kanna-code 0.18.0 → 0.20.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-Cdjl9mRd.js +606 -0
- package/dist/client/assets/index-D6aACRxb.css +32 -0
- package/dist/client/chat-sounds/Blow.mp3 +0 -0
- package/dist/client/chat-sounds/Bottle.mp3 +0 -0
- package/dist/client/chat-sounds/Frog.mp3 +0 -0
- package/dist/client/chat-sounds/Funk.mp3 +0 -0
- package/dist/client/chat-sounds/Glass.mp3 +0 -0
- package/dist/client/chat-sounds/Ping.mp3 +0 -0
- package/dist/client/chat-sounds/Pop.mp3 +0 -0
- package/dist/client/chat-sounds/Purr.mp3 +0 -0
- package/dist/client/chat-sounds/Tink.mp3 +0 -0
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/src/server/agent.test.ts +633 -2
- package/src/server/agent.ts +349 -26
- package/src/server/event-store.test.ts +65 -0
- package/src/server/event-store.ts +27 -1
- package/src/server/events.ts +8 -0
- package/src/server/generate-title.ts +42 -2
- package/src/server/quick-response.test.ts +126 -3
- package/src/server/quick-response.ts +107 -14
- package/src/server/read-models.test.ts +5 -1
- package/src/server/read-models.ts +3 -0
- package/src/server/title-generation.live.test.ts +44 -0
- package/src/server/ws-router.test.ts +186 -5
- package/src/server/ws-router.ts +26 -1
- package/src/shared/protocol.ts +2 -0
- package/src/shared/types.ts +2 -0
- package/dist/client/assets/index-BvhI1JYs.css +0 -32
- package/dist/client/assets/index-CLqK0AWC.js +0 -606
|
@@ -1,606 +0,0 @@
|
|
|
1
|
-
var hO=Object.defineProperty;var Pw=e=>{throw TypeError(e)};var fO=(e,t,n)=>t in e?hO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var hn=(e,t,n)=>fO(e,typeof t!="symbol"?t+"":t,n),Bw=(e,t,n)=>t.has(e)||Pw("Cannot "+n);var Ic=(e,t,n)=>(Bw(e,t,"read from private field"),n?n.call(e):t.get(e)),Iw=(e,t,n)=>t.has(e)?Pw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Hw=(e,t,n,r)=>(Bw(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function pO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function tp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qg={exports:{}},Hc={};/**
|
|
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 Fw;function mO(){if(Fw)return Hc;Fw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:a}}return Hc.Fragment=t,Hc.jsx=n,Hc.jsxs=n,Hc}var Uw;function gO(){return Uw||(Uw=1,Qg.exports=mO()),Qg.exports}var g=gO(),Jg={exports:{}},We={};/**
|
|
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 $w;function vO(){if($w)return We;$w=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),_=Symbol.iterator;function b(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,Z,D){this.props=I,this.context=Z,this.refs=C,this.updater=D||S}k.prototype.isReactComponent={},k.prototype.setState=function(I,Z){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,Z,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=k.prototype;function R(I,Z,D){this.props=I,this.context=Z,this.refs=C,this.updater=D||S}var M=R.prototype=new T;M.constructor=R,w(M,k.prototype),M.isPureReactComponent=!0;var L=Array.isArray;function O(){}var j={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function G(I,Z,D){var ce=D.ref;return{$$typeof:e,type:I,key:Z,ref:ce!==void 0?ce:null,props:D}}function P(I,Z){return G(I.type,Z,I.props)}function H(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function B(I){var Z={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(D){return Z[D]})}var U=/\/+/g;function $(I,Z){return typeof I=="object"&&I!==null&&I.key!=null?B(""+I.key):Z.toString(36)}function W(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(O,O):(I.status="pending",I.then(function(Z){I.status==="pending"&&(I.status="fulfilled",I.value=Z)},function(Z){I.status==="pending"&&(I.status="rejected",I.reason=Z)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function z(I,Z,D,ce,pe){var ae=typeof I;(ae==="undefined"||ae==="boolean")&&(I=null);var Q=!1;if(I===null)Q=!0;else switch(ae){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(I.$$typeof){case e:case t:Q=!0;break;case m:return Q=I._init,z(Q(I._payload),Z,D,ce,pe)}}if(Q)return pe=pe(I),Q=ce===""?"."+$(I,0):ce,L(pe)?(D="",Q!=null&&(D=Q.replace(U,"$&/")+"/"),z(pe,Z,D,"",function(de){return de})):pe!=null&&(H(pe)&&(pe=P(pe,D+(pe.key==null||I&&I.key===pe.key?"":(""+pe.key).replace(U,"$&/")+"/")+Q)),Z.push(pe)),1;Q=0;var ve=ce===""?".":ce+":";if(L(I))for(var ne=0;ne<I.length;ne++)ce=I[ne],ae=ve+$(ce,ne),Q+=z(ce,Z,D,ae,pe);else if(ne=b(I),typeof ne=="function")for(I=ne.call(I),ne=0;!(ce=I.next()).done;)ce=ce.value,ae=ve+$(ce,ne++),Q+=z(ce,Z,D,ae,pe);else if(ae==="object"){if(typeof I.then=="function")return z(W(I),Z,D,ce,pe);throw Z=String(I),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return Q}function q(I,Z,D){if(I==null)return I;var ce=[],pe=0;return z(I,ce,"","",function(ae){return Z.call(D,ae,pe++)}),ce}function V(I){if(I._status===-1){var Z=I._result;Z=Z(),Z.then(function(D){(I._status===0||I._status===-1)&&(I._status=1,I._result=D)},function(D){(I._status===0||I._status===-1)&&(I._status=2,I._result=D)}),I._status===-1&&(I._status=0,I._result=Z)}if(I._status===1)return I._result.default;throw I._result}var X=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=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(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},N={map:q,forEach:function(I,Z,D){q(I,function(){Z.apply(this,arguments)},D)},count:function(I){var Z=0;return q(I,function(){Z++}),Z},toArray:function(I){return q(I,function(Z){return Z})||[]},only:function(I){if(!H(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return We.Activity=p,We.Children=N,We.Component=k,We.Fragment=n,We.Profiler=s,We.PureComponent=R,We.StrictMode=r,We.Suspense=h,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,We.__COMPILER_RUNTIME={__proto__:null,c:function(I){return j.H.useMemoCache(I)}},We.cache=function(I){return function(){return I.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(I,Z,D){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var ce=w({},I.props),pe=I.key;if(Z!=null)for(ae in Z.key!==void 0&&(pe=""+Z.key),Z)!F.call(Z,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&Z.ref===void 0||(ce[ae]=Z[ae]);var ae=arguments.length-2;if(ae===1)ce.children=D;else if(1<ae){for(var Q=Array(ae),ve=0;ve<ae;ve++)Q[ve]=arguments[ve+2];ce.children=Q}return G(I.type,pe,ce)},We.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},We.createElement=function(I,Z,D){var ce,pe={},ae=null;if(Z!=null)for(ce in Z.key!==void 0&&(ae=""+Z.key),Z)F.call(Z,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(pe[ce]=Z[ce]);var Q=arguments.length-2;if(Q===1)pe.children=D;else if(1<Q){for(var ve=Array(Q),ne=0;ne<Q;ne++)ve[ne]=arguments[ne+2];pe.children=ve}if(I&&I.defaultProps)for(ce in Q=I.defaultProps,Q)pe[ce]===void 0&&(pe[ce]=Q[ce]);return G(I,ae,pe)},We.createRef=function(){return{current:null}},We.forwardRef=function(I){return{$$typeof:u,render:I}},We.isValidElement=H,We.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:V}},We.memo=function(I,Z){return{$$typeof:d,type:I,compare:Z===void 0?null:Z}},We.startTransition=function(I){var Z=j.T,D={};j.T=D;try{var ce=I(),pe=j.S;pe!==null&&pe(D,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(O,X)}catch(ae){X(ae)}finally{Z!==null&&D.types!==null&&(Z.types=D.types),j.T=Z}},We.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},We.use=function(I){return j.H.use(I)},We.useActionState=function(I,Z,D){return j.H.useActionState(I,Z,D)},We.useCallback=function(I,Z){return j.H.useCallback(I,Z)},We.useContext=function(I){return j.H.useContext(I)},We.useDebugValue=function(){},We.useDeferredValue=function(I,Z){return j.H.useDeferredValue(I,Z)},We.useEffect=function(I,Z){return j.H.useEffect(I,Z)},We.useEffectEvent=function(I){return j.H.useEffectEvent(I)},We.useId=function(){return j.H.useId()},We.useImperativeHandle=function(I,Z,D){return j.H.useImperativeHandle(I,Z,D)},We.useInsertionEffect=function(I,Z){return j.H.useInsertionEffect(I,Z)},We.useLayoutEffect=function(I,Z){return j.H.useLayoutEffect(I,Z)},We.useMemo=function(I,Z){return j.H.useMemo(I,Z)},We.useOptimistic=function(I,Z){return j.H.useOptimistic(I,Z)},We.useReducer=function(I,Z,D){return j.H.useReducer(I,Z,D)},We.useRef=function(I){return j.H.useRef(I)},We.useState=function(I){return j.H.useState(I)},We.useSyncExternalStore=function(I,Z,D){return j.H.useSyncExternalStore(I,Z,D)},We.useTransition=function(){return j.H.useTransition()},We.version="19.2.1",We}var Ww;function Zy(){return Ww||(Ww=1,Jg.exports=vO()),Jg.exports}var y=Zy();const Lt=tp(y),YE=pO({__proto__:null,default:Lt},[y]);var ev={exports:{}},Fc={},tv={exports:{}},nv={};/**
|
|
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 Vw;function _O(){return Vw||(Vw=1,(function(e){function t(z,q){var V=z.length;z.push(q);e:for(;0<V;){var X=V-1>>>1,N=z[X];if(0<s(N,q))z[X]=q,z[V]=N,V=X;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var q=z[0],V=z.pop();if(V!==q){z[0]=V;e:for(var X=0,N=z.length,I=N>>>1;X<I;){var Z=2*(X+1)-1,D=z[Z],ce=Z+1,pe=z[ce];if(0>s(D,V))ce<N&&0>s(pe,D)?(z[X]=pe,z[ce]=V,X=ce):(z[X]=D,z[Z]=V,X=Z);else if(ce<N&&0>s(pe,V))z[X]=pe,z[ce]=V,X=ce;else break e}}return q}function s(z,q){var V=z.sortIndex-q.sortIndex;return V!==0?V:z.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var h=[],d=[],m=1,p=null,_=3,b=!1,S=!1,w=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function M(z){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=z)r(d),q.sortIndex=q.expirationTime,t(h,q);else break;q=n(d)}}function L(z){if(w=!1,M(z),!S)if(n(h)!==null)S=!0,O||(O=!0,B());else{var q=n(d);q!==null&&W(L,q.startTime-z)}}var O=!1,j=-1,F=5,G=-1;function P(){return C?!0:!(e.unstable_now()-G<F)}function H(){if(C=!1,O){var z=e.unstable_now();G=z;var q=!0;try{e:{S=!1,w&&(w=!1,T(j),j=-1),b=!0;var V=_;try{t:{for(M(z),p=n(h);p!==null&&!(p.expirationTime>z&&P());){var X=p.callback;if(typeof X=="function"){p.callback=null,_=p.priorityLevel;var N=X(p.expirationTime<=z);if(z=e.unstable_now(),typeof N=="function"){p.callback=N,M(z),q=!0;break t}p===n(h)&&r(h),M(z)}else r(h);p=n(h)}if(p!==null)q=!0;else{var I=n(d);I!==null&&W(L,I.startTime-z),q=!1}}break e}finally{p=null,_=V,b=!1}q=void 0}}finally{q?B():O=!1}}}var B;if(typeof R=="function")B=function(){R(H)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,$=U.port2;U.port1.onmessage=H,B=function(){$.postMessage(null)}}else B=function(){k(H,0)};function W(z,q){j=k(function(){z(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(z){switch(_){case 1:case 2:case 3:var q=3;break;default:q=_}var V=_;_=q;try{return z()}finally{_=V}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var V=_;_=z;try{return q()}finally{_=V}},e.unstable_scheduleCallback=function(z,q,V){var X=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?X+V:X):V=X,z){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=V+N,z={id:m++,callback:q,priorityLevel:z,startTime:V,expirationTime:N,sortIndex:-1},V>X?(z.sortIndex=V,t(d,z),n(h)===null&&z===n(d)&&(w?(T(j),j=-1):w=!0,W(L,V-X))):(z.sortIndex=N,t(h,z),S||b||(S=!0,O||(O=!0,B()))),z},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(z){var q=_;return function(){var V=_;_=q;try{return z.apply(this,arguments)}finally{_=V}}}})(nv)),nv}var qw;function yO(){return qw||(qw=1,tv.exports=_O()),tv.exports}var rv={exports:{}},Bn={};/**
|
|
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 Kw;function bO(){if(Kw)return Bn;Kw=1;var e=Zy();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}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 a(h,d,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:h,containerInfo:d,implementation:m}}var l=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 Bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Bn.createPortal=function(h,d){var m=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 a(h,d,null,m)},Bn.flushSync=function(h){var d=l.T,m=r.p;try{if(l.T=null,r.p=2,h)return h()}finally{l.T=d,r.p=m,r.d.f()}},Bn.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))},Bn.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},Bn.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var m=d.as,p=u(m,d.crossOrigin),_=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:_,fetchPriority:b}):m==="script"&&r.d.X(h,{crossOrigin:p,integrity:_,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Bn.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=u(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:m,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)},Bn.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,p=u(m,d.crossOrigin);r.d.L(h,m,{crossOrigin:p,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})}},Bn.preloadModule=function(h,d){if(typeof h=="string")if(d){var m=u(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},Bn.requestFormReset=function(h){r.d.r(h)},Bn.unstable_batchedUpdates=function(h,d){return h(d)},Bn.useFormState=function(h,d,m){return l.H.useFormState(h,d,m)},Bn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Bn.version="19.2.1",Bn}var Gw;function XE(){if(Gw)return rv.exports;Gw=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(),rv.exports=bO(),rv.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 Yw;function xO(){if(Yw)return Fc;Yw=1;var e=yO(),t=Zy(),n=XE();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function h(i){if(a(i)!==i)throw Error(r(188))}function d(i){var o=i.alternate;if(!o){if(o=a(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,f=o;;){var 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,A=v.child;A;){if(A===c){E=!0,c=v,f=x;break}if(A===f){E=!0,f=v,c=x;break}A=A.sibling}if(!E){for(A=x.child;A;){if(A===c){E=!0,c=x,f=v;break}if(A===f){E=!0,f=x,c=v;break}A=A.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 m(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=m(i),o!==null)return o;i=i.sibling}return null}var p=Object.assign,_=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function B(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 $(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 O:return"SuspenseList";case G: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:$(i.type)||"Memo";case F:o=i._payload,i=i._init;try{return $(i(o))}catch{}}return null}var W=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},X=[],N=-1;function I(i){return{current:i}}function Z(i){0>N||(i.current=X[N],X[N]=null,N--)}function D(i,o){N++,X[N]=i.current,i.current=o}var ce=I(null),pe=I(null),ae=I(null),Q=I(null);function ve(i,o){switch(D(ae,o),D(pe,i),D(ce,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?ow(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=ow(o),i=aw(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Z(ce),D(ce,i)}function ne(){Z(ce),Z(pe),Z(ae)}function de(i){i.memoizedState!==null&&D(Q,i);var o=ce.current,c=aw(o,i.type);o!==c&&(D(pe,i),D(ce,c))}function we(i){pe.current===i&&(Z(ce),Z(pe)),Q.current===i&&(Z(Q),jc._currentValue=V)}var Ce,Re;function ze(i){if(Ce===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);Ce=o&&o[1]||"",Re=-1<c.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ce+i+Re}var yt=!1;function dt(i,o){if(!i||yt)return"";yt=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(o){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(le){var re=le}Reflect.construct(i,[],me)}else{try{me.call()}catch(le){re=le}i.call(me.prototype)}}else{try{throw Error()}catch(le){re=le}(me=i())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(le){if(le&&re&&typeof le.stack=="string")return[le.stack,re.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],A=x[1];if(E&&A){var K=E.split(`
|
|
44
|
-
`),te=A.split(`
|
|
45
|
-
`);for(v=f=0;f<K.length&&!K[f].includes("DetermineComponentFrameRoot");)f++;for(;v<te.length&&!te[v].includes("DetermineComponentFrameRoot");)v++;if(f===K.length||v===te.length)for(f=K.length-1,v=te.length-1;1<=f&&0<=v&&K[f]!==te[v];)v--;for(;1<=f&&0<=v;f--,v--)if(K[f]!==te[v]){if(f!==1||v!==1)do if(f--,v--,0>v||K[f]!==te[v]){var he=`
|
|
46
|
-
`+K[f].replace(" at new "," at ");return i.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",i.displayName)),he}while(1<=f&&0<=v);break}}}finally{yt=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?ze(c):""}function Ct(i,o){switch(i.tag){case 26:case 27:case 5:return ze(i.type);case 16:return ze("Lazy");case 13:return i.child!==o&&o!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return dt(i.type,!1);case 11:return dt(i.type.render,!1);case 1:return dt(i.type,!0);case 31:return ze("Activity");default:return""}}function tn(i){try{var o="",c=null;do o+=Ct(i,c),c=i,i=i.return;while(i);return o}catch(f){return`
|
|
47
|
-
Error generating stack: `+f.message+`
|
|
48
|
-
`+f.stack}}var _t=Object.prototype.hasOwnProperty,jt=e.unstable_scheduleCallback,be=e.unstable_cancelCallback,Be=e.unstable_shouldYield,$t=e.unstable_requestPaint,ie=e.unstable_now,ct=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,He=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,bt=e.log,Pn=e.unstable_setDisableYieldValue,oe=null,Me=null;function Xe(i){if(typeof bt=="function"&&Pn(i),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(oe,i)}catch{}}var $e=Math.clz32?Math.clz32:Mr,Dt=Math.log,Wt=Math.LN2;function Mr(i){return i>>>=0,i===0?32:31-(Dt(i)/Wt|0)|0}var hr=256,Jn=262144,xt=4194304;function It(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 se(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 A=f&134217727;return A!==0?(f=A&~x,f!==0?v=It(f):(E&=A,E!==0?v=It(E):c||(c=A&~i,c!==0&&(v=It(c))))):(A=f&~x,A!==0?v=It(A):E!==0?v=It(E):c||(c=f&~i,c!==0&&(v=It(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 xe(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Ve(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 et(){var i=xt;return xt<<=1,(xt&62914560)===0&&(xt=4194304),i}function ht(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function fr(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function un(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 A=i.entanglements,K=i.expirationTimes,te=i.hiddenUpdates;for(c=E&~c;0<c;){var he=31-$e(c),me=1<<he;A[he]=0,K[he]=-1;var re=te[he];if(re!==null)for(te[he]=null,he=0;he<re.length;he++){var le=re[he];le!==null&&(le.lane&=-536870913)}c&=~me}f!==0&&Qr(i,f,0),x!==0&&v===0&&i.tag!==0&&(i.suspendedLanes|=x&~(E&~o))}function Qr(i,o,c){i.pendingLanes|=o,i.suspendedLanes&=~o;var f=31-$e(o);i.entangledLanes|=o,i.entanglements[f]=i.entanglements[f]|1073741824|c&261930}function pr(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var f=31-$e(c),v=1<<f;v&o|i[f]&o&&(i[f]|=o),c&=~v}}function Nr(i,o){var c=o&-o;return c=(c&42)!==0?1:Pi(c),(c&(i.suspendedLanes|o))!==0?0:c}function Pi(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 Bi(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Jr(){var i=q.p;return i!==0?i:(i=window.event,i===void 0?32:Nw(i.type))}function Ss(i,o){var c=q.p;try{return q.p=i,o()}finally{q.p=c}}var Ar=Math.random().toString(36).slice(2),Mn="__reactFiber$"+Ar,er="__reactProps$"+Ar,ga="__reactContainer$"+Ar,$p="__reactEvents$"+Ar,t3="__reactListeners$"+Ar,n3="__reactHandles$"+Ar,K0="__reactResources$"+Ar,Xl="__reactMarker$"+Ar;function Wp(i){delete i[Mn],delete i[er],delete i[$p],delete i[t3],delete i[n3]}function va(i){var o=i[Mn];if(o)return o;for(var c=i.parentNode;c;){if(o=c[ga]||c[Mn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=pw(i);i!==null;){if(c=i[Mn])return c;i=pw(i)}return o}i=c,c=i.parentNode}return null}function _a(i){if(i=i[Mn]||i[ga]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Zl(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function ya(i){var o=i[K0];return o||(o=i[K0]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function _n(i){i[Xl]=!0}var G0=new Set,Y0={};function bo(i,o){ba(i,o),ba(i+"Capture",o)}function ba(i,o){for(Y0[i]=o,i=0;i<o.length;i++)G0.add(o[i])}var r3=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]*$"),X0={},Z0={};function i3(i){return _t.call(Z0,i)?!0:_t.call(X0,i)?!1:r3.test(i)?Z0[i]=!0:(X0[i]=!0,!1)}function ud(i,o,c){if(i3(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 dd(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 Ii(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 Dr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Q0(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function s3(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 Vp(i){if(!i._valueTracker){var o=Q0(i)?"checked":"value";i._valueTracker=s3(i,o,""+i[o])}}function J0(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),f="";return i&&(f=Q0(i)?i.checked?"true":"false":i.value),i=f,i!==c?(o.setValue(i),!0):!1}function hd(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 o3=/[\n"\\]/g;function Or(i){return i.replace(o3,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function qp(i,o,c,f,v,x,E,A){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=""+Dr(o)):i.value!==""+Dr(o)&&(i.value=""+Dr(o)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),o!=null?Kp(i,E,Dr(o)):c!=null?Kp(i,E,Dr(c)):f!=null&&i.removeAttribute("value"),v==null&&x!=null&&(i.defaultChecked=!!x),v!=null&&(i.checked=v&&typeof v!="function"&&typeof v!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?i.name=""+Dr(A):i.removeAttribute("name")}function ex(i,o,c,f,v,x,E,A){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)){Vp(i);return}c=c!=null?""+Dr(c):"",o=o!=null?""+Dr(o):c,A||o===i.value||(i.value=o),i.defaultValue=o}f=f??v,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=A?i.checked:!!f,i.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),Vp(i)}function Kp(i,o,c){o==="number"&&hd(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function xa(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=""+Dr(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 tx(i,o,c){if(o!=null&&(o=""+Dr(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+Dr(c):""}function nx(i,o,c,f){if(o==null){if(f!=null){if(c!=null)throw Error(r(92));if(W(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),o=c}c=Dr(o),i.defaultValue=c,f=i.textContent,f===c&&f!==""&&f!==null&&(i.value=f),Vp(i)}function Sa(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var a3=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 rx(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||a3.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function ix(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&&rx(i,v,f)}else for(var x in o)o.hasOwnProperty(x)&&rx(i,x,o[x])}function Gp(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 l3=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"]]),c3=/^[\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 fd(i){return c3.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Hi(){}var Yp=null;function Xp(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var wa=null,Ca=null;function sx(i){var o=_a(i);if(o&&(i=o.stateNode)){var c=i[er]||null;e:switch(i=o.stateNode,o.type){case"input":if(qp(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="'+Or(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var f=c[o];if(f!==i&&f.form===i.form){var v=f[er]||null;if(!v)throw Error(r(90));qp(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&&J0(f)}break e;case"textarea":tx(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&xa(i,!!c.multiple,o,!1)}}}var Zp=!1;function ox(i,o,c){if(Zp)return i(o,c);Zp=!0;try{var f=i(o);return f}finally{if(Zp=!1,(wa!==null||Ca!==null)&&(eh(),wa&&(o=wa,i=Ca,Ca=wa=null,sx(o),i)))for(o=0;o<i.length;o++)sx(i[o])}}function Ql(i,o){var c=i.stateNode;if(c===null)return null;var f=c[er]||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 Fi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qp=!1;if(Fi)try{var Jl={};Object.defineProperty(Jl,"passive",{get:function(){Qp=!0}}),window.addEventListener("test",Jl,Jl),window.removeEventListener("test",Jl,Jl)}catch{Qp=!1}var ws=null,Jp=null,pd=null;function ax(){if(pd)return pd;var i,o=Jp,c=o.length,f,v="value"in ws?ws.value:ws.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 pd=v.slice(i,1<f?1-f:void 0)}function md(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 gd(){return!0}function lx(){return!1}function tr(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 A in i)i.hasOwnProperty(A)&&(c=i[A],this[A]=c?c(x):x[A]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?gd:lx,this.isPropagationStopped=lx,this}return p(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=gd)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=gd)},persist:function(){},isPersistent:gd}),o}var xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vd=tr(xo),ec=p({},xo,{view:0,detail:0}),u3=tr(ec),em,tm,tc,_d=p({},ec,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rm,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!==tc&&(tc&&i.type==="mousemove"?(em=i.screenX-tc.screenX,tm=i.screenY-tc.screenY):tm=em=0,tc=i),em)},movementY:function(i){return"movementY"in i?i.movementY:tm}}),cx=tr(_d),d3=p({},_d,{dataTransfer:0}),h3=tr(d3),f3=p({},ec,{relatedTarget:0}),nm=tr(f3),p3=p({},xo,{animationName:0,elapsedTime:0,pseudoElement:0}),m3=tr(p3),g3=p({},xo,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),v3=tr(g3),_3=p({},xo,{data:0}),ux=tr(_3),y3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},b3={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"},x3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function S3(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=x3[i])?!!o[i]:!1}function rm(){return S3}var w3=p({},ec,{key:function(i){if(i.key){var o=y3[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=md(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?b3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rm,charCode:function(i){return i.type==="keypress"?md(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?md(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),C3=tr(w3),k3=p({},_d,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dx=tr(k3),E3=p({},ec,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rm}),R3=tr(E3),T3=p({},xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),M3=tr(T3),N3=p({},_d,{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}),A3=tr(N3),D3=p({},xo,{newState:0,oldState:0}),O3=tr(D3),L3=[9,13,27,32],im=Fi&&"CompositionEvent"in window,nc=null;Fi&&"documentMode"in document&&(nc=document.documentMode);var j3=Fi&&"TextEvent"in window&&!nc,hx=Fi&&(!im||nc&&8<nc&&11>=nc),fx=" ",px=!1;function mx(i,o){switch(i){case"keyup":return L3.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gx(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ka=!1;function z3(i,o){switch(i){case"compositionend":return gx(o);case"keypress":return o.which!==32?null:(px=!0,fx);case"textInput":return i=o.data,i===fx&&px?null:i;default:return null}}function P3(i,o){if(ka)return i==="compositionend"||!im&&mx(i,o)?(i=ax(),pd=Jp=ws=null,ka=!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 hx&&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 vx(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!B3[i.type]:o==="textarea"}function _x(i,o,c,f){wa?Ca?Ca.push(f):Ca=[f]:wa=f,o=ah(o,"onChange"),0<o.length&&(c=new vd("onChange","change",null,c,f),i.push({event:c,listeners:o}))}var rc=null,ic=null;function I3(i){ew(i,0)}function yd(i){var o=Zl(i);if(J0(o))return i}function yx(i,o){if(i==="change")return o}var bx=!1;if(Fi){var sm;if(Fi){var om="oninput"in document;if(!om){var xx=document.createElement("div");xx.setAttribute("oninput","return;"),om=typeof xx.oninput=="function"}sm=om}else sm=!1;bx=sm&&(!document.documentMode||9<document.documentMode)}function Sx(){rc&&(rc.detachEvent("onpropertychange",wx),ic=rc=null)}function wx(i){if(i.propertyName==="value"&&yd(ic)){var o=[];_x(o,ic,i,Xp(i)),ox(I3,o)}}function H3(i,o,c){i==="focusin"?(Sx(),rc=o,ic=c,rc.attachEvent("onpropertychange",wx)):i==="focusout"&&Sx()}function F3(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return yd(ic)}function U3(i,o){if(i==="click")return yd(o)}function $3(i,o){if(i==="input"||i==="change")return yd(o)}function W3(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var mr=typeof Object.is=="function"?Object.is:W3;function sc(i,o){if(mr(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(!_t.call(o,v)||!mr(i[v],o[v]))return!1}return!0}function Cx(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function kx(i,o){var c=Cx(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=Cx(c)}}function Ex(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Ex(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Rx(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=hd(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=hd(i.document)}return o}function am(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 V3=Fi&&"documentMode"in document&&11>=document.documentMode,Ea=null,lm=null,oc=null,cm=!1;function Tx(i,o,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;cm||Ea==null||Ea!==hd(f)||(f=Ea,"selectionStart"in f&&am(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}),oc&&sc(oc,f)||(oc=f,f=ah(lm,"onSelect"),0<f.length&&(o=new vd("onSelect","select",null,o,c),i.push({event:o,listeners:f}),o.target=Ea)))}function So(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var Ra={animationend:So("Animation","AnimationEnd"),animationiteration:So("Animation","AnimationIteration"),animationstart:So("Animation","AnimationStart"),transitionrun:So("Transition","TransitionRun"),transitionstart:So("Transition","TransitionStart"),transitioncancel:So("Transition","TransitionCancel"),transitionend:So("Transition","TransitionEnd")},um={},Mx={};Fi&&(Mx=document.createElement("div").style,"AnimationEvent"in window||(delete Ra.animationend.animation,delete Ra.animationiteration.animation,delete Ra.animationstart.animation),"TransitionEvent"in window||delete Ra.transitionend.transition);function wo(i){if(um[i])return um[i];if(!Ra[i])return i;var o=Ra[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in Mx)return um[i]=o[c];return i}var Nx=wo("animationend"),Ax=wo("animationiteration"),Dx=wo("animationstart"),q3=wo("transitionrun"),K3=wo("transitionstart"),G3=wo("transitioncancel"),Ox=wo("transitionend"),Lx=new Map,dm="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(" ");dm.push("scrollEnd");function ei(i,o){Lx.set(i,o),bo(o,[i])}var bd=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)},Lr=[],Ta=0,hm=0;function xd(){for(var i=Ta,o=hm=Ta=0;o<i;){var c=Lr[o];Lr[o++]=null;var f=Lr[o];Lr[o++]=null;var v=Lr[o];Lr[o++]=null;var x=Lr[o];if(Lr[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&&jx(c,v,x)}}function Sd(i,o,c,f){Lr[Ta++]=i,Lr[Ta++]=o,Lr[Ta++]=c,Lr[Ta++]=f,hm|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function fm(i,o,c,f){return Sd(i,o,c,f),wd(i)}function Co(i,o){return Sd(i,null,null,o),wd(i)}function jx(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-$e(c),i=x.hiddenUpdates,f=i[v],f===null?i[v]=[o]:f.push(o),o.lane=c|536870912),x):null}function wd(i){if(50<Tc)throw Tc=0,Sg=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var Ma={};function Y3(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 gr(i,o,c,f){return new Y3(i,o,c,f)}function pm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ui(i,o){var c=i.alternate;return c===null?(c=gr(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 zx(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 Cd(i,o,c,f,v,x){var E=0;if(f=i,typeof i=="function")pm(i)&&(E=1);else if(typeof i=="string")E=eO(i,c,ce.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case G:return i=gr(31,c,o,v),i.elementType=G,i.lanes=x,i;case w:return ko(c.children,v,x,o);case C:E=8,v|=24;break;case k:return i=gr(12,c,o,v|2),i.elementType=k,i.lanes=x,i;case L:return i=gr(13,c,o,v),i.elementType=L,i.lanes=x,i;case O:return i=gr(19,c,o,v),i.elementType=O,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=gr(E,c,o,v),o.elementType=i,o.type=f,o.lanes=x,o}function ko(i,o,c,f){return i=gr(7,i,f,o),i.lanes=c,i}function mm(i,o,c){return i=gr(6,i,null,o),i.lanes=c,i}function Px(i){var o=gr(18,null,null,0);return o.stateNode=i,o}function gm(i,o,c){return o=gr(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var Bx=new WeakMap;function jr(i,o){if(typeof i=="object"&&i!==null){var c=Bx.get(i);return c!==void 0?c:(o={value:i,source:o,stack:tn(o)},Bx.set(i,o),o)}return{value:i,source:o,stack:tn(o)}}var Na=[],Aa=0,kd=null,ac=0,zr=[],Pr=0,Cs=null,mi=1,gi="";function $i(i,o){Na[Aa++]=ac,Na[Aa++]=kd,kd=i,ac=o}function Ix(i,o,c){zr[Pr++]=mi,zr[Pr++]=gi,zr[Pr++]=Cs,Cs=i;var f=mi;i=gi;var v=32-$e(f)-1;f&=~(1<<v),c+=1;var x=32-$e(o)+v;if(30<x){var E=v-v%5;x=(f&(1<<E)-1).toString(32),f>>=E,v-=E,mi=1<<32-$e(o)+v|c<<v|f,gi=x+i}else mi=1<<x|c<<v|f,gi=i}function vm(i){i.return!==null&&($i(i,1),Ix(i,1,0))}function _m(i){for(;i===kd;)kd=Na[--Aa],Na[Aa]=null,ac=Na[--Aa],Na[Aa]=null;for(;i===Cs;)Cs=zr[--Pr],zr[Pr]=null,gi=zr[--Pr],zr[Pr]=null,mi=zr[--Pr],zr[Pr]=null}function Hx(i,o){zr[Pr++]=mi,zr[Pr++]=gi,zr[Pr++]=Cs,mi=o.id,gi=o.overflow,Cs=i}var Nn=null,zt=null,lt=!1,ks=null,Br=!1,ym=Error(r(519));function Es(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lc(jr(o,i)),ym}function Fx(i){var o=i.stateNode,c=i.type,f=i.memoizedProps;switch(o[Mn]=i,o[er]=f,c){case"dialog":rt("cancel",o),rt("close",o);break;case"iframe":case"object":case"embed":rt("load",o);break;case"video":case"audio":for(c=0;c<Nc.length;c++)rt(Nc[c],o);break;case"source":rt("error",o);break;case"img":case"image":case"link":rt("error",o),rt("load",o);break;case"details":rt("toggle",o);break;case"input":rt("invalid",o),ex(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":rt("invalid",o);break;case"textarea":rt("invalid",o),nx(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||iw(o.textContent,c)?(f.popover!=null&&(rt("beforetoggle",o),rt("toggle",o)),f.onScroll!=null&&rt("scroll",o),f.onScrollEnd!=null&&rt("scrollend",o),f.onClick!=null&&(o.onclick=Hi),o=!0):o=!1,o||Es(i,!0)}function Ux(i){for(Nn=i.return;Nn;)switch(Nn.tag){case 5:case 31:case 13:Br=!1;return;case 27:case 3:Br=!0;return;default:Nn=Nn.return}}function Da(i){if(i!==Nn)return!1;if(!lt)return Ux(i),lt=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||Pg(i.type,i.memoizedProps)),c=!c),c&&zt&&Es(i),Ux(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));zt=fw(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));zt=fw(i)}else o===27?(o=zt,Hs(i.type)?(i=Ug,Ug=null,zt=i):zt=o):zt=Nn?Hr(i.stateNode.nextSibling):null;return!0}function Eo(){zt=Nn=null,lt=!1}function bm(){var i=ks;return i!==null&&(sr===null?sr=i:sr.push.apply(sr,i),ks=null),i}function lc(i){ks===null?ks=[i]:ks.push(i)}var xm=I(null),Ro=null,Wi=null;function Rs(i,o,c){D(xm,o._currentValue),o._currentValue=c}function Vi(i){i._currentValue=xm.current,Z(xm)}function Sm(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 wm(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 A=x;x=v;for(var K=0;K<o.length;K++)if(A.context===o[K]){x.lanes|=c,A=x.alternate,A!==null&&(A.lanes|=c),Sm(x.return,c,i),f||(E=null);break e}x=A.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),Sm(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 Oa(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 A=v.type;mr(v.pendingProps.value,E.value)||(i!==null?i.push(A):i=[A])}}else if(v===Q.current){if(E=v.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(i!==null?i.push(jc):i=[jc])}v=v.return}i!==null&&wm(o,i,c,f),o.flags|=262144}function Ed(i){for(i=i.firstContext;i!==null;){if(!mr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function To(i){Ro=i,Wi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function An(i){return $x(Ro,i)}function Rd(i,o){return Ro===null&&To(i),$x(i,o)}function $x(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},Wi===null){if(i===null)throw Error(r(308));Wi=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else Wi=Wi.next=o;return c}var X3=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()})}},Z3=e.unstable_scheduleCallback,Q3=e.unstable_NormalPriority,nn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cm(){return{controller:new X3,data:new Map,refCount:0}}function cc(i){i.refCount--,i.refCount===0&&Z3(Q3,function(){i.controller.abort()})}var uc=null,km=0,La=0,ja=null;function J3(i,o){if(uc===null){var c=uc=[];km=0,La=Tg(),ja={status:"pending",value:void 0,then:function(f){c.push(f)}}}return km++,o.then(Wx,Wx),o}function Wx(){if(--km===0&&uc!==null){ja!==null&&(ja.status="fulfilled");var i=uc;uc=null,La=0,ja=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function e4(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 Vx=z.S;z.S=function(i,o){TS=ie(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&J3(i,o),Vx!==null&&Vx(i,o)};var Mo=I(null);function Em(){var i=Mo.current;return i!==null?i:Nt.pooledCache}function Td(i,o){o===null?D(Mo,Mo.current):D(Mo,o.pool)}function qx(){var i=Em();return i===null?null:{parent:nn._currentValue,pool:i}}var za=Error(r(460)),Rm=Error(r(474)),Md=Error(r(542)),Nd={then:function(){}};function Kx(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Gx(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Hi,Hi),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Xx(i),i;default:if(typeof o.status=="string")o.then(Hi,Hi);else{if(i=Nt,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,Xx(i),i}throw Ao=o,za}}function No(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ao=c,za):c}}var Ao=null;function Yx(){if(Ao===null)throw Error(r(459));var i=Ao;return Ao=null,i}function Xx(i){if(i===za||i===Md)throw Error(r(483))}var Pa=null,dc=0;function Ad(i){var o=dc;return dc+=1,Pa===null&&(Pa=[]),Gx(Pa,i,o)}function hc(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Dd(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 Zx(i){function o(J,Y){if(i){var ee=J.deletions;ee===null?(J.deletions=[Y],J.flags|=16):ee.push(Y)}}function c(J,Y){if(!i)return null;for(;Y!==null;)o(J,Y),Y=Y.sibling;return null}function f(J){for(var Y=new Map;J!==null;)J.key!==null?Y.set(J.key,J):Y.set(J.index,J),J=J.sibling;return Y}function v(J,Y){return J=Ui(J,Y),J.index=0,J.sibling=null,J}function x(J,Y,ee){return J.index=ee,i?(ee=J.alternate,ee!==null?(ee=ee.index,ee<Y?(J.flags|=67108866,Y):ee):(J.flags|=67108866,Y)):(J.flags|=1048576,Y)}function E(J){return i&&J.alternate===null&&(J.flags|=67108866),J}function A(J,Y,ee,fe){return Y===null||Y.tag!==6?(Y=mm(ee,J.mode,fe),Y.return=J,Y):(Y=v(Y,ee),Y.return=J,Y)}function K(J,Y,ee,fe){var Pe=ee.type;return Pe===w?he(J,Y,ee.props.children,fe,ee.key):Y!==null&&(Y.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===F&&No(Pe)===Y.type)?(Y=v(Y,ee.props),hc(Y,ee),Y.return=J,Y):(Y=Cd(ee.type,ee.key,ee.props,null,J.mode,fe),hc(Y,ee),Y.return=J,Y)}function te(J,Y,ee,fe){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ee.containerInfo||Y.stateNode.implementation!==ee.implementation?(Y=gm(ee,J.mode,fe),Y.return=J,Y):(Y=v(Y,ee.children||[]),Y.return=J,Y)}function he(J,Y,ee,fe,Pe){return Y===null||Y.tag!==7?(Y=ko(ee,J.mode,fe,Pe),Y.return=J,Y):(Y=v(Y,ee),Y.return=J,Y)}function me(J,Y,ee){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=mm(""+Y,J.mode,ee),Y.return=J,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:return ee=Cd(Y.type,Y.key,Y.props,null,J.mode,ee),hc(ee,Y),ee.return=J,ee;case S:return Y=gm(Y,J.mode,ee),Y.return=J,Y;case F:return Y=No(Y),me(J,Y,ee)}if(W(Y)||B(Y))return Y=ko(Y,J.mode,ee,null),Y.return=J,Y;if(typeof Y.then=="function")return me(J,Ad(Y),ee);if(Y.$$typeof===R)return me(J,Rd(J,Y),ee);Dd(J,Y)}return null}function re(J,Y,ee,fe){var Pe=Y!==null?Y.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Pe!==null?null:A(J,Y,""+ee,fe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===Pe?K(J,Y,ee,fe):null;case S:return ee.key===Pe?te(J,Y,ee,fe):null;case F:return ee=No(ee),re(J,Y,ee,fe)}if(W(ee)||B(ee))return Pe!==null?null:he(J,Y,ee,fe,null);if(typeof ee.then=="function")return re(J,Y,Ad(ee),fe);if(ee.$$typeof===R)return re(J,Y,Rd(J,ee),fe);Dd(J,ee)}return null}function le(J,Y,ee,fe,Pe){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return J=J.get(ee)||null,A(Y,J,""+fe,Pe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case b:return J=J.get(fe.key===null?ee:fe.key)||null,K(Y,J,fe,Pe);case S:return J=J.get(fe.key===null?ee:fe.key)||null,te(Y,J,fe,Pe);case F:return fe=No(fe),le(J,Y,ee,fe,Pe)}if(W(fe)||B(fe))return J=J.get(ee)||null,he(Y,J,fe,Pe,null);if(typeof fe.then=="function")return le(J,Y,ee,Ad(fe),Pe);if(fe.$$typeof===R)return le(J,Y,ee,Rd(Y,fe),Pe);Dd(Y,fe)}return null}function Ae(J,Y,ee,fe){for(var Pe=null,ft=null,je=Y,Ke=Y=0,at=null;je!==null&&Ke<ee.length;Ke++){je.index>Ke?(at=je,je=null):at=je.sibling;var pt=re(J,je,ee[Ke],fe);if(pt===null){je===null&&(je=at);break}i&&je&&pt.alternate===null&&o(J,je),Y=x(pt,Y,Ke),ft===null?Pe=pt:ft.sibling=pt,ft=pt,je=at}if(Ke===ee.length)return c(J,je),lt&&$i(J,Ke),Pe;if(je===null){for(;Ke<ee.length;Ke++)je=me(J,ee[Ke],fe),je!==null&&(Y=x(je,Y,Ke),ft===null?Pe=je:ft.sibling=je,ft=je);return lt&&$i(J,Ke),Pe}for(je=f(je);Ke<ee.length;Ke++)at=le(je,J,Ke,ee[Ke],fe),at!==null&&(i&&at.alternate!==null&&je.delete(at.key===null?Ke:at.key),Y=x(at,Y,Ke),ft===null?Pe=at:ft.sibling=at,ft=at);return i&&je.forEach(function(Vs){return o(J,Vs)}),lt&&$i(J,Ke),Pe}function Fe(J,Y,ee,fe){if(ee==null)throw Error(r(151));for(var Pe=null,ft=null,je=Y,Ke=Y=0,at=null,pt=ee.next();je!==null&&!pt.done;Ke++,pt=ee.next()){je.index>Ke?(at=je,je=null):at=je.sibling;var Vs=re(J,je,pt.value,fe);if(Vs===null){je===null&&(je=at);break}i&&je&&Vs.alternate===null&&o(J,je),Y=x(Vs,Y,Ke),ft===null?Pe=Vs:ft.sibling=Vs,ft=Vs,je=at}if(pt.done)return c(J,je),lt&&$i(J,Ke),Pe;if(je===null){for(;!pt.done;Ke++,pt=ee.next())pt=me(J,pt.value,fe),pt!==null&&(Y=x(pt,Y,Ke),ft===null?Pe=pt:ft.sibling=pt,ft=pt);return lt&&$i(J,Ke),Pe}for(je=f(je);!pt.done;Ke++,pt=ee.next())pt=le(je,J,Ke,pt.value,fe),pt!==null&&(i&&pt.alternate!==null&&je.delete(pt.key===null?Ke:pt.key),Y=x(pt,Y,Ke),ft===null?Pe=pt:ft.sibling=pt,ft=pt);return i&&je.forEach(function(dO){return o(J,dO)}),lt&&$i(J,Ke),Pe}function Rt(J,Y,ee,fe){if(typeof ee=="object"&&ee!==null&&ee.type===w&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var Pe=ee.key;Y!==null;){if(Y.key===Pe){if(Pe=ee.type,Pe===w){if(Y.tag===7){c(J,Y.sibling),fe=v(Y,ee.props.children),fe.return=J,J=fe;break e}}else if(Y.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===F&&No(Pe)===Y.type){c(J,Y.sibling),fe=v(Y,ee.props),hc(fe,ee),fe.return=J,J=fe;break e}c(J,Y);break}else o(J,Y);Y=Y.sibling}ee.type===w?(fe=ko(ee.props.children,J.mode,fe,ee.key),fe.return=J,J=fe):(fe=Cd(ee.type,ee.key,ee.props,null,J.mode,fe),hc(fe,ee),fe.return=J,J=fe)}return E(J);case S:e:{for(Pe=ee.key;Y!==null;){if(Y.key===Pe)if(Y.tag===4&&Y.stateNode.containerInfo===ee.containerInfo&&Y.stateNode.implementation===ee.implementation){c(J,Y.sibling),fe=v(Y,ee.children||[]),fe.return=J,J=fe;break e}else{c(J,Y);break}else o(J,Y);Y=Y.sibling}fe=gm(ee,J.mode,fe),fe.return=J,J=fe}return E(J);case F:return ee=No(ee),Rt(J,Y,ee,fe)}if(W(ee))return Ae(J,Y,ee,fe);if(B(ee)){if(Pe=B(ee),typeof Pe!="function")throw Error(r(150));return ee=Pe.call(ee),Fe(J,Y,ee,fe)}if(typeof ee.then=="function")return Rt(J,Y,Ad(ee),fe);if(ee.$$typeof===R)return Rt(J,Y,Rd(J,ee),fe);Dd(J,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,Y!==null&&Y.tag===6?(c(J,Y.sibling),fe=v(Y,ee),fe.return=J,J=fe):(c(J,Y),fe=mm(ee,J.mode,fe),fe.return=J,J=fe),E(J)):c(J,Y)}return function(J,Y,ee,fe){try{dc=0;var Pe=Rt(J,Y,ee,fe);return Pa=null,Pe}catch(je){if(je===za||je===Md)throw je;var ft=gr(29,je,null,J.mode);return ft.lanes=fe,ft.return=J,ft}finally{}}}var Do=Zx(!0),Qx=Zx(!1),Ts=!1;function Tm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mm(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 Ms(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ns(i,o,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(mt&2)!==0){var v=f.pending;return v===null?o.next=o:(o.next=v.next,v.next=o),f.pending=o,o=wd(i),jx(i,null,c),o}return Sd(i,f,o,c),wd(i)}function fc(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,pr(i,c)}}function Nm(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 Am=!1;function pc(){if(Am){var i=ja;if(i!==null)throw i}}function mc(i,o,c,f){Am=!1;var v=i.updateQueue;Ts=!1;var x=v.firstBaseUpdate,E=v.lastBaseUpdate,A=v.shared.pending;if(A!==null){v.shared.pending=null;var K=A,te=K.next;K.next=null,E===null?x=te:E.next=te,E=K;var he=i.alternate;he!==null&&(he=he.updateQueue,A=he.lastBaseUpdate,A!==E&&(A===null?he.firstBaseUpdate=te:A.next=te,he.lastBaseUpdate=K))}if(x!==null){var me=v.baseState;E=0,he=te=K=null,A=x;do{var re=A.lane&-536870913,le=re!==A.lane;if(le?(ot&re)===re:(f&re)===re){re!==0&&re===La&&(Am=!0),he!==null&&(he=he.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Ae=i,Fe=A;re=o;var Rt=c;switch(Fe.tag){case 1:if(Ae=Fe.payload,typeof Ae=="function"){me=Ae.call(Rt,me,re);break e}me=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Fe.payload,re=typeof Ae=="function"?Ae.call(Rt,me,re):Ae,re==null)break e;me=p({},me,re);break e;case 2:Ts=!0}}re=A.callback,re!==null&&(i.flags|=64,le&&(i.flags|=8192),le=v.callbacks,le===null?v.callbacks=[re]:le.push(re))}else le={lane:re,tag:A.tag,payload:A.payload,callback:A.callback,next:null},he===null?(te=he=le,K=me):he=he.next=le,E|=re;if(A=A.next,A===null){if(A=v.shared.pending,A===null)break;le=A,A=le.next,le.next=null,v.lastBaseUpdate=le,v.shared.pending=null}}while(!0);he===null&&(K=me),v.baseState=K,v.firstBaseUpdate=te,v.lastBaseUpdate=he,x===null&&(v.shared.lanes=0),js|=E,i.lanes=E,i.memoizedState=me}}function Jx(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function e1(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)Jx(c[i],o)}var Ba=I(null),Od=I(0);function t1(i,o){i=es,D(Od,i),D(Ba,o),es=i|o.baseLanes}function Dm(){D(Od,es),D(Ba,Ba.current)}function Om(){es=Od.current,Z(Ba),Z(Od)}var vr=I(null),Ir=null;function As(i){var o=i.alternate;D(Qt,Qt.current&1),D(vr,i),Ir===null&&(o===null||Ba.current!==null||o.memoizedState!==null)&&(Ir=i)}function Lm(i){D(Qt,Qt.current),D(vr,i),Ir===null&&(Ir=i)}function n1(i){i.tag===22?(D(Qt,Qt.current),D(vr,i),Ir===null&&(Ir=i)):Ds()}function Ds(){D(Qt,Qt.current),D(vr,vr.current)}function _r(i){Z(vr),Ir===i&&(Ir=null),Z(Qt)}var Qt=I(0);function Ld(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Hg(c)||Fg(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 qi=0,qe=null,kt=null,rn=null,jd=!1,Ia=!1,Oo=!1,zd=0,gc=0,Ha=null,t4=0;function Kt(){throw Error(r(321))}function jm(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!mr(i[c],o[c]))return!1;return!0}function zm(i,o,c,f,v,x){return qi=x,qe=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,z.H=i===null||i.memoizedState===null?I1:Zm,Oo=!1,x=c(f,v),Oo=!1,Ia&&(x=i1(o,c,f,v)),r1(i),x}function r1(i){z.H=yc;var o=kt!==null&&kt.next!==null;if(qi=0,rn=kt=qe=null,jd=!1,gc=0,Ha=null,o)throw Error(r(300));i===null||sn||(i=i.dependencies,i!==null&&Ed(i)&&(sn=!0))}function i1(i,o,c,f){qe=i;var v=0;do{if(Ia&&(Ha=null),gc=0,Ia=!1,25<=v)throw Error(r(301));if(v+=1,rn=kt=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}z.H=H1,x=o(c,f)}while(Ia);return x}function n4(){var i=z.H,o=i.useState()[0];return o=typeof o.then=="function"?vc(o):o,i=i.useState()[0],(kt!==null?kt.memoizedState:null)!==i&&(qe.flags|=1024),o}function Pm(){var i=zd!==0;return zd=0,i}function Bm(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function Im(i){if(jd){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}jd=!1}qi=0,rn=kt=qe=null,Ia=!1,gc=zd=0,Ha=null}function Wn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?qe.memoizedState=rn=i:rn=rn.next=i,rn}function Jt(){if(kt===null){var i=qe.alternate;i=i!==null?i.memoizedState:null}else i=kt.next;var o=rn===null?qe.memoizedState:rn.next;if(o!==null)rn=o,kt=i;else{if(i===null)throw qe.alternate===null?Error(r(467)):Error(r(310));kt=i,i={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},rn===null?qe.memoizedState=rn=i:rn=rn.next=i}return rn}function Pd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vc(i){var o=gc;return gc+=1,Ha===null&&(Ha=[]),i=Gx(Ha,i,o),o=qe,(rn===null?o.memoizedState:rn.next)===null&&(o=o.alternate,z.H=o===null||o.memoizedState===null?I1:Zm),i}function Bd(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return vc(i);if(i.$$typeof===R)return An(i)}throw Error(r(438,String(i)))}function Hm(i){var o=null,c=qe.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var f=qe.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=Pd(),qe.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(i),f=0;f<i;f++)c[f]=P;return o.index++,c}function Ki(i,o){return typeof o=="function"?o(i):o}function Id(i){var o=Jt();return Fm(o,kt,i)}function Fm(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 A=E=null,K=null,te=o,he=!1;do{var me=te.lane&-536870913;if(me!==te.lane?(ot&me)===me:(qi&me)===me){var re=te.revertLane;if(re===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),me===La&&(he=!0);else if((qi&re)===re){te=te.next,re===La&&(he=!0);continue}else me={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},K===null?(A=K=me,E=x):K=K.next=me,qe.lanes|=re,js|=re;me=te.action,Oo&&c(x,me),x=te.hasEagerState?te.eagerState:c(x,me)}else re={lane:me,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},K===null?(A=K=re,E=x):K=K.next=re,qe.lanes|=me,js|=me;te=te.next}while(te!==null&&te!==o);if(K===null?E=x:K.next=A,!mr(x,i.memoizedState)&&(sn=!0,he&&(c=ja,c!==null)))throw c;i.memoizedState=x,i.baseState=E,i.baseQueue=K,f.lastRenderedState=x}return v===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function Um(i){var o=Jt(),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);mr(x,o.memoizedState)||(sn=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),c.lastRenderedState=x}return[x,f]}function s1(i,o,c){var f=qe,v=Jt(),x=lt;if(x){if(c===void 0)throw Error(r(407));c=c()}else c=o();var E=!mr((kt||v).memoizedState,c);if(E&&(v.memoizedState=c,sn=!0),v=v.queue,Vm(l1.bind(null,f,v,i),[i]),v.getSnapshot!==o||E||rn!==null&&rn.memoizedState.tag&1){if(f.flags|=2048,Fa(9,{destroy:void 0},a1.bind(null,f,v,c,o),null),Nt===null)throw Error(r(349));x||(qi&127)!==0||o1(f,o,c)}return c}function o1(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=qe.updateQueue,o===null?(o=Pd(),qe.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function a1(i,o,c,f){o.value=c,o.getSnapshot=f,c1(o)&&u1(i)}function l1(i,o,c){return c(function(){c1(o)&&u1(i)})}function c1(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!mr(i,c)}catch{return!0}}function u1(i){var o=Co(i,2);o!==null&&or(o,i,2)}function $m(i){var o=Wn();if(typeof i=="function"){var c=i;if(i=c(),Oo){Xe(!0);try{c()}finally{Xe(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ki,lastRenderedState:i},o}function d1(i,o,c,f){return i.baseState=c,Fm(i,kt,typeof f=="function"?f:Ki)}function r4(i,o,c,f,v){if(Ud(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)}};z.T!==null?c(!0):x.isTransition=!1,f(x),c=o.pending,c===null?(x.next=o.pending=x,h1(o,x)):(x.next=c.next,o.pending=c.next=x)}}function h1(i,o){var c=o.action,f=o.payload,v=i.state;if(o.isTransition){var x=z.T,E={};z.T=E;try{var A=c(v,f),K=z.S;K!==null&&K(E,A),f1(i,o,A)}catch(te){Wm(i,o,te)}finally{x!==null&&E.types!==null&&(x.types=E.types),z.T=x}}else try{x=c(v,f),f1(i,o,x)}catch(te){Wm(i,o,te)}}function f1(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){p1(i,o,f)},function(f){return Wm(i,o,f)}):p1(i,o,c)}function p1(i,o,c){o.status="fulfilled",o.value=c,m1(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,h1(i,c)))}function Wm(i,o,c){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do o.status="rejected",o.reason=c,m1(o),o=o.next;while(o!==f)}i.action=null}function m1(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function g1(i,o){return o}function v1(i,o){if(lt){var c=Nt.formState;if(c!==null){e:{var f=qe;if(lt){if(zt){t:{for(var v=zt,x=Br;v.nodeType!==8;){if(!x){v=null;break t}if(v=Hr(v.nextSibling),v===null){v=null;break t}}x=v.data,v=x==="F!"||x==="F"?v:null}if(v){zt=Hr(v.nextSibling),f=v.data==="F!";break e}}Es(f)}f=!1}f&&(o=c[0])}}return c=Wn(),c.memoizedState=c.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:g1,lastRenderedState:o},c.queue=f,c=z1.bind(null,qe,f),f.dispatch=c,f=$m(!1),x=Xm.bind(null,qe,!1,f.queue),f=Wn(),v={state:o,dispatch:null,action:i,pending:null},f.queue=v,c=r4.bind(null,qe,v,x,c),v.dispatch=c,f.memoizedState=i,[o,c,!1]}function _1(i){var o=Jt();return y1(o,kt,i)}function y1(i,o,c){if(o=Fm(i,o,g1)[0],i=Id(Ki)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=vc(o)}catch(E){throw E===za?Md:E}else f=o;o=Jt();var v=o.queue,x=v.dispatch;return c!==o.memoizedState&&(qe.flags|=2048,Fa(9,{destroy:void 0},i4.bind(null,v,c),null)),[f,x,i]}function i4(i,o){i.action=o}function b1(i){var o=Jt(),c=kt;if(c!==null)return y1(o,c,i);Jt(),o=o.memoizedState,c=Jt();var f=c.queue.dispatch;return c.memoizedState=i,[o,f,!1]}function Fa(i,o,c,f){return i={tag:i,create:c,deps:f,inst:o,next:null},o=qe.updateQueue,o===null&&(o=Pd(),qe.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 x1(){return Jt().memoizedState}function Hd(i,o,c,f){var v=Wn();qe.flags|=i,v.memoizedState=Fa(1|o,{destroy:void 0},c,f===void 0?null:f)}function Fd(i,o,c,f){var v=Jt();f=f===void 0?null:f;var x=v.memoizedState.inst;kt!==null&&f!==null&&jm(f,kt.memoizedState.deps)?v.memoizedState=Fa(o,x,c,f):(qe.flags|=i,v.memoizedState=Fa(1|o,x,c,f))}function S1(i,o){Hd(8390656,8,i,o)}function Vm(i,o){Fd(2048,8,i,o)}function s4(i){qe.flags|=4;var o=qe.updateQueue;if(o===null)o=Pd(),qe.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function w1(i){var o=Jt().memoizedState;return s4({ref:o,nextImpl:i}),function(){if((mt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function C1(i,o){return Fd(4,2,i,o)}function k1(i,o){return Fd(4,4,i,o)}function E1(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 R1(i,o,c){c=c!=null?c.concat([i]):null,Fd(4,4,E1.bind(null,o,i),c)}function qm(){}function T1(i,o){var c=Jt();o=o===void 0?null:o;var f=c.memoizedState;return o!==null&&jm(o,f[1])?f[0]:(c.memoizedState=[i,o],i)}function M1(i,o){var c=Jt();o=o===void 0?null:o;var f=c.memoizedState;if(o!==null&&jm(o,f[1]))return f[0];if(f=i(),Oo){Xe(!0);try{i()}finally{Xe(!1)}}return c.memoizedState=[f,o],f}function Km(i,o,c){return c===void 0||(qi&1073741824)!==0&&(ot&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=NS(),qe.lanes|=i,js|=i,c)}function N1(i,o,c,f){return mr(c,o)?c:Ba.current!==null?(i=Km(i,c,f),mr(i,o)||(sn=!0),i):(qi&42)===0||(qi&1073741824)!==0&&(ot&261930)===0?(sn=!0,i.memoizedState=c):(i=NS(),qe.lanes|=i,js|=i,o)}function A1(i,o,c,f,v){var x=q.p;q.p=x!==0&&8>x?x:8;var E=z.T,A={};z.T=A,Xm(i,!1,o,c);try{var K=v(),te=z.S;if(te!==null&&te(A,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var he=e4(K,f);_c(i,o,he,xr(i))}else _c(i,o,f,xr(i))}catch(me){_c(i,o,{then:function(){},status:"rejected",reason:me},xr())}finally{q.p=x,E!==null&&A.types!==null&&(E.types=A.types),z.T=E}}function o4(){}function Gm(i,o,c,f){if(i.tag!==5)throw Error(r(476));var v=D1(i).queue;A1(i,v,o,V,c===null?o4:function(){return O1(i),c(f)})}function D1(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ki,lastRenderedState:V},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ki,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function O1(i){var o=D1(i);o.next===null&&(o=i.alternate.memoizedState),_c(i,o.next.queue,{},xr())}function Ym(){return An(jc)}function L1(){return Jt().memoizedState}function j1(){return Jt().memoizedState}function a4(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=xr();i=Ms(c);var f=Ns(o,i,c);f!==null&&(or(f,o,c),fc(f,o,c)),o={cache:Cm()},i.payload=o;return}o=o.return}}function l4(i,o,c){var f=xr();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Ud(i)?P1(o,c):(c=fm(i,o,c,f),c!==null&&(or(c,i,f),B1(c,o,f)))}function z1(i,o,c){var f=xr();_c(i,o,c,f)}function _c(i,o,c,f){var v={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Ud(i))P1(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,A=x(E,c);if(v.hasEagerState=!0,v.eagerState=A,mr(A,E))return Sd(i,o,v,0),Nt===null&&xd(),!1}catch{}finally{}if(c=fm(i,o,v,f),c!==null)return or(c,i,f),B1(c,o,f),!0}return!1}function Xm(i,o,c,f){if(f={lane:2,revertLane:Tg(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Ud(i)){if(o)throw Error(r(479))}else o=fm(i,c,f,2),o!==null&&or(o,i,2)}function Ud(i){var o=i.alternate;return i===qe||o!==null&&o===qe}function P1(i,o){Ia=jd=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function B1(i,o,c){if((c&4194048)!==0){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,pr(i,c)}}var yc={readContext:An,use:Bd,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};yc.useEffectEvent=Kt;var I1={readContext:An,use:Bd,useCallback:function(i,o){return Wn().memoizedState=[i,o===void 0?null:o],i},useContext:An,useEffect:S1,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,Hd(4194308,4,E1.bind(null,o,i),c)},useLayoutEffect:function(i,o){return Hd(4194308,4,i,o)},useInsertionEffect:function(i,o){Hd(4,2,i,o)},useMemo:function(i,o){var c=Wn();o=o===void 0?null:o;var f=i();if(Oo){Xe(!0);try{i()}finally{Xe(!1)}}return c.memoizedState=[f,o],f},useReducer:function(i,o,c){var f=Wn();if(c!==void 0){var v=c(o);if(Oo){Xe(!0);try{c(o)}finally{Xe(!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=l4.bind(null,qe,i),[f.memoizedState,i]},useRef:function(i){var o=Wn();return i={current:i},o.memoizedState=i},useState:function(i){i=$m(i);var o=i.queue,c=z1.bind(null,qe,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:qm,useDeferredValue:function(i,o){var c=Wn();return Km(c,i,o)},useTransition:function(){var i=$m(!1);return i=A1.bind(null,qe,i.queue,!0,!1),Wn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var f=qe,v=Wn();if(lt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),Nt===null)throw Error(r(349));(ot&127)!==0||o1(f,o,c)}v.memoizedState=c;var x={value:c,getSnapshot:o};return v.queue=x,S1(l1.bind(null,f,x,i),[i]),f.flags|=2048,Fa(9,{destroy:void 0},a1.bind(null,f,x,c,o),null),c},useId:function(){var i=Wn(),o=Nt.identifierPrefix;if(lt){var c=gi,f=mi;c=(f&~(1<<32-$e(f)-1)).toString(32)+c,o="_"+o+"R_"+c,c=zd++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=t4++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:Ym,useFormState:v1,useActionState:v1,useOptimistic:function(i){var o=Wn();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Xm.bind(null,qe,!0,c),c.dispatch=o,[i,o]},useMemoCache:Hm,useCacheRefresh:function(){return Wn().memoizedState=a4.bind(null,qe)},useEffectEvent:function(i){var o=Wn(),c={impl:i};return o.memoizedState=c,function(){if((mt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},Zm={readContext:An,use:Bd,useCallback:T1,useContext:An,useEffect:Vm,useImperativeHandle:R1,useInsertionEffect:C1,useLayoutEffect:k1,useMemo:M1,useReducer:Id,useRef:x1,useState:function(){return Id(Ki)},useDebugValue:qm,useDeferredValue:function(i,o){var c=Jt();return N1(c,kt.memoizedState,i,o)},useTransition:function(){var i=Id(Ki)[0],o=Jt().memoizedState;return[typeof i=="boolean"?i:vc(i),o]},useSyncExternalStore:s1,useId:L1,useHostTransitionStatus:Ym,useFormState:_1,useActionState:_1,useOptimistic:function(i,o){var c=Jt();return d1(c,kt,i,o)},useMemoCache:Hm,useCacheRefresh:j1};Zm.useEffectEvent=w1;var H1={readContext:An,use:Bd,useCallback:T1,useContext:An,useEffect:Vm,useImperativeHandle:R1,useInsertionEffect:C1,useLayoutEffect:k1,useMemo:M1,useReducer:Um,useRef:x1,useState:function(){return Um(Ki)},useDebugValue:qm,useDeferredValue:function(i,o){var c=Jt();return kt===null?Km(c,i,o):N1(c,kt.memoizedState,i,o)},useTransition:function(){var i=Um(Ki)[0],o=Jt().memoizedState;return[typeof i=="boolean"?i:vc(i),o]},useSyncExternalStore:s1,useId:L1,useHostTransitionStatus:Ym,useFormState:b1,useActionState:b1,useOptimistic:function(i,o){var c=Jt();return kt!==null?d1(c,kt,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:Hm,useCacheRefresh:j1};H1.useEffectEvent=w1;function Qm(i,o,c,f){o=i.memoizedState,c=c(f,o),c=c==null?o:p({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Jm={enqueueSetState:function(i,o,c){i=i._reactInternals;var f=xr(),v=Ms(f);v.payload=o,c!=null&&(v.callback=c),o=Ns(i,v,f),o!==null&&(or(o,i,f),fc(o,i,f))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var f=xr(),v=Ms(f);v.tag=1,v.payload=o,c!=null&&(v.callback=c),o=Ns(i,v,f),o!==null&&(or(o,i,f),fc(o,i,f))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=xr(),f=Ms(c);f.tag=2,o!=null&&(f.callback=o),o=Ns(i,f,c),o!==null&&(or(o,i,c),fc(o,i,c))}};function F1(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?!sc(c,f)||!sc(v,x):!0}function U1(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&&Jm.enqueueReplaceState(o,o.state,null)}function Lo(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=p({},c));for(var v in i)c[v]===void 0&&(c[v]=i[v])}return c}function $1(i){bd(i)}function W1(i){console.error(i)}function V1(i){bd(i)}function $d(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function q1(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 eg(i,o,c){return c=Ms(c),c.tag=3,c.payload={element:null},c.callback=function(){$d(i,o)},c}function K1(i){return i=Ms(i),i.tag=3,i}function G1(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(){q1(o,c,f)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){q1(o,c,f),typeof v!="function"&&(zs===null?zs=new Set([this]):zs.add(this));var A=f.stack;this.componentDidCatch(f.value,{componentStack:A!==null?A:""})})}function c4(i,o,c,f,v){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=c.alternate,o!==null&&Oa(o,c,v,!0),c=vr.current,c!==null){switch(c.tag){case 31:case 13:return Ir===null?th():c.alternate===null&&Gt===0&&(Gt=3),c.flags&=-257,c.flags|=65536,c.lanes=v,f===Nd?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([f]):o.add(f),kg(i,f,v)),!1;case 22:return c.flags|=65536,f===Nd?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)),kg(i,f,v)),!1}throw Error(r(435,c.tag))}return kg(i,f,v),th(),!1}if(lt)return o=vr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=v,f!==ym&&(i=Error(r(422),{cause:f}),lc(jr(i,c)))):(f!==ym&&(o=Error(r(423),{cause:f}),lc(jr(o,c))),i=i.current.alternate,i.flags|=65536,v&=-v,i.lanes|=v,f=jr(f,c),v=eg(i.stateNode,f,v),Nm(i,v),Gt!==4&&(Gt=2)),!1;var x=Error(r(520),{cause:f});if(x=jr(x,c),Rc===null?Rc=[x]:Rc.push(x),Gt!==4&&(Gt=2),o===null)return!0;f=jr(f,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=v&-v,c.lanes|=i,i=eg(c.stateNode,f,i),Nm(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"&&(zs===null||!zs.has(x))))return c.flags|=65536,v&=-v,c.lanes|=v,v=K1(v),G1(v,i,c,f),Nm(c,v),!1}c=c.return}while(c!==null);return!1}var tg=Error(r(461)),sn=!1;function Dn(i,o,c,f){o.child=i===null?Qx(o,null,c,f):Do(o,i.child,c,f)}function Y1(i,o,c,f,v){c=c.render;var x=o.ref;if("ref"in f){var E={};for(var A in f)A!=="ref"&&(E[A]=f[A])}else E=f;return To(o),f=zm(i,o,c,E,x,v),A=Pm(),i!==null&&!sn?(Bm(i,o,v),Gi(i,o,v)):(lt&&A&&vm(o),o.flags|=1,Dn(i,o,f,v),o.child)}function X1(i,o,c,f,v){if(i===null){var x=c.type;return typeof x=="function"&&!pm(x)&&x.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=x,Z1(i,o,x,f,v)):(i=Cd(c.type,null,f,o,o.mode,v),i.ref=o.ref,i.return=o,o.child=i)}if(x=i.child,!cg(i,v)){var E=x.memoizedProps;if(c=c.compare,c=c!==null?c:sc,c(E,f)&&i.ref===o.ref)return Gi(i,o,v)}return o.flags|=1,i=Ui(x,f),i.ref=o.ref,i.return=o,o.child=i}function Z1(i,o,c,f,v){if(i!==null){var x=i.memoizedProps;if(sc(x,f)&&i.ref===o.ref)if(sn=!1,o.pendingProps=f=x,cg(i,v))(i.flags&131072)!==0&&(sn=!0);else return o.lanes=i.lanes,Gi(i,o,v)}return ng(i,o,c,f,v)}function Q1(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 J1(i,o,x,c,f)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Td(o,x!==null?x.cachePool:null),x!==null?t1(o,x):Dm(),n1(o);else return f=o.lanes=536870912,J1(i,o,x!==null?x.baseLanes|c:c,c,f)}else x!==null?(Td(o,x.cachePool),t1(o,x),Ds(),o.memoizedState=null):(i!==null&&Td(o,null),Dm(),Ds());return Dn(i,o,v,c),o.child}function bc(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function J1(i,o,c,f,v){var x=Em();return x=x===null?null:{parent:nn._currentValue,pool:x},o.memoizedState={baseLanes:c,cachePool:x},i!==null&&Td(o,null),Dm(),n1(o),i!==null&&Oa(i,o,f,!0),o.childLanes=v,null}function Wd(i,o){return o=qd({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function eS(i,o,c){return Do(o,i.child,null,c),i=Wd(o,o.pendingProps),i.flags|=2,_r(o),o.memoizedState=null,i}function u4(i,o,c){var f=o.pendingProps,v=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(lt){if(f.mode==="hidden")return i=Wd(o,f),o.lanes=536870912,bc(null,i);if(Lm(o),(i=zt)?(i=hw(i,Br),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Cs!==null?{id:mi,overflow:gi}:null,retryLane:536870912,hydrationErrors:null},c=Px(i),c.return=o,o.child=c,Nn=o,zt=null)):i=null,i===null)throw Es(o);return o.lanes=536870912,null}return Wd(o,f)}var x=i.memoizedState;if(x!==null){var E=x.dehydrated;if(Lm(o),v)if(o.flags&256)o.flags&=-257,o=eS(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(sn||Oa(i,o,c,!1),v=(c&i.childLanes)!==0,sn||v){if(f=Nt,f!==null&&(E=Nr(f,c),E!==0&&E!==x.retryLane))throw x.retryLane=E,Co(i,E),or(f,i,E),tg;th(),o=eS(i,o,c)}else i=x.treeContext,zt=Hr(E.nextSibling),Nn=o,lt=!0,ks=null,Br=!1,i!==null&&Hx(o,i),o=Wd(o,f),o.flags|=4096;return o}return i=Ui(i.child,{mode:f.mode,children:f.children}),i.ref=o.ref,o.child=i,i.return=o,i}function Vd(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 ng(i,o,c,f,v){return To(o),c=zm(i,o,c,f,void 0,v),f=Pm(),i!==null&&!sn?(Bm(i,o,v),Gi(i,o,v)):(lt&&f&&vm(o),o.flags|=1,Dn(i,o,c,v),o.child)}function tS(i,o,c,f,v,x){return To(o),o.updateQueue=null,c=i1(o,f,c,v),r1(i),f=Pm(),i!==null&&!sn?(Bm(i,o,x),Gi(i,o,x)):(lt&&f&&vm(o),o.flags|=1,Dn(i,o,c,x),o.child)}function nS(i,o,c,f,v){if(To(o),o.stateNode===null){var x=Ma,E=c.contextType;typeof E=="object"&&E!==null&&(x=An(E)),x=new c(f,x),o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Jm,o.stateNode=x,x._reactInternals=o,x=o.stateNode,x.props=f,x.state=o.memoizedState,x.refs={},Tm(o),E=c.contextType,x.context=typeof E=="object"&&E!==null?An(E):Ma,x.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Qm(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&&Jm.enqueueReplaceState(x,x.state,null),mc(o,f,x,v),pc(),x.state=o.memoizedState),typeof x.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(i===null){x=o.stateNode;var A=o.memoizedProps,K=Lo(c,A);x.props=K;var te=x.context,he=c.contextType;E=Ma,typeof he=="object"&&he!==null&&(E=An(he));var me=c.getDerivedStateFromProps;he=typeof me=="function"||typeof x.getSnapshotBeforeUpdate=="function",A=o.pendingProps!==A,he||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A||te!==E)&&U1(o,x,f,E),Ts=!1;var re=o.memoizedState;x.state=re,mc(o,f,x,v),pc(),te=o.memoizedState,A||re!==te||Ts?(typeof me=="function"&&(Qm(o,c,me,f),te=o.memoizedState),(K=Ts||F1(o,c,K,f,re,te,E))?(he||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=K):(typeof x.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{x=o.stateNode,Mm(i,o),E=o.memoizedProps,he=Lo(c,E),x.props=he,me=o.pendingProps,re=x.context,te=c.contextType,K=Ma,typeof te=="object"&&te!==null&&(K=An(te)),A=c.getDerivedStateFromProps,(te=typeof A=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(E!==me||re!==K)&&U1(o,x,f,K),Ts=!1,re=o.memoizedState,x.state=re,mc(o,f,x,v),pc();var le=o.memoizedState;E!==me||re!==le||Ts||i!==null&&i.dependencies!==null&&Ed(i.dependencies)?(typeof A=="function"&&(Qm(o,c,A,f),le=o.memoizedState),(he=Ts||F1(o,c,he,f,re,le,K)||i!==null&&i.dependencies!==null&&Ed(i.dependencies))?(te||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(f,le,K),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(f,le,K)),typeof x.componentDidUpdate=="function"&&(o.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof x.componentDidUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=le),x.props=f,x.state=le,x.context=K,f=he):(typeof x.componentDidUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=1024),f=!1)}return x=f,Vd(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=Do(o,i.child,null,v),o.child=Do(o,null,c,v)):Dn(i,o,c,v),o.memoizedState=x.state,i=o.child):i=Gi(i,o,v),i}function rS(i,o,c,f){return Eo(),o.flags|=256,Dn(i,o,c,f),o.child}var rg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ig(i){return{baseLanes:i,cachePool:qx()}}function sg(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=br),i}function iS(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:(Qt.current&2)!==0),E&&(v=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,i===null){if(lt){if(v?As(o):Ds(),(i=zt)?(i=hw(i,Br),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Cs!==null?{id:mi,overflow:gi}:null,retryLane:536870912,hydrationErrors:null},c=Px(i),c.return=o,o.child=c,Nn=o,zt=null)):i=null,i===null)throw Es(o);return Fg(i)?o.lanes=32:o.lanes=536870912,null}var A=f.children;return f=f.fallback,v?(Ds(),v=o.mode,A=qd({mode:"hidden",children:A},v),f=ko(f,v,c,null),A.return=o,f.return=o,A.sibling=f,o.child=A,f=o.child,f.memoizedState=ig(c),f.childLanes=sg(i,E,c),o.memoizedState=rg,bc(null,f)):(As(o),og(o,A))}var K=i.memoizedState;if(K!==null&&(A=K.dehydrated,A!==null)){if(x)o.flags&256?(As(o),o.flags&=-257,o=ag(i,o,c)):o.memoizedState!==null?(Ds(),o.child=i.child,o.flags|=128,o=null):(Ds(),A=f.fallback,v=o.mode,f=qd({mode:"visible",children:f.children},v),A=ko(A,v,c,null),A.flags|=2,f.return=o,A.return=o,f.sibling=A,o.child=f,Do(o,i.child,null,c),f=o.child,f.memoizedState=ig(c),f.childLanes=sg(i,E,c),o.memoizedState=rg,o=bc(null,f));else if(As(o),Fg(A)){if(E=A.nextSibling&&A.nextSibling.dataset,E)var te=E.dgst;E=te,f=Error(r(419)),f.stack="",f.digest=E,lc({value:f,source:null,stack:null}),o=ag(i,o,c)}else if(sn||Oa(i,o,c,!1),E=(c&i.childLanes)!==0,sn||E){if(E=Nt,E!==null&&(f=Nr(E,c),f!==0&&f!==K.retryLane))throw K.retryLane=f,Co(i,f),or(E,i,f),tg;Hg(A)||th(),o=ag(i,o,c)}else Hg(A)?(o.flags|=192,o.child=i.child,o=null):(i=K.treeContext,zt=Hr(A.nextSibling),Nn=o,lt=!0,ks=null,Br=!1,i!==null&&Hx(o,i),o=og(o,f.children),o.flags|=4096);return o}return v?(Ds(),A=f.fallback,v=o.mode,K=i.child,te=K.sibling,f=Ui(K,{mode:"hidden",children:f.children}),f.subtreeFlags=K.subtreeFlags&65011712,te!==null?A=Ui(te,A):(A=ko(A,v,c,null),A.flags|=2),A.return=o,f.return=o,f.sibling=A,o.child=f,bc(null,f),f=o.child,A=i.child.memoizedState,A===null?A=ig(c):(v=A.cachePool,v!==null?(K=nn._currentValue,v=v.parent!==K?{parent:K,pool:K}:v):v=qx(),A={baseLanes:A.baseLanes|c,cachePool:v}),f.memoizedState=A,f.childLanes=sg(i,E,c),o.memoizedState=rg,bc(i.child,f)):(As(o),c=i.child,i=c.sibling,c=Ui(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 og(i,o){return o=qd({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function qd(i,o){return i=gr(22,i,null,o),i.lanes=0,i}function ag(i,o,c){return Do(o,i.child,null,c),i=og(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function sS(i,o,c){i.lanes|=o;var f=i.alternate;f!==null&&(f.lanes|=o),Sm(i.return,o,c)}function lg(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 oS(i,o,c){var f=o.pendingProps,v=f.revealOrder,x=f.tail;f=f.children;var E=Qt.current,A=(E&2)!==0;if(A?(E=E&1|2,o.flags|=128):E&=1,D(Qt,E),Dn(i,o,f,c),f=lt?ac:0,!A&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&sS(i,c,o);else if(i.tag===19)sS(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&&Ld(i)===null&&(v=c),c=c.sibling;c=v,c===null?(v=o.child,o.child=null):(v=c.sibling,c.sibling=null),lg(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&&Ld(i)===null){o.child=v;break}i=v.sibling,v.sibling=c,c=v,v=i}lg(o,!0,c,null,x,f);break;case"together":lg(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function Gi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),js|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(Oa(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=Ui(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Ui(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function cg(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Ed(i)))}function d4(i,o,c){switch(o.tag){case 3:ve(o,o.stateNode.containerInfo),Rs(o,nn,i.memoizedState.cache),Eo();break;case 27:case 5:de(o);break;case 4:ve(o,o.stateNode.containerInfo);break;case 10:Rs(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Lm(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(As(o),o.flags|=128,null):(c&o.child.childLanes)!==0?iS(i,o,c):(As(o),i=Gi(i,o,c),i!==null?i.sibling:null);As(o);break;case 19:var v=(i.flags&128)!==0;if(f=(c&o.childLanes)!==0,f||(Oa(i,o,c,!1),f=(c&o.childLanes)!==0),v){if(f)return oS(i,o,c);o.flags|=128}if(v=o.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),D(Qt,Qt.current),f)break;return null;case 22:return o.lanes=0,Q1(i,o,c,o.pendingProps);case 24:Rs(o,nn,i.memoizedState.cache)}return Gi(i,o,c)}function aS(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)sn=!0;else{if(!cg(i,c)&&(o.flags&128)===0)return sn=!1,d4(i,o,c);sn=(i.flags&131072)!==0}else sn=!1,lt&&(o.flags&1048576)!==0&&Ix(o,ac,o.index);switch(o.lanes=0,o.tag){case 16:e:{var f=o.pendingProps;if(i=No(o.elementType),o.type=i,typeof i=="function")pm(i)?(f=Lo(i,f),o.tag=1,o=nS(null,o,i,f,c)):(o.tag=0,o=ng(null,o,i,f,c));else{if(i!=null){var v=i.$$typeof;if(v===M){o.tag=11,o=Y1(null,o,i,f,c);break e}else if(v===j){o.tag=14,o=X1(null,o,i,f,c);break e}}throw o=$(i)||i,Error(r(306,o,""))}}return o;case 0:return ng(i,o,o.type,o.pendingProps,c);case 1:return f=o.type,v=Lo(f,o.pendingProps),nS(i,o,f,v,c);case 3:e:{if(ve(o,o.stateNode.containerInfo),i===null)throw Error(r(387));f=o.pendingProps;var x=o.memoizedState;v=x.element,Mm(i,o),mc(o,f,null,c);var E=o.memoizedState;if(f=E.cache,Rs(o,nn,f),f!==x.cache&&wm(o,[nn],c,!0),pc(),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=rS(i,o,f,c);break e}else if(f!==v){v=jr(Error(r(424)),o),lc(v),o=rS(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(zt=Hr(i.firstChild),Nn=o,lt=!0,ks=null,Br=!0,c=Qx(o,null,f,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Eo(),f===v){o=Gi(i,o,c);break e}Dn(i,o,f,c)}o=o.child}return o;case 26:return Vd(i,o),i===null?(c=_w(o.type,null,o.pendingProps,null))?o.memoizedState=c:lt||(c=o.type,i=o.pendingProps,f=lh(ae.current).createElement(c),f[Mn]=o,f[er]=i,On(f,c,i),_n(f),o.stateNode=f):o.memoizedState=_w(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return de(o),i===null&<&&(f=o.stateNode=mw(o.type,o.pendingProps,ae.current),Nn=o,Br=!0,v=zt,Hs(o.type)?(Ug=v,zt=Hr(f.firstChild)):zt=v),Dn(i,o,o.pendingProps.children,c),Vd(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&<&&((v=f=zt)&&(f=F4(f,o.type,o.pendingProps,Br),f!==null?(o.stateNode=f,Nn=o,zt=Hr(f.firstChild),Br=!1,v=!0):v=!1),v||Es(o)),de(o),v=o.type,x=o.pendingProps,E=i!==null?i.memoizedProps:null,f=x.children,Pg(v,x)?f=null:E!==null&&Pg(v,E)&&(o.flags|=32),o.memoizedState!==null&&(v=zm(i,o,n4,null,null,c),jc._currentValue=v),Vd(i,o),Dn(i,o,f,c),o.child;case 6:return i===null&<&&((i=c=zt)&&(c=U4(c,o.pendingProps,Br),c!==null?(o.stateNode=c,Nn=o,zt=null,i=!0):i=!1),i||Es(o)),null;case 13:return iS(i,o,c);case 4:return ve(o,o.stateNode.containerInfo),f=o.pendingProps,i===null?o.child=Do(o,null,f,c):Dn(i,o,f,c),o.child;case 11:return Y1(i,o,o.type,o.pendingProps,c);case 7:return Dn(i,o,o.pendingProps,c),o.child;case 8:return Dn(i,o,o.pendingProps.children,c),o.child;case 12:return Dn(i,o,o.pendingProps.children,c),o.child;case 10:return f=o.pendingProps,Rs(o,o.type,f.value),Dn(i,o,f.children,c),o.child;case 9:return v=o.type._context,f=o.pendingProps.children,To(o),v=An(v),f=f(v),o.flags|=1,Dn(i,o,f,c),o.child;case 14:return X1(i,o,o.type,o.pendingProps,c);case 15:return Z1(i,o,o.type,o.pendingProps,c);case 19:return oS(i,o,c);case 31:return u4(i,o,c);case 22:return Q1(i,o,c,o.pendingProps);case 24:return To(o),f=An(nn),i===null?(v=Em(),v===null&&(v=Nt,x=Cm(),v.pooledCache=x,x.refCount++,x!==null&&(v.pooledCacheLanes|=c),v=x),o.memoizedState={parent:f,cache:v},Tm(o),Rs(o,nn,v)):((i.lanes&c)!==0&&(Mm(i,o),mc(o,null,null,c),pc()),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),Rs(o,nn,f)):(f=x.cache,Rs(o,nn,f),f!==v.cache&&wm(o,[nn],c,!0))),Dn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Yi(i){i.flags|=4}function ug(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(LS())i.flags|=8192;else throw Ao=Nd,Rm}else i.flags&=-16777217}function lS(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!ww(o))if(LS())i.flags|=8192;else throw Ao=Nd,Rm}function Kd(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?et():536870912,i.lanes|=o,Va|=o)}function xc(i,o){if(!lt)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 Pt(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 h4(i,o,c){var f=o.pendingProps;switch(_m(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(o),null;case 1:return Pt(o),null;case 3:return c=o.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Vi(nn),ne(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(Da(o)?Yi(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,bm())),Pt(o),null;case 26:var v=o.type,x=o.memoizedState;return i===null?(Yi(o),x!==null?(Pt(o),lS(o,x)):(Pt(o),ug(o,v,null,f,c))):x?x!==i.memoizedState?(Yi(o),Pt(o),lS(o,x)):(Pt(o),o.flags&=-16777217):(i=i.memoizedProps,i!==f&&Yi(o),Pt(o),ug(o,v,i,f,c)),null;case 27:if(we(o),c=ae.current,v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Yi(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return Pt(o),null}i=ce.current,Da(o)?Fx(o):(i=mw(v,f,c),o.stateNode=i,Yi(o))}return Pt(o),null;case 5:if(we(o),v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Yi(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return Pt(o),null}if(x=ce.current,Da(o))Fx(o);else{var E=lh(ae.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[Mn]=o,x[er]=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(On(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&&Yi(o)}}return Pt(o),ug(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==f&&Yi(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(r(166));if(i=ae.current,Da(o)){if(i=o.stateNode,c=o.memoizedProps,f=null,v=Nn,v!==null)switch(v.tag){case 27:case 5:f=v.memoizedProps}i[Mn]=o,i=!!(i.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||iw(i.nodeValue,c)),i||Es(o,!0)}else i=lh(i).createTextNode(f),i[Mn]=o,o.stateNode=i}return Pt(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(f=Da(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[Mn]=o}else Eo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Pt(o),i=!1}else c=bm(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(_r(o),o):(_r(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Pt(o),null;case 13:if(f=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(v=Da(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[Mn]=o}else Eo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Pt(o),v=!1}else v=bm(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=v),v=!0;if(!v)return o.flags&256?(_r(o),o):(_r(o),null)}return _r(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),Kd(o,o.updateQueue),Pt(o),null);case 4:return ne(),i===null&&Dg(o.stateNode.containerInfo),Pt(o),null;case 10:return Vi(o.type),Pt(o),null;case 19:if(Z(Qt),f=o.memoizedState,f===null)return Pt(o),null;if(v=(o.flags&128)!==0,x=f.rendering,x===null)if(v)xc(f,!1);else{if(Gt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(x=Ld(i),x!==null){for(o.flags|=128,xc(f,!1),i=x.updateQueue,o.updateQueue=i,Kd(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)zx(c,i),c=c.sibling;return D(Qt,Qt.current&1|2),lt&&$i(o,f.treeForkCount),o.child}i=i.sibling}f.tail!==null&&ie()>Qd&&(o.flags|=128,v=!0,xc(f,!1),o.lanes=4194304)}else{if(!v)if(i=Ld(x),i!==null){if(o.flags|=128,v=!0,i=i.updateQueue,o.updateQueue=i,Kd(o,i),xc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!x.alternate&&!lt)return Pt(o),null}else 2*ie()-f.renderingStartTime>Qd&&c!==536870912&&(o.flags|=128,v=!0,xc(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=ie(),i.sibling=null,c=Qt.current,D(Qt,v?c&1|2:c&1),lt&&$i(o,f.treeForkCount),i):(Pt(o),null);case 22:case 23:return _r(o),Om(),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&&(Pt(o),o.subtreeFlags&6&&(o.flags|=8192)):Pt(o),c=o.updateQueue,c!==null&&Kd(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&&Z(Mo),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),Vi(nn),Pt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function f4(i,o){switch(_m(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Vi(nn),ne(),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(_r(o),o.alternate===null)throw Error(r(340));Eo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(_r(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Eo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Z(Qt),null;case 4:return ne(),null;case 10:return Vi(o.type),null;case 22:case 23:return _r(o),Om(),i!==null&&Z(Mo),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return Vi(nn),null;case 25:return null;default:return null}}function cS(i,o){switch(_m(o),o.tag){case 3:Vi(nn),ne();break;case 26:case 27:case 5:we(o);break;case 4:ne();break;case 31:o.memoizedState!==null&&_r(o);break;case 13:_r(o);break;case 19:Z(Qt);break;case 10:Vi(o.type);break;case 22:case 23:_r(o),Om(),i!==null&&Z(Mo);break;case 24:Vi(nn)}}function Sc(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(A){wt(o,o.return,A)}}function Os(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,A=E.destroy;if(A!==void 0){E.destroy=void 0,v=o;var K=c,te=A;try{te()}catch(he){wt(v,K,he)}}}f=f.next}while(f!==x)}}catch(he){wt(o,o.return,he)}}function uS(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{e1(o,c)}catch(f){wt(i,i.return,f)}}}function dS(i,o,c){c.props=Lo(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(f){wt(i,o,f)}}function wc(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){wt(i,o,v)}}function vi(i,o){var c=i.ref,f=i.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(v){wt(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){wt(i,o,v)}else c.current=null}function hS(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){wt(i,i.return,v)}}function dg(i,o,c){try{var f=i.stateNode;j4(f,i.type,c,o),f[er]=o}catch(v){wt(i,i.return,v)}}function fS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Hs(i.type)||i.tag===4}function hg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||fS(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&&Hs(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 fg(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=Hi));else if(f!==4&&(f===27&&Hs(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(fg(i,o,c),i=i.sibling;i!==null;)fg(i,o,c),i=i.sibling}function Gd(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&&Hs(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Gd(i,o,c),i=i.sibling;i!==null;)Gd(i,o,c),i=i.sibling}function pS(i){var o=i.stateNode,c=i.memoizedProps;try{for(var f=i.type,v=o.attributes;v.length;)o.removeAttributeNode(v[0]);On(o,f,c),o[Mn]=i,o[er]=c}catch(x){wt(i,i.return,x)}}var Xi=!1,on=!1,pg=!1,mS=typeof WeakSet=="function"?WeakSet:Set,yn=null;function p4(i,o){if(i=i.containerInfo,jg=mh,i=Rx(i),am(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,A=-1,K=-1,te=0,he=0,me=i,re=null;t:for(;;){for(var le;me!==c||v!==0&&me.nodeType!==3||(A=E+v),me!==x||f!==0&&me.nodeType!==3||(K=E+f),me.nodeType===3&&(E+=me.nodeValue.length),(le=me.firstChild)!==null;)re=me,me=le;for(;;){if(me===i)break t;if(re===c&&++te===v&&(A=E),re===x&&++he===f&&(K=E),(le=me.nextSibling)!==null)break;me=re,re=me.parentNode}me=le}c=A===-1||K===-1?null:{start:A,end:K}}else c=null}c=c||{start:0,end:0}}else c=null;for(zg={focusedElem:i,selectionRange:c},mh=!1,yn=o;yn!==null;)if(o=yn,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,yn=i;else for(;yn!==null;){switch(o=yn,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 Ae=Lo(c.type,v);i=f.getSnapshotBeforeUpdate(Ae,x),f.__reactInternalSnapshotBeforeUpdate=i}catch(Fe){wt(c,c.return,Fe)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)Ig(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Ig(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,yn=i;break}yn=o.return}}function gS(i,o,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:Qi(i,c),f&4&&Sc(5,c);break;case 1:if(Qi(i,c),f&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(E){wt(c,c.return,E)}else{var v=Lo(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(v,o,i.__reactInternalSnapshotBeforeUpdate)}catch(E){wt(c,c.return,E)}}f&64&&uS(c),f&512&&wc(c,c.return);break;case 3:if(Qi(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{e1(i,o)}catch(E){wt(c,c.return,E)}}break;case 27:o===null&&f&4&&pS(c);case 26:case 5:Qi(i,c),o===null&&f&4&&hS(c),f&512&&wc(c,c.return);break;case 12:Qi(i,c);break;case 31:Qi(i,c),f&4&&yS(i,c);break;case 13:Qi(i,c),f&4&&bS(i,c),f&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=w4.bind(null,c),$4(i,c))));break;case 22:if(f=c.memoizedState!==null||Xi,!f){o=o!==null&&o.memoizedState!==null||on,v=Xi;var x=on;Xi=f,(on=o)&&!x?Ji(i,c,(c.subtreeFlags&8772)!==0):Qi(i,c),Xi=v,on=x}break;case 30:break;default:Qi(i,c)}}function vS(i){var o=i.alternate;o!==null&&(i.alternate=null,vS(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&Wp(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 Ht=null,nr=!1;function Zi(i,o,c){for(c=c.child;c!==null;)_S(i,o,c),c=c.sibling}function _S(i,o,c){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(oe,c)}catch{}switch(c.tag){case 26:on||vi(c,o),Zi(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:on||vi(c,o);var f=Ht,v=nr;Hs(c.type)&&(Ht=c.stateNode,nr=!1),Zi(i,o,c),Dc(c.stateNode),Ht=f,nr=v;break;case 5:on||vi(c,o);case 6:if(f=Ht,v=nr,Ht=null,Zi(i,o,c),Ht=f,nr=v,Ht!==null)if(nr)try{(Ht.nodeType===9?Ht.body:Ht.nodeName==="HTML"?Ht.ownerDocument.body:Ht).removeChild(c.stateNode)}catch(x){wt(c,o,x)}else try{Ht.removeChild(c.stateNode)}catch(x){wt(c,o,x)}break;case 18:Ht!==null&&(nr?(i=Ht,uw(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),Ja(i)):uw(Ht,c.stateNode));break;case 4:f=Ht,v=nr,Ht=c.stateNode.containerInfo,nr=!0,Zi(i,o,c),Ht=f,nr=v;break;case 0:case 11:case 14:case 15:Os(2,c,o),on||Os(4,c,o),Zi(i,o,c);break;case 1:on||(vi(c,o),f=c.stateNode,typeof f.componentWillUnmount=="function"&&dS(c,o,f)),Zi(i,o,c);break;case 21:Zi(i,o,c);break;case 22:on=(f=on)||c.memoizedState!==null,Zi(i,o,c),on=f;break;default:Zi(i,o,c)}}function yS(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Ja(i)}catch(c){wt(o,o.return,c)}}}function bS(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Ja(i)}catch(c){wt(o,o.return,c)}}function m4(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new mS),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new mS),o;default:throw Error(r(435,i.tag))}}function Yd(i,o){var c=m4(i);o.forEach(function(f){if(!c.has(f)){c.add(f);var v=C4.bind(null,i,f);f.then(v,v)}})}function rr(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,A=E;e:for(;A!==null;){switch(A.tag){case 27:if(Hs(A.type)){Ht=A.stateNode,nr=!1;break e}break;case 5:Ht=A.stateNode,nr=!1;break e;case 3:case 4:Ht=A.stateNode.containerInfo,nr=!0;break e}A=A.return}if(Ht===null)throw Error(r(160));_S(x,E,v),Ht=null,nr=!1,x=v.alternate,x!==null&&(x.return=null),v.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)xS(o,i),o=o.sibling}var ti=null;function xS(i,o){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:rr(o,i),ir(i),f&4&&(Os(3,i,i.return),Sc(3,i),Os(5,i,i.return));break;case 1:rr(o,i),ir(i),f&512&&(on||c===null||vi(c,c.return)),f&64&&Xi&&(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=ti;if(rr(o,i),ir(i),f&512&&(on||c===null||vi(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[Xl]||x[Mn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=v.createElement(f),v.head.insertBefore(x,v.querySelector("head > title"))),On(x,f,c),x[Mn]=i,_n(x),f=x;break e;case"link":var E=xw("link","href",v).get(f+(c.href||""));if(E){for(var A=0;A<E.length;A++)if(x=E[A],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(A,1);break t}}x=v.createElement(f),On(x,f,c),v.head.appendChild(x);break;case"meta":if(E=xw("meta","content",v).get(f+(c.content||""))){for(A=0;A<E.length;A++)if(x=E[A],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(A,1);break t}}x=v.createElement(f),On(x,f,c),v.head.appendChild(x);break;default:throw Error(r(468,f))}x[Mn]=i,_n(x),f=x}i.stateNode=f}else Sw(v,i.type,i.stateNode);else i.stateNode=bw(v,f,i.memoizedProps);else x!==f?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,f===null?Sw(v,i.type,i.stateNode):bw(v,f,i.memoizedProps)):f===null&&i.stateNode!==null&&dg(i,i.memoizedProps,c.memoizedProps)}break;case 27:rr(o,i),ir(i),f&512&&(on||c===null||vi(c,c.return)),c!==null&&f&4&&dg(i,i.memoizedProps,c.memoizedProps);break;case 5:if(rr(o,i),ir(i),f&512&&(on||c===null||vi(c,c.return)),i.flags&32){v=i.stateNode;try{Sa(v,"")}catch(Ae){wt(i,i.return,Ae)}}f&4&&i.stateNode!=null&&(v=i.memoizedProps,dg(i,v,c!==null?c.memoizedProps:v)),f&1024&&(pg=!0);break;case 6:if(rr(o,i),ir(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,c=i.stateNode;try{c.nodeValue=f}catch(Ae){wt(i,i.return,Ae)}}break;case 3:if(dh=null,v=ti,ti=ch(o.containerInfo),rr(o,i),ti=v,ir(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{Ja(o.containerInfo)}catch(Ae){wt(i,i.return,Ae)}pg&&(pg=!1,SS(i));break;case 4:f=ti,ti=ch(i.stateNode.containerInfo),rr(o,i),ir(i),ti=f;break;case 12:rr(o,i),ir(i);break;case 31:rr(o,i),ir(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Yd(i,f)));break;case 13:rr(o,i),ir(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Zd=ie()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Yd(i,f)));break;case 22:v=i.memoizedState!==null;var K=c!==null&&c.memoizedState!==null,te=Xi,he=on;if(Xi=te||v,on=he||K,rr(o,i),on=he,Xi=te,ir(i),f&8192)e:for(o=i.stateNode,o._visibility=v?o._visibility&-2:o._visibility|1,v&&(c===null||K||Xi||on||jo(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){K=c=o;try{if(x=K.stateNode,v)E=x.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{A=K.stateNode;var me=K.memoizedProps.style,re=me!=null&&me.hasOwnProperty("display")?me.display:null;A.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Ae){wt(K,K.return,Ae)}}}else if(o.tag===6){if(c===null){K=o;try{K.stateNode.nodeValue=v?"":K.memoizedProps}catch(Ae){wt(K,K.return,Ae)}}}else if(o.tag===18){if(c===null){K=o;try{var le=K.stateNode;v?dw(le,!0):dw(K.stateNode,!1)}catch(Ae){wt(K,K.return,Ae)}}}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,Yd(i,c))));break;case 19:rr(o,i),ir(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Yd(i,f)));break;case 30:break;case 21:break;default:rr(o,i),ir(i)}}function ir(i){var o=i.flags;if(o&2){try{for(var c,f=i.return;f!==null;){if(fS(f)){c=f;break}f=f.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var v=c.stateNode,x=hg(i);Gd(i,x,v);break;case 5:var E=c.stateNode;c.flags&32&&(Sa(E,""),c.flags&=-33);var A=hg(i);Gd(i,A,E);break;case 3:case 4:var K=c.stateNode.containerInfo,te=hg(i);fg(i,te,K);break;default:throw Error(r(161))}}catch(he){wt(i,i.return,he)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function SS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;SS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function Qi(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)gS(i,o.alternate,o),o=o.sibling}function jo(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Os(4,o,o.return),jo(o);break;case 1:vi(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&dS(o,o.return,c),jo(o);break;case 27:Dc(o.stateNode);case 26:case 5:vi(o,o.return),jo(o);break;case 22:o.memoizedState===null&&jo(o);break;case 30:jo(o);break;default:jo(o)}i=i.sibling}}function Ji(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:Ji(v,x,c),Sc(4,x);break;case 1:if(Ji(v,x,c),f=x,v=f.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(te){wt(f,f.return,te)}if(f=x,v=f.updateQueue,v!==null){var A=f.stateNode;try{var K=v.shared.hiddenCallbacks;if(K!==null)for(v.shared.hiddenCallbacks=null,v=0;v<K.length;v++)Jx(K[v],A)}catch(te){wt(f,f.return,te)}}c&&E&64&&uS(x),wc(x,x.return);break;case 27:pS(x);case 26:case 5:Ji(v,x,c),c&&f===null&&E&4&&hS(x),wc(x,x.return);break;case 12:Ji(v,x,c);break;case 31:Ji(v,x,c),c&&E&4&&yS(v,x);break;case 13:Ji(v,x,c),c&&E&4&&bS(v,x);break;case 22:x.memoizedState===null&&Ji(v,x,c),wc(x,x.return);break;case 30:break;default:Ji(v,x,c)}o=o.sibling}}function mg(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&&cc(c))}function gg(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&cc(i))}function ni(i,o,c,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)wS(i,o,c,f),o=o.sibling}function wS(i,o,c,f){var v=o.flags;switch(o.tag){case 0:case 11:case 15:ni(i,o,c,f),v&2048&&Sc(9,o);break;case 1:ni(i,o,c,f);break;case 3:ni(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&&cc(i)));break;case 12:if(v&2048){ni(i,o,c,f),i=o.stateNode;try{var x=o.memoizedProps,E=x.id,A=x.onPostCommit;typeof A=="function"&&A(E,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(K){wt(o,o.return,K)}}else ni(i,o,c,f);break;case 31:ni(i,o,c,f);break;case 13:ni(i,o,c,f);break;case 23:break;case 22:x=o.stateNode,E=o.alternate,o.memoizedState!==null?x._visibility&2?ni(i,o,c,f):Cc(i,o):x._visibility&2?ni(i,o,c,f):(x._visibility|=2,Ua(i,o,c,f,(o.subtreeFlags&10256)!==0||!1)),v&2048&&mg(E,o);break;case 24:ni(i,o,c,f),v&2048&&gg(o.alternate,o);break;default:ni(i,o,c,f)}}function Ua(i,o,c,f,v){for(v=v&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var x=i,E=o,A=c,K=f,te=E.flags;switch(E.tag){case 0:case 11:case 15:Ua(x,E,A,K,v),Sc(8,E);break;case 23:break;case 22:var he=E.stateNode;E.memoizedState!==null?he._visibility&2?Ua(x,E,A,K,v):Cc(x,E):(he._visibility|=2,Ua(x,E,A,K,v)),v&&te&2048&&mg(E.alternate,E);break;case 24:Ua(x,E,A,K,v),v&&te&2048&&gg(E.alternate,E);break;default:Ua(x,E,A,K,v)}o=o.sibling}}function Cc(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:Cc(c,f),v&2048&&mg(f.alternate,f);break;case 24:Cc(c,f),v&2048&&gg(f.alternate,f);break;default:Cc(c,f)}o=o.sibling}}var kc=8192;function $a(i,o,c){if(i.subtreeFlags&kc)for(i=i.child;i!==null;)CS(i,o,c),i=i.sibling}function CS(i,o,c){switch(i.tag){case 26:$a(i,o,c),i.flags&kc&&i.memoizedState!==null&&tO(c,ti,i.memoizedState,i.memoizedProps);break;case 5:$a(i,o,c);break;case 3:case 4:var f=ti;ti=ch(i.stateNode.containerInfo),$a(i,o,c),ti=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=kc,kc=16777216,$a(i,o,c),kc=f):$a(i,o,c));break;default:$a(i,o,c)}}function kS(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 Ec(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];yn=f,RS(f,i)}kS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ES(i),i=i.sibling}function ES(i){switch(i.tag){case 0:case 11:case 15:Ec(i),i.flags&2048&&Os(9,i,i.return);break;case 3:Ec(i);break;case 12:Ec(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Xd(i)):Ec(i);break;default:Ec(i)}}function Xd(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];yn=f,RS(f,i)}kS(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Os(8,o,o.return),Xd(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Xd(o));break;default:Xd(o)}i=i.sibling}}function RS(i,o){for(;yn!==null;){var c=yn;switch(c.tag){case 0:case 11:case 15:Os(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:cc(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,yn=f;else e:for(c=i;yn!==null;){f=yn;var v=f.sibling,x=f.return;if(vS(f),f===c){yn=null;break e}if(v!==null){v.return=x,yn=v;break e}yn=x}}}var g4={getCacheForType:function(i){var o=An(nn),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return An(nn).controller.signal}},v4=typeof WeakMap=="function"?WeakMap:Map,mt=0,Nt=null,nt=null,ot=0,St=0,yr=null,Ls=!1,Wa=!1,vg=!1,es=0,Gt=0,js=0,zo=0,_g=0,br=0,Va=0,Rc=null,sr=null,yg=!1,Zd=0,TS=0,Qd=1/0,Jd=null,zs=null,dn=0,Ps=null,qa=null,ts=0,bg=0,xg=null,MS=null,Tc=0,Sg=null;function xr(){return(mt&2)!==0&&ot!==0?ot&-ot:z.T!==null?Tg():Jr()}function NS(){if(br===0)if((ot&536870912)===0||lt){var i=Jn;Jn<<=1,(Jn&3932160)===0&&(Jn=262144),br=i}else br=536870912;return i=vr.current,i!==null&&(i.flags|=32),br}function or(i,o,c){(i===Nt&&(St===2||St===9)||i.cancelPendingCommit!==null)&&(Ka(i,0),Bs(i,ot,br,!1)),fr(i,c),((mt&2)===0||i!==Nt)&&(i===Nt&&((mt&2)===0&&(zo|=c),Gt===4&&Bs(i,ot,br,!1)),_i(i))}function AS(i,o,c){if((mt&6)!==0)throw Error(r(327));var f=!c&&(o&127)===0&&(o&i.expiredLanes)===0||xe(i,o),v=f?b4(i,o):Cg(i,o,!0),x=f;do{if(v===0){Wa&&!f&&Bs(i,o,0,!1);break}else{if(c=i.current.alternate,x&&!_4(c)){v=Cg(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 A=i;v=Rc;var K=A.current.memoizedState.isDehydrated;if(K&&(Ka(A,E).flags|=256),E=Cg(A,E,!1),E!==2){if(vg&&!K){A.errorRecoveryDisabledLanes|=x,zo|=x,v=4;break e}x=sr,sr=v,x!==null&&(sr===null?sr=x:sr.push.apply(sr,x))}v=E}if(x=!1,v!==2)continue}}if(v===1){Ka(i,0),Bs(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:Bs(f,o,br,!Ls);break e;case 2:sr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(v=Zd+300-ie(),10<v)){if(Bs(f,o,br,!Ls),se(f,0,!0)!==0)break e;ts=o,f.timeoutHandle=lw(DS.bind(null,f,c,sr,Jd,yg,o,br,zo,Va,Ls,x,"Throttled",-0,0),v);break e}DS(f,c,sr,Jd,yg,o,br,zo,Va,Ls,x,null,-0,0)}}break}while(!0);_i(i)}function DS(i,o,c,f,v,x,E,A,K,te,he,me,re,le){if(i.timeoutHandle=-1,me=o.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hi},CS(o,x,me);var Ae=(x&62914560)===x?Zd-ie():(x&4194048)===x?TS-ie():0;if(Ae=nO(me,Ae),Ae!==null){ts=x,i.cancelPendingCommit=Ae(HS.bind(null,i,o,x,c,f,v,E,A,K,he,me,null,re,le)),Bs(i,x,E,!te);return}}HS(i,o,x,c,f,v,E,A,K)}function _4(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(!mr(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 Bs(i,o,c,f){o&=~_g,o&=~zo,i.suspendedLanes|=o,i.pingedLanes&=~o,f&&(i.warmLanes|=o),f=i.expirationTimes;for(var v=o;0<v;){var x=31-$e(v),E=1<<x;f[x]=-1,v&=~E}c!==0&&Qr(i,c,o)}function eh(){return(mt&6)===0?(Mc(0),!1):!0}function wg(){if(nt!==null){if(St===0)var i=nt.return;else i=nt,Wi=Ro=null,Im(i),Pa=null,dc=0,i=nt;for(;i!==null;)cS(i.alternate,i),i=i.return;nt=null}}function Ka(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,B4(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),ts=0,wg(),Nt=i,nt=c=Ui(i.current,null),ot=o,St=0,yr=null,Ls=!1,Wa=xe(i,o),vg=!1,Va=br=_g=zo=js=Gt=0,sr=Rc=null,yg=!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-$e(f),x=1<<v;o|=i[v],f&=~x}return es=o,xd(),c}function OS(i,o){qe=null,z.H=yc,o===za||o===Md?(o=Yx(),St=3):o===Rm?(o=Yx(),St=4):St=o===tg?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,yr=o,nt===null&&(Gt=1,$d(i,jr(o,i.current)))}function LS(){var i=vr.current;return i===null?!0:(ot&4194048)===ot?Ir===null:(ot&62914560)===ot||(ot&536870912)!==0?i===Ir:!1}function jS(){var i=z.H;return z.H=yc,i===null?yc:i}function zS(){var i=z.A;return z.A=g4,i}function th(){Gt=4,Ls||(ot&4194048)!==ot&&vr.current!==null||(Wa=!0),(js&134217727)===0&&(zo&134217727)===0||Nt===null||Bs(Nt,ot,br,!1)}function Cg(i,o,c){var f=mt;mt|=2;var v=jS(),x=zS();(Nt!==i||ot!==o)&&(Jd=null,Ka(i,o)),o=!1;var E=Gt;e:do try{if(St!==0&&nt!==null){var A=nt,K=yr;switch(St){case 8:wg(),E=6;break e;case 3:case 2:case 9:case 6:vr.current===null&&(o=!0);var te=St;if(St=0,yr=null,Ga(i,A,K,te),c&&Wa){E=0;break e}break;default:te=St,St=0,yr=null,Ga(i,A,K,te)}}y4(),E=Gt;break}catch(he){OS(i,he)}while(!0);return o&&i.shellSuspendCounter++,Wi=Ro=null,mt=f,z.H=v,z.A=x,nt===null&&(Nt=null,ot=0,xd()),E}function y4(){for(;nt!==null;)PS(nt)}function b4(i,o){var c=mt;mt|=2;var f=jS(),v=zS();Nt!==i||ot!==o?(Jd=null,Qd=ie()+500,Ka(i,o)):Wa=xe(i,o);e:do try{if(St!==0&&nt!==null){o=nt;var x=yr;t:switch(St){case 1:St=0,yr=null,Ga(i,o,x,1);break;case 2:case 9:if(Kx(x)){St=0,yr=null,BS(o);break}o=function(){St!==2&&St!==9||Nt!==i||(St=7),_i(i)},x.then(o,o);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:Kx(x)?(St=0,yr=null,BS(o)):(St=0,yr=null,Ga(i,o,x,7));break;case 5:var E=null;switch(nt.tag){case 26:E=nt.memoizedState;case 5:case 27:var A=nt;if(E?ww(E):A.stateNode.complete){St=0,yr=null;var K=A.sibling;if(K!==null)nt=K;else{var te=A.return;te!==null?(nt=te,nh(te)):nt=null}break t}}St=0,yr=null,Ga(i,o,x,5);break;case 6:St=0,yr=null,Ga(i,o,x,6);break;case 8:wg(),Gt=6;break e;default:throw Error(r(462))}}x4();break}catch(he){OS(i,he)}while(!0);return Wi=Ro=null,z.H=f,z.A=v,mt=c,nt!==null?0:(Nt=null,ot=0,xd(),Gt)}function x4(){for(;nt!==null&&!Be();)PS(nt)}function PS(i){var o=aS(i.alternate,i,es);i.memoizedProps=i.pendingProps,o===null?nh(i):nt=o}function BS(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=tS(c,o,o.pendingProps,o.type,void 0,ot);break;case 11:o=tS(c,o,o.pendingProps,o.type.render,o.ref,ot);break;case 5:Im(o);default:cS(c,o),o=nt=zx(o,es),o=aS(c,o,es)}i.memoizedProps=i.pendingProps,o===null?nh(i):nt=o}function Ga(i,o,c,f){Wi=Ro=null,Im(o),Pa=null,dc=0;var v=o.return;try{if(c4(i,v,o,c,ot)){Gt=1,$d(i,jr(c,i.current)),nt=null;return}}catch(x){if(v!==null)throw nt=v,x;Gt=1,$d(i,jr(c,i.current)),nt=null;return}o.flags&32768?(lt||f===1?i=!0:Wa||(ot&536870912)!==0?i=!1:(Ls=i=!0,(f===2||f===9||f===3||f===6)&&(f=vr.current,f!==null&&f.tag===13&&(f.flags|=16384))),IS(o,i)):nh(o)}function nh(i){var o=i;do{if((o.flags&32768)!==0){IS(o,Ls);return}i=o.return;var c=h4(o.alternate,o,es);if(c!==null){nt=c;return}if(o=o.sibling,o!==null){nt=o;return}nt=o=i}while(o!==null);Gt===0&&(Gt=5)}function IS(i,o){do{var c=f4(i.alternate,i);if(c!==null){c.flags&=32767,nt=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){nt=i;return}nt=i=c}while(i!==null);Gt=6,nt=null}function HS(i,o,c,f,v,x,E,A,K){i.cancelPendingCommit=null;do rh();while(dn!==0);if((mt&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(x=o.lanes|o.childLanes,x|=hm,un(i,c,x,E,A,K),i===Nt&&(nt=Nt=null,ot=0),qa=o,Ps=i,ts=c,bg=x,xg=v,MS=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,k4(Le,function(){return VS(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=z.T,z.T=null,v=q.p,q.p=2,E=mt,mt|=4;try{p4(i,o,c)}finally{mt=E,q.p=v,z.T=f}}dn=1,FS(),US(),$S()}}function FS(){if(dn===1){dn=0;var i=Ps,o=qa,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=z.T,z.T=null;var f=q.p;q.p=2;var v=mt;mt|=4;try{xS(o,i);var x=zg,E=Rx(i.containerInfo),A=x.focusedElem,K=x.selectionRange;if(E!==A&&A&&A.ownerDocument&&Ex(A.ownerDocument.documentElement,A)){if(K!==null&&am(A)){var te=K.start,he=K.end;if(he===void 0&&(he=te),"selectionStart"in A)A.selectionStart=te,A.selectionEnd=Math.min(he,A.value.length);else{var me=A.ownerDocument||document,re=me&&me.defaultView||window;if(re.getSelection){var le=re.getSelection(),Ae=A.textContent.length,Fe=Math.min(K.start,Ae),Rt=K.end===void 0?Fe:Math.min(K.end,Ae);!le.extend&&Fe>Rt&&(E=Rt,Rt=Fe,Fe=E);var J=kx(A,Fe),Y=kx(A,Rt);if(J&&Y&&(le.rangeCount!==1||le.anchorNode!==J.node||le.anchorOffset!==J.offset||le.focusNode!==Y.node||le.focusOffset!==Y.offset)){var ee=me.createRange();ee.setStart(J.node,J.offset),le.removeAllRanges(),Fe>Rt?(le.addRange(ee),le.extend(Y.node,Y.offset)):(ee.setEnd(Y.node,Y.offset),le.addRange(ee))}}}}for(me=[],le=A;le=le.parentNode;)le.nodeType===1&&me.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<me.length;A++){var fe=me[A];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}mh=!!jg,zg=jg=null}finally{mt=v,q.p=f,z.T=c}}i.current=o,dn=2}}function US(){if(dn===2){dn=0;var i=Ps,o=qa,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=z.T,z.T=null;var f=q.p;q.p=2;var v=mt;mt|=4;try{gS(i,o.alternate,o)}finally{mt=v,q.p=f,z.T=c}}dn=3}}function $S(){if(dn===4||dn===3){dn=0,$t();var i=Ps,o=qa,c=ts,f=MS;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?dn=5:(dn=0,qa=Ps=null,WS(i,i.pendingLanes));var v=i.pendingLanes;if(v===0&&(zs=null),Bi(c),o=o.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(oe,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=z.T,v=q.p,q.p=2,z.T=null;try{for(var x=i.onRecoverableError,E=0;E<f.length;E++){var A=f[E];x(A.value,{componentStack:A.stack})}}finally{z.T=o,q.p=v}}(ts&3)!==0&&rh(),_i(i),v=i.pendingLanes,(c&261930)!==0&&(v&42)!==0?i===Sg?Tc++:(Tc=0,Sg=i):Tc=0,Mc(0)}}function WS(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,cc(o)))}function rh(){return FS(),US(),$S(),VS()}function VS(){if(dn!==5)return!1;var i=Ps,o=bg;bg=0;var c=Bi(ts),f=z.T,v=q.p;try{q.p=32>c?32:c,z.T=null,c=xg,xg=null;var x=Ps,E=ts;if(dn=0,qa=Ps=null,ts=0,(mt&6)!==0)throw Error(r(331));var A=mt;if(mt|=4,ES(x.current),wS(x,x.current,E,c),mt=A,Mc(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(oe,x)}catch{}return!0}finally{q.p=v,z.T=f,WS(i,o)}}function qS(i,o,c){o=jr(c,o),o=eg(i.stateNode,o,2),i=Ns(i,o,2),i!==null&&(fr(i,2),_i(i))}function wt(i,o,c){if(i.tag===3)qS(i,i,c);else for(;o!==null;){if(o.tag===3){qS(o,i,c);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(zs===null||!zs.has(f))){i=jr(c,i),c=K1(2),f=Ns(o,c,2),f!==null&&(G1(c,f,o,i),fr(f,2),_i(f));break}}o=o.return}}function kg(i,o,c){var f=i.pingCache;if(f===null){f=i.pingCache=new v4;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)||(vg=!0,v.add(c),i=S4.bind(null,i,o,c),o.then(i,i))}function S4(i,o,c){var f=i.pingCache;f!==null&&f.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,Nt===i&&(ot&c)===c&&(Gt===4||Gt===3&&(ot&62914560)===ot&&300>ie()-Zd?(mt&2)===0&&Ka(i,0):_g|=c,Va===ot&&(Va=0)),_i(i)}function KS(i,o){o===0&&(o=et()),i=Co(i,o),i!==null&&(fr(i,o),_i(i))}function w4(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),KS(i,c)}function C4(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),KS(i,c)}function k4(i,o){return jt(i,o)}var ih=null,Ya=null,Eg=!1,sh=!1,Rg=!1,Is=0;function _i(i){i!==Ya&&i.next===null&&(Ya===null?ih=Ya=i:Ya=Ya.next=i),sh=!0,Eg||(Eg=!0,R4())}function Mc(i,o){if(!Rg&&sh){Rg=!0;do for(var c=!1,f=ih;f!==null;){if(i!==0){var v=f.pendingLanes;if(v===0)var x=0;else{var E=f.suspendedLanes,A=f.pingedLanes;x=(1<<31-$e(42|i)+1)-1,x&=v&~(E&~A),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,ZS(f,x))}else x=ot,x=se(f,f===Nt?x:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(x&3)===0||xe(f,x)||(c=!0,ZS(f,x));f=f.next}while(c);Rg=!1}}function E4(){GS()}function GS(){sh=Eg=!1;var i=0;Is!==0&&P4()&&(i=Is);for(var o=ie(),c=null,f=ih;f!==null;){var v=f.next,x=YS(f,o);x===0?(f.next=null,c===null?ih=v:c.next=v,v===null&&(Ya=c)):(c=f,(i!==0||(x&3)!==0)&&(sh=!0)),f=v}dn!==0&&dn!==5||Mc(i),Is!==0&&(Is=0)}function YS(i,o){for(var c=i.suspendedLanes,f=i.pingedLanes,v=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var E=31-$e(x),A=1<<E,K=v[E];K===-1?((A&c)===0||(A&f)!==0)&&(v[E]=Ve(A,o)):K<=o&&(i.expiredLanes|=A),x&=~A}if(o=Nt,c=ot,c=se(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,c===0||i===o&&(St===2||St===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&be(f),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||xe(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(f!==null&&be(f),Bi(c)){case 2:case 8:c=ye;break;case 32:c=Le;break;case 268435456:c=Ye;break;default:c=Le}return f=XS.bind(null,i),c=jt(c,f),i.callbackPriority=o,i.callbackNode=c,o}return f!==null&&f!==null&&be(f),i.callbackPriority=2,i.callbackNode=null,2}function XS(i,o){if(dn!==0&&dn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(rh()&&i.callbackNode!==c)return null;var f=ot;return f=se(i,i===Nt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(AS(i,f,o),YS(i,ie()),i.callbackNode!=null&&i.callbackNode===c?XS.bind(null,i):null)}function ZS(i,o){if(rh())return null;AS(i,o,!0)}function R4(){I4(function(){(mt&6)!==0?jt(ue,E4):GS()})}function Tg(){if(Is===0){var i=La;i===0&&(i=hr,hr<<=1,(hr&261888)===0&&(hr=256)),Is=i}return Is}function QS(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:fd(""+i)}function JS(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 T4(i,o,c,f,v){if(o==="submit"&&c&&c.stateNode===v){var x=QS((v[er]||null).action),E=f.submitter;E&&(o=(o=E[er]||null)?QS(o.formAction):E.getAttribute("formAction"),o!==null&&(x=o,E=null));var A=new vd("action","action",null,f,v);i.push({event:A,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Is!==0){var K=E?JS(v,E):new FormData(v);Gm(c,{pending:!0,data:K,method:v.method,action:x},null,K)}}else typeof x=="function"&&(A.preventDefault(),K=E?JS(v,E):new FormData(v),Gm(c,{pending:!0,data:K,method:v.method,action:x},x,K))},currentTarget:v}]})}}for(var Mg=0;Mg<dm.length;Mg++){var Ng=dm[Mg],M4=Ng.toLowerCase(),N4=Ng[0].toUpperCase()+Ng.slice(1);ei(M4,"on"+N4)}ei(Nx,"onAnimationEnd"),ei(Ax,"onAnimationIteration"),ei(Dx,"onAnimationStart"),ei("dblclick","onDoubleClick"),ei("focusin","onFocus"),ei("focusout","onBlur"),ei(q3,"onTransitionRun"),ei(K3,"onTransitionStart"),ei(G3,"onTransitionCancel"),ei(Ox,"onTransitionEnd"),ba("onMouseEnter",["mouseout","mouseover"]),ba("onMouseLeave",["mouseout","mouseover"]),ba("onPointerEnter",["pointerout","pointerover"]),ba("onPointerLeave",["pointerout","pointerover"]),bo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),bo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),bo("onBeforeInput",["compositionend","keypress","textInput","paste"]),bo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),bo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),bo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),A4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nc));function ew(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 A=f[E],K=A.instance,te=A.currentTarget;if(A=A.listener,K!==x&&v.isPropagationStopped())break e;x=A,v.currentTarget=te;try{x(v)}catch(he){bd(he)}v.currentTarget=null,x=K}else for(E=0;E<f.length;E++){if(A=f[E],K=A.instance,te=A.currentTarget,A=A.listener,K!==x&&v.isPropagationStopped())break e;x=A,v.currentTarget=te;try{x(v)}catch(he){bd(he)}v.currentTarget=null,x=K}}}}function rt(i,o){var c=o[$p];c===void 0&&(c=o[$p]=new Set);var f=i+"__bubble";c.has(f)||(tw(o,i,2,!1),c.add(f))}function Ag(i,o,c){var f=0;o&&(f|=4),tw(c,i,f,o)}var oh="_reactListening"+Math.random().toString(36).slice(2);function Dg(i){if(!i[oh]){i[oh]=!0,G0.forEach(function(c){c!=="selectionchange"&&(A4.has(c)||Ag(c,!1,i),Ag(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[oh]||(o[oh]=!0,Ag("selectionchange",!1,o))}}function tw(i,o,c,f){switch(Nw(o)){case 2:var v=sO;break;case 8:v=oO;break;default:v=Kg}c=v.bind(null,o,c,i),v=void 0,!Qp||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 Og(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 A=f.stateNode.containerInfo;if(A===v)break;if(E===4)for(E=f.return;E!==null;){var K=E.tag;if((K===3||K===4)&&E.stateNode.containerInfo===v)return;E=E.return}for(;A!==null;){if(E=va(A),E===null)return;if(K=E.tag,K===5||K===6||K===26||K===27){f=x=E;continue e}A=A.parentNode}}f=f.return}ox(function(){var te=x,he=Xp(c),me=[];e:{var re=Lx.get(i);if(re!==void 0){var le=vd,Ae=i;switch(i){case"keypress":if(md(c)===0)break e;case"keydown":case"keyup":le=C3;break;case"focusin":Ae="focus",le=nm;break;case"focusout":Ae="blur",le=nm;break;case"beforeblur":case"afterblur":le=nm;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=cx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=h3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=R3;break;case Nx:case Ax:case Dx:le=m3;break;case Ox:le=M3;break;case"scroll":case"scrollend":le=u3;break;case"wheel":le=A3;break;case"copy":case"cut":case"paste":le=v3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=dx;break;case"toggle":case"beforetoggle":le=O3}var Fe=(o&4)!==0,Rt=!Fe&&(i==="scroll"||i==="scrollend"),J=Fe?re!==null?re+"Capture":null:re;Fe=[];for(var Y=te,ee;Y!==null;){var fe=Y;if(ee=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||ee===null||J===null||(fe=Ql(Y,J),fe!=null&&Fe.push(Ac(Y,fe,ee))),Rt)break;Y=Y.return}0<Fe.length&&(re=new le(re,Ae,null,c,he),me.push({event:re,listeners:Fe}))}}if((o&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",le=i==="mouseout"||i==="pointerout",re&&c!==Yp&&(Ae=c.relatedTarget||c.fromElement)&&(va(Ae)||Ae[ga]))break e;if((le||re)&&(re=he.window===he?he:(re=he.ownerDocument)?re.defaultView||re.parentWindow:window,le?(Ae=c.relatedTarget||c.toElement,le=te,Ae=Ae?va(Ae):null,Ae!==null&&(Rt=a(Ae),Fe=Ae.tag,Ae!==Rt||Fe!==5&&Fe!==27&&Fe!==6)&&(Ae=null)):(le=null,Ae=te),le!==Ae)){if(Fe=cx,fe="onMouseLeave",J="onMouseEnter",Y="mouse",(i==="pointerout"||i==="pointerover")&&(Fe=dx,fe="onPointerLeave",J="onPointerEnter",Y="pointer"),Rt=le==null?re:Zl(le),ee=Ae==null?re:Zl(Ae),re=new Fe(fe,Y+"leave",le,c,he),re.target=Rt,re.relatedTarget=ee,fe=null,va(he)===te&&(Fe=new Fe(J,Y+"enter",Ae,c,he),Fe.target=ee,Fe.relatedTarget=Rt,fe=Fe),Rt=fe,le&&Ae)t:{for(Fe=D4,J=le,Y=Ae,ee=0,fe=J;fe;fe=Fe(fe))ee++;fe=0;for(var Pe=Y;Pe;Pe=Fe(Pe))fe++;for(;0<ee-fe;)J=Fe(J),ee--;for(;0<fe-ee;)Y=Fe(Y),fe--;for(;ee--;){if(J===Y||Y!==null&&J===Y.alternate){Fe=J;break t}J=Fe(J),Y=Fe(Y)}Fe=null}else Fe=null;le!==null&&nw(me,re,le,Fe,!1),Ae!==null&&Rt!==null&&nw(me,Rt,Ae,Fe,!0)}}e:{if(re=te?Zl(te):window,le=re.nodeName&&re.nodeName.toLowerCase(),le==="select"||le==="input"&&re.type==="file")var ft=yx;else if(vx(re))if(bx)ft=$3;else{ft=F3;var je=H3}else le=re.nodeName,!le||le.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?te&&Gp(te.elementType)&&(ft=yx):ft=U3;if(ft&&(ft=ft(i,te))){_x(me,ft,c,he);break e}je&&je(i,re,te),i==="focusout"&&te&&re.type==="number"&&te.memoizedProps.value!=null&&Kp(re,"number",re.value)}switch(je=te?Zl(te):window,i){case"focusin":(vx(je)||je.contentEditable==="true")&&(Ea=je,lm=te,oc=null);break;case"focusout":oc=lm=Ea=null;break;case"mousedown":cm=!0;break;case"contextmenu":case"mouseup":case"dragend":cm=!1,Tx(me,c,he);break;case"selectionchange":if(V3)break;case"keydown":case"keyup":Tx(me,c,he)}var Ke;if(im)e:{switch(i){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else ka?mx(i,c)&&(at="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(at="onCompositionStart");at&&(hx&&c.locale!=="ko"&&(ka||at!=="onCompositionStart"?at==="onCompositionEnd"&&ka&&(Ke=ax()):(ws=he,Jp="value"in ws?ws.value:ws.textContent,ka=!0)),je=ah(te,at),0<je.length&&(at=new ux(at,i,null,c,he),me.push({event:at,listeners:je}),Ke?at.data=Ke:(Ke=gx(c),Ke!==null&&(at.data=Ke)))),(Ke=j3?z3(i,c):P3(i,c))&&(at=ah(te,"onBeforeInput"),0<at.length&&(je=new ux("onBeforeInput","beforeinput",null,c,he),me.push({event:je,listeners:at}),je.data=Ke)),T4(me,i,te,c,he)}ew(me,o)})}function Ac(i,o,c){return{instance:i,listener:o,currentTarget:c}}function ah(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=Ql(i,c),v!=null&&f.unshift(Ac(i,v,x)),v=Ql(i,o),v!=null&&f.push(Ac(i,v,x))),i.tag===3)return f;i=i.return}return[]}function D4(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function nw(i,o,c,f,v){for(var x=o._reactName,E=[];c!==null&&c!==f;){var A=c,K=A.alternate,te=A.stateNode;if(A=A.tag,K!==null&&K===f)break;A!==5&&A!==26&&A!==27||te===null||(K=te,v?(te=Ql(c,x),te!=null&&E.unshift(Ac(c,te,K))):v||(te=Ql(c,x),te!=null&&E.push(Ac(c,te,K)))),c=c.return}E.length!==0&&i.push({event:o,listeners:E})}var O4=/\r\n?/g,L4=/\u0000|\uFFFD/g;function rw(i){return(typeof i=="string"?i:""+i).replace(O4,`
|
|
49
|
-
`).replace(L4,"")}function iw(i,o){return o=rw(o),rw(i)===o}function Et(i,o,c,f,v,x){switch(c){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||Sa(i,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&Sa(i,""+f);break;case"className":dd(i,"class",f);break;case"tabIndex":dd(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":dd(i,c,f);break;case"style":ix(i,f,x);break;case"data":if(o!=="object"){dd(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=fd(""+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"&&Et(i,o,"name",v.name,v,null),Et(i,o,"formEncType",v.formEncType,v,null),Et(i,o,"formMethod",v.formMethod,v,null),Et(i,o,"formTarget",v.formTarget,v,null)):(Et(i,o,"encType",v.encType,v,null),Et(i,o,"method",v.method,v,null),Et(i,o,"target",v.target,v,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=fd(""+f),i.setAttribute(c,f);break;case"onClick":f!=null&&(i.onclick=Hi);break;case"onScroll":f!=null&&rt("scroll",i);break;case"onScrollEnd":f!=null&&rt("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=fd(""+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":rt("beforetoggle",i),rt("toggle",i),ud(i,"popover",f);break;case"xlinkActuate":Ii(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Ii(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Ii(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Ii(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Ii(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Ii(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Ii(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Ii(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Ii(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":ud(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=l3.get(c)||c,ud(i,c,f))}}function Lg(i,o,c,f,v,x){switch(c){case"style":ix(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"?Sa(i,f):(typeof f=="number"||typeof f=="bigint")&&Sa(i,""+f);break;case"onScroll":f!=null&&rt("scroll",i);break;case"onScrollEnd":f!=null&&rt("scrollend",i);break;case"onClick":f!=null&&(i.onclick=Hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Y0.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[er]||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,""):ud(i,c,f)}}}function On(i,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",i),rt("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:Et(i,o,x,E,c,null)}}v&&Et(i,o,"srcSet",c.srcSet,c,null),f&&Et(i,o,"src",c.src,c,null);return;case"input":rt("invalid",i);var A=x=E=v=null,K=null,te=null;for(f in c)if(c.hasOwnProperty(f)){var he=c[f];if(he!=null)switch(f){case"name":v=he;break;case"type":E=he;break;case"checked":K=he;break;case"defaultChecked":te=he;break;case"value":x=he;break;case"defaultValue":A=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,o));break;default:Et(i,o,f,he,c,null)}}ex(i,x,A,K,te,E,v,!1);return;case"select":rt("invalid",i),f=E=x=null;for(v in c)if(c.hasOwnProperty(v)&&(A=c[v],A!=null))switch(v){case"value":x=A;break;case"defaultValue":E=A;break;case"multiple":f=A;default:Et(i,o,v,A,c,null)}o=x,c=E,i.multiple=!!f,o!=null?xa(i,!!f,o,!1):c!=null&&xa(i,!!f,c,!0);return;case"textarea":rt("invalid",i),x=v=f=null;for(E in c)if(c.hasOwnProperty(E)&&(A=c[E],A!=null))switch(E){case"value":f=A;break;case"defaultValue":v=A;break;case"children":x=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:Et(i,o,E,A,c,null)}nx(i,f,v,x);return;case"option":for(K in c)if(c.hasOwnProperty(K)&&(f=c[K],f!=null))switch(K){case"selected":i.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Et(i,o,K,f,c,null)}return;case"dialog":rt("beforetoggle",i),rt("toggle",i),rt("cancel",i),rt("close",i);break;case"iframe":case"object":rt("load",i);break;case"video":case"audio":for(f=0;f<Nc.length;f++)rt(Nc[f],i);break;case"image":rt("error",i),rt("load",i);break;case"details":rt("toggle",i);break;case"embed":case"source":case"link":rt("error",i),rt("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:Et(i,o,te,f,c,null)}return;default:if(Gp(o)){for(he in c)c.hasOwnProperty(he)&&(f=c[he],f!==void 0&&Lg(i,o,he,f,c,void 0));return}}for(A in c)c.hasOwnProperty(A)&&(f=c[A],f!=null&&Et(i,o,A,f,c,null))}function j4(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,A=null,K=null,te=null,he=null;for(le in c){var me=c[le];if(c.hasOwnProperty(le)&&me!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":K=me;default:f.hasOwnProperty(le)||Et(i,o,le,null,f,me)}}for(var re in f){var le=f[re];if(me=c[re],f.hasOwnProperty(re)&&(le!=null||me!=null))switch(re){case"type":x=le;break;case"name":v=le;break;case"checked":te=le;break;case"defaultChecked":he=le;break;case"value":E=le;break;case"defaultValue":A=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,o));break;default:le!==me&&Et(i,o,re,le,f,me)}}qp(i,E,A,K,te,he,x,v);return;case"select":le=E=A=re=null;for(x in c)if(K=c[x],c.hasOwnProperty(x)&&K!=null)switch(x){case"value":break;case"multiple":le=K;default:f.hasOwnProperty(x)||Et(i,o,x,null,f,K)}for(v in f)if(x=f[v],K=c[v],f.hasOwnProperty(v)&&(x!=null||K!=null))switch(v){case"value":re=x;break;case"defaultValue":A=x;break;case"multiple":E=x;default:x!==K&&Et(i,o,v,x,f,K)}o=A,c=E,f=le,re!=null?xa(i,!!c,re,!1):!!f!=!!c&&(o!=null?xa(i,!!c,o,!0):xa(i,!!c,c?[]:"",!1));return;case"textarea":le=re=null;for(A in c)if(v=c[A],c.hasOwnProperty(A)&&v!=null&&!f.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Et(i,o,A,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":re=v;break;case"defaultValue":le=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==x&&Et(i,o,E,v,f,x)}tx(i,re,le);return;case"option":for(var Ae in c)if(re=c[Ae],c.hasOwnProperty(Ae)&&re!=null&&!f.hasOwnProperty(Ae))switch(Ae){case"selected":i.selected=!1;break;default:Et(i,o,Ae,null,f,re)}for(K in f)if(re=f[K],le=c[K],f.hasOwnProperty(K)&&re!==le&&(re!=null||le!=null))switch(K){case"selected":i.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Et(i,o,K,re,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 Fe in c)re=c[Fe],c.hasOwnProperty(Fe)&&re!=null&&!f.hasOwnProperty(Fe)&&Et(i,o,Fe,null,f,re);for(te in f)if(re=f[te],le=c[te],f.hasOwnProperty(te)&&re!==le&&(re!=null||le!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,o));break;default:Et(i,o,te,re,f,le)}return;default:if(Gp(o)){for(var Rt in c)re=c[Rt],c.hasOwnProperty(Rt)&&re!==void 0&&!f.hasOwnProperty(Rt)&&Lg(i,o,Rt,void 0,f,re);for(he in f)re=f[he],le=c[he],!f.hasOwnProperty(he)||re===le||re===void 0&&le===void 0||Lg(i,o,he,re,f,le);return}}for(var J in c)re=c[J],c.hasOwnProperty(J)&&re!=null&&!f.hasOwnProperty(J)&&Et(i,o,J,null,f,re);for(me in f)re=f[me],le=c[me],!f.hasOwnProperty(me)||re===le||re==null&&le==null||Et(i,o,me,re,f,le)}function sw(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function z4(){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,A=v.duration;if(x&&A&&sw(E)){for(E=0,A=v.responseEnd,f+=1;f<c.length;f++){var K=c[f],te=K.startTime;if(te>A)break;var he=K.transferSize,me=K.initiatorType;he&&sw(me)&&(K=K.responseEnd,E+=he*(K<A?1:(A-te)/(K-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 jg=null,zg=null;function lh(i){return i.nodeType===9?i:i.ownerDocument}function ow(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 aw(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 Pg(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 Bg=null;function P4(){var i=window.event;return i&&i.type==="popstate"?i===Bg?!1:(Bg=i,!0):(Bg=null,!1)}var lw=typeof setTimeout=="function"?setTimeout:void 0,B4=typeof clearTimeout=="function"?clearTimeout:void 0,cw=typeof Promise=="function"?Promise:void 0,I4=typeof queueMicrotask=="function"?queueMicrotask:typeof cw<"u"?function(i){return cw.resolve(null).then(i).catch(H4)}:lw;function H4(i){setTimeout(function(){throw i})}function Hs(i){return i==="head"}function uw(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),Ja(o);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")Dc(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,Dc(c);for(var x=c.firstChild;x;){var E=x.nextSibling,A=x.nodeName;x[Xl]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=E}}else c==="body"&&Dc(i.ownerDocument.body);c=v}while(c);Ja(o)}function dw(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 Ig(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":Ig(c),Wp(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function F4(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[Xl])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=Hr(i.nextSibling),i===null)break}return null}function U4(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=Hr(i.nextSibling),i===null))return null;return i}function hw(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Hr(i.nextSibling),i===null))return null;return i}function Hg(i){return i.data==="$?"||i.data==="$~"}function Fg(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function $4(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 Hr(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 Ug=null;function fw(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return Hr(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function pw(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 mw(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 Dc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);Wp(i)}var Fr=new Map,gw=new Set;function ch(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var ns=q.d;q.d={f:W4,r:V4,D:q4,C:K4,L:G4,m:Y4,X:Z4,S:X4,M:Q4};function W4(){var i=ns.f(),o=eh();return i||o}function V4(i){var o=_a(i);o!==null&&o.tag===5&&o.type==="form"?O1(o):ns.r(i)}var Xa=typeof document>"u"?null:document;function vw(i,o,c){var f=Xa;if(f&&typeof o=="string"&&o){var v=Or(o);v='link[rel="'+i+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),gw.has(v)||(gw.add(v),i={rel:i,crossOrigin:c,href:o},f.querySelector(v)===null&&(o=f.createElement("link"),On(o,"link",i),_n(o),f.head.appendChild(o)))}}function q4(i){ns.D(i),vw("dns-prefetch",i,null)}function K4(i,o){ns.C(i,o),vw("preconnect",i,o)}function G4(i,o,c){ns.L(i,o,c);var f=Xa;if(f&&i&&o){var v='link[rel="preload"][as="'+Or(o)+'"]';o==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+Or(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+Or(c.imageSizes)+'"]')):v+='[href="'+Or(i)+'"]';var x=v;switch(o){case"style":x=Za(i);break;case"script":x=Qa(i)}Fr.has(x)||(i=p({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),Fr.set(x,i),f.querySelector(v)!==null||o==="style"&&f.querySelector(Oc(x))||o==="script"&&f.querySelector(Lc(x))||(o=f.createElement("link"),On(o,"link",i),_n(o),f.head.appendChild(o)))}}function Y4(i,o){ns.m(i,o);var c=Xa;if(c&&i){var f=o&&typeof o.as=="string"?o.as:"script",v='link[rel="modulepreload"][as="'+Or(f)+'"][href="'+Or(i)+'"]',x=v;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Qa(i)}if(!Fr.has(x)&&(i=p({rel:"modulepreload",href:i},o),Fr.set(x,i),c.querySelector(v)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Lc(x)))return}f=c.createElement("link"),On(f,"link",i),_n(f),c.head.appendChild(f)}}}function X4(i,o,c){ns.S(i,o,c);var f=Xa;if(f&&i){var v=ya(f).hoistableStyles,x=Za(i);o=o||"default";var E=v.get(x);if(!E){var A={loading:0,preload:null};if(E=f.querySelector(Oc(x)))A.loading=5;else{i=p({rel:"stylesheet",href:i,"data-precedence":o},c),(c=Fr.get(x))&&$g(i,c);var K=E=f.createElement("link");_n(K),On(K,"link",i),K._p=new Promise(function(te,he){K.onload=te,K.onerror=he}),K.addEventListener("load",function(){A.loading|=1}),K.addEventListener("error",function(){A.loading|=2}),A.loading|=4,uh(E,o,f)}E={type:"stylesheet",instance:E,count:1,state:A},v.set(x,E)}}}function Z4(i,o){ns.X(i,o);var c=Xa;if(c&&i){var f=ya(c).hoistableScripts,v=Qa(i),x=f.get(v);x||(x=c.querySelector(Lc(v)),x||(i=p({src:i,async:!0},o),(o=Fr.get(v))&&Wg(i,o),x=c.createElement("script"),_n(x),On(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function Q4(i,o){ns.M(i,o);var c=Xa;if(c&&i){var f=ya(c).hoistableScripts,v=Qa(i),x=f.get(v);x||(x=c.querySelector(Lc(v)),x||(i=p({src:i,async:!0,type:"module"},o),(o=Fr.get(v))&&Wg(i,o),x=c.createElement("script"),_n(x),On(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function _w(i,o,c,f){var v=(v=ae.current)?ch(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=Za(c.href),c=ya(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=Za(c.href);var x=ya(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(Oc(i)))&&!x._p&&(E.instance=x,E.state.loading=5),Fr.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},Fr.set(i,c),x||J4(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=Qa(c),c=ya(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 Za(i){return'href="'+Or(i)+'"'}function Oc(i){return'link[rel="stylesheet"]['+i+"]"}function yw(i){return p({},i,{"data-precedence":i.precedence,precedence:null})}function J4(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}),On(o,"link",c),_n(o),i.head.appendChild(o))}function Qa(i){return'[src="'+Or(i)+'"]'}function Lc(i){return"script[async]"+i}function bw(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var f=i.querySelector('style[data-href~="'+Or(c.href)+'"]');if(f)return o.instance=f,_n(f),f;var v=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),_n(f),On(f,"style",v),uh(f,c.precedence,i),o.instance=f;case"stylesheet":v=Za(c.href);var x=i.querySelector(Oc(v));if(x)return o.state.loading|=4,o.instance=x,_n(x),x;f=yw(c),(v=Fr.get(v))&&$g(f,v),x=(i.ownerDocument||i).createElement("link"),_n(x);var E=x;return E._p=new Promise(function(A,K){E.onload=A,E.onerror=K}),On(x,"link",f),o.state.loading|=4,uh(x,c.precedence,i),o.instance=x;case"script":return x=Qa(c.src),(v=i.querySelector(Lc(x)))?(o.instance=v,_n(v),v):(f=c,(v=Fr.get(x))&&(f=p({},c),Wg(f,v)),i=i.ownerDocument||i,v=i.createElement("script"),_n(v),On(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,uh(f,c.precedence,i));return o.instance}function uh(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 A=f[E];if(A.dataset.precedence===o)x=A;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 $g(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function Wg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var dh=null;function xw(i,o,c){if(dh===null){var f=new Map,v=dh=new Map;v.set(c,f)}else v=dh,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[Xl]||x[Mn]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var E=x.getAttribute(o)||"";E=i+E;var A=f.get(E);A?A.push(x):f.set(E,[x])}}return f}function Sw(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function eO(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 ww(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function tO(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=Za(f.href),x=o.querySelector(Oc(v));if(x){o=x._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=hh.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=x,_n(x);return}x=o.ownerDocument||o,f=yw(f),(v=Fr.get(v))&&$g(f,v),x=x.createElement("link"),_n(x);var E=x;E._p=new Promise(function(A,K){E.onload=A,E.onerror=K}),On(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=hh.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var Vg=0;function nO(i,o){return i.stylesheets&&i.count===0&&ph(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var f=setTimeout(function(){if(i.stylesheets&&ph(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+o);0<i.imgBytes&&Vg===0&&(Vg=62500*z4());var v=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&ph(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>Vg?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(v)}}:null}function hh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ph(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var fh=null;function ph(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,fh=new Map,o.forEach(rO,i),fh=null,hh.call(i))}function rO(i,o){if(!(o.state.loading&4)){var c=fh.get(i);if(c)var f=c.get(null);else{c=new Map,fh.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=hh.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 jc={$$typeof:R,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function iO(i,o,c,f,v,x,E,A,K){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=ht(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ht(0),this.hiddenUpdates=ht(null),this.identifierPrefix=f,this.onUncaughtError=v,this.onCaughtError=x,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function Cw(i,o,c,f,v,x,E,A,K,te,he,me){return i=new iO(i,o,c,E,K,te,he,me,A),o=1,x===!0&&(o|=24),x=gr(3,null,null,o),i.current=x,x.stateNode=i,o=Cm(),o.refCount++,i.pooledCache=o,o.refCount++,x.memoizedState={element:f,isDehydrated:c,cache:o},Tm(x),i}function kw(i){return i?(i=Ma,i):Ma}function Ew(i,o,c,f,v,x){v=kw(v),f.context===null?f.context=v:f.pendingContext=v,f=Ms(o),f.payload={element:c},x=x===void 0?null:x,x!==null&&(f.callback=x),c=Ns(i,f,o),c!==null&&(or(c,i,o),fc(c,i,o))}function Rw(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function qg(i,o){Rw(i,o),(i=i.alternate)&&Rw(i,o)}function Tw(i){if(i.tag===13||i.tag===31){var o=Co(i,67108864);o!==null&&or(o,i,67108864),qg(i,67108864)}}function Mw(i){if(i.tag===13||i.tag===31){var o=xr();o=Pi(o);var c=Co(i,o);c!==null&&or(c,i,o),qg(i,o)}}var mh=!0;function sO(i,o,c,f){var v=z.T;z.T=null;var x=q.p;try{q.p=2,Kg(i,o,c,f)}finally{q.p=x,z.T=v}}function oO(i,o,c,f){var v=z.T;z.T=null;var x=q.p;try{q.p=8,Kg(i,o,c,f)}finally{q.p=x,z.T=v}}function Kg(i,o,c,f){if(mh){var v=Gg(f);if(v===null)Og(i,o,f,gh,c),Aw(i,f);else if(lO(v,i,o,c,f))f.stopPropagation();else if(Aw(i,f),o&4&&-1<aO.indexOf(i)){for(;v!==null;){var x=_a(v);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var E=It(x.pendingLanes);if(E!==0){var A=x;for(A.pendingLanes|=2,A.entangledLanes|=2;E;){var K=1<<31-$e(E);A.entanglements[1]|=K,E&=~K}_i(x),(mt&6)===0&&(Qd=ie()+500,Mc(0))}}break;case 31:case 13:A=Co(x,2),A!==null&&or(A,x,2),eh(),qg(x,2)}if(x=Gg(f),x===null&&Og(i,o,f,gh,c),x===v)break;v=x}v!==null&&f.stopPropagation()}else Og(i,o,f,null,c)}}function Gg(i){return i=Xp(i),Yg(i)}var gh=null;function Yg(i){if(gh=null,i=va(i),i!==null){var o=a(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=l(o),i!==null)return i;i=null}else if(c===31){if(i=u(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return gh=i,null}function Nw(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(ct()){case ue:return 2;case ye:return 8;case Le:case He:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Xg=!1,Fs=null,Us=null,$s=null,zc=new Map,Pc=new Map,Ws=[],aO="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 Aw(i,o){switch(i){case"focusin":case"focusout":Fs=null;break;case"dragenter":case"dragleave":Us=null;break;case"mouseover":case"mouseout":$s=null;break;case"pointerover":case"pointerout":zc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pc.delete(o.pointerId)}}function Bc(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=_a(o),o!==null&&Tw(o)),i):(i.eventSystemFlags|=f,o=i.targetContainers,v!==null&&o.indexOf(v)===-1&&o.push(v),i)}function lO(i,o,c,f,v){switch(o){case"focusin":return Fs=Bc(Fs,i,o,c,f,v),!0;case"dragenter":return Us=Bc(Us,i,o,c,f,v),!0;case"mouseover":return $s=Bc($s,i,o,c,f,v),!0;case"pointerover":var x=v.pointerId;return zc.set(x,Bc(zc.get(x)||null,i,o,c,f,v)),!0;case"gotpointercapture":return x=v.pointerId,Pc.set(x,Bc(Pc.get(x)||null,i,o,c,f,v)),!0}return!1}function Dw(i){var o=va(i.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){i.blockedOn=o,Ss(i.priority,function(){Mw(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,Ss(i.priority,function(){Mw(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 vh(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=Gg(i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);Yp=f,c.target.dispatchEvent(f),Yp=null}else return o=_a(c),o!==null&&Tw(o),i.blockedOn=c,!1;o.shift()}return!0}function Ow(i,o,c){vh(i)&&c.delete(o)}function cO(){Xg=!1,Fs!==null&&vh(Fs)&&(Fs=null),Us!==null&&vh(Us)&&(Us=null),$s!==null&&vh($s)&&($s=null),zc.forEach(Ow),Pc.forEach(Ow)}function _h(i,o){i.blockedOn===o&&(i.blockedOn=null,Xg||(Xg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,cO)))}var yh=null;function Lw(i){yh!==i&&(yh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){yh===i&&(yh=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(Yg(f||c)===null)continue;break}var x=_a(c);x!==null&&(i.splice(o,3),o-=3,Gm(x,{pending:!0,data:v,method:c.method,action:f},f,v))}}))}function Ja(i){function o(K){return _h(K,i)}Fs!==null&&_h(Fs,i),Us!==null&&_h(Us,i),$s!==null&&_h($s,i),zc.forEach(o),Pc.forEach(o);for(var c=0;c<Ws.length;c++){var f=Ws[c];f.blockedOn===i&&(f.blockedOn=null)}for(;0<Ws.length&&(c=Ws[0],c.blockedOn===null);)Dw(c),c.blockedOn===null&&Ws.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[er]||null;if(typeof x=="function")E||Lw(c);else if(E){var A=null;if(x&&x.hasAttribute("formAction")){if(v=x,E=x[er]||null)A=E.formAction;else if(Yg(v)!==null)continue}else A=E.action;typeof A=="function"?c[f+1]=A:(c.splice(f,3),f-=3),Lw(c)}}}function jw(){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 Zg(i){this._internalRoot=i}bh.prototype.render=Zg.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,f=xr();Ew(c,f,i,o,null,null)},bh.prototype.unmount=Zg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;Ew(i.current,2,null,i,null,null),eh(),o[ga]=null}};function bh(i){this._internalRoot=i}bh.prototype.unstable_scheduleHydration=function(i){if(i){var o=Jr();i={blockedOn:null,target:i,priority:o};for(var c=0;c<Ws.length&&o!==0&&o<Ws[c].priority;c++);Ws.splice(c,0,i),c===0&&Dw(i)}};var zw=t.version;if(zw!=="19.2.1")throw Error(r(527,zw,"19.2.1"));q.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?m(i):null,i=i===null?null:i.stateNode,i};var uO={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xh.isDisabled&&xh.supportsFiber)try{oe=xh.inject(uO),Me=xh}catch{}}return Fc.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,f="",v=$1,x=W1,E=V1;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=Cw(i,1,!1,null,null,c,f,null,v,x,E,jw),i[ga]=o.current,Dg(i),new Zg(o)},Fc.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var f=!1,v="",x=$1,E=W1,A=V1,K=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&&(A=c.onRecoverableError),c.formState!==void 0&&(K=c.formState)),o=Cw(i,1,!0,o,c??null,f,v,K,x,E,A,jw),o.context=kw(null),c=o.current,f=xr(),f=Pi(f),v=Ms(f),v.callback=null,Ns(c,v,f),c=f,o.current.lanes=c,fr(o,c),_i(o),i[ga]=o.current,Dg(i),new bh(o)},Fc.version="19.2.1",Fc}var Xw;function SO(){if(Xw)return ev.exports;Xw=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(),ev.exports=xO(),ev.exports}var wO=SO();/**
|
|
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 Zw="popstate";function Qw(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function CO(e={}){function t(r,s){var d;let a=(d=s.state)==null?void 0:d.masked,{pathname:l,search:u,hash:h}=a||r.location;return p_("",{pathname:l,search:u,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:ku(s)}return EO(t,n,null,e)}function Ft(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function li(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kO(){return Math.random().toString(36).substring(2,10)}function Jw(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 p_(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Nl(t):t,state:n,key:t&&t.key||r||kO(),unstable_mask:s}}function ku({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 Nl(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 EO(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:a=!1}=r,l=s.history,u="POP",h=null,d=m();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function m(){return(l.state||{idx:null}).idx}function p(){u="POP";let C=m(),k=C==null?null:C-d;d=C,h&&h({action:u,location:w.location,delta:k})}function _(C,k){u="PUSH";let T=Qw(C)?C:p_(w.location,C,k);d=m()+1;let R=Jw(T,d),M=w.createHref(T.unstable_mask||T);try{l.pushState(R,"",M)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;s.location.assign(M)}a&&h&&h({action:u,location:w.location,delta:1})}function b(C,k){u="REPLACE";let T=Qw(C)?C:p_(w.location,C,k);d=m();let R=Jw(T,d),M=w.createHref(T.unstable_mask||T);l.replaceState(R,"",M),a&&h&&h({action:u,location:w.location,delta:0})}function S(C){return RO(C)}let w={get action(){return u},get location(){return e(s,l)},listen(C){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(Zw,p),h=C,()=>{s.removeEventListener(Zw,p),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:b,go(C){return l.go(C)}};return w}function RO(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ft(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ku(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function ZE(e,t,n="/"){return TO(e,t,n,!1)}function TO(e,t,n,r){let s=typeof t=="string"?Nl(t):t,a=hs(s.pathname||"/",n);if(a==null)return null;let l=QE(e);MO(l);let u=null;for(let h=0;u==null&&h<l.length;++h){let d=HO(a);u=BO(l[h],d,r)}return u}function QE(e,t=[],n=[],r="",s=!1){let a=(l,u,h=s,d)=>{let m={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&h)return;Ft(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let p=Mi([r,m.relativePath]),_=n.concat(m);l.children&&l.children.length>0&&(Ft(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),QE(l.children,t,_,p,h)),!(l.path==null&&!l.index)&&t.push({path:p,score:zO(p,l.index),routesMeta:_})};return e.forEach((l,u)=>{var h;if(l.path===""||!((h=l.path)!=null&&h.includes("?")))a(l,u);else for(let d of JE(l.path))a(l,u,!0,d)}),t}function JE(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let l=JE(r.join("/")),u=[];return u.push(...l.map(h=>h===""?a:[a,h].join("/"))),s&&u.push(...l),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function MO(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:PO(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var NO=/^:[\w-]+$/,AO=3,DO=2,OO=1,LO=10,jO=-2,eC=e=>e==="*";function zO(e,t){let n=e.split("/"),r=n.length;return n.some(eC)&&(r+=jO),t&&(r+=DO),n.filter(s=>!eC(s)).reduce((s,a)=>s+(NO.test(a)?AO:a===""?OO:LO),r)}function PO(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 BO(e,t,n=!1){let{routesMeta:r}=e,s={},a="/",l=[];for(let u=0;u<r.length;++u){let h=r[u],d=u===r.length-1,m=a==="/"?t:t.slice(a.length)||"/",p=xf({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},m),_=h.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=xf({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!p)return null;Object.assign(s,p.params),l.push({params:s,pathname:Mi([a,p.pathname]),pathnameBase:WO(Mi([a,p.pathnameBase])),route:_}),p.pathnameBase!=="/"&&(a=Mi([a,p.pathnameBase]))}return l}function xf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=IO(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],l=a.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:p},_)=>{if(m==="*"){let S=u[_]||"";l=a.slice(0,a.length-S.length).replace(/(.)\/+$/,"$1")}const b=u[_];return p&&!b?d[m]=void 0:d[m]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:l,pattern:e}}function IO(e,t=!1,n=!0){li(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,h,d,m)=>{if(r.push({paramName:u,isOptional:h!=null}),h){let p=m.charAt(d+l.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 HO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return li(!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 hs(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 FO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function UO(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Nl(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=tC(n.substring(1),"/"):a=tC(n,t)):a=t,{pathname:a,search:VO(r),hash:qO(s)}}function tC(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 iv(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 $O(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Qy(e){let t=$O(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function np(e,t,n,r=!1){let s;typeof e=="string"?s=Nl(e):(s={...e},Ft(!s.pathname||!s.pathname.includes("?"),iv("?","pathname","search",s)),Ft(!s.pathname||!s.pathname.includes("#"),iv("#","pathname","hash",s)),Ft(!s.search||!s.search.includes("#"),iv("#","search","hash",s)));let a=e===""||s.pathname==="",l=a?"/":s.pathname,u;if(l==null)u=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let _=l.split("/");for(;_[0]==="..";)_.shift(),p-=1;s.pathname=_.join("/")}u=p>=0?t[p]:"/"}let h=UO(s,u),d=l&&l!=="/"&&l.endsWith("/"),m=(a||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(d||m)&&(h.pathname+="/"),h}var Mi=e=>e.join("/").replace(/\/\/+/g,"/"),WO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),VO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,KO=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 GO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function YO(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var eR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function tR(e,t){let n=e;if(typeof n!="string"||!FO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(eR)try{let a=new URL(window.location.href),l=n.startsWith("//")?new URL(a.protocol+n):new URL(n),u=hs(l.pathname,t);l.origin===a.origin&&u!=null?n=u+l.search+l.hash:s=!0}catch{li(!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 nR=["POST","PUT","PATCH","DELETE"];new Set(nR);var XO=["GET",...nR];new Set(XO);var Al=y.createContext(null);Al.displayName="DataRouter";var rp=y.createContext(null);rp.displayName="DataRouterState";var ZO=y.createContext(!1),rR=y.createContext({isTransitioning:!1});rR.displayName="ViewTransition";var QO=y.createContext(new Map);QO.displayName="Fetchers";var JO=y.createContext(null);JO.displayName="Await";var Tr=y.createContext(null);Tr.displayName="Navigation";var Uu=y.createContext(null);Uu.displayName="Location";var Xr=y.createContext({outlet:null,matches:[],isDataRoute:!1});Xr.displayName="Route";var Jy=y.createContext(null);Jy.displayName="RouteError";var iR="REACT_ROUTER_ERROR",eL="REDIRECT",tL="ROUTE_ERROR_RESPONSE";function nL(e){if(e.startsWith(`${iR}:${eL}:{`))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 rL(e){if(e.startsWith(`${iR}:${tL}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new KO(t.status,t.statusText,t.data)}catch{}}function iL(e,{relative:t}={}){Ft(Dl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(Tr),{hash:s,pathname:a,search:l}=$u(e,{relative:t}),u=a;return n!=="/"&&(u=a==="/"?n:Mi([n,a])),r.createHref({pathname:u,search:l,hash:s})}function Dl(){return y.useContext(Uu)!=null}function fi(){return Ft(Dl(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Uu).location}var sR="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function oR(e){y.useContext(Tr).static||y.useLayoutEffect(e)}function Ol(){let{isDataRoute:e}=y.useContext(Xr);return e?_L():sL()}function sL(){Ft(Dl(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Al),{basename:t,navigator:n}=y.useContext(Tr),{matches:r}=y.useContext(Xr),{pathname:s}=fi(),a=JSON.stringify(Qy(r)),l=y.useRef(!1);return oR(()=>{l.current=!0}),y.useCallback((h,d={})=>{if(li(l.current,sR),!l.current)return;if(typeof h=="number"){n.go(h);return}let m=np(h,JSON.parse(a),s,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Mi([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,a,s,e])}var aR=y.createContext(null);function eb(){return y.useContext(aR)}function oL(e){let t=y.useContext(Xr).outlet;return y.useMemo(()=>t&&y.createElement(aR.Provider,{value:e},t),[t,e])}function lR(){let{matches:e}=y.useContext(Xr),t=e[e.length-1];return t?t.params:{}}function $u(e,{relative:t}={}){let{matches:n}=y.useContext(Xr),{pathname:r}=fi(),s=JSON.stringify(Qy(n));return y.useMemo(()=>np(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function aL(e,t){return cR(e,t)}function cR(e,t,n){var C;Ft(Dl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(Tr),{matches:s}=y.useContext(Xr),a=s[s.length-1],l=a?a.params:{},u=a?a.pathname:"/",h=a?a.pathnameBase:"/",d=a&&a.route;{let k=d&&d.path||"";dR(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 m=fi(),p;if(t){let k=typeof t=="string"?Nl(t):t;Ft(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.`),p=k}else p=m;let _=p.pathname||"/",b=_;if(h!=="/"){let k=h.replace(/^\//,"").split("/");b="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let S=ZE(e,{pathname:b});li(d||S!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),li(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 "${p.pathname}${p.search}${p.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=hL(S&&S.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:Mi([h,r.encodeLocation?r.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:Mi([h,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&w?y.createElement(Uu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},w):w}function lL(){let e=vL(),t=GO(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:a},"ErrorBoundary")," or"," ",y.createElement("code",{style:a},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:s},n):null,l)}var cL=y.createElement(lL,null),uR=class extends y.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=rL(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(Xr.Provider,{value:this.props.routeContext},y.createElement(Jy.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(uL,{error:e},t):t}};uR.contextType=ZO;var sv=new WeakMap;function uL({children:e,error:t}){let{basename:n}=y.useContext(Tr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=nL(t.digest);if(r){let s=sv.get(t);if(s)throw s;let a=tR(r.location,n);if(eR&&!sv.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw sv.set(t,l),l}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function dL({routeContext:e,match:t,children:n}){let r=y.useContext(Al);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Xr.Provider,{value:e},n)}function hL(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,a=r==null?void 0:r.errors;if(a!=null){let m=s.findIndex(p=>p.route.id&&(a==null?void 0:a[p.route.id])!==void 0);Ft(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let m=0;m<s.length;m++){let p=s[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=m),p.route.id){let{loaderData:_,errors:b}=r,S=p.route.loader&&!_.hasOwnProperty(p.route.id)&&(!b||b[p.route.id]===void 0);if(p.route.lazy||S){n.isStatic&&(l=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let h=n==null?void 0:n.onError,d=r&&h?(m,p)=>{var _,b;h(m,{location:r.location,params:((b=(_=r.matches)==null?void 0:_[0])==null?void 0:b.params)??{},unstable_pattern:YO(r.matches),errorInfo:p})}:void 0;return s.reduceRight((m,p,_)=>{let b,S=!1,w=null,C=null;r&&(b=a&&p.route.id?a[p.route.id]:void 0,w=p.route.errorElement||cL,l&&(u<0&&_===0?(dR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):u===_&&(S=!0,C=p.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,_+1)),T=()=>{let R;return b?R=w:S?R=C:p.route.Component?R=y.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=m,y.createElement(dL,{match:p,routeContext:{outlet:m,matches:k,isDataRoute:r!=null},children:R})};return r&&(p.route.ErrorBoundary||p.route.errorElement||_===0)?y.createElement(uR,{location:r.location,revalidation:r.revalidation,component:w,error:b,children:T(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):T()},null)}function tb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fL(e){let t=y.useContext(Al);return Ft(t,tb(e)),t}function pL(e){let t=y.useContext(rp);return Ft(t,tb(e)),t}function mL(e){let t=y.useContext(Xr);return Ft(t,tb(e)),t}function nb(e){let t=mL(e),n=t.matches[t.matches.length-1];return Ft(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function gL(){return nb("useRouteId")}function vL(){var r;let e=y.useContext(Jy),t=pL("useRouteError"),n=nb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function _L(){let{router:e}=fL("useNavigate"),t=nb("useNavigate"),n=y.useRef(!1);return oR(()=>{n.current=!0}),y.useCallback(async(s,a={})=>{li(n.current,sR),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...a}))},[e,t])}var nC={};function dR(e,t,n){!t&&!nC[e]&&(nC[e]=!0,li(!1,n))}y.memo(yL);function yL({routes:e,future:t,state:n,isStatic:r,onError:s}){return cR(e,void 0,{state:n,isStatic:r,onError:s})}function bL({to:e,replace:t,state:n,relative:r}){Ft(Dl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=y.useContext(Tr);li(!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:a}=y.useContext(Xr),{pathname:l}=fi(),u=Ol(),h=np(e,Qy(a),l,r==="path"),d=JSON.stringify(h);return y.useEffect(()=>{u(JSON.parse(d),{replace:t,state:n,relative:r})},[u,d,r,t,n]),null}function xL(e){return oL(e.context)}function ul(e){Ft(!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 SL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:a=!1,unstable_useTransitions:l}){Ft(!Dl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=y.useMemo(()=>({basename:u,navigator:s,static:a,unstable_useTransitions:l,future:{}}),[u,s,a,l]);typeof n=="string"&&(n=Nl(n));let{pathname:d="/",search:m="",hash:p="",state:_=null,key:b="default",unstable_mask:S}=n,w=y.useMemo(()=>{let C=hs(d,u);return C==null?null:{location:{pathname:C,search:m,hash:p,state:_,key:b,unstable_mask:S},navigationType:r}},[u,d,m,p,_,b,r,S]);return li(w!=null,`<Router basename="${u}"> is not able to match the URL "${d}${m}${p}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(Tr.Provider,{value:h},y.createElement(Uu.Provider,{children:t,value:w}))}function wL({children:e,location:t}){return aL(m_(e),t)}function m_(e,t=[]){let n=[];return y.Children.forEach(e,(r,s)=>{if(!y.isValidElement(r))return;let a=[...t,s];if(r.type===y.Fragment){n.push.apply(n,m_(r.props.children,a));return}Ft(r.type===ul,`[${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>`),Ft(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=m_(r.props.children,a)),n.push(l)}),n}var Jh="get",ef="application/x-www-form-urlencoded";function ip(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function CL(e){return ip(e)&&e.tagName.toLowerCase()==="button"}function kL(e){return ip(e)&&e.tagName.toLowerCase()==="form"}function EL(e){return ip(e)&&e.tagName.toLowerCase()==="input"}function RL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function TL(e,t){return e.button===0&&(!t||t==="_self")&&!RL(e)}var Sh=null;function ML(){if(Sh===null)try{new FormData(document.createElement("form"),0),Sh=!1}catch{Sh=!0}return Sh}var NL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ov(e){return e!=null&&!NL.has(e)?(li(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ef}"`),null):e}function AL(e,t){let n,r,s,a,l;if(kL(e)){let u=e.getAttribute("action");r=u?hs(u,t):null,n=e.getAttribute("method")||Jh,s=ov(e.getAttribute("enctype"))||ef,a=new FormData(e)}else if(CL(e)||EL(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?hs(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Jh,s=ov(e.getAttribute("formenctype"))||ov(u.getAttribute("enctype"))||ef,a=new FormData(u,e),!ML()){let{name:d,type:m,value:p}=e;if(m==="image"){let _=d?`${d}.`:"";a.append(`${_}x`,"0"),a.append(`${_}y`,"0")}else d&&a.append(d,p)}}else{if(ip(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Jh,r=null,s=ef,l=e}return a&&s==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function DL(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&&hs(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function OL(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 LL(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 jL(e,t,n){let r=await Promise.all(e.map(async s=>{let a=t.routes[s.route.id];if(a){let l=await OL(a,n);return l.links?l.links():[]}return[]}));return IL(r.flat(1).filter(LL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function rC(e,t,n,r,s,a){let l=(h,d)=>n[d]?h.route.id!==n[d].route.id:!0,u=(h,d)=>{var m;return n[d].pathname!==h.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==h.params["*"]};return a==="assets"?t.filter((h,d)=>l(h,d)||u(h,d)):a==="data"?t.filter((h,d)=>{var p;let m=r.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(l(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:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function zL(e,t,{includeHydrateFallback:n}={}){return PL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let a=[s.module];return s.clientActionModule&&(a=a.concat(s.clientActionModule)),s.clientLoaderModule&&(a=a.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(a=a.concat(s.hydrateFallbackModule)),s.imports&&(a=a.concat(s.imports)),a}).flat(1))}function PL(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 IL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let a=JSON.stringify(BL(s));return n.has(a)||(n.add(a),r.push({key:a,link:s})),r},[])}function hR(){let e=y.useContext(Al);return rb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function HL(){let e=y.useContext(rp);return rb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ib=y.createContext(void 0);ib.displayName="FrameworkContext";function fR(){let e=y.useContext(ib);return rb(e,"You must render this element inside a <HydratedRouter> element"),e}function FL(e,t){let n=y.useContext(ib),[r,s]=y.useState(!1),[a,l]=y.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:d,onMouseLeave:m,onTouchStart:p}=t,_=y.useRef(null);y.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let w=k=>{k.forEach(T=>{l(T.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return _.current&&C.observe(_.current),()=>{C.disconnect()}}},[e]),y.useEffect(()=>{if(r){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[r]);let b=()=>{s(!0)},S=()=>{s(!1),l(!1)};return n?e!=="intent"?[a,_,{}]:[a,_,{onFocus:Uc(u,b),onBlur:Uc(h,S),onMouseEnter:Uc(d,b),onMouseLeave:Uc(m,S),onTouchStart:Uc(p,b)}]:[!1,_,{}]}function Uc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function UL({page:e,...t}){let{router:n}=hR(),r=y.useMemo(()=>ZE(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(WL,{page:e,matches:r,...t}):null}function $L(e){let{manifest:t,routeModules:n}=fR(),[r,s]=y.useState([]);return y.useEffect(()=>{let a=!1;return jL(e,t,n).then(l=>{a||s(l)}),()=>{a=!0}},[e,t,n]),r}function WL({page:e,matches:t,...n}){let r=fi(),{future:s,manifest:a,routeModules:l}=fR(),{basename:u}=hR(),{loaderData:h,matches:d}=HL(),m=y.useMemo(()=>rC(e,t,d,a,r,"data"),[e,t,d,a,r]),p=y.useMemo(()=>rC(e,t,d,a,r,"assets"),[e,t,d,a,r]),_=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(T=>{var M;let R=a.routes[T.route.id];!R||!R.hasLoader||(!m.some(L=>L.route.id===T.route.id)&&T.route.id in h&&((M=l[T.route.id])!=null&&M.shouldRevalidate)||R.hasClientLoader?C=!0:w.add(T.route.id))}),w.size===0)return[];let k=DL(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,a,m,t,e,l]),b=y.useMemo(()=>zL(p,a),[p,a]),S=$L(p);return y.createElement(y.Fragment,null,_.map(w=>y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),b.map(w=>y.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:C})=>y.createElement("link",{key:w,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function VL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var qL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{qL&&(window.__reactRouterVersion="7.13.1")}catch{}function KL({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=y.useRef();s.current==null&&(s.current=CO({window:r,v5Compat:!0}));let a=s.current,[l,u]=y.useState({action:a.action,location:a.location}),h=y.useCallback(d=>{n===!1?u(d):y.startTransition(()=>u(d))},[n]);return y.useLayoutEffect(()=>a.listen(h),[a,h]),y.createElement(SL,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:a,unstable_useTransitions:n})}var pR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mR=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:a,replace:l,unstable_mask:u,state:h,target:d,to:m,preventScrollReset:p,viewTransition:_,unstable_defaultShouldRevalidate:b,...S},w){let{basename:C,navigator:k,unstable_useTransitions:T}=y.useContext(Tr),R=typeof m=="string"&&pR.test(m),M=tR(m,C);m=M.to;let L=iL(m,{relative:s}),O=fi(),j=null;if(u){let W=np(u,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);C!=="/"&&(W.pathname=W.pathname==="/"?C:Mi([C,W.pathname])),j=k.createHref(W)}let[F,G,P]=FL(r,S),H=ZL(m,{replace:l,unstable_mask:u,state:h,target:d,preventScrollReset:p,relative:s,viewTransition:_,unstable_defaultShouldRevalidate:b,unstable_useTransitions:T});function B(W){t&&t(W),W.defaultPrevented||H(W)}let U=!(M.isExternal||a),$=y.createElement("a",{...S,...P,href:(U?j:void 0)||M.absoluteURL||L,onClick:U?B:t,ref:VL(w,G),target:d,"data-discover":!R&&n==="render"?"true":void 0});return F&&!R?y.createElement(y.Fragment,null,$,y.createElement(UL,{page:L})):$});mR.displayName="Link";var GL=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:a,to:l,viewTransition:u,children:h,...d},m){let p=$u(l,{relative:d.relative}),_=fi(),b=y.useContext(rp),{navigator:S,basename:w}=y.useContext(Tr),C=b!=null&&nj(p)&&u===!0,k=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,T=_.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(T=T.toLowerCase(),R=R?R.toLowerCase():null,k=k.toLowerCase()),R&&w&&(R=hs(R,w)||R);const M=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let L=T===k||!s&&T.startsWith(k)&&T.charAt(M)==="/",O=R!=null&&(R===k||!s&&R.startsWith(k)&&R.charAt(k.length)==="/"),j={isActive:L,isPending:O,isTransitioning:C},F=L?t:void 0,G;typeof r=="function"?G=r(j):G=[r,L?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let P=typeof a=="function"?a(j):a;return y.createElement(mR,{...d,"aria-current":F,className:G,ref:m,style:P,to:l,viewTransition:u},typeof h=="function"?h(j):h)});GL.displayName="NavLink";var YL=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:a,method:l=Jh,action:u,onSubmit:h,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:_,...b},S)=>{let{unstable_useTransitions:w}=y.useContext(Tr),C=ej(),k=tj(u,{relative:d}),T=l.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&pR.test(u),M=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let O=L.nativeEvent.submitter,j=(O==null?void 0:O.getAttribute("formmethod"))||l,F=()=>C(O||L.currentTarget,{fetcherKey:t,method:j,navigate:n,replace:s,state:a,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:_});w&&n!==!1?y.startTransition(()=>F()):F()};return y.createElement("form",{ref:S,method:T,action:k,onSubmit:r?h:M,...b,"data-discover":!R&&e==="render"?"true":void 0})});YL.displayName="Form";function XL(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gR(e){let t=y.useContext(Al);return Ft(t,XL(e)),t}function ZL(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:d}={}){let m=Ol(),p=fi(),_=$u(e,{relative:l});return y.useCallback(b=>{if(TL(b,t)){b.preventDefault();let S=n!==void 0?n:ku(p)===ku(_),w=()=>m(e,{replace:S,unstable_mask:r,state:s,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:h});d?y.startTransition(()=>w()):w()}},[p,m,_,n,r,s,t,e,a,l,u,h,d])}var QL=0,JL=()=>`__${String(++QL)}__`;function ej(){let{router:e}=gR("useSubmit"),{basename:t}=y.useContext(Tr),n=gL(),r=e.fetch,s=e.navigate;return y.useCallback(async(a,l={})=>{let{action:u,method:h,encType:d,formData:m,body:p}=AL(a,t);if(l.navigate===!1){let _=l.fetcherKey||JL();await r(_,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:p,formMethod:l.method||h,formEncType:l.encType||d,flushSync:l.flushSync})}else await s(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:p,formMethod:l.method||h,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,s,t,n])}function tj(e,{relative:t}={}){let{basename:n}=y.useContext(Tr),r=y.useContext(Xr);Ft(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),a={...$u(e||".",{relative:t})},l=fi();if(e==null){a.search=l.search;let u=new URLSearchParams(a.search),h=u.getAll("index");if(h.some(m=>m==="")){u.delete("index"),h.filter(p=>p).forEach(p=>u.append("index",p));let m=u.toString();a.search=m?`?${m}`:""}}return(!e||e===".")&&s.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Mi([n,a.pathname])),ku(a)}function nj(e,{relative:t}={}){let n=y.useContext(rR);Ft(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=gR("useViewTransitionState"),s=$u(e,{relative:t});if(!n.isTransitioning)return!1;let a=hs(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=hs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xf(s.pathname,l)!=null||xf(s.pathname,a)!=null}var ki=XE();const rj=tp(ki);function vR(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=vR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _R(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=vR(e))&&(r&&(r+=" "),r+=t);return r}const iC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sC=_R,ij=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return sC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(d=>{const m=n==null?void 0:n[d],p=a==null?void 0:a[d];if(m===null)return null;const _=iC(m)||iC(p);return s[d][_]}),u=n&&Object.entries(n).reduce((d,m)=>{let[p,_]=m;return _===void 0||(d[p]=_),d},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:p,className:_,...b}=m;return Object.entries(b).every(S=>{let[w,C]=S;return Array.isArray(C)?C.includes({...a,...u}[w]):{...a,...u}[w]===C})?[...d,p,_]:d},[]);return sC(e,l,h,n==null?void 0:n.class,n==null?void 0:n.className)},sj=(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},oj=(e,t)=>({classGroupId:e,validator:t}),yR=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Sf="-",oC=[],aj="arbitrary..",lj=e=>{const t=uj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return cj(l);const u=l.split(Sf),h=u[0]===""&&u.length>1?1:0;return bR(u,h,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const h=r[l],d=n[l];return h?d?sj(d,h):h:d||oC}return n[l]||oC}}},bR=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const d=bR(e,t+1,a);if(d)return d}const l=n.validators;if(l===null)return;const u=t===0?e.join(Sf):e.slice(t).join(Sf),h=l.length;for(let d=0;d<h;d++){const m=l[d];if(m.validator(u))return m.classGroupId}},cj=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?aj+r:void 0})(),uj=e=>{const{theme:t,classGroups:n}=e;return dj(n,t)},dj=(e,t)=>{const n=yR();for(const r in e){const s=e[r];sb(s,n,r,t)}return n},sb=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];hj(l,t,n,r)}},hj=(e,t,n,r)=>{if(typeof e=="string"){fj(e,t,n);return}if(typeof e=="function"){pj(e,t,n,r);return}mj(e,t,n,r)},fj=(e,t,n)=>{const r=e===""?t:xR(t,e);r.classGroupId=n},pj=(e,t,n,r)=>{if(gj(e)){sb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(oj(n,e))},mj=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[u,h]=s[l];sb(h,xR(t,u),n,r)}},xR=(e,t)=>{let n=e;const r=t.split(Sf),s=r.length;for(let a=0;a<s;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=yR(),n.nextPart.set(l,u)),n=u}return n},gj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,vj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return s(a,l),l},set(a,l){a in n?n[a]=l:s(a,l)}}},g_="!",aC=":",_j=[],lC=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),yj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let l=0,u=0,h=0,d;const m=s.length;for(let w=0;w<m;w++){const C=s[w];if(l===0&&u===0){if(C===aC){a.push(s.slice(h,w)),h=w+1;continue}if(C==="/"){d=w;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const p=a.length===0?s:s.slice(h);let _=p,b=!1;p.endsWith(g_)?(_=p.slice(0,-1),b=!0):p.startsWith(g_)&&(_=p.slice(1),b=!0);const S=d&&d>h?d-h:void 0;return lC(a,b,_,S)};if(t){const s=t+aC,a=r;r=l=>l.startsWith(s)?a(l.slice(s.length)):lC(_j,!1,l,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},bj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const l=n[a],u=l[0]==="[",h=t.has(l);u||h?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},xj=e=>({cache:vj(e.cacheSize),parseClassName:yj(e),sortModifiers:bj(e),...lj(e)}),Sj=/\s+/,wj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,l=[],u=e.trim().split(Sj);let h="";for(let d=u.length-1;d>=0;d-=1){const m=u[d],{isExternal:p,modifiers:_,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:w}=n(m);if(p){h=m+(h.length>0?" "+h:h);continue}let C=!!w,k=r(C?S.substring(0,w):S);if(!k){if(!C){h=m+(h.length>0?" "+h:h);continue}if(k=r(S),!k){h=m+(h.length>0?" "+h:h);continue}C=!1}const T=_.length===0?"":_.length===1?_[0]:a(_).join(":"),R=b?T+g_:T,M=R+k;if(l.indexOf(M)>-1)continue;l.push(M);const L=s(k,C);for(let O=0;O<L.length;++O){const j=L[O];l.push(R+j)}h=m+(h.length>0?" "+h:h)}return h},Cj=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=SR(n))&&(s&&(s+=" "),s+=r);return s},SR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=SR(e[r]))&&(n&&(n+=" "),n+=t);return n},kj=(e,...t)=>{let n,r,s,a;const l=h=>{const d=t.reduce((m,p)=>p(m),e());return n=xj(d),r=n.cache.get,s=n.cache.set,a=u,u(h)},u=h=>{const d=r(h);if(d)return d;const m=wj(h,n);return s(h,m),m};return a=l,(...h)=>a(Cj(...h))},Ej=[],fn=e=>{const t=n=>n[e]||Ej;return t.isThemeGetter=!0,t},wR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,CR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Rj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Tj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mj=/\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$/,Nj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Aj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>Rj.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Ks=e=>!!e&&Number.isInteger(Number(e)),av=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),rs=e=>Tj.test(e),kR=()=>!0,Oj=e=>Mj.test(e)&&!Nj.test(e),ob=()=>!1,Lj=e=>Aj.test(e),jj=e=>Dj.test(e),zj=e=>!De(e)&&!Oe(e),Pj=e=>fo(e,TR,ob),De=e=>wR.test(e),Po=e=>fo(e,MR,Oj),cC=e=>fo(e,Vj,Qe),Bj=e=>fo(e,AR,kR),Ij=e=>fo(e,NR,ob),uC=e=>fo(e,ER,ob),Hj=e=>fo(e,RR,jj),wh=e=>fo(e,DR,Lj),Oe=e=>CR.test(e),$c=e=>la(e,MR),Fj=e=>la(e,NR),dC=e=>la(e,ER),Uj=e=>la(e,TR),$j=e=>la(e,RR),Ch=e=>la(e,DR,!0),Wj=e=>la(e,AR,!0),fo=(e,t,n)=>{const r=wR.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},la=(e,t,n=!1)=>{const r=CR.exec(e);return r?r[1]?t(r[1]):n:!1},ER=e=>e==="position"||e==="percentage",RR=e=>e==="image"||e==="url",TR=e=>e==="length"||e==="size"||e==="bg-size",MR=e=>e==="length",Vj=e=>e==="number",NR=e=>e==="family-name",AR=e=>e==="number"||e==="weight",DR=e=>e==="shadow",qj=()=>{const e=fn("color"),t=fn("font"),n=fn("text"),r=fn("font-weight"),s=fn("tracking"),a=fn("leading"),l=fn("breakpoint"),u=fn("container"),h=fn("spacing"),d=fn("radius"),m=fn("shadow"),p=fn("inset-shadow"),_=fn("text-shadow"),b=fn("drop-shadow"),S=fn("blur"),w=fn("perspective"),C=fn("aspect"),k=fn("ease"),T=fn("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(),Oe,De],O=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],F=()=>[Oe,De,h],G=()=>[qs,"full","auto",...F()],P=()=>[Ks,"none","subgrid",Oe,De],H=()=>["auto",{span:["full",Ks,Oe,De]},Ks,Oe,De],B=()=>[Ks,"auto",Oe,De],U=()=>["auto","min","max","fr",Oe,De],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...F()],q=()=>[qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],V=()=>[qs,"screen","full","dvw","lvw","svw","min","max","fit",...F()],X=()=>[qs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],N=()=>[e,Oe,De],I=()=>[...M(),dC,uC,{position:[Oe,De]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Uj,Pj,{size:[Oe,De]}],ce=()=>[av,$c,Po],pe=()=>["","none","full",d,Oe,De],ae=()=>["",Qe,$c,Po],Q=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[Qe,av,dC,uC],de=()=>["","none",S,Oe,De],we=()=>["none",Qe,Oe,De],Ce=()=>["none",Qe,Oe,De],Re=()=>[Qe,Oe,De],ze=()=>[qs,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rs],breakpoint:[rs],color:[kR],container:[rs],"drop-shadow":[rs],ease:["in","out","in-out"],font:[zj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rs],shadow:[rs],spacing:["px",Qe],text:[rs],"text-shadow":[rs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qs,De,Oe,C]}],container:["container"],columns:[{columns:[Qe,De,Oe,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:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{"inset-s":G(),start:G()}],end:[{"inset-e":G(),end:G()}],"inset-bs":[{"inset-bs":G()}],"inset-be":[{"inset-be":G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[Ks,"auto",Oe,De]}],basis:[{basis:[qs,"full","auto",u,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,qs,"auto","initial","none",De]}],grow:[{grow:["",Qe,Oe,De]}],shrink:[{shrink:["",Qe,Oe,De]}],order:[{order:[Ks,"first","last","none",Oe,De]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"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:[...$(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],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:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...X()]}],"min-block-size":[{"min-block":["auto",...X()]}],"max-block-size":[{"max-block":["none",...X()]}],w:[{w:[u,"screen",...q()]}],"min-w":[{"min-w":[u,"screen","none",...q()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,$c,Po]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Wj,Bj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",av,De]}],"font-family":[{font:[Fj,Ij,t]}],"font-features":[{"font-features":[De]}],"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,Oe,De]}],"line-clamp":[{"line-clamp":[Qe,"none",Oe,cC]}],leading:[{leading:[a,...F()]}],"list-image":[{"list-image":["none",Oe,De]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,De]}],"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:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Oe,Po]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Qe,"auto",Oe,De]}],"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",Oe,De]}],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",Oe,De]}],"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:Z()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ks,Oe,De],radial:["",Oe,De],conic:[Ks,Oe,De]},$j,Hj]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"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:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Oe,De]}],"outline-w":[{outline:["",Qe,$c,Po]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",m,Ch,wh]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",p,Ch,wh]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Qe,Po]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",_,Ch,wh]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Qe,Oe,De]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"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":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"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":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"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":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"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":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"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":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"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":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[Oe,De]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"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":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"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:Z()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,De]}],filter:[{filter:["","none",Oe,De]}],blur:[{blur:de()}],brightness:[{brightness:[Qe,Oe,De]}],contrast:[{contrast:[Qe,Oe,De]}],"drop-shadow":[{"drop-shadow":["","none",b,Ch,wh]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",Qe,Oe,De]}],"hue-rotate":[{"hue-rotate":[Qe,Oe,De]}],invert:[{invert:["",Qe,Oe,De]}],saturate:[{saturate:[Qe,Oe,De]}],sepia:[{sepia:["",Qe,Oe,De]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,De]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Oe,De]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Oe,De]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Oe,De]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Oe,De]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Oe,De]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Oe,De]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Oe,De]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Oe,De]}],"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",Oe,De]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Oe,De]}],ease:[{ease:["linear","initial",k,Oe,De]}],delay:[{delay:[Qe,Oe,De]}],animate:[{animate:["none",T,Oe,De]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Oe,De]}],"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:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:Re()}],"skew-x":[{"skew-x":Re()}],"skew-y":[{"skew-y":Re()}],transform:[{transform:[Oe,De,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"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",Oe,De]}],"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",Oe,De]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[Qe,$c,Po,cC]}],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"]}},Kj=kj(qj);function _e(...e){return Kj(_R(e))}function lv(){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 hC(e){return e.startsWith("chatId:")?e.slice(7):e}const ab=ij("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"}}),tt=y.forwardRef(({className:e,variant:t,size:n,...r},s)=>g.jsx("button",{className:_e(ab({variant:t,size:n,className:e})),ref:s,...r}));tt.displayName="Button";function Ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function fC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lb(...e){return t=>{let n=!1;const r=e.map(s=>{const a=fC(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():fC(e[s],null)}}}}function vt(...e){return y.useCallback(lb(...e),e)}function Gj(e,t){const n=y.createContext(t),r=a=>{const{children:l,...u}=a,h=y.useMemo(()=>u,Object.values(u));return g.jsx(n.Provider,{value:h,children:l})};r.displayName=e+"Provider";function s(a){const l=y.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function vs(e,t=[]){let n=[];function r(a,l){const u=y.createContext(l),h=n.length;n=[...n,l];const d=p=>{var k;const{scope:_,children:b,...S}=p,w=((k=_==null?void 0:_[e])==null?void 0:k[h])||u,C=y.useMemo(()=>S,Object.values(S));return g.jsx(w.Provider,{value:C,children:b})};d.displayName=a+"Provider";function m(p,_){var w;const b=((w=_==null?void 0:_[e])==null?void 0:w[h])||u,S=y.useContext(b);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,m]}const s=()=>{const a=n.map(l=>y.createContext(l));return function(u){const h=(u==null?void 0:u[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:h}}),[u,h])}};return s.scopeName=e,[r,Yj(s,...t)]}function Yj(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const l=r.reduce((u,{useScope:h,scopeName:d})=>{const p=h(a)[`__scope${d}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Un=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},Xj=YE[" useId ".trim().toString()]||(()=>{}),Zj=0;function ds(e){const[t,n]=y.useState(Xj());return Un(()=>{n(r=>r??String(Zj++))},[e]),t?`radix-${t}`:""}var Qj=YE[" useInsertionEffect ".trim().toString()]||Un;function wl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,l]=Jj({defaultProp:t,onChange:n}),u=e!==void 0,h=u?e:s;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${r} is changing from ${p?"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.`),m.current=u},[u,r])}const d=y.useCallback(m=>{var p;if(u){const _=ez(m)?m(e):m;_!==e&&((p=l.current)==null||p.call(l,_))}else a(m)},[u,e,a,l]);return[h,d]}function Jj({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),s=y.useRef(n),a=y.useRef(t);return Qj(()=>{a.current=t},[t]),y.useEffect(()=>{var l;s.current!==n&&((l=a.current)==null||l.call(a,n),s.current=n)},[n,s]),[n,r,a]}function ez(e){return typeof e=="function"}function Zo(e){const t=tz(e),n=y.forwardRef((r,s)=>{const{children:a,...l}=r,u=y.Children.toArray(a),h=u.find(rz);if(h){const d=h.props.children,m=u.map(p=>p===h?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...l,ref:s,children:y.isValidElement(d)?y.cloneElement(d,void 0,m):null})}return g.jsx(t,{...l,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function tz(e){const t=y.forwardRef((n,r)=>{const{children:s,...a}=n;if(y.isValidElement(s)){const l=sz(s),u=iz(a,s.props);return s.type!==y.Fragment&&(u.ref=r?lb(r,l):l),y.cloneElement(s,u)}return y.Children.count(s)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OR=Symbol("radix.slottable");function nz(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=OR,t}function rz(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OR}function iz(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...u)=>{const h=a(...u);return s(...u),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function sz(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 oz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],st=oz.reduce((e,t)=>{const n=Zo(`Primitive.${t}`),r=y.forwardRef((s,a)=>{const{asChild:l,...u}=s,h=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(h,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function LR(e,t){e&&ki.flushSync(()=>e.dispatchEvent(t))}function ci(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function az(e,t=globalThis==null?void 0:globalThis.document){const n=ci(e);y.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 lz="DismissableLayer",v_="dismissableLayer.update",cz="dismissableLayer.pointerDownOutside",uz="dismissableLayer.focusOutside",pC,jR=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ll=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...h}=e,d=y.useContext(jR),[m,p]=y.useState(null),_=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=y.useState({}),S=vt(t,j=>p(j)),w=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),T=m?w.indexOf(m):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,M=T>=k,L=fz(j=>{const F=j.target,G=[...d.branches].some(P=>P.contains(F));!M||G||(s==null||s(j),l==null||l(j),j.defaultPrevented||u==null||u())},_),O=pz(j=>{const F=j.target;[...d.branches].some(P=>P.contains(F))||(a==null||a(j),l==null||l(j),j.defaultPrevented||u==null||u())},_);return az(j=>{T===d.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&u&&(j.preventDefault(),u()))},_),y.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(pC=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),mC(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=pC)}},[m,_,n,d]),y.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),mC())},[m,d]),y.useEffect(()=>{const j=()=>b({});return document.addEventListener(v_,j),()=>document.removeEventListener(v_,j)},[]),g.jsx(st.div,{...h,ref:S,style:{pointerEvents:R?M?"auto":"none":void 0,...e.style},onFocusCapture:Ne(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ne(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ne(e.onPointerDownCapture,L.onPointerDownCapture)})});Ll.displayName=lz;var dz="DismissableLayerBranch",hz=y.forwardRef((e,t)=>{const n=y.useContext(jR),r=y.useRef(null),s=vt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),g.jsx(st.div,{...e,ref:s})});hz.displayName=dz;function fz(e,t=globalThis==null?void 0:globalThis.document){const n=ci(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let h=function(){zR(cz,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},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pz(e,t=globalThis==null?void 0:globalThis.document){const n=ci(e),r=y.useRef(!1);return y.useEffect(()=>{const s=a=>{a.target&&!r.current&&zR(uz,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function mC(){const e=new CustomEvent(v_);document.dispatchEvent(e)}function zR(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?LR(s,a):s.dispatchEvent(a)}var cv="focusScope.autoFocusOnMount",uv="focusScope.autoFocusOnUnmount",gC={bubbles:!1,cancelable:!0},mz="FocusScope",Wu=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[u,h]=y.useState(null),d=ci(s),m=ci(a),p=y.useRef(null),_=vt(t,w=>h(w)),b=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let w=function(R){if(b.paused||!u)return;const M=R.target;u.contains(M)?p.current=M:Qs(p.current,{select:!0})},C=function(R){if(b.paused||!u)return;const M=R.relatedTarget;M!==null&&(u.contains(M)||Qs(p.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const L of R)L.removedNodes.length>0&&Qs(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const T=new MutationObserver(k);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),T.disconnect()}}},[r,u,b.paused]),y.useEffect(()=>{if(u){_C.add(b);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(cv,gC);u.addEventListener(cv,d),u.dispatchEvent(k),k.defaultPrevented||(gz(xz(PR(u)),{select:!0}),document.activeElement===w&&Qs(u))}return()=>{u.removeEventListener(cv,d),setTimeout(()=>{const k=new CustomEvent(uv,gC);u.addEventListener(uv,m),u.dispatchEvent(k),k.defaultPrevented||Qs(w??document.body,{select:!0}),u.removeEventListener(uv,m),_C.remove(b)},0)}}},[u,d,m,b]);const S=y.useCallback(w=>{if(!n&&!r||b.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(C&&k){const T=w.currentTarget,[R,M]=vz(T);R&&M?!w.shiftKey&&k===M?(w.preventDefault(),n&&Qs(R,{select:!0})):w.shiftKey&&k===R&&(w.preventDefault(),n&&Qs(M,{select:!0})):k===T&&w.preventDefault()}},[n,r,b.paused]);return g.jsx(st.div,{tabIndex:-1,...l,ref:_,onKeyDown:S})});Wu.displayName=mz;function gz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Qs(r,{select:t}),document.activeElement!==n)return}function vz(e){const t=PR(e),n=vC(t,e),r=vC(t.reverse(),e);return[n,r]}function PR(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 vC(e,t){for(const n of e)if(!_z(n,{upTo:t}))return n}function _z(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 yz(e){return e instanceof HTMLInputElement&&"select"in e}function Qs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yz(e)&&t&&e.select()}}var _C=bz();function bz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=yC(e,t),e.unshift(t)},remove(t){var n;e=yC(e,t),(n=e[0])==null||n.resume()}}}function yC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xz(e){return e.filter(t=>t.tagName!=="A")}var Sz="Portal",jl=y.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,a]=y.useState(!1);Un(()=>a(!0),[]);const l=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?rj.createPortal(g.jsx(st.div,{...r,ref:t}),l):null});jl.displayName=Sz;function wz(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Zr=e=>{const{present:t,children:n}=e,r=Cz(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=vt(r.ref,kz(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:a}):null};Zr.displayName="Presence";function Cz(e){const[t,n]=y.useState(),r=y.useRef(null),s=y.useRef(e),a=y.useRef("none"),l=e?"mounted":"unmounted",[u,h]=wz(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const d=kh(r.current);a.current=u==="mounted"?d:"none"},[u]),Un(()=>{const d=r.current,m=s.current;if(m!==e){const _=a.current,b=kh(d);e?h("MOUNT"):b==="none"||(d==null?void 0:d.display)==="none"?h("UNMOUNT"):h(m&&_!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),Un(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,p=b=>{const w=kh(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&w&&(h("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},_=b=>{b.target===t&&(a.current=kh(r.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function kh(e){return(e==null?void 0:e.animationName)||"none"}function kz(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 dv=0;function sp(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??bC()),document.body.insertAdjacentElement("beforeend",e[1]??bC()),dv++,()=>{dv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),dv--}},[])}function bC(){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 Ci=function(){return Ci=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ci.apply(this,arguments)};function BR(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 Ez(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var tf="right-scroll-bar-position",nf="width-before-scroll-bar",Rz="with-scroll-bars-hidden",Tz="--removed-body-scroll-bar-size";function hv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Mz(e,t){var n=y.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 Nz=typeof window<"u"?y.useLayoutEffect:y.useEffect,xC=new WeakMap;function Az(e,t){var n=Mz(null,function(r){return e.forEach(function(s){return hv(s,r)})});return Nz(function(){var r=xC.get(n);if(r){var s=new Set(r),a=new Set(e),l=n.current;s.forEach(function(u){a.has(u)||hv(u,null)}),a.forEach(function(u){s.has(u)||hv(u,l)})}xC.set(n,e)},[e]),n}function Dz(e){return e}function Oz(e,t){t===void 0&&(t=Dz);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(a),l=n}var h=function(){var m=l;l=[],m.forEach(a)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(m){l.push(m),d()},filter:function(m){return l=l.filter(m),n}}}};return s}function Lz(e){e===void 0&&(e={});var t=Oz(null);return t.options=Ci({async:!0,ssr:!1},e),t}var IR=function(e){var t=e.sideCar,n=BR(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 y.createElement(r,Ci({},n))};IR.isSideCarExport=!0;function jz(e,t){return e.useMedium(t),IR}var HR=Lz(),fv=function(){},op=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:fv,onWheelCapture:fv,onTouchMoveCapture:fv}),s=r[0],a=r[1],l=e.forwardProps,u=e.children,h=e.className,d=e.removeScrollBar,m=e.enabled,p=e.shards,_=e.sideCar,b=e.noRelative,S=e.noIsolation,w=e.inert,C=e.allowPinchZoom,k=e.as,T=k===void 0?"div":k,R=e.gapMode,M=BR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=_,O=Az([n,t]),j=Ci(Ci({},M),s);return y.createElement(y.Fragment,null,m&&y.createElement(L,{sideCar:HR,removeScrollBar:d,shards:p,noRelative:b,noIsolation:S,inert:w,setCallbacks:a,allowPinchZoom:!!C,lockRef:n,gapMode:R}),l?y.cloneElement(y.Children.only(u),Ci(Ci({},j),{ref:O})):y.createElement(T,Ci({},j,{className:h,ref:O}),u))});op.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};op.classNames={fullWidth:nf,zeroRight:tf};var zz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Pz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zz();return t&&e.setAttribute("nonce",t),e}function Bz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Iz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Hz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Pz())&&(Bz(t,n),Iz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fz=function(){var e=Hz();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},FR=function(){var e=Fz(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Uz={left:0,top:0,right:0,gap:0},pv=function(e){return parseInt(e||"",10)||0},$z=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[pv(n),pv(r),pv(s)]},Wz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Uz;var t=$z(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])}},Vz=FR(),vl="data-scroll-locked",qz=function(e,t,n,r){var s=e.left,a=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
-
.`.concat(Rz,` {
|
|
62
|
-
overflow: hidden `).concat(r,`;
|
|
63
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
64
|
-
}
|
|
65
|
-
body[`).concat(vl,`] {
|
|
66
|
-
overflow: hidden `).concat(r,`;
|
|
67
|
-
overscroll-behavior: contain;
|
|
68
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
69
|
-
padding-left: `.concat(s,`px;
|
|
70
|
-
padding-top: `).concat(a,`px;
|
|
71
|
-
padding-right: `).concat(l,`px;
|
|
72
|
-
margin-left:0;
|
|
73
|
-
margin-top:0;
|
|
74
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
75
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.`).concat(tf,` {
|
|
79
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(nf,` {
|
|
83
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.`).concat(tf," .").concat(tf,` {
|
|
87
|
-
right: 0 `).concat(r,`;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.`).concat(nf," .").concat(nf,` {
|
|
91
|
-
margin-right: 0 `).concat(r,`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
body[`).concat(vl,`] {
|
|
95
|
-
`).concat(Tz,": ").concat(u,`px;
|
|
96
|
-
}
|
|
97
|
-
`)},SC=function(){var e=parseInt(document.body.getAttribute(vl)||"0",10);return isFinite(e)?e:0},Kz=function(){y.useEffect(function(){return document.body.setAttribute(vl,(SC()+1).toString()),function(){var e=SC()-1;e<=0?document.body.removeAttribute(vl):document.body.setAttribute(vl,e.toString())}},[])},Gz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Kz();var a=y.useMemo(function(){return Wz(s)},[s]);return y.createElement(Vz,{styles:qz(a,!t,s,n?"":"!important")})},__=!1;if(typeof window<"u")try{var Eh=Object.defineProperty({},"passive",{get:function(){return __=!0,!0}});window.addEventListener("test",Eh,Eh),window.removeEventListener("test",Eh,Eh)}catch{__=!1}var el=__?{passive:!1}:!1,Yz=function(e){return e.tagName==="TEXTAREA"},UR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yz(e)&&n[t]==="visible")},Xz=function(e){return UR(e,"overflowY")},Zz=function(e){return UR(e,"overflowX")},wC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=$R(e,r);if(s){var a=WR(e,r),l=a[1],u=a[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qz=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]},$R=function(e,t){return e==="v"?Xz(t):Zz(t)},WR=function(e,t){return e==="v"?Qz(t):Jz(t)},e6=function(e,t){return e==="h"&&t==="rtl"?-1:1},t6=function(e,t,n,r,s){var a=e6(e,window.getComputedStyle(t).direction),l=a*r,u=n.target,h=t.contains(u),d=!1,m=l>0,p=0,_=0;do{if(!u)break;var b=WR(e,u),S=b[0],w=b[1],C=b[2],k=w-C-a*S;(S||k)&&$R(e,u)&&(p+=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(m&&Math.abs(p)<1||!m&&Math.abs(_)<1)&&(d=!0),d},Rh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},CC=function(e){return[e.deltaX,e.deltaY]},kC=function(e){return e&&"current"in e?e.current:e},n6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},r6=function(e){return`
|
|
98
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
99
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
100
|
-
`)},i6=0,tl=[];function s6(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(i6++)[0],a=y.useState(FR)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=Ez([e.lockRef.current],(e.shards||[]).map(kC),!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=y.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var k=Rh(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,O=w.target,j=Math.abs(R)>Math.abs(M)?"h":"v";if("touches"in w&&j==="h"&&O.type==="range")return!1;var F=window.getSelection(),G=F&&F.anchorNode,P=G?G===O||G.contains(O):!1;if(P)return!1;var H=wC(j,O);if(!H)return!0;if(H?L=j:(L=j==="v"?"h":"v",H=wC(j,O)),!H)return!1;if(!r.current&&"changedTouches"in w&&(R||M)&&(r.current=L),!L)return!0;var B=r.current||L;return t6(B,C,w,B==="h"?R:M)},[]),h=y.useCallback(function(w){var C=w;if(!(!tl.length||tl[tl.length-1]!==a)){var k="deltaY"in C?CC(C):Rh(C),T=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&n6(L.delta,k)})[0];if(T&&T.should){C.cancelable&&C.preventDefault();return}if(!T){var R=(l.current.shards||[]).map(kC).filter(Boolean).filter(function(L){return L.contains(C.target)}),M=R.length>0?u(C,R[0]):!l.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),d=y.useCallback(function(w,C,k,T){var R={name:w,delta:C,target:k,should:T,shadowParent:o6(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(M){return M!==R})},1)},[]),m=y.useCallback(function(w){n.current=Rh(w),r.current=void 0},[]),p=y.useCallback(function(w){d(w.type,CC(w),w.target,u(w,e.lockRef.current))},[]),_=y.useCallback(function(w){d(w.type,Rh(w),w.target,u(w,e.lockRef.current))},[]);y.useEffect(function(){return tl.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:_}),document.addEventListener("wheel",h,el),document.addEventListener("touchmove",h,el),document.addEventListener("touchstart",m,el),function(){tl=tl.filter(function(w){return w!==a}),document.removeEventListener("wheel",h,el),document.removeEventListener("touchmove",h,el),document.removeEventListener("touchstart",m,el)}},[]);var b=e.removeScrollBar,S=e.inert;return y.createElement(y.Fragment,null,S?y.createElement(a,{styles:r6(s)}):null,b?y.createElement(Gz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function o6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const a6=jz(HR,s6);var Vu=y.forwardRef(function(e,t){return y.createElement(op,Ci({},e,{ref:t,sideCar:a6}))});Vu.classNames=op.classNames;var l6=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},nl=new WeakMap,Th=new WeakMap,Mh={},mv=0,VR=function(e){return e&&(e.host||VR(e.parentNode))},c6=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=VR(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})},u6=function(e,t,n,r){var s=c6(t,Array.isArray(e)?e:[e]);Mh[n]||(Mh[n]=new WeakMap);var a=Mh[n],l=[],u=new Set,h=new Set(s),d=function(p){!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);var m=function(p){!p||h.has(p)||Array.prototype.forEach.call(p.children,function(_){if(u.has(_))m(_);else try{var b=_.getAttribute(r),S=b!==null&&b!=="false",w=(nl.get(_)||0)+1,C=(a.get(_)||0)+1;nl.set(_,w),a.set(_,C),l.push(_),w===1&&S&&Th.set(_,!0),C===1&&_.setAttribute(n,"true"),S||_.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",_,k)}})};return m(t),u.clear(),mv++,function(){l.forEach(function(p){var _=nl.get(p)-1,b=a.get(p)-1;nl.set(p,_),a.set(p,b),_||(Th.has(p)||p.removeAttribute(r),Th.delete(p)),b||p.removeAttribute(n)}),mv--,mv||(nl=new WeakMap,nl=new WeakMap,Th=new WeakMap,Mh={})}},ap=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=l6(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),u6(r,s,n,"aria-hidden")):function(){return null}},lp="Dialog",[qR]=vs(lp),[d6,pi]=qR(lp),KR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,u=y.useRef(null),h=y.useRef(null),[d,m]=wl({prop:r,defaultProp:s??!1,onChange:a,caller:lp});return g.jsx(d6,{scope:t,triggerRef:u,contentRef:h,contentId:ds(),titleId:ds(),descriptionId:ds(),open:d,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(p=>!p),[m]),modal:l,children:n})};KR.displayName=lp;var GR="DialogTrigger",h6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=pi(GR,n),a=vt(t,s.triggerRef);return g.jsx(st.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":db(s.open),...r,ref:a,onClick:Ne(e.onClick,s.onOpenToggle)})});h6.displayName=GR;var cb="DialogPortal",[f6,YR]=qR(cb,{forceMount:void 0}),XR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=pi(cb,t);return g.jsx(f6,{scope:t,forceMount:n,children:y.Children.map(r,l=>g.jsx(Zr,{present:n||a.open,children:g.jsx(jl,{asChild:!0,container:s,children:l})}))})};XR.displayName=cb;var wf="DialogOverlay",ZR=y.forwardRef((e,t)=>{const n=YR(wf,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=pi(wf,e.__scopeDialog);return a.modal?g.jsx(Zr,{present:r||a.open,children:g.jsx(m6,{...s,ref:t})}):null});ZR.displayName=wf;var p6=Zo("DialogOverlay.RemoveScroll"),m6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=pi(wf,n);return g.jsx(Vu,{as:p6,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(st.div,{"data-state":db(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Qo="DialogContent",QR=y.forwardRef((e,t)=>{const n=YR(Qo,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=pi(Qo,e.__scopeDialog);return g.jsx(Zr,{present:r||a.open,children:a.modal?g.jsx(g6,{...s,ref:t}):g.jsx(v6,{...s,ref:t})})});QR.displayName=Qo;var g6=y.forwardRef((e,t)=>{const n=pi(Qo,e.__scopeDialog),r=y.useRef(null),s=vt(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return ap(a)},[]),g.jsx(JR,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ne(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ne(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:Ne(e.onFocusOutside,a=>a.preventDefault())})}),v6=y.forwardRef((e,t)=>{const n=pi(Qo,e.__scopeDialog),r=y.useRef(!1),s=y.useRef(!1);return g.jsx(JR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),JR=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,u=pi(Qo,n),h=y.useRef(null),d=vt(t,h);return sp(),g.jsxs(g.Fragment,{children:[g.jsx(Wu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:g.jsx(Ll,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":db(u.open),...l,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(_6,{titleId:u.titleId}),g.jsx(b6,{contentRef:h,descriptionId:u.descriptionId})]})]})}),ub="DialogTitle",eT=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=pi(ub,n);return g.jsx(st.h2,{id:s.titleId,...r,ref:t})});eT.displayName=ub;var tT="DialogDescription",nT=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=pi(tT,n);return g.jsx(st.p,{id:s.descriptionId,...r,ref:t})});nT.displayName=tT;var rT="DialogClose",iT=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=pi(rT,n);return g.jsx(st.button,{type:"button",...r,ref:t,onClick:Ne(e.onClick,()=>s.onOpenChange(!1))})});iT.displayName=rT;function db(e){return e?"open":"closed"}var sT="DialogTitleWarning",[nne,oT]=Gj(sT,{contentName:Qo,titleName:ub,docsSlug:"dialog"}),_6=({titleId:e})=>{const t=oT(sT),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 y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},y6="DialogDescriptionWarning",b6=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${oT(y6).contentName}}.`;return y.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},x6=KR,S6=XR,aT=ZR,lT=QR,w6=eT,C6=nT,k6=iT;/**
|
|
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 E6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),R6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),EC=e=>{const t=R6(e);return t.charAt(0).toUpperCase()+t.slice(1)},cT=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),T6=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 M6={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 N6=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...u},h)=>y.createElement("svg",{ref:h,...M6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:cT("lucide",s),...!a&&!T6(u)&&{"aria-hidden":"true"},...u},[...l.map(([d,m])=>y.createElement(d,m)),...Array.isArray(a)?a:[a]]));/**
|
|
120
|
-
* @license lucide-react v0.562.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const Ee=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement(N6,{ref:a,iconNode:t,className:cT(`lucide-${E6(EC(e))}`,`lucide-${e}`,r),...s}));return n.displayName=EC(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 A6=[["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"}]],D6=Ee("archive",A6);/**
|
|
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 O6=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],L6=Ee("arrow-down-to-line",O6);/**
|
|
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 j6=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],z6=Ee("arrow-down",j6);/**
|
|
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 P6=[["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=Ee("arrow-left-right",P6);/**
|
|
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 I6=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],H6=Ee("arrow-up",I6);/**
|
|
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 F6=[["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"}]],U6=Ee("asterisk",F6);/**
|
|
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 $6=[["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"}]],W6=Ee("book-text",$6);/**
|
|
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 V6=[["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"}]],RC=Ee("box",V6);/**
|
|
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 q6=[["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"}]],gv=Ee("brain",q6);/**
|
|
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 K6=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],G6=Ee("check-check",K6);/**
|
|
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 Y6=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],X6=Ee("check-line",Y6);/**
|
|
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 Z6=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lo=Ee("check",Z6);/**
|
|
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 Q6=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],hb=Ee("chevron-down",Q6);/**
|
|
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"}]],eP=Ee("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 tP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],fs=Ee("chevron-right",tP);/**
|
|
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 nP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],rP=Ee("chevron-up",nP);/**
|
|
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 iP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],sP=Ee("circle-slash",iP);/**
|
|
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 oP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aP=Ee("circle",oP);/**
|
|
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 lP=[["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"}]],cP=Ee("cloud-download",lP);/**
|
|
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 uP=[["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"}]],TC=Ee("code-xml",uP);/**
|
|
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 dP=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],uT=Ee("code",dP);/**
|
|
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 hP=[["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"}]],fP=Ee("command",hP);/**
|
|
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 pP=[["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"}]],cp=Ee("copy",pP);/**
|
|
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 mP=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],gP=Ee("corner-down-left",mP);/**
|
|
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 vP=[["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"}]],_P=Ee("eraser",vP);/**
|
|
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 yP=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],bP=Ee("external-link",yP);/**
|
|
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 xP=[["path",{d:"M13.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 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],SP=Ee("file-archive",xP);/**
|
|
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 wP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],CP=Ee("file-braces",wP);/**
|
|
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 kP=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],EP=Ee("file-code-corner",kP);/**
|
|
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 RP=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],TP=Ee("file-headphone",RP);/**
|
|
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 MP=[["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"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],dT=Ee("file-image",MP);/**
|
|
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 NP=[["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"}]],AP=Ee("file-pen",NP);/**
|
|
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 DP=[["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"}]],OP=Ee("file-plus-corner",DP);/**
|
|
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 LP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],jP=Ee("file-spreadsheet",LP);/**
|
|
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 zP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],PP=Ee("file-text",zP);/**
|
|
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 BP=[["path",{d:"M4 12V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2",key:"jrl274"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m10 17.843 3.033-1.755a.64.64 0 0 1 .967.56v4.704a.65.65 0 0 1-.967.56L10 20.157",key:"17aeo9"}],["rect",{width:"7",height:"6",x:"3",y:"16",rx:"1",key:"s27ndx"}]],IP=Ee("file-video-camera",BP);/**
|
|
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 HP=[["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"}]],hT=Ee("file",HP);/**
|
|
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 FP=[["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"}]],mu=Ee("flower",FP);/**
|
|
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 UP=[["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"}]],fT=Ee("folder-open",UP);/**
|
|
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 $P=[["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"}]],WP=Ee("folder",$P);/**
|
|
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 VP=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Nh=Ee("gauge",VP);/**
|
|
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 qP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],KP=Ee("info",qP);/**
|
|
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 GP=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],YP=Ee("link-2",GP);/**
|
|
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 XP=[["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"}]],ZP=Ee("list-checks",XP);/**
|
|
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 QP=[["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"}]],Cf=Ee("list-todo",QP);/**
|
|
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 JP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Di=Ee("loader-circle",JP);/**
|
|
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 eB=[["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"}]],MC=Ee("lock-open",eB);/**
|
|
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 tB=[["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"}]],NC=Ee("map",tB);/**
|
|
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 nB=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],fb=Ee("menu",nB);/**
|
|
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 rB=[["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"}]],pT=Ee("message-circle-question-mark",rB);/**
|
|
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 iB=[["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"}]],sB=Ee("message-square-quote",iB);/**
|
|
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 oB=[["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"}]],mT=Ee("minimize",oB);/**
|
|
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 aB=[["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"}]],pb=Ee("monitor",aB);/**
|
|
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 lB=[["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"}]],cB=Ee("moon",lB);/**
|
|
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 uB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],y_=Ee("panel-left",uB);/**
|
|
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 dB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],hB=Ee("panel-right",dB);/**
|
|
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 fB=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],pB=Ee("paperclip",fB);/**
|
|
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 mB=[["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"}]],gT=Ee("pencil",mB);/**
|
|
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 gB=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],mb=Ee("plus",gB);/**
|
|
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 vB=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],_B=Ee("receipt-text",vB);/**
|
|
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 yB=[["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"}]],bB=Ee("refresh-cw",yB);/**
|
|
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 xB=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],SB=Ee("scroll-text",xB);/**
|
|
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 wB=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vv=Ee("search",wB);/**
|
|
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 CB=[["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"}]],kB=Ee("send",CB);/**
|
|
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 EB=[["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"}]],RB=Ee("settings",EB);/**
|
|
450
|
-
* @license lucide-react v0.562.0 - ISC
|
|
451
|
-
*
|
|
452
|
-
* This source code is licensed under the ISC license.
|
|
453
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
454
|
-
*/const TB=[["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"}]],MB=Ee("settings-2",TB);/**
|
|
455
|
-
* @license lucide-react v0.562.0 - ISC
|
|
456
|
-
*
|
|
457
|
-
* This source code is licensed under the ISC license.
|
|
458
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
459
|
-
*/const NB=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],AB=Ee("slash",NB);/**
|
|
460
|
-
* @license lucide-react v0.562.0 - ISC
|
|
461
|
-
*
|
|
462
|
-
* This source code is licensed under the ISC license.
|
|
463
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
464
|
-
*/const DB=[["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"}]],OB=Ee("sparkles",DB);/**
|
|
465
|
-
* @license lucide-react v0.562.0 - ISC
|
|
466
|
-
*
|
|
467
|
-
* This source code is licensed under the ISC license.
|
|
468
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
469
|
-
*/const LB=[["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"}]],AC=Ee("square-menu",LB);/**
|
|
470
|
-
* @license lucide-react v0.562.0 - ISC
|
|
471
|
-
*
|
|
472
|
-
* This source code is licensed under the ISC license.
|
|
473
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
474
|
-
*/const jB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]],DC=Ee("square-minus",jB);/**
|
|
475
|
-
* @license lucide-react v0.562.0 - ISC
|
|
476
|
-
*
|
|
477
|
-
* This source code is licensed under the ISC license.
|
|
478
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
479
|
-
*/const zB=[["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"}]],gb=Ee("square-pen",zB);/**
|
|
480
|
-
* @license lucide-react v0.562.0 - ISC
|
|
481
|
-
*
|
|
482
|
-
* This source code is licensed under the ISC license.
|
|
483
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
484
|
-
*/const PB=[["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"}]],BB=Ee("square-x",PB);/**
|
|
485
|
-
* @license lucide-react v0.562.0 - ISC
|
|
486
|
-
*
|
|
487
|
-
* This source code is licensed under the ISC license.
|
|
488
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
489
|
-
*/const IB=[["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"}]],HB=Ee("sun",IB);/**
|
|
490
|
-
* @license lucide-react v0.562.0 - ISC
|
|
491
|
-
*
|
|
492
|
-
* This source code is licensed under the ISC license.
|
|
493
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
494
|
-
*/const FB=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],vb=Ee("terminal",FB);/**
|
|
495
|
-
* @license lucide-react v0.562.0 - ISC
|
|
496
|
-
*
|
|
497
|
-
* This source code is licensed under the ISC license.
|
|
498
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
499
|
-
*/const UB=[["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"}]],$B=Ee("toy-brick",UB);/**
|
|
500
|
-
* @license lucide-react v0.562.0 - ISC
|
|
501
|
-
*
|
|
502
|
-
* This source code is licensed under the ISC license.
|
|
503
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
504
|
-
*/const WB=[["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"}]],VB=Ee("trash-2",WB);/**
|
|
505
|
-
* @license lucide-react v0.562.0 - ISC
|
|
506
|
-
*
|
|
507
|
-
* This source code is licensed under the ISC license.
|
|
508
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
509
|
-
*/const qB=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],KB=Ee("upload",qB);/**
|
|
510
|
-
* @license lucide-react v0.562.0 - ISC
|
|
511
|
-
*
|
|
512
|
-
* This source code is licensed under the ISC license.
|
|
513
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
514
|
-
*/const GB=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],_b=Ee("user-round",GB);/**
|
|
515
|
-
* @license lucide-react v0.562.0 - ISC
|
|
516
|
-
*
|
|
517
|
-
* This source code is licensed under the ISC license.
|
|
518
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
519
|
-
*/const YB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ca=Ee("x",YB),Eu="data-focus-fallback-ignore",vT="data-allow-focus-retain",kf="kanna:restore-chat-input-focus",yb="data-chat-input",Ef="data-chat-selection-zone";function qo(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function _T(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:qo(e,vT):!1}function XB(e){const t=e;return t!=null&&t.matches?_T(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:qo(e,vT):!1}function OC(e){return!!e.querySelector(`[${Eu}][data-state='open']`)}function ZB(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function QB(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${yb}]`)).filter(l=>!l.disabled);if(n.length===0)return!1;const r=n.indexOf(e),s=r>=0?(r+1)%n.length:0,a=n[s];return a?(a.focus({preventScroll:!0}),!0):!1}function LC(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||qo(t,yb)||e.canCancel?"none":"escape-focus";const{pointerStartTarget:s,pointerEndTarget:a,root:l,hasActiveSelection:u}=e,h=a??s;return!l||!h||!l.contains(h)||qo(h,Eu)||qo(t,Eu)||u&&(qo(s,Ef)||qo(h,Ef))||_T(t)?"none":t&&t===h?"restore":XB(t)?"none":"restore"}const bb=x6,JB=S6,yT=y.forwardRef(({className:e,...t},n)=>g.jsx(aT,{ref:n,className:_e("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}));yT.displayName=aT.displayName;const e8={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},up=y.forwardRef(({className:e,children:t,size:n="md",...r},s)=>g.jsxs(JB,{children:[g.jsx(yT,{}),g.jsxs(lT,{ref:s,[Eu]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),window.dispatchEvent(new Event(kf)),(l=r.onCloseAutoFocus)==null||l.call(r,a)},className:_e("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",e8[n],e),...r,children:[t,g.jsxs(k6,{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(ca,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));up.displayName=lT.displayName;function t8({className:e,...t}){return g.jsx("div",{className:_e("shrink-0 flex flex-col space-y-1.5 p-4 border-b border-border",e),...t})}function xb({className:e,...t}){return g.jsx(w6,{className:_e("text-lg font-medium leading-none tracking-tight",e),...t})}function bT({className:e,...t}){return g.jsx(C6,{className:_e("text-sm text-muted-foreground",e),...t})}function Sb({className:e,...t}){return g.jsx("div",{className:_e("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function wb({className:e,...t}){return g.jsx("div",{className:_e("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",e),...t})}function n8({className:e,...t}){return g.jsx("button",{className:_e("touch-manipulation inline-flex items-center justify-center whitespace-nowrap cursor-pointer text-sm font-medium transition-colors","rounded-full h-9 px-4","hover:bg-accent dark:hover:bg-card hover:text-accent-foreground text-muted-foreground","disabled:pointer-events-none disabled:text-muted-foreground/50",e),...t})}const io=y.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{ref:r,type:t,className:_e("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}));io.displayName="Input";const xT=y.createContext(null);function r8({children:e}){const[t,n]=y.useState(null),[r,s]=y.useState(""),a=y.useRef(null);y.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(s(t.options.initialValue??""),setTimeout(()=>{var b,S;(b=a.current)==null||b.focus(),(S=a.current)==null||S.select()},0))},[t]);const l=y.useCallback(()=>{n(null),s("")},[]),u=y.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!1):t.kind==="prompt"?t.resolve(null):t.resolve(),l())},[l,t]),h=y.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!0):t.kind==="prompt"?t.resolve(r.trim()||null):t.resolve(),l())},[l,t,r]),d=y.useCallback(b=>new Promise(S=>{n({kind:"confirm",options:b,resolve:S})}),[]),m=y.useCallback(b=>new Promise(S=>{n({kind:"prompt",options:b,resolve:S})}),[]),p=y.useCallback(b=>new Promise(S=>{n({kind:"alert",options:b,resolve:S})}),[]),_=y.useMemo(()=>({confirm:d,prompt:m,alert:p}),[p,d,m]);return g.jsxs(xT.Provider,{value:_,children:[e,g.jsx(bb,{open:t!==null,onOpenChange:b=>{b||!t||u()},children:g.jsx(up,{size:"sm",onKeyDown:b=>{b.key!=="Enter"||b.shiftKey||!t||t.kind!=="confirm"||(b.preventDefault(),h())},children:t?g.jsxs(g.Fragment,{children:[g.jsxs(Sb,{className:"space-y-4",children:[g.jsx(xb,{children:t.options.title}),t.options.description?g.jsx(bT,{children:t.options.description}):null,t.kind==="prompt"?g.jsx(io,{ref:a,type:"text",value:r,onChange:b=>s(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),h())},placeholder:t.options.placeholder}):null]}),g.jsxs(wb,{children:[g.jsx(tt,{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(tt,{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 i8(){const e=y.useContext(xT);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const s8=["top","right","bottom","left"],co=Math.min,kr=Math.max,Rf=Math.round,Ah=Math.floor,Ni=e=>({x:e,y:e}),o8={left:"right",right:"left",bottom:"top",top:"bottom"};function b_(e,t,n){return kr(e,co(t,n))}function ps(e,t){return typeof e=="function"?e(t):e}function ms(e){return e.split("-")[0]}function zl(e){return e.split("-")[1]}function Cb(e){return e==="x"?"y":"x"}function kb(e){return e==="y"?"height":"width"}function Ei(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Eb(e){return Cb(Ei(e))}function a8(e,t,n){n===void 0&&(n=!1);const r=zl(e),s=Eb(e),a=kb(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Tf(l)),[l,Tf(l)]}function l8(e){const t=Tf(e);return[x_(e),t,x_(t)]}function x_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jC=["left","right"],zC=["right","left"],c8=["top","bottom"],u8=["bottom","top"];function d8(e,t,n){switch(e){case"top":case"bottom":return n?t?zC:jC:t?jC:zC;case"left":case"right":return t?c8:u8;default:return[]}}function h8(e,t,n,r){const s=zl(e);let a=d8(ms(e),n==="start",r);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(x_)))),a}function Tf(e){const t=ms(e);return o8[t]+e.slice(t.length)}function f8(e){return{top:0,right:0,bottom:0,left:0,...e}}function ST(e){return typeof e!="number"?f8(e):{top:e,right:e,bottom:e,left:e}}function Mf(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 PC(e,t,n){let{reference:r,floating:s}=e;const a=Ei(t),l=Eb(t),u=kb(l),h=ms(t),d=a==="y",m=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,_=r[u]/2-s[u]/2;let b;switch(h){case"top":b={x:m,y:r.y-s.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:p};break;case"left":b={x:r.x-s.width,y:p};break;default:b={x:r.x,y:r.y}}switch(zl(t)){case"start":b[l]-=_*(n&&d?-1:1);break;case"end":b[l]+=_*(n&&d?-1:1);break}return b}async function p8(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:l,elements:u,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:_=!1,padding:b=0}=ps(t,e),S=ST(b),C=u[_?p==="floating"?"reference":"floating":p],k=Mf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:d,rootBoundary:m,strategy:h})),T=p==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),M=await(a.isElement==null?void 0:a.isElement(R))?await(a.getScale==null?void 0:a.getScale(R))||{x:1,y:1}:{x:1,y:1},L=Mf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.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 m8=50,g8=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:p8},h=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:p}=PC(d,r,h),_=r,b=0;const S={};for(let w=0;w<a.length;w++){const C=a[w];if(!C)continue;const{name:k,fn:T}=C,{x:R,y:M,data:L,reset:O}=await T({x:m,y:p,initialPlacement:r,placement:_,strategy:s,middlewareData:S,rects:d,platform:u,elements:{reference:e,floating:t}});m=R??m,p=M??p,S[k]={...S[k],...L},O&&b<m8&&(b++,typeof O=="object"&&(O.placement&&(_=O.placement),O.rects&&(d=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):O.rects),{x:m,y:p}=PC(d,_,h)),w=-1)}return{x:m,y:p,placement:_,strategy:s,middlewareData:S}},v8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:l,elements:u,middlewareData:h}=t,{element:d,padding:m=0}=ps(e,t)||{};if(d==null)return{};const p=ST(m),_={x:n,y:r},b=Eb(s),S=kb(b),w=await l.getDimensions(d),C=b==="y",k=C?"top":"left",T=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=a.reference[S]+a.reference[b]-_[b]-a.floating[S],L=_[b]-a.reference[b],O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let j=O?O[R]:0;(!j||!await(l.isElement==null?void 0:l.isElement(O)))&&(j=u.floating[R]||a.floating[S]);const F=M/2-L/2,G=j/2-w[S]/2-1,P=co(p[k],G),H=co(p[T],G),B=P,U=j-w[S]-H,$=j/2-w[S]/2+F,W=b_(B,$,U),z=!h.arrow&&zl(s)!=null&&$!==W&&a.reference[S]/2-($<B?P:H)-w[S]/2<0,q=z?$<B?$-B:$-U:0;return{[b]:_[b]+q,data:{[b]:W,centerOffset:$-W-q,...z&&{alignmentOffset:q}},reset:z}}}),_8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:l,initialPlacement:u,platform:h,elements:d}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:_,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...C}=ps(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const k=ms(s),T=Ei(u),R=ms(u)===u,M=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=_||(R||!w?[Tf(u)]:l8(u)),O=S!=="none";!_&&O&&L.push(...h8(u,w,S,M));const j=[u,...L],F=await h.detectOverflow(t,C),G=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&G.push(F[k]),p){const $=a8(s,l,M);G.push(F[$[0]],F[$[1]])}if(P=[...P,{placement:s,overflows:G}],!G.every($=>$<=0)){var H,B;const $=(((H=a.flip)==null?void 0:H.index)||0)+1,W=j[$];if(W&&(!(p==="alignment"?T!==Ei(W):!1)||P.every(V=>Ei(V.placement)===T?V.overflows[0]>0:!0)))return{data:{index:$,overflows:P},reset:{placement:W}};let z=(B=P.filter(q=>q.overflows[0]<=0).sort((q,V)=>q.overflows[1]-V.overflows[1])[0])==null?void 0:B.placement;if(!z)switch(b){case"bestFit":{var U;const q=(U=P.filter(V=>{if(O){const X=Ei(V.placement);return X===T||X==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(X=>X>0).reduce((X,N)=>X+N,0)]).sort((V,X)=>V[1]-X[1])[0])==null?void 0:U[0];q&&(z=q);break}case"initialPlacement":z=u;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function BC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function IC(e){return s8.some(t=>e[t]>=0)}const y8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...a}=ps(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),u=BC(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:IC(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),u=BC(l,n.floating);return{data:{escapedOffsets:u,escaped:IC(u)}}}default:return{}}}}},wT=new Set(["left","top"]);async function b8(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=ms(n),u=zl(n),h=Ei(n)==="y",d=wT.has(l)?-1:1,m=a&&h?-1:1,p=ps(t,e);let{mainAxis:_,crossAxis:b,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),h?{x:b*m,y:_*d}:{x:_*d,y:b*m}}const x8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:l,middlewareData:u}=t,h=await b8(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:a+h.y,data:{...h,placement:l}}}}},S8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:h={fn:k=>{let{x:T,y:R}=k;return{x:T,y:R}}},...d}=ps(e,t),m={x:n,y:r},p=await a.detectOverflow(t,d),_=Ei(ms(s)),b=Cb(_);let S=m[b],w=m[_];if(l){const k=b==="y"?"top":"left",T=b==="y"?"bottom":"right",R=S+p[k],M=S-p[T];S=b_(R,S,M)}if(u){const k=_==="y"?"top":"left",T=_==="y"?"bottom":"right",R=w+p[k],M=w-p[T];w=b_(R,w,M)}const C=h.fn({...t,[b]:S,[_]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[b]:l,[_]:u}}}}}},w8=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:l}=t,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=ps(e,t),m={x:n,y:r},p=Ei(s),_=Cb(p);let b=m[_],S=m[p];const w=ps(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(h){const R=_==="y"?"height":"width",M=a.reference[_]-a.floating[R]+C.mainAxis,L=a.reference[_]+a.reference[R]-C.mainAxis;b<M?b=M:b>L&&(b=L)}if(d){var k,T;const R=_==="y"?"width":"height",M=wT.has(ms(s)),L=a.reference[p]-a.floating[R]+(M&&((k=l.offset)==null?void 0:k[p])||0)+(M?0:C.crossAxis),O=a.reference[p]+a.reference[R]+(M?0:((T=l.offset)==null?void 0:T[p])||0)-(M?C.crossAxis:0);S<L?S=L:S>O&&(S=O)}return{[_]:b,[p]:S}}}},C8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:l,elements:u}=t,{apply:h=()=>{},...d}=ps(e,t),m=await l.detectOverflow(t,d),p=ms(s),_=zl(s),b=Ei(s)==="y",{width:S,height:w}=a.floating;let C,k;p==="top"||p==="bottom"?(C=p,k=_===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(k=p,C=_==="end"?"top":"bottom");const T=w-m.top-m.bottom,R=S-m.left-m.right,M=co(w-m[C],T),L=co(S-m[k],R),O=!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),O&&!_){const P=kr(m.left,0),H=kr(m.right,0),B=kr(m.top,0),U=kr(m.bottom,0);b?F=S-2*(P!==0||H!==0?P+H:kr(m.left,m.right)):j=w-2*(B!==0||U!==0?B+U:kr(m.top,m.bottom))}await h({...t,availableWidth:F,availableHeight:j});const G=await l.getDimensions(u.floating);return S!==G.width||w!==G.height?{reset:{rects:!0}}:{}}}};function dp(){return typeof window<"u"}function Pl(e){return CT(e)?(e.nodeName||"").toLowerCase():"#document"}function Er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ji(e){var t;return(t=(CT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function CT(e){return dp()?e instanceof Node||e instanceof Er(e).Node:!1}function ui(e){return dp()?e instanceof Element||e instanceof Er(e).Element:!1}function _s(e){return dp()?e instanceof HTMLElement||e instanceof Er(e).HTMLElement:!1}function HC(e){return!dp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Er(e).ShadowRoot}function qu(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=di(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function k8(e){return/^(table|td|th)$/.test(Pl(e))}function hp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const E8=/transform|translate|scale|rotate|perspective|filter/,R8=/paint|layout|strict|content/,Bo=e=>!!e&&e!=="none";let _v;function Rb(e){const t=ui(e)?di(e):e;return Bo(t.transform)||Bo(t.translate)||Bo(t.scale)||Bo(t.rotate)||Bo(t.perspective)||!Tb()&&(Bo(t.backdropFilter)||Bo(t.filter))||E8.test(t.willChange||"")||R8.test(t.contain||"")}function T8(e){let t=uo(e);for(;_s(t)&&!Cl(t);){if(Rb(t))return t;if(hp(t))return null;t=uo(t)}return null}function Tb(){return _v==null&&(_v=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_v}function Cl(e){return/^(html|body|#document)$/.test(Pl(e))}function di(e){return Er(e).getComputedStyle(e)}function fp(e){return ui(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uo(e){if(Pl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||HC(e)&&e.host||ji(e);return HC(t)?t.host:t}function kT(e){const t=uo(e);return Cl(t)?e.ownerDocument?e.ownerDocument.body:e.body:_s(t)&&qu(t)?t:kT(t)}function Ru(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=kT(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),l=Er(s);if(a){const u=S_(l);return t.concat(l,l.visualViewport||[],qu(s)?s:[],u&&n?Ru(u):[])}else return t.concat(s,Ru(s,[],n))}function S_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ET(e){const t=di(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=_s(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=Rf(n)!==a||Rf(r)!==l;return u&&(n=a,r=l),{width:n,height:r,$:u}}function Mb(e){return ui(e)?e:e.contextElement}function _l(e){const t=Mb(e);if(!_s(t))return Ni(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=ET(t);let l=(a?Rf(n.width):n.width)/r,u=(a?Rf(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const M8=Ni(0);function RT(e){const t=Er(e);return!Tb()||!t.visualViewport?M8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function N8(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Er(e)?!1:t}function Jo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Mb(e);let l=Ni(1);t&&(r?ui(r)&&(l=_l(r)):l=_l(e));const u=N8(a,n,r)?RT(a):Ni(0);let h=(s.left+u.x)/l.x,d=(s.top+u.y)/l.y,m=s.width/l.x,p=s.height/l.y;if(a){const _=Er(a),b=r&&ui(r)?Er(r):r;let S=_,w=S_(S);for(;w&&r&&b!==S;){const C=_l(w),k=w.getBoundingClientRect(),T=di(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,m*=C.x,p*=C.y,h+=R,d+=M,S=Er(w),w=S_(S)}}return Mf({width:m,height:p,x:h,y:d})}function pp(e,t){const n=fp(e).scrollLeft;return t?t.left+n:Jo(ji(e)).left+n}function TT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pp(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function A8(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",l=ji(r),u=t?hp(t.floating):!1;if(r===l||u&&a)return n;let h={scrollLeft:0,scrollTop:0},d=Ni(1);const m=Ni(0),p=_s(r);if((p||!p&&!a)&&((Pl(r)!=="body"||qu(l))&&(h=fp(r)),p)){const b=Jo(r);d=_l(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const _=l&&!p&&!a?TT(l,h):Ni(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-h.scrollLeft*d.x+m.x+_.x,y:n.y*d.y-h.scrollTop*d.y+m.y+_.y}}function D8(e){return Array.from(e.getClientRects())}function O8(e){const t=ji(e),n=fp(e),r=e.ownerDocument.body,s=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+pp(e);const u=-n.scrollTop;return di(r).direction==="rtl"&&(l+=kr(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:l,y:u}}const FC=25;function L8(e,t){const n=Er(e),r=ji(e),s=n.visualViewport;let a=r.clientWidth,l=r.clientHeight,u=0,h=0;if(s){a=s.width,l=s.height;const m=Tb();(!m||m&&t==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}const d=pp(r);if(d<=0){const m=r.ownerDocument,p=m.body,_=getComputedStyle(p),b=m.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,S=Math.abs(r.clientWidth-p.clientWidth-b);S<=FC&&(a-=S)}else d<=FC&&(a+=d);return{width:a,height:l,x:u,y:h}}function j8(e,t){const n=Jo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=_s(e)?_l(e):Ni(1),l=e.clientWidth*a.x,u=e.clientHeight*a.y,h=s*a.x,d=r*a.y;return{width:l,height:u,x:h,y:d}}function UC(e,t,n){let r;if(t==="viewport")r=L8(e,n);else if(t==="document")r=O8(ji(e));else if(ui(t))r=j8(t,n);else{const s=RT(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Mf(r)}function MT(e,t){const n=uo(e);return n===t||!ui(n)||Cl(n)?!1:di(n).position==="fixed"||MT(n,t)}function z8(e,t){const n=t.get(e);if(n)return n;let r=Ru(e,[],!1).filter(u=>ui(u)&&Pl(u)!=="body"),s=null;const a=di(e).position==="fixed";let l=a?uo(e):e;for(;ui(l)&&!Cl(l);){const u=di(l),h=Rb(l);!h&&u.position==="fixed"&&(s=null),(a?!h&&!s:!h&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||qu(l)&&!h&&MT(e,l))?r=r.filter(m=>m!==l):s=u,l=uo(l)}return t.set(e,r),r}function P8(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?hp(t)?[]:z8(t,this._c):[].concat(n),r],u=UC(t,l[0],s);let h=u.top,d=u.right,m=u.bottom,p=u.left;for(let _=1;_<l.length;_++){const b=UC(t,l[_],s);h=kr(b.top,h),d=co(b.right,d),m=co(b.bottom,m),p=kr(b.left,p)}return{width:d-p,height:m-h,x:p,y:h}}function B8(e){const{width:t,height:n}=ET(e);return{width:t,height:n}}function I8(e,t,n){const r=_s(t),s=ji(t),a=n==="fixed",l=Jo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const h=Ni(0);function d(){h.x=pp(s)}if(r||!r&&!a)if((Pl(t)!=="body"||qu(s))&&(u=fp(t)),r){const b=Jo(t,!0,a,t);h.x=b.x+t.clientLeft,h.y=b.y+t.clientTop}else s&&d();a&&!r&&s&&d();const m=s&&!r&&!a?TT(s,u):Ni(0),p=l.left+u.scrollLeft-h.x-m.x,_=l.top+u.scrollTop-h.y-m.y;return{x:p,y:_,width:l.width,height:l.height}}function yv(e){return di(e).position==="static"}function $C(e,t){if(!_s(e)||di(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ji(e)===n&&(n=n.ownerDocument.body),n}function NT(e,t){const n=Er(e);if(hp(e))return n;if(!_s(e)){let s=uo(e);for(;s&&!Cl(s);){if(ui(s)&&!yv(s))return s;s=uo(s)}return n}let r=$C(e,t);for(;r&&k8(r)&&yv(r);)r=$C(r,t);return r&&Cl(r)&&yv(r)&&!Rb(r)?n:r||T8(e)||n}const H8=async function(e){const t=this.getOffsetParent||NT,n=this.getDimensions,r=await n(e.floating);return{reference:I8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function F8(e){return di(e).direction==="rtl"}const U8={convertOffsetParentRelativeRectToViewportRelativeRect:A8,getDocumentElement:ji,getClippingRect:P8,getOffsetParent:NT,getElementRects:H8,getClientRects:D8,getDimensions:B8,getScale:_l,isElement:ui,isRTL:F8};function AT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $8(e,t){let n=null,r;const s=ji(e);function a(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),a();const d=e.getBoundingClientRect(),{left:m,top:p,width:_,height:b}=d;if(u||t(),!_||!b)return;const S=Ah(p),w=Ah(s.clientWidth-(m+_)),C=Ah(s.clientHeight-(p+b)),k=Ah(m),R={rootMargin:-S+"px "+-w+"px "+-C+"px "+-k+"px",threshold:kr(0,co(1,h))||1};let M=!0;function L(O){const j=O[0].intersectionRatio;if(j!==h){if(!M)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!AT(d,e.getBoundingClientRect())&&l(),M=!1}try{n=new IntersectionObserver(L,{...R,root:s.ownerDocument})}catch{n=new IntersectionObserver(L,R)}n.observe(e)}return l(!0),a}function W8(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,d=Mb(e),m=s||a?[...d?Ru(d):[],...t?Ru(t):[]]:[];m.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),a&&k.addEventListener("resize",n)});const p=d&&u?$8(d,n):null;let _=-1,b=null;l&&(b=new ResizeObserver(k=>{let[T]=k;T&&T.target===d&&b&&t&&(b.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(t)})),n()}),d&&!h&&b.observe(d),t&&b.observe(t));let S,w=h?Jo(e):null;h&&C();function C(){const k=Jo(e);w&&!AT(w,k)&&n(),w=k,S=requestAnimationFrame(C)}return n(),()=>{var k;m.forEach(T=>{s&&T.removeEventListener("scroll",n),a&&T.removeEventListener("resize",n)}),p==null||p(),(k=b)==null||k.disconnect(),b=null,h&&cancelAnimationFrame(S)}}const V8=x8,q8=S8,K8=_8,G8=C8,Y8=y8,WC=v8,X8=w8,Z8=(e,t,n)=>{const r=new Map,s={platform:U8,...n},a={...s.platform,_c:r};return g8(e,t,{...s,platform:a})};var Q8=typeof document<"u",J8=function(){},rf=Q8?y.useLayoutEffect:J8;function Nf(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(!Nf(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!Nf(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function DT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VC(e,t){const n=DT(e);return Math.round(t*n)/n}function bv(e){const t=y.useRef(e);return rf(()=>{t.current=e}),t}function eI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:h,open:d}=e,[m,p]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,b]=y.useState(r);Nf(_,r)||b(r);const[S,w]=y.useState(null),[C,k]=y.useState(null),T=y.useCallback(V=>{V!==O.current&&(O.current=V,w(V))},[]),R=y.useCallback(V=>{V!==j.current&&(j.current=V,k(V))},[]),M=a||S,L=l||C,O=y.useRef(null),j=y.useRef(null),F=y.useRef(m),G=h!=null,P=bv(h),H=bv(s),B=bv(d),U=y.useCallback(()=>{if(!O.current||!j.current)return;const V={placement:t,strategy:n,middleware:_};H.current&&(V.platform=H.current),Z8(O.current,j.current,V).then(X=>{const N={...X,isPositioned:B.current!==!1};$.current&&!Nf(F.current,N)&&(F.current=N,ki.flushSync(()=>{p(N)}))})},[_,t,n,H,B]);rf(()=>{d===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[d]);const $=y.useRef(!1);rf(()=>($.current=!0,()=>{$.current=!1}),[]),rf(()=>{if(M&&(O.current=M),L&&(j.current=L),M&&L){if(P.current)return P.current(M,L,U);U()}},[M,L,U,P,G]);const W=y.useMemo(()=>({reference:O,floating:j,setReference:T,setFloating:R}),[T,R]),z=y.useMemo(()=>({reference:M,floating:L}),[M,L]),q=y.useMemo(()=>{const V={position:n,left:0,top:0};if(!z.floating)return V;const X=VC(z.floating,m.x),N=VC(z.floating,m.y);return u?{...V,transform:"translate("+X+"px, "+N+"px)",...DT(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:N}},[n,u,z.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:U,refs:W,elements:z,floatingStyles:q}),[m,U,W,z,q])}const tI=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?WC({element:r.current,padding:s}).fn(n):{}:r?WC({element:r,padding:s}).fn(n):{}}}},nI=(e,t)=>{const n=V8(e);return{name:n.name,fn:n.fn,options:[e,t]}},rI=(e,t)=>{const n=q8(e);return{name:n.name,fn:n.fn,options:[e,t]}},iI=(e,t)=>({fn:X8(e).fn,options:[e,t]}),sI=(e,t)=>{const n=K8(e);return{name:n.name,fn:n.fn,options:[e,t]}},oI=(e,t)=>{const n=G8(e);return{name:n.name,fn:n.fn,options:[e,t]}},aI=(e,t)=>{const n=Y8(e);return{name:n.name,fn:n.fn,options:[e,t]}},lI=(e,t)=>{const n=tI(e);return{name:n.name,fn:n.fn,options:[e,t]}};var cI="Arrow",OT=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return g.jsx(st.svg,{...a,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"})})});OT.displayName=cI;var uI=OT;function dI(e){const[t,n]=y.useState(void 0);return Un(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,u;if("borderBoxSize"in a){const h=a.borderBoxSize,d=Array.isArray(h)?h[0]:h;l=d.inlineSize,u=d.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Nb="Popper",[LT,po]=vs(Nb),[hI,jT]=LT(Nb),zT=e=>{const{__scopePopper:t,children:n}=e,[r,s]=y.useState(null);return g.jsx(hI,{scope:t,anchor:r,onAnchorChange:s,children:n})};zT.displayName=Nb;var PT="PopperAnchor",BT=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=jT(PT,n),l=y.useRef(null),u=vt(t,l),h=y.useRef(null);return y.useEffect(()=>{const d=h.current;h.current=(r==null?void 0:r.current)||l.current,d!==h.current&&a.onAnchorChange(h.current)}),r?null:g.jsx(st.div,{...s,ref:u})});BT.displayName=PT;var Ab="PopperContent",[fI,pI]=LT(Ab),IT=y.forwardRef((e,t)=>{var Q,ve,ne,de,we,Ce;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:_=!1,updatePositionStrategy:b="optimized",onPlaced:S,...w}=e,C=jT(Ab,n),[k,T]=y.useState(null),R=vt(t,Re=>T(Re)),[M,L]=y.useState(null),O=dI(M),j=(O==null?void 0:O.width)??0,F=(O==null?void 0:O.height)??0,G=r+(a!=="center"?"-"+a:""),P=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},H=Array.isArray(d)?d:[d],B=H.length>0,U={padding:P,boundary:H.filter(gI),altBoundary:B},{refs:$,floatingStyles:W,placement:z,isPositioned:q,middlewareData:V}=eI({strategy:"fixed",placement:G,whileElementsMounted:(...Re)=>W8(...Re,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[nI({mainAxis:s+F,alignmentAxis:l}),h&&rI({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?iI():void 0,...U}),h&&sI({...U}),oI({...U,apply:({elements:Re,rects:ze,availableWidth:yt,availableHeight:dt})=>{const{width:Ct,height:tn}=ze.reference,_t=Re.floating.style;_t.setProperty("--radix-popper-available-width",`${yt}px`),_t.setProperty("--radix-popper-available-height",`${dt}px`),_t.setProperty("--radix-popper-anchor-width",`${Ct}px`),_t.setProperty("--radix-popper-anchor-height",`${tn}px`)}}),M&&lI({element:M,padding:u}),vI({arrowWidth:j,arrowHeight:F}),_&&aI({strategy:"referenceHidden",...U})]}),[X,N]=UT(z),I=ci(S);Un(()=>{q&&(I==null||I())},[q,I]);const Z=(Q=V.arrow)==null?void 0:Q.x,D=(ve=V.arrow)==null?void 0:ve.y,ce=((ne=V.arrow)==null?void 0:ne.centerOffset)!==0,[pe,ae]=y.useState();return Un(()=>{k&&ae(window.getComputedStyle(k).zIndex)},[k]),g.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:q?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[(de=V.transformOrigin)==null?void 0:de.x,(we=V.transformOrigin)==null?void 0:we.y].join(" "),...((Ce=V.hide)==null?void 0:Ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(fI,{scope:n,placedSide:X,onArrowChange:L,arrowX:Z,arrowY:D,shouldHideArrow:ce,children:g.jsx(st.div,{"data-side":X,"data-align":N,...w,ref:R,style:{...w.style,animation:q?void 0:"none"}})})})});IT.displayName=Ab;var HT="PopperArrow",mI={top:"bottom",right:"left",bottom:"top",left:"right"},FT=y.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=pI(HT,r),l=mI[a.placedSide];return g.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:g.jsx(uI,{...s,ref:n,style:{...s.style,display:"block"}})})});FT.displayName=HT;function gI(e){return e!==null}var vI=e=>({name:"transformOrigin",options:e,fn(t){var C,k,T;const{placement:n,rects:r,middlewareData:s}=t,l=((C=s.arrow)==null?void 0:C.centerOffset)!==0,u=l?0:e.arrowWidth,h=l?0:e.arrowHeight,[d,m]=UT(n),p={start:"0%",center:"50%",end:"100%"}[m],_=(((k=s.arrow)==null?void 0:k.x)??0)+u/2,b=(((T=s.arrow)==null?void 0:T.y)??0)+h/2;let S="",w="";return d==="bottom"?(S=l?p:`${_}px`,w=`${-h}px`):d==="top"?(S=l?p:`${_}px`,w=`${r.floating.height+h}px`):d==="right"?(S=`${-h}px`,w=l?p:`${b}px`):d==="left"&&(S=`${r.floating.width+h}px`,w=l?p:`${b}px`),{data:{x:S,y:w}}}});function UT(e){const[t,n="center"]=e.split("-");return[t,n]}var mp=zT,Ku=BT,gp=IT,vp=FT,$T=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"}),_I="VisuallyHidden",WT=y.forwardRef((e,t)=>g.jsx(st.span,{...e,ref:t,style:{...$T,...e.style}}));WT.displayName=_I;var yI=WT,[_p]=vs("Tooltip",[po]),yp=po(),VT="TooltipProvider",bI=700,w_="tooltip.open",[xI,Db]=_p(VT),qT=e=>{const{__scopeTooltip:t,delayDuration:n=bI,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,l=y.useRef(!0),u=y.useRef(!1),h=y.useRef(0);return y.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),g.jsx(xI,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(h.current),l.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:y.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:a})};qT.displayName=VT;var Tu="Tooltip",[SI,Gu]=_p(Tu),KT=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:l,delayDuration:u}=e,h=Db(Tu,e.__scopeTooltip),d=yp(t),[m,p]=y.useState(null),_=ds(),b=y.useRef(0),S=l??h.disableHoverableContent,w=u??h.delayDuration,C=y.useRef(!1),[k,T]=wl({prop:r,defaultProp:s??!1,onChange:j=>{j?(h.onOpen(),document.dispatchEvent(new CustomEvent(w_))):h.onClose(),a==null||a(j)},caller:Tu}),R=y.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),M=y.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,T(!0)},[T]),L=y.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),O=y.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,T(!0),b.current=0},w)},[w,T]);return y.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),g.jsx(mp,{...d,children:g.jsx(SI,{scope:t,contentId:_,open:k,stateAttribute:R,trigger:m,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{h.isOpenDelayedRef.current?O():M()},[h.isOpenDelayedRef,O,M]),onTriggerLeave:y.useCallback(()=>{S?L():(window.clearTimeout(b.current),b.current=0)},[L,S]),onOpen:M,onClose:L,disableHoverableContent:S,children:n})})};KT.displayName=Tu;var C_="TooltipTrigger",GT=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Gu(C_,n),a=Db(C_,n),l=yp(n),u=y.useRef(null),h=vt(t,u,s.onTriggerChange),d=y.useRef(!1),m=y.useRef(!1),p=y.useCallback(()=>d.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),g.jsx(Ku,{asChild:!0,...l,children:g.jsx(st.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:Ne(e.onPointerMove,_=>{_.pointerType!=="touch"&&!m.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ne(e.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:Ne(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ne(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Ne(e.onBlur,s.onClose),onClick:Ne(e.onClick,s.onClose)})})});GT.displayName=C_;var Ob="TooltipPortal",[wI,CI]=_p(Ob,{forceMount:void 0}),YT=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=Gu(Ob,t);return g.jsx(wI,{scope:t,forceMount:n,children:g.jsx(Zr,{present:n||a.open,children:g.jsx(jl,{asChild:!0,container:s,children:r})})})};YT.displayName=Ob;var kl="TooltipContent",XT=y.forwardRef((e,t)=>{const n=CI(kl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,l=Gu(kl,e.__scopeTooltip);return g.jsx(Zr,{present:r||l.open,children:l.disableHoverableContent?g.jsx(ZT,{side:s,...a,ref:t}):g.jsx(kI,{side:s,...a,ref:t})})}),kI=y.forwardRef((e,t)=>{const n=Gu(kl,e.__scopeTooltip),r=Db(kl,e.__scopeTooltip),s=y.useRef(null),a=vt(t,s),[l,u]=y.useState(null),{trigger:h,onClose:d}=n,m=s.current,{onPointerInTransitChange:p}=r,_=y.useCallback(()=>{u(null),p(!1)},[p]),b=y.useCallback((S,w)=>{const C=S.currentTarget,k={x:S.clientX,y:S.clientY},T=NI(k,C.getBoundingClientRect()),R=AI(k,T),M=DI(w.getBoundingClientRect()),L=LI([...R,...M]);u(L),p(!0)},[p]);return y.useEffect(()=>()=>_(),[_]),y.useEffect(()=>{if(h&&m){const S=C=>b(C,m),w=C=>b(C,h);return h.addEventListener("pointerleave",S),m.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",S),m.removeEventListener("pointerleave",w)}}},[h,m,b,_]),y.useEffect(()=>{if(l){const S=w=>{const C=w.target,k={x:w.clientX,y:w.clientY},T=(h==null?void 0:h.contains(C))||(m==null?void 0:m.contains(C)),R=!OI(k,l);T?_():R&&(_(),d())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[h,m,l,d,_]),g.jsx(ZT,{...e,ref:a})}),[EI,RI]=_p(Tu,{isInside:!1}),TI=nz("TooltipContent"),ZT=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=e,h=Gu(kl,n),d=yp(n),{onClose:m}=h;return y.useEffect(()=>(document.addEventListener(w_,m),()=>document.removeEventListener(w_,m)),[m]),y.useEffect(()=>{if(h.trigger){const p=_=>{const b=_.target;b!=null&&b.contains(h.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[h.trigger,m]),g.jsx(Ll,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:g.jsxs(gp,{"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(TI,{children:r}),g.jsx(EI,{scope:n,isInside:!0,children:g.jsx(yI,{id:h.contentId,role:"tooltip",children:s||r})})]})})});XT.displayName=kl;var QT="TooltipArrow",MI=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=yp(n);return RI(QT,n).isInside?null:g.jsx(vp,{...s,...r,ref:t})});MI.displayName=QT;function NI(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function AI(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 DI(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 OI(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],h=t[l],d=u.x,m=u.y,p=h.x,_=h.y;m>r!=_>r&&n<(p-d)*(r-m)/(_-m)+d&&(s=!s)}return s}function LI(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),jI(t)}function jI(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],l=t[t.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],l=n[n.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var zI=qT,JT=KT,eM=GT,tM=YT,Lb=XT;function PI({className:e,...t}){return g.jsx("kbd",{className:_e("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 BI({className:e,...t}){return g.jsx("span",{className:_e("inline-flex items-center gap-0.5",e),...t})}const II="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",HI=zI,Af=JT,Df=eM,Mu=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(tM,{children:g.jsx(Lb,{ref:r,sideOffset:t,className:_e("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})}));Mu.displayName=Lb.displayName;const nu=JT,ru=eM;function nM(e){return e.toUpperCase()}function FI(e){const t=e.split("+");return g.jsx(BI,{children:t.map((n,r)=>g.jsx(PI,{children:nM(n)},`${n}-${r}`))})}const hl=y.forwardRef(({className:e,sideOffset:t=4,children:n,shortcut:r,...s},a)=>{const l=r===void 0?null:Array.isArray(r)?r[0]??null:r;return g.jsx(tM,{children:g.jsx(Lb,{ref:a,sideOffset:t,className:_e(II,e),...s,children:l?FI(l):g.jsx("span",{children:typeof n=="string"?nM(n):n})})})});hl.displayName="HotkeyTooltipContent";const UI="0.18.0",$I={version:UI},Kn="Kanna",qC="kanna",WI=".kanna",VI=".kanna-dev",qI="KANNA_RUNTIME_PROFILE",jb=`kanna/${$I.version}`,KI="[kanna]",GI=`~/${Kn}`;function bp(){var t;return(t=globalThis.process)==null?void 0:t.env}function YI(e=bp()){var t;return((t=e==null?void 0:e[qI])==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function XI(e=bp()){return YI(e)==="dev"?VI:WI}function ZI(e=bp()){return`~/${XI(e)}`}function QI(e=bp()){return`${ZI(e)}/keybindings.json`}function Dh(e){return e?`${qC} ${e}`:qC}const xp=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...s})=>g.jsx("span",{style:{"--shiny-width":`${Math.min(n,100)}px`},className:_e("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 k_(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const JI=[/^(?:\/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 e7(e){const t=e.trim();for(const n of JI){const r=t.match(n);if(!r)continue;const s=(r[2]??r[1]??"").trim();if(s)return s}return t}function rM(e){return e.split("/").pop()||e}function t7(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,s=60*r,a=24*s,l=7*a;return n<r?"now":n<s?`${Math.floor(n/r)}m`:n<a?`${Math.floor(n/s)}h`:n<l?`${Math.floor(n/a)}d`:`${Math.floor(n/l)}w`}const n7=new Set(["starting","running"]);function r7({chat:e,activeChatId:t,nowMs:n,onSelectChat:r,onDeleteChat:s}){const a=t7(e.lastMessageAt,n);return g.jsxs("div",{"data-chat-id":hC(e.chatId),className:_e("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===hC(e.chatId)?"bg-muted hover:bg-muted border-border":"border-border/0 dark:hover:border-slate-400/10 "),onClick:()=>r(e.chatId),children:[n7.has(e.status)?g.jsx(Di,{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(xp,{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:[a?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:a}):null,g.jsx(tt,{variant:"ghost",size:"icon",className:_e("absolute inset-0 h-7 w-7 opacity-100 cursor-pointer rounded-sm hover:!bg-transparent !border-0",a?"md:opacity-0 md:group-hover:opacity-100":"opacity-100 md:opacity-0 md:group-hover:opacity-100"),onClick:l=>{l.stopPropagation(),s(e.chatId)},title:"Delete chat",children:g.jsx(D6,{className:"size-3.5"})})]})]},e._id)}function i7(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Sp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function zb(e){return"nodeType"in e}function ur(e){var t,n;return e?Bl(e)?e:zb(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Pb(e){const{Document:t}=ur(e);return e instanceof t}function Yu(e){return Bl(e)?!1:e instanceof ur(e).HTMLElement}function iM(e){return e instanceof ur(e).SVGElement}function Il(e){return e?Bl(e)?e.document:zb(e)?Pb(e)?e:Yu(e)||iM(e)?e.ownerDocument:document:document:document}const Oi=Sp?y.useLayoutEffect:y.useEffect;function Bb(e){const t=y.useRef(e);return Oi(()=>{t.current=e}),y.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 s7(){const e=y.useRef(null),t=y.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=y.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Nu(e,t){t===void 0&&(t=[e]);const n=y.useRef(e);return Oi(()=>{n.current!==e&&(n.current=e)},t),n}function Xu(e,t){const n=y.useRef();return y.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Of(e){const t=Bb(e),n=y.useRef(null),r=y.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function E_(e){const t=y.useRef();return y.useEffect(()=>{t.current=e},[e]),t.current}let xv={};function Zu(e,t){return y.useMemo(()=>{if(t)return t;const n=xv[e]==null?0:xv[e]+1;return xv[e]=n,e+"-"+n},[e,t])}function sM(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((a,l)=>{const u=Object.entries(l);for(const[h,d]of u){const m=a[h];m!=null&&(a[h]=m+e*d)}return a},{...t})}}const yl=sM(1),Lf=sM(-1);function o7(e){return"clientX"in e&&"clientY"in e}function Ib(e){if(!e)return!1;const{KeyboardEvent:t}=ur(e.target);return t&&e instanceof t}function a7(e){if(!e)return!1;const{TouchEvent:t}=ur(e.target);return t&&e instanceof t}function R_(e){if(a7(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 o7(e)?{x:e.clientX,y:e.clientY}:null}const Au=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[Au.Translate.toString(e),Au.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),KC="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function l7(e){return e.matches(KC)?e:e.querySelector(KC)}const c7={display:"none"};function u7(e){let{id:t,value:n}=e;return Lt.createElement("div",{id:t,style:c7},n)}function d7(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 Lt.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function h7(){const[e,t]=y.useState("");return{announce:y.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const oM=y.createContext(null);function f7(e){const t=y.useContext(oM);y.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function p7(){const[e]=y.useState(()=>new Set),t=y.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[y.useCallback(r=>{let{type:s,event:a}=r;e.forEach(l=>{var u;return(u=l[s])==null?void 0:u.call(l,a)})},[e]),t]}const m7={draggable:`
|
|
520
|
-
To pick up a draggable item, press the space bar.
|
|
521
|
-
While dragging, use the arrow keys to move the item.
|
|
522
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
523
|
-
`},g7={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 v7(e){let{announcements:t=g7,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=m7}=e;const{announce:a,announcement:l}=h7(),u=Zu("DndLiveRegion"),[h,d]=y.useState(!1);if(y.useEffect(()=>{d(!0)},[]),f7(y.useMemo(()=>({onDragStart(p){let{active:_}=p;a(t.onDragStart({active:_}))},onDragMove(p){let{active:_,over:b}=p;t.onDragMove&&a(t.onDragMove({active:_,over:b}))},onDragOver(p){let{active:_,over:b}=p;a(t.onDragOver({active:_,over:b}))},onDragEnd(p){let{active:_,over:b}=p;a(t.onDragEnd({active:_,over:b}))},onDragCancel(p){let{active:_,over:b}=p;a(t.onDragCancel({active:_,over:b}))}}),[a,t])),!h)return null;const m=Lt.createElement(Lt.Fragment,null,Lt.createElement(u7,{id:r,value:s.draggable}),Lt.createElement(d7,{id:u,announcement:l}));return n?ki.createPortal(m,n):m}var gn;(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"})(gn||(gn={}));function jf(){}function GC(e,t){return y.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function _7(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const hi=Object.freeze({x:0,y:0});function y7(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function b7(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function x7(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function S7(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function YC(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 w7=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=YC(t,t.left,t.top),a=[];for(const l of r){const{id:u}=l,h=n.get(u);if(h){const d=y7(YC(h),s);a.push({id:u,data:{droppableContainer:l,value:d}})}}return a.sort(b7)};function C7(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=s-r,u=a-n;if(r<s&&n<a){const h=t.width*t.height,d=e.width*e.height,m=l*u,p=m/(h+d-m);return Number(p.toFixed(4))}return 0}const k7=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const a of r){const{id:l}=a,u=n.get(l);if(u){const h=C7(u,t);h>0&&s.push({id:l,data:{droppableContainer:a,value:h}})}}return s.sort(x7)};function E7(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function aM(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:hi}function R7(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return s.reduce((l,u)=>({...l,top:l.top+e*u.y,bottom:l.bottom+e*u.y,left:l.left+e*u.x,right:l.right+e*u.x}),{...n})}}const T7=R7(1);function M7(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 N7(e,t,n){const r=M7(t);if(!r)return e;const{scaleX:s,scaleY:a,x:l,y:u}=r,h=e.left-l-(1-s)*parseFloat(n),d=e.top-u-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),m=s?e.width/s:e.width,p=a?e.height/a:e.height;return{width:m,height:p,top:d,right:h+m,bottom:d+p,left:h}}const A7={ignoreTransform:!1};function Hl(e,t){t===void 0&&(t=A7);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:m}=ur(e).getComputedStyle(e);d&&(n=N7(n,d,m))}const{top:r,left:s,width:a,height:l,bottom:u,right:h}=n;return{top:r,left:s,width:a,height:l,bottom:u,right:h}}function XC(e){return Hl(e,{ignoreTransform:!0})}function D7(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function O7(e,t){return t===void 0&&(t=ur(e).getComputedStyle(e)),t.position==="fixed"}function L7(e,t){t===void 0&&(t=ur(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const a=t[s];return typeof a=="string"?n.test(a):!1})}function Hb(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Pb(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Yu(s)||iM(s)||n.includes(s))return n;const a=ur(e).getComputedStyle(s);return s!==e&&L7(s,a)&&n.push(s),O7(s,a)?n:r(s.parentNode)}return e?r(e):n}function lM(e){const[t]=Hb(e,1);return t??null}function Sv(e){return!Sp||!e?null:Bl(e)?e:zb(e)?Pb(e)||e===Il(e).scrollingElement?window:Yu(e)?e:null:null}function cM(e){return Bl(e)?e.scrollX:e.scrollLeft}function uM(e){return Bl(e)?e.scrollY:e.scrollTop}function T_(e){return{x:cM(e),y:uM(e)}}var xn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(xn||(xn={}));function dM(e){return!Sp||!e?!1:e===document.scrollingElement}function hM(e){const t={x:0,y:0},n=dM(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:a,isBottom:l,isRight:u,maxScroll:r,minScroll:t}}const j7={x:.2,y:.2};function z7(e,t,n,r,s){let{top:a,left:l,right:u,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=j7);const{isTop:d,isBottom:m,isLeft:p,isRight:_}=hM(e),b={x:0,y:0},S={x:0,y:0},w={height:t.height*s.y,width:t.width*s.x};return!d&&a<=t.top+w.height?(b.y=xn.Backward,S.y=r*Math.abs((t.top+w.height-a)/w.height)):!m&&h>=t.bottom-w.height&&(b.y=xn.Forward,S.y=r*Math.abs((t.bottom-w.height-h)/w.height)),!_&&u>=t.right-w.width?(b.x=xn.Forward,S.x=r*Math.abs((t.right-w.width-u)/w.width)):!p&&l<=t.left+w.width&&(b.x=xn.Backward,S.x=r*Math.abs((t.left+w.width-l)/w.width)),{direction:b,speed:S}}function P7(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function fM(e){return e.reduce((t,n)=>yl(t,T_(n)),hi)}function B7(e){return e.reduce((t,n)=>t+cM(n),0)}function I7(e){return e.reduce((t,n)=>t+uM(n),0)}function H7(e,t){if(t===void 0&&(t=Hl),!e)return;const{top:n,left:r,bottom:s,right:a}=t(e);lM(e)&&(s<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const F7=[["x",["left","right"],B7],["y",["top","bottom"],I7]];class Fb{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=Hb(n),s=fM(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,u]of F7)for(const h of l)Object.defineProperty(this,h,{get:()=>{const d=u(r),m=s[a]-d;return this.rect[h]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class gu{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 U7(e){const{EventTarget:t}=ur(e);return e instanceof t?e:Il(e)}function wv(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 Vr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Vr||(Vr={}));function ZC(e){e.preventDefault()}function $7(e){e.stopPropagation()}var gt;(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"})(gt||(gt={}));const pM={start:[gt.Space,gt.Enter],cancel:[gt.Esc],end:[gt.Space,gt.Enter,gt.Tab]},W7=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case gt.Right:return{...n,x:n.x+25};case gt.Left:return{...n,x:n.x-25};case gt.Down:return{...n,y:n.y+25};case gt.Up:return{...n,y:n.y-25}}};class Ub{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 gu(Il(n)),this.windowListeners=new gu(ur(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Vr.Resize,this.handleCancel),this.windowListeners.add(Vr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Vr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&H7(r),n(hi)}handleKeyDown(t){if(Ib(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:a=pM,coordinateGetter:l=W7,scrollBehavior:u="smooth"}=s,{code:h}=t;if(a.end.includes(h)){this.handleEnd(t);return}if(a.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:d}=r.current,m=d?{x:d.left,y:d.top}:hi;this.referenceCoordinates||(this.referenceCoordinates=m);const p=l(t,{active:n,context:r.current,currentCoordinates:m});if(p){const _=Lf(p,m),b={x:0,y:0},{scrollableAncestors:S}=r.current;for(const w of S){const C=t.code,{isTop:k,isRight:T,isLeft:R,isBottom:M,maxScroll:L,minScroll:O}=hM(w),j=P7(w),F={x:Math.min(C===gt.Right?j.right-j.width/2:j.right,Math.max(C===gt.Right?j.left:j.left+j.width/2,p.x)),y:Math.min(C===gt.Down?j.bottom-j.height/2:j.bottom,Math.max(C===gt.Down?j.top:j.top+j.height/2,p.y))},G=C===gt.Right&&!T||C===gt.Left&&!R,P=C===gt.Down&&!M||C===gt.Up&&!k;if(G&&F.x!==p.x){const H=w.scrollLeft+_.x,B=C===gt.Right&&H<=L.x||C===gt.Left&&H>=O.x;if(B&&!_.y){w.scrollTo({left:H,behavior:u});return}B?b.x=w.scrollLeft-H:b.x=C===gt.Right?w.scrollLeft-L.x:w.scrollLeft-O.x,b.x&&w.scrollBy({left:-b.x,behavior:u});break}else if(P&&F.y!==p.y){const H=w.scrollTop+_.y,B=C===gt.Down&&H<=L.y||C===gt.Up&&H>=O.y;if(B&&!_.x){w.scrollTo({top:H,behavior:u});return}B?b.y=w.scrollTop-H:b.y=C===gt.Down?w.scrollTop-L.y:w.scrollTop-O.y,b.y&&w.scrollBy({top:-b.y,behavior:u});break}}this.handleMove(t,yl(Lf(p,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ub.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=pM,onActivation:s}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const u=a.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function QC(e){return!!(e&&"distance"in e)}function JC(e){return!!(e&&"delay"in e)}class $b{constructor(t,n,r){var s;r===void 0&&(r=U7(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:l}=a;this.props=t,this.events=n,this.document=Il(l),this.documentListeners=new gu(this.document),this.listeners=new gu(r),this.windowListeners=new gu(ur(l)),this.initialCoordinates=(s=R_(a))!=null?s:hi,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(Vr.Resize,this.handleCancel),this.windowListeners.add(Vr.DragStart,ZC),this.windowListeners.add(Vr.VisibilityChange,this.handleCancel),this.windowListeners.add(Vr.ContextMenu,ZC),this.documentListeners.add(Vr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(JC(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(QC(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(Vr.Click,$7,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Vr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:a}=this,{onMove:l,options:{activationConstraint:u}}=a;if(!s)return;const h=(n=R_(t))!=null?n:hi,d=Lf(s,h);if(!r&&u){if(QC(u)){if(u.tolerance!=null&&wv(d,u.tolerance))return this.handleCancel();if(wv(d,u.distance))return this.handleStart()}if(JC(u)&&wv(d,u.tolerance))return this.handleCancel();this.handlePending(u,d);return}t.cancelable&&t.preventDefault(),l(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===gt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const V7={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Wb extends $b{constructor(t){const{event:n}=t,r=Il(n.target);super(t,V7,r)}}Wb.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 q7={move:{name:"mousemove"},end:{name:"mouseup"}};var M_;(function(e){e[e.RightClick=2]="RightClick"})(M_||(M_={}));class K7 extends $b{constructor(t){super(t,q7,Il(t.event.target))}}K7.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===M_.RightClick?!1:(r==null||r({event:n}),!0)}}];const Cv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class G7 extends $b{constructor(t){super(t,Cv)}static setup(){return window.addEventListener(Cv.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Cv.move.name,t)};function t(){}}}G7.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 vu;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(vu||(vu={}));var zf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(zf||(zf={}));function Y7(e){let{acceleration:t,activator:n=vu.Pointer,canScroll:r,draggingRect:s,enabled:a,interval:l=5,order:u=zf.TreeOrder,pointerCoordinates:h,scrollableAncestors:d,scrollableAncestorRects:m,delta:p,threshold:_}=e;const b=Z7({delta:p,disabled:!a}),[S,w]=s7(),C=y.useRef({x:0,y:0}),k=y.useRef({x:0,y:0}),T=y.useMemo(()=>{switch(n){case vu.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case vu.DraggableRect:return s}},[n,s,h]),R=y.useRef(null),M=y.useCallback(()=>{const O=R.current;if(!O)return;const j=C.current.x*k.current.x,F=C.current.y*k.current.y;O.scrollBy(j,F)},[]),L=y.useMemo(()=>u===zf.TreeOrder?[...d].reverse():d,[u,d]);y.useEffect(()=>{if(!a||!d.length||!T){w();return}for(const O of L){if((r==null?void 0:r(O))===!1)continue;const j=d.indexOf(O),F=m[j];if(!F)continue;const{direction:G,speed:P}=z7(O,F,T,t,_);for(const H of["x","y"])b[H][G[H]]||(P[H]=0,G[H]=0);if(P.x>0||P.y>0){w(),R.current=O,S(M,l),C.current=P,k.current=G;return}}C.current={x:0,y:0},k.current={x:0,y:0},w()},[t,M,r,w,a,l,JSON.stringify(T),JSON.stringify(b),S,d,L,m,JSON.stringify(_)])}const X7={x:{[xn.Backward]:!1,[xn.Forward]:!1},y:{[xn.Backward]:!1,[xn.Forward]:!1}};function Z7(e){let{delta:t,disabled:n}=e;const r=E_(t);return Xu(s=>{if(n||!r||!s)return X7;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[xn.Backward]:s.x[xn.Backward]||a.x===-1,[xn.Forward]:s.x[xn.Forward]||a.x===1},y:{[xn.Backward]:s.y[xn.Backward]||a.y===-1,[xn.Forward]:s.y[xn.Forward]||a.y===1}}},[n,t,r])}function Q7(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Xu(s=>{var a;return t==null?null:(a=r??s)!=null?a:null},[r,t])}function J7(e,t){return y.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,a=s.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...a]},[]),[e,t])}var Du;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Du||(Du={}));var N_;(function(e){e.Optimized="optimized"})(N_||(N_={}));const e2=new Map;function e9(e,t){let{dragging:n,dependencies:r,config:s}=t;const[a,l]=y.useState(null),{frequency:u,measure:h,strategy:d}=s,m=y.useRef(e),p=C(),_=Nu(p),b=y.useCallback(function(k){k===void 0&&(k=[]),!_.current&&l(T=>T===null?k:T.concat(k.filter(R=>!T.includes(R))))},[_]),S=y.useRef(null),w=Xu(k=>{if(p&&!n)return e2;if(!k||k===e2||m.current!==e||a!=null){const T=new Map;for(let R of e){if(!R)continue;if(a&&a.length>0&&!a.includes(R.id)&&R.rect.current){T.set(R.id,R.rect.current);continue}const M=R.node.current,L=M?new Fb(h(M),M):null;R.rect.current=L,L&&T.set(R.id,L)}return T}return k},[e,a,n,p,h]);return y.useEffect(()=>{m.current=e},[e]),y.useEffect(()=>{p||b()},[n,p]),y.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),y.useEffect(()=>{p||typeof u!="number"||S.current!==null||(S.current=setTimeout(()=>{b(),S.current=null},u))},[u,p,b,...r]),{droppableRects:w,measureDroppableContainers:b,measuringScheduled:a!=null};function C(){switch(d){case Du.Always:return!1;case Du.BeforeDragging:return n;default:return!n}}}function mM(e,t){return Xu(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function t9(e,t){return mM(e,t)}function n9(e){let{callback:t,disabled:n}=e;const r=Bb(t),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function wp(e){let{callback:t,disabled:n}=e;const r=Bb(t),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function r9(e){return new Fb(Hl(e),e)}function t2(e,t,n){t===void 0&&(t=r9);const[r,s]=y.useState(null);function a(){s(h=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=h??n)!=null?d:null}const m=t(e);return JSON.stringify(h)===JSON.stringify(m)?h:m})}const l=n9({callback(h){if(e)for(const d of h){const{type:m,target:p}=d;if(m==="childList"&&p instanceof HTMLElement&&p.contains(e)){a();break}}}}),u=wp({callback:a});return Oi(()=>{a(),e?(u==null||u.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),l==null||l.disconnect())},[e]),r}function i9(e){const t=mM(e);return aM(e,t)}const n2=[];function s9(e){const t=y.useRef(e),n=Xu(r=>e?r&&r!==n2&&e&&t.current&&e.parentNode===t.current.parentNode?r:Hb(e):n2,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function o9(e){const[t,n]=y.useState(null),r=y.useRef(e),s=y.useCallback(a=>{const l=Sv(a.target);l&&n(u=>u?(u.set(l,T_(l)),new Map(u)):null)},[]);return y.useEffect(()=>{const a=r.current;if(e!==a){l(a);const u=e.map(h=>{const d=Sv(h);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,T_(d)]):null}).filter(h=>h!=null);n(u.length?new Map(u):null),r.current=e}return()=>{l(e),l(a)};function l(u){u.forEach(h=>{const d=Sv(h);d==null||d.removeEventListener("scroll",s)})}},[s,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>yl(a,l),hi):fM(e):hi,[e,t])}function r2(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const r=e!==hi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Lf(e,n.current):hi}function a9(e){y.useEffect(()=>{if(!Sp)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 l9(e,t){return y.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:a}=r;return n[s]=l=>{a(l,t)},n},{}),[e,t])}function gM(e){return y.useMemo(()=>e?D7(e):null,[e])}const i2=[];function c9(e,t){t===void 0&&(t=Hl);const[n]=e,r=gM(n?ur(n):null),[s,a]=y.useState(i2);function l(){a(()=>e.length?e.map(h=>dM(h)?r:new Fb(t(h),h)):i2)}const u=wp({callback:l});return Oi(()=>{u==null||u.disconnect(),l(),e.forEach(h=>u==null?void 0:u.observe(h))},[e]),s}function u9(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Yu(t)?t:e}function d9(e){let{measure:t}=e;const[n,r]=y.useState(null),s=y.useCallback(d=>{for(const{target:m}of d)if(Yu(m)){r(p=>{const _=t(m);return p?{...p,width:_.width,height:_.height}:_});break}},[t]),a=wp({callback:s}),l=y.useCallback(d=>{const m=u9(d);a==null||a.disconnect(),m&&(a==null||a.observe(m)),r(m?t(m):null)},[t,a]),[u,h]=Of(l);return y.useMemo(()=>({nodeRef:u,rect:n,setRef:h}),[n,u,h])}const h9=[{sensor:Wb,options:{}},{sensor:Ub,options:{}}],f9={current:{}},sf={draggable:{measure:XC},droppable:{measure:XC,strategy:Du.WhileDragging,frequency:N_.Optimized},dragOverlay:{measure:Hl}};class _u 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 p9={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new _u,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:jf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:sf,measureDroppableContainers:jf,windowRect:null,measuringScheduled:!1},m9={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:jf,draggableNodes:new Map,over:null,measureDroppableContainers:jf},Cp=y.createContext(m9),vM=y.createContext(p9);function g9(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new _u}}}function v9(e,t){switch(t.type){case gn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case gn.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 gn.DragEnd:case gn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case gn.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new _u(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case gn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new _u(e.droppable.containers);return l.set(n,{...a,disabled:s}),{...e,droppable:{...e.droppable,containers:l}}}case gn.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new _u(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function _9(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=y.useContext(Cp),a=E_(r),l=E_(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!r&&a&&l!=null){if(!Ib(a)||document.activeElement===a.target)return;const u=s.get(l);if(!u)return;const{activatorNode:h,node:d}=u;if(!h.current&&!d.current)return;requestAnimationFrame(()=>{for(const m of[h.current,d.current]){if(!m)continue;const p=l7(m);if(p){p.focus();break}}})}},[r,t,s,l,a]),null}function y9(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,a)=>a({transform:s,...r}),n):n}function b9(e){return y.useMemo(()=>({draggable:{...sf.draggable,...e==null?void 0:e.draggable},droppable:{...sf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...sf.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 x9(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const a=y.useRef(!1),{x:l,y:u}=typeof s=="boolean"?{x:s,y:s}:s;Oi(()=>{if(!l&&!u||!t){a.current=!1;return}if(a.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const m=n(d),p=aM(m,r);if(l||(p.x=0),u||(p.y=0),a.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const _=lM(d);_&&_.scrollBy({top:p.y,left:p.x})}},[t,l,u,r,n])}const _M=y.createContext({...hi,scaleX:1,scaleY:1});var eo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(eo||(eo={}));const S9=y.memo(function(t){var n,r,s,a;let{id:l,accessibility:u,autoScroll:h=!0,children:d,sensors:m=h9,collisionDetection:p=k7,measuring:_,modifiers:b,...S}=t;const w=y.useReducer(v9,void 0,g9),[C,k]=w,[T,R]=p7(),[M,L]=y.useState(eo.Uninitialized),O=M===eo.Initialized,{draggable:{active:j,nodes:F,translate:G},droppable:{containers:P}}=C,H=j!=null?F.get(j):null,B=y.useRef({initial:null,translated:null}),U=y.useMemo(()=>{var xt;return j!=null?{id:j,data:(xt=H==null?void 0:H.data)!=null?xt:f9,rect:B}:null},[j,H]),$=y.useRef(null),[W,z]=y.useState(null),[q,V]=y.useState(null),X=Nu(S,Object.values(S)),N=Zu("DndDescribedBy",l),I=y.useMemo(()=>P.getEnabled(),[P]),Z=b9(_),{droppableRects:D,measureDroppableContainers:ce,measuringScheduled:pe}=e9(I,{dragging:O,dependencies:[G.x,G.y],config:Z.droppable}),ae=Q7(F,j),Q=y.useMemo(()=>q?R_(q):null,[q]),ve=Jn(),ne=t9(ae,Z.draggable.measure);x9({activeNode:j!=null?F.get(j):null,config:ve.layoutShiftCompensation,initialRect:ne,measure:Z.draggable.measure});const de=t2(ae,Z.draggable.measure,ne),we=t2(ae?ae.parentElement:null),Ce=y.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:D,draggableNodes:F,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Re=P.getNodeFor((n=Ce.current.over)==null?void 0:n.id),ze=d9({measure:Z.dragOverlay.measure}),yt=(r=ze.nodeRef.current)!=null?r:ae,dt=O?(s=ze.rect)!=null?s:de:null,Ct=!!(ze.nodeRef.current&&ze.rect),tn=i9(Ct?null:de),_t=gM(yt?ur(yt):null),jt=s9(O?Re??ae:null),be=c9(jt),Be=y9(b,{transform:{x:G.x-tn.x,y:G.y-tn.y,scaleX:1,scaleY:1},activatorEvent:q,active:U,activeNodeRect:de,containerNodeRect:we,draggingNodeRect:dt,over:Ce.current.over,overlayNodeRect:ze.rect,scrollableAncestors:jt,scrollableAncestorRects:be,windowRect:_t}),$t=Q?yl(Q,G):null,ie=o9(jt),ct=r2(ie),ue=r2(ie,[de]),ye=yl(Be,ct),Le=dt?T7(dt,Be):null,He=U&&Le?p({active:U,collisionRect:Le,droppableRects:D,droppableContainers:I,pointerCoordinates:$t}):null,Ye=S7(He,"id"),[bt,Pn]=y.useState(null),oe=Ct?Be:yl(Be,ue),Me=E7(oe,(a=bt==null?void 0:bt.rect)!=null?a:null,de),Xe=y.useRef(null),$e=y.useCallback((xt,It)=>{let{sensor:se,options:xe}=It;if($.current==null)return;const Ve=F.get($.current);if(!Ve)return;const et=xt.nativeEvent,ht=new se({active:$.current,activeNode:Ve,event:et,options:xe,context:Ce,onAbort(un){if(!F.get(un))return;const{onDragAbort:pr}=X.current,Nr={id:un};pr==null||pr(Nr),T({type:"onDragAbort",event:Nr})},onPending(un,Qr,pr,Nr){if(!F.get(un))return;const{onDragPending:Bi}=X.current,Jr={id:un,constraint:Qr,initialCoordinates:pr,offset:Nr};Bi==null||Bi(Jr),T({type:"onDragPending",event:Jr})},onStart(un){const Qr=$.current;if(Qr==null)return;const pr=F.get(Qr);if(!pr)return;const{onDragStart:Nr}=X.current,Pi={activatorEvent:et,active:{id:Qr,data:pr.data,rect:B}};ki.unstable_batchedUpdates(()=>{Nr==null||Nr(Pi),L(eo.Initializing),k({type:gn.DragStart,initialCoordinates:un,active:Qr}),T({type:"onDragStart",event:Pi}),z(Xe.current),V(et)})},onMove(un){k({type:gn.DragMove,coordinates:un})},onEnd:fr(gn.DragEnd),onCancel:fr(gn.DragCancel)});Xe.current=ht;function fr(un){return async function(){const{active:pr,collisions:Nr,over:Pi,scrollAdjustedTranslate:Bi}=Ce.current;let Jr=null;if(pr&&Bi){const{cancelDrop:Ss}=X.current;Jr={activatorEvent:et,active:pr,collisions:Nr,delta:Bi,over:Pi},un===gn.DragEnd&&typeof Ss=="function"&&await Promise.resolve(Ss(Jr))&&(un=gn.DragCancel)}$.current=null,ki.unstable_batchedUpdates(()=>{k({type:un}),L(eo.Uninitialized),Pn(null),z(null),V(null),Xe.current=null;const Ss=un===gn.DragEnd?"onDragEnd":"onDragCancel";if(Jr){const Ar=X.current[Ss];Ar==null||Ar(Jr),T({type:Ss,event:Jr})}})}}},[F]),Dt=y.useCallback((xt,It)=>(se,xe)=>{const Ve=se.nativeEvent,et=F.get(xe);if($.current!==null||!et||Ve.dndKit||Ve.defaultPrevented)return;const ht={active:et};xt(se,It.options,ht)===!0&&(Ve.dndKit={capturedBy:It.sensor},$.current=xe,$e(se,It))},[F,$e]),Wt=J7(m,Dt);a9(m),Oi(()=>{de&&M===eo.Initializing&&L(eo.Initialized)},[de,M]),y.useEffect(()=>{const{onDragMove:xt}=X.current,{active:It,activatorEvent:se,collisions:xe,over:Ve}=Ce.current;if(!It||!se)return;const et={active:It,activatorEvent:se,collisions:xe,delta:{x:ye.x,y:ye.y},over:Ve};ki.unstable_batchedUpdates(()=>{xt==null||xt(et),T({type:"onDragMove",event:et})})},[ye.x,ye.y]),y.useEffect(()=>{const{active:xt,activatorEvent:It,collisions:se,droppableContainers:xe,scrollAdjustedTranslate:Ve}=Ce.current;if(!xt||$.current==null||!It||!Ve)return;const{onDragOver:et}=X.current,ht=xe.get(Ye),fr=ht&&ht.rect.current?{id:ht.id,rect:ht.rect.current,data:ht.data,disabled:ht.disabled}:null,un={active:xt,activatorEvent:It,collisions:se,delta:{x:Ve.x,y:Ve.y},over:fr};ki.unstable_batchedUpdates(()=>{Pn(fr),et==null||et(un),T({type:"onDragOver",event:un})})},[Ye]),Oi(()=>{Ce.current={activatorEvent:q,active:U,activeNode:ae,collisionRect:Le,collisions:He,droppableRects:D,draggableNodes:F,draggingNode:yt,draggingNodeRect:dt,droppableContainers:P,over:bt,scrollableAncestors:jt,scrollAdjustedTranslate:ye},B.current={initial:dt,translated:Le}},[U,ae,He,Le,F,yt,dt,D,P,bt,jt,ye]),Y7({...ve,delta:G,draggingRect:Le,pointerCoordinates:$t,scrollableAncestors:jt,scrollableAncestorRects:be});const Mr=y.useMemo(()=>({active:U,activeNode:ae,activeNodeRect:de,activatorEvent:q,collisions:He,containerNodeRect:we,dragOverlay:ze,draggableNodes:F,droppableContainers:P,droppableRects:D,over:bt,measureDroppableContainers:ce,scrollableAncestors:jt,scrollableAncestorRects:be,measuringConfiguration:Z,measuringScheduled:pe,windowRect:_t}),[U,ae,de,q,He,we,ze,F,P,D,bt,ce,jt,be,Z,pe,_t]),hr=y.useMemo(()=>({activatorEvent:q,activators:Wt,active:U,activeNodeRect:de,ariaDescribedById:{draggable:N},dispatch:k,draggableNodes:F,over:bt,measureDroppableContainers:ce}),[q,Wt,U,de,k,N,F,bt,ce]);return Lt.createElement(oM.Provider,{value:R},Lt.createElement(Cp.Provider,{value:hr},Lt.createElement(vM.Provider,{value:Mr},Lt.createElement(_M.Provider,{value:Me},d)),Lt.createElement(_9,{disabled:(u==null?void 0:u.restoreFocus)===!1})),Lt.createElement(v7,{...u,hiddenTextDescribedById:N}));function Jn(){const xt=(W==null?void 0:W.autoScrollEnabled)===!1,It=typeof h=="object"?h.enabled===!1:h===!1,se=O&&!xt&&!It;return typeof h=="object"?{...h,enabled:se}:{enabled:se}}}),w9=y.createContext(null),s2="button",C9="Draggable";function k9(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const a=Zu(C9),{activators:l,activatorEvent:u,active:h,activeNodeRect:d,ariaDescribedById:m,draggableNodes:p,over:_}=y.useContext(Cp),{role:b=s2,roleDescription:S="draggable",tabIndex:w=0}=s??{},C=(h==null?void 0:h.id)===t,k=y.useContext(C?_M:w9),[T,R]=Of(),[M,L]=Of(),O=l9(l,t),j=Nu(n);Oi(()=>(p.set(t,{id:t,key:a,node:T,activatorNode:M,data:j}),()=>{const G=p.get(t);G&&G.key===a&&p.delete(t)}),[p,t]);const F=y.useMemo(()=>({role:b,tabIndex:w,"aria-disabled":r,"aria-pressed":C&&b===s2?!0:void 0,"aria-roledescription":S,"aria-describedby":m.draggable}),[r,b,w,C,S,m.draggable]);return{active:h,activatorEvent:u,activeNodeRect:d,attributes:F,isDragging:C,listeners:r?void 0:O,node:T,over:_,setNodeRef:R,setActivatorNodeRef:L,transform:k}}function E9(){return y.useContext(vM)}const R9="Droppable",T9={timeout:25};function M9(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const a=Zu(R9),{active:l,dispatch:u,over:h,measureDroppableContainers:d}=y.useContext(Cp),m=y.useRef({disabled:n}),p=y.useRef(!1),_=y.useRef(null),b=y.useRef(null),{disabled:S,updateMeasurementsFor:w,timeout:C}={...T9,...s},k=Nu(w??r),T=y.useCallback(()=>{if(!p.current){p.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),b.current=null},C)},[C]),R=wp({callback:T,disabled:S||!l}),M=y.useCallback((F,G)=>{R&&(G&&(R.unobserve(G),p.current=!1),F&&R.observe(F))},[R]),[L,O]=Of(M),j=Nu(t);return y.useEffect(()=>{!R||!L.current||(R.disconnect(),p.current=!1,R.observe(L.current))},[L,R]),y.useEffect(()=>(u({type:gn.RegisterDroppable,element:{id:r,key:a,disabled:n,node:L,rect:_,data:j}}),()=>u({type:gn.UnregisterDroppable,key:a,id:r})),[r]),y.useEffect(()=>{n!==m.current.disabled&&(u({type:gn.SetDroppableDisabled,id:r,key:a,disabled:n}),m.current.disabled=n)},[r,a,n,u]),{active:l,rect:_,isOver:(h==null?void 0:h.id)===r,node:L,over:h,setNodeRef:O}}function Vb(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function N9(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function Oh(e){return e!==null&&e>=0}function A9(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 D9(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const yM=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=Vb(t,r,n),l=t[s],u=a[s];return!u||!l?null:{x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height}},Lh={scaleX:1,scaleY:1},O9=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:l}=e;const u=(t=a[n])!=null?t:r;if(!u)return null;if(s===n){const d=a[l];return d?{x:0,y:n<l?d.top+d.height-(u.top+u.height):d.top-u.top,...Lh}:null}const h=L9(a,s,n);return s>n&&s<=l?{x:0,y:-u.height-h,...Lh}:s<n&&s>=l?{x:0,y:u.height+h,...Lh}:{x:0,y:0,...Lh}};function L9(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const bM="Sortable",xM=Lt.createContext({activeIndex:-1,containerId:bM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:yM,disabled:{draggable:!1,droppable:!1}});function j9(e){let{children:t,id:n,items:r,strategy:s=yM,disabled:a=!1}=e;const{active:l,dragOverlay:u,droppableRects:h,over:d,measureDroppableContainers:m}=E9(),p=Zu(bM,n),_=u.rect!==null,b=y.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),S=l!=null,w=l?b.indexOf(l.id):-1,C=d?b.indexOf(d.id):-1,k=y.useRef(b),T=!A9(b,k.current),R=C!==-1&&w===-1||T,M=D9(a);Oi(()=>{T&&S&&m(b)},[T,b,S,m]),y.useEffect(()=>{k.current=b},[b]);const L=y.useMemo(()=>({activeIndex:w,containerId:p,disabled:M,disableTransforms:R,items:b,overIndex:C,useDragOverlay:_,sortedRects:N9(b,h),strategy:s}),[w,p,M.draggable,M.droppable,R,b,C,h,_,s]);return Lt.createElement(xM.Provider,{value:L},t)}const z9=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Vb(n,r,s).indexOf(t)},P9=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:l,previousItems:u,previousContainerId:h,transition:d}=e;return!d||!r||u!==a&&s===l?!1:n?!0:l!==s&&t===h},B9={duration:200,easing:"ease"},SM="transform",I9=Au.Transition.toString({property:SM,duration:0,easing:"linear"}),H9={roleDescription:"sortable"};function F9(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,l]=y.useState(null),u=y.useRef(n);return Oi(()=>{if(!t&&n!==u.current&&r.current){const h=s.current;if(h){const d=Hl(r.current,{ignoreTransform:!0}),m={x:h.left-d.left,y:h.top-d.top,scaleX:h.width/d.width,scaleY:h.height/d.height};(m.x||m.y)&&l(m)}}n!==u.current&&(u.current=n)},[t,n,r,s]),y.useEffect(()=>{a&&l(null)},[a]),a}function U9(e){let{animateLayoutChanges:t=P9,attributes:n,disabled:r,data:s,getNewIndex:a=z9,id:l,strategy:u,resizeObserverConfig:h,transition:d=B9}=e;const{items:m,containerId:p,activeIndex:_,disabled:b,disableTransforms:S,sortedRects:w,overIndex:C,useDragOverlay:k,strategy:T}=y.useContext(xM),R=$9(r,b),M=m.indexOf(l),L=y.useMemo(()=>({sortable:{containerId:p,index:M,items:m},...s}),[p,s,M,m]),O=y.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:j,node:F,isOver:G,setNodeRef:P}=M9({id:l,data:L,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...h}}),{active:H,activatorEvent:B,activeNodeRect:U,attributes:$,setNodeRef:W,listeners:z,isDragging:q,over:V,setActivatorNodeRef:X,transform:N}=k9({id:l,data:L,attributes:{...H9,...n},disabled:R.draggable}),I=i7(P,W),Z=!!H,D=Z&&!S&&Oh(_)&&Oh(C),ce=!k&&q,pe=ce&&D?N:null,Q=D?pe??(u??T)({rects:w,activeNodeRect:U,activeIndex:_,overIndex:C,index:M}):null,ve=Oh(_)&&Oh(C)?a({id:l,items:m,activeIndex:_,overIndex:C}):M,ne=H==null?void 0:H.id,de=y.useRef({activeId:ne,items:m,newIndex:ve,containerId:p}),we=m!==de.current.items,Ce=t({active:H,containerId:p,isDragging:q,isSorting:Z,id:l,index:M,items:m,newIndex:de.current.newIndex,previousItems:de.current.items,previousContainerId:de.current.containerId,transition:d,wasDragging:de.current.activeId!=null}),Re=F9({disabled:!Ce,index:M,node:F,rect:j});return y.useEffect(()=>{Z&&de.current.newIndex!==ve&&(de.current.newIndex=ve),p!==de.current.containerId&&(de.current.containerId=p),m!==de.current.items&&(de.current.items=m)},[Z,ve,p,m]),y.useEffect(()=>{if(ne===de.current.activeId)return;if(ne!=null&&de.current.activeId==null){de.current.activeId=ne;return}const yt=setTimeout(()=>{de.current.activeId=ne},50);return()=>clearTimeout(yt)},[ne]),{active:H,activeIndex:_,attributes:$,data:L,rect:j,index:M,newIndex:ve,items:m,isOver:G,isSorting:Z,isDragging:q,listeners:z,node:F,overIndex:C,over:V,setNodeRef:I,setActivatorNodeRef:X,setDroppableNodeRef:P,setDraggableNodeRef:W,transform:Re??Q,transition:ze()};function ze(){if(Re||we&&de.current.newIndex===M)return I9;if(!(ce&&!Ib(B)||!d)&&(Z||Ce))return Au.Transition.toString({...d,property:SM})}}function $9(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}}gt.Down,gt.Right,gt.Up,gt.Left;function qb(e){const t=e+"CollectionProvider",[n,r]=vs(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:C,children:k}=w,T=Lt.useRef(null),R=Lt.useRef(new Map).current;return g.jsx(s,{scope:C,itemMap:R,collectionRef:T,children:k})};l.displayName=t;const u=e+"CollectionSlot",h=Zo(u),d=Lt.forwardRef((w,C)=>{const{scope:k,children:T}=w,R=a(u,k),M=vt(C,R.collectionRef);return g.jsx(h,{ref:M,children:T})});d.displayName=u;const m=e+"CollectionItemSlot",p="data-radix-collection-item",_=Zo(m),b=Lt.forwardRef((w,C)=>{const{scope:k,children:T,...R}=w,M=Lt.useRef(null),L=vt(C,M),O=a(m,k);return Lt.useEffect(()=>(O.itemMap.set(M,{ref:M,...R}),()=>void O.itemMap.delete(M))),g.jsx(_,{[p]:"",ref:L,children:T})});b.displayName=m;function S(w){const C=a(e+"CollectionConsumer",w);return Lt.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const R=Array.from(T.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((O,j)=>R.indexOf(O.ref.current)-R.indexOf(j.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:d,ItemSlot:b},S,r]}var W9=y.createContext(void 0);function Kb(e){const t=y.useContext(W9);return e||t||"ltr"}var kv="rovingFocusGroup.onEntryFocus",V9={bubbles:!1,cancelable:!0},Qu="RovingFocusGroup",[A_,wM,q9]=qb(Qu),[K9,CM]=vs(Qu,[q9]),[G9,Y9]=K9(Qu),kM=y.forwardRef((e,t)=>g.jsx(A_.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(A_.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(X9,{...e,ref:t})})}));kM.displayName=Qu;var X9=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...p}=e,_=y.useRef(null),b=vt(t,_),S=Kb(a),[w,C]=wl({prop:l,defaultProp:u??null,onChange:h,caller:Qu}),[k,T]=y.useState(!1),R=ci(d),M=wM(n),L=y.useRef(!1),[O,j]=y.useState(0);return y.useEffect(()=>{const F=_.current;if(F)return F.addEventListener(kv,R),()=>F.removeEventListener(kv,R)},[R]),g.jsx(G9,{scope:n,orientation:r,dir:S,loop:s,currentTabStopId:w,onItemFocus:y.useCallback(F=>C(F),[C]),onItemShiftTab:y.useCallback(()=>T(!0),[]),onFocusableItemAdd:y.useCallback(()=>j(F=>F+1),[]),onFocusableItemRemove:y.useCallback(()=>j(F=>F-1),[]),children:g.jsx(st.div,{tabIndex:k||O===0?-1:0,"data-orientation":r,...p,ref:b,style:{outline:"none",...e.style},onMouseDown:Ne(e.onMouseDown,()=>{L.current=!0}),onFocus:Ne(e.onFocus,F=>{const G=!L.current;if(F.target===F.currentTarget&&G&&!k){const P=new CustomEvent(kv,V9);if(F.currentTarget.dispatchEvent(P),!P.defaultPrevented){const H=M().filter(z=>z.focusable),B=H.find(z=>z.active),U=H.find(z=>z.id===w),W=[B,U,...H].filter(Boolean).map(z=>z.ref.current);TM(W,m)}}L.current=!1}),onBlur:Ne(e.onBlur,()=>T(!1))})})}),EM="RovingFocusGroupItem",RM=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...u}=e,h=ds(),d=a||h,m=Y9(EM,n),p=m.currentTabStopId===d,_=wM(n),{onFocusableItemAdd:b,onFocusableItemRemove:S,currentTabStopId:w}=m;return y.useEffect(()=>{if(r)return b(),()=>S()},[r,b,S]),g.jsx(A_.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:g.jsx(st.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...u,ref:t,onMouseDown:Ne(e.onMouseDown,C=>{r?m.onItemFocus(d):C.preventDefault()}),onFocus:Ne(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:Ne(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){m.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=J9(C,m.orientation,m.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=m.loop?eH(R,M+1):R.slice(M+1)}setTimeout(()=>TM(R))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:w!=null}):l})})});RM.displayName=EM;var Z9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Q9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function J9(e,t,n){const r=Q9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Z9[r]}function TM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function eH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tH=kM,nH=RM,D_=["Enter"," "],rH=["ArrowDown","PageUp","Home"],MM=["ArrowUp","PageDown","End"],iH=[...rH,...MM],sH={ltr:[...D_,"ArrowRight"],rtl:[...D_,"ArrowLeft"]},oH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ju="Menu",[Ou,aH,lH]=qb(Ju),[ua,NM]=vs(Ju,[lH,po,CM]),kp=po(),AM=CM(),[cH,da]=ua(Ju),[uH,ed]=ua(Ju),DM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:l=!0}=e,u=kp(t),[h,d]=y.useState(null),m=y.useRef(!1),p=ci(a),_=Kb(s);return y.useEffect(()=>{const b=()=>{m.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>m.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),g.jsx(mp,{...u,children:g.jsx(cH,{scope:t,open:n,onOpenChange:p,content:h,onContentChange:d,children:g.jsx(uH,{scope:t,onClose:y.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:_,modal:l,children:r})})})};DM.displayName=Ju;var dH="MenuAnchor",Gb=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=kp(n);return g.jsx(Ku,{...s,...r,ref:t})});Gb.displayName=dH;var Yb="MenuPortal",[hH,OM]=ua(Yb,{forceMount:void 0}),LM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,a=da(Yb,t);return g.jsx(hH,{scope:t,forceMount:n,children:g.jsx(Zr,{present:n||a.open,children:g.jsx(jl,{asChild:!0,container:s,children:r})})})};LM.displayName=Yb;var Gr="MenuContent",[fH,Xb]=ua(Gr),jM=y.forwardRef((e,t)=>{const n=OM(Gr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=da(Gr,e.__scopeMenu),l=ed(Gr,e.__scopeMenu);return g.jsx(Ou.Provider,{scope:e.__scopeMenu,children:g.jsx(Zr,{present:r||a.open,children:g.jsx(Ou.Slot,{scope:e.__scopeMenu,children:l.modal?g.jsx(pH,{...s,ref:t}):g.jsx(mH,{...s,ref:t})})})})}),pH=y.forwardRef((e,t)=>{const n=da(Gr,e.__scopeMenu),r=y.useRef(null),s=vt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return ap(a)},[]),g.jsx(Zb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ne(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mH=y.forwardRef((e,t)=>{const n=da(Gr,e.__scopeMenu);return g.jsx(Zb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),gH=Zo("MenuContent.ScrollLock"),Zb=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:h,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:_,onDismiss:b,disableOutsideScroll:S,...w}=e,C=da(Gr,n),k=ed(Gr,n),T=kp(n),R=AM(n),M=aH(n),[L,O]=y.useState(null),j=y.useRef(null),F=vt(t,j,C.onContentChange),G=y.useRef(0),P=y.useRef(""),H=y.useRef(0),B=y.useRef(null),U=y.useRef("right"),$=y.useRef(0),W=S?Vu:y.Fragment,z=S?{as:gH,allowPinchZoom:!0}:void 0,q=X=>{var Q,ve;const N=P.current+X,I=M().filter(ne=>!ne.disabled),Z=document.activeElement,D=(Q=I.find(ne=>ne.ref.current===Z))==null?void 0:Q.textValue,ce=I.map(ne=>ne.textValue),pe=TH(ce,N,D),ae=(ve=I.find(ne=>ne.textValue===pe))==null?void 0:ve.ref.current;(function ne(de){P.current=de,window.clearTimeout(G.current),de!==""&&(G.current=window.setTimeout(()=>ne(""),1e3))})(N),ae&&setTimeout(()=>ae.focus())};y.useEffect(()=>()=>window.clearTimeout(G.current),[]),sp();const V=y.useCallback(X=>{var I,Z;return U.current===((I=B.current)==null?void 0:I.side)&&NH(X,(Z=B.current)==null?void 0:Z.area)},[]);return g.jsx(fH,{scope:n,searchRef:P,onItemEnter:y.useCallback(X=>{V(X)&&X.preventDefault()},[V]),onItemLeave:y.useCallback(X=>{var N;V(X)||((N=j.current)==null||N.focus(),O(null))},[V]),onTriggerLeave:y.useCallback(X=>{V(X)&&X.preventDefault()},[V]),pointerGraceTimerRef:H,onPointerGraceIntentChange:y.useCallback(X=>{B.current=X},[]),children:g.jsx(W,{...z,children:g.jsx(Wu,{asChild:!0,trapped:s,onMountAutoFocus:Ne(a,X=>{var N;X.preventDefault(),(N=j.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:g.jsx(Ll,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:_,onDismiss:b,children:g.jsx(tH,{asChild:!0,...R,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:L,onCurrentTabStopIdChange:O,onEntryFocus:Ne(h,X=>{k.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(gp,{role:"menu","aria-orientation":"vertical","data-state":ZM(C.open),"data-radix-menu-content":"",dir:k.dir,...T,...w,ref:F,style:{outline:"none",...w.style},onKeyDown:Ne(w.onKeyDown,X=>{const I=X.target.closest("[data-radix-menu-content]")===X.currentTarget,Z=X.ctrlKey||X.altKey||X.metaKey,D=X.key.length===1;I&&(X.key==="Tab"&&X.preventDefault(),!Z&&D&&q(X.key));const ce=j.current;if(X.target!==ce||!iH.includes(X.key))return;X.preventDefault();const ae=M().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);MM.includes(X.key)&&ae.reverse(),EH(ae)}),onBlur:Ne(e.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(G.current),P.current="")}),onPointerMove:Ne(e.onPointerMove,Lu(X=>{const N=X.target,I=$.current!==X.clientX;if(X.currentTarget.contains(N)&&I){const Z=X.clientX>$.current?"right":"left";U.current=Z,$.current=X.clientX}}))})})})})})})});jM.displayName=Gr;var vH="MenuGroup",Qb=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(st.div,{role:"group",...r,ref:t})});Qb.displayName=vH;var _H="MenuLabel",zM=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(st.div,{...r,ref:t})});zM.displayName=_H;var Pf="MenuItem",o2="menu.itemSelect",Ep=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=y.useRef(null),l=ed(Pf,e.__scopeMenu),u=Xb(Pf,e.__scopeMenu),h=vt(t,a),d=y.useRef(!1),m=()=>{const p=a.current;if(!n&&p){const _=new CustomEvent(o2,{bubbles:!0,cancelable:!0});p.addEventListener(o2,b=>r==null?void 0:r(b),{once:!0}),LR(p,_),_.defaultPrevented?d.current=!1:l.onClose()}};return g.jsx(PM,{...s,ref:h,disabled:n,onClick:Ne(e.onClick,m),onPointerDown:p=>{var _;(_=e.onPointerDown)==null||_.call(e,p),d.current=!0},onPointerUp:Ne(e.onPointerUp,p=>{var _;d.current||(_=p.currentTarget)==null||_.click()}),onKeyDown:Ne(e.onKeyDown,p=>{const _=u.searchRef.current!=="";n||_&&p.key===" "||D_.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Ep.displayName=Pf;var PM=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,l=Xb(Pf,n),u=AM(n),h=y.useRef(null),d=vt(t,h),[m,p]=y.useState(!1),[_,b]=y.useState("");return y.useEffect(()=>{const S=h.current;S&&b((S.textContent??"").trim())},[a.children]),g.jsx(Ou.ItemSlot,{scope:n,disabled:r,textValue:s??_,children:g.jsx(nH,{asChild:!0,...u,focusable:!r,children:g.jsx(st.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:Ne(e.onPointerMove,Lu(S=>{r?l.onItemLeave(S):(l.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ne(e.onPointerLeave,Lu(S=>l.onItemLeave(S))),onFocus:Ne(e.onFocus,()=>p(!0)),onBlur:Ne(e.onBlur,()=>p(!1))})})})}),yH="MenuCheckboxItem",BM=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return g.jsx($M,{scope:e.__scopeMenu,checked:n,children:g.jsx(Ep,{role:"menuitemcheckbox","aria-checked":Bf(n)?"mixed":n,...s,ref:t,"data-state":e0(n),onSelect:Ne(s.onSelect,()=>r==null?void 0:r(Bf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});BM.displayName=yH;var IM="MenuRadioGroup",[bH,xH]=ua(IM,{value:void 0,onValueChange:()=>{}}),HM=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=ci(r);return g.jsx(bH,{scope:e.__scopeMenu,value:n,onValueChange:a,children:g.jsx(Qb,{...s,ref:t})})});HM.displayName=IM;var FM="MenuRadioItem",UM=y.forwardRef((e,t)=>{const{value:n,...r}=e,s=xH(FM,e.__scopeMenu),a=n===s.value;return g.jsx($M,{scope:e.__scopeMenu,checked:a,children:g.jsx(Ep,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":e0(a),onSelect:Ne(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});UM.displayName=FM;var Jb="MenuItemIndicator",[$M,SH]=ua(Jb,{checked:!1}),WM=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=SH(Jb,n);return g.jsx(Zr,{present:r||Bf(a.checked)||a.checked===!0,children:g.jsx(st.span,{...s,ref:t,"data-state":e0(a.checked)})})});WM.displayName=Jb;var wH="MenuSeparator",VM=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(st.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});VM.displayName=wH;var CH="MenuArrow",qM=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=kp(n);return g.jsx(vp,{...s,...r,ref:t})});qM.displayName=CH;var kH="MenuSub",[rne,KM]=ua(kH),iu="MenuSubTrigger",GM=y.forwardRef((e,t)=>{const n=da(iu,e.__scopeMenu),r=ed(iu,e.__scopeMenu),s=KM(iu,e.__scopeMenu),a=Xb(iu,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=a,d={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),h(null)}},[u,h]),g.jsx(Gb,{asChild:!0,...d,children:g.jsx(PM,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":ZM(n.open),...e,ref:lb(t,s.onTriggerChange),onClick:p=>{var _;(_=e.onClick)==null||_.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ne(e.onPointerMove,Lu(p=>{a.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Ne(e.onPointerLeave,Lu(p=>{var b,S;m();const _=(b=n.content)==null?void 0:b.getBoundingClientRect();if(_){const w=(S=n.content)==null?void 0:S.dataset.side,C=w==="right",k=C?-5:5,T=_[C?"left":"right"],R=_[C?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+k,y:p.clientY},{x:T,y:_.top},{x:R,y:_.top},{x:R,y:_.bottom},{x:T,y:_.bottom}],side:w}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ne(e.onKeyDown,p=>{var b;const _=a.searchRef.current!=="";e.disabled||_&&p.key===" "||sH[r.dir].includes(p.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),p.preventDefault())})})})});GM.displayName=iu;var YM="MenuSubContent",XM=y.forwardRef((e,t)=>{const n=OM(Gr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=da(Gr,e.__scopeMenu),l=ed(Gr,e.__scopeMenu),u=KM(YM,e.__scopeMenu),h=y.useRef(null),d=vt(t,h);return g.jsx(Ou.Provider,{scope:e.__scopeMenu,children:g.jsx(Zr,{present:r||a.open,children:g.jsx(Ou.Slot,{scope:e.__scopeMenu,children:g.jsx(Zb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:d,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;l.isUsingKeyboardRef.current&&((p=h.current)==null||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ne(e.onFocusOutside,m=>{m.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ne(e.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:Ne(e.onKeyDown,m=>{var b;const p=m.currentTarget.contains(m.target),_=oH[l.dir].includes(m.key);p&&_&&(a.onOpenChange(!1),(b=u.trigger)==null||b.focus(),m.preventDefault())})})})})})});XM.displayName=YM;function ZM(e){return e?"open":"closed"}function Bf(e){return e==="indeterminate"}function e0(e){return Bf(e)?"indeterminate":e?"checked":"unchecked"}function EH(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function RH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function TH(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=RH(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function MH(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],h=t[l],d=u.x,m=u.y,p=h.x,_=h.y;m>r!=_>r&&n<(p-d)*(r-m)/(_-m)+d&&(s=!s)}return s}function NH(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return MH(n,t)}function Lu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var AH=DM,DH=Gb,OH=LM,LH=jM,jH=Qb,zH=zM,PH=Ep,BH=BM,IH=HM,HH=UM,FH=WM,UH=VM,$H=qM,WH=GM,VH=XM,t0="ContextMenu",[qH]=vs(t0,[NM]),Xn=NM(),[KH,QM]=qH(t0),JM=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:a=!0}=e,[l,u]=y.useState(!1),h=Xn(t),d=ci(r),m=y.useCallback(p=>{u(p),d(p)},[d]);return g.jsx(KH,{scope:t,open:l,onOpenChange:m,modal:a,children:g.jsx(AH,{...h,dir:s,open:l,onOpenChange:m,modal:a,children:n})})};JM.displayName=t0;var eN="ContextMenuTrigger",tN=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,a=QM(eN,n),l=Xn(n),u=y.useRef({x:0,y:0}),h=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),d=y.useRef(0),m=y.useCallback(()=>window.clearTimeout(d.current),[]),p=_=>{u.current={x:_.clientX,y:_.clientY},a.onOpenChange(!0)};return y.useEffect(()=>m,[m]),y.useEffect(()=>void(r&&m()),[r,m]),g.jsxs(g.Fragment,{children:[g.jsx(DH,{...l,virtualRef:h}),g.jsx(st.span,{"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Ne(e.onContextMenu,_=>{m(),p(_),_.preventDefault()}),onPointerDown:r?e.onPointerDown:Ne(e.onPointerDown,jh(_=>{m(),d.current=window.setTimeout(()=>p(_),700)})),onPointerMove:r?e.onPointerMove:Ne(e.onPointerMove,jh(m)),onPointerCancel:r?e.onPointerCancel:Ne(e.onPointerCancel,jh(m)),onPointerUp:r?e.onPointerUp:Ne(e.onPointerUp,jh(m))})]})});tN.displayName=eN;var GH="ContextMenuPortal",nN=e=>{const{__scopeContextMenu:t,...n}=e,r=Xn(t);return g.jsx(OH,{...r,...n})};nN.displayName=GH;var rN="ContextMenuContent",iN=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=QM(rN,n),a=Xn(n),l=y.useRef(!1);return g.jsx(LH,{...a,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{var h;(h=e.onCloseAutoFocus)==null||h.call(e,u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{var h;(h=e.onInteractOutside)==null||h.call(e,u),!u.defaultPrevented&&!s.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});iN.displayName=rN;var YH="ContextMenuGroup",XH=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(jH,{...s,...r,ref:t})});XH.displayName=YH;var ZH="ContextMenuLabel",QH=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(zH,{...s,...r,ref:t})});QH.displayName=ZH;var JH="ContextMenuItem",sN=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(PH,{...s,...r,ref:t})});sN.displayName=JH;var eF="ContextMenuCheckboxItem",tF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(BH,{...s,...r,ref:t})});tF.displayName=eF;var nF="ContextMenuRadioGroup",rF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(IH,{...s,...r,ref:t})});rF.displayName=nF;var iF="ContextMenuRadioItem",sF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(HH,{...s,...r,ref:t})});sF.displayName=iF;var oF="ContextMenuItemIndicator",aF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(FH,{...s,...r,ref:t})});aF.displayName=oF;var lF="ContextMenuSeparator",cF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(UH,{...s,...r,ref:t})});cF.displayName=lF;var uF="ContextMenuArrow",dF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx($H,{...s,...r,ref:t})});dF.displayName=uF;var hF="ContextMenuSubTrigger",fF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(WH,{...s,...r,ref:t})});fF.displayName=hF;var pF="ContextMenuSubContent",mF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Xn(n);return g.jsx(VH,{...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)"}})});mF.displayName=pF;function jh(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var gF=JM,vF=tN,_F=nN,oN=iN,aN=sN;const yF=gF,bF=vF,lN=y.forwardRef(({className:e,...t},n)=>g.jsx(_F,{children:g.jsx(oN,{ref:n,className:_e("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})}));lN.displayName=oN.displayName;const cN=y.forwardRef(({className:e,...t},n)=>g.jsx(aN,{ref:n,className:_e("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}));cN.displayName=aN.displayName;function xF({onRemove:e,children:t}){return g.jsxs(yF,{children:[g.jsx(bF,{asChild:!0,children:t}),g.jsx(lN,{children:g.jsxs(cN,{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(VB,{className:"h-4 w-4"}),g.jsx("span",{className:"text-xs font-medium",children:"Remove"})]})})]})}function SF({group:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:a,chatsPerProject:l,onNewLocalChat:u,onRemoveProject:h,isConnected:d,startingLocalPath:m}){const{groupKey:p,localPath:_,chats:b}=e,S=n.has(p),w=S?b:b.slice(0,l),C=b.length>l,{attributes:k,listeners:T,setNodeRef:R,setActivatorNodeRef:M,transform:L,transition:O,isDragging:j}=U9({id:p}),F={transform:Au.Translate.toString(L),transition:O},G=g.jsxs("div",{ref:M,className:_e("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(p),...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(p)?g.jsx(fs,{className:"translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-all duration-200"}):g.jsxs(g.Fragment,{children:[g.jsx(fT,{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(fs,{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(Af,{children:[g.jsx(Df,{asChild:!0,children:g.jsx("span",{className:"truncate max-w-[150px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:rM(_)})}),g.jsx(Mu,{side:"right",sideOffset:4,children:_})]})]}),u&&g.jsxs(Af,{children:[g.jsx(Df,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",className:_e("h-5.5 w-5.5 absolute right-2 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100",(!d||m===_)&&"opacity-50 cursor-not-allowed"),disabled:!d||m===_,onClick:P=>{P.stopPropagation(),u(_)},children:m===_?g.jsx(Di,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):g.jsx(gb,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),g.jsx(Mu,{side:"right",sideOffset:4,children:d?"New chat":`Start ${Kn} to connect`})]})]});return g.jsxs("div",{ref:R,style:F,className:_e("group/section",j&&"opacity-50 shadow-lg z-50 relative"),...k,children:[h?g.jsx(xF,{onRemove:()=>h(p),children:G}):G,!t.has(p)&&(w.length>0||C)&&g.jsxs("div",{className:"space-y-[2px] mb-2 ",children:[w.map(a),C&&g.jsx("button",{onClick:()=>s(p),className:"pl-2.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:S?"Show less":`Show more (${b.length-l})`})]})]})}function wF({projectGroups:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:a,chatsPerProject:l,onNewLocalChat:u,onRemoveProject:h,onReorderGroups:d,isConnected:m,startingLocalPath:p}){const _=_7(GC(Wb,{activationConstraint:{distance:8}}),GC(Ub)),b=y.useMemo(()=>e.map(k=>k.groupKey),[e]),S=y.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=b.indexOf(T.id),L=b.indexOf(R.id);if(M!==-1&&L!==-1){const O=Vb(b,M,L);d(O)}}if(S.current){const M=S.current;S.current=null,requestAnimationFrame(()=>r(M))}}return g.jsx(S9,{sensors:_,collisionDetection:w7,onDragStart:w,onDragEnd:C,children:g.jsx(j9,{items:b,strategy:O9,children:e.map(k=>g.jsx(SF,{group:k,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:a,chatsPerProject:l,onNewLocalChat:u,onRemoveProject:h,isConnected:m,startingLocalPath:p},k.groupKey))})})}const a2=e=>{let t;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const _=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(b=>b(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},CF=(e=>e?a2(e):a2),kF=e=>e;function EF(e,t=kF){const n=Lt.useSyncExternalStore(e.subscribe,Lt.useCallback(()=>t(e.getState()),[e,t]),Lt.useCallback(()=>t(e.getInitialState()),[e,t]));return Lt.useDebugValue(n),n}const RF=e=>{const t=CF(e),n=r=>EF(t,r);return Object.assign(n,t),n},Fl=(e=>RF);function TF(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const l=h=>h===null?null:JSON.parse(h,void 0),u=(a=n.getItem(s))!=null?a:null;return u instanceof Promise?u.then(l):l(u)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const O_=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return O_(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return O_(r)(n)}}}},MF=(e,t)=>(n,r,s)=>{let a={storage:TF(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},l=!1,u=0;const h=new Set,d=new Set;let m=a.storage;if(!m)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...C)},r,s);const p=()=>{const C=a.partialize({...r()});return m.setItem(a.name,{state:C,version:a.version})},_=s.setState;s.setState=(C,k)=>(_(C,k),p());const b=e((...C)=>(n(...C),p()),r,s);s.getInitialState=()=>b;let S;const w=()=>{var C,k;if(!m)return;const T=++u;l=!1,h.forEach(M=>{var L;return M((L=r())!=null?L:b)});const R=((k=a.onRehydrateStorage)==null?void 0:k.call(a,(C=r())!=null?C:b))||void 0;return O_(m.getItem.bind(m))(a.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==a.version){if(a.migrate){const L=a.migrate(M.state,M.version);return L instanceof Promise?L.then(O=>[!0,O]):[!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[O,j]=M;if(S=a.merge(j,(L=r())!=null?L:b),n(S,!0),O)return p()}).then(()=>{T===u&&(R==null||R(S,void 0),S=r(),l=!0,d.forEach(M=>M(S)))}).catch(M=>{T===u&&(R==null||R(void 0,M))})};return s.persist={setOptions:C=>{a={...a,...C},C.storage&&(m=C.storage)},clearStorage:()=>{m==null||m.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>w(),hasHydrated:()=>l,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},a.skipHydration||w(),S||b},Ul=MF,l2=Fl()(Ul(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"}));function NF({data:e,activeChatId:t,connectionStatus:n,ready:r,open:s,collapsed:a,showMobileOpenButton:l,onOpen:u,onClose:h,onCollapse:d,onExpand:m,onCreateChat:p,onDeleteChat:_,onRemoveProject:b,updateSnapshot:S,onInstallUpdate:w}){const C=fi(),k=Ol(),T=y.useRef(null),[R,M]=y.useState(new Set),[L,O]=y.useState(new Set),[j,F]=y.useState(()=>Date.now()),G=10,P=l2(ne=>ne.order),H=l2(ne=>ne.setOrder),B=y.useMemo(()=>{if(P.length===0)return e.projectGroups;const ne=new Map(e.projectGroups.map(Ce=>[Ce.groupKey,Ce])),de=P.filter(Ce=>ne.has(Ce)).map(Ce=>ne.get(Ce)),we=new Set(P);for(const Ce of e.projectGroups)we.has(Ce.groupKey)||de.push(Ce);return de},[e.projectGroups,P]),U=y.useCallback(ne=>H(ne),[H]),$=y.useMemo(()=>new Map(e.projectGroups.map(ne=>[ne.localPath,ne.groupKey])),[e.projectGroups]),W=y.useMemo(()=>e.projectGroups.reduce((ne,de)=>ne+de.chats.length,0),[e.projectGroups]),z=y.useCallback(ne=>{M(de=>{const we=new Set(de);return we.has(ne)?we.delete(ne):we.add(ne),we})},[]),q=y.useCallback(ne=>{O(de=>{const we=new Set(de);return we.has(ne)?we.delete(ne):we.add(ne),we})},[]),V=y.useCallback(ne=>g.jsx(r7,{chat:ne,activeChatId:t,nowMs:j,onSelectChat:de=>{k(`/chat/${de}`),h()},onDeleteChat:()=>_(ne)},ne._id),[t,k,j,h,_]);y.useEffect(()=>{const ne=window.setInterval(()=>{F(Date.now())},3e4);return()=>window.clearInterval(ne)},[]),y.useEffect(()=>{!t||!T.current||requestAnimationFrame(()=>{const ne=T.current,de=ne==null?void 0:ne.querySelector(`[data-chat-id="${t}"]`);if(!de||!ne)return;const we=de.getBoundingClientRect(),Ce=ne.getBoundingClientRect();if(we.top<Ce.top+38){const Re=we.top-Ce.top+ne.scrollTop;ne.scrollTo({top:Re-38,behavior:"smooth"})}else if(we.bottom>Ce.bottom){const Re=we.top+we.height/2-Ce.top+ne.scrollTop,ze=ne.clientHeight/2;ne.scrollTo({top:Re-ze,behavior:"smooth"})}})},[t,W]);const X=W>0,N=C.pathname==="/",I=C.pathname.startsWith("/settings"),Z=N||I,D=n==="connecting"||!r,ce=D?"Connecting":n==="connected"?"Connected":"Disconnected",pe=n==="connected"?"bg-emerald-500":"bg-amber-500",ae=(S==null?void 0:S.updateAvailable)===!0,Q=S?S.latestVersion===`${S.currentVersion}-dev`:!1,ve=(S==null?void 0:S.status)==="updating"||(S==null?void 0:S.status)==="restart_pending";return g.jsxs(g.Fragment,{children:[!s&&l&&g.jsx(tt,{variant:"ghost",size:"icon",className:"fixed top-3 left-3 z-50 md:hidden",onClick:u,children:g.jsx(fb,{className:"h-5 w-5"})}),a&&Z&&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(mu,{className:"size-6 text-logo"}),g.jsx(tt,{variant:"ghost",size:"icon",onClick:m,title:"Expand sidebar",children:g.jsx(y_,{className:"h-5 w-5"})})]})}),g.jsxs("div",{"data-sidebar":"open",className:_e("fixed inset-0 z-50 bg-background dark:bg-card flex flex-col h-[100dvh] select-none","md:relative md:inset-auto md:w-[275px] md:mr-0 md:h-[calc(100dvh-16px)] md:my-2 md:ml-2 md:border md:border-border md:rounded-2xl",s?"flex":"hidden md:flex",a&&"md:hidden"),children:[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(mu,{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(y_,{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(mu,{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:Kn})]}),g.jsxs("div",{className:"flex items-center",children:[Q?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"}):ae?g.jsxs(tt,{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:ve,title:S!=null&&S.latestVersion?`Update to ${S.latestVersion}`:"Update Kanna",children:[ve?g.jsx(Di,{className:"mr-1.5 h-3 w-3 animate-spin"}):null,"UPDATE"]}):null,g.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>{k("/"),h()},className:"size-10 rounded-lg",title:"New project",children:g.jsx(mb,{className:"size-4"})}),g.jsx(tt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:h,children:g.jsx(ca,{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:[!X&&D?g.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(ne=>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(de=>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:_e("h-3.5 rounded bg-muted",de===0?"w-32":de===1?"w-40":"w-28")})]},de))})]},ne))}):null,!X&&!D&&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(wF,{projectGroups:B,onReorderGroups:U,collapsedSections:R,expandedGroups:L,onToggleSection:z,onToggleExpandedGroup:q,renderChatRow:V,chatsPerProject:G,onNewLocalChat:ne=>{const de=$.get(ne);de&&p(de)},onRemoveProject:b,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:_e("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(RB,{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:ce}),D?g.jsx(Di,{className:"h-2 w-2 animate-spin"}):g.jsx("span",{className:_e("h-2 w-2 rounded-full",pe)})]})]})})})]}),s?g.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 md:hidden",onClick:h}):null]})}const If=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],L_=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],ju={reasoningEffort:"high",contextWindow:"200k"},j_={reasoningEffort:"high",fastMode:!1};function c2(e){return If.some(t=>t.id===e)}function u2(e){return L_.some(t=>t.id===e)}const z_=[{id:"200k",label:"200k"},{id:"1m",label:"1M"}],yu=[{id:"claude",label:"Claude",defaultModel:"sonnet",defaultEffort:"high",supportsPlanMode:!0,models:[{id:"opus",label:"Opus",supportsEffort:!0,contextWindowOptions:[...z_]},{id:"sonnet",label:"Sonnet",supportsEffort:!0,contextWindowOptions:[...z_]},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...If]},{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 AF(e){const t=yu.find(n=>n.id===e);if(!t)throw new Error(`Unknown provider: ${e}`);return t}function DF(e){return AF("claude").models.find(t=>t.id===e)}function OF(e){var t;return((t=DF(e))==null?void 0:t.contextWindowOptions)??[]}function uN(e,t){const n=OF(e);return n.length===0?ju.contextWindow:n.some(r=>r.id===t)?t:ju.contextWindow}const no={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+/"]},dN=y.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:_e("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}));dN.displayName="Textarea";const n0=y.forwardRef(({className:e,children:t,...n},r)=>g.jsx("div",{ref:r,className:_e("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));n0.displayName="ScrollArea";function LF(){const[e,t]=y.useState(()=>{if(typeof window>"u")return!1;const n=navigator.standalone===!0,r=window.matchMedia("(display-mode: standalone)").matches;return n||r});return y.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 jF=Fl()(Ul((e,t)=>({drafts:{},attachmentDrafts:{},setDraft:(n,r)=>e(s=>{if(!r){const{[n]:a,...l}=s.drafts;return{drafts:l}}return{drafts:{...s.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:s,...a}=r.drafts;return{drafts:a}}),getDraft:n=>t().drafts[n]??"",setAttachmentDrafts:(n,r)=>e(s=>{if(r.length===0){const{[n]:a,...l}=s.attachmentDrafts;return{attachmentDrafts:l}}return{attachmentDrafts:{...s.attachmentDrafts,[n]:r}}}),clearAttachmentDrafts:n=>e(r=>{const{[n]:s,...a}=r.attachmentDrafts;return{attachmentDrafts:a}}),getAttachmentDrafts:n=>t().attachmentDrafts[n]??[]}),{name:"chat-input-drafts"}));function zF(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function PF(e){return e==="claude"||e==="codex"?e:"last_used"}function Ko(e){var a,l;const t=(a=e==null?void 0:e.modelOptions)==null?void 0:a.reasoningEffort,n=c2(t)?t:c2(e==null?void 0:e.effort)?e.effort:ju.reasoningEffort,r=(e==null?void 0:e.model)??"opus",s=uN(r,(l=e==null?void 0:e.modelOptions)==null?void 0:l.contextWindow);return{model:r,modelOptions:{reasoningEffort:r!=="opus"&&n==="max"?"high":n,contextWindow:s},planMode:!!(e!=null&&e.planMode)}}function Go(e){var n,r;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:zF(e==null?void 0:e.model),modelOptions:{reasoningEffort:u2(t)?t:u2(e==null?void 0:e.effort)?e.effort:j_.reasoningEffort,fastMode:typeof((r=e==null?void 0:e.modelOptions)==null?void 0:r.fastMode)=="boolean"?e.modelOptions.fastMode:j_.fastMode},planMode:!!(e!=null&&e.planMode)}}function BF(){return{claude:{model:"opus",modelOptions:{...ju},planMode:!1},codex:{model:"gpt-5.4",modelOptions:{...j_},planMode:!1}}}function IF(e){return{claude:Ko(e==null?void 0:e.claude),codex:Go(e==null?void 0:e.codex)}}function d2(e,t){if(t===void 0){console.info(`[chat-preferences] ${e}`);return}console.info(`[chat-preferences] ${e}`,t)}function P_(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 HF(e,t,n,r){if((e==null?void 0:e.provider)==="claude"){const s=Ko(e);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="codex"){const s=Go(e);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="claude"){const s=Ko(r==null?void 0:r.claude);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="codex"){const s=Go(r==null?void 0:r.codex);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}return P_("claude",t)}function FF(e){const t=IF(e==null?void 0:e.providerDefaults);return{defaultProvider:PF(e==null?void 0:e.defaultProvider),providerDefaults:t,composerState:HF(e==null?void 0:e.composerState,t,e==null?void 0:e.liveProvider,e==null?void 0:e.livePreferences)}}const cs=Fl()(Ul(e=>({defaultProvider:"last_used",providerDefaults:BF(),composerState:{provider:"claude",model:"opus",modelOptions:{...ju},planMode:!1},setDefaultProvider:t=>e({defaultProvider:t}),setProviderDefaultModel:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?Ko({...r.providerDefaults.claude,model:n}):Go({...r.providerDefaults.codex,model:n})}})),setProviderDefaultModelOptions:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?Ko({...r.providerDefaults.claude,modelOptions:{...r.providerDefaults.claude.modelOptions,...n}}):Go({...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:Ko({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:t,modelOptions:Go({...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:Ko({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:n.composerState.model,modelOptions:Go({...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:P_(t,n.providerDefaults)})),initializeComposerForNewChat:()=>e(t=>{if(t.defaultProvider==="last_used")return d2("initializeComposerForNewChat:last_used",{defaultProvider:t.defaultProvider,composerState:t.composerState,providerDefaults:t.providerDefaults}),{composerState:{...t.composerState}};const n=P_(t.defaultProvider,t.providerDefaults);return d2("initializeComposerForNewChat:explicit_default",{defaultProvider:t.defaultProvider,composerState:n,providerDefaults:t.providerDefaults}),{composerState:n}})}),{name:"chat-preferences",version:3,migrate:e=>FF(e)}));var Rp="Popover",[hN]=vs(Rp,[po]),td=po(),[UF,mo]=hN(Rp),fN=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,u=td(t),h=y.useRef(null),[d,m]=y.useState(!1),[p,_]=wl({prop:r,defaultProp:s??!1,onChange:a,caller:Rp});return g.jsx(mp,{...u,children:g.jsx(UF,{scope:t,contentId:ds(),triggerRef:h,open:p,onOpenChange:_,onOpenToggle:y.useCallback(()=>_(b=>!b),[_]),hasCustomAnchor:d,onCustomAnchorAdd:y.useCallback(()=>m(!0),[]),onCustomAnchorRemove:y.useCallback(()=>m(!1),[]),modal:l,children:n})})};fN.displayName=Rp;var pN="PopoverAnchor",$F=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(pN,n),a=td(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=s;return y.useEffect(()=>(l(),()=>u()),[l,u]),g.jsx(Ku,{...a,...r,ref:t})});$F.displayName=pN;var mN="PopoverTrigger",gN=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(mN,n),a=td(n),l=vt(t,s.triggerRef),u=g.jsx(st.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":xN(s.open),...r,ref:l,onClick:Ne(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:g.jsx(Ku,{asChild:!0,...a,children:u})});gN.displayName=mN;var r0="PopoverPortal",[WF,VF]=hN(r0,{forceMount:void 0}),vN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=mo(r0,t);return g.jsx(WF,{scope:t,forceMount:n,children:g.jsx(Zr,{present:n||a.open,children:g.jsx(jl,{asChild:!0,container:s,children:r})})})};vN.displayName=r0;var El="PopoverContent",_N=y.forwardRef((e,t)=>{const n=VF(El,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=mo(El,e.__scopePopover);return g.jsx(Zr,{present:r||a.open,children:a.modal?g.jsx(KF,{...s,ref:t}):g.jsx(GF,{...s,ref:t})})});_N.displayName=El;var qF=Zo("PopoverContent.RemoveScroll"),KF=y.forwardRef((e,t)=>{const n=mo(El,e.__scopePopover),r=y.useRef(null),s=vt(t,r),a=y.useRef(!1);return y.useEffect(()=>{const l=r.current;if(l)return ap(l)},[]),g.jsx(Vu,{as:qF,allowPinchZoom:!0,children:g.jsx(yN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ne(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),a.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ne(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,d=u.button===2||h;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Ne(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),GF=y.forwardRef((e,t)=>{const n=mo(El,e.__scopePopover),r=y.useRef(!1),s=y.useRef(!1);return g.jsx(yN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),yN=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:m,...p}=e,_=mo(El,n),b=td(n);return sp(),g.jsx(Wu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:g.jsx(Ll,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onDismiss:()=>_.onOpenChange(!1),children:g.jsx(gp,{"data-state":xN(_.open),role:"dialog",id:_.contentId,...b,...p,ref:t,style:{...p.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)"}})})})}),bN="PopoverClose",YF=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(bN,n);return g.jsx(st.button,{type:"button",...r,ref:t,onClick:Ne(e.onClick,()=>s.onOpenChange(!1))})});YF.displayName=bN;var XF="PopoverArrow",ZF=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=td(n);return g.jsx(vp,{...s,...r,ref:t})});ZF.displayName=XF;function xN(e){return e?"open":"closed"}var QF=fN,JF=gN,eU=vN,SN=_N;const tU=QF,nU=JF,wN=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>g.jsx(eU,{children:g.jsx(SN,{ref:s,align:t,sideOffset:n,[Eu]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),window.dispatchEvent(new Event(kf)),(l=r.onCloseAutoFocus)==null||l.call(r,a)},className:_e("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})}));wN.displayName=SN.displayName;function rU({className:e,...t}){return g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:_e("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 iU({className:e,...t}){return g.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:_e("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 h2={claude:rU,codex:iU};function is({onClick:e,selected:t,icon:n,label:r,description:s,disabled:a}){return g.jsxs("button",{onClick:e,disabled:a,className:_e("w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity",t?"bg-muted border-border":"hover:opacity-60",a&&"opacity-40 cursor-not-allowed"),children:[n,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 rl({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[s,a]=y.useState(!1);return n?g.jsx("button",{disabled:!0,className:_e("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(tU,{open:s,onOpenChange:a,children:[g.jsx(nU,{asChild:!0,children:g.jsx("button",{className:_e("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(wN,{align:"center",className:"w-64 p-1",children:g.jsx("div",{className:"space-y-1",children:typeof r=="function"?r(()=>a(!1)):r})})]})}function B_({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,providerLocked:r=!1,model:s,modelOptions:a,onProviderChange:l,onModelChange:u,onModelOptionChange:h,planMode:d=!1,onPlanModeChange:m,includePlanMode:p=!0,className:_}){var O,j,F,G,P;const b=e.find(H=>H.id===t)??e[0],S=h2[t],w=RC,C=p&&(b==null?void 0:b.supportsPlanMode)&&m,k=t==="claude"?a:null,T=t==="codex"?a:null,R=((O=b.models.find(H=>H.id===s))==null?void 0:O.contextWindowOptions)??[],M=(k==null?void 0:k.contextWindow)??z_[0].id,L=M==="1m"?AC:DC;return g.jsxs("div",{className:_e("flex md:justify-center items-center gap-0.5",_),children:[n?g.jsx(rl,{disabled:r||!l,trigger:g.jsxs(g.Fragment,{children:[g.jsx(S,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:(b==null?void 0:b.label)??t})]}),children:H=>e.map(B=>{const U=h2[B.id];return g.jsx(is,{onClick:()=>{l==null||l(B.id),H()},selected:t===B.id,icon:g.jsx(U,{className:"h-4 w-4 text-muted-foreground"}),label:B.label},B.id)})}):null,g.jsx(rl,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(w,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:((j=b.models.find(H=>H.id===s))==null?void 0:j.label)??s})]}),children:H=>b.models.map(B=>{const U=RC;return g.jsx(is,{onClick:()=>{u(t,B.id),H()},selected:s===B.id,icon:g.jsx(U,{className:"h-4 w-4 text-muted-foreground"}),label:B.label},B.id)})}),g.jsx(rl,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(gv,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:t==="claude"?((F=If.find(H=>H.id===a.reasoningEffort))==null?void 0:F.label)??a.reasoningEffort:((G=L_.find(H=>H.id===a.reasoningEffort))==null?void 0:G.label)??a.reasoningEffort})]}),children:H=>t==="claude"?If.map(B=>g.jsx(is,{onClick:()=>{h({type:"claudeReasoningEffort",effort:B.id}),H()},selected:a.reasoningEffort===B.id,icon:g.jsx(gv,{className:"h-4 w-4 text-muted-foreground"}),label:B.label,disabled:B.id==="max"&&s!=="opus"},B.id)):L_.map(B=>g.jsx(is,{onClick:()=>{h({type:"codexReasoningEffort",effort:B.id}),H()},selected:a.reasoningEffort===B.id,icon:g.jsx(gv,{className:"h-4 w-4 text-muted-foreground"}),label:B.label},B.id))}),t==="claude"&&R.length>1?g.jsx(rl,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(L,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:((P=R.find(H=>H.id===M))==null?void 0:P.label)??M})]}),children:H=>R.map(B=>g.jsx(is,{onClick:()=>{h({type:"contextWindow",contextWindow:B.id}),H()},selected:M===B.id,icon:B.id==="1m"?g.jsx(AC,{className:"h-4 w-4 text-muted-foreground"}):g.jsx(DC,{className:"h-4 w-4 text-muted-foreground"}),label:B.label,description:B.id==="1m"?"Expanded context window":"Standard context window"},B.id))}):null,t==="codex"?g.jsx(rl,{trigger:g.jsxs(g.Fragment,{children:[T!=null&&T.fastMode?g.jsx(Nh,{className:"h-3.5 w-3.5"}):g.jsx(Nh,{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(is,{onClick:()=>{h({type:"fastMode",fastMode:!1}),H()},selected:!(T!=null&&T.fastMode),icon:g.jsx(Nh,{className:"h-4 w-4 text-muted-foreground -scale-x-100"}),label:"Standard"}),g.jsx(is,{onClick:()=>{h({type:"fastMode",fastMode:!0}),H()},selected:!!(T!=null&&T.fastMode),icon:g.jsx(Nh,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,C?g.jsx(rl,{trigger:g.jsxs(g.Fragment,{children:[d?g.jsx(Cf,{className:"h-3.5 w-3.5"}):g.jsx(MC,{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(is,{onClick:()=>{m(!1),H()},selected:!d,icon:g.jsx(MC,{className:"h-4 w-4 text-muted-foreground"}),label:"Full Access",description:"Execution without approval"}),g.jsx(is,{onClick:()=>{m(!0),H()},selected:d,icon:g.jsx(Cf,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan Mode",description:"Review a plan before execution"})]})}):null]})}const sU=1024*1024,oU=256*1024,f2=200,I_=20,CN=new Set([".c",".cc",".cfg",".conf",".cpp",".cs",".css",".env",".go",".graphql",".h",".hpp",".html",".ini",".java",".js",".jsonc",".jsx",".kt",".lua",".mjs",".php",".pl",".properties",".py",".rb",".rs",".scss",".sh",".sql",".swift",".toml",".ts",".tsx",".txt",".vue",".xml",".yaml",".yml",".zsh"]),aU=new Set([".7z",".bz2",".gz",".rar",".tar",".tgz",".xz",".zip"]),lU=new Set([".aac",".flac",".m4a",".mp3",".ogg",".wav"]),cU=new Set([".avi",".m4v",".mov",".mp4",".mkv",".webm"]);function i0(e){const t=e.mimeType.toLowerCase(),n=kN(e.displayName);return t.startsWith("image/")?{kind:"image",openInNewTab:!1}:t==="application/pdf"?{kind:"pdf",openInNewTab:!1}:t==="application/json"?e.size<=oU?{kind:"json",openInNewTab:!1}:{kind:"external",openInNewTab:!0}:n===".md"?{kind:"markdown",openInNewTab:!1}:t==="text/csv"||t==="text/tab-separated-values"?{kind:"table",openInNewTab:!1}:t.startsWith("text/")?{kind:"text",openInNewTab:!1}:CN.has(n)?{kind:"text",openInNewTab:!1}:{kind:"external",openInNewTab:!0}}function uU(e){const t=e.mimeType.toLowerCase(),n=kN(e.displayName);return t.startsWith("image/")?"image":t==="application/pdf"||n===".pdf"?"pdf":t==="application/json"||n===".json"||n===".jsonc"?"json":n===".md"?"markdown":t==="text/csv"||t==="text/tab-separated-values"||n===".csv"||n===".tsv"?"table":t.startsWith("audio/")||lU.has(n)?"audio":t.startsWith("video/")||cU.has(n)?"video":t.includes("zip")||t.includes("archive")||aU.has(n)?"archive":CN.has(n)?n===".txt"?"text":"code":t.startsWith("text/")?"text":"file"}async function dU(e,t){const n=typeof AbortController<"u"?new AbortController:null,r=typeof window<"u"&&n?window.setTimeout(()=>n.abort("preview-timeout"),15e3):null;try{const s=await fetch(pU(e),{signal:n==null?void 0:n.signal,headers:{Accept:"text/plain, text/markdown, application/json, text/csv, text/tab-separated-values, */*"}});if(!s.ok)throw new Error(`Preview request failed with status ${s.status}`);if(!s.body){const p=await s.text(),_=new TextEncoder().encode(p),b=_.length>t;return{content:b?new TextDecoder().decode(_.slice(0,t)):p,truncated:b}}const a=s.body.getReader(),l=[];let u=0,h=!1;for(;;){const{done:p,value:_}=await a.read();if(p)break;if(!_)continue;const b=t-u;if(b<=0){h=!0,await a.cancel();break}if(_.byteLength>b){l.push(_.slice(0,b)),u+=b,h=!0,await a.cancel();break}l.push(_),u+=_.byteLength}const d=new Uint8Array(u);let m=0;for(const p of l)d.set(p,m),m+=p.byteLength;return{content:new TextDecoder().decode(d),truncated:h}}catch(s){throw mU(s)?new Error("Preview request timed out"):s}finally{r!==null&&window.clearTimeout(r)}}function hU(e){try{return`${JSON.stringify(JSON.parse(e),null,2)}
|
|
524
|
-
`}catch{return e}}function fU(e,t){const n=gU(e,t),r=n.length,s=n.reduce((u,h)=>Math.max(u,h.length),0),a=r>f2,l=s>I_;return{rows:n.slice(0,f2).map(u=>u.slice(0,I_)),rowCount:r,columnCount:s,truncatedRows:a,truncatedColumns:l}}function kN(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}function pU(e){return typeof window>"u"?e:new URL(e,window.location.origin).toString()}function mU(e){return e instanceof DOMException&&e.name==="AbortError"?!0:typeof e=="string"&&e==="preview-timeout"}function gU(e,t){const n=[];let r=[],s="",a=!1;for(let l=0;l<e.length;l+=1){const u=e[l],h=e[l+1];if(u==='"'){a&&h==='"'?(s+='"',l+=1):a=!a;continue}if(!a&&u===t){r.push(s),s="";continue}if(!a&&(u===`
|
|
525
|
-
`||u==="\r")){u==="\r"&&h===`
|
|
526
|
-
`&&(l+=1),r.push(s),n.push(r),r=[],s="";continue}s+=u}return(s.length>0||r.length>0)&&(r.push(s),n.push(r)),n}function EN({attachment:e,previewUrl:t,onClick:n,onRemove:r,className:s,size:a="transcript"}){const l=e.contentUrl||t,u=a==="composer";return g.jsxs("div",{className:_e("group relative flex flex-row items-end",s),children:[g.jsxs("button",{type:"button",onClick:n,className:_e("group/image relative overflow-hidden rounded-xl border border-border/80 bg-background/85 shadow-sm backdrop-blur-md",u?"min-w-[80px]":"min-w-[200px]"),children:[l?g.jsx("img",{src:l,alt:e.displayName,className:_e("rounded-xl object-contain bg-muted",u?"min-h-[50px] min-w-[80px] max-h-[120px] max-w-[200px]":"min-h-[100px] min-w-[200px] max-h-[300px] max-w-[300px]")}):g.jsx("div",{className:_e("flex items-center justify-center rounded-xl bg-muted text-muted-foreground",u?"min-h-[64px] min-w-[80px]":"min-h-[160px] min-w-[200px]"),children:g.jsx(dT,{className:_e(u?"size-6":"size-8")})}),g.jsxs("div",{className:_e("pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/75 via-black/30 to-transparent text-left opacity-0 transition-opacity duration-200 group-hover/image:opacity-100",u?"px-2.5 pb-2 pt-6":"px-4 pb-3 pt-10"),children:[g.jsx("div",{className:_e("truncate font-medium text-white",u?"text-xs":"text-sm"),children:e.displayName}),g.jsxs("div",{className:"truncate text-xs text-white/80",children:[e.mimeType," · ",s0(e.size)]})]})]}),r?g.jsx(TN,{displayName:e.displayName,onRemove:r}):null]})}function RN({attachment:e,onClick:t,onRemove:n,className:r}){const s=vU(uU(e));return g.jsxs("div",{className:_e("group relative",r),children:[g.jsxs("button",{type:"button",onClick:t,className:"flex w-[200px] items-center gap-2 rounded-xl border border-border bg-background/85 p-1 pr-3 text-left transition-colors hover:bg-accent/50",children:[g.jsx("div",{className:"flex min-h-10 min-w-10 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground",children:g.jsx(s,{className:"size-5"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"max-w-[150px] truncate text-[13px] font-medium text-foreground",children:e.displayName}),g.jsxs("div",{className:"truncate text-[11px] text-muted-foreground",children:[e.mimeType," · ",s0(e.size)]})]})]}),n?g.jsx(TN,{displayName:e.displayName,onRemove:n}):null]})}function TN({displayName:e,onRemove:t}){return g.jsx("button",{type:"button",className:"absolute right-2 top-2 rounded-full bg-background/90 p-1 text-muted-foreground shadow-sm transition hover:bg-muted hover:text-foreground",onClick:n=>{n.preventDefault(),n.stopPropagation(),t()},"aria-label":`Remove ${e}`,children:g.jsx(ca,{className:"h-3.5 w-3.5"})})}function vU(e){switch(e){case"image":return dT;case"pdf":return _B;case"markdown":return SB;case"json":return CP;case"table":return jP;case"code":return EP;case"text":return PP;case"archive":return SP;case"audio":return TP;case"video":return IP;default:return hT}}function s0(e){return e<1024?`${e} B`:e<1024*1024?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function _U(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const yU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xU={};function p2(e,t){return(xU.jsx?bU:yU).test(e)}const SU=/[ \t\n\f\r]/g;function wU(e){return typeof e=="object"?e.type==="text"?m2(e.value):!1:m2(e)}function m2(e){return e.replace(SU,"")===""}class nd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}nd.prototype.normal={};nd.prototype.property={};nd.prototype.space=void 0;function MN(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new nd(n,r,t)}function H_(e){return e.toLowerCase()}class dr{constructor(t,n){this.attribute=n,this.property=t}}dr.prototype.attribute="";dr.prototype.booleanish=!1;dr.prototype.boolean=!1;dr.prototype.commaOrSpaceSeparated=!1;dr.prototype.commaSeparated=!1;dr.prototype.defined=!1;dr.prototype.mustUseProperty=!1;dr.prototype.number=!1;dr.prototype.overloadedBoolean=!1;dr.prototype.property="";dr.prototype.spaceSeparated=!1;dr.prototype.space=void 0;let CU=0;const Ge=ha(),an=ha(),F_=ha(),Se=ha(),Ot=ha(),bl=ha(),Cr=ha();function ha(){return 2**++CU}const U_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:an,commaOrSpaceSeparated:Cr,commaSeparated:bl,number:Se,overloadedBoolean:F_,spaceSeparated:Ot},Symbol.toStringTag,{value:"Module"})),Ev=Object.keys(U_);class o0 extends dr{constructor(t,n,r,s){let a=-1;if(super(t,n),g2(this,"space",s),typeof r=="number")for(;++a<Ev.length;){const l=Ev[a];g2(this,Ev[a],(r&U_[l])===U_[l])}}}o0.prototype.defined=!0;function g2(e,t,n){n&&(e[t]=n)}function $l(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new o0(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[H_(r)]=r,n[H_(a.attribute)]=r}return new nd(t,n,e.space)}const NN=$l({properties:{ariaActiveDescendant:null,ariaAtomic:an,ariaAutoComplete:null,ariaBusy:an,ariaChecked:an,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:Ot,ariaCurrent:null,ariaDescribedBy:Ot,ariaDetails:null,ariaDisabled:an,ariaDropEffect:Ot,ariaErrorMessage:null,ariaExpanded:an,ariaFlowTo:Ot,ariaGrabbed:an,ariaHasPopup:null,ariaHidden:an,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ot,ariaLevel:Se,ariaLive:null,ariaModal:an,ariaMultiLine:an,ariaMultiSelectable:an,ariaOrientation:null,ariaOwns:Ot,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:an,ariaReadOnly:an,ariaRelevant:null,ariaRequired:an,ariaRoleDescription:Ot,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:an,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function AN(e,t){return t in e?e[t]:t}function DN(e,t){return AN(e,t.toLowerCase())}const kU=$l({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bl,acceptCharset:Ot,accessKey:Ot,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:Ot,autoFocus:Ge,autoPlay:Ge,blocking:Ot,capture:null,charSet:null,checked:Ge,cite:null,className:Ot,cols:Se,colSpan:null,content:null,contentEditable:an,controls:Ge,controlsList:Ot,coords:Se|bl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:F_,draggable:an,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:Ot,height:Se,hidden:F_,high:Se,href:null,hrefLang:null,htmlFor:Ot,httpEquiv:Ot,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:Ot,itemRef:Ot,itemScope:Ge,itemType:Ot,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,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:Ge,optimum:Se,pattern:null,ping:Ot,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:Ot,required:Ge,reversed:Ge,rows:Se,rowSpan:Se,sandbox:Ot,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:an,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Se,step:null,style:null,tabIndex:Se,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:an,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ot,axis:null,background:null,bgColor:null,border:Se,borderColor:null,bottomMargin:Se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:an,standby:null,summary:null,text:null,topMargin:Se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ge,disableRemotePlayback:Ge,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:DN}),EU=$l({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:Cr,accentHeight:Se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Se,amplitude:Se,arabicForm:null,ascent:Se,attributeName:null,attributeType:null,azimuth:Se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Se,by:null,calcMode:null,capHeight:Se,className:Ot,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:Se,diffuseConstant:Se,direction:null,display:null,dur:null,divisor:Se,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Se,enableBackground:null,end:null,event:null,exponent:Se,externalResourcesRequired:null,fill:null,fillOpacity:Se,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:bl,g2:bl,glyphName:bl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Se,horizOriginX:Se,horizOriginY:Se,id:null,ideographic:Se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Se,k:Se,k1:Se,k2:Se,k3:Se,k4:Se,kernelMatrix:Cr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Se,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:Se,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:Se,overlineThickness:Se,paintOrder:null,panose1:null,path:null,pathLength:Se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ot,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cr,rev:Cr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cr,requiredFeatures:Cr,requiredFonts:Cr,requiredFormats:Cr,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:Se,specularExponent:Se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Se,strikethroughThickness:Se,string:null,stroke:null,strokeDashArray:Cr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Se,strokeOpacity:Se,strokeWidth:null,style:null,surfaceScale:Se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cr,tabIndex:Se,tableValues:null,target:null,targetX:Se,targetY:Se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Se,underlineThickness:Se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Se,values:null,vAlphabetic:Se,vMathematical:Se,vectorEffect:null,vHanging:Se,vIdeographic:Se,version:null,vertAdvY:Se,vertOriginX:Se,vertOriginY:Se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:AN}),ON=$l({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()}}),LN=$l({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:DN}),jN=$l({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),RU={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"},TU=/[A-Z]/g,v2=/-[a-z]/g,MU=/^data[-\w.:]+$/i;function NU(e,t){const n=H_(t);let r=t,s=dr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&MU.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(v2,DU);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!v2.test(a)){let l=a.replace(TU,AU);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=o0}return new s(r,t)}function AU(e){return"-"+e.toLowerCase()}function DU(e){return e.charAt(1).toUpperCase()}const OU=MN([NN,kU,ON,LN,jN],"html"),a0=MN([NN,EU,ON,LN,jN],"svg");function LU(e){return e.join(" ").trim()}var il={},Rv,_2;function jU(){if(_2)return Rv;_2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,h=`
|
|
527
|
-
`,d="/",m="*",p="",_="comment",b="declaration";function S(C,k){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];k=k||{};var T=1,R=1;function M($){var W=$.match(t);W&&(T+=W.length);var z=$.lastIndexOf(h);R=~z?$.length-z:R+$.length}function L(){var $={line:T,column:R};return function(W){return W.position=new O($),G(),W}}function O($){this.start=$,this.end={line:T,column:R},this.source=k.source}O.prototype.content=C;function j($){var W=new Error(k.source+":"+T+":"+R+": "+$);if(W.reason=$,W.filename=k.source,W.line=T,W.column=R,W.source=C,!k.silent)throw W}function F($){var W=$.exec(C);if(W){var z=W[0];return M(z),C=C.slice(z.length),W}}function G(){F(n)}function P($){var W;for($=$||[];W=H();)W!==!1&&$.push(W);return $}function H(){var $=L();if(!(d!=C.charAt(0)||m!=C.charAt(1))){for(var W=2;p!=C.charAt(W)&&(m!=C.charAt(W)||d!=C.charAt(W+1));)++W;if(W+=2,p===C.charAt(W-1))return j("End of comment missing");var z=C.slice(2,W-2);return R+=2,M(z),C=C.slice(W),R+=2,$({type:_,comment:z})}}function B(){var $=L(),W=F(r);if(W){if(H(),!F(s))return j("property missing ':'");var z=F(a),q=$({type:b,property:w(W[0].replace(e,p)),value:z?w(z[0].replace(e,p)):p});return F(l),q}}function U(){var $=[];P($);for(var W;W=B();)W!==!1&&($.push(W),P($));return $}return G(),U()}function w(C){return C?C.replace(u,p):p}return Rv=S,Rv}var y2;function zU(){if(y2)return il;y2=1;var e=il&&il.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(il,"__esModule",{value:!0}),il.default=n;const t=e(jU());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:m}=h;u?s(d,m,h):m&&(a=a||{},a[d]=m)}),a}return il}var Wc={},b2;function PU(){if(b2)return Wc;b2=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},l=function(d,m){return m.toUpperCase()},u=function(d,m){return"".concat(m,"-")},h=function(d,m){return m===void 0&&(m={}),a(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(s,u):d=d.replace(r,u),d.replace(t,l))};return Wc.camelCase=h,Wc}var Vc,x2;function BU(){if(x2)return Vc;x2=1;var e=Vc&&Vc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(zU()),n=PU();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,h){u&&h&&(l[(0,n.camelCase)(u,a)]=h)}),l}return r.default=r,Vc=r,Vc}var IU=BU();const HU=tp(IU),zN=PN("end"),l0=PN("start");function PN(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 FU(e){const t=l0(e),n=zN(e);if(t&&n)return{start:t,end:n}}function bu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?S2(e.position):"start"in e||"end"in e?S2(e):"line"in e||"column"in e?$_(e):""}function $_(e){return w2(e&&e.line)+":"+w2(e&&e.column)}function S2(e){return $_(e&&e.start)+"-"+$_(e&&e.end)}function w2(e){return e&&typeof e=="number"?e:1}class $n extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(l=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?a.ruleId=r:(a.source=r.slice(0,h),a.ruleId=r.slice(h+1))}if(!a.place&&a.ancestors&&a.ancestors){const h=a.ancestors[a.ancestors.length-1];h&&(a.place=h.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=bu(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$n.prototype.file="";$n.prototype.name="";$n.prototype.reason="";$n.prototype.message="";$n.prototype.stack="";$n.prototype.column=void 0;$n.prototype.line=void 0;$n.prototype.ancestors=void 0;$n.prototype.cause=void 0;$n.prototype.fatal=void 0;$n.prototype.place=void 0;$n.prototype.ruleId=void 0;$n.prototype.source=void 0;const c0={}.hasOwnProperty,UU=new Map,$U=/[A-Z]/g,WU=new Set(["table","tbody","thead","tfoot","tr"]),VU=new Set(["td","th"]),BN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qU(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=e$(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=JU(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"?a0:OU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=IN(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function IN(e,t,n){if(t.type==="element")return KU(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return GU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return XU(e,t,n);if(t.type==="mdxjsEsm")return YU(e,t);if(t.type==="root")return ZU(e,t,n);if(t.type==="text")return QU(e,t)}function KU(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=a0,e.schema=s),e.ancestors.push(t);const a=FN(e,t.tagName,!1),l=t$(e,t);let u=d0(e,t);return WU.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!wU(h):!0})),HN(e,l,a,t),u0(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function GU(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)}zu(e,t.position)}function YU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zu(e,t.position)}function XU(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=a0,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:FN(e,t.name,!0),l=n$(e,t),u=d0(e,t);return HN(e,l,a,t),u0(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function ZU(e,t,n){const r={};return u0(r,d0(e,t)),e.create(t,e.Fragment,r,n)}function QU(e,t){return t.value}function HN(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function u0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function JU(e,t,n){return r;function r(s,a,l,u){const d=Array.isArray(l.children)?n:t;return u?d(a,l,u):d(a,l)}}function e$(e,t){return n;function n(r,s,a,l){const u=Array.isArray(a.children),h=l0(r);return t(s,a,l,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function t$(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&c0.call(t.properties,s)){const a=r$(e,s,t.properties[s]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&VU.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function n$(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else zu(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else zu(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function d0(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:UU;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const h=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(h){const d=s.get(h)||0;l=h+"-"+d,s.set(h,d+1)}}const u=IN(e,a,l);u!==void 0&&n.push(u)}return n}function r$(e,t,n){const r=NU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?_U(n):LU(n)),r.property==="style"){let s=typeof n=="object"?n:i$(e,String(n));return e.stylePropertyNameCase==="css"&&(s=s$(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?RU[r.property]||r.property:r.attribute,n]}}function i$(e,t){try{return HU(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new $n("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=BN+"#cannot-parse-style-attribute",s}}function FN(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const u=p2(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=p2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return c0.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);zu(e)}function zu(e,t){const n=new $n("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=BN+"#cannot-handle-mdx-estrees-without-createevaluater",n}function s$(e){const t={};let n;for(n in e)c0.call(e,n)&&(t[o$(n)]=e[n]);return t}function o$(e){let t=e.replace($U,a$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function a$(e){return"-"+e.toLowerCase()}const Tv={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"]},l$={};function h0(e,t){const n=l$,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return UN(e,r,s)}function UN(e,t,n){if(c$(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return C2(e.children,t,n)}return Array.isArray(e)?C2(e,t,n):""}function C2(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=UN(e[s],t,n);return r.join("")}function c$(e){return!!(e&&typeof e=="object")}const k2=document.createElement("i");function f0(e){const t="&"+e+";";k2.innerHTML=t;const n=k2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Rr(e,t,n,r){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Kr(e,t){return e.length>0?(Rr(e,e.length,0,t),e):t}const E2={}.hasOwnProperty;function $N(e){const t={};let n=-1;for(;++n<e.length;)u$(t,e[n]);return t}function u$(e,t){let n;for(n in t){const s=(E2.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){E2.call(s,l)||(s[l]=[]);const u=a[l];d$(s[l],Array.isArray(u)?u:u?[u]:[])}}}function d$(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Rr(e,0,0,r)}function WN(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 ai(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yn=go(/[A-Za-z]/),Fn=go(/[\dA-Za-z]/),h$=go(/[#-'*+\--9=?A-Z^-~]/);function Hf(e){return e!==null&&(e<32||e===127)}const W_=go(/\d/),f$=go(/[\dA-Fa-f]/),p$=go(/[!-/:-@[-`{-~]/);function Ie(e){return e!==null&&e<-2}function At(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const Tp=go(new RegExp("\\p{P}|\\p{S}","u")),ea=go(/\s/);function go(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wl(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Fn(e.charCodeAt(n+1))&&Fn(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function ut(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(h){return it(h)?(e.enter(n),u(h)):t(h)}function u(h){return it(h)&&a++<s?(e.consume(h),u):(e.exit(n),t(h))}}const m$={tokenize:g$};function g$(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"),ut(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),a(u)}function a(u){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Ie(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const v$={tokenize:_$},R2={tokenize:y$};function _$(e){const t=this,n=[];let r=0,s,a,l;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,O;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){O=t.events[L][1].end;break}k(r);let j=M;for(;j<t.events.length;)t.events[j][1].end={...O},j++;return Rr(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(R2,m,p)(R)}function m(R){return s&&T(),k(r),_(R)}function p(R){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,S(R)}function _(R){return t.containerState={},e.attempt(R2,b,S)(R)}function b(R){return r++,n.push([t.currentConstruct,t.containerState]),_(R)}function S(R){if(R===null){s&&T(),k(0),e.consume(R);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),w(R)}function w(R){if(R===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(R);return}return Ie(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=a,a&&(a.next=R),a=R,s.defineSkip(R.start),s.write(L),t.parser.lazy[R.start.line]){let O=s.events.length;for(;O--;)if(s.events[O][1].start.offset<l&&(!s.events[O][1].end||s.events[O][1].end.offset>l))return;const j=t.events.length;let F=j,G,P;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(G){P=t.events[F][1].end;break}G=!0}for(k(r),O=j;O<t.events.length;)t.events[O][1].end={...P},O++;Rr(t.events,F+1,0,t.events.slice(j)),t.events.length=O}}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]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function y$(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rl(e){if(e===null||At(e)||ea(e))return 1;if(Tp(e))return 2}function Mp(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const V_={name:"attention",resolveAll:b$,tokenize:x$};function b$(e,t){let n=-1,r,s,a,l,u,h,d,m;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 p={...e[r][1].end},_={...e[n][1].start};T2(p,-h),T2(_,h),l={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},u={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},a={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Kr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Kr(d,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),d=Kr(d,Mp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Kr(d,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=Kr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Rr(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function x$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Rl(r);let a;return l;function l(h){return a=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===a)return e.consume(h),u;const d=e.exit("attentionSequence"),m=Rl(h),p=!m||m===2&&s||n.includes(h),_=!s||s===2&&m||n.includes(r);return d._open=!!(a===42?p:p&&(s||!_)),d._close=!!(a===42?_:_&&(m||!p)),t(h)}}function T2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const S$={name:"autolink",tokenize:w$};function w$(e,t,n){let r=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(b){return Yn(b)?(e.consume(b),l):b===64?n(b):d(b)}function l(b){return b===43||b===45||b===46||Fn(b)?(r=1,u(b)):d(b)}function u(b){return b===58?(e.consume(b),r=0,h):(b===43||b===45||b===46||Fn(b))&&r++<32?(e.consume(b),u):(r=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Hf(b)?n(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),m):h$(b)?(e.consume(b),d):n(b)}function m(b){return Fn(b)?p(b):n(b)}function p(b){return b===46?(e.consume(b),r=0,m):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):_(b)}function _(b){if((b===45||Fn(b))&&r++<63){const S=b===45?_:p;return e.consume(b),S}return n(b)}}const rd={partial:!0,tokenize:C$};function C$(e,t,n){return r;function r(a){return it(a)?ut(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Ie(a)?t(a):n(a)}}const VN={continuation:{tokenize:E$},exit:R$,name:"blockQuote",tokenize:k$};function k$(e,t,n){const r=this;return s;function s(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return it(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function E$(e,t,n){const r=this;return s;function s(l){return it(l)?ut(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(VN,t,n)(l)}}function R$(e){e.exit("blockQuote")}const qN={name:"characterEscape",tokenize:T$};function T$(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return p$(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const KN={name:"characterReference",tokenize:M$};function M$(e,t,n){const r=this;let s=0,a,l;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,l=Fn,m(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=f$,m):(e.enter("characterReferenceValue"),a=7,l=W_,m(p))}function m(p){if(p===59&&s){const _=e.exit("characterReferenceValue");return l===Fn&&!f0(r.sliceSerialize(_))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&s++<a?(e.consume(p),m):n(p)}}const M2={partial:!0,tokenize:A$},N2={concrete:!0,name:"codeFenced",tokenize:N$};function N$(e,t,n){const r=this,s={partial:!0,tokenize:L};let a=0,l=0,u;return h;function h(O){return d(O)}function d(O){const j=r.events[r.events.length-1];return a=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,u=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(O)}function m(O){return O===u?(l++,e.consume(O),m):l<3?n(O):(e.exit("codeFencedFenceSequence"),it(O)?ut(e,p,"whitespace")(O):p(O))}function p(O){return O===null||Ie(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(M2,w,M)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(O))}function _(O){return O===null||Ie(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(O)):it(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,b,"whitespace")(O)):O===96&&O===u?n(O):(e.consume(O),_)}function b(O){return O===null||Ie(O)?p(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(O))}function S(O){return O===null||Ie(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(O)):O===96&&O===u?n(O):(e.consume(O),S)}function w(O){return e.attempt(s,M,C)(O)}function C(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),k}function k(O){return a>0&&it(O)?ut(e,T,"linePrefix",a+1)(O):T(O)}function T(O){return O===null||Ie(O)?e.check(M2,w,M)(O):(e.enter("codeFlowValue"),R(O))}function R(O){return O===null||Ie(O)?(e.exit("codeFlowValue"),T(O)):(e.consume(O),R)}function M(O){return e.exit("codeFenced"),t(O)}function L(O,j,F){let G=0;return P;function P(W){return O.enter("lineEnding"),O.consume(W),O.exit("lineEnding"),H}function H(W){return O.enter("codeFencedFence"),it(W)?ut(O,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):B(W)}function B(W){return W===u?(O.enter("codeFencedFenceSequence"),U(W)):F(W)}function U(W){return W===u?(G++,O.consume(W),U):G>=l?(O.exit("codeFencedFenceSequence"),it(W)?ut(O,$,"whitespace")(W):$(W)):F(W)}function $(W){return W===null||Ie(W)?(O.exit("codeFencedFence"),j(W)):F(W)}}}function A$(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Mv={name:"codeIndented",tokenize:O$},D$={partial:!0,tokenize:L$};function O$(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),ut(e,a,"linePrefix",5)(d)}function a(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?h(d):Ie(d)?e.attempt(D$,l,h)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Ie(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),u)}function h(d){return e.exit("codeIndented"),t(d)}}function L$(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):Ie(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):ut(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Ie(l)?s(l):n(l)}}const j$={name:"codeText",previous:P$,resolve:z$,tokenize:B$};function z$(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 P$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function B$(e,t,n){let r=0,s,a;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),r++,u):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(a=e.enter("codeTextSequence"),s=0,m(p)):Ie(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||Ie(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),d)}function m(p){return p===96?(e.consume(p),s++,m):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",d(p))}}class I${constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&qc(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),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 GN(e){const t={};let n=-1,r,s,a,l,u,h,d;const m=new I$(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,a=0,a<h.length&&h[a][1].type==="lineEndingBlank"&&(a+=2),a<h.length&&h[a][1].type==="content"))for(;++a<h.length&&h[a][1].type!=="content";)h[a][1].type==="chunkText"&&(h[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,H$(m,n)),n=t[n],d=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=m.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...m.get(s)[1].start},u=m.slice(s,n),u.unshift(r),m.splice(s,n-s+1,u))}}return Rr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function H$(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,h=[],d={};let m,p,_=-1,b=n,S=0,w=0;const C=[w];for(;b;){for(;e.get(++s)[1]!==b;);a.push(s),b._tokenizer||(m=r.sliceStream(b),b.next||m.push(null),p&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=b,b=b.next}for(b=n;++_<u.length;)u[_][0]==="exit"&&u[_-1][0]==="enter"&&u[_][1].type===u[_-1][1].type&&u[_][1].start.line!==u[_][1].end.line&&(w=_+1,C.push(w),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):C.pop(),_=C.length;_--;){const k=u.slice(C[_],C[_+1]),T=a.pop();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 F$={resolve:$$,tokenize:W$},U$={partial:!0,tokenize:V$};function $$(e){return GN(e),e}function W$(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?a(u):Ie(u)?e.check(U$,l,a)(u):(e.consume(u),s)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function V$(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ut(e,a,"linePrefix")}function a(l){if(l===null||Ie(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function YN(e,t,n,r,s,a,l,u,h){const d=h||Number.POSITIVE_INFINITY;let m=0;return p;function p(k){return k===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(k),e.exit(a),_):k===null||k===32||k===41||Hf(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),w(k))}function _(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(e.exit("chunkString"),e.exit(u),_(k)):k===null||k===60||Ie(k)?n(k):(e.consume(k),k===92?S:b)}function S(k){return k===60||k===62||k===92?(e.consume(k),b):b(k)}function w(k){return!m&&(k===null||k===41||At(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(k)):m<d&&k===40?(e.consume(k),m++,w):k===41?(e.consume(k),m--,w):k===null||k===32||k===40||Hf(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 XN(e,t,n,r,s,a){const l=this;let u=0,h;return d;function d(b){return e.enter(r),e.enter(s),e.consume(b),e.exit(s),e.enter(a),m}function m(b){return u>999||b===null||b===91||b===93&&!h||b===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(a),e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):Ie(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||b===91||b===93||Ie(b)||u++>999?(e.exit("chunkString"),m(b)):(e.consume(b),h||(h=!it(b)),b===92?_:p)}function _(b){return b===91||b===92||b===93?(e.consume(b),u++,p):p(b)}}function ZN(e,t,n,r,s,a){let l;return u;function u(_){return _===34||_===39||_===40?(e.enter(r),e.enter(s),e.consume(_),e.exit(s),l=_===40?41:_,h):n(_)}function h(_){return _===l?(e.enter(s),e.consume(_),e.exit(s),e.exit(r),t):(e.enter(a),d(_))}function d(_){return _===l?(e.exit(a),h(l)):_===null?n(_):Ie(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ut(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===l||_===null||Ie(_)?(e.exit("chunkString"),d(_)):(e.consume(_),_===92?p:m)}function p(_){return _===l||_===92?(e.consume(_),m):m(_)}}function xu(e,t){let n;return r;function r(s){return Ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):it(s)?ut(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const q$={name:"definition",tokenize:G$},K$={partial:!0,tokenize:Y$};function G$(e,t,n){const r=this;let s;return a;function a(b){return e.enter("definition"),l(b)}function l(b){return XN.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return s=ai(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):n(b)}function h(b){return At(b)?xu(e,d)(b):d(b)}function d(b){return YN(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(K$,p,p)(b)}function p(b){return it(b)?ut(e,_,"whitespace")(b):_(b)}function _(b){return b===null||Ie(b)?(e.exit("definition"),r.parser.defined.push(s),t(b)):n(b)}}function Y$(e,t,n){return r;function r(u){return At(u)?xu(e,s)(u):n(u)}function s(u){return ZN(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return it(u)?ut(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Ie(u)?t(u):n(u)}}const X$={name:"hardBreakEscape",tokenize:Z$};function Z$(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Ie(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Q$={name:"headingAtx",resolve:J$,tokenize:eW};function J$(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Rr(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function eW(e,t,n){let r=0;return s;function s(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||At(m)?(e.exit("atxHeadingSequence"),u(m)):n(m)}function u(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Ie(m)?(e.exit("atxHeading"),t(m)):it(m)?ut(e,u,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),u(m))}function d(m){return m===null||m===35||At(m)?(e.exit("atxHeadingText"),u(m)):(e.consume(m),d)}}const tW=["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"],A2=["pre","script","style","textarea"],nW={concrete:!0,name:"htmlFlow",resolveTo:sW,tokenize:oW},rW={partial:!0,tokenize:lW},iW={partial:!0,tokenize:aW};function sW(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 oW(e,t,n){const r=this;let s,a,l,u,h;return d;function d(D){return m(D)}function m(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),p}function p(D){return D===33?(e.consume(D),_):D===47?(e.consume(D),a=!0,w):D===63?(e.consume(D),s=3,r.interrupt?t:N):Yn(D)?(e.consume(D),l=String.fromCharCode(D),C):n(D)}function _(D){return D===45?(e.consume(D),s=2,b):D===91?(e.consume(D),s=5,u=0,S):Yn(D)?(e.consume(D),s=4,r.interrupt?t:N):n(D)}function b(D){return D===45?(e.consume(D),r.interrupt?t:N):n(D)}function S(D){const ce="CDATA[";return D===ce.charCodeAt(u++)?(e.consume(D),u===ce.length?r.interrupt?t:B:S):n(D)}function w(D){return Yn(D)?(e.consume(D),l=String.fromCharCode(D),C):n(D)}function C(D){if(D===null||D===47||D===62||At(D)){const ce=D===47,pe=l.toLowerCase();return!ce&&!a&&A2.includes(pe)?(s=1,r.interrupt?t(D):B(D)):tW.includes(l.toLowerCase())?(s=6,ce?(e.consume(D),k):r.interrupt?t(D):B(D)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?T(D):R(D))}return D===45||Fn(D)?(e.consume(D),l+=String.fromCharCode(D),C):n(D)}function k(D){return D===62?(e.consume(D),r.interrupt?t:B):n(D)}function T(D){return it(D)?(e.consume(D),T):P(D)}function R(D){return D===47?(e.consume(D),P):D===58||D===95||Yn(D)?(e.consume(D),M):it(D)?(e.consume(D),R):P(D)}function M(D){return D===45||D===46||D===58||D===95||Fn(D)?(e.consume(D),M):L(D)}function L(D){return D===61?(e.consume(D),O):it(D)?(e.consume(D),L):R(D)}function O(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),h=D,j):it(D)?(e.consume(D),O):F(D)}function j(D){return D===h?(e.consume(D),h=null,G):D===null||Ie(D)?n(D):(e.consume(D),j)}function F(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||At(D)?L(D):(e.consume(D),F)}function G(D){return D===47||D===62||it(D)?R(D):n(D)}function P(D){return D===62?(e.consume(D),H):n(D)}function H(D){return D===null||Ie(D)?B(D):it(D)?(e.consume(D),H):n(D)}function B(D){return D===45&&s===2?(e.consume(D),z):D===60&&s===1?(e.consume(D),q):D===62&&s===4?(e.consume(D),I):D===63&&s===3?(e.consume(D),N):D===93&&s===5?(e.consume(D),X):Ie(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(rW,Z,U)(D)):D===null||Ie(D)?(e.exit("htmlFlowData"),U(D)):(e.consume(D),B)}function U(D){return e.check(iW,$,Z)(D)}function $(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return D===null||Ie(D)?U(D):(e.enter("htmlFlowData"),B(D))}function z(D){return D===45?(e.consume(D),N):B(D)}function q(D){return D===47?(e.consume(D),l="",V):B(D)}function V(D){if(D===62){const ce=l.toLowerCase();return A2.includes(ce)?(e.consume(D),I):B(D)}return Yn(D)&&l.length<8?(e.consume(D),l+=String.fromCharCode(D),V):B(D)}function X(D){return D===93?(e.consume(D),N):B(D)}function N(D){return D===62?(e.consume(D),I):D===45&&s===2?(e.consume(D),N):B(D)}function I(D){return D===null||Ie(D)?(e.exit("htmlFlowData"),Z(D)):(e.consume(D),I)}function Z(D){return e.exit("htmlFlow"),t(D)}}function aW(e,t,n){const r=this;return s;function s(l){return Ie(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function lW(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(rd,t,n)}}const cW={name:"htmlText",tokenize:uW};function uW(e,t,n){const r=this;let s,a,l;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):Yn(N)?(e.consume(N),F):n(N)}function d(N){return N===45?(e.consume(N),m):N===91?(e.consume(N),a=0,S):Yn(N)?(e.consume(N),T):n(N)}function m(N){return N===45?(e.consume(N),b):n(N)}function p(N){return N===null?n(N):N===45?(e.consume(N),_):Ie(N)?(l=p,q(N)):(e.consume(N),p)}function _(N){return N===45?(e.consume(N),b):p(N)}function b(N){return N===62?z(N):N===45?_(N):p(N)}function S(N){const I="CDATA[";return N===I.charCodeAt(a++)?(e.consume(N),a===I.length?w:S):n(N)}function w(N){return N===null?n(N):N===93?(e.consume(N),C):Ie(N)?(l=w,q(N)):(e.consume(N),w)}function C(N){return N===93?(e.consume(N),k):w(N)}function k(N){return N===62?z(N):N===93?(e.consume(N),k):w(N)}function T(N){return N===null||N===62?z(N):Ie(N)?(l=T,q(N)):(e.consume(N),T)}function R(N){return N===null?n(N):N===63?(e.consume(N),M):Ie(N)?(l=R,q(N)):(e.consume(N),R)}function M(N){return N===62?z(N):R(N)}function L(N){return Yn(N)?(e.consume(N),O):n(N)}function O(N){return N===45||Fn(N)?(e.consume(N),O):j(N)}function j(N){return Ie(N)?(l=j,q(N)):it(N)?(e.consume(N),j):z(N)}function F(N){return N===45||Fn(N)?(e.consume(N),F):N===47||N===62||At(N)?G(N):n(N)}function G(N){return N===47?(e.consume(N),z):N===58||N===95||Yn(N)?(e.consume(N),P):Ie(N)?(l=G,q(N)):it(N)?(e.consume(N),G):z(N)}function P(N){return N===45||N===46||N===58||N===95||Fn(N)?(e.consume(N),P):H(N)}function H(N){return N===61?(e.consume(N),B):Ie(N)?(l=H,q(N)):it(N)?(e.consume(N),H):G(N)}function B(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),s=N,U):Ie(N)?(l=B,q(N)):it(N)?(e.consume(N),B):(e.consume(N),$)}function U(N){return N===s?(e.consume(N),s=void 0,W):N===null?n(N):Ie(N)?(l=U,q(N)):(e.consume(N),U)}function $(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||At(N)?G(N):(e.consume(N),$)}function W(N){return N===47||N===62||At(N)?G(N):n(N)}function z(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function q(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),V}function V(N){return it(N)?ut(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):X(N)}function X(N){return e.enter("htmlTextData"),l(N)}}const p0={name:"labelEnd",resolveAll:pW,resolveTo:mW,tokenize:gW},dW={tokenize:vW},hW={tokenize:_W},fW={tokenize:yW};function pW(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&&Rr(e,0,e.length,n),e}function mW(e,t){let n=e.length,r=0,s,a,l,u;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const h={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",h,t],["enter",d,t]],u=Kr(u,e.slice(a+1,a+r+3)),u=Kr(u,[["enter",m,t]]),u=Kr(u,Mp(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=Kr(u,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),u=Kr(u,e.slice(l+1)),u=Kr(u,[["exit",h,t]]),Rr(e,a,e.length,u),e}function gW(e,t,n){const r=this;let s=r.events.length,a,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return u;function u(_){return a?a._inactive?p(_):(l=r.parser.defined.includes(ai(r.sliceSerialize({start:a.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(dW,m,l?m:p)(_):_===91?e.attempt(hW,m,l?d:p)(_):l?m(_):p(_)}function d(_){return e.attempt(fW,m,p)(_)}function m(_){return t(_)}function p(_){return a._balanced=!0,n(_)}}function vW(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return At(p)?xu(e,a)(p):a(p)}function a(p){return p===41?m(p):YN(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return At(p)?xu(e,h)(p):m(p)}function u(p){return n(p)}function h(p){return p===34||p===39||p===40?ZN(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function d(p){return At(p)?xu(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function _W(e,t,n){const r=this;return s;function s(u){return XN.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(ai(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function yW(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const bW={name:"labelStartImage",resolveAll:p0.resolveAll,tokenize:xW};function xW(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const SW={name:"labelStartLink",resolveAll:p0.resolveAll,tokenize:wW};function wW(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Nv={name:"lineEnding",tokenize:CW};function CW(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const of={name:"thematicBreak",tokenize:kW};function kW(e,t,n){let r=0,s;return a;function a(d){return e.enter("thematicBreak"),l(d)}function l(d){return s=d,u(d)}function u(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):r>=3&&(d===null||Ie(d))?(e.exit("thematicBreak"),t(d)):n(d)}function h(d){return d===s?(e.consume(d),r++,h):(e.exit("thematicBreakSequence"),it(d)?ut(e,u,"whitespace")(d):u(d))}}const lr={continuation:{tokenize:MW},exit:AW,name:"list",tokenize:TW},EW={partial:!0,tokenize:DW},RW={partial:!0,tokenize:NW};function TW(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(b){const S=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:W_(b)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(of,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return n(b)}function h(b){return W_(b)&&++l<10?(e.consume(b),h):(!r.interrupt||l<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(rd,r.interrupt?n:m,e.attempt(EW,_,p))}function m(b){return r.containerState.initialBlankLine=!0,a++,_(b)}function p(b){return it(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),_):n(b)}function _(b){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function MW(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(rd,s,a);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ut(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!it(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(RW,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,ut(e,e.attempt(lr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function NW(e,t,n){const r=this;return ut(e,s,"listItemIndent",r.containerState.size+1);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function AW(e){e.exit(this.containerState.type)}function DW(e,t,n){const r=this;return ut(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!it(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const D2={name:"setextUnderline",resolveTo:OW,tokenize:LW};function OW(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function LW(e,t,n){const r=this;let s;return a;function a(d){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===s?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),it(d)?ut(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Ie(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const jW={tokenize:zW};function zW(e){const t=this,n=e.attempt(rd,r,e.attempt(this.parser.constructs.flowInitial,s,ut(e,e.attempt(this.parser.constructs.flow,s,e.attempt(F$,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const PW={resolveAll:JN()},BW=QN("string"),IW=QN("text");function QN(e){return{resolveAll:JN(e==="text"?HW:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,u);return l;function l(m){return d(m)?a(m):u(m)}function u(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),h}function h(m){return d(m)?(n.exit("data"),a(m)):(n.consume(m),h)}function d(m){if(m===null)return!0;const p=s[m];let _=-1;if(p)for(;++_<p.length;){const b=p[_];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function JN(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function HW(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,l=-1,u=0,h;for(;a--;){const d=s[a];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(d===-2)h=!0,u++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...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 FW={42:lr,43:lr,45:lr,48:lr,49:lr,50:lr,51:lr,52:lr,53:lr,54:lr,55:lr,56:lr,57:lr,62:VN},UW={91:q$},$W={[-2]:Mv,[-1]:Mv,32:Mv},WW={35:Q$,42:of,45:[D2,of],60:nW,61:D2,95:of,96:N2,126:N2},VW={38:KN,92:qN},qW={[-5]:Nv,[-4]:Nv,[-3]:Nv,33:bW,38:KN,42:V_,60:[S$,cW],91:SW,92:[X$,qN],93:p0,95:V_,96:j$},KW={null:[V_,PW]},GW={null:[42,95]},YW={null:[]},XW=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:GW,contentInitial:UW,disable:YW,document:FW,flow:WW,flowInitial:$W,insideSpan:KW,string:VW,text:qW},Symbol.toStringTag,{value:"Module"}));function ZW(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let l=[],u=[];const h={attempt:j(L),check:j(O),consume:T,enter:R,exit:M,interrupt:j(O,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:_,sliceStream:b,write:p};let m=t.tokenize.call(d,h);return t.resolveAll&&a.push(t),d;function p(H){return l=Kr(l,H),C(),l[l.length-1]!==null?[]:(F(t,0),d.events=Mp(a,d.events,d),d.events)}function _(H,B){return JW(b(H),B)}function b(H){return QW(l,H)}function S(){const{_bufferIndex:H,_index:B,line:U,column:$,offset:W}=r;return{_bufferIndex:H,_index:B,line:U,column:$,offset:W}}function w(H){s[H.line]=H.column,P()}function C(){let H;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<B.length;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(H){m=m(H)}function T(H){Ie(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,P()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=H}function R(H,B){const U=B||{};return U.type=H,U.start=S(),d.events.push(["enter",U,d]),u.push(U),U}function M(H){const B=u.pop();return B.end=S(),d.events.push(["exit",B,d]),B}function L(H,B){F(H,B.from)}function O(H,B){B.restore()}function j(H,B){return U;function U($,W,z){let q,V,X,N;return Array.isArray($)?Z($):"tokenize"in $?Z([$]):I($);function I(ae){return Q;function Q(ve){const ne=ve!==null&&ae[ve],de=ve!==null&&ae.null,we=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(de)?de:de?[de]:[]];return Z(we)(ve)}}function Z(ae){return q=ae,V=0,ae.length===0?z:D(ae[V])}function D(ae){return Q;function Q(ve){return N=G(),X=ae,ae.partial||(d.currentConstruct=ae),ae.name&&d.parser.constructs.disable.null.includes(ae.name)?pe():ae.tokenize.call(B?Object.assign(Object.create(d),B):d,h,ce,pe)(ve)}}function ce(ae){return H(X,N),W}function pe(ae){return N.restore(),++V<q.length?D(q[V]):z}}}function F(H,B){H.resolveAll&&!a.includes(H)&&a.push(H),H.resolve&&Rr(d.events,B,d.events.length-B,H.resolve(d.events.slice(B),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function G(){const H=S(),B=d.previous,U=d.currentConstruct,$=d.events.length,W=Array.from(u);return{from:$,restore:z};function z(){r=H,d.previous=B,d.currentConstruct=U,d.events.length=$,u=W,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function QW(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,a)];else{if(l=e.slice(n,s),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function JW(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
528
|
-
`;break}case-3:{l=`\r
|
|
529
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,r.push(l)}return r.join("")}function eV(e){const r={constructs:$N([XW,...(e||{}).extensions||[]]),content:s(m$),defined:[],document:s(v$),flow:s(jW),lazy:{},string:s(BW),text:s(IW)};return r;function s(a){return l;function l(u){return ZW(r,a,u)}}}function tV(e){for(;!GN(e););return e}const O2=/[\0\t\n\r]/g;function nV(){let e=1,t="",n=!0,r;return s;function s(a,l,u){const h=[];let d,m,p,_,b;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if(O2.lastIndex=p,d=O2.exec(a),_=d&&d.index!==void 0?d.index:a.length,b=a.charCodeAt(_),!d){t=a.slice(p);break}if(b===10&&p===_&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),p<_&&(h.push(a.slice(p,_)),e+=_-p),b){case 0:{h.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,h.push(-2);e++<m;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}p=_+1}return u&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const rV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iV(e){return e.replace(rV,sV)}function sV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return WN(n.slice(a?2:1),a?16:10)}return f0(n)||e}const eA={}.hasOwnProperty;function oV(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),aV(n)(tV(eV(n).document().write(nV()(e,t,!0))))}function aV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(_t),autolinkProtocol:G,autolinkEmail:G,atxHeading:a(yt),blockQuote:a(de),characterEscape:G,characterReference:G,codeFenced:a(we),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(we,l),codeText:a(Ce,l),codeTextData:G,data:G,codeFlowValue:G,definition:a(Re),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(ze),hardBreakEscape:a(dt),hardBreakTrailing:a(dt),htmlFlow:a(Ct,l),htmlFlowData:G,htmlText:a(Ct,l),htmlTextData:G,image:a(tn),label:l,link:a(_t),listItem:a(be),listItemValue:_,listOrdered:a(jt,p),listUnordered:a(jt),paragraph:a(Be),reference:D,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(yt),strong:a($t),thematicBreak:a(ct)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:ne,autolinkProtocol:ve,blockQuote:h(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ae,characterReference:Q,codeFenced:h(C),codeFencedFence:w,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:P,codeIndented:h(k),codeText:h(W),codeTextData:P,data:P,definition:h(),definitionDestinationString:M,definitionLabelString:T,definitionTitleString:R,emphasis:h(),hardBreakEscape:h(B),hardBreakTrailing:h(B),htmlFlow:h(U),htmlFlowData:P,htmlText:h($),htmlTextData:P,image:h(q),label:X,labelText:V,lineEnding:H,link:h(z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ce,resourceDestinationString:N,resourceTitleString:I,resource:Z,setextHeading:h(F),setextHeadingLineSequence:j,setextHeadingText:O,strong:h(),thematicBreak:h()}};tA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let ye={type:"root",children:[]};const Le={stack:[ye],tokenStack:[],config:t,enter:u,exit:d,buffer:l,resume:m,data:n},He=[];let Ye=-1;for(;++Ye<ue.length;)if(ue[Ye][1].type==="listOrdered"||ue[Ye][1].type==="listUnordered")if(ue[Ye][0]==="enter")He.push(Ye);else{const bt=He.pop();Ye=s(ue,bt,Ye)}for(Ye=-1;++Ye<ue.length;){const bt=t[ue[Ye][0]];eA.call(bt,ue[Ye][1].type)&&bt[ue[Ye][1].type].call(Object.assign({sliceSerialize:ue[Ye][2].sliceSerialize},Le),ue[Ye][1])}if(Le.tokenStack.length>0){const bt=Le.tokenStack[Le.tokenStack.length-1];(bt[1]||L2).call(Le,void 0,bt[0])}for(ye.position={start:Gs(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Gs(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<t.transforms.length;)ye=t.transforms[Ye](ye)||ye;return ye}function s(ue,ye,Le){let He=ye-1,Ye=-1,bt=!1,Pn,oe,Me,Xe;for(;++He<=Le;){const $e=ue[He];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?Ye++:Ye--,Xe=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(Pn&&!Xe&&!Ye&&!Me&&(Me=He),Xe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Xe=void 0}if(!Ye&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||Ye===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(Pn){let Dt=He;for(oe=void 0;Dt--;){const Wt=ue[Dt];if(Wt[1].type==="lineEnding"||Wt[1].type==="lineEndingBlank"){if(Wt[0]==="exit")continue;oe&&(ue[oe][1].type="lineEndingBlank",bt=!0),Wt[1].type="lineEnding",oe=Dt}else if(!(Wt[1].type==="linePrefix"||Wt[1].type==="blockQuotePrefix"||Wt[1].type==="blockQuotePrefixWhitespace"||Wt[1].type==="blockQuoteMarker"||Wt[1].type==="listItemIndent"))break}Me&&(!oe||Me<oe)&&(Pn._spread=!0),Pn.end=Object.assign({},oe?ue[oe][1].start:$e[1].end),ue.splice(oe||He,0,["exit",Pn,$e[2]]),He++,Le++}if($e[1].type==="listItemPrefix"){const Dt={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};Pn=Dt,ue.splice(He,0,["enter",Dt,$e[2]]),He++,Le++,Me=void 0,Xe=!0}}}return ue[ye][1]._spread=bt,Le}function a(ue,ye){return Le;function Le(He){u.call(this,ue(He),He),ye&&ye.call(this,He)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(ue,ye,Le){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([ye,Le||void 0]),ue.position={start:Gs(ye.start),end:void 0}}function h(ue){return ye;function ye(Le){ue&&ue.call(this,Le),d.call(this,Le)}}function d(ue,ye){const Le=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==ue.type&&(ye?ye.call(this,ue,He[0]):(He[1]||L2).call(this,ue,He[0]));else throw new Error("Cannot close `"+ue.type+"` ("+bu({start:ue.start,end:ue.end})+"): it’s not open");Le.position.end=Gs(ue.end)}function m(){return h0(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function _(ue){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ue}function S(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ue}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue.replace(/(\r?\n|\r)$/g,"")}function T(ue){const ye=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ye,Le.identifier=ai(this.sliceSerialize(ue)).toLowerCase()}function R(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ue}function M(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ue}function L(ue){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Le=this.sliceSerialize(ue).length;ye.depth=Le}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function j(ue){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ue){const Le=this.stack[this.stack.length-1].children;let He=Le[Le.length-1];(!He||He.type!=="text")&&(He=ie(),He.position={start:Gs(ue.start),end:void 0},Le.push(He)),this.stack.push(He)}function P(ue){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ue),ye.position.end=Gs(ue.end)}function H(ue){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=ye.children[ye.children.length-1];Le.position.end=Gs(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(G.call(this,ue),P.call(this,ue))}function B(){this.data.atHardBreak=!0}function U(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue}function $(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue}function W(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue}function z(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ye,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function q(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ye,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function V(ue){const ye=this.sliceSerialize(ue),Le=this.stack[this.stack.length-2];Le.label=iV(ye),Le.identifier=ai(ye).toLowerCase()}function X(){const ue=this.stack[this.stack.length-1],ye=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const He=ue.children;Le.children=He}else Le.alt=ye}function N(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ue}function I(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ue}function Z(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function ce(ue){const ye=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ye,Le.identifier=ai(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function pe(ue){this.data.characterReferenceType=ue.type}function ae(ue){const ye=this.sliceSerialize(ue),Le=this.data.characterReferenceType;let He;Le?(He=WN(ye,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=f0(ye);const Ye=this.stack[this.stack.length-1];Ye.value+=He}function Q(ue){const ye=this.stack.pop();ye.position.end=Gs(ue.end)}function ve(ue){P.call(this,ue);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ue)}function ne(ue){P.call(this,ue);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ue)}function de(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function Ce(){return{type:"inlineCode",value:""}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function yt(){return{type:"heading",depth:0,children:[]}}function dt(){return{type:"break"}}function Ct(){return{type:"html",value:""}}function tn(){return{type:"image",title:null,url:"",alt:null}}function _t(){return{type:"link",title:null,url:"",children:[]}}function jt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function be(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Be(){return{type:"paragraph",children:[]}}function $t(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function ct(){return{type:"thematicBreak"}}}function Gs(e){return{line:e.line,column:e.column,offset:e.offset}}function tA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?tA(e,r):lV(e,r)}}function lV(e,t){let n;for(n in t)if(eA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function L2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+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 cV(e){const t=this;t.parser=n;function n(r){return oV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uV(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 dV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
530
|
-
`}]}function hV(e,t){const n=t.value?t.value+`
|
|
531
|
-
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function fV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Wl(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const 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(l)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function gV(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 vV(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function nA(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function _V(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nA(e,t);const s={src:Wl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function yV(e,t){const n={src:Wl(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 bV(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 xV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nA(e,t);const s={href:Wl(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function SV(e,t){const n={href:Wl(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 wV(e,t,n){const r=e.all(t),s=n?CV(n):rA(t),a={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const m=r[u];(s||u!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
|
532
|
-
`}),m.type==="element"&&m.tagName==="p"&&!s?l.push(...m.children):l.push(m)}const h=r[r.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
|
533
|
-
`});const d={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,d),e.applyData(t,d)}function CV(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=rA(n[r])}return t}function rA(e){const t=e.spread;return t??e.children.length>1}function kV(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function EV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RV(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function TV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MV(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=l0(t.children[1]),h=zN(t.children[t.children.length-1]);u&&h&&(l.position={start:u,end:h}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function NV(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let h=-1;const d=[];for(;++h<u;){const p=t.children[h],_={},b=l?l[h]:void 0;b&&(_.align=b);let S={type:"element",tagName:a,properties:_,children:[]};p&&(S.children=e.all(p),e.patch(p,S),S=e.applyData(p,S)),d.push(S)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function AV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const j2=9,z2=32;function DV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(P2(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(P2(t.slice(s),s>0,!1)),a.join("")}function P2(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===j2||a===z2;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===j2||a===z2;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function OV(e,t){const n={type:"text",value:DV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function LV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const jV={blockquote:uV,break:dV,code:hV,delete:fV,emphasis:pV,footnoteReference:mV,heading:gV,html:vV,imageReference:_V,image:yV,inlineCode:bV,linkReference:xV,link:SV,listItem:wV,list:kV,paragraph:EV,root:RV,strong:TV,table:MV,tableCell:AV,tableRow:NV,text:OV,thematicBreak:LV,toml:zh,yaml:zh,definition:zh,footnoteDefinition:zh};function zh(){}const iA=-1,Np=0,Su=1,Ff=2,m0=3,g0=4,v0=5,_0=6,sA=7,oA=8,B2=typeof self=="object"?self:globalThis,zV=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case Np:case iA:return n(l,s);case Su:{const u=n([],s);for(const h of l)u.push(r(h));return u}case Ff:{const u=n({},s);for(const[h,d]of l)u[r(h)]=r(d);return u}case m0:return n(new Date(l),s);case g0:{const{source:u,flags:h}=l;return n(new RegExp(u,h),s)}case v0:{const u=n(new Map,s);for(const[h,d]of l)u.set(r(h),r(d));return u}case _0:{const u=n(new Set,s);for(const h of l)u.add(r(h));return u}case sA:{const{name:u,message:h}=l;return n(new B2[u](h),s)}case oA:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new B2[a](l),s)};return r},I2=e=>zV(new Map,e)(0),sl="",{toString:PV}={},{keys:BV}=Object,Kc=e=>{const t=typeof e;if(t!=="object"||!e)return[Np,t];const n=PV.call(e).slice(8,-1);switch(n){case"Array":return[Su,sl];case"Object":return[Ff,sl];case"Date":return[m0,sl];case"RegExp":return[g0,sl];case"Map":return[v0,sl];case"Set":return[_0,sl];case"DataView":return[Su,n]}return n.includes("Array")?[Su,n]:n.includes("Error")?[sA,n]:[Ff,n]},Ph=([e,t])=>e===Np&&(t==="function"||t==="symbol"),IV=(e,t,n,r)=>{const s=(l,u)=>{const h=r.push(l)-1;return n.set(u,h),h},a=l=>{if(n.has(l))return n.get(l);let[u,h]=Kc(l);switch(u){case Np:{let m=l;switch(h){case"bigint":u=oA,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);m=null;break;case"undefined":return s([iA],l)}return s([u,m],l)}case Su:{if(h){let _=l;return h==="DataView"?_=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(_=new Uint8Array(l)),s([h,[..._]],l)}const m=[],p=s([u,m],l);for(const _ of l)m.push(a(_));return p}case Ff:{if(h)switch(h){case"BigInt":return s([h,l.toString()],l);case"Boolean":case"Number":case"String":return s([h,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const m=[],p=s([u,m],l);for(const _ of BV(l))(e||!Ph(Kc(l[_])))&&m.push([a(_),a(l[_])]);return p}case m0:return s([u,l.toISOString()],l);case g0:{const{source:m,flags:p}=l;return s([u,{source:m,flags:p}],l)}case v0:{const m=[],p=s([u,m],l);for(const[_,b]of l)(e||!(Ph(Kc(_))||Ph(Kc(b))))&&m.push([a(_),a(b)]);return p}case _0:{const m=[],p=s([u,m],l);for(const _ of l)(e||!Ph(Kc(_)))&&m.push(a(_));return p}}const{message:d}=l;return s([u,{name:h,message:d}],l)};return a},H2=(e,{json:t,lossy:n}={})=>{const r=[];return IV(!(t||n),!!t,new Map,r)(e),r},Uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?I2(H2(e,t)):structuredClone(e):(e,t)=>I2(H2(e,t));function HV(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 FV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function UV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||HV,r=e.options.footnoteBackLabel||FV,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=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 m=e.all(d),p=String(d.identifier).toUpperCase(),_=Wl(p.toLowerCase());let b=0;const S=[],w=e.footnoteCounts.get(p);for(;w!==void 0&&++b<=w;){S.length>0&&S.push({type:"text",value:" "});let T=typeof n=="string"?n:n(h,b);typeof T=="string"&&(T={type:"text",value:T}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,b),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const C=m[m.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 m.push(...S);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(m,!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:a,properties:{...Uf(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
534
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
535
|
-
`}]}}const Ap=(function(e){if(e==null)return qV;if(typeof e=="function")return Dp(e);if(typeof e=="object")return Array.isArray(e)?$V(e):WV(e);if(typeof e=="string")return VV(e);throw new Error("Expected function, string, or object as test")});function $V(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ap(e[n]);return Dp(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function WV(e){const t=e;return Dp(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function VV(e){return Dp(t);function t(n){return n&&n.type===e}}function Dp(e){return t;function t(n,r,s){return!!(KV(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function qV(){return!0}function KV(e){return e!==null&&typeof e=="object"&&"type"in e}const aA=[],GV=!0,q_=!1,YV="skip";function lA(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=Ap(s),l=r?-1:1;u(e,void 0,[])();function u(h,d,m){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const b=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return _;function _(){let b=aA,S,w,C;if((!t||a(h,d,m[m.length-1]||void 0))&&(b=XV(n(h,m)),b[0]===q_))return b;if("children"in h&&h.children){const k=h;if(k.children&&b[0]!==YV)for(w=(r?k.children.length:-1)+l,C=m.concat(k);w>-1&&w<k.children.length;){const T=k.children[w];if(S=u(T,w,C)(),S[0]===q_)return S;w=typeof S[1]=="number"?S[1]:w+l}}return b}}}function XV(e){return Array.isArray(e)?e:typeof e=="number"?[GV,e]:e==null?aA:[e]}function y0(e,t,n,r){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=r),lA(e,a,u,s);function u(h,d){const m=d[d.length-1],p=m?m.children.indexOf(h):void 0;return l(h,p,m)}}const K_={}.hasOwnProperty,ZV={};function QV(e,t){const n=t||ZV,r=new Map,s=new Map,a=new Map,l={...jV,...n.handlers},u={all:d,applyData:eq,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:h,options:n,patch:JV,wrap:nq};return y0(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:s,_=String(m.identifier).toUpperCase();p.has(_)||p.set(_,m)}}),u;function h(m,p){const _=m.type,b=u.handlers[_];if(K_.call(u.handlers,_)&&b)return b(u,m,p);if(u.options.passThrough&&u.options.passThrough.includes(_)){if("children"in m){const{children:w,...C}=m,k=Uf(C);return k.children=u.all(m),k}return Uf(m)}return(u.options.unknownHandler||tq)(u,m,p)}function d(m){const p=[];if("children"in m){const _=m.children;let b=-1;for(;++b<_.length;){const S=u.one(_[b],m);if(S){if(b&&_[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=F2(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=F2(w.value))}Array.isArray(S)?p.push(...S):p.push(S)}}}return p}}function JV(e,t){e.position&&(t.position=FU(e))}function eq(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Uf(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function tq(e,t){const n=t.data||{},r="value"in t&&!(K_.call(n,"hProperties")||K_.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 nq(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
536
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
537
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
538
|
-
`}),n}function F2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function U2(e,t){const n=QV(e,t),r=n.one(e,void 0),s=UV(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
|
|
539
|
-
`},s),a}function rq(e,t){return e&&"run"in e?async function(n,r){const s=U2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return U2(n,{file:r,...e||t})}}function $2(e){if(e)throw e}var Av,W2;function iq(){if(W2)return Av;W2=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]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!p)return!1;var _;for(_ in d);return typeof _>"u"||e.call(d,_)},l=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},u=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return Av=function h(){var d,m,p,_,b,S,w=arguments[0],C=1,k=arguments.length,T=!1;for(typeof w=="boolean"&&(T=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<k;++C)if(d=arguments[C],d!=null)for(m in d)p=u(w,m),_=u(d,m),w!==_&&(T&&_&&(a(_)||(b=s(_)))?(b?(b=!1,S=p&&s(p)?p:[]):S=p&&a(p)?p:{},l(w,{name:m,newValue:h(T,S,_)})):typeof _<"u"&&l(w,{name:m,newValue:_}));return w},Av}var sq=iq();const Dv=tp(sq);function G_(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 oq(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(h,...d){const m=e[++a];let p=-1;if(h){l(h);return}for(;++p<s.length;)(d[p]===null||d[p]===void 0)&&(d[p]=s[p]);s=d,m?aq(m,u)(...d):l(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 aq(e,t){let n;return r;function r(...l){const u=e.length>l.length;let h;u&&l.push(s);try{h=e.apply(this,l)}catch(d){const m=d;if(u&&n)throw m;return s(m)}u||(h&&h.then&&typeof h.then=="function"?h.then(a,s):h instanceof Error?s(h):a(h))}function s(l,...u){n||(n=!0,t(l,...u))}function a(l){s(null,l)}}const Si={basename:lq,dirname:cq,extname:uq,join:dq,sep:"/"};function lq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');id(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function cq(e){if(id(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 uq(e){id(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function dq(...e){let t=-1,n;for(;++t<e.length;)id(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":hq(n)}function hq(e){id(e);const t=e.codePointAt(0)===47;let n=fq(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function fq(e,t){let n="",r=0,s=-1,a=0,l=-1,u,h;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",r=0):(n=n.slice(0,h),r=n.length-1-n.lastIndexOf("/")),s=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function id(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pq={cwd:mq};function mq(){return"/"}function Y_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function gq(e){if(typeof e=="string")e=new URL(e);else if(!Y_(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 vq(e)}function vq(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 Ov=["history","path","basename","stem","extname","dirname"];class cA{constructor(t){let n;t?Y_(t)?n={path:t}:typeof t=="string"||_q(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":pq.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ov.length;){const a=Ov[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)Ov.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Si.basename(this.path):void 0}set basename(t){jv(t,"basename"),Lv(t,"basename"),this.path=Si.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Si.dirname(this.path):void 0}set dirname(t){V2(this.basename,"dirname"),this.path=Si.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Si.extname(this.path):void 0}set extname(t){if(Lv(t,"extname"),V2(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=Si.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Y_(t)&&(t=gq(t)),jv(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Si.basename(this.path,this.extname):void 0}set stem(t){jv(t,"stem"),Lv(t,"stem"),this.path=Si.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 $n(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 Lv(e,t){if(e&&e.includes(Si.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Si.sep+"`")}function jv(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function V2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _q(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yq=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),bq={}.hasOwnProperty;class b0 extends yq{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=oq()}copy(){const t=new b0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Dv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Bv("data",this.frozen),this.namespace[t]=n,this):bq.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bv("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=Bh(t),r=this.parser||this.Parser;return zv("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),zv("process",this.parser||this.Parser),Pv("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const u=Bh(t),h=r.parse(u);r.run(h,u,function(m,p,_){if(m||!p||!_)return d(m);const b=p,S=r.stringify(b,_);wq(S)?_.value=S:_.result=S,d(m,_)});function d(m,p){m||!p?l(m):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),zv("processSync",this.parser||this.Parser),Pv("processSync",this.compiler||this.Compiler),this.process(t,s),K2("processSync","process",n),r;function s(a,l){n=!0,$2(a),r=l}}run(t,n,r){q2(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,u){const h=Bh(n);s.run(t,h,d);function d(m,p,_){const b=p||t;m?u(m):l?l(b):r(void 0,b,_)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),K2("runSync","run",r),s;function a(l,u){$2(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=Bh(n),s=this.compiler||this.Compiler;return Pv("stringify",s),q2(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Bv("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...p]=d;h(m,p)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(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=Dv(!0,s.settings,d.settings))}function u(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const p=d[m];a(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,m){let p=-1,_=-1;for(;++p<r.length;)if(r[p][0]===d){_=p;break}if(_===-1)r.push([d,...m]);else if(m.length>0){let[b,...S]=m;const w=r[_][1];G_(w)&&G_(b)&&(b=Dv(!0,w,b)),r[_]=[d,b,...S]}}}}const xq=new b0().freeze();function zv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Pv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bv(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 q2(e){if(!G_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function K2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Bh(e){return Sq(e)?e:new cA(e)}function Sq(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wq(e){return typeof e=="string"||Cq(e)}function Cq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kq="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",G2=[],Y2={allowDangerousHtml:!0},Eq=/^(https?|ircs?|mailto|xmpp)$/i,Rq=[{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 Vl(e){const t=Tq(e),n=Mq(e);return Nq(t.runSync(t.parse(n),n),e)}function Tq(e){const t=e.rehypePlugins||G2,n=e.remarkPlugins||G2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Y2}:Y2;return xq().use(cV).use(n).use(rq,r).use(t)}function Mq(e){const t=e.children||"",n=new cA;return typeof t=="string"&&(n.value=t),n}function Nq(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||Aq;for(const m of Rq)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+kq+m.id,void 0);return y0(e,d),qU(e,{Fragment:g.Fragment,components:s,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function d(m,p,_){if(m.type==="raw"&&_&&typeof p=="number")return l?_.children.splice(p,1):_.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let b;for(b in Tv)if(Object.hasOwn(Tv,b)&&Object.hasOwn(m.properties,b)){const S=m.properties[b],w=Tv[b];(w===null||w.includes(m.tagName))&&(m.properties[b]=h(String(S||""),b,m))}}if(m.type==="element"){let b=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!b&&r&&typeof p=="number"&&(b=!r(m,p,_)),b&&_&&typeof p=="number")return u&&m.children?_.children.splice(p,1,...m.children):_.children.splice(p,1),p}}}function Aq(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||Eq.test(e.slice(0,t))?e:""}function X2(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function Dq(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Oq(e,t,n){const s=Ap((n||{}).ignore||[]),a=Lq(t);let l=-1;for(;++l<a.length;)lA(e,"text",u);function u(d,m){let p=-1,_;for(;++p<m.length;){const b=m[p],S=_?_.children:void 0;if(s(b,S?S.indexOf(b):void 0,_))return;_=b}if(_)return h(d,m)}function h(d,m){const p=m[m.length-1],_=a[l][0],b=a[l][1];let S=0;const C=p.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:[...m,d]};let O=b(...R,L);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?_.lastIndex=M+1:(S!==M&&T.push({type:"text",value:d.value.slice(S,M)}),Array.isArray(O)?T.push(...O):O&&T.push(O),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)}),p.children.splice(C,1,...T)):T=[d],C+T.length}}function Lq(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([jq(s[0]),zq(s[1])])}return t}function jq(e){return typeof e=="string"?new RegExp(Dq(e),"g"):e}function zq(e){return typeof e=="function"?e:function(){return e}}const Iv="phrasing",Hv=["autolink","link","image","label"];function Pq(){return{transforms:[Wq],enter:{literalAutolink:Iq,literalAutolinkEmail:Fv,literalAutolinkHttp:Fv,literalAutolinkWww:Fv},exit:{literalAutolink:$q,literalAutolinkEmail:Uq,literalAutolinkHttp:Hq,literalAutolinkWww:Fq}}}function Bq(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Iv,notInConstruct:Hv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Iv,notInConstruct:Hv},{character:":",before:"[ps]",after:"\\/",inConstruct:Iv,notInConstruct:Hv}]}}function Iq(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Fv(e){this.config.enter.autolinkProtocol.call(this,e)}function Hq(e){this.config.exit.autolinkProtocol.call(this,e)}function Fq(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 Uq(e){this.config.exit.autolinkEmail.call(this,e)}function $q(e){this.exit(e)}function Wq(e){Oq(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Vq],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),qq]],{ignore:["link","linkReference"]})}function Vq(e,t,n,r,s){let a="";if(!uA(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!Kq(n)))return!1;const l=Gq(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function qq(e,t,n,r){return!uA(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Kq(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 Gq(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=X2(e,"(");let a=X2(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function uA(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ea(n)||Tp(n))&&(!t||n!==47)}dA.peek=rK;function Yq(){this.buffer()}function Xq(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Zq(){this.buffer()}function Qq(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Jq(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eK(e){this.exit(e)}function tK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nK(e){this.exit(e)}function rK(){return"["}function dA(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),l(),a+=s.move("]"),a}function iK(){return{enter:{gfmFootnoteCallString:Yq,gfmFootnoteCall:Xq,gfmFootnoteDefinitionLabelString:Zq,gfmFootnoteDefinition:Qq},exit:{gfmFootnoteCallString:Jq,gfmFootnoteCall:eK,gfmFootnoteDefinitionLabelString:tK,gfmFootnoteDefinition:nK}}}function sK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:dA},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const u=a.createTracker(l);let h=u.move("[^");const d=a.enter("footnoteDefinition"),m=a.enter("label");return h+=u.move(a.safe(a.associationId(r),{before:h,after:"]"})),m(),h+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),h+=u.move((t?`
|
|
540
|
-
`:" ")+a.indentLines(a.containerFlow(r,u.current()),t?hA:oK))),d(),h}}function oK(e,t,n){return t===0?e:hA(e,t,n)}function hA(e,t,n){return(n?"":" ")+e}const aK=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fA.peek=hK;function lK(){return{canContainEols:["delete"],enter:{strikethrough:uK},exit:{strikethrough:dK}}}function cK(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:aK}],handlers:{delete:fA}}}function uK(e){this.enter({type:"delete",children:[]},e)}function dK(e){this.exit(e)}function fA(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function hK(){return"~"}function fK(e){return e.length}function pK(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||fK,a=[],l=[],u=[],h=[];let d=0,m=-1;for(;++m<e.length;){const w=[],C=[];let k=-1;for(e[m].length>d&&(d=e[m].length);++k<e[m].length;){const T=mK(e[m][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)}l[m]=w,u[m]=C}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)a[p]=Z2(r[p]);else{const w=Z2(r);for(;++p<d;)a[p]=w}p=-1;const _=[],b=[];for(;++p<d;){const w=a[p];let C="",k="";w===99?(C=":",k=":"):w===108?C=":":w===114&&(k=":");let T=n.alignDelimiters===!1?1:Math.max(1,h[p]-C.length-k.length);const R=C+"-".repeat(T)+k;n.alignDelimiters!==!1&&(T=C.length+T+k.length,T>h[p]&&(h[p]=T),b[p]=T),_[p]=R}l.splice(1,0,_),u.splice(1,0,b),m=-1;const S=[];for(;++m<l.length;){const w=l[m],C=u[m];p=-1;const k=[];for(;++p<d;){const T=w[p]||"";let R="",M="";if(n.alignDelimiters!==!1){const L=h[p]-(C[p]||0),O=a[p];O===114?R=" ".repeat(L):O===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&&!p&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||p)&&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||p!==d-1)&&k.push("|")}S.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return S.join(`
|
|
541
|
-
`)}function mK(e){return e==null?"":String(e)}function Z2(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function gK(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),vK);return s(),l}function vK(e,t,n){return">"+(n?"":" ")+e}function _K(e,t){return Q2(e,t.inConstruct,!0)&&!Q2(e,t.notInConstruct,!1)}function Q2(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function J2(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
542
|
-
`&&_K(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
543
|
-
`}function yK(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>l&&(l=a):a=1,s=r+t.length,r=n.indexOf(t,s);return l}function bK(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 xK(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 SK(e,t,n,r){const s=xK(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(bK(e,n)){const p=n.enter("codeIndented"),_=n.indentLines(a,wK);return p(),_}const u=n.createTracker(r),h=s.repeat(Math.max(yK(a,s)+1,3)),d=n.enter("codeFenced");let m=u.move(h);if(e.lang){const p=n.enter(`codeFencedLang${l}`);m+=u.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);m+=u.move(" "),m+=u.move(n.safe(e.meta,{before:m,after:`
|
|
544
|
-
`,encode:["`"],...u.current()})),p()}return m+=u.move(`
|
|
545
|
-
`),a&&(m+=u.move(a+`
|
|
546
|
-
`)),m+=u.move(h),d(),m}function wK(e,t,n){return(n?"":" ")+e}function x0(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 CK(e,t,n,r){const s=x0(n),a=s==='"'?"Quote":"Apostrophe",l=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?" ":`
|
|
547
|
-
`,...h.current()}))),u(),e.title&&(u=n.enter(`title${a}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),l(),d}function kK(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 Pu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $f(e,t,n){const r=Rl(e),s=Rl(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}}pA.peek=EK;function pA(e,t,n,r){const s=kK(n),a=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s);let h=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const d=h.charCodeAt(0),m=$f(r.before.charCodeAt(r.before.length-1),d,s);m.inside&&(h=Pu(d)+h.slice(1));const p=h.charCodeAt(h.length-1),_=$f(r.after.charCodeAt(0),p,s);_.inside&&(h=h.slice(0,-1)+Pu(p));const b=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:m.outside},u+h+b}function EK(e,t,n){return n.options.emphasis||"*"}function RK(e,t){let n=!1;return y0(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,q_}),!!((!e.depth||e.depth<3)&&h0(e)&&(t.options.setext||n))}function TK(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(RK(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),_=n.containerPhrasing(e,{...a.current(),before:`
|
|
548
|
-
`,after:`
|
|
549
|
-
`});return p(),m(),_+`
|
|
550
|
-
`+(s===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(`
|
|
551
|
-
`))+1))}const l="#".repeat(s),u=n.enter("headingAtx"),h=n.enter("phrasing");a.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
552
|
-
`,...a.current()});return/^[\t ]/.test(d)&&(d=Pu(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),h(),u(),d}mA.peek=MK;function mA(e){return e.value||""}function MK(){return"<"}gA.peek=NK;function gA(e,t,n,r){const s=x0(n),a=s==='"'?"Quote":"Apostrophe",l=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${a}`),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(")"),l(),d}function NK(){return"!"}vA.peek=AK;function vA(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=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+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return l(),n.stack=m,a(),s==="full"||!d||d!==p?h+=u.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function AK(){return"!"}_A.peek=DK;function _A(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],u=n.compilePattern(l);let h;if(l.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 DK(){return"`"}function yA(e,t){const n=h0(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))}bA.peek=OK;function bA(e,t,n,r){const s=x0(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,h;if(yA(e,n)){const m=n.stack;n.stack=[],u=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),u(),n.stack=m,p}u=n.enter("link"),h=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(h=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),h(),e.title&&(h=n.enter(`title${a}`),d+=l.move(" "+s),d+=l.move(n.safe(e.title,{before:d,after:s,...l.current()})),d+=l.move(s),h()),d+=l.move(")"),u(),d}function OK(e,t,n){return yA(e,n)?"<":"["}xA.peek=LK;function xA(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=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+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return l(),n.stack=m,a(),s==="full"||!d||d!==p?h+=u.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function LK(){return"["}function S0(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 jK(e){const t=S0(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 zK(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 SA(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 PK(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?zK(n):S0(n);const u=e.ordered?l==="."?")":".":jK(n);let h=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.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),SA(n)===l&&m){let p=-1;for(;++p<e.children.length;){const _=e.children[p];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(l=u),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),d}function BK(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 IK(e,t,n,r){const s=BK(n);let a=n.bulletCurrent||S0(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(l-a.length)),u.shift(l);const h=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),m);return h(),d;function m(p,_,b){return _?(b?"":" ".repeat(l))+p:(b?a:a+" ".repeat(l-a.length))+p}}function HK(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const FK=Ap(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function UK(e,t,n,r){return(e.children.some(function(l){return FK(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function $K(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wA.peek=WK;function wA(e,t,n,r){const s=$K(n),a=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s);let h=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const d=h.charCodeAt(0),m=$f(r.before.charCodeAt(r.before.length-1),d,s);m.inside&&(h=Pu(d)+h.slice(1));const p=h.charCodeAt(h.length-1),_=$f(r.after.charCodeAt(0),p,s);_.inside&&(h=h.slice(0,-1)+Pu(p));const b=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:m.outside},u+h+b}function WK(e,t,n){return n.options.strong||"*"}function VK(e,t,n,r){return n.safe(e.value,r)}function qK(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 KK(e,t,n){const r=(SA(n)+(n.options.ruleSpaces?" ":"")).repeat(qK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const CA={blockquote:gK,break:J2,code:SK,definition:CK,emphasis:pA,hardBreak:J2,heading:TK,html:mA,image:gA,imageReference:vA,inlineCode:_A,link:bA,linkReference:xA,list:PK,listItem:IK,paragraph:HK,root:UK,strong:wA,text:VK,thematicBreak:KK};function GK(){return{enter:{table:YK,tableData:ek,tableHeader:ek,tableRow:ZK},exit:{codeText:QK,table:XK,tableData:Uv,tableHeader:Uv,tableRow:Uv}}}function YK(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 XK(e){this.exit(e),this.data.inTable=void 0}function ZK(e){this.enter({type:"tableRow",children:[]},e)}function Uv(e){this.exit(e)}function ek(e){this.enter({type:"tableCell",children:[]},e)}function QK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,JK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function JK(e,t){return t==="|"?t:e}function eG(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
553
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:l,tableCell:h,tableRow:u}};function l(b,S,w,C){return d(m(b,w,C),b.align)}function u(b,S,w,C){const k=p(b,w,C),T=d([k]);return T.slice(0,T.indexOf(`
|
|
554
|
-
`))}function h(b,S,w,C){const k=w.enter("tableCell"),T=w.enter("phrasing"),R=w.containerPhrasing(b,{...C,before:a,after:a});return T(),k(),R}function d(b,S){return pK(b,{align:S,alignDelimiters:r,padding:n,stringLength:s})}function m(b,S,w){const C=b.children;let k=-1;const T=[],R=S.enter("table");for(;++k<C.length;)T[k]=p(C[k],S,w);return R(),T}function p(b,S,w){const C=b.children;let k=-1;const T=[],R=S.enter("tableRow");for(;++k<C.length;)T[k]=h(C[k],b,S,w);return R(),T}function _(b,S,w){let C=CA.inlineCode(b,S,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function tG(){return{exit:{taskListCheckValueChecked:tk,taskListCheckValueUnchecked:tk,paragraph:rG}}}function nG(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:iG}}}function tk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function rG(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,l;for(;++a<s.length;){const u=s[a];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function iG(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(l);let h=CA.listItem(e,t,n,{...r,...u.current()});return a&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(m){return m+l}}function sG(){return[Pq(),iK(),lK(),GK(),tG()]}function oG(e){return{extensions:[Bq(),sK(e),cK(),eG(e),nG()]}}const aG={tokenize:fG,partial:!0},kA={tokenize:pG,partial:!0},EA={tokenize:mG,partial:!0},RA={tokenize:gG,partial:!0},lG={tokenize:vG,partial:!0},TA={name:"wwwAutolink",tokenize:dG,previous:NA},MA={name:"protocolAutolink",tokenize:hG,previous:AA},ys={name:"emailAutolink",tokenize:uG,previous:DA},zi={};function cG(){return{text:zi}}let Io=48;for(;Io<123;)zi[Io]=ys,Io++,Io===58?Io=65:Io===91&&(Io=97);zi[43]=ys;zi[45]=ys;zi[46]=ys;zi[95]=ys;zi[72]=[ys,MA];zi[104]=[ys,MA];zi[87]=[ys,TA];zi[119]=[ys,TA];function uG(e,t,n){const r=this;let s,a;return l;function l(p){return!X_(p)||!DA.call(r,r.previous)||w0(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return X_(p)?(e.consume(p),u):p===64?(e.consume(p),h):n(p)}function h(p){return p===46?e.check(lG,m,d)(p):p===45||p===95||Fn(p)?(a=!0,e.consume(p),h):m(p)}function d(p){return e.consume(p),s=!0,h}function m(p){return a&&s&&Yn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function dG(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!NA.call(r,r.previous)||w0(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(aG,e.attempt(kA,e.attempt(EA,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function hG(e,t,n){const r=this;let s="",a=!1;return l;function l(p){return(p===72||p===104)&&AA.call(r,r.previous)&&!w0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(Yn(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const _=s.toLowerCase();if(_==="http"||_==="https")return e.consume(p),h}return n(p)}function h(p){return p===47?(e.consume(p),a?d:(a=!0,h)):n(p)}function d(p){return p===null||Hf(p)||At(p)||ea(p)||Tp(p)?n(p):e.attempt(kA,e.attempt(EA,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function fG(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function pG(e,t,n){let r,s,a;return l;function l(d){return d===46||d===95?e.check(RA,h,u)(d):d===null||At(d)||ea(d)||d!==45&&Tp(d)?h(d):(a=!0,e.consume(d),l)}function u(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),l}function h(d){return s||r||!a?n(d):t(d)}}function mG(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(RA,t,a)(l):l===null||At(l)||ea(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function gG(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),a):u===93?(e.consume(u),s):u===60||u===null||At(u)||ea(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||At(u)||ea(u)?t(u):r(u)}function a(u){return Yn(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):Yn(u)?(e.consume(u),l):n(u)}}function vG(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return Fn(a)?n(a):t(a)}}function NA(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||At(e)}function AA(e){return!Yn(e)}function DA(e){return!(e===47||X_(e))}function X_(e){return e===43||e===45||e===46||e===95||Fn(e)}function w0(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 _G={tokenize:EG,partial:!0};function yG(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:wG,continuation:{tokenize:CG},exit:kG}},text:{91:{name:"gfmFootnoteCall",tokenize:SG},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:bG,resolveTo:xG}}}}function bG(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const h=r.events[s][1];if(h.type==="labelImage"){l=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(!l||!l._balanced)return n(h);const d=ai(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function xG(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function SG(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(a>999||p===93&&!l||p===null||p===91||At(p))return n(p);if(p===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return s.includes(ai(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return At(p)||(l=!0),a++,e.consume(p),p===92?m:d}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function wG(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=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",m):n(S)}function m(S){if(l>999||S===93&&!u||S===null||S===91||At(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=ai(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return At(S)||(u=!0),l++,e.consume(S),S===92?p:m}function p(S){return S===91||S===92||S===93?(e.consume(S),l++,m):m(S)}function _(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(a)||s.push(a),ut(e,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return t(S)}}function CG(e,t,n){return e.check(rd,t,e.attempt(_G,t,n))}function kG(e){e.exit("gfmFootnoteDefinition")}function EG(e,t,n){const r=this;return ut(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function RG(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,u){let h=-1;for(;++h<l.length;)if(l[h][0]==="enter"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._close){let d=h;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[h][1].end.offset-l[h][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[h][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[h][1].end)},p={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[h][1].start)},_=[["enter",m,u],["enter",l[d][1],u],["exit",l[d][1],u],["enter",p,u]],b=u.parser.constructs.insideSpan.null;b&&Rr(_,_.length,0,Mp(b,l.slice(d+1,h),u)),Rr(_,_.length,0,[["exit",p,u],["enter",l[h][1],u],["exit",l[h][1],u],["exit",m,u]]),Rr(l,d-1,h-d+3,_),h=d+_.length-2;break}}for(h=-1;++h<l.length;)l[h][1].type==="strikethroughSequenceTemporary"&&(l[h][1].type="data");return l}function a(l,u,h){const d=this.previous,m=this.events;let p=0;return _;function _(S){return d===126&&m[m.length-1][1].type!=="characterEscape"?h(S):(l.enter("strikethroughSequenceTemporary"),b(S))}function b(S){const w=Rl(d);if(S===126)return p>1?h(S):(l.consume(S),p++,b);if(p<2&&!n)return h(S);const C=l.exit("strikethroughSequenceTemporary"),k=Rl(S);return C._open=!k||k===2&&!!w,C._close=!w||w===2&&!!k,u(S)}}}class TG{constructor(){this.map=[]}add(t,n,r){MG(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function MG(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 NG(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function AG(){return{flow:{null:{name:"table",tokenize:DG,resolveAll:OG}}}}function DG(e,t,n){const r=this;let s=0,a=0,l;return u;function u(P){let H=r.events.length-1;for(;H>-1;){const $=r.events[H][1].type;if($==="lineEnding"||$==="linePrefix")H--;else break}const B=H>-1?r.events[H][1].type:null,U=B==="tableHead"||B==="tableRow"?O:h;return U===O&&r.parser.lazy[r.now().line]?n(P):U(P)}function h(P){return e.enter("tableHead"),e.enter("tableRow"),d(P)}function d(P){return P===124||(l=!0,a+=1),m(P)}function m(P){return P===null?n(P):Ie(P)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),b):n(P):it(P)?ut(e,m,"whitespace")(P):(a+=1,l&&(l=!1,s+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),p(P)))}function p(P){return P===null||P===124||At(P)?(e.exit("data"),m(P)):(e.consume(P),P===92?_:p)}function _(P){return P===92||P===124?(e.consume(P),p):p(P)}function b(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),l=!1,it(P)?ut(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):S(P))}function S(P){return P===45||P===58?C(P):P===124?(l=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),w):L(P)}function w(P){return it(P)?ut(e,C,"whitespace")(P):C(P)}function C(P){return P===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),k):P===45?(a+=1,k(P)):P===null||Ie(P)?M(P):L(P)}function k(P){return P===45?(e.enter("tableDelimiterFiller"),T(P)):L(P)}function T(P){return P===45?(e.consume(P),T):P===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(P))}function R(P){return it(P)?ut(e,M,"whitespace")(P):M(P)}function M(P){return P===124?S(P):P===null||Ie(P)?!l||s!==a?L(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):L(P)}function L(P){return n(P)}function O(P){return e.enter("tableRow"),j(P)}function j(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),j):P===null||Ie(P)?(e.exit("tableRow"),t(P)):it(P)?ut(e,j,"whitespace")(P):(e.enter("data"),F(P))}function F(P){return P===null||P===124||At(P)?(e.exit("data"),j(P)):(e.consume(P),P===92?G:F)}function G(P){return P===92||P===124?(e.consume(P),F):F(P)}}function OG(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,h=0,d,m,p;const _=new TG;for(;++n<e.length;){const b=e[n],S=b[1];b[0]==="enter"?S.type==="tableHead"?(u=!1,h!==0&&(nk(_,t,h,d,m),m=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,p=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,m={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",m,t]])),s=S.type==="tableDelimiterRow"?2:m?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],p=Ih(_,t,a,s,void 0,p),a=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],p=Ih(_,t,a,s,void 0,p)),a=l,l=[a[1],n,0,0])):S.type==="tableHead"?(u=!0,h=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=n,a[1]!==0?(l[0]=l[1],p=Ih(_,t,a,s,n,p)):l[1]!==0&&(p=Ih(_,t,l,s,n,p)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(h!==0&&nk(_,t,h,d,m),_.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=NG(t.events,n))}return e}function Ih(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},dl(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const h=dl(t.events,n[1]);if(a={type:l,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const d=dl(t.events,n[2]),m=dl(t.events,n[3]),p={type:u,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const _=t.events[n[2]],b=t.events[n[3]];if(_[1].end=Object.assign({},b[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,w=n[3]-n[2]-1;e.add(S,w,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(a.end=Object.assign({},dl(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function nk(e,t,n,r,s){const a=[],l=dl(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function dl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const LG={name:"tasklistCheck",tokenize:zG};function jG(){return{text:{91:LG}}}function zG(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"),a)}function a(h){return At(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),l):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),l):n(h)}function l(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(h)}function u(h){return Ie(h)?t(h):it(h)?e.check({tokenize:PG},t,n)(h):n(h)}}function PG(e,t,n){return ut(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function BG(e){return $N([cG(),yG(),RG(e),AG(),jG()])}const IG={};function ql(e){const t=this,n=e||IG,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(BG(n)),a.push(sG()),l.push(oG(n))}function rk(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function HG(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:rk(n.groups.line),column:rk(n.groups.column)}:{path:t}}function $v(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 C0=()=>{},OA=y.createContext(C0);function FG({children:e,onOpenLocalLink:t}){return g.jsx(OA.Provider,{value:t??C0,children:e})}const Z_={Task:Cf,TaskOutput:Cf,Bash:vb,Glob:vv,Grep:vv,ExitPlanMode:NC,Read:hT,Edit:AP,Write:OP,NotebookEdit:gT,WebFetch:L6,TodoWrite:X6,WebSearch:vv,KillShell:BB,AskUserQuestion:pT,Skill:OB,EnterPlanMode:NC},LA=$B;function jA(e){return Z_[e]?Z_[e]:LA}function vo({children:e,className:t}){return g.jsx("div",{className:_e("flex gap-3 justify-start items-center",t),children:e})}function UG({children:e,className:t}){return g.jsx("div",{className:_e("flex items-center gap-1.5 text-xs",t),children:e})}function ho({children:e,className:t}){return g.jsx("span",{className:_e("font-medium text-foreground/80",t),children:e})}function $G({children:e}){return g.jsx("span",{className:"text-muted-foreground",children:e})}function Op({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,s]=y.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(fs,{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 ik({label:e,children:t,copyText:n}){const[r,s]=y.useState(!1),a=n??Wf(t),l=y.useCallback(async()=>{await navigator.clipboard.writeText(a),s(!0),setTimeout(()=>s(!1),2e3)},[a]);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(tt,{variant:"ghost",size:"icon",className:_e("absolute top-[4px] right-[4px] z-10 h-6.5 w-6.5 rounded-sm text-muted-foreground opacity-0 group-hover/codeblock:opacity-100 transition-opacity",!r&&"hover:text-foreground",r&&"hover:!bg-transparent hover:!border-transparent"),onClick:l,children:r?g.jsx(lo,{className:"h-3.5 w-3.5 text-green-400"}):g.jsx(cp,{className:"h-4 w-4"})})]})]})}function zA({children:e,icon:t,className:n}){return g.jsxs("span",{className:_e("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 Lp({children:e,className:t}){return g.jsxs("div",{className:_e("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 sk(e,t){return y.isValidElement(e)?y.cloneElement(e,{className:_e(e.props.className,t)}):e}const k0={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]=y.useState(!1),s=Wf(e),a=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(tt,{variant:"ghost",size:"icon",className:_e("absolute top-[35px] -translate-y-[50%] -translate-x-[1px] rounded-md right-1.5 h-8 w-8 text-muted-foreground opacity-0 group-hover/pre:opacity-100 transition-opacity",!n&&"hover:text-foreground",n&&"hover:!bg-transparent hover:!border-transparent"),onClick:a,children:n?g.jsx(lo,{className:"h-4 w-4 text-green-400"}):g.jsx(cp,{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=y.Children.toArray(e),r=n[0];r!==void 0&&(n[0]=sk(r,"mt-0"));const s=n.length-1,a=n[s];return a!==void 0&&(n[s]=sk(a,"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 sd(e){return{...k0,a:({children:t,href:n,onClick:r,...s})=>{const a=y.useContext(OA),l=HG(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:l?void 0:"_blank",rel:l?void 0:"noopener noreferrer",onClick:u=>{r==null||r(u),!(u.defaultPrevented||!l||a===C0)&&(u.preventDefault(),a(l))},...s,children:t})}}}({...k0});function WG(e){const t=e.split(`
|
|
555
|
-
`),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 VG(e){return e.replace(/<[^>]+>/g,"")}function qG(e,t){const n=e.split(`
|
|
556
|
-
`),r=t.split(`
|
|
557
|
-
`),s=KG(n,r),a=GG(n,r,s);return YG(a)}function KG(e,t){const n=e.length,r=t.length,s=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=1;a<=n;a++)for(let l=1;l<=r;l++)s[a][l]=e[a-1]===t[l-1]?s[a-1][l-1]+1:Math.max(s[a-1][l],s[a][l-1]);return s}function GG(e,t,n){const r=[];let s=e.length,a=t.length;for(;s>0||a>0;)s>0&&a>0&&e[s-1]===t[a-1]?(r.push({type:"context",text:e[s-1],oldIdx:s,newIdx:a}),s--,a--):a>0&&(s===0||n[s][a-1]>=n[s-1][a])?(r.push({type:"added",text:t[a-1],oldIdx:s,newIdx:a}),a--):(r.push({type:"removed",text:e[s-1],oldIdx:s,newIdx:a}),s--);return r.reverse()}function YG(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function af({content:e,isDiff:t=!1,oldString:n,newString:r}){const s=y.useMemo(()=>t&&n!==void 0&&r!==void 0?qG(n,r):[],[t,n,r]),a=y.useMemo(()=>t?[]:WG(e),[e,t]),l=y.useMemo(()=>a.some(u=>u.lineNumber!==null),[a]);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":"",m=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 ${m}`,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:a.map((u,h)=>g.jsxs("tr",{children:[l&&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:VG(u.content)})]},h))})})})})}function PA({attachment:e,onOpenChange:t}){const[n,r]=y.useState({}),s=y.useMemo(()=>e?i0(e):null,[e]),a=e?n[e.id]:void 0,l=e!=null&&e.contentUrl?ZG(e.contentUrl):"";y.useEffect(()=>{if(!e||!s||s.openInNewTab||s.kind==="image"||s.kind==="pdf"||s.kind==="external")return;const d=s.kind;if((a==null?void 0:a.status)==="loading"||(a==null?void 0:a.status)==="ready")return;let m=!1;return r(p=>({...p,[e.id]:{status:"loading"}})),dU(e.contentUrl,sU).then(({content:p,truncated:_})=>{if(m)return;if(d==="table"){const S=e.mimeType==="text/tab-separated-values"?" ":",";r(w=>({...w,[e.id]:{status:"ready",kind:"table",truncated:_,table:fU(p,S)}}));return}const b=d==="json"?hU(p):p;r(S=>({...S,[e.id]:{status:"ready",kind:d,content:b,truncated:_}}))}).catch(p=>{if(m)return;const _=p instanceof Error?p.message:"Unable to load preview.";r(b=>({...b,[e.id]:{status:"error",message:_}}))}),()=>{m=!0}},[e==null?void 0:e.id,e==null?void 0:e.contentUrl,e==null?void 0:e.mimeType,s==null?void 0:s.kind,s==null?void 0:s.openInNewTab]);async function u(){var d;!l||typeof navigator>"u"||!((d=navigator.clipboard)!=null&&d.writeText)||await navigator.clipboard.writeText(l)}function h(){!l||typeof window>"u"||window.open(l,"_blank","noopener,noreferrer")}return g.jsx(bb,{open:e!==null&&!(s!=null&&s.openInNewTab),onOpenChange:t,children:g.jsx(up,{size:"lg",className:"max-w-[min(92vw,960px)] overflow-hidden p-0",children:e&&s&&!s.openInNewTab?g.jsxs(g.Fragment,{children:[g.jsx(t8,{className:"pr-12",children:g.jsx(xb,{className:"text-md",children:e.displayName})}),g.jsx(Sb,{className:"bg-muted/20 p-4",children:XG(e,s.kind,a)}),g.jsxs(wb,{className:"items-center justify-between gap-3 px-4 py-3",children:[g.jsxs(bT,{className:"truncate",children:[e.mimeType," · ",s0(e.size)]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(n8,{type:"button",onClick:u,children:[g.jsx(YP,{className:"mr-2 h-4 w-4"}),"Copy Link"]}),g.jsxs(tt,{type:"button",variant:"outline",onClick:h,children:[g.jsx(bP,{className:"mr-2 h-4 w-4"}),"Open In New Tab"]})]})]})]}):null})})}function XG(e,t,n){if(t==="image")return g.jsx("div",{className:"flex items-center justify-center",children:g.jsx("img",{src:e.contentUrl,alt:e.displayName,className:"max-h-[70vh] w-auto max-w-full rounded-2xl object-contain"})});if(t==="pdf")return g.jsx("iframe",{src:e.contentUrl,title:e.displayName,className:"h-[70vh] w-full rounded-xl border border-border bg-background"});if(!n||n.status==="loading")return g.jsx("div",{className:"flex h-[50vh] items-center justify-center text-sm text-muted-foreground",children:"Loading preview…"});if(n.status==="error")return g.jsx("div",{className:"flex h-[50vh] items-center justify-center text-sm text-destructive",children:n.message});if(n.kind==="markdown"&&n.content!==void 0)return g.jsxs("div",{className:"space-y-3",children:[n.truncated?g.jsx(Wv,{message:"Preview truncated to 1024 KB."}):null,g.jsx("div",{className:"prose prose-sm max-w-none overflow-auto rounded-xl border border-border bg-background p-4 prose-invert",children:g.jsx(Vl,{remarkPlugins:[ql],components:sd(),children:n.content})})]});if(n.kind==="table"&&n.table){const r=n.table.rows.length>0,[s,...a]=n.table.rows,l=[n.truncated?"Preview truncated to 1024 KB.":null,n.table.truncatedRows?`Showing first ${n.table.rows.length} of ${n.table.rowCount} rows.`:null,n.table.truncatedColumns?`Showing first ${I_} of ${n.table.columnCount} columns.`:null].filter(Boolean);return g.jsxs("div",{className:"space-y-3",children:[l.length>0?g.jsx(Wv,{message:l.join(" ")}):null,g.jsx("div",{className:"max-h-[70vh] overflow-auto rounded-xl border border-border bg-background",children:g.jsxs("table",{className:"min-w-full border-collapse text-xs",children:[r?g.jsx("thead",{className:"sticky top-0 bg-muted",children:g.jsx("tr",{children:s.map((u,h)=>g.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-foreground",children:u||" "},`${u}-${h}`))})}):null,g.jsx("tbody",{children:(r?a:n.table.rows).map((u,h)=>g.jsx("tr",{className:"odd:bg-background even:bg-muted/20",children:u.map((d,m)=>g.jsx("td",{className:"max-w-[320px] border-b border-border px-3 py-2 align-top text-foreground",children:g.jsx("div",{className:"whitespace-pre-wrap break-words",children:d||" "})},`${h}-${m}`))},h))})]})})]})}return g.jsxs("div",{className:"space-y-3",children:[n.truncated?g.jsx(Wv,{message:"Preview truncated to 1024 KB."}):null,g.jsx(af,{content:n.content??""})]})}function Wv({message:e}){return g.jsx("div",{className:"rounded-xl border border-border bg-background px-3 py-2 text-sm text-muted-foreground",children:e})}function ZG(e){return typeof window>"u"?e:new URL(e,window.location.origin).toString()}const BA=10,QG=3;function JG(e){const t=e.maxAttachments??BA;return e.currentAttachmentCount+e.queuedAttachmentCount+e.incomingAttachmentCount>t}function ok(e,t){return e.provider!=="claude"?{...e,model:t}:{...e,model:t,modelOptions:{...e.modelOptions,contextWindow:uN(t,e.modelOptions.contextWindow)}}}function ak(e,t){if(t===void 0){console.info(`[ChatInput] ${e}`);return}console.info(`[ChatInput] ${e}`,t)}function su(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 eY(e){if(!e.providerLocked)return{composerPlanMode:e.planMode,lockedComposerState:e.lockedComposerState};const t=e.lockedComposerState??su(e.selectedProvider,e.composerState,e.providerDefaults);return{composerPlanMode:e.composerState.planMode,lockedComposerState:{...t,planMode:e.planMode}}}const tY=y.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:s,chatId:a,projectId:l,inputElementRef:u,activeProvider:h,availableProviders:d},m){const{getDraft:p,setDraft:_,clearDraft:b,getAttachmentDrafts:S,setAttachmentDrafts:w,clearAttachmentDrafts:C}=jF(),{composerState:k,providerDefaults:T,setComposerModel:R,setComposerModelOptions:M,setComposerPlanMode:L,resetComposerFromProvider:O}=cs(),[j,F]=y.useState(()=>a?p(a):""),G=y.useRef(null),P=y.useRef(null),H=LF(),[B,U]=y.useState(()=>h?su(h,k,T):null),[$,W]=y.useState(()=>lk(a?S(a):[])),[z,q]=y.useState(null),[V,X]=y.useState(null),N=y.useRef([]),I=y.useRef(0),Z=y.useRef([]),D=y.useRef(0),ce=y.useRef(new Set),pe=y.useRef(l??null),ae=y.useRef(a??null),Q=h!==null,ve=Q?B??su(h,k,T):k,ne=Q?h:k.provider,de=d.find(oe=>oe.id===ne)??d[0],we=(de==null?void 0:de.supportsPlanMode)??!1,Ce=$.filter(oe=>oe.status==="uploaded"),Re=$.some(oe=>oe.status==="uploading"),ze=j.trim().length>0||Ce.length>0,yt=[...$].sort((oe,Me)=>oe.kind===Me.kind?0:oe.kind==="image"?-1:1),dt=$.find(oe=>oe.id===z)??null,Ct=y.useCallback(oe=>{oe.previewUrl&&URL.revokeObjectURL(oe.previewUrl)},[]),tn=y.useCallback(()=>{D.current+=1,ce.current.clear(),W(oe=>(oe.forEach(Ct),[])),N.current=[],I.current=0,X(null)},[Ct]),_t=y.useCallback(()=>{const oe=P.current;if(oe){if(oe.value.length===0){oe.style.height="";return}oe.style.height="auto",oe.style.height=`${oe.scrollHeight}px`}},[]),jt=y.useCallback(oe=>{P.current=oe,u&&(typeof u=="function"?u(oe):u.current=oe)},[u]);y.useLayoutEffect(()=>{_t()},[j,_t]),y.useEffect(()=>(window.addEventListener("resize",_t),()=>window.removeEventListener("resize",_t)),[_t]),y.useEffect(()=>{var oe;(oe=P.current)==null||oe.focus()},[a]),y.useEffect(()=>{ae.current=a??null},[a]),y.useEffect(()=>{if(h===null){U(null);return}U(su(h,k,T))},[h,a,k,T]),y.useEffect(()=>{D.current+=1,N.current=[],I.current=0,ce.current.clear(),q(null),X(null),W(oe=>(oe.forEach(Ct),lk(a?S(a):[])))},[a,Ct,S]),y.useEffect(()=>{const oe=pe.current;pe.current=l??null,!(oe===null||l===oe)&&(tn(),a&&C(a))},[l,a,tn,C]),y.useEffect(()=>{ak("resolved provider state",{chatId:a??null,activeProvider:h,composerProvider:k.provider,composerModel:k.model,effectiveProvider:ve.provider,effectiveModel:ve.model,selectedProvider:ne,providerLocked:Q,lockedComposerProvider:(B==null?void 0:B.provider)??null})},[h,a,k.model,k.provider,B==null?void 0:B.provider,Q,ve.model,ve.provider,ne]),y.useEffect(()=>{Z.current=$},[$]),y.useEffect(()=>{if(!a)return;const oe=$.filter(Me=>Me.status==="uploaded").map(({previewUrl:Me,status:Xe,...$e})=>$e);if(oe.length===0){C(a);return}w(a,oe)},[$,a,C,w]),y.useEffect(()=>()=>{Z.current.forEach(Ct)},[Ct]);function be(oe,Me){if(Q){U(Xe=>{const $e=Xe??su(ne,k,T);return oe($e)});return}Me()}function Be(oe){be(Me=>({...Me,modelOptions:{...Me.modelOptions,reasoningEffort:oe}}),()=>M(ne==="claude"?{reasoningEffort:oe}:{reasoningEffort:oe}))}function $t(oe){be(Me=>Me.provider!=="claude"?Me:ok({...Me,modelOptions:{...Me.modelOptions,contextWindow:oe}},Me.model),()=>M({contextWindow:oe}))}function ie(oe){const Me=eY({providerLocked:Q,planMode:oe,selectedProvider:ne,composerState:k,providerDefaults:T,lockedComposerState:B});Me.lockedComposerState!==B&&U(Me.lockedComposerState),Me.composerPlanMode!==k.planMode&&L(Me.composerPlanMode)}function ct(){ie(!ve.planMode)}const ue=y.useCallback(()=>{if(l)for(;I.current<QG&&N.current.length>0;){const oe=N.current.shift();if(!oe)break;I.current+=1;const Me=crypto.randomUUID(),Xe=oe.type.startsWith("image/")?URL.createObjectURL(oe):void 0,$e=D.current;W(Dt=>[...Dt,{id:Me,kind:oe.type.startsWith("image/")?"image":"file",displayName:oe.name,absolutePath:"",relativePath:"",contentUrl:"",mimeType:oe.type||"application/octet-stream",size:oe.size,status:"uploading",previewUrl:Xe}]),(async()=>{try{const Dt=new FormData;Dt.append("files",oe);const Wt=await fetch(`/api/projects/${l}/uploads`,{method:"POST",body:Dt});if(!Wt.ok){const Jn=await Wt.json().catch(()=>({}));throw new Error(typeof Jn.error=="string"?Jn.error:"Upload failed")}const hr=(await Wt.json()).attachments[0];if(!hr)throw new Error("Upload failed");if($e!==D.current){Vv(hr),Xe&&URL.revokeObjectURL(Xe);return}if(ce.current.has(Me)){ce.current.delete(Me),Xe&&URL.revokeObjectURL(Xe),Vv(hr);return}W(Jn=>Jn.map(xt=>xt.id!==Me?xt:{...xt,...hr,previewUrl:xt.previewUrl,status:"uploaded"})),X(null)}catch(Dt){if($e!==D.current){Xe&&URL.revokeObjectURL(Xe);return}W(Wt=>Wt.map(Mr=>Mr.id===Me?{...Mr,status:"failed"}:Mr)),X(Dt instanceof Error?Dt.message:String(Dt))}finally{I.current=Math.max(0,I.current-1),ue()}})()}},[l]),ye=y.useCallback(oe=>{if(!l){X("Open a project before uploading files.");return}if(JG({currentAttachmentCount:Z.current.length,queuedAttachmentCount:N.current.length,incomingAttachmentCount:oe.length})){X(`You can upload up to ${BA} files at a time.`);return}N.current.push(...oe),X(null),ue()},[ue,l]);y.useImperativeHandle(m,()=>({enqueueFiles:ye}),[ye]);async function Le(){if(!ze||Re)return;const oe=j,Me=Ce.map(({previewUrl:Dt,status:Wt,...Mr})=>Mr);let Xe;ve.provider==="claude"?Xe={claude:{...ve.modelOptions}}:Xe={codex:{...ve.modelOptions}};const $e={provider:ne,model:ve.model,modelOptions:Xe,planMode:we?ve.planMode:!1,attachments:Me};ak("submit settings",{chatId:a??null,activeProvider:h,composerProvider:ve.provider,submitOptions:$e}),F(""),a&&b(a),P.current&&(P.current.style.height="auto");try{await t(oe,$e),tn(),ae.current&&C(ae.current)}catch(Dt){console.error("[ChatInput] Submit failed:",Dt),F(oe),a&&_(a,oe)}}function He(oe){if(oe.key==="Tab"&&!oe.shiftKey){oe.preventDefault(),QB(P.current,document);return}if(oe.key==="Tab"&&oe.shiftKey&&we){oe.preventDefault(),ct();return}if(oe.key==="Escape"&&s){oe.preventDefault(),n==null||n();return}const Me="ontouchstart"in window||navigator.maxTouchPoints>0;oe.key==="Enter"&&!oe.shiftKey&&!s&&!Me&&(oe.preventDefault(),Le())}function Ye(oe){if(i0(oe).openInNewTab){typeof window<"u"&&window.open(new URL(oe.contentUrl,window.location.origin).toString(),"_blank","noopener,noreferrer");return}q(oe.id)}function bt(oe){ce.current.add(oe.id),W(Me=>{const Xe=Me.find($e=>$e.id===oe.id);return Xe&&Ct(Xe),Me.filter($e=>$e.id!==oe.id)}),z===oe.id&&q(null),oe.status==="uploaded"&&(ce.current.delete(oe.id),Vv(oe))}function Pn(){var oe;(oe=G.current)==null||oe.click()}return g.jsxs("div",{children:[g.jsxs("div",{className:_e("px-3 pt-0",H&&"px-5"),children:[g.jsxs("div",{className:"max-w-[840px] mx-auto rounded-[32px]",children:[$.length>0?g.jsx(n0,{className:"overflow-x-auto overflow-y-hidden whitespace-nowrap px-2 pb-2",children:g.jsx("div",{className:"flex items-end gap-2 pt-2",children:yt.map(oe=>g.jsx("div",{className:_e("flex shrink-0 flex-col justify-end",oe.status==="failed"&&"text-destructive"),children:oe.kind==="image"?g.jsx(EN,{attachment:oe,previewUrl:oe.previewUrl,size:"composer",onClick:oe.status==="uploaded"?()=>Ye(oe):void 0,onRemove:()=>bt(oe)}):g.jsx(RN,{attachment:oe,onClick:oe.status==="uploaded"?()=>Ye(oe):void 0,onRemove:()=>bt(oe)})},oe.id))})}):null,g.jsxs("div",{className:"flex items-end max-w-[840px] mx-auto border dark:bg-card/40 backdrop-blur-lg border-border rounded-[29px] pr-1.5",children:[g.jsx("input",{ref:G,type:"file",multiple:!0,className:"hidden",onChange:oe=>{const Me=[...oe.target.files??[]];Me.length>0&&ye(Me),oe.target.value=""}}),g.jsx(tt,{type:"button",variant:"ghost",size:"icon",onPointerDown:oe=>{oe.preventDefault(),Pn()},disabled:r,className:"md:hidden flex-shrink-0 ml-1 mb-1 h-10 w-10 rounded-full text-muted-foreground hover:text-foreground",children:g.jsx(pB,{className:"h-5 w-5"})}),g.jsx(dN,{ref:jt,placeholder:"Build something...",value:j,autoFocus:!0,[yb]:"",rows:1,onChange:oe=>{F(oe.target.value),a&&_(a,oe.target.value),_t()},onKeyDown:He,disabled:r,className:"flex-1 text-base p-3 md:p-4 !pr-2 pl-0 md:pl-6 resize-none max-h-[200px] outline-none bg-transparent border-0 shadow-none"}),g.jsx(tt,{type:"button",onPointerDown:oe=>{oe.preventDefault(),s?n==null||n():!r&&ze&&!Re&&Le()},disabled:!s&&(r||!ze||Re),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(H6,{className:"h-5 w-5 md:h-6 md:w-6"})})]})]}),V?g.jsx("div",{className:"max-w-[840px] mx-auto mt-2 px-1 text-sm text-destructive",children:V}):null]}),g.jsxs("div",{className:_e("overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden py-3 flex flex-row",H&&"p-5 pt-3"),children:[g.jsx("div",{className:"min-w-3"}),g.jsx(B_,{availableProviders:d,selectedProvider:ne,providerLocked:Q,model:ve.model,modelOptions:ve.modelOptions,onProviderChange:oe=>{Q||O(oe)},onModelChange:(oe,Me)=>{be(Xe=>ok(Xe,Me),()=>R(Me))},onModelOptionChange:oe=>{switch(oe.type){case"claudeReasoningEffort":Be(oe.effort);break;case"codexReasoningEffort":Be(oe.effort);break;case"contextWindow":$t(oe.contextWindow);break;case"fastMode":be(Me=>Me.provider==="claude"?Me:{...Me,modelOptions:{...Me.modelOptions,fastMode:oe.fastMode}},()=>M({fastMode:oe.fastMode}));break}},planMode:ve.planMode,onPlanModeChange:ie,includePlanMode:we,className:"max-w-[840px] mx-auto"}),g.jsx("div",{className:"min-w-3"})]}),g.jsx(PA,{attachment:dt,onOpenChange:oe=>!oe&&q(null)})]})}),nY=y.memo(tY);async function Vv(e){if(!e.contentUrl)return;const t=e.contentUrl.replace(/\/content$/,"");await fetch(t,{method:"DELETE"}).catch(()=>{})}function lk(e){return e.map(t=>({...t,status:"uploaded"}))}const IA=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:_e("bg-card text-card-foreground",e),...t}));IA.displayName="Card";const HA=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-2",e),...t}));HA.displayName="CardHeader";const rY=y.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));rY.displayName="CardTitle";const iY=y.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));iY.displayName="CardDescription";const FA=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));FA.displayName="CardContent";const sY=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));sY.displayName="CardFooter";function oY({sidebarCollapsed:e,onOpenSidebar:t,onExpandSidebar:n,onNewChat:r,localPath:s,embeddedTerminalVisible:a=!1,onToggleEmbeddedTerminal:l,rightSidebarVisible:u=!1,onToggleRightSidebar:h,onOpenExternal:d,editorLabel:m="Editor",finderShortcut:p,editorShortcut:_,terminalShortcut:b,rightSidebarShortcut:S}){return g.jsx(HA,{className:_e("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(tt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:t,children:g.jsx(fb,{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(mu,{className:"h-4 w-4 sm:h-5 sm:w-5 text-logo ml-1 hidden md:block"})}),g.jsx(tt,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:n,title:"Expand sidebar",children:g.jsx(y_,{className:"size-4.5"})})]}),g.jsx(tt,{variant:"ghost",size:"icon",onClick:r,title:"Compose",children:g.jsx(gb,{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||l)&&g.jsxs(g.Fragment,{children:[d?g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>d("open_finder"),title:"Open in Finder",className:"border border-border/0",children:g.jsx(fT,{className:"h-4.5 w-4.5"})})}),g.jsx(hl,{side:"bottom",shortcut:p})]}):null,l?g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:l,className:_e("border border-border/0",a&&"text-white"),children:g.jsx(vb,{className:"h-4.5 w-4.5"})})}),g.jsx(hl,{side:"bottom",shortcut:b})]}):null,d?g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>d("open_editor"),title:`Open in ${m}`,className:"border border-border/0",children:g.jsx(uT,{className:"h-4.5 w-4.5"})})}),g.jsx(hl,{side:"bottom",shortcut:_})]}):null]}),h?g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:h,className:_e("border border-border/0",u&&"text-white"),children:g.jsx(hB,{className:"h-4.5 w-4.5"})})}),g.jsx(hl,{side:"bottom",shortcut:S})]}):null]})]})})}function aY({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(ca,{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 lY(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function cY(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function uY(e){return e/100*window.innerHeight}function dY(e){return e/100*window.innerWidth}function hY(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 ou({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,a]=hY(n);switch(a){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=cY(t,s);break}case"em":{r=lY(t,s);break}case"vh":{r=uY(s);break}case"vw":{r=dY(s);break}}return r}function cr(e){return parseFloat(e.toFixed(3))}function Tl({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 Q_(e){const{panels:t}=e,n=Tl({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:s,panelConstraints:a}=r;let l=0;if(a.collapsedSize!==void 0){const m=ou({groupSize:n,panelElement:s,styleProp:a.collapsedSize});l=cr(m/n*100)}let u;if(a.defaultSize!==void 0){const m=ou({groupSize:n,panelElement:s,styleProp:a.defaultSize});u=cr(m/n*100)}let h=0;if(a.minSize!==void 0){const m=ou({groupSize:n,panelElement:s,styleProp:a.minSize});h=cr(m/n*100)}let d=100;if(a.maxSize!==void 0){const m=ou({groupSize:n,panelElement:s,styleProp:a.maxSize});d=cr(m/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:l,collapsible:a.collapsible===!0,defaultSize:u,disabled:a.disabled,minSize:h,maxSize:d,panelId:r.id}})}function Mt(e,t="Assertion error"){if(!e)throw Error(t)}function J_(e,t){return Array.from(t).sort(e==="horizontal"?fY:pY)}function fY(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function pY(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function UA(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function $A(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 mY({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,a=Number.MAX_VALUE;for(const l of t){const{x:u,y:h}=$A(r,l),d=e==="horizontal"?u:h;d<a&&(a=d,s=l)}return Mt(s,"No rect found"),s}let Hh;function gY(){return Hh===void 0&&(typeof matchMedia=="function"?Hh=!!matchMedia("(pointer:coarse)").matches:Hh=!1),Hh}function WA(e){const{element:t,orientation:n,panels:r,separators:s}=e,a=J_(n,Array.from(t.children).filter(UA).map(S=>({element:S}))).map(({element:S})=>S),l=[];let u=!1,h=!1,d=-1,m=-1,p=0,_,b=[];{let S=-1;for(const w of a)w.hasAttribute("data-panel")&&(S++,w.ariaDisabled===null&&(p++,d===-1&&(d=S),m=S))}if(p>1){let S=-1;for(const w of a)if(w.hasAttribute("data-panel")){S++;const C=r.find(k=>k.element===w);if(C){if(_){const k=_.element.getBoundingClientRect(),T=w.getBoundingClientRect();let R;if(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(b.length){case 0:{R=[M,L];break}case 1:{const O=b[0],j=mY({orientation:n,rects:[k,T],targetRect:O.element.getBoundingClientRect()});R=[O,j===k?L:M];break}default:{R=b;break}}}else b.length?R=b:R=[n==="horizontal"?new DOMRect(k.right,T.top,T.left-k.right,T.height):new DOMRect(T.left,k.bottom,T.width,T.top-k.bottom)];for(const M of R){let L="width"in M?M:M.element.getBoundingClientRect();const O=gY()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<O){const F=O-L.width;L=new DOMRect(L.x-F/2,L.y,L.width+F,L.height)}if(L.height<O){const F=O-L.height;L=new DOMRect(L.x,L.y-F/2,L.width,L.height+F)}const j=S<=d||S>m;!u&&!j&&l.push({group:e,groupSize:Tl({group:e}),panels:[_,C],separator:"width"in M?void 0:M,rect:L}),u=!1}}h=!1,_=C,b=[]}}else if(w.hasAttribute("data-separator")){w.ariaDisabled!==null&&(u=!0);const C=s.find(k=>k.element===w);C?b.push(C):(_=void 0,b=[])}else h=!0}return l}var ro,VE;let VA=(VE=class{constructor(){Iw(this,ro,{})}addListener(t,n){const r=Ic(this,ro)[t];return r===void 0?Ic(this,ro)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=Ic(this,ro)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,a=null;const l=Array.from(r);for(let u=0;u<l.length;u++){const h=l[u];try{h.call(null,n)}catch(d){a===null&&(s=!0,a=d)}}if(s)throw a}}removeAllListeners(){Hw(this,ro,{})}removeListener(t,n){const r=Ic(this,ro)[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},ro=new WeakMap,VE),Ri=new Map;const qA=new VA;function vY(e){Ri=new Map(Ri),Ri.delete(e)}function ck(e,t){for(const[n]of Ri)if(n.id===e)return n}function oo(e,t){for(const[n,r]of Ri)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function fa(){return Ri}function E0(e,t){return qA.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function gs(e,t){const n=Ri.get(e);Ri=new Map(Ri),Ri.set(e,t),qA.emit("groupChange",{group:e,prev:n,next:t})}function _Y(e,t,n){let r,s={x:1/0,y:1/0};for(const a of t){const l=$A(n,a.rect);switch(e){case"horizontal":{l.x<=s.x&&(r=a,s=l);break}case"vertical":{l.y<=s.y&&(r=a,s=l);break}}}return r?{distance:s,hitRegion:r}:void 0}function yY(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function bY(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:hk(e),b:hk(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Mt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:dk(uk(n.a)),b:dk(uk(n.b))};if(s.a===s.b){const a=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let u=a.length;for(;u--;){const h=a[u];if(h===l.a)return 1;if(h===l.b)return-1}}return Math.sign(s.a-s.b)}const xY=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function SY(e){const t=getComputedStyle(KA(e)??e).display;return t==="flex"||t==="inline-flex"}function wY(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||SY(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"||xY.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function uk(e){let t=e.length;for(;t--;){const n=e[t];if(Mt(n,"Missing node"),wY(n))return n}return null}function dk(e){return e&&Number(getComputedStyle(e).zIndex)||0}function hk(e){const t=[];for(;e;)t.push(e),e=KA(e);return t}function KA(e){const{parentNode:t}=e;return yY(t)?t.host:t}function CY(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 kY({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!UA(n)||n.contains(e)||e.contains(n))return!0;if(bY(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(CY(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function R0(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const a=WA(s),l=_Y(s.orientation,a,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&kY({groupElement:s.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function EY(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 Gn(e,t,n=0){return Math.abs(cr(e)-cr(t))<=n}function wi(e,t){return Gn(e,t)?0:e>t?1:-1}function fl({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:a,disabled:l,maxSize:u=100,minSize:h=0}=t;if(l&&!e)return n;if(wi(r,h)<0)if(a){const d=(s+h)/2;wi(r,d)<0?r=s:r=h}else r=h;return r=Math.min(u,r),r=cr(r),r}function Bu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:a}){if(Gn(e,0))return t;const l=a==="imperative-api",u=Object.values(t),h=Object.values(s),d=[...u],[m,p]=r;Mt(m!=null,"Invalid first pivot index"),Mt(p!=null,"Invalid second pivot index");let _=0;switch(a){case"keyboard":{{const w=e<0?p:m,C=n[w];Mt(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(Mt(M!=null,`Previous layout not found for panel index ${w}`),Gn(M,k)){const L=R-M;wi(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const w=e<0?m:p,C=n[w];Mt(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(Mt(M!=null,`Previous layout not found for panel index ${w}`),Gn(M,R)){const L=M-k;wi(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const w=e<0?p:m,C=n[w];Mt(C,`Panel constraints not found for index ${w}`);const k=u[w],{collapsible:T,collapsedSize:R,minSize:M}=C;if(T&&wi(k,M)<0)if(e>0){const L=M-R,O=L/2,j=k+e;wi(j,M)<0&&(e=wi(e,O)<=0?0:L)}else{const L=M-R,O=100-L/2,j=k-e;wi(j,M)<0&&(e=wi(100+e,O)>0?0:-L)}break}}{const w=e<0?1:-1;let C=e<0?p:m,k=0;for(;;){const R=u[C];Mt(R!=null,`Previous layout not found for panel index ${C}`);const M=fl({overrideDisabledPanels:l,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?m:p;for(;w>=0&&w<n.length;){const C=Math.abs(e)-Math.abs(_),k=u[w];Mt(k!=null,`Previous layout not found for panel index ${w}`);const T=k-C,R=fl({overrideDisabledPanels:l,panelConstraints:n[w],prevSize:k,size:T});if(!Gn(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(EY(h,d))return s;{const w=e<0?p:m,C=u[w];Mt(C!=null,`Previous layout not found for panel index ${w}`);const k=C+_,T=fl({overrideDisabledPanels:l,panelConstraints:n[w],prevSize:C,size:k});if(d[w]=T,!Gn(T,k)){let R=k-T,M=e<0?p:m;for(;M>=0&&M<n.length;){const L=d[M];Mt(L!=null,`Previous layout not found for panel index ${M}`);const O=L+R,j=fl({overrideDisabledPanels:l,panelConstraints:n[M],prevSize:L,size:O});if(Gn(L,j)||(R-=j-L,d[M]=j),Gn(R,0))break;e>0?M--:M++}}}const b=Object.values(d).reduce((w,C)=>C+w,0);if(!Gn(b,100,.1))return s;const S=Object.keys(s);return d.reduce((w,C,k)=>(w[S[k]]=C,w),{})}function ta(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||wi(e[n],t[n])!==0)return!1;return!0}function na({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(!Gn(s,100)&&r.length>0)for(let u=0;u<t.length;u++){const h=r[u];Mt(h!=null,`No layout data found for index ${u}`);const d=100/s*h;r[u]=d}let a=0;for(let u=0;u<t.length;u++){const h=n[u];Mt(h!=null,`No layout data found for index ${u}`);const d=r[u];Mt(d!=null,`No layout data found for index ${u}`);const m=fl({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});d!=m&&(a+=d-m,r[u]=m)}if(!Gn(a,0))for(let u=0;u<t.length;u++){const h=r[u];Mt(h!=null,`No layout data found for index ${u}`);const d=h+a,m=fl({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});if(h!==m&&(a-=m-h,r[u]=m,Gn(a,0)))break}const l=Object.keys(e);return r.reduce((u,h,d)=>(u[l[d]]=h,u),{})}function GA({groupId:e,panelId:t}){const n=()=>{const u=fa();for(const[h,{defaultLayoutDeferred:d,derivedPanelConstraints:m,layout:p,groupSize:_,separatorToPanels:b}]of u)if(h.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:m,group:h,groupSize:_,layout:p,separatorToPanels:b};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}`)},a=()=>{const u=n().layout[t];if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},l=u=>{const h=a();if(u===h)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:m,group:p,groupSize:_,layout:b,separatorToPanels:S}=n(),w=p.panels.findIndex(R=>R.id===t),C=w===p.panels.length-1,k=Bu({delta:C?h-u:u-h,initialLayout:b,panelConstraints:m,pivotIndices:C?[w-1,w]:[w,w+1],prevLayout:b,trigger:"imperative-api"}),T=na({layout:k,panelConstraints:m});ta(b,T)||gs(p,{defaultLayoutDeferred:d,derivedPanelConstraints:m,groupSize:_,layout:T,separatorToPanels:S})};return{collapse:()=>{const{collapsible:u,collapsedSize:h}=r(),{mutableValues:d}=s(),m=a();u&&m!==h&&(d.expandToSize=m,l(h))},expand:()=>{const{collapsible:u,collapsedSize:h,minSize:d}=r(),{mutableValues:m}=s(),p=a();if(u&&p===h){let _=m.expandToSize??d;_===0&&(_=1),l(_)}},getSize:()=>{const{group:u}=n(),h=a(),{element:d}=s(),m=u.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:h,inPixels:m}},isCollapsed:()=>{const{collapsible:u,collapsedSize:h}=r(),d=a();return u&&Gn(h,d)},resize:u=>{const{group:h}=n(),{element:d}=s(),m=Tl({group:h}),p=ou({groupSize:m,panelElement:d,styleProp:u}),_=cr(p/m*100);l(_)}}}function fk(e){if(e.defaultPrevented)return;const t=fa();R0(e,t).forEach(n=>{if(n.separator){const r=n.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(r){const s=r.panelConstraints.defaultSize,a=GA({groupId:n.group.id,panelId:r.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function lf(e){const t=fa();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 YA({groupId:e}){const t=()=>{const n=fa();for(const[r,s]of n)if(r.id===e)return{group:r,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:s,group:a,groupSize:l,layout:u,separatorToPanels:h}=t(),d=na({layout:n,panelConstraints:s});return r?u:(ta(u,d)||gs(a,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:l,layout:d,separatorToPanels:h}),d)}}}function Ho(e,t){const n=lf(e),r=oo(n.id,!0),s=n.separators.find(m=>m.element===e);Mt(s,"Matching separator not found");const a=r.separatorToPanels.get(s);Mt(a,"Matching panels not found");const l=a.map(m=>n.panels.indexOf(m)),u=YA({groupId:n.id}).getLayout(),h=Bu({delta:t,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:l,prevLayout:u,trigger:"keyboard"}),d=na({layout:h,panelConstraints:r.derivedPanelConstraints});ta(u,d)||gs(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels})}function pk(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=lf(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Ho(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Ho(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Ho(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Ho(t,-5);break}case"End":{e.preventDefault(),Ho(t,100);break}case"Enter":{e.preventDefault();const r=lf(t),s=oo(r.id,!0),{derivedPanelConstraints:a,layout:l,separatorToPanels:u}=s,h=r.separators.find(_=>_.element===t);Mt(h,"Matching separator not found");const d=u.get(h);Mt(d,"Matching panels not found");const m=d[0],p=a.find(_=>_.panelId===m.id);if(Mt(p,"Panel metadata not found"),p.collapsible){const _=l[m.id],b=p.collapsedSize===_?r.mutableState.expandedPanelSizes[m.id]??p.minSize:p.collapsedSize;Ho(t,b-_)}break}case"F6":{e.preventDefault();const r=lf(t).separators.map(l=>l.element),s=Array.from(r).findIndex(l=>l===e.currentTarget);Mt(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Ho(t,-100);break}}}let xl={cursorFlags:0,state:"inactive"};const T0=new VA;function ra(){return xl}function RY(e){return T0.addListener("change",e)}function TY(e){const t=xl,n={...xl};n.cursorFlags=e,xl=n,T0.emit("change",{prev:t,next:n})}function Sl(e){const t=xl;xl=e,T0.emit("change",{prev:t,next:e})}function mk(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=fa(),n=R0(e,t),r=new Map;let s=!1;n.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const l=t.get(a.group);l&&r.set(a.group,l.layout)}),Sl({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const MY=e=>e,qv=()=>{},XA=1,ZA=2,QA=4,JA=8,gk=3,vk=12;let Fh;function _k(){return Fh===void 0&&(Fh=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Fh=!0)),Fh}function NY({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&_k()){const a=(e&XA)!==0,l=(e&ZA)!==0,u=(e&QA)!==0,h=(e&JA)!==0;if(a)return u?"se-resize":h?"ne-resize":"e-resize";if(l)return u?"sw-resize":h?"nw-resize":"w-resize";if(u)return"s-resize";if(h)return"n-resize"}break}}return _k()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const yk=new WeakMap;function M0(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=yk.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=ra();switch(r.state){case"active":case"hover":{const s=NY({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(l=>l.group),state:r.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}yk.set(e,{prevStyle:t,styleSheet:n})}function e5({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:l}){let u=0;n.forEach(d=>{const{group:m,groupSize:p}=d,{orientation:_,panels:b}=m,{disableCursor:S}=m.mutableState;let w=0;a?_==="horizontal"?w=(t.clientX-a.x)/p*100:w=(t.clientY-a.y)/p*100:_==="horizontal"?w=t.clientX<0?-100:100:w=t.clientY<0?-100:100;const C=r.get(m),k=s.get(m);if(!C||!k)return;const{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:M,layout:L,separatorToPanels:O}=k;if(R&&L&&O){const j=Bu({delta:w,initialLayout:C,panelConstraints:R,pivotIndices:d.panels.map(F=>b.indexOf(F)),prevLayout:L,trigger:"mouse-or-touch"});if(ta(j,L)){if(w!==0&&!S)switch(_){case"horizontal":{u|=w<0?XA:ZA;break}case"vertical":{u|=w<0?QA:JA;break}}}else gs(d.group,{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:M,layout:j,separatorToPanels:O})}});let h=0;t.movementX===0?h|=l&gk:h|=u&gk,t.movementY===0?h|=l&vk:h|=u&vk,TY(h),M0(e)}function bk(e){const t=fa(),n=ra();switch(n.state){case"active":e5({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function xk(e){if(e.defaultPrevented)return;const t=ra(),n=fa();switch(t.state){case"active":{if(e.buttons===0){Sl({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=oo(r.group.id,!0);gs(r.group,s)});return}e5({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=R0(e,n);r.length===0?t.state!=="inactive"&&Sl({cursorFlags:0,state:"inactive"}):Sl({cursorFlags:0,hitRegions:r,state:"hover"}),M0(e.currentTarget);break}}}function Sk(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(ra().state){case"hover":Sl({cursorFlags:0,state:"inactive"})}}function wk(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ra();switch(t.state){case"active":Sl({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(M0(e.currentTarget),t.hitRegions.forEach(n=>{const r=oo(n.group.id,!0);gs(n.group,r)}),e.preventDefault())}}function Ck(e){let t=0,n=0;const r={};for(const a of e)if(a.defaultSize!==void 0){t++;const l=cr(a.defaultSize);n+=l,r[a.panelId]=l}else r[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=cr((100-n)/s);for(const l of e)l.defaultSize===void 0&&(r[l.panelId]=a)}return r}function AY(e,t,n){if(!n[0])return;const r=e.panels.find(h=>h.element===t);if(!r||!r.onResize)return;const s=Tl({group:e}),a=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,l=r.mutableValues.prevSize,u={asPercentage:cr(a/s*100),inPixels:a};r.mutableValues.prevSize=u,r.onResize(u,r.id,l)}function DY(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 OY({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,a=0,l=!1;const u=new Map,h=[];for(const p of e.panels){const _=r[p.id]??0;switch(p.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{l=!0;const b=_/100*n,S=cr(b/t*100);u.set(p.id,S),s+=S;break}case"preserve-relative-size":default:{h.push(p.id),a+=_;break}}}if(!l||h.length===0)return r;const d=100-s,m={...r};if(u.forEach((p,_)=>{m[_]=p}),a>0)for(const p of h){const _=r[p]??0;m[p]=cr(_/a*d)}else{const p=cr(d/h.length);for(const _ of h)m[_]=p}return m}function LY(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 ol=new Map;function jY(e){let t=!0;Mt(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,a=new n(S=>{for(const w of S){const{borderBoxSize:C,target:k}=w;if(k===e.element){if(t){const T=Tl({group:e});if(T===0)return;const R=oo(e.id);if(!R)return;const M=Q_(e),L=R.defaultLayoutDeferred?Ck(M):R.layout,O=OY({group:e,nextGroupSize:T,prevGroupSize:R.groupSize,prevLayout:L}),j=na({layout:O,panelConstraints:M});if(!R.defaultLayoutDeferred&&ta(R.layout,j)&&DY(R.derivedPanelConstraints,M)&&R.groupSize===T)return;gs(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:M,groupSize:T,layout:j,separatorToPanels:R.separatorToPanels})}}else AY(e,k,C)}});a.observe(e.element),e.panels.forEach(S=>{Mt(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&a.observe(S.element)});const l=Tl({group:e}),u=Q_(e),h=e.panels.map(({id:S})=>S).join(",");let d=e.mutableState.defaultLayout;d&&(LY(e.panels,d)||(d=void 0));const m=e.mutableState.layouts[h]??d??Ck(u),p=na({layout:m,panelConstraints:u}),_=e.element.ownerDocument;ol.set(_,(ol.get(_)??0)+1);const b=new Map;return WA(e).forEach(S=>{S.separator&&b.set(S.separator,S.panels)}),gs(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:u,groupSize:l,layout:p,separatorToPanels:b}),e.separators.forEach(S=>{Mt(!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",pk)}),ol.get(_)===1&&(_.addEventListener("dblclick",fk,!0),_.addEventListener("pointerdown",mk,!0),_.addEventListener("pointerleave",bk),_.addEventListener("pointermove",xk),_.addEventListener("pointerout",Sk),_.addEventListener("pointerup",wk,!0)),function(){t=!1,ol.set(_,Math.max(0,(ol.get(_)??0)-1)),vY(e),e.separators.forEach(S=>{S.element.removeEventListener("keydown",pk)}),ol.get(_)||(_.removeEventListener("dblclick",fk,!0),_.removeEventListener("pointerdown",mk,!0),_.removeEventListener("pointerleave",bk),_.removeEventListener("pointermove",xk),_.removeEventListener("pointerout",Sk),_.removeEventListener("pointerup",wk,!0)),a.disconnect()}}function zY(){const[e,t]=y.useState({}),n=y.useCallback(()=>t({}),[]);return[e,n]}function N0(e){const t=y.useId();return`${e??t}`}const pa=typeof window<"u"?y.useLayoutEffect:y.useEffect;function wu(e){const t=y.useRef(e);return pa(()=>{t.current=e},[e]),y.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function A0(...e){return wu(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function D0(e){const t=y.useRef({...e});return pa(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const t5=y.createContext(null);function PY(e,t){const n=y.useRef({getLayout:()=>({}),setLayout:MY});y.useImperativeHandle(t,()=>n.current,[]),pa(()=>{Object.assign(n.current,YA({groupId:e}))})}function n5({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:a,groupRef:l,id:u,onLayoutChange:h,onLayoutChanged:d,orientation:m="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:_,...b}){const S=y.useRef({onLayoutChange:{},onLayoutChanged:{}}),w=wu(H=>{ta(S.current.onLayoutChange,H)||(S.current.onLayoutChange=H,h==null||h(H))}),C=wu(H=>{ta(S.current.onLayoutChanged,H)||(S.current.onLayoutChanged=H,d==null||d(H))}),k=N0(u),T=y.useRef(null),[R,M]=zY(),L=y.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),O=A0(T,a);PY(k,l);const j=wu((H,B)=>{const U=ra(),$=ck(H),W=oo(H);if(W){let z=!1;switch(U.state){case"active":{z=U.hitRegions.some(q=>q.group===$);break}}return{flexGrow:W.layout[B]??1,pointerEvents:z?"none":void 0}}return{flexGrow:(n==null?void 0:n[B])??1}}),F=D0({defaultLayout:n,disableCursor:r}),G=y.useMemo(()=>({get disableCursor(){return!!F.disableCursor},getPanelStyles:j,id:k,orientation:m,registerPanel:H=>{const B=L.current;return B.panels=J_(m,[...B.panels,H]),M(),()=>{B.panels=B.panels.filter(U=>U!==H),M()}},registerSeparator:H=>{const B=L.current;return B.separators=J_(m,[...B.separators,H]),M(),()=>{B.separators=B.separators.filter(U=>U!==H),M()}},togglePanelDisabled:(H,B)=>{const U=L.current.panels.find(z=>z.id===H);U&&(U.panelConstraints.disabled=B);const $=ck(k),W=oo(k);$&&W&&gs($,{...W,derivedPanelConstraints:Q_($)})},toggleSeparatorDisabled:(H,B)=>{const U=L.current.separators.find($=>$.id===H);U&&(U.disabled=B)}}),[j,k,M,m,F]),P=y.useRef(null);return pa(()=>{const H=T.current;if(H===null)return;const B=L.current;let U;if(F.defaultLayout!==void 0&&Object.keys(F.defaultLayout).length===B.panels.length){U={};for(const N of B.panels){const I=F.defaultLayout[N.id];I!==void 0&&(U[N.id]=I)}}const $={disabled:!!s,element:H,id:k,mutableState:{defaultLayout:U,disableCursor:!!F.disableCursor,expandedPanelSizes:L.current.lastExpandedPanelSizes,layouts:L.current.layouts},orientation:m,panels:B.panels,resizeTargetMinimumSize:B.resizeTargetMinimumSize,separators:B.separators};P.current=$;const W=jY($),{defaultLayoutDeferred:z,derivedPanelConstraints:q,layout:V}=oo($.id,!0);!z&&q.length>0&&(w(V),C(V));const X=E0(k,N=>{const{defaultLayoutDeferred:I,derivedPanelConstraints:Z,layout:D}=N.next;if(I||Z.length===0)return;const ce=$.panels.map(({id:ae})=>ae).join(",");$.mutableState.layouts[ce]=D,Z.forEach(ae=>{if(ae.collapsible){const{layout:Q}=N.prev??{};if(Q){const ve=Gn(ae.collapsedSize,D[ae.panelId]),ne=Gn(ae.collapsedSize,Q[ae.panelId]);ve&&!ne&&($.mutableState.expandedPanelSizes[ae.panelId]=Q[ae.panelId])}}});const pe=ra().state!=="active";w(D),pe&&C(D)});return()=>{P.current=null,W(),X()}},[s,k,C,w,m,R,F]),y.useEffect(()=>{const H=P.current;H&&(H.mutableState.defaultLayout=n,H.mutableState.disableCursor=!!r)}),g.jsx(t5.Provider,{value:G,children:g.jsx("div",{...b,className:t,"data-group":!0,"data-testid":k,id:k,ref:O,style:{height:"100%",width:"100%",overflow:"hidden",..._,display:"flex",flexDirection:m==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:m==="horizontal"?"pan-y":"pan-x"},children:e})})}n5.displayName="Group";function O0(){const e=y.useContext(t5);return Mt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function BY(e,t){const{id:n}=O0(),r=y.useRef({collapse:qv,expand:qv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:qv});y.useImperativeHandle(t,()=>r.current,[]),pa(()=>{Object.assign(r.current,GA({groupId:n,panelId:e}))})}function r5({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:a,elementRef:l,groupResizeBehavior:u="preserve-relative-size",id:h,maxSize:d="100%",minSize:m="0%",onResize:p,panelRef:_,style:b,...S}){const w=!!h,C=N0(h),k=D0({disabled:a}),T=y.useRef(null),R=A0(T,l),{getPanelStyles:M,id:L,orientation:O,registerPanel:j,togglePanelDisabled:F}=O0(),G=p!==null,P=wu((B,U,$)=>{p==null||p(B,h,$)});pa(()=>{const B=T.current;if(B!==null){const U={element:B,id:C,idIsStable:w,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:G?P:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:s,disabled:k.disabled,maxSize:d,minSize:m}};return j(U)}},[u,n,r,s,G,C,w,d,m,P,j,k]),y.useEffect(()=>{F(C,!!a)},[a,C,F]),BY(C,_);const H=y.useSyncExternalStore(B=>E0(L,B),()=>JSON.stringify(M(L,C)),()=>JSON.stringify(M(L,C)));return g.jsx("div",{...S,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":C,id:C,ref:R,style:{...IY,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",...b,touchAction:O==="horizontal"?"pan-y":"pan-x"},children:e})})}r5.displayName="Panel";const IY={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function HY({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,a;const l=e[n],u=t.find(h=>h.panelId===n);if(u){const h=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,m=[r,r+1];a=na({layout:Bu({delta:d-l,initialLayout:e,panelConstraints:t,pivotIndices:m,prevLayout:e}),panelConstraints:t})[n],s=na({layout:Bu({delta:h-l,initialLayout:e,panelConstraints:t,pivotIndices:m,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:a,valueNow:l}}function i5({children:e,className:t,disabled:n,elementRef:r,id:s,style:a,...l}){const u=N0(s),h=D0({disabled:n}),[d,m]=y.useState({}),[p,_]=y.useState("inactive"),b=y.useRef(null),S=A0(b,r),{disableCursor:w,id:C,orientation:k,registerSeparator:T,toggleSeparatorDisabled:R}=O0(),M=k==="horizontal"?"vertical":"horizontal";pa(()=>{const O=b.current;if(O!==null){const j={disabled:h.disabled,element:O,id:u},F=T(j),G=RY(H=>{_(H.next.state!=="inactive"&&H.next.hitRegions.some(B=>B.separator===j)?H.next.state:"inactive")}),P=E0(C,H=>{const{derivedPanelConstraints:B,layout:U,separatorToPanels:$}=H.next,W=$.get(j);if(W){const z=W[0],q=W.indexOf(z);m(HY({layout:U,panelConstraints:B,panelId:z.id,panelIndex:q}))}});return()=>{G(),P(),F()}}},[C,u,T,h]),y.useEffect(()=>{R(u,!!n)},[n,u,R]);let L;return n&&!w&&(L="not-allowed"),g.jsx("div",{...l,"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":p,"data-testid":u,id:u,ref:S,role:"separator",style:{flexBasis:"auto",cursor:L,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}i5.displayName="Separator";const cf=({className:e,...t})=>g.jsx(n5,{className:_e("flex h-full w-full",e),...t}),$o=e=>g.jsx(r5,{...e}),uf=({withHandle:e,orientation:t,disabled:n,className:r,...s})=>g.jsx(i5,{disabled:n,className:_e("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"})});/**
|
|
558
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
559
|
-
* @license MIT
|
|
560
|
-
*
|
|
561
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
562
|
-
* @license MIT
|
|
563
|
-
*
|
|
564
|
-
* Originally forked from (with the author's permission):
|
|
565
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
566
|
-
* http://bellard.org/jslinux/
|
|
567
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
568
|
-
*/var Sn=0,wn=0,Cn=0,Yt=0,Hn;(e=>{function t(s,a,l,u){return u!==void 0?`#${Fo(s)}${Fo(a)}${Fo(l)}${Fo(u)}`:`#${Fo(s)}${Fo(a)}${Fo(l)}`}e.toCss=t;function n(s,a,l,u=255){return(s<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,a,l,u){return{css:e.toCss(s,a,l,u),rgba:e.toRgba(s,a,l,u)}}e.toColor=r})(Hn||(Hn={}));var FY;(e=>{function t(h,d){if(Yt=(d.rgba&255)/255,Yt===1)return{css:d.css,rgba:d.rgba};let m=d.rgba>>24&255,p=d.rgba>>16&255,_=d.rgba>>8&255,b=h.rgba>>24&255,S=h.rgba>>16&255,w=h.rgba>>8&255;Sn=b+Math.round((m-b)*Yt),wn=S+Math.round((p-S)*Yt),Cn=w+Math.round((_-w)*Yt);let C=Hn.toCss(Sn,wn,Cn),k=Hn.toRgba(Sn,wn,Cn);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,m){let p=df.ensureContrastRatio(h.rgba,d.rgba,m);if(p)return Hn.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[Sn,wn,Cn]=df.toChannels(d),{css:Hn.toCss(Sn,wn,Cn),rgba:d}}e.opaque=s;function a(h,d){return Yt=Math.round(d*255),[Sn,wn,Cn]=df.toChannels(h.rgba),{css:Hn.toCss(Sn,wn,Cn,Yt),rgba:Hn.toRgba(Sn,wn,Cn,Yt)}}e.opacity=a;function l(h,d){return Yt=h.rgba&255,a(h,Yt*d/255)}e.multiplyOpacity=l;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(FY||(FY={}));var Ln;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Sn=parseInt(s.slice(1,2).repeat(2),16),wn=parseInt(s.slice(2,3).repeat(2),16),Cn=parseInt(s.slice(3,4).repeat(2),16),Hn.toColor(Sn,wn,Cn);case 5:return Sn=parseInt(s.slice(1,2).repeat(2),16),wn=parseInt(s.slice(2,3).repeat(2),16),Cn=parseInt(s.slice(3,4).repeat(2),16),Yt=parseInt(s.slice(4,5).repeat(2),16),Hn.toColor(Sn,wn,Cn,Yt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return Sn=parseInt(a[1]),wn=parseInt(a[2]),Cn=parseInt(a[3]),Yt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Hn.toColor(Sn,wn,Cn,Yt);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),[Sn,wn,Cn,Yt]=t.getImageData(0,0,1,1).data,Yt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Hn.toRgba(Sn,wn,Cn,Yt),css:s}}e.toColor=r})(Ln||(Ln={}));var Vn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,a){let l=r/255,u=s/255,h=a/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),m=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+m*.7152+p*.0722}e.relativeLuminance2=n})(Vn||(Vn={}));var df;(e=>{function t(l,u){if(Yt=(u&255)/255,Yt===1)return u;let h=u>>24&255,d=u>>16&255,m=u>>8&255,p=l>>24&255,_=l>>16&255,b=l>>8&255;return Sn=p+Math.round((h-p)*Yt),wn=_+Math.round((d-_)*Yt),Cn=b+Math.round((m-b)*Yt),Hn.toRgba(Sn,wn,Cn)}e.blend=t;function n(l,u,h){let d=Vn.relativeLuminance(l>>8),m=Vn.relativeLuminance(u>>8);if(ss(d,m)<h){if(m<d){let b=r(l,u,h),S=ss(d,Vn.relativeLuminance(b>>8));if(S<h){let w=s(l,u,h),C=ss(d,Vn.relativeLuminance(w>>8));return S>C?b:w}return b}let p=s(l,u,h),_=ss(d,Vn.relativeLuminance(p>>8));if(_<h){let b=r(l,u,h),S=ss(d,Vn.relativeLuminance(b>>8));return _>S?p:b}return p}}e.ensureContrastRatio=n;function r(l,u,h){let d=l>>24&255,m=l>>16&255,p=l>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=ss(Vn.relativeLuminance2(_,b,S),Vn.relativeLuminance2(d,m,p));for(;w<h&&(_>0||b>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),b-=Math.max(0,Math.ceil(b*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=ss(Vn.relativeLuminance2(_,b,S),Vn.relativeLuminance2(d,m,p));return(_<<24|b<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,h){let d=l>>24&255,m=l>>16&255,p=l>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=ss(Vn.relativeLuminance2(_,b,S),Vn.relativeLuminance2(d,m,p));for(;w<h&&(_<255||b<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=ss(Vn.relativeLuminance2(_,b,S),Vn.relativeLuminance2(d,m,p));return(_<<24|b<<16|S<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(df||(df={}));function Fo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function ss(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var UY=Object.freeze((()=>{let e=[Ln.toColor("#2e3436"),Ln.toColor("#cc0000"),Ln.toColor("#4e9a06"),Ln.toColor("#c4a000"),Ln.toColor("#3465a4"),Ln.toColor("#75507b"),Ln.toColor("#06989a"),Ln.toColor("#d3d7cf"),Ln.toColor("#555753"),Ln.toColor("#ef2929"),Ln.toColor("#8ae234"),Ln.toColor("#fce94f"),Ln.toColor("#729fcf"),Ln.toColor("#ad7fa8"),Ln.toColor("#34e2e2"),Ln.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],a=t[n%6];e.push({css:Hn.toCss(r,s,a),rgba:Hn.toRgba(r,s,a)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Hn.toCss(r,r,r),rgba:Hn.toRgba(r,r,r)})}return e})());function kk(e,t,n){return Math.max(t,Math.min(e,n))}function $Y(e){switch(e){case"&":return"&";case"<":return"<"}return e}var s5=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),a=r,l=t.start.y,u=t.end.y,h=t.start.x,d=t.end.x;this._beforeSerialize(u-l,l,u);for(let m=l;m<=u;m++){let p=this._buffer.getLine(m);if(p){let _=m===t.start.y?h:0,b=m===t.end.y?d:p.length;for(let S=_;S<b;S++){let w=p.getCell(S,a===r?s:r);if(!w){console.warn(`Can't get cell at row=${m}, col=${S}`);continue}this._nextCell(w,a,m,S),a=w}}this._rowEnd(m,m===u)}return this._afterSerialize(),this._serializeString(n)}_nextCell(t,n,r,s){}_rowEnd(t,n){}_beforeSerialize(t,n,r){}_afterSerialize(){}_serializeString(t){return""}};function o5(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function ls(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function a5(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 WY=class extends s5{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&&!ls(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!n){t-this._firstRow>=this._terminal.rows&&((s=this._buffer.getLine(this._cursorStyleRow))==null||s.getCell(this._cursorStyleCol,this._backgroundCell));let a=this._buffer.getLine(t),l=this._buffer.getLine(t+1);if(!l.isWrapped)r=`\r
|
|
569
|
-
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{r="";let u=a.getCell(a.length-1,this._thisRowLastChar),h=a.getCell(a.length-2,this._thisRowLastSecondChar),d=l.getCell(0,this._nextRowFirstChar),m=d.getWidth()>1,p=!1;(d.getChars()&&m?this._nullCellCount<=1:this._nullCellCount<=0)&&((u.getChars()||u.getWidth()===0)&&ls(u,d)&&(p=!0),m&&(h.getChars()||h.getWidth()===0)&&ls(u,d)&&ls(h,d)&&(p=!0)),p||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${a.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${a.length-this._nullCellCount}D`,r+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=r,this._currentRow="",this._nullCellCount=0}_diffStyle(t,n){let r=[],s=!o5(t,n),a=!ls(t,n),l=!a5(t,n);if(s||a||l)if(t.isAttributeDefault())n.isAttributeDefault()||r.push(0);else{if(s){let u=t.getFgColor();t.isFgRGB()?r.push(38,2,u>>>16&255,u>>>8&255,u&255):t.isFgPalette()?u>=16?r.push(38,5,u):r.push(u&8?90+(u&7):30+(u&7)):r.push(39)}if(a){let u=t.getBgColor();t.isBgRGB()?r.push(48,2,u>>>16&255,u>>>8&255,u&255):t.isBgPalette()?u>=16?r.push(48,5,u):r.push(u&8?100+(u&7):40+(u&7)):r.push(49)}l&&(t.isInverse()!==n.isInverse()&&r.push(t.isInverse()?7:27),t.isBold()!==n.isBold()&&r.push(t.isBold()?1:22),t.isUnderline()!==n.isUnderline()&&r.push(t.isUnderline()?4:24),t.isOverline()!==n.isOverline()&&r.push(t.isOverline()?53:55),t.isBlink()!==n.isBlink()&&r.push(t.isBlink()?5:25),t.isInvisible()!==n.isInvisible()&&r.push(t.isInvisible()?8:28),t.isItalic()!==n.isItalic()&&r.push(t.isItalic()?3:23),t.isDim()!==n.isDim()&&r.push(t.isDim()?2:22),t.isStrikethrough()!==n.isStrikethrough()&&r.push(t.isStrikethrough()?9:29))}return r}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let a=t.getChars()==="",l=this._diffStyle(t,this._cursorStyle);if(a?!ls(this._cursorStyle,t):l.length>0){this._nullCellCount>0&&(ls(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s,this._currentRow+=`\x1B[${l.join(";")}m`;let u=this._buffer.getLine(r);u!==void 0&&(u.getCell(s,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=s)}a?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(ls(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s+t.getWidth())}_serializeString(t){let n=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(n=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let r="";for(let l=0;l<n;l++)r+=this._allRows[l],l+1<n&&(r+=this._allRowSeparators[l]);if(!t){let l=this._buffer.baseY+this._buffer.cursorY,u=this._buffer.cursorX,h=l!==this._lastCursorRow||u!==this._lastCursorCol,d=m=>{m>0?r+=`\x1B[${m}C`:m<0&&(r+=`\x1B[${-m}D`)};h&&((m=>{m>0?r+=`\x1B[${m}B`:m<0&&(r+=`\x1B[${-m}A`)})(l-this._lastCursorRow),d(u-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,a=this._diffStyle(s,this._cursorStyle);return a.length>0&&(r+=`\x1B[${a.join(";")}m`),r}},VY=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let s=n.length,a=r===void 0?s:kk(r+t.rows,0,s);return this._serializeBufferByRange(t,n,{start:s-a,end:s-1},!1)}_serializeBufferByRange(t,n,r,s){return new WY(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 qY(r,t,n),a=n.onlySelection??!1,l=n.range;if(l)return s.serialize({start:{x:l.startCol,y:(l.startLine,l.startLine)},end:{x:t.cols,y:(l.endLine,l.endLine)}});if(!a){let d=r.length,m=n.scrollback,p=m===void 0?d:kk(m+t.rows,0,d);return s.serialize({start:{x:0,y:d-p},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(){}},qY=class extends s5{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=UY}_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",a="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((u=this._terminal.options.theme)==null?void 0:u.foreground)??"#ffffff",a=((h=this._terminal.options.theme)==null?void 0:h.background)??"#000000");let l=[];l.push("color: "+s+";"),l.push("background-color: "+a+";"),l.push("font-family: "+this._terminal.options.fontFamily+";"),l.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+l.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,n){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,n){let r=n?t.getFgColor():t.getBgColor();if(n?t.isFgRGB():t.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(s=>this._padStart(s.toString(16),2,"0")).join("");if(n?t.isFgPalette():t.isBgPalette())return this._ansiColors[r].css}_diffStyle(t,n){let r=[],s=!o5(t,n),a=!ls(t,n),l=!a5(t,n);if(s||a||l){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 a=t.getChars()==="",l=this._diffStyle(t,n);l&&(this._currentRow+=l.length===0?"</span><span>":"</span><span style='"+l.join(" ")+"'>"),a?this._currentRow+=" ":this._currentRow+=$Y(t.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
570
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
571
|
-
* @license MIT
|
|
572
|
-
*
|
|
573
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
574
|
-
* @license MIT
|
|
575
|
-
*
|
|
576
|
-
* Originally forked from (with the author's permission):
|
|
577
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
578
|
-
* http://bellard.org/jslinux/
|
|
579
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
580
|
-
*/var KY=class{constructor(t,n,r,s={}){this._terminal=t,this._regex=n,this._handler=r,this._options=s}provideLinks(t,n){let r=YY.computeLink(t,this._regex,this._terminal,this._handler);n(this._addCallbacks(r))}_addCallbacks(t){return t.map(n=>(n.leave=this._options.leave,n.hover=(r,s)=>{if(this._options.hover){let{range:a}=n;this._options.hover(r,s,a)}},n))}};function GY(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 YY=class hf{static computeLink(t,n,r,s){let a=new RegExp(n.source,(n.flags||"")+"g"),[l,u]=hf._getWindowedLineStrings(t-1,r),h=l.join(""),d,m=[];for(;d=a.exec(h);){let p=d[0];if(!GY(p))continue;let[_,b]=hf._mapStrIdx(r,u,0,d.index),[S,w]=hf._mapStrIdx(r,_,b,p.length);if(_===-1||b===-1||S===-1||w===-1)continue;let C={start:{x:b+1,y:_+1},end:{x:w,y:S+1}};m.push({range:C,text:p,activate:s})}return m}static _getWindowedLineStrings(t,n){let r,s=t,a=t,l=0,u="",h=[];if(r=n.buffer.active.getLine(t)){let d=r.translateToString(!0);if(r.isWrapped&&d[0]!==" "){for(l=0;(r=n.buffer.active.getLine(--s))&&l<2048&&(u=r.translateToString(!0),l+=u.length,h.push(u),!(!r.isWrapped||u.indexOf(" ")!==-1)););h.reverse()}for(h.push(d),l=0;(r=n.buffer.active.getLine(++a))&&r.isWrapped&&l<2048&&(u=r.translateToString(!0),l+=u.length,h.push(u),u.indexOf(" ")===-1););}return[h,s]}static _mapStrIdx(t,n,r,s){let a=t.buffer.active,l=a.getNullCell(),u=r;for(;s;){let h=a.getLine(n);if(!h)return[-1,-1];for(let d=u;d<h.length;++d){h.getCell(d,l);let m=l.getChars();if(l.getWidth()&&(s-=m.length||1,d===h.length-1&&m==="")){let p=a.getLine(n+1);p&&p.isWrapped&&(p.getCell(0,l),l.getWidth()===2&&(s+=1))}if(s<0)return[n,d]}n++,u=0}return[n,u]}},XY=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function ZY(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 QY=class{constructor(t=ZY,n={}){this._handler=t,this._options=n}activate(t){this._terminal=t;let n=this._options,r=n.urlRegex||XY;this._linkProvider=this._terminal.registerLinkProvider(new KY(this._terminal,r,this._handler,n))}dispose(){var t;(t=this._linkProvider)==null||t.dispose()}};/**
|
|
581
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
582
|
-
* @license MIT
|
|
583
|
-
*
|
|
584
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
585
|
-
* @license MIT
|
|
586
|
-
*
|
|
587
|
-
* Originally forked from (with the author's permission):
|
|
588
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
589
|
-
* http://bellard.org/jslinux/
|
|
590
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
591
|
-
*/var l5=Object.defineProperty,JY=Object.getOwnPropertyDescriptor,eX=(e,t)=>{for(var n in t)l5(e,n,{get:t[n],enumerable:!0})},Zt=(e,t,n,r)=>{for(var s=r>1?void 0:r?JY(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(s=(r?l(t,n,s):l(s))||s);return r&&s&&l5(t,n,s),s},Te=(e,t)=>(n,r)=>t(n,r,e),Ek="Terminal input",ey={get:()=>Ek,set:e=>Ek=e},Rk="Too much output to announce, navigate to rows manually to read",ty={get:()=>Rk,set:e=>Rk=e};function tX(e){return e.replace(/\r?\n/g,"\r")}function nX(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function rX(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function iX(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");c5(s,t,n,r)}}function c5(e,t,n,r){e=tX(e),e=nX(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function u5(e,t,n){let r=n.getBoundingClientRect(),s=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${a}px`,t.style.zIndex="1000",t.focus()}function Tk(e,t,n,r,s){u5(e,t,n),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function to(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function jp(e,t=0,n=e.length){let r="";for(let s=t;s<n;++s){let a=e[s];a>65535?(a-=65536,r+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):r+=String.fromCharCode(a)}return r}var sX=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s=0;if(this._interim){let a=e.charCodeAt(s++);56320<=a&&a<=57343?t[r++]=(this._interim-55296)*1024+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0}for(let a=s;a<n;++a){let l=e.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=n)return this._interim=l,r;let u=e.charCodeAt(a);56320<=u&&u<=57343?t[r++]=(l-55296)*1024+u-56320+65536:(t[r++]=l,t[r++]=u);continue}l!==65279&&(t[r++]=l)}return r}},oX=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s,a,l,u,h=0,d=0;if(this.interim[0]){let _=!1,b=this.interim[0];b&=(b&224)===192?31:(b&240)===224?15:7;let S=0,w;for(;(w=this.interim[++S]&63)&&S<4;)b<<=6,b|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-S;for(;d<k;){if(d>=n)return 0;if(w=e[d++],(w&192)!==128){d--,_=!0;break}else this.interim[S++]=w,b<<=6,b|=w&63}_||(C===2?b<128?d--:t[r++]=b:C===3?b<2048||b>=55296&&b<=57343||b===65279||(t[r++]=b):b<65536||b>1114111||(t[r++]=b)),this.interim.fill(0)}let m=n-4,p=d;for(;p<n;){for(;p<m&&!((s=e[p])&128)&&!((a=e[p+1])&128)&&!((l=e[p+2])&128)&&!((u=e[p+3])&128);)t[r++]=s,t[r++]=a,t[r++]=l,t[r++]=u,p+=4;if(s=e[p++],s<128)t[r++]=s;else if((s&224)===192){if(p>=n)return this.interim[0]=s,r;if(a=e[p++],(a&192)!==128){p--;continue}if(h=(s&31)<<6|a&63,h<128){p--;continue}t[r++]=h}else if((s&240)===224){if(p>=n)return this.interim[0]=s,r;if(a=e[p++],(a&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=a,r;if(l=e[p++],(l&192)!==128){p--;continue}if(h=(s&15)<<12|(a&63)<<6|l&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[r++]=h}else if((s&248)===240){if(p>=n)return this.interim[0]=s,r;if(a=e[p++],(a&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=a,r;if(l=e[p++],(l&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=a,this.interim[2]=l,r;if(u=e[p++],(u&192)!==128){p--;continue}if(h=(s&7)<<18|(a&63)<<12|(l&63)<<6|u&63,h<65536||h>1114111)continue;t[r++]=h}}return r}},d5="",so=" ",od=class h5{constructor(){this.fg=0,this.bg=0,this.extended=new Vf}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 h5;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}},Vf=class f5{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 f5(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Yr=class p5 extends od{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Vf,this.combinedData=""}static fromCharData(t){let n=new p5;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?to(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()]}},Mk="di$target",ny="di$dependencies",Kv=new Map;function aX(e){return e[ny]||[]}function Tn(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");lX(t,n,s)};return t._id=e,Kv.set(e,t),t}function lX(e,t,n){t[Mk]===t?t[ny].push({id:e,index:n}):(t[ny]=[{id:e,index:n}],t[Mk]=t)}var Zn=Tn("BufferService"),m5=Tn("CoreMouseService"),ma=Tn("CoreService"),cX=Tn("CharsetService"),L0=Tn("InstantiationService"),g5=Tn("LogService"),Qn=Tn("OptionsService"),v5=Tn("OscLinkService"),uX=Tn("UnicodeService"),ad=Tn("DecorationService"),ry=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var m;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],s=this._optionsService.rawOptions.linkHandler,a=new Yr,l=n.getTrimmedLength(),u=-1,h=-1,d=!1;for(let p=0;p<l;p++)if(!(h===-1&&!n.hasContent(p))){if(n.loadCell(p,a),a.hasExtendedAttrs()&&a.extended.urlId)if(h===-1){h=p,u=a.extended.urlId;continue}else d=a.extended.urlId!==u;else h!==-1&&(d=!0);if(d||h!==-1&&p===l-1){let _=(m=this._oscLinkService.getLinkData(u))==null?void 0:m.uri;if(_){let b={start:{x:h+1,y:e},end:{x:p+(!d&&p===l-1?1:0),y:e}},S=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let w=new URL(_);["http:","https:"].includes(w.protocol)||(S=!0)}catch{S=!0}S||r.push({text:_,range:b,activate:(w,C)=>s?s.activate(w,C,b):dX(w,C),hover:(w,C)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,w,C,b)},leave:(w,C)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,w,C,b)}})}d=!1,a.hasExtendedAttrs()&&a.extended.urlId?(h=p,u=a.extended.urlId):(h=-1,u=-1)}}t(r)}};ry=Zt([Te(0,Zn),Te(1,Qn),Te(2,v5)],ry);function dX(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
592
|
-
|
|
593
|
-
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 zp=Tn("CharSizeService"),bs=Tn("CoreBrowserService"),j0=Tn("MouseService"),xs=Tn("RenderService"),hX=Tn("SelectionService"),_5=Tn("CharacterJoinerService"),Kl=Tn("ThemeService"),y5=Tn("LinkProviderService"),fX=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Nk.isErrorNoTelemetry(e)?new Nk(e.message+`
|
|
594
|
-
|
|
595
|
-
`+e.stack):new Error(e.message+`
|
|
596
|
-
|
|
597
|
-
`+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)}},pX=new fX;function ff(e){mX(e)||pX.onUnexpectedError(e)}var iy="Canceled";function mX(e){return e instanceof gX?!0:e instanceof Error&&e.name===iy&&e.message===iy}var gX=class extends Error{constructor(){super(iy),this.name=this.message}};function vX(e){return new Error(`Illegal argument: ${e}`)}var Nk=class sy extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof sy)return t;let n=new sy;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},oy=class b5 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,b5.prototype)}};function Sr(e,t=0){return e[e.length-(1+t)]}var _X;(e=>{function t(a){return a<0}e.isLessThan=t;function n(a){return a<=0}e.isLessThanOrEqual=n;function r(a){return a>0}e.isGreaterThan=r;function s(a){return a===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(_X||(_X={}));function yX(e,t){let n=this,r=!1,s;return function(){return r||(r=!0,t||(s=e.apply(n,arguments))),s}}var x5;(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 a(M){return t(M)?M:s(M)}e.wrap=a;function l(M){return M||n}e.from=l;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 m(M,L){let O=0;for(let j of M)if(L(j,O++))return!0;return!1}e.some=m;function p(M,L){for(let O of M)if(L(O))return O}e.find=p;function*_(M,L){for(let O of M)L(O)&&(yield O)}e.filter=_;function*b(M,L){let O=0;for(let j of M)yield L(j,O++)}e.map=b;function*S(M,L){let O=0;for(let j of M)yield*L(j,O++)}e.flatMap=S;function*w(...M){for(let L of M)yield*L}e.concat=w;function C(M,L,O){let j=O;for(let F of M)j=L(j,F);return j}e.reduce=C;function*k(M,L,O=M.length){for(L<0&&(L+=M.length),O<0?O+=M.length:O>M.length&&(O=M.length);L<O;L++)yield M[L]}e.slice=k;function T(M,L=Number.POSITIVE_INFINITY){let O=[];if(L===0)return[O,M];let j=M[Symbol.iterator]();for(let F=0;F<L;F++){let G=j.next();if(G.done)return[O,e.empty()];O.push(G.value)}return[O,{[Symbol.iterator](){return j}}]}e.consume=T;async function R(M){let L=[];for await(let O of M)L.push(O);return Promise.resolve(L)}e.asyncToArray=R})(x5||(x5={}));function ia(e){if(x5.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 bX(...e){return Ut(()=>ia(e))}function Ut(e){return{dispose:yX(()=>{e()})}}var S5=class w5{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{ia(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?w5.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)}};S5.DISABLE_DISPOSED_WARNING=!1;var ao=S5,Je=class{constructor(){this._store=new ao,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)}};Je.None=Object.freeze({dispose(){}});var Ml=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}},us=typeof window=="object"?window:globalThis,ay=class ly{constructor(t){this.element=t,this.next=ly.Undefined,this.prev=ly.Undefined}};ay.Undefined=new ay(void 0);var Vt=ay,Ak=class{constructor(){this._first=Vt.Undefined,this._last=Vt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Vt.Undefined}clear(){let e=this._first;for(;e!==Vt.Undefined;){let t=e.next;e.prev=Vt.Undefined,e.next=Vt.Undefined,e=t}this._first=Vt.Undefined,this._last=Vt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Vt(e);if(this._first===Vt.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!==Vt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Vt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Vt.Undefined&&e.next!==Vt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Vt.Undefined&&e.next===Vt.Undefined?(this._first=Vt.Undefined,this._last=Vt.Undefined):e.next===Vt.Undefined?(this._last=this._last.prev,this._last.next=Vt.Undefined):e.prev===Vt.Undefined&&(this._first=this._first.next,this._first.prev=Vt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Vt.Undefined;)yield e.element,e=e.next}},xX=globalThis.performance&&typeof globalThis.performance.now=="function",SX=class C5{static create(t){return new C5(t)}constructor(t){this._now=xX&&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}},zn;(e=>{e.None=()=>Je.None;function t(B,U){return p(B,()=>{},0,void 0,!0,void 0,U)}e.defer=t;function n(B){return(U,$=null,W)=>{let z=!1,q;return q=B(V=>{if(!z)return q?q.dispose():z=!0,U.call($,V)},null,W),z&&q.dispose(),q}}e.once=n;function r(B,U,$){return d((W,z=null,q)=>B(V=>W.call(z,U(V)),null,q),$)}e.map=r;function s(B,U,$){return d((W,z=null,q)=>B(V=>{U(V),W.call(z,V)},null,q),$)}e.forEach=s;function a(B,U,$){return d((W,z=null,q)=>B(V=>U(V)&&W.call(z,V),null,q),$)}e.filter=a;function l(B){return B}e.signal=l;function u(...B){return(U,$=null,W)=>{let z=bX(...B.map(q=>q(V=>U.call($,V))));return m(z,W)}}e.any=u;function h(B,U,$,W){let z=$;return r(B,q=>(z=U(z,q),z),W)}e.reduce=h;function d(B,U){let $,W={onWillAddFirstListener(){$=B(z.fire,z)},onDidRemoveLastListener(){$==null||$.dispose()}},z=new ke(W);return U==null||U.add(z),z.event}function m(B,U){return U instanceof Array?U.push(B):U&&U.add(B),B}function p(B,U,$=100,W=!1,z=!1,q,V){let X,N,I,Z=0,D,ce={leakWarningThreshold:q,onWillAddFirstListener(){X=B(ae=>{Z++,N=U(N,ae),W&&!I&&(pe.fire(N),N=void 0),D=()=>{let Q=N;N=void 0,I=void 0,(!W||Z>1)&&pe.fire(Q),Z=0},typeof $=="number"?(clearTimeout(I),I=setTimeout(D,$)):I===void 0&&(I=0,queueMicrotask(D))})},onWillRemoveListener(){z&&Z>0&&(D==null||D())},onDidRemoveLastListener(){D=void 0,X.dispose()}},pe=new ke(ce);return V==null||V.add(pe),pe.event}e.debounce=p;function _(B,U=0,$){return e.debounce(B,(W,z)=>W?(W.push(z),W):[z],U,void 0,!0,void 0,$)}e.accumulate=_;function b(B,U=(W,z)=>W===z,$){let W=!0,z;return a(B,q=>{let V=W||!U(q,z);return W=!1,z=q,V},$)}e.latch=b;function S(B,U,$){return[e.filter(B,U,$),e.filter(B,W=>!U(W),$)]}e.split=S;function w(B,U=!1,$=[],W){let z=$.slice(),q=B(N=>{z?z.push(N):X.fire(N)});W&&W.add(q);let V=()=>{z==null||z.forEach(N=>X.fire(N)),z=null},X=new ke({onWillAddFirstListener(){q||(q=B(N=>X.fire(N)),W&&W.add(q))},onDidAddFirstListener(){z&&(U?setTimeout(V):V())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return W&&W.add(X),X.event}e.buffer=w;function C(B,U){return($,W,z)=>{let q=U(new T);return B(function(V){let X=q.evaluate(V);X!==k&&$.call(W,X)},void 0,z)}}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($=>(U($),$)),this}filter(U){return this.steps.push($=>U($)?$:k),this}reduce(U,$){let W=$;return this.steps.push(z=>(W=U(W,z),W)),this}latch(U=($,W)=>$===W){let $=!0,W;return this.steps.push(z=>{let q=$||!U(z,W);return $=!1,W=z,q?z:k}),this}evaluate(U){for(let $ of this.steps)if(U=$(U),U===k)break;return U}}function R(B,U,$=W=>W){let W=(...X)=>V.fire($(...X)),z=()=>B.on(U,W),q=()=>B.removeListener(U,W),V=new ke({onWillAddFirstListener:z,onDidRemoveLastListener:q});return V.event}e.fromNodeEventEmitter=R;function M(B,U,$=W=>W){let W=(...X)=>V.fire($(...X)),z=()=>B.addEventListener(U,W),q=()=>B.removeEventListener(U,W),V=new ke({onWillAddFirstListener:z,onDidRemoveLastListener:q});return V.event}e.fromDOMEventEmitter=M;function L(B){return new Promise(U=>n(B)(U))}e.toPromise=L;function O(B){let U=new ke;return B.then($=>{U.fire($)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}e.fromPromise=O;function j(B,U){return B($=>U.fire($))}e.forward=j;function F(B,U,$){return U($),B(W=>U(W))}e.runAndSubscribe=F;class G{constructor(U,$){this._observable=U,this._counter=0,this._hasChanged=!1;let W={onWillAddFirstListener:()=>{U.addObserver(this)},onDidRemoveLastListener:()=>{U.removeObserver(this)}};this.emitter=new ke(W),$&&$.add(this.emitter)}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,$){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 P(B,U){return new G(B,U).emitter.event}e.fromObservable=P;function H(B){return(U,$,W)=>{let z=0,q=!1,V={beginUpdate(){z++},endUpdate(){z--,z===0&&(B.reportChanges(),q&&(q=!1,U.call($)))},handlePossibleChange(){},handleChange(){q=!0}};B.addObserver(V),B.reportChanges();let X={dispose(){B.removeObserver(V)}};return W instanceof ao?W.add(X):Array.isArray(W)&&W.push(X),X}}e.fromObservableLight=H})(zn||(zn={}));var cy=class uy{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${uy._idPool++}`,uy.all.add(this)}start(t){this._stopWatch=new SX,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}}};cy.all=new Set,cy._idPool=0;var wX=cy,CX=-1,k5=class E5{constructor(t,n,r=(E5._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[a,l]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${l}):`;console.warn(u),console.warn(a);let h=new RX(u,a);this._errorHandler(h)}return()=>{let a=this._stacks.get(t.value)||0;this._stacks.set(t.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,s]of this._stacks)(!t||n<s)&&(t=[r,s],n=s);return t}};k5._idPool=1;var kX=k5,EX=class R5{constructor(t){this.value=t}static create(){let t=new Error;return new R5(t.stack??"")}print(){console.warn(this.value.split(`
|
|
598
|
-
`).slice(2).join(`
|
|
599
|
-
`))}},RX=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},TX=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},MX=0,Gv=class{constructor(e){this.value=e,this.id=MX++}},NX=2,AX,ke=class{constructor(e){var t,n,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new kX((e==null?void 0:e.onListenerError)??ff,((n=this._options)==null?void 0:n.leakWarningThreshold)??CX):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new wX(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var l,u,h,d,m;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let p=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(p);let _=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],b=new TX(`${p}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(((l=this._options)==null?void 0:l.onListenerError)||ff)(b),Je.None}if(this._disposed)return Je.None;t&&(e=e.bind(t));let r=new Gv(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=EX.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Gv?(this._deliveryQueue??(this._deliveryQueue=new DX),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,(m=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||m.call(d,this)),this._size++;let a=Ut(()=>{s==null||s(),this._removeListener(r)});return n instanceof ao?n.add(a):Array.isArray(n)&&n.push(a),a}),this._event}_removeListener(e){var s,a,l,u;if((a=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||a.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||u.call(l,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*NX<=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)||ff;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 Gv)this._deliver(this._listeners,e);else{let a=this._deliveryQueue;a.enqueue(this,e,this._listeners.length),this._deliverQueue(a)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},DX=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}},dy=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ke,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ke,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}};dy.INSTANCE=new dy;var z0=dy;function OX(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}z0.INSTANCE.onDidChangeZoomLevel;function LX(e){return z0.INSTANCE.getZoomFactor(e)}z0.INSTANCE.onDidChangeFullscreen;var Gl=typeof navigator=="object"?navigator.userAgent:"",hy=Gl.indexOf("Firefox")>=0,jX=Gl.indexOf("AppleWebKit")>=0,P0=Gl.indexOf("Chrome")>=0,zX=!P0&&Gl.indexOf("Safari")>=0;Gl.indexOf("Electron/")>=0;Gl.indexOf("Android")>=0;var Yv=!1;if(typeof us.matchMedia=="function"){let e=us.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=us.matchMedia("(display-mode: fullscreen)");Yv=e.matches,OX(us,e,({matches:n})=>{Yv&&t.matches||(Yv=n)})}var pl="en",fy=!1,py=!1,pf=!1,T5=!1,Uh,mf=pl,Dk=pl,PX,si,Xo=globalThis,jn,qE;typeof Xo.vscode<"u"&&typeof Xo.vscode.process<"u"?jn=Xo.vscode.process:typeof process<"u"&&typeof((qE=process==null?void 0:process.versions)==null?void 0:qE.node)=="string"&&(jn=process);var KE,BX=typeof((KE=jn==null?void 0:jn.versions)==null?void 0:KE.electron)=="string",IX=BX&&(jn==null?void 0:jn.type)==="renderer",GE;if(typeof jn=="object"){fy=jn.platform==="win32",py=jn.platform==="darwin",pf=jn.platform==="linux",pf&&jn.env.SNAP&&jn.env.SNAP_REVISION,jn.env.CI||jn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Uh=pl,mf=pl;let e=jn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Uh=t.userLocale,Dk=t.osLocale,mf=t.resolvedLanguage||pl,PX=(GE=t.languagePack)==null?void 0:GE.translationsConfigFile}catch{}T5=!0}else typeof navigator=="object"&&!IX?(si=navigator.userAgent,fy=si.indexOf("Windows")>=0,py=si.indexOf("Macintosh")>=0,(si.indexOf("Macintosh")>=0||si.indexOf("iPad")>=0||si.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,pf=si.indexOf("Linux")>=0,(si==null?void 0:si.indexOf("Mobi"))>=0,mf=globalThis._VSCODE_NLS_LANGUAGE||pl,Uh=navigator.language.toLowerCase(),Dk=Uh):console.error("Unable to resolve platform.");var M5=fy,Ai=py,HX=pf,Ok=T5,Li=si,Ys=mf,FX;(e=>{function t(){return Ys}e.value=t;function n(){return Ys.length===2?Ys==="en":Ys.length>=3?Ys[0]==="e"&&Ys[1]==="n"&&Ys[2]==="-":!1}e.isDefaultVariant=n;function r(){return Ys==="en"}e.isDefault=r})(FX||(FX={}));var UX=typeof Xo.postMessage=="function"&&!Xo.importScripts;(()=>{if(UX){let e=[];Xo.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=e.length;r<s;r++){let a=e[r];if(a.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),a.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Xo.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var $X=!!(Li&&Li.indexOf("Chrome")>=0);Li&&Li.indexOf("Firefox")>=0;!$X&&Li&&Li.indexOf("Safari")>=0;Li&&Li.indexOf("Edg/")>=0;Li&&Li.indexOf("Android")>=0;var al=typeof navigator=="object"?navigator:{};Ok||document.queryCommandSupported&&document.queryCommandSupported("copy")||al&&al.clipboard&&al.clipboard.writeText,Ok||al&&al.clipboard&&al.clipboard.readText;var B0=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}},Xv=new B0,Lk=new B0,jk=new B0,WX=new Array(230),N5;(e=>{function t(u){return Xv.keyCodeToStr(u)}e.toString=t;function n(u){return Xv.strToKeyCode(u)}e.fromString=n;function r(u){return Lk.keyCodeToStr(u)}e.toUserSettingsUS=r;function s(u){return jk.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function a(u){return Lk.strToKeyCode(u)||jk.strToKeyCode(u)}e.fromUserSettings=a;function l(u){if(u>=98&&u<=113)return null;switch(u){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Xv.keyCodeToStr(u)}e.toElectronAccelerator=l})(N5||(N5={}));var VX=class A5{constructor(t,n,r,s,a){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=a}equals(t){return t instanceof A5&&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 qX([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},qX=class{constructor(e){if(e.length===0)throw vX("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 KX(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return N5.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(hy)switch(t){case 59:return 85;case 60:if(HX)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ai)return 57;break}else if(jX&&(Ai&&t===93||!Ai&&t===92))return 57;return WX[t]||0}var GX=Ai?256:2048,YX=512,XX=1024,ZX=Ai?2048:256,zk=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=KX(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|=GX),this.altKey&&(t|=YX),this.shiftKey&&(t|=XX),this.metaKey&&(t|=ZX),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new VX(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Pk=new WeakMap;function QX(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 JX=class{static getSameOriginWindowChain(e){let t=Pk.get(e);if(!t){t=[],Pk.set(e,t);let n=e,r;do r=QX(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,s=this.getSameOriginWindowChain(e);for(let a of s){let l=a.window.deref();if(n+=(l==null?void 0:l.scrollY)??0,r+=(l==null?void 0:l.scrollX)??0,l===t||!a.iframeElement)break;let u=a.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},$h=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=JX.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Bk=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(P0){let a=navigator.userAgent.match(/Chrome\/(\d+)/);r=(a?parseInt(a[1]):123)<=122}if(e){let a=e,l=e,u=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof a.wheelDeltaY<"u")r?this.deltaY=a.wheelDeltaY/(120*u):this.deltaY=a.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?hy&&!Ai?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")zX&&M5?this.deltaX=-(a.wheelDeltaX/120):r?this.deltaX=a.wheelDeltaX/(120*u):this.deltaX=a.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?hy&&!Ai?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()}},D5=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),eZ;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof tZ?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:zn.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:D5})})(eZ||(eZ={}));var tZ=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?D5:(this._emitter||(this._emitter=new ke),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},I0=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 oy("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new oy("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},nZ=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 oy("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=Ut(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},rZ;(e=>{async function t(r){let s,a=await Promise.all(r.map(l=>l.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return a}e.settled=t;function n(r){return new Promise(async(s,a)=>{try{await r(s,a)}catch(l){a(l)}})}e.withAsyncBody=n})(rZ||(rZ={}));var Ik=class $r{static fromArray(t){return new $r(n=>{n.emitMany(t)})}static fromPromise(t){return new $r(async n=>{n.emitMany(await t)})}static fromPromises(t){return new $r(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new $r(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 ke,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 zn.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 $r(async r=>{for await(let s of t)r.emitOne(n(s))})}map(t){return $r.map(this,t)}static filter(t,n){return new $r(async r=>{for await(let s of t)n(s)&&r.emitOne(s)})}filter(t){return $r.filter(this,t)}static coalesce(t){return $r.filter(t,n=>!!n)}coalesce(){return $r.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return $r.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())}};Ik.EMPTY=Ik.fromArray([]);var{getWindow:Ti,getWindowId:iZ,onDidRegisterWindow:sZ}=(function(){let e=new Map,t={window:us,disposables:new ao};e.set(us.vscodeWindowId,t);let n=new ke,r=new ke,s=new ke;function a(l,u){return(typeof l=="number"?e.get(l):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:r.event,registerWindow(l){if(e.has(l.vscodeWindowId))return Je.None;let u=new ao,h={window:l,disposables:u.add(new ao)};return e.set(l.vscodeWindowId,h),u.add(Ut(()=>{e.delete(l.vscodeWindowId),r.fire(l)})),u.add(Ue(l,bn.BEFORE_UNLOAD,()=>{s.fire(l)})),n.fire(h),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:a,getWindow(l){var d;let u=l;if((d=u==null?void 0:u.ownerDocument)!=null&&d.defaultView)return u.ownerDocument.defaultView.window;let h=l;return h!=null&&h.view?h.view.window:us},getDocument(l){return Ti(l).document}}})(),oZ=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 Ue(e,t,n,r){return new oZ(e,t,n,r)}var Hk=function(e,t,n,r){return Ue(e,t,n,r)},H0,aZ=class extends nZ{constructor(e){super(),this.defaultTarget=e&&Ti(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},Fk=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){ff(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,s=a=>{n.set(a,!1);let l=e.get(a)??[];for(t.set(a,l),e.set(a,[]),r.set(a,!0);l.length>0;)l.sort(Fk.sort),l.shift().execute();r.set(a,!1)};H0=(a,l,u=0)=>{let h=iZ(a),d=new Fk(l,u),m=e.get(h);return m||(m=[],e.set(h,m)),m.push(d),n.get(h)||(n.set(h,!0),a.requestAnimationFrame(()=>s(h))),d}})();function lZ(e){let t=e.getBoundingClientRect(),n=Ti(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var bn={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"},cZ=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=ar(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ar(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ar(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ar(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ar(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ar(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ar(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ar(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ar(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ar(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ar(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=ar(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=ar(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ar(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 ar(e){return typeof e=="number"?`${e}px`:e}function Cu(e){return new cZ(e)}var O5=class{constructor(){this._hooks=new ao,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=s;let a=e;try{e.setPointerCapture(t),this._hooks.add(Ut(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=Ti(e)}this._hooks.add(Ue(a,bn.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Ue(a,bn.POINTER_UP,l=>this.stopMonitoring(!0)))}};function uZ(e,t,n){let r=null,s=null;if(typeof n.value=="function"?(r="value",s=n.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",s=n.get),!s)throw new Error("not supported");let a=`$memoize$${t}`;n[r]=function(...l){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,l)}),this[a]}}var xi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(xi||(xi={}));var au=class In extends Je{constructor(){super(),this.dispatched=!1,this.targets=new Ak,this.ignoreTargets=new Ak,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(zn.runAndSubscribe(sZ,({window:t,disposables:n})=>{n.add(Ue(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(Ue(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(Ue(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:us,disposables:this._store}))}static addTarget(t){if(!In.isTouchDevice())return Je.None;In.INSTANCE||(In.INSTANCE=new In);let n=In.INSTANCE.targets.push(t);return Ut(n)}static ignoreTarget(t){if(!In.isTouchDevice())return Je.None;In.INSTANCE||(In.INSTANCE=new In);let n=In.INSTANCE.ignoreTargets.push(t);return Ut(n)}static isTouchDevice(){return"ontouchstart"in us||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,s=t.targetTouches.length;r<s;r++){let a=t.targetTouches.item(r);this.activeTouches[a.identifier]={id:a.identifier,initialTarget:a.target,initialTimeStamp:n,initialPageX:a.pageX,initialPageY:a.pageY,rollingTimestamps:[n],rollingPageX:[a.pageX],rollingPageY:[a.pageY]};let l=this.newGestureEvent(xi.Start,a.target);l.pageX=a.pageX,l.pageY=a.pageY,this.dispatchEvent(l)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),s=Object.keys(this.activeTouches).length;for(let a=0,l=n.changedTouches.length;a<l;a++){let u=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let h=this.activeTouches[u.identifier],d=Date.now()-h.initialTimeStamp;if(d<In.HOLD_DELAY&&Math.abs(h.initialPageX-Sr(h.rollingPageX))<30&&Math.abs(h.initialPageY-Sr(h.rollingPageY))<30){let m=this.newGestureEvent(xi.Tap,h.initialTarget);m.pageX=Sr(h.rollingPageX),m.pageY=Sr(h.rollingPageY),this.dispatchEvent(m)}else if(d>=In.HOLD_DELAY&&Math.abs(h.initialPageX-Sr(h.rollingPageX))<30&&Math.abs(h.initialPageY-Sr(h.rollingPageY))<30){let m=this.newGestureEvent(xi.Contextmenu,h.initialTarget);m.pageX=Sr(h.rollingPageX),m.pageY=Sr(h.rollingPageY),this.dispatchEvent(m)}else if(s===1){let m=Sr(h.rollingPageX),p=Sr(h.rollingPageY),_=Sr(h.rollingTimestamps)-h.rollingTimestamps[0],b=m-h.rollingPageX[0],S=p-h.rollingPageY[0],w=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,w,r,Math.abs(b)/_,b>0?1:-1,m,Math.abs(S)/_,S>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(xi.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===xi.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>In.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===xi.Change||t.type===xi.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let s=0,a=t.initialTarget;for(;a&&a!==r;)s++,a=a.parentElement;n.push([s,r])}n.sort((r,s)=>r[0]-s[0]);for(let[r,s]of n)s.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,s,a,l,u,h,d){this.handle=H0(t,()=>{let m=Date.now(),p=m-r,_=0,b=0,S=!0;s+=In.SCROLL_FRICTION*p,u+=In.SCROLL_FRICTION*p,s>0&&(S=!1,_=a*s*p),u>0&&(S=!1,b=h*u*p);let w=this.newGestureEvent(xi.Change);w.translationX=_,w.translationY=b,n.forEach(C=>C.dispatchEvent(w)),S||this.inertia(t,n,m,s,a,l+_,u,h,d+b)})}onTouchMove(t){let n=Date.now();for(let r=0,s=t.changedTouches.length;r<s;r++){let a=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("end of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],u=this.newGestureEvent(xi.Change,l.initialTarget);u.translationX=a.pageX-Sr(l.rollingPageX),u.translationY=a.pageY-Sr(l.rollingPageY),u.pageX=a.pageX,u.pageY=a.pageY,this.dispatchEvent(u),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(a.pageX),l.rollingPageY.push(a.pageY),l.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};au.SCROLL_FRICTION=-.005,au.HOLD_DELAY=700,au.CLEAR_TAP_COUNT_TIME=400,Zt([uZ],au,"isTouchDevice",1);var dZ=au,F0=class extends Je{onclick(e,t){this._register(Ue(e,bn.CLICK,n=>t(new $h(Ti(e),n))))}onmousedown(e,t){this._register(Ue(e,bn.MOUSE_DOWN,n=>t(new $h(Ti(e),n))))}onmouseover(e,t){this._register(Ue(e,bn.MOUSE_OVER,n=>t(new $h(Ti(e),n))))}onmouseleave(e,t){this._register(Ue(e,bn.MOUSE_LEAVE,n=>t(new $h(Ti(e),n))))}onkeydown(e,t){this._register(Ue(e,bn.KEY_DOWN,n=>t(new zk(n))))}onkeyup(e,t){this._register(Ue(e,bn.KEY_UP,n=>t(new zk(n))))}oninput(e,t){this._register(Ue(e,bn.INPUT,t))}onblur(e,t){this._register(Ue(e,bn.BLUR,t))}onfocus(e,t){this._register(Ue(e,bn.FOCUS,t))}onchange(e,t){this._register(Ue(e,bn.CHANGE,t))}ignoreGesture(e){return dZ.ignoreTarget(e)}},Uk=11,hZ=class extends F0{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=Uk+"px",this.domNode.style.height=Uk+"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 O5),this._register(Hk(this.bgDomNode,bn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Hk(this.domNode,bn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new aZ),this._pointerdownScheduleRepeatTimer=this._register(new I0)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ti(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()}},fZ=class my{constructor(t,n,r,s,a,l,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,a=a|0,l=l|0,u=u|0),this.rawScrollLeft=s,this.rawScrollTop=u,n<0&&(n=0),s+n>r&&(s=r-n),s<0&&(s=0),a<0&&(a=0),u+a>l&&(u=l-a),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=a,this.scrollHeight=l,this.scrollTop=u}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new my(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 my(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let r=this.width!==t.width,s=this.scrollWidth!==t.scrollWidth,a=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,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:a,heightChanged:l,scrollHeightChanged:u,scrollTopChanged:h}}},pZ=class extends Je{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ke),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new fZ(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 Wk(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=Wk.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)))}},$k=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Zv(e,t){let n=t-e;return function(r){return e+n*vZ(r)}}function mZ(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var Wk=class gy{constructor(t,n,r,s){this.from=t,this.to=n,this.duration=s,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,r){if(Math.abs(t-n)>2.5*r){let s,a;return t<n?(s=t+.75*r,a=n-.75*r):(s=t-.75*r,a=n+.75*r),mZ(Zv(t,s),Zv(a,n),.33)}return Zv(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 $k(r,s,!1)}return new $k(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return gy.start(t,n,r)}static start(t,n,r){r=r+10;let s=Date.now()-10;return new gy(t,n,s,r)}};function gZ(e){return Math.pow(e,3)}function vZ(e){return 1-gZ(1-e)}var _Z=class extends Je{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 I0)}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":"")))}},yZ=140,L5=class extends F0{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 _Z(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new O5),this._shouldRender=!0,this.domNode=Cu(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(Ue(this.domNode.domNode,bn.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new hZ(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Cu(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(Ue(this.slider.domNode,bn.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=lZ(this.domNode.domNode);t=e.pageX-s.left,n=e.pageY-s.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let a=this._sliderOrthogonalPointerPosition(s),l=Math.abs(a-n);if(M5&&l>yZ){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()}},j5=class vy{constructor(t,n,r,s,a,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=a,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new vy(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,r,s,a){let l=Math.max(0,r-t),u=Math.max(0,l-2*n),h=s>0&&s>r;if(!h)return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*u/s))),m=(u-d)/(s-r),p=a*m;return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(d),computedSliderRatio:m,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let t=vy._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)}},bZ=class extends L5{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new j5(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}},xZ=class extends L5{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new j5(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}},SZ=500,Vk=50,wZ=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},_y=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,r=1,s=this._rear;do{let a=s===this._front?t:Math.pow(2,-r);if(t-=a,n+=this._memory[s].score*a,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(P0){let n=Ti(t.browserEvent),r=LX(n);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,r){let s=null,a=new wZ(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=a,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=a),a.score=this._computeScore(a,s)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),n){let s=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.abs(n.deltaX),u=Math.abs(n.deltaY),h=Math.max(Math.min(s,l),1),d=Math.max(Math.min(a,u),1),m=Math.max(s,l),p=Math.max(a,u);m%h===0&&p%d===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};_y.INSTANCE=new _y;var CZ=_y,kZ=class extends F0{constructor(e,t,n){super(),this._onScroll=this._register(new ke),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ke),this.onWillScroll=this._onWillScroll.event,this._options=RZ(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 xZ(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new bZ(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=Cu(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Cu(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Cu(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 I0),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ia(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,Ai&&(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 Bk(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ia(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new Bk(n))};this._mouseWheelToDispose.push(Ue(this._listenOnDomNode,bn.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=CZ.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);let u=!Ai&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!l&&(l=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),d={};if(a){let m=Vk*a,p=h.scrollTop-(m<0?Math.floor(m):Math.ceil(m));this._verticalScrollbar.writeScrollPosition(d,p)}if(l){let m=Vk*l,p=h.scrollLeft-(m<0?Math.floor(m):Math.ceil(m));this._horizontalScrollbar.writeScrollPosition(d,p)}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":"",a=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${s}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),SZ)}},EZ=class extends kZ{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 RZ(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,Ai&&(t.className+=" mac"),t}var yy=class extends Je{constructor(e,t,n,r,s,a,l,u){super(),this._bufferService=n,this._optionsService=l,this._renderService=u,this._onRequestScrollLines=this._register(new ke),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new pZ({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>H0(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new EZ(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(zn.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Ut(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Ut(()=>this._styleElement.remove())),this._register(zn.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${a.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${a.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${a.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
600
|
-
`)})),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}};yy=Zt([Te(2,Zn),Te(3,bs),Te(4,m5),Te(5,Kl),Te(6,Qn),Te(7,xs)],yy);var by=class extends Je{constructor(e,t,n,r,s){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(a=>this._removeDecoration(a))),this._register(Ut(()=>{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()}};by=Zt([Te(1,Zn),Te(2,bs),Te(3,ad),Te(4,xs)],by);var TZ=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)}},yi={full:0,left:0,center:0,right:0},Xs={full:0,left:0,center:0,right:0},Gc={full:0,left:0,center:0,right:0},qf=class extends Je{constructor(e,t,n,r,s,a,l,u){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=a,this._themeService=l,this._coreBrowserService=u,this._colorZoneStore=new TZ,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(Ut(()=>{var m;return(m=this._canvas)==null?void 0:m.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);Xs.full=this._canvas.width,Xs.left=e,Xs.center=t,Xs.right=e,this._refreshDrawHeightConstants(),Gc.full=1,Gc.left=1,Gc.center=1+Xs.left,Gc.right=1+Xs.left+Xs.center}_refreshDrawHeightConstants(){yi.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);yi.left=t,yi.center=t,yi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*yi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*yi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*yi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*yi.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(Gc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-yi[e.position||"full"]/2),Xs[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+yi[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}))}};qf=Zt([Te(2,Zn),Te(3,ad),Te(4,xs),Te(5,Qn),Te(6,Kl),Te(7,bs)],qf);var ge;(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=`
|
|
601
|
-
`,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=""))(ge||(ge={}));var gf;(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=""))(gf||(gf={}));var z5;(e=>e.ST=`${ge.ESC}\\`)(z5||(z5={}));var xy=class{constructor(e,t,n,r,s,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ge.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let a=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};xy=Zt([Te(2,Zn),Te(3,Qn),Te(4,ma),Te(5,xs)],xy);var kn=0,En=0,Rn=0,Xt=0,qk={css:"#00000000",rgba:0},cn;(e=>{function t(s,a,l,u){return u!==void 0?`#${Uo(s)}${Uo(a)}${Uo(l)}${Uo(u)}`:`#${Uo(s)}${Uo(a)}${Uo(l)}`}e.toCss=t;function n(s,a,l,u=255){return(s<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,a,l,u){return{css:e.toCss(s,a,l,u),rgba:e.toRgba(s,a,l,u)}}e.toColor=r})(cn||(cn={}));var Bt;(e=>{function t(h,d){if(Xt=(d.rgba&255)/255,Xt===1)return{css:d.css,rgba:d.rgba};let m=d.rgba>>24&255,p=d.rgba>>16&255,_=d.rgba>>8&255,b=h.rgba>>24&255,S=h.rgba>>16&255,w=h.rgba>>8&255;kn=b+Math.round((m-b)*Xt),En=S+Math.round((p-S)*Xt),Rn=w+Math.round((_-w)*Xt);let C=cn.toCss(kn,En,Rn),k=cn.toRgba(kn,En,Rn);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,m){let p=vf.ensureContrastRatio(h.rgba,d.rgba,m);if(p)return cn.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[kn,En,Rn]=vf.toChannels(d),{css:cn.toCss(kn,En,Rn),rgba:d}}e.opaque=s;function a(h,d){return Xt=Math.round(d*255),[kn,En,Rn]=vf.toChannels(h.rgba),{css:cn.toCss(kn,En,Rn,Xt),rgba:cn.toRgba(kn,En,Rn,Xt)}}e.opacity=a;function l(h,d){return Xt=h.rgba&255,a(h,Xt*d/255)}e.multiplyOpacity=l;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(Bt||(Bt={}));var qt;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return kn=parseInt(s.slice(1,2).repeat(2),16),En=parseInt(s.slice(2,3).repeat(2),16),Rn=parseInt(s.slice(3,4).repeat(2),16),cn.toColor(kn,En,Rn);case 5:return kn=parseInt(s.slice(1,2).repeat(2),16),En=parseInt(s.slice(2,3).repeat(2),16),Rn=parseInt(s.slice(3,4).repeat(2),16),Xt=parseInt(s.slice(4,5).repeat(2),16),cn.toColor(kn,En,Rn,Xt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return kn=parseInt(a[1]),En=parseInt(a[2]),Rn=parseInt(a[3]),Xt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),cn.toColor(kn,En,Rn,Xt);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),[kn,En,Rn,Xt]=t.getImageData(0,0,1,1).data,Xt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:cn.toRgba(kn,En,Rn,Xt),css:s}}e.toColor=r})(qt||(qt={}));var qn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,a){let l=r/255,u=s/255,h=a/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),m=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+m*.7152+p*.0722}e.relativeLuminance2=n})(qn||(qn={}));var vf;(e=>{function t(l,u){if(Xt=(u&255)/255,Xt===1)return u;let h=u>>24&255,d=u>>16&255,m=u>>8&255,p=l>>24&255,_=l>>16&255,b=l>>8&255;return kn=p+Math.round((h-p)*Xt),En=_+Math.round((d-_)*Xt),Rn=b+Math.round((m-b)*Xt),cn.toRgba(kn,En,Rn)}e.blend=t;function n(l,u,h){let d=qn.relativeLuminance(l>>8),m=qn.relativeLuminance(u>>8);if(os(d,m)<h){if(m<d){let b=r(l,u,h),S=os(d,qn.relativeLuminance(b>>8));if(S<h){let w=s(l,u,h),C=os(d,qn.relativeLuminance(w>>8));return S>C?b:w}return b}let p=s(l,u,h),_=os(d,qn.relativeLuminance(p>>8));if(_<h){let b=r(l,u,h),S=os(d,qn.relativeLuminance(b>>8));return _>S?p:b}return p}}e.ensureContrastRatio=n;function r(l,u,h){let d=l>>24&255,m=l>>16&255,p=l>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=os(qn.relativeLuminance2(_,b,S),qn.relativeLuminance2(d,m,p));for(;w<h&&(_>0||b>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),b-=Math.max(0,Math.ceil(b*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=os(qn.relativeLuminance2(_,b,S),qn.relativeLuminance2(d,m,p));return(_<<24|b<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,h){let d=l>>24&255,m=l>>16&255,p=l>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=os(qn.relativeLuminance2(_,b,S),qn.relativeLuminance2(d,m,p));for(;w<h&&(_<255||b<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=os(qn.relativeLuminance2(_,b,S),qn.relativeLuminance2(d,m,p));return(_<<24|b<<16|S<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(vf||(vf={}));function Uo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function os(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var MZ=class extends od{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()]}},Kf=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Yr}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),s=0,a=0,l=0,u=t.getFg(0),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 m=this._getJoinedRanges(r,l,a,t,s);for(let p=0;p<m.length;p++)n.push(m[p])}s=d,l=a,u=this._workCell.fg,h=this._workCell.bg}a+=this._workCell.getChars().length||so.length}if(this._bufferService.cols-s>1){let d=this._getJoinedRanges(r,l,a,t,s);for(let m=0;m<d.length;m++)n.push(d[m])}return n}_getJoinedRanges(e,t,n,r,s){let a=e.substring(t,n),l=[];try{l=this._characterJoiners[0].handler(a)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let h=this._characterJoiners[u].handler(a);for(let d=0;d<h.length;d++)Kf._mergeRanges(l,h[d])}catch(h){console.error(h)}return this._stringRangesToCellRanges(l,r,s),l}_stringRangesToCellRanges(e,t,n){let r=0,s=!1,a=0,l=e[r];if(l){for(let u=n;u<this._bufferService.cols;u++){let h=t.getWidth(u),d=t.getString(u).length||so.length;if(h!==0){if(!s&&l[0]<=a&&(l[0]=u,s=!0),l[1]<=a){if(l[1]=u,l=e[++r],!l)break;l[0]<=a?(l[0]=u,s=!0):s=!1}a+=d}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];if(n){if(t[1]<=s[0])return e[r-1][1]=t[1],e;if(t[1]<=s[1])return e[r-1][1]=Math.max(t[1],s[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=s[0])return e.splice(r,0,t),e;if(t[1]<=s[1])return s[0]=Math.min(t[0],s[0]),e;t[0]<s[1]&&(s[0]=Math.min(t[0],s[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};Kf=Zt([Te(0,Zn)],Kf);function NZ(e){return 57508<=e&&e<=57558}function AZ(e){return 9472<=e&&e<=9631}function DZ(e){return NZ(e)||AZ(e)}function OZ(){return{css:{canvas:Wh(),cell:Wh()},device:{canvas:Wh(),cell:Wh(),char:{width:0,height:0,left:0,top:0}}}}function Wh(){return{width:0,height:0}}var Sy=class{constructor(e,t,n,r,s,a,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=a,this._themeService=l,this._workCell=new Yr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,s,a,l,u,h,d,m){let p=[],_=this._characterJoinerService.getJoinedCharacters(t),b=this._themeService.colors,S=e.getNoBgTrimmedLength();n&&S<a+1&&(S=a+1);let w,C=0,k="",T=0,R=0,M=0,L=0,O=!1,j=0,F=!1,G=0,P=0,H=[],B=d!==-1&&m!==-1;for(let U=0;U<S;U++){e.loadCell(U,this._workCell);let $=this._workCell.getWidth();if($===0)continue;let W=!1,z=U>=P,q=U,V=this._workCell;if(_.length>0&&U===_[0][0]&&z){let Re=_.shift(),ze=this._isCellInSelection(Re[0],t);for(T=Re[0]+1;T<Re[1];T++)z&&(z=ze===this._isCellInSelection(T,t));z&&(z=!n||a<Re[0]||a>=Re[1]),z?(W=!0,V=new MZ(this._workCell,e.translateToString(!0,Re[0],Re[1]),Re[1]-Re[0]),q=Re[1]-1,$=V.getWidth()):P=Re[1]}let X=this._isCellInSelection(U,t),N=n&&U===a,I=B&&U>=d&&U<=m,Z=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,Re=>{Z=!0});let D=V.getChars()||so;if(D===" "&&(V.isUnderline()||V.isOverline())&&(D=" "),G=$*u-h.get(D,V.isBold(),V.isItalic()),!w)w=this._document.createElement("span");else if(C&&(X&&F||!X&&!F&&V.bg===R)&&(X&&F&&b.selectionForeground||V.fg===M)&&V.extended.ext===L&&I===O&&G===j&&!N&&!W&&!Z&&z){V.isInvisible()?k+=so:k+=D,C++;continue}else C&&(w.textContent=k),w=this._document.createElement("span"),C=0,k="";if(R=V.bg,M=V.fg,L=V.extended.ext,O=I,j=G,F=X,W&&a>=U&&a<=q&&(a=U),!this._coreService.isCursorHidden&&N&&this._coreService.isCursorInitialized){if(H.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&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(V.isBold()&&H.push("xterm-bold"),V.isItalic()&&H.push("xterm-italic"),V.isDim()&&H.push("xterm-dim"),V.isInvisible()?k=so:k=V.getChars()||so,V.isUnderline()&&(H.push(`xterm-underline-${V.extended.underlineStyle}`),k===" "&&(k=" "),!V.isUnderlineColorDefault()))if(V.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${od.toColorRGB(V.getUnderlineColor()).join(",")})`;else{let Re=V.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&V.isBold()&&Re<8&&(Re+=8),w.style.textDecorationColor=b.ansi[Re].css}V.isOverline()&&(H.push("xterm-overline"),k===" "&&(k=" ")),V.isStrikethrough()&&H.push("xterm-strikethrough"),I&&(w.style.textDecoration="underline");let ce=V.getFgColor(),pe=V.getFgColorMode(),ae=V.getBgColor(),Q=V.getBgColorMode(),ve=!!V.isInverse();if(ve){let Re=ce;ce=ae,ae=Re;let ze=pe;pe=Q,Q=ze}let ne,de,we=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,Re=>{Re.options.layer!=="top"&&we||(Re.backgroundColorRGB&&(Q=50331648,ae=Re.backgroundColorRGB.rgba>>8&16777215,ne=Re.backgroundColorRGB),Re.foregroundColorRGB&&(pe=50331648,ce=Re.foregroundColorRGB.rgba>>8&16777215,de=Re.foregroundColorRGB),we=Re.options.layer==="top")}),!we&&X&&(ne=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,ae=ne.rgba>>8&16777215,Q=50331648,we=!0,b.selectionForeground&&(pe=50331648,ce=b.selectionForeground.rgba>>8&16777215,de=b.selectionForeground)),we&&H.push("xterm-decoration-top");let Ce;switch(Q){case 16777216:case 33554432:Ce=b.ansi[ae],H.push(`xterm-bg-${ae}`);break;case 50331648:Ce=cn.toColor(ae>>16,ae>>8&255,ae&255),this._addStyle(w,`background-color:#${Kk((ae>>>0).toString(16),"0",6)}`);break;case 0:default:ve?(Ce=b.foreground,H.push("xterm-bg-257")):Ce=b.background}switch(ne||V.isDim()&&(ne=Bt.multiplyOpacity(Ce,.5)),pe){case 16777216:case 33554432:V.isBold()&&ce<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ce+=8),this._applyMinimumContrast(w,Ce,b.ansi[ce],V,ne,void 0)||H.push(`xterm-fg-${ce}`);break;case 50331648:let Re=cn.toColor(ce>>16&255,ce>>8&255,ce&255);this._applyMinimumContrast(w,Ce,Re,V,ne,de)||this._addStyle(w,`color:#${Kk(ce.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(w,Ce,b.foreground,V,ne,de)||ve&&H.push("xterm-fg-257")}H.length&&(w.className=H.join(" "),H.length=0),!N&&!W&&!Z&&z?C++:w.textContent=k,G!==this.defaultSpacing&&(w.style.letterSpacing=`${G}px`),p.push(w),U=q}return w&&C&&(w.textContent=k),p}_applyMinimumContrast(e,t,n,r,s,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||DZ(r.getCode()))return!1;let l=this._getContrastCache(r),u;if(!s&&!a&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=Bt.ensureContrastRatio(s||t,a||n,h),l.setColor((s||t).rgba,(a||n).rgba,u??null)}return u?(this._addStyle(e,`color:${u.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};Sy=Zt([Te(1,_5),Te(2,Qn),Te(3,bs),Te(4,ma),Te(5,ad),Te(6,Kl)],Sy);function Kk(e,t,n){for(;e.length<n;)e=t+e;return e}var LZ=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold",a.style.fontStyle="italic",this._measureElements=[n,r,s,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let l=this._measure(e,0);return l>0&&(this._flat[r]=l),l}let s=e;t&&(s+="B"),n&&(s+="I");let a=this._holey.get(s);if(a===void 0){let l=0;t&&(l|=1),n&&(l|=2),a=this._measure(e,l),a>0&&this._holey.set(s,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},jZ=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let s=e.buffers.active.ydisp,a=t[1]-s,l=n[1]-s,u=Math.max(a,0),h=Math.min(l,e.rows-1);if(u>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=l,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 zZ(){return new jZ}var Qv="xterm-dom-renderer-owner-",Ur="xterm-rows",Vh="xterm-fg-",Gk="xterm-bg-",Yc="xterm-focus",qh="xterm-selection",PZ=1,wy=class extends Je{constructor(e,t,n,r,s,a,l,u,h,d,m,p,_,b){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=a,this._linkifier2=l,this._charSizeService=h,this._optionsService=d,this._bufferService=m,this._coreService=p,this._coreBrowserService=_,this._themeService=b,this._terminalClass=PZ++,this._rowElements=[],this._selectionRenderModel=zZ(),this.onRequestRedraw=this._register(new ke).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Ur),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(qh),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=OZ(),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(Sy,document),this._element.classList.add(Qv+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(Ut(()=>{this._element.classList.remove(Qv+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new LZ(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} .${Ur} 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} .${Ur} { 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} .${Ur} .xterm-dim { color: ${Bt.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Ur}.${Yc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Ur}.${Yc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Ur}.${Yc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Ur} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Ur} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Ur} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Ur} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Ur} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${qh} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${qh} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${qh} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,l]of e.ansi.entries())t+=`${this._terminalSelector} .${Vh}${a} { color: ${l.css}; }${this._terminalSelector} .${Vh}${a}.xterm-dim { color: ${Bt.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${Gk}${a} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${Vh}257 { color: ${Bt.opaque(e.background).css}; }${this._terminalSelector} .${Vh}257.xterm-dim { color: ${Bt.multiplyOpacity(Bt.opaque(e.background),.5).css}; }${this._terminalSelector} .${Gk}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(Yc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Yc),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let h=e[0]>t[0];u.appendChild(this._createSelectionElement(a,h?t[0]:e[0],h?e[0]:t[0],l-a+1))}else{let h=r===a?e[0]:0,d=a===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,h,d));let m=l-a-1;if(u.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,m)),a!==l){let p=s===l?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,0,p))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let s=this._document.createElement("div"),a=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-t);return a+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-a),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${a}px`,s.style.width=`${l}px`,s}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,s=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){let d=h+n.ydisp,m=this._rowElements[h],p=n.lines.get(d);if(!m||!p)break;m.replaceChildren(...this._rowFactory.createRow(p,d,d===r,l,u,s,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Qv}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,s,a){n<0&&(e=0),r<0&&(t=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),r=Math.max(Math.min(r,l),0),s=Math.min(s,this._bufferService.cols);let u=this._bufferService.buffer,h=u.ybase+u.y,d=Math.min(u.x,s-1),m=this._optionsService.rawOptions.cursorBlink,p=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let b=n;b<=r;++b){let S=b+u.ydisp,w=this._rowElements[b],C=u.lines.get(S);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,S,S===h,p,_,d,m,this.dimensions.css.cell.width,this._widthCache,a?b===n?e:0:-1,a?(b===r?t:s)-1:-1))}}};wy=Zt([Te(7,L0),Te(8,zp),Te(9,Qn),Te(10,Zn),Te(11,ma),Te(12,bs),Te(13,Kl)],wy);var Cy=class extends Je{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ke),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new IZ(this._optionsService))}catch{this._measureStrategy=this._register(new BZ(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())}};Cy=Zt([Te(2,Qn)],Cy);var P5=class extends Je{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)}},BZ=class extends P5{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}},IZ=class extends P5{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}},HZ=class extends Je{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 FZ(this._window)),this._onDprChange=this._register(new ke),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ke),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(zn.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ue(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ue(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}},FZ=class extends Je{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ml),this._onDprChange=this._register(new ke),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Ut(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ue(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)}},UZ=class extends Je{constructor(){super(),this.linkProviders=[],this._register(Ut(()=>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 U0(e,t,n){let r=n.getBoundingClientRect(),s=e.getComputedStyle(n),a=parseInt(s.getPropertyValue("padding-left")),l=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-r.left-a,t.clientY-r.top-l]}function $Z(e,t,n,r,s,a,l,u,h){if(!a)return;let d=U0(e,t,n);if(d)return d[0]=Math.ceil((d[0]+(h?l/2:0))/l),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 ky=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,s){return $Z(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=U0(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])}}};ky=Zt([Te(0,xs),Te(1,zp)],ky);var WZ=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=[]}},B5={};eX(B5,{getSafariVersion:()=>qZ,isChromeOS:()=>U5,isFirefox:()=>I5,isIpad:()=>KZ,isIphone:()=>GZ,isLegacyEdge:()=>VZ,isLinux:()=>$0,isMac:()=>Gf,isNode:()=>Pp,isSafari:()=>H5,isWindows:()=>F5});var Pp=typeof process<"u"&&"title"in process,ld=Pp?"node":navigator.userAgent,cd=Pp?"node":navigator.platform,I5=ld.includes("Firefox"),VZ=ld.includes("Edge"),H5=/^((?!chrome|android).)*safari/i.test(ld);function qZ(){if(!H5)return 0;let e=ld.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Gf=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(cd),KZ=cd==="iPad",GZ=cd==="iPhone",F5=["Windows","Win16","Win32","WinCE"].includes(cd),$0=cd.indexOf("Linux")>=0,U5=/\bCrOS\b/.test(ld),$5=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()}},YZ=class extends $5{_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())}}},XZ=class extends $5{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Yf=!Pp&&"requestIdleCallback"in window?XZ:YZ,ZZ=class{constructor(){this._queue=new Yf}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Ey=class extends Je{constructor(e,t,n,r,s,a,l,u,h){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new Ml),this._pausedResizeTask=new ZZ,this._observerDisposable=this._register(new Ml),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 ke),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ke),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ke),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ke),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new WZ((d,m)=>this._renderRows(d,m),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new QZ(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Ut(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.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(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(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=Ut(()=>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()}};Ey=Zt([Te(2,Qn),Te(3,zp),Te(4,ma),Te(5,ad),Te(6,Zn),Te(7,bs),Te(8,Kl)],Ey);var QZ=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 JZ(e,t,n,r){let s=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return nQ(s,a,e,t,n,r)+Bp(a,t,n,r)+rQ(s,a,e,t,n,r);let l;if(a===t)return l=s>e?"D":"C",Hu(Math.abs(s-e),Iu(l,r));l=a>t?"D":"C";let u=Math.abs(a-t),h=tQ(a>t?e:s,n)+(u-1)*n.cols+1+eQ(a>t?s:e);return Hu(h,Iu(l,r))}function eQ(e,t){return e-1}function tQ(e,t){return t.cols-e}function nQ(e,t,n,r,s,a){return Bp(t,r,s,a).length===0?"":Hu(V5(e,t,e,t-sa(t,s),!1,s).length,Iu("D",a))}function Bp(e,t,n,r){let s=e-sa(e,n),a=t-sa(t,n),l=Math.abs(s-a)-iQ(e,t,n);return Hu(l,Iu(W5(e,t),r))}function rQ(e,t,n,r,s,a){let l;Bp(t,r,s,a).length>0?l=r-sa(r,s):l=t;let u=r,h=sQ(e,t,n,r,s,a);return Hu(V5(e,l,n,u,h==="C",s).length,Iu(h,a))}function iQ(e,t,n){var l;let r=0,s=e-sa(e,n),a=t-sa(t,n);for(let u=0;u<Math.abs(s-a);u++){let h=W5(e,t)==="A"?-1:1;(l=n.buffer.lines.get(s+h*u))!=null&&l.isWrapped&&r++}return r}function sa(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 sQ(e,t,n,r,s,a){let l;return Bp(n,r,s,a).length>0?l=r-sa(r,s):l=t,e<n&&l<=r||e>=n&&l<r?"C":"D"}function W5(e,t){return e>t?"A":"B"}function V5(e,t,n,r,s,a){let l=e,u=t,h="";for(;(l!==n||u!==r)&&u>=0&&u<a.buffer.lines.length;)l+=s?1:-1,s&&l>a.cols-1?(h+=a.buffer.translateBufferLineToString(u,!1,e,l),l=0,e=0,u++):!s&&l<0&&(h+=a.buffer.translateBufferLineToString(u,!1,0,e+1),l=a.cols-1,e=l,u--);return h+a.buffer.translateBufferLineToString(u,!1,e,l)}function Iu(e,t){let n=t?"O":"[";return ge.ESC+n+e}function Hu(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var oQ=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 Yk(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 Jv=50,aQ=15,lQ=50,cQ=500,uQ=" ",dQ=new RegExp(uQ,"g"),Ry=class extends Je{constructor(e,t,n,r,s,a,l,u,h){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=a,this._optionsService=l,this._renderService=u,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Yr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ke),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ke),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ke),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ke),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 oQ(this._bufferService),this._activeSelectionMode=0,this._register(Ut(()=>{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],a=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let u=n.translateBufferLineToString(l,!0,s,a);r.push(u)}}else{let s=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],s));for(let a=e[1]+1;a<=t[1]-1;a++){let l=n.lines.get(a),u=n.translateBufferLineToString(a,!0);l!=null&&l.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let a=n.lines.get(t[1]),l=n.translateBufferLineToString(t[1],!0,0,t[0]);a&&a.isWrapped?r[r.length-1]+=l:r.push(l)}}return r.map(s=>s.replace(dQ," ")).join(F5?`\r
|
|
602
|
-
`:`
|
|
603
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),$0&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var s,a;let n=(a=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:a.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Yk(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=U0(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,-Jv),Jv),t/=Jv,t/Math.abs(t)+Math.round(t*(aQ-1)))}shouldForceSelection(e){return Gf?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(),lQ)}_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&&!(Gf&&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<cQ&&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=JZ(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let s=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:s>1&&t!==r&&(n+=s-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,a=s.lines.get(e[1]);if(!a)return;let l=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(a,e[0]),h=u,d=e[0]-u,m=0,p=0,_=0,b=0;if(l.charAt(u)===" "){for(;u>0&&l.charAt(u-1)===" ";)u--;for(;h<l.length&&l.charAt(h+1)===" ";)h++}else{let C=e[0],k=e[0];a.getWidth(C)===0&&(m++,C--),a.getWidth(k)===2&&(p++,k++);let T=a.getString(k).length;for(T>1&&(b+=T-1,h+=T-1);C>0&&u>0&&!this._isCharWordSeparator(a.loadCell(C-1,this._workCell));){a.loadCell(C-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(m++,C--):R>1&&(_+=R-1,u-=R-1),u--,C--}for(;k<a.length&&h+1<l.length&&!this._isCharWordSeparator(a.loadCell(k+1,this._workCell));){a.loadCell(k+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(p++,k++):R>1&&(b+=R-1,h+=R-1),h++,k++}}h++;let S=u+d-m+_,w=Math.min(this._bufferService.cols,h-u+m+p-_-b);if(!(!t&&l.slice(u,h).trim()==="")){if(n&&S===0&&a.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&a.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let T=this._bufferService.cols-k.start;S-=T,w+=T}}}if(r&&S+w===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let C=s.lines.get(e[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(w+=k.length)}}return{start:S,length:w}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Yk(n,this._bufferService.cols)}};Ry=Zt([Te(3,Zn),Te(4,ma),Te(5,j0),Te(6,Qn),Te(7,xs),Te(8,bs)],Ry);var Xk=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={}}},Zk=class{constructor(){this._color=new Xk,this._css=new Xk}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()}},pn=Object.freeze((()=>{let e=[qt.toColor("#2e3436"),qt.toColor("#cc0000"),qt.toColor("#4e9a06"),qt.toColor("#c4a000"),qt.toColor("#3465a4"),qt.toColor("#75507b"),qt.toColor("#06989a"),qt.toColor("#d3d7cf"),qt.toColor("#555753"),qt.toColor("#ef2929"),qt.toColor("#8ae234"),qt.toColor("#fce94f"),qt.toColor("#729fcf"),qt.toColor("#ad7fa8"),qt.toColor("#34e2e2"),qt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],a=t[n%6];e.push({css:cn.toCss(r,s,a),rgba:cn.toRgba(r,s,a)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:cn.toCss(r,r,r),rgba:cn.toRgba(r,r,r)})}return e})()),Wo=qt.toColor("#ffffff"),lu=qt.toColor("#000000"),Qk=qt.toColor("#ffffff"),Jk=lu,Xc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},hQ=Wo,Ty=class extends Je{constructor(e){super(),this._optionsService=e,this._contrastCache=new Zk,this._halfContrastCache=new Zk,this._onChangeColors=this._register(new ke),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Wo,background:lu,cursor:Qk,cursorAccent:Jk,selectionForeground:void 0,selectionBackgroundTransparent:Xc,selectionBackgroundOpaque:Bt.blend(lu,Xc),selectionInactiveBackgroundTransparent:Xc,selectionInactiveBackgroundOpaque:Bt.blend(lu,Xc),scrollbarSliderBackground:Bt.opacity(Wo,.2),scrollbarSliderHoverBackground:Bt.opacity(Wo,.4),scrollbarSliderActiveBackground:Bt.opacity(Wo,.5),overviewRulerBorder:Wo,ansi:pn.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=Tt(e.foreground,Wo),t.background=Tt(e.background,lu),t.cursor=Bt.blend(t.background,Tt(e.cursor,Qk)),t.cursorAccent=Bt.blend(t.background,Tt(e.cursorAccent,Jk)),t.selectionBackgroundTransparent=Tt(e.selectionBackground,Xc),t.selectionBackgroundOpaque=Bt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Tt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Bt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Tt(e.selectionForeground,qk):void 0,t.selectionForeground===qk&&(t.selectionForeground=void 0),Bt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Bt.opacity(t.selectionBackgroundTransparent,.3)),Bt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Bt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Tt(e.scrollbarSliderBackground,Bt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Tt(e.scrollbarSliderHoverBackground,Bt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Tt(e.scrollbarSliderActiveBackground,Bt.opacity(t.foreground,.5)),t.overviewRulerBorder=Tt(e.overviewRulerBorder,hQ),t.ansi=pn.slice(),t.ansi[0]=Tt(e.black,pn[0]),t.ansi[1]=Tt(e.red,pn[1]),t.ansi[2]=Tt(e.green,pn[2]),t.ansi[3]=Tt(e.yellow,pn[3]),t.ansi[4]=Tt(e.blue,pn[4]),t.ansi[5]=Tt(e.magenta,pn[5]),t.ansi[6]=Tt(e.cyan,pn[6]),t.ansi[7]=Tt(e.white,pn[7]),t.ansi[8]=Tt(e.brightBlack,pn[8]),t.ansi[9]=Tt(e.brightRed,pn[9]),t.ansi[10]=Tt(e.brightGreen,pn[10]),t.ansi[11]=Tt(e.brightYellow,pn[11]),t.ansi[12]=Tt(e.brightBlue,pn[12]),t.ansi[13]=Tt(e.brightMagenta,pn[13]),t.ansi[14]=Tt(e.brightCyan,pn[14]),t.ansi[15]=Tt(e.brightWhite,pn[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]=Tt(e.extendedAnsi[r],pn[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()}}};Ty=Zt([Te(0,Qn)],Ty);function Tt(e,t){if(e!==void 0)try{return qt.toColor(e)}catch{}return t}var fQ=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)}},pQ=class{constructor(){this._services=new fQ,this._services.set(L0,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=aX(e).sort((a,l)=>a.index-l.index),r=[];for(let a of n){let l=this._services.get(a.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id._id}.`);r.push(l)}let s=n.length>0?n[0].index:t.length;if(t.length!==s)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},mQ={trace:0,debug:1,info:2,warn:3,error:4,off:5},gQ="xterm.js: ",My=class extends Je{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=mQ[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?"":gQ)+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)}};My=Zt([Te(0,Qn)],My);var eE=class extends Je{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ke),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ke),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ke),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}},Ze=3,ln=Object.freeze(new od),Kh=0,e_=2,cu=class q5{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ze);let s=n||Yr.fromCharData([0,d5,1,0]);for(let a=0;a<t;++a)this.setCell(a,s);this.length=t}get(t){let n=this._data[t*Ze+0],r=n&2097151;return[this._data[t*Ze+1],n&2097152?this._combined[t]:r?to(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*Ze+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Ze+0]=t|2097152|n[2]<<22):this._data[t*Ze+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Ze+0]>>22}hasWidth(t){return this._data[t*Ze+0]&12582912}getFg(t){return this._data[t*Ze+1]}getBg(t){return this._data[t*Ze+2]}hasContent(t){return this._data[t*Ze+0]&4194303}getCodePoint(t){let n=this._data[t*Ze+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Ze+0]&2097152}getString(t){let n=this._data[t*Ze+0];return n&2097152?this._combined[t]:n&2097151?to(n&2097151):""}isProtected(t){return this._data[t*Ze+2]&536870912}loadCell(t,n){return Kh=t*Ze,n.content=this._data[Kh+0],n.fg=this._data[Kh+1],n.bg=this._data[Kh+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*Ze+0]=n.content,this._data[t*Ze+1]=n.fg,this._data[t*Ze+2]=n.bg}setCellFromCodepoint(t,n,r,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*Ze+0]=n|r<<22,this._data[t*Ze+1]=s.fg,this._data[t*Ze+2]=s.bg}addCodepointToCell(t,n,r){let s=this._data[t*Ze+0];s&2097152?this._combined[t]+=to(n):s&2097151?(this._combined[t]=to(s&2097151)+to(n),s&=-2097152,s|=2097152):s=n|1<<22,r&&(s&=-12582913,s|=r<<22),this._data[t*Ze+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 Yr;for(let a=this.length-t-n-1;a>=0;--a)this.setCell(t+n+a,this.loadCell(t+a,s));for(let a=0;a<n;++a)this.setCell(t+a,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,n,r){if(t%=this.length,n<this.length-t){let s=new Yr;for(let a=0;a<this.length-t-n;++a)this.setCell(t+a,this.loadCell(t+n+a,s));for(let a=this.length-n;a<this.length;++a)this.setCell(a,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,n,r,s=!1){if(s){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.setCell(t++,r)}resize(t,n){if(t===this.length)return this._data.length*4*e_<this._data.buffer.byteLength;let r=t*Ze;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let s=new Uint32Array(r);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,r);let s=Object.keys(this._combined);for(let l=0;l<s.length;l++){let u=parseInt(s[l],10);u>=t&&delete this._combined[u]}let a=Object.keys(this._extendedAttrs);for(let l=0;l<a.length;l++){let u=parseInt(a[l],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*e_<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*e_<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 q5(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*Ze+0]&4194303)return t+(this._data[t*Ze+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ze+0]&4194303||this._data[t*Ze+2]&50331648)return t+(this._data[t*Ze+0]>>22);return 0}copyCellsFrom(t,n,r,s,a){let l=t._data;if(a)for(let h=s-1;h>=0;h--){for(let d=0;d<Ze;d++)this._data[(r+h)*Ze+d]=l[(n+h)*Ze+d];l[(n+h)*Ze+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}else for(let h=0;h<s;h++){for(let d=0;d<Ze;d++)this._data[(r+h)*Ze+d]=l[(n+h)*Ze+d];l[(n+h)*Ze+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 a="";for(;n<r;){let l=this._data[n*Ze+0],u=l&2097151,h=l&2097152?this._combined[n]:u?to(u):so;if(a+=h,s)for(let d=0;d<h.length;++d)s.push(n);n+=l>>22||1}return s&&s.push(n),a}};function vQ(e,t,n,r,s,a){let l=[];for(let u=0;u<e.length-1;u++){let h=u,d=e.get(++h);if(!d.isWrapped)continue;let m=[e.get(u)];for(;h<e.length&&d.isWrapped;)m.push(d),d=e.get(++h);if(!a&&r>=u&&r<h){u+=m.length-1;continue}let p=0,_=Fu(m,p,t),b=1,S=0;for(;b<m.length;){let C=Fu(m,b,t),k=C-S,T=n-_,R=Math.min(k,T);m[p].copyCellsFrom(m[b],S,_,R,!1),_+=R,_===n&&(p++,_=0),S+=R,S===C&&(b++,S=0),_===0&&p!==0&&m[p-1].getWidth(n-1)===2&&(m[p].copyCellsFrom(m[p-1],n-1,_++,1,!1),m[p-1].setCell(n-1,s))}m[p].replaceCells(_,n,s);let w=0;for(let C=m.length-1;C>0&&(C>p||m[C].getTrimmedLength()===0);C--)w++;w>0&&(l.push(u+m.length-w),l.push(w)),u+=m.length-1}return l}function _Q(e,t){let n=[],r=0,s=t[r],a=0;for(let l=0;l<e.length;l++)if(s===l){let u=t[++r];e.onDeleteEmitter.fire({index:l-a,amount:u}),l+=u-1,a+=u,s=t[++r]}else n.push(l);return{layout:n,countRemoved:a}}function yQ(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 bQ(e,t,n){let r=[],s=e.map((h,d)=>Fu(e,d,t)).reduce((h,d)=>h+d),a=0,l=0,u=0;for(;u<s;){if(s-u<n){r.push(s-u);break}a+=n;let h=Fu(e,l,t);a>h&&(a-=h,l++);let d=e[l].getWidth(a-1)===2;d&&a--;let m=d?n-1:n;r.push(m),u+=m}return r}function Fu(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 K5=class G5{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=G5._nextId++,this._onDispose=this.register(new ke),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ia(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};K5._nextId=1;var xQ=K5,vn={},Vo=vn.B;vn[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:"≥","{":"π","|":"≠","}":"£","~":"·"};vn.A={"#":"£"};vn.B=void 0;vn[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};vn.C=vn[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};vn.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};vn.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};vn.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};vn.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};vn.E=vn[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};vn.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};vn.H=vn[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};vn["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var tE=4294967295,nE=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=ln.clone(),this.savedCharset=Vo,this.markers=[],this._nullCell=Yr.fromCharData([0,d5,1,0]),this._whitespaceCell=Yr.fromCharData([0,so,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Yf,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new eE(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 Vf),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 Vf),this._whitespaceCell}getBlankLine(e,t){return new cu(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>tE?tE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=ln);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 eE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(ln),r=0,s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)r+=+this.lines.get(l).resize(e,n);let a=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new cu(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new cu(e,n)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let l=this.lines.length-s;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=vQ(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ln),n);if(r.length>0){let s=_Q(this.lines,r);yQ(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(ln),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new cu(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(ln),s=[],a=0;for(let l=this.lines.length-1;l>=0;l--){let u=this.lines.get(l);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let h=[u];for(;u.isWrapped&&l>0;)u=this.lines.get(--l),h.unshift(u);if(!n){let R=this.ybase+this.y;if(R>=l&&R<l+h.length)continue}let d=h[h.length-1].getTrimmedLength(),m=bQ(h,this._cols,e),p=m.length-h.length,_;this.ybase===0&&this.y!==this.lines.length-1?_=Math.max(0,this.y-this.lines.maxLength+p):_=Math.max(0,this.lines.length-this.lines.maxLength+p);let b=[];for(let R=0;R<p;R++){let M=this.getBlankLine(ln,!0);b.push(M)}b.length>0&&(s.push({start:l+h.length+a,newLines:b}),a+=b.length),h.push(...b);let S=m.length-1,w=m[S];w===0&&(S--,w=m[S]);let C=h.length-p-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=m[S]),k-=R,k===0){C--;let M=Math.max(C,0);k=Fu(h,M,this._cols)}}for(let R=0;R<h.length;R++)m[R]<e&&h[R].setCell(m[R],r);let T=p-_;for(;T-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(s.length>0){let l=[],u=[];for(let w=0;w<this.lines.length;w++)u.push(this.lines.get(w));let h=this.lines.length,d=h-1,m=0,p=s[m];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let _=0;for(let w=Math.min(this.lines.maxLength-1,h+a-1);w>=0;w--)if(p&&p.start>d+_){for(let C=p.newLines.length-1;C>=0;C--)this.lines.set(w--,p.newLines[C]);w++,l.push({index:d+1,amount:p.newLines.length}),_+=p.newLines.length,p=s[++m]}else this.lines.set(w,u[d--]);let b=0;for(let w=l.length-1;w>=0;w--)l[w].index+=b,this.lines.onInsertEmitter.fire(l[w]),b+=l[w].amount;let S=Math.max(0,h+a-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}translateBufferLineToString(e,t,n=0,r){let s=this.lines.get(e);return s?s.translateToString(t,n,r):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new xQ(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)}},SQ=class extends Je{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ke),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 nE(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new nE(!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)}},Y5=2,X5=1,Ny=class extends Je{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ke),this.onResize=this._onResize.event,this._onScroll=this._register(new ke),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Y5),this.rows=Math.max(e.rawOptions.rows||0,X5),this.buffers=this._register(new SQ(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let s=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let l=n.lines.isFull;a===n.lines.length-1?l?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),l?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let l=a-s+1;n.lines.shiftElements(s+1,l-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Ny=Zt([Te(0,Qn)],Ny);var ll={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:Gf,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},wQ=["normal","bold","100","200","300","400","500","600","700","800","900"],CQ=class extends Je{constructor(e){super(),this._onOptionChange=this._register(new ke),this.onOptionChange=this._onOptionChange.event;let t={...ll};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(Ut(()=>{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 ll))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in ll))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=ll[e]),!kQ(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ll[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=wQ.includes(t)?t:ll[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 kQ(e){return e==="block"||e==="underline"||e==="bar"}function uu(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]&&uu(e[r],t-1);return n}var rE=Object.freeze({insertMode:!1}),iE=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Ay=class extends Je{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 ke),this.onData=this._onData.event,this._onUserInput=this._register(new ke),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ke),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ke),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=uu(rE),this.decPrivateModes=uu(iE)}reset(){this.modes=uu(rE),this.decPrivateModes=uu(iE)}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))}};Ay=Zt([Te(0,Zn),Te(1,g5),Te(2,Qn)],Ay);var sE={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 t_(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 n_=String.fromCharCode,oE={DEFAULT:e=>{let t=[t_(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${n_(t[0])}${n_(t[1])}${n_(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${t_(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${t_(e,!0)};${e.x};${e.y}${t}`}},Dy=class extends Je{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 ke),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(sE))this.addProtocol(r,sE[r]);for(let r of Object.keys(oE))this.addEncoding(r,oE[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)}};Dy=Zt([Te(0,Zn),Te(1,ma),Te(2,Qn)],Dy);var r_=[[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]],EQ=[[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]],mn;function RQ(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 TQ=class{constructor(){if(this.version="6",!mn){mn=new Uint8Array(65536),mn.fill(1),mn[0]=0,mn.fill(0,1,32),mn.fill(0,127,160),mn.fill(2,4352,4448),mn[9001]=2,mn[9002]=2,mn.fill(2,11904,42192),mn[12351]=1,mn.fill(2,44032,55204),mn.fill(2,63744,64256),mn.fill(2,65040,65050),mn.fill(2,65072,65136),mn.fill(2,65280,65377),mn.fill(2,65504,65511);for(let e=0;e<r_.length;++e)mn.fill(0,r_[e][0],r_[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?mn[e]:RQ(e,EQ)?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=Yo.extractWidth(t);s===0?r=!1:s>n&&(n=s)}return Yo.createPropertyValue(0,n,r)}},Yo=class _f{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ke,this.onChange=this._onChange.event;let t=new TQ;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,s=t.length;for(let a=0;a<s;++a){let l=t.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=s)return n+this.wcwidth(l);let d=t.charCodeAt(a);56320<=d&&d<=57343?l=(l-55296)*1024+d-56320+65536:n+=this.wcwidth(d)}let u=this.charProperties(l,r),h=_f.extractWidth(u);_f.extractShouldJoin(u)&&(h-=_f.extractWidth(r)),n+=h,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},MQ=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 aE(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 Zc=2147483647,NQ=256,Z5=class Oy{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>NQ)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 Oy;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let s=t[r];if(Array.isArray(s))for(let a=0;a<s.length;++a)n.addSubParam(s[a]);else n.addParam(s)}return n}clone(){let t=new Oy(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>Zc?Zc: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>Zc?Zc: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,Zc):t}},Qc=[],AQ=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",jp(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}}},wr=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+=jp(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}},Jc=[],DQ=class{constructor(){this._handlers=Object.create(null),this._active=Jc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Jc}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=Jc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Jc,!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",jp(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=Jc,this._ident=0}},du=new Z5;du.addParam(0);var lE=class{constructor(e){this._handler=e,this._data="",this._params=du,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():du,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=jp(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=du,this._data="",this._hitLimit=!1,n));return this._params=du,this._data="",this._hitLimit=!1,t}},OQ=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}},qr=160,LQ=(function(){let e=new OQ(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 a=n(0,14),l;e.setDefault(1,0),e.addMany(r,0,2,0);for(l in a)e.addMany([24,26,153,154],l,3,0),e.addMany(n(128,144),l,3,0),e.addMany(n(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(qr,0,2,0),e.add(qr,8,5,8),e.add(qr,6,0,6),e.add(qr,11,0,11),e.add(qr,13,13,13),e})(),jQ=class extends Je{constructor(e=LQ){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 Z5,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(Ut(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new AQ),this._dcsParser=this._register(new DQ),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let s=0;s<e.intermediates.length;++s){let a=e.intermediates.charCodeAt(s);if(32>a||a>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=a}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(e,t,n){let r=0,s=0,a=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,l}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],l=this._oscParser.end(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=a;u<t;++u){switch(r=e[u],s=this._transitions.table[this.currentState<<8|(r<160?r:qr)],s>>4){case 2:for(let _=u+1;;++_){if(_>=t||(r=e[_])<32||r>126&&r<qr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<qr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<qr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<qr){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&&(l=h[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._preserveStack(3,h,d,s,u),l;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 m=this._escHandlers[this._collect<<8|r],p=m?m.length-1:-1;for(;p>=0&&(l=m[p](),l!==!0);p--)if(l instanceof Promise)return this._preserveStack(4,m,p,s,u),l;p<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<qr){this._dcsParser.put(e,u,_),u=_-1;break}break;case 14:if(l=this._dcsParser.unhook(r!==24&&r!==26),l)return this._preserveStack(6,[],0,s,u),l;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let _=u+1;;_++)if(_>=t||(r=e[_])<32||r>127&&r<qr){this._oscParser.put(e,u,_),u=_-1;break}break;case 6:if(l=this._oscParser.end(r!==24&&r!==26),l)return this._preserveStack(5,[],0,s,u),l;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},zQ=/^([\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})$/,PQ=/^[\da-f]+$/;function cE(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=zQ.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),PQ.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let s=0;s<3;++s){let a=parseInt(t.slice(n*s,n*s+n),16);r[s]=n===1?a<<4:n===2?a:n===3?a>>4:a>>8}return r}}function i_(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 BQ(e,t=16){let[n,r,s]=e;return`rgb:${i_(n,t)}/${i_(r,t)}/${i_(s,t)}`}var IQ={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Zs=131072,uE=10;function dE(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 hE=5e3,fE=0,HQ=class extends Je{constructor(e,t,n,r,s,a,l,u,h=new jQ){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=s,this._oscLinkService=a,this._coreMouseService=l,this._unicodeService=u,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new sX,this._utf8Decoder=new oX,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ln.clone(),this._eraseAttrDataInternal=ln.clone(),this._onRequestBell=this._register(new ke),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ke),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ke),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ke),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ke),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ke),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ke),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ke),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ke),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ke),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ke),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ke),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ke),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 Ly(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,m)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:m.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,m,p)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:m,data:p})}),this._parser.setDcsHandlerFallback((d,m,p)=>{m==="HOOK"&&(p=p.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:m,payload:p})}),this._parser.setPrintHandler((d,m,p)=>this.print(d,m,p)),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(ge.BEL,()=>this.bell()),this._parser.setExecuteHandler(ge.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ge.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ge.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ge.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ge.BS,()=>this.backspace()),this._parser.setExecuteHandler(ge.HT,()=>this.tab()),this._parser.setExecuteHandler(ge.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ge.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(gf.IND,()=>this.index()),this._parser.setExecuteHandler(gf.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(gf.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new wr(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new wr(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new wr(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new wr(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new wr(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new wr(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new wr(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new wr(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new wr(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new wr(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new wr(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new wr(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 vn)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 lE((d,m)=>this.requestStatusString(d,m)))}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"),hE))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${hE} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,s=this._activeBuffer.y,a=0,l=this._parseStack.paused;if(l){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Zs&&(a=this._parseStack.position+Zs)}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<Zs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Zs))),l||this._dirtyRowTracker.clearRange(),e.length>Zs)for(let d=a;d<e.length;d+=Zs){let m=d+Zs<e.length?d+Zs:e.length,p=typeof e=="string"?this._stringDecoder.decode(e.substring(d,m),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,m),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,p))return this._preserveStack(r,s,p,d),this._logSlowResolvingAsync(n),n}else if(!l){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,a=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,m=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodepoint(this._activeBuffer.x-1,0,1,m);let _=this._parser.precedingJoinState;for(let b=t;b<n;++b){if(r=e[b],r<127&&a){let k=a[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let S=this._unicodeService.charProperties(r,_);s=Yo.extractWidth(S);let w=Yo.extractShouldJoin(S),C=w?Yo.extractWidth(_):0;if(_=S,l&&this._onA11yChar.fire(to(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(h){let k=p,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),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&p instanceof cu&&p.copyCellsFrom(k,T,0,C,!1);T<u;)k.setCellFromCodepoint(T++,0,1,m)}else if(this._activeBuffer.x=u-1,s===2)continue}if(w&&this._activeBuffer.x){let k=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-k,r,s);for(let T=s-C;--T>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,m);continue}if(d&&(p.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(m)),p.getWidth(u-1)===2&&p.setCellFromCodepoint(u-1,0,1,m)),p.setCellFromCodepoint(this._activeBuffer.x++,r,s,m),s>0)for(;--s;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,m)}this._parser.precedingJoinState=_,this._activeBuffer.x<u&&n-t>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodepoint(this._activeBuffer.x,0,1,m),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>dE(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new lE(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new wr(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,s=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&r.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(ln));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=Yo.extractWidth(t),s=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),l=new Uint32Array(a.length*n),u=0;for(let d=0;d<a.length;){let m=a.codePointAt(d)||0;l[u++]=m,d+=m>65535?2:1}let h=u;for(let d=1;d<n;++d)l.copyWithin(h,0,u),h+=u;return this.print(l,0,h),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ge.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ge.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ge.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ge.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ge.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,Vo),this._charsetService.setgCharset(1,Vo),this._charsetService.setgCharset(2,Vo),this._charsetService.setgCharset(3,Vo);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:a}=this._coreMouseService,l=this._coreService,{buffers:u,cols:h}=this._bufferService,{active:d,alt:m}=u,p=this._optionsService.rawOptions,_=(w,C)=>(l.triggerDataEvent(`${ge.ESC}[${t?"":"?"}${w};${C}$y`),!0),b=w=>w?1:2,S=e.params[0];return t?S===2?_(S,4):S===4?_(S,b(l.modes.insertMode)):S===12?_(S,3):S===20?_(S,b(p.convertEol)):_(S,0):S===1?_(S,b(r.applicationCursorKeys)):S===3?_(S,p.windowOptions.setWinLines?h===80?2:h===132?1:0:0):S===6?_(S,b(r.origin)):S===7?_(S,b(r.wraparound)):S===8?_(S,3):S===9?_(S,b(s==="X10")):S===12?_(S,b(p.cursorBlink)):S===25?_(S,b(!l.isCursorHidden)):S===45?_(S,b(r.reverseWraparound)):S===66?_(S,b(r.applicationKeypad)):S===67?_(S,4):S===1e3?_(S,b(s==="VT200")):S===1002?_(S,b(s==="DRAG")):S===1003?_(S,b(s==="ANY")):S===1004?_(S,b(r.sendFocus)):S===1005?_(S,4):S===1006?_(S,b(a==="SGR")):S===1015?_(S,4):S===1016?_(S,b(a==="SGR_PIXELS")):S===1048?_(S,1):S===47||S===1047||S===1049?_(S,b(d===m)):S===2004?_(S,b(r.bracketedPasteMode)):S===2026?_(S,b(r.synchronizedOutput)):_(S,0)}_updateAttrColor(e,t,n,r,s){return t===2?(e|=50331648,e&=-16777216,e|=od.fromColorRGB([n,r,s])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],s=0,a=0;do{if(r[a+s]=e.params[t+a],e.hasSubParams(t+a)){let l=e.getSubParams(t+a),u=0;do r[1]===5&&(s=1),r[a+u+1+s]=l[u];while(++u<l.length&&u+a+1+s<r.length);break}if(r[1]===5&&a+s>=2||r[1]===2&&a+s>=5)break;r[1]&&(s=1)}while(++a+t<e.length&&a+s<r.length);for(let l=2;l<r.length;++l)r[l]===-1&&(r[l]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=ln.fg,e.bg=ln.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|=ln.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=ln.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|=ln.fg&16777215,r.bg&=-67108864,r.bg|=ln.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ge.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ge.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(`${ge.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=ln.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(!dE(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(`${ge.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>uE&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>uE&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let r=n.shift(),s=n.shift();if(/^\d+$/.exec(r)){let a=parseInt(r);if(pE(a))if(s==="?")t.push({type:0,index:a});else{let l=cE(s);l&&t.push({type:1,index:a,color:l})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),r,s=n.findIndex(a=>a.startsWith("id="));return s!==-1&&(r=n[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let r=0;r<n.length&&!(t>=this._specialColors.length);++r,++t)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let s=cE(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]);pE(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,Vo),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(IQ[e[0]],vn[e[1]]||Vo),!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=ln.clone(),this._eraseAttrDataInternal=ln.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 Yr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=l=>(this._coreService.triggerDataEvent(`${ge.ESC}${l}${ge.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)}},Ly=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&&(fE=e,e=t,t=fE),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Ly=Zt([Te(0,Zn)],Ly);function pE(e){return 0<=e&&e<256}var FQ=5e7,mE=12,UQ=50,$Q=class extends Je{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 ke),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>FQ)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],s=this._action(r,t);if(s){let l=u=>performance.now()-n>=mE?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(l);return}let a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=mE)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>UQ&&(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()}},jy=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 a=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(l,a)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};jy=Zt([Te(0,Zn)],jy);var gE=!1,WQ=class extends Je{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ml),this._onBinary=this._register(new ke),this.onBinary=this._onBinary.event,this._onData=this._register(new ke),this.onData=this._onData.event,this._onLineFeed=this._register(new ke),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ke),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ke),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ke),this._instantiationService=new pQ,this.optionsService=this._register(new CQ(e)),this._instantiationService.setService(Qn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Ny)),this._instantiationService.setService(Zn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(My)),this._instantiationService.setService(g5,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Ay)),this._instantiationService.setService(ma,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Dy)),this._instantiationService.setService(m5,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Yo)),this._instantiationService.setService(uX,this.unicodeService),this._charsetService=this._instantiationService.createInstance(MQ),this._instantiationService.setService(cX,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(jy),this._instantiationService.setService(v5,this._oscLinkService),this._inputHandler=this._register(new HQ(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(zn.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(zn.forward(this._bufferService.onResize,this._onResize)),this._register(zn.forward(this.coreService.onData,this._onData)),this._register(zn.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 $Q((t,n)=>this._inputHandler.parse(t,n))),this._register(zn.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ke),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&&!gE&&(this._logService.warn("writeSync is unreliable and will be removed soon."),gE=!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,Y5),t=Math.max(t,X5),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(aE.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(aE(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Ut(()=>{for(let t of e)t.dispose()})}}},VQ={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 qQ(e,t,n,r){var l;let s={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?s.key=ge.ESC+"OA":s.key=ge.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=ge.ESC+"OD":s.key=ge.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=ge.ESC+"OC":s.key=ge.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=ge.ESC+"OB":s.key=ge.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":ge.DEL,e.altKey&&(s.key=ge.ESC+s.key);break;case 9:if(e.shiftKey){s.key=ge.ESC+"[Z";break}s.key=ge.HT,s.cancel=!0;break;case 13:s.key=e.altKey?ge.ESC+ge.CR:ge.CR,s.cancel=!0;break;case 27:s.key=ge.ESC,e.altKey&&(s.key=ge.ESC+ge.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;a?s.key=ge.ESC+"[1;"+(a+1)+"D":t?s.key=ge.ESC+"OD":s.key=ge.ESC+"[D";break;case 39:if(e.metaKey)break;a?s.key=ge.ESC+"[1;"+(a+1)+"C":t?s.key=ge.ESC+"OC":s.key=ge.ESC+"[C";break;case 38:if(e.metaKey)break;a?s.key=ge.ESC+"[1;"+(a+1)+"A":t?s.key=ge.ESC+"OA":s.key=ge.ESC+"[A";break;case 40:if(e.metaKey)break;a?s.key=ge.ESC+"[1;"+(a+1)+"B":t?s.key=ge.ESC+"OB":s.key=ge.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=ge.ESC+"[2~");break;case 46:a?s.key=ge.ESC+"[3;"+(a+1)+"~":s.key=ge.ESC+"[3~";break;case 36:a?s.key=ge.ESC+"[1;"+(a+1)+"H":t?s.key=ge.ESC+"OH":s.key=ge.ESC+"[H";break;case 35:a?s.key=ge.ESC+"[1;"+(a+1)+"F":t?s.key=ge.ESC+"OF":s.key=ge.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=ge.ESC+"[5;"+(a+1)+"~":s.key=ge.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=ge.ESC+"[6;"+(a+1)+"~":s.key=ge.ESC+"[6~";break;case 112:a?s.key=ge.ESC+"[1;"+(a+1)+"P":s.key=ge.ESC+"OP";break;case 113:a?s.key=ge.ESC+"[1;"+(a+1)+"Q":s.key=ge.ESC+"OQ";break;case 114:a?s.key=ge.ESC+"[1;"+(a+1)+"R":s.key=ge.ESC+"OR";break;case 115:a?s.key=ge.ESC+"[1;"+(a+1)+"S":s.key=ge.ESC+"OS";break;case 116:a?s.key=ge.ESC+"[15;"+(a+1)+"~":s.key=ge.ESC+"[15~";break;case 117:a?s.key=ge.ESC+"[17;"+(a+1)+"~":s.key=ge.ESC+"[17~";break;case 118:a?s.key=ge.ESC+"[18;"+(a+1)+"~":s.key=ge.ESC+"[18~";break;case 119:a?s.key=ge.ESC+"[19;"+(a+1)+"~":s.key=ge.ESC+"[19~";break;case 120:a?s.key=ge.ESC+"[20;"+(a+1)+"~":s.key=ge.ESC+"[20~";break;case 121:a?s.key=ge.ESC+"[21;"+(a+1)+"~":s.key=ge.ESC+"[21~";break;case 122:a?s.key=ge.ESC+"[23;"+(a+1)+"~":s.key=ge.ESC+"[23~";break;case 123:a?s.key=ge.ESC+"[24;"+(a+1)+"~":s.key=ge.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=ge.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=ge.DEL:e.keyCode===219?s.key=ge.ESC:e.keyCode===220?s.key=ge.FS:e.keyCode===221&&(s.key=ge.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(l=VQ[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(u)s.key=ge.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=ge.ESC+d}else if(e.keyCode===32)s.key=ge.ESC+(e.ctrlKey?ge.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),s.key=ge.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=ge.US),e.key==="@"&&(s.key=ge.NUL));break}return s}var en=0,KQ=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Yf,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Yf,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((s,a)=>this._getKey(s)-this._getKey(a)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<r.length;s++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[s]=e[t],t++):r[s]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(en=this._search(t),en===-1)||this._getKey(this._array[en])!==t)return!1;do if(this._array[en]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(en),!0;while(++en<this._array.length&&this._getKey(this._array[en])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,a)=>s-a),t=0,n=new Array(this._array.length-e.length),r=0;for(let s=0;s<this._array.length;s++)e[t]===s?t++:n[r++]=this._array[s];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(en=this._search(e),!(en<0||en>=this._array.length)&&this._getKey(this._array[en])===e))do yield this._array[en];while(++en<this._array.length&&this._getKey(this._array[en])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(en=this._search(e),!(en<0||en>=this._array.length)&&this._getKey(this._array[en])===e))do t(this._array[en]);while(++en<this._array.length&&this._getKey(this._array[en])===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}},s_=0,vE=0,GQ=class extends Je{constructor(){super(),this._decorations=new KQ(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new ke),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ke),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Ut(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new YQ(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,s=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,s=r+(a.options.width??1),e>=r&&e<s&&(!n||(a.options.layer??"bottom")===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,s=>{s_=s.options.x??0,vE=s_+(s.options.width??1),e>=s_&&e<vE&&(!n||(s.options.layer??"bottom")===n)&&r(s)})}},YQ=class extends ao{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ke),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ke),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=qt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=qt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},XQ=1e3,ZQ=class{constructor(e,t=XQ){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=r-this._lastRefreshMs,a=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},a)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},_E=20,Xf=class extends Je{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let a=0;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);if(this._topBoundaryFocusListener=a=>this._handleBoundaryFocus(a,0),this._bottomBoundaryFocusListener=a=>this._handleBoundaryFocus(a,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new ZQ(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(a=>this._handleResize(a.rows))),this._register(this._terminal.onRender(a=>this._refreshRows(a.start,a.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(a=>this._handleChar(a))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
604
|
-
`))),this._register(this._terminal.onA11yTab(a=>this._handleTab(a))),this._register(this._terminal.onKey(a=>this._handleKey(a.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ue(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Ut(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<_E+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
605
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===_E+1&&(this._liveRegion.textContent+=ty.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let s=e;s<=t;s++){let a=n.lines.get(n.ydisp+s),l=[],u=(a==null?void 0:a.translateToString(!0,void 0,void 0,l))||"",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,l)),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"),a=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===a||e.relatedTarget!==r)return;let l,u;if(t===0?(l=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(l=this._rowElements.shift(),u=n,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let 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 m=h instanceof Text?h.parentNode:h,p=parseInt(m==null?void 0:m.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(m);if(!_)return console.warn("columns is null. Race condition?"),null;let b=d<_.length?_[d]:_.slice(-1)[0]+1;return b>=this._terminal.cols&&(++p,b=0),{row:p,column:b}},a=s(t),l=s(n);if(!(!a||!l)){if(a.row>l.row||a.row===l.row&&a.column>=l.column)throw new Error("invalid range");this._terminal.select(a.column,a.row,(l.row-a.row)*this._terminal.cols-a.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var s,a;e.style.transform="";let t=e.getBoundingClientRect().width,n=(a=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:a[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};Xf=Zt([Te(1,L0),Te(2,bs),Te(3,xs)],Xf);var zy=class extends Je{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 ke),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ke),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Ut(()=>{var a;ia(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(a=this._activeProviderReplies)==null||a.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ue(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ue(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ue(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ue(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let r=0;r<n.length;r++){let s=n[r];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var r,s;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(a=>{a==null||a.forEach(l=>{l.link.dispose&&l.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[a,l]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(a)&&(n=this._checkLinkProviderResult(a,e,n)):l.provideLinks(e.y,u=>{var d,m;if(this._isMouseOut)return;let h=u==null?void 0:u.map(p=>({link:p}));(d=this._activeProviderReplies)==null||d.set(a,h),n=this._checkLinkProviderResult(a,e,n),((m=this._activeProviderReplies)==null?void 0:m.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let s=t.get(r);if(s)for(let a=0;a<s.length;a++){let l=s[a],u=l.link.range.start.y<e?0:l.link.range.start.x,h=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let d=u;d<=h;d++){if(n.has(d)){s.splice(a--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,t,n){var a;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),s=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(s=!0);if(!s&&r){let l=r.find(u=>this._linkAtPosition(u.link,t));l&&(n=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let l=0;l<this._activeProviderReplies.size;l++){let u=(a=this._activeProviderReplies.get(l))==null?void 0:a.find(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&&QQ(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,ia(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.pointerCursor},set:n=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.underline},set:n=>{var r,s,a;(r=this._currentLink)!=null&&r.state&&((a=(s=this._currentLink)==null?void 0:s.state)==null?void 0:a.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let r=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(r,s),this._lastMouseEvent)){let a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,s=t.y*this._bufferService.cols+t.x;return n<=s&&s<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,s){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:s}}};zy=Zt([Te(1,j0),Te(2,xs),Te(3,Zn),Te(4,y5)],zy);function QQ(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 JQ=class extends WQ{constructor(e={}){super(e),this._linkifier=this._register(new Ml),this.browser=B5,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ml),this._onCursorMove=this._register(new ke),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ke),this.onKey=this._onKey.event,this._onRender=this._register(new ke),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ke),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ke),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ke),this.onBell=this._onBell.event,this._onFocus=this._register(new ke),this._onBlur=this._register(new ke),this._onA11yCharEmitter=this._register(new ke),this._onA11yTabEmitter=this._register(new ke),this._onWillOpen=this._register(new ke),this._setup(),this._decorationService=this._instantiationService.createInstance(GQ),this._instantiationService.setService(ad,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(UZ),this._instantiationService.setService(y5,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(ry)),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(zn.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(zn.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(zn.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(zn.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Ut(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,r="";switch(t.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+t.index}switch(t.type){case 0:let s=Bt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ge.ESC}]${r};${BQ(s)}${z5.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(a=>a.ansi[t.index]=cn.toColor(...t.color));else{let a=n;this._themeService.modifyColors(l=>l[a]=cn.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(Xf,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ge.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(ge.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,s=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*s,l=this.buffer.y*this._renderService.dimensions.css.cell.height,u=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=l+"px",this.textarea.style.width=a+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ue(this.element,"copy",t=>{this.hasSelection()&&rX(t,this._selectionService)}));let e=t=>iX(t,this.textarea,this.coreService,this.optionsService);this._register(Ue(this.textarea,"paste",e)),this._register(Ue(this.element,"paste",e)),I5?this._register(Ue(this.element,"mousedown",t=>{t.button===2&&Tk(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ue(this.element,"contextmenu",t=>{Tk(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),$0&&this._register(Ue(this.element,"auxclick",t=>{t.button===1&&u5(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ue(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ue(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ue(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ue(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ue(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ue(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ue(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(Ue(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",ey.get()),U5||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(HZ,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(bs,this._coreBrowserService),this._register(Ue(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Ue(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Cy,this._document,this._helperContainer),this._instantiationService.setService(zp,this._charSizeService),this._themeService=this._instantiationService.createInstance(Ty),this._instantiationService.setService(Kl,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Kf),this._instantiationService.setService(_5,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Ey,this.rows,this.screenElement)),this._instantiationService.setService(xs,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(xy,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(ky),this._instantiationService.setService(j0,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(zy,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(yy,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ry,this.element,this.screenElement,r)),this._instantiationService.setService(hX,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(zn.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var a;this._selectionService.refresh(),(a=this._viewport)==null||a.queueSync()})),this._register(this._instantiationService.createInstance(by,this.screenElement)),this._register(Ue(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Xf,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(qf,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(qf,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(wy,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(a){var d,m,p,_,b;let l=e._mouseService.getMouseReportCoords(a,e.screenElement);if(!l)return!1;let u,h;switch(a.overrideType||a.type){case"mousemove":h=32,a.buttons===void 0?(u=3,a.button!==void 0&&(u=a.button<3?a.button:3)):u=a.buttons&1?0:a.buttons&4?1:a.buttons&2?2:3;break;case"mouseup":h=0,u=a.button<3?a.button:3;break;case"mousedown":h=1,u=a.button<3?a.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(a)===!1)return!1;let S=a.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(a,(_=(p=(m=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:m.device)==null?void 0:p.cell)==null?void 0:_.height,(b=e._coreBrowserService)==null?void 0:b.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:l.col,row:l.row,x:l.x,y:l.y,button:u,action:h,ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:a=>(n(a),a.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(a)),wheel:a=>(n(a),this.cancel(a,!0)),mousedrag:a=>{a.buttons&&n(a)},mousemove:a=>{a.buttons||n(a)}};this._register(this.coreMouseService.onProtocolChange(a=>{a?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(a)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),a&8?r.mousemove||(t.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),a&16?r.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),a&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),a&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ue(t,"mousedown",a=>{if(a.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(a)))return n(a),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(a)})),this._register(Ue(t,"wheel",a=>{var l,u,h,d,m;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(a)===!1)return!1;if(!this.buffer.hasScrollback){if(a.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(a,(d=(h=(u=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:u.device)==null?void 0:h.cell)==null?void 0:d.height,(m=e._coreBrowserService)==null?void 0:m.dpr)===0)return this.cancel(a,!0);let p=ge.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(a.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(p,!0),this.cancel(a,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){c5(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=qQ(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===ge.ETX||n.key===ge.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)&&(eJ(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(ln));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(ge.ESC+"[I"):this.coreService.triggerDataEvent(ge.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(`${ge.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(`${ge.ESC}[6;${s};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function eJ(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var tJ=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)}},nJ=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 Yr)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},yE=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 nJ(t)}getNullCell(){return new Yr}},rJ=class extends Je{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ke),this.onBufferChange=this._onBufferChange.event,this._normal=new yE(this._core.buffers.normal,"normal"),this._alternate=new yE(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)}},iJ=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)}},sJ=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}},oJ=["cols","rows"],bi=0,aJ=class extends Je{constructor(e){super(),this._core=this._register(new JQ(e)),this._addonManager=this._register(new tJ),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(oJ.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 iJ(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new sJ(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 rJ(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
|
|
606
|
-
`,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 ey.get()},set promptLabel(e){ey.set(e)},get tooMuchOutput(){return ty.get()},set tooMuchOutput(e){ty.set(e)}}}_verifyIntegers(...e){for(bi of e)if(bi===1/0||isNaN(bi)||bi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(bi of e)if(bi&&(bi===1/0||isNaN(bi)||bi%1!==0||bi<0))throw new Error("This API only accepts positive integers")}};const Q5="lever-theme",J5=y.createContext(void 0),lJ=e=>e==="light"||e==="dark"||e==="system",eD=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",bE=e=>{if(typeof document>"u")return;const t=e==="system"?eD():e;document.documentElement.classList.toggle("dark",t==="dark")},cJ=()=>{if(typeof window>"u")return"system";const e=window.localStorage.getItem(Q5);return lJ(e)?e:"system"};function uJ({children:e}){const[t,n]=y.useState(cJ);y.useEffect(()=>{bE(t),typeof window<"u"&&window.localStorage.setItem(Q5,t)},[t]),y.useEffect(()=>{if(t!=="system")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>bE("system");return s.addEventListener?(s.addEventListener("change",a),()=>s.removeEventListener("change",a)):(s.addListener(a),()=>s.removeListener(a))},[t]);const r=y.useMemo(()=>{const s=t==="system"?eD():t;return{theme:t,resolvedTheme:s,setTheme:n}},[t]);return g.jsx(J5.Provider,{value:r,children:e})}function tD(){const e=y.useContext(J5);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const dJ={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"},hJ={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 nD(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function rD(e,t){var S,w,C,k,T;const n=e.element,r=(k=(C=(w=(S=e._core)==null?void 0:S._renderService)==null?void 0:w.dimensions)==null?void 0:C.css)==null?void 0:k.cell,s=(r==null?void 0:r.width)??0,a=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(s)||!Number.isFinite(a)||s<=0||a<=0)return null;const l=t.getBoundingClientRect(),u=window.getComputedStyle(t),h=window.getComputedStyle(n),d=e.options.scrollback===0?0:((T=e.options.overviewRuler)==null?void 0:T.width)??14,m=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight)+parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),p=parseFloat(u.paddingTop)+parseFloat(u.paddingBottom)+parseFloat(h.paddingTop)+parseFloat(h.paddingBottom),_=Math.max(0,l.width-m-d-1),b=Math.max(0,l.height-p);return{cols:Math.max(2,Math.floor(_/s)),rows:Math.max(1,Math.floor(b/a))}}function Gh(e){e.refresh(0,Math.max(0,e.rows-1))}function Yh(e,t,n,r,s){const a=rD(e,t)??nD(e);return n.current&&n.current.cols===a.cols&&n.current.rows===a.rows||(e.resize(a.cols,a.rows),n.current=a,r&&s(a.cols,a.rows)),a}function fJ({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:s,clearVersion:a=0,focusRequestVersion:l=0,onPathChange:u}){const{resolvedTheme:h}=tD(),d=y.useRef(null),m=y.useRef(null),p=y.useRef(null),_=y.useRef(!1),b=y.useRef(0),S=y.useRef(null),w=y.useRef(null),[C,k]=y.useState(null),[T,R]=y.useState(null),M=h==="dark"?hJ:dJ,L=(j,F)=>{n.command({type:"terminal.resize",terminalId:t,cols:j,rows:F}).catch(()=>{})},O=()=>{const j=()=>{const F=m.current,G=d.current;!F||!G||!_.current||Yh(F,G,w,!0,L)};requestAnimationFrame(()=>{j(),setTimeout(j,0)})};return y.useEffect(()=>{const j=new aJ({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 VY;j.loadAddon(F),j.loadAddon(new QY),m.current=j;const G=d.current;G&&(j.open(G),p.current&&j.write(p.current),Yh(j,G,w,!1,()=>{}),Gh(j),O());const P=j.onData(U=>{n.command({type:"terminal.input",terminalId:t,data:U}).catch($=>{R($ instanceof Error?$.message:String($))})}),H=j.onResize(({cols:U,rows:$})=>{if(!_.current)return;const W={cols:U,rows:$};w.current&&w.current.cols===U&&w.current.rows===$||(w.current=W,L(U,$))}),B=new ResizeObserver(()=>{const U=m.current,$=d.current;!U||!$||Yh(U,$,w,_.current,(W,z)=>{n.command({type:"terminal.resize",terminalId:t,cols:W,rows:z}).catch(()=>{})})});return G&&B.observe(G),()=>{B.disconnect(),H.dispose(),P.dispose(),p.current=F.serialize(),j.dispose(),m.current=null}},[r,n,t,M]),y.useEffect(()=>{const j=m.current;j&&(j.options.scrollback=r)},[r]),y.useEffect(()=>{const j=m.current;j&&(j.options.theme=M,Gh(j))},[M]),y.useEffect(()=>{if(l===0)return;const j=m.current;j&&requestAnimationFrame(()=>{j.focus()})},[l]),y.useEffect(()=>{if(a===0)return;const j=m.current;j&&(_.current=!1,b.current+=1,S.current=null,p.current=null,k(null),R(null),j.reset(),Gh(j),n.command({type:"terminal.close",terminalId:t}).catch(F=>{R(F instanceof Error?F.message:String(F))}))},[a,n,t]),y.useEffect(()=>{u==null||u((C==null?void 0:C.cwd)??null)},[C==null?void 0:C.cwd,u]),y.useEffect(()=>{const j=P=>{const H=m.current;if(!H)return;const B=JSON.stringify({cwd:P.cwd,shell:P.shell,cols:P.cols,rows:P.rows,scrollback:P.scrollback,status:P.status,exitCode:P.exitCode,serializedState:P.serializedState});if(S.current===B){k({cwd:P.cwd,shell:P.shell,status:P.status,exitCode:P.exitCode}),p.current=P.serializedState||null;return}S.current=B,k({cwd:P.cwd,shell:P.shell,status:P.status,exitCode:P.exitCode}),p.current=P.serializedState||null,H.options.scrollback=P.scrollback,H.reset(),P.serializedState&&H.write(P.serializedState),Gh(H)},F=()=>{const P=m.current,H=d.current;if(!P||!H)return;const B=rD(P,H)??nD(P);P.resize(B.cols,B.rows),w.current=B,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:B.cols,rows:B.rows,scrollback:r}).then(U=>{_.current=!0,R(null),U&&j(U),O()}).catch(U=>{R(U instanceof Error?U.message:String(U))})},G=()=>{const P=++b.current,H=()=>{if(b.current!==P)return;const B=m.current,U=d.current;if(!B||!U)return;Yh(B,U,w,!1,()=>{});const $=U.getBoundingClientRect();if($.width<=0||$.height<=0){requestAnimationFrame(H);return}F()};requestAnimationFrame(()=>{requestAnimationFrame(H)})};return G(),n.subscribeTerminal(t,{onSnapshot:P=>{if(!P){_.current=!1,S.current=null,s==="connected"&&G();return}_.current=!0,R(null),j(P),O()},onEvent:P=>{const H=m.current;if(H){if(P.type==="terminal.output"){H.write(P.data);return}P.type==="terminal.exit"&&k(B=>({cwd:(B==null?void 0:B.cwd)??"",shell:(B==null?void 0:B.shell)??"",status:"exited",exitCode:P.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 pJ=24;function iD(e){return e+pJ}function mJ(e,t){return Math.max(1,e)*iD(t)}function xE({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:s,minColumnWidth:a,focusRequestVersion:l=0,splitTerminalShortcut:u,onAddTerminal:h,onRemoveTerminal:d,onTerminalLayout:m}){const p=y.useRef(null),_=y.useRef({}),b=y.useRef([]),[S,w]=y.useState(0),[C,k]=y.useState({}),[T,R]=y.useState({});y.useLayoutEffect(()=>{const G=p.current;if(!G)return;const P=()=>{w(G.getBoundingClientRect().width)},H=new ResizeObserver(P);return H.observe(G),P(),()=>H.disconnect()},[]);const M=t.terminals.length,L=iD(a),O=mJ(M,a),j=Math.max(S,O),F=y.useMemo(()=>t.terminals.map(G=>G.id).join(":"),[t.terminals]);return y.useLayoutEffect(()=>{const G=b.current,P=t.terminals.map(U=>U.id),H=P.find(U=>!G.includes(U));if(b.current=P,!H||G.length===0)return;const B=_.current[H];B&&B.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:p,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(cf,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:G=>m(e,t.terminals.map(P=>G[P.id]??P.size)),children:t.terminals.map((G,P)=>g.jsxs(y.Fragment,{children:[g.jsx($o,{id:G.id,defaultSize:`${G.size}%`,minSize:`${L}px`,className:"min-h-0 overflow-hidden",style:{minWidth:L},children:g.jsxs("div",{ref:H=>{_.current[G.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[G.id]??""})]})}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>R(H=>({...H,[G.id]:(H[G.id]??0)+1})),children:g.jsx(_P,{className:"size-3.5"})}),g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>h(e,G.id),children:g.jsx(mb,{className:"size-3.5"})})}),g.jsx(hl,{side:"bottom",shortcut:u})]}),g.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>d(e,G.id),children:g.jsx(ca,{className:"size-3.5"})})]})]}),g.jsx(fJ,{projectId:e,terminalId:G.id,socket:n,scrollback:s,connectionStatus:r,clearVersion:T[G.id]??0,focusRequestVersion:P===0?l:0,onPathChange:H=>k(B=>B[G.id]===H?B:{...B,[G.id]:H})})]})}),P<t.terminals.length-1?g.jsx(uf,{withHandle:!0,orientation:"horizontal"}):null]},G.id))},F)})})})}const gJ={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function vJ({status:e}){const t=(e?gJ[e]:void 0)||"Processing...",n=e==="failed";return g.jsx(vo,{className:"ml-[1px]",children:g.jsxs(UG,{children:[n?g.jsx(ca,{className:"size-4.5 text-red-500"}):g.jsx(Di,{className:"size-4.5 animate-spin text-muted-icon"}),g.jsx(xp,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const sD={toggleEmbeddedTerminal:"Toggle Embedded Terminal",toggleRightSidebar:"Toggle Right Sidebar",openInFinder:"Open In Finder",openInEditor:"Open In Editor",addSplitTerminal:"Add Split Terminal"};function o_(e){return(e??[]).join(", ")}function eu(e){return e.split(",").map(t=>t.trim()).map(t=>t.toLowerCase()).filter(Boolean)}const _J=new Map([["cmd","meta"],["meta","meta"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["option","alt"],["shift","shift"]]);function yJ(e,t){const n=bJ(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 tu(e,t,n){return((e==null?void 0:e.bindings[t])??no[t]).some(s=>yJ(s,n))}function oD(e){return{bindings:{toggleEmbeddedTerminal:(e==null?void 0:e.bindings.toggleEmbeddedTerminal)??no.toggleEmbeddedTerminal,toggleRightSidebar:(e==null?void 0:e.bindings.toggleRightSidebar)??no.toggleRightSidebar,openInFinder:(e==null?void 0:e.bindings.openInFinder)??no.openInFinder,openInEditor:(e==null?void 0:e.bindings.openInEditor)??no.openInEditor,addSplitTerminal:(e==null?void 0:e.bindings.addSplitTerminal)??no.addSplitTerminal},warning:(e==null?void 0:e.warning)??null,filePathDisplay:(e==null?void 0:e.filePathDisplay)??""}}function bJ(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(),a=_J.get(s);if(a==="ctrl"){n.ctrl=!0;continue}if(a==="meta"){n.meta=!0;continue}if(a==="alt"){n.alt=!0;continue}if(a==="shift"){n.shift=!0;continue}if(n.key)return null;n.key=s}return n.key?n:null}const Ip=20,Py=50,aD=30;function lD(e){return Number.isFinite(e)?Math.min(Py,Math.max(Ip,e)):aD}function xJ(){return{isVisible:!1,size:Ip}}function a_(e,t){return e[t]??xJ()}function SJ(e){return!e||typeof e!="object"?{projects:{}}:{projects:Object.fromEntries(Object.entries(e.projects??{}).map(([r,s])=>[r,{isVisible:!1,size:lD(s.size??aD)}]))}}const yf=Fl()(Ul(e=>({projects:{},toggleVisibility:t=>e(n=>({projects:{...n.projects,[t]:{...a_(n.projects,t),isVisible:!a_(n.projects,t).isVisible}}})),setSize:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...a_(r.projects,t),size:lD(n)}}})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"right-sidebar-layouts",version:2,migrate:SJ})),wJ={isVisible:!1,size:Ip},W0=[68,32];function CJ(){return{isVisible:!1,mainSizes:[...W0],terminals:[],nextTerminalIndex:0}}function kJ(e,t){return e[t]??CJ()}function l_(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 EJ(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 RJ(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function cl(e,t,n){return{...e,[t]:n(kJ(e,t))}}const Js=Fl()(Ul(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:cl(r.projects,t,s=>{var h,d;const a=RJ(s.terminals),l={id:((d=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:d.call(h))??`terminal-${Date.now()}-${s.nextTerminalIndex}`,title:EJ(s.nextTerminalIndex),size:100/(a.length+1)},u=n?Math.max(a.findIndex(m=>m.id===n)+1,0):a.length;return{...s,isVisible:!0,nextTerminalIndex:s.nextTerminalIndex+1,terminals:[...a.slice(0,u),l,...a.slice(u)]}})})),removeTerminal:(t,n)=>e(r=>({projects:cl(r.projects,t,s=>{const a=s.terminals.filter(u=>u.id!==n);if(a.length===0)return{...s,isVisible:!1,terminals:[]};const l=l_(a.map(u=>u.size));return{...s,terminals:a.map((u,h)=>({...u,size:l[h]??100/a.length}))}})})),toggleVisibility:t=>e(n=>({projects:cl(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),resetMainSizes:t=>e(n=>({projects:cl(n.projects,t,r=>({...r,mainSizes:[...W0]}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const s=l_(n);return{projects:cl(r.projects,t,a=>({...a,mainSizes:s}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:cl(r.projects,t,s=>{if(n.length!==s.terminals.length)return s;const a=l_(n);return{...s,terminals:s.terminals.map((l,u)=>({...l,size:a[u]??l.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"terminal-layouts",version:1})),TJ={isVisible:!1,mainSizes:[...W0],terminals:[],nextTerminalIndex:0},Zf=1e3,By=500,Iy=5e3,Qf=450,Hy=250,Fy=900,Uy="cursor";function $y(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 MJ(e){switch(e){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function SE(e){return Number.isFinite(e)?Math.min(Iy,Math.max(By,Math.round(e))):Zf}function wE(e){return Number.isFinite(e)?Math.min(Fy,Math.max(Hy,Math.round(e))):Qf}function CE(e){switch(e){case"vscode":case"windsurf":case"custom":case"cursor":return e;default:return Uy}}function c_(e,t){const n=e==null?void 0:e.trim();return n&&n.length>0?n:$y(t)}const Wr=Fl()(Ul(e=>({scrollbackLines:Zf,minColumnWidth:Qf,editorPreset:Uy,editorCommandTemplate:$y(Uy),setScrollbackLines:t=>e({scrollbackLines:SE(t)}),setMinColumnWidth:t=>e({minColumnWidth:wE(t)}),setEditorPreset:t=>e(n=>{const r=CE(t);return{editorPreset:r,editorCommandTemplate:r==="custom"?c_(n.editorCommandTemplate,r):$y(r)}}),setEditorCommandTemplate:t=>e(n=>({editorCommandTemplate:c_(t,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:e=>{const t=e,n=CE(t==null?void 0:t.editorPreset);return{scrollbackLines:SE((t==null?void 0:t.scrollbackLines)??Zf),minColumnWidth:wE((t==null?void 0:t.minColumnWidth)??Qf),editorPreset:n,editorCommandTemplate:c_(t==null?void 0:t.editorCommandTemplate,n)}}})),NJ=35;function AJ(e,t){return!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0?0:e*(t/100)}function DJ(e,t){const n=AJ(e,t);return n>=0&&n<NJ}const ml=350,OJ=[.4,0,.2,1],LJ=8,kE=1e-6;function jJ(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function zJ(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function PJ(e,t,n){const r=1-e;return 3*r*r*t+6*r*e*(n-t)+3*e*e*(1-n)}function BJ(e,t,n){let r=e;for(let s=0;s<LJ;s+=1){const a=jJ(r,t,n)-e;if(Math.abs(a)<kE)return r;const l=PJ(r,t,n);if(Math.abs(l)<kE)break;r-=a/l}return r}function IJ(e){if(e<=0)return 0;if(e>=1)return 1;const[t,n,r,s]=OJ,a=BJ(e,t,r);return zJ(a,n,s)}function cD(e,t,n){const r=IJ(n);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function HJ({projectId:e,shouldRenderRightSidebarLayout:t,showRightSidebar:n,rightSidebarSize:r}){const s=y.useRef(null),a=y.useRef(null),l=y.useRef(null),u=y.useRef(null),h=y.useRef(null),d=y.useRef(!1),m=y.useRef(null),p=y.useRef(!1),_=y.useRef(!1);return y.useEffect(()=>()=>{u.current!==null&&window.cancelAnimationFrame(u.current),h.current!==null&&window.clearTimeout(h.current)},[]),y.useLayoutEffect(()=>{var j,F,G,P,H,B;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 b=s.current;if(!b)return;u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null);const S=m.current,w=S!==null&&S!==e,C=n&&!_.current,k=!p.current,T=n?[100-r,r]:[100,0],R=w||k&&n,M=C||k?[100,0]:[b.getLayout().workspace??T[0],b.getLayout().rightSidebar??T[1]];if(m.current=e,p.current=t,_.current=n,R||Math.abs(M[0]-T[0])<.1&&Math.abs(M[1]-T[1])<.1){b.setLayout({workspace:T[0],rightSidebar:T[1]}),(j=a.current)==null||j.setAttribute("data-right-sidebar-open",n?"true":"false"),(F=l.current)==null||F.setAttribute("data-right-sidebar-open",n?"true":"false"),(G=l.current)==null||G.setAttribute("data-right-sidebar-animated","false");return}d.current=!0,(P=a.current)==null||P.setAttribute("data-right-sidebar-open",n?"true":"false"),(H=l.current)==null||H.setAttribute("data-right-sidebar-open",n?"true":"false"),(B=l.current)==null||B.setAttribute("data-right-sidebar-animated","true"),b.setLayout({workspace:M[0],rightSidebar:M[1]});const L=performance.now(),O=U=>{const $=Math.min(1,(U-L)/ml),W=cD(M,T,$);if(b.setLayout({workspace:W[0],rightSidebar:W[1]}),$<1){u.current=window.requestAnimationFrame(O);return}b.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(O)},[e,r,t,n]),y.useEffect(()=>{t||(p.current=!1,_.current=!1)},[t]),{isAnimating:d,panelGroupRef:s,sidebarPanelRef:a,sidebarVisualRef:l}}function FJ(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 UJ({previousProjectId:e,projectId:t,previousShouldRenderTerminalLayout:n,previousShowTerminalPane:r,showTerminalPane:s,terminalLayout:a,liveLayout:l}){const u=e!==null&&e!==t,h=s&&!r,d=!n,m=e===null&&t!==null,p=s?a.mainSizes:[100,0];return{currentLayout:h||d?[100,0]:l,shouldSkipAnimation:u||m&&d,targetLayout:p}}function $J({chatInputRef:e,projectId:t,shouldRenderTerminalLayout:n,showTerminalPane:r,terminalLayout:s}){const a=y.useRef(null),l=y.useRef(null),u=y.useRef(null),h=y.useRef(null),d=y.useRef(null),m=y.useRef(!1),p=y.useRef(null),_=y.useRef(!1),b=y.useRef(!1),S=y.useRef(!1),[w,C]=y.useState(0);return y.useEffect(()=>{var R;const k=p.current,T=S.current;FJ({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,p.current=t},[e,t,r]),y.useEffect(()=>()=>{h.current!==null&&window.cancelAnimationFrame(h.current),d.current!==null&&window.clearTimeout(d.current)},[]),y.useLayoutEffect(()=>{var F,G,P,H,B,U;if(!n){h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null),m.current=!1;return}const k=a.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=p.current,{currentLayout:R,shouldSkipAnimation:M,targetLayout:L}=UJ({previousProjectId:T,projectId:t,previousShouldRenderTerminalLayout:_.current,previousShowTerminalPane:b.current,showTerminalPane:r,terminalLayout:s,liveLayout:[k.getLayout().chat??s.mainSizes[0],k.getLayout().terminal??s.mainSizes[1]]});if(_.current=n,b.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=l.current)==null||F.setAttribute("data-terminal-open",r?"true":"false"),(G=u.current)==null||G.setAttribute("data-terminal-open",r?"true":"false"),(P=u.current)==null||P.setAttribute("data-terminal-animated","false");return}m.current=!0,(H=l.current)==null||H.setAttribute("data-terminal-open",r?"true":"false"),(B=u.current)==null||B.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 O=performance.now(),j=$=>{const W=Math.min(1,($-O)/ml),z=cD(R,L,W);if(k.setLayout({chat:z[0],terminal:z[1]}),W<1){h.current=window.requestAnimationFrame(j);return}k.setLayout({chat:L[0],terminal:L[1]}),h.current=null,d.current=window.setTimeout(()=>{m.current=!1,d.current=null},0)};h.current=window.requestAnimationFrame(j)},[t,n,r,s.mainSizes]),y.useEffect(()=>{n||(_.current=!1,b.current=!1)},[n]),{isAnimating:m,mainPanelGroupRef:a,terminalFocusRequestVersion:w,terminalPanelRef:l,terminalVisualRef:u}}function WJ({content:e,attachments:t=[]}){const[n,r]=y.useState(null),s=y.useMemo(()=>t.filter(h=>h.kind==="image"&&h.contentUrl),[t]),a=y.useMemo(()=>t.filter(h=>h.kind!=="image"||!h.contentUrl),[t]),l=t.find(h=>h.id===n)??null;function u(h){if(i0(h).openInNewTab){typeof window<"u"&&window.open(new URL(h.contentUrl,window.location.origin).toString(),"_blank","noopener,noreferrer");return}r(h.id)}return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex flex-col items-end gap-2",children:[s.length>0?g.jsx("div",{className:"flex max-w-[85%] sm:max-w-[80%] flex-wrap justify-end gap-3",children:s.map(h=>g.jsx(EN,{attachment:h,onClick:()=>u(h)},h.id))}):null,a.length>0?g.jsx("div",{className:"flex max-w-[85%] sm:max-w-[80%] flex-wrap justify-end gap-2",children:a.map(h=>g.jsx(RN,{attachment:h,onClick:()=>u(h)},h.id))}):null,e?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(Vl,{remarkPlugins:[ql],components:sd(),children:e})}):null]}),g.jsx(PA,{attachment:l,onOpenChange:h=>!h&&r(null)})]})}function VJ({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 uD({title:e,count:t,children:n,badge:r}){const[s,a]=y.useState(!1);return t===0?null:g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[g.jsx(fs,{className:_e("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 u_({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:g.jsx(uD,{title:e,count:t.length,children:g.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>g.jsx(zA,{icon:r?r(s):n,children:s},s))})})}function qJ(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function dD({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return g.jsx("span",{className:_e("inline-block h-2 w-2 rounded-full shrink-0",t)})}function KJ(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 EE({server:e}){const[t,n]=y.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:_e("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(fs,{className:_e("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),g.jsx(dD,{status:e.status}),g.jsx("span",{className:"text-muted-foreground font-medium",children:k_(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:KJ(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(zA,{icon:jA(`mcp__${e.name}__${s}`),children:s},s))})]})}function GJ({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(dD,{status:"failed"}),g.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return g.jsx(uD,{title:"MCP Servers",count:e.length,badge:r,children:g.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(s=>g.jsx(EE,{server:s},s.name)),n.map(s=>g.jsx(EE,{server:s},s.name))]})})}function YJ({rawJson:e}){const[t,n]=y.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(fs,{className:_e("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 XJ({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=y.useMemo(()=>{const s=new Map,a=[];for(const u of e.tools){const h=qJ(u);if(h){const d=s.get(h.server)||[];d.push(h.tool),s.set(h.server,d)}else a.push(u)}const l=e.mcpServers.map(u=>({name:u.name,status:u.status,error:u.error,tools:s.get(u.name)||[]}));return{coreTools:a,mcpServersWithTools:l}},[e.tools,e.mcpServers]);return g.jsx(vo,{children:g.jsxs(Op,{expandedContent:g.jsx(Lp,{className:"my-4 text-xs",children:g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx($G,{children:e.model}),g.jsx(u_,{title:"Tools",items:n,getIcon:s=>Z_[s]??LA}),g.jsx(u_,{title:"Agents",items:e.agents,icon:_b}),g.jsx(u_,{title:"Commands",items:e.slashCommands,icon:AB}),g.jsx(GJ,{servers:r}),t&&g.jsx(YJ,{rawJson:t})]})}),children:[g.jsx(U6,{className:"h-5 w-5 text-logo"}),g.jsx(ho,{children:"Session Started"})]})})}function ZJ({message:e}){return g.jsx(vo,{className:"hidden",children:g.jsxs(Op,{expandedContent:g.jsx(Lp,{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(_b,{className:"h-4 w-4 text-muted-foreground"})}),g.jsx(ho,{children:"Account"})]})})}function QJ({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(Vl,{remarkPlugins:[ql],components:sd(),children:e.text})})}function JJ({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:s}){const a=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:[a?g.jsx("button",{onClick:r,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:g.jsx(eP,{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 RE({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 hD({selected:e,multiSelect:t,onClick:n}){return g.jsx("button",{type:"button",onClick:n,className:_e("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 eee({option:e,selected:t,multiSelect:n,onClick:r,isLast:s}){const a="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",l=s?"":"border-b border-border";return r?g.jsx("button",{onClick:r,className:_e(a,l,"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(RE,{label:e.label,description:e.description})}),g.jsx(hD,{selected:t,multiSelect:n})]})}):g.jsx("div",{className:_e(a,l),children:g.jsx(RE,{label:e.label,description:e.description})})}function tee(e){return e==null?void 0:e.answers}function ri(e){return e.id||e.question}function nee({message:e,onSubmit:t,isLatest:n}){var z,q;const r=e.input.questions,s=!!e.result,a=tee(e.result),l=((z=e.result)==null?void 0:z.discarded)===!0,[u,h]=y.useState(0),[d,m]=y.useState({}),[p,_]=y.useState({}),[b,S]=y.useState(a??null),[w,C]=y.useState(s),k=(V,X)=>{var ce;const N=(ce=p[V])==null?void 0:ce.trim(),I=d[V]||"",Z=X||r.find(pe=>ri(pe)===V);if(Z!=null&&Z.multiSelect)return[I,N].filter(Boolean).flatMap(pe=>pe.split(", ").filter(Boolean));const D=N||I;return D?[D]:[]},T=V=>{const X=d[ri(V)]||"";return V.multiSelect?X.split(", ").filter(Boolean):[X]},R=(V,X)=>{const N=ri(V);if(V.multiSelect){const I=d[N]?d[N].split(", ").filter(Boolean):[],Z=I.includes(X)?I.filter(D=>D!==X):[...I,X];m({...d,[N]:Z.join(", ")})}else m({...d,[N]:X}),_({...p,[N]:""}),u<r.length-1&&setTimeout(()=>h(u+1),150)},M=(V,X)=>{const N=ri(V);_({...p,[N]:X}),X&&!V.multiSelect&&m({...d,[N]:""})},L=V=>{const X=ri(V);V.multiSelect&&p[X]&&_({...p,[X]:""})},O=r.every(V=>k(ri(V),V).length>0),j=r[u],F=u===r.length-1,G=j&&k(ri(j),j).length>0,P=()=>{u<r.length-1&&h(u+1)},H=()=>{u>0&&h(u-1)},B=()=>{if(!O)return;const V={};for(const X of r){const N=ri(X);V[N]=k(N,X)}S(V),C(!0),t(e.toolId,r,V)},U=V=>{if(V.key==="Enter"&&!(!j||!G)){if(V.preventDefault(),F){B();return}P()}};if(w||s){const V=a||b||{};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:l?"Discarded":"Answers"})]}),r.map((X,N)=>{const I=V[ri(X)]||V[X.question]||[],Z=N===r.length-1;return g.jsxs("div",{className:_e("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!Z&&"border-b border-border"),children:[g.jsx("div",{className:"text-sm text-pretty",children:X.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:l?"Discarded":"No Response"})]},ri(X))})]})})}if(!n)return g.jsx("div",{className:"w-full py-2",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(pT,{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 $=T(j),W=p[ri(j)]||"";return g.jsxs("div",{className:"w-full space-y-3",children:[g.jsxs(JJ,{question:j.question,currentIndex:u,totalQuestions:r.length,onBack:u>0?H:void 0,children:[(q=j.options)==null?void 0:q.map(V=>g.jsx(eee,{option:V,selected:$.includes(V.label),multiSelect:j.multiSelect,onClick:()=>R(j,V.label)},V.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:W,onChange:V=>M(j,V.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(hD,{selected:!!W,multiSelect:j.multiSelect,onClick:j.multiSelect&&W?()=>L(j):void 0})]})})]}),g.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!F&&G&&(j.multiSelect||!!W)&&g.jsx(tt,{size:"sm",onClick:P,children:"Next"}),F&&g.jsx(tt,{size:"sm",onClick:B,disabled:!O,className:_e(!O&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}function ree({message:e,onConfirm:t,isLatest:n}){const r=!!e.result,[s,a]=y.useState(!1),[l,u]=y.useState(!1),[h,d]=y.useState(!1),[m,p]=y.useState(""),_=y.useRef(null),b=e.input;y.useEffect(()=>{h&&_.current&&_.current.focus()},[h]);const S=async()=>{b!=null&&b.plan&&(await navigator.clipboard.writeText(b.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:[(b==null?void 0:b.plan)&&g.jsx(tt,{variant:"ghost",size:"icon",className:_e("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",!l&&"hover:text-foreground",l&&"hover:!bg-transparent hover:!border-transparent"),onClick:S,children:l?g.jsx(lo,{className:"h-4 w-4 text-green-400"}):g.jsx(cp,{className:"h-4 w-4"})}),g.jsxs("div",{className:_e("!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(tt,{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:()=>a(!s),children:[s?"Show Less":"Show More",g.jsx(hb,{className:`size-3.5 transition-transform ${s?"rotate-180":""}`})]}),b!=null&&b.plan?g.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[g.jsx(Vl,{remarkPlugins:[ql],components:sd(),children:b.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(gP,{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(tt,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-background pr-4 md:order-last",children:[g.jsx(G6,{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(tt,{size:"sm",variant:"outline",onClick:()=>d(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[g.jsx(gT,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),g.jsxs(tt,{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:m,onChange:k=>p(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&m.trim()&&(k.preventDefault(),t(e.toolId,!1,void 0,m.trim())),k.key==="Escape"&&(d(!1),p(""))},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(tt,{size:"sm",variant:"ghost",onClick:()=>{d(!1),p("")},className:"rounded-full text-muted-foreground",children:"Cancel"}),g.jsxs(tt,{size:"sm",disabled:!m.trim(),onClick:()=>t(e.toolId,!1,void 0,m.trim()),className:"rounded-full bg-primary text-background disabled:opacity-50 disabled:pointer-events-none",children:[g.jsx(kB,{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 iee={completed:{Icon:lo,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:Di,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:aP,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function see({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(ZP,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),g.jsx("div",{children:t.map((n,r)=>{const s=r===t.length-1,{Icon:a,iconClass:l,textClass:u}=iee[n.status];return g.jsxs("div",{className:_e("flex items-center gap-3 px-4 py-2.5 bg-background",!s&&"border-b border-border"),children:[g.jsx(a,{className:_e("h-4 w-4 flex-shrink-0",l)}),g.jsx("span",{className:_e("text-sm",u),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function TE(e){return(e&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)?e.content:Array.isArray(e)?e:[]).flatMap(n=>!n||typeof n!="object"||!("type"in n)||n.type!=="image"?[]:"data"in n&&typeof n.data=="string"?[{type:"image",data:n.data,mimeType:typeof n.mimeType=="string"?n.mimeType:void 0}]:"source"in n&&n.source&&typeof n.source=="object"&&"type"in n.source&&n.source.type==="base64"&&"data"in n.source&&typeof n.source.data=="string"?[{type:"image",data:n.source.data,mimeType:typeof n.source.media_type=="string"?n.source.media_type:void 0}]:[])}function oee({images:e}){return g.jsx("div",{className:"flex flex-col gap-3",children:e.map((t,n)=>{const r=t.mimeType||"image/png";return g.jsx("div",{className:"overflow-hidden rounded-lg border border-border bg-muted/20",children:g.jsx("img",{src:`data:${r};base64,${t.data}`,alt:`Read result ${n+1}`,className:"max-h-[50vh] w-full object-contain bg-background"})},`${r}:${n}`)})})}function fD({message:e,isLoading:t=!1,localPath:n}){var w;const r=e.result!==void 0,s=!r&&t,a=y.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 C=e.input.pattern,k=e.input.outputMode;return k==="count"?`Count \`${C}\` occurrences`:k==="content"?`Find \`${C}\` in text`:`Find \`${C}\` in files`}return e.toolKind==="bash"?e.input.description||(e.input.command?e7(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?`Read ${$v(e.input.filePath,n)}`:e.toolKind==="write_file"?`Write ${$v(e.input.filePath,n)}`:e.toolKind==="edit_file"?`Edit ${$v(e.input.filePath,n)}`:e.toolKind==="mcp_generic"?`${k_(e.input.tool)} from ${k_(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[e.input,e.toolName,n]),l=y.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),u=y.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),h=e.toolKind==="bash",d=e.toolKind==="write_file",m=e.toolKind==="edit_file",p=e.toolKind==="read_file",_=y.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 C=e.result.content;if(typeof C=="string")return C}return JSON.stringify(e.result,null,2)},[e.result]),b=y.useMemo(()=>{if(!p)return[];if(e.result&&typeof e.result=="object"&&"blocks"in e.result){const C=e.result.blocks;if(Array.isArray(C)){const k=TE(C);if(k.length>0)return k}}return TE(e.rawResult)},[p,e.rawResult,e.result]),S=y.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(vo,{className:"w-full",children:g.jsxs(Op,{expandedContent:g.jsx(Lp,{className:"my-4 text-sm",children:g.jsxs("div",{className:"flex flex-col gap-2",children:[m?g.jsx(af,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):!p&&!d&&g.jsx(ik,{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:S,children:S}),r&&p&&!e.isError&&(b.length>0?g.jsxs("div",{children:[g.jsx("span",{className:"font-medium text-muted-foreground",children:"Image"}),g.jsx("div",{className:"mt-1",children:g.jsx(oee,{images:b})})]}):g.jsx(af,{content:_})),d&&!e.isError&&g.jsx(af,{content:e.input.content}),r&&!p&&!(d&&!e.isError)&&!(m&&!e.isError)&&g.jsx(ik,{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(ca,{className:"size-4 text-destructive"});if(l)return g.jsx(_b,{className:"size-4 text-muted-icon"});const C=jA(e.toolName);return g.jsx(C,{className:"size-4 text-muted-icon"})})()}),g.jsx(ho,{className:"text-left transition-opacity duration-200 truncate",children:g.jsx(xp,{animate:s,shimmerWidth:Math.max(20,(((w=u||a)==null?void 0:w.length)??33)*3),children:u||a})})]})})}function aee({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),s=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return s>0?`${s}h${a>0?` ${a}m`:""}`:a>0?`${a}m${l>0?` ${l}s`:""}`:`${l}s`};return e.success?g.jsxs(vo,{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(ho,{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 lee({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(sP,{className:"h-4 w-4 ml-1.5"}),g.jsx("em",{children:"Interrupted"})]})})}function Jf({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 cee(){return g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Jf,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),g.jsx(Jf,{})]})}function uee(){return g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Jf,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),g.jsx(Jf,{})]})}function dee({message:e}){return g.jsx(vo,{children:g.jsxs(Op,{expandedContent:g.jsx(Lp,{className:"my-4 text-xs",children:g.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:g.jsx(Vl,{remarkPlugins:[ql],components:sd(),children:e.summary})})}),children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(mT,{className:"h-4.5 w-4.5 text-muted-foreground"})}),g.jsx(ho,{children:"Summarized"})]})})}const hee={compacting:"Compacting..."};function fee({message:e}){const t=hee[e.status]||e.status;return g.jsxs(vo,{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(mT,{className:"h-4.5 w-4.5 text-muted-foreground"})}),g.jsx(ho,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const pee={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"}},mee={key:"other",singular:"tool call",plural:"tool calls"};function gee(e){return pee[e]??mee}function vee(e){const t=new Map,n=[];for(const r of e){const s=r.toolKind,a=gee(s),l=t.get(a.key);l?l.count++:(t.set(a.key,{category:a,count:1}),n.push(a.key))}return n.map(r=>{const{category:s,count:a}=t.get(r);return`${a} ${a===1?s.singular:s.plural}`}).join(", ")}function _ee({messages:e,isLoading:t,localPath:n}){const[r,s]=y.useState(!1),a=y.useMemo(()=>vee(e),[e]),u=e.some(h=>h.result===void 0)&&t;return g.jsx(vo,{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(fs,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),g.jsx(ho,{className:"text-left",children:g.jsx(xp,{animate:u,children:a})})]})}),r&&g.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(h=>g.jsx(fD,{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(fs,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),g.jsx(ho,{className:"text-left",children:"Collapse"})]})})]})]})})}const yee=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function ME(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!yee.has(t)}function bee(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(ME(r)){const s=[r],a=n;for(n+=1;n<e.length&&ME(e[n]);)s.push(e[n]),n+=1;s.length>=2?t.push({type:"tool-group",messages:s,startIndex:a}):t.push({type:"single",message:r,index:a});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function xee({messages:e,isLoading:t,localPath:n,latestToolIds:r,onOpenLocalLink:s,onAskUserQuestionSubmit:a,onExitPlanModeConfirm:l}){const u=y.useMemo(()=>bee(e),[e]);function h(d,m){if(d.kind==="user_prompt")return g.jsx(WJ,{content:d.content,attachments:d.attachments},d.id);switch(d.kind){case"unknown":return g.jsx(VJ,{json:d.json},d.id);case"system_init":return e.findIndex(_=>_.kind==="system_init")===m?g.jsx(XJ,{message:d,rawJson:d.debugRaw},d.id):null;case"account_info":return e.findIndex(_=>_.kind==="account_info")===m?g.jsx(ZJ,{message:d},d.id):null;case"assistant_text":return g.jsx(QJ,{message:d},d.id);case"tool":return d.toolKind==="ask_user_question"?g.jsx(nee,{message:d,onSubmit:a,isLatest:d.id===r.AskUserQuestion},d.id):d.toolKind==="exit_plan_mode"?g.jsx(ree,{message:d,onConfirm:l,isLatest:d.id===r.ExitPlanMode},d.id):d.toolKind==="todo_write"?d.id!==r.TodoWrite?null:g.jsx(see,{message:d},d.id):g.jsx(fD,{message:d,isLoading:t,localPath:n},d.id);case"result":{const p=e[m+1],_=e[m-1];return(p==null?void 0:p.kind)==="context_cleared"||(_==null?void 0:_.kind)==="context_cleared"?null:g.jsx(aee,{message:d},d.id)}case"interrupted":return g.jsx(lee,{message:d},d.id);case"compact_boundary":return g.jsx(cee,{},d.id);case"context_cleared":return g.jsx(uee,{},d.id);case"compact_summary":return g.jsx(dee,{message:d},d.id);case"status":return m===e.length-1?g.jsx(fee,{message:d},d.id):null}}return g.jsx(FG,{onOpenLocalLink:s,children:u.map(d=>{if(d.type==="tool-group")return g.jsx("div",{className:"group relative",[Ef]:"",children:g.jsx(_ee,{messages:d.messages,isLoading:t,localPath:n})},`group-${d.startIndex}`);const m=h(d.message,d.index);return m?g.jsx("div",{id:`msg-${d.message.id}`,className:"group relative",[Ef]:"",children:m},d.message.id):null})})}function See({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){y.useEffect(()=>{if(!n)return;let s=0,a=null;const l=p=>{const _=p instanceof Element?p:null,b=e.current,S=t.current;if(LC({trigger:"pointer",activeElement:document.activeElement,pointerStartTarget:a,pointerEndTarget:_,root:b,fallback:S,hasActiveOverlay:OC(document),hasActiveSelection:ZB(window.getSelection())})!=="restore"){a=null;return}S==null||S.focus({preventScroll:!0}),a=null},u=p=>{cancelAnimationFrame(s),a=p.target instanceof Element?p.target:null},h=p=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{l(p.target)})},d=()=>{a=null;const p=t.current;!p||p.disabled||p.focus({preventScroll:!0})},m=p=>{if(p.key!=="Escape")return;const _=t.current;LC({trigger:"escape",activeElement:document.activeElement,fallback:_,hasActiveOverlay:OC(document),canCancel:r,defaultPrevented:p.defaultPrevented})==="escape-focus"&&(p.preventDefault(),_==null||_.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",u,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("keydown",m,!0),window.addEventListener(kf,d),()=>{cancelAnimationFrame(s),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener(kf,d)}},[r,n,t,e])}const Xh="What are we building?",wee=19,Cee=72,kee=120;function Eee(e){return Array.from(e).includes("Files")}function Ree(){var yt,dt,Ct,tn,_t,jt;const e=eb(),t=y.useRef(null),n=y.useRef(null),r=y.useRef(null),s=y.useRef(null),[a,l]=y.useState(""),[u,h]=y.useState(!1),[d,m]=y.useState(0),[p,_]=y.useState(!1),b=y.useRef(0),S=((yt=e.runtime)==null?void 0:yt.projectId)??null,C=Js(be=>S?be.projects[S]:void 0)??TJ,T=yf(be=>S?be.projects[S]:void 0)??wJ,R=Js(be=>be.addTerminal),M=Js(be=>be.removeTerminal),L=Js(be=>be.toggleVisibility),O=Js(be=>be.resetMainSizes),j=Js(be=>be.setMainSizes),F=Js(be=>be.setTerminalSizes),G=yf(be=>be.toggleVisibility),P=yf(be=>be.setSize),H=Wr(be=>be.scrollbackLines),B=Wr(be=>be.minColumnWidth),U=e.keybindings,$=y.useMemo(()=>oD(U),[U]),W=C.terminals.length>0,z=!!(S&&C.isVisible&&W),q=!!(S&&W),V=!!(S&&T.isVisible),X=!!S,{isAnimating:N,mainPanelGroupRef:I,terminalFocusRequestVersion:Z,terminalPanelRef:D,terminalVisualRef:ce}=$J({showTerminalPane:z,shouldRenderTerminalLayout:q,projectId:S,terminalLayout:C,chatInputRef:r}),{isAnimating:pe,panelGroupRef:ae,sidebarPanelRef:Q,sidebarVisualRef:ve}=HJ({projectId:S,shouldRenderRightSidebarLayout:X,showRightSidebar:V,rightSidebarSize:T.size});See({rootRef:n,fallbackRef:r,enabled:e.hasSelectedProject&&((dt=e.runtime)==null?void 0:dt.status)!=="waiting_for_user",canCancel:e.canCancel});function ne(be){var Be;return Eee(((Be=be.dataTransfer)==null?void 0:Be.types)??[])}function de(be){var Be;!e.hasSelectedProject||be.length===0||(Be=s.current)==null||Be.enqueueFiles(be)}const we=()=>{if(S){if(W){L(S);return}R(S)}},Ce=be=>{var ct;if(!S||!z||N.current)return;const Be=be.chat,$t=be.terminal;if(!Number.isFinite(Be)||!Number.isFinite($t))return;const ie=((ct=t.current)==null?void 0:ct.getBoundingClientRect().height)??0;if(DJ(ie,$t)){O(S),L(S);return}j(S,[Be,$t])};y.useEffect(()=>{if(e.messages.length!==0)return;l(""),h(!1);let be=0;const Be=window.setInterval(()=>{be+=1,l(Xh.slice(0,be)),be>=Xh.length&&(window.clearInterval(Be),h(!0))},wee);return()=>window.clearInterval(Be)},[e.activeChatId,e.messages.length]),y.useEffect(()=>{function be(Be){if(S){if(tu($,"toggleEmbeddedTerminal",Be)){Be.preventDefault(),we();return}if(tu($,"toggleRightSidebar",Be)){Be.preventDefault(),G(S);return}if(tu($,"openInFinder",Be)){Be.preventDefault(),e.handleOpenExternal("open_finder");return}if(tu($,"openInEditor",Be)){Be.preventDefault(),e.handleOpenExternal("open_editor");return}tu($,"addSplitTerminal",Be)&&(Be.preventDefault(),R(S))}}return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[R,we,S,$,G,L]),y.useEffect(()=>{const be=window.requestAnimationFrame(()=>{e.updateScrollState()}),Be=window.setTimeout(()=>{e.updateScrollState()},ml);return()=>{window.cancelAnimationFrame(be),window.clearTimeout(Be)}},[q,z,e.updateScrollState]),y.useEffect(()=>{function be(){e.updateScrollState()}return window.addEventListener("resize",be),()=>window.removeEventListener("resize",be)},[e.updateScrollState]),y.useEffect(()=>{const be=t.current;if(!be||!q)return;const Be=()=>{const ie=be.getBoundingClientRect().height;if(ie<=0)return;const ct=ie*(C.mainSizes[1]/100);ct<=0||m(ue=>Math.abs(ue-ct)<1?ue:ct)},$t=new ResizeObserver(Be);return $t.observe(be),Be(),()=>$t.disconnect()},[S,q,C.mainSizes]);const Re=be=>Number.isFinite(be)?Math.min(Py,Math.max(Ip,be)):T.size,ze=g.jsxs(IA,{ref:n,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",onDragEnter:be=>{!ne(be)||!e.hasSelectedProject||(be.preventDefault(),b.current+=1,_(!0))},onDragOver:be=>{!ne(be)||!e.hasSelectedProject||(be.preventDefault(),be.dataTransfer.dropEffect="copy",p||_(!0))},onDragLeave:be=>{!ne(be)||!e.hasSelectedProject||(be.preventDefault(),b.current=Math.max(0,b.current-1),b.current===0&&_(!1))},onDrop:be=>{!ne(be)||!e.hasSelectedProject||(be.preventDefault(),b.current=0,_(!1),de([...be.dataTransfer.files]))},children:[g.jsxs(FA,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[g.jsx(oY,{sidebarCollapsed:e.sidebarCollapsed,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,onNewChat:e.handleCompose,localPath:e.navbarLocalPath,embeddedTerminalVisible:z,onToggleEmbeddedTerminal:S?we:void 0,rightSidebarVisible:V,onToggleRightSidebar:S?()=>G(S):void 0,onOpenExternal:be=>{e.handleOpenExternal(be)},editorLabel:e.editorLabel,finderShortcut:$.bindings.openInFinder,editorShortcut:$.bindings.openInEditor,terminalShortcut:$.bindings.toggleEmbeddedTerminal,rightSidebarShortcut:$.bindings.toggleRightSidebar}),g.jsxs(n0,{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(xee,{messages:e.messages,isLoading:e.isProcessing,localPath:(Ct=e.runtime)==null?void 0:Ct.localPath,latestToolIds:e.latestToolIds,onOpenLocalLink:e.handleOpenLocalLink,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?g.jsx(vJ,{status:(tn=e.runtime)==null?void 0:tn.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:Cee,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(mu,{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":Xh,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:Xh}),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:a}),g.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true",children:g.jsx("span",{className:"kanna-typewriter-cursor","data-typing-complete":u?"true":"false"})})]})]})})]})})},e.activeChatId??"new-chat"):null,p?g.jsxs("div",{className:"absolute inset-0 z-30 pointer-events-none",children:[g.jsx("div",{className:"absolute inset-0 backdrop-blur-sm"}),g.jsx("div",{className:"absolute inset-6 ",children:g.jsx("div",{className:"flex h-full items-center justify-center",children:g.jsxs("div",{className:"text-center flex flex-col items-center justify-center gap-3",children:[g.jsx(KB,{className:"mx-auto size-14 text-foreground",strokeWidth:1.75}),g.jsx("div",{className:"text-xl font-medium text-foreground",children:"Drop up to 10 files"})]})})})]}):null,g.jsx("div",{style:{bottom:kee},className:_e("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(z6,{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(nY,{ref:s,inputElementRef:r,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((_t=e.runtime)==null?void 0:_t.status)==="waiting_for_user",canCancel:e.canCancel,chatId:e.activeChatId,projectId:S,activeProvider:((jt=e.runtime)==null?void 0:jt.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:X&&S?g.jsxs(cf,{groupRef:ae,orientation:"horizontal",className:"flex-1 min-h-0",onLayoutChange:be=>{var $t;if(!V||pe.current)return;const Be=Re(be.rightSidebar);Math.abs(Be-be.rightSidebar)<.1||($t=ae.current)==null||$t.setLayout({workspace:100-Be,rightSidebar:Be})},onLayoutChanged:be=>{!V||pe.current||P(S,Re(be.rightSidebar))},children:[g.jsx($o,{id:"workspace",defaultSize:`${100-T.size}%`,minSize:"50%",className:"min-h-0 min-w-0",children:q?g.jsxs(cf,{groupRef:I,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:Ce,children:[g.jsx($o,{id:"chat",defaultSize:`${C.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:ze}),g.jsx(uf,{withHandle:!0,orientation:"vertical",disabled:!z,className:_e(!z&&"pointer-events-none opacity-0")}),g.jsx($o,{id:"terminal",defaultSize:`${C.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:D,children:g.jsx("div",{ref:ce,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":z?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${ml}ms`},children:g.jsx("div",{style:d>0?{height:`${d}px`}:void 0,children:g.jsx(xE,{projectId:S,layout:C,onAddTerminal:R,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:H,minColumnWidth:B,splitTerminalShortcut:$.bindings.addSplitTerminal,focusRequestVersion:Z,onRemoveTerminal:(be,Be)=>{e.socket.command({type:"terminal.close",terminalId:Be}).catch(()=>{}),M(be,Be)},onTerminalLayout:F})})})})]},S):ze}),g.jsx(uf,{withHandle:!0,orientation:"horizontal",disabled:!V,className:_e(!V&&"pointer-events-none opacity-0")}),g.jsx($o,{id:"rightSidebar",defaultSize:`${T.size}%`,maxSize:`${Py}%`,className:"min-h-0 min-w-0",elementRef:Q,children:g.jsx("div",{ref:ve,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":`${ml}ms`},children:g.jsx(aY,{onClose:()=>G(S)})})})]},`${S}-right-sidebar`):q&&S?g.jsxs(cf,{groupRef:I,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:Ce,children:[g.jsx($o,{id:"chat",defaultSize:`${C.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:ze}),g.jsx(uf,{withHandle:!0,orientation:"vertical",disabled:!z,className:_e(!z&&"pointer-events-none opacity-0")}),g.jsx($o,{id:"terminal",defaultSize:`${C.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:D,children:g.jsx("div",{ref:ce,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":z?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${ml}ms`},children:g.jsx("div",{style:d>0?{height:`${d}px`}:void 0,children:g.jsx(xE,{projectId:S,layout:C,onAddTerminal:R,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:H,minColumnWidth:B,splitTerminalShortcut:$.bindings.addSplitTerminal,focusRequestVersion:Z,onRemoveTerminal:(be,Be)=>{e.socket.command({type:"terminal.close",terminalId:Be}).catch(()=>{}),M(be,Be)},onTerminalLayout:F})})})})]},S):ze})}function NE({narrow:e=!1,title:t,subtitle:n,icon:r=pb}){return g.jsxs("div",{className:_e("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[g.jsxs("div",{className:_e("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:_e("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const Tee={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function pD({value:e,onValueChange:t,options:n,size:r="md",className:s,optionClassName:a}){return g.jsx("div",{className:_e("inline-flex items-center rounded-lg border border-border p-[3px] ",s),children:n.map(l=>{const u=l.value===e,h=l.icon,d=h?y.isValidElement(h)?h:(()=>{const p=h;return g.jsx(p,{className:r==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,m=g.jsxs("button",{type:"button",onClick:()=>t(l.value),disabled:l.disabled,"aria-pressed":u,className:_e("rounded-[4px] border transition-colors",h?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",Tee[r],u?"bg-white dark:bg-muted text-slate-900 dark:text-slate-200 border-slate-300 dark:border-white/10 bg-slate-200 ":"border-transparent text-slate-800 hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",l.disabled&&"opacity-50 pointer-events-none",a),children:[d,g.jsx("span",{children:l.label})]},l.value);return l.tooltip?g.jsxs(Af,{children:[g.jsx(Df,{asChild:!0,children:m}),g.jsx(Mu,{children:l.tooltip})]},l.value):m})})}function Mee(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Nee({open:e,onOpenChange:t,onConfirm:n}){const[r,s]=y.useState("new"),[a,l]=y.useState(""),[u,h]=y.useState(""),d=y.useRef(null),m=y.useRef(null);y.useEffect(()=>{e&&(s("new"),l(""),h(""),setTimeout(()=>{var C;return(C=d.current)==null?void 0:C.focus()},0))},[e]),y.useEffect(()=>{e&&setTimeout(()=>{var C,k;r==="new"?(C=d.current)==null||C.focus():(k=m.current)==null||k.focus()},0)},[r,e]);const p=Mee(a),_=p?`${GI}/${p}`:"",b=u.trim(),S=r==="new"?!!p:!!b,w=()=>{if(S){if(r==="new")n({mode:"new",localPath:_,title:a.trim()});else{const C=b.split("/").pop()||b;n({mode:"existing",localPath:b,title:C})}t(!1)}};return g.jsx(bb,{open:e,onOpenChange:t,children:g.jsxs(up,{size:"sm",children:[g.jsxs(Sb,{className:"space-y-4",children:[g.jsx(xb,{children:"Add Project"}),g.jsx(pD,{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(io,{ref:d,type:"text",value:a,onChange:C=>l(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(io,{ref:m,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(wb,{children:[g.jsx(tt,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),g.jsx(tt,{variant:"secondary",size:"sm",onClick:w,disabled:!S,children:"Create"})]})]})})}function Aee({text:e}){const[t,n]=y.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return g.jsx(tt,{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(cp,{className:"h-4 w-4"})})}function AE({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(fs,{className:"inline h-4 w-4 opacity-40"}),g.jsx("code",{children:e})]}),g.jsx(Aee,{text:e})]})}function Zh({children:e}){return g.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function d_({children:e}){return g.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function h_({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 DE(){return g.jsx(B6,{className:"h-4 w-4 text-muted-foreground"})}function OE({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 Dee({localPath:e,loading:t,onClick:n}){return g.jsxs(Af,{children:[g.jsx(Df,{asChild:!0,children:g.jsxs("button",{className:_e("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(WP,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),g.jsx("span",{className:"font-medium text-foreground truncate flex-1",children:rM(e)}),t?g.jsx(Di,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):g.jsx(gb,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})}),g.jsx(Mu,{children:g.jsx("p",{children:e})})]})}function Oee({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:s,onOpenProject:a,onCreateProject:l}){const[u,h]=y.useState(!1),d=y.useMemo(()=>(n==null?void 0:n.projects)??[],[n==null?void 0:n.projects]),m=e==="connecting"||!t,p=e==="connected"&&t;return g.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[p?g.jsxs(g.Fragment,{children:[g.jsx(NE,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${Kn} 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(tt,{variant:"default",size:"sm",onClick:()=>h(!0),children:[g.jsx(mb,{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(Dee,{localPath:_.localPath,loading:r===_.localPath,onClick:()=>{a(_.localPath)}},_.localPath))}):g.jsx(Zh,{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(NE,{narrow:!0,icon:TC,title:m?`Connecting ${Kn}`:`Connect ${Kn}`,subtitle:m?`${Kn} is starting up and loading your local projects.`:`Run ${Kn} 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(d_,{children:"Status"}),g.jsx("div",{className:"mb-8",children:g.jsx(Zh,{children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Di,{className:"h-4 w-4 text-muted-foreground animate-spin"}),g.jsx("span",{className:"text-sm text-muted-foreground",children:m?`Connecting to your local ${Kn} 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:Dh()})," from any terminal on this machine."]})})]})})}),m?null:g.jsxs("div",{className:"mb-10",children:[g.jsx(d_,{children:"How it works"}),g.jsx(Zh,{children:g.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[g.jsx(h_,{icon:vb,title:`${Kn} CLI`,subtitle:"On Your Machine"}),g.jsx(DE,{}),g.jsx(h_,{icon:pb,title:`${Kn} Server`,subtitle:"Local WebSocket"}),g.jsx(DE,{}),g.jsx(h_,{icon:TC,title:`${Kn} UI`,subtitle:"Project Chat"})]})})]}),m?null:g.jsxs("div",{className:"mb-10",children:[g.jsx(d_,{children:"Setup"}),g.jsx(Zh,{children:g.jsxs("div",{className:"space-y-4",children:[g.jsxs(OE,{number:1,title:`Start ${Kn}`,children:[g.jsx("p",{children:"Run this command in your terminal:"}),g.jsx(AE,{children:Dh()})]}),g.jsxs(OE,{number:2,title:"Open the local UI",children:[g.jsxs("p",{children:[Kn," serves the app locally and opens the Local Projects page in an app-style browser window."]}),g.jsx(AE,{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:Dh("").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:Dh("--no-open")}),g.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),g.jsx(Nee,{open:u,onOpenChange:h,onConfirm:_=>{l(_)}}),g.jsx("div",{className:"py-4 text-center",children:g.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",jb.split("/")[1]]})})]})}function Lee(){const e=eb();return g.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:g.jsx(Oee,{connectionStatus:e.connectionStatus,ready:e.localProjectsReady,snapshot:e.localProjects,startingLocalPath:e.startingLocalPath,commandError:e.commandError,onOpenProject:e.handleOpenLocalProject,onCreateProject:e.handleCreateProject})})}function LE({children:e,className:t,icon:n,type:r="button",variant:s="outline",...a}){return g.jsxs("button",{type:r,className:_e(ab({variant:s,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",t),...a,children:[n,g.jsx("span",{children:e})]})}function jE(e,[t,n]){return Math.min(n,Math.max(t,e))}function jee(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var zee=[" ","Enter","ArrowUp","ArrowDown"],Pee=[" ","Enter"],oa="Select",[Hp,Fp,Bee]=qb(oa),[Yl]=vs(oa,[Bee,po]),Up=po(),[Iee,_o]=Yl(oa),[Hee,Fee]=Yl(oa),mD=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:l,defaultValue:u,onValueChange:h,dir:d,name:m,autoComplete:p,disabled:_,required:b,form:S}=e,w=Up(t),[C,k]=y.useState(null),[T,R]=y.useState(null),[M,L]=y.useState(!1),O=Kb(d),[j,F]=wl({prop:r,defaultProp:s??!1,onChange:a,caller:oa}),[G,P]=wl({prop:l,defaultProp:u,onChange:h,caller:oa}),H=y.useRef(null),B=C?S||!!C.closest("form"):!0,[U,$]=y.useState(new Set),W=Array.from(U).map(z=>z.props.value).join(";");return g.jsx(mp,{...w,children:g.jsxs(Iee,{required:b,scope:t,trigger:C,onTriggerChange:k,valueNode:T,onValueNodeChange:R,valueNodeHasChildren:M,onValueNodeHasChildrenChange:L,contentId:ds(),value:G,onValueChange:P,open:j,onOpenChange:F,dir:O,triggerPointerDownPosRef:H,disabled:_,children:[g.jsx(Hp.Provider,{scope:t,children:g.jsx(Hee,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(z=>{$(q=>new Set(q).add(z))},[]),onNativeOptionRemove:y.useCallback(z=>{$(q=>{const V=new Set(q);return V.delete(z),V})},[]),children:n})}),B?g.jsxs(HD,{"aria-hidden":!0,required:b,tabIndex:-1,name:m,autoComplete:p,value:G,onChange:z=>P(z.target.value),disabled:_,form:S,children:[G===void 0?g.jsx("option",{value:""}):null,Array.from(U)]},W):null]})})};mD.displayName=oa;var gD="SelectTrigger",vD=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=Up(n),l=_o(gD,n),u=l.disabled||r,h=vt(t,l.onTriggerChange),d=Fp(n),m=y.useRef("touch"),[p,_,b]=UD(w=>{const C=d().filter(R=>!R.disabled),k=C.find(R=>R.value===l.value),T=$D(C,w,k);T!==void 0&&l.onValueChange(T.value)}),S=w=>{u||(l.onOpenChange(!0),b()),w&&(l.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return g.jsx(Ku,{asChild:!0,...a,children:g.jsx(st.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":FD(l.value)?"":void 0,...s,ref:h,onClick:Ne(s.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&S(w)}),onPointerDown:Ne(s.onPointerDown,w=>{m.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:Ne(s.onKeyDown,w=>{const C=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&_(w.key),!(C&&w.key===" ")&&zee.includes(w.key)&&(S(),w.preventDefault())})})})});vD.displayName=gD;var _D="SelectValue",yD=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:l="",...u}=e,h=_o(_D,n),{onValueNodeHasChildrenChange:d}=h,m=a!==void 0,p=vt(t,h.onValueNodeChange);return Un(()=>{d(m)},[d,m]),g.jsx(st.span,{...u,ref:p,style:{pointerEvents:"none"},children:FD(h.value)?g.jsx(g.Fragment,{children:l}):a})});yD.displayName=_D;var Uee="SelectIcon",bD=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return g.jsx(st.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});bD.displayName=Uee;var $ee="SelectPortal",xD=e=>g.jsx(jl,{asChild:!0,...e});xD.displayName=$ee;var aa="SelectContent",SD=y.forwardRef((e,t)=>{const n=_o(aa,e.__scopeSelect),[r,s]=y.useState();if(Un(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?ki.createPortal(g.jsx(wD,{scope:e.__scopeSelect,children:g.jsx(Hp.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),a):null}return g.jsx(CD,{...e,ref:t})});SD.displayName=aa;var oi=10,[wD,yo]=Yl(aa),Wee="SelectContentImpl",Vee=Zo("SelectContent.RemoveScroll"),CD=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:u,sideOffset:h,align:d,alignOffset:m,arrowPadding:p,collisionBoundary:_,collisionPadding:b,sticky:S,hideWhenDetached:w,avoidCollisions:C,...k}=e,T=_o(aa,n),[R,M]=y.useState(null),[L,O]=y.useState(null),j=vt(t,Q=>M(Q)),[F,G]=y.useState(null),[P,H]=y.useState(null),B=Fp(n),[U,$]=y.useState(!1),W=y.useRef(!1);y.useEffect(()=>{if(R)return ap(R)},[R]),sp();const z=y.useCallback(Q=>{const[ve,...ne]=B().map(Ce=>Ce.ref.current),[de]=ne.slice(-1),we=document.activeElement;for(const Ce of Q)if(Ce===we||(Ce==null||Ce.scrollIntoView({block:"nearest"}),Ce===ve&&L&&(L.scrollTop=0),Ce===de&&L&&(L.scrollTop=L.scrollHeight),Ce==null||Ce.focus(),document.activeElement!==we))return},[B,L]),q=y.useCallback(()=>z([F,R]),[z,F,R]);y.useEffect(()=>{U&&q()},[U,q]);const{onOpenChange:V,triggerPointerDownPosRef:X}=T;y.useEffect(()=>{if(R){let Q={x:0,y:0};const ve=de=>{var we,Ce;Q={x:Math.abs(Math.round(de.pageX)-(((we=X.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(de.pageY)-(((Ce=X.current)==null?void 0:Ce.y)??0))}},ne=de=>{Q.x<=10&&Q.y<=10?de.preventDefault():R.contains(de.target)||V(!1),document.removeEventListener("pointermove",ve),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",ne,{capture:!0})}}},[R,V,X]),y.useEffect(()=>{const Q=()=>V(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[V]);const[N,I]=UD(Q=>{const ve=B().filter(we=>!we.disabled),ne=ve.find(we=>we.ref.current===document.activeElement),de=$D(ve,Q,ne);de&&setTimeout(()=>de.ref.current.focus())}),Z=y.useCallback((Q,ve,ne)=>{const de=!W.current&&!ne;(T.value!==void 0&&T.value===ve||de)&&(G(Q),de&&(W.current=!0))},[T.value]),D=y.useCallback(()=>R==null?void 0:R.focus(),[R]),ce=y.useCallback((Q,ve,ne)=>{const de=!W.current&&!ne;(T.value!==void 0&&T.value===ve||de)&&H(Q)},[T.value]),pe=r==="popper"?Wy:kD,ae=pe===Wy?{side:u,sideOffset:h,align:d,alignOffset:m,arrowPadding:p,collisionBoundary:_,collisionPadding:b,sticky:S,hideWhenDetached:w,avoidCollisions:C}:{};return g.jsx(wD,{scope:n,content:R,viewport:L,onViewportChange:O,itemRefCallback:Z,selectedItem:F,onItemLeave:D,itemTextRefCallback:ce,focusSelectedItem:q,selectedItemText:P,position:r,isPositioned:U,searchRef:N,children:g.jsx(Vu,{as:Vee,allowPinchZoom:!0,children:g.jsx(Wu,{asChild:!0,trapped:T.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ne(s,Q=>{var ve;(ve=T.trigger)==null||ve.focus({preventScroll:!0}),Q.preventDefault()}),children:g.jsx(Ll,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:g.jsx(pe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:Q=>Q.preventDefault(),...k,...ae,onPlaced:()=>$(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ne(k.onKeyDown,Q=>{const ve=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ve&&Q.key.length===1&&I(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let de=B().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const we=Q.target,Ce=de.indexOf(we);de=de.slice(Ce+1)}setTimeout(()=>z(de)),Q.preventDefault()}})})})})})})});CD.displayName=Wee;var qee="SelectItemAlignedPosition",kD=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=_o(aa,n),l=yo(aa,n),[u,h]=y.useState(null),[d,m]=y.useState(null),p=vt(t,j=>m(j)),_=Fp(n),b=y.useRef(!1),S=y.useRef(!0),{viewport:w,selectedItem:C,selectedItemText:k,focusSelectedItem:T}=l,R=y.useCallback(()=>{if(a.trigger&&a.valueNode&&u&&d&&w&&C&&k){const j=a.trigger.getBoundingClientRect(),F=d.getBoundingClientRect(),G=a.valueNode.getBoundingClientRect(),P=k.getBoundingClientRect();if(a.dir!=="rtl"){const we=P.left-F.left,Ce=G.left-we,Re=j.left-Ce,ze=j.width+Re,yt=Math.max(ze,F.width),dt=window.innerWidth-oi,Ct=jE(Ce,[oi,Math.max(oi,dt-yt)]);u.style.minWidth=ze+"px",u.style.left=Ct+"px"}else{const we=F.right-P.right,Ce=window.innerWidth-G.right-we,Re=window.innerWidth-j.right-Ce,ze=j.width+Re,yt=Math.max(ze,F.width),dt=window.innerWidth-oi,Ct=jE(Ce,[oi,Math.max(oi,dt-yt)]);u.style.minWidth=ze+"px",u.style.right=Ct+"px"}const H=_(),B=window.innerHeight-oi*2,U=w.scrollHeight,$=window.getComputedStyle(d),W=parseInt($.borderTopWidth,10),z=parseInt($.paddingTop,10),q=parseInt($.borderBottomWidth,10),V=parseInt($.paddingBottom,10),X=W+z+U+V+q,N=Math.min(C.offsetHeight*5,X),I=window.getComputedStyle(w),Z=parseInt(I.paddingTop,10),D=parseInt(I.paddingBottom,10),ce=j.top+j.height/2-oi,pe=B-ce,ae=C.offsetHeight/2,Q=C.offsetTop+ae,ve=W+z+Q,ne=X-ve;if(ve<=ce){const we=H.length>0&&C===H[H.length-1].ref.current;u.style.bottom="0px";const Ce=d.clientHeight-w.offsetTop-w.offsetHeight,Re=Math.max(pe,ae+(we?D:0)+Ce+q),ze=ve+Re;u.style.height=ze+"px"}else{const we=H.length>0&&C===H[0].ref.current;u.style.top="0px";const Re=Math.max(ce,W+w.offsetTop+(we?Z:0)+ae)+ne;u.style.height=Re+"px",w.scrollTop=ve-ce+w.offsetTop}u.style.margin=`${oi}px 0`,u.style.minHeight=N+"px",u.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[_,a.trigger,a.valueNode,u,d,w,C,k,a.dir,r]);Un(()=>R(),[R]);const[M,L]=y.useState();Un(()=>{d&&L(window.getComputedStyle(d).zIndex)},[d]);const O=y.useCallback(j=>{j&&S.current===!0&&(R(),T==null||T(),S.current=!1)},[R,T]);return g.jsx(Gee,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:O,children:g.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:g.jsx(st.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});kD.displayName=qee;var Kee="SelectPopperPosition",Wy=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=oi,...a}=e,l=Up(n);return g.jsx(gp,{...l,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.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)"}})});Wy.displayName=Kee;var[Gee,V0]=Yl(aa,{}),Vy="SelectViewport",ED=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=yo(Vy,n),l=V0(Vy,n),u=vt(t,a.onViewportChange),h=y.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(Hp.Slot,{scope:n,children:g.jsx(st.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ne(s.onScroll,d=>{const m=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:_}=l;if(_!=null&&_.current&&p){const b=Math.abs(h.current-m.scrollTop);if(b>0){const S=window.innerHeight-oi*2,w=parseFloat(p.style.minHeight),C=parseFloat(p.style.height),k=Math.max(w,C);if(k<S){const T=k+b,R=Math.min(S,T),M=T-R;p.style.height=R+"px",p.style.bottom==="0px"&&(m.scrollTop=M>0?M:0,p.style.justifyContent="flex-end")}}}h.current=m.scrollTop})})})]})});ED.displayName=Vy;var RD="SelectGroup",[Yee,Xee]=Yl(RD),TD=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ds();return g.jsx(Yee,{scope:n,id:s,children:g.jsx(st.div,{role:"group","aria-labelledby":s,...r,ref:t})})});TD.displayName=RD;var MD="SelectLabel",ND=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Xee(MD,n);return g.jsx(st.div,{id:s.id,...r,ref:t})});ND.displayName=MD;var ep="SelectItem",[Zee,AD]=Yl(ep),DD=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...l}=e,u=_o(ep,n),h=yo(ep,n),d=u.value===r,[m,p]=y.useState(a??""),[_,b]=y.useState(!1),S=vt(t,T=>{var R;return(R=h.itemRefCallback)==null?void 0:R.call(h,T,r,s)}),w=ds(),C=y.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(Zee,{scope:n,value:r,disabled:s,textId:w,isSelected:d,onItemTextChange:y.useCallback(T=>{p(R=>R||((T==null?void 0:T.textContent)??"").trim())},[]),children:g.jsx(Hp.ItemSlot,{scope:n,value:r,disabled:s,textValue:m,children:g.jsx(st.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,...l,ref:S,onFocus:Ne(l.onFocus,()=>b(!0)),onBlur:Ne(l.onBlur,()=>b(!1)),onClick:Ne(l.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Ne(l.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Ne(l.onPointerDown,T=>{C.current=T.pointerType}),onPointerMove:Ne(l.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:Ne(l.onPointerLeave,T=>{var R;T.currentTarget===document.activeElement&&((R=h.onItemLeave)==null||R.call(h))}),onKeyDown:Ne(l.onKeyDown,T=>{var M;((M=h.searchRef)==null?void 0:M.current)!==""&&T.key===" "||(Pee.includes(T.key)&&k(),T.key===" "&&T.preventDefault())})})})})});DD.displayName=ep;var hu="SelectItemText",OD=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,l=_o(hu,n),u=yo(hu,n),h=AD(hu,n),d=Fee(hu,n),[m,p]=y.useState(null),_=vt(t,k=>p(k),h.onItemTextChange,k=>{var T;return(T=u.itemTextRefCallback)==null?void 0:T.call(u,k,h.value,h.disabled)}),b=m==null?void 0:m.textContent,S=y.useMemo(()=>g.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:C}=d;return Un(()=>(w(S),()=>C(S)),[w,C,S]),g.jsxs(g.Fragment,{children:[g.jsx(st.span,{id:h.textId,...a,ref:_}),h.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ki.createPortal(a.children,l.valueNode):null]})});OD.displayName=hu;var LD="SelectItemIndicator",jD=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return AD(LD,n).isSelected?g.jsx(st.span,{"aria-hidden":!0,...r,ref:t}):null});jD.displayName=LD;var qy="SelectScrollUpButton",zD=y.forwardRef((e,t)=>{const n=yo(qy,e.__scopeSelect),r=V0(qy,e.__scopeSelect),[s,a]=y.useState(!1),l=vt(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollTop>0;a(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:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop-h.offsetHeight)}}):null});zD.displayName=qy;var Ky="SelectScrollDownButton",PD=y.forwardRef((e,t)=>{const n=yo(Ky,e.__scopeSelect),r=V0(Ky,e.__scopeSelect),[s,a]=y.useState(!1),l=vt(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollHeight-h.clientHeight,m=Math.ceil(h.scrollTop)<d;a(m)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?g.jsx(BD,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop+h.offsetHeight)}}):null});PD.displayName=Ky;var BD=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=yo("SelectScrollButton",n),l=y.useRef(null),u=Fp(n),h=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>h(),[h]),Un(()=>{var m;const d=u().find(p=>p.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[u]),g.jsx(st.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ne(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Ne(s.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Ne(s.onPointerLeave,()=>{h()})})}),Qee="SelectSeparator",ID=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(st.div,{"aria-hidden":!0,...r,ref:t})});ID.displayName=Qee;var Gy="SelectArrow",Jee=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Up(n),a=_o(Gy,n),l=yo(Gy,n);return a.open&&l.position==="popper"?g.jsx(vp,{...s,...r,ref:t}):null});Jee.displayName=Gy;var ete="SelectBubbleInput",HD=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=y.useRef(null),a=vt(r,s),l=jee(t);return y.useEffect(()=>{const u=s.current;if(!u)return;const h=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(h,"value").set;if(l!==t&&m){const p=new Event("change",{bubbles:!0});m.call(u,t),u.dispatchEvent(p)}},[l,t]),g.jsx(st.select,{...n,style:{...$T,...n.style},ref:a,defaultValue:t})});HD.displayName=ete;function FD(e){return e===""||e===void 0}function UD(e){const t=ci(e),n=y.useRef(""),r=y.useRef(0),s=y.useCallback(l=>{const u=n.current+l;t(u),(function h(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>h(""),1e3))})(u)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function $D(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=tte(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function tte(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nte=mD,WD=vD,rte=yD,ite=bD,ste=xD,VD=SD,ote=ED,ate=TD,qD=ND,KD=DD,lte=OD,cte=jD,GD=zD,YD=PD,XD=ID;const zE=nte,PE=ate,BE=rte,Yy=y.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(WD,{ref:r,className:_e("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(ite,{asChild:!0,children:g.jsx(hb,{className:"h-4 w-4 shrink-0 opacity-50"})})]}));Yy.displayName=WD.displayName;const ZD=y.forwardRef(({className:e,...t},n)=>g.jsx(GD,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(rP,{className:"h-4 w-4"})}));ZD.displayName=GD.displayName;const QD=y.forwardRef(({className:e,...t},n)=>g.jsx(YD,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(hb,{className:"h-4 w-4"})}));QD.displayName=YD.displayName;const Xy=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>g.jsx(ste,{children:g.jsxs(VD,{ref:s,className:_e("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(ZD,{}),g.jsx(ote,{className:_e("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(QD,{})]})}));Xy.displayName=VD.displayName;const ute=y.forwardRef(({className:e,...t},n)=>g.jsx(qD,{ref:n,className:_e("px-2 py-1.5 text-sm font-semibold",e),...t}));ute.displayName=qD.displayName;const bf=y.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(KD,{ref:r,className:_e("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(cte,{children:g.jsx(lo,{className:"h-4 w-4"})})}),g.jsx(lte,{children:t})]}));bf.displayName=KD.displayName;const dte=y.forwardRef(({className:e,...t},n)=>g.jsx(XD,{ref:n,className:_e("-mx-1 my-1 h-px bg-border",e),...t}));dte.displayName=XD.displayName;const fu=[{id:"general",label:"General",icon:MB,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"providers",label:"Providers",icon:sB,subtitle:"Manage the default chat provider and saved model defaults for Claude Code and Codex."},{id:"keybindings",label:"Keybindings",icon:fP,subtitle:"Edit global app shortcuts stored in the active keybindings file."},{id:"changelog",label:"Changelog",icon:W6,subtitle:"Release notes pulled from the public GitHub releases feed."}];function IE(e){return e&&fu.some(t=>t.id===e)?e:null}const hte=[{value:"light",label:"Light",icon:HB},{value:"dark",label:"Dark",icon:cB},{value:"system",label:"System",icon:pb}],fte=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],pte="https://api.github.com/repos/jakemor/kanna/releases",mte=300*1e3;let gl=null;const HE=Object.keys(sD);function gte(e){return`Edit global app shortcuts stored in ${e}.`}function vte(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 _te(e=fetch){const t=await e(pte,{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 yte(){return gl?Date.now()>=gl.expiresAt?(gl=null,null):gl.releases:null}function bte(e){gl={releases:e,expiresAt:Date.now()+mte}}async function FE(e){const t=e!=null&&e.force?null:yte();if(t)return t;const n=await _te(e==null?void 0:e.fetchImpl);return bte(n),n}function xte(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 Ste({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(Di,{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 a,l;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:((a=s.name)==null?void 0:a.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:xte(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:_e(ab({variant:"ghost",size:"icon-sm"}),"h-8 w-8 shrink-0 rounded-md"),children:g.jsx(wte,{className:"h-4 w-4"})})]})]}),(l=s.body)!=null&&l.trim()?g.jsx("div",{className:"prose prose-sm mt-5 max-w-none text-foreground dark:prose-invert",children:g.jsx(Vl,{remarkPlugins:[ql],components:k0,children:s.body})}):g.jsx("div",{className:"mt-5 text-sm text-muted-foreground",children:"No release notes were provided."})]},s.id)}):null]})}function wte({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 as({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:_e("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 Cte(){var Be,$t;const e=Ol(),{sectionId:t}=lR(),n=eb(),{theme:r,setTheme:s}=tD(),[a,l]=y.useState("idle"),[u,h]=y.useState([]),[d,m]=y.useState(null),p=IE(t)??"general",_=n.connectionStatus==="connecting"||!n.localProjectsReady,b=((Be=n.localProjects)==null?void 0:Be.machine.displayName)??"Unavailable",S=(($t=n.localProjects)==null?void 0:$t.projects.length)??0,w=jb.split("/")[1]??"unknown",C=Wr(ie=>ie.scrollbackLines),k=Wr(ie=>ie.minColumnWidth),T=Wr(ie=>ie.editorPreset),R=Wr(ie=>ie.editorCommandTemplate),M=Wr(ie=>ie.setScrollbackLines),L=Wr(ie=>ie.setMinColumnWidth),O=Wr(ie=>ie.setEditorPreset),j=Wr(ie=>ie.setEditorCommandTemplate),F=n.keybindings,G=cs(ie=>ie.defaultProvider),P=cs(ie=>ie.providerDefaults),H=cs(ie=>ie.setDefaultProvider),B=cs(ie=>ie.setProviderDefaultModel),U=cs(ie=>ie.setProviderDefaultModelOptions),$=cs(ie=>ie.setProviderDefaultPlanMode),W=y.useMemo(()=>oD(F),[F]),z=W.filePathDisplay||QI(),[q,V]=y.useState(String(C)),[X,N]=y.useState(String(k)),[I,Z]=y.useState(R),[D,ce]=y.useState({}),[pe,ae]=y.useState(null),Q=n.updateSnapshot,ve=vte(Q),ne=(Q==null?void 0:Q.status)==="checking"?"Checking for updates…":(Q==null?void 0:Q.status)==="updating"?"Installing update…":(Q==null?void 0:Q.status)==="restart_pending"?"Restarting Kanna…":(Q==null?void 0:Q.status)==="available"?`Update available${Q.latestVersion?`: ${Q.latestVersion}`:""}`:(Q==null?void 0:Q.status)==="up_to_date"?"Up to date":(Q==null?void 0:Q.status)==="error"?"Update check failed":"Not checked yet";y.useEffect(()=>{V(String(C))},[C]),y.useEffect(()=>{N(String(k))},[k]),y.useEffect(()=>{Z(R)},[R]),y.useEffect(()=>{ce(Object.fromEntries(HE.map(ie=>[ie,o_(W.bindings[ie])])))},[W]),y.useEffect(()=>{t&&(IE(t)||e("/settings/general",{replace:!0}))},[e,t]),y.useEffect(()=>{if(p!=="changelog"||_)return;let ie=!1;return l("loading"),m(null),FE().then(ct=>{ie||(h(ct),l("success"))}).catch(ct=>{ie||(m(ct instanceof Error?ct.message:"Unable to load changelog."),l("error"))}),()=>{ie=!0}},[_,p]);function de(){const ie=Number(q);if(!Number.isFinite(ie)){V(String(C));return}M(ie)}function we(){const ie=Number(X);if(!Number.isFinite(ie)){N(String(k));return}L(ie)}function Ce(ie,ct){ie.key==="Enter"&&(ct(),ie.currentTarget.blur())}function Re(ie,ct){ie.key==="Enter"&&(ct(),ie.currentTarget.blur())}function ze(){j(I)}async function yt(){try{ae(null),await n.socket.command({type:"settings.writeKeybindings",bindings:UE(D)})}catch(ie){ae(ie instanceof Error?ie.message:"Unable to save keybindings.")}}async function dt(ie){const ct={...D,[ie]:o_(no[ie])};ce(ct);try{ae(null),await n.socket.command({type:"settings.writeKeybindings",bindings:UE(ct)})}catch(ue){ae(ue instanceof Error?ue.message:"Unable to save keybindings.")}}function Ct(){gl=null,l("loading"),m(null),FE({force:!0}).then(ie=>{h(ie),l("success")}).catch(ie=>{m(ie instanceof Error?ie.message:"Unable to load changelog."),l("error")})}const tn=I.replaceAll("{path}","/Users/jake/Projects/kanna/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),_t=fu.find(ie=>ie.id===p)??fu[0],jt=p==="keybindings"?gte(z):_t.subtitle,be=!_;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 ${be?"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"}),fu.map(ie=>g.jsx("button",{type:"button",onClick:()=>e(`/settings/${ie.id}`),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${ie.id===p?"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(ie.icon,{className:"h-4 w-4 shrink-0"}),g.jsx("span",{children:ie.label})]})},ie.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(fb,{className:"h-4 w-4 shrink-0"})})}),fu.map(ie=>g.jsxs("button",{type:"button",onClick:()=>e(`/settings/${ie.id}`),className:_e("flex shrink-0 items-center gap-2 rounded-full border px-3 py-2 text-sm transition-colors",ie.id===p?"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(ie.icon,{className:"h-4 w-4 shrink-0"}),g.jsx("span",{className:"whitespace-nowrap",children:ie.label})]},ie.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(Di,{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:_t.label}),p==="keybindings"?g.jsxs(LE,{onClick:()=>{n.handleOpenExternalPath("open_editor",z)},icon:g.jsx(uT,{className:"h-4 w-4"}),children:["Open in ",n.editorLabel]}):null,p==="general"?g.jsx("div",{className:"flex items-center gap-2",children:g.jsx(LE,{variant:ve.variant,onClick:()=>{if(ve.kind==="update"){n.handleInstallUpdate();return}n.handleCheckForUpdates({force:!0})},disabled:ve.disabled,icon:ve.kind==="check"?g.jsx(bB,{className:_e("size-3.5",ve.spinning&&"animate-spin")}):ve.kind==="update"?g.jsx(cP,{className:_e("size-3.5")}):void 0,children:ve.label})}):null]}),g.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:jt})]}),p==="general"?g.jsx(g.Fragment,{children:g.jsxs("div",{className:"border-b border-border",children:[g.jsx(as,{title:"Application Update",description:g.jsxs(g.Fragment,{children:[g.jsxs("span",{children:[ne,"."]}),Q!=null&&Q.lastCheckedAt?g.jsxs("span",{children:[" Last checked ",new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(Q.lastCheckedAt),"."]}):null,Q!=null&&Q.error?g.jsxs("span",{children:[" ",Q.error]}):null]}),bordered:!1,children:g.jsxs("div",{className:"text-right text-sm text-foreground",children:[g.jsxs("div",{children:["Current: ",(Q==null?void 0:Q.currentVersion)??w]}),g.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latest: ",(Q==null?void 0:Q.latestVersion)??"Unknown"]})]})}),g.jsx(as,{title:"Theme",description:"Choose between light, dark, or system appearance",children:g.jsx(pD,{value:r,onValueChange:s,options:hte,size:"sm"})}),g.jsx(as,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:g.jsxs(zE,{value:T,onValueChange:ie=>O(ie),children:[g.jsx(Yy,{className:"min-w-[180px]",children:g.jsx(BE,{})}),g.jsx(Xy,{children:g.jsx(PE,{children:fte.map(ie=>g.jsx(bf,{value:ie.value,children:ie.label},ie.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(io,{type:"text",value:I,onChange:ie=>Z(ie.target.value),onBlur:ze,onKeyDown:ie=>Re(ie,ze),className:"font-mono"}),g.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview: ",g.jsx("span",{className:"font-mono",children:tn})]})]})]})}):null,g.jsx(as,{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(io,{type:"number",min:By,max:Iy,step:100,value:q,onChange:ie=>V(ie.target.value),onBlur:de,onKeyDown:ie=>Ce(ie,de),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:[By,"-",Iy," lines",C===Zf?" (default)":""]})]})}),g.jsx(as,{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(io,{type:"number",min:Hy,max:Fy,step:10,value:X,onChange:ie=>N(ie.target.value),onBlur:we,onKeyDown:ie=>Ce(ie,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:[Hy,"-",Fy," px",k===Qf?" (default)":""]})]})})]})}):p==="providers"?g.jsxs("div",{className:"border-b border-border",children:[g.jsx(as,{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(zE,{value:G,onValueChange:ie=>H(ie),children:[g.jsx(Yy,{className:"min-w-[180px]",children:g.jsx(BE,{})}),g.jsx(Xy,{children:g.jsxs(PE,{children:[g.jsx(bf,{value:"last_used",children:"Last Used"}),yu.map(ie=>g.jsx(bf,{value:ie.id,children:ie.label},ie.id))]})})]})}),g.jsx(as,{title:"Claude Code Defaults",description:"Saved defaults when using Claude Code.",alignStart:!0,children:g.jsx("div",{className:"max-w-[420px]",children:g.jsx(B_,{availableProviders:yu,selectedProvider:"claude",showProviderPicker:!1,providerLocked:!0,model:P.claude.model,modelOptions:P.claude.modelOptions,onModelChange:(ie,ct)=>{B("claude",ct)},onModelOptionChange:ie=>{ie.type==="claudeReasoningEffort"?U("claude",{reasoningEffort:ie.effort}):ie.type==="contextWindow"&&U("claude",{contextWindow:ie.contextWindow})},planMode:P.claude.planMode,onPlanModeChange:ie=>$("claude",ie),includePlanMode:!0,className:"justify-start flex-wrap"})})}),g.jsx(as,{title:"Codex Defaults",description:"Saved defaults when using Codex.",alignStart:!0,children:g.jsx("div",{className:"max-w-[420px]",children:g.jsx(B_,{availableProviders:yu,selectedProvider:"codex",showProviderPicker:!1,providerLocked:!0,model:P.codex.model,modelOptions:P.codex.modelOptions,onModelChange:(ie,ct)=>{B("codex",ct)},onModelOptionChange:ie=>{ie.type==="codexReasoningEffort"?U("codex",{reasoningEffort:ie.effort}):ie.type==="fastMode"&&U("codex",{fastMode:ie.fastMode})},planMode:P.codex.planMode,onPlanModeChange:ie=>$("codex",ie),includePlanMode:!0,className:"justify-start flex-wrap"})})})]}):p==="keybindings"?g.jsxs("div",{className:"border-b border-border",children:[pe?g.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:pe}):null,W.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:W.warning}):null,HE.map((ie,ct)=>{const ue=o_(no[ie]),ye=D[ie]??"",Le=ye!==ue;return g.jsx(as,{title:sD[ie],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:()=>{dt(ie)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",ue]})]}):null]}),bordered:ct!==0,children:g.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:g.jsx(io,{type:"text",value:ye,onChange:He=>{const Ye=He.target.value;ce(bt=>({...bt,[ie]:Ye}))},onBlur:()=>{yt()},onKeyDown:He=>Re(He,()=>{yt()}),className:"font-mono"})})},ie)})]}):g.jsx(Ste,{status:a,releases:u,error:d,onRetry:Ct})]}),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(KP,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),g.jsx("span",{children:n.commandError})]}):null]})]})]}),be?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:b})]}),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 UE(e){return{toggleEmbeddedTerminal:eu(e.toggleEmbeddedTerminal??""),toggleRightSidebar:eu(e.toggleRightSidebar??""),openInFinder:eu(e.openInFinder??""),openInEditor:eu(e.openInEditor??""),addSplitTerminal:eu(e.addSplitTerminal??"")}}function Qh(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function kte(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function Ete(e){const t=e&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)?e.content:Array.isArray(e)?e:[],n=[];for(const r of t)if(!(!r||typeof r!="object"||!("type"in r))){if(r.type==="text"&&typeof r.text=="string"){n.push({type:"text",text:r.text});continue}if(r.type==="image"){if("data"in r&&typeof r.data=="string"){n.push({type:"image",data:r.data,mimeType:typeof r.mimeType=="string"?r.mimeType:void 0});continue}"source"in r&&r.source&&typeof r.source=="object"&&"type"in r.source&&r.source.type==="base64"&&"data"in r.source&&typeof r.source.data=="string"&&n.push({type:"image",data:r.source.data,mimeType:typeof r.source.media_type=="string"?r.source.media_type:void 0})}}return n}function Rte(e,t){const n=kte(t);switch(e.toolKind){case"ask_user_question":{const a=Qh(n),l=Qh(a==null?void 0:a.answers)??(a||{});return{answers:Object.fromEntries(Object.entries(l).map(([u,h])=>Array.isArray(h)?[u,h.map(d=>String(d))]:h&&typeof h=="object"&&Array.isArray(h.answers)?[u,h.answers.map(d=>String(d))]:h==null||h===""?[u,[]]:[u,[String(h)]])),...(a==null?void 0:a.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const a=Qh(n);return{confirmed:typeof(a==null?void 0:a.confirmed)=="boolean"?a.confirmed:void 0,clearContext:typeof(a==null?void 0:a.clearContext)=="boolean"?a.clearContext:void 0,message:typeof(a==null?void 0:a.message)=="string"?a.message:void 0,...(a==null?void 0:a.discarded)===!0?{discarded:!0}:{}}}case"read_file":if(typeof n=="string")return n;const r=Ete(n);if(r.length>0)return{content:r.flatMap(a=>a.type==="text"?[a.text]:[]).join(""),blocks:r};const s=Qh(n);return{content:typeof(s==null?void 0:s.content)=="string"?s.content:JSON.stringify(n,null,2)};default:return n}}function JD(e){return new Date(e).toISOString()}function ii(e){return{id:e._id,messageId:e.messageId,timestamp:JD(e.createdAt),hidden:e.hidden}}function Tte(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 Mte(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function Nte(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...ii(r),kind:"user_prompt",content:r.content,attachments:r.attachments??[]});break;case"system_init":n.push({...ii(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({...ii(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":n.push({...ii(r),kind:"assistant_text",text:r.text});break;case"tool_call":{const s=Tte(r);t.set(r.tool.toolId,{hydrated:s,normalized:r.tool}),n.push(s);break}case"tool_result":{const s=t.get(r.toolId);if(s){const a=s.normalized.toolKind==="ask_user_question"||s.normalized.toolKind==="exit_plan_mode"?Mte(r)??r.content:r.content;s.hydrated.result=Rte(s.normalized,a),s.hydrated.rawResult=a,s.hydrated.isError=r.isError}break}case"result":n.push({...ii(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...ii(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...ii(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...ii(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...ii(r),kind:"context_cleared"});break;case"interrupted":n.push({...ii(r),kind:"interrupted"});break;default:n.push({...ii(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const Ate=["AskUserQuestion","ExitPlanMode","TodoWrite"],Dte=new Set(["TodoWrite"]);function Ote(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 Lte(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 jte(e){const t={};for(const n of Ate)t[n]=Dte.has(n)?Lte(e,n):Ote(e,n);return t}function zte(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function Pte(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const Bte=25e3,Ite=15e3,Hte=4e3;class Fte{constructor(t){hn(this,"url");hn(this,"ws",null);hn(this,"started",!1);hn(this,"reconnectTimer",null);hn(this,"reconnectDelayMs",750);hn(this,"subscriptions",new Map);hn(this,"pending",new Map);hn(this,"outboundQueue",[]);hn(this,"statusListeners",new Set);hn(this,"heartbeatTimer",null);hn(this,"pingTimeoutTimer",null);hn(this,"pingPromise",null);hn(this,"lastOpenAt",0);hn(this,"lastMessageAt",0);hn(this,"reconnectImmediatelyOnClose",!1);hn(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});hn(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});hn(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=lv();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=lv(),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=lv(),r={v:1,type:"command",id:n,command:t};return new Promise((s,a)=>{this.pending.set(n,{resolve:s,reject:a}),this.enqueue(r)})}ensureHealthyConnection(){return!this.ws||this.ws.readyState===WebSocket.CLOSED||this.ws.readyState===WebSocket.CLOSING?(this.reconnectNow(),Promise.resolve()):this.ws.readyState===WebSocket.CONNECTING||!this.isConnectionStale()?Promise.resolve():this.sendPing()}connect(){this.started&&(this.emitStatus("connecting"),this.ws=new WebSocket(this.url),this.ws.addEventListener("open",()=>{this.reconnectDelayMs=750,this.reconnectImmediatelyOnClose=!1,this.lastOpenAt=Date.now(),this.lastMessageAt=this.lastOpenAt,this.emitStatus("connected"),this.startHeartbeat();for(const[t,n]of this.subscriptions.entries())this.sendNow({v:1,type:"subscribe",id:t,topic:n.topic});for(;this.outboundQueue.length>0;){const t=this.outboundQueue.shift();t&&this.sendNow(t)}}),this.ws.addEventListener("message",t=>{var r;this.lastMessageAt=Date.now();let n;try{n=JSON.parse(String(t.data))}catch{return}if(n.type==="snapshot"){const s=this.subscriptions.get(n.id);s==null||s.listener(n.snapshot.data);return}if(n.type==="event"){const s=this.subscriptions.get(n.id);(r=s==null?void 0:s.eventListener)==null||r.call(s,n.event);return}if(n.type==="ack"){const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.resolve(n.result);return}if(n.type==="error"){if(!n.id){console.error(KI,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>=Bte}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()},Hte),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()},Ite))}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 Ute(e,t){var r;const n=e.find(s=>s.chats.some(a=>a.chatId===t));return n?((r=n.chats.find(s=>s.chatId!==t))==null?void 0:r.chatId)??null:null}function $te(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Wte(){const e=y.useRef(null);return e.current||(e.current=new Fte($te())),y.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function pu(e,t){if(t===void 0){console.info(`[useKannaState] ${e}`);return}console.info(`[useKannaState] ${e}`,t)}function Vte(e){return e<24}function qte(e,t){return e==="awaiting_disconnect"&&t==="disconnected"?"awaiting_reconnect":e==="awaiting_reconnect"&&t==="connected"?"navigate_changelog":"none"}const Kte=320,q0="kanna:ui-update-restart";function Gte(){return window.sessionStorage.getItem(q0)}function $E(e){window.sessionStorage.setItem(q0,e)}function f_(){window.sessionStorage.removeItem(q0)}function Yte(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 Xte(e,t){return!e||!t?null:e.runtime.chatId!==t?(pu("stale snapshot masked",{routeChatId:t,snapshotChatId:e.runtime.chatId,snapshotProvider:e.runtime.provider}),null):e}function Zte(e){var Jn,xt,It;const t=Ol(),n=Wte(),r=i8(),[s,a]=y.useState({projectGroups:[]}),[l,u]=y.useState(null),[h,d]=y.useState(null),[m,p]=y.useState(null),[_,b]=y.useState(null),[S,w]=y.useState("connecting"),[C,k]=y.useState(!1),[T,R]=y.useState(!1),[M,L]=y.useState(!1),[O,j]=y.useState(null),[F,G]=y.useState(!1),[P,H]=y.useState(!1),[B,U]=y.useState(148),[$,W]=y.useState(!0),[z,q]=y.useState(null),[V,X]=y.useState(null),[N,I]=y.useState(null),Z=MJ(Wr(se=>se.editorPreset)),D=y.useRef(null),ce=y.useRef(null),pe=y.useRef(!1),ae=y.useRef(null);y.useEffect(()=>n.onStatus(w),[n]),y.useEffect(()=>n.subscribe({type:"sidebar"},se=>{a(se),k(!0),q(null)}),[n]),y.useEffect(()=>n.subscribe({type:"local-projects"},se=>{u(se),R(!0),q(null)}),[n]),y.useEffect(()=>n.subscribe({type:"update"},se=>{d(se),q(null)}),[n]),y.useEffect(()=>{S==="connected"&&n.command({type:"update.check",force:!0}).catch(se=>{q(se instanceof Error?se.message:String(se))})},[S,n]),y.useEffect(()=>{const se=Gte(),xe=qte(se,S);if(xe==="awaiting_reconnect"){$E("awaiting_reconnect");return}xe==="navigate_changelog"&&(f_(),t("/settings/changelog",{replace:!0}))},[S,t]),y.useEffect(()=>{function se(){h!=null&&h.lastCheckedAt&&(Date.now()-h.lastCheckedAt<=3600*1e3||n.command({type:"update.check"}).catch(xe=>{q(xe instanceof Error?xe.message:String(xe))}))}return window.addEventListener("focus",se),()=>{window.removeEventListener("focus",se)}},[n,h==null?void 0:h.lastCheckedAt]),y.useEffect(()=>n.subscribe({type:"keybindings"},se=>{b(se),q(null)}),[n]),y.useEffect(()=>{if(!e){pu("clearing chat snapshot for non-chat route"),p(null),L(!0);return}return pu("subscribing to chat",{activeChatId:e}),p(null),L(!1),n.subscribe({type:"chat",chatId:e},se=>{pu("chat snapshot received",{activeChatId:e,snapshotChatId:(se==null?void 0:se.runtime.chatId)??null,snapshotProvider:(se==null?void 0:se.runtime.provider)??null,snapshotStatus:(se==null?void 0:se.runtime.status)??null}),p(se),L(!0),q(null)})},[e,n]),y.useEffect(()=>{if(O)return;const se=s.projectGroups[0];se&&j(se.groupKey)},[O,s.projectGroups]),y.useEffect(()=>{if(!e||!C||!M)return;if(s.projectGroups.some(xe=>xe.chats.some(Ve=>Ve.chatId===e))){N===e&&I(null);return}N!==e&&t("/")},[e,M,t,N,s.projectGroups,C]),y.useEffect(()=>{m&&(j(m.runtime.projectId),N===m.runtime.chatId&&I(null))},[m,N]),y.useEffect(()=>{pe.current=!1,ae.current!==null&&(window.cancelAnimationFrame(ae.current),ae.current=null),W(!0)},[e]),y.useEffect(()=>()=>{ae.current!==null&&window.cancelAnimationFrame(ae.current)},[]),y.useLayoutEffect(()=>{const se=ce.current;if(!se)return;const xe=new ResizeObserver(()=>{U(se.getBoundingClientRect().height)});return xe.observe(se),U(se.getBoundingClientRect().height),()=>xe.disconnect()},[]);const Q=y.useMemo(()=>Xte(m,e),[e,m]);y.useEffect(()=>{pu("active snapshot resolved",{routeChatId:e,rawSnapshotChatId:(m==null?void 0:m.runtime.chatId)??null,rawSnapshotProvider:(m==null?void 0:m.runtime.provider)??null,activeSnapshotChatId:(Q==null?void 0:Q.runtime.chatId)??null,activeSnapshotProvider:(Q==null?void 0:Q.runtime.provider)??null,pendingChatId:N})},[e,Q,m,N]);const ve=y.useMemo(()=>Nte((Q==null?void 0:Q.messages)??[]),[Q==null?void 0:Q.messages]),ne=y.useMemo(()=>jte(ve),[ve]),de=(Q==null?void 0:Q.runtime)??null,we=(Q==null?void 0:Q.availableProviders)??yu,Ce=Pte(de==null?void 0:de.status),Re=zte(de==null?void 0:de.status),ze=Kte,yt=!$&&ve.length>0,dt=((Jn=l==null?void 0:l.projects[0])==null?void 0:Jn.localPath)??null,Ct=(de==null?void 0:de.localPath)??dt??((xt=s.projectGroups[0])==null?void 0:xt.localPath),tn=!!(O??(de==null?void 0:de.projectId)??((It=s.projectGroups[0])==null?void 0:It.groupKey)??dt);y.useLayoutEffect(()=>{if(pe.current)return;const se=D.current;se&&(e&&!de||(se.scrollTo({top:se.scrollHeight,behavior:"auto"}),ae.current!==null&&window.cancelAnimationFrame(ae.current),ae.current=window.requestAnimationFrame(()=>{const xe=D.current;xe&&(xe.scrollTo({top:xe.scrollHeight,behavior:"auto"}),ae.current=null)}),pe.current=!0))},[e,B,ve.length,de]),y.useEffect(()=>{if(!pe.current||!$)return;const se=window.requestAnimationFrame(()=>{const xe=D.current;!xe||!$||xe.scrollTo({top:xe.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(se)},[e,B,$,ve.length,de==null?void 0:de.status]);function _t(){const se=D.current;if(!se)return;const xe=se.scrollHeight-se.scrollTop-se.clientHeight;W(Vte(xe))}function jt(se){const xe=D.current;W(!0),xe&&xe.scrollTo({top:xe.scrollHeight,behavior:se})}function be(){jt("smooth")}async function Be(se){cs.getState().initializeComposerForNewChat();const xe=await n.command({type:"chat.create",projectId:se});j(se),I(xe.chatId),t(`/chat/${xe.chatId}`),G(!1),q(null)}async function $t(se){return se.kind==="project_id"?{projectId:se.projectId}:se.kind==="local_path"?{projectId:(await n.command({type:"project.open",localPath:se.localPath})).projectId,localPath:se.localPath}:{projectId:(await n.command(se.project.mode==="new"?{type:"project.create",localPath:se.project.localPath,title:se.project.title}:{type:"project.open",localPath:se.project.localPath})).projectId,localPath:se.project.localPath}}async function ie(se){try{const xe=se.kind==="project_id"?null:se.kind==="local_path"?se.localPath:se.project.localPath;xe&&X(xe);const{projectId:Ve}=await $t(se);await Be(Ve)}catch(xe){q(xe instanceof Error?xe.message:String(xe))}finally{X(null)}}async function ct(se){await ie({kind:"project_id",projectId:se})}async function ue(se){await ie({kind:"local_path",localPath:se})}async function ye(se){await ie({kind:"project_request",project:se})}async function Le(se){try{await n.command({type:"update.check",force:se==null?void 0:se.force}),q(null)}catch(xe){q(xe instanceof Error?xe.message:String(xe))}}async function He(){try{const se=await n.command({type:"update.install"});if(!se.ok){f_(),q(null),await r.alert({title:se.userTitle??"Update failed",description:se.userMessage??"Kanna could not install the update. Try again later.",closeLabel:"OK"});return}if(se.ok&&se.action==="reload"){window.location.reload();return}se.ok&&se.action==="restart"&&$E("awaiting_disconnect"),q(null)}catch(se){f_(),q(se instanceof Error?se.message:String(se))}}async function Ye(se,xe){var Ve;try{let et=O??((Ve=s.projectGroups[0])==null?void 0:Ve.groupKey)??null;if(!e&&!et&&dt&&(et=(await n.command({type:"project.open",localPath:dt})).projectId,j(et)),!e&&!et)throw new Error("Open a project first");jt("auto");const ht=await n.command({type:"chat.send",chatId:e??void 0,projectId:e?void 0:et??void 0,provider:xe==null?void 0:xe.provider,content:se,attachments:xe==null?void 0:xe.attachments,model:xe==null?void 0:xe.model,modelOptions:xe==null?void 0:xe.modelOptions,planMode:xe==null?void 0:xe.planMode});!e&&ht.chatId&&(I(ht.chatId),t(`/chat/${ht.chatId}`)),q(null)}catch(et){throw q(et instanceof Error?et.message:String(et)),et}}async function bt(){if(e)try{await n.command({type:"chat.cancel",chatId:e})}catch(se){q(se instanceof Error?se.message:String(se))}}async function Pn(se){if(await r.confirm({title:"Delete Chat",description:`Delete "${se.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await n.command({type:"chat.delete",chatId:se.chatId}),se.chatId===e){const Ve=Ute(s.projectGroups,se.chatId);t(Ve?`/chat/${Ve}`:"/")}}catch(Ve){q(Ve instanceof Error?Ve.message:String(Ve))}}async function oe(se){const xe=s.projectGroups.find(ht=>ht.groupKey===se);if(!xe)return;const Ve=xe.localPath.split("/").filter(Boolean).pop()??xe.localPath;if(await r.confirm({title:"Remove",description:`Remove "${Ve}" from the sidebar? Existing chats will be removed from ${Kn}.`,confirmLabel:"Remove",confirmVariant:"destructive"}))try{await n.command({type:"project.remove",projectId:se}),Js.getState().clearProject(se),yf.getState().clearProject(se),(de==null?void 0:de.projectId)===se&&t("/"),q(null)}catch(ht){q(ht instanceof Error?ht.message:String(ht))}}async function Me(se){var Ve,et;const xe=(de==null?void 0:de.localPath)??((Ve=l==null?void 0:l.projects[0])==null?void 0:Ve.localPath)??((et=s.projectGroups[0])==null?void 0:et.localPath);if(xe)try{await Dt({action:se,localPath:xe})}catch(ht){q(ht instanceof Error?ht.message:String(ht))}}async function Xe(se){try{await Dt({action:"open_editor",localPath:se.path,line:se.line,column:se.column})}catch(xe){q(xe instanceof Error?xe.message:String(xe))}}async function $e(se,xe){try{await Dt({action:se,localPath:xe})}catch(Ve){q(Ve instanceof Error?Ve.message:String(Ve))}}async function Dt(se){const xe=Wr.getState();q(null),await n.command({type:"system.openExternal",...se,editor:se.action==="open_editor"?{preset:xe.editorPreset,commandTemplate:xe.editorCommandTemplate}:void 0})}function Wt(){var xe;const se=Yte({selectedProjectId:O,sidebarProjectId:(xe=s.projectGroups[0])==null?void 0:xe.groupKey,fallbackLocalProjectPath:dt});if(se){ie(se);return}t("/")}async function Mr(se,xe,Ve){if(e)try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:se,result:{questions:xe,answers:Ve}})}catch(et){q(et instanceof Error?et.message:String(et))}}async function hr(se,xe,Ve,et){if(e){xe&&cs.getState().setComposerPlanMode(!1);try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:se,result:{confirmed:xe,...Ve?{clearContext:!0}:{},...et?{message:et}:{}}})}catch(ht){q(ht instanceof Error?ht.message:String(ht))}}}return{socket:n,activeChatId:e,sidebarData:s,localProjects:l,updateSnapshot:h,chatSnapshot:m,keybindings:_,connectionStatus:S,sidebarReady:C,localProjectsReady:T,commandError:z,startingLocalPath:V,sidebarOpen:F,sidebarCollapsed:P,scrollRef:D,inputRef:ce,messages:ve,latestToolIds:ne,runtime:de,availableProviders:we,isProcessing:Ce,canCancel:Re,transcriptPaddingBottom:ze,showScrollButton:yt,navbarLocalPath:Ct,editorLabel:Z,hasSelectedProject:tn,openSidebar:()=>G(!0),closeSidebar:()=>G(!1),collapseSidebar:()=>H(!0),expandSidebar:()=>H(!1),updateScrollState:_t,scrollToBottom:be,handleCreateChat:ct,handleOpenLocalProject:ue,handleCreateProject:ye,handleCheckForUpdates:Le,handleInstallUpdate:He,handleSend:Ye,handleCancel:bt,handleDeleteChat:Pn,handleRemoveProject:oe,handleOpenExternal:Me,handleOpenExternalPath:$e,handleOpenLocalLink:Xe,handleCompose:Wt,handleAskUserQuestion:Mr,handleExitPlanMode:hr}}const WE="kanna:last-seen-version";function Qte(e,t,n){return e==="/"&&!!t&&n!==t}function Jte(){const e=fi(),t=Ol(),n=lR(),r=Zte(n.chatId??null),s=e.pathname==="/",a=jb.split("/")[1]??"unknown";return y.useEffect(()=>{const l=window.localStorage.getItem(WE),u=Qte(e.pathname,a,l);window.localStorage.setItem(WE,a),u&&t("/settings/changelog",{replace:!0})},[a,e.pathname,t]),g.jsxs("div",{className:"flex h-[100dvh] min-h-[100dvh] overflow-hidden",children:[g.jsx(NF,{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:l=>{r.handleCreateChat(l)},onDeleteChat:l=>{r.handleDeleteChat(l)},onRemoveProject:l=>{r.handleRemoveProject(l)},updateSnapshot:r.updateSnapshot,onInstallUpdate:()=>{r.handleInstallUpdate()}}),g.jsx(xL,{context:r})]})}function ene(){return g.jsx(HI,{children:g.jsx(r8,{children:g.jsx(wL,{children:g.jsxs(ul,{element:g.jsx(Jte,{}),children:[g.jsx(ul,{path:"/",element:g.jsx(Lee,{})}),g.jsx(ul,{path:"/settings",element:g.jsx(bL,{to:"/settings/general",replace:!0})}),g.jsx(ul,{path:"/settings/:sectionId",element:g.jsx(Cte,{})}),g.jsx(ul,{path:"/chat/:chatId",element:g.jsx(Ree,{})})]})})})})}const e3=document.getElementById("root");if(!e3)throw new Error("Missing #root");wO.createRoot(e3).render(g.jsx(y.StrictMode,{children:g.jsx(KL,{children:g.jsx(uJ,{children:g.jsx(ene,{})})})}));
|