kaizenai 0.6.1 → 0.7.2
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/FeatureOverviewPage-Cbp5uhtA.js +11 -0
- package/dist/client/assets/FeatureOverviewPage-Cbp5uhtA.js.br +0 -0
- package/dist/client/assets/FeatureOverviewPage-Cbp5uhtA.js.gz +0 -0
- package/dist/client/assets/LocalProjectsPage-CihqlQOs.js +21 -0
- package/dist/client/assets/LocalProjectsPage-CihqlQOs.js.br +0 -0
- package/dist/client/assets/LocalProjectsPage-CihqlQOs.js.gz +0 -0
- package/dist/client/assets/SettingsPage-jZce-i3Z.js +51 -0
- package/dist/client/assets/SettingsPage-jZce-i3Z.js.br +0 -0
- package/dist/client/assets/SettingsPage-jZce-i3Z.js.gz +0 -0
- package/dist/client/assets/eye-BkdZGixK.js +11 -0
- package/dist/client/assets/eye-BkdZGixK.js.br +0 -0
- package/dist/client/assets/eye-BkdZGixK.js.gz +0 -0
- package/dist/client/assets/index-B7C7C1FY.js +608 -0
- package/dist/client/assets/index-B7C7C1FY.js.br +0 -0
- package/dist/client/assets/index-B7C7C1FY.js.gz +0 -0
- package/dist/client/assets/index-D-HIK4uM.css +32 -0
- package/dist/client/assets/index-D-HIK4uM.css.br +0 -0
- package/dist/client/assets/index-D-HIK4uM.css.gz +0 -0
- package/dist/client/index.html +3 -2
- package/dist/server/build-target.json +4 -0
- package/dist/server/cli-supervisor.js +51 -15
- package/dist/server/cli.js +18733 -6474
- package/package.json +20 -13
- package/dist/client/assets/index-BNd87qOY.js +0 -653
- package/dist/client/assets/index-CVCsARVW.css +0 -32
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeatureOverviewPage-Cbp5uhtA.js","assets/eye-BkdZGixK.js","assets/SettingsPage-jZce-i3Z.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Qj=Object.defineProperty;var BC=t=>{throw TypeError(t)};var Zj=(t,e,n)=>e in t?Qj(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var pn=(t,e,n)=>Zj(t,typeof e!="symbol"?e+"":e,n),FC=(t,e,n)=>e.has(t)||BC("Cannot "+n);var Ad=(t,e,n)=>(FC(t,e,"read from private field"),n?n.call(t):e.get(t)),HC=(t,e,n)=>e.has(t)?BC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$C=(t,e,n,r)=>(FC(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function Jj(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function tg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K0={exports:{}},Nd={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var UC;function eL(){if(UC)return Nd;UC=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:a,ref:i!==void 0?i:null,props:s}}return Nd.Fragment=e,Nd.jsx=n,Nd.jsxs=n,Nd}var WC;function tL(){return WC||(WC=1,K0.exports=eL()),K0.exports}var g=tL(),G0={exports:{}},Dd={},Y0={exports:{}},X0={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* scheduler.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var VC;function nL(){return VC||(VC=1,function(t){function e(j,G){var B=j.length;j.push(G);e:for(;0<B;){var K=B-1>>>1,A=j[K];if(0<i(A,G))j[K]=G,j[B]=A,B=K;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var G=j[0],B=j.pop();if(B!==G){j[0]=B;e:for(var K=0,A=j.length,I=A>>>1;K<I;){var $=2*(K+1)-1,T=j[$],X=$+1,Z=j[X];if(0>i(T,B))X<A&&0>i(Z,T)?(j[K]=Z,j[X]=B,K=X):(j[K]=T,j[$]=B,K=$);else if(X<A&&0>i(Z,B))j[K]=Z,j[X]=B,K=X;else break e}}return G}function i(j,G){var B=j.sortIndex-G.sortIndex;return B!==0?B:j.id-G.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,c=a.now();t.unstable_now=function(){return a.now()-c}}var d=[],u=[],f=1,m=null,v=3,b=!1,S=!1,x=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function M(j){for(var G=n(u);G!==null;){if(G.callback===null)r(u);else if(G.startTime<=j)r(u),G.sortIndex=G.expirationTime,e(d,G);else break;G=n(u)}}function O(j){if(x=!1,M(j),!S)if(n(d)!==null)S=!0,D||(D=!0,V());else{var G=n(u);G!==null&&H(O,G.startTime-j)}}var D=!1,P=-1,z=5,Y=-1;function L(){return C?!0:!(t.unstable_now()-Y<z)}function W(){if(C=!1,D){var j=t.unstable_now();Y=j;var G=!0;try{e:{S=!1,x&&(x=!1,E(P),P=-1),b=!0;var B=v;try{t:{for(M(j),m=n(d);m!==null&&!(m.expirationTime>j&&L());){var K=m.callback;if(typeof K=="function"){m.callback=null,v=m.priorityLevel;var A=K(m.expirationTime<=j);if(j=t.unstable_now(),typeof A=="function"){m.callback=A,M(j),G=!0;break t}m===n(d)&&r(d),M(j)}else r(d);m=n(d)}if(m!==null)G=!0;else{var I=n(u);I!==null&&H(O,I.startTime-j),G=!1}}break e}finally{m=null,v=B,b=!1}G=void 0}}finally{G?V():D=!1}}}var V;if(typeof R=="function")V=function(){R(W)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,U=F.port2;F.port1.onmessage=W,V=function(){U.postMessage(null)}}else V=function(){k(W,0)};function H(j,G){P=k(function(){j(t.unstable_now())},G)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(j){j.callback=null},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(j){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var B=v;v=G;try{return j()}finally{v=B}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(j,G){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var B=v;v=j;try{return G()}finally{v=B}},t.unstable_scheduleCallback=function(j,G,B){var K=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?K+B:K):B=K,j){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=B+A,j={id:f++,callback:G,priorityLevel:j,startTime:B,expirationTime:A,sortIndex:-1},B>K?(j.sortIndex=B,e(u,j),n(d)===null&&j===n(u)&&(x?(E(P),P=-1):x=!0,H(O,B-K))):(j.sortIndex=A,e(d,j),S||b||(S=!0,D||(D=!0,V()))),j},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(j){var G=v;return function(){var B=v;v=G;try{return j.apply(this,arguments)}finally{v=B}}}}(X0)),X0}var qC;function rL(){return qC||(qC=1,Y0.exports=nL()),Y0.exports}var Q0={exports:{}},St={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* react.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var KC;function iL(){if(KC)return St;KC=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),v=Symbol.iterator;function b(I){return I===null||typeof I!="object"?null:(I=v&&I[v]||I["@@iterator"],typeof I=="function"?I:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function k(I,$,T){this.props=I,this.context=$,this.refs=C,this.updater=T||S}k.prototype.isReactComponent={},k.prototype.setState=function(I,$){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,$,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function E(){}E.prototype=k.prototype;function R(I,$,T){this.props=I,this.context=$,this.refs=C,this.updater=T||S}var M=R.prototype=new E;M.constructor=R,x(M,k.prototype),M.isPureReactComponent=!0;var O=Array.isArray;function D(){}var P={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function Y(I,$,T){var X=T.ref;return{$$typeof:t,type:I,key:$,ref:X!==void 0?X:null,props:T}}function L(I,$){return Y(I.type,$,I.props)}function W(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function V(I){var $={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(T){return $[T]})}var F=/\/+/g;function U(I,$){return typeof I=="object"&&I!==null&&I.key!=null?V(""+I.key):$.toString(36)}function H(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(D,D):(I.status="pending",I.then(function($){I.status==="pending"&&(I.status="fulfilled",I.value=$)},function($){I.status==="pending"&&(I.status="rejected",I.reason=$)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function j(I,$,T,X,Z){var J=typeof I;(J==="undefined"||J==="boolean")&&(I=null);var re=!1;if(I===null)re=!0;else switch(J){case"bigint":case"string":case"number":re=!0;break;case"object":switch(I.$$typeof){case t:case e:re=!0;break;case f:return re=I._init,j(re(I._payload),$,T,X,Z)}}if(re)return Z=Z(I),re=X===""?"."+U(I,0):X,O(Z)?(T="",re!=null&&(T=re.replace(F,"$&/")+"/"),j(Z,$,T,"",function(me){return me})):Z!=null&&(W(Z)&&(Z=L(Z,T+(Z.key==null||I&&I.key===Z.key?"":(""+Z.key).replace(F,"$&/")+"/")+re)),$.push(Z)),1;re=0;var ae=X===""?".":X+":";if(O(I))for(var ue=0;ue<I.length;ue++)X=I[ue],J=ae+U(X,ue),re+=j(X,$,T,J,Z);else if(ue=b(I),typeof ue=="function")for(I=ue.call(I),ue=0;!(X=I.next()).done;)X=X.value,J=ae+U(X,ue++),re+=j(X,$,T,J,Z);else if(J==="object"){if(typeof I.then=="function")return j(H(I),$,T,X,Z);throw $=String(I),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return re}function G(I,$,T){if(I==null)return I;var X=[],Z=0;return j(I,X,"","",function(J){return $.call(T,J,Z++)}),X}function B(I){if(I._status===-1){var $=I._result;$=$(),$.then(function(T){(I._status===0||I._status===-1)&&(I._status=1,I._result=T)},function(T){(I._status===0||I._status===-1)&&(I._status=2,I._result=T)}),I._status===-1&&(I._status=0,I._result=$)}if(I._status===1)return I._result.default;throw I._result}var K=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=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($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},A={map:G,forEach:function(I,$,T){G(I,function(){$.apply(this,arguments)},T)},count:function(I){var $=0;return G(I,function(){$++}),$},toArray:function(I){return G(I,function($){return $})||[]},only:function(I){if(!W(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return St.Activity=m,St.Children=A,St.Component=k,St.Fragment=n,St.Profiler=i,St.PureComponent=R,St.StrictMode=r,St.Suspense=d,St.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,St.__COMPILER_RUNTIME={__proto__:null,c:function(I){return P.H.useMemoCache(I)}},St.cache=function(I){return function(){return I.apply(null,arguments)}},St.cacheSignal=function(){return null},St.cloneElement=function(I,$,T){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var X=x({},I.props),Z=I.key;if($!=null)for(J in $.key!==void 0&&(Z=""+$.key),$)!z.call($,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&$.ref===void 0||(X[J]=$[J]);var J=arguments.length-2;if(J===1)X.children=T;else if(1<J){for(var re=Array(J),ae=0;ae<J;ae++)re[ae]=arguments[ae+2];X.children=re}return Y(I.type,Z,X)},St.createContext=function(I){return I={$$typeof:a,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:s,_context:I},I},St.createElement=function(I,$,T){var X,Z={},J=null;if($!=null)for(X in $.key!==void 0&&(J=""+$.key),$)z.call($,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(Z[X]=$[X]);var re=arguments.length-2;if(re===1)Z.children=T;else if(1<re){for(var ae=Array(re),ue=0;ue<re;ue++)ae[ue]=arguments[ue+2];Z.children=ae}if(I&&I.defaultProps)for(X in re=I.defaultProps,re)Z[X]===void 0&&(Z[X]=re[X]);return Y(I,J,Z)},St.createRef=function(){return{current:null}},St.forwardRef=function(I){return{$$typeof:c,render:I}},St.isValidElement=W,St.lazy=function(I){return{$$typeof:f,_payload:{_status:-1,_result:I},_init:B}},St.memo=function(I,$){return{$$typeof:u,type:I,compare:$===void 0?null:$}},St.startTransition=function(I){var $=P.T,T={};P.T=T;try{var X=I(),Z=P.S;Z!==null&&Z(T,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(D,K)}catch(J){K(J)}finally{$!==null&&T.types!==null&&($.types=T.types),P.T=$}},St.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},St.use=function(I){return P.H.use(I)},St.useActionState=function(I,$,T){return P.H.useActionState(I,$,T)},St.useCallback=function(I,$){return P.H.useCallback(I,$)},St.useContext=function(I){return P.H.useContext(I)},St.useDebugValue=function(){},St.useDeferredValue=function(I,$){return P.H.useDeferredValue(I,$)},St.useEffect=function(I,$){return P.H.useEffect(I,$)},St.useEffectEvent=function(I){return P.H.useEffectEvent(I)},St.useId=function(){return P.H.useId()},St.useImperativeHandle=function(I,$,T){return P.H.useImperativeHandle(I,$,T)},St.useInsertionEffect=function(I,$){return P.H.useInsertionEffect(I,$)},St.useLayoutEffect=function(I,$){return P.H.useLayoutEffect(I,$)},St.useMemo=function(I,$){return P.H.useMemo(I,$)},St.useOptimistic=function(I,$){return P.H.useOptimistic(I,$)},St.useReducer=function(I,$,T){return P.H.useReducer(I,$,T)},St.useRef=function(I){return P.H.useRef(I)},St.useState=function(I){return P.H.useState(I)},St.useSyncExternalStore=function(I,$,T){return P.H.useSyncExternalStore(I,$,T)},St.useTransition=function(){return P.H.useTransition()},St.version="19.2.4",St}var GC;function ng(){return GC||(GC=1,Q0.exports=iL()),Q0.exports}var Z0={exports:{}},Or={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var YC;function sL(){if(YC)return Or;YC=1;var t=ng();function e(d){var u="https://react.dev/errors/"+d;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+d+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(d,u,f){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:u,implementation:f}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,u){if(d==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Or.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Or.createPortal=function(d,u){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return s(d,u,null,f)},Or.flushSync=function(d){var u=a.T,f=r.p;try{if(a.T=null,r.p=2,d)return d()}finally{a.T=u,r.p=f,r.d.f()}},Or.preconnect=function(d,u){typeof d=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(d,u))},Or.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Or.preinit=function(d,u){if(typeof d=="string"&&u&&typeof u.as=="string"){var f=u.as,m=c(f,u.crossOrigin),v=typeof u.integrity=="string"?u.integrity:void 0,b=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;f==="style"?r.d.S(d,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:m,integrity:v,fetchPriority:b}):f==="script"&&r.d.X(d,{crossOrigin:m,integrity:v,fetchPriority:b,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Or.preinitModule=function(d,u){if(typeof d=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var f=c(u.as,u.crossOrigin);r.d.M(d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(d)},Or.preload=function(d,u){if(typeof d=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var f=u.as,m=c(f,u.crossOrigin);r.d.L(d,f,{crossOrigin:m,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Or.preloadModule=function(d,u){if(typeof d=="string")if(u){var f=c(u.as,u.crossOrigin);r.d.m(d,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(d)},Or.requestFormReset=function(d){r.d.r(d)},Or.unstable_batchedUpdates=function(d,u){return d(u)},Or.useFormState=function(d,u,f){return a.H.useFormState(d,u,f)},Or.useFormStatus=function(){return a.H.useHostTransitionStatus()},Or.version="19.2.4",Or}var XC;function CR(){if(XC)return Z0.exports;XC=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Z0.exports=sL(),Z0.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var QC;function oL(){if(QC)return Dd;QC=1;var t=rL(),e=ng(),n=CR();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var l=o,h=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(h=l.return),o=l.return;while(o)}return l.tag===3?h:null}function a(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function c(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function d(o){if(s(o)!==o)throw Error(r(188))}function u(o){var l=o.alternate;if(!l){if(l=s(o),l===null)throw Error(r(188));return l!==o?null:o}for(var h=o,p=l;;){var y=h.return;if(y===null)break;var w=y.alternate;if(w===null){if(p=y.return,p!==null){h=p;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===h)return d(y),o;if(w===p)return d(y),l;w=w.sibling}throw Error(r(188))}if(h.return!==p.return)h=y,p=w;else{for(var N=!1,q=y.child;q;){if(q===h){N=!0,h=y,p=w;break}if(q===p){N=!0,p=y,h=w;break}q=q.sibling}if(!N){for(q=w.child;q;){if(q===h){N=!0,h=w,p=y;break}if(q===p){N=!0,p=w,h=y;break}q=q.sibling}if(!N)throw Error(r(189))}}if(h.alternate!==p)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?o:l}function f(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=f(o),l!==null)return l;o=o.sibling}return null}var m=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function V(o){return o===null||typeof o!="object"?null:(o=W&&o[W]||o["@@iterator"],typeof o=="function"?o:null)}var F=Symbol.for("react.client.reference");function U(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===F?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case x:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case D:return"SuspenseList";case Y:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case S:return"Portal";case R:return o.displayName||"Context";case E:return(o._context.displayName||"Context")+".Consumer";case M:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case P:return l=o.displayName||null,l!==null?l:U(o.type)||"Memo";case z:l=o._payload,o=o._init;try{return U(o(l))}catch{}}return null}var H=Array.isArray,j=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},K=[],A=-1;function I(o){return{current:o}}function $(o){0>A||(o.current=K[A],K[A]=null,A--)}function T(o,l){A++,K[A]=o.current,o.current=l}var X=I(null),Z=I(null),J=I(null),re=I(null);function ae(o,l){switch(T(J,l),T(Z,o),T(X,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?lC(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=lC(l),o=cC(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}$(X),T(X,o)}function ue(){$(X),$(Z),$(J)}function me(o){o.memoizedState!==null&&T(re,o);var l=X.current,h=cC(l,o.type);l!==h&&(T(Z,o),T(X,h))}function se(o){Z.current===o&&($(X),$(Z)),re.current===o&&($(re),Ed._currentValue=B)}var oe,ee;function Q(o){if(oe===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);oe=l&&l[1]||"",ee=-1<h.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+oe+o+ee}var te=!1;function he(o,l){if(!o||te)return"";te=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var Ne=function(){throw Error()};if(Object.defineProperty(Ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ne,[])}catch(Se){var _e=Se}Reflect.construct(o,[],Ne)}else{try{Ne.call()}catch(Se){_e=Se}o.call(Ne.prototype)}}else{try{throw Error()}catch(Se){_e=Se}(Ne=o())&&typeof Ne.catch=="function"&&Ne.catch(function(){})}}catch(Se){if(Se&&_e&&typeof Se.stack=="string")return[Se.stack,_e.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=p.DetermineComponentFrameRoot(),N=w[0],q=w[1];if(N&&q){var ne=N.split(`
|
|
45
|
+
`),ve=q.split(`
|
|
46
|
+
`);for(y=p=0;p<ne.length&&!ne[p].includes("DetermineComponentFrameRoot");)p++;for(;y<ve.length&&!ve[y].includes("DetermineComponentFrameRoot");)y++;if(p===ne.length||y===ve.length)for(p=ne.length-1,y=ve.length-1;1<=p&&0<=y&&ne[p]!==ve[y];)y--;for(;1<=p&&0<=y;p--,y--)if(ne[p]!==ve[y]){if(p!==1||y!==1)do if(p--,y--,0>y||ne[p]!==ve[y]){var Ee=`
|
|
47
|
+
`+ne[p].replace(" at new "," at ");return o.displayName&&Ee.includes("<anonymous>")&&(Ee=Ee.replace("<anonymous>",o.displayName)),Ee}while(1<=p&&0<=y);break}}}finally{te=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?Q(h):""}function ie(o,l){switch(o.tag){case 26:case 27:case 5:return Q(o.type);case 16:return Q("Lazy");case 13:return o.child!==l&&l!==null?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return he(o.type,!1);case 11:return he(o.type.render,!1);case 1:return he(o.type,!0);case 31:return Q("Activity");default:return""}}function xe(o){try{var l="",h=null;do l+=ie(o,h),h=o,o=o.return;while(o);return l}catch(p){return`
|
|
48
|
+
Error generating stack: `+p.message+`
|
|
49
|
+
`+p.stack}}var Ae=Object.prototype.hasOwnProperty,Ke=t.unstable_scheduleCallback,mt=t.unstable_cancelCallback,Ye=t.unstable_shouldYield,Ze=t.unstable_requestPaint,tt=t.unstable_now,it=t.unstable_getCurrentPriorityLevel,ce=t.unstable_ImmediatePriority,Re=t.unstable_UserBlockingPriority,Ue=t.unstable_NormalPriority,Je=t.unstable_LowPriority,Ve=t.unstable_IdlePriority,ze=t.log,He=t.unstable_setDisableYieldValue,Xe=null,ut=null;function ft(o){if(typeof ze=="function"&&He(o),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(Xe,o)}catch{}}var rt=Math.clz32?Math.clz32:ht,Tt=Math.log,lt=Math.LN2;function ht(o){return o>>>=0,o===0?32:31-(Tt(o)/lt|0)|0}var Be=256,$e=262144,Le=4194304;function Fe(o){var l=o&42;if(l!==0)return l;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function ye(o,l,h){var p=o.pendingLanes;if(p===0)return 0;var y=0,w=o.suspendedLanes,N=o.pingedLanes;o=o.warmLanes;var q=p&134217727;return q!==0?(p=q&~w,p!==0?y=Fe(p):(N&=q,N!==0?y=Fe(N):h||(h=q&~o,h!==0&&(y=Fe(h))))):(q=p&~w,q!==0?y=Fe(q):N!==0?y=Fe(N):h||(h=p&~o,h!==0&&(y=Fe(h)))),y===0?0:l!==0&&l!==y&&(l&w)===0&&(w=y&-y,h=l&-l,w>=h||w===32&&(h&4194048)!==0)?l:y}function Ie(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Qe(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 gt(){var o=Le;return Le<<=1,(Le&62914560)===0&&(Le=4194304),o}function Wt(o){for(var l=[],h=0;31>h;h++)l.push(o);return l}function wt(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function xt(o,l,h,p,y,w){var N=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var q=o.entanglements,ne=o.expirationTimes,ve=o.hiddenUpdates;for(h=N&~h;0<h;){var Ee=31-rt(h),Ne=1<<Ee;q[Ee]=0,ne[Ee]=-1;var _e=ve[Ee];if(_e!==null)for(ve[Ee]=null,Ee=0;Ee<_e.length;Ee++){var Se=_e[Ee];Se!==null&&(Se.lane&=-536870913)}h&=~Ne}p!==0&&Qt(o,p,0),w!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=w&~(N&~l))}function Qt(o,l,h){o.pendingLanes|=l,o.suspendedLanes&=~l;var p=31-rt(l);o.entangledLanes|=l,o.entanglements[p]=o.entanglements[p]|1073741824|h&261930}function kt(o,l){var h=o.entangledLanes|=l;for(o=o.entanglements;h;){var p=31-rt(h),y=1<<p;y&l|o[p]&l&&(o[p]|=l),h&=~y}}function Dt(o,l){var h=l&-l;return h=(h&42)!==0?1:wn(h),(h&(o.suspendedLanes|l))!==0?0:h}function wn(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Zt(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function bn(){var o=G.p;return o!==0?o:(o=window.event,o===void 0?32:DC(o.type))}function Hn(o,l){var h=G.p;try{return G.p=o,l()}finally{G.p=h}}var dn=Math.random().toString(36).slice(2),pe="__reactFiber$"+dn,de="__reactProps$"+dn,Oe="__reactContainer$"+dn,Et="__reactEvents$"+dn,_n="__reactListeners$"+dn,An="__reactHandles$"+dn,Jn="__reactResources$"+dn,$n="__reactMarker$"+dn;function tn(o){delete o[pe],delete o[de],delete o[Et],delete o[_n],delete o[An]}function er(o){var l=o[pe];if(l)return l;for(var h=o.parentNode;h;){if(l=h[Oe]||h[pe]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(o=gC(o);o!==null;){if(h=o[pe])return h;o=gC(o)}return l}o=h,h=o.parentNode}return null}function lr(o){if(o=o[pe]||o[Oe]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function Br(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function Rn(o){var l=o[Jn];return l||(l=o[Jn]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function nn(o){o[$n]=!0}var Fr=new Set,xr={};function Jr(o,l){Un(o,l),Un(o+"Capture",l)}function Un(o,l){for(xr[o]=l,o=0;o<l.length;o++)Fr.add(l[o])}var ul=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]*$"),so={},oo={};function na(o){return Ae.call(oo,o)?!0:Ae.call(so,o)?!1:ul.test(o)?oo[o]=!0:(so[o]=!0,!1)}function be(o,l,h){if(na(l))if(h===null)o.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+h)}}function we(o,l,h){if(h===null)o.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+h)}}function Te(o,l,h,p){if(p===null)o.removeAttribute(h);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(l,h,""+p)}}function Pe(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ge(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Ft(o,l,h){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,w=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return y.call(this)},set:function(N){h=""+N,w.call(this,N)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return h},setValue:function(N){h=""+N},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function hn(o){if(!o._valueTracker){var l=Ge(o)?"checked":"value";o._valueTracker=Ft(o,l,""+o[l])}}function fn(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var h=l.getValue(),p="";return o&&(p=Ge(o)?o.checked?"true":"false":o.value),o=p,o!==h?(l.setValue(o),!0):!1}function as(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var qu=/[\n"\\]/g;function tr(o){return o.replace(qu,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Rs(o,l,h,p,y,w,N,q){o.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?o.type=N:o.removeAttribute("type"),l!=null?N==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+Pe(l)):o.value!==""+Pe(l)&&(o.value=""+Pe(l)):N!=="submit"&&N!=="reset"||o.removeAttribute("value"),l!=null?dl(o,N,Pe(l)):h!=null?dl(o,N,Pe(h)):p!=null&&o.removeAttribute("value"),y==null&&w!=null&&(o.defaultChecked=!!w),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?o.name=""+Pe(q):o.removeAttribute("name")}function uc(o,l,h,p,y,w,N,q){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(o.type=w),l!=null||h!=null){if(!(w!=="submit"&&w!=="reset"||l!=null)){hn(o);return}h=h!=null?""+Pe(h):"",l=l!=null?""+Pe(l):h,q||l===o.value||(o.value=l),o.defaultValue=l}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=q?o.checked:!!p,o.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.name=N),hn(o)}function dl(o,l,h){l==="number"&&as(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function pi(o,l,h,p){if(o=o.options,l){l={};for(var y=0;y<h.length;y++)l["$"+h[y]]=!0;for(h=0;h<o.length;h++)y=l.hasOwnProperty("$"+o[h].value),o[h].selected!==y&&(o[h].selected=y),y&&p&&(o[h].defaultSelected=!0)}else{for(h=""+Pe(h),l=null,y=0;y<o.length;y++){if(o[y].value===h){o[y].selected=!0,p&&(o[y].defaultSelected=!0);return}l!==null||o[y].disabled||(l=o[y])}l!==null&&(l.selected=!0)}}function ao(o,l,h){if(l!=null&&(l=""+Pe(l),l!==o.value&&(o.value=l),h==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=h!=null?""+Pe(h):""}function hl(o,l,h,p){if(l==null){if(p!=null){if(h!=null)throw Error(r(92));if(H(p)){if(1<p.length)throw Error(r(93));p=p[0]}h=p}h==null&&(h=""),l=h}h=Pe(l),o.defaultValue=h,p=o.textContent,p===h&&p!==""&&p!==null&&(o.value=p),hn(o)}function gi(o,l){if(l){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=l;return}}o.textContent=l}var dc=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 lo(o,l,h){var p=l.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?p?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":p?o.setProperty(l,h):typeof h!="number"||h===0||dc.has(l)?l==="float"?o.cssFloat=h:o[l]=(""+h).trim():o[l]=h+"px"}function co(o,l,h){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,h!=null){for(var p in h)!h.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="");for(var y in l)p=l[y],l.hasOwnProperty(y)&&h[y]!==p&&lo(o,y,p)}else for(var w in l)l.hasOwnProperty(w)&&lo(o,w,l[w])}function Ts(o){if(o.indexOf("-")===-1)return!1;switch(o){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 hc=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"]]),fc=/^[\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 ls(o){return fc.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Ar(){}var ra=null;function Ms(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var As=null,vi=null;function uo(o){var l=lr(o);if(l&&(o=l.stateNode)){var h=o[de]||null;e:switch(o=l.stateNode,l.type){case"input":if(Rs(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),l=h.name,h.type==="radio"&&l!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+tr(""+l)+'"][type="radio"]'),l=0;l<h.length;l++){var p=h[l];if(p!==o&&p.form===o.form){var y=p[de]||null;if(!y)throw Error(r(90));Rs(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<h.length;l++)p=h[l],p.form===o.form&&fn(p)}break e;case"textarea":ao(o,h.value,h.defaultValue);break e;case"select":l=h.value,l!=null&&pi(o,!!h.multiple,l,!1)}}}var Ns=!1;function ho(o,l,h){if(Ns)return o(l,h);Ns=!0;try{var p=o(l);return p}finally{if(Ns=!1,(As!==null||vi!==null)&&(Hf(),As&&(l=As,o=vi,vi=As=null,uo(l),o)))for(l=0;l<o.length;l++)uo(o[l])}}function Ds(o,l){var h=o.stateNode;if(h===null)return null;var p=h[de]||null;if(p===null)return null;h=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,l,typeof h));return h}var Nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Os=!1;if(Nr)try{var Ii={};Object.defineProperty(Ii,"passive",{get:function(){Os=!0}}),window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{Os=!1}var bi=null,js=null,cs=null;function mc(){if(cs)return cs;var o,l=js,h=l.length,p,y="value"in bi?bi.value:bi.textContent,w=y.length;for(o=0;o<h&&l[o]===y[o];o++);var N=h-o;for(p=1;p<=N&&l[h-p]===y[w-p];p++);return cs=y.slice(o,1<p?1-p:void 0)}function ia(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function sa(){return!0}function fo(){return!1}function In(o){function l(h,p,y,w,N){this._reactName=h,this._targetInst=y,this.type=p,this.nativeEvent=w,this.target=N,this.currentTarget=null;for(var q in o)o.hasOwnProperty(q)&&(h=o[q],this[q]=h?h(w):w[q]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?sa:fo,this.isPropagationStopped=fo,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=sa)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=sa)},persist:function(){},isPersistent:sa}),l}var us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ds=In(us),Pi=m({},us,{view:0,detail:0}),oa=In(Pi),fl,Ls,Is,hs=m({},Pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ua,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Is&&(Is&&o.type==="mousemove"?(fl=o.screenX-Is.screenX,Ls=o.screenY-Is.screenY):Ls=fl=0,Is=o),fl)},movementY:function(o){return"movementY"in o?o.movementY:Ls}}),mo=In(hs),aa=m({},hs,{dataTransfer:0}),la=In(aa),ca=m({},Pi,{relatedTarget:0}),Ps=In(ca),pc=m({},us,{animationName:0,elapsedTime:0,pseudoElement:0}),Mt=In(pc),Ct=m({},us,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),Dr=In(Ct),mn=m({},us,{data:0}),zi=In(mn),Sr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cr={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"},ei={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bi(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=ei[o])?!!l[o]:!1}function ua(){return Bi}var Zg=m({},Pi,{key:function(o){if(o.key){var l=Sr[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=ia(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?cr[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ua,charCode:function(o){return o.type==="keypress"?ia(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?ia(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),cO=In(Zg),uO=m({},hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fS=In(uO),dO=m({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ua}),hO=In(dO),fO=m({},us,{propertyName:0,elapsedTime:0,pseudoElement:0}),mO=In(fO),pO=m({},hs,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),gO=In(pO),vO=m({},us,{newState:0,oldState:0}),bO=In(vO),_O=[9,13,27,32],Jg=Nr&&"CompositionEvent"in window,Ku=null;Nr&&"documentMode"in document&&(Ku=document.documentMode);var yO=Nr&&"TextEvent"in window&&!Ku,mS=Nr&&(!Jg||Ku&&8<Ku&&11>=Ku),pS=" ",gS=!1;function vS(o,l){switch(o){case"keyup":return _O.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bS(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var gc=!1;function xO(o,l){switch(o){case"compositionend":return bS(l);case"keypress":return l.which!==32?null:(gS=!0,pS);case"textInput":return o=l.data,o===pS&&gS?null:o;default:return null}}function SO(o,l){if(gc)return o==="compositionend"||!Jg&&vS(o,l)?(o=mc(),cs=js=bi=null,gc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return mS&&l.locale!=="ko"?null:l.data;default:return null}}var wO={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 _S(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!wO[o.type]:l==="textarea"}function yS(o,l,h,p){As?vi?vi.push(p):vi=[p]:As=p,l=Gf(l,"onChange"),0<l.length&&(h=new ds("onChange","change",null,h,p),o.push({event:h,listeners:l}))}var Gu=null,Yu=null;function CO(o){nC(o,0)}function of(o){var l=Br(o);if(fn(l))return o}function xS(o,l){if(o==="change")return l}var SS=!1;if(Nr){var ev;if(Nr){var tv="oninput"in document;if(!tv){var wS=document.createElement("div");wS.setAttribute("oninput","return;"),tv=typeof wS.oninput=="function"}ev=tv}else ev=!1;SS=ev&&(!document.documentMode||9<document.documentMode)}function CS(){Gu&&(Gu.detachEvent("onpropertychange",kS),Yu=Gu=null)}function kS(o){if(o.propertyName==="value"&&of(Yu)){var l=[];yS(l,Yu,o,Ms(o)),ho(CO,l)}}function kO(o,l,h){o==="focusin"?(CS(),Gu=l,Yu=h,Gu.attachEvent("onpropertychange",kS)):o==="focusout"&&CS()}function EO(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return of(Yu)}function RO(o,l){if(o==="click")return of(l)}function TO(o,l){if(o==="input"||o==="change")return of(l)}function MO(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var _i=typeof Object.is=="function"?Object.is:MO;function Xu(o,l){if(_i(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var h=Object.keys(o),p=Object.keys(l);if(h.length!==p.length)return!1;for(p=0;p<h.length;p++){var y=h[p];if(!Ae.call(l,y)||!_i(o[y],l[y]))return!1}return!0}function ES(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function RS(o,l){var h=ES(o);o=0;for(var p;h;){if(h.nodeType===3){if(p=o+h.textContent.length,o<=l&&p>=l)return{node:h,offset:l-o};o=p}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=ES(h)}}function TS(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?TS(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function MS(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=as(o.document);l instanceof o.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)o=l.contentWindow;else break;l=as(o.document)}return l}function nv(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var AO=Nr&&"documentMode"in document&&11>=document.documentMode,vc=null,rv=null,Qu=null,iv=!1;function AS(o,l,h){var p=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;iv||vc==null||vc!==as(p)||(p=vc,"selectionStart"in p&&nv(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Qu&&Xu(Qu,p)||(Qu=p,p=Gf(rv,"onSelect"),0<p.length&&(l=new ds("onSelect","select",null,l,h),o.push({event:l,listeners:p}),l.target=vc)))}function ml(o,l){var h={};return h[o.toLowerCase()]=l.toLowerCase(),h["Webkit"+o]="webkit"+l,h["Moz"+o]="moz"+l,h}var bc={animationend:ml("Animation","AnimationEnd"),animationiteration:ml("Animation","AnimationIteration"),animationstart:ml("Animation","AnimationStart"),transitionrun:ml("Transition","TransitionRun"),transitionstart:ml("Transition","TransitionStart"),transitioncancel:ml("Transition","TransitionCancel"),transitionend:ml("Transition","TransitionEnd")},sv={},NS={};Nr&&(NS=document.createElement("div").style,"AnimationEvent"in window||(delete bc.animationend.animation,delete bc.animationiteration.animation,delete bc.animationstart.animation),"TransitionEvent"in window||delete bc.transitionend.transition);function pl(o){if(sv[o])return sv[o];if(!bc[o])return o;var l=bc[o],h;for(h in l)if(l.hasOwnProperty(h)&&h in NS)return sv[o]=l[h];return o}var DS=pl("animationend"),OS=pl("animationiteration"),jS=pl("animationstart"),NO=pl("transitionrun"),DO=pl("transitionstart"),OO=pl("transitioncancel"),LS=pl("transitionend"),IS=new Map,ov="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(" ");ov.push("scrollEnd");function fs(o,l){IS.set(o,l),Jr(l,[o])}var af=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Fi=[],_c=0,av=0;function lf(){for(var o=_c,l=av=_c=0;l<o;){var h=Fi[l];Fi[l++]=null;var p=Fi[l];Fi[l++]=null;var y=Fi[l];Fi[l++]=null;var w=Fi[l];if(Fi[l++]=null,p!==null&&y!==null){var N=p.pending;N===null?y.next=y:(y.next=N.next,N.next=y),p.pending=y}w!==0&&PS(h,y,w)}}function cf(o,l,h,p){Fi[_c++]=o,Fi[_c++]=l,Fi[_c++]=h,Fi[_c++]=p,av|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function lv(o,l,h,p){return cf(o,l,h,p),uf(o)}function gl(o,l){return cf(o,null,null,l),uf(o)}function PS(o,l,h){o.lanes|=h;var p=o.alternate;p!==null&&(p.lanes|=h);for(var y=!1,w=o.return;w!==null;)w.childLanes|=h,p=w.alternate,p!==null&&(p.childLanes|=h),w.tag===22&&(o=w.stateNode,o===null||o._visibility&1||(y=!0)),o=w,w=w.return;return o.tag===3?(w=o.stateNode,y&&l!==null&&(y=31-rt(h),o=w.hiddenUpdates,p=o[y],p===null?o[y]=[l]:p.push(l),l.lane=h|536870912),w):null}function uf(o){if(50<_d)throw _d=0,v0=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var yc={};function jO(o,l,h,p){this.tag=o,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(o,l,h,p){return new jO(o,l,h,p)}function cv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function po(o,l){var h=o.alternate;return h===null?(h=yi(o.tag,l,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=l,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,l=o.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function zS(o,l){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,l=h.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function df(o,l,h,p,y,w){var N=0;if(p=o,typeof o=="function")cv(o)&&(N=1);else if(typeof o=="string")N=Bj(o,h,X.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case Y:return o=yi(31,h,l,y),o.elementType=Y,o.lanes=w,o;case x:return vl(h.children,y,w,l);case C:N=8,y|=24;break;case k:return o=yi(12,h,l,y|2),o.elementType=k,o.lanes=w,o;case O:return o=yi(13,h,l,y),o.elementType=O,o.lanes=w,o;case D:return o=yi(19,h,l,y),o.elementType=D,o.lanes=w,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case R:N=10;break e;case E:N=9;break e;case M:N=11;break e;case P:N=14;break e;case z:N=16,p=null;break e}N=29,h=Error(r(130,o===null?"null":typeof o,"")),p=null}return l=yi(N,h,l,y),l.elementType=o,l.type=p,l.lanes=w,l}function vl(o,l,h,p){return o=yi(7,o,p,l),o.lanes=h,o}function uv(o,l,h){return o=yi(6,o,null,l),o.lanes=h,o}function BS(o){var l=yi(18,null,null,0);return l.stateNode=o,l}function dv(o,l,h){return l=yi(4,o.children!==null?o.children:[],o.key,l),l.lanes=h,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var FS=new WeakMap;function Hi(o,l){if(typeof o=="object"&&o!==null){var h=FS.get(o);return h!==void 0?h:(l={value:o,source:l,stack:xe(l)},FS.set(o,l),l)}return{value:o,source:l,stack:xe(l)}}var xc=[],Sc=0,hf=null,Zu=0,$i=[],Ui=0,da=null,zs=1,Bs="";function go(o,l){xc[Sc++]=Zu,xc[Sc++]=hf,hf=o,Zu=l}function HS(o,l,h){$i[Ui++]=zs,$i[Ui++]=Bs,$i[Ui++]=da,da=o;var p=zs;o=Bs;var y=32-rt(p)-1;p&=~(1<<y),h+=1;var w=32-rt(l)+y;if(30<w){var N=y-y%5;w=(p&(1<<N)-1).toString(32),p>>=N,y-=N,zs=1<<32-rt(l)+y|h<<y|p,Bs=w+o}else zs=1<<w|h<<y|p,Bs=o}function hv(o){o.return!==null&&(go(o,1),HS(o,1,0))}function fv(o){for(;o===hf;)hf=xc[--Sc],xc[Sc]=null,Zu=xc[--Sc],xc[Sc]=null;for(;o===da;)da=$i[--Ui],$i[Ui]=null,Bs=$i[--Ui],$i[Ui]=null,zs=$i[--Ui],$i[Ui]=null}function $S(o,l){$i[Ui++]=zs,$i[Ui++]=Bs,$i[Ui++]=da,zs=l.id,Bs=l.overflow,da=o}var wr=null,yn=null,Ut=!1,ha=null,Wi=!1,mv=Error(r(519));function fa(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ju(Hi(l,o)),mv}function US(o){var l=o.stateNode,h=o.type,p=o.memoizedProps;switch(l[pe]=o,l[de]=p,h){case"dialog":Pt("cancel",l),Pt("close",l);break;case"iframe":case"object":case"embed":Pt("load",l);break;case"video":case"audio":for(h=0;h<xd.length;h++)Pt(xd[h],l);break;case"source":Pt("error",l);break;case"img":case"image":case"link":Pt("error",l),Pt("load",l);break;case"details":Pt("toggle",l);break;case"input":Pt("invalid",l),uc(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Pt("invalid",l);break;case"textarea":Pt("invalid",l),hl(l,p.value,p.defaultValue,p.children)}h=p.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||l.textContent===""+h||p.suppressHydrationWarning===!0||oC(l.textContent,h)?(p.popover!=null&&(Pt("beforetoggle",l),Pt("toggle",l)),p.onScroll!=null&&Pt("scroll",l),p.onScrollEnd!=null&&Pt("scrollend",l),p.onClick!=null&&(l.onclick=Ar),l=!0):l=!1,l||fa(o,!0)}function WS(o){for(wr=o.return;wr;)switch(wr.tag){case 5:case 31:case 13:Wi=!1;return;case 27:case 3:Wi=!0;return;default:wr=wr.return}}function wc(o){if(o!==wr)return!1;if(!Ut)return WS(o),Ut=!0,!1;var l=o.tag,h;if((h=l!==3&&l!==27)&&((h=l===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||D0(o.type,o.memoizedProps)),h=!h),h&&yn&&fa(o),WS(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));yn=pC(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));yn=pC(o)}else l===27?(l=yn,Ra(o.type)?(o=P0,P0=null,yn=o):yn=l):yn=wr?qi(o.stateNode.nextSibling):null;return!0}function bl(){yn=wr=null,Ut=!1}function pv(){var o=ha;return o!==null&&(ii===null?ii=o:ii.push.apply(ii,o),ha=null),o}function Ju(o){ha===null?ha=[o]:ha.push(o)}var gv=I(null),_l=null,vo=null;function ma(o,l,h){T(gv,l._currentValue),l._currentValue=h}function bo(o){o._currentValue=gv.current,$(gv)}function vv(o,l,h){for(;o!==null;){var p=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),o===h)break;o=o.return}}function bv(o,l,h,p){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var w=y.dependencies;if(w!==null){var N=y.child;w=w.firstContext;e:for(;w!==null;){var q=w;w=y;for(var ne=0;ne<l.length;ne++)if(q.context===l[ne]){w.lanes|=h,q=w.alternate,q!==null&&(q.lanes|=h),vv(w.return,h,o),p||(N=null);break e}w=q.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(r(341));N.lanes|=h,w=N.alternate,w!==null&&(w.lanes|=h),vv(N,h,o),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===o){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function Cc(o,l,h,p){o=null;for(var y=l,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var q=y.type;_i(y.pendingProps.value,N.value)||(o!==null?o.push(q):o=[q])}}else if(y===re.current){if(N=y.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(Ed):o=[Ed])}y=y.return}o!==null&&bv(l,o,h,p),l.flags|=262144}function ff(o){for(o=o.firstContext;o!==null;){if(!_i(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function yl(o){_l=o,vo=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Cr(o){return VS(_l,o)}function mf(o,l){return _l===null&&yl(o),VS(o,l)}function VS(o,l){var h=l._currentValue;if(l={context:l,memoizedValue:h,next:null},vo===null){if(o===null)throw Error(r(308));vo=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else vo=vo.next=l;return h}var LO=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(h,p){o.push(p)}};this.abort=function(){l.aborted=!0,o.forEach(function(h){return h()})}},IO=t.unstable_scheduleCallback,PO=t.unstable_NormalPriority,Wn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _v(){return{controller:new LO,data:new Map,refCount:0}}function ed(o){o.refCount--,o.refCount===0&&IO(PO,function(){o.controller.abort()})}var td=null,yv=0,kc=0,Ec=null;function zO(o,l){if(td===null){var h=td=[];yv=0,kc=w0(),Ec={status:"pending",value:void 0,then:function(p){h.push(p)}}}return yv++,l.then(qS,qS),l}function qS(){if(--yv===0&&td!==null){Ec!==null&&(Ec.status="fulfilled");var o=td;td=null,kc=0,Ec=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function BO(o,l){var h=[],p={status:"pending",value:null,reason:null,then:function(y){h.push(y)}};return o.then(function(){p.status="fulfilled",p.value=l;for(var y=0;y<h.length;y++)(0,h[y])(l)},function(y){for(p.status="rejected",p.reason=y,y=0;y<h.length;y++)(0,h[y])(void 0)}),p}var KS=j.S;j.S=function(o,l){A2=tt(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&zO(o,l),KS!==null&&KS(o,l)};var xl=I(null);function xv(){var o=xl.current;return o!==null?o:cn.pooledCache}function pf(o,l){l===null?T(xl,xl.current):T(xl,l.pool)}function GS(){var o=xv();return o===null?null:{parent:Wn._currentValue,pool:o}}var Rc=Error(r(460)),Sv=Error(r(474)),gf=Error(r(542)),vf={then:function(){}};function YS(o){return o=o.status,o==="fulfilled"||o==="rejected"}function XS(o,l,h){switch(h=o[h],h===void 0?o.push(l):h!==l&&(l.then(Ar,Ar),l=h),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,ZS(o),o;default:if(typeof l.status=="string")l.then(Ar,Ar);else{if(o=cn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(p){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=p}},function(p){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,ZS(o),o}throw wl=l,Rc}}function Sl(o){try{var l=o._init;return l(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(wl=h,Rc):h}}var wl=null;function QS(){if(wl===null)throw Error(r(459));var o=wl;return wl=null,o}function ZS(o){if(o===Rc||o===gf)throw Error(r(483))}var Tc=null,nd=0;function bf(o){var l=nd;return nd+=1,Tc===null&&(Tc=[]),XS(Tc,o,l)}function rd(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function _f(o,l){throw l.$$typeof===v?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function JS(o){function l(fe,le){if(o){var ge=fe.deletions;ge===null?(fe.deletions=[le],fe.flags|=16):ge.push(le)}}function h(fe,le){if(!o)return null;for(;le!==null;)l(fe,le),le=le.sibling;return null}function p(fe){for(var le=new Map;fe!==null;)fe.key!==null?le.set(fe.key,fe):le.set(fe.index,fe),fe=fe.sibling;return le}function y(fe,le){return fe=po(fe,le),fe.index=0,fe.sibling=null,fe}function w(fe,le,ge){return fe.index=ge,o?(ge=fe.alternate,ge!==null?(ge=ge.index,ge<le?(fe.flags|=67108866,le):ge):(fe.flags|=67108866,le)):(fe.flags|=1048576,le)}function N(fe){return o&&fe.alternate===null&&(fe.flags|=67108866),fe}function q(fe,le,ge,Me){return le===null||le.tag!==6?(le=uv(ge,fe.mode,Me),le.return=fe,le):(le=y(le,ge),le.return=fe,le)}function ne(fe,le,ge,Me){var pt=ge.type;return pt===x?Ee(fe,le,ge.props.children,Me,ge.key):le!==null&&(le.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===z&&Sl(pt)===le.type)?(le=y(le,ge.props),rd(le,ge),le.return=fe,le):(le=df(ge.type,ge.key,ge.props,null,fe.mode,Me),rd(le,ge),le.return=fe,le)}function ve(fe,le,ge,Me){return le===null||le.tag!==4||le.stateNode.containerInfo!==ge.containerInfo||le.stateNode.implementation!==ge.implementation?(le=dv(ge,fe.mode,Me),le.return=fe,le):(le=y(le,ge.children||[]),le.return=fe,le)}function Ee(fe,le,ge,Me,pt){return le===null||le.tag!==7?(le=vl(ge,fe.mode,Me,pt),le.return=fe,le):(le=y(le,ge),le.return=fe,le)}function Ne(fe,le,ge){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return le=uv(""+le,fe.mode,ge),le.return=fe,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return ge=df(le.type,le.key,le.props,null,fe.mode,ge),rd(ge,le),ge.return=fe,ge;case S:return le=dv(le,fe.mode,ge),le.return=fe,le;case z:return le=Sl(le),Ne(fe,le,ge)}if(H(le)||V(le))return le=vl(le,fe.mode,ge,null),le.return=fe,le;if(typeof le.then=="function")return Ne(fe,bf(le),ge);if(le.$$typeof===R)return Ne(fe,mf(fe,le),ge);_f(fe,le)}return null}function _e(fe,le,ge,Me){var pt=le!==null?le.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return pt!==null?null:q(fe,le,""+ge,Me);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case b:return ge.key===pt?ne(fe,le,ge,Me):null;case S:return ge.key===pt?ve(fe,le,ge,Me):null;case z:return ge=Sl(ge),_e(fe,le,ge,Me)}if(H(ge)||V(ge))return pt!==null?null:Ee(fe,le,ge,Me,null);if(typeof ge.then=="function")return _e(fe,le,bf(ge),Me);if(ge.$$typeof===R)return _e(fe,le,mf(fe,ge),Me);_f(fe,ge)}return null}function Se(fe,le,ge,Me,pt){if(typeof Me=="string"&&Me!==""||typeof Me=="number"||typeof Me=="bigint")return fe=fe.get(ge)||null,q(le,fe,""+Me,pt);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case b:return fe=fe.get(Me.key===null?ge:Me.key)||null,ne(le,fe,Me,pt);case S:return fe=fe.get(Me.key===null?ge:Me.key)||null,ve(le,fe,Me,pt);case z:return Me=Sl(Me),Se(fe,le,ge,Me,pt)}if(H(Me)||V(Me))return fe=fe.get(ge)||null,Ee(le,fe,Me,pt,null);if(typeof Me.then=="function")return Se(fe,le,ge,bf(Me),pt);if(Me.$$typeof===R)return Se(fe,le,ge,mf(le,Me),pt);_f(le,Me)}return null}function ot(fe,le,ge,Me){for(var pt=null,qt=null,dt=le,At=le=0,$t=null;dt!==null&&At<ge.length;At++){dt.index>At?($t=dt,dt=null):$t=dt.sibling;var Kt=_e(fe,dt,ge[At],Me);if(Kt===null){dt===null&&(dt=$t);break}o&&dt&&Kt.alternate===null&&l(fe,dt),le=w(Kt,le,At),qt===null?pt=Kt:qt.sibling=Kt,qt=Kt,dt=$t}if(At===ge.length)return h(fe,dt),Ut&&go(fe,At),pt;if(dt===null){for(;At<ge.length;At++)dt=Ne(fe,ge[At],Me),dt!==null&&(le=w(dt,le,At),qt===null?pt=dt:qt.sibling=dt,qt=dt);return Ut&&go(fe,At),pt}for(dt=p(dt);At<ge.length;At++)$t=Se(dt,fe,At,ge[At],Me),$t!==null&&(o&&$t.alternate!==null&&dt.delete($t.key===null?At:$t.key),le=w($t,le,At),qt===null?pt=$t:qt.sibling=$t,qt=$t);return o&&dt.forEach(function(Da){return l(fe,Da)}),Ut&&go(fe,At),pt}function _t(fe,le,ge,Me){if(ge==null)throw Error(r(151));for(var pt=null,qt=null,dt=le,At=le=0,$t=null,Kt=ge.next();dt!==null&&!Kt.done;At++,Kt=ge.next()){dt.index>At?($t=dt,dt=null):$t=dt.sibling;var Da=_e(fe,dt,Kt.value,Me);if(Da===null){dt===null&&(dt=$t);break}o&&dt&&Da.alternate===null&&l(fe,dt),le=w(Da,le,At),qt===null?pt=Da:qt.sibling=Da,qt=Da,dt=$t}if(Kt.done)return h(fe,dt),Ut&&go(fe,At),pt;if(dt===null){for(;!Kt.done;At++,Kt=ge.next())Kt=Ne(fe,Kt.value,Me),Kt!==null&&(le=w(Kt,le,At),qt===null?pt=Kt:qt.sibling=Kt,qt=Kt);return Ut&&go(fe,At),pt}for(dt=p(dt);!Kt.done;At++,Kt=ge.next())Kt=Se(dt,fe,At,Kt.value,Me),Kt!==null&&(o&&Kt.alternate!==null&&dt.delete(Kt.key===null?At:Kt.key),le=w(Kt,le,At),qt===null?pt=Kt:qt.sibling=Kt,qt=Kt);return o&&dt.forEach(function(Xj){return l(fe,Xj)}),Ut&&go(fe,At),pt}function on(fe,le,ge,Me){if(typeof ge=="object"&&ge!==null&&ge.type===x&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case b:e:{for(var pt=ge.key;le!==null;){if(le.key===pt){if(pt=ge.type,pt===x){if(le.tag===7){h(fe,le.sibling),Me=y(le,ge.props.children),Me.return=fe,fe=Me;break e}}else if(le.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===z&&Sl(pt)===le.type){h(fe,le.sibling),Me=y(le,ge.props),rd(Me,ge),Me.return=fe,fe=Me;break e}h(fe,le);break}else l(fe,le);le=le.sibling}ge.type===x?(Me=vl(ge.props.children,fe.mode,Me,ge.key),Me.return=fe,fe=Me):(Me=df(ge.type,ge.key,ge.props,null,fe.mode,Me),rd(Me,ge),Me.return=fe,fe=Me)}return N(fe);case S:e:{for(pt=ge.key;le!==null;){if(le.key===pt)if(le.tag===4&&le.stateNode.containerInfo===ge.containerInfo&&le.stateNode.implementation===ge.implementation){h(fe,le.sibling),Me=y(le,ge.children||[]),Me.return=fe,fe=Me;break e}else{h(fe,le);break}else l(fe,le);le=le.sibling}Me=dv(ge,fe.mode,Me),Me.return=fe,fe=Me}return N(fe);case z:return ge=Sl(ge),on(fe,le,ge,Me)}if(H(ge))return ot(fe,le,ge,Me);if(V(ge)){if(pt=V(ge),typeof pt!="function")throw Error(r(150));return ge=pt.call(ge),_t(fe,le,ge,Me)}if(typeof ge.then=="function")return on(fe,le,bf(ge),Me);if(ge.$$typeof===R)return on(fe,le,mf(fe,ge),Me);_f(fe,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,le!==null&&le.tag===6?(h(fe,le.sibling),Me=y(le,ge),Me.return=fe,fe=Me):(h(fe,le),Me=uv(ge,fe.mode,Me),Me.return=fe,fe=Me),N(fe)):h(fe,le)}return function(fe,le,ge,Me){try{nd=0;var pt=on(fe,le,ge,Me);return Tc=null,pt}catch(dt){if(dt===Rc||dt===gf)throw dt;var qt=yi(29,dt,null,fe.mode);return qt.lanes=Me,qt.return=fe,qt}finally{}}}var Cl=JS(!0),ew=JS(!1),pa=!1;function wv(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cv(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function ga(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function va(o,l,h){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(Gt&2)!==0){var y=p.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),p.pending=l,l=uf(o),PS(o,null,h),l}return cf(o,p,l,h),uf(o)}function id(o,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194048)!==0)){var p=l.lanes;p&=o.pendingLanes,h|=p,l.lanes=h,kt(o,h)}}function kv(o,l){var h=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,h===p)){var y=null,w=null;if(h=h.firstBaseUpdate,h!==null){do{var N={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};w===null?y=w=N:w=w.next=N,h=h.next}while(h!==null);w===null?y=w=l:w=w.next=l}else y=w=l;h={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:p.shared,callbacks:p.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=l:o.next=l,h.lastBaseUpdate=l}var Ev=!1;function sd(){if(Ev){var o=Ec;if(o!==null)throw o}}function od(o,l,h,p){Ev=!1;var y=o.updateQueue;pa=!1;var w=y.firstBaseUpdate,N=y.lastBaseUpdate,q=y.shared.pending;if(q!==null){y.shared.pending=null;var ne=q,ve=ne.next;ne.next=null,N===null?w=ve:N.next=ve,N=ne;var Ee=o.alternate;Ee!==null&&(Ee=Ee.updateQueue,q=Ee.lastBaseUpdate,q!==N&&(q===null?Ee.firstBaseUpdate=ve:q.next=ve,Ee.lastBaseUpdate=ne))}if(w!==null){var Ne=y.baseState;N=0,Ee=ve=ne=null,q=w;do{var _e=q.lane&-536870913,Se=_e!==q.lane;if(Se?(Ht&_e)===_e:(p&_e)===_e){_e!==0&&_e===kc&&(Ev=!0),Ee!==null&&(Ee=Ee.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var ot=o,_t=q;_e=l;var on=h;switch(_t.tag){case 1:if(ot=_t.payload,typeof ot=="function"){Ne=ot.call(on,Ne,_e);break e}Ne=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=_t.payload,_e=typeof ot=="function"?ot.call(on,Ne,_e):ot,_e==null)break e;Ne=m({},Ne,_e);break e;case 2:pa=!0}}_e=q.callback,_e!==null&&(o.flags|=64,Se&&(o.flags|=8192),Se=y.callbacks,Se===null?y.callbacks=[_e]:Se.push(_e))}else Se={lane:_e,tag:q.tag,payload:q.payload,callback:q.callback,next:null},Ee===null?(ve=Ee=Se,ne=Ne):Ee=Ee.next=Se,N|=_e;if(q=q.next,q===null){if(q=y.shared.pending,q===null)break;Se=q,q=Se.next,Se.next=null,y.lastBaseUpdate=Se,y.shared.pending=null}}while(!0);Ee===null&&(ne=Ne),y.baseState=ne,y.firstBaseUpdate=ve,y.lastBaseUpdate=Ee,w===null&&(y.shared.lanes=0),Sa|=N,o.lanes=N,o.memoizedState=Ne}}function tw(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function nw(o,l){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)tw(h[o],l)}var Mc=I(null),yf=I(0);function rw(o,l){o=Ro,T(yf,o),T(Mc,l),Ro=o|l.baseLanes}function Rv(){T(yf,Ro),T(Mc,Mc.current)}function Tv(){Ro=yf.current,$(Mc),$(yf)}var xi=I(null),Vi=null;function ba(o){var l=o.alternate;T(Pn,Pn.current&1),T(xi,o),Vi===null&&(l===null||Mc.current!==null||l.memoizedState!==null)&&(Vi=o)}function Mv(o){T(Pn,Pn.current),T(xi,o),Vi===null&&(Vi=o)}function iw(o){o.tag===22?(T(Pn,Pn.current),T(xi,o),Vi===null&&(Vi=o)):_a()}function _a(){T(Pn,Pn.current),T(xi,xi.current)}function Si(o){$(xi),Vi===o&&(Vi=null),$(Pn)}var Pn=I(0);function xf(o){for(var l=o;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||L0(h)||I0(h)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var _o=0,Rt=null,rn=null,Vn=null,Sf=!1,Ac=!1,kl=!1,wf=0,ad=0,Nc=null,FO=0;function Nn(){throw Error(r(321))}function Av(o,l){if(l===null)return!1;for(var h=0;h<l.length&&h<o.length;h++)if(!_i(o[h],l[h]))return!1;return!0}function Nv(o,l,h,p,y,w){return _o=w,Rt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,j.H=o===null||o.memoizedState===null?Hw:qv,kl=!1,w=h(p,y),kl=!1,Ac&&(w=ow(l,h,p,y)),sw(o),w}function sw(o){j.H=ud;var l=rn!==null&&rn.next!==null;if(_o=0,Vn=rn=Rt=null,Sf=!1,ad=0,Nc=null,l)throw Error(r(300));o===null||qn||(o=o.dependencies,o!==null&&ff(o)&&(qn=!0))}function ow(o,l,h,p){Rt=o;var y=0;do{if(Ac&&(Nc=null),ad=0,Ac=!1,25<=y)throw Error(r(301));if(y+=1,Vn=rn=null,o.updateQueue!=null){var w=o.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}j.H=$w,w=l(h,p)}while(Ac);return w}function HO(){var o=j.H,l=o.useState()[0];return l=typeof l.then=="function"?ld(l):l,o=o.useState()[0],(rn!==null?rn.memoizedState:null)!==o&&(Rt.flags|=1024),l}function Dv(){var o=wf!==0;return wf=0,o}function Ov(o,l,h){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~h}function jv(o){if(Sf){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}Sf=!1}_o=0,Vn=rn=Rt=null,Ac=!1,ad=wf=0,Nc=null}function Hr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?Rt.memoizedState=Vn=o:Vn=Vn.next=o,Vn}function zn(){if(rn===null){var o=Rt.alternate;o=o!==null?o.memoizedState:null}else o=rn.next;var l=Vn===null?Rt.memoizedState:Vn.next;if(l!==null)Vn=l,rn=o;else{if(o===null)throw Rt.alternate===null?Error(r(467)):Error(r(310));rn=o,o={memoizedState:rn.memoizedState,baseState:rn.baseState,baseQueue:rn.baseQueue,queue:rn.queue,next:null},Vn===null?Rt.memoizedState=Vn=o:Vn=Vn.next=o}return Vn}function Cf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ld(o){var l=ad;return ad+=1,Nc===null&&(Nc=[]),o=XS(Nc,o,l),l=Rt,(Vn===null?l.memoizedState:Vn.next)===null&&(l=l.alternate,j.H=l===null||l.memoizedState===null?Hw:qv),o}function kf(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return ld(o);if(o.$$typeof===R)return Cr(o)}throw Error(r(438,String(o)))}function Lv(o){var l=null,h=Rt.updateQueue;if(h!==null&&(l=h.memoCache),l==null){var p=Rt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),h===null&&(h=Cf(),Rt.updateQueue=h),h.memoCache=l,h=l.data[l.index],h===void 0)for(h=l.data[l.index]=Array(o),p=0;p<o;p++)h[p]=L;return l.index++,h}function yo(o,l){return typeof l=="function"?l(o):l}function Ef(o){var l=zn();return Iv(l,rn,o)}function Iv(o,l,h){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=h;var y=o.baseQueue,w=p.pending;if(w!==null){if(y!==null){var N=y.next;y.next=w.next,w.next=N}l.baseQueue=y=w,p.pending=null}if(w=o.baseState,y===null)o.memoizedState=w;else{l=y.next;var q=N=null,ne=null,ve=l,Ee=!1;do{var Ne=ve.lane&-536870913;if(Ne!==ve.lane?(Ht&Ne)===Ne:(_o&Ne)===Ne){var _e=ve.revertLane;if(_e===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),Ne===kc&&(Ee=!0);else if((_o&_e)===_e){ve=ve.next,_e===kc&&(Ee=!0);continue}else Ne={lane:0,revertLane:ve.revertLane,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},ne===null?(q=ne=Ne,N=w):ne=ne.next=Ne,Rt.lanes|=_e,Sa|=_e;Ne=ve.action,kl&&h(w,Ne),w=ve.hasEagerState?ve.eagerState:h(w,Ne)}else _e={lane:Ne,revertLane:ve.revertLane,gesture:ve.gesture,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},ne===null?(q=ne=_e,N=w):ne=ne.next=_e,Rt.lanes|=Ne,Sa|=Ne;ve=ve.next}while(ve!==null&&ve!==l);if(ne===null?N=w:ne.next=q,!_i(w,o.memoizedState)&&(qn=!0,Ee&&(h=Ec,h!==null)))throw h;o.memoizedState=w,o.baseState=N,o.baseQueue=ne,p.lastRenderedState=w}return y===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function Pv(o){var l=zn(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var p=h.dispatch,y=h.pending,w=l.memoizedState;if(y!==null){h.pending=null;var N=y=y.next;do w=o(w,N.action),N=N.next;while(N!==y);_i(w,l.memoizedState)||(qn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),h.lastRenderedState=w}return[w,p]}function aw(o,l,h){var p=Rt,y=zn(),w=Ut;if(w){if(h===void 0)throw Error(r(407));h=h()}else h=l();var N=!_i((rn||y).memoizedState,h);if(N&&(y.memoizedState=h,qn=!0),y=y.queue,Fv(uw.bind(null,p,y,o),[o]),y.getSnapshot!==l||N||Vn!==null&&Vn.memoizedState.tag&1){if(p.flags|=2048,Dc(9,{destroy:void 0},cw.bind(null,p,y,h,l),null),cn===null)throw Error(r(349));w||(_o&127)!==0||lw(p,l,h)}return h}function lw(o,l,h){o.flags|=16384,o={getSnapshot:l,value:h},l=Rt.updateQueue,l===null?(l=Cf(),Rt.updateQueue=l,l.stores=[o]):(h=l.stores,h===null?l.stores=[o]:h.push(o))}function cw(o,l,h,p){l.value=h,l.getSnapshot=p,dw(l)&&hw(o)}function uw(o,l,h){return h(function(){dw(l)&&hw(o)})}function dw(o){var l=o.getSnapshot;o=o.value;try{var h=l();return!_i(o,h)}catch{return!0}}function hw(o){var l=gl(o,2);l!==null&&si(l,o,2)}function zv(o){var l=Hr();if(typeof o=="function"){var h=o;if(o=h(),kl){ft(!0);try{h()}finally{ft(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yo,lastRenderedState:o},l}function fw(o,l,h,p){return o.baseState=h,Iv(o,rn,typeof p=="function"?p:yo)}function $O(o,l,h,p,y){if(Mf(o))throw Error(r(485));if(o=l.action,o!==null){var w={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){w.listeners.push(N)}};j.T!==null?h(!0):w.isTransition=!1,p(w),h=l.pending,h===null?(w.next=l.pending=w,mw(l,w)):(w.next=h.next,l.pending=h.next=w)}}function mw(o,l){var h=l.action,p=l.payload,y=o.state;if(l.isTransition){var w=j.T,N={};j.T=N;try{var q=h(y,p),ne=j.S;ne!==null&&ne(N,q),pw(o,l,q)}catch(ve){Bv(o,l,ve)}finally{w!==null&&N.types!==null&&(w.types=N.types),j.T=w}}else try{w=h(y,p),pw(o,l,w)}catch(ve){Bv(o,l,ve)}}function pw(o,l,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(p){gw(o,l,p)},function(p){return Bv(o,l,p)}):gw(o,l,h)}function gw(o,l,h){l.status="fulfilled",l.value=h,vw(l),o.state=h,l=o.pending,l!==null&&(h=l.next,h===l?o.pending=null:(h=h.next,l.next=h,mw(o,h)))}function Bv(o,l,h){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=h,vw(l),l=l.next;while(l!==p)}o.action=null}function vw(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function bw(o,l){return l}function _w(o,l){if(Ut){var h=cn.formState;if(h!==null){e:{var p=Rt;if(Ut){if(yn){t:{for(var y=yn,w=Wi;y.nodeType!==8;){if(!w){y=null;break t}if(y=qi(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){yn=qi(y.nextSibling),p=y.data==="F!";break e}}fa(p)}p=!1}p&&(l=h[0])}}return h=Hr(),h.memoizedState=h.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bw,lastRenderedState:l},h.queue=p,h=zw.bind(null,Rt,p),p.dispatch=h,p=zv(!1),w=Vv.bind(null,Rt,!1,p.queue),p=Hr(),y={state:l,dispatch:null,action:o,pending:null},p.queue=y,h=$O.bind(null,Rt,y,w,h),y.dispatch=h,p.memoizedState=o,[l,h,!1]}function yw(o){var l=zn();return xw(l,rn,o)}function xw(o,l,h){if(l=Iv(o,l,bw)[0],o=Ef(yo)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=ld(l)}catch(N){throw N===Rc?gf:N}else p=l;l=zn();var y=l.queue,w=y.dispatch;return h!==l.memoizedState&&(Rt.flags|=2048,Dc(9,{destroy:void 0},UO.bind(null,y,h),null)),[p,w,o]}function UO(o,l){o.action=l}function Sw(o){var l=zn(),h=rn;if(h!==null)return xw(l,h,o);zn(),l=l.memoizedState,h=zn();var p=h.queue.dispatch;return h.memoizedState=o,[l,p,!1]}function Dc(o,l,h,p){return o={tag:o,create:h,deps:p,inst:l,next:null},l=Rt.updateQueue,l===null&&(l=Cf(),Rt.updateQueue=l),h=l.lastEffect,h===null?l.lastEffect=o.next=o:(p=h.next,h.next=o,o.next=p,l.lastEffect=o),o}function ww(){return zn().memoizedState}function Rf(o,l,h,p){var y=Hr();Rt.flags|=o,y.memoizedState=Dc(1|l,{destroy:void 0},h,p===void 0?null:p)}function Tf(o,l,h,p){var y=zn();p=p===void 0?null:p;var w=y.memoizedState.inst;rn!==null&&p!==null&&Av(p,rn.memoizedState.deps)?y.memoizedState=Dc(l,w,h,p):(Rt.flags|=o,y.memoizedState=Dc(1|l,w,h,p))}function Cw(o,l){Rf(8390656,8,o,l)}function Fv(o,l){Tf(2048,8,o,l)}function WO(o){Rt.flags|=4;var l=Rt.updateQueue;if(l===null)l=Cf(),Rt.updateQueue=l,l.events=[o];else{var h=l.events;h===null?l.events=[o]:h.push(o)}}function kw(o){var l=zn().memoizedState;return WO({ref:l,nextImpl:o}),function(){if((Gt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Ew(o,l){return Tf(4,2,o,l)}function Rw(o,l){return Tf(4,4,o,l)}function Tw(o,l){if(typeof l=="function"){o=o();var h=l(o);return function(){typeof h=="function"?h():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Mw(o,l,h){h=h!=null?h.concat([o]):null,Tf(4,4,Tw.bind(null,l,o),h)}function Hv(){}function Aw(o,l){var h=zn();l=l===void 0?null:l;var p=h.memoizedState;return l!==null&&Av(l,p[1])?p[0]:(h.memoizedState=[o,l],o)}function Nw(o,l){var h=zn();l=l===void 0?null:l;var p=h.memoizedState;if(l!==null&&Av(l,p[1]))return p[0];if(p=o(),kl){ft(!0);try{o()}finally{ft(!1)}}return h.memoizedState=[p,l],p}function $v(o,l,h){return h===void 0||(_o&1073741824)!==0&&(Ht&261930)===0?o.memoizedState=l:(o.memoizedState=h,o=D2(),Rt.lanes|=o,Sa|=o,h)}function Dw(o,l,h,p){return _i(h,l)?h:Mc.current!==null?(o=$v(o,h,p),_i(o,l)||(qn=!0),o):(_o&42)===0||(_o&1073741824)!==0&&(Ht&261930)===0?(qn=!0,o.memoizedState=h):(o=D2(),Rt.lanes|=o,Sa|=o,l)}function Ow(o,l,h,p,y){var w=G.p;G.p=w!==0&&8>w?w:8;var N=j.T,q={};j.T=q,Vv(o,!1,l,h);try{var ne=y(),ve=j.S;if(ve!==null&&ve(q,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var Ee=BO(ne,p);cd(o,l,Ee,ki(o))}else cd(o,l,p,ki(o))}catch(Ne){cd(o,l,{then:function(){},status:"rejected",reason:Ne},ki())}finally{G.p=w,N!==null&&q.types!==null&&(N.types=q.types),j.T=N}}function VO(){}function Uv(o,l,h,p){if(o.tag!==5)throw Error(r(476));var y=jw(o).queue;Ow(o,y,l,B,h===null?VO:function(){return Lw(o),h(p)})}function jw(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yo,lastRenderedState:B},next:null};var h={};return l.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yo,lastRenderedState:h},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function Lw(o){var l=jw(o);l.next===null&&(l=o.alternate.memoizedState),cd(o,l.next.queue,{},ki())}function Wv(){return Cr(Ed)}function Iw(){return zn().memoizedState}function Pw(){return zn().memoizedState}function qO(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var h=ki();o=ga(h);var p=va(l,o,h);p!==null&&(si(p,l,h),id(p,l,h)),l={cache:_v()},o.payload=l;return}l=l.return}}function KO(o,l,h){var p=ki();h={lane:p,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Mf(o)?Bw(l,h):(h=lv(o,l,h,p),h!==null&&(si(h,o,p),Fw(h,l,p)))}function zw(o,l,h){var p=ki();cd(o,l,h,p)}function cd(o,l,h,p){var y={lane:p,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Mf(o))Bw(l,y);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var N=l.lastRenderedState,q=w(N,h);if(y.hasEagerState=!0,y.eagerState=q,_i(q,N))return cf(o,l,y,0),cn===null&&lf(),!1}catch{}finally{}if(h=lv(o,l,y,p),h!==null)return si(h,o,p),Fw(h,l,p),!0}return!1}function Vv(o,l,h,p){if(p={lane:2,revertLane:w0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Mf(o)){if(l)throw Error(r(479))}else l=lv(o,h,p,2),l!==null&&si(l,o,2)}function Mf(o){var l=o.alternate;return o===Rt||l!==null&&l===Rt}function Bw(o,l){Ac=Sf=!0;var h=o.pending;h===null?l.next=l:(l.next=h.next,h.next=l),o.pending=l}function Fw(o,l,h){if((h&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,h|=p,l.lanes=h,kt(o,h)}}var ud={readContext:Cr,use:kf,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useLayoutEffect:Nn,useInsertionEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useDeferredValue:Nn,useTransition:Nn,useSyncExternalStore:Nn,useId:Nn,useHostTransitionStatus:Nn,useFormState:Nn,useActionState:Nn,useOptimistic:Nn,useMemoCache:Nn,useCacheRefresh:Nn};ud.useEffectEvent=Nn;var Hw={readContext:Cr,use:kf,useCallback:function(o,l){return Hr().memoizedState=[o,l===void 0?null:l],o},useContext:Cr,useEffect:Cw,useImperativeHandle:function(o,l,h){h=h!=null?h.concat([o]):null,Rf(4194308,4,Tw.bind(null,l,o),h)},useLayoutEffect:function(o,l){return Rf(4194308,4,o,l)},useInsertionEffect:function(o,l){Rf(4,2,o,l)},useMemo:function(o,l){var h=Hr();l=l===void 0?null:l;var p=o();if(kl){ft(!0);try{o()}finally{ft(!1)}}return h.memoizedState=[p,l],p},useReducer:function(o,l,h){var p=Hr();if(h!==void 0){var y=h(l);if(kl){ft(!0);try{h(l)}finally{ft(!1)}}}else y=l;return p.memoizedState=p.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},p.queue=o,o=o.dispatch=KO.bind(null,Rt,o),[p.memoizedState,o]},useRef:function(o){var l=Hr();return o={current:o},l.memoizedState=o},useState:function(o){o=zv(o);var l=o.queue,h=zw.bind(null,Rt,l);return l.dispatch=h,[o.memoizedState,h]},useDebugValue:Hv,useDeferredValue:function(o,l){var h=Hr();return $v(h,o,l)},useTransition:function(){var o=zv(!1);return o=Ow.bind(null,Rt,o.queue,!0,!1),Hr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,h){var p=Rt,y=Hr();if(Ut){if(h===void 0)throw Error(r(407));h=h()}else{if(h=l(),cn===null)throw Error(r(349));(Ht&127)!==0||lw(p,l,h)}y.memoizedState=h;var w={value:h,getSnapshot:l};return y.queue=w,Cw(uw.bind(null,p,w,o),[o]),p.flags|=2048,Dc(9,{destroy:void 0},cw.bind(null,p,w,h,l),null),h},useId:function(){var o=Hr(),l=cn.identifierPrefix;if(Ut){var h=Bs,p=zs;h=(p&~(1<<32-rt(p)-1)).toString(32)+h,l="_"+l+"R_"+h,h=wf++,0<h&&(l+="H"+h.toString(32)),l+="_"}else h=FO++,l="_"+l+"r_"+h.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:Wv,useFormState:_w,useActionState:_w,useOptimistic:function(o){var l=Hr();l.memoizedState=l.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=h,l=Vv.bind(null,Rt,!0,h),h.dispatch=l,[o,l]},useMemoCache:Lv,useCacheRefresh:function(){return Hr().memoizedState=qO.bind(null,Rt)},useEffectEvent:function(o){var l=Hr(),h={impl:o};return l.memoizedState=h,function(){if((Gt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},qv={readContext:Cr,use:kf,useCallback:Aw,useContext:Cr,useEffect:Fv,useImperativeHandle:Mw,useInsertionEffect:Ew,useLayoutEffect:Rw,useMemo:Nw,useReducer:Ef,useRef:ww,useState:function(){return Ef(yo)},useDebugValue:Hv,useDeferredValue:function(o,l){var h=zn();return Dw(h,rn.memoizedState,o,l)},useTransition:function(){var o=Ef(yo)[0],l=zn().memoizedState;return[typeof o=="boolean"?o:ld(o),l]},useSyncExternalStore:aw,useId:Iw,useHostTransitionStatus:Wv,useFormState:yw,useActionState:yw,useOptimistic:function(o,l){var h=zn();return fw(h,rn,o,l)},useMemoCache:Lv,useCacheRefresh:Pw};qv.useEffectEvent=kw;var $w={readContext:Cr,use:kf,useCallback:Aw,useContext:Cr,useEffect:Fv,useImperativeHandle:Mw,useInsertionEffect:Ew,useLayoutEffect:Rw,useMemo:Nw,useReducer:Pv,useRef:ww,useState:function(){return Pv(yo)},useDebugValue:Hv,useDeferredValue:function(o,l){var h=zn();return rn===null?$v(h,o,l):Dw(h,rn.memoizedState,o,l)},useTransition:function(){var o=Pv(yo)[0],l=zn().memoizedState;return[typeof o=="boolean"?o:ld(o),l]},useSyncExternalStore:aw,useId:Iw,useHostTransitionStatus:Wv,useFormState:Sw,useActionState:Sw,useOptimistic:function(o,l){var h=zn();return rn!==null?fw(h,rn,o,l):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:Lv,useCacheRefresh:Pw};$w.useEffectEvent=kw;function Kv(o,l,h,p){l=o.memoizedState,h=h(p,l),h=h==null?l:m({},l,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var Gv={enqueueSetState:function(o,l,h){o=o._reactInternals;var p=ki(),y=ga(p);y.payload=l,h!=null&&(y.callback=h),l=va(o,y,p),l!==null&&(si(l,o,p),id(l,o,p))},enqueueReplaceState:function(o,l,h){o=o._reactInternals;var p=ki(),y=ga(p);y.tag=1,y.payload=l,h!=null&&(y.callback=h),l=va(o,y,p),l!==null&&(si(l,o,p),id(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var h=ki(),p=ga(h);p.tag=2,l!=null&&(p.callback=l),l=va(o,p,h),l!==null&&(si(l,o,h),id(l,o,h))}};function Uw(o,l,h,p,y,w,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,w,N):l.prototype&&l.prototype.isPureReactComponent?!Xu(h,p)||!Xu(y,w):!0}function Ww(o,l,h,p){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,p),l.state!==o&&Gv.enqueueReplaceState(l,l.state,null)}function El(o,l){var h=l;if("ref"in l){h={};for(var p in l)p!=="ref"&&(h[p]=l[p])}if(o=o.defaultProps){h===l&&(h=m({},h));for(var y in o)h[y]===void 0&&(h[y]=o[y])}return h}function Vw(o){af(o)}function qw(o){console.error(o)}function Kw(o){af(o)}function Af(o,l){try{var h=o.onUncaughtError;h(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function Gw(o,l,h){try{var p=o.onCaughtError;p(h.value,{componentStack:h.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Yv(o,l,h){return h=ga(h),h.tag=3,h.payload={element:null},h.callback=function(){Af(o,l)},h}function Yw(o){return o=ga(o),o.tag=3,o}function Xw(o,l,h,p){var y=h.type.getDerivedStateFromError;if(typeof y=="function"){var w=p.value;o.payload=function(){return y(w)},o.callback=function(){Gw(l,h,p)}}var N=h.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(o.callback=function(){Gw(l,h,p),typeof y!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var q=p.stack;this.componentDidCatch(p.value,{componentStack:q!==null?q:""})})}function GO(o,l,h,p,y){if(h.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=h.alternate,l!==null&&Cc(l,h,y,!0),h=xi.current,h!==null){switch(h.tag){case 31:case 13:return Vi===null?$f():h.alternate===null&&Dn===0&&(Dn=3),h.flags&=-257,h.flags|=65536,h.lanes=y,p===vf?h.flags|=16384:(l=h.updateQueue,l===null?h.updateQueue=new Set([p]):l.add(p),y0(o,p,y)),!1;case 22:return h.flags|=65536,p===vf?h.flags|=16384:(l=h.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},h.updateQueue=l):(h=l.retryQueue,h===null?l.retryQueue=new Set([p]):h.add(p)),y0(o,p,y)),!1}throw Error(r(435,h.tag))}return y0(o,p,y),$f(),!1}if(Ut)return l=xi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,p!==mv&&(o=Error(r(422),{cause:p}),Ju(Hi(o,h)))):(p!==mv&&(l=Error(r(423),{cause:p}),Ju(Hi(l,h))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,p=Hi(p,h),y=Yv(o.stateNode,p,y),kv(o,y),Dn!==4&&(Dn=2)),!1;var w=Error(r(520),{cause:p});if(w=Hi(w,h),bd===null?bd=[w]:bd.push(w),Dn!==4&&(Dn=2),l===null)return!0;p=Hi(p,h),h=l;do{switch(h.tag){case 3:return h.flags|=65536,o=y&-y,h.lanes|=o,o=Yv(h.stateNode,p,o),kv(h,o),!1;case 1:if(l=h.type,w=h.stateNode,(h.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(wa===null||!wa.has(w))))return h.flags|=65536,y&=-y,h.lanes|=y,y=Yw(y),Xw(y,o,h,p),kv(h,y),!1}h=h.return}while(h!==null);return!1}var Xv=Error(r(461)),qn=!1;function kr(o,l,h,p){l.child=o===null?ew(l,null,h,p):Cl(l,o.child,h,p)}function Qw(o,l,h,p,y){h=h.render;var w=l.ref;if("ref"in p){var N={};for(var q in p)q!=="ref"&&(N[q]=p[q])}else N=p;return yl(l),p=Nv(o,l,h,N,w,y),q=Dv(),o!==null&&!qn?(Ov(o,l,y),xo(o,l,y)):(Ut&&q&&hv(l),l.flags|=1,kr(o,l,p,y),l.child)}function Zw(o,l,h,p,y){if(o===null){var w=h.type;return typeof w=="function"&&!cv(w)&&w.defaultProps===void 0&&h.compare===null?(l.tag=15,l.type=w,Jw(o,l,w,p,y)):(o=df(h.type,null,p,l,l.mode,y),o.ref=l.ref,o.return=l,l.child=o)}if(w=o.child,!i0(o,y)){var N=w.memoizedProps;if(h=h.compare,h=h!==null?h:Xu,h(N,p)&&o.ref===l.ref)return xo(o,l,y)}return l.flags|=1,o=po(w,p),o.ref=l.ref,o.return=l,l.child=o}function Jw(o,l,h,p,y){if(o!==null){var w=o.memoizedProps;if(Xu(w,p)&&o.ref===l.ref)if(qn=!1,l.pendingProps=p=w,i0(o,y))(o.flags&131072)!==0&&(qn=!0);else return l.lanes=o.lanes,xo(o,l,y)}return Qv(o,l,h,p,y)}function e2(o,l,h,p){var y=p.children,w=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((l.flags&128)!==0){if(w=w!==null?w.baseLanes|h:h,o!==null){for(p=l.child=o.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~w}else p=0,l.child=null;return t2(o,l,w,h,p)}if((h&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&pf(l,w!==null?w.cachePool:null),w!==null?rw(l,w):Rv(),iw(l);else return p=l.lanes=536870912,t2(o,l,w!==null?w.baseLanes|h:h,h,p)}else w!==null?(pf(l,w.cachePool),rw(l,w),_a(),l.memoizedState=null):(o!==null&&pf(l,null),Rv(),_a());return kr(o,l,y,h),l.child}function dd(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function t2(o,l,h,p,y){var w=xv();return w=w===null?null:{parent:Wn._currentValue,pool:w},l.memoizedState={baseLanes:h,cachePool:w},o!==null&&pf(l,null),Rv(),iw(l),o!==null&&Cc(o,l,p,!0),l.childLanes=y,null}function Nf(o,l){return l=Of({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function n2(o,l,h){return Cl(l,o.child,null,h),o=Nf(l,l.pendingProps),o.flags|=2,Si(l),l.memoizedState=null,o}function YO(o,l,h){var p=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(Ut){if(p.mode==="hidden")return o=Nf(l,p),l.lanes=536870912,dd(null,o);if(Mv(l),(o=yn)?(o=mC(o,Wi),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:da!==null?{id:zs,overflow:Bs}:null,retryLane:536870912,hydrationErrors:null},h=BS(o),h.return=l,l.child=h,wr=l,yn=null)):o=null,o===null)throw fa(l);return l.lanes=536870912,null}return Nf(l,p)}var w=o.memoizedState;if(w!==null){var N=w.dehydrated;if(Mv(l),y)if(l.flags&256)l.flags&=-257,l=n2(o,l,h);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(qn||Cc(o,l,h,!1),y=(h&o.childLanes)!==0,qn||y){if(p=cn,p!==null&&(N=Dt(p,h),N!==0&&N!==w.retryLane))throw w.retryLane=N,gl(o,N),si(p,o,N),Xv;$f(),l=n2(o,l,h)}else o=w.treeContext,yn=qi(N.nextSibling),wr=l,Ut=!0,ha=null,Wi=!1,o!==null&&$S(l,o),l=Nf(l,p),l.flags|=4096;return l}return o=po(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Df(o,l){var h=l.ref;if(h===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(o===null||o.ref!==h)&&(l.flags|=4194816)}}function Qv(o,l,h,p,y){return yl(l),h=Nv(o,l,h,p,void 0,y),p=Dv(),o!==null&&!qn?(Ov(o,l,y),xo(o,l,y)):(Ut&&p&&hv(l),l.flags|=1,kr(o,l,h,y),l.child)}function r2(o,l,h,p,y,w){return yl(l),l.updateQueue=null,h=ow(l,p,h,y),sw(o),p=Dv(),o!==null&&!qn?(Ov(o,l,w),xo(o,l,w)):(Ut&&p&&hv(l),l.flags|=1,kr(o,l,h,w),l.child)}function i2(o,l,h,p,y){if(yl(l),l.stateNode===null){var w=yc,N=h.contextType;typeof N=="object"&&N!==null&&(w=Cr(N)),w=new h(p,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Gv,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=p,w.state=l.memoizedState,w.refs={},wv(l),N=h.contextType,w.context=typeof N=="object"&&N!==null?Cr(N):yc,w.state=l.memoizedState,N=h.getDerivedStateFromProps,typeof N=="function"&&(Kv(l,h,N,p),w.state=l.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(N=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),N!==w.state&&Gv.enqueueReplaceState(w,w.state,null),od(l,p,w,y),sd(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){w=l.stateNode;var q=l.memoizedProps,ne=El(h,q);w.props=ne;var ve=w.context,Ee=h.contextType;N=yc,typeof Ee=="object"&&Ee!==null&&(N=Cr(Ee));var Ne=h.getDerivedStateFromProps;Ee=typeof Ne=="function"||typeof w.getSnapshotBeforeUpdate=="function",q=l.pendingProps!==q,Ee||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(q||ve!==N)&&Ww(l,w,p,N),pa=!1;var _e=l.memoizedState;w.state=_e,od(l,p,w,y),sd(),ve=l.memoizedState,q||_e!==ve||pa?(typeof Ne=="function"&&(Kv(l,h,Ne,p),ve=l.memoizedState),(ne=pa||Uw(l,h,ne,p,_e,ve,N))?(Ee||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=ve),w.props=p,w.state=ve,w.context=N,p=ne):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{w=l.stateNode,Cv(o,l),N=l.memoizedProps,Ee=El(h,N),w.props=Ee,Ne=l.pendingProps,_e=w.context,ve=h.contextType,ne=yc,typeof ve=="object"&&ve!==null&&(ne=Cr(ve)),q=h.getDerivedStateFromProps,(ve=typeof q=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N!==Ne||_e!==ne)&&Ww(l,w,p,ne),pa=!1,_e=l.memoizedState,w.state=_e,od(l,p,w,y),sd();var Se=l.memoizedState;N!==Ne||_e!==Se||pa||o!==null&&o.dependencies!==null&&ff(o.dependencies)?(typeof q=="function"&&(Kv(l,h,q,p),Se=l.memoizedState),(Ee=pa||Uw(l,h,Ee,p,_e,Se,ne)||o!==null&&o.dependencies!==null&&ff(o.dependencies))?(ve||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,Se,ne),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,Se,ne)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||N===o.memoizedProps&&_e===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&_e===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=Se),w.props=p,w.state=Se,w.context=ne,p=Ee):(typeof w.componentDidUpdate!="function"||N===o.memoizedProps&&_e===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&_e===o.memoizedState||(l.flags|=1024),p=!1)}return w=p,Df(o,l),p=(l.flags&128)!==0,w||p?(w=l.stateNode,h=p&&typeof h.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,o!==null&&p?(l.child=Cl(l,o.child,null,y),l.child=Cl(l,null,h,y)):kr(o,l,h,y),l.memoizedState=w.state,o=l.child):o=xo(o,l,y),o}function s2(o,l,h,p){return bl(),l.flags|=256,kr(o,l,h,p),l.child}var Zv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jv(o){return{baseLanes:o,cachePool:GS()}}function e0(o,l,h){return o=o!==null?o.childLanes&~h:0,l&&(o|=Ci),o}function o2(o,l,h){var p=l.pendingProps,y=!1,w=(l.flags&128)!==0,N;if((N=w)||(N=o!==null&&o.memoizedState===null?!1:(Pn.current&2)!==0),N&&(y=!0,l.flags&=-129),N=(l.flags&32)!==0,l.flags&=-33,o===null){if(Ut){if(y?ba(l):_a(),(o=yn)?(o=mC(o,Wi),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:da!==null?{id:zs,overflow:Bs}:null,retryLane:536870912,hydrationErrors:null},h=BS(o),h.return=l,l.child=h,wr=l,yn=null)):o=null,o===null)throw fa(l);return I0(o)?l.lanes=32:l.lanes=536870912,null}var q=p.children;return p=p.fallback,y?(_a(),y=l.mode,q=Of({mode:"hidden",children:q},y),p=vl(p,y,h,null),q.return=l,p.return=l,q.sibling=p,l.child=q,p=l.child,p.memoizedState=Jv(h),p.childLanes=e0(o,N,h),l.memoizedState=Zv,dd(null,p)):(ba(l),t0(l,q))}var ne=o.memoizedState;if(ne!==null&&(q=ne.dehydrated,q!==null)){if(w)l.flags&256?(ba(l),l.flags&=-257,l=n0(o,l,h)):l.memoizedState!==null?(_a(),l.child=o.child,l.flags|=128,l=null):(_a(),q=p.fallback,y=l.mode,p=Of({mode:"visible",children:p.children},y),q=vl(q,y,h,null),q.flags|=2,p.return=l,q.return=l,p.sibling=q,l.child=p,Cl(l,o.child,null,h),p=l.child,p.memoizedState=Jv(h),p.childLanes=e0(o,N,h),l.memoizedState=Zv,l=dd(null,p));else if(ba(l),I0(q)){if(N=q.nextSibling&&q.nextSibling.dataset,N)var ve=N.dgst;N=ve,p=Error(r(419)),p.stack="",p.digest=N,Ju({value:p,source:null,stack:null}),l=n0(o,l,h)}else if(qn||Cc(o,l,h,!1),N=(h&o.childLanes)!==0,qn||N){if(N=cn,N!==null&&(p=Dt(N,h),p!==0&&p!==ne.retryLane))throw ne.retryLane=p,gl(o,p),si(N,o,p),Xv;L0(q)||$f(),l=n0(o,l,h)}else L0(q)?(l.flags|=192,l.child=o.child,l=null):(o=ne.treeContext,yn=qi(q.nextSibling),wr=l,Ut=!0,ha=null,Wi=!1,o!==null&&$S(l,o),l=t0(l,p.children),l.flags|=4096);return l}return y?(_a(),q=p.fallback,y=l.mode,ne=o.child,ve=ne.sibling,p=po(ne,{mode:"hidden",children:p.children}),p.subtreeFlags=ne.subtreeFlags&65011712,ve!==null?q=po(ve,q):(q=vl(q,y,h,null),q.flags|=2),q.return=l,p.return=l,p.sibling=q,l.child=p,dd(null,p),p=l.child,q=o.child.memoizedState,q===null?q=Jv(h):(y=q.cachePool,y!==null?(ne=Wn._currentValue,y=y.parent!==ne?{parent:ne,pool:ne}:y):y=GS(),q={baseLanes:q.baseLanes|h,cachePool:y}),p.memoizedState=q,p.childLanes=e0(o,N,h),l.memoizedState=Zv,dd(o.child,p)):(ba(l),h=o.child,o=h.sibling,h=po(h,{mode:"visible",children:p.children}),h.return=l,h.sibling=null,o!==null&&(N=l.deletions,N===null?(l.deletions=[o],l.flags|=16):N.push(o)),l.child=h,l.memoizedState=null,h)}function t0(o,l){return l=Of({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Of(o,l){return o=yi(22,o,null,l),o.lanes=0,o}function n0(o,l,h){return Cl(l,o.child,null,h),o=t0(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function a2(o,l,h){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),vv(o.return,l,h)}function r0(o,l,h,p,y,w){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:h,tailMode:y,treeForkCount:w}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=h,N.tailMode=y,N.treeForkCount=w)}function l2(o,l,h){var p=l.pendingProps,y=p.revealOrder,w=p.tail;p=p.children;var N=Pn.current,q=(N&2)!==0;if(q?(N=N&1|2,l.flags|=128):N&=1,T(Pn,N),kr(o,l,p,h),p=Ut?Zu:0,!q&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&a2(o,h,l);else if(o.tag===19)a2(o,h,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"forwards":for(h=l.child,y=null;h!==null;)o=h.alternate,o!==null&&xf(o)===null&&(y=h),h=h.sibling;h=y,h===null?(y=l.child,l.child=null):(y=h.sibling,h.sibling=null),r0(l,!1,y,h,w,p);break;case"backwards":case"unstable_legacy-backwards":for(h=null,y=l.child,l.child=null;y!==null;){if(o=y.alternate,o!==null&&xf(o)===null){l.child=y;break}o=y.sibling,y.sibling=h,h=y,y=o}r0(l,!0,h,null,w,p);break;case"together":r0(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function xo(o,l,h){if(o!==null&&(l.dependencies=o.dependencies),Sa|=l.lanes,(h&l.childLanes)===0)if(o!==null){if(Cc(o,l,h,!1),(h&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,h=po(o,o.pendingProps),l.child=h,h.return=l;o.sibling!==null;)o=o.sibling,h=h.sibling=po(o,o.pendingProps),h.return=l;h.sibling=null}return l.child}function i0(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&ff(o)))}function XO(o,l,h){switch(l.tag){case 3:ae(l,l.stateNode.containerInfo),ma(l,Wn,o.memoizedState.cache),bl();break;case 27:case 5:me(l);break;case 4:ae(l,l.stateNode.containerInfo);break;case 10:ma(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Mv(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(ba(l),l.flags|=128,null):(h&l.child.childLanes)!==0?o2(o,l,h):(ba(l),o=xo(o,l,h),o!==null?o.sibling:null);ba(l);break;case 19:var y=(o.flags&128)!==0;if(p=(h&l.childLanes)!==0,p||(Cc(o,l,h,!1),p=(h&l.childLanes)!==0),y){if(p)return l2(o,l,h);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),T(Pn,Pn.current),p)break;return null;case 22:return l.lanes=0,e2(o,l,h,l.pendingProps);case 24:ma(l,Wn,o.memoizedState.cache)}return xo(o,l,h)}function c2(o,l,h){if(o!==null)if(o.memoizedProps!==l.pendingProps)qn=!0;else{if(!i0(o,h)&&(l.flags&128)===0)return qn=!1,XO(o,l,h);qn=(o.flags&131072)!==0}else qn=!1,Ut&&(l.flags&1048576)!==0&&HS(l,Zu,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=Sl(l.elementType),l.type=o,typeof o=="function")cv(o)?(p=El(o,p),l.tag=1,l=i2(null,l,o,p,h)):(l.tag=0,l=Qv(null,l,o,p,h));else{if(o!=null){var y=o.$$typeof;if(y===M){l.tag=11,l=Qw(null,l,o,p,h);break e}else if(y===P){l.tag=14,l=Zw(null,l,o,p,h);break e}}throw l=U(o)||o,Error(r(306,l,""))}}return l;case 0:return Qv(o,l,l.type,l.pendingProps,h);case 1:return p=l.type,y=El(p,l.pendingProps),i2(o,l,p,y,h);case 3:e:{if(ae(l,l.stateNode.containerInfo),o===null)throw Error(r(387));p=l.pendingProps;var w=l.memoizedState;y=w.element,Cv(o,l),od(l,p,null,h);var N=l.memoizedState;if(p=N.cache,ma(l,Wn,p),p!==w.cache&&bv(l,[Wn],h,!0),sd(),p=N.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:N.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=s2(o,l,p,h);break e}else if(p!==y){y=Hi(Error(r(424)),l),Ju(y),l=s2(o,l,p,h);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(yn=qi(o.firstChild),wr=l,Ut=!0,ha=null,Wi=!0,h=ew(l,null,p,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(bl(),p===y){l=xo(o,l,h);break e}kr(o,l,p,h)}l=l.child}return l;case 26:return Df(o,l),o===null?(h=yC(l.type,null,l.pendingProps,null))?l.memoizedState=h:Ut||(h=l.type,o=l.pendingProps,p=Yf(J.current).createElement(h),p[pe]=l,p[de]=o,Er(p,h,o),nn(p),l.stateNode=p):l.memoizedState=yC(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return me(l),o===null&&Ut&&(p=l.stateNode=vC(l.type,l.pendingProps,J.current),wr=l,Wi=!0,y=yn,Ra(l.type)?(P0=y,yn=qi(p.firstChild)):yn=y),kr(o,l,l.pendingProps.children,h),Df(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&Ut&&((y=p=yn)&&(p=Ej(p,l.type,l.pendingProps,Wi),p!==null?(l.stateNode=p,wr=l,yn=qi(p.firstChild),Wi=!1,y=!0):y=!1),y||fa(l)),me(l),y=l.type,w=l.pendingProps,N=o!==null?o.memoizedProps:null,p=w.children,D0(y,w)?p=null:N!==null&&D0(y,N)&&(l.flags|=32),l.memoizedState!==null&&(y=Nv(o,l,HO,null,null,h),Ed._currentValue=y),Df(o,l),kr(o,l,p,h),l.child;case 6:return o===null&&Ut&&((o=h=yn)&&(h=Rj(h,l.pendingProps,Wi),h!==null?(l.stateNode=h,wr=l,yn=null,o=!0):o=!1),o||fa(l)),null;case 13:return o2(o,l,h);case 4:return ae(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=Cl(l,null,p,h):kr(o,l,p,h),l.child;case 11:return Qw(o,l,l.type,l.pendingProps,h);case 7:return kr(o,l,l.pendingProps,h),l.child;case 8:return kr(o,l,l.pendingProps.children,h),l.child;case 12:return kr(o,l,l.pendingProps.children,h),l.child;case 10:return p=l.pendingProps,ma(l,l.type,p.value),kr(o,l,p.children,h),l.child;case 9:return y=l.type._context,p=l.pendingProps.children,yl(l),y=Cr(y),p=p(y),l.flags|=1,kr(o,l,p,h),l.child;case 14:return Zw(o,l,l.type,l.pendingProps,h);case 15:return Jw(o,l,l.type,l.pendingProps,h);case 19:return l2(o,l,h);case 31:return YO(o,l,h);case 22:return e2(o,l,h,l.pendingProps);case 24:return yl(l),p=Cr(Wn),o===null?(y=xv(),y===null&&(y=cn,w=_v(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=h),y=w),l.memoizedState={parent:p,cache:y},wv(l),ma(l,Wn,y)):((o.lanes&h)!==0&&(Cv(o,l),od(l,null,null,h),sd()),y=o.memoizedState,w=l.memoizedState,y.parent!==p?(y={parent:p,cache:p},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),ma(l,Wn,p)):(p=w.cache,ma(l,Wn,p),p!==y.cache&&bv(l,[Wn],h,!0))),kr(o,l,l.pendingProps.children,h),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function So(o){o.flags|=4}function s0(o,l,h,p,y){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(I2())o.flags|=8192;else throw wl=vf,Sv}else o.flags&=-16777217}function u2(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!kC(l))if(I2())o.flags|=8192;else throw wl=vf,Sv}function jf(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?gt():536870912,o.lanes|=l,Ic|=l)}function hd(o,l){if(!Ut)switch(o.tailMode){case"hidden":l=o.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var p=null;h!==null;)h.alternate!==null&&(p=h),h=h.sibling;p===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null}}function xn(o){var l=o.alternate!==null&&o.alternate.child===o.child,h=0,p=0;if(l)for(var y=o.child;y!==null;)h|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)h|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=p,o.childLanes=h,l}function QO(o,l,h){var p=l.pendingProps;switch(fv(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(l),null;case 1:return xn(l),null;case 3:return h=l.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),bo(Wn),ue(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(wc(l)?So(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,pv())),xn(l),null;case 26:var y=l.type,w=l.memoizedState;return o===null?(So(l),w!==null?(xn(l),u2(l,w)):(xn(l),s0(l,y,null,p,h))):w?w!==o.memoizedState?(So(l),xn(l),u2(l,w)):(xn(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&So(l),xn(l),s0(l,y,o,p,h)),null;case 27:if(se(l),h=J.current,y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&So(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return xn(l),null}o=X.current,wc(l)?US(l):(o=vC(y,p,h),l.stateNode=o,So(l))}return xn(l),null;case 5:if(se(l),y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&So(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return xn(l),null}if(w=X.current,wc(l))US(l);else{var N=Yf(J.current);switch(w){case 1:w=N.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:w=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":w=N.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":w=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":w=N.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?N.createElement(y,{is:p.is}):N.createElement(y)}}w[pe]=l,w[de]=p;e:for(N=l.child;N!==null;){if(N.tag===5||N.tag===6)w.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===l)break e;for(;N.sibling===null;){if(N.return===null||N.return===l)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}l.stateNode=w;e:switch(Er(w,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&So(l)}}return xn(l),s0(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,h),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&So(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(o=J.current,wc(l)){if(o=l.stateNode,h=l.memoizedProps,p=null,y=wr,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}o[pe]=l,o=!!(o.nodeValue===h||p!==null&&p.suppressHydrationWarning===!0||oC(o.nodeValue,h)),o||fa(l,!0)}else o=Yf(o).createTextNode(p),o[pe]=l,l.stateNode=o}return xn(l),null;case 31:if(h=l.memoizedState,o===null||o.memoizedState!==null){if(p=wc(l),h!==null){if(o===null){if(!p)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[pe]=l}else bl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;xn(l),o=!1}else h=pv(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return l.flags&256?(Si(l),l):(Si(l),null);if((l.flags&128)!==0)throw Error(r(558))}return xn(l),null;case 13:if(p=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=wc(l),p!==null&&p.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[pe]=l}else bl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;xn(l),y=!1}else y=pv(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Si(l),l):(Si(l),null)}return Si(l),(l.flags&128)!==0?(l.lanes=h,l):(h=p!==null,o=o!==null&&o.memoizedState!==null,h&&(p=l.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),w=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==y&&(p.flags|=2048)),h!==o&&h&&(l.child.flags|=8192),jf(l,l.updateQueue),xn(l),null);case 4:return ue(),o===null&&R0(l.stateNode.containerInfo),xn(l),null;case 10:return bo(l.type),xn(l),null;case 19:if($(Pn),p=l.memoizedState,p===null)return xn(l),null;if(y=(l.flags&128)!==0,w=p.rendering,w===null)if(y)hd(p,!1);else{if(Dn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(w=xf(o),w!==null){for(l.flags|=128,hd(p,!1),o=w.updateQueue,l.updateQueue=o,jf(l,o),l.subtreeFlags=0,o=h,h=l.child;h!==null;)zS(h,o),h=h.sibling;return T(Pn,Pn.current&1|2),Ut&&go(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&tt()>Bf&&(l.flags|=128,y=!0,hd(p,!1),l.lanes=4194304)}else{if(!y)if(o=xf(w),o!==null){if(l.flags|=128,y=!0,o=o.updateQueue,l.updateQueue=o,jf(l,o),hd(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!Ut)return xn(l),null}else 2*tt()-p.renderingStartTime>Bf&&h!==536870912&&(l.flags|=128,y=!0,hd(p,!1),l.lanes=4194304);p.isBackwards?(w.sibling=l.child,l.child=w):(o=p.last,o!==null?o.sibling=w:l.child=w,p.last=w)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=tt(),o.sibling=null,h=Pn.current,T(Pn,y?h&1|2:h&1),Ut&&go(l,p.treeForkCount),o):(xn(l),null);case 22:case 23:return Si(l),Tv(),p=l.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(h&536870912)!==0&&(l.flags&128)===0&&(xn(l),l.subtreeFlags&6&&(l.flags|=8192)):xn(l),h=l.updateQueue,h!==null&&jf(l,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==h&&(l.flags|=2048),o!==null&&$(xl),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),bo(Wn),xn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function ZO(o,l){switch(fv(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return bo(Wn),ue(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return se(l),null;case 31:if(l.memoizedState!==null){if(Si(l),l.alternate===null)throw Error(r(340));bl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Si(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));bl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return $(Pn),null;case 4:return ue(),null;case 10:return bo(l.type),null;case 22:case 23:return Si(l),Tv(),o!==null&&$(xl),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return bo(Wn),null;case 25:return null;default:return null}}function d2(o,l){switch(fv(l),l.tag){case 3:bo(Wn),ue();break;case 26:case 27:case 5:se(l);break;case 4:ue();break;case 31:l.memoizedState!==null&&Si(l);break;case 13:Si(l);break;case 19:$(Pn);break;case 10:bo(l.type);break;case 22:case 23:Si(l),Tv(),o!==null&&$(xl);break;case 24:bo(Wn)}}function fd(o,l){try{var h=l.updateQueue,p=h!==null?h.lastEffect:null;if(p!==null){var y=p.next;h=y;do{if((h.tag&o)===o){p=void 0;var w=h.create,N=h.inst;p=w(),N.destroy=p}h=h.next}while(h!==y)}}catch(q){en(l,l.return,q)}}function ya(o,l,h){try{var p=l.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var w=y.next;p=w;do{if((p.tag&o)===o){var N=p.inst,q=N.destroy;if(q!==void 0){N.destroy=void 0,y=l;var ne=h,ve=q;try{ve()}catch(Ee){en(y,ne,Ee)}}}p=p.next}while(p!==w)}}catch(Ee){en(l,l.return,Ee)}}function h2(o){var l=o.updateQueue;if(l!==null){var h=o.stateNode;try{nw(l,h)}catch(p){en(o,o.return,p)}}}function f2(o,l,h){h.props=El(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(p){en(o,l,p)}}function md(o,l){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:p=o.stateNode;break;default:p=o.stateNode}typeof h=="function"?o.refCleanup=h(p):h.current=p}}catch(y){en(o,l,y)}}function Fs(o,l){var h=o.ref,p=o.refCleanup;if(h!==null)if(typeof p=="function")try{p()}catch(y){en(o,l,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(y){en(o,l,y)}else h.current=null}function m2(o){var l=o.type,h=o.memoizedProps,p=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":h.autoFocus&&p.focus();break e;case"img":h.src?p.src=h.src:h.srcSet&&(p.srcset=h.srcSet)}}catch(y){en(o,o.return,y)}}function o0(o,l,h){try{var p=o.stateNode;yj(p,o.type,h,l),p[de]=l}catch(y){en(o,o.return,y)}}function p2(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Ra(o.type)||o.tag===4}function a0(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||p2(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Ra(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function l0(o,l,h){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,l):(l=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,l.appendChild(o),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=Ar));else if(p!==4&&(p===27&&Ra(o.type)&&(h=o.stateNode,l=null),o=o.child,o!==null))for(l0(o,l,h),o=o.sibling;o!==null;)l0(o,l,h),o=o.sibling}function Lf(o,l,h){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?h.insertBefore(o,l):h.appendChild(o);else if(p!==4&&(p===27&&Ra(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(Lf(o,l,h),o=o.sibling;o!==null;)Lf(o,l,h),o=o.sibling}function g2(o){var l=o.stateNode,h=o.memoizedProps;try{for(var p=o.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Er(l,p,h),l[pe]=o,l[de]=h}catch(w){en(o,o.return,w)}}var wo=!1,Kn=!1,c0=!1,v2=typeof WeakSet=="function"?WeakSet:Set,ur=null;function JO(o,l){if(o=o.containerInfo,A0=nm,o=MS(o),nv(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var p=h.getSelection&&h.getSelection();if(p&&p.rangeCount!==0){h=p.anchorNode;var y=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{h.nodeType,w.nodeType}catch{h=null;break e}var N=0,q=-1,ne=-1,ve=0,Ee=0,Ne=o,_e=null;t:for(;;){for(var Se;Ne!==h||y!==0&&Ne.nodeType!==3||(q=N+y),Ne!==w||p!==0&&Ne.nodeType!==3||(ne=N+p),Ne.nodeType===3&&(N+=Ne.nodeValue.length),(Se=Ne.firstChild)!==null;)_e=Ne,Ne=Se;for(;;){if(Ne===o)break t;if(_e===h&&++ve===y&&(q=N),_e===w&&++Ee===p&&(ne=N),(Se=Ne.nextSibling)!==null)break;Ne=_e,_e=Ne.parentNode}Ne=Se}h=q===-1||ne===-1?null:{start:q,end:ne}}else h=null}h=h||{start:0,end:0}}else h=null;for(N0={focusedElem:o,selectionRange:h},nm=!1,ur=l;ur!==null;)if(l=ur,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,ur=o;else for(;ur!==null;){switch(l=ur,w=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)y=o[h],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&w!==null){o=void 0,h=l,y=w.memoizedProps,w=w.memoizedState,p=h.stateNode;try{var ot=El(h.type,y);o=p.getSnapshotBeforeUpdate(ot,w),p.__reactInternalSnapshotBeforeUpdate=o}catch(_t){en(h,h.return,_t)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,h=o.nodeType,h===9)j0(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":j0(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,ur=o;break}ur=l.return}}function b2(o,l,h){var p=h.flags;switch(h.tag){case 0:case 11:case 15:ko(o,h),p&4&&fd(5,h);break;case 1:if(ko(o,h),p&4)if(o=h.stateNode,l===null)try{o.componentDidMount()}catch(N){en(h,h.return,N)}else{var y=El(h.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(y,l,o.__reactInternalSnapshotBeforeUpdate)}catch(N){en(h,h.return,N)}}p&64&&h2(h),p&512&&md(h,h.return);break;case 3:if(ko(o,h),p&64&&(o=h.updateQueue,o!==null)){if(l=null,h.child!==null)switch(h.child.tag){case 27:case 5:l=h.child.stateNode;break;case 1:l=h.child.stateNode}try{nw(o,l)}catch(N){en(h,h.return,N)}}break;case 27:l===null&&p&4&&g2(h);case 26:case 5:ko(o,h),l===null&&p&4&&m2(h),p&512&&md(h,h.return);break;case 12:ko(o,h);break;case 31:ko(o,h),p&4&&x2(o,h);break;case 13:ko(o,h),p&4&&S2(o,h),p&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=lj.bind(null,h),Tj(o,h))));break;case 22:if(p=h.memoizedState!==null||wo,!p){l=l!==null&&l.memoizedState!==null||Kn,y=wo;var w=Kn;wo=p,(Kn=l)&&!w?Eo(o,h,(h.subtreeFlags&8772)!==0):ko(o,h),wo=y,Kn=w}break;case 30:break;default:ko(o,h)}}function _2(o){var l=o.alternate;l!==null&&(o.alternate=null,_2(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&tn(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Cn=null,ti=!1;function Co(o,l,h){for(h=h.child;h!==null;)y2(o,l,h),h=h.sibling}function y2(o,l,h){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(Xe,h)}catch{}switch(h.tag){case 26:Kn||Fs(h,l),Co(o,l,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Kn||Fs(h,l);var p=Cn,y=ti;Ra(h.type)&&(Cn=h.stateNode,ti=!1),Co(o,l,h),wd(h.stateNode),Cn=p,ti=y;break;case 5:Kn||Fs(h,l);case 6:if(p=Cn,y=ti,Cn=null,Co(o,l,h),Cn=p,ti=y,Cn!==null)if(ti)try{(Cn.nodeType===9?Cn.body:Cn.nodeName==="HTML"?Cn.ownerDocument.body:Cn).removeChild(h.stateNode)}catch(w){en(h,l,w)}else try{Cn.removeChild(h.stateNode)}catch(w){en(h,l,w)}break;case 18:Cn!==null&&(ti?(o=Cn,hC(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),Wc(o)):hC(Cn,h.stateNode));break;case 4:p=Cn,y=ti,Cn=h.stateNode.containerInfo,ti=!0,Co(o,l,h),Cn=p,ti=y;break;case 0:case 11:case 14:case 15:ya(2,h,l),Kn||ya(4,h,l),Co(o,l,h);break;case 1:Kn||(Fs(h,l),p=h.stateNode,typeof p.componentWillUnmount=="function"&&f2(h,l,p)),Co(o,l,h);break;case 21:Co(o,l,h);break;case 22:Kn=(p=Kn)||h.memoizedState!==null,Co(o,l,h),Kn=p;break;default:Co(o,l,h)}}function x2(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Wc(o)}catch(h){en(l,l.return,h)}}}function S2(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Wc(o)}catch(h){en(l,l.return,h)}}function ej(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new v2),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new v2),l;default:throw Error(r(435,o.tag))}}function If(o,l){var h=ej(o);l.forEach(function(p){if(!h.has(p)){h.add(p);var y=cj.bind(null,o,p);p.then(y,y)}})}function ni(o,l){var h=l.deletions;if(h!==null)for(var p=0;p<h.length;p++){var y=h[p],w=o,N=l,q=N;e:for(;q!==null;){switch(q.tag){case 27:if(Ra(q.type)){Cn=q.stateNode,ti=!1;break e}break;case 5:Cn=q.stateNode,ti=!1;break e;case 3:case 4:Cn=q.stateNode.containerInfo,ti=!0;break e}q=q.return}if(Cn===null)throw Error(r(160));y2(w,N,y),Cn=null,ti=!1,w=y.alternate,w!==null&&(w.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)w2(l,o),l=l.sibling}var ms=null;function w2(o,l){var h=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:ni(l,o),ri(o),p&4&&(ya(3,o,o.return),fd(3,o),ya(5,o,o.return));break;case 1:ni(l,o),ri(o),p&512&&(Kn||h===null||Fs(h,h.return)),p&64&&wo&&(o=o.updateQueue,o!==null&&(p=o.callbacks,p!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?p:h.concat(p))));break;case 26:var y=ms;if(ni(l,o),ri(o),p&512&&(Kn||h===null||Fs(h,h.return)),p&4){var w=h!==null?h.memoizedState:null;if(p=o.memoizedState,h===null)if(p===null)if(o.stateNode===null){e:{p=o.type,h=o.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":w=y.getElementsByTagName("title")[0],(!w||w[$n]||w[pe]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=y.createElement(p),y.head.insertBefore(w,y.querySelector("head > title"))),Er(w,p,h),w[pe]=o,nn(w),p=w;break e;case"link":var N=wC("link","href",y).get(p+(h.href||""));if(N){for(var q=0;q<N.length;q++)if(w=N[q],w.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&w.getAttribute("rel")===(h.rel==null?null:h.rel)&&w.getAttribute("title")===(h.title==null?null:h.title)&&w.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){N.splice(q,1);break t}}w=y.createElement(p),Er(w,p,h),y.head.appendChild(w);break;case"meta":if(N=wC("meta","content",y).get(p+(h.content||""))){for(q=0;q<N.length;q++)if(w=N[q],w.getAttribute("content")===(h.content==null?null:""+h.content)&&w.getAttribute("name")===(h.name==null?null:h.name)&&w.getAttribute("property")===(h.property==null?null:h.property)&&w.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&w.getAttribute("charset")===(h.charSet==null?null:h.charSet)){N.splice(q,1);break t}}w=y.createElement(p),Er(w,p,h),y.head.appendChild(w);break;default:throw Error(r(468,p))}w[pe]=o,nn(w),p=w}o.stateNode=p}else CC(y,o.type,o.stateNode);else o.stateNode=SC(y,p,o.memoizedProps);else w!==p?(w===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):w.count--,p===null?CC(y,o.type,o.stateNode):SC(y,p,o.memoizedProps)):p===null&&o.stateNode!==null&&o0(o,o.memoizedProps,h.memoizedProps)}break;case 27:ni(l,o),ri(o),p&512&&(Kn||h===null||Fs(h,h.return)),h!==null&&p&4&&o0(o,o.memoizedProps,h.memoizedProps);break;case 5:if(ni(l,o),ri(o),p&512&&(Kn||h===null||Fs(h,h.return)),o.flags&32){y=o.stateNode;try{gi(y,"")}catch(ot){en(o,o.return,ot)}}p&4&&o.stateNode!=null&&(y=o.memoizedProps,o0(o,y,h!==null?h.memoizedProps:y)),p&1024&&(c0=!0);break;case 6:if(ni(l,o),ri(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,h=o.stateNode;try{h.nodeValue=p}catch(ot){en(o,o.return,ot)}}break;case 3:if(Zf=null,y=ms,ms=Xf(l.containerInfo),ni(l,o),ms=y,ri(o),p&4&&h!==null&&h.memoizedState.isDehydrated)try{Wc(l.containerInfo)}catch(ot){en(o,o.return,ot)}c0&&(c0=!1,C2(o));break;case 4:p=ms,ms=Xf(o.stateNode.containerInfo),ni(l,o),ri(o),ms=p;break;case 12:ni(l,o),ri(o);break;case 31:ni(l,o),ri(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,If(o,p)));break;case 13:ni(l,o),ri(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(zf=tt()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,If(o,p)));break;case 22:y=o.memoizedState!==null;var ne=h!==null&&h.memoizedState!==null,ve=wo,Ee=Kn;if(wo=ve||y,Kn=Ee||ne,ni(l,o),Kn=Ee,wo=ve,ri(o),p&8192)e:for(l=o.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(h===null||ne||wo||Kn||Rl(o)),h=null,l=o;;){if(l.tag===5||l.tag===26){if(h===null){ne=h=l;try{if(w=ne.stateNode,y)N=w.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{q=ne.stateNode;var Ne=ne.memoizedProps.style,_e=Ne!=null&&Ne.hasOwnProperty("display")?Ne.display:null;q.style.display=_e==null||typeof _e=="boolean"?"":(""+_e).trim()}}catch(ot){en(ne,ne.return,ot)}}}else if(l.tag===6){if(h===null){ne=l;try{ne.stateNode.nodeValue=y?"":ne.memoizedProps}catch(ot){en(ne,ne.return,ot)}}}else if(l.tag===18){if(h===null){ne=l;try{var Se=ne.stateNode;y?fC(Se,!0):fC(ne.stateNode,!1)}catch(ot){en(ne,ne.return,ot)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;h===l&&(h=null),l=l.return}h===l&&(h=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=o.updateQueue,p!==null&&(h=p.retryQueue,h!==null&&(p.retryQueue=null,If(o,h))));break;case 19:ni(l,o),ri(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,If(o,p)));break;case 30:break;case 21:break;default:ni(l,o),ri(o)}}function ri(o){var l=o.flags;if(l&2){try{for(var h,p=o.return;p!==null;){if(p2(p)){h=p;break}p=p.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var y=h.stateNode,w=a0(o);Lf(o,w,y);break;case 5:var N=h.stateNode;h.flags&32&&(gi(N,""),h.flags&=-33);var q=a0(o);Lf(o,q,N);break;case 3:case 4:var ne=h.stateNode.containerInfo,ve=a0(o);l0(o,ve,ne);break;default:throw Error(r(161))}}catch(Ee){en(o,o.return,Ee)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function C2(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;C2(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function ko(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)b2(o,l.alternate,l),l=l.sibling}function Rl(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:ya(4,l,l.return),Rl(l);break;case 1:Fs(l,l.return);var h=l.stateNode;typeof h.componentWillUnmount=="function"&&f2(l,l.return,h),Rl(l);break;case 27:wd(l.stateNode);case 26:case 5:Fs(l,l.return),Rl(l);break;case 22:l.memoizedState===null&&Rl(l);break;case 30:Rl(l);break;default:Rl(l)}o=o.sibling}}function Eo(o,l,h){for(h=h&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,y=o,w=l,N=w.flags;switch(w.tag){case 0:case 11:case 15:Eo(y,w,h),fd(4,w);break;case 1:if(Eo(y,w,h),p=w,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ve){en(p,p.return,ve)}if(p=w,y=p.updateQueue,y!==null){var q=p.stateNode;try{var ne=y.shared.hiddenCallbacks;if(ne!==null)for(y.shared.hiddenCallbacks=null,y=0;y<ne.length;y++)tw(ne[y],q)}catch(ve){en(p,p.return,ve)}}h&&N&64&&h2(w),md(w,w.return);break;case 27:g2(w);case 26:case 5:Eo(y,w,h),h&&p===null&&N&4&&m2(w),md(w,w.return);break;case 12:Eo(y,w,h);break;case 31:Eo(y,w,h),h&&N&4&&x2(y,w);break;case 13:Eo(y,w,h),h&&N&4&&S2(y,w);break;case 22:w.memoizedState===null&&Eo(y,w,h),md(w,w.return);break;case 30:break;default:Eo(y,w,h)}l=l.sibling}}function u0(o,l){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&ed(h))}function d0(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&ed(o))}function ps(o,l,h,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)k2(o,l,h,p),l=l.sibling}function k2(o,l,h,p){var y=l.flags;switch(l.tag){case 0:case 11:case 15:ps(o,l,h,p),y&2048&&fd(9,l);break;case 1:ps(o,l,h,p);break;case 3:ps(o,l,h,p),y&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&ed(o)));break;case 12:if(y&2048){ps(o,l,h,p),o=l.stateNode;try{var w=l.memoizedProps,N=w.id,q=w.onPostCommit;typeof q=="function"&&q(N,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(ne){en(l,l.return,ne)}}else ps(o,l,h,p);break;case 31:ps(o,l,h,p);break;case 13:ps(o,l,h,p);break;case 23:break;case 22:w=l.stateNode,N=l.alternate,l.memoizedState!==null?w._visibility&2?ps(o,l,h,p):pd(o,l):w._visibility&2?ps(o,l,h,p):(w._visibility|=2,Oc(o,l,h,p,(l.subtreeFlags&10256)!==0||!1)),y&2048&&u0(N,l);break;case 24:ps(o,l,h,p),y&2048&&d0(l.alternate,l);break;default:ps(o,l,h,p)}}function Oc(o,l,h,p,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var w=o,N=l,q=h,ne=p,ve=N.flags;switch(N.tag){case 0:case 11:case 15:Oc(w,N,q,ne,y),fd(8,N);break;case 23:break;case 22:var Ee=N.stateNode;N.memoizedState!==null?Ee._visibility&2?Oc(w,N,q,ne,y):pd(w,N):(Ee._visibility|=2,Oc(w,N,q,ne,y)),y&&ve&2048&&u0(N.alternate,N);break;case 24:Oc(w,N,q,ne,y),y&&ve&2048&&d0(N.alternate,N);break;default:Oc(w,N,q,ne,y)}l=l.sibling}}function pd(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var h=o,p=l,y=p.flags;switch(p.tag){case 22:pd(h,p),y&2048&&u0(p.alternate,p);break;case 24:pd(h,p),y&2048&&d0(p.alternate,p);break;default:pd(h,p)}l=l.sibling}}var gd=8192;function jc(o,l,h){if(o.subtreeFlags&gd)for(o=o.child;o!==null;)E2(o,l,h),o=o.sibling}function E2(o,l,h){switch(o.tag){case 26:jc(o,l,h),o.flags&gd&&o.memoizedState!==null&&Fj(h,ms,o.memoizedState,o.memoizedProps);break;case 5:jc(o,l,h);break;case 3:case 4:var p=ms;ms=Xf(o.stateNode.containerInfo),jc(o,l,h),ms=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=gd,gd=16777216,jc(o,l,h),gd=p):jc(o,l,h));break;default:jc(o,l,h)}}function R2(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function vd(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var p=l[h];ur=p,M2(p,o)}R2(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)T2(o),o=o.sibling}function T2(o){switch(o.tag){case 0:case 11:case 15:vd(o),o.flags&2048&&ya(9,o,o.return);break;case 3:vd(o);break;case 12:vd(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Pf(o)):vd(o);break;default:vd(o)}}function Pf(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var p=l[h];ur=p,M2(p,o)}R2(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:ya(8,l,l.return),Pf(l);break;case 22:h=l.stateNode,h._visibility&2&&(h._visibility&=-3,Pf(l));break;default:Pf(l)}o=o.sibling}}function M2(o,l){for(;ur!==null;){var h=ur;switch(h.tag){case 0:case 11:case 15:ya(8,h,l);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var p=h.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:ed(h.memoizedState.cache)}if(p=h.child,p!==null)p.return=h,ur=p;else e:for(h=o;ur!==null;){p=ur;var y=p.sibling,w=p.return;if(_2(p),p===h){ur=null;break e}if(y!==null){y.return=w,ur=y;break e}ur=w}}}var tj={getCacheForType:function(o){var l=Cr(Wn),h=l.data.get(o);return h===void 0&&(h=o(),l.data.set(o,h)),h},cacheSignal:function(){return Cr(Wn).controller.signal}},nj=typeof WeakMap=="function"?WeakMap:Map,Gt=0,cn=null,It=null,Ht=0,Jt=0,wi=null,xa=!1,Lc=!1,h0=!1,Ro=0,Dn=0,Sa=0,Tl=0,f0=0,Ci=0,Ic=0,bd=null,ii=null,m0=!1,zf=0,A2=0,Bf=1/0,Ff=null,wa=null,nr=0,Ca=null,Pc=null,To=0,p0=0,g0=null,N2=null,_d=0,v0=null;function ki(){return(Gt&2)!==0&&Ht!==0?Ht&-Ht:j.T!==null?w0():bn()}function D2(){if(Ci===0)if((Ht&536870912)===0||Ut){var o=$e;$e<<=1,($e&3932160)===0&&($e=262144),Ci=o}else Ci=536870912;return o=xi.current,o!==null&&(o.flags|=32),Ci}function si(o,l,h){(o===cn&&(Jt===2||Jt===9)||o.cancelPendingCommit!==null)&&(zc(o,0),ka(o,Ht,Ci,!1)),wt(o,h),((Gt&2)===0||o!==cn)&&(o===cn&&((Gt&2)===0&&(Tl|=h),Dn===4&&ka(o,Ht,Ci,!1)),Hs(o))}function O2(o,l,h){if((Gt&6)!==0)throw Error(r(327));var p=!h&&(l&127)===0&&(l&o.expiredLanes)===0||Ie(o,l),y=p?sj(o,l):_0(o,l,!0),w=p;do{if(y===0){Lc&&!p&&ka(o,l,0,!1);break}else{if(h=o.current.alternate,w&&!rj(h)){y=_0(o,l,!1),w=!1;continue}if(y===2){if(w=l,o.errorRecoveryDisabledLanes&w)var N=0;else N=o.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){l=N;e:{var q=o;y=bd;var ne=q.current.memoizedState.isDehydrated;if(ne&&(zc(q,N).flags|=256),N=_0(q,N,!1),N!==2){if(h0&&!ne){q.errorRecoveryDisabledLanes|=w,Tl|=w,y=4;break e}w=ii,ii=y,w!==null&&(ii===null?ii=w:ii.push.apply(ii,w))}y=N}if(w=!1,y!==2)continue}}if(y===1){zc(o,0),ka(o,l,0,!0);break}e:{switch(p=o,w=y,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:ka(p,l,Ci,!xa);break e;case 2:ii=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(y=zf+300-tt(),10<y)){if(ka(p,l,Ci,!xa),ye(p,0,!0)!==0)break e;To=l,p.timeoutHandle=uC(j2.bind(null,p,h,ii,Ff,m0,l,Ci,Tl,Ic,xa,w,"Throttled",-0,0),y);break e}j2(p,h,ii,Ff,m0,l,Ci,Tl,Ic,xa,w,null,-0,0)}}break}while(!0);Hs(o)}function j2(o,l,h,p,y,w,N,q,ne,ve,Ee,Ne,_e,Se){if(o.timeoutHandle=-1,Ne=l.subtreeFlags,Ne&8192||(Ne&16785408)===16785408){Ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ar},E2(l,w,Ne);var ot=(w&62914560)===w?zf-tt():(w&4194048)===w?A2-tt():0;if(ot=Hj(Ne,ot),ot!==null){To=w,o.cancelPendingCommit=ot($2.bind(null,o,l,w,h,p,y,N,q,ne,Ee,Ne,null,_e,Se)),ka(o,w,N,!ve);return}}$2(o,l,w,h,p,y,N,q,ne)}function rj(o){for(var l=o;;){var h=l.tag;if((h===0||h===11||h===15)&&l.flags&16384&&(h=l.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var p=0;p<h.length;p++){var y=h[p],w=y.getSnapshot;y=y.value;try{if(!_i(w(),y))return!1}catch{return!1}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function ka(o,l,h,p){l&=~f0,l&=~Tl,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var y=l;0<y;){var w=31-rt(y),N=1<<w;p[w]=-1,y&=~N}h!==0&&Qt(o,h,l)}function Hf(){return(Gt&6)===0?(yd(0),!1):!0}function b0(){if(It!==null){if(Jt===0)var o=It.return;else o=It,vo=_l=null,jv(o),Tc=null,nd=0,o=It;for(;o!==null;)d2(o.alternate,o),o=o.return;It=null}}function zc(o,l){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,wj(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),To=0,b0(),cn=o,It=h=po(o.current,null),Ht=l,Jt=0,wi=null,xa=!1,Lc=Ie(o,l),h0=!1,Ic=Ci=f0=Tl=Sa=Dn=0,ii=bd=null,m0=!1,(l&8)!==0&&(l|=l&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=l;0<p;){var y=31-rt(p),w=1<<y;l|=o[y],p&=~w}return Ro=l,lf(),h}function L2(o,l){Rt=null,j.H=ud,l===Rc||l===gf?(l=QS(),Jt=3):l===Sv?(l=QS(),Jt=4):Jt=l===Xv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,wi=l,It===null&&(Dn=1,Af(o,Hi(l,o.current)))}function I2(){var o=xi.current;return o===null?!0:(Ht&4194048)===Ht?Vi===null:(Ht&62914560)===Ht||(Ht&536870912)!==0?o===Vi:!1}function P2(){var o=j.H;return j.H=ud,o===null?ud:o}function z2(){var o=j.A;return j.A=tj,o}function $f(){Dn=4,xa||(Ht&4194048)!==Ht&&xi.current!==null||(Lc=!0),(Sa&134217727)===0&&(Tl&134217727)===0||cn===null||ka(cn,Ht,Ci,!1)}function _0(o,l,h){var p=Gt;Gt|=2;var y=P2(),w=z2();(cn!==o||Ht!==l)&&(Ff=null,zc(o,l)),l=!1;var N=Dn;e:do try{if(Jt!==0&&It!==null){var q=It,ne=wi;switch(Jt){case 8:b0(),N=6;break e;case 3:case 2:case 9:case 6:xi.current===null&&(l=!0);var ve=Jt;if(Jt=0,wi=null,Bc(o,q,ne,ve),h&&Lc){N=0;break e}break;default:ve=Jt,Jt=0,wi=null,Bc(o,q,ne,ve)}}ij(),N=Dn;break}catch(Ee){L2(o,Ee)}while(!0);return l&&o.shellSuspendCounter++,vo=_l=null,Gt=p,j.H=y,j.A=w,It===null&&(cn=null,Ht=0,lf()),N}function ij(){for(;It!==null;)B2(It)}function sj(o,l){var h=Gt;Gt|=2;var p=P2(),y=z2();cn!==o||Ht!==l?(Ff=null,Bf=tt()+500,zc(o,l)):Lc=Ie(o,l);e:do try{if(Jt!==0&&It!==null){l=It;var w=wi;t:switch(Jt){case 1:Jt=0,wi=null,Bc(o,l,w,1);break;case 2:case 9:if(YS(w)){Jt=0,wi=null,F2(l);break}l=function(){Jt!==2&&Jt!==9||cn!==o||(Jt=7),Hs(o)},w.then(l,l);break e;case 3:Jt=7;break e;case 4:Jt=5;break e;case 7:YS(w)?(Jt=0,wi=null,F2(l)):(Jt=0,wi=null,Bc(o,l,w,7));break;case 5:var N=null;switch(It.tag){case 26:N=It.memoizedState;case 5:case 27:var q=It;if(N?kC(N):q.stateNode.complete){Jt=0,wi=null;var ne=q.sibling;if(ne!==null)It=ne;else{var ve=q.return;ve!==null?(It=ve,Uf(ve)):It=null}break t}}Jt=0,wi=null,Bc(o,l,w,5);break;case 6:Jt=0,wi=null,Bc(o,l,w,6);break;case 8:b0(),Dn=6;break e;default:throw Error(r(462))}}oj();break}catch(Ee){L2(o,Ee)}while(!0);return vo=_l=null,j.H=p,j.A=y,Gt=h,It!==null?0:(cn=null,Ht=0,lf(),Dn)}function oj(){for(;It!==null&&!Ye();)B2(It)}function B2(o){var l=c2(o.alternate,o,Ro);o.memoizedProps=o.pendingProps,l===null?Uf(o):It=l}function F2(o){var l=o,h=l.alternate;switch(l.tag){case 15:case 0:l=r2(h,l,l.pendingProps,l.type,void 0,Ht);break;case 11:l=r2(h,l,l.pendingProps,l.type.render,l.ref,Ht);break;case 5:jv(l);default:d2(h,l),l=It=zS(l,Ro),l=c2(h,l,Ro)}o.memoizedProps=o.pendingProps,l===null?Uf(o):It=l}function Bc(o,l,h,p){vo=_l=null,jv(l),Tc=null,nd=0;var y=l.return;try{if(GO(o,y,l,h,Ht)){Dn=1,Af(o,Hi(h,o.current)),It=null;return}}catch(w){if(y!==null)throw It=y,w;Dn=1,Af(o,Hi(h,o.current)),It=null;return}l.flags&32768?(Ut||p===1?o=!0:Lc||(Ht&536870912)!==0?o=!1:(xa=o=!0,(p===2||p===9||p===3||p===6)&&(p=xi.current,p!==null&&p.tag===13&&(p.flags|=16384))),H2(l,o)):Uf(l)}function Uf(o){var l=o;do{if((l.flags&32768)!==0){H2(l,xa);return}o=l.return;var h=QO(l.alternate,l,Ro);if(h!==null){It=h;return}if(l=l.sibling,l!==null){It=l;return}It=l=o}while(l!==null);Dn===0&&(Dn=5)}function H2(o,l){do{var h=ZO(o.alternate,o);if(h!==null){h.flags&=32767,It=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!l&&(o=o.sibling,o!==null)){It=o;return}It=o=h}while(o!==null);Dn=6,It=null}function $2(o,l,h,p,y,w,N,q,ne){o.cancelPendingCommit=null;do Wf();while(nr!==0);if((Gt&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=av,xt(o,h,w,N,q,ne),o===cn&&(It=cn=null,Ht=0),Pc=l,Ca=o,To=h,p0=w,g0=y,N2=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,uj(Ue,function(){return K2(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=j.T,j.T=null,y=G.p,G.p=2,N=Gt,Gt|=4;try{JO(o,l,h)}finally{Gt=N,G.p=y,j.T=p}}nr=1,U2(),W2(),V2()}}function U2(){if(nr===1){nr=0;var o=Ca,l=Pc,h=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||h){h=j.T,j.T=null;var p=G.p;G.p=2;var y=Gt;Gt|=4;try{w2(l,o);var w=N0,N=MS(o.containerInfo),q=w.focusedElem,ne=w.selectionRange;if(N!==q&&q&&q.ownerDocument&&TS(q.ownerDocument.documentElement,q)){if(ne!==null&&nv(q)){var ve=ne.start,Ee=ne.end;if(Ee===void 0&&(Ee=ve),"selectionStart"in q)q.selectionStart=ve,q.selectionEnd=Math.min(Ee,q.value.length);else{var Ne=q.ownerDocument||document,_e=Ne&&Ne.defaultView||window;if(_e.getSelection){var Se=_e.getSelection(),ot=q.textContent.length,_t=Math.min(ne.start,ot),on=ne.end===void 0?_t:Math.min(ne.end,ot);!Se.extend&&_t>on&&(N=on,on=_t,_t=N);var fe=RS(q,_t),le=RS(q,on);if(fe&&le&&(Se.rangeCount!==1||Se.anchorNode!==fe.node||Se.anchorOffset!==fe.offset||Se.focusNode!==le.node||Se.focusOffset!==le.offset)){var ge=Ne.createRange();ge.setStart(fe.node,fe.offset),Se.removeAllRanges(),_t>on?(Se.addRange(ge),Se.extend(le.node,le.offset)):(ge.setEnd(le.node,le.offset),Se.addRange(ge))}}}}for(Ne=[],Se=q;Se=Se.parentNode;)Se.nodeType===1&&Ne.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<Ne.length;q++){var Me=Ne[q];Me.element.scrollLeft=Me.left,Me.element.scrollTop=Me.top}}nm=!!A0,N0=A0=null}finally{Gt=y,G.p=p,j.T=h}}o.current=l,nr=2}}function W2(){if(nr===2){nr=0;var o=Ca,l=Pc,h=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||h){h=j.T,j.T=null;var p=G.p;G.p=2;var y=Gt;Gt|=4;try{b2(o,l.alternate,l)}finally{Gt=y,G.p=p,j.T=h}}nr=3}}function V2(){if(nr===4||nr===3){nr=0,Ze();var o=Ca,l=Pc,h=To,p=N2;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?nr=5:(nr=0,Pc=Ca=null,q2(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(wa=null),Zt(h),l=l.stateNode,ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot(Xe,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=j.T,y=G.p,G.p=2,j.T=null;try{for(var w=o.onRecoverableError,N=0;N<p.length;N++){var q=p[N];w(q.value,{componentStack:q.stack})}}finally{j.T=l,G.p=y}}(To&3)!==0&&Wf(),Hs(o),y=o.pendingLanes,(h&261930)!==0&&(y&42)!==0?o===v0?_d++:(_d=0,v0=o):_d=0,yd(0)}}function q2(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,ed(l)))}function Wf(){return U2(),W2(),V2(),K2()}function K2(){if(nr!==5)return!1;var o=Ca,l=p0;p0=0;var h=Zt(To),p=j.T,y=G.p;try{G.p=32>h?32:h,j.T=null,h=g0,g0=null;var w=Ca,N=To;if(nr=0,Pc=Ca=null,To=0,(Gt&6)!==0)throw Error(r(331));var q=Gt;if(Gt|=4,T2(w.current),k2(w,w.current,N,h),Gt=q,yd(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(Xe,w)}catch{}return!0}finally{G.p=y,j.T=p,q2(o,l)}}function G2(o,l,h){l=Hi(h,l),l=Yv(o.stateNode,l,2),o=va(o,l,2),o!==null&&(wt(o,2),Hs(o))}function en(o,l,h){if(o.tag===3)G2(o,o,h);else for(;l!==null;){if(l.tag===3){G2(l,o,h);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(wa===null||!wa.has(p))){o=Hi(h,o),h=Yw(2),p=va(l,h,2),p!==null&&(Xw(h,p,l,o),wt(p,2),Hs(p));break}}l=l.return}}function y0(o,l,h){var p=o.pingCache;if(p===null){p=o.pingCache=new nj;var y=new Set;p.set(l,y)}else y=p.get(l),y===void 0&&(y=new Set,p.set(l,y));y.has(h)||(h0=!0,y.add(h),o=aj.bind(null,o,l,h),l.then(o,o))}function aj(o,l,h){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,cn===o&&(Ht&h)===h&&(Dn===4||Dn===3&&(Ht&62914560)===Ht&&300>tt()-zf?(Gt&2)===0&&zc(o,0):f0|=h,Ic===Ht&&(Ic=0)),Hs(o)}function Y2(o,l){l===0&&(l=gt()),o=gl(o,l),o!==null&&(wt(o,l),Hs(o))}function lj(o){var l=o.memoizedState,h=0;l!==null&&(h=l.retryLane),Y2(o,h)}function cj(o,l){var h=0;switch(o.tag){case 31:case 13:var p=o.stateNode,y=o.memoizedState;y!==null&&(h=y.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(l),Y2(o,h)}function uj(o,l){return Ke(o,l)}var Vf=null,Fc=null,x0=!1,qf=!1,S0=!1,Ea=0;function Hs(o){o!==Fc&&o.next===null&&(Fc===null?Vf=Fc=o:Fc=Fc.next=o),qf=!0,x0||(x0=!0,hj())}function yd(o,l){if(!S0&&qf){S0=!0;do for(var h=!1,p=Vf;p!==null;){if(o!==0){var y=p.pendingLanes;if(y===0)var w=0;else{var N=p.suspendedLanes,q=p.pingedLanes;w=(1<<31-rt(42|o)+1)-1,w&=y&~(N&~q),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(h=!0,J2(p,w))}else w=Ht,w=ye(p,p===cn?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||Ie(p,w)||(h=!0,J2(p,w));p=p.next}while(h);S0=!1}}function dj(){X2()}function X2(){qf=x0=!1;var o=0;Ea!==0&&Sj()&&(o=Ea);for(var l=tt(),h=null,p=Vf;p!==null;){var y=p.next,w=Q2(p,l);w===0?(p.next=null,h===null?Vf=y:h.next=y,y===null&&(Fc=h)):(h=p,(o!==0||(w&3)!==0)&&(qf=!0)),p=y}nr!==0&&nr!==5||yd(o),Ea!==0&&(Ea=0)}function Q2(o,l){for(var h=o.suspendedLanes,p=o.pingedLanes,y=o.expirationTimes,w=o.pendingLanes&-62914561;0<w;){var N=31-rt(w),q=1<<N,ne=y[N];ne===-1?((q&h)===0||(q&p)!==0)&&(y[N]=Qe(q,l)):ne<=l&&(o.expiredLanes|=q),w&=~q}if(l=cn,h=Ht,h=ye(o,o===l?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,h===0||o===l&&(Jt===2||Jt===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&mt(p),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||Ie(o,h)){if(l=h&-h,l===o.callbackPriority)return l;switch(p!==null&&mt(p),Zt(h)){case 2:case 8:h=Re;break;case 32:h=Ue;break;case 268435456:h=Ve;break;default:h=Ue}return p=Z2.bind(null,o),h=Ke(h,p),o.callbackPriority=l,o.callbackNode=h,l}return p!==null&&p!==null&&mt(p),o.callbackPriority=2,o.callbackNode=null,2}function Z2(o,l){if(nr!==0&&nr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(Wf()&&o.callbackNode!==h)return null;var p=Ht;return p=ye(o,o===cn?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(O2(o,p,l),Q2(o,tt()),o.callbackNode!=null&&o.callbackNode===h?Z2.bind(null,o):null)}function J2(o,l){if(Wf())return null;O2(o,l,!0)}function hj(){Cj(function(){(Gt&6)!==0?Ke(ce,dj):X2()})}function w0(){if(Ea===0){var o=kc;o===0&&(o=Be,Be<<=1,(Be&261888)===0&&(Be=256)),Ea=o}return Ea}function eC(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:ls(""+o)}function tC(o,l){var h=l.ownerDocument.createElement("input");return h.name=l.name,h.value=l.value,o.id&&h.setAttribute("form",o.id),l.parentNode.insertBefore(h,l),o=new FormData(o),h.parentNode.removeChild(h),o}function fj(o,l,h,p,y){if(l==="submit"&&h&&h.stateNode===y){var w=eC((y[de]||null).action),N=p.submitter;N&&(l=(l=N[de]||null)?eC(l.formAction):N.getAttribute("formAction"),l!==null&&(w=l,N=null));var q=new ds("action","action",null,p,y);o.push({event:q,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Ea!==0){var ne=N?tC(y,N):new FormData(y);Uv(h,{pending:!0,data:ne,method:y.method,action:w},null,ne)}}else typeof w=="function"&&(q.preventDefault(),ne=N?tC(y,N):new FormData(y),Uv(h,{pending:!0,data:ne,method:y.method,action:w},w,ne))},currentTarget:y}]})}}for(var C0=0;C0<ov.length;C0++){var k0=ov[C0],mj=k0.toLowerCase(),pj=k0[0].toUpperCase()+k0.slice(1);fs(mj,"on"+pj)}fs(DS,"onAnimationEnd"),fs(OS,"onAnimationIteration"),fs(jS,"onAnimationStart"),fs("dblclick","onDoubleClick"),fs("focusin","onFocus"),fs("focusout","onBlur"),fs(NO,"onTransitionRun"),fs(DO,"onTransitionStart"),fs(OO,"onTransitionCancel"),fs(LS,"onTransitionEnd"),Un("onMouseEnter",["mouseout","mouseover"]),Un("onMouseLeave",["mouseout","mouseover"]),Un("onPointerEnter",["pointerout","pointerover"]),Un("onPointerLeave",["pointerout","pointerover"]),Jr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xd="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(" "),gj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xd));function nC(o,l){l=(l&4)!==0;for(var h=0;h<o.length;h++){var p=o[h],y=p.event;p=p.listeners;e:{var w=void 0;if(l)for(var N=p.length-1;0<=N;N--){var q=p[N],ne=q.instance,ve=q.currentTarget;if(q=q.listener,ne!==w&&y.isPropagationStopped())break e;w=q,y.currentTarget=ve;try{w(y)}catch(Ee){af(Ee)}y.currentTarget=null,w=ne}else for(N=0;N<p.length;N++){if(q=p[N],ne=q.instance,ve=q.currentTarget,q=q.listener,ne!==w&&y.isPropagationStopped())break e;w=q,y.currentTarget=ve;try{w(y)}catch(Ee){af(Ee)}y.currentTarget=null,w=ne}}}}function Pt(o,l){var h=l[Et];h===void 0&&(h=l[Et]=new Set);var p=o+"__bubble";h.has(p)||(rC(l,o,2,!1),h.add(p))}function E0(o,l,h){var p=0;l&&(p|=4),rC(h,o,p,l)}var Kf="_reactListening"+Math.random().toString(36).slice(2);function R0(o){if(!o[Kf]){o[Kf]=!0,Fr.forEach(function(h){h!=="selectionchange"&&(gj.has(h)||E0(h,!1,o),E0(h,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Kf]||(l[Kf]=!0,E0("selectionchange",!1,l))}}function rC(o,l,h,p){switch(DC(l)){case 2:var y=Wj;break;case 8:y=Vj;break;default:y=$0}h=y.bind(null,l,h,o),y=void 0,!Os||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),p?y!==void 0?o.addEventListener(l,h,{capture:!0,passive:y}):o.addEventListener(l,h,!0):y!==void 0?o.addEventListener(l,h,{passive:y}):o.addEventListener(l,h,!1)}function T0(o,l,h,p,y){var w=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var N=p.tag;if(N===3||N===4){var q=p.stateNode.containerInfo;if(q===y)break;if(N===4)for(N=p.return;N!==null;){var ne=N.tag;if((ne===3||ne===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;q!==null;){if(N=er(q),N===null)return;if(ne=N.tag,ne===5||ne===6||ne===26||ne===27){p=w=N;continue e}q=q.parentNode}}p=p.return}ho(function(){var ve=w,Ee=Ms(h),Ne=[];e:{var _e=IS.get(o);if(_e!==void 0){var Se=ds,ot=o;switch(o){case"keypress":if(ia(h)===0)break e;case"keydown":case"keyup":Se=cO;break;case"focusin":ot="focus",Se=Ps;break;case"focusout":ot="blur",Se=Ps;break;case"beforeblur":case"afterblur":Se=Ps;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=mo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=la;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=hO;break;case DS:case OS:case jS:Se=Mt;break;case LS:Se=mO;break;case"scroll":case"scrollend":Se=oa;break;case"wheel":Se=gO;break;case"copy":case"cut":case"paste":Se=Dr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=fS;break;case"toggle":case"beforetoggle":Se=bO}var _t=(l&4)!==0,on=!_t&&(o==="scroll"||o==="scrollend"),fe=_t?_e!==null?_e+"Capture":null:_e;_t=[];for(var le=ve,ge;le!==null;){var Me=le;if(ge=Me.stateNode,Me=Me.tag,Me!==5&&Me!==26&&Me!==27||ge===null||fe===null||(Me=Ds(le,fe),Me!=null&&_t.push(Sd(le,Me,ge))),on)break;le=le.return}0<_t.length&&(_e=new Se(_e,ot,null,h,Ee),Ne.push({event:_e,listeners:_t}))}}if((l&7)===0){e:{if(_e=o==="mouseover"||o==="pointerover",Se=o==="mouseout"||o==="pointerout",_e&&h!==ra&&(ot=h.relatedTarget||h.fromElement)&&(er(ot)||ot[Oe]))break e;if((Se||_e)&&(_e=Ee.window===Ee?Ee:(_e=Ee.ownerDocument)?_e.defaultView||_e.parentWindow:window,Se?(ot=h.relatedTarget||h.toElement,Se=ve,ot=ot?er(ot):null,ot!==null&&(on=s(ot),_t=ot.tag,ot!==on||_t!==5&&_t!==27&&_t!==6)&&(ot=null)):(Se=null,ot=ve),Se!==ot)){if(_t=mo,Me="onMouseLeave",fe="onMouseEnter",le="mouse",(o==="pointerout"||o==="pointerover")&&(_t=fS,Me="onPointerLeave",fe="onPointerEnter",le="pointer"),on=Se==null?_e:Br(Se),ge=ot==null?_e:Br(ot),_e=new _t(Me,le+"leave",Se,h,Ee),_e.target=on,_e.relatedTarget=ge,Me=null,er(Ee)===ve&&(_t=new _t(fe,le+"enter",ot,h,Ee),_t.target=ge,_t.relatedTarget=on,Me=_t),on=Me,Se&&ot)t:{for(_t=vj,fe=Se,le=ot,ge=0,Me=fe;Me;Me=_t(Me))ge++;Me=0;for(var pt=le;pt;pt=_t(pt))Me++;for(;0<ge-Me;)fe=_t(fe),ge--;for(;0<Me-ge;)le=_t(le),Me--;for(;ge--;){if(fe===le||le!==null&&fe===le.alternate){_t=fe;break t}fe=_t(fe),le=_t(le)}_t=null}else _t=null;Se!==null&&iC(Ne,_e,Se,_t,!1),ot!==null&&on!==null&&iC(Ne,on,ot,_t,!0)}}e:{if(_e=ve?Br(ve):window,Se=_e.nodeName&&_e.nodeName.toLowerCase(),Se==="select"||Se==="input"&&_e.type==="file")var qt=xS;else if(_S(_e))if(SS)qt=TO;else{qt=EO;var dt=kO}else Se=_e.nodeName,!Se||Se.toLowerCase()!=="input"||_e.type!=="checkbox"&&_e.type!=="radio"?ve&&Ts(ve.elementType)&&(qt=xS):qt=RO;if(qt&&(qt=qt(o,ve))){yS(Ne,qt,h,Ee);break e}dt&&dt(o,_e,ve),o==="focusout"&&ve&&_e.type==="number"&&ve.memoizedProps.value!=null&&dl(_e,"number",_e.value)}switch(dt=ve?Br(ve):window,o){case"focusin":(_S(dt)||dt.contentEditable==="true")&&(vc=dt,rv=ve,Qu=null);break;case"focusout":Qu=rv=vc=null;break;case"mousedown":iv=!0;break;case"contextmenu":case"mouseup":case"dragend":iv=!1,AS(Ne,h,Ee);break;case"selectionchange":if(AO)break;case"keydown":case"keyup":AS(Ne,h,Ee)}var At;if(Jg)e:{switch(o){case"compositionstart":var $t="onCompositionStart";break e;case"compositionend":$t="onCompositionEnd";break e;case"compositionupdate":$t="onCompositionUpdate";break e}$t=void 0}else gc?vS(o,h)&&($t="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&($t="onCompositionStart");$t&&(mS&&h.locale!=="ko"&&(gc||$t!=="onCompositionStart"?$t==="onCompositionEnd"&&gc&&(At=mc()):(bi=Ee,js="value"in bi?bi.value:bi.textContent,gc=!0)),dt=Gf(ve,$t),0<dt.length&&($t=new zi($t,o,null,h,Ee),Ne.push({event:$t,listeners:dt}),At?$t.data=At:(At=bS(h),At!==null&&($t.data=At)))),(At=yO?xO(o,h):SO(o,h))&&($t=Gf(ve,"onBeforeInput"),0<$t.length&&(dt=new zi("onBeforeInput","beforeinput",null,h,Ee),Ne.push({event:dt,listeners:$t}),dt.data=At)),fj(Ne,o,ve,h,Ee)}nC(Ne,l)})}function Sd(o,l,h){return{instance:o,listener:l,currentTarget:h}}function Gf(o,l){for(var h=l+"Capture",p=[];o!==null;){var y=o,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=Ds(o,h),y!=null&&p.unshift(Sd(o,y,w)),y=Ds(o,l),y!=null&&p.push(Sd(o,y,w))),o.tag===3)return p;o=o.return}return[]}function vj(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function iC(o,l,h,p,y){for(var w=l._reactName,N=[];h!==null&&h!==p;){var q=h,ne=q.alternate,ve=q.stateNode;if(q=q.tag,ne!==null&&ne===p)break;q!==5&&q!==26&&q!==27||ve===null||(ne=ve,y?(ve=Ds(h,w),ve!=null&&N.unshift(Sd(h,ve,ne))):y||(ve=Ds(h,w),ve!=null&&N.push(Sd(h,ve,ne)))),h=h.return}N.length!==0&&o.push({event:l,listeners:N})}var bj=/\r\n?/g,_j=/\u0000|\uFFFD/g;function sC(o){return(typeof o=="string"?o:""+o).replace(bj,`
|
|
50
|
+
`).replace(_j,"")}function oC(o,l){return l=sC(l),sC(o)===l}function sn(o,l,h,p,y,w){switch(h){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||gi(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&gi(o,""+p);break;case"className":we(o,"class",p);break;case"tabIndex":we(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":we(o,h,p);break;case"style":co(o,p,w);break;case"data":if(l!=="object"){we(o,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||h!=="href")){o.removeAttribute(h);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(h);break}p=ls(""+p),o.setAttribute(h,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(h,"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 w=="function"&&(h==="formAction"?(l!=="input"&&sn(o,l,"name",y.name,y,null),sn(o,l,"formEncType",y.formEncType,y,null),sn(o,l,"formMethod",y.formMethod,y,null),sn(o,l,"formTarget",y.formTarget,y,null)):(sn(o,l,"encType",y.encType,y,null),sn(o,l,"method",y.method,y,null),sn(o,l,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(h);break}p=ls(""+p),o.setAttribute(h,p);break;case"onClick":p!=null&&(o.onclick=Ar);break;case"onScroll":p!=null&&Pt("scroll",o);break;case"onScrollEnd":p!=null&&Pt("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(h=p.__html,h!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}h=ls(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(h,""+p):o.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":p===!0?o.setAttribute(h,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(h,p):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(h,p):o.removeAttribute(h);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(h):o.setAttribute(h,p);break;case"popover":Pt("beforetoggle",o),Pt("toggle",o),be(o,"popover",p);break;case"xlinkActuate":Te(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Te(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Te(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Te(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Te(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Te(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Te(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Te(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Te(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":be(o,"is",p);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=hc.get(h)||h,be(o,h,p))}}function M0(o,l,h,p,y,w){switch(h){case"style":co(o,p,w);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(h=p.__html,h!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"children":typeof p=="string"?gi(o,p):(typeof p=="number"||typeof p=="bigint")&&gi(o,""+p);break;case"onScroll":p!=null&&Pt("scroll",o);break;case"onScrollEnd":p!=null&&Pt("scrollend",o);break;case"onClick":p!=null&&(o.onclick=Ar);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xr.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(y=h.endsWith("Capture"),l=h.slice(2,y?h.length-7:void 0),w=o[de]||null,w=w!=null?w[h]:null,typeof w=="function"&&o.removeEventListener(l,w,y),typeof p=="function")){typeof w!="function"&&w!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(l,p,y);break e}h in o?o[h]=p:p===!0?o.setAttribute(h,""):be(o,h,p)}}}function Er(o,l,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pt("error",o),Pt("load",o);var p=!1,y=!1,w;for(w in h)if(h.hasOwnProperty(w)){var N=h[w];if(N!=null)switch(w){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:sn(o,l,w,N,h,null)}}y&&sn(o,l,"srcSet",h.srcSet,h,null),p&&sn(o,l,"src",h.src,h,null);return;case"input":Pt("invalid",o);var q=w=N=y=null,ne=null,ve=null;for(p in h)if(h.hasOwnProperty(p)){var Ee=h[p];if(Ee!=null)switch(p){case"name":y=Ee;break;case"type":N=Ee;break;case"checked":ne=Ee;break;case"defaultChecked":ve=Ee;break;case"value":w=Ee;break;case"defaultValue":q=Ee;break;case"children":case"dangerouslySetInnerHTML":if(Ee!=null)throw Error(r(137,l));break;default:sn(o,l,p,Ee,h,null)}}uc(o,w,q,ne,ve,N,y,!1);return;case"select":Pt("invalid",o),p=N=w=null;for(y in h)if(h.hasOwnProperty(y)&&(q=h[y],q!=null))switch(y){case"value":w=q;break;case"defaultValue":N=q;break;case"multiple":p=q;default:sn(o,l,y,q,h,null)}l=w,h=N,o.multiple=!!p,l!=null?pi(o,!!p,l,!1):h!=null&&pi(o,!!p,h,!0);return;case"textarea":Pt("invalid",o),w=y=p=null;for(N in h)if(h.hasOwnProperty(N)&&(q=h[N],q!=null))switch(N){case"value":p=q;break;case"defaultValue":y=q;break;case"children":w=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(91));break;default:sn(o,l,N,q,h,null)}hl(o,p,y,w);return;case"option":for(ne in h)if(h.hasOwnProperty(ne)&&(p=h[ne],p!=null))switch(ne){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:sn(o,l,ne,p,h,null)}return;case"dialog":Pt("beforetoggle",o),Pt("toggle",o),Pt("cancel",o),Pt("close",o);break;case"iframe":case"object":Pt("load",o);break;case"video":case"audio":for(p=0;p<xd.length;p++)Pt(xd[p],o);break;case"image":Pt("error",o),Pt("load",o);break;case"details":Pt("toggle",o);break;case"embed":case"source":case"link":Pt("error",o),Pt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ve in h)if(h.hasOwnProperty(ve)&&(p=h[ve],p!=null))switch(ve){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:sn(o,l,ve,p,h,null)}return;default:if(Ts(l)){for(Ee in h)h.hasOwnProperty(Ee)&&(p=h[Ee],p!==void 0&&M0(o,l,Ee,p,h,void 0));return}}for(q in h)h.hasOwnProperty(q)&&(p=h[q],p!=null&&sn(o,l,q,p,h,null))}function yj(o,l,h,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,w=null,N=null,q=null,ne=null,ve=null,Ee=null;for(Se in h){var Ne=h[Se];if(h.hasOwnProperty(Se)&&Ne!=null)switch(Se){case"checked":break;case"value":break;case"defaultValue":ne=Ne;default:p.hasOwnProperty(Se)||sn(o,l,Se,null,p,Ne)}}for(var _e in p){var Se=p[_e];if(Ne=h[_e],p.hasOwnProperty(_e)&&(Se!=null||Ne!=null))switch(_e){case"type":w=Se;break;case"name":y=Se;break;case"checked":ve=Se;break;case"defaultChecked":Ee=Se;break;case"value":N=Se;break;case"defaultValue":q=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(r(137,l));break;default:Se!==Ne&&sn(o,l,_e,Se,p,Ne)}}Rs(o,N,q,ne,ve,Ee,w,y);return;case"select":Se=N=q=_e=null;for(w in h)if(ne=h[w],h.hasOwnProperty(w)&&ne!=null)switch(w){case"value":break;case"multiple":Se=ne;default:p.hasOwnProperty(w)||sn(o,l,w,null,p,ne)}for(y in p)if(w=p[y],ne=h[y],p.hasOwnProperty(y)&&(w!=null||ne!=null))switch(y){case"value":_e=w;break;case"defaultValue":q=w;break;case"multiple":N=w;default:w!==ne&&sn(o,l,y,w,p,ne)}l=q,h=N,p=Se,_e!=null?pi(o,!!h,_e,!1):!!p!=!!h&&(l!=null?pi(o,!!h,l,!0):pi(o,!!h,h?[]:"",!1));return;case"textarea":Se=_e=null;for(q in h)if(y=h[q],h.hasOwnProperty(q)&&y!=null&&!p.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:sn(o,l,q,null,p,y)}for(N in p)if(y=p[N],w=h[N],p.hasOwnProperty(N)&&(y!=null||w!=null))switch(N){case"value":_e=y;break;case"defaultValue":Se=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==w&&sn(o,l,N,y,p,w)}ao(o,_e,Se);return;case"option":for(var ot in h)if(_e=h[ot],h.hasOwnProperty(ot)&&_e!=null&&!p.hasOwnProperty(ot))switch(ot){case"selected":o.selected=!1;break;default:sn(o,l,ot,null,p,_e)}for(ne in p)if(_e=p[ne],Se=h[ne],p.hasOwnProperty(ne)&&_e!==Se&&(_e!=null||Se!=null))switch(ne){case"selected":o.selected=_e&&typeof _e!="function"&&typeof _e!="symbol";break;default:sn(o,l,ne,_e,p,Se)}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 _t in h)_e=h[_t],h.hasOwnProperty(_t)&&_e!=null&&!p.hasOwnProperty(_t)&&sn(o,l,_t,null,p,_e);for(ve in p)if(_e=p[ve],Se=h[ve],p.hasOwnProperty(ve)&&_e!==Se&&(_e!=null||Se!=null))switch(ve){case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(r(137,l));break;default:sn(o,l,ve,_e,p,Se)}return;default:if(Ts(l)){for(var on in h)_e=h[on],h.hasOwnProperty(on)&&_e!==void 0&&!p.hasOwnProperty(on)&&M0(o,l,on,void 0,p,_e);for(Ee in p)_e=p[Ee],Se=h[Ee],!p.hasOwnProperty(Ee)||_e===Se||_e===void 0&&Se===void 0||M0(o,l,Ee,_e,p,Se);return}}for(var fe in h)_e=h[fe],h.hasOwnProperty(fe)&&_e!=null&&!p.hasOwnProperty(fe)&&sn(o,l,fe,null,p,_e);for(Ne in p)_e=p[Ne],Se=h[Ne],!p.hasOwnProperty(Ne)||_e===Se||_e==null&&Se==null||sn(o,l,Ne,_e,p,Se)}function aC(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xj(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,h=performance.getEntriesByType("resource"),p=0;p<h.length;p++){var y=h[p],w=y.transferSize,N=y.initiatorType,q=y.duration;if(w&&q&&aC(N)){for(N=0,q=y.responseEnd,p+=1;p<h.length;p++){var ne=h[p],ve=ne.startTime;if(ve>q)break;var Ee=ne.transferSize,Ne=ne.initiatorType;Ee&&aC(Ne)&&(ne=ne.responseEnd,N+=Ee*(ne<q?1:(q-ve)/(ne-ve)))}if(--p,l+=8*(w+N)/(y.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var A0=null,N0=null;function Yf(o){return o.nodeType===9?o:o.ownerDocument}function lC(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cC(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function D0(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var O0=null;function Sj(){var o=window.event;return o&&o.type==="popstate"?o===O0?!1:(O0=o,!0):(O0=null,!1)}var uC=typeof setTimeout=="function"?setTimeout:void 0,wj=typeof clearTimeout=="function"?clearTimeout:void 0,dC=typeof Promise=="function"?Promise:void 0,Cj=typeof queueMicrotask=="function"?queueMicrotask:typeof dC<"u"?function(o){return dC.resolve(null).then(o).catch(kj)}:uC;function kj(o){setTimeout(function(){throw o})}function Ra(o){return o==="head"}function hC(o,l){var h=l,p=0;do{var y=h.nextSibling;if(o.removeChild(h),y&&y.nodeType===8)if(h=y.data,h==="/$"||h==="/&"){if(p===0){o.removeChild(y),Wc(l);return}p--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")p++;else if(h==="html")wd(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,wd(h);for(var w=h.firstChild;w;){var N=w.nextSibling,q=w.nodeName;w[$n]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&w.rel.toLowerCase()==="stylesheet"||h.removeChild(w),w=N}}else h==="body"&&wd(o.ownerDocument.body);h=y}while(h);Wc(l)}function fC(o,l){var h=o;o=0;do{var p=h.nextSibling;if(h.nodeType===1?l?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(l?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),p&&p.nodeType===8)if(h=p.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=p}while(h)}function j0(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var h=l;switch(l=l.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":j0(h),tn(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function Ej(o,l,h,p){for(;o.nodeType===1;){var y=h;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[$n])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(w=o.getAttribute("rel"),w==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(w!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(w=o.getAttribute("src"),(w!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===w)return o}else return o;if(o=qi(o.nextSibling),o===null)break}return null}function Rj(o,l,h){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=qi(o.nextSibling),o===null))return null;return o}function mC(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=qi(o.nextSibling),o===null))return null;return o}function L0(o){return o.data==="$?"||o.data==="$~"}function I0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function Tj(o,l){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||h.readyState!=="loading")l();else{var p=function(){l(),h.removeEventListener("DOMContentLoaded",p)};h.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function qi(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var P0=null;function pC(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(l===0)return qi(o.nextSibling);l--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||l++}o=o.nextSibling}return null}function gC(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(l===0)return o;l--}else h!=="/$"&&h!=="/&"||l++}o=o.previousSibling}return null}function vC(o,l,h){switch(l=Yf(h),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function wd(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);tn(o)}var Ki=new Map,bC=new Set;function Xf(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Mo=G.d;G.d={f:Mj,r:Aj,D:Nj,C:Dj,L:Oj,m:jj,X:Ij,S:Lj,M:Pj};function Mj(){var o=Mo.f(),l=Hf();return o||l}function Aj(o){var l=lr(o);l!==null&&l.tag===5&&l.type==="form"?Lw(l):Mo.r(o)}var Hc=typeof document>"u"?null:document;function _C(o,l,h){var p=Hc;if(p&&typeof l=="string"&&l){var y=tr(l);y='link[rel="'+o+'"][href="'+y+'"]',typeof h=="string"&&(y+='[crossorigin="'+h+'"]'),bC.has(y)||(bC.add(y),o={rel:o,crossOrigin:h,href:l},p.querySelector(y)===null&&(l=p.createElement("link"),Er(l,"link",o),nn(l),p.head.appendChild(l)))}}function Nj(o){Mo.D(o),_C("dns-prefetch",o,null)}function Dj(o,l){Mo.C(o,l),_C("preconnect",o,l)}function Oj(o,l,h){Mo.L(o,l,h);var p=Hc;if(p&&o&&l){var y='link[rel="preload"][as="'+tr(l)+'"]';l==="image"&&h&&h.imageSrcSet?(y+='[imagesrcset="'+tr(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(y+='[imagesizes="'+tr(h.imageSizes)+'"]')):y+='[href="'+tr(o)+'"]';var w=y;switch(l){case"style":w=$c(o);break;case"script":w=Uc(o)}Ki.has(w)||(o=m({rel:"preload",href:l==="image"&&h&&h.imageSrcSet?void 0:o,as:l},h),Ki.set(w,o),p.querySelector(y)!==null||l==="style"&&p.querySelector(Cd(w))||l==="script"&&p.querySelector(kd(w))||(l=p.createElement("link"),Er(l,"link",o),nn(l),p.head.appendChild(l)))}}function jj(o,l){Mo.m(o,l);var h=Hc;if(h&&o){var p=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+tr(p)+'"][href="'+tr(o)+'"]',w=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Uc(o)}if(!Ki.has(w)&&(o=m({rel:"modulepreload",href:o},l),Ki.set(w,o),h.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(kd(w)))return}p=h.createElement("link"),Er(p,"link",o),nn(p),h.head.appendChild(p)}}}function Lj(o,l,h){Mo.S(o,l,h);var p=Hc;if(p&&o){var y=Rn(p).hoistableStyles,w=$c(o);l=l||"default";var N=y.get(w);if(!N){var q={loading:0,preload:null};if(N=p.querySelector(Cd(w)))q.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":l},h),(h=Ki.get(w))&&z0(o,h);var ne=N=p.createElement("link");nn(ne),Er(ne,"link",o),ne._p=new Promise(function(ve,Ee){ne.onload=ve,ne.onerror=Ee}),ne.addEventListener("load",function(){q.loading|=1}),ne.addEventListener("error",function(){q.loading|=2}),q.loading|=4,Qf(N,l,p)}N={type:"stylesheet",instance:N,count:1,state:q},y.set(w,N)}}}function Ij(o,l){Mo.X(o,l);var h=Hc;if(h&&o){var p=Rn(h).hoistableScripts,y=Uc(o),w=p.get(y);w||(w=h.querySelector(kd(y)),w||(o=m({src:o,async:!0},l),(l=Ki.get(y))&&B0(o,l),w=h.createElement("script"),nn(w),Er(w,"link",o),h.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(y,w))}}function Pj(o,l){Mo.M(o,l);var h=Hc;if(h&&o){var p=Rn(h).hoistableScripts,y=Uc(o),w=p.get(y);w||(w=h.querySelector(kd(y)),w||(o=m({src:o,async:!0,type:"module"},l),(l=Ki.get(y))&&B0(o,l),w=h.createElement("script"),nn(w),Er(w,"link",o),h.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(y,w))}}function yC(o,l,h,p){var y=(y=J.current)?Xf(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(l=$c(h.href),h=Rn(y).hoistableStyles,p=h.get(l),p||(p={type:"style",instance:null,count:0,state:null},h.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=$c(h.href);var w=Rn(y).hoistableStyles,N=w.get(o);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(o,N),(w=y.querySelector(Cd(o)))&&!w._p&&(N.instance=w,N.state.loading=5),Ki.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Ki.set(o,h),w||zj(y,o,h,N.state))),l&&p===null)throw Error(r(528,""));return N}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=h.async,h=h.src,typeof h=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Uc(h),h=Rn(y).hoistableScripts,p=h.get(l),p||(p={type:"script",instance:null,count:0,state:null},h.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function $c(o){return'href="'+tr(o)+'"'}function Cd(o){return'link[rel="stylesheet"]['+o+"]"}function xC(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function zj(o,l,h,p){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=o.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Er(l,"link",h),nn(l),o.head.appendChild(l))}function Uc(o){return'[src="'+tr(o)+'"]'}function kd(o){return"script[async]"+o}function SC(o,l,h){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+tr(h.href)+'"]');if(p)return l.instance=p,nn(p),p;var y=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),nn(p),Er(p,"style",y),Qf(p,h.precedence,o),l.instance=p;case"stylesheet":y=$c(h.href);var w=o.querySelector(Cd(y));if(w)return l.state.loading|=4,l.instance=w,nn(w),w;p=xC(h),(y=Ki.get(y))&&z0(p,y),w=(o.ownerDocument||o).createElement("link"),nn(w);var N=w;return N._p=new Promise(function(q,ne){N.onload=q,N.onerror=ne}),Er(w,"link",p),l.state.loading|=4,Qf(w,h.precedence,o),l.instance=w;case"script":return w=Uc(h.src),(y=o.querySelector(kd(w)))?(l.instance=y,nn(y),y):(p=h,(y=Ki.get(w))&&(p=m({},h),B0(p,y)),o=o.ownerDocument||o,y=o.createElement("script"),nn(y),Er(y,"link",p),o.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,Qf(p,h.precedence,o));return l.instance}function Qf(o,l,h){for(var p=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,w=y,N=0;N<p.length;N++){var q=p[N];if(q.dataset.precedence===l)w=q;else if(w!==y)break}w?w.parentNode.insertBefore(o,w.nextSibling):(l=h.nodeType===9?h.head:h,l.insertBefore(o,l.firstChild))}function z0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function B0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Zf=null;function wC(o,l,h){if(Zf===null){var p=new Map,y=Zf=new Map;y.set(h,p)}else y=Zf,p=y.get(h),p||(p=new Map,y.set(h,p));if(p.has(o))return p;for(p.set(o,null),h=h.getElementsByTagName(o),y=0;y<h.length;y++){var w=h[y];if(!(w[$n]||w[pe]||o==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var N=w.getAttribute(l)||"";N=o+N;var q=p.get(N);q?q.push(w):p.set(N,[w])}}return p}function CC(o,l,h){o=o.ownerDocument||o,o.head.insertBefore(h,l==="title"?o.querySelector("head > title"):null)}function Bj(o,l,h){if(h===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return o=l.disabled,typeof l.precedence=="string"&&o==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function kC(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function Fj(o,l,h,p){if(h.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var y=$c(p.href),w=l.querySelector(Cd(y));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=Jf.bind(o),l.then(o,o)),h.state.loading|=4,h.instance=w,nn(w);return}w=l.ownerDocument||l,p=xC(p),(y=Ki.get(y))&&z0(p,y),w=w.createElement("link"),nn(w);var N=w;N._p=new Promise(function(q,ne){N.onload=q,N.onerror=ne}),Er(w,"link",p),h.instance=w}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,l),(l=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=Jf.bind(o),l.addEventListener("load",h),l.addEventListener("error",h))}}var F0=0;function Hj(o,l){return o.stylesheets&&o.count===0&&tm(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var p=setTimeout(function(){if(o.stylesheets&&tm(o,o.stylesheets),o.unsuspend){var w=o.unsuspend;o.unsuspend=null,w()}},6e4+l);0<o.imgBytes&&F0===0&&(F0=62500*xj());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&tm(o,o.stylesheets),o.unsuspend)){var w=o.unsuspend;o.unsuspend=null,w()}},(o.imgBytes>F0?50:800)+l);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tm(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var em=null;function tm(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,em=new Map,l.forEach($j,o),em=null,Jf.call(o))}function $j(o,l){if(!(l.state.loading&4)){var h=em.get(o);if(h)var p=h.get(null);else{h=new Map,em.set(o,h);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var N=y[w];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(h.set(N.dataset.precedence,N),p=N)}p&&h.set(null,p)}y=l.instance,N=y.getAttribute("data-precedence"),w=h.get(N)||p,w===p&&h.set(null,y),h.set(N,y),this.count++,p=Jf.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),w?w.parentNode.insertBefore(y,w.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),l.state.loading|=4}}var Ed={$$typeof:R,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function Uj(o,l,h,p,y,w,N,q,ne){this.tag=1,this.containerInfo=o,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=Wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wt(0),this.hiddenUpdates=Wt(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function EC(o,l,h,p,y,w,N,q,ne,ve,Ee,Ne){return o=new Uj(o,l,h,N,ne,ve,Ee,Ne,q),l=1,w===!0&&(l|=24),w=yi(3,null,null,l),o.current=w,w.stateNode=o,l=_v(),l.refCount++,o.pooledCache=l,l.refCount++,w.memoizedState={element:p,isDehydrated:h,cache:l},wv(w),o}function RC(o){return o?(o=yc,o):yc}function TC(o,l,h,p,y,w){y=RC(y),p.context===null?p.context=y:p.pendingContext=y,p=ga(l),p.payload={element:h},w=w===void 0?null:w,w!==null&&(p.callback=w),h=va(o,p,l),h!==null&&(si(h,o,l),id(h,o,l))}function MC(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<l?h:l}}function H0(o,l){MC(o,l),(o=o.alternate)&&MC(o,l)}function AC(o){if(o.tag===13||o.tag===31){var l=gl(o,67108864);l!==null&&si(l,o,67108864),H0(o,67108864)}}function NC(o){if(o.tag===13||o.tag===31){var l=ki();l=wn(l);var h=gl(o,l);h!==null&&si(h,o,l),H0(o,l)}}var nm=!0;function Wj(o,l,h,p){var y=j.T;j.T=null;var w=G.p;try{G.p=2,$0(o,l,h,p)}finally{G.p=w,j.T=y}}function Vj(o,l,h,p){var y=j.T;j.T=null;var w=G.p;try{G.p=8,$0(o,l,h,p)}finally{G.p=w,j.T=y}}function $0(o,l,h,p){if(nm){var y=U0(p);if(y===null)T0(o,l,p,rm,h),OC(o,p);else if(Kj(y,o,l,h,p))p.stopPropagation();else if(OC(o,p),l&4&&-1<qj.indexOf(o)){for(;y!==null;){var w=lr(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var N=Fe(w.pendingLanes);if(N!==0){var q=w;for(q.pendingLanes|=2,q.entangledLanes|=2;N;){var ne=1<<31-rt(N);q.entanglements[1]|=ne,N&=~ne}Hs(w),(Gt&6)===0&&(Bf=tt()+500,yd(0))}}break;case 31:case 13:q=gl(w,2),q!==null&&si(q,w,2),Hf(),H0(w,2)}if(w=U0(p),w===null&&T0(o,l,p,rm,h),w===y)break;y=w}y!==null&&p.stopPropagation()}else T0(o,l,p,null,h)}}function U0(o){return o=Ms(o),W0(o)}var rm=null;function W0(o){if(rm=null,o=er(o),o!==null){var l=s(o);if(l===null)o=null;else{var h=l.tag;if(h===13){if(o=a(l),o!==null)return o;o=null}else if(h===31){if(o=c(l),o!==null)return o;o=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return rm=o,null}function DC(o){switch(o){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(it()){case ce:return 2;case Re:return 8;case Ue:case Je:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var V0=!1,Ta=null,Ma=null,Aa=null,Rd=new Map,Td=new Map,Na=[],qj="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 OC(o,l){switch(o){case"focusin":case"focusout":Ta=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Aa=null;break;case"pointerover":case"pointerout":Rd.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Td.delete(l.pointerId)}}function Md(o,l,h,p,y,w){return o===null||o.nativeEvent!==w?(o={blockedOn:l,domEventName:h,eventSystemFlags:p,nativeEvent:w,targetContainers:[y]},l!==null&&(l=lr(l),l!==null&&AC(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),o)}function Kj(o,l,h,p,y){switch(l){case"focusin":return Ta=Md(Ta,o,l,h,p,y),!0;case"dragenter":return Ma=Md(Ma,o,l,h,p,y),!0;case"mouseover":return Aa=Md(Aa,o,l,h,p,y),!0;case"pointerover":var w=y.pointerId;return Rd.set(w,Md(Rd.get(w)||null,o,l,h,p,y)),!0;case"gotpointercapture":return w=y.pointerId,Td.set(w,Md(Td.get(w)||null,o,l,h,p,y)),!0}return!1}function jC(o){var l=er(o.target);if(l!==null){var h=s(l);if(h!==null){if(l=h.tag,l===13){if(l=a(h),l!==null){o.blockedOn=l,Hn(o.priority,function(){NC(h)});return}}else if(l===31){if(l=c(h),l!==null){o.blockedOn=l,Hn(o.priority,function(){NC(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function im(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var h=U0(o.nativeEvent);if(h===null){h=o.nativeEvent;var p=new h.constructor(h.type,h);ra=p,h.target.dispatchEvent(p),ra=null}else return l=lr(h),l!==null&&AC(l),o.blockedOn=h,!1;l.shift()}return!0}function LC(o,l,h){im(o)&&h.delete(l)}function Gj(){V0=!1,Ta!==null&&im(Ta)&&(Ta=null),Ma!==null&&im(Ma)&&(Ma=null),Aa!==null&&im(Aa)&&(Aa=null),Rd.forEach(LC),Td.forEach(LC)}function sm(o,l){o.blockedOn===l&&(o.blockedOn=null,V0||(V0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gj)))}var om=null;function IC(o){om!==o&&(om=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){om===o&&(om=null);for(var l=0;l<o.length;l+=3){var h=o[l],p=o[l+1],y=o[l+2];if(typeof p!="function"){if(W0(p||h)===null)continue;break}var w=lr(h);w!==null&&(o.splice(l,3),l-=3,Uv(w,{pending:!0,data:y,method:h.method,action:p},p,y))}}))}function Wc(o){function l(ne){return sm(ne,o)}Ta!==null&&sm(Ta,o),Ma!==null&&sm(Ma,o),Aa!==null&&sm(Aa,o),Rd.forEach(l),Td.forEach(l);for(var h=0;h<Na.length;h++){var p=Na[h];p.blockedOn===o&&(p.blockedOn=null)}for(;0<Na.length&&(h=Na[0],h.blockedOn===null);)jC(h),h.blockedOn===null&&Na.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(p=0;p<h.length;p+=3){var y=h[p],w=h[p+1],N=y[de]||null;if(typeof w=="function")N||IC(h);else if(N){var q=null;if(w&&w.hasAttribute("formAction")){if(y=w,N=w[de]||null)q=N.formAction;else if(W0(y)!==null)continue}else q=N.action;typeof q=="function"?h[p+1]=q:(h.splice(p,3),p-=3),IC(h)}}}function PC(){function o(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(N){return y=N})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),p||setTimeout(h,20)}function h(){if(!p&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(h,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function q0(o){this._internalRoot=o}am.prototype.render=q0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var h=l.current,p=ki();TC(h,p,o,l,null,null)},am.prototype.unmount=q0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;TC(o.current,2,null,o,null,null),Hf(),l[Oe]=null}};function am(o){this._internalRoot=o}am.prototype.unstable_scheduleHydration=function(o){if(o){var l=bn();o={blockedOn:null,target:o,priority:l};for(var h=0;h<Na.length&&l!==0&&l<Na[h].priority;h++);Na.splice(h,0,o),h===0&&jC(o)}};var zC=e.version;if(zC!=="19.2.4")throw Error(r(527,zC,"19.2.4"));G.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=u(l),o=o!==null?f(o):null,o=o===null?null:o.stateNode,o};var Yj={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lm.isDisabled&&lm.supportsFiber)try{Xe=lm.inject(Yj),ut=lm}catch{}}return Dd.createRoot=function(o,l){if(!i(o))throw Error(r(299));var h=!1,p="",y=Vw,w=qw,N=Kw;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError)),l=EC(o,1,!1,null,null,h,p,null,y,w,N,PC),o[Oe]=l.current,R0(o),new q0(l)},Dd.hydrateRoot=function(o,l,h){if(!i(o))throw Error(r(299));var p=!1,y="",w=Vw,N=qw,q=Kw,ne=null;return h!=null&&(h.unstable_strictMode===!0&&(p=!0),h.identifierPrefix!==void 0&&(y=h.identifierPrefix),h.onUncaughtError!==void 0&&(w=h.onUncaughtError),h.onCaughtError!==void 0&&(N=h.onCaughtError),h.onRecoverableError!==void 0&&(q=h.onRecoverableError),h.formState!==void 0&&(ne=h.formState)),l=EC(o,1,!0,l,h??null,p,y,ne,w,N,q,PC),l.context=RC(null),h=l.current,p=ki(),p=wn(p),y=ga(p),y.callback=null,va(h,y,p),h=p,l.current.lanes=h,wt(l,h),Hs(l),o[Oe]=l.current,R0(o),new am(l)},Dd.version="19.2.4",Dd}var ZC;function aL(){if(ZC)return G0.exports;ZC=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),G0.exports=oL(),G0.exports}var lL=aL(),_=ng();const je=tg(_),kR=Jj({__proto__:null,default:je},[_]);/**
|
|
51
|
+
* react-router v7.13.2
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Remix Software Inc.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
+
*
|
|
58
|
+
* @license MIT
|
|
59
|
+
*/var JC="popstate";function ek(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function cL(t={}){function e(r,i){var u;let s=(u=i.state)==null?void 0:u.masked,{pathname:a,search:c,hash:d}=s||r.location;return _1("",{pathname:a,search:c,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:gh(i)}return dL(e,n,null,t)}function kn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function rs(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function uL(){return Math.random().toString(36).substring(2,10)}function tk(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function _1(t,e,n=null,r,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Ru(e):e,state:n,key:e&&e.key||r||uL(),unstable_mask:i}}function gh({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ru(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function dL(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,c="POP",d=null,u=f();u==null&&(u=0,a.replaceState({...a.state,idx:u},""));function f(){return(a.state||{idx:null}).idx}function m(){c="POP";let C=f(),k=C==null?null:C-u;u=C,d&&d({action:c,location:x.location,delta:k})}function v(C,k){c="PUSH";let E=ek(C)?C:_1(x.location,C,k);u=f()+1;let R=tk(E,u),M=x.createHref(E.unstable_mask||E);try{a.pushState(R,"",M)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(M)}s&&d&&d({action:c,location:x.location,delta:1})}function b(C,k){c="REPLACE";let E=ek(C)?C:_1(x.location,C,k);u=f();let R=tk(E,u),M=x.createHref(E.unstable_mask||E);a.replaceState(R,"",M),s&&d&&d({action:c,location:x.location,delta:0})}function S(C){return hL(C)}let x={get action(){return c},get location(){return t(i,a)},listen(C){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(JC,m),d=C,()=>{i.removeEventListener(JC,m),d=null}},createHref(C){return e(i,C)},createURL:S,encodeLocation(C){let k=S(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:v,replace:b,go(C){return a.go(C)}};return x}function hL(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),kn(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:gh(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function ER(t,e,n="/"){return fL(t,e,n,!1)}function fL(t,e,n,r){let i=typeof e=="string"?Ru(e):e,s=Vo(i.pathname||"/",n);if(s==null)return null;let a=RR(t);mL(a);let c=null;for(let d=0;c==null&&d<a.length;++d){let u=kL(s);c=wL(a[d],u,r)}return c}function RR(t,e=[],n=[],r="",i=!1){let s=(a,c,d=i,u)=>{let f={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:c,route:a};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&d)return;kn(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let m=Zs([r,f.relativePath]),v=n.concat(f);a.children&&a.children.length>0&&(kn(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),RR(a.children,e,v,m,d)),!(a.path==null&&!a.index)&&e.push({path:m,score:xL(m,a.index),routesMeta:v})};return t.forEach((a,c)=>{var d;if(a.path===""||!((d=a.path)!=null&&d.includes("?")))s(a,c);else for(let u of TR(a.path))s(a,c,!0,u)}),e}function TR(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=TR(r.join("/")),c=[];return c.push(...a.map(d=>d===""?s:[s,d].join("/"))),i&&c.push(...a),c.map(d=>t.startsWith("/")&&d===""?"/":d)}function mL(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:SL(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var pL=/^:[\w-]+$/,gL=3,vL=2,bL=1,_L=10,yL=-2,nk=t=>t==="*";function xL(t,e){let n=t.split("/"),r=n.length;return n.some(nk)&&(r+=yL),e&&(r+=vL),n.filter(i=>!nk(i)).reduce((i,s)=>i+(pL.test(s)?gL:s===""?bL:_L),r)}function SL(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function wL(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",a=[];for(let c=0;c<r.length;++c){let d=r[c],u=c===r.length-1,f=s==="/"?e:e.slice(s.length)||"/",m=vp({path:d.relativePath,caseSensitive:d.caseSensitive,end:u},f),v=d.route;if(!m&&u&&n&&!r[r.length-1].route.index&&(m=vp({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},f)),!m)return null;Object.assign(i,m.params),a.push({params:i,pathname:Zs([s,m.pathname]),pathnameBase:ML(Zs([s,m.pathnameBase])),route:v}),m.pathnameBase!=="/"&&(s=Zs([s,m.pathnameBase]))}return a}function vp(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=CL(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:r.reduce((u,{paramName:f,isOptional:m},v)=>{if(f==="*"){let S=c[v]||"";a=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const b=c[v];return m&&!b?u[f]=void 0:u[f]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:t}}function CL(t,e=!1,n=!0){rs(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,c,d,u,f)=>{if(r.push({paramName:c,isOptional:d!=null}),d){let m=f.charAt(u+a.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function kL(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return rs(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function Vo(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var EL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function RL(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Ru(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=rk(n.substring(1),"/"):s=rk(n,e)):s=e,{pathname:s,search:AL(r),hash:NL(i)}}function rk(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function J0(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` 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 TL(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function fy(t){let e=TL(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function rg(t,e,n,r=!1){let i;typeof t=="string"?i=Ru(t):(i={...t},kn(!i.pathname||!i.pathname.includes("?"),J0("?","pathname","search",i)),kn(!i.pathname||!i.pathname.includes("#"),J0("#","pathname","hash",i)),kn(!i.search||!i.search.includes("#"),J0("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,c;if(a==null)c=n;else{let m=e.length-1;if(!r&&a.startsWith("..")){let v=a.split("/");for(;v[0]==="..";)v.shift(),m-=1;i.pathname=v.join("/")}c=m>=0?e[m]:"/"}let d=RL(i,c),u=a&&a!=="/"&&a.endsWith("/"),f=(s||a===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(u||f)&&(d.pathname+="/"),d}var Zs=t=>t.join("/").replace(/\/\/+/g,"/"),ML=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),AL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,NL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,DL=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function OL(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function jL(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var MR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function AR(t,e){let n=t;if(typeof n!="string"||!EL.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(MR)try{let s=new URL(window.location.href),a=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=Vo(a.pathname,e);a.origin===s.origin&&c!=null?n=c+a.search+a.hash:i=!0}catch{rs(!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:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var NR=["POST","PUT","PATCH","DELETE"];new Set(NR);var LL=["GET",...NR];new Set(LL);var Tu=_.createContext(null);Tu.displayName="DataRouter";var ig=_.createContext(null);ig.displayName="DataRouterState";var IL=_.createContext(!1),DR=_.createContext({isTransitioning:!1});DR.displayName="ViewTransition";var PL=_.createContext(new Map);PL.displayName="Fetchers";var zL=_.createContext(null);zL.displayName="Await";var ji=_.createContext(null);ji.displayName="Navigation";var Ah=_.createContext(null);Ah.displayName="Location";var ss=_.createContext({outlet:null,matches:[],isDataRoute:!1});ss.displayName="Route";var my=_.createContext(null);my.displayName="RouteError";var OR="REACT_ROUTER_ERROR",BL="REDIRECT",FL="ROUTE_ERROR_RESPONSE";function HL(t){if(t.startsWith(`${OR}:${BL}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function $L(t){if(t.startsWith(`${OR}:${FL}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new DL(e.status,e.statusText,e.data)}catch{}}function UL(t,{relative:e}={}){kn(Mu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=_.useContext(ji),{hash:i,pathname:s,search:a}=Nh(t,{relative:e}),c=s;return n!=="/"&&(c=s==="/"?n:Zs([n,s])),r.createHref({pathname:c,search:a,hash:i})}function Mu(){return _.useContext(Ah)!=null}function Yr(){return kn(Mu(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(Ah).location}var jR="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function LR(t){_.useContext(ji).static||_.useLayoutEffect(t)}function tc(){let{isDataRoute:t}=_.useContext(ss);return t?iI():WL()}function WL(){kn(Mu(),"useNavigate() may be used only in the context of a <Router> component.");let t=_.useContext(Tu),{basename:e,navigator:n}=_.useContext(ji),{matches:r}=_.useContext(ss),{pathname:i}=Yr(),s=JSON.stringify(fy(r)),a=_.useRef(!1);return LR(()=>{a.current=!0}),_.useCallback((d,u={})=>{if(rs(a.current,jR),!a.current)return;if(typeof d=="number"){n.go(d);return}let f=rg(d,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Zs([e,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[e,n,s,i,t])}var VL=_.createContext(null);function qL(t){let e=_.useContext(ss).outlet;return _.useMemo(()=>e&&_.createElement(VL.Provider,{value:t},e),[e,t])}function IR(){let{matches:t}=_.useContext(ss),e=t[t.length-1];return e?e.params:{}}function Nh(t,{relative:e}={}){let{matches:n}=_.useContext(ss),{pathname:r}=Yr(),i=JSON.stringify(fy(n));return _.useMemo(()=>rg(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function KL(t,e){return PR(t,e)}function PR(t,e,n){var C;kn(Mu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=_.useContext(ji),{matches:i}=_.useContext(ss),s=i[i.length-1],a=s?s.params:{},c=s?s.pathname:"/",d=s?s.pathnameBase:"/",u=s&&s.route;{let k=u&&u.path||"";BR(c,!u||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (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.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let f=Yr(),m;if(e){let k=typeof e=="string"?Ru(e):e;kn(d==="/"||((C=k.pathname)==null?void 0:C.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${k.pathname}" was given in the \`location\` prop.`),m=k}else m=f;let v=m.pathname||"/",b=v;if(d!=="/"){let k=d.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let S=ER(t,{pathname:b});rs(u||S!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),rs(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=ZL(S&&S.map(k=>Object.assign({},k,{params:Object.assign({},a,k.params),pathname:Zs([d,r.encodeLocation?r.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?d:Zs([d,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),i,n);return e&&x?_.createElement(Ah.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},x):x}function GL(){let t=rI(),e=OL(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",t),a=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:s},"ErrorBoundary")," or"," ",_.createElement("code",{style:s},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:i},n):null,a)}var YL=_.createElement(GL,null),zR=class extends _.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=$L(t.digest);n&&(t=n)}let e=t!==void 0?_.createElement(ss.Provider,{value:this.props.routeContext},_.createElement(my.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?_.createElement(XL,{error:t},e):e}};zR.contextType=IL;var eb=new WeakMap;function XL({children:t,error:e}){let{basename:n}=_.useContext(ji);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=HL(e.digest);if(r){let i=eb.get(e);if(i)throw i;let s=AR(r.location,n);if(MR&&!eb.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw eb.set(e,a),a}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function QL({routeContext:t,match:e,children:n}){let r=_.useContext(Tu);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),_.createElement(ss.Provider,{value:t},n)}function ZL(t,e=[],n){let r=n==null?void 0:n.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let i=t,s=r==null?void 0:r.errors;if(s!=null){let f=i.findIndex(m=>m.route.id&&(s==null?void 0:s[m.route.id])!==void 0);kn(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let a=!1,c=-1;if(n&&r){a=r.renderFallback;for(let f=0;f<i.length;f++){let m=i[f];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(c=f),m.route.id){let{loaderData:v,errors:b}=r,S=m.route.loader&&!v.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||S){n.isStatic&&(a=!0),c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let d=n==null?void 0:n.onError,u=r&&d?(f,m)=>{var v,b;d(f,{location:r.location,params:((b=(v=r.matches)==null?void 0:v[0])==null?void 0:b.params)??{},unstable_pattern:jL(r.matches),errorInfo:m})}:void 0;return i.reduceRight((f,m,v)=>{let b,S=!1,x=null,C=null;r&&(b=s&&m.route.id?s[m.route.id]:void 0,x=m.route.errorElement||YL,a&&(c<0&&v===0?(BR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):c===v&&(S=!0,C=m.route.hydrateFallbackElement||null)));let k=e.concat(i.slice(0,v+1)),E=()=>{let R;return b?R=x:S?R=C:m.route.Component?R=_.createElement(m.route.Component,null):m.route.element?R=m.route.element:R=f,_.createElement(QL,{match:m,routeContext:{outlet:f,matches:k,isDataRoute:r!=null},children:R})};return r&&(m.route.ErrorBoundary||m.route.errorElement||v===0)?_.createElement(zR,{location:r.location,revalidation:r.revalidation,component:x,error:b,children:E(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:u}):E()},null)}function py(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function JL(t){let e=_.useContext(Tu);return kn(e,py(t)),e}function eI(t){let e=_.useContext(ig);return kn(e,py(t)),e}function tI(t){let e=_.useContext(ss);return kn(e,py(t)),e}function gy(t){let e=tI(t),n=e.matches[e.matches.length-1];return kn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function nI(){return gy("useRouteId")}function rI(){var r;let t=_.useContext(my),e=eI("useRouteError"),n=gy("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function iI(){let{router:t}=JL("useNavigate"),e=gy("useNavigate"),n=_.useRef(!1);return LR(()=>{n.current=!0}),_.useCallback(async(i,s={})=>{rs(n.current,jR),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var ik={};function BR(t,e,n){!e&&!ik[t]&&(ik[t]=!0,rs(!1,n))}_.memo(sI);function sI({routes:t,future:e,state:n,isStatic:r,onError:i}){return PR(t,void 0,{state:n,isStatic:r,onError:i})}function oI({to:t,replace:e,state:n,relative:r}){kn(Mu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=_.useContext(ji);rs(!i,"<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:s}=_.useContext(ss),{pathname:a}=Yr(),c=tc(),d=rg(t,fy(s),a,r==="path"),u=JSON.stringify(d);return _.useEffect(()=>{c(JSON.parse(u),{replace:e,state:n,relative:r})},[c,u,r,e,n]),null}function aI(t){return qL(t.context)}function jo(t){kn(!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 lI({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:a}){kn(!Mu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),d=_.useMemo(()=>({basename:c,navigator:i,static:s,unstable_useTransitions:a,future:{}}),[c,i,s,a]);typeof n=="string"&&(n=Ru(n));let{pathname:u="/",search:f="",hash:m="",state:v=null,key:b="default",unstable_mask:S}=n,x=_.useMemo(()=>{let C=Vo(u,c);return C==null?null:{location:{pathname:C,search:f,hash:m,state:v,key:b,unstable_mask:S},navigationType:r}},[c,u,f,m,v,b,r,S]);return rs(x!=null,`<Router basename="${c}"> is not able to match the URL "${u}${f}${m}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:_.createElement(ji.Provider,{value:d},_.createElement(Ah.Provider,{children:e,value:x}))}function cI({children:t,location:e}){return KL(y1(t),e)}function y1(t,e=[]){let n=[];return _.Children.forEach(t,(r,i)=>{if(!_.isValidElement(r))return;let s=[...e,i];if(r.type===_.Fragment){n.push.apply(n,y1(r.props.children,s));return}kn(r.type===jo,`[${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>`),kn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=y1(r.props.children,s)),n.push(a)}),n}var Ym="get",Xm="application/x-www-form-urlencoded";function sg(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function uI(t){return sg(t)&&t.tagName.toLowerCase()==="button"}function dI(t){return sg(t)&&t.tagName.toLowerCase()==="form"}function hI(t){return sg(t)&&t.tagName.toLowerCase()==="input"}function fI(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function mI(t,e){return t.button===0&&(!e||e==="_self")&&!fI(t)}function x1(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function pI(t,e){let n=x1(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}var cm=null;function gI(){if(cm===null)try{new FormData(document.createElement("form"),0),cm=!1}catch{cm=!0}return cm}var vI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tb(t){return t!=null&&!vI.has(t)?(rs(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xm}"`),null):t}function bI(t,e){let n,r,i,s,a;if(dI(t)){let c=t.getAttribute("action");r=c?Vo(c,e):null,n=t.getAttribute("method")||Ym,i=tb(t.getAttribute("enctype"))||Xm,s=new FormData(t)}else if(uI(t)||hI(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||c.getAttribute("action");if(r=d?Vo(d,e):null,n=t.getAttribute("formmethod")||c.getAttribute("method")||Ym,i=tb(t.getAttribute("formenctype"))||tb(c.getAttribute("enctype"))||Xm,s=new FormData(c,t),!gI()){let{name:u,type:f,value:m}=t;if(f==="image"){let v=u?`${u}.`:"";s.append(`${v}x`,"0"),s.append(`${v}y`,"0")}else u&&s.append(u,m)}}else{if(sg(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ym,r=null,i=Xm,a=t}return s&&i==="text/plain"&&(a=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vy(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function _I(t,e,n,r){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:e&&Vo(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function yI(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xI(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function SI(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let a=await yI(s,n);return a.links?a.links():[]}return[]}));return EI(r.flat(1).filter(xI).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function sk(t,e,n,r,i,s){let a=(d,u)=>n[u]?d.route.id!==n[u].route.id:!0,c=(d,u)=>{var f;return n[u].pathname!==d.pathname||((f=n[u].route.path)==null?void 0:f.endsWith("*"))&&n[u].params["*"]!==d.params["*"]};return s==="assets"?e.filter((d,u)=>a(d,u)||c(d,u)):s==="data"?e.filter((d,u)=>{var m;let f=r.routes[d.route.id];if(!f||!f.hasLoader)return!1;if(a(d,u)||c(d,u))return!0;if(d.route.shouldRevalidate){let v=d.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function wI(t,e,{includeHydrateFallback:n}={}){return CI(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function CI(t){return[...new Set(t)]}function kI(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function EI(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(kI(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function FR(){let t=_.useContext(Tu);return vy(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function RI(){let t=_.useContext(ig);return vy(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var by=_.createContext(void 0);by.displayName="FrameworkContext";function HR(){let t=_.useContext(by);return vy(t,"You must render this element inside a <HydratedRouter> element"),t}function TI(t,e){let n=_.useContext(by),[r,i]=_.useState(!1),[s,a]=_.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:u,onMouseLeave:f,onTouchStart:m}=e,v=_.useRef(null);_.useEffect(()=>{if(t==="render"&&a(!0),t==="viewport"){let x=k=>{k.forEach(E=>{a(E.isIntersecting)})},C=new IntersectionObserver(x,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[t]),_.useEffect(()=>{if(r){let x=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(x)}}},[r]);let b=()=>{i(!0)},S=()=>{i(!1),a(!1)};return n?t!=="intent"?[s,v,{}]:[s,v,{onFocus:Od(c,b),onBlur:Od(d,S),onMouseEnter:Od(u,b),onMouseLeave:Od(f,S),onTouchStart:Od(m,b)}]:[!1,v,{}]}function Od(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function MI({page:t,...e}){let{router:n}=FR(),r=_.useMemo(()=>ER(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?_.createElement(NI,{page:t,matches:r,...e}):null}function AI(t){let{manifest:e,routeModules:n}=HR(),[r,i]=_.useState([]);return _.useEffect(()=>{let s=!1;return SI(t,e,n).then(a=>{s||i(a)}),()=>{s=!0}},[t,e,n]),r}function NI({page:t,matches:e,...n}){let r=Yr(),{future:i,manifest:s,routeModules:a}=HR(),{basename:c}=FR(),{loaderData:d,matches:u}=RI(),f=_.useMemo(()=>sk(t,e,u,s,r,"data"),[t,e,u,s,r]),m=_.useMemo(()=>sk(t,e,u,s,r,"assets"),[t,e,u,s,r]),v=_.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let x=new Set,C=!1;if(e.forEach(E=>{var M;let R=s.routes[E.route.id];!R||!R.hasLoader||(!f.some(O=>O.route.id===E.route.id)&&E.route.id in d&&((M=a[E.route.id])!=null&&M.shouldRevalidate)||R.hasClientLoader?C=!0:x.add(E.route.id))}),x.size===0)return[];let k=_I(t,c,i.unstable_trailingSlashAwareDataRequests,"data");return C&&x.size>0&&k.searchParams.set("_routes",e.filter(E=>x.has(E.route.id)).map(E=>E.route.id).join(",")),[k.pathname+k.search]},[c,i.unstable_trailingSlashAwareDataRequests,d,r,s,f,e,t,a]),b=_.useMemo(()=>wI(m,s),[m,s]),S=AI(m);return _.createElement(_.Fragment,null,v.map(x=>_.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),b.map(x=>_.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),S.map(({key:x,link:C})=>_.createElement("link",{key:x,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function DI(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var OI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{OI&&(window.__reactRouterVersion="7.13.2")}catch{}function jI({basename:t,children:e,unstable_useTransitions:n,window:r}){let i=_.useRef();i.current==null&&(i.current=cL({window:r,v5Compat:!0}));let s=i.current,[a,c]=_.useState({action:s.action,location:s.location}),d=_.useCallback(u=>{n===!1?c(u):_.startTransition(()=>c(u))},[n]);return _.useLayoutEffect(()=>s.listen(d),[s,d]),_.createElement(lI,{basename:t,children:e,location:a.location,navigationType:a.action,navigator:s,unstable_useTransitions:n})}var $R=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dh=_.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:a,unstable_mask:c,state:d,target:u,to:f,preventScrollReset:m,viewTransition:v,unstable_defaultShouldRevalidate:b,...S},x){let{basename:C,navigator:k,unstable_useTransitions:E}=_.useContext(ji),R=typeof f=="string"&&$R.test(f),M=AR(f,C);f=M.to;let O=UL(f,{relative:i}),D=Yr(),P=null;if(c){let H=rg(c,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);C!=="/"&&(H.pathname=H.pathname==="/"?C:Zs([C,H.pathname])),P=k.createHref(H)}let[z,Y,L]=TI(r,S),W=zI(f,{replace:a,unstable_mask:c,state:d,target:u,preventScrollReset:m,relative:i,viewTransition:v,unstable_defaultShouldRevalidate:b,unstable_useTransitions:E});function V(H){e&&e(H),H.defaultPrevented||W(H)}let F=!(M.isExternal||s),U=_.createElement("a",{...S,...L,href:(F?P:void 0)||M.absoluteURL||O,onClick:F?V:e,ref:DI(x,Y),target:u,"data-discover":!R&&n==="render"?"true":void 0});return z&&!R?_.createElement(_.Fragment,null,U,_.createElement(MI,{page:O})):U});Dh.displayName="Link";var LI=_.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:a,viewTransition:c,children:d,...u},f){let m=Nh(a,{relative:u.relative}),v=Yr(),b=_.useContext(ig),{navigator:S,basename:x}=_.useContext(ji),C=b!=null&&UI(m)&&c===!0,k=S.encodeLocation?S.encodeLocation(m).pathname:m.pathname,E=v.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(E=E.toLowerCase(),R=R?R.toLowerCase():null,k=k.toLowerCase()),R&&x&&(R=Vo(R,x)||R);const M=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let O=E===k||!i&&E.startsWith(k)&&E.charAt(M)==="/",D=R!=null&&(R===k||!i&&R.startsWith(k)&&R.charAt(k.length)==="/"),P={isActive:O,isPending:D,isTransitioning:C},z=O?e:void 0,Y;typeof r=="function"?Y=r(P):Y=[r,O?"active":null,D?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let L=typeof s=="function"?s(P):s;return _.createElement(Dh,{...u,"aria-current":z,className:Y,ref:f,style:L,to:a,viewTransition:c},typeof d=="function"?d(P):d)});LI.displayName="NavLink";var II=_.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:a=Ym,action:c,onSubmit:d,relative:u,preventScrollReset:f,viewTransition:m,unstable_defaultShouldRevalidate:v,...b},S)=>{let{unstable_useTransitions:x}=_.useContext(ji),C=HI(),k=$I(c,{relative:u}),E=a.toLowerCase()==="get"?"get":"post",R=typeof c=="string"&&$R.test(c),M=O=>{if(d&&d(O),O.defaultPrevented)return;O.preventDefault();let D=O.nativeEvent.submitter,P=(D==null?void 0:D.getAttribute("formmethod"))||a,z=()=>C(D||O.currentTarget,{fetcherKey:e,method:P,navigate:n,replace:i,state:s,relative:u,preventScrollReset:f,viewTransition:m,unstable_defaultShouldRevalidate:v});x&&n!==!1?_.startTransition(()=>z()):z()};return _.createElement("form",{ref:S,method:E,action:k,onSubmit:r?d:M,...b,"data-discover":!R&&t==="render"?"true":void 0})});II.displayName="Form";function PI(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function UR(t){let e=_.useContext(Tu);return kn(e,PI(t)),e}function zI(t,{target:e,replace:n,unstable_mask:r,state:i,preventScrollReset:s,relative:a,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:u}={}){let f=tc(),m=Yr(),v=Nh(t,{relative:a});return _.useCallback(b=>{if(mI(b,e)){b.preventDefault();let S=n!==void 0?n:gh(m)===gh(v),x=()=>f(t,{replace:S,unstable_mask:r,state:i,preventScrollReset:s,relative:a,viewTransition:c,unstable_defaultShouldRevalidate:d});u?_.startTransition(()=>x()):x()}},[m,f,v,n,r,i,e,t,s,a,c,d,u])}function _le(t){rs(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=_.useRef(x1(t)),n=_.useRef(!1),r=Yr(),i=_.useMemo(()=>pI(r.search,n.current?null:e.current),[r.search]),s=tc(),a=_.useCallback((c,d)=>{const u=x1(typeof c=="function"?c(new URLSearchParams(i)):c);n.current=!0,s("?"+u,d)},[s,i]);return[i,a]}var BI=0,FI=()=>`__${String(++BI)}__`;function HI(){let{router:t}=UR("useSubmit"),{basename:e}=_.useContext(ji),n=nI(),r=t.fetch,i=t.navigate;return _.useCallback(async(s,a={})=>{let{action:c,method:d,encType:u,formData:f,body:m}=bI(s,e);if(a.navigate===!1){let v=a.fetcherKey||FI();await r(v,n,a.action||c,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:m,formMethod:a.method||d,formEncType:a.encType||u,flushSync:a.flushSync})}else await i(a.action||c,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:m,formMethod:a.method||d,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,e,n])}function $I(t,{relative:e}={}){let{basename:n}=_.useContext(ji),r=_.useContext(ss);kn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Nh(t||".",{relative:e})},a=Yr();if(t==null){s.search=a.search;let c=new URLSearchParams(s.search),d=c.getAll("index");if(d.some(f=>f==="")){c.delete("index"),d.filter(m=>m).forEach(m=>c.append("index",m));let f=c.toString();s.search=f?`?${f}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Zs([n,s.pathname])),gh(s)}function UI(t,{relative:e}={}){let n=_.useContext(DR);kn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=UR("useViewTransitionState"),i=Nh(t,{relative:e});if(!n.isTransitioning)return!1;let s=Vo(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Vo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return vp(i.pathname,a)!=null||vp(i.pathname,s)!=null}var es=CR();const WR=tg(es),WI="modulepreload",VI=function(t){return"/"+t},ok={},_y=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let a=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=a(n.map(u=>{if(u=VI(u),u in ok)return;ok[u]=!0;const f=u.endsWith(".css"),m=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const v=document.createElement("link");if(v.rel=f?"stylesheet":WI,f||(v.as="script"),v.crossOrigin="",v.href=u,d&&v.setAttribute("nonce",d),document.head.appendChild(v),f)return new Promise((b,S)=>{v.addEventListener("load",b),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};var nb={exports:{}},rb={};/**
|
|
62
|
+
* @license React
|
|
63
|
+
* react-compiler-runtime.production.js
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the MIT license found in the
|
|
68
|
+
* LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/var ak;function qI(){if(ak)return rb;ak=1;var t=ng().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return rb.c=function(e){return t.H.useMemoCache(e)},rb}var lk;function KI(){return lk||(lk=1,nb.exports=qI()),nb.exports}var ke=KI();function GI(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const YI=t=>{switch(t){case"success":return ZI;case"info":return eP;case"warning":return JI;case"error":return tP;default:return null}},XI=Array(12).fill(0),QI=({visible:t,className:e})=>je.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},je.createElement("div",{className:"sonner-spinner"},XI.map((n,r)=>je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),ZI=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),JI=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),eP=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),tP=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nP=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rP=()=>{const[t,e]=je.useState(document.hidden);return je.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let S1=1;class iP{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...i}=e,s=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:S1++,a=this.toasts.find(d=>d.id===s),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:r}),{...d,...e,id:s,dismissible:c,title:r}):d):this.addToast({title:r,...i,dismissible:c,id:s}),s},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(e instanceof Function?e():e);let s=r!==void 0,a;const c=i.then(async u=>{if(a=["resolve",u],je.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(oP(u)&&!u.ok){s=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,S=typeof m=="object"&&!je.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:v,...S})}else if(u instanceof Error){s=!1;const m=typeof n.error=="function"?await n.error(u):n.error,v=typeof n.description=="function"?await n.description(u):n.description,S=typeof m=="object"&&!je.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:v,...S})}else if(n.success!==void 0){s=!1;const m=typeof n.success=="function"?await n.success(u):n.success,v=typeof n.description=="function"?await n.description(u):n.description,S=typeof m=="object"&&!je.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:v,...S})}}).catch(async u=>{if(a=["reject",u],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(u):n.error,m=typeof n.description=="function"?await n.description(u):n.description,b=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:m,...b})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((u,f)=>c.then(()=>a[0]==="reject"?f(a[1]):u(a[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||S1++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ci=new iP,sP=(t,e)=>{const n=(e==null?void 0:e.id)||S1++;return ci.addToast({title:t,...e,id:n}),n},oP=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",aP=sP,lP=()=>ci.toasts,cP=()=>ci.getActiveToasts(),ru=Object.assign(aP,{success:ci.success,info:ci.info,warning:ci.warning,error:ci.error,custom:ci.custom,message:ci.message,promise:ci.promise,dismiss:ci.dismiss,loading:ci.loading},{getHistory:lP,getToasts:cP});GI("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function um(t){return t.label!==void 0}const uP=3,dP="24px",hP="16px",ck=4e3,fP=356,mP=14,pP=45,gP=200;function $s(...t){return t.filter(Boolean).join(" ")}function vP(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const bP=t=>{var e,n,r,i,s,a,c,d,u;const{invert:f,toast:m,unstyled:v,interacting:b,setHeights:S,visibleToasts:x,heights:C,index:k,toasts:E,expanded:R,removeToast:M,defaultRichColors:O,closeButton:D,style:P,cancelButtonStyle:z,actionButtonStyle:Y,className:L="",descriptionClassName:W="",duration:V,position:F,gap:U,expandByDefault:H,classNames:j,icons:G,closeButtonAriaLabel:B="Close toast"}=t,[K,A]=je.useState(null),[I,$]=je.useState(null),[T,X]=je.useState(!1),[Z,J]=je.useState(!1),[re,ae]=je.useState(!1),[ue,me]=je.useState(!1),[se,oe]=je.useState(!1),[ee,Q]=je.useState(0),[te,he]=je.useState(0),ie=je.useRef(m.duration||V||ck),xe=je.useRef(null),Ae=je.useRef(null),Ke=k===0,mt=k+1<=x,Ye=m.type,Ze=m.dismissible!==!1,tt=m.className||"",it=m.descriptionClassName||"",ce=je.useMemo(()=>C.findIndex(ye=>ye.toastId===m.id)||0,[C,m.id]),Re=je.useMemo(()=>{var ye;return(ye=m.closeButton)!=null?ye:D},[m.closeButton,D]),Ue=je.useMemo(()=>m.duration||V||ck,[m.duration,V]),Je=je.useRef(0),Ve=je.useRef(0),ze=je.useRef(0),He=je.useRef(null),[Xe,ut]=F.split("-"),ft=je.useMemo(()=>C.reduce((ye,Ie,Qe)=>Qe>=ce?ye:ye+Ie.height,0),[C,ce]),rt=rP(),Tt=m.invert||f,lt=Ye==="loading";Ve.current=je.useMemo(()=>ce*U+ft,[ce,ft]),je.useEffect(()=>{ie.current=Ue},[Ue]),je.useEffect(()=>{X(!0)},[]),je.useEffect(()=>{const ye=Ae.current;if(ye){const Ie=ye.getBoundingClientRect().height;return he(Ie),S(Qe=>[{toastId:m.id,height:Ie,position:m.position},...Qe]),()=>S(Qe=>Qe.filter(gt=>gt.toastId!==m.id))}},[S,m.id]),je.useLayoutEffect(()=>{if(!T)return;const ye=Ae.current,Ie=ye.style.height;ye.style.height="auto";const Qe=ye.getBoundingClientRect().height;ye.style.height=Ie,he(Qe),S(gt=>gt.find(wt=>wt.toastId===m.id)?gt.map(wt=>wt.toastId===m.id?{...wt,height:Qe}:wt):[{toastId:m.id,height:Qe,position:m.position},...gt])},[T,m.title,m.description,S,m.id,m.jsx,m.action,m.cancel]);const ht=je.useCallback(()=>{J(!0),Q(Ve.current),S(ye=>ye.filter(Ie=>Ie.toastId!==m.id)),setTimeout(()=>{M(m)},gP)},[m,M,S,Ve]);je.useEffect(()=>{if(m.promise&&Ye==="loading"||m.duration===1/0||m.type==="loading")return;let ye;return R||b||rt?(()=>{if(ze.current<Je.current){const gt=new Date().getTime()-Je.current;ie.current=ie.current-gt}ze.current=new Date().getTime()})():(()=>{ie.current!==1/0&&(Je.current=new Date().getTime(),ye=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),ht()},ie.current))})(),()=>clearTimeout(ye)},[R,b,m,Ye,rt,ht]),je.useEffect(()=>{m.delete&&(ht(),m.onDismiss==null||m.onDismiss.call(m,m))},[ht,m.delete]);function Be(){var ye;if(G!=null&&G.loading){var Ie;return je.createElement("div",{className:$s(j==null?void 0:j.loader,m==null||(Ie=m.classNames)==null?void 0:Ie.loader,"sonner-loader"),"data-visible":Ye==="loading"},G.loading)}return je.createElement(QI,{className:$s(j==null?void 0:j.loader,m==null||(ye=m.classNames)==null?void 0:ye.loader),visible:Ye==="loading"})}const $e=m.icon||(G==null?void 0:G[Ye])||YI(Ye);var Le,Fe;return je.createElement("li",{tabIndex:0,ref:Ae,className:$s(L,tt,j==null?void 0:j.toast,m==null||(e=m.classNames)==null?void 0:e.toast,j==null?void 0:j.default,j==null?void 0:j[Ye],m==null||(n=m.classNames)==null?void 0:n[Ye]),"data-sonner-toast":"","data-rich-colors":(Le=m.richColors)!=null?Le:O,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":T,"data-promise":!!m.promise,"data-swiped":se,"data-removed":Z,"data-visible":mt,"data-y-position":Xe,"data-x-position":ut,"data-index":k,"data-front":Ke,"data-swiping":re,"data-dismissible":Ze,"data-type":Ye,"data-invert":Tt,"data-swipe-out":ue,"data-swipe-direction":I,"data-expanded":!!(R||H&&T),"data-testid":m.testId,style:{"--index":k,"--toasts-before":k,"--z-index":E.length-k,"--offset":`${Z?ee:Ve.current}px`,"--initial-height":H?"auto":`${te}px`,...P,...m.style},onDragEnd:()=>{ae(!1),A(null),He.current=null},onPointerDown:ye=>{ye.button!==2&&(lt||!Ze||(xe.current=new Date,Q(Ve.current),ye.target.setPointerCapture(ye.pointerId),ye.target.tagName!=="BUTTON"&&(ae(!0),He.current={x:ye.clientX,y:ye.clientY})))},onPointerUp:()=>{var ye,Ie,Qe;if(ue||!Ze)return;He.current=null;const gt=Number(((ye=Ae.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Wt=Number(((Ie=Ae.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wt=new Date().getTime()-((Qe=xe.current)==null?void 0:Qe.getTime()),xt=K==="x"?gt:Wt,Qt=Math.abs(xt)/wt;if(Math.abs(xt)>=pP||Qt>.11){Q(Ve.current),m.onDismiss==null||m.onDismiss.call(m,m),$(K==="x"?gt>0?"right":"left":Wt>0?"down":"up"),ht(),me(!0);return}else{var kt,Dt;(kt=Ae.current)==null||kt.style.setProperty("--swipe-amount-x","0px"),(Dt=Ae.current)==null||Dt.style.setProperty("--swipe-amount-y","0px")}oe(!1),ae(!1),A(null)},onPointerMove:ye=>{var Ie,Qe,gt;if(!He.current||!Ze||((Ie=window.getSelection())==null?void 0:Ie.toString().length)>0)return;const wt=ye.clientY-He.current.y,xt=ye.clientX-He.current.x;var Qt;const kt=(Qt=t.swipeDirections)!=null?Qt:vP(F);!K&&(Math.abs(xt)>1||Math.abs(wt)>1)&&A(Math.abs(xt)>Math.abs(wt)?"x":"y");let Dt={x:0,y:0};const wn=Zt=>1/(1.5+Math.abs(Zt)/20);if(K==="y"){if(kt.includes("top")||kt.includes("bottom"))if(kt.includes("top")&&wt<0||kt.includes("bottom")&&wt>0)Dt.y=wt;else{const Zt=wt*wn(wt);Dt.y=Math.abs(Zt)<Math.abs(wt)?Zt:wt}}else if(K==="x"&&(kt.includes("left")||kt.includes("right")))if(kt.includes("left")&&xt<0||kt.includes("right")&&xt>0)Dt.x=xt;else{const Zt=xt*wn(xt);Dt.x=Math.abs(Zt)<Math.abs(xt)?Zt:xt}(Math.abs(Dt.x)>0||Math.abs(Dt.y)>0)&&oe(!0),(Qe=Ae.current)==null||Qe.style.setProperty("--swipe-amount-x",`${Dt.x}px`),(gt=Ae.current)==null||gt.style.setProperty("--swipe-amount-y",`${Dt.y}px`)}},Re&&!m.jsx&&Ye!=="loading"?je.createElement("button",{"aria-label":B,"data-disabled":lt,"data-close-button":!0,onClick:lt||!Ze?()=>{}:()=>{ht(),m.onDismiss==null||m.onDismiss.call(m,m)},className:$s(j==null?void 0:j.closeButton,m==null||(r=m.classNames)==null?void 0:r.closeButton)},(Fe=G==null?void 0:G.close)!=null?Fe:nP):null,(Ye||m.icon||m.promise)&&m.icon!==null&&((G==null?void 0:G[Ye])!==null||m.icon)?je.createElement("div",{"data-icon":"",className:$s(j==null?void 0:j.icon,m==null||(i=m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Be():null,m.type!=="loading"?$e:null):null,je.createElement("div",{"data-content":"",className:$s(j==null?void 0:j.content,m==null||(s=m.classNames)==null?void 0:s.content)},je.createElement("div",{"data-title":"",className:$s(j==null?void 0:j.title,m==null||(a=m.classNames)==null?void 0:a.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?je.createElement("div",{"data-description":"",className:$s(W,it,j==null?void 0:j.description,m==null||(c=m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),je.isValidElement(m.cancel)?m.cancel:m.cancel&&um(m.cancel)?je.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||z,onClick:ye=>{um(m.cancel)&&Ze&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,ye),ht())},className:$s(j==null?void 0:j.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,je.isValidElement(m.action)?m.action:m.action&&um(m.action)?je.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||Y,onClick:ye=>{um(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,ye),!ye.defaultPrevented&&ht())},className:$s(j==null?void 0:j.actionButton,m==null||(u=m.classNames)==null?void 0:u.actionButton)},m.action.label):null)};function uk(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function _P(t,e){const n={};return[t,e].forEach((r,i)=>{const s=i===1,a=s?"--mobile-offset":"--offset",c=s?hP:dP;function d(u){["top","right","bottom","left"].forEach(f=>{n[`${a}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${a}-${u}`]=c:n[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):d(c)}),n}const yP=je.forwardRef(function(e,n){const{id:r,invert:i,position:s="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:d,className:u,offset:f,mobileOffset:m,theme:v="light",richColors:b,duration:S,style:x,visibleToasts:C=uP,toastOptions:k,dir:E=uk(),gap:R=mP,icons:M,containerAriaLabel:O="Notifications"}=e,[D,P]=je.useState([]),z=je.useMemo(()=>r?D.filter(T=>T.toasterId===r):D.filter(T=>!T.toasterId),[D,r]),Y=je.useMemo(()=>Array.from(new Set([s].concat(z.filter(T=>T.position).map(T=>T.position)))),[z,s]),[L,W]=je.useState([]),[V,F]=je.useState(!1),[U,H]=je.useState(!1),[j,G]=je.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=je.useRef(null),K=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=je.useRef(null),I=je.useRef(!1),$=je.useCallback(T=>{P(X=>{var Z;return(Z=X.find(J=>J.id===T.id))!=null&&Z.delete||ci.dismiss(T.id),X.filter(({id:J})=>J!==T.id)})},[]);return je.useEffect(()=>ci.subscribe(T=>{if(T.dismiss){requestAnimationFrame(()=>{P(X=>X.map(Z=>Z.id===T.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{WR.flushSync(()=>{P(X=>{const Z=X.findIndex(J=>J.id===T.id);return Z!==-1?[...X.slice(0,Z),{...X[Z],...T},...X.slice(Z+1)]:[T,...X]})})})}),[D]),je.useEffect(()=>{if(v!=="system"){G(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const T=window.matchMedia("(prefers-color-scheme: dark)");try{T.addEventListener("change",({matches:X})=>{G(X?"dark":"light")})}catch{T.addListener(({matches:Z})=>{try{G(Z?"dark":"light")}catch(J){console.error(J)}})}},[v]),je.useEffect(()=>{D.length<=1&&F(!1)},[D]),je.useEffect(()=>{const T=X=>{var Z;if(a.every(ae=>X[ae]||X.code===ae)){var re;F(!0),(re=B.current)==null||re.focus()}X.code==="Escape"&&(document.activeElement===B.current||(Z=B.current)!=null&&Z.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[a]),je.useEffect(()=>{if(B.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,I.current=!1)}},[B.current]),je.createElement("section",{ref:n,"aria-label":`${O} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Y.map((T,X)=>{var Z;const[J,re]=T.split("-");return z.length?je.createElement("ol",{key:T,dir:E==="auto"?uk():E,tabIndex:-1,ref:B,className:u,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":J,"data-x-position":re,style:{"--front-toast-height":`${((Z=L[0])==null?void 0:Z.height)||0}px`,"--width":`${fP}px`,"--gap":`${R}px`,...x,..._P(f,m)},onBlur:ae=>{I.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(I.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||I.current||(I.current=!0,A.current=ae.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{U||F(!1)},onDragEnd:()=>F(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},z.filter(ae=>!ae.position&&X===0||ae.position===T).map((ae,ue)=>{var me,se;return je.createElement(bP,{key:ae.id,icons:M,index:ue,toast:ae,defaultRichColors:b,duration:(me=k==null?void 0:k.duration)!=null?me:S,className:k==null?void 0:k.className,descriptionClassName:k==null?void 0:k.descriptionClassName,invert:i,visibleToasts:C,closeButton:(se=k==null?void 0:k.closeButton)!=null?se:d,interacting:U,position:T,style:k==null?void 0:k.style,unstyled:k==null?void 0:k.unstyled,classNames:k==null?void 0:k.classNames,cancelButtonStyle:k==null?void 0:k.cancelButtonStyle,actionButtonStyle:k==null?void 0:k.actionButtonStyle,closeButtonAriaLabel:k==null?void 0:k.closeButtonAriaLabel,removeToast:$,toasts:z.filter(oe=>oe.position==ae.position),heights:L.filter(oe=>oe.position==ae.position),setHeights:W,expandByDefault:c,gap:R,expanded:V,swipeDirections:e.swipeDirections})})):null}))});function VR(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=VR(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function qR(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=VR(t))&&(r&&(r+=" "),r+=e);return r}const dk=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,hk=qR,xP=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return hk(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(u=>{const f=n==null?void 0:n[u],m=s==null?void 0:s[u];if(f===null)return null;const v=dk(f)||dk(m);return i[u][v]}),c=n&&Object.entries(n).reduce((u,f)=>{let[m,v]=f;return v===void 0||(u[m]=v),u},{}),d=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:m,className:v,...b}=f;return Object.entries(b).every(S=>{let[x,C]=S;return Array.isArray(C)?C.includes({...s,...c}[x]):{...s,...c}[x]===C})?[...u,m,v]:u},[]);return hk(t,a,d,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
|
70
|
+
* @license lucide-react v0.562.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const SP=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wP=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),fk=t=>{const e=wP(t);return e.charAt(0).toUpperCase()+e.slice(1)},KR=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),CP=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
|
|
75
|
+
* @license lucide-react v0.562.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/var kP={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"};/**
|
|
80
|
+
* @license lucide-react v0.562.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const EP=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...c},d)=>_.createElement("svg",{ref:d,...kP,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:KR("lucide",i),...!s&&!CP(c)&&{"aria-hidden":"true"},...c},[...a.map(([u,f])=>_.createElement(u,f)),...Array.isArray(s)?s:[s]]));/**
|
|
85
|
+
* @license lucide-react v0.562.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const st=(t,e)=>{const n=_.forwardRef(({className:r,...i},s)=>_.createElement(EP,{ref:s,iconNode:e,className:KR(`lucide-${SP(fk(t))}`,`lucide-${t}`,r),...i}));return n.displayName=fk(t),n};/**
|
|
90
|
+
* @license lucide-react v0.562.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const RP=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],TP=st("arrow-down-to-line",RP);/**
|
|
95
|
+
* @license lucide-react v0.562.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const MP=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],AP=st("arrow-down",MP);/**
|
|
100
|
+
* @license lucide-react v0.562.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const NP=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],DP=st("arrow-up",NP);/**
|
|
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 OP=[["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"}]],jP=st("asterisk",OP);/**
|
|
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
|
+
*/const LP=[["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"}]],Gn=st("brain",LP);/**
|
|
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 IP=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],PP=st("check-check",IP);/**
|
|
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 zP=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],BP=st("check-line",zP);/**
|
|
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 FP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],di=st("check",FP);/**
|
|
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 HP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],og=st("chevron-down",HP);/**
|
|
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 $P=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],GR=st("chevron-left",$P);/**
|
|
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 UP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ni=st("chevron-right",UP);/**
|
|
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 WP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],VP=st("chevron-up",WP);/**
|
|
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 qP=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],KP=st("chevrons-up",qP);/**
|
|
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 GP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],YP=st("circle-slash",GP);/**
|
|
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 XP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],QP=st("circle",XP);/**
|
|
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 ZP=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],JP=st("code",ZP);/**
|
|
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 e8=[["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"}]],lu=st("copy",e8);/**
|
|
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 t8=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],n8=st("corner-down-left",t8);/**
|
|
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 r8=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],mk=st("download",r8);/**
|
|
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 i8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],pk=st("ellipsis",i8);/**
|
|
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 s8=[["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"}]],o8=st("eraser",s8);/**
|
|
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 a8=[["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"}]],l8=st("file-code-corner",a8);/**
|
|
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 c8=[["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"}]],u8=st("file-pen",c8);/**
|
|
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 d8=[["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"}]],h8=st("file-plus-corner",d8);/**
|
|
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 f8=[["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"}]],ag=st("file-text",f8);/**
|
|
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 m8=[["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"}]],p8=st("file",m8);/**
|
|
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 g8=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],ib=st("folder-git-2",g8);/**
|
|
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 v8=[["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"}]],b8=st("folder-open",v8);/**
|
|
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 _8=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],YR=st("folder-plus",_8);/**
|
|
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 y8=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Ao=st("gauge",y8);/**
|
|
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 x8=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],S8=st("git-branch",x8);/**
|
|
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 w8=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],C8=st("grip-vertical",w8);/**
|
|
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 k8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],E8=st("image",k8);/**
|
|
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 R8=[["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"}]],T8=st("list-checks",R8);/**
|
|
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 M8=[["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"}]],bp=st("list-todo",M8);/**
|
|
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 A8=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Fn=st("loader-circle",A8);/**
|
|
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 N8=[["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"}]],gk=st("lock-open",N8);/**
|
|
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 D8=[["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"}]],vk=st("map",D8);/**
|
|
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 O8=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],j8=st("maximize-2",O8);/**
|
|
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 L8=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],w1=st("menu",L8);/**
|
|
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 I8=[["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"}]],XR=st("message-circle-question-mark",I8);/**
|
|
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 P8=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],z8=st("minimize-2",P8);/**
|
|
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 B8=[["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"}]],QR=st("minimize",B8);/**
|
|
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 F8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],C1=st("panel-left",F8);/**
|
|
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 H8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],$8=st("panel-right",H8);/**
|
|
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 U8=[["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"}]],ZR=st("paperclip",U8);/**
|
|
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 W8=[["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"}]],Ul=st("pencil",W8);/**
|
|
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 V8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],yy=st("plus",V8);/**
|
|
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 q8=[["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"}]],JR=st("refresh-cw",q8);/**
|
|
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 K8=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],sb=st("search",K8);/**
|
|
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 G8=[["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"}]],Y8=st("send",G8);/**
|
|
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 X8=[["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"}]],Q8=st("settings",X8);/**
|
|
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 Z8=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],e4=st("slash",Z8);/**
|
|
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 J8=[["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"}]],gn=st("sparkles",J8);/**
|
|
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 ez=[["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"}]],bk=st("square-menu",ez);/**
|
|
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 tz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]],_k=st("square-minus",tz);/**
|
|
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 nz=[["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"}]],t4=st("square-pen",nz);/**
|
|
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 rz=[["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"}]],iz=st("square-x",rz);/**
|
|
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 sz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],oz=st("square",sz);/**
|
|
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 az=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],n4=st("terminal",az);/**
|
|
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 lz=[["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"}]],cz=st("toy-brick",lz);/**
|
|
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 uz=[["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"}]],vu=st("trash-2",uz);/**
|
|
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 dz=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],xy=st("user-round",dz);/**
|
|
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 hz=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],fz=st("user",hz);/**
|
|
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 mz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],is=st("x",mz);/**
|
|
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 pz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],qr=st("zap",pz),gz=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},vz=(t,e)=>({classGroupId:t,validator:e}),r4=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),_p="-",yk=[],bz="arbitrary..",_z=t=>{const e=xz(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return yz(a);const c=a.split(_p),d=c[0]===""&&c.length>1?1:0;return i4(c,d,e)},getConflictingClassGroupIds:(a,c)=>{if(c){const d=r[a],u=n[a];return d?u?gz(u,d):d:u||yk}return n[a]||yk}}},i4=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],s=n.nextPart.get(i);if(s){const u=i4(t,e+1,s);if(u)return u}const a=n.validators;if(a===null)return;const c=e===0?t.join(_p):t.slice(e).join(_p),d=a.length;for(let u=0;u<d;u++){const f=a[u];if(f.validator(c))return f.classGroupId}},yz=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?bz+r:void 0})(),xz=t=>{const{theme:e,classGroups:n}=t;return Sz(n,e)},Sz=(t,e)=>{const n=r4();for(const r in t){const i=t[r];Sy(i,n,r,e)}return n},Sy=(t,e,n,r)=>{const i=t.length;for(let s=0;s<i;s++){const a=t[s];wz(a,e,n,r)}},wz=(t,e,n,r)=>{if(typeof t=="string"){Cz(t,e,n);return}if(typeof t=="function"){kz(t,e,n,r);return}Ez(t,e,n,r)},Cz=(t,e,n)=>{const r=t===""?e:s4(e,t);r.classGroupId=n},kz=(t,e,n,r)=>{if(Rz(t)){Sy(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(vz(n,t))},Ez=(t,e,n,r)=>{const i=Object.entries(t),s=i.length;for(let a=0;a<s;a++){const[c,d]=i[a];Sy(d,s4(e,c),n,r)}},s4=(t,e)=>{let n=t;const r=e.split(_p),i=r.length;for(let s=0;s<i;s++){const a=r[s];let c=n.nextPart.get(a);c||(c=r4(),n.nextPart.set(a,c)),n=c}return n},Rz=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Tz=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(s,a)=>{n[s]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return i(s,a),a},set(s,a){s in n?n[s]=a:i(s,a)}}},k1="!",xk=":",Mz=[],Sk=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Az=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const s=[];let a=0,c=0,d=0,u;const f=i.length;for(let x=0;x<f;x++){const C=i[x];if(a===0&&c===0){if(C===xk){s.push(i.slice(d,x)),d=x+1;continue}if(C==="/"){u=x;continue}}C==="["?a++:C==="]"?a--:C==="("?c++:C===")"&&c--}const m=s.length===0?i:i.slice(d);let v=m,b=!1;m.endsWith(k1)?(v=m.slice(0,-1),b=!0):m.startsWith(k1)&&(v=m.slice(1),b=!0);const S=u&&u>d?u-d:void 0;return Sk(s,b,v,S)};if(e){const i=e+xk,s=r;r=a=>a.startsWith(i)?s(a.slice(i.length)):Sk(Mz,!1,a,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},Nz=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const a=n[s],c=a[0]==="[",d=e.has(a);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},Dz=t=>({cache:Tz(t.cacheSize),parseClassName:Az(t),sortModifiers:Nz(t),..._z(t)}),Oz=/\s+/,jz=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=e,a=[],c=t.trim().split(Oz);let d="";for(let u=c.length-1;u>=0;u-=1){const f=c[u],{isExternal:m,modifiers:v,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:x}=n(f);if(m){d=f+(d.length>0?" "+d:d);continue}let C=!!x,k=r(C?S.substring(0,x):S);if(!k){if(!C){d=f+(d.length>0?" "+d:d);continue}if(k=r(S),!k){d=f+(d.length>0?" "+d:d);continue}C=!1}const E=v.length===0?"":v.length===1?v[0]:s(v).join(":"),R=b?E+k1:E,M=R+k;if(a.indexOf(M)>-1)continue;a.push(M);const O=i(k,C);for(let D=0;D<O.length;++D){const P=O[D];a.push(R+P)}d=f+(d.length>0?" "+d:d)}return d},Lz=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=o4(n))&&(i&&(i+=" "),i+=r);return i},o4=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=o4(t[r]))&&(n&&(n+=" "),n+=e);return n},Iz=(t,...e)=>{let n,r,i,s;const a=d=>{const u=e.reduce((f,m)=>m(f),t());return n=Dz(u),r=n.cache.get,i=n.cache.set,s=c,c(d)},c=d=>{const u=r(d);if(u)return u;const f=jz(d,n);return i(d,f),f};return s=a,(...d)=>s(Lz(...d))},Pz=[],rr=t=>{const e=n=>n[t]||Pz;return e.isThemeGetter=!0,e},a4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,l4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Bz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fz=/\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$/,Hz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Uz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oa=t=>zz.test(t),jt=t=>!!t&&!Number.isNaN(Number(t)),ja=t=>!!t&&Number.isInteger(Number(t)),ob=t=>t.endsWith("%")&&jt(t.slice(0,-1)),No=t=>Bz.test(t),c4=()=>!0,Wz=t=>Fz.test(t)&&!Hz.test(t),wy=()=>!1,Vz=t=>$z.test(t),qz=t=>Uz.test(t),Kz=t=>!at(t)&&!ct(t),Gz=t=>il(t,h4,wy),at=t=>a4.test(t),Ml=t=>il(t,f4,Wz),wk=t=>il(t,nB,jt),Yz=t=>il(t,p4,c4),Xz=t=>il(t,m4,wy),Ck=t=>il(t,u4,wy),Qz=t=>il(t,d4,qz),dm=t=>il(t,g4,Vz),ct=t=>l4.test(t),jd=t=>nc(t,f4),Zz=t=>nc(t,m4),kk=t=>nc(t,u4),Jz=t=>nc(t,h4),eB=t=>nc(t,d4),hm=t=>nc(t,g4,!0),tB=t=>nc(t,p4,!0),il=(t,e,n)=>{const r=a4.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},nc=(t,e,n=!1)=>{const r=l4.exec(t);return r?r[1]?e(r[1]):n:!1},u4=t=>t==="position"||t==="percentage",d4=t=>t==="image"||t==="url",h4=t=>t==="length"||t==="size"||t==="bg-size",f4=t=>t==="length",nB=t=>t==="number",m4=t=>t==="family-name",p4=t=>t==="number"||t==="weight",g4=t=>t==="shadow",rB=()=>{const t=rr("color"),e=rr("font"),n=rr("text"),r=rr("font-weight"),i=rr("tracking"),s=rr("leading"),a=rr("breakpoint"),c=rr("container"),d=rr("spacing"),u=rr("radius"),f=rr("shadow"),m=rr("inset-shadow"),v=rr("text-shadow"),b=rr("drop-shadow"),S=rr("blur"),x=rr("perspective"),C=rr("aspect"),k=rr("ease"),E=rr("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"],O=()=>[...M(),ct,at],D=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],z=()=>[ct,at,d],Y=()=>[Oa,"full","auto",...z()],L=()=>[ja,"none","subgrid",ct,at],W=()=>["auto",{span:["full",ja,ct,at]},ja,ct,at],V=()=>[ja,"auto",ct,at],F=()=>["auto","min","max","fr",ct,at],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...z()],G=()=>[Oa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],B=()=>[Oa,"screen","full","dvw","lvw","svw","min","max","fit",...z()],K=()=>[Oa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],A=()=>[t,ct,at],I=()=>[...M(),kk,Ck,{position:[ct,at]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",Jz,Gz,{size:[ct,at]}],X=()=>[ob,jd,Ml],Z=()=>["","none","full",u,ct,at],J=()=>["",jt,jd,Ml],re=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[jt,ob,kk,Ck],me=()=>["","none",S,ct,at],se=()=>["none",jt,ct,at],oe=()=>["none",jt,ct,at],ee=()=>[jt,ct,at],Q=()=>[Oa,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[No],breakpoint:[No],color:[c4],container:[No],"drop-shadow":[No],ease:["in","out","in-out"],font:[Kz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[No],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[No],shadow:[No],spacing:["px",jt],text:[No],"text-shadow":[No],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Oa,at,ct,C]}],container:["container"],columns:[{columns:[jt,at,ct,c]}],"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:O()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[ja,"auto",ct,at]}],basis:[{basis:[Oa,"full","auto",c,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[jt,Oa,"auto","initial","none",at]}],grow:[{grow:["",jt,ct,at]}],shrink:[{shrink:["",jt,ct,at]}],order:[{order:[ja,"first","last","none",ct,at]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[c,"screen",...G()]}],"min-w":[{"min-w":[c,"screen","none",...G()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,jd,Ml]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tB,Yz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ob,at]}],"font-family":[{font:[Zz,Xz,e]}],"font-features":[{"font-features":[at]}],"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:[i,ct,at]}],"line-clamp":[{"line-clamp":[jt,"none",ct,wk]}],leading:[{leading:[s,...z()]}],"list-image":[{"list-image":["none",ct,at]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ct,at]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[jt,"from-font","auto",ct,Ml]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[jt,"auto",ct,at]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ct,at]}],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",ct,at]}],"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:$()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ja,ct,at],radial:["",ct,at],conic:[ja,ct,at]},eB,Qz]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[jt,ct,at]}],"outline-w":[{outline:["",jt,jd,Ml]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",f,hm,dm]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",m,hm,dm]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[jt,Ml]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",v,hm,dm]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[jt,ct,at]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"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":[jt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[ct,at]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[jt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ct,at]}],filter:[{filter:["","none",ct,at]}],blur:[{blur:me()}],brightness:[{brightness:[jt,ct,at]}],contrast:[{contrast:[jt,ct,at]}],"drop-shadow":[{"drop-shadow":["","none",b,hm,dm]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",jt,ct,at]}],"hue-rotate":[{"hue-rotate":[jt,ct,at]}],invert:[{invert:["",jt,ct,at]}],saturate:[{saturate:[jt,ct,at]}],sepia:[{sepia:["",jt,ct,at]}],"backdrop-filter":[{"backdrop-filter":["","none",ct,at]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[jt,ct,at]}],"backdrop-contrast":[{"backdrop-contrast":[jt,ct,at]}],"backdrop-grayscale":[{"backdrop-grayscale":["",jt,ct,at]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jt,ct,at]}],"backdrop-invert":[{"backdrop-invert":["",jt,ct,at]}],"backdrop-opacity":[{"backdrop-opacity":[jt,ct,at]}],"backdrop-saturate":[{"backdrop-saturate":[jt,ct,at]}],"backdrop-sepia":[{"backdrop-sepia":["",jt,ct,at]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ct,at]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[jt,"initial",ct,at]}],ease:[{ease:["linear","initial",k,ct,at]}],delay:[{delay:[jt,ct,at]}],animate:[{animate:["none",E,ct,at]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,ct,at]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[ct,at,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Q()}],"translate-x":[{"translate-x":Q()}],"translate-y":[{"translate-y":Q()}],"translate-z":[{"translate-z":Q()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ct,at]}],"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":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",ct,at]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[jt,jd,Ml,wk]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},iB=Iz(rB);function Ce(...t){return iB(qR(t))}const v4=xP("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 border-input disabled:bg-transparent disabled:text-foreground/50 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"}}),vt=_.forwardRef((t,e)=>{const n=ke.c(24);let r,i,s,a,c,d,u,f;n[0]!==t?({className:s,variant:f,size:d,loading:u,disabled:a,children:i,"aria-busy":r,...c}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=a,n[5]=c,n[6]=d,n[7]=u,n[8]=f):(r=n[1],i=n[2],s=n[3],a=n[4],c=n[5],d=n[6],u=n[7],f=n[8]);const m=u===void 0?!1:u,v=!!(a||m),b=d==="icon"||d==="icon-sm";let S;n[9]!==s||n[10]!==d||n[11]!==f?(S=Ce(v4({variant:f,size:d,className:s})),n[9]=s,n[10]=d,n[11]=f,n[12]=S):S=n[12];const x=m?!0:r;let C;n[13]!==i||n[14]!==b||n[15]!==m?(C=m?b?g.jsx(Fn,{className:"size-4 animate-spin","aria-hidden":!0}):g.jsxs(g.Fragment,{children:[g.jsx(Fn,{className:"mr-2 size-4 shrink-0 animate-spin","aria-hidden":!0}),i]}):i,n[13]=i,n[14]=b,n[15]=m,n[16]=C):C=n[16];let k;return n[17]!==v||n[18]!==c||n[19]!==e||n[20]!==S||n[21]!==x||n[22]!==C?(k=g.jsx("button",{ref:e,className:S,...c,disabled:v,"aria-busy":x,children:C}),n[17]=v,n[18]=c,n[19]=e,n[20]=S,n[21]=x,n[22]=C,n[23]=k):k=n[23],k});vt.displayName="Button";function nt(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Ek(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Cy(...t){return e=>{let n=!1;const r=t.map(i=>{const s=Ek(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Ek(t[i],null)}}}}function Xt(...t){return _.useCallback(Cy(...t),t)}function sB(t,e){const n=_.createContext(e),r=s=>{const{children:a,...c}=s,d=_.useMemo(()=>c,Object.values(c));return g.jsx(n.Provider,{value:d,children:a})};r.displayName=t+"Provider";function i(s){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function Xo(t,e=[]){let n=[];function r(s,a){const c=_.createContext(a),d=n.length;n=[...n,a];const u=m=>{var k;const{scope:v,children:b,...S}=m,x=((k=v==null?void 0:v[t])==null?void 0:k[d])||c,C=_.useMemo(()=>S,Object.values(S));return g.jsx(x.Provider,{value:C,children:b})};u.displayName=s+"Provider";function f(m,v){var x;const b=((x=v==null?void 0:v[t])==null?void 0:x[d])||c,S=_.useContext(b);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${s}\``)}return[u,f]}const i=()=>{const s=n.map(a=>_.createContext(a));return function(c){const d=(c==null?void 0:c[t])||s;return _.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return i.scopeName=t,[r,oB(i,...e)]}function oB(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((c,{useScope:d,scopeName:u})=>{const m=d(s)[`__scope${u}`];return{...c,...m}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var Pr=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},aB=kR[" useId ".trim().toString()]||(()=>{}),lB=0;function Wo(t){const[e,n]=_.useState(aB());return Pr(()=>{n(r=>r??String(lB++))},[t]),e?`radix-${e}`:""}var cB=kR[" useInsertionEffect ".trim().toString()]||Pr;function bu({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,a]=uB({defaultProp:e,onChange:n}),c=t!==void 0,d=c?t:i;{const f=_.useRef(t!==void 0);_.useEffect(()=>{const m=f.current;m!==c&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${c?"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.`),f.current=c},[c,r])}const u=_.useCallback(f=>{var m;if(c){const v=dB(f)?f(t):f;v!==t&&((m=a.current)==null||m.call(a,v))}else s(f)},[c,t,s,a]);return[d,u]}function uB({defaultProp:t,onChange:e}){const[n,r]=_.useState(t),i=_.useRef(n),s=_.useRef(e);return cB(()=>{s.current=e},[e]),_.useEffect(()=>{var a;i.current!==n&&((a=s.current)==null||a.call(s,n),i.current=n)},[n,i]),[n,r,s]}function dB(t){return typeof t=="function"}function Wl(t){const e=hB(t),n=_.forwardRef((r,i)=>{const{children:s,...a}=r,c=_.Children.toArray(s),d=c.find(mB);if(d){const u=d.props.children,f=c.map(m=>m===d?_.Children.count(u)>1?_.Children.only(null):_.isValidElement(u)?u.props.children:null:m);return g.jsx(e,{...a,ref:i,children:_.isValidElement(u)?_.cloneElement(u,void 0,f):null})}return g.jsx(e,{...a,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function hB(t){const e=_.forwardRef((n,r)=>{const{children:i,...s}=n;if(_.isValidElement(i)){const a=gB(i),c=pB(s,i.props);return i.type!==_.Fragment&&(c.ref=r?Cy(r,a):a),_.cloneElement(i,c)}return _.Children.count(i)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var b4=Symbol("radix.slottable");function fB(t){const e=({children:n})=>g.jsx(g.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=b4,e}function mB(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===b4}function pB(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{const d=s(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function gB(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var vB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Bt=vB.reduce((t,e)=>{const n=Wl(`Primitive.${e}`),r=_.forwardRef((i,s)=>{const{asChild:a,...c}=i,d=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(d,{...c,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function _4(t,e){t&&es.flushSync(()=>t.dispatchEvent(e))}function Ss(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function bB(t,e=globalThis==null?void 0:globalThis.document){const n=Ss(t);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var _B="DismissableLayer",E1="dismissableLayer.update",yB="dismissableLayer.pointerDownOutside",xB="dismissableLayer.focusOutside",Rk,y4=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Au=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...d}=t,u=_.useContext(y4),[f,m]=_.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=_.useState({}),S=Xt(e,P=>m(P)),x=Array.from(u.layers),[C]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),k=x.indexOf(C),E=f?x.indexOf(f):-1,R=u.layersWithOutsidePointerEventsDisabled.size>0,M=E>=k,O=CB(P=>{const z=P.target,Y=[...u.branches].some(L=>L.contains(z));!M||Y||(i==null||i(P),a==null||a(P),P.defaultPrevented||c==null||c())},v),D=kB(P=>{const z=P.target;[...u.branches].some(L=>L.contains(z))||(s==null||s(P),a==null||a(P),P.defaultPrevented||c==null||c())},v);return bB(P=>{E===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},v),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Rk=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Tk(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Rk)}},[f,v,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Tk())},[f,u]),_.useEffect(()=>{const P=()=>b({});return document.addEventListener(E1,P),()=>document.removeEventListener(E1,P)},[]),g.jsx(Bt.div,{...d,ref:S,style:{pointerEvents:R?M?"auto":"none":void 0,...t.style},onFocusCapture:nt(t.onFocusCapture,D.onFocusCapture),onBlurCapture:nt(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:nt(t.onPointerDownCapture,O.onPointerDownCapture)})});Au.displayName=_B;var SB="DismissableLayerBranch",wB=_.forwardRef((t,e)=>{const n=_.useContext(y4),r=_.useRef(null),i=Xt(e,r);return _.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(Bt.div,{...t,ref:i})});wB.displayName=SB;function CB(t,e=globalThis==null?void 0:globalThis.document){const n=Ss(t),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let d=function(){x4(yB,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=d,e.addEventListener("click",i.current,{once:!0})):d()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function kB(t,e=globalThis==null?void 0:globalThis.document){const n=Ss(t),r=_.useRef(!1);return _.useEffect(()=>{const i=s=>{s.target&&!r.current&&x4(xB,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Tk(){const t=new CustomEvent(E1);document.dispatchEvent(t)}function x4(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?_4(i,s):i.dispatchEvent(s)}var ab="focusScope.autoFocusOnMount",lb="focusScope.autoFocusOnUnmount",Mk={bubbles:!1,cancelable:!0},EB="FocusScope",Oh=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=t,[c,d]=_.useState(null),u=Ss(i),f=Ss(s),m=_.useRef(null),v=Xt(e,x=>d(x)),b=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let x=function(R){if(b.paused||!c)return;const M=R.target;c.contains(M)?m.current=M:Fa(m.current,{select:!0})},C=function(R){if(b.paused||!c)return;const M=R.relatedTarget;M!==null&&(c.contains(M)||Fa(m.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const O of R)O.removedNodes.length>0&&Fa(c)};document.addEventListener("focusin",x),document.addEventListener("focusout",C);const E=new MutationObserver(k);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",C),E.disconnect()}}},[r,c,b.paused]),_.useEffect(()=>{if(c){Nk.add(b);const x=document.activeElement;if(!c.contains(x)){const k=new CustomEvent(ab,Mk);c.addEventListener(ab,u),c.dispatchEvent(k),k.defaultPrevented||(RB(DB(S4(c)),{select:!0}),document.activeElement===x&&Fa(c))}return()=>{c.removeEventListener(ab,u),setTimeout(()=>{const k=new CustomEvent(lb,Mk);c.addEventListener(lb,f),c.dispatchEvent(k),k.defaultPrevented||Fa(x??document.body,{select:!0}),c.removeEventListener(lb,f),Nk.remove(b)},0)}}},[c,u,f,b]);const S=_.useCallback(x=>{if(!n&&!r||b.paused)return;const C=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(C&&k){const E=x.currentTarget,[R,M]=TB(E);R&&M?!x.shiftKey&&k===M?(x.preventDefault(),n&&Fa(R,{select:!0})):x.shiftKey&&k===R&&(x.preventDefault(),n&&Fa(M,{select:!0})):k===E&&x.preventDefault()}},[n,r,b.paused]);return g.jsx(Bt.div,{tabIndex:-1,...a,ref:v,onKeyDown:S})});Oh.displayName=EB;function RB(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Fa(r,{select:e}),document.activeElement!==n)return}function TB(t){const e=S4(t),n=Ak(e,t),r=Ak(e.reverse(),t);return[n,r]}function S4(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Ak(t,e){for(const n of t)if(!MB(n,{upTo:e}))return n}function MB(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function AB(t){return t instanceof HTMLInputElement&&"select"in t}function Fa(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&AB(t)&&e&&t.select()}}var Nk=NB();function NB(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Dk(t,e),t.unshift(e)},remove(e){var n;t=Dk(t,e),(n=t[0])==null||n.resume()}}}function Dk(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function DB(t){return t.filter(e=>e.tagName!=="A")}var OB="Portal",Nu=_.forwardRef((t,e)=>{var c;const{container:n,...r}=t,[i,s]=_.useState(!1);Pr(()=>s(!0),[]);const a=n||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?WR.createPortal(g.jsx(Bt.div,{...r,ref:e}),a):null});Nu.displayName=OB;function jB(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var os=t=>{const{present:e,children:n}=t,r=LB(e),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),s=Xt(r.ref,IB(i));return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:s}):null};os.displayName="Presence";function LB(t){const[e,n]=_.useState(),r=_.useRef(null),i=_.useRef(t),s=_.useRef("none"),a=t?"mounted":"unmounted",[c,d]=jB(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=fm(r.current);s.current=c==="mounted"?u:"none"},[c]),Pr(()=>{const u=r.current,f=i.current;if(f!==t){const v=s.current,b=fm(u);t?d("MOUNT"):b==="none"||(u==null?void 0:u.display)==="none"?d("UNMOUNT"):d(f&&v!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,d]),Pr(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,m=b=>{const x=fm(r.current).includes(CSS.escape(b.animationName));if(b.target===e&&x&&(d("ANIMATION_END"),!i.current)){const C=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=C)})}},v=b=>{b.target===e&&(s.current=fm(r.current))};return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:_.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function fm(t){return(t==null?void 0:t.animationName)||"none"}function IB(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var cb=0;function lg(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Ok()),document.body.insertAdjacentElement("beforeend",t[1]??Ok()),cb++,()=>{cb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),cb--}},[])}function Ok(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Gs=function(){return Gs=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Gs.apply(this,arguments)};function w4(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function PB(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Qm="right-scroll-bar-position",Zm="width-before-scroll-bar",zB="with-scroll-bars-hidden",BB="--removed-body-scroll-bar-size";function ub(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function FB(t,e){var n=_.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var HB=typeof window<"u"?_.useLayoutEffect:_.useEffect,jk=new WeakMap;function $B(t,e){var n=FB(null,function(r){return t.forEach(function(i){return ub(i,r)})});return HB(function(){var r=jk.get(n);if(r){var i=new Set(r),s=new Set(t),a=n.current;i.forEach(function(c){s.has(c)||ub(c,null)}),s.forEach(function(c){i.has(c)||ub(c,a)})}jk.set(n,t)},[t]),n}function UB(t){return t}function WB(t,e){e===void 0&&(e=UB);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var a=e(s,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(s),a=n}var d=function(){var f=a;a=[],f.forEach(s)},u=function(){return Promise.resolve().then(d)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return i}function VB(t){t===void 0&&(t={});var e=WB(null);return e.options=Gs({async:!0,ssr:!1},t),e}var C4=function(t){var e=t.sideCar,n=w4(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return _.createElement(r,Gs({},n))};C4.isSideCarExport=!0;function qB(t,e){return t.useMedium(e),C4}var k4=VB(),db=function(){},cg=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:db,onWheelCapture:db,onTouchMoveCapture:db}),i=r[0],s=r[1],a=t.forwardProps,c=t.children,d=t.className,u=t.removeScrollBar,f=t.enabled,m=t.shards,v=t.sideCar,b=t.noRelative,S=t.noIsolation,x=t.inert,C=t.allowPinchZoom,k=t.as,E=k===void 0?"div":k,R=t.gapMode,M=w4(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=v,D=$B([n,e]),P=Gs(Gs({},M),i);return _.createElement(_.Fragment,null,f&&_.createElement(O,{sideCar:k4,removeScrollBar:u,shards:m,noRelative:b,noIsolation:S,inert:x,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:R}),a?_.cloneElement(_.Children.only(c),Gs(Gs({},P),{ref:D})):_.createElement(E,Gs({},P,{className:d,ref:D}),c))});cg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cg.classNames={fullWidth:Zm,zeroRight:Qm};var KB=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GB(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=KB();return e&&t.setAttribute("nonce",e),t}function YB(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function XB(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var QB=function(){var t=0,e=null;return{add:function(n){t==0&&(e=GB())&&(YB(e,n),XB(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},ZB=function(){var t=QB();return function(e,n){_.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},E4=function(){var t=ZB(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},JB={left:0,top:0,right:0,gap:0},hb=function(t){return parseInt(t||"",10)||0},e7=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[hb(n),hb(r),hb(i)]},t7=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return JB;var e=e7(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},n7=E4(),cu="data-scroll-locked",r7=function(t,e,n,r){var i=t.left,s=t.top,a=t.right,c=t.gap;return n===void 0&&(n="margin"),`
|
|
420
|
+
.`.concat(zB,` {
|
|
421
|
+
overflow: hidden `).concat(r,`;
|
|
422
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
423
|
+
}
|
|
424
|
+
body[`).concat(cu,`] {
|
|
425
|
+
overflow: hidden `).concat(r,`;
|
|
426
|
+
overscroll-behavior: contain;
|
|
427
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
428
|
+
padding-left: `.concat(i,`px;
|
|
429
|
+
padding-top: `).concat(s,`px;
|
|
430
|
+
padding-right: `).concat(a,`px;
|
|
431
|
+
margin-left:0;
|
|
432
|
+
margin-top:0;
|
|
433
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
434
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.`).concat(Qm,` {
|
|
438
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.`).concat(Zm,` {
|
|
442
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.`).concat(Qm," .").concat(Qm,` {
|
|
446
|
+
right: 0 `).concat(r,`;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.`).concat(Zm," .").concat(Zm,` {
|
|
450
|
+
margin-right: 0 `).concat(r,`;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
body[`).concat(cu,`] {
|
|
454
|
+
`).concat(BB,": ").concat(c,`px;
|
|
455
|
+
}
|
|
456
|
+
`)},Lk=function(){var t=parseInt(document.body.getAttribute(cu)||"0",10);return isFinite(t)?t:0},i7=function(){_.useEffect(function(){return document.body.setAttribute(cu,(Lk()+1).toString()),function(){var t=Lk()-1;t<=0?document.body.removeAttribute(cu):document.body.setAttribute(cu,t.toString())}},[])},s7=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;i7();var s=_.useMemo(function(){return t7(i)},[i]);return _.createElement(n7,{styles:r7(s,!e,i,n?"":"!important")})},R1=!1;if(typeof window<"u")try{var mm=Object.defineProperty({},"passive",{get:function(){return R1=!0,!0}});window.addEventListener("test",mm,mm),window.removeEventListener("test",mm,mm)}catch{R1=!1}var Vc=R1?{passive:!1}:!1,o7=function(t){return t.tagName==="TEXTAREA"},R4=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!o7(t)&&n[e]==="visible")},a7=function(t){return R4(t,"overflowY")},l7=function(t){return R4(t,"overflowX")},Ik=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=T4(t,r);if(i){var s=M4(t,r),a=s[1],c=s[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},c7=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},u7=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},T4=function(t,e){return t==="v"?a7(e):l7(e)},M4=function(t,e){return t==="v"?c7(e):u7(e)},d7=function(t,e){return t==="h"&&e==="rtl"?-1:1},h7=function(t,e,n,r,i){var s=d7(t,window.getComputedStyle(e).direction),a=s*r,c=n.target,d=e.contains(c),u=!1,f=a>0,m=0,v=0;do{if(!c)break;var b=M4(t,c),S=b[0],x=b[1],C=b[2],k=x-C-s*S;(S||k)&&T4(t,c)&&(m+=k,v+=S);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&c!==document.body||d&&(e.contains(c)||e===c));return(f&&Math.abs(m)<1||!f&&Math.abs(v)<1)&&(u=!0),u},pm=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Pk=function(t){return[t.deltaX,t.deltaY]},zk=function(t){return t&&"current"in t?t.current:t},f7=function(t,e){return t[0]===e[0]&&t[1]===e[1]},m7=function(t){return`
|
|
457
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
458
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
459
|
+
`)},p7=0,qc=[];function g7(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(p7++)[0],s=_.useState(E4)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var x=PB([t.lockRef.current],(t.shards||[]).map(zk),!0).filter(Boolean);return x.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var c=_.useCallback(function(x,C){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var k=pm(x),E=n.current,R="deltaX"in x?x.deltaX:E[0]-k[0],M="deltaY"in x?x.deltaY:E[1]-k[1],O,D=x.target,P=Math.abs(R)>Math.abs(M)?"h":"v";if("touches"in x&&P==="h"&&D.type==="range")return!1;var z=window.getSelection(),Y=z&&z.anchorNode,L=Y?Y===D||Y.contains(D):!1;if(L)return!1;var W=Ik(P,D);if(!W)return!0;if(W?O=P:(O=P==="v"?"h":"v",W=Ik(P,D)),!W)return!1;if(!r.current&&"changedTouches"in x&&(R||M)&&(r.current=O),!O)return!0;var V=r.current||O;return h7(V,C,x,V==="h"?R:M)},[]),d=_.useCallback(function(x){var C=x;if(!(!qc.length||qc[qc.length-1]!==s)){var k="deltaY"in C?Pk(C):pm(C),E=e.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&f7(O.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(a.current.shards||[]).map(zk).filter(Boolean).filter(function(O){return O.contains(C.target)}),M=R.length>0?c(C,R[0]):!a.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),u=_.useCallback(function(x,C,k,E){var R={name:x,delta:C,target:k,should:E,shadowParent:v7(k)};e.current.push(R),setTimeout(function(){e.current=e.current.filter(function(M){return M!==R})},1)},[]),f=_.useCallback(function(x){n.current=pm(x),r.current=void 0},[]),m=_.useCallback(function(x){u(x.type,Pk(x),x.target,c(x,t.lockRef.current))},[]),v=_.useCallback(function(x){u(x.type,pm(x),x.target,c(x,t.lockRef.current))},[]);_.useEffect(function(){return qc.push(s),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",d,Vc),document.addEventListener("touchmove",d,Vc),document.addEventListener("touchstart",f,Vc),function(){qc=qc.filter(function(x){return x!==s}),document.removeEventListener("wheel",d,Vc),document.removeEventListener("touchmove",d,Vc),document.removeEventListener("touchstart",f,Vc)}},[]);var b=t.removeScrollBar,S=t.inert;return _.createElement(_.Fragment,null,S?_.createElement(s,{styles:m7(i)}):null,b?_.createElement(s7,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function v7(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const b7=qB(k4,g7);var jh=_.forwardRef(function(t,e){return _.createElement(cg,Gs({},t,{ref:e,sideCar:b7}))});jh.classNames=cg.classNames;var _7=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Kc=new WeakMap,gm=new WeakMap,vm={},fb=0,A4=function(t){return t&&(t.host||A4(t.parentNode))},y7=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=A4(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},x7=function(t,e,n,r){var i=y7(e,Array.isArray(t)?t:[t]);vm[n]||(vm[n]=new WeakMap);var s=vm[n],a=[],c=new Set,d=new Set(i),u=function(m){!m||c.has(m)||(c.add(m),u(m.parentNode))};i.forEach(u);var f=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(v){if(c.has(v))f(v);else try{var b=v.getAttribute(r),S=b!==null&&b!=="false",x=(Kc.get(v)||0)+1,C=(s.get(v)||0)+1;Kc.set(v,x),s.set(v,C),a.push(v),x===1&&S&&gm.set(v,!0),C===1&&v.setAttribute(n,"true"),S||v.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",v,k)}})};return f(e),c.clear(),fb++,function(){a.forEach(function(m){var v=Kc.get(m)-1,b=s.get(m)-1;Kc.set(m,v),s.set(m,b),v||(gm.has(m)||m.removeAttribute(r),gm.delete(m)),b||m.removeAttribute(n)}),fb--,fb||(Kc=new WeakMap,Kc=new WeakMap,gm=new WeakMap,vm={})}},ug=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=_7(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),x7(r,i,n,"aria-hidden")):function(){return null}},dg="Dialog",[N4,yle]=Xo(dg),[S7,Es]=N4(dg),D4=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,c=_.useRef(null),d=_.useRef(null),[u,f]=bu({prop:r,defaultProp:i??!1,onChange:s,caller:dg});return g.jsx(S7,{scope:e,triggerRef:c,contentRef:d,contentId:Wo(),titleId:Wo(),descriptionId:Wo(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(m=>!m),[f]),modal:a,children:n})};D4.displayName=dg;var O4="DialogTrigger",w7=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Es(O4,n),s=Xt(e,i.triggerRef);return g.jsx(Bt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ry(i.open),...r,ref:s,onClick:nt(t.onClick,i.onOpenToggle)})});w7.displayName=O4;var ky="DialogPortal",[C7,j4]=N4(ky,{forceMount:void 0}),L4=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=Es(ky,e);return g.jsx(C7,{scope:e,forceMount:n,children:_.Children.map(r,a=>g.jsx(os,{present:n||s.open,children:g.jsx(Nu,{asChild:!0,container:i,children:a})}))})};L4.displayName=ky;var yp="DialogOverlay",I4=_.forwardRef((t,e)=>{const n=j4(yp,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Es(yp,t.__scopeDialog);return s.modal?g.jsx(os,{present:r||s.open,children:g.jsx(E7,{...i,ref:e})}):null});I4.displayName=yp;var k7=Wl("DialogOverlay.RemoveScroll"),E7=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Es(yp,n);return g.jsx(jh,{as:k7,allowPinchZoom:!0,shards:[i.contentRef],children:g.jsx(Bt.div,{"data-state":Ry(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Vl="DialogContent",P4=_.forwardRef((t,e)=>{const n=j4(Vl,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Es(Vl,t.__scopeDialog);return g.jsx(os,{present:r||s.open,children:s.modal?g.jsx(R7,{...i,ref:e}):g.jsx(T7,{...i,ref:e})})});P4.displayName=Vl;var R7=_.forwardRef((t,e)=>{const n=Es(Vl,t.__scopeDialog),r=_.useRef(null),i=Xt(e,n.contentRef,r);return _.useEffect(()=>{const s=r.current;if(s)return ug(s)},[]),g.jsx(z4,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nt(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:nt(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:nt(t.onFocusOutside,s=>s.preventDefault())})}),T7=_.forwardRef((t,e)=>{const n=Es(Vl,t.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return g.jsx(z4,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,c;(a=t.onCloseAutoFocus)==null||a.call(t,s),s.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var d,u;(d=t.onInteractOutside)==null||d.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),z4=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=t,c=Es(Vl,n),d=_.useRef(null),u=Xt(e,d);return lg(),g.jsxs(g.Fragment,{children:[g.jsx(Oh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:g.jsx(Au,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ry(c.open),...a,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(M7,{titleId:c.titleId}),g.jsx(N7,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Ey="DialogTitle",B4=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Es(Ey,n);return g.jsx(Bt.h2,{id:i.titleId,...r,ref:e})});B4.displayName=Ey;var F4="DialogDescription",H4=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Es(F4,n);return g.jsx(Bt.p,{id:i.descriptionId,...r,ref:e})});H4.displayName=F4;var $4="DialogClose",U4=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Es($4,n);return g.jsx(Bt.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,()=>i.onOpenChange(!1))})});U4.displayName=$4;function Ry(t){return t?"open":"closed"}var W4="DialogTitleWarning",[xle,V4]=sB(W4,{contentName:Vl,titleName:Ey,docsSlug:"dialog"}),M7=({titleId:t})=>{const e=V4(W4),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
460
|
+
|
|
461
|
+
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
462
|
+
|
|
463
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},A7="DialogDescriptionWarning",N7=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${V4(A7).contentName}}.`;return _.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},D7=D4,O7=L4,q4=I4,K4=P4,j7=B4,L7=H4,I7=U4;function Ai(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function T1(t){return t.startsWith("chatId:")?t.slice(7):t}const vh="data-focus-fallback-ignore",G4="data-allow-focus-retain",xp="kaizen:restore-chat-input-focus",Ty="data-chat-input",Sp="data-chat-selection-zone";function zl(t,e){return!!(t!=null&&t.closest(`[${e}]`))}function M1(t){var n;const e=t;return e!=null&&e.matches?e.matches("input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']), textarea, select")||e.isContentEditable||((n=e.getAttribute)==null?void 0:n.call(e,"role"))==="textbox"?!0:zl(t,G4):!1}function P7(t){const e=t;return e!=null&&e.matches?M1(t)||(e.tabIndex??-1)>=0||e.matches("button, a[href], summary")?!0:zl(t,G4):!1}function Bk(t){return!!t.querySelector(`[${vh}][data-state='open']`)}function z7(t){return t?!t.isCollapsed&&t.toString().trim().length>0:!1}function B7(t,e){if(!t)return!1;const n=Array.from(e.querySelectorAll(`textarea[${Ty}]`)).filter(a=>!a.disabled);if(n.length===0)return!1;const r=n.indexOf(t),i=r>=0?(r+1)%n.length:0,s=n[i];return s?(s.focus({preventScroll:!0}),!0):!1}function Fk(t){const{activeElement:e,fallback:n,hasActiveOverlay:r}=t;if(!n||n.disabled||r||e===n)return"none";if(t.trigger==="escape")return t.defaultPrevented||zl(e,Ty)||t.canCancel?"none":"escape-focus";const{pointerStartTarget:i,pointerEndTarget:s,root:a,hasActiveSelection:c}=t,d=s??i;return!a||!d||!a.contains(d)||zl(d,vh)||zl(e,vh)||M1(d)||c&&(zl(i,Sp)||zl(d,Sp))||M1(e)?"none":e&&e===d?"restore":P7(e)?"none":"restore"}const My=D7,F7=O7,Y4=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("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",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx(q4,{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});Y4.displayName=q4.displayName;const H7={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},hg=_.forwardRef((t,e)=>{const n=ke.c(19);let r,i,s,a;n[0]!==t?({className:i,children:r,size:a,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=a):(r=n[1],i=n[2],s=n[3],a=n[4]);const c=a===void 0?"md":a;let d;n[5]===Symbol.for("react.memo_cache_sentinel")?(d=g.jsx(Y4,{}),n[5]=d):d=n[5];let u;n[6]===Symbol.for("react.memo_cache_sentinel")?(u={[vh]:""},n[6]=u):u=n[6];let f;n[7]!==s?(f=x=>{var C;x.preventDefault(),window.dispatchEvent(new Event(xp)),(C=s.onCloseAutoFocus)==null||C.call(s,x)},n[7]=s,n[8]=f):f=n[8];const m=H7[c];let v;n[9]!==i||n[10]!==m?(v=Ce("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 backdrop-blur-md 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",m,i),n[9]=i,n[10]=m,n[11]=v):v=n[11];let b;n[12]===Symbol.for("react.memo_cache_sentinel")?(b=g.jsxs(I7,{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(is,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]}),n[12]=b):b=n[12];let S;return n[13]!==r||n[14]!==s||n[15]!==e||n[16]!==f||n[17]!==v?(S=g.jsxs(F7,{children:[d,g.jsxs(K4,{ref:e,...u,onCloseAutoFocus:f,className:v,...s,children:[r,b]})]}),n[13]=r,n[14]=s,n[15]=e,n[16]=f,n[17]=v,n[18]=S):S=n[18],S});hg.displayName=K4.displayName;function Ay(t){const e=ke.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("text-lg font-medium leading-none tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=g.jsx(j7,{className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Ny(t){const e=ke.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("text-sm text-muted-foreground",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=g.jsx(L7,{className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Dy(t){const e=ke.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=g.jsx("div",{className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Oy(t){const e=ke.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=g.jsx("div",{className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}const jy=_.forwardRef((t,e)=>{const n=ke.c(11);let r,i,s;n[0]!==t?({className:r,type:s,...i}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s):(r=n[1],i=n[2],s=n[3]);let a;n[4]!==r?(a=Ce("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",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==i||n[7]!==e||n[8]!==a||n[9]!==s?(c=g.jsx("input",{ref:e,type:s,className:a,...i}),n[6]=i,n[7]=e,n[8]=a,n[9]=s,n[10]=c):c=n[10],c});jy.displayName="Input";const X4=_.createContext(null);function $7(t){const e=ke.c(34),{children:n}=t,[r,i]=_.useState(null),[s,a]=_.useState(""),c=_.useRef(null);let d,u;e[0]!==r?(d=()=>{(r==null?void 0:r.kind)==="prompt"&&(a(r.options.initialValue??""),setTimeout(()=>{var H,j;(H=c.current)==null||H.focus(),(j=c.current)==null||j.select()},0))},u=[r],e[0]=r,e[1]=d,e[2]=u):(d=e[1],u=e[2]),_.useEffect(d,u);let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{i(null),a("")},e[3]=f):f=e[3];const m=f;let v;e[4]!==r?(v=()=>{r&&(r.kind==="confirm"?r.resolve(!1):r.kind==="prompt"?r.resolve(null):r.resolve(),m())},e[4]=r,e[5]=v):v=e[5];const b=v;let S;e[6]!==r||e[7]!==s?(S=()=>{r&&(r.kind==="confirm"?r.resolve(!0):r.kind==="prompt"?r.resolve(s.trim()||null):r.resolve(),m())},e[6]=r,e[7]=s,e[8]=S):S=e[8];const x=S;let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=H=>new Promise(j=>{i({kind:"confirm",options:H,resolve:j})}),e[9]=C):C=e[9];const k=C;let E;e[10]===Symbol.for("react.memo_cache_sentinel")?(E=H=>new Promise(j=>{i({kind:"prompt",options:H,resolve:j})}),e[10]=E):E=e[10];const R=E;let M;e[11]===Symbol.for("react.memo_cache_sentinel")?(M=H=>new Promise(j=>{i({kind:"alert",options:H,resolve:j})}),e[11]=M):M=e[11];const O=M;let D;e[12]===Symbol.for("react.memo_cache_sentinel")?(D={confirm:k,prompt:R,alert:O},e[12]=D):D=e[12];const P=D,z=r!==null;let Y;e[13]!==r||e[14]!==b?(Y=H=>{H||!r||b()},e[13]=r,e[14]=b,e[15]=Y):Y=e[15];let L;e[16]!==r||e[17]!==x?(L=H=>{H.key!=="Enter"||H.shiftKey||!r||r.kind!=="confirm"||(H.preventDefault(),x())},e[16]=r,e[17]=x,e[18]=L):L=e[18];let W;e[19]!==r||e[20]!==s||e[21]!==b||e[22]!==x?(W=r?g.jsxs(g.Fragment,{children:[g.jsxs(Dy,{className:"space-y-4",children:[g.jsx(Ay,{children:r.options.title}),r.options.description?g.jsx(Ny,{children:r.options.description}):null,r.kind==="prompt"?g.jsx(jy,{ref:c,type:"text",value:s,onChange:H=>a(H.target.value),onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),x())},placeholder:r.options.placeholder}):null]}),g.jsxs(Oy,{children:[g.jsx(vt,{variant:"ghost",size:"sm",onClick:b,className:r.kind==="alert"?"hidden":void 0,children:"cancelLabel"in r.options?r.options.cancelLabel??"Cancel":"Cancel"}),g.jsx(vt,{variant:r.kind==="confirm"?r.options.confirmVariant??"default":"secondary",size:"sm",onClick:x,disabled:r.kind==="prompt"&&!s.trim(),children:r.kind==="alert"?r.options.closeLabel??"OK":"confirmLabel"in r.options?r.options.confirmLabel??"Confirm":"Confirm"})]})]}):null,e[19]=r,e[20]=s,e[21]=b,e[22]=x,e[23]=W):W=e[23];let V;e[24]!==L||e[25]!==W?(V=g.jsx(hg,{size:"sm",onKeyDown:L,children:W}),e[24]=L,e[25]=W,e[26]=V):V=e[26];let F;e[27]!==z||e[28]!==Y||e[29]!==V?(F=g.jsx(My,{open:z,onOpenChange:Y,children:V}),e[27]=z,e[28]=Y,e[29]=V,e[30]=F):F=e[30];let U;return e[31]!==n||e[32]!==F?(U=g.jsxs(X4.Provider,{value:P,children:[n,F]}),e[31]=n,e[32]=F,e[33]=U):U=e[33],U}function Ly(){const t=_.useContext(X4);if(!t)throw new Error("useAppDialog must be used within AppDialogProvider");return t}const fg=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("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",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:s,ref:e,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});fg.displayName="Textarea";function U7(t){return t.trim().length>0}function W7({canSubmit:t,isSubmitting:e}){return{isCreateDisabled:e||!t,isFormDisabled:e,createLabel:e?"Creating...":"Create"}}function V7({open:t,isSubmitting:e=!1,onOpenChange:n,onConfirm:r}){const[i,s]=_.useState(""),[a,c]=_.useState(""),[d,u]=_.useState(!1),f=_.useRef(null),m=_.useRef(!1);_.useEffect(()=>{t&&(s(""),c(""),setTimeout(()=>{var x;return(x=f.current)==null?void 0:x.focus()},0))},[t]),_.useEffect(()=>{t||(m.current=!1,u(!1))},[t]);const v=U7(i),b=W7({canSubmit:v,isSubmitting:e||d}),S=async()=>{if(!(b.isCreateDisabled||m.current)){m.current=!0,u(!0);try{await r({title:i.trim(),description:a.trim()})}finally{m.current=!1,u(!1)}}};return g.jsx(My,{open:t,onOpenChange:x=>{b.isFormDisabled||n(x)},children:g.jsx(hg,{size:"sm",onKeyDown:x=>{b.isFormDisabled||(x.metaKey||x.ctrlKey)&&x.key==="Enter"&&(x.preventDefault(),S())},children:g.jsxs("form",{onSubmit:x=>{x.preventDefault(),S()},children:[g.jsxs(Dy,{className:"space-y-4",children:[g.jsx(Ay,{children:"Create Feature"}),g.jsx(Ny,{children:"Name the feature folder and optionally add a short description for the feature."}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{htmlFor:"feature-title",className:"text-sm font-medium",children:"Feature name"}),g.jsx(jy,{id:"feature-title",ref:f,type:"text",value:i,disabled:b.isFormDisabled,onChange:x=>s(x.target.value),onKeyDown:x=>{b.isFormDisabled||x.key==="Enter"&&(x.preventDefault(),S())},placeholder:"Feature name"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("label",{htmlFor:"feature-description",className:"text-sm font-medium",children:["Description ",g.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),g.jsx(fg,{id:"feature-description",value:a,disabled:b.isFormDisabled,onChange:x=>c(x.target.value),rows:5,placeholder:"Leave blank to add it later"})]})]}),g.jsxs(Oy,{children:[g.jsx(vt,{type:"button",variant:"ghost",size:"sm",disabled:b.isFormDisabled,onClick:()=>n(!1),children:"Cancel"}),g.jsxs(vt,{type:"submit",variant:"secondary",size:"sm",disabled:b.isCreateDisabled,children:[b.isFormDisabled?g.jsx(Fn,{className:"mr-2 size-4 animate-spin"}):null,b.createLabel]})]})]})})})}const Hk=`1. Sign in on the opened Cursor spending page.
|
|
464
|
+
2. Open DevTools > Network.
|
|
465
|
+
3. Refresh the page.
|
|
466
|
+
4. Right-click the get-current-period-usage request.
|
|
467
|
+
5. Copy > Copy as cURL.
|
|
468
|
+
6. Paste it here.`;function q7(t){const e=ke.c(44),{open:n,onOpenChange:r,onSubmit:i}=t,s=_.useRef(null),[a,c]=_.useState(""),[d,u]=_.useState(!1);let f,m;e[0]!==n?(f=()=>{n&&(c(""),setTimeout(()=>{var I;return(I=s.current)==null?void 0:I.focus()},0))},m=[n],e[0]=n,e[1]=f,e[2]=m):(f=e[1],m=e[2]),_.useEffect(f,m);let v;e[3]===Symbol.for("react.memo_cache_sentinel")?(v=async function(){const $=await navigator.clipboard.readText();c($)},e[3]=v):v=e[3];const b=v;let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=async function(){await navigator.clipboard.writeText(Hk),u(!0),setTimeout(()=>u(!1),2e3)},e[4]=S):S=e[4];const x=S;let C;e[5]!==a?(C=a.trim(),e[5]=a,e[6]=C):C=e[6];const k=C.length>0;let E;e[7]!==k||e[8]!==a||e[9]!==i?(E=I=>{I.preventDefault(),k&&i(a.trim())},e[7]=k,e[8]=a,e[9]=i,e[10]=E):E=e[10];let R;e[11]===Symbol.for("react.memo_cache_sentinel")?(R=g.jsx(Ay,{children:"Import Cursor Session"}),e[11]=R):R=e[11];let M,O;e[12]===Symbol.for("react.memo_cache_sentinel")?(M=g.jsxs(Ny,{children:["Paste the copied ",g.jsx("code",{children:"get-current-period-usage"})," curl command and Kaizen will import the session for you."]}),O=g.jsx("div",{className:"rounded-xl border border-border bg-card px-3 py-3 text-sm text-muted-foreground whitespace-pre-line",children:Hk}),e[12]=M,e[13]=O):(M=e[12],O=e[13]);let D;e[14]===Symbol.for("react.memo_cache_sentinel")?(D=g.jsx(vt,{type:"button",variant:"ghost",size:"sm",onClick:()=>void b(),children:"Paste Clipboard"}),e[14]=D):D=e[14];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=()=>void x(),e[15]=P):P=e[15];let z;e[16]!==d?(z=d?g.jsx(di,{className:"h-4 w-4"}):g.jsx(lu,{className:"h-4 w-4"}),e[16]=d,e[17]=z):z=e[17];const Y=d?"Copied":"Copy Steps";let L;e[18]!==Y?(L=g.jsx("span",{className:"ml-1",children:Y}),e[18]=Y,e[19]=L):L=e[19];let W;e[20]!==z||e[21]!==L?(W=g.jsxs("div",{className:"flex gap-2",children:[D,g.jsxs(vt,{type:"button",variant:"ghost",size:"sm",onClick:P,children:[z,L]})]}),e[20]=z,e[21]=L,e[22]=W):W=e[22];let V;e[23]===Symbol.for("react.memo_cache_sentinel")?(V=I=>c(I.target.value),e[23]=V):V=e[23];let F;e[24]!==a?(F=g.jsx(fg,{ref:s,value:a,onChange:V,rows:10,placeholder:"Paste the copied curl command here",className:"font-mono text-xs"}),e[24]=a,e[25]=F):F=e[25];let U;e[26]!==W||e[27]!==F?(U=g.jsxs(Dy,{className:"space-y-4",children:[R,M,O,W,F]}),e[26]=W,e[27]=F,e[28]=U):U=e[28];let H;e[29]!==r?(H=g.jsx(vt,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Cancel"}),e[29]=r,e[30]=H):H=e[30];const j=!k;let G;e[31]!==j?(G=g.jsx(vt,{type:"submit",variant:"secondary",size:"sm",disabled:j,children:"Import Session"}),e[31]=j,e[32]=G):G=e[32];let B;e[33]!==H||e[34]!==G?(B=g.jsxs(Oy,{children:[H,G]}),e[33]=H,e[34]=G,e[35]=B):B=e[35];let K;e[36]!==U||e[37]!==B||e[38]!==E?(K=g.jsx(hg,{size:"lg",children:g.jsxs("form",{onSubmit:E,children:[U,B]})}),e[36]=U,e[37]=B,e[38]=E,e[39]=K):K=e[39];let A;return e[40]!==r||e[41]!==n||e[42]!==K?(A=g.jsx(My,{open:n,onOpenChange:r,children:K}),e[40]=r,e[41]=n,e[42]=K,e[43]=A):A=e[43],A}const K7=["top","right","bottom","left"],nl=Math.min,Mi=Math.max,wp=Math.round,bm=Math.floor,Js=t=>({x:t,y:t}),G7={left:"right",right:"left",bottom:"top",top:"bottom"};function A1(t,e,n){return Mi(t,nl(e,n))}function qo(t,e){return typeof t=="function"?t(e):t}function Ko(t){return t.split("-")[0]}function Du(t){return t.split("-")[1]}function Iy(t){return t==="x"?"y":"x"}function Py(t){return t==="y"?"height":"width"}function Ys(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function zy(t){return Iy(Ys(t))}function Y7(t,e,n){n===void 0&&(n=!1);const r=Du(t),i=zy(t),s=Py(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Cp(a)),[a,Cp(a)]}function X7(t){const e=Cp(t);return[N1(t),e,N1(e)]}function N1(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const $k=["left","right"],Uk=["right","left"],Q7=["top","bottom"],Z7=["bottom","top"];function J7(t,e,n){switch(t){case"top":case"bottom":return n?e?Uk:$k:e?$k:Uk;case"left":case"right":return e?Q7:Z7;default:return[]}}function e9(t,e,n,r){const i=Du(t);let s=J7(Ko(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(N1)))),s}function Cp(t){const e=Ko(t);return G7[e]+t.slice(e.length)}function t9(t){return{top:0,right:0,bottom:0,left:0,...t}}function Q4(t){return typeof t!="number"?t9(t):{top:t,right:t,bottom:t,left:t}}function kp(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Wk(t,e,n){let{reference:r,floating:i}=t;const s=Ys(e),a=zy(e),c=Py(a),d=Ko(e),u=s==="y",f=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,v=r[c]/2-i[c]/2;let b;switch(d){case"top":b={x:f,y:r.y-i.height};break;case"bottom":b={x:f,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-i.width,y:m};break;default:b={x:r.x,y:r.y}}switch(Du(e)){case"start":b[a]-=v*(n&&u?-1:1);break;case"end":b[a]+=v*(n&&u?-1:1);break}return b}async function n9(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:c,strategy:d}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:v=!1,padding:b=0}=qo(e,t),S=Q4(b),C=c[v?m==="floating"?"reference":"floating":m],k=kp(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(C)))==null||n?C:C.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:d})),E=m==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),M=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},O=kp(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:R,strategy:d}):E);return{top:(k.top-O.top+S.top)/M.y,bottom:(O.bottom-k.bottom+S.bottom)/M.y,left:(k.left-O.left+S.left)/M.x,right:(O.right-k.right+S.right)/M.x}}const r9=50,i9=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:n9},d=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:m}=Wk(u,r,d),v=r,b=0;const S={};for(let x=0;x<s.length;x++){const C=s[x];if(!C)continue;const{name:k,fn:E}=C,{x:R,y:M,data:O,reset:D}=await E({x:f,y:m,initialPlacement:r,placement:v,strategy:i,middlewareData:S,rects:u,platform:c,elements:{reference:t,floating:e}});f=R??f,m=M??m,S[k]={...S[k],...O},D&&b<r9&&(b++,typeof D=="object"&&(D.placement&&(v=D.placement),D.rects&&(u=D.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):D.rects),{x:f,y:m}=Wk(u,v,d)),x=-1)}return{x:f,y:m,placement:v,strategy:i,middlewareData:S}},s9=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:c,middlewareData:d}=e,{element:u,padding:f=0}=qo(t,e)||{};if(u==null)return{};const m=Q4(f),v={x:n,y:r},b=zy(i),S=Py(b),x=await a.getDimensions(u),C=b==="y",k=C?"top":"left",E=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=s.reference[S]+s.reference[b]-v[b]-s.floating[S],O=v[b]-s.reference[b],D=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let P=D?D[R]:0;(!P||!await(a.isElement==null?void 0:a.isElement(D)))&&(P=c.floating[R]||s.floating[S]);const z=M/2-O/2,Y=P/2-x[S]/2-1,L=nl(m[k],Y),W=nl(m[E],Y),V=L,F=P-x[S]-W,U=P/2-x[S]/2+z,H=A1(V,U,F),j=!d.arrow&&Du(i)!=null&&U!==H&&s.reference[S]/2-(U<V?L:W)-x[S]/2<0,G=j?U<V?U-V:U-F:0;return{[b]:v[b]+G,data:{[b]:H,centerOffset:U-H-G,...j&&{alignmentOffset:G}},reset:j}}}),o9=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:c,platform:d,elements:u}=e,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:x=!0,...C}=qo(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const k=Ko(i),E=Ys(c),R=Ko(c)===c,M=await(d.isRTL==null?void 0:d.isRTL(u.floating)),O=v||(R||!x?[Cp(c)]:X7(c)),D=S!=="none";!v&&D&&O.push(...e9(c,x,S,M));const P=[c,...O],z=await d.detectOverflow(e,C),Y=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&Y.push(z[k]),m){const U=Y7(i,a,M);Y.push(z[U[0]],z[U[1]])}if(L=[...L,{placement:i,overflows:Y}],!Y.every(U=>U<=0)){var W,V;const U=(((W=s.flip)==null?void 0:W.index)||0)+1,H=P[U];if(H&&(!(m==="alignment"?E!==Ys(H):!1)||L.every(B=>Ys(B.placement)===E?B.overflows[0]>0:!0)))return{data:{index:U,overflows:L},reset:{placement:H}};let j=(V=L.filter(G=>G.overflows[0]<=0).sort((G,B)=>G.overflows[1]-B.overflows[1])[0])==null?void 0:V.placement;if(!j)switch(b){case"bestFit":{var F;const G=(F=L.filter(B=>{if(D){const K=Ys(B.placement);return K===E||K==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(K=>K>0).reduce((K,A)=>K+A,0)]).sort((B,K)=>B[1]-K[1])[0])==null?void 0:F[0];G&&(j=G);break}case"initialPlacement":j=c;break}if(i!==j)return{reset:{placement:j}}}return{}}}};function Vk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function qk(t){return K7.some(e=>t[e]>=0)}const a9=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=qo(t,e);switch(i){case"referenceHidden":{const a=await r.detectOverflow(e,{...s,elementContext:"reference"}),c=Vk(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:qk(c)}}}case"escaped":{const a=await r.detectOverflow(e,{...s,altBoundary:!0}),c=Vk(a,n.floating);return{data:{escapedOffsets:c,escaped:qk(c)}}}default:return{}}}}},Z4=new Set(["left","top"]);async function l9(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Ko(n),c=Du(n),d=Ys(n)==="y",u=Z4.has(a)?-1:1,f=s&&d?-1:1,m=qo(e,t);let{mainAxis:v,crossAxis:b,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof S=="number"&&(b=c==="end"?S*-1:S),d?{x:b*f,y:v*u}:{x:v*u,y:b*f}}const c9=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:c}=e,d=await l9(e,t);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:s+d.y,data:{...d,placement:a}}}}},u9=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:d={fn:k=>{let{x:E,y:R}=k;return{x:E,y:R}}},...u}=qo(t,e),f={x:n,y:r},m=await s.detectOverflow(e,u),v=Ys(Ko(i)),b=Iy(v);let S=f[b],x=f[v];if(a){const k=b==="y"?"top":"left",E=b==="y"?"bottom":"right",R=S+m[k],M=S-m[E];S=A1(R,S,M)}if(c){const k=v==="y"?"top":"left",E=v==="y"?"bottom":"right",R=x+m[k],M=x-m[E];x=A1(R,x,M)}const C=d.fn({...e,[b]:S,[v]:x});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[b]:a,[v]:c}}}}}},d9=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=e,{offset:c=0,mainAxis:d=!0,crossAxis:u=!0}=qo(t,e),f={x:n,y:r},m=Ys(i),v=Iy(m);let b=f[v],S=f[m];const x=qo(c,e),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(d){const R=v==="y"?"height":"width",M=s.reference[v]-s.floating[R]+C.mainAxis,O=s.reference[v]+s.reference[R]-C.mainAxis;b<M?b=M:b>O&&(b=O)}if(u){var k,E;const R=v==="y"?"width":"height",M=Z4.has(Ko(i)),O=s.reference[m]-s.floating[R]+(M&&((k=a.offset)==null?void 0:k[m])||0)+(M?0:C.crossAxis),D=s.reference[m]+s.reference[R]+(M?0:((E=a.offset)==null?void 0:E[m])||0)-(M?C.crossAxis:0);S<O?S=O:S>D&&(S=D)}return{[v]:b,[m]:S}}}},h9=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:a,elements:c}=e,{apply:d=()=>{},...u}=qo(t,e),f=await a.detectOverflow(e,u),m=Ko(i),v=Du(i),b=Ys(i)==="y",{width:S,height:x}=s.floating;let C,k;m==="top"||m==="bottom"?(C=m,k=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(k=m,C=v==="end"?"top":"bottom");const E=x-f.top-f.bottom,R=S-f.left-f.right,M=nl(x-f[C],E),O=nl(S-f[k],R),D=!e.middlewareData.shift;let P=M,z=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(z=R),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(P=E),D&&!v){const L=Mi(f.left,0),W=Mi(f.right,0),V=Mi(f.top,0),F=Mi(f.bottom,0);b?z=S-2*(L!==0||W!==0?L+W:Mi(f.left,f.right)):P=x-2*(V!==0||F!==0?V+F:Mi(f.top,f.bottom))}await d({...e,availableWidth:z,availableHeight:P});const Y=await a.getDimensions(c.floating);return S!==Y.width||x!==Y.height?{reset:{rects:!0}}:{}}}};function mg(){return typeof window<"u"}function Ou(t){return J4(t)?(t.nodeName||"").toLowerCase():"#document"}function Di(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ro(t){var e;return(e=(J4(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function J4(t){return mg()?t instanceof Node||t instanceof Di(t).Node:!1}function ws(t){return mg()?t instanceof Element||t instanceof Di(t).Element:!1}function Qo(t){return mg()?t instanceof HTMLElement||t instanceof Di(t).HTMLElement:!1}function Kk(t){return!mg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Di(t).ShadowRoot}function Lh(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Cs(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function f9(t){return/^(table|td|th)$/.test(Ou(t))}function pg(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const m9=/transform|translate|scale|rotate|perspective|filter/,p9=/paint|layout|strict|content/,Al=t=>!!t&&t!=="none";let mb;function By(t){const e=ws(t)?Cs(t):t;return Al(e.transform)||Al(e.translate)||Al(e.scale)||Al(e.rotate)||Al(e.perspective)||!Fy()&&(Al(e.backdropFilter)||Al(e.filter))||m9.test(e.willChange||"")||p9.test(e.contain||"")}function g9(t){let e=rl(t);for(;Qo(e)&&!_u(e);){if(By(e))return e;if(pg(e))return null;e=rl(e)}return null}function Fy(){return mb==null&&(mb=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),mb}function _u(t){return/^(html|body|#document)$/.test(Ou(t))}function Cs(t){return Di(t).getComputedStyle(t)}function gg(t){return ws(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function rl(t){if(Ou(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Kk(t)&&t.host||ro(t);return Kk(e)?e.host:e}function eT(t){const e=rl(t);return _u(e)?t.ownerDocument?t.ownerDocument.body:t.body:Qo(e)&&Lh(e)?e:eT(e)}function bh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=eT(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=Di(i);if(s){const c=D1(a);return e.concat(a,a.visualViewport||[],Lh(i)?i:[],c&&n?bh(c):[])}else return e.concat(i,bh(i,[],n))}function D1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function tT(t){const e=Cs(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Qo(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,c=wp(n)!==s||wp(r)!==a;return c&&(n=s,r=a),{width:n,height:r,$:c}}function Hy(t){return ws(t)?t:t.contextElement}function uu(t){const e=Hy(t);if(!Qo(e))return Js(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=tT(e);let a=(s?wp(n.width):n.width)/r,c=(s?wp(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const v9=Js(0);function nT(t){const e=Di(t);return!Fy()||!e.visualViewport?v9:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function b9(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Di(t)?!1:e}function ql(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Hy(t);let a=Js(1);e&&(r?ws(r)&&(a=uu(r)):a=uu(t));const c=b9(s,n,r)?nT(s):Js(0);let d=(i.left+c.x)/a.x,u=(i.top+c.y)/a.y,f=i.width/a.x,m=i.height/a.y;if(s){const v=Di(s),b=r&&ws(r)?Di(r):r;let S=v,x=D1(S);for(;x&&r&&b!==S;){const C=uu(x),k=x.getBoundingClientRect(),E=Cs(x),R=k.left+(x.clientLeft+parseFloat(E.paddingLeft))*C.x,M=k.top+(x.clientTop+parseFloat(E.paddingTop))*C.y;d*=C.x,u*=C.y,f*=C.x,m*=C.y,d+=R,u+=M,S=Di(x),x=D1(S)}}return kp({width:f,height:m,x:d,y:u})}function vg(t,e){const n=gg(t).scrollLeft;return e?e.left+n:ql(ro(t)).left+n}function rT(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-vg(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function _9(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=ro(r),c=e?pg(e.floating):!1;if(r===a||c&&s)return n;let d={scrollLeft:0,scrollTop:0},u=Js(1);const f=Js(0),m=Qo(r);if((m||!m&&!s)&&((Ou(r)!=="body"||Lh(a))&&(d=gg(r)),m)){const b=ql(r);u=uu(r),f.x=b.x+r.clientLeft,f.y=b.y+r.clientTop}const v=a&&!m&&!s?rT(a,d):Js(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+f.x+v.x,y:n.y*u.y-d.scrollTop*u.y+f.y+v.y}}function y9(t){return Array.from(t.getClientRects())}function x9(t){const e=ro(t),n=gg(t),r=t.ownerDocument.body,i=Mi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Mi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+vg(t);const c=-n.scrollTop;return Cs(r).direction==="rtl"&&(a+=Mi(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:c}}const Gk=25;function S9(t,e){const n=Di(t),r=ro(t),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,c=0,d=0;if(i){s=i.width,a=i.height;const f=Fy();(!f||f&&e==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const u=vg(r);if(u<=0){const f=r.ownerDocument,m=f.body,v=getComputedStyle(m),b=f.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,S=Math.abs(r.clientWidth-m.clientWidth-b);S<=Gk&&(s-=S)}else u<=Gk&&(s+=u);return{width:s,height:a,x:c,y:d}}function w9(t,e){const n=ql(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Qo(t)?uu(t):Js(1),a=t.clientWidth*s.x,c=t.clientHeight*s.y,d=i*s.x,u=r*s.y;return{width:a,height:c,x:d,y:u}}function Yk(t,e,n){let r;if(e==="viewport")r=S9(t,n);else if(e==="document")r=x9(ro(t));else if(ws(e))r=w9(e,n);else{const i=nT(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return kp(r)}function iT(t,e){const n=rl(t);return n===e||!ws(n)||_u(n)?!1:Cs(n).position==="fixed"||iT(n,e)}function C9(t,e){const n=e.get(t);if(n)return n;let r=bh(t,[],!1).filter(c=>ws(c)&&Ou(c)!=="body"),i=null;const s=Cs(t).position==="fixed";let a=s?rl(t):t;for(;ws(a)&&!_u(a);){const c=Cs(a),d=By(a);!d&&c.position==="fixed"&&(i=null),(s?!d&&!i:!d&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Lh(a)&&!d&&iT(t,a))?r=r.filter(f=>f!==a):i=c,a=rl(a)}return e.set(t,r),r}function k9(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?pg(e)?[]:C9(e,this._c):[].concat(n),r],c=Yk(e,a[0],i);let d=c.top,u=c.right,f=c.bottom,m=c.left;for(let v=1;v<a.length;v++){const b=Yk(e,a[v],i);d=Mi(b.top,d),u=nl(b.right,u),f=nl(b.bottom,f),m=Mi(b.left,m)}return{width:u-m,height:f-d,x:m,y:d}}function E9(t){const{width:e,height:n}=tT(t);return{width:e,height:n}}function R9(t,e,n){const r=Qo(e),i=ro(e),s=n==="fixed",a=ql(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const d=Js(0);function u(){d.x=vg(i)}if(r||!r&&!s)if((Ou(e)!=="body"||Lh(i))&&(c=gg(e)),r){const b=ql(e,!0,s,e);d.x=b.x+e.clientLeft,d.y=b.y+e.clientTop}else i&&u();s&&!r&&i&&u();const f=i&&!r&&!s?rT(i,c):Js(0),m=a.left+c.scrollLeft-d.x-f.x,v=a.top+c.scrollTop-d.y-f.y;return{x:m,y:v,width:a.width,height:a.height}}function pb(t){return Cs(t).position==="static"}function Xk(t,e){if(!Qo(t)||Cs(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ro(t)===n&&(n=n.ownerDocument.body),n}function sT(t,e){const n=Di(t);if(pg(t))return n;if(!Qo(t)){let i=rl(t);for(;i&&!_u(i);){if(ws(i)&&!pb(i))return i;i=rl(i)}return n}let r=Xk(t,e);for(;r&&f9(r)&&pb(r);)r=Xk(r,e);return r&&_u(r)&&pb(r)&&!By(r)?n:r||g9(t)||n}const T9=async function(t){const e=this.getOffsetParent||sT,n=this.getDimensions,r=await n(t.floating);return{reference:R9(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function M9(t){return Cs(t).direction==="rtl"}const A9={convertOffsetParentRelativeRectToViewportRelativeRect:_9,getDocumentElement:ro,getClippingRect:k9,getOffsetParent:sT,getElementRects:T9,getClientRects:y9,getDimensions:E9,getScale:uu,isElement:ws,isRTL:M9};function oT(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function N9(t,e){let n=null,r;const i=ro(t);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),s();const u=t.getBoundingClientRect(),{left:f,top:m,width:v,height:b}=u;if(c||e(),!v||!b)return;const S=bm(m),x=bm(i.clientWidth-(f+v)),C=bm(i.clientHeight-(m+b)),k=bm(f),R={rootMargin:-S+"px "+-x+"px "+-C+"px "+-k+"px",threshold:Mi(0,nl(1,d))||1};let M=!0;function O(D){const P=D[0].intersectionRatio;if(P!==d){if(!M)return a();P?a(!1,P):r=setTimeout(()=>{a(!1,1e-7)},1e3)}P===1&&!oT(u,t.getBoundingClientRect())&&a(),M=!1}try{n=new IntersectionObserver(O,{...R,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,R)}n.observe(t)}return a(!0),s}function D9(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,u=Hy(t),f=i||s?[...u?bh(u):[],...e?bh(e):[]]:[];f.forEach(k=>{i&&k.addEventListener("scroll",n,{passive:!0}),s&&k.addEventListener("resize",n)});const m=u&&c?N9(u,n):null;let v=-1,b=null;a&&(b=new ResizeObserver(k=>{let[E]=k;E&&E.target===u&&b&&e&&(b.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(e)})),n()}),u&&!d&&b.observe(u),e&&b.observe(e));let S,x=d?ql(t):null;d&&C();function C(){const k=ql(t);x&&!oT(x,k)&&n(),x=k,S=requestAnimationFrame(C)}return n(),()=>{var k;f.forEach(E=>{i&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),m==null||m(),(k=b)==null||k.disconnect(),b=null,d&&cancelAnimationFrame(S)}}const O9=c9,j9=u9,L9=o9,I9=h9,P9=a9,Qk=s9,z9=d9,B9=(t,e,n)=>{const r=new Map,i={platform:A9,...n},s={...i.platform,_c:r};return i9(t,e,{...i,platform:s})};var F9=typeof document<"u",H9=function(){},Jm=F9?_.useLayoutEffect:H9;function Ep(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Ep(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Ep(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function aT(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Zk(t,e){const n=aT(t);return Math.round(e*n)/n}function gb(t){const e=_.useRef(t);return Jm(()=>{e.current=t}),e}function $9(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:d,open:u}=t,[f,m]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,b]=_.useState(r);Ep(v,r)||b(r);const[S,x]=_.useState(null),[C,k]=_.useState(null),E=_.useCallback(B=>{B!==D.current&&(D.current=B,x(B))},[]),R=_.useCallback(B=>{B!==P.current&&(P.current=B,k(B))},[]),M=s||S,O=a||C,D=_.useRef(null),P=_.useRef(null),z=_.useRef(f),Y=d!=null,L=gb(d),W=gb(i),V=gb(u),F=_.useCallback(()=>{if(!D.current||!P.current)return;const B={placement:e,strategy:n,middleware:v};W.current&&(B.platform=W.current),B9(D.current,P.current,B).then(K=>{const A={...K,isPositioned:V.current!==!1};U.current&&!Ep(z.current,A)&&(z.current=A,es.flushSync(()=>{m(A)}))})},[v,e,n,W,V]);Jm(()=>{u===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,m(B=>({...B,isPositioned:!1})))},[u]);const U=_.useRef(!1);Jm(()=>(U.current=!0,()=>{U.current=!1}),[]),Jm(()=>{if(M&&(D.current=M),O&&(P.current=O),M&&O){if(L.current)return L.current(M,O,F);F()}},[M,O,F,L,Y]);const H=_.useMemo(()=>({reference:D,floating:P,setReference:E,setFloating:R}),[E,R]),j=_.useMemo(()=>({reference:M,floating:O}),[M,O]),G=_.useMemo(()=>{const B={position:n,left:0,top:0};if(!j.floating)return B;const K=Zk(j.floating,f.x),A=Zk(j.floating,f.y);return c?{...B,transform:"translate("+K+"px, "+A+"px)",...aT(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:A}},[n,c,j.floating,f.x,f.y]);return _.useMemo(()=>({...f,update:F,refs:H,elements:j,floatingStyles:G}),[f,F,H,j,G])}const U9=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Qk({element:r.current,padding:i}).fn(n):{}:r?Qk({element:r,padding:i}).fn(n):{}}}},W9=(t,e)=>{const n=O9(t);return{name:n.name,fn:n.fn,options:[t,e]}},V9=(t,e)=>{const n=j9(t);return{name:n.name,fn:n.fn,options:[t,e]}},q9=(t,e)=>({fn:z9(t).fn,options:[t,e]}),K9=(t,e)=>{const n=L9(t);return{name:n.name,fn:n.fn,options:[t,e]}},G9=(t,e)=>{const n=I9(t);return{name:n.name,fn:n.fn,options:[t,e]}},Y9=(t,e)=>{const n=P9(t);return{name:n.name,fn:n.fn,options:[t,e]}},X9=(t,e)=>{const n=U9(t);return{name:n.name,fn:n.fn,options:[t,e]}};var Q9="Arrow",lT=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return g.jsx(Bt.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});lT.displayName=Q9;var Z9=lT;function J9(t){const[e,n]=_.useState(void 0);return Pr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,c;if("borderBoxSize"in s){const d=s.borderBoxSize,u=Array.isArray(d)?d[0]:d;a=u.inlineSize,c=u.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var $y="Popper",[cT,sl]=Xo($y),[eF,uT]=cT($y),dT=t=>{const{__scopePopper:e,children:n}=t,[r,i]=_.useState(null);return g.jsx(eF,{scope:e,anchor:r,onAnchorChange:i,children:n})};dT.displayName=$y;var hT="PopperAnchor",fT=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=uT(hT,n),a=_.useRef(null),c=Xt(e,a),d=_.useRef(null);return _.useEffect(()=>{const u=d.current;d.current=(r==null?void 0:r.current)||a.current,u!==d.current&&s.onAnchorChange(d.current)}),r?null:g.jsx(Bt.div,{...i,ref:c})});fT.displayName=hT;var Uy="PopperContent",[tF,nF]=cT(Uy),mT=_.forwardRef((t,e)=>{var re,ae,ue,me,se,oe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:S,...x}=t,C=uT(Uy,n),[k,E]=_.useState(null),R=Xt(e,ee=>E(ee)),[M,O]=_.useState(null),D=J9(M),P=(D==null?void 0:D.width)??0,z=(D==null?void 0:D.height)??0,Y=r+(s!=="center"?"-"+s:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},W=Array.isArray(u)?u:[u],V=W.length>0,F={padding:L,boundary:W.filter(iF),altBoundary:V},{refs:U,floatingStyles:H,placement:j,isPositioned:G,middlewareData:B}=$9({strategy:"fixed",placement:Y,whileElementsMounted:(...ee)=>D9(...ee,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[W9({mainAxis:i+z,alignmentAxis:a}),d&&V9({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?q9():void 0,...F}),d&&K9({...F}),G9({...F,apply:({elements:ee,rects:Q,availableWidth:te,availableHeight:he})=>{const{width:ie,height:xe}=Q.reference,Ae=ee.floating.style;Ae.setProperty("--radix-popper-available-width",`${te}px`),Ae.setProperty("--radix-popper-available-height",`${he}px`),Ae.setProperty("--radix-popper-anchor-width",`${ie}px`),Ae.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),M&&X9({element:M,padding:c}),sF({arrowWidth:P,arrowHeight:z}),v&&Y9({strategy:"referenceHidden",...F})]}),[K,A]=vT(j),I=Ss(S);Pr(()=>{G&&(I==null||I())},[G,I]);const $=(re=B.arrow)==null?void 0:re.x,T=(ae=B.arrow)==null?void 0:ae.y,X=((ue=B.arrow)==null?void 0:ue.centerOffset)!==0,[Z,J]=_.useState();return Pr(()=>{k&&J(window.getComputedStyle(k).zIndex)},[k]),g.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:G?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(me=B.transformOrigin)==null?void 0:me.x,(se=B.transformOrigin)==null?void 0:se.y].join(" "),...((oe=B.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(tF,{scope:n,placedSide:K,onArrowChange:O,arrowX:$,arrowY:T,shouldHideArrow:X,children:g.jsx(Bt.div,{"data-side":K,"data-align":A,...x,ref:R,style:{...x.style,animation:G?void 0:"none"}})})})});mT.displayName=Uy;var pT="PopperArrow",rF={top:"bottom",right:"left",bottom:"top",left:"right"},gT=_.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=nF(pT,r),a=rF[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(Z9,{...i,ref:n,style:{...i.style,display:"block"}})})});gT.displayName=pT;function iF(t){return t!==null}var sF=t=>({name:"transformOrigin",options:t,fn(e){var C,k,E;const{placement:n,rects:r,middlewareData:i}=e,a=((C=i.arrow)==null?void 0:C.centerOffset)!==0,c=a?0:t.arrowWidth,d=a?0:t.arrowHeight,[u,f]=vT(n),m={start:"0%",center:"50%",end:"100%"}[f],v=(((k=i.arrow)==null?void 0:k.x)??0)+c/2,b=(((E=i.arrow)==null?void 0:E.y)??0)+d/2;let S="",x="";return u==="bottom"?(S=a?m:`${v}px`,x=`${-d}px`):u==="top"?(S=a?m:`${v}px`,x=`${r.floating.height+d}px`):u==="right"?(S=`${-d}px`,x=a?m:`${b}px`):u==="left"&&(S=`${r.floating.width+d}px`,x=a?m:`${b}px`),{data:{x:S,y:x}}}});function vT(t){const[e,n="center"]=t.split("-");return[e,n]}var bg=dT,Ih=fT,_g=mT,yg=gT,bT=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"}),oF="VisuallyHidden",_T=_.forwardRef((t,e)=>g.jsx(Bt.span,{...t,ref:e,style:{...bT,...t.style}}));_T.displayName=oF;var aF=_T,[xg,Sle]=Xo("Tooltip",[sl]),Sg=sl(),yT="TooltipProvider",lF=700,O1="tooltip.open",[cF,Wy]=xg(yT),xT=t=>{const{__scopeTooltip:e,delayDuration:n=lF,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,a=_.useRef(!0),c=_.useRef(!1),d=_.useRef(0);return _.useEffect(()=>{const u=d.current;return()=>window.clearTimeout(u)},[]),g.jsx(cF,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:_.useCallback(u=>{c.current=u},[]),disableHoverableContent:i,children:s})};xT.displayName=yT;var _h="Tooltip",[uF,Ph]=xg(_h),ST=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:c}=t,d=Wy(_h,t.__scopeTooltip),u=Sg(e),[f,m]=_.useState(null),v=Wo(),b=_.useRef(0),S=a??d.disableHoverableContent,x=c??d.delayDuration,C=_.useRef(!1),[k,E]=bu({prop:r,defaultProp:i??!1,onChange:P=>{P?(d.onOpen(),document.dispatchEvent(new CustomEvent(O1))):d.onClose(),s==null||s(P)},caller:_h}),R=_.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),M=_.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,E(!0)},[E]),O=_.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E(!1)},[E]),D=_.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,E(!0),b.current=0},x)},[x,E]);return _.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),g.jsx(bg,{...u,children:g.jsx(uF,{scope:e,contentId:v,open:k,stateAttribute:R,trigger:f,onTriggerChange:m,onTriggerEnter:_.useCallback(()=>{d.isOpenDelayedRef.current?D():M()},[d.isOpenDelayedRef,D,M]),onTriggerLeave:_.useCallback(()=>{S?O():(window.clearTimeout(b.current),b.current=0)},[O,S]),onOpen:M,onClose:O,disableHoverableContent:S,children:n})})};ST.displayName=_h;var j1="TooltipTrigger",wT=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Ph(j1,n),s=Wy(j1,n),a=Sg(n),c=_.useRef(null),d=Xt(e,c,i.onTriggerChange),u=_.useRef(!1),f=_.useRef(!1),m=_.useCallback(()=>u.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),g.jsx(Ih,{asChild:!0,...a,children:g.jsx(Bt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:nt(t.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:nt(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:nt(t.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:nt(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:nt(t.onBlur,i.onClose),onClick:nt(t.onClick,i.onClose)})})});wT.displayName=j1;var Vy="TooltipPortal",[dF,hF]=xg(Vy,{forceMount:void 0}),CT=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,s=Ph(Vy,e);return g.jsx(dF,{scope:e,forceMount:n,children:g.jsx(os,{present:n||s.open,children:g.jsx(Nu,{asChild:!0,container:i,children:r})})})};CT.displayName=Vy;var yu="TooltipContent",kT=_.forwardRef((t,e)=>{const n=hF(yu,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,a=Ph(yu,t.__scopeTooltip);return g.jsx(os,{present:r||a.open,children:a.disableHoverableContent?g.jsx(ET,{side:i,...s,ref:e}):g.jsx(fF,{side:i,...s,ref:e})})}),fF=_.forwardRef((t,e)=>{const n=Ph(yu,t.__scopeTooltip),r=Wy(yu,t.__scopeTooltip),i=_.useRef(null),s=Xt(e,i),[a,c]=_.useState(null),{trigger:d,onClose:u}=n,f=i.current,{onPointerInTransitChange:m}=r,v=_.useCallback(()=>{c(null),m(!1)},[m]),b=_.useCallback((S,x)=>{const C=S.currentTarget,k={x:S.clientX,y:S.clientY},E=bF(k,C.getBoundingClientRect()),R=_F(k,E),M=yF(x.getBoundingClientRect()),O=SF([...R,...M]);c(O),m(!0)},[m]);return _.useEffect(()=>()=>v(),[v]),_.useEffect(()=>{if(d&&f){const S=C=>b(C,f),x=C=>b(C,d);return d.addEventListener("pointerleave",S),f.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",S),f.removeEventListener("pointerleave",x)}}},[d,f,b,v]),_.useEffect(()=>{if(a){const S=x=>{const C=x.target,k={x:x.clientX,y:x.clientY},E=(d==null?void 0:d.contains(C))||(f==null?void 0:f.contains(C)),R=!xF(k,a);E?v():R&&(v(),u())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[d,f,a,u,v]),g.jsx(ET,{...t,ref:s})}),[mF,pF]=xg(_h,{isInside:!1}),gF=fB("TooltipContent"),ET=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...c}=t,d=Ph(yu,n),u=Sg(n),{onClose:f}=d;return _.useEffect(()=>(document.addEventListener(O1,f),()=>document.removeEventListener(O1,f)),[f]),_.useEffect(()=>{if(d.trigger){const m=v=>{const b=v.target;b!=null&&b.contains(d.trigger)&&f()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,f]),g.jsx(Au,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:f,children:g.jsxs(_g,{"data-state":d.stateAttribute,...u,...c,ref:e,style:{...c.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(gF,{children:r}),g.jsx(mF,{scope:n,isInside:!0,children:g.jsx(aF,{id:d.contentId,role:"tooltip",children:i||r})})]})})});kT.displayName=yu;var RT="TooltipArrow",vF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Sg(n);return pF(RT,n).isInside?null:g.jsx(yg,{...i,...r,ref:e})});vF.displayName=RT;function bF(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function _F(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function yF(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function xF(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const c=e[s],d=e[a],u=c.x,f=c.y,m=d.x,v=d.y;f>r!=v>r&&n<(m-u)*(r-f)/(v-f)+u&&(i=!i)}return i}function SF(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),wF(e)}function wF(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var CF=xT,TT=ST,MT=wT,AT=CT,qy=kT;function kF(t){const e=ke.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("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",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=g.jsx("kbd",{className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function EF(t){const e=ke.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("inline-flex items-center gap-0.5",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=g.jsx("span",{className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}const RF="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",TF=CF,zo=TT,Bo=MT,Fo=_.forwardRef((t,e)=>{const n=ke.c(11);let r,i,s;n[0]!==t?({className:r,sideOffset:s,...i}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s):(r=n[1],i=n[2],s=n[3]);const a=s===void 0?4:s;let c;n[4]!==r?(c=Ce("z-50 overflow-hidden rounded-md bg-card text-card-foreground border border-border backdrop-blur-md 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",r),n[4]=r,n[5]=c):c=n[5];let d;return n[6]!==i||n[7]!==e||n[8]!==a||n[9]!==c?(d=g.jsx(AT,{children:g.jsx(qy,{ref:e,sideOffset:a,className:c,...i})}),n[6]=i,n[7]=e,n[8]=a,n[9]=c,n[10]=d):d=n[10],d});Fo.displayName=qy.displayName;const Gd=TT,Yd=MT;function NT(t){return t.toUpperCase()}function MF(t){const e=t.split("+");return g.jsx(EF,{children:e.map((n,r)=>g.jsx(kF,{children:NT(n)},`${n}-${r}`))})}const Fl=_.forwardRef((t,e)=>{const n=ke.c(17);let r,i,s,a,c;n[0]!==t?({className:i,sideOffset:c,children:r,shortcut:a,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=a,n[5]=c):(r=n[1],i=n[2],s=n[3],a=n[4],c=n[5]);const d=c===void 0?4:c,u=a===void 0?null:Array.isArray(a)?a[0]??null:a;let f;n[6]!==i?(f=Ce(RF,i),n[6]=i,n[7]=f):f=n[7];let m;n[8]!==r||n[9]!==u?(m=u?MF(u):g.jsx("span",{children:typeof r=="string"?NT(r):r}),n[8]=r,n[9]=u,n[10]=m):m=n[10];let v;return n[11]!==s||n[12]!==e||n[13]!==d||n[14]!==f||n[15]!==m?(v=g.jsx(AT,{children:g.jsx(qy,{ref:e,sideOffset:d,className:f,...s,children:m})}),n[11]=s,n[12]=e,n[13]=d,n[14]=f,n[15]=m,n[16]=v):v=n[16],v});Fl.displayName="HotkeyTooltipContent";const AF="0.7.2",NF={version:AF},ys="Kaizen",Jk="kaizen",DF=".kaizen",OF=".kaizen-dev",wle=".kaizen",jF="KAIZEN_RUNTIME_PROFILE",LF=`kaizen/${NF.version}`,IF="[kaizen]",Cle=`~/${ys}`,Ky="kaizen:";function ju(){var e;return(e=globalThis.process)==null?void 0:e.env}function PF(t=ju()){const e=t==null?void 0:t[jF];return(e==null?void 0:e.trim().toLowerCase())==="dev"?"dev":"prod"}function zF(t=ju()){return PF(t)==="dev"?OF:DF}function DT(t=ju()){return`~/${zF(t)}`}function kle(t=ju()){return`${DT(t)}/keybindings.json`}function BF(t=ju()){return`${DT(t)}/themes`}function FF(t=ju()){return`${BF(t)}/THEME_README.md`}function Ele(t){return t?`${Jk} ${t}`:Jk}function HF(t){return t==="claude"||t==="codex"||t==="gemini"||t==="cursor"||t==="openrouter"}function $F(t){return HF(t)?t:null}const Rp=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],L1=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],I1=[{id:"off",label:"Off"},{id:"standard",label:"Standard"},{id:"high",label:"High"}],P1="claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]",OT=[{id:"composer-2[fast=true]",label:"Composer 2",supportsEffort:!1},{id:"composer-1.5[]",label:"Composer 1.5",supportsEffort:!1},{id:"gpt-5.3-codex[reasoning=medium,fast=false]",label:"Codex 5.3",supportsEffort:!1},{id:"gpt-5.4[reasoning=medium,context=272k,fast=false]",label:"GPT-5.4",supportsEffort:!1},{id:"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]",label:"Sonnet 4.6",supportsEffort:!1},{id:"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]",label:"Opus 4.6",supportsEffort:!1},{id:"claude-opus-4-5[thinking=true]",label:"Opus 4.5",supportsEffort:!1},{id:"gpt-5.2[reasoning=medium,fast=false]",label:"GPT-5.2",supportsEffort:!1},{id:"gemini-3.1-pro[]",label:"Gemini 3.1 Pro",supportsEffort:!1},{id:"gpt-5.4-mini[reasoning=medium]",label:"GPT-5.4 Mini",supportsEffort:!1},{id:"gpt-5.4-nano[reasoning=medium]",label:"GPT-5.4 Nano",supportsEffort:!1},{id:"claude-haiku-4-5[thinking=true]",label:"Haiku 4.5",supportsEffort:!1},{id:"gpt-5.3-codex-spark[reasoning=medium]",label:"Codex 5.3 Spark",supportsEffort:!1},{id:"grok-4-20[thinking=true]",label:"Grok 4.20",supportsEffort:!1},{id:"claude-sonnet-4-5[thinking=true,context=200k]",label:"Sonnet 4.5",supportsEffort:!1},{id:"gpt-5.2-codex[reasoning=medium,fast=false]",label:"Codex 5.2",supportsEffort:!1},{id:"gemini-3-flash[]",label:"Gemini 3 Flash",supportsEffort:!1},{id:"claude-sonnet-4[thinking=false,context=200k]",label:"Sonnet 4",supportsEffort:!1},{id:"kimi-k2.5[]",label:"Kimi K2.5",supportsEffort:!1}],UF={"composer-2-fast":"composer-2[fast=true]","composer-1.5":"composer-1.5[]","gpt-5.3-codex":"gpt-5.3-codex[reasoning=medium,fast=false]","gpt-5.4":"gpt-5.4[reasoning=medium,context=272k,fast=false]","gpt-5.4-medium":"gpt-5.4[reasoning=medium,context=272k,fast=false]","claude-4.6-sonnet-medium-thinking":"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]","claude-4.6-opus-high-thinking":"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]","claude-4.5-opus-high-thinking":"claude-opus-4-5[thinking=true]","gpt-5.2":"gpt-5.2[reasoning=medium,fast=false]","gemini-3.1-pro":"gemini-3.1-pro[]","gpt-5.4-mini":"gpt-5.4-mini[reasoning=medium]","gpt-5.4-mini-medium":"gpt-5.4-mini[reasoning=medium]","gpt-5.4-nano":"gpt-5.4-nano[reasoning=medium]","gpt-5.4-nano-medium":"gpt-5.4-nano[reasoning=medium]","claude-haiku-4.5":"claude-haiku-4-5[thinking=true]","gpt-5.3-codex-spark-preview":"gpt-5.3-codex-spark[reasoning=medium]","grok-4-20":"grok-4-20[thinking=true]","grok-4-20-thinking":"grok-4-20[thinking=true]","claude-4.5-sonnet-thinking":"claude-sonnet-4-5[thinking=true,context=200k]","gpt-5.2-codex":"gpt-5.2-codex[reasoning=medium,fast=false]","gemini-3-flash":"gemini-3-flash[]","claude-4-sonnet":"claude-sonnet-4[thinking=false,context=200k]","kimi-k2.5":"kimi-k2.5[]"};function WF(t){return t?OT.some(e=>e.id===t)?t:UF[t]??P1:P1}function eE(t){const e=t.indexOf("[");return e>=0?t.slice(0,e):t}function Lu(t){const e=t.match(/\bfast=(true|false)\b/);return e?e[1]==="true"?"fast":"standard":null}function tE(t){return Rp.some(e=>e.id===t)}function nE(t){return L1.some(e=>e.id===t)}const z1=[{id:"200k",label:"200k"},{id:"1m",label:"1M"}];function VF(t){return I1.some(e=>e.id===t)}const qF={image:!0,markdown:!0,document:!0},KF={image:!0,markdown:!0,document:!1},GF={image:!0,markdown:!0,document:!0},YF={image:!0,markdown:!0,document:!0},XF={image:!0,markdown:!0,document:!0},QF={openrouter:"account",providerUsage:"account",handoff:"account",remoteRelay:"paid",browserNotifications:"paid",installMobilePush:"paid",syncedSettings:"paid",syncedKeybindings:"paid",syncedHandoffs:"paid",crossDeviceStorage:"paid"},rc=[{id:"claude",label:"Claude",systemActive:!0,defaultModel:"sonnet",defaultEffort:"high",defaultModelOptions:{reasoningEffort:"high",contextWindow:"200k"},supportsPlanMode:!0,attachmentCapabilities:qF,models:[{id:"opus",label:"Opus",supportsEffort:!0,contextWindowOptions:[...z1]},{id:"sonnet",label:"Sonnet",supportsEffort:!0,contextWindowOptions:[...z1]},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...Rp]},{id:"codex",label:"Codex",systemActive:!0,defaultModel:"gpt-5.4",defaultModelOptions:{reasoningEffort:"high",fastMode:!1},supportsPlanMode:!0,attachmentCapabilities:KF,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:[]},{id:"gemini",label:"Gemini",systemActive:!1,defaultModel:"auto-gemini-2.5",defaultModelOptions:{thinkingMode:"standard"},supportsPlanMode:!0,attachmentCapabilities:GF,models:[{id:"auto-gemini-3",label:"Auto (Gemini 3)",supportsEffort:!1},{id:"auto-gemini-2.5",label:"Auto (Gemini 2.5)",supportsEffort:!1},{id:"gemini-3.1-pro-preview",label:"3.1 Pro Preview",supportsEffort:!1},{id:"gemini-3-pro-preview",label:"3 Pro Preview",supportsEffort:!1},{id:"gemini-3-flash-preview",label:"3 Flash Preview",supportsEffort:!1},{id:"gemini-2.5-pro",label:"2.5 Pro",supportsEffort:!1},{id:"gemini-2.5-flash",label:"2.5 Flash",supportsEffort:!1},{id:"gemini-2.5-flash-lite",label:"2.5 Flash Lite",supportsEffort:!1}],efforts:[]},{id:"cursor",label:"Cursor",systemActive:!0,defaultModel:P1,defaultModelOptions:{},supportsPlanMode:!0,attachmentCapabilities:YF,models:[...OT],efforts:[]},{id:"openrouter",label:"OpenRouter",systemActive:!0,defaultModel:"opencode/big-pickle",defaultModelOptions:{},supportsPlanMode:!0,attachmentCapabilities:XF,models:[{id:"opencode/big-pickle",label:"Big Pickle",supportsEffort:!1},{id:"opencode/gpt-5-nano",label:"GPT-5 Nano",supportsEffort:!1},{id:"opencode/mimo-v2-omni-free",label:"MiMo V2 Omni Free",supportsEffort:!1},{id:"opencode/mimo-v2-pro-free",label:"MiMo V2 Pro Free",supportsEffort:!1},{id:"opencode/minimax-m2.5-free",label:"MiniMax M2.5 Free",supportsEffort:!1},{id:"opencode/nemotron-3-super-free",label:"Nemotron 3 Super Free",supportsEffort:!1},{id:"opencode/qwen3.6-plus-free",label:"Qwen3.6 Plus Free",supportsEffort:!1},{id:"openrouter/anthropic/claude-sonnet-4",label:"Claude Sonnet 4",supportsEffort:!1},{id:"openrouter/anthropic/claude-opus-4",label:"Claude Opus 4",supportsEffort:!1},{id:"openrouter/openai/gpt-5.4",label:"GPT-5.4",supportsEffort:!1},{id:"openrouter/google/gemini-2.5-pro",label:"Gemini 2.5 Pro",supportsEffort:!1},{id:"openrouter/deepseek/deepseek-r1",label:"DeepSeek R1",supportsEffort:!1},{id:"openrouter/meta-llama/llama-4-maverick",label:"Llama 4 Maverick",supportsEffort:!1}],efforts:[]}],Tp={claude:{active:!0},codex:{active:!0},gemini:{active:!0},cursor:{active:!0},openrouter:{active:!1}};function Zn(t,e=rc){const n=e.find(r=>r.id===t);if(!n)throw new Error(`Unknown provider: ${t}`);return n}function wg(t,e){const n=e?t.models.find(r=>r.id===e):void 0;return(n==null?void 0:n.attachmentCapabilities)??t.attachmentCapabilities}function Gy(t,e){const n=Tp[e],r=t==null?void 0:t[e];return{active:(r==null?void 0:r.active)??n.active}}function ZF(t,e,n=rc){var s;const r=Zn(t,n),i=Gy(e,t);return r.systemActive&&i.active?null:!r.systemActive&&((s=r.availabilityMessage)!=null&&s.trim())?r.availabilityMessage:`Provider ${r.label} is currently not active.`}function JF(t,e,n=rc){const r=Zn(t,n),i=Gy(e,t);return r.systemActive&&i.active}function eH(t,e){return t.map(n=>{const r=Gy(e,n.id),i=n.systemActive&&r.active;return{...n,active:r.active,isSelectable:i,isUsageEnabled:i,isInactive:!i,inactiveMessage:ZF(n.id,e,t)}})}function tH(t,e){return eH(t,e).filter(n=>n.isSelectable).map(({active:n,isSelectable:r,isUsageEnabled:i,isInactive:s,inactiveMessage:a,...c})=>c)}function jT(t){return tH(rc,t)}function Kr(t){return Zn(t).defaultModelOptions}const LT=Kr("claude");Kr("codex");Kr("gemini");Kr("cursor");Kr("openrouter");function nH(t){return Zn("claude").models.find(e=>e.id===t)}function rH(t){var e;return((e=nH(t))==null?void 0:e.contextWindowOptions)??[]}function iH(t,e){const n=rH(t);if(n.length!==0)return n.some(r=>r.id===e)?e:LT.contextWindow}const sH=["idea","todo","progress","testing","done"],rE={idea:"IDEA",todo:"TODO",progress:"PROGRESS",testing:"TESTING",done:"DONE"},Lo={submitChatMessage:["enter"],toggleQuickPrompts:["cmd+e","ctrl+e"],toggleProjectsSidebar:["ctrl+a"],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+/"]},Mp=8,IT=10*1024*1024,oH=20*1024*1024,aH=1*1024*1024,Ap=["image/png","image/jpeg","image/webp","image/gif"],PT=["application/pdf"],zT=["text/markdown","text/x-markdown"],lH="/assets/icon-4rSnra9R.svg";function sh(t){const e=ke.c(10);let n,r,i;e[0]!==t?({alt:i,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const s=i===void 0?"":i;let a;e[4]!==n?(a=Ce("shrink-0 object-contain",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==r||e[8]!==a?(c=g.jsx("img",{alt:s,src:lH,className:a,...r}),e[6]=s,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}var Cg="Popover",[BT,Rle]=Xo(Cg,[sl]),zh=sl(),[cH,ol]=BT(Cg),FT=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!1}=t,c=zh(e),d=_.useRef(null),[u,f]=_.useState(!1),[m,v]=bu({prop:r,defaultProp:i??!1,onChange:s,caller:Cg});return g.jsx(bg,{...c,children:g.jsx(cH,{scope:e,contentId:Wo(),triggerRef:d,open:m,onOpenChange:v,onOpenToggle:_.useCallback(()=>v(b=>!b),[v]),hasCustomAnchor:u,onCustomAnchorAdd:_.useCallback(()=>f(!0),[]),onCustomAnchorRemove:_.useCallback(()=>f(!1),[]),modal:a,children:n})})};FT.displayName=Cg;var HT="PopoverAnchor",$T=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=ol(HT,n),s=zh(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=i;return _.useEffect(()=>(a(),()=>c()),[a,c]),g.jsx(Ih,{...s,...r,ref:e})});$T.displayName=HT;var UT="PopoverTrigger",WT=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=ol(UT,n),s=zh(n),a=Xt(e,i.triggerRef),c=g.jsx(Bt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":YT(i.open),...r,ref:a,onClick:nt(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:g.jsx(Ih,{asChild:!0,...s,children:c})});WT.displayName=UT;var Yy="PopoverPortal",[uH,dH]=BT(Yy,{forceMount:void 0}),VT=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=ol(Yy,e);return g.jsx(uH,{scope:e,forceMount:n,children:g.jsx(os,{present:n||s.open,children:g.jsx(Nu,{asChild:!0,container:i,children:r})})})};VT.displayName=Yy;var xu="PopoverContent",qT=_.forwardRef((t,e)=>{const n=dH(xu,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=ol(xu,t.__scopePopover);return g.jsx(os,{present:r||s.open,children:s.modal?g.jsx(fH,{...i,ref:e}):g.jsx(mH,{...i,ref:e})})});qT.displayName=xu;var hH=Wl("PopoverContent.RemoveScroll"),fH=_.forwardRef((t,e)=>{const n=ol(xu,t.__scopePopover),r=_.useRef(null),i=Xt(e,r),s=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return ug(a)},[]),g.jsx(jh,{as:hH,allowPinchZoom:!0,children:g.jsx(KT,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nt(t.onCloseAutoFocus,a=>{var c;a.preventDefault(),s.current||(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:nt(t.onPointerDownOutside,a=>{const c=a.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,u=c.button===2||d;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:nt(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),mH=_.forwardRef((t,e)=>{const n=ol(xu,t.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return g.jsx(KT,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,c;(a=t.onCloseAutoFocus)==null||a.call(t,s),s.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var d,u;(d=t.onInteractOutside)==null||d.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),KT=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:f,...m}=t,v=ol(xu,n),b=zh(n);return lg(),g.jsx(Oh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:g.jsx(Au,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:g.jsx(_g,{"data-state":YT(v.open),role:"dialog",id:v.contentId,...b,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),GT="PopoverClose",pH=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=ol(GT,n);return g.jsx(Bt.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,()=>i.onOpenChange(!1))})});pH.displayName=GT;var gH="PopoverArrow",vH=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=zh(n);return g.jsx(yg,{...i,...r,ref:e})});vH.displayName=gH;function YT(t){return t?"open":"closed"}var XT=FT,bH=$T,_H=WT,QT=VT,Xy=qT;const Qy=XT,Zy=_H,kg=_.forwardRef((t,e)=>{const n=ke.c(17);let r,i,s,a;n[0]!==t?({className:r,align:s,sideOffset:a,...i}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=a):(r=n[1],i=n[2],s=n[3],a=n[4]);const c=s===void 0?"center":s,d=a===void 0?4:a;let u;n[5]===Symbol.for("react.memo_cache_sentinel")?(u={[vh]:""},n[5]=u):u=n[5];let f;n[6]!==i?(f=b=>{var S;b.preventDefault(),window.dispatchEvent(new Event(xp)),(S=i.onCloseAutoFocus)==null||S.call(i,b)},n[6]=i,n[7]=f):f=n[7];let m;n[8]!==r?(m=Ce("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg backdrop-blur-md 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",r),n[8]=r,n[9]=m):m=n[9];let v;return n[10]!==c||n[11]!==i||n[12]!==e||n[13]!==d||n[14]!==f||n[15]!==m?(v=g.jsx(QT,{children:g.jsx(Xy,{ref:e,align:c,sideOffset:d,...u,onCloseAutoFocus:f,className:m,...i})}),n[10]=c,n[11]=i,n[12]=e,n[13]=d,n[14]=f,n[15]=m,n[16]=v):v=n[16],v});kg.displayName=Xy.displayName;function yH(t){const e=ke.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("shrink-0",n),e[3]=n,e[4]=i):i=e[4];let s;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=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"}),e[5]=s):s=e[5];let a;return e[6]!==r||e[7]!==i?(a=g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:i,...r,children:s}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function xH(t){const e=ke.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("shrink-0",n),e[3]=n,e[4]=i):i=e[4];let s;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=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"}),e[5]=s):s=e[5];let a;return e[6]!==r||e[7]!==i?(a=g.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:i,...r,children:s}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function SH(t){const e=ke.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("shrink-0",n),e[3]=n,e[4]=i):i=e[4];let s;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=g.jsx("path",{d:"M12 0C12 0 12 8 8 12C4 16 0 12 0 12C0 12 4 12 8 12C12 12 12 16 12 24C12 24 12 16 16 12C20 8 24 12 24 12C24 12 16 12 16 12C12 12 12 4 12 0Z"}),e[5]=s):s=e[5];let a;return e[6]!==r||e[7]!==i?(a=g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:i,...r,children:s}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function wH(t){const e=ke.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("shrink-0",n),e[3]=n,e[4]=i):i=e[4];let s;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=g.jsx("path",{d:"M12 0 2.4 5.5v13L12 24l9.6-5.5v-13Zm0 3.1 6.8 3.9v5.1L15 14.3V9.7L12 8l-3 1.7v4.6l-3.8-2.2V7Zm-6.8 9.8 3.8 2.2v4.5l3 1.8 3-1.8v-4.5l3.8-2.2v3.8L12 20.9l-6.8-3.9Z"}),e[5]=s):s=e[5];let a;return e[6]!==r||e[7]!==i?(a=g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:i,...r,children:s}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function CH(t){const e=ke.c(11);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("shrink-0",n),e[3]=n,e[4]=i):i=e[4];let s,a,c;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=g.jsx("path",{d:"M12 2.75c2.83 0 5.14 2.28 5.19 5.1l1.72.99A7.25 7.25 0 0 0 5.4 13.45l-1.7.98A9.25 9.25 0 0 1 12 2.75Z",fill:"currentColor"}),a=g.jsx("path",{d:"M19.34 8.2a9.25 9.25 0 0 1-3.4 12.65 9.2 9.2 0 0 1-5.22 1.25v-1.98a7.24 7.24 0 0 0 7.25-12.56l1.37.64Z",fill:"currentColor",opacity:".8"}),c=g.jsx("path",{d:"M8.4 21.02A9.26 9.26 0 0 1 3.3 9.58l1.72.99A7.24 7.24 0 0 0 15.9 18.8l-.02 1.58a9.2 9.2 0 0 1-7.48.64Z",fill:"currentColor",opacity:".6"}),e[5]=s,e[6]=a,e[7]=c):(s=e[5],a=e[6],c=e[7]);let d;return e[8]!==r||e[9]!==i?(d=g.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:i,...r,children:[s,a,c]}),e[8]=r,e[9]=i,e[10]=d):d=e[10],d}function kH(t){return!(t.startsWith("gemini-3")||t==="auto-gemini-3")}const EH=["Composer","GPT","Claude","Gemini","Grok","Kimi"];function RH(t){return t.startsWith("composer-")?"Composer":t.startsWith("gpt-")?"GPT":t.startsWith("claude-")?"Claude":t.startsWith("gemini-")?"Gemini":t.startsWith("grok-")?"Grok":"Kimi"}function iE(t){return{Standard:"Std","Fast Mode":"Fast",Medium:"Med",Minimal:"Min",XHigh:"XHi"}[t]??t}function vb(t,e){const n=Lu(e);return!n||n==="standard"?t:`${t} (${n==="fast"?"Fast":"Standard"})`}const Np={claude:yH,codex:xH,gemini:SH,cursor:wH,openrouter:CH},_m={auto:gn,opus:Gn,sonnet:gn,haiku:qr,"gpt-5.4":Gn,"gpt-5.4[reasoning=medium,context=272k,fast=false]":Gn,"gpt-5.4-mini[reasoning=medium]":gn,"gpt-5.4-nano[reasoning=medium]":qr,"gpt-5.3-codex":gn,"gpt-5.3-codex[reasoning=medium,fast=false]":gn,"gpt-5.3-codex-spark[reasoning=medium]":qr,"gpt-5.2[reasoning=medium,fast=false]":gn,"gpt-5.2-codex[reasoning=medium,fast=false]":gn,"gpt-5.3-codex-spark":qr,"gemini-2.5-pro":Gn,"gemini-2.5-flash":gn,"gemini-2.5-flash-lite":qr,"auto-gemini-3":Gn,"auto-gemini-2.5":gn,"gemini-3.1-pro-preview":Gn,"gemini-3.1-pro[]":Gn,"gemini-3-flash[]":gn,"gemini-3-pro-preview":Gn,"gemini-3-flash-preview":gn,"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]":Gn,"claude-opus-4-5[thinking=true]":Gn,"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]":gn,"claude-sonnet-4-5[thinking=true,context=200k]":gn,"claude-sonnet-4[thinking=false,context=200k]":gn,"claude-haiku-4-5[thinking=true]":qr,"opencode/big-pickle":Gn,"opencode/gpt-5-nano":qr,"opencode/mimo-v2-omni-free":gn,"opencode/mimo-v2-pro-free":gn,"opencode/minimax-m2.5-free":gn,"opencode/nemotron-3-super-free":Gn,"opencode/qwen3.6-plus-free":Gn,"openrouter/anthropic/claude-sonnet-4":gn,"openrouter/anthropic/claude-opus-4":Gn,"openrouter/openai/gpt-5.4":Gn,"openrouter/google/gemini-2.5-pro":Gn,"openrouter/deepseek/deepseek-r1":Gn,"openrouter/meta-llama/llama-4-maverick":gn,"grok-4-20[thinking=true]":Gn,"kimi-k2.5[]":gn,"composer-2[fast=true]":Gn,"composer-1.5[]":gn};function oi(t){const e=ke.c(16),{onClick:n,selected:r,icon:i,label:s,description:a,disabled:c}=t,d=r?"bg-muted border-border":"hover:opacity-60",u=c&&"opacity-40 cursor-not-allowed";let f;e[0]!==d||e[1]!==u?(f=Ce("w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity",d,u),e[0]=d,e[1]=u,e[2]=f):f=e[2];let m;e[3]!==s?(m=g.jsx("div",{className:"text-sm font-medium",children:s}),e[3]=s,e[4]=m):m=e[4];let v;e[5]!==a?(v=a?g.jsx("div",{className:"text-xs text-muted-foreground",children:a}):null,e[5]=a,e[6]=v):v=e[6];let b;e[7]!==m||e[8]!==v?(b=g.jsxs("div",{children:[m,v]}),e[7]=m,e[8]=v,e[9]=b):b=e[9];let S;return e[10]!==c||e[11]!==i||e[12]!==n||e[13]!==f||e[14]!==b?(S=g.jsxs("button",{onClick:n,disabled:c,className:f,children:[i,b]}),e[10]=c,e[11]=i,e[12]=n,e[13]=f,e[14]=b,e[15]=S):S=e[15],S}function La(t){const e=ke.c(18),{trigger:n,triggerClassName:r,disabled:i,children:s}=t,a=i===void 0?!1:i,[c,d]=_.useState(!1);if(a){let S;e[0]!==r?(S=Ce("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default",r),e[0]=r,e[1]=S):S=e[1];let x;return e[2]!==S||e[3]!==n?(x=g.jsx("button",{disabled:!0,className:S,children:n}),e[2]=S,e[3]=n,e[4]=x):x=e[4],x}let u;e[5]!==r?(u=Ce("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0","hover:bg-muted/50",r),e[5]=r,e[6]=u):u=e[6];let f;e[7]!==u||e[8]!==n?(f=g.jsx(Zy,{asChild:!0,children:g.jsx("button",{className:u,children:n})}),e[7]=u,e[8]=n,e[9]=f):f=e[9];let m;e[10]!==s?(m=typeof s=="function"?s(()=>d(!1)):s,e[10]=s,e[11]=m):m=e[11];let v;e[12]!==m?(v=g.jsx(kg,{align:"center",className:"w-64 p-1",children:g.jsx("div",{className:"max-h-[min(24rem,60vh)] space-y-1 overflow-y-auto pr-1",children:m})}),e[12]=m,e[13]=v):v=e[13];let b;return e[14]!==c||e[15]!==f||e[16]!==v?(b=g.jsxs(Qy,{open:c,onOpenChange:d,children:[f,v]}),e[14]=c,e[15]=f,e[16]=v,e[17]=b):b=e[17],b}function TH(t){var tt,it,ce,Re,Ue,Je,Ve;const e=ke.c(38),{availableProviders:n,selectedProvider:r,lockedProviders:i,disabled:s,showProviderPicker:a,providerLocked:c,model:d,modelOptions:u,onProviderChange:f,onModelChange:m,onClaudeReasoningEffortChange:v,onClaudeContextWindowChange:b,onCodexReasoningEffortChange:S,onGeminiThinkingModeChange:x,onCodexFastModeChange:C,planMode:k,onPlanModeChange:E,pendingPlanMode:R,includePlanMode:M,className:O}=t,D=s===void 0?!1:s,P=a===void 0?!0:a,z=c===void 0?!1:c,Y=k===void 0?!1:k,L=R===void 0?null:R,W=M===void 0?!0:M,[V,F]=_.useState(null),U=n.find(ze=>ze.id===r)??Zn(r),H=Np[r],j=_m[d]??gn,G=W&&(U==null?void 0:U.supportsPlanMode)&&E,B=L??Y,K=L!==null,A=r==="claude"?u:null,I=r==="codex"?u:null,$=r==="gemini"?u:null,T=((tt=U.models.find(ze=>ze.id===d))==null?void 0:tt.contextWindowOptions)??[],X=(A==null?void 0:A.contextWindow)??z1[0].id,Z=X==="1m"?bk:_k,J=r==="claude"||r==="codex",re=r==="cursor"?Lu(d):null,ae=U.id==="cursor"?U.models.filter(ze=>eE(ze.id)===eE(d)):[],ue=r==="cursor"&&ae.some(OH)&&ae.some(DH),me=U.id==="cursor"?EH.map(ze=>({family:ze,models:U.models.filter(He=>RH(He.id)===ze)})).filter(NH):[];let se;e[0]!==J||e[1]!==u||e[2]!==r?(se=J?r==="claude"?((it=Rp.find(ze=>ze.id===u.reasoningEffort))==null?void 0:it.label)??String(u.reasoningEffort):((ce=L1.find(ze=>ze.id===u.reasoningEffort))==null?void 0:ce.label)??String(u.reasoningEffort):null,e[0]=J,e[1]=u,e[2]=r,e[3]=se):se=e[3];const oe=se;let ee;e[4]!==($==null?void 0:$.thinkingMode)||e[5]!==r?(ee=r==="gemini"?((Re=I1.find(ze=>ze.id===($==null?void 0:$.thinkingMode)))==null?void 0:Re.label)??($==null?void 0:$.thinkingMode)??"Standard":null,e[4]=$==null?void 0:$.thinkingMode,e[5]=r,e[6]=ee):ee=e[6];const Q=ee;let te;e[7]===Symbol.for("react.memo_cache_sentinel")?(te=()=>{F(null)},e[7]=te):te=e[7];let he;e[8]!==r?(he=[r],e[8]=r,e[9]=he):he=e[9],_.useEffect(te,he);const ie=D&&"pointer-events-none opacity-60";let xe;e[10]!==O||e[11]!==ie?(xe=Ce("max-w-full overflow-x-auto scrollbar-hide",ie,O),e[10]=O,e[11]=ie,e[12]=xe):xe=e[12];let Ae;e[13]!==j?(Ae=g.jsx(j,{className:"h-3.5 w-3.5"}),e[13]=j,e[14]=Ae):Ae=e[14];let Ke;e[15]!==oe||e[16]!==J||e[17]!==d||e[18]!==u||e[19]!==v||e[20]!==S||e[21]!==r?(Ke=J?g.jsx(La,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(Ao,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"hidden md:inline",children:oe}),g.jsx("span",{className:"md:hidden",children:oe!==null?iE(oe):null})]}),children:ze=>r==="claude"?Rp.map(He=>g.jsx(oi,{onClick:()=>{v(He.id),ze()},selected:u.reasoningEffort===He.id,icon:g.jsx(Ao,{className:"h-4 w-4 text-muted-foreground"}),label:He.label,disabled:He.id==="max"&&d!=="opus"},He.id)):L1.map(He=>g.jsx(oi,{onClick:()=>{S(He.id),ze()},selected:u.reasoningEffort===He.id,icon:g.jsx(Ao,{className:"h-4 w-4 text-muted-foreground"}),label:He.label},He.id))}):null,e[15]=oe,e[16]=J,e[17]=d,e[18]=u,e[19]=v,e[20]=S,e[21]=r,e[22]=Ke):Ke=e[22];let mt;e[23]!==($==null?void 0:$.thinkingMode)||e[24]!==Q||e[25]!==d||e[26]!==x||e[27]!==r?(mt=r==="gemini"?g.jsx(La,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(Ao,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"hidden md:inline",children:Q}),g.jsx("span",{className:"md:hidden",children:Q!==null?iE(Q):null})]}),children:ze=>I1.map(He=>g.jsx(oi,{onClick:()=>{x(He.id),ze()},selected:($==null?void 0:$.thinkingMode)===He.id,icon:g.jsx(Ao,{className:"h-4 w-4 text-muted-foreground"}),label:He.label,disabled:He.id==="off"&&!kH(d)},He.id))}):null,e[23]=$==null?void 0:$.thinkingMode,e[24]=Q,e[25]=d,e[26]=x,e[27]=r,e[28]=mt):mt=e[28];let Ye;e[29]!==(I==null?void 0:I.fastMode)||e[30]!==C||e[31]!==r?(Ye=r==="codex"?g.jsx(La,{trigger:g.jsxs(g.Fragment,{children:[I!=null&&I.fastMode?g.jsx(qr,{className:"h-3.5 w-3.5"}):g.jsx(Ao,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"hidden md:inline",children:I!=null&&I.fastMode?"Fast Mode":"Standard"}),g.jsx("span",{className:"md:hidden",children:I!=null&&I.fastMode?"Fast":"Std"})]}),triggerClassName:I!=null&&I.fastMode?"text-emerald-500 dark:text-emerald-400":void 0,children:ze=>g.jsxs(g.Fragment,{children:[g.jsx(oi,{onClick:()=>{C(!1),ze()},selected:!(I!=null&&I.fastMode),icon:g.jsx(Ao,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"}),g.jsx(oi,{onClick:()=>{C(!0),ze()},selected:!!(I!=null&&I.fastMode),icon:g.jsx(qr,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,e[29]=I==null?void 0:I.fastMode,e[30]=C,e[31]=r,e[32]=Ye):Ye=e[32];let Ze;return e[33]!==B||e[34]!==K||e[35]!==E||e[36]!==G?(Ze=G?g.jsx(La,{trigger:g.jsxs(g.Fragment,{children:[K?g.jsx(Fn,{className:"h-3.5 w-3.5 animate-spin"}):B?g.jsx(bp,{className:"h-3.5 w-3.5"}):g.jsx(gk,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"hidden md:inline",children:K?B?"Planning...":"Implementing...":B?"Plan":"Implement"}),g.jsx("span",{className:"md:hidden",children:K?B?"Plan...":"Impl...":B?"Plan":"Impl"})]}),triggerClassName:B?"text-blue-400 dark:text-blue-300":void 0,children:ze=>g.jsxs(g.Fragment,{children:[g.jsx(oi,{onClick:()=>{E(!1),ze()},selected:!B,icon:g.jsx(gk,{className:"h-4 w-4 text-muted-foreground"}),label:"Implement",description:"Start execution",disabled:K}),g.jsx(oi,{onClick:()=>{E(!0),ze()},selected:B,icon:g.jsx(bp,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan",description:"Review a plan before execution",disabled:K})]})}):null,e[33]=B,e[34]=K,e[35]=E,e[36]=G,e[37]=Ze):Ze=e[37],g.jsx("div",{className:xe,children:g.jsxs("div",{className:"flex w-max items-center justify-center gap-0.5 mx-auto",children:[P?g.jsx(La,{disabled:z||!f,trigger:g.jsxs(g.Fragment,{children:[g.jsx(H,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"hidden md:inline",children:(U==null?void 0:U.label)??r})]}),children:ze=>n.map(He=>{const Xe=Np[He.id],ut=i==null?void 0:i[He.id];return g.jsx(oi,{onClick:()=>{ut||(f==null||f(He.id),ze())},selected:r===He.id,icon:g.jsx(Xe,{className:"h-4 w-4 text-muted-foreground"}),label:He.label,description:ut,disabled:!!ut},He.id)})}):null,g.jsx(La,{trigger:g.jsxs(g.Fragment,{children:[Ae,g.jsx("span",{children:U.id==="cursor"?vb(((Ue=U.models.find(ze=>ze.id===d))==null?void 0:Ue.label)??d,d):((Je=U.models.find(ze=>ze.id===d))==null?void 0:Je.label)??d})]}),children:ze=>{var He;return U.id==="cursor"?V?g.jsxs(g.Fragment,{children:[g.jsxs("button",{onClick:()=>F(null),className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm text-muted-foreground transition-opacity hover:opacity-70",children:[g.jsx(GR,{className:"h-4 w-4"}),g.jsx("span",{children:V})]}),(He=me.find(Xe=>Xe.family===V))==null?void 0:He.models.map(Xe=>{const ut=_m[Xe.id]??gn;return g.jsx(oi,{onClick:()=>{m(r,Xe.id),F(null),ze()},selected:d===Xe.id,icon:g.jsx(ut,{className:"h-4 w-4 text-muted-foreground"}),label:vb(Xe.label,Xe.id)},Xe.id)})]}):me.map(Xe=>{var rt;const ut=Xe.models.some(Tt=>Tt.id===d),ft=_m[((rt=Xe.models[0])==null?void 0:rt.id)??""]??gn;return g.jsxs("div",{className:"relative",children:[g.jsx(oi,{onClick:()=>F(Xe.family),selected:ut,icon:g.jsx(ft,{className:"h-4 w-4 text-muted-foreground"}),label:Xe.family,description:`${Xe.models.length} model${Xe.models.length===1?"":"s"}`}),g.jsx(Ni,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"})]},Xe.family)}):U.models.map(Xe=>{const ut=_m[Xe.id]??gn;return g.jsx(oi,{onClick:()=>{m(r,Xe.id),ze()},selected:d===Xe.id,icon:g.jsx(ut,{className:"h-4 w-4 text-muted-foreground"}),label:U.id==="cursor"?vb(Xe.label,Xe.id):Xe.label},Xe.id)})}}),ue?g.jsx(La,{trigger:g.jsxs(g.Fragment,{children:[re==="fast"?g.jsx(qr,{className:"h-3.5 w-3.5"}):g.jsx(Ao,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"hidden md:inline",children:re==="fast"?"Fast":"Standard"}),g.jsx("span",{className:"md:hidden",children:re==="fast"?"Fast":"Std"})]}),triggerClassName:re==="fast"?"text-emerald-500 dark:text-emerald-400":void 0,children:ze=>g.jsxs(g.Fragment,{children:[ae.filter(AH).map(He=>g.jsx(oi,{onClick:()=>{m(r,He.id),ze()},selected:d===He.id,icon:g.jsx(Ao,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"},He.id)),ae.filter(MH).map(He=>g.jsx(oi,{onClick:()=>{m(r,He.id),ze()},selected:d===He.id,icon:g.jsx(qr,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast"},He.id))]})}):null,Ke,r==="claude"&&T.length>1?g.jsx(La,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(Z,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:((Ve=T.find(ze=>ze.id===X))==null?void 0:Ve.label)??X})]}),children:ze=>T.map(He=>g.jsx(oi,{onClick:()=>{b(He.id),ze()},selected:X===He.id,icon:He.id==="1m"?g.jsx(bk,{className:"h-4 w-4 text-muted-foreground"}):g.jsx(_k,{className:"h-4 w-4 text-muted-foreground"}),label:He.label,description:He.id==="1m"?"Expanded context window":"Standard context window"},He.id))}):null,mt,Ye,Ze]})})}function MH(t){return Lu(t.id)==="fast"}function AH(t){return Lu(t.id)==="standard"}function NH(t){return t.models.length>0}function DH(t){return Lu(t.id)==="standard"}function OH(t){return Lu(t.id)==="fast"}const Eg=t=>{const e=ke.c(16);let n,r,i,s,a;e[0]!==t?({children:n,className:r,shimmerWidth:s,animate:a,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5]);const c=s===void 0?100:s,d=a===void 0?!0:a,u=`${Math.min(c,100)}px`;let f;e[6]!==u?(f={"--shiny-width":u},e[6]=u,e[7]=f):f=e[7];const m=f;let v;e[8]!==d||e[9]!==r?(v=Ce("mx-auto max-w-md text-foreground/50",d?["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"],r),e[8]=d,e[9]=r,e[10]=v):v=e[10];let b;return e[11]!==n||e[12]!==i||e[13]!==m||e[14]!==v?(b=g.jsx("span",{style:m,className:v,...i,children:n}),e[11]=n,e[12]=i,e[13]=m,e[14]=v,e[15]=b):b=e[15],b};function B1(t){return t.split(/[\s_-]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}const jH=[/^(?:\/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 LH(t){const e=t.trim();for(const n of jH){const r=e.match(n);if(!r)continue;const i=(r[2]??r[1]??"").trim();if(i)return i}return e}function sE(t){return t.split("/").pop()||t}function IH(t,e){if(t===void 0)return null;const n=Math.max(0,e-t),r=6e4,i=60*r,s=24*i,a=7*s;return n<r?"now":n<i?`${Math.floor(n/r)}m`:n<s?`${Math.floor(n/i)}h`:n<a?`${Math.floor(n/s)}d`:`${Math.floor(n/a)}w`}const PH='button, select, input, textarea, [role="combobox"], [role="listbox"], [data-no-touch-drag]';function oE(t){var e;try{(e=navigator.vibrate)==null||e.call(navigator,t)}catch{}}function Jy({enabled:t,visualElementRef:e,onTap:n,onContextMenu:r,onDragStart:i,onDragMove:s,onDragEnd:a,holdDelay:c=300,contextMenuDelay:d=2500,scrollThreshold:u=8,dragMoveThreshold:f=5}){const[m,v]=_.useState(!1),[b,S]=_.useState(!1),[x,C]=_.useState(null),[k,E]=_.useState(null),R=_.useCallback(j=>{E(j)},[]),M=_.useRef("idle"),O=_.useRef({x:0,y:0}),D=_.useRef(null),P=_.useRef(null),z=_.useRef(n),Y=_.useRef(r),L=_.useRef(i),W=_.useRef(s),V=_.useRef(a);z.current=n,Y.current=r,L.current=i,W.current=s,V.current=a;const F=_.useCallback((j,G)=>{const B=(e==null?void 0:e.current)??k;if(!B)return document.elementFromPoint(j,G);const K=B.style.pointerEvents;B.style.pointerEvents="none";const A=document.elementFromPoint(j,G);return B.style.pointerEvents=K,A},[e,k]),U=_.useCallback(()=>{D.current&&(clearTimeout(D.current),D.current=null),P.current&&(clearTimeout(P.current),P.current=null)},[]),H=_.useCallback(()=>{U(),M.current="idle",S(!1),v(!1),C(null)},[U]);return _.useEffect(()=>{if(!k||!t)return;const j=A=>{if(A.target.closest(PH))return;const I=A.touches[0];I&&(O.current={x:I.clientX,y:I.clientY},M.current="holding",D.current=setTimeout(()=>{D.current=null,M.current==="holding"&&(M.current="armed",S(!0),oE(30),P.current=setTimeout(()=>{var T;if(P.current=null,M.current!=="armed")return;oE(100);const $={...O.current};M.current="idle",S(!1),(T=Y.current)==null||T.call(Y,$)},d))},c))},G=A=>{var J,re;const I=M.current;if(I==="idle")return;const $=A.touches[0];if(!$)return;const T=$.clientX-O.current.x,X=$.clientY-O.current.y,Z=Math.sqrt(T*T+X*X);if(I==="holding"){Z>u&&(U(),M.current="idle");return}if(I==="armed"){Z>f&&(P.current&&(clearTimeout(P.current),P.current=null),M.current="dragging",S(!1),v(!0),C({x:$.clientX,y:$.clientY}),A.preventDefault(),(J=L.current)==null||J.call(L,{x:$.clientX,y:$.clientY}));return}if(I==="dragging"){A.preventDefault(),C({x:$.clientX,y:$.clientY});const ae=F($.clientX,$.clientY);(re=W.current)==null||re.call(W,{x:$.clientX,y:$.clientY,elementBelow:ae})}},B=A=>{var $,T;const I=M.current;if(I==="holding"){U(),M.current="idle",S(!1),v(!1),A.preventDefault(),($=z.current)==null||$.call(z);return}if(I==="armed"){H();return}if(I==="dragging"){const X=A.changedTouches[0];if(X){const Z=F(X.clientX,X.clientY);(T=V.current)==null||T.call(V,{x:X.clientX,y:X.clientY,elementBelow:Z})}H()}},K=()=>{var A;M.current==="dragging"&&((A=V.current)==null||A.call(V,{x:0,y:0,elementBelow:null})),H()};return k.addEventListener("touchstart",j,{passive:!1}),k.addEventListener("touchmove",G,{passive:!1}),k.addEventListener("touchend",B),k.addEventListener("touchcancel",K),()=>{k.removeEventListener("touchstart",j),k.removeEventListener("touchmove",G),k.removeEventListener("touchend",B),k.removeEventListener("touchcancel",K),U(),M.current="idle"}},[k,t,c,d,u,f,U,H,F]),{touchRef:R,isDragging:m,isArmed:b,dragPosition:x}}function ZT(t){const e=ke.c(9),{position:n,children:r,className:i}=t;if(!n)return null;let s;e[0]!==n.x||e[1]!==n.y?(s={position:"fixed",left:n.x,top:n.y,transform:"translate(-50%, calc(-100% - 14px))",zIndex:9999,pointerEvents:"none",willChange:"transform"},e[0]=n.x,e[1]=n.y,e[2]=s):s=e[2];let a;e[3]!==i?(a=Ce("flex items-center gap-2 rounded-xl border-2 border-primary/60 bg-card px-3 py-2","shadow-[0_8px_32px_rgba(0,0,0,0.25)] dark:shadow-[0_8px_32px_rgba(0,0,0,0.5)]","min-w-[120px] max-w-[240px]","scale-[1.04]",i),e[3]=i,e[4]=a):a=e[4];let c;return e[5]!==r||e[6]!==s||e[7]!==a?(c=es.createPortal(g.jsx("div",{style:s,className:a,children:r}),document.body),e[5]=r,e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function ex(t){const e=t+"CollectionProvider",[n,r]=Xo(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:C,children:k}=x,E=je.useRef(null),R=je.useRef(new Map).current;return g.jsx(i,{scope:C,itemMap:R,collectionRef:E,children:k})};a.displayName=e;const c=t+"CollectionSlot",d=Wl(c),u=je.forwardRef((x,C)=>{const{scope:k,children:E}=x,R=s(c,k),M=Xt(C,R.collectionRef);return g.jsx(d,{ref:M,children:E})});u.displayName=c;const f=t+"CollectionItemSlot",m="data-radix-collection-item",v=Wl(f),b=je.forwardRef((x,C)=>{const{scope:k,children:E,...R}=x,M=je.useRef(null),O=Xt(C,M),D=s(f,k);return je.useEffect(()=>(D.itemMap.set(M,{ref:M,...R}),()=>void D.itemMap.delete(M))),g.jsx(v,{[m]:"",ref:O,children:E})});b.displayName=f;function S(x){const C=s(t+"CollectionConsumer",x);return je.useCallback(()=>{const E=C.collectionRef.current;if(!E)return[];const R=Array.from(E.querySelectorAll(`[${m}]`));return Array.from(C.itemMap.values()).sort((D,P)=>R.indexOf(D.ref.current)-R.indexOf(P.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:u,ItemSlot:b},S,r]}var zH=_.createContext(void 0);function tx(t){const e=_.useContext(zH);return t||e||"ltr"}var bb="rovingFocusGroup.onEntryFocus",BH={bubbles:!1,cancelable:!0},Bh="RovingFocusGroup",[F1,JT,FH]=ex(Bh),[HH,eM]=Xo(Bh,[FH]),[$H,UH]=HH(Bh),tM=_.forwardRef((t,e)=>g.jsx(F1.Provider,{scope:t.__scopeRovingFocusGroup,children:g.jsx(F1.Slot,{scope:t.__scopeRovingFocusGroup,children:g.jsx(WH,{...t,ref:e})})}));tM.displayName=Bh;var WH=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=t,v=_.useRef(null),b=Xt(e,v),S=tx(s),[x,C]=bu({prop:a,defaultProp:c??null,onChange:d,caller:Bh}),[k,E]=_.useState(!1),R=Ss(u),M=JT(n),O=_.useRef(!1),[D,P]=_.useState(0);return _.useEffect(()=>{const z=v.current;if(z)return z.addEventListener(bb,R),()=>z.removeEventListener(bb,R)},[R]),g.jsx($H,{scope:n,orientation:r,dir:S,loop:i,currentTabStopId:x,onItemFocus:_.useCallback(z=>C(z),[C]),onItemShiftTab:_.useCallback(()=>E(!0),[]),onFocusableItemAdd:_.useCallback(()=>P(z=>z+1),[]),onFocusableItemRemove:_.useCallback(()=>P(z=>z-1),[]),children:g.jsx(Bt.div,{tabIndex:k||D===0?-1:0,"data-orientation":r,...m,ref:b,style:{outline:"none",...t.style},onMouseDown:nt(t.onMouseDown,()=>{O.current=!0}),onFocus:nt(t.onFocus,z=>{const Y=!O.current;if(z.target===z.currentTarget&&Y&&!k){const L=new CustomEvent(bb,BH);if(z.currentTarget.dispatchEvent(L),!L.defaultPrevented){const W=M().filter(j=>j.focusable),V=W.find(j=>j.active),F=W.find(j=>j.id===x),H=[V,F,...W].filter(Boolean).map(j=>j.ref.current);iM(H,f)}}O.current=!1}),onBlur:nt(t.onBlur,()=>E(!1))})})}),nM="RovingFocusGroupItem",rM=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...c}=t,d=Wo(),u=s||d,f=UH(nM,n),m=f.currentTabStopId===u,v=JT(n),{onFocusableItemAdd:b,onFocusableItemRemove:S,currentTabStopId:x}=f;return _.useEffect(()=>{if(r)return b(),()=>S()},[r,b,S]),g.jsx(F1.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:g.jsx(Bt.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:e,onMouseDown:nt(t.onMouseDown,C=>{r?f.onItemFocus(u):C.preventDefault()}),onFocus:nt(t.onFocus,()=>f.onItemFocus(u)),onKeyDown:nt(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){f.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=KH(C,f.orientation,f.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=v().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=f.loop?GH(R,M+1):R.slice(M+1)}setTimeout(()=>iM(R))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:x!=null}):a})})});rM.displayName=nM;var VH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qH(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function KH(t,e,n){const r=qH(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return VH[r]}function iM(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function GH(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var YH=tM,XH=rM,H1=["Enter"," "],QH=["ArrowDown","PageUp","Home"],sM=["ArrowUp","PageDown","End"],ZH=[...QH,...sM],JH={ltr:[...H1,"ArrowRight"],rtl:[...H1,"ArrowLeft"]},e$={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fh="Menu",[yh,t$,n$]=ex(Fh),[ic,oM]=Xo(Fh,[n$,sl,eM]),Rg=sl(),aM=eM(),[r$,sc]=ic(Fh),[i$,Hh]=ic(Fh),lM=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:a=!0}=t,c=Rg(e),[d,u]=_.useState(null),f=_.useRef(!1),m=Ss(s),v=tx(i);return _.useEffect(()=>{const b=()=>{f.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>f.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(bg,{...c,children:g.jsx(r$,{scope:e,open:n,onOpenChange:m,content:d,onContentChange:u,children:g.jsx(i$,{scope:e,onClose:_.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:f,dir:v,modal:a,children:r})})})};lM.displayName=Fh;var s$="MenuAnchor",nx=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Rg(n);return g.jsx(Ih,{...i,...r,ref:e})});nx.displayName=s$;var rx="MenuPortal",[o$,cM]=ic(rx,{forceMount:void 0}),uM=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=sc(rx,e);return g.jsx(o$,{scope:e,forceMount:n,children:g.jsx(os,{present:n||s.open,children:g.jsx(Nu,{asChild:!0,container:i,children:r})})})};uM.displayName=rx;var ts="MenuContent",[a$,ix]=ic(ts),dM=_.forwardRef((t,e)=>{const n=cM(ts,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=sc(ts,t.__scopeMenu),a=Hh(ts,t.__scopeMenu);return g.jsx(yh.Provider,{scope:t.__scopeMenu,children:g.jsx(os,{present:r||s.open,children:g.jsx(yh.Slot,{scope:t.__scopeMenu,children:a.modal?g.jsx(l$,{...i,ref:e}):g.jsx(c$,{...i,ref:e})})})})}),l$=_.forwardRef((t,e)=>{const n=sc(ts,t.__scopeMenu),r=_.useRef(null),i=Xt(e,r);return _.useEffect(()=>{const s=r.current;if(s)return ug(s)},[]),g.jsx(sx,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:nt(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),c$=_.forwardRef((t,e)=>{const n=sc(ts,t.__scopeMenu);return g.jsx(sx,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),u$=Wl("MenuContent.ScrollLock"),sx=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:v,onDismiss:b,disableOutsideScroll:S,...x}=t,C=sc(ts,n),k=Hh(ts,n),E=Rg(n),R=aM(n),M=t$(n),[O,D]=_.useState(null),P=_.useRef(null),z=Xt(e,P,C.onContentChange),Y=_.useRef(0),L=_.useRef(""),W=_.useRef(0),V=_.useRef(null),F=_.useRef("right"),U=_.useRef(0),H=S?jh:_.Fragment,j=S?{as:u$,allowPinchZoom:!0}:void 0,G=K=>{var re,ae;const A=L.current+K,I=M().filter(ue=>!ue.disabled),$=document.activeElement,T=(re=I.find(ue=>ue.ref.current===$))==null?void 0:re.textValue,X=I.map(ue=>ue.textValue),Z=S$(X,A,T),J=(ae=I.find(ue=>ue.textValue===Z))==null?void 0:ae.ref.current;(function ue(me){L.current=me,window.clearTimeout(Y.current),me!==""&&(Y.current=window.setTimeout(()=>ue(""),1e3))})(A),J&&setTimeout(()=>J.focus())};_.useEffect(()=>()=>window.clearTimeout(Y.current),[]),lg();const B=_.useCallback(K=>{var I,$;return F.current===((I=V.current)==null?void 0:I.side)&&C$(K,($=V.current)==null?void 0:$.area)},[]);return g.jsx(a$,{scope:n,searchRef:L,onItemEnter:_.useCallback(K=>{B(K)&&K.preventDefault()},[B]),onItemLeave:_.useCallback(K=>{var A;B(K)||((A=P.current)==null||A.focus(),D(null))},[B]),onTriggerLeave:_.useCallback(K=>{B(K)&&K.preventDefault()},[B]),pointerGraceTimerRef:W,onPointerGraceIntentChange:_.useCallback(K=>{V.current=K},[]),children:g.jsx(H,{...j,children:g.jsx(Oh,{asChild:!0,trapped:i,onMountAutoFocus:nt(s,K=>{var A;K.preventDefault(),(A=P.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(Au,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:v,onDismiss:b,children:g.jsx(YH,{asChild:!0,...R,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:D,onEntryFocus:nt(d,K=>{k.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(_g,{role:"menu","aria-orientation":"vertical","data-state":RM(C.open),"data-radix-menu-content":"",dir:k.dir,...E,...x,ref:z,style:{outline:"none",...x.style},onKeyDown:nt(x.onKeyDown,K=>{const I=K.target.closest("[data-radix-menu-content]")===K.currentTarget,$=K.ctrlKey||K.altKey||K.metaKey,T=K.key.length===1;I&&(K.key==="Tab"&&K.preventDefault(),!$&&T&&G(K.key));const X=P.current;if(K.target!==X||!ZH.includes(K.key))return;K.preventDefault();const J=M().filter(re=>!re.disabled).map(re=>re.ref.current);sM.includes(K.key)&&J.reverse(),y$(J)}),onBlur:nt(t.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(Y.current),L.current="")}),onPointerMove:nt(t.onPointerMove,xh(K=>{const A=K.target,I=U.current!==K.clientX;if(K.currentTarget.contains(A)&&I){const $=K.clientX>U.current?"right":"left";F.current=$,U.current=K.clientX}}))})})})})})})});dM.displayName=ts;var d$="MenuGroup",ox=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.jsx(Bt.div,{role:"group",...r,ref:e})});ox.displayName=d$;var h$="MenuLabel",hM=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.jsx(Bt.div,{...r,ref:e})});hM.displayName=h$;var Dp="MenuItem",aE="menu.itemSelect",Tg=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=_.useRef(null),a=Hh(Dp,t.__scopeMenu),c=ix(Dp,t.__scopeMenu),d=Xt(e,s),u=_.useRef(!1),f=()=>{const m=s.current;if(!n&&m){const v=new CustomEvent(aE,{bubbles:!0,cancelable:!0});m.addEventListener(aE,b=>r==null?void 0:r(b),{once:!0}),_4(m,v),v.defaultPrevented?u.current=!1:a.onClose()}};return g.jsx(fM,{...i,ref:d,disabled:n,onClick:nt(t.onClick,f),onPointerDown:m=>{var v;(v=t.onPointerDown)==null||v.call(t,m),u.current=!0},onPointerUp:nt(t.onPointerUp,m=>{var v;u.current||(v=m.currentTarget)==null||v.click()}),onKeyDown:nt(t.onKeyDown,m=>{const v=c.searchRef.current!=="";n||v&&m.key===" "||H1.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Tg.displayName=Dp;var fM=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,a=ix(Dp,n),c=aM(n),d=_.useRef(null),u=Xt(e,d),[f,m]=_.useState(!1),[v,b]=_.useState("");return _.useEffect(()=>{const S=d.current;S&&b((S.textContent??"").trim())},[s.children]),g.jsx(yh.ItemSlot,{scope:n,disabled:r,textValue:i??v,children:g.jsx(XH,{asChild:!0,...c,focusable:!r,children:g.jsx(Bt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:nt(t.onPointerMove,xh(S=>{r?a.onItemLeave(S):(a.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:nt(t.onPointerLeave,xh(S=>a.onItemLeave(S))),onFocus:nt(t.onFocus,()=>m(!0)),onBlur:nt(t.onBlur,()=>m(!1))})})})}),f$="MenuCheckboxItem",mM=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return g.jsx(_M,{scope:t.__scopeMenu,checked:n,children:g.jsx(Tg,{role:"menuitemcheckbox","aria-checked":Op(n)?"mixed":n,...i,ref:e,"data-state":lx(n),onSelect:nt(i.onSelect,()=>r==null?void 0:r(Op(n)?!0:!n),{checkForDefaultPrevented:!1})})})});mM.displayName=f$;var pM="MenuRadioGroup",[m$,p$]=ic(pM,{value:void 0,onValueChange:()=>{}}),gM=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Ss(r);return g.jsx(m$,{scope:t.__scopeMenu,value:n,onValueChange:s,children:g.jsx(ox,{...i,ref:e})})});gM.displayName=pM;var vM="MenuRadioItem",bM=_.forwardRef((t,e)=>{const{value:n,...r}=t,i=p$(vM,t.__scopeMenu),s=n===i.value;return g.jsx(_M,{scope:t.__scopeMenu,checked:s,children:g.jsx(Tg,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":lx(s),onSelect:nt(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});bM.displayName=vM;var ax="MenuItemIndicator",[_M,g$]=ic(ax,{checked:!1}),yM=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=g$(ax,n);return g.jsx(os,{present:r||Op(s.checked)||s.checked===!0,children:g.jsx(Bt.span,{...i,ref:e,"data-state":lx(s.checked)})})});yM.displayName=ax;var v$="MenuSeparator",xM=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.jsx(Bt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});xM.displayName=v$;var b$="MenuArrow",SM=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Rg(n);return g.jsx(yg,{...i,...r,ref:e})});SM.displayName=b$;var _$="MenuSub",[Tle,wM]=ic(_$),Xd="MenuSubTrigger",CM=_.forwardRef((t,e)=>{const n=sc(Xd,t.__scopeMenu),r=Hh(Xd,t.__scopeMenu),i=wM(Xd,t.__scopeMenu),s=ix(Xd,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,u={__scopeMenu:t.__scopeMenu},f=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>f,[f]),_.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),d(null)}},[c,d]),g.jsx(nx,{asChild:!0,...u,children:g.jsx(fM,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":RM(n.open),...t,ref:Cy(e,i.onTriggerChange),onClick:m=>{var v;(v=t.onClick)==null||v.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:nt(t.onPointerMove,xh(m=>{s.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:nt(t.onPointerLeave,xh(m=>{var b,S;f();const v=(b=n.content)==null?void 0:b.getBoundingClientRect();if(v){const x=(S=n.content)==null?void 0:S.dataset.side,C=x==="right",k=C?-5:5,E=v[C?"left":"right"],R=v[C?"right":"left"];s.onPointerGraceIntentChange({area:[{x:m.clientX+k,y:m.clientY},{x:E,y:v.top},{x:R,y:v.top},{x:R,y:v.bottom},{x:E,y:v.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(m),m.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:nt(t.onKeyDown,m=>{var b;const v=s.searchRef.current!=="";t.disabled||v&&m.key===" "||JH[r.dir].includes(m.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),m.preventDefault())})})})});CM.displayName=Xd;var kM="MenuSubContent",EM=_.forwardRef((t,e)=>{const n=cM(ts,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=sc(ts,t.__scopeMenu),a=Hh(ts,t.__scopeMenu),c=wM(kM,t.__scopeMenu),d=_.useRef(null),u=Xt(e,d);return g.jsx(yh.Provider,{scope:t.__scopeMenu,children:g.jsx(os,{present:r||s.open,children:g.jsx(yh.Slot,{scope:t.__scopeMenu,children:g.jsx(sx,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var m;a.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:nt(t.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:nt(t.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:nt(t.onKeyDown,f=>{var b;const m=f.currentTarget.contains(f.target),v=e$[a.dir].includes(f.key);m&&v&&(s.onOpenChange(!1),(b=c.trigger)==null||b.focus(),f.preventDefault())})})})})})});EM.displayName=kM;function RM(t){return t?"open":"closed"}function Op(t){return t==="indeterminate"}function lx(t){return Op(t)?"indeterminate":t?"checked":"unchecked"}function y$(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function x$(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function S$(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let a=x$(t,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==n));const d=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function w$(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const c=e[s],d=e[a],u=c.x,f=c.y,m=d.x,v=d.y;f>r!=v>r&&n<(m-u)*(r-f)/(v-f)+u&&(i=!i)}return i}function C$(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return w$(n,e)}function xh(t){return e=>e.pointerType==="mouse"?t(e):void 0}var k$=lM,E$=nx,R$=uM,T$=dM,M$=ox,A$=hM,N$=Tg,D$=mM,O$=gM,j$=bM,L$=yM,I$=xM,P$=SM,z$=CM,B$=EM,cx="ContextMenu",[F$,Mle]=Xo(cx,[oM]),Xr=oM(),[H$,TM]=F$(cx),MM=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:i,modal:s=!0}=t,[a,c]=_.useState(!1),d=Xr(e),u=Ss(r),f=_.useCallback(m=>{c(m),u(m)},[u]);return g.jsx(H$,{scope:e,open:a,onOpenChange:f,modal:s,children:g.jsx(k$,{...d,dir:i,open:a,onOpenChange:f,modal:s,children:n})})};MM.displayName=cx;var AM="ContextMenuTrigger",NM=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=t,s=TM(AM,n),a=Xr(n),c=_.useRef({x:0,y:0}),d=_.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),u=_.useRef(0),f=_.useCallback(()=>window.clearTimeout(u.current),[]),m=v=>{c.current={x:v.clientX,y:v.clientY},s.onOpenChange(!0)};return _.useEffect(()=>f,[f]),_.useEffect(()=>void(r&&f()),[r,f]),g.jsxs(g.Fragment,{children:[g.jsx(E$,{...a,virtualRef:d}),g.jsx(Bt.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:nt(t.onContextMenu,v=>{f(),m(v),v.preventDefault()}),onPointerDown:r?t.onPointerDown:nt(t.onPointerDown,ym(v=>{f(),u.current=window.setTimeout(()=>m(v),700)})),onPointerMove:r?t.onPointerMove:nt(t.onPointerMove,ym(f)),onPointerCancel:r?t.onPointerCancel:nt(t.onPointerCancel,ym(f)),onPointerUp:r?t.onPointerUp:nt(t.onPointerUp,ym(f))})]})});NM.displayName=AM;var $$="ContextMenuPortal",DM=t=>{const{__scopeContextMenu:e,...n}=t,r=Xr(e);return g.jsx(R$,{...r,...n})};DM.displayName=$$;var OM="ContextMenuContent",jM=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=TM(OM,n),s=Xr(n),a=_.useRef(!1);return g.jsx(T$,{...s,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var d;(d=t.onCloseAutoFocus)==null||d.call(t,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var d;(d=t.onInteractOutside)==null||d.call(t,c),!c.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...t.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)"}})});jM.displayName=OM;var U$="ContextMenuGroup",W$=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(M$,{...i,...r,ref:e})});W$.displayName=U$;var V$="ContextMenuLabel",q$=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(A$,{...i,...r,ref:e})});q$.displayName=V$;var K$="ContextMenuItem",LM=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(N$,{...i,...r,ref:e})});LM.displayName=K$;var G$="ContextMenuCheckboxItem",Y$=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(D$,{...i,...r,ref:e})});Y$.displayName=G$;var X$="ContextMenuRadioGroup",Q$=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(O$,{...i,...r,ref:e})});Q$.displayName=X$;var Z$="ContextMenuRadioItem",J$=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(j$,{...i,...r,ref:e})});J$.displayName=Z$;var eU="ContextMenuItemIndicator",tU=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(L$,{...i,...r,ref:e})});tU.displayName=eU;var nU="ContextMenuSeparator",rU=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(I$,{...i,...r,ref:e})});rU.displayName=nU;var iU="ContextMenuArrow",sU=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(P$,{...i,...r,ref:e})});sU.displayName=iU;var oU="ContextMenuSubTrigger",aU=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(z$,{...i,...r,ref:e})});aU.displayName=oU;var lU="ContextMenuSubContent",cU=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Xr(n);return g.jsx(B$,{...i,...r,ref:e,style:{...t.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)"}})});cU.displayName=lU;function ym(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var uU=MM,dU=NM,hU=DM,IM=jM,PM=LM;const ux=uU,dx=dU,Mg=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg backdrop-blur-md 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",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx(hU,{children:g.jsx(IM,{ref:e,className:s,...i})}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});Mg.displayName=IM.displayName;const Su=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("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",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx(PM,{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});Su.displayName=PM.displayName;function Ag(t){const e=ke.c(12),{open:n,onOpenChange:r,position:i,children:s}=t;let a;e[0]!==i?(a=i?{position:"fixed",left:i.x,top:i.y,width:0,height:0}:void 0,e[0]=i,e[1]=a):a=e[1];let c;e[2]!==a?(c=g.jsx(bH,{style:a}),e[2]=a,e[3]=c):c=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=Ce("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg backdrop-blur-md","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[4]=d):d=e[4];let u;e[5]!==s?(u=g.jsx(QT,{children:g.jsx(Xy,{side:"bottom",align:"start",sideOffset:4,onOpenAutoFocus:fU,className:d,children:s})}),e[5]=s,e[6]=u):u=e[6];let f;return e[7]!==r||e[8]!==n||e[9]!==c||e[10]!==u?(f=g.jsxs(XT,{open:n,onOpenChange:r,children:[c,u]}),e[7]=r,e[8]=n,e[9]=c,e[10]=u,e[11]=f):f=e[11],f}function fU(t){return t.preventDefault()}function Za(t){const e=ke.c(8),{onSelect:n,className:r,children:i}=t;let s;e[0]!==r?(s=Ce("relative flex w-full cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium outline-hidden transition-colors","hover:bg-accent focus:bg-accent",r),e[0]=r,e[1]=s):s=e[1];let a;e[2]!==n?(a=d=>{d.preventDefault(),n()},e[2]=n,e[3]=a):a=e[3];let c;return e[4]!==i||e[5]!==s||e[6]!==a?(c=g.jsx("button",{type:"button",className:s,onPointerDown:a,children:i}),e[4]=i,e[5]=s,e[6]=a,e[7]=c):c=e[7],c}function mU(t){const e=ke.c(21),{onRemove:n,children:r,mobileMenuPosition:i,onMobileMenuClose:s,skipContextMenu:a}=t;let c;e[0]!==r||e[1]!==n||e[2]!==a?(c=a?r:g.jsxs(ux,{children:[g.jsx(dx,{asChild:!0,children:r}),g.jsx(Mg,{children:g.jsxs(Su,{onSelect:k=>{k.stopPropagation(),n()},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(vu,{className:"h-4 w-4"}),g.jsx("span",{className:"text-xs font-medium",children:"Hide"})]})})]}),e[0]=r,e[1]=n,e[2]=a,e[3]=c):c=e[3];const d=!!i;let u;e[4]!==s?(u=k=>{k||s==null||s()},e[4]=s,e[5]=u):u=e[5];const f=i??null;let m;e[6]!==s||e[7]!==n?(m=()=>{s==null||s(),n()},e[6]=s,e[7]=n,e[8]=m):m=e[8];let v,b;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=g.jsx(vu,{className:"h-4 w-4"}),b=g.jsx("span",{children:"Hide"}),e[9]=v,e[10]=b):(v=e[9],b=e[10]);let S;e[11]!==m?(S=g.jsxs(Za,{onSelect:m,className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[v,b]}),e[11]=m,e[12]=S):S=e[12];let x;e[13]!==d||e[14]!==u||e[15]!==f||e[16]!==S?(x=g.jsx(Ag,{open:d,onOpenChange:u,position:f,children:S}),e[13]=d,e[14]=u,e[15]=f,e[16]=S,e[17]=x):x=e[17];let C;return e[18]!==c||e[19]!==x?(C=g.jsxs(g.Fragment,{children:[c,x]}),e[18]=c,e[19]=x,e[20]=C):C=e[20],C}function pU(t){const e=ke.c(30),{onRename:n,onDelete:r,children:i,mobileMenuPosition:s,onMobileMenuClose:a,skipContextMenu:c}=t;let d;e[0]!==i||e[1]!==r||e[2]!==n||e[3]!==c?(d=c?i:g.jsxs(ux,{children:[g.jsx(dx,{asChild:!0,children:i}),g.jsxs(Mg,{children:[g.jsxs(Su,{onSelect:D=>{D.stopPropagation(),n()},children:[g.jsx(Ul,{className:"h-4 w-4"}),g.jsx("span",{className:"text-xs font-medium",children:"Rename Feature"})]}),g.jsxs(Su,{onSelect:D=>{D.stopPropagation(),r()},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(vu,{className:"h-4 w-4"}),g.jsx("span",{className:"text-xs font-medium",children:"Delete Feature"})]})]})]}),e[0]=i,e[1]=r,e[2]=n,e[3]=c,e[4]=d):d=e[4];const u=!!s;let f;e[5]!==a?(f=D=>{D||a==null||a()},e[5]=a,e[6]=f):f=e[6];const m=s??null;let v;e[7]!==a||e[8]!==n?(v=()=>{a==null||a(),n()},e[7]=a,e[8]=n,e[9]=v):v=e[9];let b,S;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=g.jsx(Ul,{className:"h-4 w-4"}),S=g.jsx("span",{children:"Rename Feature"}),e[10]=b,e[11]=S):(b=e[10],S=e[11]);let x;e[12]!==v?(x=g.jsxs(Za,{onSelect:v,children:[b,S]}),e[12]=v,e[13]=x):x=e[13];let C;e[14]!==r||e[15]!==a?(C=()=>{a==null||a(),r()},e[14]=r,e[15]=a,e[16]=C):C=e[16];let k,E;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=g.jsx(vu,{className:"h-4 w-4"}),E=g.jsx("span",{children:"Delete Feature"}),e[17]=k,e[18]=E):(k=e[17],E=e[18]);let R;e[19]!==C?(R=g.jsxs(Za,{onSelect:C,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:[k,E]}),e[19]=C,e[20]=R):R=e[20];let M;e[21]!==R||e[22]!==u||e[23]!==f||e[24]!==m||e[25]!==x?(M=g.jsxs(Ag,{open:u,onOpenChange:f,position:m,children:[x,R]}),e[21]=R,e[22]=u,e[23]=f,e[24]=m,e[25]=x,e[26]=M):M=e[26];let O;return e[27]!==d||e[28]!==M?(O=g.jsxs(g.Fragment,{children:[d,M]}),e[27]=d,e[28]=M,e[29]=O):O=e[29],O}function gU(t){const e=ke.c(30),{onRename:n,onDelete:r,children:i,mobileMenuPosition:s,onMobileMenuClose:a,skipContextMenu:c}=t;let d;e[0]!==i||e[1]!==r||e[2]!==n||e[3]!==c?(d=c?i:g.jsxs(ux,{children:[g.jsx(dx,{asChild:!0,children:i}),g.jsxs(Mg,{children:[g.jsxs(Su,{onSelect:D=>{D.stopPropagation(),n()},children:[g.jsx(Ul,{className:"h-4 w-4"}),g.jsx("span",{className:"text-xs font-medium",children:"Rename Chat"})]}),g.jsxs(Su,{onSelect:D=>{D.stopPropagation(),r()},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(vu,{className:"h-4 w-4"}),g.jsx("span",{className:"text-xs font-medium",children:"Delete Chat"})]})]})]}),e[0]=i,e[1]=r,e[2]=n,e[3]=c,e[4]=d):d=e[4];const u=!!s;let f;e[5]!==a?(f=D=>{D||a==null||a()},e[5]=a,e[6]=f):f=e[6];const m=s??null;let v;e[7]!==a||e[8]!==n?(v=()=>{a==null||a(),n()},e[7]=a,e[8]=n,e[9]=v):v=e[9];let b,S;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=g.jsx(Ul,{className:"h-4 w-4"}),S=g.jsx("span",{children:"Rename Chat"}),e[10]=b,e[11]=S):(b=e[10],S=e[11]);let x;e[12]!==v?(x=g.jsxs(Za,{onSelect:v,children:[b,S]}),e[12]=v,e[13]=x):x=e[13];let C;e[14]!==r||e[15]!==a?(C=()=>{a==null||a(),r()},e[14]=r,e[15]=a,e[16]=C):C=e[16];let k,E;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=g.jsx(vu,{className:"h-4 w-4"}),E=g.jsx("span",{children:"Delete Chat"}),e[17]=k,e[18]=E):(k=e[17],E=e[18]);let R;e[19]!==C?(R=g.jsxs(Za,{onSelect:C,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:[k,E]}),e[19]=C,e[20]=R):R=e[20];let M;e[21]!==R||e[22]!==u||e[23]!==f||e[24]!==m||e[25]!==x?(M=g.jsxs(Ag,{open:u,onOpenChange:f,position:m,children:[x,R]}),e[21]=R,e[22]=u,e[23]=f,e[24]=m,e[25]=x,e[26]=M):M=e[26];let O;return e[27]!==d||e[28]!==M?(O=g.jsxs(g.Fragment,{children:[d,M]}),e[27]=d,e[28]=M,e[29]=O):O=e[29],O}const vU=new Set(["starting","running"]);function bU(t){const e=ke.c(90),{chat:n,activeChatId:r,nowMs:i,showProviderIcon:s,isCompleted:a,onSelectChat:c,onRenameChat:d,onDeleteChat:u,draggable:f,onDragStart:m,onDragEnd:v,isTouchDevice:b,onTouchDragMove:S,onTouchDragEnd:x}=t,C=s===void 0?!1:s,k=a===void 0?!1:a,E=f===void 0?!1:f,R=b===void 0?!1:b;let M;e[0]!==n.lastMessageAt||e[1]!==i?(M=IH(n.lastMessageAt,i),e[0]=n.lastMessageAt,e[1]=i,e[2]=M):M=e[2];const O=M,D=R,P=n.provider?Np[n.provider]:null,[z,Y]=_.useState(null);let L;e[3]!==n.chatId||e[4]!==c?(L=()=>c(n.chatId),e[3]=n.chatId,e[4]=c,e[5]=L):L=e[5];let W;e[6]===Symbol.for("react.memo_cache_sentinel")?(W=it=>Y(it),e[6]=W):W=e[6];let V;e[7]!==n||e[8]!==E||e[9]!==m?(V=E?()=>m==null?void 0:m(n):void 0,e[7]=n,e[8]=E,e[9]=m,e[10]=V):V=e[10];let F;e[11]!==E||e[12]!==S?(F=E?it=>{const{x:ce,y:Re,elementBelow:Ue}=it;return S==null?void 0:S(ce,Re,Ue)}:void 0,e[11]=E,e[12]=S,e[13]=F):F=e[13];let U;e[14]!==E||e[15]!==v||e[16]!==x?(U=it=>{const{x:ce,y:Re,elementBelow:Ue}=it;E&&(x==null||x(ce,Re,Ue),v==null||v())},e[14]=E,e[15]=v,e[16]=x,e[17]=U):U=e[17];let H;e[18]!==U||e[19]!==L||e[20]!==V||e[21]!==F||e[22]!==D?(H={enabled:D,onTap:L,onContextMenu:W,onDragStart:V,onDragMove:F,onDragEnd:U},e[18]=U,e[19]=L,e[20]=V,e[21]=F,e[22]=D,e[23]=H):H=e[23];const{touchRef:j,isArmed:G,isDragging:B,dragPosition:K}=Jy(H),A=D?j:void 0,I=n._id;let $;e[24]!==n.chatId?($=T1(n.chatId),e[24]=n.chatId,e[25]=$):$=e[25];let T;e[26]!==r||e[27]!==n.chatId?(T=r===T1(n.chatId)?"bg-muted hover:bg-muted border-border":"cursor-pointer border-border/0 hover:border-border hover:bg-muted/20 dark:hover:border-slate-400/10",e[26]=r,e[27]=n.chatId,e[28]=T):T=e[28];const X=G&&"scale-[1.03] shadow-md ring-2 ring-primary/50 bg-card border-primary/40",Z=B&&!G&&"opacity-20 scale-[0.98]";let J;e[29]!==T||e[30]!==X||e[31]!==Z?(J=Ce("group flex items-center gap-2 rounded-lg border px-2.5 py-1.5 transition-all duration-150 select-none",T,X,Z),e[29]=T,e[30]=X,e[31]=Z,e[32]=J):J=e[32];const re=E&&!R;let ae;e[33]!==n||e[34]!==E||e[35]!==R||e[36]!==m?(ae=E&&!R?()=>m==null?void 0:m(n):void 0,e[33]=n,e[34]=E,e[35]=R,e[36]=m,e[37]=ae):ae=e[37];const ue=E&&!R?v:void 0;let me;e[38]!==n.chatId||e[39]!==R||e[40]!==c?(me=R?void 0:()=>c(n.chatId),e[38]=n.chatId,e[39]=R,e[40]=c,e[41]=me):me=e[41];let se;e[42]!==n.status||e[43]!==k?(se=vU.has(n.status)?g.jsx(Fn,{className:"size-3.5 flex-shrink-0 animate-spin text-muted-foreground"}):n.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"})]})}):k?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-emerald-400/80 animate-ping"}),g.jsx("div",{className:"rounded-full z-0 size-2.5 bg-emerald-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):null,e[42]=n.status,e[43]=k,e[44]=se):se=e[44];let oe;e[45]!==P||e[46]!==n.provider||e[47]!==C?(oe=C&&P?g.jsx(P,{className:"size-3.5 flex-shrink-0 text-muted-foreground/80","aria-label":`${n.provider} provider`}):null,e[45]=P,e[46]=n.provider,e[47]=C,e[48]=oe):oe=e[48];let ee;e[49]!==n.status||e[50]!==n.title?(ee=n.status!=="idle"&&n.status!=="waiting_for_user"?g.jsx(Eg,{animate:n.status==="running",shimmerWidth:Math.max(20,n.title.length*3),children:n.title}):n.title,e[49]=n.status,e[50]=n.title,e[51]=ee):ee=e[51];let Q;e[52]!==ee?(Q=g.jsx("span",{className:"min-w-0 flex-1 translate-y-[-0.5px] truncate text-sm",children:ee}),e[52]=ee,e[53]=Q):Q=e[53];let te;e[54]!==O?(te=O?g.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground opacity-60 md:inline",children:O}):null,e[54]=O,e[55]=te):te=e[55];let he;e[56]!==n._id||e[57]!==A||e[58]!==$||e[59]!==J||e[60]!==re||e[61]!==ae||e[62]!==ue||e[63]!==me||e[64]!==se||e[65]!==oe||e[66]!==Q||e[67]!==te?(he=g.jsxs("div",{ref:A,"data-chat-id":$,className:J,draggable:re,onDragStart:ae,onDragEnd:ue,onContextMenu:_U,onClick:me,children:[se,oe,Q,te]},I),e[56]=n._id,e[57]=A,e[58]=$,e[59]=J,e[60]=re,e[61]=ae,e[62]=ue,e[63]=me,e[64]=se,e[65]=oe,e[66]=Q,e[67]=te,e[68]=he):he=e[68];const ie=he;let xe;e[69]!==n.chatId||e[70]!==d?(xe=()=>d(n.chatId),e[69]=n.chatId,e[70]=d,e[71]=xe):xe=e[71];let Ae;e[72]!==n.chatId||e[73]!==u?(Ae=()=>u(n.chatId),e[72]=n.chatId,e[73]=u,e[74]=Ae):Ae=e[74];let Ke;e[75]===Symbol.for("react.memo_cache_sentinel")?(Ke=()=>Y(null),e[75]=Ke):Ke=e[75];let mt;e[76]!==R||e[77]!==z||e[78]!==ie||e[79]!==xe||e[80]!==Ae?(mt=g.jsx(gU,{onRename:xe,onDelete:Ae,mobileMenuPosition:z,onMobileMenuClose:Ke,skipContextMenu:R,children:ie}),e[76]=R,e[77]=z,e[78]=ie,e[79]=xe,e[80]=Ae,e[81]=mt):mt=e[81];let Ye;e[82]!==n.title?(Ye=g.jsx("span",{className:"text-sm font-medium truncate",children:n.title}),e[82]=n.title,e[83]=Ye):Ye=e[83];let Ze;e[84]!==K||e[85]!==Ye?(Ze=g.jsx(ZT,{position:K,children:Ye}),e[84]=K,e[85]=Ye,e[86]=Ze):Ze=e[86];let tt;return e[87]!==mt||e[88]!==Ze?(tt=g.jsxs(g.Fragment,{children:[mt,Ze]}),e[87]=mt,e[88]=Ze,e[89]=tt):tt=e[89],tt}function _U(t){t.stopPropagation()}function yU(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return _.useMemo(()=>r=>{e.forEach(i=>i(r))},e)}const Ng=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Iu(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function hx(t){return"nodeType"in t}function hi(t){var e,n;return t?Iu(t)?t:hx(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function fx(t){const{Document:e}=hi(t);return t instanceof e}function $h(t){return Iu(t)?!1:t instanceof hi(t).HTMLElement}function zM(t){return t instanceof hi(t).SVGElement}function Pu(t){return t?Iu(t)?t.document:hx(t)?fx(t)?t:$h(t)||zM(t)?t.ownerDocument:document:document:document}const to=Ng?_.useLayoutEffect:_.useEffect;function mx(t){const e=_.useRef(t);return to(()=>{e.current=t}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function xU(){const t=_.useRef(null),e=_.useCallback((r,i)=>{t.current=setInterval(r,i)},[]),n=_.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Sh(t,e){e===void 0&&(e=[t]);const n=_.useRef(t);return to(()=>{n.current!==t&&(n.current=t)},e),n}function Uh(t,e){const n=_.useRef();return _.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function jp(t){const e=mx(t),n=_.useRef(null),r=_.useCallback(i=>{i!==n.current&&(e==null||e(i,n.current)),n.current=i},[]);return[n,r]}function $1(t){const e=_.useRef();return _.useEffect(()=>{e.current=t},[t]),e.current}let _b={};function Wh(t,e){return _.useMemo(()=>{if(e)return e;const n=_b[t]==null?0:_b[t]+1;return _b[t]=n,t+"-"+n},[t,e])}function BM(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,a)=>{const c=Object.entries(a);for(const[d,u]of c){const f=s[d];f!=null&&(s[d]=f+t*u)}return s},{...e})}}const du=BM(1),Lp=BM(-1);function SU(t){return"clientX"in t&&"clientY"in t}function px(t){if(!t)return!1;const{KeyboardEvent:e}=hi(t.target);return e&&t instanceof e}function wU(t){if(!t)return!1;const{TouchEvent:e}=hi(t.target);return e&&t instanceof e}function U1(t){if(wU(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return SU(t)?{x:t.clientX,y:t.clientY}:null}const wu=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[wu.Translate.toString(t),wu.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),lE="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function CU(t){return t.matches(lE)?t:t.querySelector(lE)}const kU={display:"none"};function EU(t){let{id:e,value:n}=t;return je.createElement("div",{id:e,style:kU},n)}function RU(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const i={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 je.createElement("div",{id:e,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function TU(){const[t,e]=_.useState("");return{announce:_.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const FM=_.createContext(null);function MU(t){const e=_.useContext(FM);_.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function AU(){const[t]=_.useState(()=>new Set),e=_.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[_.useCallback(r=>{let{type:i,event:s}=r;t.forEach(a=>{var c;return(c=a[i])==null?void 0:c.call(a,s)})},[t]),e]}const NU={draggable:`
|
|
469
|
+
To pick up a draggable item, press the space bar.
|
|
470
|
+
While dragging, use the arrow keys to move the item.
|
|
471
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
472
|
+
`},DU={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function OU(t){let{announcements:e=DU,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=NU}=t;const{announce:s,announcement:a}=TU(),c=Wh("DndLiveRegion"),[d,u]=_.useState(!1);if(_.useEffect(()=>{u(!0)},[]),MU(_.useMemo(()=>({onDragStart(m){let{active:v}=m;s(e.onDragStart({active:v}))},onDragMove(m){let{active:v,over:b}=m;e.onDragMove&&s(e.onDragMove({active:v,over:b}))},onDragOver(m){let{active:v,over:b}=m;s(e.onDragOver({active:v,over:b}))},onDragEnd(m){let{active:v,over:b}=m;s(e.onDragEnd({active:v,over:b}))},onDragCancel(m){let{active:v,over:b}=m;s(e.onDragCancel({active:v,over:b}))}}),[s,e])),!d)return null;const f=je.createElement(je.Fragment,null,je.createElement(EU,{id:r,value:i.draggable}),je.createElement(RU,{id:c,announcement:a}));return n?es.createPortal(f,n):f}var or;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(or||(or={}));function Ip(){}function ep(t,e){return _.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function HM(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return _.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const ks=Object.freeze({x:0,y:0});function jU(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function LU(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function IU(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function PU(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function cE(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const $M=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const i=cE(e,e.left,e.top),s=[];for(const a of r){const{id:c}=a,d=n.get(c);if(d){const u=jU(cE(d),i);s.push({id:c,data:{droppableContainer:a,value:u}})}}return s.sort(LU)};function zU(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),a=i-r,c=s-n;if(r<i&&n<s){const d=e.width*e.height,u=t.width*t.height,f=a*c,m=f/(d+u-f);return Number(m.toFixed(4))}return 0}const BU=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const i=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const d=zU(c,e);d>0&&i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(IU)};function FU(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function UM(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:ks}function HU(t){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((a,c)=>({...a,top:a.top+t*c.y,bottom:a.bottom+t*c.y,left:a.left+t*c.x,right:a.right+t*c.x}),{...n})}}const $U=HU(1);function UU(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function WU(t,e,n){const r=UU(e);if(!r)return t;const{scaleX:i,scaleY:s,x:a,y:c}=r,d=t.left-a-(1-i)*parseFloat(n),u=t.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=i?t.width/i:t.width,m=s?t.height/s:t.height;return{width:f,height:m,top:u,right:d+f,bottom:u+m,left:d}}const VU={ignoreTransform:!1};function zu(t,e){e===void 0&&(e=VU);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:f}=hi(t).getComputedStyle(t);u&&(n=WU(n,u,f))}const{top:r,left:i,width:s,height:a,bottom:c,right:d}=n;return{top:r,left:i,width:s,height:a,bottom:c,right:d}}function uE(t){return zu(t,{ignoreTransform:!0})}function qU(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function KU(t,e){return e===void 0&&(e=hi(t).getComputedStyle(t)),e.position==="fixed"}function GU(t,e){e===void 0&&(e=hi(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=e[i];return typeof s=="string"?n.test(s):!1})}function gx(t,e){const n=[];function r(i){if(e!=null&&n.length>=e||!i)return n;if(fx(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!$h(i)||zM(i)||n.includes(i))return n;const s=hi(t).getComputedStyle(i);return i!==t&&GU(i,s)&&n.push(i),KU(i,s)?n:r(i.parentNode)}return t?r(t):n}function WM(t){const[e]=gx(t,1);return e??null}function yb(t){return!Ng||!t?null:Iu(t)?t:hx(t)?fx(t)||t===Pu(t).scrollingElement?window:$h(t)?t:null:null}function VM(t){return Iu(t)?t.scrollX:t.scrollLeft}function qM(t){return Iu(t)?t.scrollY:t.scrollTop}function W1(t){return{x:VM(t),y:qM(t)}}var fr;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(fr||(fr={}));function KM(t){return!Ng||!t?!1:t===document.scrollingElement}function GM(t){const e={x:0,y:0},n=KM(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},i=t.scrollTop<=e.y,s=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,c=t.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:a,isRight:c,maxScroll:r,minScroll:e}}const YU={x:.2,y:.2};function XU(t,e,n,r,i){let{top:s,left:a,right:c,bottom:d}=n;r===void 0&&(r=10),i===void 0&&(i=YU);const{isTop:u,isBottom:f,isLeft:m,isRight:v}=GM(t),b={x:0,y:0},S={x:0,y:0},x={height:e.height*i.y,width:e.width*i.x};return!u&&s<=e.top+x.height?(b.y=fr.Backward,S.y=r*Math.abs((e.top+x.height-s)/x.height)):!f&&d>=e.bottom-x.height&&(b.y=fr.Forward,S.y=r*Math.abs((e.bottom-x.height-d)/x.height)),!v&&c>=e.right-x.width?(b.x=fr.Forward,S.x=r*Math.abs((e.right-x.width-c)/x.width)):!m&&a<=e.left+x.width&&(b.x=fr.Backward,S.x=r*Math.abs((e.left+x.width-a)/x.width)),{direction:b,speed:S}}function QU(t){if(t===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:e,left:n,right:r,bottom:i}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:i,width:t.clientWidth,height:t.clientHeight}}function YM(t){return t.reduce((e,n)=>du(e,W1(n)),ks)}function ZU(t){return t.reduce((e,n)=>e+VM(n),0)}function JU(t){return t.reduce((e,n)=>e+qM(n),0)}function eW(t,e){if(e===void 0&&(e=zu),!t)return;const{top:n,left:r,bottom:i,right:s}=e(t);WM(t)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const tW=[["x",["left","right"],ZU],["y",["top","bottom"],JU]];class vx{constructor(e,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=gx(n),i=YM(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,a,c]of tW)for(const d of a)Object.defineProperty(this,d,{get:()=>{const u=c(r),f=i[s]-u;return this.rect[d]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class oh{constructor(e){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=e}add(e,n,r){var i;(i=this.target)==null||i.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function nW(t){const{EventTarget:e}=hi(t);return t instanceof e?t:Pu(t)}function xb(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Qi;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Qi||(Qi={}));function dE(t){t.preventDefault()}function rW(t){t.stopPropagation()}var Yt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Yt||(Yt={}));const XM={start:[Yt.Space,Yt.Enter],cancel:[Yt.Esc],end:[Yt.Space,Yt.Enter,Yt.Tab]},iW=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Yt.Right:return{...n,x:n.x+25};case Yt.Left:return{...n,x:n.x-25};case Yt.Down:return{...n,y:n.y+25};case Yt.Up:return{...n,y:n.y-25}}};class bx{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new oh(Pu(n)),this.windowListeners=new oh(hi(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Qi.Resize,this.handleCancel),this.windowListeners.add(Qi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Qi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&eW(r),n(ks)}handleKeyDown(e){if(px(e)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=XM,coordinateGetter:a=iW,scrollBehavior:c="smooth"}=i,{code:d}=e;if(s.end.includes(d)){this.handleEnd(e);return}if(s.cancel.includes(d)){this.handleCancel(e);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:ks;this.referenceCoordinates||(this.referenceCoordinates=f);const m=a(e,{active:n,context:r.current,currentCoordinates:f});if(m){const v=Lp(m,f),b={x:0,y:0},{scrollableAncestors:S}=r.current;for(const x of S){const C=e.code,{isTop:k,isRight:E,isLeft:R,isBottom:M,maxScroll:O,minScroll:D}=GM(x),P=QU(x),z={x:Math.min(C===Yt.Right?P.right-P.width/2:P.right,Math.max(C===Yt.Right?P.left:P.left+P.width/2,m.x)),y:Math.min(C===Yt.Down?P.bottom-P.height/2:P.bottom,Math.max(C===Yt.Down?P.top:P.top+P.height/2,m.y))},Y=C===Yt.Right&&!E||C===Yt.Left&&!R,L=C===Yt.Down&&!M||C===Yt.Up&&!k;if(Y&&z.x!==m.x){const W=x.scrollLeft+v.x,V=C===Yt.Right&&W<=O.x||C===Yt.Left&&W>=D.x;if(V&&!v.y){x.scrollTo({left:W,behavior:c});return}V?b.x=x.scrollLeft-W:b.x=C===Yt.Right?x.scrollLeft-O.x:x.scrollLeft-D.x,b.x&&x.scrollBy({left:-b.x,behavior:c});break}else if(L&&z.y!==m.y){const W=x.scrollTop+v.y,V=C===Yt.Down&&W<=O.y||C===Yt.Up&&W>=D.y;if(V&&!v.x){x.scrollTo({top:W,behavior:c});return}V?b.y=x.scrollTop-W:b.y=C===Yt.Down?x.scrollTop-O.y:x.scrollTop-D.y,b.y&&x.scrollBy({top:-b.y,behavior:c});break}}this.handleMove(e,du(Lp(m,this.referenceCoordinates),b))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}bx.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=XM,onActivation:i}=e,{active:s}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const c=s.activatorNode.current;return c&&t.target!==c?!1:(t.preventDefault(),i==null||i({event:t.nativeEvent}),!0)}return!1}}];function hE(t){return!!(t&&"distance"in t)}function fE(t){return!!(t&&"delay"in t)}class _x{constructor(e,n,r){var i;r===void 0&&(r=nW(e.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=e,this.events=n;const{event:s}=e,{target:a}=s;this.props=e,this.events=n,this.document=Pu(a),this.documentListeners=new oh(this.document),this.listeners=new oh(r),this.windowListeners=new oh(hi(a)),this.initialCoordinates=(i=U1(s))!=null?i:ks,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:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Qi.Resize,this.handleCancel),this.windowListeners.add(Qi.DragStart,dE),this.windowListeners.add(Qi.VisibilityChange,this.handleCancel),this.windowListeners.add(Qi.ContextMenu,dE),this.documentListeners.add(Qi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fE(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(hE(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(e,n){const{active:r,onPending:i}=this.props;i(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Qi.Click,rW,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Qi.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:a,options:{activationConstraint:c}}=s;if(!i)return;const d=(n=U1(e))!=null?n:ks,u=Lp(i,d);if(!r&&c){if(hE(c)){if(c.tolerance!=null&&xb(u,c.tolerance))return this.handleCancel();if(xb(u,c.distance))return this.handleStart()}if(fE(c)&&xb(u,c.tolerance))return this.handleCancel();this.handlePending(c,u);return}e.cancelable&&e.preventDefault(),a(d)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Yt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const sW={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dg extends _x{constructor(e){const{event:n}=e,r=Pu(n.target);super(e,sW,r)}}Dg.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const oW={move:{name:"mousemove"},end:{name:"mouseup"}};var V1;(function(t){t[t.RightClick=2]="RightClick"})(V1||(V1={}));class aW extends _x{constructor(e){super(e,oW,Pu(e.event.target))}}aW.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===V1.RightClick?!1:(r==null||r({event:n}),!0)}}];const Sb={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class QM extends _x{constructor(e){super(e,Sb)}static setup(){return window.addEventListener(Sb.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Sb.move.name,e)};function e(){}}}QM.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var ah;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ah||(ah={}));var Pp;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Pp||(Pp={}));function lW(t){let{acceleration:e,activator:n=ah.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:c=Pp.TreeOrder,pointerCoordinates:d,scrollableAncestors:u,scrollableAncestorRects:f,delta:m,threshold:v}=t;const b=uW({delta:m,disabled:!s}),[S,x]=xU(),C=_.useRef({x:0,y:0}),k=_.useRef({x:0,y:0}),E=_.useMemo(()=>{switch(n){case ah.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case ah.DraggableRect:return i}},[n,i,d]),R=_.useRef(null),M=_.useCallback(()=>{const D=R.current;if(!D)return;const P=C.current.x*k.current.x,z=C.current.y*k.current.y;D.scrollBy(P,z)},[]),O=_.useMemo(()=>c===Pp.TreeOrder?[...u].reverse():u,[c,u]);_.useEffect(()=>{if(!s||!u.length||!E){x();return}for(const D of O){if((r==null?void 0:r(D))===!1)continue;const P=u.indexOf(D),z=f[P];if(!z)continue;const{direction:Y,speed:L}=XU(D,z,E,e,v);for(const W of["x","y"])b[W][Y[W]]||(L[W]=0,Y[W]=0);if(L.x>0||L.y>0){x(),R.current=D,S(M,a),C.current=L,k.current=Y;return}}C.current={x:0,y:0},k.current={x:0,y:0},x()},[e,M,r,x,s,a,JSON.stringify(E),JSON.stringify(b),S,u,O,f,JSON.stringify(v)])}const cW={x:{[fr.Backward]:!1,[fr.Forward]:!1},y:{[fr.Backward]:!1,[fr.Forward]:!1}};function uW(t){let{delta:e,disabled:n}=t;const r=$1(e);return Uh(i=>{if(n||!r||!i)return cW;const s={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[fr.Backward]:i.x[fr.Backward]||s.x===-1,[fr.Forward]:i.x[fr.Forward]||s.x===1},y:{[fr.Backward]:i.y[fr.Backward]||s.y===-1,[fr.Forward]:i.y[fr.Forward]||s.y===1}}},[n,e,r])}function dW(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Uh(i=>{var s;return e==null?null:(s=r??i)!=null?s:null},[r,e])}function hW(t,e){return _.useMemo(()=>t.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...s]},[]),[t,e])}var wh;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(wh||(wh={}));var q1;(function(t){t.Optimized="optimized"})(q1||(q1={}));const mE=new Map;function fW(t,e){let{dragging:n,dependencies:r,config:i}=e;const[s,a]=_.useState(null),{frequency:c,measure:d,strategy:u}=i,f=_.useRef(t),m=C(),v=Sh(m),b=_.useCallback(function(k){k===void 0&&(k=[]),!v.current&&a(E=>E===null?k:E.concat(k.filter(R=>!E.includes(R))))},[v]),S=_.useRef(null),x=Uh(k=>{if(m&&!n)return mE;if(!k||k===mE||f.current!==t||s!=null){const E=new Map;for(let R of t){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){E.set(R.id,R.rect.current);continue}const M=R.node.current,O=M?new vx(d(M),M):null;R.rect.current=O,O&&E.set(R.id,O)}return E}return k},[t,s,n,m,d]);return _.useEffect(()=>{f.current=t},[t]),_.useEffect(()=>{m||b()},[n,m]),_.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),_.useEffect(()=>{m||typeof c!="number"||S.current!==null||(S.current=setTimeout(()=>{b(),S.current=null},c))},[c,m,b,...r]),{droppableRects:x,measureDroppableContainers:b,measuringScheduled:s!=null};function C(){switch(u){case wh.Always:return!1;case wh.BeforeDragging:return n;default:return!n}}}function ZM(t,e){return Uh(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function mW(t,e){return ZM(t,e)}function pW(t){let{callback:e,disabled:n}=t;const r=mx(e),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return _.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Og(t){let{callback:e,disabled:n}=t;const r=mx(e),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return _.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function gW(t){return new vx(zu(t),t)}function pE(t,e,n){e===void 0&&(e=gW);const[r,i]=_.useState(null);function s(){i(d=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=d??n)!=null?u:null}const f=e(t);return JSON.stringify(d)===JSON.stringify(f)?d:f})}const a=pW({callback(d){if(t)for(const u of d){const{type:f,target:m}=u;if(f==="childList"&&m instanceof HTMLElement&&m.contains(t)){s();break}}}}),c=Og({callback:s});return to(()=>{s(),t?(c==null||c.observe(t),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),a==null||a.disconnect())},[t]),r}function vW(t){const e=ZM(t);return UM(t,e)}const gE=[];function bW(t){const e=_.useRef(t),n=Uh(r=>t?r&&r!==gE&&t&&e.current&&t.parentNode===e.current.parentNode?r:gx(t):gE,[t]);return _.useEffect(()=>{e.current=t},[t]),n}function _W(t){const[e,n]=_.useState(null),r=_.useRef(t),i=_.useCallback(s=>{const a=yb(s.target);a&&n(c=>c?(c.set(a,W1(a)),new Map(c)):null)},[]);return _.useEffect(()=>{const s=r.current;if(t!==s){a(s);const c=t.map(d=>{const u=yb(d);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,W1(u)]):null}).filter(d=>d!=null);n(c.length?new Map(c):null),r.current=t}return()=>{a(t),a(s)};function a(c){c.forEach(d=>{const u=yb(d);u==null||u.removeEventListener("scroll",i)})}},[i,t]),_.useMemo(()=>t.length?e?Array.from(e.values()).reduce((s,a)=>du(s,a),ks):YM(t):ks,[t,e])}function vE(t,e){e===void 0&&(e=[]);const n=_.useRef(null);return _.useEffect(()=>{n.current=null},e),_.useEffect(()=>{const r=t!==ks;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Lp(t,n.current):ks}function yW(t){_.useEffect(()=>{if(!Ng)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function xW(t,e){return _.useMemo(()=>t.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=a=>{s(a,e)},n},{}),[t,e])}function JM(t){return _.useMemo(()=>t?qU(t):null,[t])}const bE=[];function SW(t,e){e===void 0&&(e=zu);const[n]=t,r=JM(n?hi(n):null),[i,s]=_.useState(bE);function a(){s(()=>t.length?t.map(d=>KM(d)?r:new vx(e(d),d)):bE)}const c=Og({callback:a});return to(()=>{c==null||c.disconnect(),a(),t.forEach(d=>c==null?void 0:c.observe(d))},[t]),i}function wW(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return $h(e)?e:t}function CW(t){let{measure:e}=t;const[n,r]=_.useState(null),i=_.useCallback(u=>{for(const{target:f}of u)if($h(f)){r(m=>{const v=e(f);return m?{...m,width:v.width,height:v.height}:v});break}},[e]),s=Og({callback:i}),a=_.useCallback(u=>{const f=wW(u);s==null||s.disconnect(),f&&(s==null||s.observe(f)),r(f?e(f):null)},[e,s]),[c,d]=jp(a);return _.useMemo(()=>({nodeRef:c,rect:n,setRef:d}),[n,c,d])}const kW=[{sensor:Dg,options:{}},{sensor:bx,options:{}}],EW={current:{}},tp={draggable:{measure:uE},droppable:{measure:uE,strategy:wh.WhileDragging,frequency:q1.Optimized},dragOverlay:{measure:zu}};class lh extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const RW={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new lh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ip},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:tp,measureDroppableContainers:Ip,windowRect:null,measuringScheduled:!1},TW={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ip,draggableNodes:new Map,over:null,measureDroppableContainers:Ip},jg=_.createContext(TW),eA=_.createContext(RW);function MW(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new lh}}}function AW(t,e){switch(e.type){case or.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case or.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case or.DragEnd:case or.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case or.RegisterDroppable:{const{element:n}=e,{id:r}=n,i=new lh(t.droppable.containers);return i.set(r,n),{...t,droppable:{...t.droppable,containers:i}}}case or.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const a=new lh(t.droppable.containers);return a.set(n,{...s,disabled:i}),{...t,droppable:{...t.droppable,containers:a}}}case or.UnregisterDroppable:{const{id:n,key:r}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const s=new lh(t.droppable.containers);return s.delete(n),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function NW(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:i}=_.useContext(jg),s=$1(r),a=$1(n==null?void 0:n.id);return _.useEffect(()=>{if(!e&&!r&&s&&a!=null){if(!px(s)||document.activeElement===s.target)return;const c=i.get(a);if(!c)return;const{activatorNode:d,node:u}=c;if(!d.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[d.current,u.current]){if(!f)continue;const m=CU(f);if(m){m.focus();break}}})}},[r,e,i,a,s]),null}function DW(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((i,s)=>s({transform:i,...r}),n):n}function OW(t){return _.useMemo(()=>({draggable:{...tp.draggable,...t==null?void 0:t.draggable},droppable:{...tp.droppable,...t==null?void 0:t.droppable},dragOverlay:{...tp.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function jW(t){let{activeNode:e,measure:n,initialRect:r,config:i=!0}=t;const s=_.useRef(!1),{x:a,y:c}=typeof i=="boolean"?{x:i,y:i}:i;to(()=>{if(!a&&!c||!e){s.current=!1;return}if(s.current||!r)return;const u=e==null?void 0:e.node.current;if(!u||u.isConnected===!1)return;const f=n(u),m=UM(f,r);if(a||(m.x=0),c||(m.y=0),s.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const v=WM(u);v&&v.scrollBy({top:m.y,left:m.x})}},[e,a,c,r,n])}const tA=_.createContext({...ks,scaleX:1,scaleY:1});var $a;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})($a||($a={}));const nA=_.memo(function(e){var n,r,i,s;let{id:a,accessibility:c,autoScroll:d=!0,children:u,sensors:f=kW,collisionDetection:m=BU,measuring:v,modifiers:b,...S}=e;const x=_.useReducer(AW,void 0,MW),[C,k]=x,[E,R]=AU(),[M,O]=_.useState($a.Uninitialized),D=M===$a.Initialized,{draggable:{active:P,nodes:z,translate:Y},droppable:{containers:L}}=C,W=P!=null?z.get(P):null,V=_.useRef({initial:null,translated:null}),F=_.useMemo(()=>{var Le;return P!=null?{id:P,data:(Le=W==null?void 0:W.data)!=null?Le:EW,rect:V}:null},[P,W]),U=_.useRef(null),[H,j]=_.useState(null),[G,B]=_.useState(null),K=Sh(S,Object.values(S)),A=Wh("DndDescribedBy",a),I=_.useMemo(()=>L.getEnabled(),[L]),$=OW(v),{droppableRects:T,measureDroppableContainers:X,measuringScheduled:Z}=fW(I,{dragging:D,dependencies:[Y.x,Y.y],config:$.droppable}),J=dW(z,P),re=_.useMemo(()=>G?U1(G):null,[G]),ae=$e(),ue=mW(J,$.draggable.measure);jW({activeNode:P!=null?z.get(P):null,config:ae.layoutShiftCompensation,initialRect:ue,measure:$.draggable.measure});const me=pE(J,$.draggable.measure,ue),se=pE(J?J.parentElement:null),oe=_.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:T,draggableNodes:z,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ee=L.getNodeFor((n=oe.current.over)==null?void 0:n.id),Q=CW({measure:$.dragOverlay.measure}),te=(r=Q.nodeRef.current)!=null?r:J,he=D?(i=Q.rect)!=null?i:me:null,ie=!!(Q.nodeRef.current&&Q.rect),xe=vW(ie?null:me),Ae=JM(te?hi(te):null),Ke=bW(D?ee??J:null),mt=SW(Ke),Ye=DW(b,{transform:{x:Y.x-xe.x,y:Y.y-xe.y,scaleX:1,scaleY:1},activatorEvent:G,active:F,activeNodeRect:me,containerNodeRect:se,draggingNodeRect:he,over:oe.current.over,overlayNodeRect:Q.rect,scrollableAncestors:Ke,scrollableAncestorRects:mt,windowRect:Ae}),Ze=re?du(re,Y):null,tt=_W(Ke),it=vE(tt),ce=vE(tt,[me]),Re=du(Ye,it),Ue=he?$U(he,Ye):null,Je=F&&Ue?m({active:F,collisionRect:Ue,droppableRects:T,droppableContainers:I,pointerCoordinates:Ze}):null,Ve=PU(Je,"id"),[ze,He]=_.useState(null),Xe=ie?Ye:du(Ye,ce),ut=FU(Xe,(s=ze==null?void 0:ze.rect)!=null?s:null,me),ft=_.useRef(null),rt=_.useCallback((Le,Fe)=>{let{sensor:ye,options:Ie}=Fe;if(U.current==null)return;const Qe=z.get(U.current);if(!Qe)return;const gt=Le.nativeEvent,Wt=new ye({active:U.current,activeNode:Qe,event:gt,options:Ie,context:oe,onAbort(xt){if(!z.get(xt))return;const{onDragAbort:kt}=K.current,Dt={id:xt};kt==null||kt(Dt),E({type:"onDragAbort",event:Dt})},onPending(xt,Qt,kt,Dt){if(!z.get(xt))return;const{onDragPending:Zt}=K.current,bn={id:xt,constraint:Qt,initialCoordinates:kt,offset:Dt};Zt==null||Zt(bn),E({type:"onDragPending",event:bn})},onStart(xt){const Qt=U.current;if(Qt==null)return;const kt=z.get(Qt);if(!kt)return;const{onDragStart:Dt}=K.current,wn={activatorEvent:gt,active:{id:Qt,data:kt.data,rect:V}};es.unstable_batchedUpdates(()=>{Dt==null||Dt(wn),O($a.Initializing),k({type:or.DragStart,initialCoordinates:xt,active:Qt}),E({type:"onDragStart",event:wn}),j(ft.current),B(gt)})},onMove(xt){k({type:or.DragMove,coordinates:xt})},onEnd:wt(or.DragEnd),onCancel:wt(or.DragCancel)});ft.current=Wt;function wt(xt){return async function(){const{active:kt,collisions:Dt,over:wn,scrollAdjustedTranslate:Zt}=oe.current;let bn=null;if(kt&&Zt){const{cancelDrop:Hn}=K.current;bn={activatorEvent:gt,active:kt,collisions:Dt,delta:Zt,over:wn},xt===or.DragEnd&&typeof Hn=="function"&&await Promise.resolve(Hn(bn))&&(xt=or.DragCancel)}U.current=null,es.unstable_batchedUpdates(()=>{k({type:xt}),O($a.Uninitialized),He(null),j(null),B(null),ft.current=null;const Hn=xt===or.DragEnd?"onDragEnd":"onDragCancel";if(bn){const dn=K.current[Hn];dn==null||dn(bn),E({type:Hn,event:bn})}})}}},[z]),Tt=_.useCallback((Le,Fe)=>(ye,Ie)=>{const Qe=ye.nativeEvent,gt=z.get(Ie);if(U.current!==null||!gt||Qe.dndKit||Qe.defaultPrevented)return;const Wt={active:gt};Le(ye,Fe.options,Wt)===!0&&(Qe.dndKit={capturedBy:Fe.sensor},U.current=Ie,rt(ye,Fe))},[z,rt]),lt=hW(f,Tt);yW(f),to(()=>{me&&M===$a.Initializing&&O($a.Initialized)},[me,M]),_.useEffect(()=>{const{onDragMove:Le}=K.current,{active:Fe,activatorEvent:ye,collisions:Ie,over:Qe}=oe.current;if(!Fe||!ye)return;const gt={active:Fe,activatorEvent:ye,collisions:Ie,delta:{x:Re.x,y:Re.y},over:Qe};es.unstable_batchedUpdates(()=>{Le==null||Le(gt),E({type:"onDragMove",event:gt})})},[Re.x,Re.y]),_.useEffect(()=>{const{active:Le,activatorEvent:Fe,collisions:ye,droppableContainers:Ie,scrollAdjustedTranslate:Qe}=oe.current;if(!Le||U.current==null||!Fe||!Qe)return;const{onDragOver:gt}=K.current,Wt=Ie.get(Ve),wt=Wt&&Wt.rect.current?{id:Wt.id,rect:Wt.rect.current,data:Wt.data,disabled:Wt.disabled}:null,xt={active:Le,activatorEvent:Fe,collisions:ye,delta:{x:Qe.x,y:Qe.y},over:wt};es.unstable_batchedUpdates(()=>{He(wt),gt==null||gt(xt),E({type:"onDragOver",event:xt})})},[Ve]),to(()=>{oe.current={activatorEvent:G,active:F,activeNode:J,collisionRect:Ue,collisions:Je,droppableRects:T,draggableNodes:z,draggingNode:te,draggingNodeRect:he,droppableContainers:L,over:ze,scrollableAncestors:Ke,scrollAdjustedTranslate:Re},V.current={initial:he,translated:Ue}},[F,J,Je,Ue,z,te,he,T,L,ze,Ke,Re]),lW({...ae,delta:Y,draggingRect:Ue,pointerCoordinates:Ze,scrollableAncestors:Ke,scrollableAncestorRects:mt});const ht=_.useMemo(()=>({active:F,activeNode:J,activeNodeRect:me,activatorEvent:G,collisions:Je,containerNodeRect:se,dragOverlay:Q,draggableNodes:z,droppableContainers:L,droppableRects:T,over:ze,measureDroppableContainers:X,scrollableAncestors:Ke,scrollableAncestorRects:mt,measuringConfiguration:$,measuringScheduled:Z,windowRect:Ae}),[F,J,me,G,Je,se,Q,z,L,T,ze,X,Ke,mt,$,Z,Ae]),Be=_.useMemo(()=>({activatorEvent:G,activators:lt,active:F,activeNodeRect:me,ariaDescribedById:{draggable:A},dispatch:k,draggableNodes:z,over:ze,measureDroppableContainers:X}),[G,lt,F,me,k,A,z,ze,X]);return je.createElement(FM.Provider,{value:R},je.createElement(jg.Provider,{value:Be},je.createElement(eA.Provider,{value:ht},je.createElement(tA.Provider,{value:ut},u)),je.createElement(NW,{disabled:(c==null?void 0:c.restoreFocus)===!1})),je.createElement(OU,{...c,hiddenTextDescribedById:A}));function $e(){const Le=(H==null?void 0:H.autoScrollEnabled)===!1,Fe=typeof d=="object"?d.enabled===!1:d===!1,ye=D&&!Le&&!Fe;return typeof d=="object"?{...d,enabled:ye}:{enabled:ye}}}),LW=_.createContext(null),_E="button",IW="Draggable";function PW(t){let{id:e,data:n,disabled:r=!1,attributes:i}=t;const s=Wh(IW),{activators:a,activatorEvent:c,active:d,activeNodeRect:u,ariaDescribedById:f,draggableNodes:m,over:v}=_.useContext(jg),{role:b=_E,roleDescription:S="draggable",tabIndex:x=0}=i??{},C=(d==null?void 0:d.id)===e,k=_.useContext(C?tA:LW),[E,R]=jp(),[M,O]=jp(),D=xW(a,e),P=Sh(n);to(()=>(m.set(e,{id:e,key:s,node:E,activatorNode:M,data:P}),()=>{const Y=m.get(e);Y&&Y.key===s&&m.delete(e)}),[m,e]);const z=_.useMemo(()=>({role:b,tabIndex:x,"aria-disabled":r,"aria-pressed":C&&b===_E?!0:void 0,"aria-roledescription":S,"aria-describedby":f.draggable}),[r,b,x,C,S,f.draggable]);return{active:d,activatorEvent:c,activeNodeRect:u,attributes:z,isDragging:C,listeners:r?void 0:D,node:E,over:v,setNodeRef:R,setActivatorNodeRef:O,transform:k}}function zW(){return _.useContext(eA)}const BW="Droppable",FW={timeout:25};function HW(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:i}=t;const s=Wh(BW),{active:a,dispatch:c,over:d,measureDroppableContainers:u}=_.useContext(jg),f=_.useRef({disabled:n}),m=_.useRef(!1),v=_.useRef(null),b=_.useRef(null),{disabled:S,updateMeasurementsFor:x,timeout:C}={...FW,...i},k=Sh(x??r),E=_.useCallback(()=>{if(!m.current){m.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{u(Array.isArray(k.current)?k.current:[k.current]),b.current=null},C)},[C]),R=Og({callback:E,disabled:S||!a}),M=_.useCallback((z,Y)=>{R&&(Y&&(R.unobserve(Y),m.current=!1),z&&R.observe(z))},[R]),[O,D]=jp(M),P=Sh(e);return _.useEffect(()=>{!R||!O.current||(R.disconnect(),m.current=!1,R.observe(O.current))},[O,R]),_.useEffect(()=>(c({type:or.RegisterDroppable,element:{id:r,key:s,disabled:n,node:O,rect:v,data:P}}),()=>c({type:or.UnregisterDroppable,key:s,id:r})),[r]),_.useEffect(()=>{n!==f.current.disabled&&(c({type:or.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,c]),{active:a,rect:v,isOver:(d==null?void 0:d.id)===r,node:O,over:d,setNodeRef:D}}function yx(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function $W(t,e){return t.reduce((n,r,i)=>{const s=e.get(r);return s&&(n[i]=s),n},Array(t.length))}function xm(t){return t!==null&&t>=0}function UW(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function WW(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const rA=t=>{let{rects:e,activeIndex:n,overIndex:r,index:i}=t;const s=yx(e,r,n),a=e[i],c=s[i];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},Sm={scaleX:1,scaleY:1},iA=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:i,rects:s,overIndex:a}=t;const c=(e=s[n])!=null?e:r;if(!c)return null;if(i===n){const u=s[a];return u?{x:0,y:n<a?u.top+u.height-(c.top+c.height):u.top-c.top,...Sm}:null}const d=VW(s,i,n);return i>n&&i<=a?{x:0,y:-c.height-d,...Sm}:i<n&&i>=a?{x:0,y:c.height+d,...Sm}:{x:0,y:0,...Sm}};function VW(t,e,n){const r=t[e],i=t[e-1],s=t[e+1];return r?n<e?i?r.top-(i.top+i.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const sA="Sortable",oA=je.createContext({activeIndex:-1,containerId:sA,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:rA,disabled:{draggable:!1,droppable:!1}});function aA(t){let{children:e,id:n,items:r,strategy:i=rA,disabled:s=!1}=t;const{active:a,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:f}=zW(),m=Wh(sA,n),v=c.rect!==null,b=_.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),S=a!=null,x=a?b.indexOf(a.id):-1,C=u?b.indexOf(u.id):-1,k=_.useRef(b),E=!UW(b,k.current),R=C!==-1&&x===-1||E,M=WW(s);to(()=>{E&&S&&f(b)},[E,b,S,f]),_.useEffect(()=>{k.current=b},[b]);const O=_.useMemo(()=>({activeIndex:x,containerId:m,disabled:M,disableTransforms:R,items:b,overIndex:C,useDragOverlay:v,sortedRects:$W(b,d),strategy:i}),[x,m,M.draggable,M.droppable,R,b,C,d,v,i]);return je.createElement(oA.Provider,{value:O},e)}const qW=t=>{let{id:e,items:n,activeIndex:r,overIndex:i}=t;return yx(n,r,i).indexOf(e)},KW=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:i,items:s,newIndex:a,previousItems:c,previousContainerId:d,transition:u}=t;return!u||!r||c!==s&&i===a?!1:n?!0:a!==i&&e===d},GW={duration:200,easing:"ease"},lA="transform",YW=wu.Transition.toString({property:lA,duration:0,easing:"linear"}),XW={roleDescription:"sortable"};function QW(t){let{disabled:e,index:n,node:r,rect:i}=t;const[s,a]=_.useState(null),c=_.useRef(n);return to(()=>{if(!e&&n!==c.current&&r.current){const d=i.current;if(d){const u=zu(r.current,{ignoreTransform:!0}),f={x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height};(f.x||f.y)&&a(f)}}n!==c.current&&(c.current=n)},[e,n,r,i]),_.useEffect(()=>{s&&a(null)},[s]),s}function cA(t){let{animateLayoutChanges:e=KW,attributes:n,disabled:r,data:i,getNewIndex:s=qW,id:a,strategy:c,resizeObserverConfig:d,transition:u=GW}=t;const{items:f,containerId:m,activeIndex:v,disabled:b,disableTransforms:S,sortedRects:x,overIndex:C,useDragOverlay:k,strategy:E}=_.useContext(oA),R=ZW(r,b),M=f.indexOf(a),O=_.useMemo(()=>({sortable:{containerId:m,index:M,items:f},...i}),[m,i,M,f]),D=_.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:P,node:z,isOver:Y,setNodeRef:L}=HW({id:a,data:O,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...d}}),{active:W,activatorEvent:V,activeNodeRect:F,attributes:U,setNodeRef:H,listeners:j,isDragging:G,over:B,setActivatorNodeRef:K,transform:A}=PW({id:a,data:O,attributes:{...XW,...n},disabled:R.draggable}),I=yU(L,H),$=!!W,T=$&&!S&&xm(v)&&xm(C),X=!k&&G,Z=X&&T?A:null,re=T?Z??(c??E)({rects:x,activeNodeRect:F,activeIndex:v,overIndex:C,index:M}):null,ae=xm(v)&&xm(C)?s({id:a,items:f,activeIndex:v,overIndex:C}):M,ue=W==null?void 0:W.id,me=_.useRef({activeId:ue,items:f,newIndex:ae,containerId:m}),se=f!==me.current.items,oe=e({active:W,containerId:m,isDragging:G,isSorting:$,id:a,index:M,items:f,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:u,wasDragging:me.current.activeId!=null}),ee=QW({disabled:!oe,index:M,node:z,rect:P});return _.useEffect(()=>{$&&me.current.newIndex!==ae&&(me.current.newIndex=ae),m!==me.current.containerId&&(me.current.containerId=m),f!==me.current.items&&(me.current.items=f)},[$,ae,m,f]),_.useEffect(()=>{if(ue===me.current.activeId)return;if(ue!=null&&me.current.activeId==null){me.current.activeId=ue;return}const te=setTimeout(()=>{me.current.activeId=ue},50);return()=>clearTimeout(te)},[ue]),{active:W,activeIndex:v,attributes:U,data:O,rect:P,index:M,newIndex:ae,items:f,isOver:Y,isSorting:$,isDragging:G,listeners:j,node:z,overIndex:C,over:B,setNodeRef:I,setActivatorNodeRef:K,setDroppableNodeRef:L,setDraggableNodeRef:H,transform:ee??re,transition:Q()};function Q(){if(ee||se&&me.current.newIndex===M)return YW;if(!(X&&!px(V)||!u)&&($||oe))return wu.Transition.toString({...u,property:lA})}}function ZW(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}Yt.Down,Yt.Right,Yt.Up,Yt.Left;function Gc(t,e,n){let r=n.initialDeps??[],i,s=!0;function a(){var c,d,u;let f;n.key&&((c=n.debug)!=null&&c.call(n))&&(f=Date.now());const m=t();if(!(m.length!==r.length||m.some((S,x)=>r[x]!==S)))return i;r=m;let b;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(b=Date.now()),i=e(...m),n.key&&((u=n.debug)!=null&&u.call(n))){const S=Math.round((Date.now()-f)*100)/100,x=Math.round((Date.now()-b)*100)/100,C=x/16,k=(E,R)=>{for(E=String(E);E.length<R;)E=" "+E;return E};console.info(`%c⏱ ${k(x,5)} /${k(S,5)} ms`,`
|
|
473
|
+
font-size: .6rem;
|
|
474
|
+
font-weight: bold;
|
|
475
|
+
color: hsl(${Math.max(0,Math.min(120-120*C,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(i),s=!1,i}return a.updateDeps=c=>{r=c},a}function yE(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const JW=(t,e)=>Math.abs(t-e)<1.01,eV=(t,e,n)=>{let r;return function(...i){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,i),n)}},xE=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},tV=t=>t,nV=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let i=e;i<=n;i++)r.push(i);return r},rV=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const i=a=>{const{width:c,height:d}=a;e({width:Math.round(c),height:Math.round(d)})};if(i(xE(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(a=>{const c=()=>{const d=a[0];if(d!=null&&d.borderBoxSize){const u=d.borderBoxSize[0];if(u){i({width:u.inlineSize,height:u.blockSize});return}}i(xE(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},SE={passive:!0},wE=typeof window>"u"?!0:"onscrollend"in window,iV=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let i=0;const s=t.options.useScrollendEvent&&wE?()=>{}:eV(r,()=>{e(i,!1)},t.options.isScrollingResetDelay),a=f=>()=>{const{horizontal:m,isRtl:v}=t.options;i=m?n.scrollLeft*(v&&-1||1):n.scrollTop,s(),e(i,f)},c=a(!0),d=a(!1);n.addEventListener("scroll",c,SE);const u=t.options.useScrollendEvent&&wE;return u&&n.addEventListener("scrollend",d,SE),()=>{n.removeEventListener("scroll",c),u&&n.removeEventListener("scrollend",d)}},sV=(t,e,n)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},oV=(t,{adjustments:e=0,behavior:n},r)=>{var i,s;const a=t+e;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class aV{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{const a=()=>{const c=s.target,d=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(c,s,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:tV,rangeExtractor:nV,onChange:()=>{},measureElement:sV,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Gc(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,s=new Map;for(let a=r-1;a>=0;a--){const c=n[a];if(i.has(c.lane))continue;const d=s.get(c.lane);if(d==null||c.end>d.end?s.set(c.lane,c):c.end<d.end&&i.set(c.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((a,c)=>a.end===c.end?a.index-c.index:a.end-c.end)[0]:void 0},this.getMeasurementOptions=Gc(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,i,s,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:c}),{key:!1}),this.getMeasurements=Gc(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:c},d)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const v of this.laneAssignments.keys())v>=n&&this.laneAssignments.delete(v);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(v=>{this.itemSizeCache.set(v.key,v.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,u),m=new Array(c).fill(void 0);for(let v=0;v<u;v++){const b=f[v];b&&(m[b.lane]=v)}for(let v=u;v<n;v++){const b=s(v),S=this.laneAssignments.get(v);let x,C;if(S!==void 0&&this.options.lanes>1){x=S;const M=m[x],O=M!==void 0?f[M]:void 0;C=O?O.end+this.options.gap:r+i}else{const M=this.options.lanes===1?f[v-1]:this.getFurthestMeasurement(f,v);C=M?M.end+this.options.gap:r+i,x=M?M.lane:v%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(v,x)}const k=d.get(b),E=typeof k=="number"?k:this.options.estimateSize(v),R=C+E;f[v]={index:v,start:C,size:E,end:R,key:b,lane:x},m[x]=v}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Gc(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,s)=>this.range=n.length>0&&r>0?lV({measurements:n,outerSize:r,scrollOffset:i,lanes:s}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Gc(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,s,a)=>s===null||a===null?[]:n({startIndex:s,endIndex:a,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(i!==void 0&&this.range){const s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,i-s),c=Math.min(this.options.count-1,i+s);return n>=a&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,c)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(c))});return}const r=this.indexFromElement(n),i=this.options.getItemKey(r),s=this.elementsCache.get(i);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(i,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var i;const s=this.measurementsCache[n];if(!s)return;const a=this.itemSizeCache.get(s.key)??s.size,c=r-a;c!==0&&(((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,c,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.getVirtualItems=Gc(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;s<a;s++){const c=n[s],d=r[c];i.push(d)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return yE(r[uA(0,r.length-1,i=>yE(r[i]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+s?"end":"start"),r==="center"?n+=(i-s)/2:r==="end"&&(n-=s);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),s=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(r==="auto")if(a.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(a.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const c=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,a.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{const s=this.getOffsetForAlignment(n,r),a=this.now();this.scrollState={index:null,align:r,behavior:i,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:i="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getOffsetForIndex(n,r);if(!s)return;const[a,c]=s,d=this.now();this.scrollState={index:n,align:c,behavior:i,startedAt:d,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getScrollOffset()+n,s=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((n=r[r.length-1])==null?void 0:n.end)??0;else{const s=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&s.some(c=>c===null);){const c=r[a];s[c.lane]===null&&(s[c.lane]=c.end),a--}i=Math.max(...s.filter(c=>c!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=r?r[0]:this.scrollState.lastTargetOffset,s=1,a=i!==this.scrollState.lastTargetOffset;if(!a&&JW(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=s){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=i,this.scrollState.behavior="auto",this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const uA=(t,e,n,r)=>{for(;t<=e;){const i=(t+e)/2|0,s=n(i);if(s<r)t=i+1;else if(s>r)e=i-1;else return i}return t>0?t-1:0};function lV({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const i=t.length-1,s=d=>t[d].start;if(t.length<=r)return{startIndex:0,endIndex:i};let a=uA(0,i,s,n),c=a;if(r===1)for(;c<i&&t[c].end<n+e;)c++;else if(r>1){const d=Array(r).fill(0);for(;c<i&&d.some(f=>f<n+e);){const f=t[c];d[f.lane]=f.end,c++}const u=Array(r).fill(n+e);for(;a>=0&&u.some(f=>f>=n);){const f=t[a];u[f.lane]=f.start,a--}a=Math.max(0,a-a%r),c=Math.min(i,c+(r-1-c%r))}return{startIndex:a,endIndex:c}}const CE=typeof document<"u"?_.useLayoutEffect:_.useEffect;function cV({useFlushSync:t=!0,...e}){const n=_.useReducer(()=>({}),{})[1],r={...e,onChange:(s,a)=>{var c;t&&a?es.flushSync(n):n(),(c=e.onChange)==null||c.call(e,s,a)}},[i]=_.useState(()=>new aV(r));return i.setOptions(r),CE(()=>i._didMount(),[]),CE(()=>i._willUpdate()),i}function uV(t){return cV({observeElementRect:rV,observeElementOffset:iV,scrollToFn:oV,...t})}const kE={idea:"border-amber-500/30 bg-amber-500/15 text-amber-700 dark:border-amber-500/40 dark:bg-amber-500/12 dark:text-amber-200",todo:"border-sky-500/30 bg-sky-500/15 text-sky-700 dark:border-sky-500/40 dark:bg-sky-500/12 dark:text-sky-200",progress:"border-indigo-500/30 bg-indigo-500/15 text-indigo-700 dark:border-indigo-500/40 dark:bg-indigo-500/12 dark:text-indigo-200",testing:"border-cyan-500/30 bg-cyan-500/15 text-cyan-700 dark:border-cyan-500/40 dark:bg-cyan-500/12 dark:text-cyan-200",done:"border-emerald-500/30 bg-emerald-500/15 text-emerald-700 dark:border-emerald-500/40 dark:bg-emerald-500/12 dark:text-emerald-200"};function EE(t,[e,n]){return Math.min(n,Math.max(e,t))}function dV(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var hV=[" ","Enter","ArrowUp","ArrowDown"],fV=[" ","Enter"],Kl="Select",[Lg,Ig,mV]=ex(Kl),[Bu,Ale]=Xo(Kl,[mV,sl]),Pg=sl(),[pV,al]=Bu(Kl),[gV,vV]=Bu(Kl),dA=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:c,onValueChange:d,dir:u,name:f,autoComplete:m,disabled:v,required:b,form:S}=t,x=Pg(e),[C,k]=_.useState(null),[E,R]=_.useState(null),[M,O]=_.useState(!1),D=tx(u),[P,z]=bu({prop:r,defaultProp:i??!1,onChange:s,caller:Kl}),[Y,L]=bu({prop:a,defaultProp:c,onChange:d,caller:Kl}),W=_.useRef(null),V=C?S||!!C.closest("form"):!0,[F,U]=_.useState(new Set),H=Array.from(F).map(j=>j.props.value).join(";");return g.jsx(bg,{...x,children:g.jsxs(pV,{required:b,scope:e,trigger:C,onTriggerChange:k,valueNode:E,onValueNodeChange:R,valueNodeHasChildren:M,onValueNodeHasChildrenChange:O,contentId:Wo(),value:Y,onValueChange:L,open:P,onOpenChange:z,dir:D,triggerPointerDownPosRef:W,disabled:v,children:[g.jsx(Lg.Provider,{scope:e,children:g.jsx(gV,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(j=>{U(G=>new Set(G).add(j))},[]),onNativeOptionRemove:_.useCallback(j=>{U(G=>{const B=new Set(G);return B.delete(j),B})},[]),children:n})}),V?g.jsxs(IA,{"aria-hidden":!0,required:b,tabIndex:-1,name:f,autoComplete:m,value:Y,onChange:j=>L(j.target.value),disabled:v,form:S,children:[Y===void 0?g.jsx("option",{value:""}):null,Array.from(F)]},H):null]})})};dA.displayName=Kl;var hA="SelectTrigger",fA=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,s=Pg(n),a=al(hA,n),c=a.disabled||r,d=Xt(e,a.onTriggerChange),u=Ig(n),f=_.useRef("touch"),[m,v,b]=zA(x=>{const C=u().filter(R=>!R.disabled),k=C.find(R=>R.value===a.value),E=BA(C,x,k);E!==void 0&&a.onValueChange(E.value)}),S=x=>{c||(a.onOpenChange(!0),b()),x&&(a.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return g.jsx(Ih,{asChild:!0,...s,children:g.jsx(Bt.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":PA(a.value)?"":void 0,...i,ref:d,onClick:nt(i.onClick,x=>{x.currentTarget.focus(),f.current!=="mouse"&&S(x)}),onPointerDown:nt(i.onPointerDown,x=>{f.current=x.pointerType;const C=x.target;C.hasPointerCapture(x.pointerId)&&C.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(S(x),x.preventDefault())}),onKeyDown:nt(i.onKeyDown,x=>{const C=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&v(x.key),!(C&&x.key===" ")&&hV.includes(x.key)&&(S(),x.preventDefault())})})})});fA.displayName=hA;var mA="SelectValue",pA=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...c}=t,d=al(mA,n),{onValueNodeHasChildrenChange:u}=d,f=s!==void 0,m=Xt(e,d.onValueNodeChange);return Pr(()=>{u(f)},[u,f]),g.jsx(Bt.span,{...c,ref:m,style:{pointerEvents:"none"},children:PA(d.value)?g.jsx(g.Fragment,{children:a}):s})});pA.displayName=mA;var bV="SelectIcon",gA=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return g.jsx(Bt.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});gA.displayName=bV;var _V="SelectPortal",vA=t=>g.jsx(Nu,{asChild:!0,...t});vA.displayName=_V;var Gl="SelectContent",bA=_.forwardRef((t,e)=>{const n=al(Gl,t.__scopeSelect),[r,i]=_.useState();if(Pr(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?es.createPortal(g.jsx(_A,{scope:t.__scopeSelect,children:g.jsx(Lg.Slot,{scope:t.__scopeSelect,children:g.jsx("div",{children:t.children})})}),s):null}return g.jsx(yA,{...t,ref:e})});bA.displayName=Gl;var bs=10,[_A,ll]=Bu(Gl),yV="SelectContentImpl",xV=Wl("SelectContent.RemoveScroll"),yA=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:v,collisionPadding:b,sticky:S,hideWhenDetached:x,avoidCollisions:C,...k}=t,E=al(Gl,n),[R,M]=_.useState(null),[O,D]=_.useState(null),P=Xt(e,re=>M(re)),[z,Y]=_.useState(null),[L,W]=_.useState(null),V=Ig(n),[F,U]=_.useState(!1),H=_.useRef(!1);_.useEffect(()=>{if(R)return ug(R)},[R]),lg();const j=_.useCallback(re=>{const[ae,...ue]=V().map(oe=>oe.ref.current),[me]=ue.slice(-1),se=document.activeElement;for(const oe of re)if(oe===se||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===ae&&O&&(O.scrollTop=0),oe===me&&O&&(O.scrollTop=O.scrollHeight),oe==null||oe.focus(),document.activeElement!==se))return},[V,O]),G=_.useCallback(()=>j([z,R]),[j,z,R]);_.useEffect(()=>{F&&G()},[F,G]);const{onOpenChange:B,triggerPointerDownPosRef:K}=E;_.useEffect(()=>{if(R){let re={x:0,y:0};const ae=me=>{var se,oe;re={x:Math.abs(Math.round(me.pageX)-(((se=K.current)==null?void 0:se.x)??0)),y:Math.abs(Math.round(me.pageY)-(((oe=K.current)==null?void 0:oe.y)??0))}},ue=me=>{re.x<=10&&re.y<=10?me.preventDefault():R.contains(me.target)||B(!1),document.removeEventListener("pointermove",ae),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",ue,{capture:!0})}}},[R,B,K]),_.useEffect(()=>{const re=()=>B(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[B]);const[A,I]=zA(re=>{const ae=V().filter(se=>!se.disabled),ue=ae.find(se=>se.ref.current===document.activeElement),me=BA(ae,re,ue);me&&setTimeout(()=>me.ref.current.focus())}),$=_.useCallback((re,ae,ue)=>{const me=!H.current&&!ue;(E.value!==void 0&&E.value===ae||me)&&(Y(re),me&&(H.current=!0))},[E.value]),T=_.useCallback(()=>R==null?void 0:R.focus(),[R]),X=_.useCallback((re,ae,ue)=>{const me=!H.current&&!ue;(E.value!==void 0&&E.value===ae||me)&&W(re)},[E.value]),Z=r==="popper"?K1:xA,J=Z===K1?{side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:v,collisionPadding:b,sticky:S,hideWhenDetached:x,avoidCollisions:C}:{};return g.jsx(_A,{scope:n,content:R,viewport:O,onViewportChange:D,itemRefCallback:$,selectedItem:z,onItemLeave:T,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:L,position:r,isPositioned:F,searchRef:A,children:g.jsx(jh,{as:xV,allowPinchZoom:!0,children:g.jsx(Oh,{asChild:!0,trapped:E.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:nt(i,re=>{var ae;(ae=E.trigger)==null||ae.focus({preventScroll:!0}),re.preventDefault()}),children:g.jsx(Au,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:g.jsx(Z,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:re=>re.preventDefault(),...k,...J,onPlaced:()=>U(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:nt(k.onKeyDown,re=>{const ae=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!ae&&re.key.length===1&&I(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let me=V().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(re.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const se=re.target,oe=me.indexOf(se);me=me.slice(oe+1)}setTimeout(()=>j(me)),re.preventDefault()}})})})})})})});yA.displayName=yV;var SV="SelectItemAlignedPosition",xA=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,s=al(Gl,n),a=ll(Gl,n),[c,d]=_.useState(null),[u,f]=_.useState(null),m=Xt(e,P=>f(P)),v=Ig(n),b=_.useRef(!1),S=_.useRef(!0),{viewport:x,selectedItem:C,selectedItemText:k,focusSelectedItem:E}=a,R=_.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&x&&C&&k){const P=s.trigger.getBoundingClientRect(),z=u.getBoundingClientRect(),Y=s.valueNode.getBoundingClientRect(),L=k.getBoundingClientRect();if(s.dir!=="rtl"){const se=L.left-z.left,oe=Y.left-se,ee=P.left-oe,Q=P.width+ee,te=Math.max(Q,z.width),he=window.innerWidth-bs,ie=EE(oe,[bs,Math.max(bs,he-te)]);c.style.minWidth=Q+"px",c.style.left=ie+"px"}else{const se=z.right-L.right,oe=window.innerWidth-Y.right-se,ee=window.innerWidth-P.right-oe,Q=P.width+ee,te=Math.max(Q,z.width),he=window.innerWidth-bs,ie=EE(oe,[bs,Math.max(bs,he-te)]);c.style.minWidth=Q+"px",c.style.right=ie+"px"}const W=v(),V=window.innerHeight-bs*2,F=x.scrollHeight,U=window.getComputedStyle(u),H=parseInt(U.borderTopWidth,10),j=parseInt(U.paddingTop,10),G=parseInt(U.borderBottomWidth,10),B=parseInt(U.paddingBottom,10),K=H+j+F+B+G,A=Math.min(C.offsetHeight*5,K),I=window.getComputedStyle(x),$=parseInt(I.paddingTop,10),T=parseInt(I.paddingBottom,10),X=P.top+P.height/2-bs,Z=V-X,J=C.offsetHeight/2,re=C.offsetTop+J,ae=H+j+re,ue=K-ae;if(ae<=X){const se=W.length>0&&C===W[W.length-1].ref.current;c.style.bottom="0px";const oe=u.clientHeight-x.offsetTop-x.offsetHeight,ee=Math.max(Z,J+(se?T:0)+oe+G),Q=ae+ee;c.style.height=Q+"px"}else{const se=W.length>0&&C===W[0].ref.current;c.style.top="0px";const ee=Math.max(X,H+x.offsetTop+(se?$:0)+J)+ue;c.style.height=ee+"px",x.scrollTop=ae-X+x.offsetTop}c.style.margin=`${bs}px 0`,c.style.minHeight=A+"px",c.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[v,s.trigger,s.valueNode,c,u,x,C,k,s.dir,r]);Pr(()=>R(),[R]);const[M,O]=_.useState();Pr(()=>{u&&O(window.getComputedStyle(u).zIndex)},[u]);const D=_.useCallback(P=>{P&&S.current===!0&&(R(),E==null||E(),S.current=!1)},[R,E]);return g.jsx(CV,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:b,onScrollButtonChange:D,children:g.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:g.jsx(Bt.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});xA.displayName=SV;var wV="SelectPopperPosition",K1=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=bs,...s}=t,a=Pg(n);return g.jsx(_g,{...a,...s,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})});K1.displayName=wV;var[CV,xx]=Bu(Gl,{}),G1="SelectViewport",SA=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,s=ll(G1,n),a=xx(G1,n),c=Xt(e,s.onViewportChange),d=_.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(Lg.Slot,{scope:n,children:g.jsx(Bt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:nt(i.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=a;if(v!=null&&v.current&&m){const b=Math.abs(d.current-f.scrollTop);if(b>0){const S=window.innerHeight-bs*2,x=parseFloat(m.style.minHeight),C=parseFloat(m.style.height),k=Math.max(x,C);if(k<S){const E=k+b,R=Math.min(S,E),M=E-R;m.style.height=R+"px",m.style.bottom==="0px"&&(f.scrollTop=M>0?M:0,m.style.justifyContent="flex-end")}}}d.current=f.scrollTop})})})]})});SA.displayName=G1;var wA="SelectGroup",[kV,EV]=Bu(wA),CA=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Wo();return g.jsx(kV,{scope:n,id:i,children:g.jsx(Bt.div,{role:"group","aria-labelledby":i,...r,ref:e})})});CA.displayName=wA;var kA="SelectLabel",EA=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=EV(kA,n);return g.jsx(Bt.div,{id:i.id,...r,ref:e})});EA.displayName=kA;var zp="SelectItem",[RV,RA]=Bu(zp),TA=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=t,c=al(zp,n),d=ll(zp,n),u=c.value===r,[f,m]=_.useState(s??""),[v,b]=_.useState(!1),S=Xt(e,E=>{var R;return(R=d.itemRefCallback)==null?void 0:R.call(d,E,r,i)}),x=Wo(),C=_.useRef("touch"),k=()=>{i||(c.onValueChange(r),c.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(RV,{scope:n,value:r,disabled:i,textId:x,isSelected:u,onItemTextChange:_.useCallback(E=>{m(R=>R||((E==null?void 0:E.textContent)??"").trim())},[]),children:g.jsx(Lg.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:g.jsx(Bt.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":u&&v,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:S,onFocus:nt(a.onFocus,()=>b(!0)),onBlur:nt(a.onBlur,()=>b(!1)),onClick:nt(a.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:nt(a.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:nt(a.onPointerDown,E=>{C.current=E.pointerType}),onPointerMove:nt(a.onPointerMove,E=>{var R;C.current=E.pointerType,i?(R=d.onItemLeave)==null||R.call(d):C.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:nt(a.onPointerLeave,E=>{var R;E.currentTarget===document.activeElement&&((R=d.onItemLeave)==null||R.call(d))}),onKeyDown:nt(a.onKeyDown,E=>{var M;((M=d.searchRef)==null?void 0:M.current)!==""&&E.key===" "||(fV.includes(E.key)&&k(),E.key===" "&&E.preventDefault())})})})})});TA.displayName=zp;var Qd="SelectItemText",MA=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...s}=t,a=al(Qd,n),c=ll(Qd,n),d=RA(Qd,n),u=vV(Qd,n),[f,m]=_.useState(null),v=Xt(e,k=>m(k),d.onItemTextChange,k=>{var E;return(E=c.itemTextRefCallback)==null?void 0:E.call(c,k,d.value,d.disabled)}),b=f==null?void 0:f.textContent,S=_.useMemo(()=>g.jsx("option",{value:d.value,disabled:d.disabled,children:b},d.value),[d.disabled,d.value,b]),{onNativeOptionAdd:x,onNativeOptionRemove:C}=u;return Pr(()=>(x(S),()=>C(S)),[x,C,S]),g.jsxs(g.Fragment,{children:[g.jsx(Bt.span,{id:d.textId,...s,ref:v}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren?es.createPortal(s.children,a.valueNode):null]})});MA.displayName=Qd;var AA="SelectItemIndicator",NA=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return RA(AA,n).isSelected?g.jsx(Bt.span,{"aria-hidden":!0,...r,ref:e}):null});NA.displayName=AA;var Y1="SelectScrollUpButton",DA=_.forwardRef((t,e)=>{const n=ll(Y1,t.__scopeSelect),r=xx(Y1,t.__scopeSelect),[i,s]=_.useState(!1),a=Xt(e,r.onScrollButtonChange);return Pr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollTop>0;s(u)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?g.jsx(jA,{...t,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});DA.displayName=Y1;var X1="SelectScrollDownButton",OA=_.forwardRef((t,e)=>{const n=ll(X1,t.__scopeSelect),r=xx(X1,t.__scopeSelect),[i,s]=_.useState(!1),a=Xt(e,r.onScrollButtonChange);return Pr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollHeight-d.clientHeight,f=Math.ceil(d.scrollTop)<u;s(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?g.jsx(jA,{...t,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});OA.displayName=X1;var jA=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,s=ll("SelectScrollButton",n),a=_.useRef(null),c=Ig(n),d=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>d(),[d]),Pr(()=>{var f;const u=c().find(m=>m.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[c]),g.jsx(Bt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:nt(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:nt(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:nt(i.onPointerLeave,()=>{d()})})}),TV="SelectSeparator",LA=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return g.jsx(Bt.div,{"aria-hidden":!0,...r,ref:e})});LA.displayName=TV;var Q1="SelectArrow",MV=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Pg(n),s=al(Q1,n),a=ll(Q1,n);return s.open&&a.position==="popper"?g.jsx(yg,{...i,...r,ref:e}):null});MV.displayName=Q1;var AV="SelectBubbleInput",IA=_.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=_.useRef(null),s=Xt(r,i),a=dV(e);return _.useEffect(()=>{const c=i.current;if(!c)return;const d=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(a!==e&&f){const m=new Event("change",{bubbles:!0});f.call(c,e),c.dispatchEvent(m)}},[a,e]),g.jsx(Bt.select,{...n,style:{...bT,...n.style},ref:s,defaultValue:e})});IA.displayName=AV;function PA(t){return t===""||t===void 0}function zA(t){const e=Ss(t),n=_.useRef(""),r=_.useRef(0),i=_.useCallback(a=>{const c=n.current+a;e(c),function d(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>d(""),1e3))}(c)},[e]),s=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function BA(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let a=NV(t,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==n));const d=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function NV(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var DV=dA,FA=fA,OV=pA,jV=gA,LV=vA,HA=bA,IV=SA,PV=CA,$A=EA,Sx=TA,UA=MA,WA=NA,VA=DA,qA=OA,KA=LA;const zV=DV,Nle=PV,BV=OV,GA=_.forwardRef((t,e)=>{const n=ke.c(12);let r,i,s;n[0]!==t?({className:i,children:r,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s):(r=n[1],i=n[2],s=n[3]);let a;n[4]!==i?(a=Ce("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",i),n[4]=i,n[5]=a):a=n[5];let c;n[6]===Symbol.for("react.memo_cache_sentinel")?(c=g.jsx(jV,{asChild:!0,children:g.jsx(og,{className:"h-4 w-4 shrink-0 opacity-50"})}),n[6]=c):c=n[6];let d;return n[7]!==r||n[8]!==s||n[9]!==e||n[10]!==a?(d=g.jsxs(FA,{ref:e,className:a,...s,children:[r,c]}),n[7]=r,n[8]=s,n[9]=e,n[10]=a,n[11]=d):d=n[11],d});GA.displayName=FA.displayName;const YA=_.forwardRef((t,e)=>{const n=ke.c(10);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("flex cursor-default items-center justify-center py-1",r),n[3]=r,n[4]=s):s=n[4];let a;n[5]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(VP,{className:"h-4 w-4"}),n[5]=a):a=n[5];let c;return n[6]!==i||n[7]!==e||n[8]!==s?(c=g.jsx(VA,{ref:e,className:s,...i,children:a}),n[6]=i,n[7]=e,n[8]=s,n[9]=c):c=n[9],c});YA.displayName=VA.displayName;const XA=_.forwardRef((t,e)=>{const n=ke.c(10);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("flex cursor-default items-center justify-center py-1",r),n[3]=r,n[4]=s):s=n[4];let a;n[5]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(og,{className:"h-4 w-4"}),n[5]=a):a=n[5];let c;return n[6]!==i||n[7]!==e||n[8]!==s?(c=g.jsx(qA,{ref:e,className:s,...i,children:a}),n[6]=i,n[7]=e,n[8]=s,n[9]=c):c=n[9],c});XA.displayName=qA.displayName;const QA=_.forwardRef((t,e)=>{const n=ke.c(21);let r,i,s,a;n[0]!==t?({className:i,children:r,position:a,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=a):(r=n[1],i=n[2],s=n[3],a=n[4]);const c=a===void 0?"popper":a,d=c==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let u;n[5]!==i||n[6]!==d?(u=Ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-background text-foreground shadow-md backdrop-blur-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",d,i),n[5]=i,n[6]=d,n[7]=u):u=n[7];let f;n[8]===Symbol.for("react.memo_cache_sentinel")?(f=g.jsx(YA,{}),n[8]=f):f=n[8];const m=c==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]";let v;n[9]!==m?(v=Ce("p-1",m),n[9]=m,n[10]=v):v=n[10];let b;n[11]!==r||n[12]!==v?(b=g.jsx(IV,{className:v,children:r}),n[11]=r,n[12]=v,n[13]=b):b=n[13];let S;n[14]===Symbol.for("react.memo_cache_sentinel")?(S=g.jsx(XA,{}),n[14]=S):S=n[14];let x;return n[15]!==c||n[16]!==s||n[17]!==e||n[18]!==u||n[19]!==b?(x=g.jsx(LV,{children:g.jsxs(HA,{ref:e,className:u,position:c,...s,children:[f,b,S]})}),n[15]=c,n[16]=s,n[17]=e,n[18]=u,n[19]=b,n[20]=x):x=n[20],x});QA.displayName=HA.displayName;const FV=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("px-2 py-1.5 text-sm font-semibold",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx($A,{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});FV.displayName=$A.displayName;const ZA=_.forwardRef((t,e)=>{const n=ke.c(14);let r,i,s;n[0]!==t?({className:i,children:r,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s):(r=n[1],i=n[2],s=n[3]);let a;n[4]!==i?(a=Ce("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",i),n[4]=i,n[5]=a):a=n[5];let c;n[6]===Symbol.for("react.memo_cache_sentinel")?(c=g.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(WA,{children:g.jsx(di,{className:"h-4 w-4"})})}),n[6]=c):c=n[6];let d;n[7]!==r?(d=g.jsx(UA,{children:r}),n[7]=r,n[8]=d):d=n[8];let u;return n[9]!==s||n[10]!==e||n[11]!==a||n[12]!==d?(u=g.jsxs(Sx,{ref:e,className:a,...s,children:[c,d]}),n[9]=s,n[10]=e,n[11]=a,n[12]=d,n[13]=u):u=n[13],u});ZA.displayName=Sx.displayName;const HV=_.forwardRef((t,e)=>{const n=ke.c(22);let r,i,s,a,c;n[0]!==t?({className:i,children:r,thumbnail:c,thumbnailAlt:a,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=a,n[5]=c):(r=n[1],i=n[2],s=n[3],a=n[4],c=n[5]);const d=a===void 0?"":a;let u;n[6]!==i?(u=Ce("flex w-full cursor-default select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-2 text-sm outline-none","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",i),n[6]=i,n[7]=u):u=n[7];let f;n[8]!==r?(f=g.jsx("div",{className:"min-w-0 flex-1 truncate",children:g.jsx(UA,{children:r})}),n[8]=r,n[9]=f):f=n[9];let m;n[10]!==c||n[11]!==d?(m=c?g.jsx("img",{src:c,alt:d,className:"h-5 w-9 rounded object-cover opacity-90"}):null,n[10]=c,n[11]=d,n[12]=m):m=n[12];let v;n[13]===Symbol.for("react.memo_cache_sentinel")?(v=g.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(WA,{children:g.jsx(di,{className:"h-4 w-4"})})}),n[13]=v):v=n[13];let b;n[14]!==m?(b=g.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[m,v]}),n[14]=m,n[15]=b):b=n[15];let S;return n[16]!==s||n[17]!==e||n[18]!==u||n[19]!==f||n[20]!==b?(S=g.jsxs(Sx,{ref:e,className:u,...s,children:[f,b]}),n[16]=s,n[17]=e,n[18]=u,n[19]=f,n[20]=b,n[21]=S):S=n[21],S});HV.displayName="SelectItemWithThumbnail";const $V=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("-mx-1 my-1 h-px bg-border",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx(KA,{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});$V.displayName=KA.displayName;function zg(t){const e=ke.c(5);let n;e[0]!==t?(n=()=>typeof window>"u"?!1:window.matchMedia(t).matches,e[0]=t,e[1]=n):n=e[1];const[r,i]=_.useState(n);let s,a;return e[2]!==t?(s=()=>{const c=window.matchMedia(t),d=()=>i(c.matches);return d(),c.addEventListener?(c.addEventListener("change",d),()=>c.removeEventListener("change",d)):(c.addListener(d),()=>c.removeListener(d))},a=[t],e[2]=t,e[3]=s,e[4]=a):(s=e[3],a=e[4]),_.useEffect(s,a),r}function UV(t){const e=ke.c(8),{iconDataUrl:n,alt:r,className:i,fallback:s}=t,a=s===void 0?null:s;if(!n){let u;return e[0]!==a?(u=g.jsx(g.Fragment,{children:a}),e[0]=a,e[1]=u):u=e[1],u}let c;e[2]!==i?(c=Ce("shrink-0 object-contain",i),e[2]=i,e[3]=c):c=e[3];let d;return e[4]!==r||e[5]!==n||e[6]!==c?(d=g.jsx("img",{src:n,alt:r,className:c}),e[4]=r,e[5]=n,e[6]=c,e[7]=d):d=e[7],d}const RE=t=>{let e;const n=new Set,r=(u,f)=>{const m=typeof u=="function"?u(e):u;if(!Object.is(m,e)){const v=e;e=f??(typeof m!="object"||m===null)?m:Object.assign({},e,m),n.forEach(b=>b(e,v))}},i=()=>e,c={setState:r,getState:i,getInitialState:()=>d,subscribe:u=>(n.add(u),()=>n.delete(u))},d=e=t(r,i,c);return c},WV=t=>t?RE(t):RE,VV=t=>t;function qV(t,e=VV){const n=je.useSyncExternalStore(t.subscribe,je.useCallback(()=>e(t.getState()),[t,e]),je.useCallback(()=>e(t.getInitialState()),[t,e]));return je.useDebugValue(n),n}const TE=t=>{const e=WV(t),n=r=>qV(e,r);return Object.assign(n,e),n},fi=t=>t?TE(t):TE;function KV(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var s;const a=d=>d===null?null:JSON.parse(d,void 0),c=(s=n.getItem(i))!=null?s:null;return c instanceof Promise?c.then(a):a(c)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const Z1=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return Z1(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Z1(r)(n)}}}},GV=(t,e)=>(n,r,i)=>{let s={storage:KV(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...e},a=!1,c=0;const d=new Set,u=new Set;let f=s.storage;if(!f)return t((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...C)},r,i);const m=()=>{const C=s.partialize({...r()});return f.setItem(s.name,{state:C,version:s.version})},v=i.setState;i.setState=(C,k)=>(v(C,k),m());const b=t((...C)=>(n(...C),m()),r,i);i.getInitialState=()=>b;let S;const x=()=>{var C,k;if(!f)return;const E=++c;a=!1,d.forEach(M=>{var O;return M((O=r())!=null?O:b)});const R=((k=s.onRehydrateStorage)==null?void 0:k.call(s,(C=r())!=null?C:b))||void 0;return Z1(f.getItem.bind(f))(s.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==s.version){if(s.migrate){const O=s.migrate(M.state,M.version);return O instanceof Promise?O.then(D=>[!0,D]):[!0,O]}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 O;if(E!==c)return;const[D,P]=M;if(S=s.merge(P,(O=r())!=null?O:b),n(S,!0),D)return m()}).then(()=>{E===c&&(R==null||R(r(),void 0),S=r(),a=!0,u.forEach(M=>M(S)))}).catch(M=>{E===c&&(R==null||R(void 0,M))})};return i.persist={setOptions:C=>{s={...s,...C},C.storage&&(f=C.storage)},clearStorage:()=>{f==null||f.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>x(),hasHydrated:()=>a,onHydrate:C=>(d.add(C),()=>{d.delete(C)}),onFinishHydration:C=>(u.add(C),()=>{u.delete(C)})},s.skipHydration||x(),S||b},Li=GV,_s=fi()(Li(t=>({themePreference:"system",themeId:"default",customAppearance:"system",backgroundImage:null,backgroundOpacity:1,backgroundBlur:0,showProjectIconsInSidebar:!0,availableThemes:[],themeCssText:"",setThemePreference:e=>t({themePreference:e}),setThemeId:e=>t({themeId:e}),setCustomAppearance:e=>t({customAppearance:e}),setBackgroundImage:e=>t({backgroundImage:e}),setBackgroundOpacity:e=>t({backgroundOpacity:e}),setBackgroundBlur:e=>t({backgroundBlur:e}),setShowProjectIconsInSidebar:e=>t({showProjectIconsInSidebar:e}),setAvailableThemes:e=>t({availableThemes:e}),setThemeCssText:e=>t({themeCssText:e})}),{name:"theme-settings"})),Zd=new Map,wx=fi(()=>({pending:{}}));function YV(t){return encodeURIComponent(t)}function $r(t,...e){return`${t}:${e.map(YV).join(":")}`}function Cx(t,e){wx.setState(n=>{const r=e(n.pending[t]);if(r===null){const i={...n.pending};return delete i[t],{pending:i}}return{pending:{...n.pending,[t]:r}}})}const hr={chatCreate:(t,e)=>$r("chat.create",t,e??"general"),chatPlanMode:t=>$r("chat.plan-mode",t),featureCreate:t=>$r("feature.create",t),featureOverviewSave:t=>$r("feature.overview.save",t),localProjectCreate:t=>$r("project.open","create",t),localProjectHide:t=>$r("project.hide","local",t),localProjectOpen:t=>$r("project.open","local",t),planHandoff:(t,e)=>$r("plan.handoff",t,e),planRespond:(t,e)=>$r("plan.respond",t,e),projectRemove:t=>$r("project.remove",t),providerLogin:t=>$r("provider.login",t),providerUsageRefresh:(t="all")=>$r("provider.usage.refresh",t),settingsRemoteAuth:t=>$r("settings.remote-auth",t),settingsTheme:t=>$r("settings.theme",t),settingsUpdate:t=>$r("settings.update",t)};function JA(t,e){Cx(t,n=>({count:((n==null?void 0:n.count)??0)+1,statusLabel:(e==null?void 0:e.statusLabel)??(n==null?void 0:n.statusLabel)??null}))}function XV(t){Cx(t,e=>!e||e.count<=1?null:{...e,count:e.count-1})}function wm(t){Cx(t,()=>null),Zd.delete(t)}function hu(t){const e=ke.c(2);let n;return e[0]!==t?(n=r=>!!r.pending[t],e[0]=t,e[1]=n):n=e[1],wx(n)}function QV(t){const e=ke.c(2);let n;return e[0]!==t?(n=r=>{var i;return((i=r.pending[t])==null?void 0:i.statusLabel)??null},e[0]=t,e[1]=n):n=e[1],wx(n)}function Ho(t,e,n){const r=(n==null?void 0:n.dedupe)??!0,i=Zd.get(t);if(i&&r)return i;JA(t,{statusLabel:(n==null?void 0:n.statusLabel)??null});const s=Promise.resolve().then(e);return Zd.set(t,s),s.finally(()=>{Zd.get(t)===s&&Zd.delete(t),XV(t)})}const eN=8,ZV=180;function J1(t,e){return!t.has(e)}function Ld(t,e,n,r="before"){const i=t.map(u=>u.featureId),s=i.indexOf(e),a=i.indexOf(n);if(s===-1||a===-1||s===a)return null;const c=i.filter(u=>u!==e),d=c.indexOf(n);return d===-1||(c.splice(r==="after"?d+1:d,0,e),c.every((u,f)=>u===i[f]))?null:c}function ME(t,e,n){const r=[...t.querySelectorAll("[data-feature-drop-target]")].map(s=>({element:s,featureId:s.getAttribute("data-feature-drop-target")})).filter(s=>!!(s.featureId&&n.includes(s.featureId)));if(r.length===0)return null;for(const{element:s,featureId:a}of r){const c=s.getBoundingClientRect(),d=c.top+c.height/2;if(e<=d)return{featureId:a,position:"before"};if(e<=c.bottom)return{featureId:a,position:"after"}}const i=r.at(-1);return i?{featureId:i.featureId,position:"after"}:null}function JV(t){return{activeFeatures:t.filter(e=>e.stage!=="done"),completedFeatures:t.filter(e=>e.stage==="done")}}function eq(t,e){return e?t:t.slice(0,eN)}function tq(t,e){return t.map(n=>`feature:${n.featureId}`).filter(n=>!e.has(n))}function AE(t){const e=ke.c(75),{feature:n,groupKey:r,collapsedSections:i,onToggleSection:s,renderChatRow:a,onNewLocalChat:c,onRenameFeature:d,onDeleteFeature:u,onSetFeatureBrowserState:f,onSetFeatureStage:m,kanbanStatusesEnabled:v,showFeatureOverviewInSidebar:b,activeOverviewFeatureId:S,onOpenFeatureOverview:x,showAllChats:C,onToggleShowAllChats:k,draggedFeatureId:E,draggedChatId:R,hoveredDropTarget:M,insertIndicator:O,isTouchDevice:D,onFeatureDragStart:P,onFeatureDragEnd:z,onChatDrop:Y,onTouchDragMove:L,onTouchDragEnd:W,onChatDragStart:V,onChatDragEnd:F}=t,U=v===void 0?!0:v,H=b===void 0?!1:b,j=S===void 0?null:S,G=`feature:${n.featureId}`,B=J1(i,G),K=R!==null,A=eq(n.chats,C),I=Math.max(0,n.chats.length-eN),$=I>0,T=j===n.featureId;let X;e[0]!==n.featureId||e[1]!==r?(X=hr.chatCreate(r,n.featureId),e[0]=n.featureId,e[1]=r,e[2]=X):X=e[2];const Z=hu(X),[J,re]=_.useState(null),ae=function(){s(G),f==null||f(n.featureId,B?"CLOSED":"OPEN")};let ue;e[3]!==n.featureId||e[4]!==P?(ue=function(Ie){Ie.dataTransfer.effectAllowed="move",Ie.dataTransfer.setData("text/plain",n.featureId),P(n.featureId)},e[3]=n.featureId,e[4]=P,e[5]=ue):ue=e[5];const me=ue,se=_.useRef(null);let oe;e[6]!==re?(oe=ye=>re(ye),e[6]=re,e[7]=oe):oe=e[7];let ee;e[8]!==n.featureId||e[9]!==P?(ee=()=>P(n.featureId),e[8]=n.featureId,e[9]=P,e[10]=ee):ee=e[10];let Q;e[11]!==L?(Q=ye=>{const{x:Ie,y:Qe,elementBelow:gt}=ye;return L(Ie,Qe,gt)},e[11]=L,e[12]=Q):Q=e[12];let te;e[13]!==W?(te=ye=>{const{x:Ie,y:Qe,elementBelow:gt}=ye;return W(Ie,Qe,gt)},e[13]=W,e[14]=te):te=e[14];let he;e[15]!==D||e[16]!==oe||e[17]!==ee||e[18]!==Q||e[19]!==te||e[20]!==ae?(he={enabled:D,visualElementRef:se,onTap:ae,onContextMenu:oe,onDragStart:ee,onDragMove:Q,onDragEnd:te,holdDelay:ZV},e[15]=D,e[16]=oe,e[17]=ee,e[18]=Q,e[19]=te,e[20]=ae,e[21]=he):he=e[21];const{touchRef:ie,isDragging:xe,isArmed:Ae,dragPosition:Ke}=Jy(he),mt=E===n.featureId||xe,Ye=n.featureId;let Ze;e[22]!==K||e[23]!==D?(Ze=D?void 0:ye=>{K&&ye.preventDefault()},e[22]=K,e[23]=D,e[24]=Ze):Ze=e[24];let tt;e[25]!==R||e[26]!==n.featureId||e[27]!==D||e[28]!==Y?(tt=D?void 0:ye=>{R&&(ye.preventDefault(),Y(R,n.featureId))},e[25]=R,e[26]=n.featureId,e[27]=D,e[28]=Y,e[29]=tt):tt=e[29];const it=K&&!D&&"border-dashed hover:border-primary/60 hover:bg-primary/5",ce=M===n.featureId&&"border-primary/60 bg-primary/5",Re=Ae&&"scale-[1.03] shadow-md ring-2 ring-primary/50 bg-card",Ue=mt&&!Ae&&"opacity-20 scale-[0.98]";let Je;e[30]!==it||e[31]!==ce||e[32]!==Re||e[33]!==Ue?(Je=Ce("rounded-lg border border-border/60 bg-muted/10 transition-all duration-150 select-none",it,ce,Re,Ue),e[30]=it,e[31]=ce,e[32]=Re,e[33]=Ue,e[34]=Je):Je=e[34];let Ve;e[35]!==O?(Ve=O?g.jsx("div",{className:Ce("pointer-events-none absolute inset-x-3 h-[2px] rounded-full bg-primary/70 shadow-[0_0_0_1px_hsl(var(--background))]",O==="before"?"top-[-5px]":"bottom-[-5px]")}):null,e[35]=O,e[36]=Ve):Ve=e[36];const ze=D?ie:void 0,He=D?g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button","data-no-touch-drag":!0,onClick:ae,className:"flex shrink-0 items-center",children:g.jsx(Ni,{className:Ce("size-3 transition-transform",B&&"rotate-90")})}),g.jsx(ib,{className:"size-3.5 shrink-0 text-muted-foreground"}),g.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n.title})]}):g.jsxs("button",{type:"button",onClick:ae,draggable:!0,"data-feature-drag-handle":n.featureId,onDragStart:me,onDragEnd:z,className:"flex min-w-0 flex-1 basis-0 items-center gap-2 text-left",children:[g.jsx(Ni,{className:Ce("size-3 transition-transform",B&&"rotate-90")}),g.jsx(ib,{className:"size-3.5 text-muted-foreground"}),g.jsxs(zo,{children:[g.jsx(Bo,{asChild:!0,children:g.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n.title})}),g.jsx(Fo,{side:"right",sideOffset:4,children:n.title})]})]});let Xe;e[37]!==n.featureId||e[38]!==n.stage||e[39]!==U||e[40]!==m?(Xe=U?g.jsxs(zV,{value:n.stage,onValueChange:ye=>m==null?void 0:m(n.featureId,ye),children:[g.jsx(GA,{"data-no-touch-drag":!0,className:Ce("h-7 w-auto min-w-[70px] shrink-0 items-center gap-1 rounded-full px-2 pr-1.5 text-[10px] font-semibold leading-none tracking-[0.04em] shadow-none focus:ring-0 focus:ring-offset-0 [&>span]:flex [&>span]:items-center [&>span]:leading-none [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:translate-y-0 [&>svg]:opacity-60",kE[n.stage]),children:g.jsx(BV,{children:rE[n.stage]})}),g.jsx(QA,{children:sH.map(ye=>g.jsx(ZA,{value:ye,className:Ce("text-[11px] font-medium",ye===n.stage&&kE[ye]),children:rE[ye]},ye))})]}):null,e[37]=n.featureId,e[38]=n.stage,e[39]=U,e[40]=m,e[41]=Xe):Xe=e[41];let ut;e[42]!==n.featureId||e[43]!==r||e[44]!==Z||e[45]!==c?(ut=c?g.jsx(vt,{variant:"ghost",size:"icon",className:"h-6 w-6","data-no-touch-drag":!0,onClick:()=>c(r,n.featureId),title:"New chat in feature",disabled:Z,children:Z?g.jsx(Fn,{className:"size-3.5 animate-spin"}):g.jsx(t4,{className:"size-3.5"})}):null,e[42]=n.featureId,e[43]=r,e[44]=Z,e[45]=c,e[46]=ut):ut=e[46];let ft;e[47]!==ze||e[48]!==He||e[49]!==Xe||e[50]!==ut?(ft=g.jsxs("div",{ref:ze,className:"flex items-center gap-2 px-2 py-1.5",children:[He,Xe,ut]}),e[47]=ze,e[48]=He,e[49]=Xe,e[50]=ut,e[51]=ft):ft=e[51];const rt=B?g.jsxs("div",{className:"space-y-[2px] border-t border-border/50 p-1 pl-3",children:[H&&n.overviewRelativePath?g.jsxs("button",{type:"button",onClick:()=>x==null?void 0:x(n.featureId),className:Ce("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors",T?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"),children:[g.jsx(ag,{className:"size-3.5 shrink-0"}),g.jsx("span",{className:"truncate",children:"overview.md"})]}):null,A.map(ye=>a(ye,{draggable:!0,onDragStart:Ie=>V(Ie.chatId),onDragEnd:F,isTouchDevice:D,onTouchDragMove:L,onTouchDragEnd:W})),$?g.jsx("div",{className:"pt-1",children:g.jsx(vt,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:k,children:C?"Show less":`Show ${I} more`})}):null]}):null;let Tt;e[52]!==n.featureId||e[53]!==Ze||e[54]!==tt||e[55]!==Je||e[56]!==Ve||e[57]!==ft||e[58]!==rt?(Tt=g.jsxs("div",{ref:se,"data-feature-drop-target":Ye,onDragOver:Ze,onDrop:tt,className:Je,children:[Ve,ft,rt]}),e[52]=n.featureId,e[53]=Ze,e[54]=tt,e[55]=Je,e[56]=Ve,e[57]=ft,e[58]=rt,e[59]=Tt):Tt=e[59];const lt=Tt;let ht;e[60]===Symbol.for("react.memo_cache_sentinel")?(ht=g.jsx(ib,{className:"size-3.5 shrink-0 text-primary"}),e[60]=ht):ht=e[60];let Be;e[61]!==n.title?(Be=g.jsx("span",{className:"text-sm font-medium truncate",children:n.title}),e[61]=n.title,e[62]=Be):Be=e[62];let $e;e[63]!==Ke||e[64]!==Be?($e=g.jsxs(ZT,{position:Ke,children:[ht,Be]}),e[63]=Ke,e[64]=Be,e[65]=$e):$e=e[65];const Le=$e;let Fe;return e[66]!==n.featureId||e[67]!==lt||e[68]!==D||e[69]!==J||e[70]!==u||e[71]!==d||e[72]!==Le||e[73]!==re?(Fe=u?g.jsxs(g.Fragment,{children:[g.jsx(pU,{onRename:()=>d==null?void 0:d(n.featureId),onDelete:()=>u(n.featureId),mobileMenuPosition:J,onMobileMenuClose:()=>re(null),skipContextMenu:D,children:lt}),Le]}):g.jsxs(g.Fragment,{children:[lt,Le]}),e[66]=n.featureId,e[67]=lt,e[68]=D,e[69]=J,e[70]=u,e[71]=d,e[72]=Le,e[73]=re,e[74]=Fe):Fe=e[74],Fe}function nq({group:t,collapsedSections:e,onToggleSection:n,renderChatRow:r,onNewLocalChat:i,onCreateFeature:s,onRenameFeature:a,onDeleteFeature:c,onSetProjectBrowserState:d,onSetProjectGeneralChatsBrowserState:u,onSetFeatureBrowserState:f,onSetFeatureStage:m,onSetChatFeature:v,onReorderFeatures:b,onRemoveProject:S,isConnected:x,startingLocalPath:C,folderGroupsEnabled:k=!0,showFeatureOverviewInSidebar:E=!1,kanbanStatusesEnabled:R=!0,activeOverviewFeatureId:M=null,onOpenFeatureOverview:O,scrollContainerRef:D}){const P=_s(Be=>Be.showProjectIconsInSidebar),{groupKey:z,localPath:Y,features:L,generalChats:W}=t,V=`project:${z}`,F=`general:${z}`,U=J1(e,V),H=L.length===0||J1(e,F),j=hu(hr.chatCreate(z)),G=hu(hr.projectRemove(z)),[B,K]=_.useState(null),[A,I]=_.useState(null),[$,T]=_.useState(null),[X,Z]=_.useState(null),[J,re]=_.useState(!1),[ae,ue]=_.useState(!1),[me,se]=_.useState({}),[oe,ee]=_.useState(null),Q=zg("(pointer: coarse)"),te=k&&!J?W.slice(0,10):W,he=k&&W.length>10,ie=_.useMemo(()=>{if(!A||!$||!X)return L;const Be=Ld(L,A,$,X);if(!Be)return L;const $e=new Map(L.map(Le=>[Le.featureId,Le]));return Be.map(Le=>$e.get(Le)).filter(Le=>!!Le)},[A,L,$,X]),{activeFeatures:xe,completedFeatures:Ae}=_.useMemo(()=>JV(ie),[ie]),{attributes:Ke,listeners:mt,setNodeRef:Ye,setActivatorNodeRef:Ze,transform:tt,transition:it,isDragging:ce}=cA({id:z}),Re={transform:wu.Translate.toString(tt),transition:it};function Ue(){n(V),d==null||d(z,U?"CLOSED":"OPEN")}function Je(){n(F),u==null||u(z,H?"CLOSED":"OPEN")}function Ve(Be){se($e=>({...$e,[Be]:!$e[Be]}))}function ze(Be){Be.stopPropagation();for(const $e of tq(L,e))n($e);for(const $e of L)f==null||f($e.featureId,"CLOSED")}function He(Be,$e){if(!A||$e.length===0)return;const Le=ME(Be.currentTarget,Be.clientY,$e);Le&&(Be.preventDefault(),T(Le.featureId),Z(Le.position))}function Xe(Be,$e){if(!A||$e.length===0)return;const Le=ME(Be.currentTarget,Be.clientY,$e);if(!Le||Le.featureId===A){I(null),T(null),Z(null);return}Be.preventDefault();const Fe=Ld(L,A,Le.featureId,Le.position);I(null),T(null),Z(null),Fe&&(b==null||b(z,Fe))}function ut(Be){if(!Be)return null;const $e=Be.closest("[data-feature-drop-target]");return $e?{type:"feature",featureId:$e.getAttribute("data-feature-drop-target")}:Be.closest(`[data-general-chats-drop-target="${z}"]`)?{type:"general"}:null}function ft(Be,$e,Le){const Fe=D==null?void 0:D.current;if(Fe){const Ie=Fe.getBoundingClientRect(),Qe=60;$e<Ie.top+Qe?Fe.scrollBy(0,-6):$e>Ie.bottom-Qe&&Fe.scrollBy(0,6)}const ye=ut(Le);if((ye==null?void 0:ye.type)==="feature"){const Ie=Le==null?void 0:Le.closest("[data-feature-drop-target]");if(Ie){const Qe=Ie.getBoundingClientRect();T(ye.featureId),Z($e>=Qe.top+Qe.height/2?"after":"before");return}}T(null),Z(null)}function rt(Be,$e,Le){const Fe=ut(Le);if(A){if((Fe==null?void 0:Fe.type)==="feature"&&Fe.featureId!==A&&b){const ye=Ld(L,A,Fe.featureId,X??"before");ye&&b(z,ye)}I(null)}else B&&v&&((Fe==null?void 0:Fe.type)==="feature"?v(B,Fe.featureId):(Fe==null?void 0:Fe.type)==="general"&&v(B,null),K(null));T(null),Z(null)}const Tt=_.useRef(null),{touchRef:lt}=Jy({enabled:Q&&!!S,onTap:Ue,onContextMenu:Be=>ee(Be)}),ht=g.jsxs("div",{ref:Be=>{Ze(Be),Tt.current=Be,Q&&S&<(Be)},className:Ce("sticky top-0 bg-background dark:bg-card z-10 relative p-[10px] flex items-center justify-between cursor-grab active:cursor-grabbing select-none",ce&&"cursor-grabbing",G&&"opacity-60"),onClick:Q?void 0:Ue,...mt,children:[g.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[g.jsx("span",{className:"relative size-3.5 shrink-0 cursor-pointer",children:g.jsx(Ni,{className:Ce("translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-transform duration-200",U&&"rotate-90")})}),P?g.jsx(UV,{iconDataUrl:t.iconDataUrl,alt:`${t.title||sE(Y)} icon`,className:"size-5",fallback:g.jsx("span",{className:"size-5 shrink-0","aria-hidden":"true"})}):null,g.jsxs(zo,{children:[g.jsx(Bo,{asChild:!0,children:g.jsx("span",{className:"truncate max-w-[180px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:t.title||sE(Y)})}),g.jsx(Fo,{side:"right",sideOffset:4,children:Y})]})]}),g.jsxs("div",{className:"absolute right-2 flex items-center gap-1",children:[s?g.jsxs(zo,{children:[g.jsx(Bo,{asChild:!0,children:g.jsx(vt,{variant:"ghost",size:"icon",className:"h-5.5 w-5.5 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100","data-no-touch-drag":!0,onClick:Be=>{Be.stopPropagation(),s(z)},children:g.jsx(YR,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),g.jsx(Fo,{side:"right",sideOffset:4,children:"New feature"})]}):null,L.length>0?g.jsxs(zo,{children:[g.jsx(Bo,{asChild:!0,children:g.jsx(vt,{variant:"ghost",size:"icon",className:"h-5.5 w-5.5 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100","data-no-touch-drag":!0,onClick:ze,children:g.jsx(KP,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),g.jsx(Fo,{side:"right",sideOffset:4,children:"Close all feature folders"})]}):null,i?g.jsxs(zo,{children:[g.jsx(Bo,{asChild:!0,children:g.jsx(vt,{variant:"ghost",size:"icon",className:Ce("h-5.5 w-5.5 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100",(!x||C===Y||j)&&"opacity-50 cursor-not-allowed"),disabled:!x||C===Y||j,"data-no-touch-drag":!0,onClick:Be=>{Be.stopPropagation(),i(z)},children:C===Y||j?g.jsx(Fn,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):g.jsx(t4,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),g.jsx(Fo,{side:"right",sideOffset:4,children:x?"New general chat":`Start ${ys} to connect`})]}):null]})]});return g.jsxs("div",{ref:Ye,style:Re,className:Ce("group/section",ce&&"opacity-50 shadow-lg z-50 relative"),...Ke,children:[S?g.jsx(mU,{onRemove:()=>S(z),mobileMenuPosition:oe,onMobileMenuClose:()=>ee(null),skipContextMenu:Q,children:ht}):ht,U?g.jsxs("div",{className:"mb-2 space-y-2",children:[k&&xe.length>0?g.jsx("section",{className:"space-y-2 pl-6",onDragOver:Q?void 0:Be=>He(Be,xe.map($e=>$e.featureId)),onDrop:Q?void 0:Be=>Xe(Be,xe.map($e=>$e.featureId)),children:xe.map(Be=>g.jsx(AE,{feature:Be,groupKey:z,collapsedSections:e,onToggleSection:n,renderChatRow:r,onNewLocalChat:i,onRenameFeature:a,onDeleteFeature:c,onSetFeatureBrowserState:f,onSetFeatureStage:m,kanbanStatusesEnabled:R,showFeatureOverviewInSidebar:E,activeOverviewFeatureId:M,onOpenFeatureOverview:O,showAllChats:!!me[Be.featureId],onToggleShowAllChats:()=>Ve(Be.featureId),draggedFeatureId:A,draggedChatId:B,hoveredDropTarget:$,insertIndicator:$===Be.featureId?X:null,isTouchDevice:Q,onFeatureDragStart:$e=>I($e),onFeatureDragEnd:()=>{I(null),T(null),Z(null)},onFeatureDragHover:($e,Le)=>{T($e),Z(Le)},onFeatureDrop:($e,Le,Fe)=>{const ye=Ld(L,$e,Le,Fe);I(null),T(null),Z(null),ye&&(b==null||b(z,ye))},onChatDrop:($e,Le)=>{v==null||v($e,Le),K(null)},onTouchDragMove:ft,onTouchDragEnd:rt,onChatDragStart:$e=>K($e),onChatDragEnd:()=>K(null)},Be.featureId))}):null,k&&Ae.length>0?g.jsxs("section",{className:"pl-6",children:[g.jsxs("button",{type:"button",onClick:()=>ue(Be=>!Be),className:"flex w-full items-center gap-2 px-2 py-1 text-left text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:[g.jsx(Ni,{className:Ce("size-3 transition-transform",ae&&"rotate-90")}),g.jsx("span",{children:ae?"Hide completed":"Show completed"}),g.jsx("span",{className:"ml-auto",children:Ae.length})]}),ae?g.jsx("div",{className:"space-y-2 pt-1",onDragOver:Q?void 0:Be=>He(Be,Ae.map($e=>$e.featureId)),onDrop:Q?void 0:Be=>Xe(Be,Ae.map($e=>$e.featureId)),children:Ae.map(Be=>g.jsx(AE,{feature:Be,groupKey:z,collapsedSections:e,onToggleSection:n,renderChatRow:r,onNewLocalChat:i,onRenameFeature:a,onDeleteFeature:c,onSetFeatureBrowserState:f,onSetFeatureStage:m,kanbanStatusesEnabled:R,showFeatureOverviewInSidebar:E,activeOverviewFeatureId:M,onOpenFeatureOverview:O,showAllChats:!!me[Be.featureId],onToggleShowAllChats:()=>Ve(Be.featureId),draggedFeatureId:A,draggedChatId:B,hoveredDropTarget:$,insertIndicator:$===Be.featureId?X:null,isTouchDevice:Q,onFeatureDragStart:$e=>I($e),onFeatureDragEnd:()=>{I(null),T(null),Z(null)},onFeatureDragHover:($e,Le)=>{T($e),Z(Le)},onFeatureDrop:($e,Le,Fe)=>{const ye=Ld(L,$e,Le,Fe);I(null),T(null),Z(null),ye&&(b==null||b(z,ye))},onChatDrop:($e,Le)=>{v==null||v($e,Le),K(null)},onTouchDragMove:ft,onTouchDragEnd:rt,onChatDragStart:$e=>K($e),onChatDragEnd:()=>K(null)},Be.featureId))}):null]}):null,W.length>0?g.jsxs("section",{"data-general-chats-drop-target":z,onDragOver:B&&!Q?Be=>Be.preventDefault():void 0,onDrop:B&&!Q&&v?Be=>{Be.preventDefault(),v(B,null),K(null)}:void 0,children:[k?g.jsxs("button",{type:"button",onClick:Je,className:"flex w-full items-center gap-2 px-4 py-1 text-left text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:[g.jsx(Ni,{className:Ce("size-3 transition-transform",H&&"rotate-90")}),g.jsx("span",{children:"General Chats"}),g.jsx("span",{className:"ml-auto",children:W.length})]}):null,!k||H?g.jsxs("div",{className:Ce("space-y-[2px]",k?"pl-7":"pl-4"),children:[te.map(Be=>r(Be,{draggable:!0,onDragStart:$e=>K($e.chatId),onDragEnd:()=>K(null),isTouchDevice:Q,onTouchDragMove:ft,onTouchDragEnd:rt})),he?g.jsx("div",{className:"pt-1",children:g.jsx(vt,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:()=>re(Be=>!Be),children:J?"Show less":`Show ${W.length-10} more`})}):null]}):null]}):null]}):null]})}const NE=_.memo(nq);function rq(t,e,n,r){return n===null||r!==null?!1:t.every(i=>e.has(`project:${i.groupKey}`))}function iq({projectGroups:t,collapsedSections:e,onToggleSection:n,onSetProjectBrowserState:r,onSetProjectGeneralChatsBrowserState:i,renderChatRow:s,onNewLocalChat:a,onCreateFeature:c,onRenameFeature:d,onDeleteFeature:u,onSetFeatureBrowserState:f,onSetFeatureStage:m,onSetChatFeature:v,onReorderFeatures:b,onRemoveProject:S,onReorderGroups:x,isConnected:C,startingLocalPath:k,folderGroupsEnabled:E=!0,showFeatureOverviewInSidebar:R=!1,kanbanStatusesEnabled:M=!0,activeOverviewFeatureId:O=null,onOpenFeatureOverview:D,scrollContainerRef:P}){const z=HM(ep(Dg,{activationConstraint:{distance:8}}),ep(QM,{activationConstraint:{delay:250,tolerance:5}}),ep(bx)),Y=_.useMemo(()=>t.map($=>$.groupKey),[t]),L=_.useRef(null),[W,V]=_.useState(null),[F,U]=_.useState(null);_.useEffect(()=>{U((P==null?void 0:P.current)??null)},[P]);const H=uV({count:t.length,getScrollElement:()=>F,estimateSize:()=>44,overscan:3,enabled:F!==null&&W===null,measureElement:$=>$.getBoundingClientRect().height});function j($){const T=$.active.id,X=`project:${T}`;V(T),e.has(X)?L.current=null:(L.current=X,n(X))}function G($){const{active:T,over:X}=$;if(V(null),X&&T.id!==X.id&&x){const Z=Y.indexOf(T.id),J=Y.indexOf(X.id);Z!==-1&&J!==-1&&x(yx(Y,Z,J))}if(L.current){const Z=L.current;L.current=null,requestAnimationFrame(()=>n(Z))}}function B(){if(V(null),L.current){const $=L.current;L.current=null,requestAnimationFrame(()=>n($))}}const K=rq(t,e,F,W),A=K?H.getVirtualItems():[],I=K?A.map($=>{var T;return{group:t[$.index],key:((T=t[$.index])==null?void 0:T.groupKey)??`virtual-${$.index}`,start:$.start,index:$.index}}).filter($=>$.group!==void 0):t.map(($,T)=>({group:$,key:$.groupKey,start:0,index:T}));return g.jsx(nA,{sensors:z,collisionDetection:$M,onDragStart:j,onDragEnd:G,onDragCancel:B,children:g.jsx(aA,{items:Y,strategy:iA,children:K?g.jsx("div",{style:{height:H.getTotalSize(),position:"relative"},children:I.map(({group:$,key:T,start:X,index:Z})=>g.jsx("div",{"data-index":Z,ref:H.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${X}px)`},children:g.jsx(NE,{group:$,collapsedSections:e,onToggleSection:n,onSetProjectBrowserState:r,onSetProjectGeneralChatsBrowserState:i,renderChatRow:s,onNewLocalChat:a,onCreateFeature:c,onRenameFeature:d,onDeleteFeature:u,onSetFeatureBrowserState:f,onSetFeatureStage:m,onSetChatFeature:v,onReorderFeatures:b,onRemoveProject:S,onReorderGroups:x,isConnected:C,startingLocalPath:k,folderGroupsEnabled:E,showFeatureOverviewInSidebar:R,kanbanStatusesEnabled:M,activeOverviewFeatureId:O,onOpenFeatureOverview:D,scrollContainerRef:P},`${T}-${Z}`)},T))}):I.map(({group:$,key:T})=>g.jsx(NE,{group:$,collapsedSections:e,onToggleSection:n,onSetProjectBrowserState:r,onSetProjectGeneralChatsBrowserState:i,renderChatRow:s,onNewLocalChat:a,onCreateFeature:c,onRenameFeature:d,onDeleteFeature:u,onSetFeatureBrowserState:f,onSetFeatureStage:m,onSetChatFeature:v,onReorderFeatures:b,onRemoveProject:S,onReorderGroups:x,isConnected:C,startingLocalPath:k,folderGroupsEnabled:E,showFeatureOverviewInSidebar:R,kanbanStatusesEnabled:M,activeOverviewFeatureId:O,onOpenFeatureOverview:D,scrollContainerRef:P},T))})})}function Bg(t){var i;const e=(t==null?void 0:t.status)==="signed_in",n=e&&((i=t==null?void 0:t.entitlements)==null?void 0:i["remote.relay"])===!0,r=Object.fromEntries(Object.entries(QF).map(([s,a])=>[s,{id:s,level:a,enabled:a==="free"?!0:a==="account"?e:n}]));return{signedIn:e,paid:n,features:r}}function kx(t){return t==="paid"?"Upgrade to unlock":"Unlock with an account"}function sq(t,e){return e==="paid"?`${t} is locked. Upgrade to unlock in Settings > Account.`:`${t} is locked. Unlock with an account in Settings > Account.`}function oq(t,e){return`${t} is locked. ${kx(e)}.`}const aq="/settings/account",tN=`${Ky}provider-usage-collapsed`,nN=`${Ky}provider-usage-mode`,lq=rc.map(t=>t.id),cq=["claude","codex"],e_=Object.fromEntries(rc.map(t=>[t.id,t.label]));function DE(t){return t===null?"bg-muted":t>=90?"bg-red-500":t>=75?"bg-amber-500":"bg-emerald-500"}function wb(t){return t===null?"N/A":`${t.toFixed(1)}%`}function OE(t,e){if(e!=null&&e.trim())return`Resets ${e.trim()}`;if(t===null)return null;const n=Date.now();if(t<=n)return"Limit may have reset";const r=t-n,i=Math.ceil(r/6e4);return i<60?`Resets in ${i} min`:`Resets at ${new Date(t).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`}function uq(){try{return localStorage.getItem(tN)==="true"}catch{return!1}}function dq(){try{return localStorage.getItem(nN)==="weekly"?"weekly":"session"}catch{return"session"}}function hq(t){try{localStorage.setItem(tN,String(t))}catch{}}function fq(t){try{localStorage.setItem(nN,t)}catch{}}function jE(t){const e=ke.c(56),{entry:n,mode:r,isPending:i,onRefreshProviderUsage:s,onOpenProviderLogin:a}=t,c=Np[n.provider],d=t.labelOverride??e_[n.provider],u=n.availability==="unavailable",f=n.availability==="login_required",m=n.availability==="stale",v=n.provider==="cursor",b=t.percentOverride!==void 0?t.percentOverride:r==="weekly"?n.weeklyLimitUsedPercent??null:n.sessionLimitUsedPercent,S=b;let x;e[0]!==n.rateLimitResetAt||e[1]!==n.rateLimitResetLabel||e[2]!==n.weeklyRateLimitResetAt||e[3]!==n.weeklyRateLimitResetLabel||e[4]!==v||e[5]!==r?(x=v?null:r==="weekly"?OE(n.weeklyRateLimitResetAt??null,n.weeklyRateLimitResetLabel??null):OE(n.rateLimitResetAt,n.rateLimitResetLabel),e[0]=n.rateLimitResetAt,e[1]=n.rateLimitResetLabel,e[2]=n.weeklyRateLimitResetAt,e[3]=n.weeklyRateLimitResetLabel,e[4]=v,e[5]=r,e[6]=x):x=e[6];const C=x;let k;if(e[7]!==t.bars||e[8]!==n.statusDetail||e[9]!==f||e[10]!==m||e[11]!==u||e[12]!==r||e[13]!==b||e[14]!==C){if(k=[],f)k.push("Login required to fetch Cursor usage");else if(u)k.push("Usage data unavailable");else{if(t.bars)k.push("Cursor limit usage");else if(b!==null){let j;e[16]!==b?(j=wb(b),e[16]=b,e[17]=j):j=e[17],k.push(`${j} of ${r} limit used`)}C&&k.push(C),m&&k.push("Data may be outdated"),k.length===0&&k.push("No usage data yet")}if(n.statusDetail){let j;e[18]!==n.statusDetail?(j=n.statusDetail.replaceAll("_"," "),e[18]=n.statusDetail,e[19]=j):j=e[19],k.push(j)}e[7]=t.bars,e[8]=n.statusDetail,e[9]=f,e[10]=m,e[11]=u,e[12]=r,e[13]=b,e[14]=C,e[15]=k}else k=e[15];const E=!t.hideActions&&v&&f,R=v&&!t.hideActions&&u&&!f&&n.statusDetail!=="unsupported_platform",M=m&&"opacity-50";let O;e[20]!==M?(O=Ce("flex flex-col",M),e[20]=M,e[21]=O):O=e[21];let D;e[22]!==c?(D=g.jsx(c,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),e[22]=c,e[23]=D):D=e[23];let P;e[24]!==d?(P=g.jsx("span",{className:"text-[11px] text-muted-foreground w-11 shrink-0",children:d}),e[24]=d,e[25]=P):P=e[25];let z;e[26]!==t.bars||e[27]!==S||e[28]!==u?(z=u&&!t.bars?g.jsx("span",{className:"text-[10px] text-muted-foreground/60 ml-auto",children:"N/A"}):t.bars?g.jsx("div",{className:"flex-1"}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden min-w-0",children:S!==null?g.jsx("div",{className:Ce("h-full rounded-full transition-all",DE(S)),style:{width:`${Math.min(100,Math.max(0,S))}%`}}):null}),g.jsx("span",{className:"text-[10px] tabular-nums text-muted-foreground w-7 text-right shrink-0",children:wb(S)})]}),e[26]=t.bars,e[27]=S,e[28]=u,e[29]=z):z=e[29];let Y;e[30]!==i||e[31]!==a||e[32]!==E?(Y=E?g.jsx("button",{type:"button",disabled:i,onClick:j=>{j.stopPropagation(),a==null||a("cursor")},className:"ml-auto rounded border border-border/70 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50",children:i?"Starting":"Sign In"}):null,e[30]=i,e[31]=a,e[32]=E,e[33]=Y):Y=e[33];let L;e[34]!==i||e[35]!==s||e[36]!==R?(L=R?g.jsxs("button",{type:"button",disabled:i,onClick:j=>{j.stopPropagation(),s==null||s("cursor")},className:"flex items-center gap-1 rounded border border-border/70 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50",children:[i&&g.jsx(JR,{className:"h-2 w-2 animate-spin"}),i?"Checking":"Refresh"]}):null,e[34]=i,e[35]=s,e[36]=R,e[37]=L):L=e[37];let W;e[38]!==D||e[39]!==P||e[40]!==z||e[41]!==Y||e[42]!==L?(W=g.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 rounded-md",children:[D,P,z,Y,L]}),e[38]=D,e[39]=P,e[40]=z,e[41]=Y,e[42]=L,e[43]=W):W=e[43];let V;e[44]!==t.bars||e[45]!==u?(V=t.bars&&g.jsx("div",{className:"flex flex-col gap-1 pb-1",children:t.bars.map((j,G)=>g.jsxs("div",{className:"flex items-center gap-2 pl-7 pr-2",children:[g.jsx("span",{className:"text-[10px] text-muted-foreground w-12 shrink-0",children:j.label}),u?g.jsx("span",{className:"text-[10px] text-muted-foreground/60 ml-auto",children:"N/A"}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden min-w-0",children:j.percent!==null?g.jsx("div",{className:Ce("h-full rounded-full transition-all",DE(j.percent)),style:{width:`${Math.min(100,Math.max(0,j.percent))}%`}}):null}),g.jsx("span",{className:"text-[10px] tabular-nums text-muted-foreground w-7 text-right shrink-0",children:wb(j.percent)})]})]},G))}),e[44]=t.bars,e[45]=u,e[46]=V):V=e[46];let F;e[47]!==O||e[48]!==W||e[49]!==V?(F=g.jsx(Bo,{asChild:!0,children:g.jsxs("div",{className:O,children:[W,V]})}),e[47]=O,e[48]=W,e[49]=V,e[50]=F):F=e[50];let U;e[51]!==k?(U=g.jsx(Fo,{side:"right",className:"max-w-48",children:k.map(mq)}),e[51]=k,e[52]=U):U=e[52];let H;return e[53]!==F||e[54]!==U?(H=g.jsxs(zo,{children:[F,U]}),e[53]=F,e[54]=U,e[55]=H):H=e[55],H}function mq(t,e){return g.jsx("div",{className:"text-xs",children:t},e)}function pq({providerUsage:t,visibleProviders:e=lq,locked:n=!1,onRefreshProviderUsage:r,onOpenProviderLogin:i,onLockedAction:s}){const[a,c]=_.useState(uq),[d,u]=_.useState(dq),f=hr.providerUsageRefresh(),m=hr.providerUsageRefresh("cursor"),v=hr.providerLogin("cursor"),b=hu(f),S=hu(m),x=hu(v),C=()=>{c(E=>{const R=!E;return hq(R),R})},k=async()=>{try{await Ho(f,()=>r==null?void 0:r(),{statusLabel:"Checking provider usage..."}),ru("Usage checked successfully.")}catch{ru("Failed to check usage.")}};return g.jsxs("div",{className:"px-1 pb-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2 px-2 pb-0.5",children:[g.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-1 text-left group",children:[a?g.jsx(Ni,{className:"h-3 w-3 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors"}):g.jsx(og,{className:"h-3 w-3 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors"}),g.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 font-medium group-hover:text-muted-foreground transition-colors",children:"Provider Usage"})]}),!a&&g.jsx("div",{className:"flex items-center gap-1",children:n?null:g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",onClick:k,disabled:b,className:"shrink-0 rounded-md border border-border/70 bg-muted/40 p-1 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors disabled:opacity-50",title:"Refresh usages",children:g.jsx(JR,{className:Ce("h-3 w-3",b&&"animate-spin")})}),g.jsx("button",{type:"button",onClick:()=>{u(E=>{const R=E==="session"?"weekly":"session";return fq(R),R})},className:"shrink-0 rounded-md border border-border/70 bg-muted/40 px-2 py-0.5 text-[10px] uppercase tracking-wider text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:d==="session"?"Session":"Weekly"})]})})]}),!a&&n?g.jsx("div",{className:"px-2 pt-1 pb-2",children:g.jsx("button",{type:"button",onClick:s,className:"w-full rounded-md border border-border/70 bg-muted/40 px-2.5 py-1.5 text-[11px] uppercase tracking-wider text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:kx("account")})}):null,!a&&!n&&(d==="weekly"?cq:e).flatMap(E=>{const R=(t==null?void 0:t[E])??{provider:E,sessionLimitUsedPercent:null,apiLimitUsedPercent:null,rateLimitResetAt:null,rateLimitResetLabel:null,weeklyLimitUsedPercent:null,weeklyRateLimitResetAt:null,weeklyRateLimitResetLabel:null,statusDetail:null,availability:"unavailable",lastRequestedAt:null,updatedAt:null,warnings:[]},M=async D=>{try{await Ho(m,()=>r==null?void 0:r(D),{statusLabel:"Checking Cursor usage..."}),ru(`${e_[D]??"Provider"} usage checked successfully.`)}catch{ru(`Failed to check ${e_[D]??"provider"} usage.`)}},O=D=>{Ho(v,()=>i==null?void 0:i(D),{statusLabel:"Opening Cursor sign-in..."})};return E==="cursor"&&d==="session"?[g.jsx(jE,{entry:R,mode:d,isPending:S||x,bars:[{label:"API",percent:R.apiLimitUsedPercent??null},{label:"Composer",percent:R.sessionLimitUsedPercent}],onRefreshProviderUsage:M,onOpenProviderLogin:O},"cursor")]:[g.jsx(jE,{entry:R,mode:d,isPending:b||E==="cursor"&&(S||x),onRefreshProviderUsage:M,onOpenProviderLogin:O},E)]})]})}function gq(t){return t==="gpt-5-codex"?"gpt-5.3-codex":t??"gpt-5.4"}function vq(t){return t==="claude"||t==="codex"||t==="gemini"||t==="cursor"||t==="openrouter"?t:"last_used"}function Wa(t){var s,a;const e=(s=t==null?void 0:t.modelOptions)==null?void 0:s.reasoningEffort,n=tE(e)?e:tE(t==null?void 0:t.effort)?t.effort:LT.reasoningEffort,r=(t==null?void 0:t.model)??Zn("claude").defaultModel,i=iH(r,(a=t==null?void 0:t.modelOptions)==null?void 0:a.contextWindow);return{model:r,modelOptions:{reasoningEffort:r!=="opus"&&n==="max"?"high":n,...i?{contextWindow:i}:{}},planMode:!!(t!=null&&t.planMode)}}function Va(t){var r,i;const e=Kr("codex"),n=(r=t==null?void 0:t.modelOptions)==null?void 0:r.reasoningEffort;return{model:gq((t==null?void 0:t.model)??Zn("codex").defaultModel),modelOptions:{reasoningEffort:nE(n)?n:nE(t==null?void 0:t.effort)?t.effort:e.reasoningEffort,fastMode:typeof((i=t==null?void 0:t.modelOptions)==null?void 0:i.fastMode)=="boolean"?t.modelOptions.fastMode:e.fastMode},planMode:!!(t!=null&&t.planMode)}}function qa(t){var n;const e=Kr("gemini");return{model:(t==null?void 0:t.model)??Zn("gemini").defaultModel,modelOptions:{thinkingMode:VF((n=t==null?void 0:t.modelOptions)==null?void 0:n.thinkingMode)?t.modelOptions.thinkingMode:e.thinkingMode},planMode:!!(t!=null&&t.planMode)}}function Ka(t){return t==null||t.modelOptions,{model:WF((t==null?void 0:t.model)??Zn("cursor").defaultModel),modelOptions:{...Kr("cursor")},planMode:!!(t!=null&&t.planMode)}}function Ga(t){return t==null||t.modelOptions,{model:(t==null?void 0:t.model)??Zn("openrouter").defaultModel,modelOptions:{...Kr("openrouter")},planMode:!!(t!=null&&t.planMode)}}function bq(){return{claude:{model:Zn("claude").defaultModel,modelOptions:{...Kr("claude")},planMode:!1},codex:{model:Zn("codex").defaultModel,modelOptions:{...Kr("codex")},planMode:!1},gemini:{model:Zn("gemini").defaultModel,modelOptions:{...Kr("gemini")},planMode:!1},cursor:{model:Zn("cursor").defaultModel,modelOptions:{...Kr("cursor")},planMode:!1},openrouter:{model:Zn("openrouter").defaultModel,modelOptions:{...Kr("openrouter")},planMode:!1}}}function _q(t){return{claude:Wa(t==null?void 0:t.claude),codex:Va(t==null?void 0:t.codex),gemini:qa(t==null?void 0:t.gemini),cursor:Ka(t==null?void 0:t.cursor),openrouter:Ga(t==null?void 0:t.openrouter)}}function LE(t,e){if(e===void 0){console.info(`[chat-preferences] ${t}`);return}console.info(`[chat-preferences] ${t}`,e)}function t_(t,e){if(t==="claude"){const r=e.claude;return{provider:"claude",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}if(t==="gemini"){const r=e.gemini;return{provider:"gemini",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}if(t==="cursor"){const r=e.cursor;return{provider:"cursor",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}if(t==="openrouter"){const r=e.openrouter;return{provider:"openrouter",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}const n=e.codex;return{provider:"codex",model:n.model,modelOptions:{...n.modelOptions},planMode:n.planMode}}function yq(t,e,n,r){if((t==null?void 0:t.provider)==="claude"){const s=Wa(t);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((t==null?void 0:t.provider)==="codex"){const s=Va(t);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((t==null?void 0:t.provider)==="gemini"){const s=qa(t);return{provider:"gemini",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((t==null?void 0:t.provider)==="cursor"){const s=Ka(t);return{provider:"cursor",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((t==null?void 0:t.provider)==="openrouter"){const s=Ga(t);return{provider:"openrouter",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}const i=$F(n);if(i==="claude"){const s=Wa(r==null?void 0:r.claude);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(i==="codex"){const s=Va(r==null?void 0:r.codex);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(i==="gemini"){const s=qa(r==null?void 0:r.gemini);return{provider:"gemini",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(i==="cursor"){const s=Ka(r==null?void 0:r.cursor);return{provider:"cursor",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(i==="openrouter"){const s=Ga(r==null?void 0:r.openrouter);return{provider:"openrouter",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}return t_("codex",e)}function rN(t){const e=_q(t==null?void 0:t.providerDefaults);return{defaultProvider:vq(t==null?void 0:t.defaultProvider),providerDefaults:e,showProviderIconsInSideTray:(t==null?void 0:t.showProviderIconsInSideTray)!==!1,composerState:yq(t==null?void 0:t.composerState,e,t==null?void 0:t.liveProvider,t==null?void 0:t.livePreferences)}}function xq(t,e){if(!t||typeof t!="object")return e;const n=rN(t);return{...e,...n}}const $o=fi()(Li(t=>({defaultProvider:"last_used",providerDefaults:bq(),showProviderIconsInSideTray:!0,composerState:{provider:"codex",model:Zn("codex").defaultModel,modelOptions:{...Kr("codex")},planMode:!1},setDefaultProvider:e=>t({defaultProvider:e}),setShowProviderIconsInSideTray:e=>t({showProviderIconsInSideTray:e}),setProviderDefaultModel:(e,n)=>t(r=>({providerDefaults:{...r.providerDefaults,[e]:e==="claude"?Wa({...r.providerDefaults.claude,model:n}):e==="gemini"?qa({...r.providerDefaults.gemini,model:n}):e==="cursor"?Ka({...r.providerDefaults.cursor,model:n}):e==="openrouter"?Ga({...r.providerDefaults.openrouter,model:n}):Va({...r.providerDefaults.codex,model:n})}})),setProviderDefaultModelOptions:(e,n)=>t(r=>({providerDefaults:{...r.providerDefaults,[e]:e==="claude"?Wa({...r.providerDefaults.claude,modelOptions:{...r.providerDefaults.claude.modelOptions,...n}}):e==="gemini"?qa({...r.providerDefaults.gemini,modelOptions:{...r.providerDefaults.gemini.modelOptions,...n}}):e==="cursor"?Ka({...r.providerDefaults.cursor,modelOptions:{...r.providerDefaults.cursor.modelOptions,...n}}):e==="openrouter"?Ga({...r.providerDefaults.openrouter,modelOptions:{...r.providerDefaults.openrouter.modelOptions,...n}}):Va({...r.providerDefaults.codex,modelOptions:{...r.providerDefaults.codex.modelOptions,...n}})}})),setProviderDefaultPlanMode:(e,n)=>t(r=>({providerDefaults:{...r.providerDefaults,[e]:e==="claude"?Wa({...r.providerDefaults.claude,planMode:n}):e==="gemini"?qa({...r.providerDefaults.gemini,planMode:n}):e==="cursor"?Ka({...r.providerDefaults.cursor,planMode:n}):e==="openrouter"?Ga({...r.providerDefaults.openrouter,planMode:n}):Va({...r.providerDefaults.codex,planMode:n})}})),setComposerProvider:e=>t(n=>({composerState:{...n.composerState,provider:e}})),setComposerModel:e=>t(n=>n.composerState.provider==="claude"?{composerState:{provider:"claude",model:e,modelOptions:Wa({...n.composerState,model:e}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="gemini"?{composerState:{provider:"gemini",model:e,modelOptions:qa({...n.composerState,model:e}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="cursor"?{composerState:{provider:"cursor",model:e,modelOptions:Ka({...n.composerState,model:e}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="openrouter"?{composerState:{provider:"openrouter",model:e,modelOptions:Ga({...n.composerState,model:e}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:e,modelOptions:Va({...n.composerState,model:e}).modelOptions,planMode:n.composerState.planMode}}),setComposerModelOptions:e=>t(n=>n.composerState.provider==="claude"?{composerState:{provider:"claude",model:n.composerState.model,modelOptions:Wa({...n.composerState,modelOptions:{...n.composerState.modelOptions,...e}}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="gemini"?{composerState:{provider:"gemini",model:n.composerState.model,modelOptions:qa({...n.composerState,modelOptions:{...n.composerState.modelOptions,...e}}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="cursor"?{composerState:{provider:"cursor",model:n.composerState.model,modelOptions:Ka({...n.composerState,modelOptions:{...n.composerState.modelOptions,...e}}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="openrouter"?{composerState:{provider:"openrouter",model:n.composerState.model,modelOptions:Ga({...n.composerState,modelOptions:{...n.composerState.modelOptions,...e}}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:n.composerState.model,modelOptions:Va({...n.composerState,modelOptions:{...n.composerState.modelOptions,...e}}).modelOptions,planMode:n.composerState.planMode}}),setComposerPlanMode:e=>t(n=>({composerState:{...n.composerState,planMode:e}})),resetComposerFromProvider:e=>t(n=>({composerState:t_(e,n.providerDefaults)})),initializeComposerForNewChat:()=>t(e=>{if(e.defaultProvider==="last_used")return LE("initializeComposerForNewChat:last_used",{defaultProvider:e.defaultProvider,composerState:e.composerState,providerDefaults:e.providerDefaults}),{composerState:{...e.composerState}};const n=t_(e.defaultProvider,e.providerDefaults);return LE("initializeComposerForNewChat:explicit_default",{defaultProvider:e.defaultProvider,composerState:n,providerDefaults:e.providerDefaults}),{composerState:n}})}),{name:"chat-preferences",version:6,migrate:t=>rN(t),merge:(t,e)=>xq(t,e)})),IE=fi()(Li(t=>({order:[],setOrder:e=>t({order:e})}),{name:"project-group-order"})),Bp=315,Sq=240,wq=520;function Cq(t){return typeof t=="object"&&t!==null}function Fg(t){return Number.isFinite(t)?Math.min(wq,Math.max(Sq,Math.round(t))):Bp}function kq(t){return Cq(t)?{widthPx:Fg(typeof t.widthPx=="number"?t.widthPx:Bp)}:{widthPx:Bp}}const PE=fi()(Li(t=>({widthPx:Bp,setWidth:e=>t({widthPx:Fg(e)})}),{name:"left-sidebar-layout",version:1,migrate:kq}));function iN(t,e){return t&&!e}function Eq(t,e,n){if(iN(t,e))return{width:`${Fg(n)}px`}}function Rq(t,e){return t===e?null:e}function Tq(t){const e=ke.c(221),{data:n,completedChatIds:r,activeChatId:i,activeOverviewFeatureId:s,connectionStatus:a,ready:c,open:d,collapsed:u,isDesktopViewport:f,showMobileOpenButton:m,desktopWidth:v,onOpen:b,onClose:S,onToggle:x,onExpand:C,toggleShortcut:k,onResizeDesktopWidth:E,onCreateChat:R,onCreateFeature:M,onRenameFeature:O,onDeleteFeature:D,onSetProjectBrowserState:P,onSetProjectGeneralChatsBrowserState:z,onSetFeatureBrowserState:Y,onSetFeatureStage:L,onSetChatFeature:W,onReorderFeatures:V,folderGroupsEnabled:F,showFeatureOverviewInSidebar:U,kanbanStatusesEnabled:H,onOpenFeatureOverview:j,onRenameChat:G,onDeleteChat:B,onRemoveProject:K,onRefreshProviderUsage:A,onOpenProviderLogin:I,providerSettings:$,remoteAuth:T,startingLocalPath:X,updateSnapshot:Z,onInstallUpdate:J}=t,re=Yr(),ae=tc(),ue=_.useRef(null),me=_.useRef(null),se=_.useRef(null),oe=_.useRef(null),ee=_.useRef(0),Q=_.useRef(null),te=_.useRef(null);let he;e[0]===Symbol.for("react.memo_cache_sentinel")?(he={},e[0]=he):he=e[0];const ie=_.useRef(he);let xe;e[1]===Symbol.for("react.memo_cache_sentinel")?(xe={},e[1]=xe):xe=e[1];const Ae=_.useRef(xe);let Ke;e[2]===Symbol.for("react.memo_cache_sentinel")?(Ke={},e[2]=Ke):Ke=e[2];const mt=_.useRef(Ke);let Ye;e[3]===Symbol.for("react.memo_cache_sentinel")?(Ye=new Set,e[3]=Ye):Ye=e[3];const[Ze,tt]=_.useState(Ye),[it,ce]=_.useState(!1),[Re,Ue]=_.useState(null),[Je,Ve]=_.useState(Fq),ze=IE(Bq),He=IE(zq);let Xe;e[4]!==T?(Xe=Bg(T),e[4]=T,e[5]=Xe):Xe=e[5];const ut=Xe;$==null||$.settings;let ft;e[6]!==($==null?void 0:$.settings)?(ft=jT(($==null?void 0:$.settings)??Tp).map(Pq),e[6]=$==null?void 0:$.settings,e[7]=ft):ft=e[7];const rt=ft;let Tt;e:{if(ze.length===0){Tt=n.projectGroups;break e}let Mt;if(e[8]!==n.projectGroups||e[9]!==ze){const Ct=new Map(n.projectGroups.map(Iq));Mt=ze.filter(mn=>Ct.has(mn)).map(mn=>Ct.get(mn));const Dr=new Set(ze);for(const mn of n.projectGroups)Dr.has(mn.groupKey)||Mt.push(mn);e[8]=n.projectGroups,e[9]=ze,e[10]=Mt}else Mt=e[10];Tt=Mt}const lt=Tt;let ht;e[11]!==ae||e[12]!==S?(ht=()=>{ae({pathname:"/",search:"?newProject=1"}),S()},e[11]=ae,e[12]=S,e[13]=ht):ht=e[13];const Be=ht;let $e;e[14]!==F||e[15]!==lt?($e=F?lt:lt.map(Lq),e[14]=F,e[15]=lt,e[16]=$e):$e=e[16];const Le=$e;let Fe;e[17]!==He?(Fe=Mt=>He(Mt),e[17]=He,e[18]=Fe):Fe=e[18];const ye=Fe;let Ie;e[19]===Symbol.for("react.memo_cache_sentinel")?(Ie=Mt=>{tt(Ct=>{const Dr=new Set(Ct);return Dr.has(Mt)?Dr.delete(Mt):Dr.add(Mt),Dr})},e[19]=Ie):Ie=e[19];const Qe=Ie;let gt,Wt;e[20]!==Le?(gt=()=>{const Mt=ie.current,Ct=Ae.current,Dr=mt.current;tt(cr=>{const ei=new Set([...cr].filter(jq));for(const Bi of Le)(Mt[Bi.groupKey]??Bi.browserState)==="CLOSED"&&ei.add(`project:${Bi.groupKey}`),(Ct[Bi.groupKey]??Bi.generalChatsBrowserState)==="CLOSED"&&ei.add(`general:${Bi.groupKey}`);for(const Bi of Le)for(const ua of Bi.features)(Dr[ua.featureId]??ua.browserState)==="CLOSED"&&ei.add(`feature:${ua.featureId}`);return ei});const mn={...Mt};for(const cr of Le)mn[cr.groupKey]===cr.browserState&&delete mn[cr.groupKey];ie.current=mn;const zi={...Ct};for(const cr of Le)zi[cr.groupKey]===cr.generalChatsBrowserState&&delete zi[cr.groupKey];Ae.current=zi;const Sr={...Dr};for(const cr of Le)for(const ei of cr.features)Sr[ei.featureId]===ei.browserState&&delete Sr[ei.featureId];mt.current=Sr},Wt=[Le],e[20]=Le,e[21]=gt,e[22]=Wt):(gt=e[21],Wt=e[22]),_.useEffect(gt,Wt);let wt;e[23]!==P?(wt=(Mt,Ct)=>{ie.current={...ie.current,[Mt]:Ct},P(Mt,Ct)},e[23]=P,e[24]=wt):wt=e[24];const xt=wt;let Qt;e[25]!==z?(Qt=(Mt,Ct)=>{Ae.current={...Ae.current,[Mt]:Ct},z(Mt,Ct)},e[25]=z,e[26]=Qt):Qt=e[26];const kt=Qt;let Dt;e[27]!==Y?(Dt=(Mt,Ct)=>{mt.current={...mt.current,[Mt]:Ct},Y(Mt,Ct)},e[27]=Y,e[28]=Dt):Dt=e[28];const wn=Dt;let Zt;e[29]!==ae||e[30]!==S||e[31]!==d?(Zt=Mt=>{ae(`/chat/${Mt}`),d&&S()},e[29]=ae,e[30]=S,e[31]=d,e[32]=Zt):Zt=e[32];const bn=Zt,Hn=$o(Oq);let dn;e[33]!==i||e[34]!==r||e[35]!==bn||e[36]!==Je||e[37]!==B||e[38]!==G||e[39]!==Hn?(dn=(Mt,Ct)=>g.jsx(bU,{chat:Mt,activeChatId:i,nowMs:Je,showProviderIcon:Hn,isCompleted:r.has(Mt.chatId),onSelectChat:bn,onRenameChat:()=>G(Mt),onDeleteChat:()=>B(Mt),draggable:Ct==null?void 0:Ct.draggable,onDragStart:Ct==null?void 0:Ct.onDragStart,onDragEnd:Ct==null?void 0:Ct.onDragEnd,isTouchDevice:Ct==null?void 0:Ct.isTouchDevice,onTouchDragMove:Ct==null?void 0:Ct.onTouchDragMove,onTouchDragEnd:Ct==null?void 0:Ct.onTouchDragEnd},Mt._id),e[33]=i,e[34]=r,e[35]=bn,e[36]=Je,e[37]=B,e[38]=G,e[39]=Hn,e[40]=dn):dn=e[40];const pe=dn;let de,Oe;e[41]===Symbol.for("react.memo_cache_sentinel")?(de=()=>{const Mt=window.setInterval(()=>{Ve(Date.now())},3e4);return()=>window.clearInterval(Mt)},Oe=[],e[41]=de,e[42]=Oe):(de=e[41],Oe=e[42]),_.useEffect(de,Oe);let Et,_n;e[43]!==it?(Et=()=>{if(it)return document.body.style.cursor="col-resize",document.body.style.userSelect="none",Dq},_n=[it],e[43]=it,e[44]=Et,e[45]=_n):(Et=e[44],_n=e[45]),_.useEffect(Et,_n);let An,Jn;e[46]===Symbol.for("react.memo_cache_sentinel")?(An=()=>()=>{te.current!==null&&window.cancelAnimationFrame(te.current)},Jn=[],e[46]=An,e[47]=Jn):(An=e[46],Jn=e[47]),_.useEffect(An,Jn);let $n,tn;e[48]!==i?($n=()=>{const Mt=se.current;oe.current=Rq(Mt,i),se.current=i},tn=[i],e[48]=i,e[49]=$n,e[50]=tn):($n=e[49],tn=e[50]),_.useEffect($n,tn);let er;e[51]!==u||e[52]!==f||e[53]!==d?(er=()=>{if((f?u:!d)||!me.current)return;const Ct=oe.current;if(!Ct)return;const Dr=requestAnimationFrame(()=>{const mn=me.current;if(!mn)return;const zi=mn.querySelector(`[data-chat-id="${T1(Ct)}"]`);if(!zi)return;oe.current=null;const Sr=zi.getBoundingClientRect(),cr=mn.getBoundingClientRect();if(Sr.top<cr.top+38){const ei=Sr.top-cr.top+mn.scrollTop;mn.scrollTo({top:ei-38,behavior:"smooth"})}else if(Sr.bottom>cr.bottom){const ei=Sr.top+Sr.height/2-cr.top+mn.scrollTop,Bi=mn.clientHeight/2;mn.scrollTo({top:ei-Bi,behavior:"smooth"})}});return()=>window.cancelAnimationFrame(Dr)},e[51]=u,e[52]=f,e[53]=d,e[54]=er):er=e[54];let lr;e[55]!==i||e[56]!==u||e[57]!==f||e[58]!==d||e[59]!==Le?(lr=[i,u,f,d,Le],e[55]=i,e[56]=u,e[57]=f,e[58]=d,e[59]=Le,e[60]=lr):lr=e[60],_.useEffect(er,lr);let Br;e[61]!==Le?(Br=Le.some(Nq),e[61]=Le,e[62]=Br):Br=e[62];const Rn=Br,nn=re.pathname==="/";let Fr;e[63]!==re.pathname?(Fr=re.pathname.startsWith("/settings"),e[63]=re.pathname,e[64]=Fr):Fr=e[64];const xr=Fr,Jr=nn||xr,Un=a==="connecting"||!c,ul=Un?"Connecting":a==="connected"?"Connected":"Disconnected",so=a==="connected"?"bg-emerald-500":"bg-amber-500",oo=(Z==null?void 0:Z.updateAvailable)===!0,na=Z?Z.latestVersion===`${Z.currentVersion}-dev`:!1,be=(Z==null?void 0:Z.status)==="updating"||(Z==null?void 0:Z.status)==="restart_pending",we=Re??v;let Te;e[65]!==u||e[66]!==we||e[67]!==f?(Te=Eq(f,u,we),e[65]=u,e[66]=we,e[67]=f,e[68]=Te):Te=e[68];const Pe=Te;let Ge;e[69]!==u||e[70]!==f?(Ge=iN(f,u),e[69]=u,e[70]=f,e[71]=Ge):Ge=e[71];const Ft=Ge,hn=k&&k.length>0?`Toggle sidebar (${k[0]})`:"Toggle sidebar",fn=r.size>0;let as;e[72]!==v||e[73]!==E||e[74]!==Ft?(as=Mt=>{var zi;if(!Ft)return;Mt.preventDefault(),ce(!0),ee.current=((zi=ue.current)==null?void 0:zi.getBoundingClientRect().left)??0,Ue(v);const Ct=Sr=>{Q.current=Fg(Sr-ee.current),te.current===null&&(te.current=window.requestAnimationFrame(()=>{te.current=null,Q.current!==null&&Ue(Q.current)}))};Ct(Mt.clientX);const Dr=Sr=>{Ct(Sr.clientX)},mn=()=>{ce(!1),te.current!==null&&(window.cancelAnimationFrame(te.current),te.current=null);const Sr=Q.current??v;Q.current=null,Ue(null),E(Sr),window.removeEventListener("pointermove",Dr),window.removeEventListener("pointerup",mn),window.removeEventListener("pointercancel",mn)};window.addEventListener("pointermove",Dr),window.addEventListener("pointerup",mn),window.addEventListener("pointercancel",mn)},e[72]=v,e[73]=E,e[74]=Ft,e[75]=as):as=e[75];const qu=as;let tr;e[76]!==fn||e[77]!==b||e[78]!==d||e[79]!==m?(tr=!d&&m&&g.jsx("div",{className:Ce("fixed top-2 left-2.5 z-50 md:hidden","flex items-center gap-1 flex-shrink-0","bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1"),children:g.jsxs(vt,{variant:"ghost",size:"icon",className:"relative",onClick:b,children:[g.jsx(w1,{className:"h-5 w-5"}),fn&&g.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]})}),e[76]=fn,e[77]=b,e[78]=d,e[79]=m,e[80]=tr):tr=e[80];let Rs;e[81]!==u||e[82]!==fn||e[83]!==Jr||e[84]!==C?(Rs=u&&Jr&&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.jsxs("div",{className:"relative",children:[g.jsx(sh,{className:"size-6 text-logo"}),fn&&g.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]}),g.jsx(vt,{variant:"ghost",size:"icon",onClick:C,title:"Expand sidebar",children:g.jsx(C1,{className:"h-5 w-5"})})]})}),e[81]=u,e[82]=fn,e[83]=Jr,e[84]=C,e[85]=Rs):Rs=e[85];const uc=d?"flex":"hidden md:flex",dl=u&&"md:hidden";let pi;e[86]!==uc||e[87]!==dl?(pi=Ce("fixed inset-0 z-50 bg-background dark:bg-card backdrop-blur-2xl flex flex-col h-[100dvh] select-none","md:relative md:inset-auto md:bg-background md:dark:bg-card md:backdrop-blur-none md:flex-none md:mr-0 md:h-[calc(100dvh-16px)] md:my-2 md:ml-2 md:border md:border-border md:rounded-2xl",uc,dl),e[86]=uc,e[87]=dl,e[88]=pi):pi=e[88];let ao;e[89]!==qu||e[90]!==it||e[91]!==Ft?(ao=Ft?g.jsx("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical",className:Ce("group/sidebar-resize hidden md:flex absolute top-0 right-0 z-20 h-full w-3 translate-x-1/2 cursor-col-resize items-center justify-center",it&&"after:bg-logo/70"),onPointerDown:qu,children:g.jsx("span",{className:Ce("h-14 w-px rounded-full bg-border/80 opacity-0 transition-opacity group-hover/sidebar-resize:opacity-100",it&&"bg-logo/70 opacity-100")})}):null,e[89]=qu,e[90]=it,e[91]=Ft,e[92]=ao):ao=e[92];let hl;e[93]===Symbol.for("react.memo_cache_sentinel")?(hl=Ce("flex items-center gap-1 flex-shrink-0 z-10","bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1","md:bg-transparent md:dark:bg-transparent md:backdrop-blur-none md:border-transparent md:p-0 md:rounded-none"),e[93]=hl):hl=e[93];let gi;e[94]!==f||e[95]!==x?(gi=()=>x(f),e[94]=f,e[95]=x,e[96]=gi):gi=e[96];let dc;e[97]===Symbol.for("react.memo_cache_sentinel")?(dc=g.jsx(w1,{className:"h-5 w-5"}),e[97]=dc):dc=e[97];let lo;e[98]!==fn?(lo=fn&&g.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"}),e[98]=fn,e[99]=lo):lo=e[99];let co;e[100]!==gi||e[101]!==lo?(co=g.jsxs(vt,{variant:"ghost",size:"icon",className:"relative md:hidden",onClick:gi,children:[dc,lo]}),e[100]=gi,e[101]=lo,e[102]=co):co=e[102];let Ts;e[103]!==f||e[104]!==x?(Ts=()=>x(f),e[103]=f,e[104]=x,e[105]=Ts):Ts=e[105];let hc,fc;e[106]===Symbol.for("react.memo_cache_sentinel")?(hc=g.jsx(sh,{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"}),fc=g.jsx(C1,{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"}),e[106]=hc,e[107]=fc):(hc=e[106],fc=e[107]);let ls;e[108]!==Ts||e[109]!==hn?(ls=g.jsxs("button",{type:"button",onClick:Ts,title:hn,"aria-label":hn,className:"group/sidebar-collapse hidden md:flex relative items-center justify-center h-5 w-5",children:[hc,fc]}),e[108]=Ts,e[109]=hn,e[110]=ls):ls=e[110];let Ar;e[111]!==co||e[112]!==ls?(Ar=g.jsxs("div",{className:hl,children:[co,ls]}),e[111]=co,e[112]=ls,e[113]=Ar):Ar=e[113];let ra;e[114]===Symbol.for("react.memo_cache_sentinel")?(ra=g.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 md:hidden",children:g.jsx(sh,{className:"h-6 w-6 text-logo"})}),e[114]=ra):ra=e[114];let Ms;e[115]!==xr||e[116]!==ae||e[117]!==S?(Ms=()=>{ae("/settings/account",{replace:xr}),S()},e[115]=xr,e[116]=ae,e[117]=S,e[118]=Ms):Ms=e[118];const As=ut.signedIn?"text-foreground":"text-muted-foreground";let vi;e[119]!==As?(vi=Ce("size-5",As),e[119]=As,e[120]=vi):vi=e[120];let uo;e[121]!==vi?(uo=g.jsx(fz,{className:vi}),e[121]=vi,e[122]=uo):uo=e[122];let Ns;e[123]!==Ms||e[124]!==uo?(Ns=g.jsx(vt,{variant:"ghost",size:"icon",onClick:Ms,className:"mr-1 size-10 rounded-lg","aria-label":"Account",title:"Account",children:uo}),e[123]=Ms,e[124]=uo,e[125]=Ns):Ns=e[125];let ho;e[126]!==be||e[127]!==J||e[128]!==na||e[129]!==oo||e[130]!==Z?(ho=na?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"}):oo?g.jsxs(vt,{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:J,disabled:be,title:Z!=null&&Z.latestVersion?`Update to ${Z.latestVersion}`:"Update Kaizen",children:[be?g.jsx(Fn,{className:"mr-1.5 h-3 w-3 animate-spin"}):null,"UPDATE"]}):null,e[126]=be,e[127]=J,e[128]=na,e[129]=oo,e[130]=Z,e[131]=ho):ho=e[131];let Ds;e[132]===Symbol.for("react.memo_cache_sentinel")?(Ds=g.jsx(YR,{className:"size-5"}),e[132]=Ds):Ds=e[132];let Nr;e[133]!==Be?(Nr=g.jsx(vt,{variant:"ghost",size:"icon",onClick:Be,className:"size-10 rounded-lg",title:"Add project",children:Ds}),e[133]=Be,e[134]=Nr):Nr=e[134];let Os;e[135]!==Ns||e[136]!==ho||e[137]!==Nr?(Os=g.jsxs("div",{className:"flex items-center z-10",children:[Ns,ho,Nr]}),e[135]=Ns,e[136]=ho,e[137]=Nr,e[138]=Os):Os=e[138];let Ii;e[139]!==Ar||e[140]!==Os?(Ii=g.jsxs("div",{className:"relative pl-2.5 md:pl-3 pr-[7px] h-[64px] max-h-[64px] md:h-[55px] md:max-h-[55px] border-b flex items-center justify-between",children:[Ar,ra,Os]}),e[139]=Ar,e[140]=Os,e[141]=Ii):Ii=e[141];let bi;e[142]===Symbol.for("react.memo_cache_sentinel")?(bi={WebkitOverflowScrolling:"touch"},e[142]=bi):bi=e[142];let js;e[143]!==Rn||e[144]!==Un?(js=!Rn&&Un?g.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(Mq)}):null,e[143]=Rn,e[144]=Un,e[145]=js):js=e[145];let cs;e[146]!==n.projectGroups||e[147]!==Rn||e[148]!==Un?(cs=!Rn&&!Un&&n.projectGroups.length===0?g.jsx("p",{className:"text-sm text-slate-400 p-2 mt-6 text-center",children:"No conversations yet"}):null,e[146]=n.projectGroups,e[147]=Rn,e[148]=Un,e[149]=cs):cs=e[149];const mc=F?M:void 0,ia=H?L:void 0,sa=a==="connected";let fo;e[150]!==s||e[151]!==Ze||e[152]!==F||e[153]!==ye||e[154]!==wn||e[155]!==xt||e[156]!==kt||e[157]!==H||e[158]!==R||e[159]!==D||e[160]!==j||e[161]!==K||e[162]!==O||e[163]!==V||e[164]!==W||e[165]!==pe||e[166]!==U||e[167]!==Le||e[168]!==X||e[169]!==mc||e[170]!==ia||e[171]!==sa?(fo=g.jsx(iq,{projectGroups:Le,onReorderGroups:ye,collapsedSections:Ze,onToggleSection:Qe,onSetProjectBrowserState:xt,onSetProjectGeneralChatsBrowserState:kt,onSetFeatureBrowserState:wn,renderChatRow:pe,onNewLocalChat:R,onCreateFeature:mc,onRenameFeature:O,onDeleteFeature:D,onSetFeatureStage:ia,onSetChatFeature:W,onReorderFeatures:V,onRemoveProject:K,isConnected:sa,startingLocalPath:X,folderGroupsEnabled:F,showFeatureOverviewInSidebar:U,kanbanStatusesEnabled:H,activeOverviewFeatureId:s,onOpenFeatureOverview:j,scrollContainerRef:me}),e[150]=s,e[151]=Ze,e[152]=F,e[153]=ye,e[154]=wn,e[155]=xt,e[156]=kt,e[157]=H,e[158]=R,e[159]=D,e[160]=j,e[161]=K,e[162]=O,e[163]=V,e[164]=W,e[165]=pe,e[166]=U,e[167]=Le,e[168]=X,e[169]=mc,e[170]=ia,e[171]=sa,e[172]=fo):fo=e[172];let In;e[173]!==js||e[174]!==cs||e[175]!==fo?(In=g.jsx("div",{ref:me,"data-sidebar-scroll":!0,className:"flex-1 min-h-0 overflow-y-auto scrollbar-hide",style:bi,children:g.jsxs("div",{className:"p-[7px]",children:[js,cs,fo]})}),e[173]=js,e[174]=cs,e[175]=fo,e[176]=In):In=e[176];const us=!ut.features.providerUsage.enabled;let ds;e[177]!==xr||e[178]!==ae||e[179]!==S?(ds=()=>{ae("/settings/account",{replace:xr}),S()},e[177]=xr,e[178]=ae,e[179]=S,e[180]=ds):ds=e[180];let Pi;e[181]!==n.providerUsage||e[182]!==I||e[183]!==A||e[184]!==us||e[185]!==ds||e[186]!==rt?(Pi=g.jsx(pq,{providerUsage:n.providerUsage,visibleProviders:rt,locked:us,onRefreshProviderUsage:A,onOpenProviderLogin:I,onLockedAction:ds}),e[181]=n.providerUsage,e[182]=I,e[183]=A,e[184]=us,e[185]=ds,e[186]=rt,e[187]=Pi):Pi=e[187];let oa;e[188]!==xr||e[189]!==ae||e[190]!==S?(oa=()=>{ae("/settings/general",{replace:xr}),S()},e[188]=xr,e[189]=ae,e[190]=S,e[191]=oa):oa=e[191];const fl=xr?"bg-muted border-border":"border-border/0 hover:bg-muted hover:border-border active:bg-muted/80";let Ls;e[192]!==fl?(Ls=Ce("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",fl),e[192]=fl,e[193]=Ls):Ls=e[193];let Is;e[194]===Symbol.for("react.memo_cache_sentinel")?(Is=g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Q8,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm",children:"Settings"})]}),e[194]=Is):Is=e[194];let hs;e[195]!==ul?(hs=g.jsx("span",{children:ul}),e[195]=ul,e[196]=hs):hs=e[196];let mo;e[197]!==Un||e[198]!==so?(mo=Un?g.jsx(Fn,{className:"h-2 w-2 animate-spin"}):g.jsx("span",{className:Ce("h-2 w-2 rounded-full",so)}),e[197]=Un,e[198]=so,e[199]=mo):mo=e[199];let aa;e[200]!==hs||e[201]!==mo?(aa=g.jsxs("div",{className:"flex items- justify-between gap-2",children:[Is,g.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[hs,mo]})]}),e[200]=hs,e[201]=mo,e[202]=aa):aa=e[202];let la;e[203]!==oa||e[204]!==Ls||e[205]!==aa?(la=g.jsx("button",{type:"button",onClick:oa,className:Ls,children:aa}),e[203]=oa,e[204]=Ls,e[205]=aa,e[206]=la):la=e[206];let ca;e[207]!==Pi||e[208]!==la?(ca=g.jsxs("div",{className:"border-t border-border p-2",children:[Pi,la]}),e[207]=Pi,e[208]=la,e[209]=ca):ca=e[209];let Ps;e[210]!==Pe||e[211]!==pi||e[212]!==ao||e[213]!==Ii||e[214]!==In||e[215]!==ca?(Ps=g.jsxs("div",{ref:ue,"data-sidebar":"open",className:pi,style:Pe,children:[ao,Ii,In,ca]}),e[210]=Pe,e[211]=pi,e[212]=ao,e[213]=Ii,e[214]=In,e[215]=ca,e[216]=Ps):Ps=e[216];let pc;return e[217]!==tr||e[218]!==Rs||e[219]!==Ps?(pc=g.jsxs(g.Fragment,{children:[tr,Rs,Ps]}),e[217]=tr,e[218]=Rs,e[219]=Ps,e[220]=pc):pc=e[220],pc}function Mq(t){return 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(Aq)})]},t)}function Aq(t){return 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:Ce("h-3.5 rounded bg-muted",t===0?"w-32":t===1?"w-40":"w-28")})]},t)}function Nq(t){return sN(t).length>0}function Dq(){document.body.style.cursor="",document.body.style.userSelect=""}function Oq(t){return t.showProviderIconsInSideTray}function jq(t){return!t.startsWith("project:")&&!t.startsWith("general:")&&!t.startsWith("feature:")}function Lq(t){return{...t,features:[],generalChats:sN(t)}}function Iq(t){return[t.groupKey,t]}function Pq(t){return t.id}function zq(t){return t.setOrder}function Bq(t){return t.order}function Fq(){return Date.now()}function sN(t){return[...t.features.flatMap(e=>e.chats),...t.generalChats]}const oN=fi()(Li(t=>({prompts:[],isOpen:!1,addPrompt:e=>t(n=>{const r=e.trim();return r?{prompts:[...n.prompts,{id:Ai(),text:r}]}:n}),removePrompt:e=>t(n=>({prompts:n.prompts.filter(r=>r.id!==e)})),updatePrompt:(e,n)=>t(r=>{const i=n.trim();return i?{prompts:r.prompts.map(s=>s.id===e?{...s,text:i}:s)}:r}),reorderPrompts:(e,n)=>t(r=>{const i=r.prompts.findIndex(d=>d.id===e),s=r.prompts.findIndex(d=>d.id===n);if(i===-1||s===-1||i===s)return r;const a=[...r.prompts],[c]=a.splice(i,1);return a.splice(s,0,c),{prompts:a}}),setOpen:e=>t({isOpen:e})}),{name:"kaizen-quick-prompts",partialize:t=>({prompts:t.prompts})})),Dle={submitChatMessage:"Submit Chat Message",toggleQuickPrompts:"Toggle Quick Prompts",toggleProjectsSidebar:"Toggle Projects Sidebar",toggleEmbeddedTerminal:"Toggle Embedded Terminal",toggleRightSidebar:"Toggle Right Sidebar",openInFinder:"Open In Finder",openInEditor:"Open In Editor",addSplitTerminal:"Add Split Terminal"};function Ole(t){return(t??[]).join(", ")}function jle(t){return t.split(",").map(e=>e.trim()).map(e=>e.toLowerCase()).filter(Boolean)}const Hq=new Map([["cmd","meta"],["meta","meta"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["option","alt"],["shift","shift"]]);function aN(t,e){const n=$q(t);return n?e.key.toLowerCase()===n.key&&e.ctrlKey===n.ctrl&&e.metaKey===n.meta&&e.altKey===n.alt&&e.shiftKey===n.shift:!1}function Ya(t,e,n){return((t==null?void 0:t.bindings[e])??Lo[e]).some(i=>aN(i,n))}function lN(t){return{bindings:{submitChatMessage:(t==null?void 0:t.bindings.submitChatMessage)??Lo.submitChatMessage,toggleQuickPrompts:(t==null?void 0:t.bindings.toggleQuickPrompts)??Lo.toggleQuickPrompts,toggleProjectsSidebar:(t==null?void 0:t.bindings.toggleProjectsSidebar)??Lo.toggleProjectsSidebar,toggleEmbeddedTerminal:(t==null?void 0:t.bindings.toggleEmbeddedTerminal)??Lo.toggleEmbeddedTerminal,toggleRightSidebar:(t==null?void 0:t.bindings.toggleRightSidebar)??Lo.toggleRightSidebar,openInFinder:(t==null?void 0:t.bindings.openInFinder)??Lo.openInFinder,openInEditor:(t==null?void 0:t.bindings.openInEditor)??Lo.openInEditor,addSplitTerminal:(t==null?void 0:t.bindings.addSplitTerminal)??Lo.addSplitTerminal},warning:(t==null?void 0:t.warning)??null,filePathDisplay:(t==null?void 0:t.filePathDisplay)??""}}function $q(t){const e=t.split("+").map(r=>r.trim()).filter(Boolean);if(e.length===0)return null;const n={key:"",ctrl:!1,meta:!1,alt:!1,shift:!1};for(const r of e){const i=r.toLowerCase(),s=Hq.get(i);if(s==="ctrl"){n.ctrl=!0;continue}if(s==="meta"){n.meta=!0;continue}if(s==="alt"){n.alt=!0;continue}if(s==="shift"){n.shift=!0;continue}if(n.key)return null;n.key=i}return n.key?n:null}function Uq(t){if(!t||typeof t!="object")return!1;const e=t;if(e.isContentEditable===!0)return!0;if(typeof e.tagName=="string"){const n=e.tagName.toLowerCase();if(n==="input"||n==="textarea"||n==="select")return!0}return typeof e.closest=="function"?!!e.closest('input, textarea, select, [contenteditable], [contenteditable="true"]'):!1}function zE(t,e){const n=t.trim(),r=e.trim();return r?n?`${n}
|
|
476
|
+
|
|
477
|
+
Additional instructions:
|
|
478
|
+
${r}`:r:n}const Wq=[{name:"new",description:"Start a new chat in the current feature or project",source:"kaizen",handler:({handleCompose:t})=>{t()}},{name:"plan",description:"Switch to plan mode or send the rest of the message in plan mode",source:"kaizen",handler:async({sendMessage:t,setPlanMode:e},n)=>{const r=n.remainder.trim();if(!r){e(!0);return}e(!0),await t({...n.message,text:r},{...n.options,planMode:!0})}},{name:"feature",description:"Create a feature folder or open the feature creation modal",source:"kaizen",handler:async({createFeature:t,openFeatureModal:e},n)=>{const r=n.remainder.trim();if(!r){e();return}await t(r)}}];function BE(t){const e=[...Wq];t.settings.pullRequestProviders.includes(t.currentProvider)&&(e.push({name:"pr",description:"Send the saved pull request creation prompt",source:"kaizen",handler:async({sendMessage:i},s)=>{const a=zE(t.settings.pullRequestPrompt,s.remainder);a.trim()&&await i({...s.message,text:a},s.options)}}),e.push({name:"pr-update",description:"Send the saved pull request update prompt",source:"kaizen",handler:async({sendMessage:i},s)=>{const a=zE(t.settings.pullRequestUpdatePrompt,s.remainder);a.trim()&&await i({...s.message,text:a},s.options)}}));const n=new Set,r=[];for(const i of e)n.has(i.name)||(n.add(i.name),r.push(i));return r}function Vq(t,e){const n=e.toLowerCase();return t.filter(r=>r.name.toLowerCase().includes(n))}function cN(){const t=ke.c(2),[e,n]=_.useState(qq);let r,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const s=window.matchMedia("(display-mode: standalone)"),a=c=>{n(c.matches||navigator.standalone===!0)};return s.addEventListener("change",a),()=>s.removeEventListener("change",a)},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),_.useEffect(r,i),e}function qq(){if(typeof window>"u")return!1;const t=navigator.standalone===!0,e=window.matchMedia("(display-mode: standalone)").matches;return t||e}const Kq=fi()(Li((t,e)=>({drafts:{},setDraft:(n,r)=>t(i=>{if(!r){const{[n]:s,...a}=i.drafts;return{drafts:a}}return{drafts:{...i.drafts,[n]:r}}}),clearDraft:n=>t(r=>{const{[n]:i,...s}=r.drafts;return{drafts:s}}),getDraft:n=>e().drafts[n]??""}),{name:"chat-input-drafts"}));function Gq(t){return t.source==="kaizen"?"Kaizen":t.source}function Yq(t){const e=ke.c(10),{commands:n,activeIndex:r,onSelect:i}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const a=_.useRef(s);let c,d;e[1]!==r?(c=()=>{var m;(m=a.current[r])==null||m.scrollIntoView({block:"nearest"})},d=[r],e[1]=r,e[2]=c,e[3]=d):(c=e[2],d=e[3]),_.useEffect(c,d);let u;e[4]!==r||e[5]!==n||e[6]!==i?(u=n.map((m,v)=>g.jsxs("button",{ref:b=>{a.current[v]=b},type:"button",className:Ce("flex w-full items-center gap-3 rounded-xl px-3 py-2 text-left transition-colors",v===r?"bg-accent":"hover:bg-accent/70"),onPointerDown:b=>{b.preventDefault(),i(m)},children:[g.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border bg-muted/60",children:g.jsx(e4,{className:"h-4 w-4 text-muted-foreground"})}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"font-medium text-sm text-foreground",children:["/",m.name]}),g.jsx("div",{className:"truncate text-xs text-muted-foreground",children:m.description})]}),g.jsx("div",{className:"shrink-0 rounded-full border border-border bg-muted/60 px-2 py-0.5 text-[11px] uppercase tracking-wide text-muted-foreground",children:Gq(m)})]},`${m.source}:${m.name}`)),e[4]=r,e[5]=n,e[6]=i,e[7]=u):u=e[7];let f;return e[8]!==u?(f=g.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-1 z-50",children:g.jsx("div",{className:"overflow-hidden rounded-2xl border border-border bg-background/95 shadow-2xl backdrop-blur-lg",children:g.jsx("div",{className:"max-h-72 overflow-y-auto p-1",children:u})})}),e[8]=u,e[9]=f):f=e[9],f}const Xq=25e3,Qq=15e3,Zq=4e3,Jq=5e3,eK=3e4,tK=150,nK="/dashboard",rK="/kaizen/login",n_="kaizen.remoteAuthBaseUrl";function Cb(t){const e=/^relay_machine_offline:([^:]+)$/.exec(t);return(e==null?void 0:e[1])??null}class iK extends Error{constructor(n){super(`Command "${n}" timed out`);pn(this,"commandType");this.name="CommandTimeoutError",this.commandType=n}}class sK{constructor(e){pn(this,"url");pn(this,"ws",null);pn(this,"started",!1);pn(this,"reconnectTimer",null);pn(this,"reconnectDelayMs",750);pn(this,"subscriptions",new Map);pn(this,"lastSeqBySubscriptionId",new Map);pn(this,"recoveringSubscriptionIds",new Set);pn(this,"pending",new Map);pn(this,"inFlight",new Map);pn(this,"outboundQueue",[]);pn(this,"statusListeners",new Set);pn(this,"heartbeatTimer",null);pn(this,"pingTimeoutTimer",null);pn(this,"connectTimeoutTimer",null);pn(this,"pingPromise",null);pn(this,"pendingAuthReloadTimer",null);pn(this,"lastAuthCloseReason",null);pn(this,"lastOpenAt",0);pn(this,"lastMessageAt",0);pn(this,"reconnectImmediatelyOnClose",!1);pn(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});pn(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});pn(this,"handleOnline",()=>{this.ensureHealthyConnection()});this.url=e}setTimeout(e,n){return window.setTimeout(e,n)}clearTimeout(e){e!==null&&window.clearTimeout(e)}setInterval(e,n){return window.setInterval(e,n)}clearInterval(e){e!==null&&window.clearInterval(e)}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 e;this.started=!1,this.reconnectTimer&&(this.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat(),this.clearPingState(),this.clearConnectTimeout(),this.pendingAuthReloadTimer!==null&&(this.clearTimeout(this.pendingAuthReloadTimer),this.pendingAuthReloadTimer=null),window.removeEventListener("focus",this.handleWindowFocus),window.removeEventListener("online",this.handleOnline),document.removeEventListener("visibilitychange",this.handleVisibilityChange),(e=this.ws)==null||e.close(),this.ws=null;for(const n of this.pending.values())this.rejectPending(n.id,new Error("Socket disposed"))}onStatus(e){return this.statusListeners.add(e),e(this.getStatus()),()=>{this.statusListeners.delete(e)}}subscribe(e,n,r){var s;const i=Ai();return this.subscriptions.set(i,{topic:e,listener:n,eventListener:r}),((s=this.ws)==null?void 0:s.readyState)===WebSocket.OPEN&&this.sendNow({v:1,type:"subscribe",id:i,topic:e},this.ws),()=>{var a;this.subscriptions.delete(i),this.lastSeqBySubscriptionId.delete(i),this.recoveringSubscriptionIds.delete(i),((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.sendNow({v:1,type:"unsubscribe",id:i},this.ws)}}subscribeTerminal(e,n){var s;const r=Ai(),i={type:"terminal",terminalId:e};return this.subscriptions.set(r,{topic:i,listener:n.onSnapshot,eventListener:n.onEvent}),((s=this.ws)==null?void 0:s.readyState)===WebSocket.OPEN&&this.sendNow({v:1,type:"subscribe",id:r,topic:i},this.ws),()=>{var a;this.subscriptions.delete(r),this.lastSeqBySubscriptionId.delete(r),this.recoveringSubscriptionIds.delete(r),((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.sendNow({v:1,type:"unsubscribe",id:r},this.ws)}}command(e){const n=this.getCommandKey(e),r=this.inFlight.get(n);if(r)return r;const i=Ai(),s={v:1,type:"command",id:i,command:e},a=new Promise((c,d)=>{const u=this.setTimeout(()=>{this.rejectPending(i,new iK(e.type))},eK);this.pending.set(i,{id:i,resolve:c,reject:d,timeoutHandle:u,commandKey:n}),this.enqueue(s)});return this.inFlight.set(n,a),a}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(){if(!this.started)return;this.emitStatus("connecting");const e=new WebSocket(this.url);this.ws=e,this.clearConnectTimeout(),this.connectTimeoutTimer=this.setTimeout(()=>{!this.started||this.ws!==e||e.readyState!==WebSocket.CONNECTING||this.abortConnectingSocketAndReconnect()},Jq),e.addEventListener("open",()=>{if(this.ws===e){this.clearConnectTimeout(),this.lastAuthCloseReason=null,this.reconnectDelayMs=750,this.reconnectImmediatelyOnClose=!1,this.lastOpenAt=Date.now(),this.lastMessageAt=this.lastOpenAt,this.lastSeqBySubscriptionId.clear(),this.recoveringSubscriptionIds.clear(),this.emitStatus("connected"),this.startHeartbeat();for(const[n,r]of this.subscriptions.entries())this.sendNow({v:1,type:"subscribe",id:n,topic:r.topic},e);for(;this.outboundQueue.length>0;){const n=this.outboundQueue.shift();n&&this.sendNow(n,e)}}}),e.addEventListener("message",n=>{var i;if(this.ws!==e)return;this.lastMessageAt=Date.now();let r;try{r=JSON.parse(String(n.data))}catch{return}if(r.type==="snapshot"){const s=this.subscriptions.get(r.id);if(!s)return;if(this.recoveringSubscriptionIds.has(r.id)){this.lastSeqBySubscriptionId.set(r.id,r.seq),this.recoveringSubscriptionIds.delete(r.id),s.listener(r.snapshot.data);return}if(!this.shouldAcceptSeq(r.id,r.seq)){this.startRecovery(r.id);return}this.lastSeqBySubscriptionId.set(r.id,r.seq),s.listener(r.snapshot.data);return}if(r.type==="event"){const s=this.subscriptions.get(r.id);if(!s||this.recoveringSubscriptionIds.has(r.id))return;if(!this.shouldAcceptSeq(r.id,r.seq)){this.startRecovery(r.id);return}this.lastSeqBySubscriptionId.set(r.id,r.seq),(i=s.eventListener)==null||i.call(s,r.event);return}if(r.type==="ack"){this.resolvePending(r.id,r.result);return}if(r.type==="error"){if(!r.id){console.error(IF,r.message);return}this.rejectPending(r.id,new Error(r.message))}}),e.addEventListener("close",n=>{if(this.ws!==e||(this.clearConnectTimeout(),!this.started))return;const r=this.reconnectImmediatelyOnClose;this.reconnectImmediatelyOnClose=!1,this.stopHeartbeat(),this.clearPingState(),this.lastSeqBySubscriptionId.clear(),this.recoveringSubscriptionIds.clear(),this.emitStatus("disconnected");const i=(n==null?void 0:n.code)??1e3,s=(n==null?void 0:n.reason)??"",a=(i===1008||i===4001)&&s?this.getAuthCloseMessage(s):"Disconnected";for(const c of this.pending.values())this.rejectPending(c.id,new Error(a));if((i===1008||i===4001)&&this.shouldReloadForAuthClose(s)){this.lastAuthCloseReason=s,this.scheduleAuthReload();return}if(r){this.connect();return}this.scheduleReconnect(this.reconnectDelayMs)})}shouldReloadForAuthClose(e){return e==="relay_sign_in_required"||Cb(e)!==null||e==="relay_access_disabled"||e==="relay_machine_revoked"}getAuthCloseMessage(e){if(Cb(e))return"This remote machine went offline.";switch(e){case"relay_sign_in_required":return"Sign in again to continue to this remote session.";case"relay_machine_revoked":return"This remote machine is no longer available.";case"relay_access_disabled":return"Remote access is no longer enabled for this account.";default:return"Disconnected"}}scheduleAuthReload(){this.pendingAuthReloadTimer===null&&(this.pendingAuthReloadTimer=this.setTimeout(()=>{this.pendingAuthReloadTimer=null;const e=this.getAuthCloseRedirectUrl();if(e){window.location.replace(e);return}window.location.reload()},tK))}getAuthCloseRedirectUrl(){const e=window.localStorage.getItem(n_);if(!e)return null;try{const n=new URL(e),r=this.lastAuthCloseReason;if(!r||!(new URL(window.location.href).hostname!==n.hostname))return null;if(r==="relay_sign_in_required")return n.pathname=rK,n.search="",n.hash="",n.searchParams.set("callbackUrl",window.location.href),n.searchParams.set("reason",r),n.toString();const a=Cb(r);return a?(n.pathname=`/relay/${a}/offline`,n.search="",n.hash="",n.searchParams.set("returnTo",window.location.href),n.toString()):(n.pathname=nK,n.search="",n.hash="",n.searchParams.set("notice",r),n.toString())}catch{return null}}scheduleReconnect(e=this.reconnectDelayMs){this.reconnectTimer===null&&(this.reconnectTimer=this.setTimeout(()=>{this.reconnectTimer=null,this.connect(),this.reconnectDelayMs=Math.min(this.reconnectDelayMs*2,5e3)},e))}getStatus(){var e,n;return((e=this.ws)==null?void 0:e.readyState)===WebSocket.OPEN?"connected":((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING?"connecting":"disconnected"}emitStatus(e){for(const n of this.statusListeners)n(e)}isConnectionStale(){const e=Math.max(this.lastMessageAt,this.lastOpenAt);return e>0&&Date.now()-e>=Xq}sendPing(){if(this.pingPromise)return this.pingPromise;const e=this.command({type:"system.ping"}).then(()=>{this.clearPingState()}).catch(n=>{throw this.clearPingState(),this.reconnectNow(),n});return this.pingTimeoutTimer=this.setTimeout(()=>{this.clearPingState(),this.reconnectNow()},Zq),this.pingPromise=e,e}reconnectNow(){if(this.reconnectTimer!==null&&(this.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())}abortConnectingSocketAndReconnect(){if(!this.ws||this.ws.readyState!==WebSocket.CONNECTING){this.reconnectNow();return}this.reconnectImmediatelyOnClose=!0,this.ws.close()}startHeartbeat(){document.visibilityState==="visible"&&this.heartbeatTimer===null&&(this.heartbeatTimer=this.setInterval(()=>{var e;if(document.visibilityState!=="visible"){this.stopHeartbeat();return}((e=this.ws)==null?void 0:e.readyState)===WebSocket.OPEN&&this.ensureHealthyConnection()},Qq))}stopHeartbeat(){this.heartbeatTimer!==null&&(this.clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}clearPingState(){this.pingTimeoutTimer!==null&&(this.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=null),this.pingPromise=null}clearConnectTimeout(){this.connectTimeoutTimer!==null&&(this.clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=null)}resolvePending(e,n){const r=this.pending.get(e);r&&(this.pending.delete(e),this.clearTimeout(r.timeoutHandle),this.removeQueuedCommand(e),this.inFlight.delete(r.commandKey),r.resolve(n))}rejectPending(e,n){const r=this.pending.get(e);r&&(this.pending.delete(e),this.clearTimeout(r.timeoutHandle),this.removeQueuedCommand(e),this.inFlight.delete(r.commandKey),r.reject(n))}removeQueuedCommand(e){const n=this.outboundQueue.findIndex(r=>r.type==="command"&&r.id===e);n!==-1&&this.outboundQueue.splice(n,1)}enqueue(e){var n;if(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.sendNow(e,this.ws);return}this.outboundQueue.push(e)}sendNow(e,n){if(n.readyState!==WebSocket.OPEN){e.type==="command"&&this.outboundQueue.unshift(e);return}n.send(JSON.stringify(e))}shouldAcceptSeq(e,n){const r=this.lastSeqBySubscriptionId.get(e);return r==null?!0:n===r+1}startRecovery(e){var n;this.recoveringSubscriptionIds.has(e)||(this.recoveringSubscriptionIds.add(e),this.lastSeqBySubscriptionId.delete(e),((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.sendNow({v:1,type:"refresh",id:e},this.ws))}getCommandKey(e){switch(e.type){case"chat.send":case"chat.cancel":case"chat.loadMore":case"chat.respondTool":case"terminal.input":return`${e.type}:${Ai()}`;default:return JSON.stringify(e)}}}const fu=fi()(Li(t=>({folderGroupsEnabled:!1,showFeatureOverviewInSidebar:!0,kanbanStatusesEnabled:!0,commitProjectMetadataDirectory:!0,setFolderGroupsEnabled:e=>t({folderGroupsEnabled:e}),setShowFeatureOverviewInSidebar:e=>t({showFeatureOverviewInSidebar:e}),setKanbanStatusesEnabled:e=>t({kanbanStatusesEnabled:e}),setCommitProjectMetadataDirectory:e=>t({commitProjectMetadataDirectory:e})}),{name:"feature-settings"})),r_=1e4,oK=500,aK=5e4,i_=450,lK=250,cK=900,s_="cursor";function o_(t){switch(t){case"vscode":return"code {path}";case"windsurf":return"windsurf {path}";case"custom":return"cursor {path}";case"cursor":default:return"cursor {path}"}}function uK(t){switch(t){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function FE(t){return Number.isFinite(t)?Math.min(aK,Math.max(oK,Math.round(t))):r_}function HE(t){return Number.isFinite(t)?Math.min(cK,Math.max(lK,Math.round(t))):i_}function $E(t){switch(t){case"vscode":case"windsurf":case"custom":case"cursor":return t;default:return s_}}function kb(t,e){const n=t==null?void 0:t.trim();return n&&n.length>0?n:o_(e)}const Fp=fi()(Li(t=>({scrollbackLines:r_,minColumnWidth:i_,editorPreset:s_,editorCommandTemplate:o_(s_),setScrollbackLines:e=>t({scrollbackLines:FE(e)}),setMinColumnWidth:e=>t({minColumnWidth:HE(e)}),setEditorPreset:e=>t(n=>{const r=$E(e);return{editorPreset:r,editorCommandTemplate:r==="custom"?kb(n.editorCommandTemplate,r):o_(r)}}),setEditorCommandTemplate:e=>t(n=>({editorCommandTemplate:kb(e,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:t=>{const e=t,n=$E(e==null?void 0:e.editorPreset);return{scrollbackLines:FE((e==null?void 0:e.scrollbackLines)??r_),minColumnWidth:HE((e==null?void 0:e.minColumnWidth)??i_),editorPreset:n,editorCommandTemplate:kb(e==null?void 0:e.editorCommandTemplate,n)}}}));function uN(t=window.location.pathname){const e=t.match(/^\/m\/[^/]+/);return e?e[0]:""}function Hg(t){const e=uN();return e?t==="/"?e:`${e}${t.startsWith("/")?t:`/${t}`}`:t}function dK(t){return t?t.startsWith("/")?Hg(t):t:t??null}function hK(t){return t?Hg(`/api/theme-backgrounds?source=${encodeURIComponent(t)}`):t??null}async function a_({socket:t,action:e,localPath:n,line:r,column:i}){const s=Fp.getState();await t.command({type:"system.openExternal",action:e,localPath:n,line:r,column:i,editor:e==="open_editor"?{preset:s.editorPreset,commandTemplate:s.editorCommandTemplate}:void 0})}const Ex="Execute on this plan now.";function l_(t){return{id:Ai(),label:t.label,provider:t.provider,model:t.model,modelOptions:{...t.modelOptions},basePrompt:t.basePrompt??Ex}}function np(){return[l_({label:"Claude Opus",provider:"claude",model:"opus",modelOptions:{reasoningEffort:"high"}}),l_({label:"Codex 5.4",provider:"codex",model:"gpt-5.4",modelOptions:{reasoningEffort:"high",fastMode:!1}})]}function fK(t="codex"){var n;const e=Zn(t);return l_({label:`${e.label} ${((n=e.models[0])==null?void 0:n.label)??e.defaultModel}`,provider:t,model:e.defaultModel,modelOptions:e.defaultModelOptions})}function c_(t){var i;const e=(t==null?void 0:t.provider)==="claude"||(t==null?void 0:t.provider)==="codex"||(t==null?void 0:t.provider)==="gemini"||(t==null?void 0:t.provider)==="cursor"||(t==null?void 0:t.provider)==="openrouter"?t.provider:"codex",n=Zn(e),r=typeof(t==null?void 0:t.model)=="string"&&n.models.some(s=>s.id===t.model)?t.model:n.defaultModel;return{id:t!=null&&t.id&&t.id.trim()?t.id:Ai(),label:typeof(t==null?void 0:t.label)=="string"&&t.label.trim()?t.label.trim():`${n.label} ${((i=n.models.find(s=>s.id===r))==null?void 0:i.label)??r}`,provider:e,model:r,modelOptions:t!=null&&t.modelOptions&&typeof t.modelOptions=="object"&&!Array.isArray(t.modelOptions)?{...t.modelOptions}:{...n.defaultModelOptions},basePrompt:typeof(t==null?void 0:t.basePrompt)=="string"?t.basePrompt:Ex}}function mK(t){return!Array.isArray(t)||t.length===0?np():t.map(e=>c_(e&&typeof e=="object"?e:void 0))}const pK=fi()(Li(t=>({entries:np(),addEntry:e=>t(n=>({entries:[...n.entries,c_(e)]})),updateEntry:(e,n)=>t(r=>({entries:r.entries.map(i=>i.id===e?c_({...i,...n,id:i.id}):i)})),removeEntry:e=>t(n=>({entries:n.entries.filter(r=>r.id!==e)})),reorderEntries:e=>t(n=>{const r=new Map(n.entries.map(a=>[a.id,a])),i=e.map(a=>r.get(a)).filter(a=>a!==void 0),s=n.entries.filter(a=>!e.includes(a.id));return{entries:[...i,...s]}}),resetToDefaults:()=>t({entries:np()})}),{name:"quick-chats",version:1,migrate:t=>{if(!t||typeof t!="object")return{entries:np()};const e=t;return{...e,entries:mK(e.entries)}}}));function Lle(t="codex"){return fK(t)}function gK(t,e){var r;const n=t.find(i=>Hp(i).some(s=>s.chatId===e));return n?((r=Hp(n).find(i=>i.chatId!==e))==null?void 0:r.chatId)??null:null}function u_(t,e){var n;return((n=t.find(r=>Hp(r).some(i=>i.chatId===e)))==null?void 0:n.groupKey)??null}function tu(t,e){for(const n of t){const r=Hp(n).find(i=>i.chatId===e);if(r)return r}return null}function dN(t){return t<24}function vK(t){return Math.max(160,Math.round(t+48))}function bK(t,e){return t==="awaiting_disconnect"&&e==="disconnected"?"awaiting_reconnect":t==="awaiting_reconnect"&&e==="connected"?"clear_phase":"none"}const hN=8e3;function _K(t,e,n){return t==="awaiting_reconnect"&&e==="disconnected"&&n>=hN}function yK(t){const e=t.selectedProjectId??t.sidebarProjectId??null;return e?{kind:"project_id",projectId:e}:t.fallbackLocalProjectPath?{kind:"local_path",localPath:t.fallbackLocalProjectPath}:null}function xK(t,e){return!t||!e||t.runtime.chatId!==e?null:t}function fN(t){return t.basePrompt.trim()||Ex}function SK(t){return fN(t)}function wK(t){const e=new TextEncoder().encode(t);let n="";for(const r of e)n+=String.fromCharCode(r);return{type:"text",name:"kaizen-plan-handoff.md",mimeType:"text/markdown",sizeBytes:e.length,dataUrl:`data:text/markdown;base64,${btoa(n)}`}}async function CK(t){const e=fN(t.entry),n=SK(t.entry),r=wK(t.planText),i={type:"chat.respondTool",chatId:t.sourceChatId,toolUseId:t.toolUseId,result:{confirmed:!0,suppressFollowUp:!0}};return await t.socket.command(i),await t.socket.command({type:"chat.cancel",chatId:t.sourceChatId}),{chatId:(await t.socket.command({type:"chat.send",projectId:t.projectId,featureId:t.featureId,provider:t.entry.provider,message:{text:n,attachments:[r]},model:t.entry.model,modelOptions:{[t.entry.provider]:t.entry.modelOptions},planMode:!1})).chatId,handoffText:e}}function Hp(t){return[...t.features.flatMap(e=>e.chats),...t.generalChats]}const mN=_.createContext(void 0);function kK(t){const e=ke.c(11),{children:n}=t,[r,i]=_.useState(null),[s,a]=_.useState(null),[c,d]=_.useState(!1);let u,f,m,v;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=C=>a(C),f=()=>a(null),m=()=>d(!0),v=()=>d(!1),e[0]=u,e[1]=f,e[2]=m,e[3]=v):(u=e[0],f=e[1],m=e[2],v=e[3]);let b;e[4]!==r||e[5]!==s||e[6]!==c?(b={commandError:r,createFeatureModalProjectId:s,cursorCurlImportOpen:c,setCommandError:i,handleOpenCreateFeatureModal:u,handleCloseCreateFeatureModal:f,handleOpenCursorCurlImport:m,handleCloseCursorCurlImport:v},e[4]=r,e[5]=s,e[6]=c,e[7]=b):b=e[7];const S=b;let x;return e[8]!==n||e[9]!==S?(x=g.jsx(mN.Provider,{value:S,children:n}),e[8]=n,e[9]=S,e[10]=x):x=e[10],x}function Fu(){const t=_.useContext(mN);if(!t)throw new Error("useUIContext must be used within UIProvider");return t}const Rx="kaizen-last-seen-version".replace("last-seen-version","ui-update-restart");function EK(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${Hg("/ws")}`}function Eb(){return window.sessionStorage.getItem(Rx)}function UE(t){window.sessionStorage.setItem(Rx,t)}function Cm(){window.sessionStorage.removeItem(Rx)}function RK(){const t=ke.c(3),[e]=_.useState(TK);let n,r;return t[0]!==e?(n=()=>(e==null||e.start(),()=>{e==null||e.dispose()}),r=[e],t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]),_.useEffect(n,r),e}function TK(){return new sK(EK())}const pN=_.createContext(void 0);function MK({children:t}){const e=RK(),n=Ly(),{setCommandError:r}=Fu(),[i,s]=_.useState("connecting"),[a,c]=_.useState(null);_.useEffect(()=>e.onStatus(s),[e]),_.useEffect(()=>e.subscribe({type:"update"},v=>{c(v),r(null)}),[r,e]),_.useEffect(()=>{i==="connected"&&e.command({type:"update.check",force:!0}).catch(v=>{r(v instanceof Error?v.message:String(v))})},[i,r,e]),_.useEffect(()=>{const v=Eb(),b=bK(v,i);if(b==="awaiting_reconnect"){UE("awaiting_reconnect");return}b==="clear_phase"&&Cm()},[i]),_.useEffect(()=>{if(Eb()!=="awaiting_reconnect"||i!=="disconnected")return;const b=Date.now(),S=window.setTimeout(()=>{_K(Eb(),i,Date.now()-b)&&Cm()},hN);return()=>{window.clearTimeout(S)}},[i]),_.useEffect(()=>{function v(){a!=null&&a.lastCheckedAt&&(Date.now()-a.lastCheckedAt<=3600*1e3||e.command({type:"update.check"}).catch(b=>{r(b instanceof Error?b.message:String(b))}))}return window.addEventListener("focus",v),()=>{window.removeEventListener("focus",v)}},[r,e,a==null?void 0:a.lastCheckedAt]);async function d(v){try{await e.command({type:"update.check",force:v==null?void 0:v.force}),r(null)}catch(b){r(b instanceof Error?b.message:String(b))}}async function u(){try{const v=await e.command({type:"update.install"});if(!v.ok){Cm(),r(null),await n.alert({title:v.userTitle??"Update failed",description:v.userMessage??`${ys} could not install the update. Try again later.`,closeLabel:"OK"});return}if(v.action==="reload"){window.location.reload();return}v.action==="restart"&&UE("awaiting_disconnect"),r(null)}catch(v){Cm(),r(v instanceof Error?v.message:String(v))}}async function f(v,b){try{r(null),await a_({socket:e,action:v,localPath:b})}catch(S){r(S instanceof Error?S.message:String(S))}}async function m(v){try{r(null),await a_({socket:e,action:"open_editor",localPath:v.path,line:v.line,column:v.column})}catch(b){r(b instanceof Error?b.message:String(b))}}return g.jsx(pN.Provider,{value:{socket:e,connectionStatus:i,updateSnapshot:a,handleCheckForUpdates:d,handleInstallUpdate:u,handleOpenExternalPath:f,handleOpenLocalLink:m},children:t})}function Vh(){const t=_.useContext(pN);if(!t)throw new Error("useConnectionContext must be used within ConnectionProvider");return t}function WE(t){_s.setState({themePreference:t.settings.themePreference,themeId:t.settings.themeId,customAppearance:t.settings.customAppearance,backgroundImage:t.settings.backgroundImage,backgroundOpacity:t.settings.backgroundOpacity,backgroundBlur:t.settings.backgroundBlur,showProjectIconsInSidebar:t.settings.showProjectIconsInSidebar,availableThemes:t.availableThemes,themeCssText:t.themeCssText})}const gN=_.createContext(void 0);function AK({children:t}){const{socket:e,handleOpenExternalPath:n}=Vh(),{setCommandError:r,handleOpenCursorCurlImport:i,handleCloseCursorCurlImport:s}=Fu(),[a,c]=_.useState(null),[d,u]=_.useState(null),[f,m]=_.useState(null),[v,b]=_.useState(null),[S,x]=_.useState(null),[C,k]=_.useState(null),[E,R]=_.useState(null),M=fu(B=>B.folderGroupsEnabled),O=fu(B=>B.showFeatureOverviewInSidebar),D=fu(B=>B.kanbanStatusesEnabled),P=uK(Fp(B=>B.editorPreset));_.useEffect(()=>e.subscribe({type:"keybindings"},B=>{c(B),r(null)}),[r,e]),_.useEffect(()=>e.subscribe({type:"theme-settings"},B=>{u(B),WE(B),r(null)}),[r,e]),_.useEffect(()=>e.subscribe({type:"provider-catalog"},B=>{m(B),r(null)}),[r,e]),_.useEffect(()=>e.subscribe({type:"provider-settings"},B=>{b(B),r(null)}),[r,e]),_.useEffect(()=>e.subscribe({type:"remote-auth"},B=>{x(B),r(null)}),[r,e]),_.useEffect(()=>{if(!(S!=null&&S.baseUrl)){window.localStorage.removeItem(n_);return}window.localStorage.setItem(n_,S.baseUrl)},[S==null?void 0:S.baseUrl]),_.useEffect(()=>e.subscribe({type:"remote-relay"},B=>{k(B),r(null)}),[r,e]);async function z(B){try{await e.command({type:"provider.refreshUsage",provider:B}),r(null)}catch(K){r(K instanceof Error?K.message:String(K))}}async function Y(B){if(B==="cursor")try{const K=await e.command({type:"provider.browserLogin",provider:B});if(K.availability==="login_required"){K.statusDetail==="browser_launch_failed"&&i(),r(K.statusDetail==="browser_launch_failed"?"Could not launch a Chromium browser for Cursor sign-in. Paste a copied cURL command instead.":"Cursor sign-in did not complete. Try again and finish login in the opened browser.");return}r(null)}catch(K){r(K instanceof Error?K.message:String(K))}}async function L(B){try{const K=await e.command({type:"provider.importUsageCurl",provider:"cursor",curlCommand:B});if(K.availability==="login_required"&&K.statusDetail==="invalid_curl_import"){r("Could not import that cURL command. Copy the get-current-period-usage request as cURL and paste it here.");return}s(),r(null)}catch(K){r(K instanceof Error?K.message:String(K))}}async function W(B){try{await e.command({type:"settings.writeRemoteAuthBaseUrl",baseUrl:B}),r(null)}catch(K){r(K instanceof Error?K.message:String(K))}}async function V(B="sign_in"){const K=window.open("about:blank","_blank");K&&(K.opener=null);try{const A=await e.command({type:"remoteAuth.startSignIn",localBaseUrl:window.location.origin,entryPoint:B});if(!(A!=null&&A.authUrl))throw new Error("Missing Kaizen sign-in URL");R(A.authUrl),K?(K.location.replace(A.authUrl),K.focus()):window.open(A.authUrl,"_blank","noopener,noreferrer"),r(null)}catch(A){K==null||K.close(),r(A instanceof Error?A.message:String(A))}}async function F(){try{await e.command({type:"remoteAuth.signOut"}),R(null),r(null)}catch(B){r(B instanceof Error?B.message:String(B))}}async function U(){try{await e.command({type:"remoteAuth.reload"}),r(null)}catch(B){r(B instanceof Error?B.message:String(B))}}async function H(B){try{await e.command({type:"remoteAuth.setStreamerMode",streamerModeEnabled:B}),r(null)}catch(K){r(K instanceof Error?K.message:String(K))}}async function j(){var B,K;try{r(null);const A=await e.command({type:"settings.bootstrapCustomThemes"}),I=(d==null?void 0:d.themesReadmeFileDisplay)??((K=A==null?void 0:A.localPath)==null?void 0:K.replace(/[/\\][^/\\]+$/,`${(B=A==null?void 0:A.localPath)!=null&&B.includes("\\")?"\\":"/"}THEME_README.md`))??FF();await n("open_editor",I)}catch(A){r(A instanceof Error?A.message:String(A))}}async function G(){try{r(null);const B=await e.command({type:"settings.reloadThemeSettings"});u(B),WE(B)}catch(B){r(B instanceof Error?B.message:String(B))}}return g.jsx(gN.Provider,{value:{keybindings:a,themeSettings:d,providerCatalog:f,providerSettings:v,remoteAuth:S,remoteRelay:C,lastRemoteAuthUrl:E,editorLabel:P,folderGroupsEnabled:M,showFeatureOverviewInSidebar:O,kanbanStatusesEnabled:D,handleOpenCustomThemes:j,handleRefreshThemeSettings:G,handleWriteRemoteAuthBaseUrl:W,handleStartRemoteAuthSignIn:V,handleReloadRemoteAuth:U,handleSetStreamerMode:H,handleSignOutRemoteAuth:F,handleRefreshProviderUsage:z,handleOpenProviderLogin:Y,handleSubmitCursorCurlImport:L},children:t})}function Hu(){const t=_.useContext(gN);if(!t)throw new Error("useSettingsContext must be used within SettingsProvider");return t}function $p(t){return Ap.includes(t.type)?"image":PT.includes(t.type)?"document":zT.includes(t.type)||t.name.toLowerCase().endsWith(".md")?"text":"unsupported"}function rp(t,e,n){const r=wg(t,e);return n==="image"?r.image:n==="document"?r.document:r.markdown}function NK(t,e){const n=typeof t=="string"?Zn(t):t,r=wg(n,e);return[...r.image?[...Ap]:[],...r.document?[...PT]:[],...r.markdown?[...zT,".md"]:[]]}function DK(t,e){const n=wg(t,e);return[...n.image?[{kind:"image",label:"Images"}]:[],...n.document?[{kind:"document",label:"PDF"}]:[],...n.markdown?[{kind:"text",label:"Markdown"}]:[]]}function OK(t,e){const n=wg(e,t),r=[...n.image?["PNG, JPEG, WEBP, and GIF"]:[],...n.document?["PDF"]:[],...n.markdown?["Markdown"]:[]],i=vN(e,t);return r.length===0?`${i} via ${e.label} does not support attachments in Kaizen yet.`:r.length===1?`Only ${r[0]} files are supported for ${i} via ${e.label}.`:`Only ${r.slice(0,-1).join(", ")}, and ${r[r.length-1]} files are supported for ${i} via ${e.label}.`}function vN(t,e){var n;return((n=t.models.find(r=>r.id===e))==null?void 0:n.label)??e}function jK(t){return t==="image"?"image":t==="document"?"PDF":"Markdown"}function ip(t){return`${vN(t.providerConfig,t.model)} via ${t.providerLabel} does not support ${jK(t.attachmentKind)} attachments in Kaizen yet.`}function Rb(t){return"previewUrl"in t?"image":t.mimeType==="application/pdf"?"document":"text"}function VE(t){for(const e of t.attachments.images)if(!rp(t.providerConfig,t.model,"image"))return ip({providerLabel:t.providerConfig.label,providerConfig:t.providerConfig,model:t.model,attachmentKind:Rb(e)});for(const e of t.attachments.documents)if(!rp(t.providerConfig,t.model,"document"))return ip({providerLabel:t.providerConfig.label,providerConfig:t.providerConfig,model:t.model,attachmentKind:Rb(e)});for(const e of t.attachments.textAttachments)if(!rp(t.providerConfig,t.model,"text"))return ip({providerLabel:t.providerConfig.label,providerConfig:t.providerConfig,model:t.model,attachmentKind:Rb(e)});return null}async function Tb(t){const e=$p(t),n=e==="text"?"text/markdown":e==="document"?"application/pdf":t.type,r=await new Promise((i,s)=>{const a=new FileReader;a.onload=()=>{if(typeof a.result=="string"){if(n&&n!==t.type){const[,c=""]=a.result.split(",",2);i(`data:${n};base64,${c}`);return}i(a.result);return}s(new Error("Failed to read image attachment"))},a.onerror=()=>s(a.error??new Error("Failed to read image attachment")),a.readAsDataURL(t)});return{type:e==="document"?"document":e==="text"?"text":"image",name:t.name,mimeType:n,sizeBytes:t.size,dataUrl:r}}function LK(t){return t>=1024*1024?`${Math.max(.1,Math.round(t/(1024*1024)*10)/10)} MB`:`${Math.max(1,Math.round(t/1024))} KB`}function qE(){return{images:[],documents:[],textAttachments:[]}}function IK(t){const e=[...t.current.images],n=[...t.current.documents],r=[...t.current.textAttachments];let i=null;for(const s of t.incomingFiles){const a=$p(s);if(a==="unsupported"){i=`Unsupported attachment type: ${s.type||s.name||"unknown"}`;continue}if(!rp(t.providerConfig,t.selectedModel,a)){i=ip({providerLabel:t.providerConfig.label,providerConfig:t.providerConfig,model:t.selectedModel,attachmentKind:a});continue}if(e.length+n.length+r.length>=Mp){i=`You can attach up to ${Mp} files per message.`;break}if(a==="image"){if(s.size<=0||s.size>IT){i=`${s.name} is empty or larger than 10 MB.`;continue}e.push({id:Ai(),file:s,name:s.name||"image",mimeType:s.type,sizeBytes:s.size,previewUrl:URL.createObjectURL(s)});continue}if(a==="document"){if(s.size<=0||s.size>oH){i=`${s.name} is empty or larger than 20 MB.`;continue}n.push({id:Ai(),file:s,name:s.name||"document.pdf",mimeType:"application/pdf",sizeBytes:s.size});continue}if(s.size<=0||s.size>aH){i=`${s.name} is empty or larger than 1 MB.`;continue}r.push({id:Ai(),file:s,name:s.name||"notes.md",mimeType:"text/markdown",sizeBytes:s.size})}return{attachments:{images:e,documents:n,textAttachments:r},error:i}}function PK(t){const e=ke.c(16),{composerDisabled:n,images:r,documents:i,textAttachments:s,onRemoveImage:a,onRemoveDocument:c,onRemoveTextAttachment:d}=t;if(!r.length&&!i.length&&!s.length)return null;let u;e[0]!==n||e[1]!==r||e[2]!==a?(u=r.length?g.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:r.map(b=>g.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/80 bg-background/80",children:[g.jsx("img",{src:b.previewUrl,alt:b.name,className:"h-28 w-full object-cover"}),g.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 px-2 py-1.5",children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"truncate text-xs text-foreground",children:b.name}),g.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[Math.max(1,Math.round(b.sizeBytes/1024))," KB"]})]}),g.jsx(vt,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0","aria-label":`Remove ${b.name||b.id}`,onClick:()=>a(b.id),disabled:n,children:g.jsx(is,{className:"h-3.5 w-3.5"})})]})]},b.id))}):null,e[0]=n,e[1]=r,e[2]=a,e[3]=u):u=e[3];let f;e[4]!==n||e[5]!==i||e[6]!==c?(f=i.length?g.jsx("div",{className:"flex flex-col gap-2",children:i.map(b=>g.jsx(KE,{name:b.name,sizeBytes:b.sizeBytes,composerDisabled:n,onRemove:()=>c(b.id)},b.id))}):null,e[4]=n,e[5]=i,e[6]=c,e[7]=f):f=e[7];let m;e[8]!==n||e[9]!==d||e[10]!==s?(m=s.length?g.jsx("div",{className:"flex flex-col gap-2",children:s.map(b=>g.jsx(KE,{name:b.name,sizeBytes:b.sizeBytes,composerDisabled:n,onRemove:()=>d(b.id)},b.id))}):null,e[8]=n,e[9]=d,e[10]=s,e[11]=m):m=e[11];let v;return e[12]!==u||e[13]!==f||e[14]!==m?(v=g.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[u,f,m]}),e[12]=u,e[13]=f,e[14]=m,e[15]=v):v=e[15],v}function KE(t){const e=ke.c(18),{name:n,sizeBytes:r,composerDisabled:i,onRemove:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:g.jsx(ag,{className:"h-5 w-5"})}),e[0]=a):a=e[0];let c;e[1]!==n?(c=g.jsx("div",{className:"truncate text-sm text-foreground",children:n}),e[1]=n,e[2]=c):c=e[2];let d;e[3]!==r?(d=LK(r),e[3]=r,e[4]=d):d=e[4];let u;e[5]!==d?(u=g.jsx("div",{className:"text-[11px] text-muted-foreground",children:d}),e[5]=d,e[6]=u):u=e[6];let f;e[7]!==c||e[8]!==u?(f=g.jsxs("div",{className:"min-w-0 flex-1",children:[c,u]}),e[7]=c,e[8]=u,e[9]=f):f=e[9];const m=`Remove ${n}`;let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=g.jsx(is,{className:"h-3.5 w-3.5"}),e[10]=v):v=e[10];let b;e[11]!==i||e[12]!==s||e[13]!==m?(b=g.jsx(vt,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0","aria-label":m,onClick:s,disabled:i,children:v}),e[11]=i,e[12]=s,e[13]=m,e[14]=b):b=e[14];let S;return e[15]!==f||e[16]!==b?(S=g.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border/80 bg-background/80 px-3 py-2",children:[a,f,b]}),e[15]=f,e[16]=b,e[17]=S):S=e[17],S}function zK(t){return t instanceof HTMLElement&&!!t.closest('input, textarea, select, button, [contenteditable], [contenteditable="true"]')}function BK(t){const e=ke.c(91),{prompt:n,displayNumber:r,isActive:i,isEditing:s,editingText:a,editInputRef:c,onSetEditingText:d,onCommitEdit:u,onCancelEdit:f,onStartEdit:m,onSelect:v,onRemove:b}=t;let S;e[0]!==n.id?(S={id:n.id},e[0]=n.id,e[1]=S):S=e[1];const{attributes:x,listeners:C,setNodeRef:k,transform:E,transition:R,isDragging:M}=cA(S);let O;e[2]!==E?(O=wu.Transform.toString(E),e[2]=E,e[3]=O):O=e[3];let D;e[4]!==O||e[5]!==R?(D={transform:O,transition:R},e[4]=O,e[5]=R,e[6]=D):D=e[6];const P=D;if(s){let te;e[7]!==d?(te=ce=>d(ce.target.value),e[7]=d,e[8]=te):te=e[8];const he=`Edit prompt ${r}`;let ie;e[9]!==f||e[10]!==u?(ie=ce=>{ce.key==="Enter"&&(ce.preventDefault(),ce.stopPropagation(),u()),ce.key==="Escape"&&(ce.preventDefault(),ce.stopPropagation(),f())},e[9]=f,e[10]=u,e[11]=ie):ie=e[11];let xe;e[12]!==c||e[13]!==a||e[14]!==te||e[15]!==he||e[16]!==ie?(xe=g.jsx("input",{ref:c,value:a,onChange:te,"aria-label":he,className:"flex-1 bg-transparent text-sm outline-none text-foreground",onKeyDown:ie}),e[12]=c,e[13]=a,e[14]=te,e[15]=he,e[16]=ie,e[17]=xe):xe=e[17];let Ae;e[18]!==u?(Ae=ce=>{ce.preventDefault(),u()},e[18]=u,e[19]=Ae):Ae=e[19];let Ke;e[20]===Symbol.for("react.memo_cache_sentinel")?(Ke=g.jsx(di,{className:"h-3 w-3"}),e[20]=Ke):Ke=e[20];let mt;e[21]!==u||e[22]!==Ae?(mt=g.jsx("button",{type:"button","aria-label":"Save prompt",className:"shrink-0 h-5 w-5 rounded-full flex items-center justify-center hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors",onPointerDown:Ae,onClick:u,children:Ke}),e[21]=u,e[22]=Ae,e[23]=mt):mt=e[23];let Ye;e[24]!==f?(Ye=ce=>{ce.preventDefault(),f()},e[24]=f,e[25]=Ye):Ye=e[25];let Ze;e[26]===Symbol.for("react.memo_cache_sentinel")?(Ze=g.jsx(is,{className:"h-3 w-3"}),e[26]=Ze):Ze=e[26];let tt;e[27]!==f||e[28]!==Ye?(tt=g.jsx("button",{type:"button","aria-label":"Cancel edit",className:"shrink-0 h-5 w-5 rounded-full flex items-center justify-center hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors",onPointerDown:Ye,onClick:f,children:Ze}),e[27]=f,e[28]=Ye,e[29]=tt):tt=e[29];let it;return e[30]!==k||e[31]!==P||e[32]!==mt||e[33]!==tt||e[34]!==xe?(it=g.jsxs("div",{ref:k,style:P,"data-prompt-item":"",className:"flex items-center gap-2 py-2.5 border-l-[3px] border-primary pl-[13px] pr-4",children:[xe,mt,tt]}),e[30]=k,e[31]=P,e[32]=mt,e[33]=tt,e[34]=xe,e[35]=it):it=e[35],it}const z=M?"opacity-40":"",Y=i?"bg-muted/60 text-foreground border-primary pl-[13px] pr-4":"text-muted-foreground hover:bg-muted/30 hover:text-foreground border-transparent px-4";let L;e[36]!==z||e[37]!==Y?(L=Ce("group flex items-center gap-2 py-2.5 cursor-pointer transition-colors border-l-[3px]",z,Y),e[36]=z,e[37]=Y,e[38]=L):L=e[38];let W;e[39]!==v||e[40]!==n.text?(W=te=>{te.target.closest("[data-drag-handle]")||v(n.text)},e[39]=v,e[40]=n.text,e[41]=W):W=e[41];const V=`Reorder prompt ${r}`;let F;e[42]===Symbol.for("react.memo_cache_sentinel")?(F=g.jsx(C8,{className:"h-3.5 w-3.5"}),e[42]=F):F=e[42];let U;e[43]!==x||e[44]!==C||e[45]!==V?(U=g.jsx("button",{type:"button","data-drag-handle":"","aria-label":V,...x,...C,className:"shrink-0 cursor-grab active:cursor-grabbing text-muted-foreground/30 hover:text-muted-foreground/70 transition-colors touch-none",children:F}),e[43]=x,e[44]=C,e[45]=V,e[46]=U):U=e[46];const H=i?"text-muted-foreground/60":"text-muted-foreground/30";let j;e[47]!==H?(j=Ce("shrink-0 font-mono text-[10px] tabular-nums w-4 text-right select-none",H),e[47]=H,e[48]=j):j=e[48];let G;e[49]!==r||e[50]!==j?(G=g.jsx("span",{className:j,children:r}),e[49]=r,e[50]=j,e[51]=G):G=e[51];let B;e[52]!==n.text?(B=g.jsx("span",{className:"flex-1 text-sm truncate",children:n.text}),e[52]=n.text,e[53]=B):B=e[53];const K=`Edit prompt ${r}`,A=i&&"opacity-50";let I;e[54]!==A?(I=Ce("shrink-0 h-5 w-5 rounded-full flex items-center justify-center","opacity-0 group-hover:opacity-50 hover:!opacity-100 transition-opacity","hover:bg-muted-foreground/20","focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border",A),e[54]=A,e[55]=I):I=e[55];let $,T;e[56]!==m||e[57]!==n.id||e[58]!==n.text?($=te=>{te.stopPropagation(),te.preventDefault(),m(n.id,n.text)},T=te=>{te.stopPropagation(),m(n.id,n.text)},e[56]=m,e[57]=n.id,e[58]=n.text,e[59]=$,e[60]=T):($=e[59],T=e[60]);let X;e[61]===Symbol.for("react.memo_cache_sentinel")?(X=g.jsx(Ul,{className:"h-3 w-3"}),e[61]=X):X=e[61];let Z;e[62]!==K||e[63]!==I||e[64]!==$||e[65]!==T?(Z=g.jsx("button",{type:"button","aria-label":K,className:I,onPointerDown:$,onClick:T,children:X}),e[62]=K,e[63]=I,e[64]=$,e[65]=T,e[66]=Z):Z=e[66];const J=`Remove prompt ${r}`,re=i&&"opacity-50";let ae;e[67]!==re?(ae=Ce("shrink-0 h-5 w-5 rounded-full flex items-center justify-center","opacity-0 group-hover:opacity-50 hover:!opacity-100 transition-opacity","hover:bg-muted-foreground/20","focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border",re),e[67]=re,e[68]=ae):ae=e[68];let ue,me;e[69]!==b||e[70]!==n.id?(ue=te=>{te.stopPropagation(),te.preventDefault(),b(n.id)},me=te=>{te.stopPropagation(),b(n.id)},e[69]=b,e[70]=n.id,e[71]=ue,e[72]=me):(ue=e[71],me=e[72]);let se;e[73]===Symbol.for("react.memo_cache_sentinel")?(se=g.jsx(is,{className:"h-3 w-3"}),e[73]=se):se=e[73];let oe;e[74]!==J||e[75]!==ae||e[76]!==ue||e[77]!==me?(oe=g.jsx("button",{type:"button","aria-label":J,className:ae,onPointerDown:ue,onClick:me,children:se}),e[74]=J,e[75]=ae,e[76]=ue,e[77]=me,e[78]=oe):oe=e[78];let ee;e[79]!==Z||e[80]!==oe?(ee=g.jsxs("div",{className:"flex items-center gap-0.5",children:[Z,oe]}),e[79]=Z,e[80]=oe,e[81]=ee):ee=e[81];let Q;return e[82]!==k||e[83]!==P||e[84]!==U||e[85]!==G||e[86]!==B||e[87]!==ee||e[88]!==L||e[89]!==W?(Q=g.jsxs("div",{ref:k,style:P,"data-prompt-item":"",className:L,onClick:W,children:[U,G,B,ee]}),e[82]=k,e[83]=P,e[84]=U,e[85]=G,e[86]=B,e[87]=ee,e[88]=L,e[89]=W,e[90]=Q):Q=e[90],Q}function FK(t){const e=ke.c(95),{prompts:n,attachmentItems:r,supportsAttachments:i,shortcutBindings:s,onSelect:a,onAdd:c,onRemove:d,onUpdate:u,onReorder:f,onClose:m}=t;let v;e[0]!==n.length?(v=()=>n.length>0?n.length-1:n.length,e[0]=n.length,e[1]=v):v=e[1];const[b,S]=_.useState(v),[x,C]=_.useState(!1),[k,E]=_.useState(""),[R,M]=_.useState(null),[O,D]=_.useState(""),P=_.useRef(null),z=_.useRef(null),Y=_.useRef(null),L=_.useRef(null),W=_.useRef(null),V=_.useRef(""),F=_.useRef(null);let U;e[2]===Symbol.for("react.memo_cache_sentinel")?(U={activationConstraint:{distance:5}},e[2]=U):U=e[2];const H=HM(ep(Dg,U));let j,G;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{var ye;(ye=P.current)==null||ye.focus()},G=[],e[3]=j,e[4]=G):(j=e[3],G=e[4]),_.useEffect(j,G);let B,K;e[5]!==x?(B=()=>{var ye;x&&((ye=Y.current)==null||ye.focus())},K=[x],e[5]=x,e[6]=B,e[7]=K):(B=e[6],K=e[7]),_.useEffect(B,K);let A,I;e[8]!==R?(A=()=>{var ye;R!==null&&((ye=W.current)==null||ye.focus())},I=[R],e[8]=R,e[9]=A,e[10]=I):(A=e[9],I=e[10]),_.useEffect(A,I);let $,T;e[11]!==n.length?(T=()=>{S(ye=>Math.min(ye,n.length))},$=[n.length],e[11]=n.length,e[12]=$,e[13]=T):($=e[12],T=e[13]),_.useEffect(T,$);let X,Z;e[14]!==b||e[15]!==n.length?(X=()=>{var Qe,gt;if(b===n.length){(Qe=L.current)==null||Qe.scrollIntoView({block:"nearest"});return}const ye=z.current;if(!ye)return;(gt=ye.querySelectorAll("[data-prompt-item]")[b])==null||gt.scrollIntoView({block:"nearest"})},Z=[b,n.length],e[14]=b,e[15]=n.length,e[16]=X,e[17]=Z):(X=e[16],Z=e[17]),_.useEffect(X,Z);let J,re;e[18]===Symbol.for("react.memo_cache_sentinel")?(J=()=>()=>{F.current&&clearTimeout(F.current)},re=[],e[18]=J,e[19]=re):(J=e[18],re=e[19]),_.useEffect(J,re);let ae;e[20]!==k||e[21]!==c||e[22]!==n.length?(ae=function(){var Qe;const Ie=k.trim();Ie&&(c(Ie),S(n.length)),C(!1),E(""),(Qe=P.current)==null||Qe.focus()},e[20]=k,e[21]=c,e[22]=n.length,e[23]=ae):ae=e[23];const ue=ae;let me;e[24]===Symbol.for("react.memo_cache_sentinel")?(me=function(){var Ie;C(!1),E(""),(Ie=P.current)==null||Ie.focus()},e[24]=me):me=e[24];const se=me;let oe;e[25]===Symbol.for("react.memo_cache_sentinel")?(oe=function(Ie,Qe){M(Ie),D(Qe)},e[25]=oe):oe=e[25];const ee=oe;let Q;e[26]!==R||e[27]!==O||e[28]!==u?(Q=function(){var Ie;R&&O.trim()&&u(R,O.trim()),M(null),D(""),(Ie=P.current)==null||Ie.focus()},e[26]=R,e[27]=O,e[28]=u,e[29]=Q):Q=e[29];const te=Q;let he;e[30]===Symbol.for("react.memo_cache_sentinel")?(he=function(){var Ie;M(null),D(""),(Ie=P.current)==null||Ie.focus()},e[30]=he):he=e[30];const ie=he;let xe;e[31]!==f?(xe=function(Ie){const{active:Qe,over:gt}=Ie;gt&&Qe.id!==gt.id&&f(String(Qe.id),String(gt.id))},e[31]=f,e[32]=xe):xe=e[32];const Ae=xe;let Ke;e[33]!==b||e[34]!==x||e[35]!==m||e[36]!==a||e[37]!==n||e[38]!==s?(Ke=function(Ie){if(!zK(Ie.target)){if(Ie.key==="ArrowDown"){Ie.preventDefault(),S(Qe=>Qe===n.length?n.length>0?0:n.length:Math.min(Qe+1,n.length-1));return}if(Ie.key==="ArrowUp"){Ie.preventDefault(),S(Qe=>Qe===0||Qe===n.length?n.length:Qe-1);return}if(Ie.key==="Enter"&&!Ie.shiftKey&&!x){if(Ie.preventDefault(),b===n.length)C(!0);else{const Qe=n[b];Qe&&a(Qe.text)}return}if(Ie.key==="Escape"){Ie.preventDefault(),m();return}if(s.some(Qe=>aN(Qe,Ie.nativeEvent))){Ie.preventDefault(),m();return}/^\d$/.test(Ie.key)&&!Ie.ctrlKey&&!Ie.metaKey&&!Ie.altKey&&(Ie.preventDefault(),V.current=V.current+Ie.key,F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{const Qe=parseInt(V.current,10);V.current="",Qe>=1&&Qe<=n.length&&S(n.length-Qe)},400))}},e[33]=b,e[34]=x,e[35]=m,e[36]=a,e[37]=n,e[38]=s,e[39]=Ke):Ke=e[39];const mt=Ke;let Ye,Ze;e[40]===Symbol.for("react.memo_cache_sentinel")?(Ye=Ce("relative z-20 -mb-[1px] outline-none","self-center w-[90%] sm:self-start sm:ml-[60px] sm:w-1/2","border-x border-t border-b-0 border-border rounded-t-[22px]","dark:bg-card/40 bg-background/95 backdrop-blur-lg","animate-slide-up-sm"),Ze=g.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[2px] dark:bg-card bg-background"}),e[40]=Ye,e[41]=Ze):(Ye=e[40],Ze=e[41]);let tt;e[42]===Symbol.for("react.memo_cache_sentinel")?(tt=g.jsx("span",{className:"text-[11px] font-medium tracking-widest uppercase text-muted-foreground/70",children:"Quick Prompts"}),e[42]=tt):tt=e[42];const it=b===n.length?"bg-muted/60 text-foreground ring-1 ring-border":"hover:bg-muted/60 text-muted-foreground hover:text-foreground";let ce;e[43]!==it?(ce=Ce("h-6 w-6 flex items-center justify-center rounded-full transition-colors",it),e[43]=it,e[44]=ce):ce=e[44];let Re,Ue,Je;e[45]===Symbol.for("react.memo_cache_sentinel")?(Re=ye=>{ye.preventDefault(),C(!0)},Ue=()=>C(!0),Je=g.jsx(yy,{className:"h-3.5 w-3.5"}),e[45]=Re,e[46]=Ue,e[47]=Je):(Re=e[45],Ue=e[46],Je=e[47]);let Ve;e[48]!==ce?(Ve=g.jsx("button",{ref:L,type:"button","aria-label":"Add prompt",className:ce,title:"Add prompt (Enter)",onPointerDown:Re,onClick:Ue,children:Je}),e[48]=ce,e[49]=Ve):Ve=e[49];let ze;e[50]!==m?(ze=ye=>{ye.preventDefault(),m()},e[50]=m,e[51]=ze):ze=e[51];let He;e[52]===Symbol.for("react.memo_cache_sentinel")?(He=g.jsx(is,{className:"h-3.5 w-3.5"}),e[52]=He):He=e[52];let Xe;e[53]!==m||e[54]!==ze?(Xe=g.jsx("button",{type:"button","aria-label":"Close quick prompts",className:"h-6 w-6 flex items-center justify-center rounded-full hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors",title:"Close (Esc)",onPointerDown:ze,onClick:m,children:He}),e[53]=m,e[54]=ze,e[55]=Xe):Xe=e[55];let ut;e[56]!==Ve||e[57]!==Xe?(ut=g.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-2",children:[tt,g.jsxs("div",{className:"flex items-center gap-1",children:[Ve,Xe]})]}),e[56]=Ve,e[57]=Xe,e[58]=ut):ut=e[58];let ft;e[59]!==x||e[60]!==n.length?(ft=n.length===0&&!x?g.jsxs("div",{className:"px-4 py-5 text-sm text-center text-muted-foreground/50",children:["Press"," ",g.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-muted text-muted-foreground font-mono text-xs",children:"Enter"})," ","to add a quick prompt"]}):null,e[59]=x,e[60]=n.length,e[61]=ft):ft=e[61];let rt;e[62]!==n?(rt=n.map($K),e[62]=n,e[63]=rt):rt=e[63];let Tt;e[64]!==b||e[65]!==te||e[66]!==R||e[67]!==O||e[68]!==d||e[69]!==a||e[70]!==n?(Tt=n.map((ye,Ie)=>g.jsx(BK,{prompt:ye,index:Ie,displayNumber:n.length-Ie,isActive:Ie===b,isEditing:R===ye.id,editingText:O,editInputRef:W,onSetEditingText:D,onCommitEdit:te,onCancelEdit:ie,onStartEdit:ee,onSelect:a,onRemove:d},ye.id)),e[64]=b,e[65]=te,e[66]=R,e[67]=O,e[68]=d,e[69]=a,e[70]=n,e[71]=Tt):Tt=e[71];let lt;e[72]!==rt||e[73]!==Tt?(lt=g.jsx(aA,{items:rt,strategy:iA,children:Tt}),e[72]=rt,e[73]=Tt,e[74]=lt):lt=e[74];let ht;e[75]!==Ae||e[76]!==H||e[77]!==lt?(ht=g.jsx(nA,{sensors:H,collisionDetection:$M,onDragEnd:Ae,children:lt}),e[75]=Ae,e[76]=H,e[77]=lt,e[78]=ht):ht=e[78];let Be;e[79]!==k||e[80]!==ue||e[81]!==x?(Be=x?g.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-t border-border/40",children:[g.jsx("input",{ref:Y,value:k,onChange:ye=>E(ye.target.value),"aria-label":"New quick prompt text",placeholder:"Type a prompt...",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/40 text-foreground",onKeyDown:ye=>{ye.key==="Enter"&&(ye.preventDefault(),ye.stopPropagation(),ue()),ye.key==="Escape"&&(ye.preventDefault(),ye.stopPropagation(),se())}}),g.jsx("button",{type:"button","aria-label":"Save new prompt",className:"h-6 w-6 flex items-center justify-center rounded-full hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors shrink-0",onPointerDown:ye=>{ye.preventDefault(),ue()},onClick:ue,children:g.jsx(di,{className:"h-3.5 w-3.5"})}),g.jsx("button",{type:"button","aria-label":"Cancel new prompt",className:"h-6 w-6 flex items-center justify-center rounded-full hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors shrink-0",onPointerDown:ye=>{ye.preventDefault(),se()},onClick:se,children:g.jsx(is,{className:"h-3.5 w-3.5"})})]}):null,e[79]=k,e[80]=ue,e[81]=x,e[82]=Be):Be=e[82];let $e;e[83]!==ft||e[84]!==ht||e[85]!==Be?($e=g.jsxs("div",{ref:z,className:"max-h-52 overflow-y-auto",children:[ft,ht,Be]}),e[83]=ft,e[84]=ht,e[85]=Be,e[86]=$e):$e=e[86];let Le;e[87]!==r||e[88]!==i?(Le=i&&r.length>0?g.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-t border-border/50",children:[g.jsx(di,{className:"h-3 w-3 text-green-500 shrink-0"}),g.jsx("span",{className:"text-xs text-muted-foreground/60",children:"Attachments"}),g.jsx("div",{className:"flex items-center gap-1.5",children:r.map(HK)})]}):null,e[87]=r,e[88]=i,e[89]=Le):Le=e[89];let Fe;return e[90]!==mt||e[91]!==ut||e[92]!==$e||e[93]!==Le?(Fe=g.jsxs("div",{ref:P,tabIndex:-1,onKeyDown:mt,className:Ye,children:[Ze,ut,$e,Le]}),e[90]=mt,e[91]=ut,e[92]=$e,e[93]=Le,e[94]=Fe):Fe=e[94],Fe}function HK(t,e){const n=t.kind==="image"?E8:t.kind==="document"?ag:l8;return g.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted/60 text-muted-foreground",title:t.label,children:g.jsx(n,{className:"h-3 w-3"})},`${t.kind}-${t.label}-${e}`)}function $K(t){return t.id}function UK(t){const e=ke.c(11),{supportsAttachments:n,quickPromptsOpen:r,quickPrompts:i,attachmentItems:s,shortcutBindings:a,onSelect:c,onAdd:d,onRemove:u,onUpdate:f,onReorder:m,onClose:v}=t;if(!r)return null;let b;return e[0]!==s||e[1]!==d||e[2]!==v||e[3]!==u||e[4]!==m||e[5]!==c||e[6]!==f||e[7]!==i||e[8]!==a||e[9]!==n?(b=g.jsx(FK,{prompts:i,attachmentItems:s,supportsAttachments:n,shortcutBindings:a,onSelect:c,onAdd:d,onRemove:u,onUpdate:f,onReorder:m,onClose:v}),e[0]=s,e[1]=d,e[2]=v,e[3]=u,e[4]=m,e[5]=c,e[6]=f,e[7]=i,e[8]=a,e[9]=n,e[10]=b):b=e[10],b}function WK(t){const e=ke.c(10),{quickPromptsOpen:n,shortcutBindings:r,onOpen:i}=t;if(n)return null;let s,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Ce("relative self-start ml-[60px] z-20 -mb-[1px] flex items-center","border-t border-x border-border rounded-t-[18px]","dark:bg-card/40 bg-background/95 backdrop-blur-lg","text-muted-foreground transition-colors hover:text-foreground"),a=g.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[1px] bg-background"}),e[0]=s,e[1]=a):(s=e[0],a=e[1]);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=g.jsx(qr,{className:"h-4 w-4"}),e[2]=c):c=e[2];let d;e[3]!==i?(d=g.jsx(Bo,{asChild:!0,children:g.jsx("button",{type:"button",className:"inline-flex h-7 w-10 shrink-0 items-center justify-center touch-manipulation","aria-label":"Quick prompts",onPointerDown:VK,onClick:i,children:c})}),e[3]=i,e[4]=d):d=e[4];let u;e[5]!==r?(u=g.jsx(Fl,{side:"top",shortcut:r,children:"Quick Prompts"}),e[5]=r,e[6]=u):u=e[6];let f;return e[7]!==d||e[8]!==u?(f=g.jsxs("div",{className:s,children:[a,g.jsxs(zo,{children:[d,u]})]}),e[7]=d,e[8]=u,e[9]=f):f=e[9],f}function VK(t){t.preventDefault()}function qK(t){const e=ke.c(8),{attachmentError:n,showAttachmentErrorBanner:r}=t,i=r?"translate-y-0 opacity-100":"translate-y-4 opacity-0";let s;e[0]!==i?(s=Ce("pointer-events-none absolute inset-x-2 bottom-[4.75rem] z-30","transition-all duration-300 ease-out",i),e[0]=i,e[1]=s):s=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=Ce("mx-auto rounded-2xl border border-red-500/40 bg-red-500/12 px-4 py-2.5 text-sm text-red-100 shadow-lg backdrop-blur-md","dark:border-red-400/35 dark:bg-red-500/14 dark:text-red-50"),e[2]=a):a=e[2];let c;e[3]!==n?(c=g.jsx("div",{className:a,children:n}),e[3]=n,e[4]=c):c=e[4];let d;return e[5]!==s||e[6]!==c?(d=g.jsx("div",{"aria-live":"polite",className:s,children:c}),e[5]=s,e[6]=c,e[7]=d):d=e[7],d}const KK="max-w-[840px] md:max-w-[960px]";function GE(t,e){if(e===void 0){console.info(`[ChatInput] ${t}`);return}console.info(`[ChatInput] ${t}`,e)}function Io(t,e,n,r,i){return t==="claude"?e.provider==="claude"?{provider:"claude",model:r??e.model,modelOptions:{...e.modelOptions},planMode:i??e.planMode}:{provider:"claude",model:r??n.claude.model,modelOptions:{...n.claude.modelOptions},planMode:i??n.claude.planMode}:t==="gemini"?e.provider==="gemini"?{provider:"gemini",model:r??e.model,modelOptions:{...e.modelOptions},planMode:i??e.planMode}:{provider:"gemini",model:r??n.gemini.model,modelOptions:{...n.gemini.modelOptions},planMode:i??n.gemini.planMode}:t==="cursor"?e.provider==="cursor"?{provider:"cursor",model:r??e.model,modelOptions:{...e.modelOptions},planMode:i??e.planMode}:{provider:"cursor",model:r??n.cursor.model,modelOptions:{...n.cursor.modelOptions},planMode:i??n.cursor.planMode}:t==="openrouter"?e.provider==="openrouter"?{provider:"openrouter",model:r??e.model,modelOptions:{...e.modelOptions},planMode:i??e.planMode}:{provider:"openrouter",model:r??n.openrouter.model,modelOptions:{...n.openrouter.modelOptions},planMode:i??n.openrouter.planMode}:e.provider==="codex"?{provider:"codex",model:r??e.model,modelOptions:{...e.modelOptions},planMode:i??e.planMode}:{provider:"codex",model:r??n.codex.model,modelOptions:{...n.codex.modelOptions},planMode:i??n.codex.planMode}}function GK(t,e,n,r){return r&&t.key==="Enter"?!1:Ya(e,"submitChatMessage",t)&&!n&&!t.isComposing}function YK(t){if(!t.providerLocked)return{composerPlanMode:t.planMode,lockedComposerState:t.lockedComposerState};const e=t.lockedComposerState??Io(t.selectedProvider,t.composerState,t.providerDefaults);return{composerPlanMode:t.composerState.planMode,lockedComposerState:{...e,planMode:t.planMode}}}const XK=_.forwardRef(function({onSubmit:e,onCancel:n,disabled:r,canCancel:i,chatId:s,activeProvider:a,activeModel:c,activePlanMode:d,availableProviders:u,keybindings:f,slashCommands:m,requestedPlanMode:v,requestedPlanModeVersion:b,pendingPlanMode:S},x){const{getDraft:C,setDraft:k,clearDraft:E}=Kq(),{prompts:R,isOpen:M,addPrompt:O,removePrompt:D,updatePrompt:P,reorderPrompts:z,setOpen:Y}=oN(),{composerState:L,providerDefaults:W,setComposerModel:V,setComposerModelOptions:F,setComposerPlanMode:U,resetComposerFromProvider:H}=$o(),[j,G]=_.useState(()=>s?C(s):""),[B,K]=_.useState(()=>qE()),A=_.useRef(B),[I,$]=_.useState(null),[T,X]=_.useState(!1),[Z,J]=_.useState(!1),[re,ae]=_.useState(!1),[ue,me]=_.useState(""),[se,oe]=_.useState(0),ee=_.useRef(null),Q=_.useRef(null),te=cN(),he=zg("(pointer: coarse)"),{remoteAuth:ie}=Hu(),xe=Bg(ie),Ae=xe.features.openrouter.enabled?void 0:oq("OpenRouter","account"),Ke=pe=>pe==="openrouter"&&!!Ae,mt=Ae?{openrouter:Ae}:void 0,Ye=u.filter(pe=>!Ke(pe.id)),[Ze,tt]=_.useState(()=>a?Io(a,L,W,c,d):null),it=a!==null,ce=it?a:L.provider,Re=u.some(pe=>pe.id===ce),Ue=!!(ce&&Ke(ce)),Je=it?Ue||!Re:Ye.length===0,Ve=it?Ze??Io(a,L,W,c,d):L,ze=u.find(pe=>pe.id===ce)??Zn(ce),He=Ve.model,Xe=NK(ze,He),ut=DK(ze,He),ft=(f==null?void 0:f.bindings.toggleQuickPrompts)??["cmd+e","ctrl+e"],rt=Xe.length>0,Tt=(ze==null?void 0:ze.supportsPlanMode)??!1,lt=r||Je,ht=re&&m?Vq(m,ue):[],{images:Be,documents:$e,textAttachments:Le}=B,Fe=_.useCallback(()=>{const pe=ee.current;pe&&(pe.style.height="auto",pe.style.height=`${pe.scrollHeight}px`)},[]),ye=_.useCallback(pe=>{if(ee.current=pe,!!x){if(typeof x=="function"){x(pe);return}x.current=pe}},[x]);_.useEffect(()=>{const pe=A.current.images,de=new Set(B.images.map(Oe=>Oe.id));for(const Oe of pe)de.has(Oe.id)||URL.revokeObjectURL(Oe.previewUrl);A.current=B},[B]),_.useEffect(()=>{Fe()},[j,Fe]),_.useEffect(()=>(window.addEventListener("resize",Fe),()=>window.removeEventListener("resize",Fe)),[Fe]),_.useEffect(()=>{var pe;(pe=ee.current)==null||pe.focus()},[s]),_.useEffect(()=>()=>{for(const pe of A.current.images)URL.revokeObjectURL(pe.previewUrl)},[]),_.useEffect(()=>{if(a===null){tt(null);return}tt(Io(a,L,W,c,d))},[c,d,a,s,L,W]),_.useEffect(()=>{if(!it&&Ye.length!==0){if(L.provider==="openrouter"&&!xe.features.openrouter.enabled){const pe=Ye[0];pe&&H(pe.id);return}Ye.some(pe=>pe.id===L.provider)||H(Ye[0].id)}},[xe.features.openrouter.enabled,L.provider,it,H,Ye]),_.useEffect(()=>{v!=null&&Wt(v)},[v,b]),_.useEffect(()=>{GE("resolved provider state",{chatId:s??null,activeProvider:a,composerProvider:L.provider,composerModel:L.model,effectiveProvider:Ve.provider,effectiveModel:He,selectedProvider:ce,providerLocked:it,lockedComposerProvider:(Ze==null?void 0:Ze.provider)??null})},[a,s,L.model,L.provider,Ze==null?void 0:Ze.provider,it,Ve.model,Ve.provider,ce,He]),_.useEffect(()=>{const pe=VE({model:He,providerConfig:ze,attachments:B});pe&&$(pe)},[B,ze,He,ce]),_.useEffect(()=>{if(!I){X(!1);return}X(!0);const pe=window.setTimeout(()=>{X(!1),$(de=>de===I?null:de)},5e3);return()=>window.clearTimeout(pe)},[I]);function Ie(pe){if(it){tt(de=>{const Oe=de??Io(ce,L,W);return Oe.provider==="claude"?{...Oe,modelOptions:{...Oe.modelOptions,reasoningEffort:pe}}:Oe.provider==="gemini"?Oe:{...Oe,modelOptions:{...Oe.modelOptions,reasoningEffort:pe}}});return}if(ce==="claude"){F({reasoningEffort:pe});return}F({reasoningEffort:pe})}function Qe(pe){if(it){tt(de=>{const Oe=de??Io(ce,L,W);return Oe.provider!=="gemini"?Oe:{...Oe,modelOptions:{...Oe.modelOptions,thinkingMode:pe}}});return}ce==="gemini"&&F({thinkingMode:pe})}function gt(pe){if(it){tt(de=>{const Oe=de??Io(ce,L,W);return Oe.provider!=="claude"?Oe:{...Oe,modelOptions:{...Oe.modelOptions,contextWindow:pe}}});return}ce==="claude"&&F({contextWindow:pe})}function Wt(pe){const de=YK({providerLocked:it,planMode:pe,selectedProvider:ce,composerState:L,providerDefaults:W,lockedComposerState:Ze});de.lockedComposerState!==Ze&&tt(de.lockedComposerState),de.composerPlanMode!==L.planMode&&U(de.composerPlanMode)}function wt(){Wt(!Ve.planMode)}function xt(pe){if(pe.startsWith("/")&&!pe.includes(" ")&&((m==null?void 0:m.length)??0)>0){me(pe.slice(1)),oe(0),ae(!0);return}me(""),oe(0),ae(!1)}function Qt(pe){var Oe;const de=`/${pe.name} `;G(de),s&&k(s,de),ae(!1),me(""),oe(0),(Oe=ee.current)==null||Oe.focus()}async function kt(){if(lt)return;if(ce==="openrouter"&&!xe.features.openrouter.enabled){$(sq("OpenRouter","account"));return}if(!j.trim()&&Be.length===0&&$e.length===0&&Le.length===0)return;const pe=j,de=Be,Oe=$e,Et=Le;let _n;Ve.provider==="claude"?_n={claude:{...Ve.modelOptions}}:Ve.provider==="gemini"?_n={gemini:{...Ve.modelOptions}}:Ve.provider==="cursor"?_n={cursor:{...Ve.modelOptions}}:Ve.provider==="openrouter"?_n={openrouter:{...Ve.modelOptions}}:_n={codex:{...Ve.modelOptions}};const An={provider:ce,model:He,modelOptions:_n,planMode:Tt?Ve.planMode:!1};GE("submit settings",{chatId:s??null,activeProvider:a,composerProvider:Ve.provider,submitOptions:An}),G(""),ae(!1),me(""),oe(0),$(null),s&&E(s),ee.current&&(ee.current.style.height="auto");const Jn={images:de,documents:Oe,textAttachments:Et};try{const $n=VE({model:He,providerConfig:ze,attachments:B});if($n){$($n),G(pe),s&&k(s,pe);return}K(qE()),await e({text:pe.trim(),attachments:de.length||Oe.length||Et.length?[...await Promise.all(de.map(tn=>Tb(tn.file))),...await Promise.all(Oe.map(tn=>Tb(tn.file))),...await Promise.all(Et.map(tn=>Tb(tn.file)))]:void 0},An);for(const tn of de)URL.revokeObjectURL(tn.previewUrl)}catch($n){console.error("[ChatInput] Submit failed:",$n),G(pe),xt(pe),s&&k(s,pe),K({images:Jn.images.map(tn=>({...tn,previewUrl:URL.createObjectURL(tn.file)})),documents:Jn.documents,textAttachments:Jn.textAttachments})}}const Dt=_.useCallback(pe=>{if(lt)return;if(pe.every(Oe=>$p(Oe)==="unsupported")){$(OK(He,ze));return}const de=IK({current:A.current,incomingFiles:pe,providerConfig:ze,selectedModel:He});$(de.error),K(de.attachments)},[lt,ze,He]),wn=_.useCallback(pe=>{K(de=>({...de,documents:de.documents.filter(Oe=>Oe.id!==pe)})),$(null)},[]),Zt=_.useCallback(pe=>{K(de=>({...de,textAttachments:de.textAttachments.filter(Oe=>Oe.id!==pe)})),$(null)},[]),bn=_.useCallback(pe=>{K(de=>{const Oe=de.images.find(Et=>Et.id===pe);return Oe&&URL.revokeObjectURL(Oe.previewUrl),{...de,images:de.images.filter(Et=>Et.id!==pe)}}),$(null)},[]);function Hn(pe){var de;G(pe),s&&k(s,pe),xt(pe),Y(!1),(de=ee.current)==null||de.focus()}function dn(pe){if(Ya(f,"toggleQuickPrompts",pe.nativeEvent)){pe.preventDefault(),Y(!M);return}if(re&&ht.length>0){if(pe.key==="ArrowDown"){pe.preventDefault(),oe(de=>Math.min(de+1,ht.length-1));return}if(pe.key==="ArrowUp"){pe.preventDefault(),oe(de=>Math.max(de-1,0));return}if(pe.key==="Enter"&&!pe.shiftKey){pe.preventDefault();const de=ht[se];de&&Qt(de);return}if(pe.key==="Escape"){pe.preventDefault(),ae(!1);return}}if(pe.key==="Tab"&&!pe.shiftKey){pe.preventDefault(),B7(ee.current,document);return}if(pe.key==="Tab"&&pe.shiftKey&&Tt){pe.preventDefault(),wt();return}if(pe.key==="Escape"&&i){pe.preventDefault(),n==null||n();return}GK(pe.nativeEvent,f,i,he)&&(pe.preventDefault(),kt())}return g.jsx("div",{className:Ce("p-3 pt-0 px-2 md:px-3 md:pb-2 flex flex-col items-center",te&&"px-3"),style:te?{paddingBottom:"var(--app-composer-bottom-padding)"}:void 0,children:g.jsxs("div",{className:Ce("relative z-10 mx-auto flex w-full flex-col items-center overflow-visible",KK),children:[g.jsx(UK,{supportsAttachments:rt,quickPromptsOpen:M,quickPrompts:R,attachmentItems:ut,shortcutBindings:ft,onSelect:Hn,onAdd:O,onRemove:D,onUpdate:P,onReorder:z,onClose:()=>{var pe;Y(!1),(pe=ee.current)==null||pe.focus()}}),g.jsx(WK,{supportsAttachments:rt,quickPromptsOpen:M,shortcutBindings:ft,onOpen:()=>Y(!0)}),re&&ht.length>0?g.jsx(Yq,{commands:ht,activeIndex:se,onSelect:Qt}):null,g.jsx(qK,{attachmentError:I,showAttachmentErrorBanner:T}),g.jsxs("div",{className:Ce("w-full border dark:bg-card/40 bg-background/95 backdrop-blur-lg border-border rounded-[29px] px-2 py-2 transition-colors relative z-10",Z&&"border-foreground/40 bg-muted/30"),onDragEnter:pe=>{r||!pe.dataTransfer.types.includes("Files")||(pe.preventDefault(),J(!0))},onDragOver:pe=>{r||!pe.dataTransfer.types.includes("Files")||(pe.preventDefault(),pe.dataTransfer.dropEffect="copy",J(!0))},onDragLeave:pe=>{if(!pe.dataTransfer.types.includes("Files"))return;pe.preventDefault();const de=pe.relatedTarget;de instanceof Node&&pe.currentTarget.contains(de)||J(!1)},onDrop:pe=>{var de;r||!pe.dataTransfer.types.includes("Files")||(pe.preventDefault(),J(!1),Dt(Array.from(pe.dataTransfer.files)),(de=ee.current)==null||de.focus())},children:[g.jsx(PK,{composerDisabled:lt,images:Be,documents:$e,textAttachments:Le,onRemoveImage:bn,onRemoveDocument:wn,onRemoveTextAttachment:Zt}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("input",{ref:Q,type:"file",accept:Xe.join(","),multiple:!0,className:"hidden",onChange:pe=>{Dt(Array.from(pe.target.files??[])),pe.target.value=""}}),rt?g.jsx(vt,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 rounded-full","aria-label":"Attach files",disabled:lt||i,onClick:()=>{var pe;return(pe=Q.current)==null?void 0:pe.click()},children:g.jsx(ZR,{className:"h-4.5 w-4.5"})}):null,g.jsx(fg,{ref:ye,placeholder:"Build something...",value:j,autoFocus:!0,[Ty]:"",rows:1,onChange:pe=>{const de=pe.target.value;G(de),s&&k(s,de),xt(de),Fe()},onPaste:pe=>{const de=Array.from(pe.clipboardData.files);de.some(Oe=>$p(Oe)!=="unsupported")&&(pe.preventDefault(),Dt(de))},onKeyDown:dn,onBlur:()=>{window.setTimeout(()=>ae(!1),100)},disabled:lt,className:"flex-1 text-base py-2 md:py-3.75 px-1 md:px-2 resize-none max-h-[200px] outline-none bg-transparent border-0 shadow-none"}),g.jsx(vt,{type:"button",onPointerDown:pe=>{pe.preventDefault(),i?n==null||n():!lt&&(j.trim()||Be.length>0||$e.length>0||Le.length>0)&&kt()},disabled:!i&&(lt||!j.trim()&&Be.length===0&&$e.length===0&&Le.length===0),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 touch-manipulation disabled:bg-white/60 disabled:text-slate-700",children:i?g.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):g.jsx(DP,{className:"h-5 w-5 md:h-6 md:w-6"})})]})]}),g.jsxs("div",{className:Ce("border-x border-b border-t-0 border-border rounded-b-[20px] px-3 py-1.5 transition-colors relative z-20 -mt-[1px] flex-shrink-0 shadow-sm","dark:bg-card/40 bg-background/95 backdrop-blur-lg",Z&&"border-foreground/40 bg-muted/30"),children:[g.jsx("div",{className:"absolute top-0 left-0 right-0 h-[1px] bg-background"}),g.jsx(TH,{availableProviders:u,selectedProvider:ce,lockedProviders:mt,disabled:lt,providerLocked:it,model:Ve.model,modelOptions:Ve.modelOptions,onProviderChange:pe=>{it||H(pe)},onModelChange:(pe,de)=>{if(it){tt(Oe=>({...Oe??Io(ce,L,W),model:de}));return}V(de)},onClaudeReasoningEffortChange:pe=>Ie(pe),onClaudeContextWindowChange:pe=>gt(pe),onCodexReasoningEffortChange:pe=>Ie(pe),onGeminiThinkingModeChange:pe=>Qe(pe),onCodexFastModeChange:pe=>{if(it){tt(de=>{const Oe=de??Io(ce,L,W);return Oe.provider!=="codex"?Oe:{...Oe,modelOptions:{...Oe.modelOptions,fastMode:pe}}});return}F({fastMode:pe})},planMode:Ve.planMode,onPlanModeChange:Wt,pendingPlanMode:S,includePlanMode:Tt,className:"w-full relative z-10"}),Je?g.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No active providers are available. Re-enable one in Settings."}):null]})]})})}),QK=_.memo(XK);function YE(t){const e=ke.c(17),{label:n,isCurrent:r,icon:i,onClick:s,className:a}=t;let c;e[0]!==a?(c=Ce("w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left text-sm transition-colors hover:bg-muted",a),e[0]=a,e[1]=c):c=e[1];let d;e[2]!==i||e[3]!==r?(d=i??(r?g.jsx(di,{className:"h-3.5 w-3.5 text-muted-foreground"}):null),e[2]=i,e[3]=r,e[4]=d):d=e[4];let u;e[5]!==d?(u=g.jsx("span",{className:"flex-shrink-0 w-4 flex items-center justify-center",children:d}),e[5]=d,e[6]=u):u=e[6];let f;e[7]!==n?(f=g.jsx("span",{className:"flex-1 min-w-0 truncate",children:n}),e[7]=n,e[8]=f):f=e[8];let m;e[9]!==r?(m=r&&g.jsx("span",{className:"flex-shrink-0 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full border border-border",children:"current"}),e[9]=r,e[10]=m):m=e[10];let v;return e[11]!==s||e[12]!==c||e[13]!==u||e[14]!==f||e[15]!==m?(v=g.jsxs("button",{onClick:s,className:c,children:[u,f,m]}),e[11]=s,e[12]=c,e[13]=u,e[14]=f,e[15]=m,e[16]=v):v=e[16],v}function ZK(t){const e=ke.c(98),{projectId:n,socket:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={phase:"loading"},e[0]=i):i=e[0];const[s,a]=_.useState(i),[c,d]=_.useState(!1),[u,f]=_.useState(""),m=_.useDeferredValue(u),[v,b]=_.useTransition(),S=_.useRef(null);let x;e[1]!==n||e[2]!==r?(x=async()=>{try{const J=await r.command({type:"git.getBranches",projectId:n});if(!J.isRepo){a({phase:"not-a-repo"});return}a({phase:"ready",currentBranch:J.currentBranch,branches:J.branches})}catch(J){const re=J;a({phase:"error",message:re instanceof Error?re.message:String(re)})}},e[1]=n,e[2]=r,e[3]=x):x=e[3];const C=x;let k,E;e[4]!==C?(k=()=>{C()},E=[C],e[4]=C,e[5]=k,e[6]=E):(k=e[5],E=e[6]),_.useEffect(k,E);let R,M;e[7]!==C||e[8]!==c?(R=()=>{c&&(f(""),C())},M=[c,C],e[7]=C,e[8]=c,e[9]=R,e[10]=M):(R=e[9],M=e[10]),_.useEffect(R,M);let O,D;e[11]!==s.phase||e[12]!==c?(O=()=>{if(c&&s.phase==="ready"){const J=setTimeout(()=>{var re;return(re=S.current)==null?void 0:re.focus()},50);return()=>clearTimeout(J)}},D=[c,s.phase],e[11]=s.phase,e[12]=c,e[13]=O,e[14]=D):(O=e[13],D=e[14]),_.useEffect(O,D);let P;e[15]!==C||e[16]!==s.currentBranch||e[17]!==s.phase||e[18]!==n||e[19]!==r?(P=function(re){s.phase!=="ready"||re===s.currentBranch||(d(!1),b(async()=>{try{await r.command({type:"git.switchBranch",projectId:n,branchName:re}),await C()}catch(ae){const ue=ae;a({phase:"error",message:ue instanceof Error?ue.message:String(ue)})}}))},e[15]=C,e[16]=s.currentBranch,e[17]=s.phase,e[18]=n,e[19]=r,e[20]=P):P=e[20];const z=P;let Y;e[21]!==C||e[22]!==n||e[23]!==r?(Y=function(re){re.trim()&&(d(!1),b(async()=>{try{await r.command({type:"git.createBranch",projectId:n,branchName:re.trim(),checkout:!0}),await C()}catch(ae){const ue=ae;a({phase:"error",message:ue instanceof Error?ue.message:String(ue)})}}))},e[21]=C,e[22]=n,e[23]=r,e[24]=Y):Y=e[24];const L=Y;if(s.phase==="not-a-repo")return null;let W,V,F,U,H,j,G,B,K,A,I,$;if(e[25]!==m||e[26]!==L||e[27]!==z||e[28]!==v||e[29]!==s.branches||e[30]!==s.currentBranch||e[31]!==s.message||e[32]!==s.phase||e[33]!==c||e[34]!==u){const J=s.phase==="ready"?s.branches.filter(xe=>xe.toLowerCase().includes(m.toLowerCase())):[];let re;e[47]!==m||e[48]!==s.branches||e[49]!==s.phase?(re=s.phase==="ready"&&s.branches.some(xe=>xe===m.trim()),e[47]=m,e[48]=s.branches,e[49]=s.phase,e[50]=re):re=e[50];const ae=re;let ue;e[51]!==m||e[52]!==ae?(ue=m.trim().length>0&&!ae,e[51]=m,e[52]=ae,e[53]=ue):ue=e[53];const me=ue;V=Qy,A=c,I=d;const se=s.phase==="error"&&"text-destructive";let oe;e[54]!==se?(oe=Ce("h-10 w-auto max-w-[180px] gap-1.5 rounded-lg border border-border/0 px-3 text-sm text-muted-foreground",se),e[54]=se,e[55]=oe):oe=e[55];let ee;e[56]!==v?(ee=v?g.jsx(Fn,{className:"h-4.5 w-4.5 flex-shrink-0 animate-spin"}):g.jsx(S8,{className:"h-4.5 w-4.5 flex-shrink-0"}),e[56]=v,e[57]=ee):ee=e[57];let Q;e[58]!==s.currentBranch||e[59]!==s.phase?(Q=s.phase==="ready"&&g.jsx("span",{className:"truncate",children:s.currentBranch??"HEAD detached"}),e[58]=s.currentBranch,e[59]=s.phase,e[60]=Q):Q=e[60];let te;e[61]!==s.phase?(te=s.phase==="error"&&g.jsx("span",{className:"truncate",children:"git error"}),e[61]=s.phase,e[62]=te):te=e[62],e[63]!==oe||e[64]!==ee||e[65]!==Q||e[66]!==te?($=g.jsx(Zy,{asChild:!0,children:g.jsxs(vt,{variant:"ghost",size:"icon",className:oe,children:[ee,Q,te]})}),e[63]=oe,e[64]=ee,e[65]=Q,e[66]=te,e[67]=$):$=e[67],W=kg,G="end",B="w-64 p-0 overflow-hidden";let he;e[68]===Symbol.for("react.memo_cache_sentinel")?(he=xe=>f(xe.target.value),e[68]=he):he=e[68];let ie;e[69]!==L||e[70]!==u||e[71]!==me?(ie=xe=>{xe.key==="Enter"&&me&&L(u)},e[69]=L,e[70]=u,e[71]=me,e[72]=ie):ie=e[72],e[73]!==u||e[74]!==ie?(K=g.jsx("div",{className:"border-b border-border",children:g.jsx("input",{ref:S,value:u,onChange:he,placeholder:"Search or create branch...",className:"w-full px-3 py-2 text-sm bg-transparent outline-none placeholder:text-muted-foreground",onKeyDown:ie})}),e[73]=u,e[74]=ie,e[75]=K):K=e[75],F="max-h-[220px] overflow-y-auto p-1",e[76]!==s.phase?(U=s.phase==="loading"&&g.jsx("div",{className:"flex items-center justify-center py-6 text-muted-foreground",children:g.jsx(Fn,{className:"h-4 w-4 animate-spin"})}),e[76]=s.phase,e[77]=U):U=e[77],e[78]!==s.message||e[79]!==s.phase?(H=s.phase==="error"&&g.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:s.message}),e[78]=s.message,e[79]=s.phase,e[80]=H):H=e[80],j=s.phase==="ready"&&g.jsxs(g.Fragment,{children:[J.length===0&&!me&&g.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No branches match"}),J.map(xe=>g.jsx(YE,{label:xe,isCurrent:xe===s.currentBranch,onClick:()=>z(xe)},xe)),me&&g.jsx(YE,{label:`Create branch "${m.trim()}"`,icon:g.jsx(yy,{className:"h-3.5 w-3.5 text-muted-foreground"}),onClick:()=>L(u),className:"text-muted-foreground border-t border-border/50 mt-1 pt-2 rounded-none"})]}),e[25]=m,e[26]=L,e[27]=z,e[28]=v,e[29]=s.branches,e[30]=s.currentBranch,e[31]=s.message,e[32]=s.phase,e[33]=c,e[34]=u,e[35]=W,e[36]=V,e[37]=F,e[38]=U,e[39]=H,e[40]=j,e[41]=G,e[42]=B,e[43]=K,e[44]=A,e[45]=I,e[46]=$}else W=e[35],V=e[36],F=e[37],U=e[38],H=e[39],j=e[40],G=e[41],B=e[42],K=e[43],A=e[44],I=e[45],$=e[46];let T;e[81]!==F||e[82]!==U||e[83]!==H||e[84]!==j?(T=g.jsxs("div",{className:F,children:[U,H,j]}),e[81]=F,e[82]=U,e[83]=H,e[84]=j,e[85]=T):T=e[85];let X;e[86]!==W||e[87]!==G||e[88]!==B||e[89]!==K||e[90]!==T?(X=g.jsxs(W,{align:G,className:B,children:[K,T]}),e[86]=W,e[87]=G,e[88]=B,e[89]=K,e[90]=T,e[91]=X):X=e[91];let Z;return e[92]!==V||e[93]!==A||e[94]!==I||e[95]!==$||e[96]!==X?(Z=g.jsxs(V,{open:A,onOpenChange:I,children:[$,X]}),e[92]=V,e[93]=A,e[94]=I,e[95]=$,e[96]=X,e[97]=Z):Z=e[97],Z}const bN=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("bg-card text-card-foreground",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx("div",{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});bN.displayName="Card";const _N=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("flex flex-col space-y-1.5 p-2",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx("div",{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});_N.displayName="CardHeader";const JK=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("text-2xl font-semibold leading-none tracking-tight",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx("h3",{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});JK.displayName="CardTitle";const eG=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx("p",{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});eG.displayName="CardDescription";const yN=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx("div",{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});yN.displayName="CardContent";const tG=_.forwardRef((t,e)=>{const n=ke.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let s;n[3]!==r?(s=Ce("flex items-center p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==i||n[6]!==e||n[7]!==s?(a=g.jsx("div",{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a});tG.displayName="CardFooter";function nG(t){const e=ke.c(50),{sidebarCollapsed:n,hasCompletedChats:r,onOpenSidebar:i,onExpandSidebar:s,usage:a,localPath:c,embeddedTerminalVisible:d,onToggleEmbeddedTerminal:u,rightSidebarVisible:f,onToggleRightSidebar:m,onOpenExternal:v,editorLabel:b,projectId:S,socket:x,finderShortcut:C,editorShortcut:k,terminalShortcut:E,rightSidebarShortcut:R}=t,M=r===void 0?!1:r,O=d===void 0?!1:d,D=f===void 0?!1:f,P=b===void 0?"Editor":b,z=rG,Y=a!=null&&a.warnings.includes("context_critical")||a!=null&&a.warnings.includes("rate_critical")?"text-amber-300 bg-amber-500/10":a!=null&&a.warnings.includes("context_warning")||a!=null&&a.warnings.includes("rate_warning")?"text-amber-100 bg-amber-500/5":"text-muted-foreground bg-background/70",L=n?"md:px-2.5 md:pr-4":"md:px-4 md:pr-4";let W;e[0]!==L?(W=Ce("absolute top-0 md:top-2 left-0 right-0 z-10 px-2.5 border-border/0 md:pb-0 flex items-center justify-center",L," bg-gradient-to-b from-background"),e[0]=L,e[1]=W):W=e[1];const V=!n&&"md:bg-transparent md:dark:bg-transparent md:backdrop-blur-none md:border-transparent md:p-0";let F;e[2]!==V?(F=Ce("flex items-center gap-1 flex-shrink-0","bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1",V),e[2]=V,e[3]=F):F=e[3];let U;e[4]===Symbol.for("react.memo_cache_sentinel")?(U=g.jsx(w1,{className:"h-5 w-5"}),e[4]=U):U=e[4];let H;e[5]!==M?(H=M&&g.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"}),e[5]=M,e[6]=H):H=e[6];let j;e[7]!==i||e[8]!==H?(j=g.jsxs(vt,{variant:"ghost",size:"icon",className:"relative md:hidden",onClick:i,children:[U,H]}),e[7]=i,e[8]=H,e[9]=j):j=e[9];let G;e[10]!==M||e[11]!==s||e[12]!==n?(G=n&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"relative flex items-center justify-center w-[40px] h-[40px]",children:[g.jsx(sh,{className:"h-4 w-4 sm:h-5 sm:w-5 ml-1 hidden md:block"}),M&&g.jsx("span",{className:"absolute top-1.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background hidden md:block"})]}),g.jsx(vt,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:s,title:"Expand sidebar",children:g.jsx(C1,{className:"size-4.5"})})]}),e[10]=M,e[11]=s,e[12]=n,e[13]=G):G=e[13];let B;e[14]!==j||e[15]!==G||e[16]!==F?(B=g.jsxs("div",{className:F,children:[j,G]}),e[14]=j,e[15]=G,e[16]=F,e[17]=B):B=e[17];let K;e[18]===Symbol.for("react.memo_cache_sentinel")?(K=g.jsx("div",{className:"flex-1 min-w-0"}),e[18]=K):K=e[18];let A;e[19]!==S||e[20]!==a||e[21]!==Y?(A=S?g.jsxs("div",{className:"hidden md:flex items-center gap-1 mr-1",children:[g.jsxs(zo,{children:[(a==null?void 0:a.contextUsedPercent)!==null&&(a==null?void 0:a.contextUsedPercent)!==void 0?g.jsx(Bo,{asChild:!0,children:g.jsxs("div",{className:Ce("px-2.5 py-1 rounded-lg text-[14px] font-medium",Y),children:["Context: ",z(a.contextUsedPercent)]})}):null,g.jsx(Fo,{side:"bottom",children:(a==null?void 0:a.contextWindowTokens)!==null&&(a==null?void 0:a.contextWindowTokens)!==void 0&&(a==null?void 0:a.threadTokens)!==null&&(a==null?void 0:a.threadTokens)!==void 0?`${Math.round(a.threadTokens).toLocaleString()} of ${Math.round(a.contextWindowTokens).toLocaleString()} tokens`:"Context window unavailable for this chat yet"})]}),((a==null?void 0:a.sessionLimitUsedPercent)??0)>=75?g.jsxs(zo,{children:[g.jsx(Bo,{asChild:!0,children:g.jsxs("div",{className:Ce("px-2.5 py-1 rounded-lg border text-[11px] font-medium",Y),children:["Session: ",z(a==null?void 0:a.sessionLimitUsedPercent)]})}),g.jsx(Fo,{side:"bottom",children:a!=null&&a.rateLimitResetAt?`Resets ${new Date(a.rateLimitResetAt).toLocaleString()}`:"No reset time available yet"})]}):null]}):null,e[19]=S,e[20]=a,e[21]=Y,e[22]=A):A=e[22];let I;e[23]!==S||e[24]!==x?(I=S?g.jsx(ZK,{projectId:S,socket:x}):null,e[23]=S,e[24]=x,e[25]=I):I=e[25];let $;e[26]!==P||e[27]!==k||e[28]!==O||e[29]!==C||e[30]!==c||e[31]!==v||e[32]!==u||e[33]!==E?($=c&&(v||u)&&g.jsxs(g.Fragment,{children:[v?g.jsxs(Gd,{children:[g.jsx(Yd,{asChild:!0,children:g.jsx(vt,{variant:"ghost",size:"icon",onClick:()=>v("open_finder"),title:"Open in Finder",className:"border border-border/0",children:g.jsx(b8,{className:"h-4.5 w-4.5"})})}),g.jsx(Fl,{side:"bottom",shortcut:C})]}):null,u?g.jsxs(Gd,{children:[g.jsx(Yd,{asChild:!0,children:g.jsx(vt,{variant:"ghost",size:"icon",onClick:u,className:Ce("border border-border/0",O&&"text-white"),children:g.jsx(n4,{className:"h-4.5 w-4.5"})})}),g.jsx(Fl,{side:"bottom",shortcut:E})]}):null,v?g.jsxs(Gd,{children:[g.jsx(Yd,{asChild:!0,children:g.jsx(vt,{variant:"ghost",size:"icon",onClick:()=>v("open_editor"),title:`Open in ${P}`,className:"border border-border/0",children:g.jsx(JP,{className:"h-4.5 w-4.5"})})}),g.jsx(Fl,{side:"bottom",shortcut:k})]}):null]}),e[26]=P,e[27]=k,e[28]=O,e[29]=C,e[30]=c,e[31]=v,e[32]=u,e[33]=E,e[34]=$):$=e[34];let T;e[35]!==m||e[36]!==R||e[37]!==D?(T=m?g.jsxs(Gd,{children:[g.jsx(Yd,{asChild:!0,children:g.jsx(vt,{variant:"ghost",size:"icon",onClick:m,className:Ce("border border-border/0",D&&"text-white"),children:g.jsx($8,{className:"h-4.5 w-4.5"})})}),g.jsx(Fl,{side:"bottom",shortcut:R})]}):null,e[35]=m,e[36]=R,e[37]=D,e[38]=T):T=e[38];let X;e[39]!==A||e[40]!==I||e[41]!==$||e[42]!==T?(X=g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1",children:[A,I,$,T]}),e[39]=A,e[40]=I,e[41]=$,e[42]=T,e[43]=X):X=e[43];let Z;e[44]!==B||e[45]!==X?(Z=g.jsxs("div",{className:"relative flex items-center gap-2 w-full",children:[B,K,X]}),e[44]=B,e[45]=X,e[46]=Z):Z=e[46];let J;return e[47]!==Z||e[48]!==W?(J=g.jsx(_N,{className:W,children:Z}),e[47]=Z,e[48]=W,e[49]=J):J=e[49],J}function rG(t){return t==null?"Unavailable":`${Math.round(t)}%`}function XE(t){const e=ke.c(12),{onClose:n,className:r}=t;let i;e[0]!==r?(i=Ce("h-full min-h-0 bg-background md:min-w-[300px] md:border-l md:border-border",r),e[0]=r,e[1]=i):i=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=g.jsx("div",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:"Diffs"}),e[2]=s):s=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(is,{className:"h-4 w-4"}),e[3]=a):a=e[3];let c;e[4]!==n?(c=g.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[s,g.jsx("button",{type:"button","aria-label":"Close right sidebar",onClick:n,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:a})]}),e[4]=n,e[5]=c):c=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=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"})}),e[6]=d):d=e[6];let u;e[7]!==c?(u=g.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[c,d]}),e[7]=c,e[8]=u):u=e[8];let f;return e[9]!==i||e[10]!==u?(f=g.jsx("div",{className:i,children:u}),e[9]=i,e[10]=u,e[11]=f):f=e[11],f}function iG(t,e){const n=getComputedStyle(t),r=parseFloat(n.fontSize);return e*r}function sG(t,e){const n=getComputedStyle(t.ownerDocument.body),r=parseFloat(n.fontSize);return e*r}function oG(t){return t/100*window.innerHeight}function aG(t){return t/100*window.innerWidth}function lG(t){switch(typeof t){case"number":return[t,"px"];case"string":{const e=parseFloat(t);return t.endsWith("%")?[e,"%"]:t.endsWith("px")?[e,"px"]:t.endsWith("rem")?[e,"rem"]:t.endsWith("em")?[e,"em"]:t.endsWith("vh")?[e,"vh"]:t.endsWith("vw")?[e,"vw"]:[e,"%"]}}}function Jd({groupSize:t,panelElement:e,styleProp:n}){let r;const[i,s]=lG(n);switch(s){case"%":{r=i/100*t;break}case"px":{r=i;break}case"rem":{r=sG(e,i);break}case"em":{r=iG(e,i);break}case"vh":{r=oG(i);break}case"vw":{r=aG(i);break}}return r}function ui(t){return parseFloat(t.toFixed(3))}function Cu({group:t}){const{orientation:e,panels:n}=t;return n.reduce((r,i)=>(r+=e==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function d_(t){const{panels:e}=t,n=Cu({group:t});return n===0?e.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})):e.map(r=>{const{element:i,panelConstraints:s}=r;let a=0;if(s.collapsedSize!==void 0){const f=Jd({groupSize:n,panelElement:i,styleProp:s.collapsedSize});a=ui(f/n*100)}let c;if(s.defaultSize!==void 0){const f=Jd({groupSize:n,panelElement:i,styleProp:s.defaultSize});c=ui(f/n*100)}let d=0;if(s.minSize!==void 0){const f=Jd({groupSize:n,panelElement:i,styleProp:s.minSize});d=ui(f/n*100)}let u=100;if(s.maxSize!==void 0){const f=Jd({groupSize:n,panelElement:i,styleProp:s.maxSize});u=ui(f/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:a,collapsible:s.collapsible===!0,defaultSize:c,disabled:s.disabled,minSize:d,maxSize:u,panelId:r.id}})}function ln(t,e="Assertion error"){if(!t)throw Error(e)}function h_(t,e){return Array.from(e).sort(t==="horizontal"?cG:uG)}function cG(t,e){const n=t.element.offsetLeft-e.element.offsetLeft;return n!==0?n:t.element.offsetWidth-e.element.offsetWidth}function uG(t,e){const n=t.element.offsetTop-e.element.offsetTop;return n!==0?n:t.element.offsetHeight-e.element.offsetHeight}function xN(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}function SN(t,e){return{x:t.x>=e.left&&t.x<=e.right?0:Math.min(Math.abs(t.x-e.left),Math.abs(t.x-e.right)),y:t.y>=e.top&&t.y<=e.bottom?0:Math.min(Math.abs(t.y-e.top),Math.abs(t.y-e.bottom))}}function dG({orientation:t,rects:e,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let i,s=Number.MAX_VALUE;for(const a of e){const{x:c,y:d}=SN(r,a),u=t==="horizontal"?c:d;u<s&&(s=u,i=a)}return ln(i,"No rect found"),i}let km;function hG(){return km===void 0&&(typeof matchMedia=="function"?km=!!matchMedia("(pointer:coarse)").matches:km=!1),km}function wN(t){const{element:e,orientation:n,panels:r,separators:i}=t,s=h_(n,Array.from(e.children).filter(xN).map(S=>({element:S}))).map(({element:S})=>S),a=[];let c=!1,d=!1,u=-1,f=-1,m=0,v,b=[];{let S=-1;for(const x of s)x.hasAttribute("data-panel")&&(S++,x.hasAttribute("data-disabled")||(m++,u===-1&&(u=S),f=S))}if(m>1){let S=-1;for(const x of s)if(x.hasAttribute("data-panel")){S++;const C=r.find(k=>k.element===x);if(C){if(v){const k=v.element.getBoundingClientRect(),E=x.getBoundingClientRect();let R;if(d){const M=n==="horizontal"?new DOMRect(k.right,k.top,0,k.height):new DOMRect(k.left,k.bottom,k.width,0),O=n==="horizontal"?new DOMRect(E.left,E.top,0,E.height):new DOMRect(E.left,E.top,E.width,0);switch(b.length){case 0:{R=[M,O];break}case 1:{const D=b[0],P=dG({orientation:n,rects:[k,E],targetRect:D.element.getBoundingClientRect()});R=[D,P===k?O:M];break}default:{R=b;break}}}else b.length?R=b:R=[n==="horizontal"?new DOMRect(k.right,E.top,E.left-k.right,E.height):new DOMRect(E.left,k.bottom,E.width,E.top-k.bottom)];for(const M of R){let O="width"in M?M:M.element.getBoundingClientRect();const D=hG()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine;if(O.width<D){const z=D-O.width;O=new DOMRect(O.x-z/2,O.y,O.width+z,O.height)}if(O.height<D){const z=D-O.height;O=new DOMRect(O.x,O.y-z/2,O.width,O.height+z)}const P=S<=u||S>f;!c&&!P&&a.push({group:t,groupSize:Cu({group:t}),panels:[v,C],separator:"width"in M?void 0:M,rect:O}),c=!1}}d=!1,v=C,b=[]}}else if(x.hasAttribute("data-separator")){x.ariaDisabled!==null&&(c=!0);const C=i.find(k=>k.element===x);C?b.push(C):(v=void 0,b=[])}else d=!0}return a}var Xa,yR;let CN=(yR=class{constructor(){HC(this,Xa,{})}addListener(e,n){const r=Ad(this,Xa)[e];return r===void 0?Ad(this,Xa)[e]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(e,n)}}emit(e,n){const r=Ad(this,Xa)[e];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let i=!1,s=null;const a=Array.from(r);for(let c=0;c<a.length;c++){const d=a[c];try{d.call(null,n)}catch(u){s===null&&(i=!0,s=u)}}if(i)throw s}}removeAllListeners(){$C(this,Xa,{})}removeListener(e,n){const r=Ad(this,Xa)[e];if(r!==void 0){const i=r.indexOf(n);i>=0&&r.splice(i,1)}}},Xa=new WeakMap,yR),Xs=new Map;const kN=new CN;function fG(t){Xs=new Map(Xs),Xs.delete(t)}function QE(t,e){for(const[n]of Xs)if(n.id===t)return n}function Ja(t,e){for(const[n,r]of Xs)if(n.id===t)return r;if(e)throw Error(`Could not find data for Group with id ${t}`)}function oc(){return Xs}function Tx(t,e){return kN.addListener("groupChange",n=>{n.group.id===t&&e(n)})}function Go(t,e){const n=Xs.get(t);Xs=new Map(Xs),Xs.set(t,e),kN.emit("groupChange",{group:t,prev:n,next:e})}function mG(t,e,n){let r,i={x:1/0,y:1/0};for(const s of e){const a=SN(n,s.rect);switch(t){case"horizontal":{a.x<=i.x&&(r=s,i=a);break}case"vertical":{a.y<=i.y&&(r=s,i=a);break}}}return r?{distance:i,hitRegion:r}:void 0}function pG(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function gG(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:e5(t),b:e5(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();ln(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:JE(ZE(n.a)),b:JE(ZE(n.b))};if(i.a===i.b){const s=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let c=s.length;for(;c--;){const d=s[c];if(d===a.a)return 1;if(d===a.b)return-1}}return Math.sign(i.a-i.b)}const vG=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function bG(t){const e=getComputedStyle(EN(t)??t).display;return e==="flex"||e==="inline-flex"}function _G(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||bG(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||vG.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function ZE(t){let e=t.length;for(;e--;){const n=t[e];if(ln(n,"Missing node"),_G(n))return n}return null}function JE(t){return t&&Number(getComputedStyle(t).zIndex)||0}function e5(t){const e=[];for(;t;)e.push(t),t=EN(t);return e}function EN(t){const{parentNode:e}=t;return pG(e)?e.host:e}function yG(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function xG({groupElement:t,hitRegion:e,pointerEventTarget:n}){if(!xN(n)||n.contains(t)||t.contains(n))return!0;if(gG(n,t)>0){let r=n;for(;r;){if(r.contains(t))return!0;if(yG(r.getBoundingClientRect(),e))return!1;r=r.parentElement}}return!0}function Mx(t,e){const n=[];return e.forEach((r,i)=>{if(i.disabled)return;const s=wN(i),a=mG(i.orientation,s,{x:t.clientX,y:t.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&xG({groupElement:i.element,hitRegion:a.hitRegion.rect,pointerEventTarget:t.target})&&n.push(a.hitRegion)}),n}function SG(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function Vr(t,e,n=0){return Math.abs(ui(t)-ui(e))<=n}function Ks(t,e){return Vr(t,e)?0:t>e?1:-1}function iu({overrideDisabledPanels:t,panelConstraints:e,prevSize:n,size:r}){const{collapsedSize:i=0,collapsible:s,disabled:a,maxSize:c=100,minSize:d=0}=e;if(a&&!t)return n;if(Ks(r,d)<0)if(s){const u=(i+d)/2;Ks(r,u)<0?r=i:r=d}else r=d;return r=Math.min(c,r),r=ui(r),r}function Ch({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(Vr(t,0))return e;const a=s==="imperative-api",c=Object.values(e),d=Object.values(i),u=[...c],[f,m]=r;ln(f!=null,"Invalid first pivot index"),ln(m!=null,"Invalid second pivot index");let v=0;switch(s){case"keyboard":{{const x=t<0?m:f,C=n[x];ln(C,`Panel constraints not found for index ${x}`);const{collapsedSize:k=0,collapsible:E,minSize:R=0}=C;if(E){const M=c[x];if(ln(M!=null,`Previous layout not found for panel index ${x}`),Vr(M,k)){const O=R-M;Ks(O,Math.abs(t))>0&&(t=t<0?0-O:O)}}}{const x=t<0?f:m,C=n[x];ln(C,`No panel constraints found for index ${x}`);const{collapsedSize:k=0,collapsible:E,minSize:R=0}=C;if(E){const M=c[x];if(ln(M!=null,`Previous layout not found for panel index ${x}`),Vr(M,R)){const O=M-k;Ks(O,Math.abs(t))>0&&(t=t<0?0-O:O)}}}break}default:{const x=t<0?m:f,C=n[x];ln(C,`Panel constraints not found for index ${x}`);const k=c[x],{collapsible:E,collapsedSize:R,minSize:M}=C;if(E&&Ks(k,M)<0)if(t>0){const O=M-R,D=O/2,P=k+t;Ks(P,M)<0&&(t=Ks(t,D)<=0?0:O)}else{const O=M-R,D=100-O/2,P=k-t;Ks(P,M)<0&&(t=Ks(100+t,D)>0?0:-O)}break}}{const x=t<0?1:-1;let C=t<0?m:f,k=0;for(;;){const R=c[C];ln(R!=null,`Previous layout not found for panel index ${C}`);const M=iu({overrideDisabledPanels:a,panelConstraints:n[C],prevSize:R,size:100})-R;if(k+=M,C+=x,C<0||C>=n.length)break}const E=Math.min(Math.abs(t),Math.abs(k));t=t<0?0-E:E}{let x=t<0?f:m;for(;x>=0&&x<n.length;){const C=Math.abs(t)-Math.abs(v),k=c[x];ln(k!=null,`Previous layout not found for panel index ${x}`);const E=k-C,R=iu({overrideDisabledPanels:a,panelConstraints:n[x],prevSize:k,size:E});if(!Vr(k,R)&&(v+=k-R,u[x]=R,v.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?x--:x++}}if(SG(d,u))return i;{const x=t<0?m:f,C=c[x];ln(C!=null,`Previous layout not found for panel index ${x}`);const k=C+v,E=iu({overrideDisabledPanels:a,panelConstraints:n[x],prevSize:C,size:k});if(u[x]=E,!Vr(E,k)){let R=k-E,M=t<0?m:f;for(;M>=0&&M<n.length;){const O=u[M];ln(O!=null,`Previous layout not found for panel index ${M}`);const D=O+R,P=iu({overrideDisabledPanels:a,panelConstraints:n[M],prevSize:O,size:D});if(Vr(O,P)||(R-=P-O,u[M]=P),Vr(R,0))break;t>0?M--:M++}}}const b=Object.values(u).reduce((x,C)=>C+x,0);if(!Vr(b,100,.1))return i;const S=Object.keys(i);return u.reduce((x,C,k)=>(x[S[k]]=C,x),{})}function Yl(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(e[n]===void 0||Ks(t[n],e[n])!==0)return!1;return!0}function Xl({layout:t,panelConstraints:e}){const n=Object.values(t),r=[...n],i=r.reduce((c,d)=>c+d,0);if(r.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${r.map(c=>`${c}%`).join(", ")}`);if(!Vr(i,100)&&r.length>0)for(let c=0;c<e.length;c++){const d=r[c];ln(d!=null,`No layout data found for index ${c}`);const u=100/i*d;r[c]=u}let s=0;for(let c=0;c<e.length;c++){const d=n[c];ln(d!=null,`No layout data found for index ${c}`);const u=r[c];ln(u!=null,`No layout data found for index ${c}`);const f=iu({overrideDisabledPanels:!0,panelConstraints:e[c],prevSize:d,size:u});u!=f&&(s+=u-f,r[c]=f)}if(!Vr(s,0))for(let c=0;c<e.length;c++){const d=r[c];ln(d!=null,`No layout data found for index ${c}`);const u=d+s,f=iu({overrideDisabledPanels:!0,panelConstraints:e[c],prevSize:d,size:u});if(d!==f&&(s-=f-d,r[c]=f,Vr(s,0)))break}const a=Object.keys(t);return r.reduce((c,d,u)=>(c[a[u]]=d,c),{})}function RN({groupId:t,panelId:e}){const n=()=>{const c=oc();for(const[d,{defaultLayoutDeferred:u,derivedPanelConstraints:f,layout:m,groupSize:v,separatorToPanels:b}]of c)if(d.id===t)return{defaultLayoutDeferred:u,derivedPanelConstraints:f,group:d,groupSize:v,layout:m,separatorToPanels:b};throw Error(`Group ${t} not found`)},r=()=>{const c=n().derivedPanelConstraints.find(d=>d.panelId===e);if(c!==void 0)return c;throw Error(`Panel constraints not found for Panel ${e}`)},i=()=>{const c=n().group.panels.find(d=>d.id===e);if(c!==void 0)return c;throw Error(`Layout not found for Panel ${e}`)},s=()=>{const c=n().layout[e];if(c!==void 0)return c;throw Error(`Layout not found for Panel ${e}`)},a=c=>{const d=s();if(c===d)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:f,group:m,groupSize:v,layout:b,separatorToPanels:S}=n(),x=m.panels.findIndex(R=>R.id===e),C=x===m.panels.length-1,k=Ch({delta:C?d-c:c-d,initialLayout:b,panelConstraints:f,pivotIndices:C?[x-1,x]:[x,x+1],prevLayout:b,trigger:"imperative-api"}),E=Xl({layout:k,panelConstraints:f});Yl(b,E)||Go(m,{defaultLayoutDeferred:u,derivedPanelConstraints:f,groupSize:v,layout:E,separatorToPanels:S})};return{collapse:()=>{const{collapsible:c,collapsedSize:d}=r(),{mutableValues:u}=i(),f=s();c&&f!==d&&(u.expandToSize=f,a(d))},expand:()=>{const{collapsible:c,collapsedSize:d,minSize:u}=r(),{mutableValues:f}=i(),m=s();if(c&&m===d){let v=f.expandToSize??u;v===0&&(v=1),a(v)}},getSize:()=>{const{group:c}=n(),d=s(),{element:u}=i(),f=c.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:d,inPixels:f}},isCollapsed:()=>{const{collapsible:c,collapsedSize:d}=r(),u=s();return c&&Vr(d,u)},resize:c=>{const{group:d}=n(),{element:u}=i(),f=Cu({group:d}),m=Jd({groupSize:f,panelElement:u,styleProp:c}),v=ui(m/f*100);a(v)}}}function t5(t){if(t.defaultPrevented)return;const e=oc();Mx(t,e).forEach(n=>{if(n.separator){const r=n.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(r){const i=r.panelConstraints.defaultSize,s=RN({groupId:n.group.id,panelId:r.id});s&&i!==void 0&&(s.resize(i),t.preventDefault())}}})}function sp(t){const e=oc();for(const[n]of e)if(n.separators.some(r=>r.element===t))return n;throw Error("Could not find parent Group for separator element")}function TN({groupId:t}){const e=()=>{const n=oc();for(const[r,i]of n)if(r.id===t)return{group:r,...i};throw Error(`Could not find Group with id "${t}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=e();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:s,groupSize:a,layout:c,separatorToPanels:d}=e(),u=Xl({layout:n,panelConstraints:i});return r?c:(Yl(c,u)||Go(s,{defaultLayoutDeferred:r,derivedPanelConstraints:i,groupSize:a,layout:u,separatorToPanels:d}),u)}}}function Nl(t,e){const n=sp(t),r=Ja(n.id,!0),i=n.separators.find(f=>f.element===t);ln(i,"Matching separator not found");const s=r.separatorToPanels.get(i);ln(s,"Matching panels not found");const a=s.map(f=>n.panels.indexOf(f)),c=TN({groupId:n.id}).getLayout(),d=Ch({delta:e,initialLayout:c,panelConstraints:r.derivedPanelConstraints,pivotIndices:a,prevLayout:c,trigger:"keyboard"}),u=Xl({layout:d,panelConstraints:r.derivedPanelConstraints});Yl(c,u)||Go(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:u,separatorToPanels:r.separatorToPanels})}function n5(t){if(t.defaultPrevented)return;const e=t.currentTarget,n=sp(e);if(!n.disabled)switch(t.key){case"ArrowDown":{t.preventDefault(),n.orientation==="vertical"&&Nl(e,5);break}case"ArrowLeft":{t.preventDefault(),n.orientation==="horizontal"&&Nl(e,-5);break}case"ArrowRight":{t.preventDefault(),n.orientation==="horizontal"&&Nl(e,5);break}case"ArrowUp":{t.preventDefault(),n.orientation==="vertical"&&Nl(e,-5);break}case"End":{t.preventDefault(),Nl(e,100);break}case"Enter":{t.preventDefault();const r=sp(e),i=Ja(r.id,!0),{derivedPanelConstraints:s,layout:a,separatorToPanels:c}=i,d=r.separators.find(v=>v.element===e);ln(d,"Matching separator not found");const u=c.get(d);ln(u,"Matching panels not found");const f=u[0],m=s.find(v=>v.panelId===f.id);if(ln(m,"Panel metadata not found"),m.collapsible){const v=a[f.id],b=m.collapsedSize===v?r.mutableState.expandedPanelSizes[f.id]??m.minSize:m.collapsedSize;Nl(e,b-v)}break}case"F6":{t.preventDefault();const r=sp(e).separators.map(a=>a.element),i=Array.from(r).findIndex(a=>a===t.currentTarget);ln(i!==null,"Index not found");const s=t.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[s].focus({preventScroll:!0});break}case"Home":{t.preventDefault(),Nl(e,-100);break}}}let mu={cursorFlags:0,state:"inactive"};const Ax=new CN;function Ql(){return mu}function wG(t){return Ax.addListener("change",t)}function CG(t){const e=mu,n={...mu};n.cursorFlags=t,mu=n,Ax.emit("change",{prev:e,next:n})}function pu(t){const e=mu;mu=t,Ax.emit("change",{prev:e,next:t})}function r5(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const e=oc(),n=Mx(t,e),r=new Map;let i=!1;n.forEach(s=>{s.separator&&(i||(i=!0,s.separator.element.focus({preventScroll:!0})));const a=e.get(s.group);a&&r.set(s.group,a.layout)}),pu({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:t.clientX,y:t.clientY},state:"active"}),n.length&&t.preventDefault()}const kG=t=>t,Mb=()=>{},MN=1,AN=2,NN=4,DN=8,i5=3,s5=12;let Em;function o5(){return Em===void 0&&(Em=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Em=!0)),Em}function EG({cursorFlags:t,groups:e,state:n}){let r=0,i=0;switch(n){case"active":case"hover":e.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{i++;break}}})}if(!(r===0&&i===0)){switch(n){case"active":{if(t&&o5()){const s=(t&MN)!==0,a=(t&AN)!==0,c=(t&NN)!==0,d=(t&DN)!==0;if(s)return c?"se-resize":d?"ne-resize":"e-resize";if(a)return c?"sw-resize":d?"nw-resize":"w-resize";if(c)return"s-resize";if(d)return"n-resize"}break}}return o5()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const a5=new WeakMap;function Nx(t){if(t.defaultView===null||t.defaultView===void 0)return;let{prevStyle:e,styleSheet:n}=a5.get(t)??{};n===void 0&&(n=new t.defaultView.CSSStyleSheet,t.adoptedStyleSheets&&t.adoptedStyleSheets.push(n));const r=Ql();switch(r.state){case"active":case"hover":{const i=EG({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(a=>a.group),state:r.state}),s=`*, *:hover {cursor: ${i} !important; }`;if(e===s)return;e=s,i?n.cssRules.length===0?n.insertRule(s):n.replaceSync(s):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{e=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}a5.set(t,{prevStyle:e,styleSheet:n})}function ON({document:t,event:e,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:s,prevCursorFlags:a}){let c=0;n.forEach(u=>{const{group:f,groupSize:m}=u,{orientation:v,panels:b}=f,{disableCursor:S}=f.mutableState;let x=0;s?v==="horizontal"?x=(e.clientX-s.x)/m*100:x=(e.clientY-s.y)/m*100:v==="horizontal"?x=e.clientX<0?-100:100:x=e.clientY<0?-100:100;const C=r.get(f),k=i.get(f);if(!C||!k)return;const{defaultLayoutDeferred:E,derivedPanelConstraints:R,groupSize:M,layout:O,separatorToPanels:D}=k;if(R&&O&&D){const P=Ch({delta:x,initialLayout:C,panelConstraints:R,pivotIndices:u.panels.map(z=>b.indexOf(z)),prevLayout:O,trigger:"mouse-or-touch"});if(Yl(P,O)){if(x!==0&&!S)switch(v){case"horizontal":{c|=x<0?MN:AN;break}case"vertical":{c|=x<0?NN:DN;break}}}else Go(u.group,{defaultLayoutDeferred:E,derivedPanelConstraints:R,groupSize:M,layout:P,separatorToPanels:D})}});let d=0;e.movementX===0?d|=a&i5:d|=c&i5,e.movementY===0?d|=a&s5:d|=c&s5,CG(d),Nx(t)}function l5(t){const e=oc(),n=Ql();switch(n.state){case"active":ON({document:t.currentTarget,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:e,prevCursorFlags:n.cursorFlags})}}function c5(t){var r,i;if(t.defaultPrevented)return;const e=Ql(),n=oc();switch(e.state){case"active":{if(t.buttons===0){pu({cursorFlags:0,state:"inactive"}),e.hitRegions.forEach(s=>{const a=Ja(s.group.id,!0);Go(s.group,a)});return}for(const s of e.hitRegions)if(s.separator){const{element:a}=s.separator;(r=a.hasPointerCapture)!=null&&r.call(a,t.pointerId)||((i=a.setPointerCapture)==null||i.call(a,t.pointerId))}ON({document:t.currentTarget,event:t,hitRegions:e.hitRegions,initialLayoutMap:e.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:e.pointerDownAtPoint,prevCursorFlags:e.cursorFlags});break}default:{const s=Mx(t,n);s.length===0?e.state!=="inactive"&&pu({cursorFlags:0,state:"inactive"}):pu({cursorFlags:0,hitRegions:s,state:"hover"}),Nx(t.currentTarget);break}}}function u5(t){if(t.relatedTarget instanceof HTMLIFrameElement)switch(Ql().state){case"hover":pu({cursorFlags:0,state:"inactive"})}}function d5(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const e=Ql();switch(e.state){case"active":pu({cursorFlags:0,state:"inactive"}),e.hitRegions.length>0&&(Nx(t.currentTarget),e.hitRegions.forEach(n=>{const r=Ja(n.group.id,!0);Go(n.group,r)}),t.preventDefault())}}function h5(t){let e=0,n=0;const r={};for(const s of t)if(s.defaultSize!==void 0){e++;const a=ui(s.defaultSize);n+=a,r[s.panelId]=a}else r[s.panelId]=void 0;const i=t.length-e;if(i!==0){const s=ui((100-n)/i);for(const a of t)a.defaultSize===void 0&&(r[a.panelId]=s)}return r}function RG(t,e,n){if(!n[0])return;const r=t.panels.find(d=>d.element===e);if(!r||!r.onResize)return;const i=Cu({group:t}),s=t.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,a=r.mutableValues.prevSize,c={asPercentage:ui(s/i*100),inPixels:s};r.mutableValues.prevSize=c,r.onResize(c,r.id,a)}function TG(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function MG({group:t,nextGroupSize:e,prevGroupSize:n,prevLayout:r}){if(n<=0||e<=0||n===e)return r;let i=0,s=0,a=!1;const c=new Map,d=[];for(const m of t.panels){const v=r[m.id]??0;switch(m.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{a=!0;const b=v/100*n,S=ui(b/e*100);c.set(m.id,S),i+=S;break}case"preserve-relative-size":default:{d.push(m.id),s+=v;break}}}if(!a||d.length===0)return r;const u=100-i,f={...r};if(c.forEach((m,v)=>{f[v]=m}),s>0)for(const m of d){const v=r[m]??0;f[m]=ui(v/s*u)}else{const m=ui(u/d.length);for(const v of d)f[v]=m}return f}function AG(t,e){const n=t.map(i=>i.id),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i))return!1;return!0}const Yc=new Map;function NG(t){let e=!0;ln(t.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=t.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,s=new n(S=>{for(const x of S){const{borderBoxSize:C,target:k}=x;if(k===t.element){if(e){const E=Cu({group:t});if(E===0)return;const R=Ja(t.id);if(!R)return;const M=d_(t),O=R.defaultLayoutDeferred?h5(M):R.layout,D=MG({group:t,nextGroupSize:E,prevGroupSize:R.groupSize,prevLayout:O}),P=Xl({layout:D,panelConstraints:M});if(!R.defaultLayoutDeferred&&Yl(R.layout,P)&&TG(R.derivedPanelConstraints,M)&&R.groupSize===E)return;Go(t,{defaultLayoutDeferred:!1,derivedPanelConstraints:M,groupSize:E,layout:P,separatorToPanels:R.separatorToPanels})}}else RG(t,k,C)}});s.observe(t.element),t.panels.forEach(S=>{ln(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&s.observe(S.element)});const a=Cu({group:t}),c=d_(t),d=t.panels.map(({id:S})=>S).join(",");let u=t.mutableState.defaultLayout;u&&(AG(t.panels,u)||(u=void 0));const f=t.mutableState.layouts[d]??u??h5(c),m=Xl({layout:f,panelConstraints:c}),v=t.element.ownerDocument;Yc.set(v,(Yc.get(v)??0)+1);const b=new Map;return wN(t).forEach(S=>{S.separator&&b.set(S.separator,S.panels)}),Go(t,{defaultLayoutDeferred:a===0,derivedPanelConstraints:c,groupSize:a,layout:m,separatorToPanels:b}),t.separators.forEach(S=>{ln(!i.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),i.add(S.id),S.element.addEventListener("keydown",n5)}),Yc.get(v)===1&&(v.addEventListener("dblclick",t5,!0),v.addEventListener("pointerdown",r5,!0),v.addEventListener("pointerleave",l5),v.addEventListener("pointermove",c5),v.addEventListener("pointerout",u5),v.addEventListener("pointerup",d5,!0)),function(){e=!1,Yc.set(v,Math.max(0,(Yc.get(v)??0)-1)),fG(t),t.separators.forEach(S=>{S.element.removeEventListener("keydown",n5)}),Yc.get(v)||(v.removeEventListener("dblclick",t5,!0),v.removeEventListener("pointerdown",r5,!0),v.removeEventListener("pointerleave",l5),v.removeEventListener("pointermove",c5),v.removeEventListener("pointerout",u5),v.removeEventListener("pointerup",d5,!0)),s.disconnect()}}function DG(){const[t,e]=_.useState({}),n=_.useCallback(()=>e({}),[]);return[t,n]}function Dx(t){const e=_.useId();return`${t??e}`}const ac=typeof window<"u"?_.useLayoutEffect:_.useEffect;function ch(t){const e=_.useRef(t);return ac(()=>{e.current=t},[t]),_.useCallback((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[e])}function Ox(...t){return ch(e=>{t.forEach(n=>{if(n)switch(typeof n){case"function":{n(e);break}case"object":{n.current=e;break}}})})}function jx(t){const e=_.useRef({...t});return ac(()=>{for(const n in t)e.current[n]=t[n]},[t]),e.current}const jN=_.createContext(null);function OG(t,e){const n=_.useRef({getLayout:()=>({}),setLayout:kG});_.useImperativeHandle(e,()=>n.current,[]),ac(()=>{Object.assign(n.current,TN({groupId:t}))})}function LN({children:t,className:e,defaultLayout:n,disableCursor:r,disabled:i,elementRef:s,groupRef:a,id:c,onLayoutChange:d,onLayoutChanged:u,orientation:f="horizontal",resizeTargetMinimumSize:m={coarse:20,fine:10},style:v,...b}){const S=_.useRef({onLayoutChange:{},onLayoutChanged:{}}),x=ch(W=>{Yl(S.current.onLayoutChange,W)||(S.current.onLayoutChange=W,d==null||d(W))}),C=ch(W=>{Yl(S.current.onLayoutChanged,W)||(S.current.onLayoutChanged=W,u==null||u(W))}),k=Dx(c),E=_.useRef(null),[R,M]=DG(),O=_.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:m,separators:[]}),D=Ox(E,s);OG(k,a);const P=ch((W,V)=>{const F=Ql(),U=QE(W),H=Ja(W);if(H){let j=!1;switch(F.state){case"active":{j=F.hitRegions.some(G=>G.group===U);break}}return{flexGrow:H.layout[V]??1,pointerEvents:j?"none":void 0}}if(n!=null&&n[V])return{flexGrow:n==null?void 0:n[V]}}),z=jx({defaultLayout:n,disableCursor:r}),Y=_.useMemo(()=>({get disableCursor(){return!!z.disableCursor},getPanelStyles:P,id:k,orientation:f,registerPanel:W=>{const V=O.current;return V.panels=h_(f,[...V.panels,W]),M(),()=>{V.panels=V.panels.filter(F=>F!==W),M()}},registerSeparator:W=>{const V=O.current;return V.separators=h_(f,[...V.separators,W]),M(),()=>{V.separators=V.separators.filter(F=>F!==W),M()}},togglePanelDisabled:(W,V)=>{const F=O.current.panels.find(j=>j.id===W);F&&(F.panelConstraints.disabled=V);const U=QE(k),H=Ja(k);U&&H&&Go(U,{...H,derivedPanelConstraints:d_(U)})},toggleSeparatorDisabled:(W,V)=>{const F=O.current.separators.find(U=>U.id===W);F&&(F.disabled=V)}}),[P,k,M,f,z]),L=_.useRef(null);return ac(()=>{const W=E.current;if(W===null)return;const V=O.current;let F;if(z.defaultLayout!==void 0&&Object.keys(z.defaultLayout).length===V.panels.length){F={};for(const A of V.panels){const I=z.defaultLayout[A.id];I!==void 0&&(F[A.id]=I)}}const U={disabled:!!i,element:W,id:k,mutableState:{defaultLayout:F,disableCursor:!!z.disableCursor,expandedPanelSizes:O.current.lastExpandedPanelSizes,layouts:O.current.layouts},orientation:f,panels:V.panels,resizeTargetMinimumSize:V.resizeTargetMinimumSize,separators:V.separators};L.current=U;const H=NG(U),{defaultLayoutDeferred:j,derivedPanelConstraints:G,layout:B}=Ja(U.id,!0);!j&&G.length>0&&(x(B),C(B));const K=Tx(k,A=>{const{defaultLayoutDeferred:I,derivedPanelConstraints:$,layout:T}=A.next;if(I||$.length===0)return;const X=U.panels.map(({id:J})=>J).join(",");U.mutableState.layouts[X]=T,$.forEach(J=>{if(J.collapsible){const{layout:re}=A.prev??{};if(re){const ae=Vr(J.collapsedSize,T[J.panelId]),ue=Vr(J.collapsedSize,re[J.panelId]);ae&&!ue&&(U.mutableState.expandedPanelSizes[J.panelId]=re[J.panelId])}}});const Z=Ql().state!=="active";x(T),Z&&C(T)});return()=>{L.current=null,H(),K()}},[i,k,C,x,f,R,z]),_.useEffect(()=>{const W=L.current;W&&(W.mutableState.defaultLayout=n,W.mutableState.disableCursor=!!r)}),g.jsx(jN.Provider,{value:Y,children:g.jsx("div",{...b,className:e,"data-group":!0,"data-testid":k,id:k,ref:D,style:{height:"100%",width:"100%",overflow:"hidden",...v,display:"flex",flexDirection:f==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:f==="horizontal"?"pan-y":"pan-x"},children:t})})}LN.displayName="Group";function Lx(){const t=_.useContext(jN);return ln(t,"Group Context not found; did you render a Panel or Separator outside of a Group?"),t}function jG(t,e){const{id:n}=Lx(),r=_.useRef({collapse:Mb,expand:Mb,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Mb});_.useImperativeHandle(e,()=>r.current,[]),ac(()=>{Object.assign(r.current,RN({groupId:n,panelId:t}))})}function IN({children:t,className:e,collapsedSize:n="0%",collapsible:r=!1,defaultSize:i,disabled:s,elementRef:a,groupResizeBehavior:c="preserve-relative-size",id:d,maxSize:u="100%",minSize:f="0%",onResize:m,panelRef:v,style:b,...S}){const x=!!d,C=Dx(d),k=jx({disabled:s}),E=_.useRef(null),R=Ox(E,a),{getPanelStyles:M,id:O,orientation:D,registerPanel:P,togglePanelDisabled:z}=Lx(),Y=m!==null,L=ch((U,H,j)=>{m==null||m(U,d,j)});ac(()=>{const U=E.current;if(U!==null){const H={element:U,id:C,idIsStable:x,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:Y?L:void 0,panelConstraints:{groupResizeBehavior:c,collapsedSize:n,collapsible:r,defaultSize:i,disabled:k.disabled,maxSize:u,minSize:f}};return P(H)}},[c,n,r,i,Y,C,x,u,f,L,P,k]),_.useEffect(()=>{z(C,!!s)},[s,C,z]),jG(C,v);const W=()=>{const U=M(O,C);if(U)return JSON.stringify(U)},V=_.useSyncExternalStore(U=>Tx(O,U),W,W);let F;return V?F=JSON.parse(V):i?F={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:F={flexGrow:1},g.jsx("div",{...S,"data-disabled":s||void 0,"data-panel":!0,"data-testid":C,id:C,ref:R,style:{...LG,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...F},children:g.jsx("div",{className:e,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...b,touchAction:D==="horizontal"?"pan-y":"pan-x"},children:t})})}IN.displayName="Panel";const LG={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function IG({layout:t,panelConstraints:e,panelId:n,panelIndex:r}){let i,s;const a=t[n],c=e.find(d=>d.panelId===n);if(c){const d=c.maxSize,u=c.collapsible?c.collapsedSize:c.minSize,f=[r,r+1];s=Xl({layout:Ch({delta:u-a,initialLayout:t,panelConstraints:e,pivotIndices:f,prevLayout:t}),panelConstraints:e})[n],i=Xl({layout:Ch({delta:d-a,initialLayout:t,panelConstraints:e,pivotIndices:f,prevLayout:t}),panelConstraints:e})[n]}return{valueControls:n,valueMax:i,valueMin:s,valueNow:a}}function PN({children:t,className:e,disabled:n,elementRef:r,id:i,style:s,...a}){const c=Dx(i),d=jx({disabled:n}),[u,f]=_.useState({}),[m,v]=_.useState("inactive"),b=_.useRef(null),S=Ox(b,r),{disableCursor:x,id:C,orientation:k,registerSeparator:E,toggleSeparatorDisabled:R}=Lx(),M=k==="horizontal"?"vertical":"horizontal";ac(()=>{const D=b.current;if(D!==null){const P={disabled:d.disabled,element:D,id:c},z=E(P),Y=wG(W=>{v(W.next.state!=="inactive"&&W.next.hitRegions.some(V=>V.separator===P)?W.next.state:"inactive")}),L=Tx(C,W=>{const{derivedPanelConstraints:V,layout:F,separatorToPanels:U}=W.next,H=U.get(P);if(H){const j=H[0],G=H.indexOf(j);f(IG({layout:F,panelConstraints:V,panelId:j.id,panelIndex:G}))}});return()=>{Y(),L(),z()}}},[C,c,E,d]),_.useEffect(()=>{R(c,!!n)},[n,c,R]);let O;return n&&!x&&(O="not-allowed"),g.jsx("div",{...a,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":M,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:t,className:e,"data-separator":n?"disabled":m,"data-testid":c,id:c,ref:S,role:"separator",style:{flexBasis:"auto",cursor:O,...s,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}PN.displayName="Separator";const op=t=>{const e=ke.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ce("flex h-full w-full",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=g.jsx(LN,{className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s},Ll=t=>{const e=ke.c(2);let n;return e[0]!==t?(n=g.jsx(IN,{...t}),e[0]=t,e[1]=n):n=e[1],n},ap=t=>{const e=ke.c(15);let n,r,i,s;if(e[0]!==t){const{withHandle:m,orientation:v,disabled:b,className:S,...x}=t;i=v,r=b,n=S,s=x,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s}else n=e[1],r=e[2],i=e[3],s=e[4];const a=i==="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";let c;e[5]!==n||e[6]!==a?(c=Ce("relative flex items-center justify-center bg-transparent focus-visible:outline-none",a,n),e[5]=n,e[6]=a,e[7]=c):c=e[7];const d=i==="vertical"?"Resize rows":"Resize columns";let u;e[8]!==d?(u=g.jsx("span",{className:"sr-only",children:d}),e[8]=d,e[9]=u):u=e[9];let f;return e[10]!==r||e[11]!==s||e[12]!==c||e[13]!==u?(f=g.jsx(PN,{disabled:r,className:c,...s,children:u}),e[10]=r,e[11]=s,e[12]=c,e[13]=u,e[14]=f):f=e[14],f};/**
|
|
479
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
480
|
+
* @license MIT
|
|
481
|
+
*
|
|
482
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
483
|
+
* @license MIT
|
|
484
|
+
*
|
|
485
|
+
* Originally forked from (with the author's permission):
|
|
486
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
487
|
+
* http://bellard.org/jslinux/
|
|
488
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
489
|
+
*/var mr=0,pr=0,gr=0,On=0,Lr;(t=>{function e(i,s,a,c){return c!==void 0?`#${Dl(i)}${Dl(s)}${Dl(a)}${Dl(c)}`:`#${Dl(i)}${Dl(s)}${Dl(a)}`}t.toCss=e;function n(i,s,a,c=255){return(i<<24|s<<16|a<<8|c)>>>0}t.toRgba=n;function r(i,s,a,c){return{css:t.toCss(i,s,a,c),rgba:t.toRgba(i,s,a,c)}}t.toColor=r})(Lr||(Lr={}));var PG;(t=>{function e(d,u){if(On=(u.rgba&255)/255,On===1)return{css:u.css,rgba:u.rgba};let f=u.rgba>>24&255,m=u.rgba>>16&255,v=u.rgba>>8&255,b=d.rgba>>24&255,S=d.rgba>>16&255,x=d.rgba>>8&255;mr=b+Math.round((f-b)*On),pr=S+Math.round((m-S)*On),gr=x+Math.round((v-x)*On);let C=Lr.toCss(mr,pr,gr),k=Lr.toRgba(mr,pr,gr);return{css:C,rgba:k}}t.blend=e;function n(d){return(d.rgba&255)===255}t.isOpaque=n;function r(d,u,f){let m=lp.ensureContrastRatio(d.rgba,u.rgba,f);if(m)return Lr.toColor(m>>24&255,m>>16&255,m>>8&255)}t.ensureContrastRatio=r;function i(d){let u=(d.rgba|255)>>>0;return[mr,pr,gr]=lp.toChannels(u),{css:Lr.toCss(mr,pr,gr),rgba:u}}t.opaque=i;function s(d,u){return On=Math.round(u*255),[mr,pr,gr]=lp.toChannels(d.rgba),{css:Lr.toCss(mr,pr,gr,On),rgba:Lr.toRgba(mr,pr,gr,On)}}t.opacity=s;function a(d,u){return On=d.rgba&255,s(d,On*u/255)}t.multiplyOpacity=a;function c(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}t.toColorRGB=c})(PG||(PG={}));var Rr;(t=>{let e,n;try{let i=document.createElement("canvas");i.width=1,i.height=1;let s=i.getContext("2d",{willReadFrequently:!0});s&&(e=s,e.globalCompositeOperation="copy",n=e.createLinearGradient(0,0,1,1))}catch{}function r(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return mr=parseInt(i.slice(1,2).repeat(2),16),pr=parseInt(i.slice(2,3).repeat(2),16),gr=parseInt(i.slice(3,4).repeat(2),16),Lr.toColor(mr,pr,gr);case 5:return mr=parseInt(i.slice(1,2).repeat(2),16),pr=parseInt(i.slice(2,3).repeat(2),16),gr=parseInt(i.slice(3,4).repeat(2),16),On=parseInt(i.slice(4,5).repeat(2),16),Lr.toColor(mr,pr,gr,On);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let s=i.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return mr=parseInt(s[1]),pr=parseInt(s[2]),gr=parseInt(s[3]),On=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),Lr.toColor(mr,pr,gr,On);if(!e||!n)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=n,e.fillStyle=i,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[mr,pr,gr,On]=e.getImageData(0,0,1,1).data,On!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Lr.toRgba(mr,pr,gr,On),css:i}}t.toColor=r})(Rr||(Rr={}));var Ur;(t=>{function e(r){return n(r>>16&255,r>>8&255,r&255)}t.relativeLuminance=e;function n(r,i,s){let a=r/255,c=i/255,d=s/255,u=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),f=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),m=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return u*.2126+f*.7152+m*.0722}t.relativeLuminance2=n})(Ur||(Ur={}));var lp;(t=>{function e(a,c){if(On=(c&255)/255,On===1)return c;let d=c>>24&255,u=c>>16&255,f=c>>8&255,m=a>>24&255,v=a>>16&255,b=a>>8&255;return mr=m+Math.round((d-m)*On),pr=v+Math.round((u-v)*On),gr=b+Math.round((f-b)*On),Lr.toRgba(mr,pr,gr)}t.blend=e;function n(a,c,d){let u=Ur.relativeLuminance(a>>8),f=Ur.relativeLuminance(c>>8);if(Do(u,f)<d){if(f<u){let b=r(a,c,d),S=Do(u,Ur.relativeLuminance(b>>8));if(S<d){let x=i(a,c,d),C=Do(u,Ur.relativeLuminance(x>>8));return S>C?b:x}return b}let m=i(a,c,d),v=Do(u,Ur.relativeLuminance(m>>8));if(v<d){let b=r(a,c,d),S=Do(u,Ur.relativeLuminance(b>>8));return v>S?m:b}return m}}t.ensureContrastRatio=n;function r(a,c,d){let u=a>>24&255,f=a>>16&255,m=a>>8&255,v=c>>24&255,b=c>>16&255,S=c>>8&255,x=Do(Ur.relativeLuminance2(v,b,S),Ur.relativeLuminance2(u,f,m));for(;x<d&&(v>0||b>0||S>0);)v-=Math.max(0,Math.ceil(v*.1)),b-=Math.max(0,Math.ceil(b*.1)),S-=Math.max(0,Math.ceil(S*.1)),x=Do(Ur.relativeLuminance2(v,b,S),Ur.relativeLuminance2(u,f,m));return(v<<24|b<<16|S<<8|255)>>>0}t.reduceLuminance=r;function i(a,c,d){let u=a>>24&255,f=a>>16&255,m=a>>8&255,v=c>>24&255,b=c>>16&255,S=c>>8&255,x=Do(Ur.relativeLuminance2(v,b,S),Ur.relativeLuminance2(u,f,m));for(;x<d&&(v<255||b<255||S<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),x=Do(Ur.relativeLuminance2(v,b,S),Ur.relativeLuminance2(u,f,m));return(v<<24|b<<16|S<<8|255)>>>0}t.increaseLuminance=i;function s(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}t.toChannels=s})(lp||(lp={}));function Dl(t){let e=t.toString(16);return e.length<2?"0"+e:e}function Do(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var zG=Object.freeze((()=>{let t=[Rr.toColor("#2e3436"),Rr.toColor("#cc0000"),Rr.toColor("#4e9a06"),Rr.toColor("#c4a000"),Rr.toColor("#3465a4"),Rr.toColor("#75507b"),Rr.toColor("#06989a"),Rr.toColor("#d3d7cf"),Rr.toColor("#555753"),Rr.toColor("#ef2929"),Rr.toColor("#8ae234"),Rr.toColor("#fce94f"),Rr.toColor("#729fcf"),Rr.toColor("#ad7fa8"),Rr.toColor("#34e2e2"),Rr.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=e[n/36%6|0],i=e[n/6%6|0],s=e[n%6];t.push({css:Lr.toCss(r,i,s),rgba:Lr.toRgba(r,i,s)})}for(let n=0;n<24;n++){let r=8+n*10;t.push({css:Lr.toCss(r,r,r),rgba:Lr.toRgba(r,r,r)})}return t})());function f5(t,e,n){return Math.max(e,Math.min(t,n))}function BG(t){switch(t){case"&":return"&";case"<":return"<"}return t}var zN=class{constructor(e){this._buffer=e}serialize(e,n){let r=this._buffer.getNullCell(),i=this._buffer.getNullCell(),s=r,a=e.start.y,c=e.end.y,d=e.start.x,u=e.end.x;this._beforeSerialize(c-a,a,c);for(let f=a;f<=c;f++){let m=this._buffer.getLine(f);if(m){let v=f===e.start.y?d:0,b=f===e.end.y?u:m.length;for(let S=v;S<b;S++){let x=m.getCell(S,s===r?i:r);if(!x){console.warn(`Can't get cell at row=${f}, col=${S}`);continue}this._nextCell(x,s,f,S),s=x}}this._rowEnd(f,f===c)}return this._afterSerialize(),this._serializeString(n)}_nextCell(e,n,r,i){}_rowEnd(e,n){}_beforeSerialize(e,n,r){}_afterSerialize(){}_serializeString(e){return""}};function BN(t,e){return t.getFgColorMode()===e.getFgColorMode()&&t.getFgColor()===e.getFgColor()}function Po(t,e){return t.getBgColorMode()===e.getBgColorMode()&&t.getBgColor()===e.getBgColor()}function FN(t,e){return t.isInverse()===e.isInverse()&&t.isBold()===e.isBold()&&t.isUnderline()===e.isUnderline()&&t.isOverline()===e.isOverline()&&t.isBlink()===e.isBlink()&&t.isInvisible()===e.isInvisible()&&t.isItalic()===e.isItalic()&&t.isDim()===e.isDim()&&t.isStrikethrough()===e.isStrikethrough()}var FG=class extends zN{constructor(e,n){super(e),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(e,n,r){this._allRows=new Array(e),this._lastContentCursorRow=n,this._lastCursorRow=n,this._firstRow=n}_rowEnd(e,n){var i;this._nullCellCount>0&&!Po(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!n){e-this._firstRow>=this._terminal.rows&&((i=this._buffer.getLine(this._cursorStyleRow))==null||i.getCell(this._cursorStyleCol,this._backgroundCell));let s=this._buffer.getLine(e),a=this._buffer.getLine(e+1);if(!a.isWrapped)r=`\r
|
|
490
|
+
`,this._lastCursorRow=e+1,this._lastCursorCol=0;else{r="";let c=s.getCell(s.length-1,this._thisRowLastChar),d=s.getCell(s.length-2,this._thisRowLastSecondChar),u=a.getCell(0,this._nextRowFirstChar),f=u.getWidth()>1,m=!1;(u.getChars()&&f?this._nullCellCount<=1:this._nullCellCount<=0)&&((c.getChars()||c.getWidth()===0)&&Po(c,u)&&(m=!0),f&&(d.getChars()||d.getWidth()===0)&&Po(c,u)&&Po(d,u)&&(m=!0)),m||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${s.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${s.length-this._nullCellCount}D`,r+="\x1B[B"),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=r,this._currentRow="",this._nullCellCount=0}_diffStyle(e,n){let r=[],i=!BN(e,n),s=!Po(e,n),a=!FN(e,n);if(i||s||a)if(e.isAttributeDefault())n.isAttributeDefault()||r.push(0);else{if(i){let c=e.getFgColor();e.isFgRGB()?r.push(38,2,c>>>16&255,c>>>8&255,c&255):e.isFgPalette()?c>=16?r.push(38,5,c):r.push(c&8?90+(c&7):30+(c&7)):r.push(39)}if(s){let c=e.getBgColor();e.isBgRGB()?r.push(48,2,c>>>16&255,c>>>8&255,c&255):e.isBgPalette()?c>=16?r.push(48,5,c):r.push(c&8?100+(c&7):40+(c&7)):r.push(49)}a&&(e.isInverse()!==n.isInverse()&&r.push(e.isInverse()?7:27),e.isBold()!==n.isBold()&&r.push(e.isBold()?1:22),e.isUnderline()!==n.isUnderline()&&r.push(e.isUnderline()?4:24),e.isOverline()!==n.isOverline()&&r.push(e.isOverline()?53:55),e.isBlink()!==n.isBlink()&&r.push(e.isBlink()?5:25),e.isInvisible()!==n.isInvisible()&&r.push(e.isInvisible()?8:28),e.isItalic()!==n.isItalic()&&r.push(e.isItalic()?3:23),e.isDim()!==n.isDim()&&r.push(e.isDim()?2:22),e.isStrikethrough()!==n.isStrikethrough()&&r.push(e.isStrikethrough()?9:29))}return r}_nextCell(e,n,r,i){if(e.getWidth()===0)return;let s=e.getChars()==="",a=this._diffStyle(e,this._cursorStyle);if(s?!Po(this._cursorStyle,e):a.length>0){this._nullCellCount>0&&(Po(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=i,this._currentRow+=`\x1B[${a.join(";")}m`;let c=this._buffer.getLine(r);c!==void 0&&(c.getCell(i,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=i)}s?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(Po(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+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=i+e.getWidth())}_serializeString(e){let n=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(n=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let r="";for(let a=0;a<n;a++)r+=this._allRows[a],a+1<n&&(r+=this._allRowSeparators[a]);if(!e){let a=this._buffer.baseY+this._buffer.cursorY,c=this._buffer.cursorX,d=a!==this._lastCursorRow||c!==this._lastCursorCol,u=f=>{f>0?r+=`\x1B[${f}C`:f<0&&(r+=`\x1B[${-f}D`)};d&&((f=>{f>0?r+=`\x1B[${f}B`:f<0&&(r+=`\x1B[${-f}A`)})(a-this._lastCursorRow),u(c-this._lastCursorCol))}let i=this._terminal._core._inputHandler._curAttrData,s=this._diffStyle(i,this._cursorStyle);return s.length>0&&(r+=`\x1B[${s.join(";")}m`),r}},HG=class{activate(e){this._terminal=e}_serializeBufferByScrollback(e,n,r){let i=n.length,s=r===void 0?i:f5(r+e.rows,0,i);return this._serializeBufferByRange(e,n,{start:i-s,end:i-1},!1)}_serializeBufferByRange(e,n,r,i){return new FG(n,e).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:e.cols,y:typeof r.end=="number"?r.end:r.end.line}},i)}_serializeBufferAsHTML(e,n){var d;let r=e.buffer.active,i=new $G(r,e,n),s=n.onlySelection??!1,a=n.range;if(a)return i.serialize({start:{x:a.startCol,y:(a.startLine,a.startLine)},end:{x:e.cols,y:(a.endLine,a.endLine)}});if(!s){let u=r.length,f=n.scrollback,m=f===void 0?u:f5(f+e.rows,0,u);return i.serialize({start:{x:0,y:u-m},end:{x:e.cols,y:u-1}})}let c=(d=this._terminal)==null?void 0:d.getSelectionPosition();return c!==void 0?i.serialize({start:{x:c.start.x,y:c.start.y},end:{x:c.end.x,y:c.end.y}}):""}_serializeModes(e){let n="",r=e.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(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let n=e!=null&&e.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,e.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,e==null?void 0:e.scrollback);if(!(e!=null&&e.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 e!=null&&e.excludeModes||(n+=this._serializeModes(this._terminal)),n}serializeAsHTML(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,e||{})}dispose(){}},$G=class extends zN{constructor(e,n,r){super(e),this._terminal=n,this._options=r,this._currentRow="",this._htmlContent="",n._core._themeService?this._ansiColors=n._core._themeService.colors.ansi:this._ansiColors=zG}_padStart(e,n,r){return n=n>>0,r=r??" ",e.length>n?e:(n-=e.length,n>r.length&&(r+=r.repeat(n/r.length)),r.slice(0,n)+e)}_beforeSerialize(e,n,r){var c,d;this._htmlContent+="<html><body><!--StartFragment--><pre>";let i="#000000",s="#ffffff";(this._options.includeGlobalBackground??!1)&&(i=((c=this._terminal.options.theme)==null?void 0:c.foreground)??"#ffffff",s=((d=this._terminal.options.theme)==null?void 0:d.background)??"#000000");let a=[];a.push("color: "+i+";"),a.push("background-color: "+s+";"),a.push("font-family: "+this._terminal.options.fontFamily+";"),a.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+a.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(e,n){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(e,n){let r=n?e.getFgColor():e.getBgColor();if(n?e.isFgRGB():e.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(i=>this._padStart(i.toString(16),2,"0")).join("");if(n?e.isFgPalette():e.isBgPalette())return this._ansiColors[r].css}_diffStyle(e,n){let r=[],i=!BN(e,n),s=!Po(e,n),a=!FN(e,n);if(i||s||a){let c=this._getHexColor(e,!0);c&&r.push("color: "+c+";");let d=this._getHexColor(e,!1);return d&&r.push("background-color: "+d+";"),e.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),e.isBold()&&r.push("font-weight: bold;"),e.isUnderline()&&e.isOverline()?r.push("text-decoration: overline underline;"):e.isUnderline()?r.push("text-decoration: underline;"):e.isOverline()&&r.push("text-decoration: overline;"),e.isBlink()&&r.push("text-decoration: blink;"),e.isInvisible()&&r.push("visibility: hidden;"),e.isItalic()&&r.push("font-style: italic;"),e.isDim()&&r.push("opacity: 0.5;"),e.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(e,n,r,i){if(e.getWidth()===0)return;let s=e.getChars()==="",a=this._diffStyle(e,n);a&&(this._currentRow+=a.length===0?"</span><span>":"</span><span style='"+a.join(" ")+"'>"),s?this._currentRow+=" ":this._currentRow+=BG(e.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
491
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
492
|
+
* @license MIT
|
|
493
|
+
*
|
|
494
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
495
|
+
* @license MIT
|
|
496
|
+
*
|
|
497
|
+
* Originally forked from (with the author's permission):
|
|
498
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
499
|
+
* http://bellard.org/jslinux/
|
|
500
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
501
|
+
*/var UG=class{constructor(e,n,r,i={}){this._terminal=e,this._regex=n,this._handler=r,this._options=i}provideLinks(e,n){let r=VG.computeLink(e,this._regex,this._terminal,this._handler);n(this._addCallbacks(r))}_addCallbacks(e){return e.map(n=>(n.leave=this._options.leave,n.hover=(r,i)=>{if(this._options.hover){let{range:s}=n;this._options.hover(r,i,s)}},n))}};function WG(t){try{let e=new URL(t),n=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return t.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var VG=class cp{static computeLink(e,n,r,i){let s=new RegExp(n.source,(n.flags||"")+"g"),[a,c]=cp._getWindowedLineStrings(e-1,r),d=a.join(""),u,f=[];for(;u=s.exec(d);){let m=u[0];if(!WG(m))continue;let[v,b]=cp._mapStrIdx(r,c,0,u.index),[S,x]=cp._mapStrIdx(r,v,b,m.length);if(v===-1||b===-1||S===-1||x===-1)continue;let C={start:{x:b+1,y:v+1},end:{x,y:S+1}};f.push({range:C,text:m,activate:i})}return f}static _getWindowedLineStrings(e,n){let r,i=e,s=e,a=0,c="",d=[];if(r=n.buffer.active.getLine(e)){let u=r.translateToString(!0);if(r.isWrapped&&u[0]!==" "){for(a=0;(r=n.buffer.active.getLine(--i))&&a<2048&&(c=r.translateToString(!0),a+=c.length,d.push(c),!(!r.isWrapped||c.indexOf(" ")!==-1)););d.reverse()}for(d.push(u),a=0;(r=n.buffer.active.getLine(++s))&&r.isWrapped&&a<2048&&(c=r.translateToString(!0),a+=c.length,d.push(c),c.indexOf(" ")===-1););}return[d,i]}static _mapStrIdx(e,n,r,i){let s=e.buffer.active,a=s.getNullCell(),c=r;for(;i;){let d=s.getLine(n);if(!d)return[-1,-1];for(let u=c;u<d.length;++u){d.getCell(u,a);let f=a.getChars();if(a.getWidth()&&(i-=f.length||1,u===d.length-1&&f==="")){let m=s.getLine(n+1);m&&m.isWrapped&&(m.getCell(0,a),a.getWidth()===2&&(i+=1))}if(i<0)return[n,u]}n++,c=0}return[n,c]}},qG=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function KG(t,e){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var GG=class{constructor(e=KG,n={}){this._handler=e,this._options=n}activate(e){this._terminal=e;let n=this._options,r=n.urlRegex||qG;this._linkProvider=this._terminal.registerLinkProvider(new UG(this._terminal,r,this._handler,n))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};/**
|
|
502
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
503
|
+
* @license MIT
|
|
504
|
+
*
|
|
505
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
506
|
+
* @license MIT
|
|
507
|
+
*
|
|
508
|
+
* Originally forked from (with the author's permission):
|
|
509
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
510
|
+
* http://bellard.org/jslinux/
|
|
511
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
512
|
+
*/var HN=Object.defineProperty,YG=Object.getOwnPropertyDescriptor,XG=(t,e)=>{for(var n in e)HN(t,n,{get:e[n],enumerable:!0})},Ln=(t,e,n,r)=>{for(var i=r>1?void 0:r?YG(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(i=(r?a(e,n,i):a(i))||i);return r&&i&&HN(e,n,i),i},et=(t,e)=>(n,r)=>e(n,r,t),m5="Terminal input",f_={get:()=>m5,set:t=>m5=t},p5="Too much output to announce, navigate to rows manually to read",m_={get:()=>p5,set:t=>p5=t};function QG(t){return t.replace(/\r?\n/g,"\r")}function ZG(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function JG(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function eY(t,e,n,r){if(t.stopPropagation(),t.clipboardData){let i=t.clipboardData.getData("text/plain");$N(i,e,n,r)}}function $N(t,e,n,r){t=QG(t),t=ZG(t,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(t,!0),e.value=""}function UN(t,e,n){let r=n.getBoundingClientRect(),i=t.clientX-r.left-10,s=t.clientY-r.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${i}px`,e.style.top=`${s}px`,e.style.zIndex="1000",e.focus()}function g5(t,e,n,r,i){UN(t,e,n),i&&r.rightClickSelect(t),e.value=r.selectionText,e.select()}function Ua(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function $g(t,e=0,n=t.length){let r="";for(let i=e;i<n;++i){let s=t[i];s>65535?(s-=65536,r+=String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):r+=String.fromCharCode(s)}return r}var tY=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,e){let n=t.length;if(!n)return 0;let r=0,i=0;if(this._interim){let s=t.charCodeAt(i++);56320<=s&&s<=57343?e[r++]=(this._interim-55296)*1024+s-56320+65536:(e[r++]=this._interim,e[r++]=s),this._interim=0}for(let s=i;s<n;++s){let a=t.charCodeAt(s);if(55296<=a&&a<=56319){if(++s>=n)return this._interim=a,r;let c=t.charCodeAt(s);56320<=c&&c<=57343?e[r++]=(a-55296)*1024+c-56320+65536:(e[r++]=a,e[r++]=c);continue}a!==65279&&(e[r++]=a)}return r}},nY=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,e){let n=t.length;if(!n)return 0;let r=0,i,s,a,c,d=0,u=0;if(this.interim[0]){let v=!1,b=this.interim[0];b&=(b&224)===192?31:(b&240)===224?15:7;let S=0,x;for(;(x=this.interim[++S]&63)&&S<4;)b<<=6,b|=x;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-S;for(;u<k;){if(u>=n)return 0;if(x=t[u++],(x&192)!==128){u--,v=!0;break}else this.interim[S++]=x,b<<=6,b|=x&63}v||(C===2?b<128?u--:e[r++]=b:C===3?b<2048||b>=55296&&b<=57343||b===65279||(e[r++]=b):b<65536||b>1114111||(e[r++]=b)),this.interim.fill(0)}let f=n-4,m=u;for(;m<n;){for(;m<f&&!((i=t[m])&128)&&!((s=t[m+1])&128)&&!((a=t[m+2])&128)&&!((c=t[m+3])&128);)e[r++]=i,e[r++]=s,e[r++]=a,e[r++]=c,m+=4;if(i=t[m++],i<128)e[r++]=i;else if((i&224)===192){if(m>=n)return this.interim[0]=i,r;if(s=t[m++],(s&192)!==128){m--;continue}if(d=(i&31)<<6|s&63,d<128){m--;continue}e[r++]=d}else if((i&240)===224){if(m>=n)return this.interim[0]=i,r;if(s=t[m++],(s&192)!==128){m--;continue}if(m>=n)return this.interim[0]=i,this.interim[1]=s,r;if(a=t[m++],(a&192)!==128){m--;continue}if(d=(i&15)<<12|(s&63)<<6|a&63,d<2048||d>=55296&&d<=57343||d===65279)continue;e[r++]=d}else if((i&248)===240){if(m>=n)return this.interim[0]=i,r;if(s=t[m++],(s&192)!==128){m--;continue}if(m>=n)return this.interim[0]=i,this.interim[1]=s,r;if(a=t[m++],(a&192)!==128){m--;continue}if(m>=n)return this.interim[0]=i,this.interim[1]=s,this.interim[2]=a,r;if(c=t[m++],(c&192)!==128){m--;continue}if(d=(i&7)<<18|(s&63)<<12|(a&63)<<6|c&63,d<65536||d>1114111)continue;e[r++]=d}}return r}},WN="",Qa=" ",qh=class VN{constructor(){this.fg=0,this.bg=0,this.extended=new Up}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new VN;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}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}},Up=class qN{constructor(e=0,n=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new qN(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ns=class KN extends qh{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Up,this.combinedData=""}static fromCharData(e){let n=new KN;return n.setFromCharData(e),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ua(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let n=!1;if(e[1].length>2)n=!0;else if(e[1].length===2){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let i=e[1].charCodeAt(1);56320<=i&&i<=57343?this.content=(r-55296)*1024+i-56320+65536|e[2]<<22:n=!0}else n=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;n&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},v5="di$target",p_="di$dependencies",Ab=new Map;function rY(t){return t[p_]||[]}function yr(t){if(Ab.has(t))return Ab.get(t);let e=function(n,r,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");iY(e,n,i)};return e._id=t,Ab.set(t,e),e}function iY(t,e,n){e[v5]===e?e[p_].push({id:t,index:n}):(e[p_]=[{id:t,index:n}],e[v5]=e)}var Qr=yr("BufferService"),GN=yr("CoreMouseService"),lc=yr("CoreService"),sY=yr("CharsetService"),Ix=yr("InstantiationService"),YN=yr("LogService"),Zr=yr("OptionsService"),XN=yr("OscLinkService"),oY=yr("UnicodeService"),Kh=yr("DecorationService"),g_=class{constructor(t,e,n){this._bufferService=t,this._optionsService=e,this._oscLinkService=n}provideLinks(t,e){var f;let n=this._bufferService.buffer.lines.get(t-1);if(!n){e(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,s=new ns,a=n.getTrimmedLength(),c=-1,d=-1,u=!1;for(let m=0;m<a;m++)if(!(d===-1&&!n.hasContent(m))){if(n.loadCell(m,s),s.hasExtendedAttrs()&&s.extended.urlId)if(d===-1){d=m,c=s.extended.urlId;continue}else u=s.extended.urlId!==c;else d!==-1&&(u=!0);if(u||d!==-1&&m===a-1){let v=(f=this._oscLinkService.getLinkData(c))==null?void 0:f.uri;if(v){let b={start:{x:d+1,y:t},end:{x:m+(!u&&m===a-1?1:0),y:t}},S=!1;if(!(i!=null&&i.allowNonHttpProtocols))try{let x=new URL(v);["http:","https:"].includes(x.protocol)||(S=!0)}catch{S=!0}S||r.push({text:v,range:b,activate:(x,C)=>i?i.activate(x,C,b):aY(x,C),hover:(x,C)=>{var k;return(k=i==null?void 0:i.hover)==null?void 0:k.call(i,x,C,b)},leave:(x,C)=>{var k;return(k=i==null?void 0:i.leave)==null?void 0:k.call(i,x,C,b)}})}u=!1,s.hasExtendedAttrs()&&s.extended.urlId?(d=m,c=s.extended.urlId):(d=-1,c=-1)}}e(r)}};g_=Ln([et(0,Qr),et(1,Zr),et(2,XN)],g_);function aY(t,e){if(confirm(`Do you want to navigate to ${e}?
|
|
513
|
+
|
|
514
|
+
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var Ug=yr("CharSizeService"),Zo=yr("CoreBrowserService"),Px=yr("MouseService"),Jo=yr("RenderService"),lY=yr("SelectionService"),QN=yr("CharacterJoinerService"),$u=yr("ThemeService"),ZN=yr("LinkProviderService"),cY=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?b5.isErrorNoTelemetry(t)?new b5(t.message+`
|
|
515
|
+
|
|
516
|
+
`+t.stack):new Error(t.message+`
|
|
517
|
+
|
|
518
|
+
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},uY=new cY;function up(t){dY(t)||uY.onUnexpectedError(t)}var v_="Canceled";function dY(t){return t instanceof hY?!0:t instanceof Error&&t.name===v_&&t.message===v_}var hY=class extends Error{constructor(){super(v_),this.name=this.message}};function fY(t){return new Error(`Illegal argument: ${t}`)}var b5=class b_ extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof b_)return e;let n=new b_;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},__=class JN extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,JN.prototype)}};function Ei(t,e=0){return t[t.length-(1+e)]}var mY;(t=>{function e(s){return s<0}t.isLessThan=e;function n(s){return s<=0}t.isLessThanOrEqual=n;function r(s){return s>0}t.isGreaterThan=r;function i(s){return s===0}t.isNeitherLessOrGreaterThan=i,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(mY||(mY={}));function pY(t,e){let n=this,r=!1,i;return function(){return r||(r=!0,e||(i=t.apply(n,arguments))),i}}var eD;(t=>{function e(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}t.is=e;let n=Object.freeze([]);function r(){return n}t.empty=r;function*i(M){yield M}t.single=i;function s(M){return e(M)?M:i(M)}t.wrap=s;function a(M){return M||n}t.from=a;function*c(M){for(let O=M.length-1;O>=0;O--)yield M[O]}t.reverse=c;function d(M){return!M||M[Symbol.iterator]().next().done===!0}t.isEmpty=d;function u(M){return M[Symbol.iterator]().next().value}t.first=u;function f(M,O){let D=0;for(let P of M)if(O(P,D++))return!0;return!1}t.some=f;function m(M,O){for(let D of M)if(O(D))return D}t.find=m;function*v(M,O){for(let D of M)O(D)&&(yield D)}t.filter=v;function*b(M,O){let D=0;for(let P of M)yield O(P,D++)}t.map=b;function*S(M,O){let D=0;for(let P of M)yield*O(P,D++)}t.flatMap=S;function*x(...M){for(let O of M)yield*O}t.concat=x;function C(M,O,D){let P=D;for(let z of M)P=O(P,z);return P}t.reduce=C;function*k(M,O,D=M.length){for(O<0&&(O+=M.length),D<0?D+=M.length:D>M.length&&(D=M.length);O<D;O++)yield M[O]}t.slice=k;function E(M,O=Number.POSITIVE_INFINITY){let D=[];if(O===0)return[D,M];let P=M[Symbol.iterator]();for(let z=0;z<O;z++){let Y=P.next();if(Y.done)return[D,t.empty()];D.push(Y.value)}return[D,{[Symbol.iterator](){return P}}]}t.consume=E;async function R(M){let O=[];for await(let D of M)O.push(D);return Promise.resolve(O)}t.asyncToArray=R})(eD||(eD={}));function Zl(t){if(eD.is(t)){let e=[];for(let n of t)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function gY(...t){return En(()=>Zl(t))}function En(t){return{dispose:pY(()=>{t()})}}var tD=class nD{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{Zl(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?nD.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(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};tD.DISABLE_DISPOSED_WARNING=!1;var el=tD,Lt=class{constructor(){this._store=new el,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Lt.None=Object.freeze({dispose(){}});var ku=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){var e;this._isDisposed||t===this._value||((e=this._value)==null||e.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,(t=this._value)==null||t.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},Uo=typeof window=="object"?window:globalThis,y_=class x_{constructor(e){this.element=e,this.next=x_.Undefined,this.prev=x_.Undefined}};y_.Undefined=new y_(void 0);var Tn=y_,_5=class{constructor(){this._first=Tn.Undefined,this._last=Tn.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Tn.Undefined}clear(){let t=this._first;for(;t!==Tn.Undefined;){let e=t.next;t.prev=Tn.Undefined,t.next=Tn.Undefined,t=e}this._first=Tn.Undefined,this._last=Tn.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let n=new Tn(t);if(this._first===Tn.Undefined)this._first=n,this._last=n;else if(e){let i=this._last;this._last=n,n.prev=i,i.next=n}else{let i=this._first;this._first=n,n.next=i,i.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==Tn.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==Tn.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==Tn.Undefined&&t.next!==Tn.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===Tn.Undefined&&t.next===Tn.Undefined?(this._first=Tn.Undefined,this._last=Tn.Undefined):t.next===Tn.Undefined?(this._last=this._last.prev,this._last.next=Tn.Undefined):t.prev===Tn.Undefined&&(this._first=this._first.next,this._first.prev=Tn.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==Tn.Undefined;)yield t.element,t=t.next}},vY=globalThis.performance&&typeof globalThis.performance.now=="function",bY=class rD{static create(e){return new rD(e)}constructor(e){this._now=vY&&e===!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}},Mr;(t=>{t.None=()=>Lt.None;function e(V,F){return m(V,()=>{},0,void 0,!0,void 0,F)}t.defer=e;function n(V){return(F,U=null,H)=>{let j=!1,G;return G=V(B=>{if(!j)return G?G.dispose():j=!0,F.call(U,B)},null,H),j&&G.dispose(),G}}t.once=n;function r(V,F,U){return u((H,j=null,G)=>V(B=>H.call(j,F(B)),null,G),U)}t.map=r;function i(V,F,U){return u((H,j=null,G)=>V(B=>{F(B),H.call(j,B)},null,G),U)}t.forEach=i;function s(V,F,U){return u((H,j=null,G)=>V(B=>F(B)&&H.call(j,B),null,G),U)}t.filter=s;function a(V){return V}t.signal=a;function c(...V){return(F,U=null,H)=>{let j=gY(...V.map(G=>G(B=>F.call(U,B))));return f(j,H)}}t.any=c;function d(V,F,U,H){let j=U;return r(V,G=>(j=F(j,G),j),H)}t.reduce=d;function u(V,F){let U,H={onWillAddFirstListener(){U=V(j.fire,j)},onDidRemoveLastListener(){U==null||U.dispose()}},j=new qe(H);return F==null||F.add(j),j.event}function f(V,F){return F instanceof Array?F.push(V):F&&F.add(V),V}function m(V,F,U=100,H=!1,j=!1,G,B){let K,A,I,$=0,T,X={leakWarningThreshold:G,onWillAddFirstListener(){K=V(J=>{$++,A=F(A,J),H&&!I&&(Z.fire(A),A=void 0),T=()=>{let re=A;A=void 0,I=void 0,(!H||$>1)&&Z.fire(re),$=0},typeof U=="number"?(clearTimeout(I),I=setTimeout(T,U)):I===void 0&&(I=0,queueMicrotask(T))})},onWillRemoveListener(){j&&$>0&&(T==null||T())},onDidRemoveLastListener(){T=void 0,K.dispose()}},Z=new qe(X);return B==null||B.add(Z),Z.event}t.debounce=m;function v(V,F=0,U){return t.debounce(V,(H,j)=>H?(H.push(j),H):[j],F,void 0,!0,void 0,U)}t.accumulate=v;function b(V,F=(H,j)=>H===j,U){let H=!0,j;return s(V,G=>{let B=H||!F(G,j);return H=!1,j=G,B},U)}t.latch=b;function S(V,F,U){return[t.filter(V,F,U),t.filter(V,H=>!F(H),U)]}t.split=S;function x(V,F=!1,U=[],H){let j=U.slice(),G=V(A=>{j?j.push(A):K.fire(A)});H&&H.add(G);let B=()=>{j==null||j.forEach(A=>K.fire(A)),j=null},K=new qe({onWillAddFirstListener(){G||(G=V(A=>K.fire(A)),H&&H.add(G))},onDidAddFirstListener(){j&&(F?setTimeout(B):B())},onDidRemoveLastListener(){G&&G.dispose(),G=null}});return H&&H.add(K),K.event}t.buffer=x;function C(V,F){return(U,H,j)=>{let G=F(new E);return V(function(B){let K=G.evaluate(B);K!==k&&U.call(H,K)},void 0,j)}}t.chain=C;let k=Symbol("HaltChainable");class E{constructor(){this.steps=[]}map(F){return this.steps.push(F),this}forEach(F){return this.steps.push(U=>(F(U),U)),this}filter(F){return this.steps.push(U=>F(U)?U:k),this}reduce(F,U){let H=U;return this.steps.push(j=>(H=F(H,j),H)),this}latch(F=(U,H)=>U===H){let U=!0,H;return this.steps.push(j=>{let G=U||!F(j,H);return U=!1,H=j,G?j:k}),this}evaluate(F){for(let U of this.steps)if(F=U(F),F===k)break;return F}}function R(V,F,U=H=>H){let H=(...K)=>B.fire(U(...K)),j=()=>V.on(F,H),G=()=>V.removeListener(F,H),B=new qe({onWillAddFirstListener:j,onDidRemoveLastListener:G});return B.event}t.fromNodeEventEmitter=R;function M(V,F,U=H=>H){let H=(...K)=>B.fire(U(...K)),j=()=>V.addEventListener(F,H),G=()=>V.removeEventListener(F,H),B=new qe({onWillAddFirstListener:j,onDidRemoveLastListener:G});return B.event}t.fromDOMEventEmitter=M;function O(V){return new Promise(F=>n(V)(F))}t.toPromise=O;function D(V){let F=new qe;return V.then(U=>{F.fire(U)},()=>{F.fire(void 0)}).finally(()=>{F.dispose()}),F.event}t.fromPromise=D;function P(V,F){return V(U=>F.fire(U))}t.forward=P;function z(V,F,U){return F(U),V(H=>F(H))}t.runAndSubscribe=z;class Y{constructor(F,U){this._observable=F,this._counter=0,this._hasChanged=!1;let H={onWillAddFirstListener:()=>{F.addObserver(this)},onDidRemoveLastListener:()=>{F.removeObserver(this)}};this.emitter=new qe(H),U&&U.add(this.emitter)}beginUpdate(F){this._counter++}handlePossibleChange(F){}handleChange(F,U){this._hasChanged=!0}endUpdate(F){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function L(V,F){return new Y(V,F).emitter.event}t.fromObservable=L;function W(V){return(F,U,H)=>{let j=0,G=!1,B={beginUpdate(){j++},endUpdate(){j--,j===0&&(V.reportChanges(),G&&(G=!1,F.call(U)))},handlePossibleChange(){},handleChange(){G=!0}};V.addObserver(B),V.reportChanges();let K={dispose(){V.removeObserver(B)}};return H instanceof el?H.add(K):Array.isArray(H)&&H.push(K),K}}t.fromObservableLight=W})(Mr||(Mr={}));var S_=class w_{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${w_._idPool++}`,w_.all.add(this)}start(e){this._stopWatch=new bY,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};S_.all=new Set,S_._idPool=0;var _Y=S_,yY=-1,iD=class sD{constructor(e,n,r=(sD._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let i=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[s,a]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${a}):`;console.warn(c),console.warn(s);let d=new wY(c,s);this._errorHandler(d)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,n=0;for(let[r,i]of this._stacks)(!e||n<i)&&(e=[r,i],n=i);return e}};iD._idPool=1;var xY=iD,SY=class oD{constructor(e){this.value=e}static create(){let e=new Error;return new oD(e.stack??"")}print(){console.warn(this.value.split(`
|
|
519
|
+
`).slice(2).join(`
|
|
520
|
+
`))}},wY=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},CY=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},kY=0,Nb=class{constructor(t){this.value=t,this.id=kY++}},EY=2,RY,qe=class{constructor(t){var e,n,r,i;this._size=0,this._options=t,this._leakageMon=(e=this._options)!=null&&e.leakWarningThreshold?new xY((t==null?void 0:t.onListenerError)??up,((n=this._options)==null?void 0:n.leakWarningThreshold)??yY):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new _Y(this._options._profName):void 0,this._deliveryQueue=(i=this._options)==null?void 0:i.deliveryQueue}dispose(){var t,e,n,r;this._disposed||(this._disposed=!0,((t=this._deliveryQueue)==null?void 0:t.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(e=this._options)==null?void 0:e.onDidRemoveLastListener)==null||n.call(e),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(t,e,n)=>{var a,c,d,u,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let v=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],b=new CY(`${m}. HINT: Stack shows most frequent listener (${v[1]}-times)`,v[0]);return(((a=this._options)==null?void 0:a.onListenerError)||up)(b),Lt.None}if(this._disposed)return Lt.None;e&&(t=t.bind(e));let r=new Nb(t),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=SY.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Nb?(this._deliveryQueue??(this._deliveryQueue=new TY),this._listeners=[this._listeners,r]):this._listeners.push(r):((d=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||d.call(c,this),this._listeners=r,(f=(u=this._options)==null?void 0:u.onDidAddFirstListener)==null||f.call(u,this)),this._size++;let s=En(()=>{i==null||i(),this._removeListener(r)});return n instanceof el?n.add(s):Array.isArray(n)&&n.push(s),s}),this._event}_removeListener(t){var i,s,a,c;if((s=(i=this._options)==null?void 0:i.onWillRemoveListener)==null||s.call(i,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||c.call(a,this),this._size=0;return}let e=this._listeners,n=e.indexOf(t);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--,e[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*EY<=e.length){let d=0;for(let u=0;u<e.length;u++)e[u]?e[d++]=e[u]:r&&(this._deliveryQueue.end--,d<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=d}}_deliver(t,e){var r;if(!t)return;let n=((r=this._options)==null?void 0:r.onListenerError)||up;if(!n){t.value(e);return}try{t.value(e)}catch(i){n(i)}}_deliverQueue(t){let e=t.current._listeners;for(;t.i<t.end;)this._deliver(e[t.i++],t.value);t.reset()}fire(t){var e,n,r,i;if((e=this._deliveryQueue)!=null&&e.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 Nb)this._deliver(this._listeners,t);else{let s=this._deliveryQueue;s.enqueue(this,t,this._listeners.length),this._deliverQueue(s)}(i=this._perfMon)==null||i.stop()}hasListeners(){return this._size>0}},TY=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,n){this.i=0,this.end=n,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},C_=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new qe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new qe,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,n){if(this.getZoomLevel(n)===e)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,e),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),e)}setFullscreen(e,n){if(this.isFullscreen(n)===e)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,e),this._onDidChangeFullscreen.fire(r)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};C_.INSTANCE=new C_;var zx=C_;function MY(t,e,n){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",n)}zx.INSTANCE.onDidChangeZoomLevel;function AY(t){return zx.INSTANCE.getZoomFactor(t)}zx.INSTANCE.onDidChangeFullscreen;var Uu=typeof navigator=="object"?navigator.userAgent:"",k_=Uu.indexOf("Firefox")>=0,NY=Uu.indexOf("AppleWebKit")>=0,Bx=Uu.indexOf("Chrome")>=0,DY=!Bx&&Uu.indexOf("Safari")>=0;Uu.indexOf("Electron/")>=0;Uu.indexOf("Android")>=0;var Db=!1;if(typeof Uo.matchMedia=="function"){let t=Uo.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=Uo.matchMedia("(display-mode: fullscreen)");Db=t.matches,MY(Uo,t,({matches:n})=>{Db&&e.matches||(Db=n)})}var su="en",E_=!1,R_=!1,dp=!1,aD=!1,Rm,hp=su,y5=su,OY,vs,$l=globalThis,Tr,xR;typeof $l.vscode<"u"&&typeof $l.vscode.process<"u"?Tr=$l.vscode.process:typeof process<"u"&&typeof((xR=process==null?void 0:process.versions)==null?void 0:xR.node)=="string"&&(Tr=process);var SR,jY=typeof((SR=Tr==null?void 0:Tr.versions)==null?void 0:SR.electron)=="string",LY=jY&&(Tr==null?void 0:Tr.type)==="renderer",wR;if(typeof Tr=="object"){E_=Tr.platform==="win32",R_=Tr.platform==="darwin",dp=Tr.platform==="linux",dp&&Tr.env.SNAP&&Tr.env.SNAP_REVISION,Tr.env.CI||Tr.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Rm=su,hp=su;let t=Tr.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Rm=e.userLocale,y5=e.osLocale,hp=e.resolvedLanguage||su,OY=(wR=e.languagePack)==null?void 0:wR.translationsConfigFile}catch{}aD=!0}else typeof navigator=="object"&&!LY?(vs=navigator.userAgent,E_=vs.indexOf("Windows")>=0,R_=vs.indexOf("Macintosh")>=0,(vs.indexOf("Macintosh")>=0||vs.indexOf("iPad")>=0||vs.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,dp=vs.indexOf("Linux")>=0,(vs==null?void 0:vs.indexOf("Mobi"))>=0,hp=globalThis._VSCODE_NLS_LANGUAGE||su,Rm=navigator.language.toLowerCase(),y5=Rm):console.error("Unable to resolve platform.");var lD=E_,eo=R_,IY=dp,x5=aD,no=vs,Ia=hp,PY;(t=>{function e(){return Ia}t.value=e;function n(){return Ia.length===2?Ia==="en":Ia.length>=3?Ia[0]==="e"&&Ia[1]==="n"&&Ia[2]==="-":!1}t.isDefaultVariant=n;function r(){return Ia==="en"}t.isDefault=r})(PY||(PY={}));var zY=typeof $l.postMessage=="function"&&!$l.importScripts;(()=>{if(zY){let t=[];$l.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,i=t.length;r<i;r++){let s=t[r];if(s.id===n.data.vscodeScheduleAsyncWork){t.splice(r,1),s.callback();return}}});let e=0;return n=>{let r=++e;t.push({id:r,callback:n}),$l.postMessage({vscodeScheduleAsyncWork:r},"*")}}return t=>setTimeout(t)})();var BY=!!(no&&no.indexOf("Chrome")>=0);no&&no.indexOf("Firefox")>=0;!BY&&no&&no.indexOf("Safari")>=0;no&&no.indexOf("Edg/")>=0;no&&no.indexOf("Android")>=0;var Xc=typeof navigator=="object"?navigator:{};x5||document.queryCommandSupported&&document.queryCommandSupported("copy")||Xc&&Xc.clipboard&&Xc.clipboard.writeText,x5||Xc&&Xc.clipboard&&Xc.clipboard.readText;var Fx=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},Ob=new Fx,S5=new Fx,w5=new Fx,FY=new Array(230),cD;(t=>{function e(c){return Ob.keyCodeToStr(c)}t.toString=e;function n(c){return Ob.strToKeyCode(c)}t.fromString=n;function r(c){return S5.keyCodeToStr(c)}t.toUserSettingsUS=r;function i(c){return w5.keyCodeToStr(c)}t.toUserSettingsGeneral=i;function s(c){return S5.strToKeyCode(c)||w5.strToKeyCode(c)}t.fromUserSettings=s;function a(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Ob.keyCodeToStr(c)}t.toElectronAccelerator=a})(cD||(cD={}));var HY=class uD{constructor(e,n,r,i,s){this.ctrlKey=e,this.shiftKey=n,this.altKey=r,this.metaKey=i,this.keyCode=s}equals(e){return e instanceof uD&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",r=this.altKey?"1":"0",i=this.metaKey?"1":"0";return`K${e}${n}${r}${i}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new $Y([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},$Y=class{constructor(t){if(t.length===0)throw fY("chords");this.chords=t}getHashCode(){let t="";for(let e=0,n=this.chords.length;e<n;e++)e!==0&&(t+=";"),t+=this.chords[e].getHashCode();return t}equals(t){if(t===null||this.chords.length!==t.chords.length)return!1;for(let e=0;e<this.chords.length;e++)if(!this.chords[e].equals(t.chords[e]))return!1;return!0}};function UY(t){if(t.charCode){let n=String.fromCharCode(t.charCode).toUpperCase();return cD.fromString(n)}let e=t.keyCode;if(e===3)return 7;if(k_)switch(e){case 59:return 85;case 60:if(IY)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(eo)return 57;break}else if(NY&&(eo&&e===93||!eo&&e===92))return 57;return FY[e]||0}var WY=eo?256:2048,VY=512,qY=1024,KY=eo?2048:256,C5=class{constructor(t){var n;this._standardKeyboardEventBrand=!0;let e=t;this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.altGraphKey=(n=e.getModifierState)==null?void 0:n.call(e,"AltGraph"),this.keyCode=UY(e),this.code=e.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(t){return this._asKeybinding===t}_computeKeybinding(){let t=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode);let e=0;return this.ctrlKey&&(e|=WY),this.altKey&&(e|=VY),this.shiftKey&&(e|=qY),this.metaKey&&(e|=KY),e|=t,e}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new HY(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},k5=new WeakMap;function GY(t){if(!t.parent||t.parent===t)return null;try{let e=t.location,n=t.parent.location;if(e.origin!=="null"&&n.origin!=="null"&&e.origin!==n.origin)return null}catch{return null}return t.parent}var YY=class{static getSameOriginWindowChain(t){let e=k5.get(t);if(!e){e=[],k5.set(t,e);let n=t,r;do r=GY(n),r?e.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):e.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return e.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(t,e){if(!e||t===e)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(t);for(let s of i){let a=s.window.deref();if(n+=(a==null?void 0:a.scrollY)??0,r+=(a==null?void 0:a.scrollX)??0,a===e||!s.iframeElement)break;let c=s.iframeElement.getBoundingClientRect();n+=c.top,r+=c.left}return{top:n,left:r}}},Tm=class{constructor(t,e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=YY.getPositionOfChildWindowRelativeToAncestorWindow(t,e.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},E5=class{constructor(t,e=0,n=0){var i;this.browserEvent=t||null,this.target=t?t.target||t.targetNode||t.srcElement:null,this.deltaY=n,this.deltaX=e;let r=!1;if(Bx){let s=navigator.userAgent.match(/Chrome\/(\d+)/);r=(s?parseInt(s[1]):123)<=122}if(t){let s=t,a=t,c=((i=t.view)==null?void 0:i.devicePixelRatio)||1;if(typeof s.wheelDeltaY<"u")r?this.deltaY=s.wheelDeltaY/(120*c):this.deltaY=s.wheelDeltaY/120;else if(typeof a.VERTICAL_AXIS<"u"&&a.axis===a.VERTICAL_AXIS)this.deltaY=-a.detail/3;else if(t.type==="wheel"){let d=t;d.deltaMode===d.DOM_DELTA_LINE?k_&&!eo?this.deltaY=-t.deltaY/3:this.deltaY=-t.deltaY:this.deltaY=-t.deltaY/40}if(typeof s.wheelDeltaX<"u")DY&&lD?this.deltaX=-(s.wheelDeltaX/120):r?this.deltaX=s.wheelDeltaX/(120*c):this.deltaX=s.wheelDeltaX/120;else if(typeof a.HORIZONTAL_AXIS<"u"&&a.axis===a.HORIZONTAL_AXIS)this.deltaX=-t.detail/3;else if(t.type==="wheel"){let d=t;d.deltaMode===d.DOM_DELTA_LINE?k_&&!eo?this.deltaX=-t.deltaX/3:this.deltaX=-t.deltaX:this.deltaX=-t.deltaX/40}this.deltaY===0&&this.deltaX===0&&t.wheelDelta&&(r?this.deltaY=t.wheelDelta/(120*c):this.deltaY=t.wheelDelta/120)}}preventDefault(){var t;(t=this.browserEvent)==null||t.preventDefault()}stopPropagation(){var t;(t=this.browserEvent)==null||t.stopPropagation()}},dD=Object.freeze(function(t,e){let n=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(n)}}}),XY;(t=>{function e(n){return n===t.None||n===t.Cancelled||n instanceof QY?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Mr.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:dD})})(XY||(XY={}));var QY=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?dD:(this._emitter||(this._emitter=new qe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Hx=class{constructor(t,e){this._isDisposed=!1,this._token=-1,typeof t=="function"&&typeof e=="number"&&this.setIfNotSet(t,e)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(t,e){if(this._isDisposed)throw new __("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},e)}setIfNotSet(t,e){if(this._isDisposed)throw new __("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},e))}},ZY=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var t;(t=this.disposable)==null||t.dispose(),this.disposable=void 0}cancelAndSet(t,e,n=globalThis){if(this.isDisposed)throw new __("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{t()},e);this.disposable=En(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},JY;(t=>{async function e(r){let i,s=await Promise.all(r.map(a=>a.then(c=>c,c=>{i||(i=c)})));if(typeof i<"u")throw i;return s}t.settled=e;function n(r){return new Promise(async(i,s)=>{try{await r(i,s)}catch(a){s(a)}})}t.withAsyncBody=n})(JY||(JY={}));var R5=class Xi{static fromArray(e){return new Xi(n=>{n.emitMany(e)})}static fromPromise(e){return new Xi(async n=>{n.emitMany(await e)})}static fromPromises(e){return new Xi(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new Xi(async n=>{await Promise.all(e.map(async r=>{for await(let i of r)n.emitOne(i)}))})}constructor(e,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new qe,queueMicrotask(async()=>{let r={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{await Promise.resolve(e(r)),this.resolve()}catch(i){this.reject(i)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Mr.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(e,n){return new Xi(async r=>{for await(let i of e)r.emitOne(n(i))})}map(e){return Xi.map(this,e)}static filter(e,n){return new Xi(async r=>{for await(let i of e)n(i)&&r.emitOne(i)})}filter(e){return Xi.filter(this,e)}static coalesce(e){return Xi.filter(e,n=>!!n)}coalesce(){return Xi.coalesce(this)}static async toPromise(e){let n=[];for await(let r of e)n.push(r);return n}toPromise(){return Xi.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};R5.EMPTY=R5.fromArray([]);var{getWindow:Qs,getWindowId:eX,onDidRegisterWindow:tX}=function(){let t=new Map,e={window:Uo,disposables:new el};t.set(Uo.vscodeWindowId,e);let n=new qe,r=new qe,i=new qe;function s(a,c){return(typeof a=="number"?t.get(a):void 0)??(c?e:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(a){if(t.has(a.vscodeWindowId))return Lt.None;let c=new el,d={window:a,disposables:c.add(new el)};return t.set(a.vscodeWindowId,d),c.add(En(()=>{t.delete(a.vscodeWindowId),r.fire(a)})),c.add(yt(a,dr.BEFORE_UNLOAD,()=>{i.fire(a)})),n.fire(d),c},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return t.has(a)},getWindowById:s,getWindow(a){var u;let c=a;if((u=c==null?void 0:c.ownerDocument)!=null&&u.defaultView)return c.ownerDocument.defaultView.window;let d=a;return d!=null&&d.view?d.view.window:Uo},getDocument(a){return Qs(a).document}}}(),nX=class{constructor(t,e,n,r){this._node=t,this._type=e,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 yt(t,e,n,r){return new nX(t,e,n,r)}var T5=function(t,e,n,r){return yt(t,e,n,r)},$x,rX=class extends ZY{constructor(t){super(),this.defaultTarget=t&&Qs(t)}cancelAndSet(t,e,n){return super.cancelAndSet(t,e,n??this.defaultTarget)}},M5=class{constructor(t,e=0){this._runner=t,this.priority=e,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(t){up(t)}}static sort(t,e){return e.priority-t.priority}};(function(){let t=new Map,e=new Map,n=new Map,r=new Map,i=s=>{n.set(s,!1);let a=t.get(s)??[];for(e.set(s,a),t.set(s,[]),r.set(s,!0);a.length>0;)a.sort(M5.sort),a.shift().execute();r.set(s,!1)};$x=(s,a,c=0)=>{let d=eX(s),u=new M5(a,c),f=t.get(d);return f||(f=[],t.set(d,f)),f.push(u),n.get(d)||(n.set(d,!0),s.requestAnimationFrame(()=>i(d))),u}})();function iX(t){let e=t.getBoundingClientRect(),n=Qs(t);return{left:e.left+n.scrollX,top:e.top+n.scrollY,width:e.width,height:e.height}}var dr={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"},sX=class{constructor(t){this.domNode=t,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(t){let e=ai(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=ai(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=ai(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=ai(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=ai(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=ai(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=ai(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=ai(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=ai(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=ai(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=ai(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=ai(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=ai(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=ai(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function ai(t){return typeof t=="number"?`${t}px`:t}function uh(t){return new sX(t)}var hD=class{constructor(){this._hooks=new el,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(t,e){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,t&&n&&n(e)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(t,e,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let s=t;try{t.setPointerCapture(e),this._hooks.add(En(()=>{try{t.releasePointerCapture(e)}catch{}}))}catch{s=Qs(t)}this._hooks.add(yt(s,dr.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(yt(s,dr.POINTER_UP,a=>this.stopMonitoring(!0)))}};function oX(t,e,n){let r=null,i=null;if(typeof n.value=="function"?(r="value",i=n.value,i.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",i=n.get),!i)throw new Error("not supported");let s=`$memoize$${e}`;n[r]=function(...a){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,a)}),this[s]}}var Vs;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(Vs||(Vs={}));var eh=class jr extends Lt{constructor(){super(),this.dispatched=!1,this.targets=new _5,this.ignoreTargets=new _5,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Mr.runAndSubscribe(tX,({window:e,disposables:n})=>{n.add(yt(e.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(yt(e.document,"touchend",r=>this.onTouchEnd(e,r))),n.add(yt(e.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:Uo,disposables:this._store}))}static addTarget(e){if(!jr.isTouchDevice())return Lt.None;jr.INSTANCE||(jr.INSTANCE=new jr);let n=jr.INSTANCE.targets.push(e);return En(n)}static ignoreTarget(e){if(!jr.isTouchDevice())return Lt.None;jr.INSTANCE||(jr.INSTANCE=new jr);let n=jr.INSTANCE.ignoreTargets.push(e);return En(n)}static isTouchDevice(){return"ontouchstart"in Uo||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,i=e.targetTouches.length;r<i;r++){let s=e.targetTouches.item(r);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:n,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[n],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};let a=this.newGestureEvent(Vs.Start,s.target);a.pageX=s.pageX,a.pageY=s.pageY,this.dispatchEvent(a)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let s=0,a=n.changedTouches.length;s<a;s++){let c=n.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(c.identifier))){console.warn("move of an UNKNOWN touch",c);continue}let d=this.activeTouches[c.identifier],u=Date.now()-d.initialTimeStamp;if(u<jr.HOLD_DELAY&&Math.abs(d.initialPageX-Ei(d.rollingPageX))<30&&Math.abs(d.initialPageY-Ei(d.rollingPageY))<30){let f=this.newGestureEvent(Vs.Tap,d.initialTarget);f.pageX=Ei(d.rollingPageX),f.pageY=Ei(d.rollingPageY),this.dispatchEvent(f)}else if(u>=jr.HOLD_DELAY&&Math.abs(d.initialPageX-Ei(d.rollingPageX))<30&&Math.abs(d.initialPageY-Ei(d.rollingPageY))<30){let f=this.newGestureEvent(Vs.Contextmenu,d.initialTarget);f.pageX=Ei(d.rollingPageX),f.pageY=Ei(d.rollingPageY),this.dispatchEvent(f)}else if(i===1){let f=Ei(d.rollingPageX),m=Ei(d.rollingPageY),v=Ei(d.rollingTimestamps)-d.rollingTimestamps[0],b=f-d.rollingPageX[0],S=m-d.rollingPageY[0],x=[...this.targets].filter(C=>d.initialTarget instanceof Node&&C.contains(d.initialTarget));this.inertia(e,x,r,Math.abs(b)/v,b>0?1:-1,f,Math.abs(S)/v,S>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(Vs.End,d.initialTarget)),delete this.activeTouches[c.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,n){let r=document.createEvent("CustomEvent");return r.initEvent(e,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(e){if(e.type===Vs.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>jr.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,e.tapCount=r}else(e.type===Vs.Change||e.type===Vs.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(e.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(e.initialTarget)){let i=0,s=e.initialTarget;for(;s&&s!==r;)i++,s=s.parentElement;n.push([i,r])}n.sort((r,i)=>r[0]-i[0]);for(let[r,i]of n)i.dispatchEvent(e),this.dispatched=!0}}inertia(e,n,r,i,s,a,c,d,u){this.handle=$x(e,()=>{let f=Date.now(),m=f-r,v=0,b=0,S=!0;i+=jr.SCROLL_FRICTION*m,c+=jr.SCROLL_FRICTION*m,i>0&&(S=!1,v=s*i*m),c>0&&(S=!1,b=d*c*m);let x=this.newGestureEvent(Vs.Change);x.translationX=v,x.translationY=b,n.forEach(C=>C.dispatchEvent(x)),S||this.inertia(e,n,f,i,s,a+v,c,d,u+b)})}onTouchMove(e){let n=Date.now();for(let r=0,i=e.changedTouches.length;r<i;r++){let s=e.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}let a=this.activeTouches[s.identifier],c=this.newGestureEvent(Vs.Change,a.initialTarget);c.translationX=s.pageX-Ei(a.rollingPageX),c.translationY=s.pageY-Ei(a.rollingPageY),c.pageX=s.pageX,c.pageY=s.pageY,this.dispatchEvent(c),a.rollingPageX.length>3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(s.pageX),a.rollingPageY.push(s.pageY),a.rollingTimestamps.push(n)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};eh.SCROLL_FRICTION=-.005,eh.HOLD_DELAY=700,eh.CLEAR_TAP_COUNT_TIME=400,Ln([oX],eh,"isTouchDevice",1);var aX=eh,Ux=class extends Lt{onclick(t,e){this._register(yt(t,dr.CLICK,n=>e(new Tm(Qs(t),n))))}onmousedown(t,e){this._register(yt(t,dr.MOUSE_DOWN,n=>e(new Tm(Qs(t),n))))}onmouseover(t,e){this._register(yt(t,dr.MOUSE_OVER,n=>e(new Tm(Qs(t),n))))}onmouseleave(t,e){this._register(yt(t,dr.MOUSE_LEAVE,n=>e(new Tm(Qs(t),n))))}onkeydown(t,e){this._register(yt(t,dr.KEY_DOWN,n=>e(new C5(n))))}onkeyup(t,e){this._register(yt(t,dr.KEY_UP,n=>e(new C5(n))))}oninput(t,e){this._register(yt(t,dr.INPUT,e))}onblur(t,e){this._register(yt(t,dr.BLUR,e))}onfocus(t,e){this._register(yt(t,dr.FOCUS,e))}onchange(t,e){this._register(yt(t,dr.CHANGE,e))}ignoreGesture(t){return aX.ignoreTarget(t)}},A5=11,lX=class extends Ux{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=A5+"px",this.domNode.style.height=A5+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new hD),this._register(T5(this.bgDomNode,dr.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(T5(this.domNode,dr.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new rX),this._pointerdownScheduleRepeatTimer=this._register(new Hx)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Qs(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},cX=class T_{constructor(e,n,r,i,s,a,c){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,i=i|0,s=s|0,a=a|0,c=c|0),this.rawScrollLeft=i,this.rawScrollTop=c,n<0&&(n=0),i+n>r&&(i=r-n),i<0&&(i=0),s<0&&(s=0),c+s>a&&(c=a-s),c<0&&(c=0),this.width=n,this.scrollWidth=r,this.scrollLeft=i,this.height=s,this.scrollHeight=a,this.scrollTop=c}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,n){return new T_(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new T_(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,n){let r=this.width!==e.width,i=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,c=this.scrollHeight!==e.scrollHeight,d=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:n,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:i,scrollLeftChanged:s,heightChanged:a,scrollHeightChanged:c,scrollTopChanged:d}}},uX=class extends Lt{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new qe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new cX(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,e){var r;let n=this._state.withScrollDimensions(t,e);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(t){let e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(t,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let n=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;e?r=new D5(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(t);this._smoothScrolling=D5.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 t=this._smoothScrolling.tick(),e=this._state.withScrollPosition(t);if(this._setState(e,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,e){let n=this._state;n.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(n,e)))}},N5=class{constructor(t,e,n){this.scrollLeft=t,this.scrollTop=e,this.isDone=n}};function jb(t,e){let n=e-t;return function(r){return t+n*fX(r)}}function dX(t,e,n){return function(r){return r<n?t(r/n):e((r-n)/(1-n))}}var D5=class M_{constructor(e,n,r,i){this.from=e,this.to=n,this.duration=i,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(e,n,r){if(Math.abs(e-n)>2.5*r){let i,s;return e<n?(i=e+.75*r,s=n-.75*r):(i=e-.75*r,s=n+.75*r),dX(jb(e,i),jb(s,n),.33)}return jb(e,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let n=(e-this.startTime)/this.duration;if(n<1){let r=this.scrollLeft(n),i=this.scrollTop(n);return new N5(r,i,!1)}return new N5(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,n,r){return M_.start(e,n,r)}static start(e,n,r){r=r+10;let i=Date.now()-10;return new M_(e,n,i,r)}};function hX(t){return Math.pow(t,3)}function fX(t){return 1-hX(1-t)}var mX=class extends Lt{constructor(t,e,n){super(),this._visibility=t,this._visibleClassName=e,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Hx)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this._updateShouldBeVisible())}setShouldBeVisible(t){this._rawShouldBeVisible=t,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let t=this._applyVisibilitySetting();this._shouldBeVisible!==t&&(this._shouldBeVisible=t,this.ensureVisibility())}setIsNeeded(t){this._isNeeded!==t&&(this._isNeeded=t,this.ensureVisibility())}setDomNode(t){this._domNode=t,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 t;(t=this._domNode)==null||t.setClassName(this._visibleClassName)},0))}_hide(t){var e;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(e=this._domNode)==null||e.setClassName(this._invisibleClassName+(t?" fade":"")))}},pX=140,fD=class extends Ux{constructor(t){super(),this._lazyRender=t.lazyRender,this._host=t.host,this._scrollable=t.scrollable,this._scrollByPage=t.scrollByPage,this._scrollbarState=t.scrollbarState,this._visibilityController=this._register(new mX(t.visibility,"visible scrollbar "+t.extraScrollbarClassName,"invisible scrollbar "+t.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new hD),this._shouldRender=!0,this.domNode=uh(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(yt(this.domNode.domNode,dr.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(t){let e=this._register(new lX(t));this.domNode.domNode.appendChild(e.bgDomNode),this.domNode.domNode.appendChild(e.domNode)}_createSlider(t,e,n,r){this.slider=uh(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(t),this.slider.setLeft(e),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(yt(this.slider.domNode,dr.POINTER_DOWN,i=>{i.button===0&&(i.preventDefault(),this._sliderPointerDown(i))})),this.onclick(this.slider.domNode,i=>{i.leftButton&&i.stopPropagation()})}_onElementSize(t){return this._scrollbarState.setVisibleSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(t){return this._scrollbarState.setScrollSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(t){return this._scrollbarState.setScrollPosition(t)&&(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(t){t.target===this.domNode.domNode&&this._onPointerDown(t)}delegatePointerDown(t){let e=this.domNode.domNode.getClientRects()[0].top,n=e+this._scrollbarState.getSliderPosition(),r=e+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(t);n<=i&&i<=r?t.button===0&&(t.preventDefault(),this._sliderPointerDown(t)):this._onPointerDown(t)}_onPointerDown(t){let e,n;if(t.target===this.domNode.domNode&&typeof t.offsetX=="number"&&typeof t.offsetY=="number")e=t.offsetX,n=t.offsetY;else{let i=iX(this.domNode.domNode);e=t.pageX-i.left,n=t.pageY-i.top}let r=this._pointerDownRelativePosition(e,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),t.button===0&&(t.preventDefault(),this._sliderPointerDown(t))}_sliderPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=this._sliderPointerPosition(t),n=this._sliderOrthogonalPointerPosition(t),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,i=>{let s=this._sliderOrthogonalPointerPosition(i),a=Math.abs(s-n);if(lD&&a>pX){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let c=this._sliderPointerPosition(i)-e;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(t){let e={};this.writeScrollPosition(e,t),this._scrollable.setScrollPositionNow(e)}updateScrollbarSize(t){this._updateScrollbarSize(t),this._scrollbarState.setScrollbarSize(t),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},mD=class A_{constructor(e,n,r,i,s,a){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(e),this._visibleSize=i,this._scrollSize=s,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new A_(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let n=Math.round(e);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(e){let n=Math.round(e);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let n=Math.round(e);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,n,r,i,s){let a=Math.max(0,r-e),c=Math.max(0,a-2*n),d=i>0&&i>r;if(!d)return{computedAvailableSize:Math.round(a),computedIsNeeded:d,computedSliderSize:Math.round(c),computedSliderRatio:0,computedSliderPosition:0};let u=Math.round(Math.max(20,Math.floor(r*c/i))),f=(c-u)/(i-r),m=s*f;return{computedAvailableSize:Math.round(a),computedIsNeeded:d,computedSliderSize:Math.round(u),computedSliderRatio:f,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let e=A_._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.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(e){if(!this._computedIsNeeded)return 0;let n=e-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let n=e-this._arrowSize,r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+e;return Math.round(n/this._computedSliderRatio)}},gX=class extends fD{constructor(t,e,n){let r=t.getScrollDimensions(),i=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:n,scrollbarState:new mD(e.horizontalHasArrows?e.arrowSize:0,e.horizontal===2?0:e.horizontalScrollbarSize,e.vertical===2?0:e.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:e.horizontal,extraScrollbarClassName:"horizontal",scrollable:t,scrollByPage:e.scrollByPage}),e.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((e.horizontalScrollbarSize-e.horizontalSliderSize)/2),0,void 0,e.horizontalSliderSize)}_updateSlider(t,e){this.slider.setWidth(t),this.slider.setLeft(e)}_renderDomNode(t,e){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(t.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,e){return t}_sliderPointerPosition(t){return t.pageX}_sliderOrthogonalPointerPosition(t){return t.pageY}_updateScrollbarSize(t){this.slider.setHeight(t)}writeScrollPosition(t,e){t.scrollLeft=e}updateOptions(t){this.updateScrollbarSize(t.horizontal===2?0:t.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._visibilityController.setVisibility(t.horizontal),this._scrollByPage=t.scrollByPage}},vX=class extends fD{constructor(t,e,n){let r=t.getScrollDimensions(),i=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:n,scrollbarState:new mD(e.verticalHasArrows?e.arrowSize:0,e.vertical===2?0:e.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:e.vertical,extraScrollbarClassName:"vertical",scrollable:t,scrollByPage:e.scrollByPage}),e.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((e.verticalScrollbarSize-e.verticalSliderSize)/2),e.verticalSliderSize,void 0)}_updateSlider(t,e){this.slider.setHeight(t),this.slider.setTop(e)}_renderDomNode(t,e){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(t.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,e){return e}_sliderPointerPosition(t){return t.pageY}_sliderOrthogonalPointerPosition(t){return t.pageX}_updateScrollbarSize(t){this.slider.setWidth(t)}writeScrollPosition(t,e){t.scrollTop=e}updateOptions(t){this.updateScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(t.vertical),this._scrollByPage=t.scrollByPage}},bX=500,O5=50,_X=class{constructor(t,e,n){this.timestamp=t,this.deltaX=e,this.deltaY=n,this.score=0}},N_=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,n=0,r=1,i=this._rear;do{let s=i===this._front?e:Math.pow(2,-r);if(e-=s,n+=this._memory[i].score*s,i===this._front)break;i=(this._capacity+i-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(e){if(Bx){let n=Qs(e.browserEvent),r=AY(n);this.accept(Date.now(),e.deltaX*r,e.deltaY*r)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,n,r){let i=null,s=new _X(e,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(i=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]=s),s.score=this._computeScore(s,i)}_computeScore(e,n){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(r+=.25),n){let i=Math.abs(e.deltaX),s=Math.abs(e.deltaY),a=Math.abs(n.deltaX),c=Math.abs(n.deltaY),d=Math.max(Math.min(i,a),1),u=Math.max(Math.min(s,c),1),f=Math.max(i,a),m=Math.max(s,c);f%d===0&&m%u===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};N_.INSTANCE=new N_;var yX=N_,xX=class extends Ux{constructor(t,e,n){super(),this._onScroll=this._register(new qe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new qe),this.onWillScroll=this._onWillScroll.event,this._options=wX(e),this._scrollable=n,this._register(this._scrollable.onScroll(i=>{this._onWillScroll.fire(i),this._onDidScroll(i),this._onScroll.fire(i)}));let r={onMouseWheel:i=>this._onMouseWheel(i),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new vX(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new gX(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(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=uh(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=uh(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=uh(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,i=>this._onMouseOver(i)),this.onmouseleave(this._listenOnDomNode,i=>this._onMouseLeave(i)),this._hideTimeout=this._register(new Hx),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Zl(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,eo&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new E5(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=Zl(this._mouseWheelToDispose),t)){let e=n=>{this._onMouseWheel(new E5(n))};this._mouseWheelToDispose.push(yt(this._listenOnDomNode,dr.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){var i;if((i=t.browserEvent)!=null&&i.defaultPrevented)return;let e=yX.INSTANCE;e.acceptStandardWheelEvent(t);let n=!1;if(t.deltaY||t.deltaX){let s=t.deltaY*this._options.mouseWheelScrollSensitivity,a=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);let c=!eo&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||c)&&!a&&(a=s,s=0),t.browserEvent&&t.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);let d=this._scrollable.getFutureScrollPosition(),u={};if(s){let f=O5*s,m=d.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(u,m)}if(a){let f=O5*a,m=d.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(u,m)}u=this._scrollable.validateScrollPosition(u),(d.scrollLeft!==u.scrollLeft||d.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&e.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||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 t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,n=t.scrollLeft>0,r=n?" left":"",i=e?" top":"",s=n||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){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(),bX)}},SX=class extends xX{constructor(t,e,n){super(t,e,n)}setScrollPosition(t){t.reuseAnimation?this._scrollable.setScrollPositionSmooth(t,t.reuseAnimation):this._scrollable.setScrollPositionNow(t)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function wX(t){let e={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return e.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:e.verticalScrollbarSize,eo&&(e.className+=" mac"),e}var D_=class extends Lt{constructor(t,e,n,r,i,s,a,c){super(),this._bufferService=n,this._optionsService=a,this._renderService=c,this._onRequestScrollLines=this._register(new qe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let d=this._register(new uX({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:u=>$x(r.window,u)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{d.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new SX(e,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},d)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(u=>{this._scrollableElement.updateOptions({handleMouseWheel:!(u&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Mr.runAndSubscribe(s.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=s.colors.background.css})),t.appendChild(this._scrollableElement.getDomNode()),this._register(En(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),e.appendChild(this._styleElement),this._register(En(()=>this._styleElement.remove())),this._register(Mr.runAndSubscribe(s.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${s.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${s.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${s.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
521
|
+
`)})),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(u=>this._handleScroll(u)))}scrollLines(t){let e=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:e.scrollTop+t*this._renderService.dimensions.css.cell.height})}scrollToLine(t,e){e&&(this._latestYDisp=t),this._scrollableElement.setScrollPosition({reuseAnimation:!e,scrollTop:t*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var t;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((t=this._optionsService.rawOptions.overviewRuler)==null?void 0:t.width)||14}}queueSync(t){t!==void 0&&(this._latestYDisp=t),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(t=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,t!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:t*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(t){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let e=Math.round(t.scrollTop/this._renderService.dimensions.css.cell.height),n=e-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=e,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};D_=Ln([et(2,Qr),et(3,Zo),et(4,GN),et(5,$u),et(6,Zr),et(7,Jo)],D_);var O_=class extends Lt{constructor(t,e,n,r,i){super(),this._screenElement=t,this._bufferService=e,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,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(s=>this._removeDecoration(s))),this._register(En(()=>{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 t of this._decorationService.decorations)this._renderDecoration(t);this._dimensionsChanged=!1}_renderDecoration(t){this._refreshStyle(t),this._dimensionsChanged&&this._refreshXPosition(t)}_createElement(t){var r;let e=this._coreBrowserService.mainDocument.createElement("div");e.classList.add("xterm-decoration"),e.classList.toggle("xterm-decoration-top-layer",((r=t==null?void 0:t.options)==null?void 0:r.layer)==="top"),e.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,e.style.height=`${(t.options.height||1)*this._renderService.dimensions.css.cell.height}px`,e.style.top=`${(t.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,e.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=t.options.x??0;return n&&n>this._bufferService.cols&&(e.style.display="none"),this._refreshXPosition(t,e),e}_refreshStyle(t){let e=t.marker.line-this._bufferService.buffers.active.ydisp;if(e<0||e>=this._bufferService.rows)t.element&&(t.element.style.display="none",t.onRenderEmitter.fire(t.element));else{let n=this._decorationElements.get(t);n||(n=this._createElement(t),t.element=n,this._decorationElements.set(t,n),this._container.appendChild(n),t.onDispose(()=>{this._decorationElements.delete(t),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(t.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${e*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),t.onRenderEmitter.fire(n)}}_refreshXPosition(t,e=t.element){if(!e)return;let n=t.options.x??0;(t.options.anchor||"left")==="right"?e.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":e.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(t){var e;(e=this._decorationElements.get(t))==null||e.remove(),this._decorationElements.delete(t),t.dispose()}};O_=Ln([et(1,Qr),et(2,Zo),et(3,Kh),et(4,Jo)],O_);var CX=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(t){if(t.options.overviewRulerOptions){for(let e of this._zones)if(e.color===t.options.overviewRulerOptions.color&&e.position===t.options.overviewRulerOptions.position){if(this._lineIntersectsZone(e,t.marker.line))return;if(this._lineAdjacentToZone(e,t.marker.line,t.options.overviewRulerOptions.position)){this._addLineToZone(e,t.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=t.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=t.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=t.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=t.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:t.options.overviewRulerOptions.color,position:t.options.overviewRulerOptions.position,startBufferLine:t.marker.line,endBufferLine:t.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(t){this._linePadding=t}_lineIntersectsZone(t,e){return e>=t.startBufferLine&&e<=t.endBufferLine}_lineAdjacentToZone(t,e,n){return e>=t.startBufferLine-this._linePadding[n||"full"]&&e<=t.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(t,e){t.startBufferLine=Math.min(t.startBufferLine,e),t.endBufferLine=Math.max(t.endBufferLine,e)}},Us={full:0,left:0,center:0,right:0},Pa={full:0,left:0,center:0,right:0},Id={full:0,left:0,center:0,right:0},Wp=class extends Lt{constructor(t,e,n,r,i,s,a,c){var u;super(),this._viewportElement=t,this._screenElement=e,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=s,this._themeService=a,this._coreBrowserService=c,this._colorZoneStore=new CX,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(),(u=this._viewportElement.parentElement)==null||u.insertBefore(this._canvas,this._viewportElement),this._register(En(()=>{var f;return(f=this._canvas)==null?void 0:f.remove()}));let d=this._canvas.getContext("2d");if(d)this._ctx=d;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var t;return((t=this._optionsService.options.overviewRuler)==null?void 0:t.width)||0}_refreshDrawConstants(){let t=Math.floor((this._canvas.width-1)/3),e=Math.ceil((this._canvas.width-1)/3);Pa.full=this._canvas.width,Pa.left=t,Pa.center=e,Pa.right=t,this._refreshDrawHeightConstants(),Id.full=1,Id.left=1,Id.center=1+Pa.left,Id.right=1+Pa.left+Pa.center}_refreshDrawHeightConstants(){Us.full=Math.round(2*this._coreBrowserService.dpr);let t=this._canvas.height/this._bufferService.buffer.lines.length,e=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);Us.left=e,Us.center=e,Us.right=e}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Us.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Us.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Us.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Us.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 e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let t=this._colorZoneStore.zones;for(let e of t)e.position!=="full"&&this._renderColorZone(e);for(let e of t)e.position==="full"&&this._renderColorZone(e);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(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(Id[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-Us[t.position||"full"]/2),Pa[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+Us[t.position||"full"]))}_queueRefresh(t,e){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=e||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Wp=Ln([et(2,Qr),et(3,Kh),et(4,Jo),et(5,Zr),et(6,$u),et(7,Zo)],Wp);var De;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=`
|
|
522
|
+
`,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(De||(De={}));var fp;(t=>(t.PAD="",t.HOP="",t.BPH="",t.NBH="",t.IND="",t.NEL="
",t.SSA="",t.ESA="",t.HTS="",t.HTJ="",t.VTS="",t.PLD="",t.PLU="",t.RI="",t.SS2="",t.SS3="",t.DCS="",t.PU1="",t.PU2="",t.STS="",t.CCH="",t.MW="",t.SPA="",t.EPA="",t.SOS="",t.SGCI="",t.SCI="",t.CSI="",t.ST="",t.OSC="",t.PM="",t.APC=""))(fp||(fp={}));var pD;(t=>t.ST=`${De.ESC}\\`)(pD||(pD={}));var j_=class{constructor(t,e,n,r,i,s){this._textarea=t,this._compositionView=e,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=s,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(t){this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(t){if(this._isComposing||this._isSendingComposition){if(t.keyCode===20||t.keyCode===229||t.keyCode===16||t.keyCode===17||t.keyCode===18)return!1;this._finalizeComposition(!1)}return t.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(t){if(this._compositionView.classList.remove("active"),this._isComposing=!1,t){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;e.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(e.start,this._compositionPosition.start):n=this._textarea.value.substring(e.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let t=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let e=this._textarea.value,n=e.replace(t,"");this._dataAlreadySent=n,e.length>t.length?this._coreService.triggerDataEvent(n,!0):e.length<t.length?this._coreService.triggerDataEvent(`${De.DEL}`,!0):e.length===t.length&&e!==t&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(t){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=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,i=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"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 s=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}t||setTimeout(()=>this.updateCompositionElements(!0),0)}}};j_=Ln([et(2,Qr),et(3,Zr),et(4,lc),et(5,Jo)],j_);var vr=0,br=0,_r=0,jn=0,j5={css:"#00000000",rgba:0},Qn;(t=>{function e(i,s,a,c){return c!==void 0?`#${Ol(i)}${Ol(s)}${Ol(a)}${Ol(c)}`:`#${Ol(i)}${Ol(s)}${Ol(a)}`}t.toCss=e;function n(i,s,a,c=255){return(i<<24|s<<16|a<<8|c)>>>0}t.toRgba=n;function r(i,s,a,c){return{css:t.toCss(i,s,a,c),rgba:t.toRgba(i,s,a,c)}}t.toColor=r})(Qn||(Qn={}));var Sn;(t=>{function e(d,u){if(jn=(u.rgba&255)/255,jn===1)return{css:u.css,rgba:u.rgba};let f=u.rgba>>24&255,m=u.rgba>>16&255,v=u.rgba>>8&255,b=d.rgba>>24&255,S=d.rgba>>16&255,x=d.rgba>>8&255;vr=b+Math.round((f-b)*jn),br=S+Math.round((m-S)*jn),_r=x+Math.round((v-x)*jn);let C=Qn.toCss(vr,br,_r),k=Qn.toRgba(vr,br,_r);return{css:C,rgba:k}}t.blend=e;function n(d){return(d.rgba&255)===255}t.isOpaque=n;function r(d,u,f){let m=mp.ensureContrastRatio(d.rgba,u.rgba,f);if(m)return Qn.toColor(m>>24&255,m>>16&255,m>>8&255)}t.ensureContrastRatio=r;function i(d){let u=(d.rgba|255)>>>0;return[vr,br,_r]=mp.toChannels(u),{css:Qn.toCss(vr,br,_r),rgba:u}}t.opaque=i;function s(d,u){return jn=Math.round(u*255),[vr,br,_r]=mp.toChannels(d.rgba),{css:Qn.toCss(vr,br,_r,jn),rgba:Qn.toRgba(vr,br,_r,jn)}}t.opacity=s;function a(d,u){return jn=d.rgba&255,s(d,jn*u/255)}t.multiplyOpacity=a;function c(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}t.toColorRGB=c})(Sn||(Sn={}));var Mn;(t=>{let e,n;try{let i=document.createElement("canvas");i.width=1,i.height=1;let s=i.getContext("2d",{willReadFrequently:!0});s&&(e=s,e.globalCompositeOperation="copy",n=e.createLinearGradient(0,0,1,1))}catch{}function r(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return vr=parseInt(i.slice(1,2).repeat(2),16),br=parseInt(i.slice(2,3).repeat(2),16),_r=parseInt(i.slice(3,4).repeat(2),16),Qn.toColor(vr,br,_r);case 5:return vr=parseInt(i.slice(1,2).repeat(2),16),br=parseInt(i.slice(2,3).repeat(2),16),_r=parseInt(i.slice(3,4).repeat(2),16),jn=parseInt(i.slice(4,5).repeat(2),16),Qn.toColor(vr,br,_r,jn);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let s=i.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return vr=parseInt(s[1]),br=parseInt(s[2]),_r=parseInt(s[3]),jn=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),Qn.toColor(vr,br,_r,jn);if(!e||!n)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=n,e.fillStyle=i,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[vr,br,_r,jn]=e.getImageData(0,0,1,1).data,jn!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Qn.toRgba(vr,br,_r,jn),css:i}}t.toColor=r})(Mn||(Mn={}));var Wr;(t=>{function e(r){return n(r>>16&255,r>>8&255,r&255)}t.relativeLuminance=e;function n(r,i,s){let a=r/255,c=i/255,d=s/255,u=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),f=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),m=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return u*.2126+f*.7152+m*.0722}t.relativeLuminance2=n})(Wr||(Wr={}));var mp;(t=>{function e(a,c){if(jn=(c&255)/255,jn===1)return c;let d=c>>24&255,u=c>>16&255,f=c>>8&255,m=a>>24&255,v=a>>16&255,b=a>>8&255;return vr=m+Math.round((d-m)*jn),br=v+Math.round((u-v)*jn),_r=b+Math.round((f-b)*jn),Qn.toRgba(vr,br,_r)}t.blend=e;function n(a,c,d){let u=Wr.relativeLuminance(a>>8),f=Wr.relativeLuminance(c>>8);if(Oo(u,f)<d){if(f<u){let b=r(a,c,d),S=Oo(u,Wr.relativeLuminance(b>>8));if(S<d){let x=i(a,c,d),C=Oo(u,Wr.relativeLuminance(x>>8));return S>C?b:x}return b}let m=i(a,c,d),v=Oo(u,Wr.relativeLuminance(m>>8));if(v<d){let b=r(a,c,d),S=Oo(u,Wr.relativeLuminance(b>>8));return v>S?m:b}return m}}t.ensureContrastRatio=n;function r(a,c,d){let u=a>>24&255,f=a>>16&255,m=a>>8&255,v=c>>24&255,b=c>>16&255,S=c>>8&255,x=Oo(Wr.relativeLuminance2(v,b,S),Wr.relativeLuminance2(u,f,m));for(;x<d&&(v>0||b>0||S>0);)v-=Math.max(0,Math.ceil(v*.1)),b-=Math.max(0,Math.ceil(b*.1)),S-=Math.max(0,Math.ceil(S*.1)),x=Oo(Wr.relativeLuminance2(v,b,S),Wr.relativeLuminance2(u,f,m));return(v<<24|b<<16|S<<8|255)>>>0}t.reduceLuminance=r;function i(a,c,d){let u=a>>24&255,f=a>>16&255,m=a>>8&255,v=c>>24&255,b=c>>16&255,S=c>>8&255,x=Oo(Wr.relativeLuminance2(v,b,S),Wr.relativeLuminance2(u,f,m));for(;x<d&&(v<255||b<255||S<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),x=Oo(Wr.relativeLuminance2(v,b,S),Wr.relativeLuminance2(u,f,m));return(v<<24|b<<16|S<<8|255)>>>0}t.increaseLuminance=i;function s(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}t.toChannels=s})(mp||(mp={}));function Ol(t){let e=t.toString(16);return e.length<2?"0"+e:e}function Oo(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var kX=class extends qh{constructor(t,e,n){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Vp=class{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new ns}register(t){let e={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];let e=this._bufferService.buffer.lines.get(t);if(!e||e.length===0)return[];let n=[],r=e.translateToString(!0),i=0,s=0,a=0,c=e.getFg(0),d=e.getBg(0);for(let u=0;u<e.getTrimmedLength();u++)if(e.loadCell(u,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==d){if(u-i>1){let f=this._getJoinedRanges(r,a,s,e,i);for(let m=0;m<f.length;m++)n.push(f[m])}i=u,a=s,c=this._workCell.fg,d=this._workCell.bg}s+=this._workCell.getChars().length||Qa.length}if(this._bufferService.cols-i>1){let u=this._getJoinedRanges(r,a,s,e,i);for(let f=0;f<u.length;f++)n.push(u[f])}return n}_getJoinedRanges(t,e,n,r,i){let s=t.substring(e,n),a=[];try{a=this._characterJoiners[0].handler(s)}catch(c){console.error(c)}for(let c=1;c<this._characterJoiners.length;c++)try{let d=this._characterJoiners[c].handler(s);for(let u=0;u<d.length;u++)Vp._mergeRanges(a,d[u])}catch(d){console.error(d)}return this._stringRangesToCellRanges(a,r,i),a}_stringRangesToCellRanges(t,e,n){let r=0,i=!1,s=0,a=t[r];if(a){for(let c=n;c<this._bufferService.cols;c++){let d=e.getWidth(c),u=e.getString(c).length||Qa.length;if(d!==0){if(!i&&a[0]<=s&&(a[0]=c,i=!0),a[1]<=s){if(a[1]=c,a=t[++r],!a)break;a[0]<=s?(a[0]=c,i=!0):i=!1}s+=u}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(t,e){let n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(n){if(e[1]<=i[0])return t[r-1][1]=e[1],t;if(e[1]<=i[1])return t[r-1][1]=Math.max(e[1],i[1]),t.splice(r,1),t;t.splice(r,1),r--}else{if(e[1]<=i[0])return t.splice(r,0,e),t;if(e[1]<=i[1])return i[0]=Math.min(e[0],i[0]),t;e[0]<i[1]&&(i[0]=Math.min(e[0],i[0]),n=!0);continue}}return n?t[t.length-1][1]=e[1]:t.push(e),t}};Vp=Ln([et(0,Qr)],Vp);function EX(t){return 57508<=t&&t<=57558}function RX(t){return 9472<=t&&t<=9631}function TX(t){return EX(t)||RX(t)}function MX(){return{css:{canvas:Mm(),cell:Mm()},device:{canvas:Mm(),cell:Mm(),char:{width:0,height:0,left:0,top:0}}}}function Mm(){return{width:0,height:0}}var L_=class{constructor(t,e,n,r,i,s,a){this._document=t,this._characterJoinerService=e,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=s,this._themeService=a,this._workCell=new ns,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(t,e,n){this._selectionStart=t,this._selectionEnd=e,this._columnSelectMode=n}createRow(t,e,n,r,i,s,a,c,d,u,f){let m=[],v=this._characterJoinerService.getJoinedCharacters(e),b=this._themeService.colors,S=t.getNoBgTrimmedLength();n&&S<s+1&&(S=s+1);let x,C=0,k="",E=0,R=0,M=0,O=0,D=!1,P=0,z=!1,Y=0,L=0,W=[],V=u!==-1&&f!==-1;for(let F=0;F<S;F++){t.loadCell(F,this._workCell);let U=this._workCell.getWidth();if(U===0)continue;let H=!1,j=F>=L,G=F,B=this._workCell;if(v.length>0&&F===v[0][0]&&j){let ee=v.shift(),Q=this._isCellInSelection(ee[0],e);for(E=ee[0]+1;E<ee[1];E++)j&&(j=Q===this._isCellInSelection(E,e));j&&(j=!n||s<ee[0]||s>=ee[1]),j?(H=!0,B=new kX(this._workCell,t.translateToString(!0,ee[0],ee[1]),ee[1]-ee[0]),G=ee[1]-1,U=B.getWidth()):L=ee[1]}let K=this._isCellInSelection(F,e),A=n&&F===s,I=V&&F>=u&&F<=f,$=!1;this._decorationService.forEachDecorationAtCell(F,e,void 0,ee=>{$=!0});let T=B.getChars()||Qa;if(T===" "&&(B.isUnderline()||B.isOverline())&&(T=" "),Y=U*c-d.get(T,B.isBold(),B.isItalic()),!x)x=this._document.createElement("span");else if(C&&(K&&z||!K&&!z&&B.bg===R)&&(K&&z&&b.selectionForeground||B.fg===M)&&B.extended.ext===O&&I===D&&Y===P&&!A&&!H&&!$&&j){B.isInvisible()?k+=Qa:k+=T,C++;continue}else C&&(x.textContent=k),x=this._document.createElement("span"),C=0,k="";if(R=B.bg,M=B.fg,O=B.extended.ext,D=I,P=Y,z=K,H&&s>=F&&s<=G&&(s=F),!this._coreService.isCursorHidden&&A&&this._coreService.isCursorInitialized){if(W.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&W.push("xterm-cursor-blink"),W.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(i)switch(i){case"outline":W.push("xterm-cursor-outline");break;case"block":W.push("xterm-cursor-block");break;case"bar":W.push("xterm-cursor-bar");break;case"underline":W.push("xterm-cursor-underline");break}}if(B.isBold()&&W.push("xterm-bold"),B.isItalic()&&W.push("xterm-italic"),B.isDim()&&W.push("xterm-dim"),B.isInvisible()?k=Qa:k=B.getChars()||Qa,B.isUnderline()&&(W.push(`xterm-underline-${B.extended.underlineStyle}`),k===" "&&(k=" "),!B.isUnderlineColorDefault()))if(B.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${qh.toColorRGB(B.getUnderlineColor()).join(",")})`;else{let ee=B.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&B.isBold()&&ee<8&&(ee+=8),x.style.textDecorationColor=b.ansi[ee].css}B.isOverline()&&(W.push("xterm-overline"),k===" "&&(k=" ")),B.isStrikethrough()&&W.push("xterm-strikethrough"),I&&(x.style.textDecoration="underline");let X=B.getFgColor(),Z=B.getFgColorMode(),J=B.getBgColor(),re=B.getBgColorMode(),ae=!!B.isInverse();if(ae){let ee=X;X=J,J=ee;let Q=Z;Z=re,re=Q}let ue,me,se=!1;this._decorationService.forEachDecorationAtCell(F,e,void 0,ee=>{ee.options.layer!=="top"&&se||(ee.backgroundColorRGB&&(re=50331648,J=ee.backgroundColorRGB.rgba>>8&16777215,ue=ee.backgroundColorRGB),ee.foregroundColorRGB&&(Z=50331648,X=ee.foregroundColorRGB.rgba>>8&16777215,me=ee.foregroundColorRGB),se=ee.options.layer==="top")}),!se&&K&&(ue=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,J=ue.rgba>>8&16777215,re=50331648,se=!0,b.selectionForeground&&(Z=50331648,X=b.selectionForeground.rgba>>8&16777215,me=b.selectionForeground)),se&&W.push("xterm-decoration-top");let oe;switch(re){case 16777216:case 33554432:oe=b.ansi[J],W.push(`xterm-bg-${J}`);break;case 50331648:oe=Qn.toColor(J>>16,J>>8&255,J&255),this._addStyle(x,`background-color:#${L5((J>>>0).toString(16),"0",6)}`);break;case 0:default:ae?(oe=b.foreground,W.push("xterm-bg-257")):oe=b.background}switch(ue||B.isDim()&&(ue=Sn.multiplyOpacity(oe,.5)),Z){case 16777216:case 33554432:B.isBold()&&X<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(X+=8),this._applyMinimumContrast(x,oe,b.ansi[X],B,ue,void 0)||W.push(`xterm-fg-${X}`);break;case 50331648:let ee=Qn.toColor(X>>16&255,X>>8&255,X&255);this._applyMinimumContrast(x,oe,ee,B,ue,me)||this._addStyle(x,`color:#${L5(X.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(x,oe,b.foreground,B,ue,me)||ae&&W.push("xterm-fg-257")}W.length&&(x.className=W.join(" "),W.length=0),!A&&!H&&!$&&j?C++:x.textContent=k,Y!==this.defaultSpacing&&(x.style.letterSpacing=`${Y}px`),m.push(x),F=G}return x&&C&&(x.textContent=k),m}_applyMinimumContrast(t,e,n,r,i,s){if(this._optionsService.rawOptions.minimumContrastRatio===1||TX(r.getCode()))return!1;let a=this._getContrastCache(r),c;if(!i&&!s&&(c=a.getColor(e.rgba,n.rgba)),c===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);c=Sn.ensureContrastRatio(i||e,s||n,d),a.setColor((i||e).rgba,(s||n).rgba,c??null)}return c?(this._addStyle(t,`color:${c.css}`),!0):!1}_getContrastCache(t){return t.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(t,e){t.setAttribute("style",`${t.getAttribute("style")||""}${e};`)}_isCellInSelection(t,e){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?t>=n[0]&&e>=n[1]&&t<r[0]&&e<=r[1]:t<n[0]&&e>=n[1]&&t>=r[0]&&e<=r[1]:e>n[1]&&e<r[1]||n[1]===r[1]&&e===n[1]&&t>=n[0]&&t<r[0]||n[1]<r[1]&&e===r[1]&&t<r[0]||n[1]<r[1]&&e===n[1]&&t>=n[0]}};L_=Ln([et(1,QN),et(2,Zr),et(3,Zo),et(4,lc),et(5,Kh),et(6,$u)],L_);function L5(t,e,n){for(;t.length<n;)t=e+t;return t}var AX=class{constructor(t,e){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=t.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=t.createElement("span");n.classList.add("xterm-char-measure-element");let r=t.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let i=t.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontStyle="italic";let s=t.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold",s.style.fontStyle="italic",this._measureElements=[n,r,i,s],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(s),e.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(t,e,n,r){t===this._font&&e===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=t,this._fontSize=e,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(t,e,n){let r=0;if(!e&&!n&&t.length===1&&(r=t.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let a=this._measure(t,0);return a>0&&(this._flat[r]=a),a}let i=t;e&&(i+="B"),n&&(i+="I");let s=this._holey.get(i);if(s===void 0){let a=0;e&&(a|=1),n&&(a|=2),s=this._measure(t,a),s>0&&this._holey.set(i,s)}return s}_measure(t,e){let n=this._measureElements[e];return n.textContent=t.repeat(32),n.offsetWidth/32}},NX=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(t,e,n,r=!1){if(this.selectionStart=e,this.selectionEnd=n,!e||!n||e[0]===n[0]&&e[1]===n[1]){this.clear();return}let i=t.buffers.active.ydisp,s=e[1]-i,a=n[1]-i,c=Math.max(s,0),d=Math.min(a,t.rows-1);if(c>=t.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=s,this.viewportEndRow=a,this.viewportCappedStartRow=c,this.viewportCappedEndRow=d,this.startCol=e[0],this.endCol=n[0]}isCellSelected(t,e,n){return this.hasSelection?(n-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&n>=this.viewportCappedStartRow&&e<this.endCol&&n<=this.viewportCappedEndRow:e<this.startCol&&n>=this.viewportCappedStartRow&&e>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&e>=this.startCol&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&e>=this.startCol):!1}};function DX(){return new NX}var Lb="xterm-dom-renderer-owner-",Gi="xterm-rows",Am="xterm-fg-",I5="xterm-bg-",Pd="xterm-focus",Nm="xterm-selection",OX=1,I_=class extends Lt{constructor(t,e,n,r,i,s,a,c,d,u,f,m,v,b){super(),this._terminal=t,this._document=e,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=s,this._linkifier2=a,this._charSizeService=d,this._optionsService=u,this._bufferService=f,this._coreService=m,this._coreBrowserService=v,this._themeService=b,this._terminalClass=OX++,this._rowElements=[],this._selectionRenderModel=DX(),this.onRequestRedraw=this._register(new qe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Gi),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(Nm),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=MX(),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=c.createInstance(L_,document),this._element.classList.add(Lb+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(En(()=>{this._element.classList.remove(Lb+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new AX(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 t=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*t,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*t),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/t),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/t),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 e=`${this._terminalSelector} .${Gi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=e,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(t){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let e=`${this._terminalSelector} .${Gi} { pointer-events: none; color: ${t.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;e+=`${this._terminalSelector} .${Gi} .xterm-dim { color: ${Sn.multiplyOpacity(t.foreground,.5).css};}`,e+=`${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}`,i=`blink_block_${this._terminalClass}`;e+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,e+=`@keyframes ${r} { 50% { box-shadow: none; }}`,e+=`@keyframes ${i} { 0% { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css}; } 50% { background-color: inherit; color: ${t.cursor.css}; }}`,e+=`${this._terminalSelector} .${Gi}.${Pd} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Gi}.${Pd} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Gi}.${Pd} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Gi} .xterm-cursor.xterm-cursor-block { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css};}${this._terminalSelector} .${Gi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${t.cursor.css} !important; color: ${t.cursorAccent.css} !important;}${this._terminalSelector} .${Gi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${t.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Gi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${t.cursor.css} inset;}${this._terminalSelector} .${Gi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${t.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,e+=`${this._terminalSelector} .${Nm} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Nm} div { position: absolute; background-color: ${t.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Nm} div { position: absolute; background-color: ${t.selectionInactiveBackgroundOpaque.css};}`;for(let[s,a]of t.ansi.entries())e+=`${this._terminalSelector} .${Am}${s} { color: ${a.css}; }${this._terminalSelector} .${Am}${s}.xterm-dim { color: ${Sn.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${I5}${s} { background-color: ${a.css}; }`;e+=`${this._terminalSelector} .${Am}257 { color: ${Sn.opaque(t.background).css}; }${this._terminalSelector} .${Am}257.xterm-dim { color: ${Sn.multiplyOpacity(Sn.opaque(t.background),.5).css}; }${this._terminalSelector} .${I5}257 { background-color: ${t.foreground.css}; }`,this._themeStyleElement.textContent=e}_setDefaultSpacing(){let t=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${t}px`,this._rowFactory.defaultSpacing=t}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(t,e){for(let n=this._rowElements.length;n<=e;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(t,e){this._refreshRowElements(t,e),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(Pd),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Pd),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(t,e,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(t,e,n),this.renderRows(0,this._bufferService.rows-1),!t||!e||(this._selectionRenderModel.update(this._terminal,t,e,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,s=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,c=this._document.createDocumentFragment();if(n){let d=t[0]>e[0];c.appendChild(this._createSelectionElement(s,d?e[0]:t[0],d?t[0]:e[0],a-s+1))}else{let d=r===s?t[0]:0,u=s===i?e[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(s,d,u));let f=a-s-1;if(c.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,f)),s!==a){let m=i===a?e[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(a,0,m))}}this._selectionContainer.appendChild(c)}_createSelectionElement(t,e,n,r=1){let i=this._document.createElement("div"),s=e*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(n-e);return s+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-s),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${t*this.dimensions.css.cell.height}px`,i.style.left=`${s}px`,i.style.width=`${a}px`,i}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 t of this._rowElements)t.replaceChildren()}renderRows(t,e){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),s=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,c=this._optionsService.rawOptions.cursorInactiveStyle;for(let d=t;d<=e;d++){let u=d+n.ydisp,f=this._rowElements[d],m=n.lines.get(u);if(!f||!m)break;f.replaceChildren(...this._rowFactory.createRow(m,u,u===r,a,c,i,s,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Lb}${this._terminalClass}`}_handleLinkHover(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!0)}_handleLinkLeave(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!1)}_setCellUnderline(t,e,n,r,i,s){n<0&&(t=0),r<0&&(e=0);let a=this._bufferService.rows-1;n=Math.max(Math.min(n,a),0),r=Math.max(Math.min(r,a),0),i=Math.min(i,this._bufferService.cols);let c=this._bufferService.buffer,d=c.ybase+c.y,u=Math.min(c.x,i-1),f=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let b=n;b<=r;++b){let S=b+c.ydisp,x=this._rowElements[b],C=c.lines.get(S);if(!x||!C)break;x.replaceChildren(...this._rowFactory.createRow(C,S,S===d,m,v,u,f,this.dimensions.css.cell.width,this._widthCache,s?b===n?t:0:-1,s?(b===r?e:i)-1:-1))}}};I_=Ln([et(7,Ix),et(8,Ug),et(9,Zr),et(10,Qr),et(11,lc),et(12,Zo),et(13,$u)],I_);var P_=class extends Lt{constructor(t,e,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new qe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new LX(this._optionsService))}catch{this._measureStrategy=this._register(new jX(t,e,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let t=this._measureStrategy.measure();(t.width!==this.width||t.height!==this.height)&&(this.width=t.width,this.height=t.height,this._onCharSizeChange.fire())}};P_=Ln([et(2,Zr)],P_);var gD=class extends Lt{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,e){t!==void 0&&t>0&&e!==void 0&&e>0&&(this._result.width=t,this._result.height=e)}},jX=class extends gD{constructor(t,e,n){super(),this._document=t,this._parentElement=e,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}},LX=class extends gD{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let e=this._ctx.measureText("W");if(!("width"in e&&"fontBoundingBoxAscent"in e&&"fontBoundingBoxDescent"in e))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}},IX=class extends Lt{constructor(t,e,n){super(),this._textarea=t,this._window=e,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new PX(this._window)),this._onDprChange=this._register(new qe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new qe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(Mr.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(yt(this._textarea,"focus",()=>this._isFocused=!0)),this._register(yt(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(t){this._window!==t&&(this._window=t,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}},PX=class extends Lt{constructor(t){super(),this._parentWindow=t,this._windowResizeListener=this._register(new ku),this._onDprChange=this._register(new qe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(En(()=>this.clearListener()))}setWindow(t){this._parentWindow=t,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=yt(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var t;this._outerListener&&((t=this._resolutionMediaMatchList)==null||t.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)}},zX=class extends Lt{constructor(){super(),this.linkProviders=[],this._register(En(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let e=this.linkProviders.indexOf(t);e!==-1&&this.linkProviders.splice(e,1)}}}};function Wx(t,e,n){let r=n.getBoundingClientRect(),i=t.getComputedStyle(n),s=parseInt(i.getPropertyValue("padding-left")),a=parseInt(i.getPropertyValue("padding-top"));return[e.clientX-r.left-s,e.clientY-r.top-a]}function BX(t,e,n,r,i,s,a,c,d){if(!s)return;let u=Wx(t,e,n);if(u)return u[0]=Math.ceil((u[0]+(d?a/2:0))/a),u[1]=Math.ceil(u[1]/c),u[0]=Math.min(Math.max(u[0],1),r+(d?1:0)),u[1]=Math.min(Math.max(u[1],1),i),u}var z_=class{constructor(t,e){this._renderService=t,this._charSizeService=e}getCoords(t,e,n,r,i){return BX(window,t,e,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(t,e){let n=Wx(window,t,e);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])}}};z_=Ln([et(0,Jo),et(1,Ug)],z_);var FX=class{constructor(t,e){this._renderCallback=t,this._coreBrowserService=e,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(t){return this._refreshCallbacks.push(t),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(t,e,n){this._rowCount=n,t=t!==void 0?t:0,e=e!==void 0?e:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,t):t,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,e):e,!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 t=Math.max(this._rowStart,0),e=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,e),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let t of this._refreshCallbacks)t(0);this._refreshCallbacks=[]}},vD={};XG(vD,{getSafariVersion:()=>$X,isChromeOS:()=>xD,isFirefox:()=>bD,isIpad:()=>UX,isIphone:()=>WX,isLegacyEdge:()=>HX,isLinux:()=>Vx,isMac:()=>qp,isNode:()=>Wg,isSafari:()=>_D,isWindows:()=>yD});var Wg=typeof process<"u"&&"title"in process,Gh=Wg?"node":navigator.userAgent,Yh=Wg?"node":navigator.platform,bD=Gh.includes("Firefox"),HX=Gh.includes("Edge"),_D=/^((?!chrome|android).)*safari/i.test(Gh);function $X(){if(!_D)return 0;let t=Gh.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var qp=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Yh),UX=Yh==="iPad",WX=Yh==="iPhone",yD=["Windows","Win16","Win32","WinCE"].includes(Yh),Vx=Yh.indexOf("Linux")>=0,xD=/\bCrOS\b/.test(Gh),SD=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),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(t){this._idleCallback=void 0;let e=0,n=0,r=t.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),n=Math.max(e,n),i=t.timeRemaining(),n*1.5>i){r-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-e))}ms`),this._start();return}r=i}this.clear()}},VX=class extends SD{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},qX=class extends SD{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},Kp=!Wg&&"requestIdleCallback"in window?qX:VX,KX=class{constructor(){this._queue=new Kp}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},B_=class extends Lt{constructor(t,e,n,r,i,s,a,c,d){super(),this._rowCount=t,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=c,this._renderer=this._register(new ku),this._pausedResizeTask=new KX,this._observerDisposable=this._register(new ku),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 qe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new qe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new qe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new qe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new FX((u,f)=>this._renderRows(u,f),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new GX(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(En(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>{var u;return(u=this._renderer.value)==null?void 0:u.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(s.onDecorationRegistered(()=>this._fullRefresh())),this._register(s.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(d.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,e),this._register(this._coreBrowserService.onWindowChange(u=>this._registerIntersectionObserver(u,e)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(t,e){if("IntersectionObserver"in t){let n=new t.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(e),this._observerDisposable.value=En(()=>n.disconnect())}}_handleIntersectionChange(t){this._isPaused=t.isIntersecting===void 0?t.intersectionRatio===0:!t.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(t,e,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(t,e);return}let r=this._syncOutputHandler.flush();r&&(t=Math.min(t,r.start),e=Math.max(e,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(t,e,this._rowCount)}_renderRows(t,e){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(t,e);return}t=Math.min(t,this._rowCount-1),e=Math.min(e,this._rowCount-1),this._renderer.value.renderRows(t,e),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:t,end:e}),this._onRender.fire({start:t,end:e}),this._isNextRenderRedrawOnly=!0}}resize(t,e){this._rowCount=e,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(t){this._renderer.value=t,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(t){return this._renderDebouncer.addRefreshCallback(t)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var t,e;this._renderer.value&&((e=(t=this._renderer.value).clearTextureAtlas)==null||e.call(t),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(t,e){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(t,e)}):this._renderer.value.handleResize(t,e),this._fullRefresh())}handleCharSizeChanged(){var t;(t=this._renderer.value)==null||t.handleCharSizeChanged()}handleBlur(){var t;(t=this._renderer.value)==null||t.handleBlur()}handleFocus(){var t;(t=this._renderer.value)==null||t.handleFocus()}handleSelectionChanged(t,e,n){var r;this._selectionState.start=t,this._selectionState.end=e,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(t,e,n)}handleCursorMove(){var t;(t=this._renderer.value)==null||t.handleCursorMove()}clear(){var t;(t=this._renderer.value)==null||t.clear()}};B_=Ln([et(2,Zr),et(3,Ug),et(4,lc),et(5,Kh),et(6,Qr),et(7,Zo),et(8,$u)],B_);var GX=class{constructor(t,e,n){this._coreBrowserService=t,this._coreService=e,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,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 t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function YX(t,e,n,r){let i=n.buffer.x,s=n.buffer.y;if(!n.buffer.hasScrollback)return ZX(i,s,t,e,n,r)+Vg(s,e,n,r)+JX(i,s,t,e,n,r);let a;if(s===e)return a=i>t?"D":"C",Eh(Math.abs(i-t),kh(a,r));a=s>e?"D":"C";let c=Math.abs(s-e),d=QX(s>e?t:i,n)+(c-1)*n.cols+1+XX(s>e?i:t);return Eh(d,kh(a,r))}function XX(t,e){return t-1}function QX(t,e){return e.cols-t}function ZX(t,e,n,r,i,s){return Vg(e,r,i,s).length===0?"":Eh(CD(t,e,t,e-Jl(e,i),!1,i).length,kh("D",s))}function Vg(t,e,n,r){let i=t-Jl(t,n),s=e-Jl(e,n),a=Math.abs(i-s)-eQ(t,e,n);return Eh(a,kh(wD(t,e),r))}function JX(t,e,n,r,i,s){let a;Vg(e,r,i,s).length>0?a=r-Jl(r,i):a=e;let c=r,d=tQ(t,e,n,r,i,s);return Eh(CD(t,a,n,c,d==="C",i).length,kh(d,s))}function eQ(t,e,n){var a;let r=0,i=t-Jl(t,n),s=e-Jl(e,n);for(let c=0;c<Math.abs(i-s);c++){let d=wD(t,e)==="A"?-1:1;(a=n.buffer.lines.get(i+d*c))!=null&&a.isWrapped&&r++}return r}function Jl(t,e){let n=0,r=e.buffer.lines.get(t),i=r==null?void 0:r.isWrapped;for(;i&&t>=0&&t<e.rows;)n++,r=e.buffer.lines.get(--t),i=r==null?void 0:r.isWrapped;return n}function tQ(t,e,n,r,i,s){let a;return Vg(n,r,i,s).length>0?a=r-Jl(r,i):a=e,t<n&&a<=r||t>=n&&a<r?"C":"D"}function wD(t,e){return t>e?"A":"B"}function CD(t,e,n,r,i,s){let a=t,c=e,d="";for(;(a!==n||c!==r)&&c>=0&&c<s.buffer.lines.length;)a+=i?1:-1,i&&a>s.cols-1?(d+=s.buffer.translateBufferLineToString(c,!1,t,a),a=0,t=0,c++):!i&&a<0&&(d+=s.buffer.translateBufferLineToString(c,!1,0,t+1),a=s.cols-1,t=a,c--);return d+s.buffer.translateBufferLineToString(c,!1,t,a)}function kh(t,e){let n=e?"O":"[";return De.ESC+n+t}function Eh(t,e){t=Math.floor(t);let n="";for(let r=0;r<t;r++)n+=e;return n}var nQ=class{constructor(t){this._bufferService=t,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 t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function P5(t,e){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return e*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var Ib=50,rQ=15,iQ=50,sQ=500,oQ=" ",aQ=new RegExp(oQ,"g"),F_=class extends Lt{constructor(t,e,n,r,i,s,a,c,d){super(),this._element=t,this._screenElement=e,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=s,this._optionsService=a,this._renderService=c,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new ns,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new qe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new qe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new qe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new qe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=u=>this._handleMouseMove(u),this._mouseUpListener=u=>this._handleMouseUp(u),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(u=>this._handleTrim(u)),this._register(this._bufferService.buffers.onBufferActivate(u=>this._handleBufferActivate(u))),this.enable(),this._model=new nQ(this._bufferService),this._activeSelectionMode=0,this._register(En(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(u=>{u.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 t=this._model.finalSelectionStart,e=this._model.finalSelectionEnd;return!t||!e?!1:t[0]!==e[0]||t[1]!==e[1]}get selectionText(){let t=this._model.finalSelectionStart,e=this._model.finalSelectionEnd;if(!t||!e)return"";let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(t[0]===e[0])return"";let i=t[0]<e[0]?t[0]:e[0],s=t[0]<e[0]?e[0]:t[0];for(let a=t[1];a<=e[1];a++){let c=n.translateBufferLineToString(a,!0,i,s);r.push(c)}}else{let i=t[1]===e[1]?e[0]:void 0;r.push(n.translateBufferLineToString(t[1],!0,t[0],i));for(let s=t[1]+1;s<=e[1]-1;s++){let a=n.lines.get(s),c=n.translateBufferLineToString(s,!0);a!=null&&a.isWrapped?r[r.length-1]+=c:r.push(c)}if(t[1]!==e[1]){let s=n.lines.get(e[1]),a=n.translateBufferLineToString(e[1],!0,0,e[0]);s&&s.isWrapped?r[r.length-1]+=a:r.push(a)}}return r.map(i=>i.replace(aQ," ")).join(yD?`\r
|
|
523
|
+
`:`
|
|
524
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(t){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Vx&&t&&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(t){let e=this._getMouseBufferCoords(t),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!e?!1:this._areCoordsInSelection(e,n,r)}isCellInSelection(t,e){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([t,e],n,r)}_areCoordsInSelection(t,e,n){return t[1]>e[1]&&t[1]<n[1]||e[1]===n[1]&&t[1]===e[1]&&t[0]>=e[0]&&t[0]<n[0]||e[1]<n[1]&&t[1]===n[1]&&t[0]<n[0]||e[1]<n[1]&&t[1]===e[1]&&t[0]>=e[0]}_selectWordAtCursor(t,e){var i,s;let n=(s=(i=this._linkifier.currentLink)==null?void 0:i.link)==null?void 0:s.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=P5(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(t);return r?(this._selectWordAt(r,e),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(t,e){this._model.clearSelection(),t=Math.max(t,0),e=Math.min(e,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,t],this._model.selectionEnd=[this._bufferService.cols,e],this.refresh(),this._onSelectionChange.fire()}_handleTrim(t){this._model.handleTrim(t)&&this.refresh()}_getMouseBufferCoords(t){let e=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(e)return e[0]--,e[1]--,e[1]+=this._bufferService.buffer.ydisp,e}_getMouseEventScrollAmount(t){let e=Wx(this._coreBrowserService.window,t,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return e>=0&&e<=n?0:(e>n&&(e-=n),e=Math.min(Math.max(e,-Ib),Ib),e/=Ib,e/Math.abs(e)+Math.round(e*(rQ-1)))}shouldForceSelection(t){return qp?t.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:t.shiftKey}handleMouseDown(t){if(this._mouseDownTimeStamp=t.timeStamp,!(t.button===2&&this.hasSelection)&&t.button===0){if(!this._enabled){if(!this.shouldForceSelection(t))return;t.stopPropagation()}t.preventDefault(),this._dragScrollAmount=0,this._enabled&&t.shiftKey?this._handleIncrementalClick(t):t.detail===1?this._handleSingleClick(t):t.detail===2?this._handleDoubleClick(t):t.detail===3&&this._handleTripleClick(t),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(),iQ)}_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(t){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(t))}_handleSingleClick(t){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(t)?3:0,this._model.selectionStart=this._getMouseBufferCoords(t),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let e=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);e&&e.length!==this._model.selectionStart[0]&&e.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(t){this._selectWordAtCursor(t,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(t){let e=this._getMouseBufferCoords(t);e&&(this._activeSelectionMode=2,this._selectLineAt(e[1]))}shouldColumnSelect(t){return t.altKey&&!(qp&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(t){if(t.stopImmediatePropagation(),!this._model.selectionStart)return;let e=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(t),!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(t),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]++}(!e||e[0]!==this._model.selectionEnd[0]||e[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 t=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(t.ydisp+this._bufferService.rows,t.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=t.ydisp),this.refresh()}}_handleMouseUp(t){let e=t.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&e<sQ&&t.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(t,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=YX(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let t=this._model.finalSelectionStart,e=this._model.finalSelectionEnd,n=!!t&&!!e&&(t[0]!==e[0]||t[1]!==e[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(t,e,n);return}!t||!e||(!this._oldSelectionStart||!this._oldSelectionEnd||t[0]!==this._oldSelectionStart[0]||t[1]!==this._oldSelectionStart[1]||e[0]!==this._oldSelectionEnd[0]||e[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(t,e,n)}_fireOnSelectionChange(t,e,n){this._oldSelectionStart=t,this._oldSelectionEnd=e,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(t){this.clearSelection(),this._trimListener.dispose(),this._trimListener=t.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(t,e){let n=e;for(let r=0;e>=r;r++){let i=t.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&e!==r&&(n+=i-1)}return n}setSelection(t,e,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[t,e],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(t){this._isClickInSelection(t)||(this._selectWordAtCursor(t,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(t,e,n=!0,r=!0){if(t[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,s=i.lines.get(t[1]);if(!s)return;let a=i.translateBufferLineToString(t[1],!1),c=this._convertViewportColToCharacterIndex(s,t[0]),d=c,u=t[0]-c,f=0,m=0,v=0,b=0;if(a.charAt(c)===" "){for(;c>0&&a.charAt(c-1)===" ";)c--;for(;d<a.length&&a.charAt(d+1)===" ";)d++}else{let C=t[0],k=t[0];s.getWidth(C)===0&&(f++,C--),s.getWidth(k)===2&&(m++,k++);let E=s.getString(k).length;for(E>1&&(b+=E-1,d+=E-1);C>0&&c>0&&!this._isCharWordSeparator(s.loadCell(C-1,this._workCell));){s.loadCell(C-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(f++,C--):R>1&&(v+=R-1,c-=R-1),c--,C--}for(;k<s.length&&d+1<a.length&&!this._isCharWordSeparator(s.loadCell(k+1,this._workCell));){s.loadCell(k+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,k++):R>1&&(b+=R-1,d+=R-1),d++,k++}}d++;let S=c+u-f+v,x=Math.min(this._bufferService.cols,d-c+f+m-v-b);if(!(!e&&a.slice(c,d).trim()==="")){if(n&&S===0&&s.getCodePoint(0)!==32){let C=i.lines.get(t[1]-1);if(C&&s.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,t[1]-1],!1,!0,!1);if(k){let E=this._bufferService.cols-k.start;S-=E,x+=E}}}if(r&&S+x===this._bufferService.cols&&s.getCodePoint(this._bufferService.cols-1)!==32){let C=i.lines.get(t[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let k=this._getWordAt([0,t[1]+1],!1,!1,!0);k&&(x+=k.length)}}return{start:S,length:x}}}_selectWordAt(t,e){let n=this._getWordAt(t,e);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,t[1]--;this._model.selectionStart=[n.start,t[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(t){let e=this._getWordAt(t,!0);if(e){let n=t[1];for(;e.start<0;)e.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;e.start+e.length>this._bufferService.cols;)e.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?e.start:e.start+e.length,n]}}_isCharWordSeparator(t){return t.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(t.getChars())>=0}_selectLineAt(t){let e=this._bufferService.buffer.getWrappedRangeForLine(t),n={start:{x:0,y:e.first},end:{x:this._bufferService.cols-1,y:e.last}};this._model.selectionStart=[0,e.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=P5(n,this._bufferService.cols)}};F_=Ln([et(3,Qr),et(4,lc),et(5,Px),et(6,Zr),et(7,Jo),et(8,Zo)],F_);var z5=class{constructor(){this._data={}}set(t,e,n){this._data[t]||(this._data[t]={}),this._data[t][e]=n}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}},B5=class{constructor(){this._color=new z5,this._css=new z5}setCss(t,e,n){this._css.set(t,e,n)}getCss(t,e){return this._css.get(t,e)}setColor(t,e,n){this._color.set(t,e,n)}getColor(t,e){return this._color.get(t,e)}clear(){this._color.clear(),this._css.clear()}},ir=Object.freeze((()=>{let t=[Mn.toColor("#2e3436"),Mn.toColor("#cc0000"),Mn.toColor("#4e9a06"),Mn.toColor("#c4a000"),Mn.toColor("#3465a4"),Mn.toColor("#75507b"),Mn.toColor("#06989a"),Mn.toColor("#d3d7cf"),Mn.toColor("#555753"),Mn.toColor("#ef2929"),Mn.toColor("#8ae234"),Mn.toColor("#fce94f"),Mn.toColor("#729fcf"),Mn.toColor("#ad7fa8"),Mn.toColor("#34e2e2"),Mn.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=e[n/36%6|0],i=e[n/6%6|0],s=e[n%6];t.push({css:Qn.toCss(r,i,s),rgba:Qn.toRgba(r,i,s)})}for(let n=0;n<24;n++){let r=8+n*10;t.push({css:Qn.toCss(r,r,r),rgba:Qn.toRgba(r,r,r)})}return t})()),Il=Mn.toColor("#ffffff"),th=Mn.toColor("#000000"),F5=Mn.toColor("#ffffff"),H5=th,zd={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},lQ=Il,H_=class extends Lt{constructor(t){super(),this._optionsService=t,this._contrastCache=new B5,this._halfContrastCache=new B5,this._onChangeColors=this._register(new qe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Il,background:th,cursor:F5,cursorAccent:H5,selectionForeground:void 0,selectionBackgroundTransparent:zd,selectionBackgroundOpaque:Sn.blend(th,zd),selectionInactiveBackgroundTransparent:zd,selectionInactiveBackgroundOpaque:Sn.blend(th,zd),scrollbarSliderBackground:Sn.opacity(Il,.2),scrollbarSliderHoverBackground:Sn.opacity(Il,.4),scrollbarSliderActiveBackground:Sn.opacity(Il,.5),overviewRulerBorder:Il,ansi:ir.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(t={}){let e=this._colors;if(e.foreground=an(t.foreground,Il),e.background=an(t.background,th),e.cursor=Sn.blend(e.background,an(t.cursor,F5)),e.cursorAccent=Sn.blend(e.background,an(t.cursorAccent,H5)),e.selectionBackgroundTransparent=an(t.selectionBackground,zd),e.selectionBackgroundOpaque=Sn.blend(e.background,e.selectionBackgroundTransparent),e.selectionInactiveBackgroundTransparent=an(t.selectionInactiveBackground,e.selectionBackgroundTransparent),e.selectionInactiveBackgroundOpaque=Sn.blend(e.background,e.selectionInactiveBackgroundTransparent),e.selectionForeground=t.selectionForeground?an(t.selectionForeground,j5):void 0,e.selectionForeground===j5&&(e.selectionForeground=void 0),Sn.isOpaque(e.selectionBackgroundTransparent)&&(e.selectionBackgroundTransparent=Sn.opacity(e.selectionBackgroundTransparent,.3)),Sn.isOpaque(e.selectionInactiveBackgroundTransparent)&&(e.selectionInactiveBackgroundTransparent=Sn.opacity(e.selectionInactiveBackgroundTransparent,.3)),e.scrollbarSliderBackground=an(t.scrollbarSliderBackground,Sn.opacity(e.foreground,.2)),e.scrollbarSliderHoverBackground=an(t.scrollbarSliderHoverBackground,Sn.opacity(e.foreground,.4)),e.scrollbarSliderActiveBackground=an(t.scrollbarSliderActiveBackground,Sn.opacity(e.foreground,.5)),e.overviewRulerBorder=an(t.overviewRulerBorder,lQ),e.ansi=ir.slice(),e.ansi[0]=an(t.black,ir[0]),e.ansi[1]=an(t.red,ir[1]),e.ansi[2]=an(t.green,ir[2]),e.ansi[3]=an(t.yellow,ir[3]),e.ansi[4]=an(t.blue,ir[4]),e.ansi[5]=an(t.magenta,ir[5]),e.ansi[6]=an(t.cyan,ir[6]),e.ansi[7]=an(t.white,ir[7]),e.ansi[8]=an(t.brightBlack,ir[8]),e.ansi[9]=an(t.brightRed,ir[9]),e.ansi[10]=an(t.brightGreen,ir[10]),e.ansi[11]=an(t.brightYellow,ir[11]),e.ansi[12]=an(t.brightBlue,ir[12]),e.ansi[13]=an(t.brightMagenta,ir[13]),e.ansi[14]=an(t.brightCyan,ir[14]),e.ansi[15]=an(t.brightWhite,ir[15]),t.extendedAnsi){let n=Math.min(e.ansi.length-16,t.extendedAnsi.length);for(let r=0;r<n;r++)e.ansi[r+16]=an(t.extendedAnsi[r],ir[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(t){this._restoreColor(t),this._onChangeColors.fire(this.colors)}_restoreColor(t){if(t===void 0){for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];return}switch(t){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[t]=this._restoreColors.ansi[t]}}modifyColors(t){t(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()}}};H_=Ln([et(0,Zr)],H_);function an(t,e){if(t!==void 0)try{return Mn.toColor(t)}catch{}return e}var cQ=class{constructor(...t){this._entries=new Map;for(let[e,n]of t)this.set(e,n)}set(t,e){let n=this._entries.get(t);return this._entries.set(t,e),n}forEach(t){for(let[e,n]of this._entries.entries())t(e,n)}has(t){return this._entries.has(t)}get(t){return this._entries.get(t)}},uQ=class{constructor(){this._services=new cQ,this._services.set(Ix,this)}setService(t,e){this._services.set(t,e)}getService(t){return this._services.get(t)}createInstance(t,...e){let n=rY(t).sort((s,a)=>s.index-a.index),r=[];for(let s of n){let a=this._services.get(s.id);if(!a)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${s.id._id}.`);r.push(a)}let i=n.length>0?n[0].index:e.length;if(e.length!==i)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${i+1} conflicts with ${e.length} static arguments`);return new t(...e,...r)}},dQ={trace:0,debug:1,info:2,warn:3,error:4,off:5},hQ="xterm.js: ",$_=class extends Lt{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=dQ[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e<t.length;e++)typeof t[e]=="function"&&(t[e]=t[e]())}_log(t,e,n){this._evalLazyOptionalParams(n),t.call(console,(this._optionsService.options.logger?"":hQ)+e,...n)}trace(t,...e){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,t,e)}debug(t,...e){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,t,e)}info(t,...e){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,t,e)}warn(t,...e){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,t,e)}error(t,...e){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,t,e)}};$_=Ln([et(0,Zr)],$_);var $5=class extends Lt{constructor(t){super(),this._maxLength=t,this.onDeleteEmitter=this._register(new qe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new qe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new qe),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(t){if(this._maxLength===t)return;let e=new Array(t);for(let n=0;n<Math.min(t,this.length);n++)e[n]=this._array[this._getCyclicIndex(n)];this._array=e,this._maxLength=t,this._startIndex=0}get length(){return this._length}set length(t){if(t>this._length)for(let e=this._length;e<t;e++)this._array[e]=void 0;this._length=t}get(t){return this._array[this._getCyclicIndex(t)]}set(t,e){this._array[this._getCyclicIndex(t)]=e}push(t){this._array[this._getCyclicIndex(this._length)]=t,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(t,e,...n){if(e){for(let r=t;r<this._length-e;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+e)];this._length-=e,this.onDeleteEmitter.fire({index:t,amount:e})}for(let r=this._length-1;r>=t;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(t+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:t,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(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.onTrimEmitter.fire(t)}shiftElements(t,e,n){if(!(e<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let i=e-1;i>=0;i--)this.set(t+i+n,this.get(t+i));let r=t+e+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<e;r++)this.set(t+r+n,this.get(t+r))}}_getCyclicIndex(t){return(this._startIndex+t)%this._maxLength}},Ot=3,Xn=Object.freeze(new qh),Dm=0,Pb=2,nh=class kD{constructor(e,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*Ot);let i=n||ns.fromCharData([0,WN,1,0]);for(let s=0;s<e;++s)this.setCell(s,i);this.length=e}get(e){let n=this._data[e*Ot+0],r=n&2097151;return[this._data[e*Ot+1],n&2097152?this._combined[e]:r?Ua(r):"",n>>22,n&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):r]}set(e,n){this._data[e*Ot+1]=n[0],n[1].length>1?(this._combined[e]=n[1],this._data[e*Ot+0]=e|2097152|n[2]<<22):this._data[e*Ot+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(e){return this._data[e*Ot+0]>>22}hasWidth(e){return this._data[e*Ot+0]&12582912}getFg(e){return this._data[e*Ot+1]}getBg(e){return this._data[e*Ot+2]}hasContent(e){return this._data[e*Ot+0]&4194303}getCodePoint(e){let n=this._data[e*Ot+0];return n&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n&2097151}isCombined(e){return this._data[e*Ot+0]&2097152}getString(e){let n=this._data[e*Ot+0];return n&2097152?this._combined[e]:n&2097151?Ua(n&2097151):""}isProtected(e){return this._data[e*Ot+2]&536870912}loadCell(e,n){return Dm=e*Ot,n.content=this._data[Dm+0],n.fg=this._data[Dm+1],n.bg=this._data[Dm+2],n.content&2097152&&(n.combinedData=this._combined[e]),n.bg&268435456&&(n.extended=this._extendedAttrs[e]),n}setCell(e,n){n.content&2097152&&(this._combined[e]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[e]=n.extended),this._data[e*Ot+0]=n.content,this._data[e*Ot+1]=n.fg,this._data[e*Ot+2]=n.bg}setCellFromCodepoint(e,n,r,i){i.bg&268435456&&(this._extendedAttrs[e]=i.extended),this._data[e*Ot+0]=n|r<<22,this._data[e*Ot+1]=i.fg,this._data[e*Ot+2]=i.bg}addCodepointToCell(e,n,r){let i=this._data[e*Ot+0];i&2097152?this._combined[e]+=Ua(n):i&2097151?(this._combined[e]=Ua(i&2097151)+Ua(n),i&=-2097152,i|=2097152):i=n|1<<22,r&&(i&=-12582913,i|=r<<22),this._data[e*Ot+0]=i}insertCells(e,n,r){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,r),n<this.length-e){let i=new ns;for(let s=this.length-e-n-1;s>=0;--s)this.setCell(e+n+s,this.loadCell(e+s,i));for(let s=0;s<n;++s)this.setCell(e+s,r)}else for(let i=e;i<this.length;++i)this.setCell(i,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(e,n,r){if(e%=this.length,n<this.length-e){let i=new ns;for(let s=0;s<this.length-e-n;++s)this.setCell(e+s,this.loadCell(e+n+s,i));for(let s=this.length-n;s<this.length;++s)this.setCell(s,r)}else for(let i=e;i<this.length;++i)this.setCell(i,r);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,r),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,r)}replaceCells(e,n,r,i=!1){if(i){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);e<n&&e<this.length;)this.isProtected(e)||this.setCell(e,r),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);e<n&&e<this.length;)this.setCell(e++,r)}resize(e,n){if(e===this.length)return this._data.length*4*Pb<this._data.buffer.byteLength;let r=e*Ot;if(e>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let i=new Uint32Array(r);i.set(this._data),this._data=i}for(let i=this.length;i<e;++i)this.setCell(i,n)}else{this._data=this._data.subarray(0,r);let i=Object.keys(this._combined);for(let a=0;a<i.length;a++){let c=parseInt(i[a],10);c>=e&&delete this._combined[c]}let s=Object.keys(this._extendedAttrs);for(let a=0;a<s.length;a++){let c=parseInt(s[a],10);c>=e&&delete this._extendedAttrs[c]}}return this.length=e,r*4*Pb<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Pb<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,n=!1){if(n){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,e);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,e)}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(let n in e._combined)this._combined[n]=e._combined[n];this._extendedAttrs={};for(let n in e._extendedAttrs)this._extendedAttrs[n]=e._extendedAttrs[n];this.isWrapped=e.isWrapped}clone(){let e=new kD(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let n in this._combined)e._combined[n]=this._combined[n];for(let n in this._extendedAttrs)e._extendedAttrs[n]=this._extendedAttrs[n];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*Ot+0]&4194303)return e+(this._data[e*Ot+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*Ot+0]&4194303||this._data[e*Ot+2]&50331648)return e+(this._data[e*Ot+0]>>22);return 0}copyCellsFrom(e,n,r,i,s){let a=e._data;if(s)for(let d=i-1;d>=0;d--){for(let u=0;u<Ot;u++)this._data[(r+d)*Ot+u]=a[(n+d)*Ot+u];a[(n+d)*Ot+2]&268435456&&(this._extendedAttrs[r+d]=e._extendedAttrs[n+d])}else for(let d=0;d<i;d++){for(let u=0;u<Ot;u++)this._data[(r+d)*Ot+u]=a[(n+d)*Ot+u];a[(n+d)*Ot+2]&268435456&&(this._extendedAttrs[r+d]=e._extendedAttrs[n+d])}let c=Object.keys(e._combined);for(let d=0;d<c.length;d++){let u=parseInt(c[d],10);u>=n&&(this._combined[u-n+r]=e._combined[u])}}translateToString(e,n,r,i){n=n??0,r=r??this.length,e&&(r=Math.min(r,this.getTrimmedLength())),i&&(i.length=0);let s="";for(;n<r;){let a=this._data[n*Ot+0],c=a&2097151,d=a&2097152?this._combined[n]:c?Ua(c):Qa;if(s+=d,i)for(let u=0;u<d.length;++u)i.push(n);n+=a>>22||1}return i&&i.push(n),s}};function fQ(t,e,n,r,i,s){let a=[];for(let c=0;c<t.length-1;c++){let d=c,u=t.get(++d);if(!u.isWrapped)continue;let f=[t.get(c)];for(;d<t.length&&u.isWrapped;)f.push(u),u=t.get(++d);if(!s&&r>=c&&r<d){c+=f.length-1;continue}let m=0,v=Rh(f,m,e),b=1,S=0;for(;b<f.length;){let C=Rh(f,b,e),k=C-S,E=n-v,R=Math.min(k,E);f[m].copyCellsFrom(f[b],S,v,R,!1),v+=R,v===n&&(m++,v=0),S+=R,S===C&&(b++,S=0),v===0&&m!==0&&f[m-1].getWidth(n-1)===2&&(f[m].copyCellsFrom(f[m-1],n-1,v++,1,!1),f[m-1].setCell(n-1,i))}f[m].replaceCells(v,n,i);let x=0;for(let C=f.length-1;C>0&&(C>m||f[C].getTrimmedLength()===0);C--)x++;x>0&&(a.push(c+f.length-x),a.push(x)),c+=f.length-1}return a}function mQ(t,e){let n=[],r=0,i=e[r],s=0;for(let a=0;a<t.length;a++)if(i===a){let c=e[++r];t.onDeleteEmitter.fire({index:a-s,amount:c}),a+=c-1,s+=c,i=e[++r]}else n.push(a);return{layout:n,countRemoved:s}}function pQ(t,e){let n=[];for(let r=0;r<e.length;r++)n.push(t.get(e[r]));for(let r=0;r<n.length;r++)t.set(r,n[r]);t.length=e.length}function gQ(t,e,n){let r=[],i=t.map((d,u)=>Rh(t,u,e)).reduce((d,u)=>d+u),s=0,a=0,c=0;for(;c<i;){if(i-c<n){r.push(i-c);break}s+=n;let d=Rh(t,a,e);s>d&&(s-=d,a++);let u=t[a].getWidth(s-1)===2;u&&s--;let f=u?n-1:n;r.push(f),c+=f}return r}function Rh(t,e,n){if(e===t.length-1)return t[e].getTrimmedLength();let r=!t[e].hasContent(n-1)&&t[e].getWidth(n-1)===1,i=t[e+1].getWidth(0)===2;return r&&i?n-1:n}var ED=class RD{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=RD._nextId++,this._onDispose=this.register(new qe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Zl(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};ED._nextId=1;var vQ=ED,ar={},Pl=ar.B;ar[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ar.A={"#":"£"};ar.B=void 0;ar[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ar.C=ar[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ar.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ar.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ar.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ar.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ar.E=ar[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ar.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ar.H=ar[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ar["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var U5=4294967295,W5=class{constructor(t,e,n){this._hasScrollback=t,this._optionsService=e,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=Xn.clone(),this.savedCharset=Pl,this.markers=[],this._nullCell=ns.fromCharData([0,WN,1,0]),this._whitespaceCell=ns.fromCharData([0,Qa,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Kp,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new $5(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Up),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Up),this._whitespaceCell}getBlankLine(t,e){return new nh(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;let e=t+this._optionsService.rawOptions.scrollback;return e>U5?U5:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=Xn);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new $5(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let n=this.getNullCell(Xn),r=0,i=this._getCorrectBufferLength(e);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<t)for(let a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(t,n);let s=0;if(this._rows<e)for(let a=this._rows;a<e;a++)this.lines.length<e+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new nh(t,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new nh(t,n)));else for(let a=this._rows;a>e;a--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let a=this.lines.length-i;a>0&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=i}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),s&&(this.y+=s),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let s=0;s<this.lines.length;s++)r+=+this.lines.get(s).resize(t,n);this._cols=t,this._rows=e,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition<this.lines.length;)if(e+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),e>100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let n=this._optionsService.rawOptions.reflowCursorLine,r=fQ(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(Xn),n);if(r.length>0){let i=mQ(this.lines,r);pQ(this.lines,i.layout),this._reflowLargerAdjustViewport(t,e,i.countRemoved)}}_reflowLargerAdjustViewport(t,e,n){let r=this.getNullCell(Xn),i=n;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<e&&this.lines.push(new nh(t,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(t,e){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(Xn),i=[],s=0;for(let a=this.lines.length-1;a>=0;a--){let c=this.lines.get(a);if(!c||!c.isWrapped&&c.getTrimmedLength()<=t)continue;let d=[c];for(;c.isWrapped&&a>0;)c=this.lines.get(--a),d.unshift(c);if(!n){let R=this.ybase+this.y;if(R>=a&&R<a+d.length)continue}let u=d[d.length-1].getTrimmedLength(),f=gQ(d,this._cols,t),m=f.length-d.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+m):v=Math.max(0,this.lines.length-this.lines.maxLength+m);let b=[];for(let R=0;R<m;R++){let M=this.getBlankLine(Xn,!0);b.push(M)}b.length>0&&(i.push({start:a+d.length+s,newLines:b}),s+=b.length),d.push(...b);let S=f.length-1,x=f[S];x===0&&(S--,x=f[S]);let C=d.length-m-1,k=u;for(;C>=0;){let R=Math.min(k,x);if(d[S]===void 0)break;if(d[S].copyCellsFrom(d[C],k-R,x-R,R,!0),x-=R,x===0&&(S--,x=f[S]),k-=R,k===0){C--;let M=Math.max(C,0);k=Rh(d,M,this._cols)}}for(let R=0;R<d.length;R++)f[R]<t&&d[R].setCell(f[R],r);let E=m-v;for(;E-- >0;)this.ybase===0?this.y<e-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+e-1)}if(i.length>0){let a=[],c=[];for(let x=0;x<this.lines.length;x++)c.push(this.lines.get(x));let d=this.lines.length,u=d-1,f=0,m=i[f];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);let v=0;for(let x=Math.min(this.lines.maxLength-1,d+s-1);x>=0;x--)if(m&&m.start>u+v){for(let C=m.newLines.length-1;C>=0;C--)this.lines.set(x--,m.newLines[C]);x++,a.push({index:u+1,amount:m.newLines.length}),v+=m.newLines.length,m=i[++f]}else this.lines.set(x,c[u--]);let b=0;for(let x=a.length-1;x>=0;x--)a[x].index+=b,this.lines.onInsertEmitter.fire(a[x]),b+=a[x].amount;let S=Math.max(0,d+s-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}translateBufferLineToString(t,e,n=0,r){let i=this.lines.get(t);return i?i.translateToString(e,n,r):""}getWrappedRangeForLine(t){let e=t,n=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:e,last:n}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose();this.markers.length=0,this._isClearing=!1}addMarker(t){let e=new vQ(t);return this.markers.push(e),e.register(this.lines.onTrim(n=>{e.line-=n,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(n=>{e.line>=n.index&&(e.line+=n.amount)})),e.register(this.lines.onDelete(n=>{e.line>=n.index&&e.line<n.index+n.amount&&e.dispose(),e.line>n.index&&(e.line-=n.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},bQ=class extends Lt{constructor(t,e){super(),this._optionsService=t,this._bufferService=e,this._onBufferActivate=this._register(new qe),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 W5(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new W5(!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(t){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(t),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(t,e){this._normal.resize(t,e),this._alt.resize(t,e),this.setupTabStops(t)}setupTabStops(t){this._normal.setupTabStops(t),this._alt.setupTabStops(t)}},TD=2,MD=1,U_=class extends Lt{constructor(t){super(),this.isUserScrolling=!1,this._onResize=this._register(new qe),this.onResize=this._onResize.event,this._onScroll=this._register(new qe),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,TD),this.rows=Math.max(t.rawOptions.rows||0,MD),this.buffers=this._register(new bQ(t,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(t,e){let n=this.cols!==t,r=this.rows!==e;this.cols=t,this.rows=e,this.buffers.resize(t,e),this._onResize.fire({cols:t,rows:e,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,e=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==t.fg||r.getBg(0)!==t.bg)&&(r=n.getBlankLine(t,e),this._cachedBlankLine=r),r.isWrapped=e;let i=n.ybase+n.scrollTop,s=n.ybase+n.scrollBottom;if(n.scrollTop===0){let a=n.lines.isFull;s===n.lines.length-1?a?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(s+1,0,r.clone()),a?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let a=s-i+1;n.lines.shiftElements(i+1,a-1,-1),n.lines.set(s,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(t,e){let n=this.buffer;if(t<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else t+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+t,n.ybase),0),r!==n.ydisp&&(e||this._onScroll.fire(n.ydisp))}};U_=Ln([et(0,Zr)],U_);var Qc={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:qp,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},_Q=["normal","bold","100","200","300","400","500","600","700","800","900"],yQ=class extends Lt{constructor(t){super(),this._onOptionChange=this._register(new qe),this.onOptionChange=this._onOptionChange.event;let e={...Qc};for(let n in t)if(n in e)try{let r=t[n];e[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=e,this.options={...e},this._setupOptions(),this._register(En(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(t,e){return this.onOptionChange(n=>{n===t&&e(this.rawOptions[t])})}onMultipleOptionChange(t,e){return this.onOptionChange(n=>{t.indexOf(n)!==-1&&e()})}_setupOptions(){let t=n=>{if(!(n in Qc))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},e=(n,r)=>{if(!(n in Qc))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:t.bind(this,n),set:e.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(t,e){switch(t){case"cursorStyle":if(e||(e=Qc[t]),!xQ(e))throw new Error(`"${e}" is not a valid value for ${t}`);break;case"wordSeparator":e||(e=Qc[t]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=_Q.includes(e)?e:Qc[t];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${t} cannot be less than 1, value: ${e}`);break;case"minimumContrastRatio":e=Math.max(1,Math.min(21,Math.round(e*10)/10));break;case"scrollback":if(e=Math.min(e,4294967295),e<0)throw new Error(`${t} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${t} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${t} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{};break}return e}};function xQ(t){return t==="block"||t==="underline"||t==="bar"}function rh(t,e=5){if(typeof t!="object")return t;let n=Array.isArray(t)?[]:{};for(let r in t)n[r]=e<=1?t[r]:t[r]&&rh(t[r],e-1);return n}var V5=Object.freeze({insertMode:!1}),q5=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),W_=class extends Lt{constructor(t,e,n){super(),this._bufferService=t,this._logService=e,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new qe),this.onData=this._onData.event,this._onUserInput=this._register(new qe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new qe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new qe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=rh(V5),this.decPrivateModes=rh(q5)}reset(){this.modes=rh(V5),this.decPrivateModes=rh(q5)}triggerDataEvent(t,e=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;e&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),e&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`),this._logService.trace("sending data (codes)",()=>t.split("").map(r=>r.charCodeAt(0))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`),this._logService.trace("sending binary (codes)",()=>t.split("").map(e=>e.charCodeAt(0))),this._onBinary.fire(t))}};W_=Ln([et(0,Qr),et(1,YN),et(2,Zr)],W_);var K5={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function zb(t,e){let n=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(n|=64,n|=t.action):(n|=t.button&3,t.button&4&&(n|=64),t.button&8&&(n|=128),t.action===32?n|=32:t.action===0&&!e&&(n|=3)),n}var Bb=String.fromCharCode,G5={DEFAULT:t=>{let e=[zb(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${Bb(e[0])}${Bb(e[1])}${Bb(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${zb(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${zb(t,!0)};${t.x};${t.y}${e}`}},V_=class extends Lt{constructor(t,e,n){super(),this._bufferService=t,this._coreService=e,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new qe),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(K5))this.addProtocol(r,K5[r]);for(let r of Object.keys(G5))this.addEncoding(r,G5[r]);this.reset()}addProtocol(t,e){this._protocols[t]=e}addEncoding(t,e){this._encodings[t]=e}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,e,n){if(t.deltaY===0||t.shiftKey||e===void 0||n===void 0)return 0;let r=e/n,i=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(t.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(t,e){return e.altKey||e.ctrlKey||e.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let e=this._encodings[this._activeEncoding](t);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,e,n){if(n){if(t.x!==e.x||t.y!==e.y)return!1}else if(t.col!==e.col||t.row!==e.row)return!1;return!(t.button!==e.button||t.action!==e.action||t.ctrl!==e.ctrl||t.alt!==e.alt||t.shift!==e.shift)}};V_=Ln([et(0,Qr),et(1,lc),et(2,Zr)],V_);var Fb=[[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]],SQ=[[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]],sr;function wQ(t,e){let n=0,r=e.length-1,i;if(t<e[0][0]||t>e[r][1])return!1;for(;r>=n;)if(i=n+r>>1,t>e[i][1])n=i+1;else if(t<e[i][0])r=i-1;else return!0;return!1}var CQ=class{constructor(){if(this.version="6",!sr){sr=new Uint8Array(65536),sr.fill(1),sr[0]=0,sr.fill(0,1,32),sr.fill(0,127,160),sr.fill(2,4352,4448),sr[9001]=2,sr[9002]=2,sr.fill(2,11904,42192),sr[12351]=1,sr.fill(2,44032,55204),sr.fill(2,63744,64256),sr.fill(2,65040,65050),sr.fill(2,65072,65136),sr.fill(2,65280,65377),sr.fill(2,65504,65511);for(let t=0;t<Fb.length;++t)sr.fill(0,Fb[t][0],Fb[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?sr[t]:wQ(t,SQ)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,e){let n=this.wcwidth(t),r=n===0&&e!==0;if(r){let i=Hl.extractWidth(e);i===0?r=!1:i>n&&(n=i)}return Hl.createPropertyValue(0,n,r)}},Hl=class pp{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new qe,this.onChange=this._onChange.event;let e=new CQ;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,n,r=!1){return(e&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(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let n=0,r=0,i=e.length;for(let s=0;s<i;++s){let a=e.charCodeAt(s);if(55296<=a&&a<=56319){if(++s>=i)return n+this.wcwidth(a);let u=e.charCodeAt(s);56320<=u&&u<=57343?a=(a-55296)*1024+u-56320+65536:n+=this.wcwidth(u)}let c=this.charProperties(a,r),d=pp.extractWidth(c);pp.extractShouldJoin(c)&&(d-=pp.extractWidth(r)),n+=d,r=c}return n}charProperties(e,n){return this._activeProvider.charProperties(e,n)}},kQ=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(t){this.glevel=t,this.charset=this._charsets[t]}setgCharset(t,e){this._charsets[t]=e,this.glevel===t&&(this.charset=e)}};function Y5(t){var r;let e=(r=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1))==null?void 0:r.get(t.cols-1),n=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);n&&e&&(n.isWrapped=e[3]!==0&&e[3]!==32)}var Bd=2147483647,EQ=256,AD=class q_{constructor(e=32,n=32){if(this.maxLength=e,this.maxSubParamsLength=n,n>EQ)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){let n=new q_;if(!e.length)return n;for(let r=Array.isArray(e[0])?1:0;r<e.length;++r){let i=e[r];if(Array.isArray(i))for(let s=0;s<i.length;++s)n.addSubParam(i[s]);else n.addParam(i)}return n}clone(){let e=new q_(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let n=0;n<this.length;++n){e.push(this.params[n]);let r=this._subParamsIdx[n]>>8,i=this._subParamsIdx[n]&255;i-r>0&&e.push(Array.prototype.slice.call(this._subParams,r,i))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>Bd?Bd:e}addSubParam(e){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>Bd?Bd:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let n=this._subParamsIdx[e]>>8,r=this._subParamsIdx[e]&255;return r-n>0?this._subParams.subarray(n,r):null}getSubParamsAll(){let e={};for(let n=0;n<this.length;++n){let r=this._subParamsIdx[n]>>8,i=this._subParamsIdx[n]&255;i-r>0&&(e[n]=this._subParams.slice(r,i))}return e}addDigit(e){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,i=r[n-1];r[n-1]=~i?Math.min(i*10+e,Bd):e}},Fd=[],RQ=class{constructor(){this._state=0,this._active=Fd,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(t,e){this._handlers[t]===void 0&&(this._handlers[t]=[]);let n=this._handlers[t];return n.push(e),{dispose:()=>{let r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Fd}reset(){if(this._state===2)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].end(!1);this._stack.paused=!1,this._active=Fd,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Fd,!this._active.length)this._handlerFb(this._id,"START");else for(let t=this._active.length-1;t>=0;t--)this._active[t].start()}_put(t,e,n){if(!this._active.length)this._handlerFb(this._id,"PUT",$g(t,e,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(t,e,n)}start(){this.reset(),this._state=1}put(t,e,n){if(this._state!==3){if(this._state===1)for(;e<n;){let r=t[e++];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-e>0&&this._put(t,e,n)}}end(t,e=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",t);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=e,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(t),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=Fd,this._id=-1,this._state=0}}},Ri=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,e,n){this._hitLimit||(this._data+=$g(t,e,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data),e instanceof Promise))return e.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,e}},Hd=[],TQ=class{constructor(){this._handlers=Object.create(null),this._active=Hd,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Hd}registerHandler(t,e){this._handlers[t]===void 0&&(this._handlers[t]=[]);let n=this._handlers[t];return n.push(e),{dispose:()=>{let r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}reset(){if(this._active.length)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].unhook(!1);this._stack.paused=!1,this._active=Hd,this._ident=0}hook(t,e){if(this.reset(),this._ident=t,this._active=this._handlers[t]||Hd,!this._active.length)this._handlerFb(this._ident,"HOOK",e);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(e)}put(t,e,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",$g(t,e,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(t,e,n)}unhook(t,e=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",t);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=e,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(t),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=Hd,this._ident=0}},ih=new AD;ih.addParam(0);var X5=class{constructor(t){this._handler=t,this._data="",this._params=ih,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():ih,this._data="",this._hitLimit=!1}put(t,e,n){this._hitLimit||(this._data+=$g(t,e,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(n=>(this._params=ih,this._data="",this._hitLimit=!1,n));return this._params=ih,this._data="",this._hitLimit=!1,e}},MQ=class{constructor(t){this.table=new Uint8Array(t)}setDefault(t,e){this.table.fill(t<<4|e)}add(t,e,n,r){this.table[e<<8|t]=n<<4|r}addMany(t,e,n,r){for(let i=0;i<t.length;i++)this.table[e<<8|t[i]]=n<<4|r}},Zi=160,AQ=function(){let t=new MQ(4095),e=Array.apply(null,Array(256)).map((c,d)=>d),n=(c,d)=>e.slice(c,d),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let s=n(0,14),a;t.setDefault(1,0),t.addMany(r,0,2,0);for(a in s)t.addMany([24,26,153,154],a,3,0),t.addMany(n(128,144),a,3,0),t.addMany(n(144,152),a,3,0),t.add(156,a,0,0),t.add(27,a,11,1),t.add(157,a,4,8),t.addMany([152,158,159],a,0,7),t.add(155,a,11,3),t.add(144,a,11,9);return t.addMany(i,0,3,0),t.addMany(i,1,3,1),t.add(127,1,0,1),t.addMany(i,8,0,8),t.addMany(i,3,3,3),t.add(127,3,0,3),t.addMany(i,4,3,4),t.add(127,4,0,4),t.addMany(i,6,3,6),t.addMany(i,5,3,5),t.add(127,5,0,5),t.addMany(i,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(r,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(n(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(r,7,0,7),t.addMany(i,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(n(64,127),3,7,0),t.addMany(n(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(n(48,60),4,8,4),t.addMany(n(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(n(32,64),6,0,6),t.add(127,6,0,6),t.addMany(n(64,127),6,0,0),t.addMany(n(32,48),3,9,5),t.addMany(n(32,48),5,9,5),t.addMany(n(48,64),5,0,6),t.addMany(n(64,127),5,7,0),t.addMany(n(32,48),4,9,5),t.addMany(n(32,48),1,9,2),t.addMany(n(32,48),2,9,2),t.addMany(n(48,127),2,10,0),t.addMany(n(48,80),1,10,0),t.addMany(n(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(n(96,127),1,10,0),t.add(80,1,11,9),t.addMany(i,9,0,9),t.add(127,9,0,9),t.addMany(n(28,32),9,0,9),t.addMany(n(32,48),9,9,12),t.addMany(n(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(i,11,0,11),t.addMany(n(32,128),11,0,11),t.addMany(n(28,32),11,0,11),t.addMany(i,10,0,10),t.add(127,10,0,10),t.addMany(n(28,32),10,0,10),t.addMany(n(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(n(32,48),10,9,12),t.addMany(i,12,0,12),t.add(127,12,0,12),t.addMany(n(28,32),12,0,12),t.addMany(n(32,48),12,9,12),t.addMany(n(48,64),12,0,11),t.addMany(n(64,127),12,12,13),t.addMany(n(64,127),10,12,13),t.addMany(n(64,127),9,12,13),t.addMany(i,13,13,13),t.addMany(r,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(Zi,0,2,0),t.add(Zi,8,5,8),t.add(Zi,6,0,6),t.add(Zi,11,0,11),t.add(Zi,13,13,13),t}(),NQ=class extends Lt{constructor(t=AQ){super(),this._transitions=t,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new AD,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,n,r)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,n)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(En(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new RQ),this._dcsParser=this._register(new TQ),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(t,e=[64,126]){let n=0;if(t.prefix){if(t.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=t.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let i=0;i<t.intermediates.length;++i){let s=t.intermediates.charCodeAt(i);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=s}}if(t.final.length!==1)throw new Error("final must be a single byte");let r=t.final.charCodeAt(0);if(e[0]>r||r>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return n<<=8,n|=r,n}identToString(t){let e=[];for(;t;)e.push(String.fromCharCode(t&255)),t>>=8;return e.reverse().join("")}setPrintHandler(t){this._printHandler=t}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(t,e){let n=this._identifier(t,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(e),{dispose:()=>{let i=r.indexOf(e);i!==-1&&r.splice(i,1)}}}clearEscHandler(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]}setEscHandlerFallback(t){this._escHandlerFb=t}setExecuteHandler(t,e){this._executeHandlers[t.charCodeAt(0)]=e}clearExecuteHandler(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]}setExecuteHandlerFallback(t){this._executeHandlerFb=t}registerCsiHandler(t,e){let n=this._identifier(t);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(e),{dispose:()=>{let i=r.indexOf(e);i!==-1&&r.splice(i,1)}}}clearCsiHandler(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]}setCsiHandlerFallback(t){this._csiHandlerFb=t}registerDcsHandler(t,e){return this._dcsParser.registerHandler(this._identifier(t),e)}clearDcsHandler(t){this._dcsParser.clearHandler(this._identifier(t))}setDcsHandlerFallback(t){this._dcsParser.setHandlerFallback(t)}registerOscHandler(t,e){return this._oscParser.registerHandler(t,e)}clearOscHandler(t){this._oscParser.clearHandler(t)}setOscHandlerFallback(t){this._oscParser.setHandlerFallback(t)}setErrorHandler(t){this._errorHandler=t}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(t,e,n,r,i){this._parseStack.state=t,this._parseStack.handlers=e,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(t,e,n){let r=0,i=0,s=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,s=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 c=this._parseStack.handlers,d=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&d>-1){for(;d>=0&&(a=c[d](this._params),a!==!0);d--)if(a instanceof Promise)return this._parseStack.handlerPos=d,a}this._parseStack.handlers=[];break;case 4:if(n===!1&&d>-1){for(;d>=0&&(a=c[d](),a!==!0);d--)if(a instanceof Promise)return this._parseStack.handlerPos=d,a}this._parseStack.handlers=[];break;case 6:if(r=t[this._parseStack.chunkPos],a=this._dcsParser.unhook(r!==24&&r!==26,n),a)return a;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=t[this._parseStack.chunkPos],a=this._oscParser.end(r!==24&&r!==26,n),a)return a;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,s=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let c=s;c<e;++c){switch(r=t[c],i=this._transitions.table[this.currentState<<8|(r<160?r:Zi)],i>>4){case 2:for(let v=c+1;;++v){if(v>=e||(r=t[v])<32||r>126&&r<Zi){this._printHandler(t,c,v),c=v-1;break}if(++v>=e||(r=t[v])<32||r>126&&r<Zi){this._printHandler(t,c,v),c=v-1;break}if(++v>=e||(r=t[v])<32||r>126&&r<Zi){this._printHandler(t,c,v),c=v-1;break}if(++v>=e||(r=t[v])<32||r>126&&r<Zi){this._printHandler(t,c,v),c=v-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:c,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|r],u=d?d.length-1:-1;for(;u>=0&&(a=d[u](this._params),a!==!0);u--)if(a instanceof Promise)return this._preserveStack(3,d,u,i,c),a;u<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(++c<e&&(r=t[c])>47&&r<60);c--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let f=this._escHandlers[this._collect<<8|r],m=f?f.length-1:-1;for(;m>=0&&(a=f[m](),a!==!0);m--)if(a instanceof Promise)return this._preserveStack(4,f,m,i,c),a;m<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let v=c+1;;++v)if(v>=e||(r=t[v])===24||r===26||r===27||r>127&&r<Zi){this._dcsParser.put(t,c,v),c=v-1;break}break;case 14:if(a=this._dcsParser.unhook(r!==24&&r!==26),a)return this._preserveStack(6,[],0,i,c),a;r===27&&(i|=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 v=c+1;;v++)if(v>=e||(r=t[v])<32||r>127&&r<Zi){this._oscParser.put(t,c,v),c=v-1;break}break;case 6:if(a=this._oscParser.end(r!==24&&r!==26),a)return this._preserveStack(5,[],0,i,c),a;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=i&15}}},DQ=/^([\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})$/,OQ=/^[\da-f]+$/;function Q5(t){if(!t)return;let e=t.toLowerCase();if(e.indexOf("rgb:")===0){e=e.slice(4);let n=DQ.exec(e);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(e.indexOf("#")===0&&(e=e.slice(1),OQ.exec(e)&&[3,6,9,12].includes(e.length))){let n=e.length/3,r=[0,0,0];for(let i=0;i<3;++i){let s=parseInt(e.slice(n*i,n*i+n),16);r[i]=n===1?s<<4:n===2?s:n===3?s>>4:s>>8}return r}}function Hb(t,e){let n=t.toString(16),r=n.length<2?"0"+n:n;switch(e){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function jQ(t,e=16){let[n,r,i]=t;return`rgb:${Hb(n,e)}/${Hb(r,e)}/${Hb(i,e)}`}var LQ={"(":0,")":1,"*":2,"+":3,"-":1,".":2},za=131072,Z5=10;function J5(t,e){if(t>24)return e.setWinLines||!1;switch(t){case 1:return!!e.restoreWin;case 2:return!!e.minimizeWin;case 3:return!!e.setWinPosition;case 4:return!!e.setWinSizePixels;case 5:return!!e.raiseWin;case 6:return!!e.lowerWin;case 7:return!!e.refreshWin;case 8:return!!e.setWinSizeChars;case 9:return!!e.maximizeWin;case 10:return!!e.fullscreenWin;case 11:return!!e.getWinState;case 13:return!!e.getWinPosition;case 14:return!!e.getWinSizePixels;case 15:return!!e.getScreenSizePixels;case 16:return!!e.getCellSizePixels;case 18:return!!e.getWinSizeChars;case 19:return!!e.getScreenSizeChars;case 20:return!!e.getIconTitle;case 21:return!!e.getWinTitle;case 22:return!!e.pushTitle;case 23:return!!e.popTitle;case 24:return!!e.setWinLines}return!1}var e3=5e3,t3=0,IQ=class extends Lt{constructor(t,e,n,r,i,s,a,c,d=new NQ){super(),this._bufferService=t,this._charsetService=e,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=s,this._coreMouseService=a,this._unicodeService=c,this._parser=d,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new tY,this._utf8Decoder=new nY,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Xn.clone(),this._eraseAttrDataInternal=Xn.clone(),this._onRequestBell=this._register(new qe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new qe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new qe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new qe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new qe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new qe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new qe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new qe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new qe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new qe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new qe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new qe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new qe),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 K_(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(u=>this._activeBuffer=u.activeBuffer)),this._parser.setCsiHandlerFallback((u,f)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(u),params:f.toArray()})}),this._parser.setEscHandlerFallback(u=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(u)})}),this._parser.setExecuteHandlerFallback(u=>{this._logService.debug("Unknown EXECUTE code: ",{code:u})}),this._parser.setOscHandlerFallback((u,f,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:u,action:f,data:m})}),this._parser.setDcsHandlerFallback((u,f,m)=>{f==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(u),action:f,payload:m})}),this._parser.setPrintHandler((u,f,m)=>this.print(u,f,m)),this._parser.registerCsiHandler({final:"@"},u=>this.insertChars(u)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},u=>this.scrollLeft(u)),this._parser.registerCsiHandler({final:"A"},u=>this.cursorUp(u)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},u=>this.scrollRight(u)),this._parser.registerCsiHandler({final:"B"},u=>this.cursorDown(u)),this._parser.registerCsiHandler({final:"C"},u=>this.cursorForward(u)),this._parser.registerCsiHandler({final:"D"},u=>this.cursorBackward(u)),this._parser.registerCsiHandler({final:"E"},u=>this.cursorNextLine(u)),this._parser.registerCsiHandler({final:"F"},u=>this.cursorPrecedingLine(u)),this._parser.registerCsiHandler({final:"G"},u=>this.cursorCharAbsolute(u)),this._parser.registerCsiHandler({final:"H"},u=>this.cursorPosition(u)),this._parser.registerCsiHandler({final:"I"},u=>this.cursorForwardTab(u)),this._parser.registerCsiHandler({final:"J"},u=>this.eraseInDisplay(u,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},u=>this.eraseInDisplay(u,!0)),this._parser.registerCsiHandler({final:"K"},u=>this.eraseInLine(u,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},u=>this.eraseInLine(u,!0)),this._parser.registerCsiHandler({final:"L"},u=>this.insertLines(u)),this._parser.registerCsiHandler({final:"M"},u=>this.deleteLines(u)),this._parser.registerCsiHandler({final:"P"},u=>this.deleteChars(u)),this._parser.registerCsiHandler({final:"S"},u=>this.scrollUp(u)),this._parser.registerCsiHandler({final:"T"},u=>this.scrollDown(u)),this._parser.registerCsiHandler({final:"X"},u=>this.eraseChars(u)),this._parser.registerCsiHandler({final:"Z"},u=>this.cursorBackwardTab(u)),this._parser.registerCsiHandler({final:"`"},u=>this.charPosAbsolute(u)),this._parser.registerCsiHandler({final:"a"},u=>this.hPositionRelative(u)),this._parser.registerCsiHandler({final:"b"},u=>this.repeatPrecedingCharacter(u)),this._parser.registerCsiHandler({final:"c"},u=>this.sendDeviceAttributesPrimary(u)),this._parser.registerCsiHandler({prefix:">",final:"c"},u=>this.sendDeviceAttributesSecondary(u)),this._parser.registerCsiHandler({final:"d"},u=>this.linePosAbsolute(u)),this._parser.registerCsiHandler({final:"e"},u=>this.vPositionRelative(u)),this._parser.registerCsiHandler({final:"f"},u=>this.hVPosition(u)),this._parser.registerCsiHandler({final:"g"},u=>this.tabClear(u)),this._parser.registerCsiHandler({final:"h"},u=>this.setMode(u)),this._parser.registerCsiHandler({prefix:"?",final:"h"},u=>this.setModePrivate(u)),this._parser.registerCsiHandler({final:"l"},u=>this.resetMode(u)),this._parser.registerCsiHandler({prefix:"?",final:"l"},u=>this.resetModePrivate(u)),this._parser.registerCsiHandler({final:"m"},u=>this.charAttributes(u)),this._parser.registerCsiHandler({final:"n"},u=>this.deviceStatus(u)),this._parser.registerCsiHandler({prefix:"?",final:"n"},u=>this.deviceStatusPrivate(u)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},u=>this.softReset(u)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},u=>this.setCursorStyle(u)),this._parser.registerCsiHandler({final:"r"},u=>this.setScrollRegion(u)),this._parser.registerCsiHandler({final:"s"},u=>this.saveCursor(u)),this._parser.registerCsiHandler({final:"t"},u=>this.windowOptions(u)),this._parser.registerCsiHandler({final:"u"},u=>this.restoreCursor(u)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},u=>this.insertColumns(u)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},u=>this.deleteColumns(u)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},u=>this.selectProtected(u)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},u=>this.requestMode(u,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},u=>this.requestMode(u,!1)),this._parser.setExecuteHandler(De.BEL,()=>this.bell()),this._parser.setExecuteHandler(De.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(De.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(De.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(De.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(De.BS,()=>this.backspace()),this._parser.setExecuteHandler(De.HT,()=>this.tab()),this._parser.setExecuteHandler(De.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(De.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(fp.IND,()=>this.index()),this._parser.setExecuteHandler(fp.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(fp.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Ri(u=>(this.setTitle(u),this.setIconName(u),!0))),this._parser.registerOscHandler(1,new Ri(u=>this.setIconName(u))),this._parser.registerOscHandler(2,new Ri(u=>this.setTitle(u))),this._parser.registerOscHandler(4,new Ri(u=>this.setOrReportIndexedColor(u))),this._parser.registerOscHandler(8,new Ri(u=>this.setHyperlink(u))),this._parser.registerOscHandler(10,new Ri(u=>this.setOrReportFgColor(u))),this._parser.registerOscHandler(11,new Ri(u=>this.setOrReportBgColor(u))),this._parser.registerOscHandler(12,new Ri(u=>this.setOrReportCursorColor(u))),this._parser.registerOscHandler(104,new Ri(u=>this.restoreIndexedColor(u))),this._parser.registerOscHandler(110,new Ri(u=>this.restoreFgColor(u))),this._parser.registerOscHandler(111,new Ri(u=>this.restoreBgColor(u))),this._parser.registerOscHandler(112,new Ri(u=>this.restoreCursorColor(u))),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 u in ar)this._parser.registerEscHandler({intermediates:"(",final:u},()=>this.selectCharset("("+u)),this._parser.registerEscHandler({intermediates:")",final:u},()=>this.selectCharset(")"+u)),this._parser.registerEscHandler({intermediates:"*",final:u},()=>this.selectCharset("*"+u)),this._parser.registerEscHandler({intermediates:"+",final:u},()=>this.selectCharset("+"+u)),this._parser.registerEscHandler({intermediates:"-",final:u},()=>this.selectCharset("-"+u)),this._parser.registerEscHandler({intermediates:".",final:u},()=>this.selectCharset("."+u)),this._parser.registerEscHandler({intermediates:"/",final:u},()=>this.selectCharset("/"+u));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(u=>(this._logService.error("Parsing error: ",u),u)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new X5((u,f)=>this.requestStatusString(u,f)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),e3))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${e3} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,s=0,a=this._parseStack.paused;if(a){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>za&&(s=this._parseStack.position+za)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,u=>String.fromCharCode(u)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(u=>u.charCodeAt(0)):t),this._parseBuffer.length<t.length&&this._parseBuffer.length<za&&(this._parseBuffer=new Uint32Array(Math.min(t.length,za))),a||this._dirtyRowTracker.clearRange(),t.length>za)for(let u=s;u<t.length;u+=za){let f=u+za<t.length?u+za:t.length,m=typeof t=="string"?this._stringDecoder.decode(t.substring(u,f),this._parseBuffer):this._utf8Decoder.decode(t.subarray(u,f),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,m))return this._preserveStack(r,i,m,u),this._logSlowResolvingAsync(n),n}else if(!a){let u=typeof t=="string"?this._stringDecoder.decode(t,this._parseBuffer):this._utf8Decoder.decode(t,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,u))return this._preserveStack(r,i,u,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let c=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),d=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);d<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(d,this._bufferService.rows-1),end:Math.min(c,this._bufferService.rows-1)})}print(t,e,n){let r,i,s=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,c=this._bufferService.cols,d=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,f=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-e>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,f);let v=this._parser.precedingJoinState;for(let b=e;b<n;++b){if(r=t[b],r<127&&s){let k=s[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let S=this._unicodeService.charProperties(r,v);i=Hl.extractWidth(S);let x=Hl.extractShouldJoin(S),C=x?Hl.extractWidth(v):0;if(v=S,a&&this._onA11yChar.fire(Ua(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-C>c){if(d){let k=m,E=this._activeBuffer.x-C;for(this._activeBuffer.x=C,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&m instanceof nh&&m.copyCellsFrom(k,E,0,C,!1);E<c;)k.setCellFromCodepoint(E++,0,1,f)}else if(this._activeBuffer.x=c-1,i===2)continue}if(x&&this._activeBuffer.x){let k=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-k,r,i);for(let E=i-C;--E>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,f);continue}if(u&&(m.insertCells(this._activeBuffer.x,i-C,this._activeBuffer.getNullCell(f)),m.getWidth(c-1)===2&&m.setCellFromCodepoint(c-1,0,1,f)),m.setCellFromCodepoint(this._activeBuffer.x++,r,i,f),i>0)for(;--i;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,f)}this._parser.precedingJoinState=v,this._activeBuffer.x<c&&n-e>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,f),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,e){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,n=>J5(n.params[0],this._optionsService.rawOptions.windowOptions)?e(n):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new X5(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Ri(e))}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 t;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&&((t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&t.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,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(t,e){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+e):(this._activeBuffer.x=t,this._activeBuffer.y=e),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,e){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+e)}cursorUp(t){let e=this._activeBuffer.y-this._activeBuffer.scrollTop;return e>=0?this._moveCursor(0,-Math.min(e,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let e=this._activeBuffer.scrollBottom-this._activeBuffer.y;return e>=0?this._moveCursor(0,Math.min(e,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let e=t.params[0];return e===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:e===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let e=t.params[0];return e===1&&(this._curAttrData.bg|=536870912),(e===2||e===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,e,n,r=!1,i=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);s.replaceCells(e,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(s.isWrapped=!1)}_resetBufferLine(t,e=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),e),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),n.isWrapped=!1)}eraseInDisplay(t,e=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(t.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,e);n<this._bufferService.rows;n++)this._resetBufferLine(n,e);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,e),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,e);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,e);this._dirtyRowTracker.markDirty(0)}break;case 3:let i=this._activeBuffer.lines.length-this._bufferService.rows;i>0&&(this._activeBuffer.lines.trimStart(i),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-i,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-i,0),this._onScroll.fire(0));break}return!0}eraseInLine(t,e=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,e);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,e);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let e=t.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,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;e--;)this._activeBuffer.lines.splice(i-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(t){this._restrictCursor();let e=t.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;e--;)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(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.insertCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.deleteCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(t){let e=t.params[0]||1;for(;e--;)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(t){let e=t.params[0]||1;for(;e--;)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(Xn));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.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,e,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.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,e,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.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,e,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.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,e,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(t.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(t){let e=this._parser.precedingJoinState;if(!e)return!0;let n=t.params[0]||1,r=Hl.extractWidth(e),i=this._activeBuffer.x-r,s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),a=new Uint32Array(s.length*n),c=0;for(let u=0;u<s.length;){let f=s.codePointAt(u)||0;a[c++]=f,u+=f>65535?2:1}let d=c;for(let u=1;u<n;++u)a.copyWithin(d,0,c),d+=c;return this.print(a,0,d),!0}sendDeviceAttributesPrimary(t){return t.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(De.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(De.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(De.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(De.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(De.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Pl),this._charsetService.setgCharset(1,Pl),this._charsetService.setgCharset(2,Pl),this._charsetService.setgCharset(3,Pl);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(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){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(),t.params[e]===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(t,e){(x=>(x[x.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",x[x.SET=1]="SET",x[x.RESET=2]="RESET",x[x.PERMANENTLY_SET=3]="PERMANENTLY_SET",x[x.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:s}=this._coreMouseService,a=this._coreService,{buffers:c,cols:d}=this._bufferService,{active:u,alt:f}=c,m=this._optionsService.rawOptions,v=(x,C)=>(a.triggerDataEvent(`${De.ESC}[${e?"":"?"}${x};${C}$y`),!0),b=x=>x?1:2,S=t.params[0];return e?S===2?v(S,4):S===4?v(S,b(a.modes.insertMode)):S===12?v(S,3):S===20?v(S,b(m.convertEol)):v(S,0):S===1?v(S,b(r.applicationCursorKeys)):S===3?v(S,m.windowOptions.setWinLines?d===80?2:d===132?1:0:0):S===6?v(S,b(r.origin)):S===7?v(S,b(r.wraparound)):S===8?v(S,3):S===9?v(S,b(i==="X10")):S===12?v(S,b(m.cursorBlink)):S===25?v(S,b(!a.isCursorHidden)):S===45?v(S,b(r.reverseWraparound)):S===66?v(S,b(r.applicationKeypad)):S===67?v(S,4):S===1e3?v(S,b(i==="VT200")):S===1002?v(S,b(i==="DRAG")):S===1003?v(S,b(i==="ANY")):S===1004?v(S,b(r.sendFocus)):S===1005?v(S,4):S===1006?v(S,b(s==="SGR")):S===1015?v(S,4):S===1016?v(S,b(s==="SGR_PIXELS")):S===1048?v(S,1):S===47||S===1047||S===1049?v(S,b(u===f)):S===2004?v(S,b(r.bracketedPasteMode)):S===2026?v(S,b(r.synchronizedOutput)):v(S,0)}_updateAttrColor(t,e,n,r,i){return e===2?(t|=50331648,t&=-16777216,t|=qh.fromColorRGB([n,r,i])):e===5&&(t&=-50331904,t|=33554432|n&255),t}_extractColor(t,e,n){let r=[0,0,-1,0,0,0],i=0,s=0;do{if(r[s+i]=t.params[e+s],t.hasSubParams(e+s)){let a=t.getSubParams(e+s),c=0;do r[1]===5&&(i=1),r[s+c+1+i]=a[c];while(++c<a.length&&c+s+1+i<r.length);break}if(r[1]===5&&s+i>=2||r[1]===2&&s+i>=5)break;r[1]&&(i=1)}while(++s+e<t.length&&s+i<r.length);for(let a=2;a<r.length;++a)r[a]===-1&&(r[a]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return s}_processUnderline(t,e){e.extended=e.extended.clone(),(!~t||t>5)&&(t=1),e.extended.underlineStyle=t,e.fg|=268435456,t===0&&(e.fg&=-268435457),e.updateExtended()}_processSGR0(t){t.fg=Xn.fg,t.bg=Xn.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let e=t.length,n,r=this._curAttrData;for(let i=0;i<e;i++)n=t.params[i],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(t.hasSubParams(i)?t.getSubParams(i)[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|=Xn.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=Xn.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(t,i,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|=Xn.fg&16777215,r.bg&=-67108864,r.bg|=Xn.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${De.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${De.ESC}[${e};${n}R`);break}return!0}deviceStatusPrivate(t){switch(t.params[0]){case 6:let e=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${De.ESC}[?${e};${n}R`);break}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Xn.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(t){let e=t.length===0?1:t.params[0];if(e===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(e){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=e%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(t){let e=t.params[0]||1,n;return(t.length<2||(n=t.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>e&&(this._activeBuffer.scrollTop=e-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(t){if(!J5(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let e=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:e!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${De.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Z5&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Z5&&this._iconNameStack.shift());break;case 23:(e===0||e===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(e===0||e===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){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(t){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(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let e=[],n=t.split(";");for(;n.length>1;){let r=n.shift(),i=n.shift();if(/^\d+$/.exec(r)){let s=parseInt(r);if(n3(s))if(i==="?")e.push({type:0,index:s});else{let a=Q5(i);a&&e.push({type:1,index:s,color:a})}}}return e.length&&this._onColor.fire(e),!0}setHyperlink(t){let e=t.indexOf(";");if(e===-1)return!0;let n=t.slice(0,e).trim(),r=t.slice(e+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let n=t.split(":"),r,i=n.findIndex(s=>s.startsWith("id="));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:e}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,e){let n=t.split(";");for(let r=0;r<n.length&&!(e>=this._specialColors.length);++r,++e)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let i=Q5(n[r]);i&&this._onColor.fire([{type:1,index:this._specialColors[e],color:i}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let e=[],n=t.split(";");for(let r=0;r<n.length;++r)if(/^\d+$/.exec(n[r])){let i=parseInt(n[r]);n3(i)&&e.push({type:2,index:i})}return e.length&&this._onColor.fire(e),!0}restoreFgColor(t){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(t){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(t){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,Pl),!0}selectCharset(t){return t.length!==2?(this.selectDefaultCharset(),!0):(t[0]==="/"||this._charsetService.setgCharset(LQ[t[0]],ar[t[1]]||Pl),!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 t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,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=Xn.clone(),this._eraseAttrDataInternal=Xn.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new ns;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e<this._bufferService.rows;++e){let n=this._activeBuffer.ybase+this._activeBuffer.y+e,r=this._activeBuffer.lines.get(n);r&&(r.fill(t),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(t,e){let n=a=>(this._coreService.triggerDataEvent(`${De.ESC}${a}${De.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-(i.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,e){this._dirtyRowTracker.markRangeDirty(t,e)}},K_=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){t<this.start?this.start=t:t>this.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(t3=t,t=e,e=t3),t<this.start&&(this.start=t),e>this.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};K_=Ln([et(0,Qr)],K_);function n3(t){return 0<=t&&t<256}var PQ=5e7,r3=12,zQ=50,BQ=class extends Lt{constructor(t){super(),this._action=t,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new qe),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(t,e){if(e!==void 0&&this._syncCalls>e){this._syncCalls=0;return}if(this._pendingData+=t.length,this._writeBuffer.push(t),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(t,e){if(this._pendingData>PQ)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+=t.length,this._writeBuffer.push(t),this._callbacks.push(e),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(e)}_innerWrite(t=0,e=!0){let n=t||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],i=this._action(r,e);if(i){let a=c=>performance.now()-n>=r3?setTimeout(()=>this._innerWrite(0,c)):this._innerWrite(n,c);i.catch(c=>(queueMicrotask(()=>{throw c}),Promise.resolve(!1))).then(a);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=r3)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>zQ&&(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()}},G_=class{constructor(t){this._bufferService=t,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(t){let e=this._bufferService.buffer;if(t.id===void 0){let c=e.addMarker(e.ybase+e.y),d={data:t,id:this._nextId++,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(d,c)),this._dataByLinkId.set(d.id,d),d.id}let n=t,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,e.ybase+e.y),i.id;let s=e.addMarker(e.ybase+e.y),a={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(a,s)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(t,e){let n=this._dataByLinkId.get(t);if(n&&n.lines.every(r=>r.line!==e)){let r=this._bufferService.buffer.addMarker(e);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(t){var e;return(e=this._dataByLinkId.get(t))==null?void 0:e.data}_getEntryIdKey(t){return`${t.id};;${t.uri}`}_removeMarkerFromLink(t,e){let n=t.lines.indexOf(e);n!==-1&&(t.lines.splice(n,1),t.lines.length===0&&(t.data.id!==void 0&&this._entriesWithId.delete(t.key),this._dataByLinkId.delete(t.id)))}};G_=Ln([et(0,Qr)],G_);var i3=!1,FQ=class extends Lt{constructor(t){super(),this._windowsWrappingHeuristics=this._register(new ku),this._onBinary=this._register(new qe),this.onBinary=this._onBinary.event,this._onData=this._register(new qe),this.onData=this._onData.event,this._onLineFeed=this._register(new qe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new qe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new qe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new qe),this._instantiationService=new uQ,this.optionsService=this._register(new yQ(t)),this._instantiationService.setService(Zr,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(U_)),this._instantiationService.setService(Qr,this._bufferService),this._logService=this._register(this._instantiationService.createInstance($_)),this._instantiationService.setService(YN,this._logService),this.coreService=this._register(this._instantiationService.createInstance(W_)),this._instantiationService.setService(lc,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(V_)),this._instantiationService.setService(GN,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Hl)),this._instantiationService.setService(oY,this.unicodeService),this._charsetService=this._instantiationService.createInstance(kQ),this._instantiationService.setService(sY,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(G_),this._instantiationService.setService(XN,this._oscLinkService),this._inputHandler=this._register(new IQ(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Mr.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Mr.forward(this._bufferService.onResize,this._onResize)),this._register(Mr.forward(this.coreService.onData,this._onData)),this._register(Mr.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 BQ((e,n)=>this._inputHandler.parse(e,n))),this._register(Mr.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new qe),this._onScroll.event(t=>{var e;(e=this._onScrollApi)==null||e.fire(t.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(t){for(let e in t)this.optionsService.options[e]=t[e]}write(t,e){this._writeBuffer.write(t,e)}writeSync(t,e){this._logService.logLevel<=3&&!i3&&(this._logService.warn("writeSync is unreliable and will be removed soon."),i3=!0),this._writeBuffer.writeSync(t,e)}input(t,e=!0){this.coreService.triggerDataEvent(t,e)}resize(t,e){isNaN(t)||isNaN(e)||(t=Math.max(t,TD),e=Math.max(e,MD),this._bufferService.resize(t,e))}scroll(t,e=!1){this._bufferService.scroll(t,e)}scrollLines(t,e){this._bufferService.scrollLines(t,e)}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(t){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(t){let e=t-this._bufferService.buffer.ydisp;e!==0&&this.scrollLines(e)}registerEscHandler(t,e){return this._inputHandler.registerEscHandler(t,e)}registerDcsHandler(t,e){return this._inputHandler.registerDcsHandler(t,e)}registerCsiHandler(t,e){return this._inputHandler.registerCsiHandler(t,e)}registerOscHandler(t,e){return this._inputHandler.registerOscHandler(t,e)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let t=!1,e=this.optionsService.rawOptions.windowsPty;e&&e.buildNumber!==void 0&&e.buildNumber!==void 0?t=e.backend==="conpty"&&e.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(t=!0),t?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let t=[];t.push(this.onLineFeed(Y5.bind(null,this._bufferService))),t.push(this.registerCsiHandler({final:"H"},()=>(Y5(this._bufferService),!1))),this._windowsWrappingHeuristics.value=En(()=>{for(let e of t)e.dispose()})}}},HQ={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 $Q(t,e,n,r){var a;let i={type:0,cancel:!1,key:void 0},s=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?e?i.key=De.ESC+"OA":i.key=De.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?i.key=De.ESC+"OD":i.key=De.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?i.key=De.ESC+"OC":i.key=De.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?i.key=De.ESC+"OB":i.key=De.ESC+"[B");break;case 8:i.key=t.ctrlKey?"\b":De.DEL,t.altKey&&(i.key=De.ESC+i.key);break;case 9:if(t.shiftKey){i.key=De.ESC+"[Z";break}i.key=De.HT,i.cancel=!0;break;case 13:i.key=t.altKey?De.ESC+De.CR:De.CR,i.cancel=!0;break;case 27:i.key=De.ESC,t.altKey&&(i.key=De.ESC+De.ESC),i.cancel=!0;break;case 37:if(t.metaKey)break;s?i.key=De.ESC+"[1;"+(s+1)+"D":e?i.key=De.ESC+"OD":i.key=De.ESC+"[D";break;case 39:if(t.metaKey)break;s?i.key=De.ESC+"[1;"+(s+1)+"C":e?i.key=De.ESC+"OC":i.key=De.ESC+"[C";break;case 38:if(t.metaKey)break;s?i.key=De.ESC+"[1;"+(s+1)+"A":e?i.key=De.ESC+"OA":i.key=De.ESC+"[A";break;case 40:if(t.metaKey)break;s?i.key=De.ESC+"[1;"+(s+1)+"B":e?i.key=De.ESC+"OB":i.key=De.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(i.key=De.ESC+"[2~");break;case 46:s?i.key=De.ESC+"[3;"+(s+1)+"~":i.key=De.ESC+"[3~";break;case 36:s?i.key=De.ESC+"[1;"+(s+1)+"H":e?i.key=De.ESC+"OH":i.key=De.ESC+"[H";break;case 35:s?i.key=De.ESC+"[1;"+(s+1)+"F":e?i.key=De.ESC+"OF":i.key=De.ESC+"[F";break;case 33:t.shiftKey?i.type=2:t.ctrlKey?i.key=De.ESC+"[5;"+(s+1)+"~":i.key=De.ESC+"[5~";break;case 34:t.shiftKey?i.type=3:t.ctrlKey?i.key=De.ESC+"[6;"+(s+1)+"~":i.key=De.ESC+"[6~";break;case 112:s?i.key=De.ESC+"[1;"+(s+1)+"P":i.key=De.ESC+"OP";break;case 113:s?i.key=De.ESC+"[1;"+(s+1)+"Q":i.key=De.ESC+"OQ";break;case 114:s?i.key=De.ESC+"[1;"+(s+1)+"R":i.key=De.ESC+"OR";break;case 115:s?i.key=De.ESC+"[1;"+(s+1)+"S":i.key=De.ESC+"OS";break;case 116:s?i.key=De.ESC+"[15;"+(s+1)+"~":i.key=De.ESC+"[15~";break;case 117:s?i.key=De.ESC+"[17;"+(s+1)+"~":i.key=De.ESC+"[17~";break;case 118:s?i.key=De.ESC+"[18;"+(s+1)+"~":i.key=De.ESC+"[18~";break;case 119:s?i.key=De.ESC+"[19;"+(s+1)+"~":i.key=De.ESC+"[19~";break;case 120:s?i.key=De.ESC+"[20;"+(s+1)+"~":i.key=De.ESC+"[20~";break;case 121:s?i.key=De.ESC+"[21;"+(s+1)+"~":i.key=De.ESC+"[21~";break;case 122:s?i.key=De.ESC+"[23;"+(s+1)+"~":i.key=De.ESC+"[23~";break;case 123:s?i.key=De.ESC+"[24;"+(s+1)+"~":i.key=De.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?i.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?i.key=De.NUL:t.keyCode>=51&&t.keyCode<=55?i.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?i.key=De.DEL:t.keyCode===219?i.key=De.ESC:t.keyCode===220?i.key=De.FS:t.keyCode===221&&(i.key=De.GS);else if((!n||r)&&t.altKey&&!t.metaKey){let c=(a=HQ[t.keyCode])==null?void 0:a[t.shiftKey?1:0];if(c)i.key=De.ESC+c;else if(t.keyCode>=65&&t.keyCode<=90){let d=t.ctrlKey?t.keyCode-64:t.keyCode+32,u=String.fromCharCode(d);t.shiftKey&&(u=u.toUpperCase()),i.key=De.ESC+u}else if(t.keyCode===32)i.key=De.ESC+(t.ctrlKey?De.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let d=t.code.slice(3,4);t.shiftKey||(d=d.toLowerCase()),i.key=De.ESC+d,i.cancel=!0}}else n&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(i.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?i.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(i.key=De.US),t.key==="@"&&(i.key=De.NUL));break}return i}var Bn=0,UQ=class{constructor(t){this._getKey=t,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Kp,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Kp,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(t){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(t)}_flushInserted(){let t=this._insertedValues.sort((i,s)=>this._getKey(i)-this._getKey(s)),e=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(t[e])<=this._getKey(this._array[n])?(r[i]=t[e],e++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(t){if(this._flushCleanupInserted(),this._array.length===0)return!1;let e=this._getKey(t);if(e===void 0||(Bn=this._search(e),Bn===-1)||this._getKey(this._array[Bn])!==e)return!1;do if(this._array[Bn]===t)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Bn),!0;while(++Bn<this._array.length&&this._getKey(this._array[Bn])===e);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let t=this._deletedIndices.sort((i,s)=>i-s),e=0,n=new Array(this._array.length-t.length),r=0;for(let i=0;i<this._array.length;i++)t[e]===i?e++:n[r++]=this._array[i];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Bn=this._search(t),!(Bn<0||Bn>=this._array.length)&&this._getKey(this._array[Bn])===t))do yield this._array[Bn];while(++Bn<this._array.length&&this._getKey(this._array[Bn])===t)}forEachByKey(t,e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Bn=this._search(t),!(Bn<0||Bn>=this._array.length)&&this._getKey(this._array[Bn])===t))do e(this._array[Bn]);while(++Bn<this._array.length&&this._getKey(this._array[Bn])===t)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(t){let e=0,n=this._array.length-1;for(;n>=e;){let r=e+n>>1,i=this._getKey(this._array[r]);if(i>t)n=r-1;else if(i<t)e=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===t;)r--;return r}}return e}},$b=0,s3=0,WQ=class extends Lt{constructor(){super(),this._decorations=new UQ(t=>t==null?void 0:t.marker.line),this._onDecorationRegistered=this._register(new qe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new qe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(En(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new VQ(t);if(e){let n=e.marker.onDispose(()=>e.dispose()),r=e.onDispose(()=>{r.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),n.dispose())});this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,e,n){let r=0,i=0;for(let s of this._decorations.getKeyIterator(e))r=s.options.x??0,i=r+(s.options.width??1),t>=r&&t<i&&(!n||(s.options.layer??"bottom")===n)&&(yield s)}forEachDecorationAtCell(t,e,n,r){this._decorations.forEachByKey(e,i=>{$b=i.options.x??0,s3=$b+(i.options.width??1),t>=$b&&t<s3&&(!n||(i.options.layer??"bottom")===n)&&r(i)})}},VQ=class extends el{constructor(t){super(),this.options=t,this.onRenderEmitter=this.add(new qe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new qe),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Mn.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Mn.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},qQ=1e3,KQ=class{constructor(t,e=qQ){this._renderCallback=t,this._debounceThresholdMS=e,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(t,e,n){this._rowCount=n,t=t!==void 0?t:0,e=e!==void 0?e:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,t):t,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,e):e;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let i=r-this._lastRefreshMs,s=this._debounceThresholdMS-i;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},s)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let t=Math.max(this._rowStart,0),e=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,e)}},o3=20,Gp=class extends Lt{constructor(t,e,n,r){super(),this._terminal=t,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=i.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let s=0;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);if(this._topBoundaryFocusListener=s=>this._handleBoundaryFocus(s,0),this._bottomBoundaryFocusListener=s=>this._handleBoundaryFocus(s,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=i.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new KQ(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(s=>this._handleResize(s.rows))),this._register(this._terminal.onRender(s=>this._refreshRows(s.start,s.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(s=>this._handleChar(s))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
525
|
+
`))),this._register(this._terminal.onA11yTab(s=>this._handleTab(s))),this._register(this._terminal.onKey(s=>this._handleKey(s.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(yt(i,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(En(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e<t;e++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<o3+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
|
|
526
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===o3+1&&(this._liveRegion.textContent+=m_.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=t;i<=e;i++){let s=n.lines.get(n.ydisp+i),a=[],c=(s==null?void 0:s.translateToString(!0,void 0,void 0,a))||"",d=(n.ydisp+i+1).toString(),u=this._rowElements[i];u&&(c.length===0?(u.textContent=" ",this._rowColumns.set(u,[0,1])):(u.textContent=c,this._rowColumns.set(u,a)),u.setAttribute("aria-posinset",d),u.setAttribute("aria-setsize",r),this._alignRowWidth(u))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let n=t.target,r=this._rowElements[e===0?1:this._rowElements.length-2],i=n.getAttribute("aria-posinset"),s=e===0?"1":`${this._terminal.buffer.lines.length}`;if(i===s||t.relatedTarget!==r)return;let a,c;if(e===0?(a=n,c=this._rowElements.pop(),this._rowContainer.removeChild(c)):(a=this._rowElements.shift(),c=n,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),c.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let d=this._createAccessibilityTreeNode();this._rowElements.unshift(d),this._rowContainer.insertAdjacentElement("afterbegin",d)}else{let d=this._createAccessibilityTreeNode();this._rowElements.push(d),this._rowContainer.appendChild(d)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){var c;if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},n={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===n.node&&e.offset>n.offset)&&([e,n]=[n,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.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:((c=r.textContent)==null?void 0:c.length)??0}),!this._rowContainer.contains(n.node))return;let i=({node:d,offset:u})=>{let f=d instanceof Text?d.parentNode:d,m=parseInt(f==null?void 0:f.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(f);if(!v)return console.warn("columns is null. Race condition?"),null;let b=u<v.length?v[u]:v.slice(-1)[0]+1;return b>=this._terminal.cols&&(++m,b=0),{row:m,column:b}},s=i(e),a=i(n);if(!(!s||!a)){if(s.row>a.row||s.row===a.row&&s.column>=a.column)throw new Error("invalid range");this._terminal.select(s.column,s.row,(a.row-s.row)*this._terminal.cols-s.column+a.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_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 t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t]),this._alignRowWidth(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(t){var i,s;t.style.transform="";let e=t.getBoundingClientRect().width,n=(s=(i=this._rowColumns.get(t))==null?void 0:i.slice(-1))==null?void 0:s[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;t.style.transform=`scaleX(${r/e})`}};Gp=Ln([et(1,Ix),et(2,Zo),et(3,Jo)],Gp);var Y_=class extends Lt{constructor(t,e,n,r,i){super(),this._element=t,this._mouseService=e,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new qe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new qe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(En(()=>{var s;Zl(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(s=this._activeProviderReplies)==null||s.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(yt(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(yt(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(yt(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(yt(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let n=t.composedPath();for(let r=0;r<n.length;r++){let i=n[r];if(i.classList.contains("xterm"))break;if(i.classList.contains("xterm-hover"))return}(!this._lastBufferCell||e.x!==this._lastBufferCell.x||e.y!==this._lastBufferCell.y)&&(this._handleHover(e),this._lastBufferCell=e)}_handleHover(t){if(this._activeLine!==t.y||this._wasResized){this._clearCurrentLink(),this._askForLink(t,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))}_askForLink(t,e){var r,i;(!this._activeProviderReplies||!e)&&((r=this._activeProviderReplies)==null||r.forEach(s=>{s==null||s.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let n=!1;for(let[s,a]of this._linkProviderService.linkProviders.entries())e?(i=this._activeProviderReplies)!=null&&i.get(s)&&(n=this._checkLinkProviderResult(s,t,n)):a.provideLinks(t.y,c=>{var u,f;if(this._isMouseOut)return;let d=c==null?void 0:c.map(m=>({link:m}));(u=this._activeProviderReplies)==null||u.set(s,d),n=this._checkLinkProviderResult(s,t,n),((f=this._activeProviderReplies)==null?void 0:f.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,e){let n=new Set;for(let r=0;r<e.size;r++){let i=e.get(r);if(i)for(let s=0;s<i.length;s++){let a=i[s],c=a.link.range.start.y<t?0:a.link.range.start.x,d=a.link.range.end.y>t?this._bufferService.cols:a.link.range.end.x;for(let u=c;u<=d;u++){if(n.has(u)){i.splice(s--,1);break}n.add(u)}}}}_checkLinkProviderResult(t,e,n){var s;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(t),i=!1;for(let a=0;a<t;a++)(!this._activeProviderReplies.has(a)||this._activeProviderReplies.get(a))&&(i=!0);if(!i&&r){let a=r.find(c=>this._linkAtPosition(c.link,e));a&&(n=!0,this._handleNewLink(a))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let a=0;a<this._activeProviderReplies.size;a++){let c=(s=this._activeProviderReplies.get(a))==null?void 0:s.find(d=>this._linkAtPosition(d.link,e));if(c){n=!0,this._handleNewLink(c);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);e&&this._mouseDownLink&&GQ(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,e){!this._currentLink||!this._lastMouseEvent||(!t||!e||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Zl(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(t.link,e)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.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,i,s;(r=this._currentLink)!=null&&r.state&&((s=(i=this._currentLink)==null?void 0:i.state)==null?void 0:s.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.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,i=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(r,i),this._lastMouseEvent)){let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._askForLink(s,!1)}})))}_linkHover(t,e,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(n,e.text)}_fireUnderlineEvent(t,e){let n=t.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(t,e,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(n,e.text)}_linkAtPosition(t,e){let n=t.range.start.y*this._bufferService.cols+t.range.start.x,r=t.range.end.y*this._bufferService.cols+t.range.end.x,i=e.y*this._bufferService.cols+e.x;return n<=i&&i<=r}_positionFromMouseEvent(t,e,n){let r=n.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,n,r,i){return{x1:t,y1:e,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};Y_=Ln([et(1,Px),et(2,Jo),et(3,Qr),et(4,ZN)],Y_);function GQ(t,e){return t.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}var YQ=class extends FQ{constructor(t={}){super(t),this._linkifier=this._register(new ku),this.browser=vD,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ku),this._onCursorMove=this._register(new qe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new qe),this.onKey=this._onKey.event,this._onRender=this._register(new qe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new qe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new qe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new qe),this.onBell=this._onBell.event,this._onFocus=this._register(new qe),this._onBlur=this._register(new qe),this._onA11yCharEmitter=this._register(new qe),this._onA11yTabEmitter=this._register(new qe),this._onWillOpen=this._register(new qe),this._setup(),this._decorationService=this._instantiationService.createInstance(WQ),this._instantiationService.setService(Kh,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(zX),this._instantiationService.setService(ZN,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g_)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh((e==null?void 0:e.start)??0,(e==null?void 0:e.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(Mr.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Mr.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Mr.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Mr.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(En(()=>{var e,n;this._customKeyEventHandler=void 0,(n=(e=this.element)==null?void 0:e.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(t){if(this._themeService)for(let e of t){let n,r="";switch(e.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;"+e.index}switch(e.type){case 0:let i=Sn.toColorRGB(n==="ansi"?this._themeService.colors.ansi[e.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${De.ESC}]${r};${jQ(i)}${pD.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(s=>s.ansi[e.index]=Qn.toColor(...e.color));else{let s=n;this._themeService.modifyColors(a=>a[s]=Qn.toColor(...e.color))}break;case 2:this._themeService.restoreColor(e.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(t){t?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Gp,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(t){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(De.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var t;return(t=this.textarea)==null?void 0:t.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(De.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let t=this.buffer.ybase+this.buffer.y,e=this.buffer.lines.get(t);if(!e)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=e.getWidth(n),s=this._renderService.dimensions.css.cell.width*i,a=this.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=c+"px",this.textarea.style.top=a+"px",this.textarea.style.width=s+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(yt(this.element,"copy",e=>{this.hasSelection()&&JG(e,this._selectionService)}));let t=e=>eY(e,this.textarea,this.coreService,this.optionsService);this._register(yt(this.textarea,"paste",t)),this._register(yt(this.element,"paste",t)),bD?this._register(yt(this.element,"mousedown",e=>{e.button===2&&g5(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(yt(this.element,"contextmenu",e=>{g5(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Vx&&this._register(yt(this.element,"auxclick",e=>{e.button===1&&UN(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(yt(this.textarea,"keyup",t=>this._keyUp(t),!0)),this._register(yt(this.textarea,"keydown",t=>this._keyDown(t),!0)),this._register(yt(this.textarea,"keypress",t=>this._keyPress(t),!0)),this._register(yt(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(yt(this.textarea,"compositionupdate",t=>this._compositionHelper.compositionupdate(t))),this._register(yt(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(yt(this.textarea,"input",t=>this._inputEvent(t),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(t){var i;if(!t)throw new Error("Terminal requires a parent element.");if(t.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((i=this.element)==null?void 0:i.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=t.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"),t.appendChild(this.element);let e=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),e.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(yt(this.screenElement,"mousemove",s=>this.updateCursorStyle(s))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),e.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f_.get()),xD||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(IX,this.textarea,t.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Zo,this._coreBrowserService),this._register(yt(this.textarea,"focus",s=>this._handleTextAreaFocus(s))),this._register(yt(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(P_,this._document,this._helperContainer),this._instantiationService.setService(Ug,this._charSizeService),this._themeService=this._instantiationService.createInstance(H_),this._instantiationService.setService($u,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Vp),this._instantiationService.setService(QN,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(B_,this.rows,this.screenElement)),this._instantiationService.setService(Jo,this._renderService),this._register(this._renderService.onRenderedViewportChange(s=>this._onRender.fire(s))),this.onResize(s=>this._renderService.resize(s.cols,s.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(j_,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(z_),this._instantiationService.setService(Px,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Y_,this.screenElement));this.element.appendChild(e);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(D_,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(s=>{super.scrollLines(s,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(F_,this.element,this.screenElement,r)),this._instantiationService.setService(lY,this._selectionService),this._register(this._selectionService.onRequestScrollLines(s=>this.scrollLines(s.amount,s.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(s=>this._renderService.handleSelectionChanged(s.start,s.end,s.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(s=>{this.textarea.value=s,this.textarea.focus(),this.textarea.select()})),this._register(Mr.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var s;this._selectionService.refresh(),(s=this._viewport)==null||s.queueSync()})),this._register(this._instantiationService.createInstance(O_,this.screenElement)),this._register(yt(this.element,"mousedown",s=>this._selectionService.handleMouseDown(s))),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(Gp,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",s=>this._handleScreenReaderModeOptionChange(s))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Wp,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",s=>{!this._overviewRulerRenderer&&s&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Wp,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(I_,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let t=this,e=this.element;function n(s){var u,f,m,v,b;let a=t._mouseService.getMouseReportCoords(s,t.screenElement);if(!a)return!1;let c,d;switch(s.overrideType||s.type){case"mousemove":d=32,s.buttons===void 0?(c=3,s.button!==void 0&&(c=s.button<3?s.button:3)):c=s.buttons&1?0:s.buttons&4?1:s.buttons&2?2:3;break;case"mouseup":d=0,c=s.button<3?s.button:3;break;case"mousedown":d=1,c=s.button<3?s.button:3;break;case"wheel":if(t._customWheelEventHandler&&t._customWheelEventHandler(s)===!1)return!1;let S=s.deltaY;if(S===0||t.coreMouseService.consumeWheelEvent(s,(v=(m=(f=(u=t._renderService)==null?void 0:u.dimensions)==null?void 0:f.device)==null?void 0:m.cell)==null?void 0:v.height,(b=t._coreBrowserService)==null?void 0:b.dpr)===0)return!1;d=S<0?0:1,c=4;break;default:return!1}return d===void 0||c===void 0||c>4?!1:t.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:c,action:d,ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:s=>(n(s),s.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(s)),wheel:s=>(n(s),this.cancel(s,!0)),mousedrag:s=>{s.buttons&&n(s)},mousemove:s=>{s.buttons||n(s)}};this._register(this.coreMouseService.onProtocolChange(s=>{s?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(s)),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()),s&8?r.mousemove||(e.addEventListener("mousemove",i.mousemove),r.mousemove=i.mousemove):(e.removeEventListener("mousemove",r.mousemove),r.mousemove=null),s&16?r.wheel||(e.addEventListener("wheel",i.wheel,{passive:!1}),r.wheel=i.wheel):(e.removeEventListener("wheel",r.wheel),r.wheel=null),s&2?r.mouseup||(r.mouseup=i.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),s&4?r.mousedrag||(r.mousedrag=i.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(yt(e,"mousedown",s=>{if(s.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(s)))return n(s),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(s)})),this._register(yt(e,"wheel",s=>{var a,c,d,u,f;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(s)===!1)return!1;if(!this.buffer.hasScrollback){if(s.deltaY===0)return!1;if(t.coreMouseService.consumeWheelEvent(s,(u=(d=(c=(a=t._renderService)==null?void 0:a.dimensions)==null?void 0:c.device)==null?void 0:d.cell)==null?void 0:u.height,(f=t._coreBrowserService)==null?void 0:f.dpr)===0)return this.cancel(s,!0);let m=De.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(s.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(s,!0)}}},{passive:!1}))}refresh(t,e){var n;(n=this._renderService)==null||n.refreshRows(t,e)}updateCursorStyle(t){var e;(e=this._selectionService)!=null&&e.shouldColumnSelect(t)?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(t,e){this._viewport?this._viewport.scrollLines(t):super.scrollLines(t,e),this.refresh(0,this.rows-1)}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(t){t&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(t){let e=t-this._bufferService.buffer.ydisp;e!==0&&this.scrollLines(e)}paste(t){$N(t,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(t){this._customKeyEventHandler=t}attachCustomWheelEventHandler(t){this._customWheelEventHandler=t}registerLinkProvider(t){return this._linkProviderService.registerLinkProvider(t)}registerCharacterJoiner(t){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let e=this._characterJoinerService.register(t);return this.refresh(0,this.rows-1),e}deregisterCharacterJoiner(t){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(t)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(t){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+t)}registerDecoration(t){return this._decorationService.registerDecoration(t)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(t,e,n){this._selectionService.setSelection(t,e,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 t;(t=this._selectionService)==null||t.clearSelection()}selectAll(){var t;(t=this._selectionService)==null||t.selectAll()}selectLines(t,e){var n;(n=this._selectionService)==null||n.selectLines(t,e)}_keyDown(t){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)return!1;let e=this.browser.isMac&&this.options.macOptionIsMeta&&t.altKey;if(!e&&!this._compositionHelper.keydown(t))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!e&&(t.key==="Dead"||t.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=$Q(t,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(t),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(t,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,t)||(n.cancel&&this.cancel(t,!0),!n.key)||t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.key.length===1&&t.key.charCodeAt(0)>=65&&t.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===De.ETX||n.key===De.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||t.altKey||t.ctrlKey)return this.cancel(t,!0);this._keyDownHandled=!0}_isThirdLevelShift(t,e){let n=t.isMac&&!this.options.macOptionIsMeta&&e.altKey&&!e.ctrlKey&&!e.metaKey||t.isWindows&&e.altKey&&e.ctrlKey&&!e.metaKey||t.isWindows&&e.getModifierState("AltGraph");return e.type==="keypress"?n:n&&(!e.keyCode||e.keyCode>47)}_keyUp(t){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)&&(XQ(t)||this.focus(),this.updateCursorStyle(t),this._keyPressHandled=!1)}_keyPress(t){let e;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)return!1;if(this.cancel(t),t.charCode)e=t.charCode;else if(t.which===null||t.which===void 0)e=t.keyCode;else if(t.which!==0&&t.charCode!==0)e=t.which;else return!1;return!e||(t.altKey||t.ctrlKey||t.metaKey)&&!this._isThirdLevelShift(this.browser,t)?!1:(e=String.fromCharCode(e),this._onKey.fire({key:e,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(e,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(t){if(t.data&&t.inputType==="insertText"&&(!t.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let e=t.data;return this.coreService.triggerDataEvent(e,!0),this.cancel(t),!0}return!1}resize(t,e){if(t===this.cols&&e===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(t,e)}_afterResize(t,e){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 t=1;t<this.rows;t++)this.buffer.lines.push(this.buffer.getBlankLine(Xn));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var e;this.options.rows=this.rows,this.options.cols=this.cols;let t=this._customKeyEventHandler;this._setup(),super.reset(),(e=this._selectionService)==null||e.reset(),this._decorationService.reset(),this._customKeyEventHandler=t,this.refresh(0,this.rows-1)}clearTextureAtlas(){var t;(t=this._renderService)==null||t.clearTextureAtlas()}_reportFocus(){var t;(t=this.element)!=null&&t.classList.contains("focus")?this.coreService.triggerDataEvent(De.ESC+"[I"):this.coreService.triggerDataEvent(De.ESC+"[O")}_reportWindowsOptions(t){if(this._renderService)switch(t){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${De.ESC}[4;${n};${e}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),i=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${De.ESC}[6;${i};${r}t`);break}}cancel(t,e){if(!(!this.options.cancelEvents&&!e))return t.preventDefault(),t.stopPropagation(),!1}};function XQ(t){return t.keyCode===16||t.keyCode===17||t.keyCode===18}var QQ=class{constructor(){this._addons=[]}dispose(){for(let t=this._addons.length-1;t>=0;t--)this._addons[t].instance.dispose()}loadAddon(t,e){let n={instance:e,dispose:e.dispose,isDisposed:!1};this._addons.push(n),e.dispose=()=>this._wrappedAddonDispose(n),e.activate(t)}_wrappedAddonDispose(t){if(t.isDisposed)return;let e=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===t){e=n;break}if(e===-1)throw new Error("Could not dispose an addon that has not been loaded");t.isDisposed=!0,t.dispose.apply(t.instance),this._addons.splice(e,1)}},ZQ=class{constructor(t){this._line=t}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(t,e){if(!(t<0||t>=this._line.length))return e?(this._line.loadCell(t,e),e):this._line.loadCell(t,new ns)}translateToString(t,e,n){return this._line.translateToString(t,e,n)}},a3=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,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(t){let e=this._buffer.lines.get(t);if(e)return new ZQ(e)}getNullCell(){return new ns}},JQ=class extends Lt{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new qe),this.onBufferChange=this._onBufferChange.event,this._normal=new a3(this._core.buffers.normal,"normal"),this._alternate=new a3(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)}},eZ=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,n=>e(n.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(n,r)=>e(n,r.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},tZ=class{constructor(t){this._core=t}register(t){this._core.unicodeService.register(t)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(t){this._core.unicodeService.activeVersion=t}},nZ=["cols","rows"],Ws=0,rZ=class extends Lt{constructor(t){super(),this._core=this._register(new YQ(t)),this._addonManager=this._register(new QQ),this._publicOptions={...this._core.options};let e=r=>this._core.options[r],n=(r,i)=>{this._checkReadonlyOptions(r),this._core.options[r]=i};for(let r in this._core.options){let i={get:e.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,i)}}_checkReadonlyOptions(t){if(nZ.includes(t))throw new Error(`Option "${t}" 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 eZ(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new tZ(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 JQ(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,n){this._verifyIntegers(t,e,n),this._core.select(t,e,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r
|
|
527
|
+
`,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return f_.get()},set promptLabel(t){f_.set(t)},get tooMuchOutput(){return m_.get()},set tooMuchOutput(t){m_.set(t)}}}_verifyIntegers(...t){for(Ws of t)if(Ws===1/0||isNaN(Ws)||Ws%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(Ws of t)if(Ws&&(Ws===1/0||isNaN(Ws)||Ws%1!==0||Ws<0))throw new Error("This API only accepts positive integers")}};const l3="lever-theme",Ub="20260329-handoff",iZ={light:`/manifest.webmanifest?v=${Ub}`,dark:`/manifest-dark.webmanifest?v=${Ub}`,custom:`/manifest-dark.webmanifest?v=${Ub}`},ND=_.createContext(void 0),sZ=t=>t==="light"||t==="dark"||t==="system"||t==="custom",Bl=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",c3=(t,e)=>{if(typeof document>"u")return;let n;t==="custom"?n=e==="system"||!e?Bl():e:n=t==="system"?Bl():t,document.documentElement.classList.toggle("dark",n==="dark")},u3=t=>{if(typeof document>"u")return;document.documentElement.style.colorScheme=t;const e=document.querySelector('meta[name="theme-color"]');if(e){const i=getComputedStyle(document.body).backgroundColor;i&&i!=="rgba(0, 0, 0, 0)"&&i!=="transparent"&&e.setAttribute("content",i)}const n=document.querySelector('link[rel="manifest"]#app-manifest'),r=dK(iZ[t]);n&&r&&n.getAttribute("href")!==r&&n.setAttribute("href",r)};function oZ({children:t}){const e=_s(m=>m.themePreference),n=_s(m=>m.setThemePreference),r=_s(m=>m.themeId),i=_s(m=>m.customAppearance),s=_s(m=>m.backgroundImage),a=_s(m=>m.backgroundOpacity),c=_s(m=>m.backgroundBlur),d=_s(m=>m.themeCssText);_.useEffect(()=>{if(typeof window>"u")return;const m=window.localStorage.getItem(l3);sZ(m)&&(_s.getState().themePreference==="system"&&m!=="system"&&n(m),window.localStorage.removeItem(l3))},[]),_.useEffect(()=>{c3(e,i);const m=e==="custom"?i==="system"?Bl():i:e==="system"?Bl():e;u3(m)},[e,i]),_.useEffect(()=>{if(e!=="system"&&(e!=="custom"||i!=="system"))return;const m=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{c3(e,i),u3(Bl())};return m.addEventListener?(m.addEventListener("change",v),()=>m.removeEventListener("change",v)):(m.addListener(v),()=>m.removeListener(v))},[e,i]),_.useEffect(()=>{if(typeof document>"u")return;let m=document.getElementById("kaizen-theme-registry-styles");m||(m=document.createElement("style"),m.id="kaizen-theme-registry-styles",document.head.appendChild(m)),m.textContent=d},[d]),_.useEffect(()=>{typeof document>"u"||(e==="custom"?document.documentElement.setAttribute("data-theme",r):document.documentElement.removeAttribute("data-theme"))},[e,r]),_.useEffect(()=>{if(typeof document>"u")return;let m=document.getElementById("kaizen-custom-theme-styles");m||(m=document.createElement("style"),m.id="kaizen-custom-theme-styles",document.head.appendChild(m));const v=e==="custom"&&s&&s.trim()!=="",b=[];if(v){const S=c?c*2:0;b.push(`
|
|
528
|
+
body {
|
|
529
|
+
background-image: none !important;
|
|
530
|
+
background-color: transparent !important;
|
|
531
|
+
}
|
|
532
|
+
body::before {
|
|
533
|
+
content: "";
|
|
534
|
+
position: fixed;
|
|
535
|
+
top: -${S}px;
|
|
536
|
+
left: -${S}px;
|
|
537
|
+
right: -${S}px;
|
|
538
|
+
bottom: -${S}px;
|
|
539
|
+
background-image: url("${hK(s)}");
|
|
540
|
+
background-size: cover;
|
|
541
|
+
background-position: center;
|
|
542
|
+
filter: blur(${c}px);
|
|
543
|
+
z-index: -2;
|
|
544
|
+
pointer-events: none;
|
|
545
|
+
}
|
|
546
|
+
body::after {
|
|
547
|
+
content: "";
|
|
548
|
+
position: fixed;
|
|
549
|
+
inset: 0;
|
|
550
|
+
background-color: hsl(var(--background) / ${a});
|
|
551
|
+
z-index: -1;
|
|
552
|
+
pointer-events: none;
|
|
553
|
+
}
|
|
554
|
+
#root {
|
|
555
|
+
background-color: transparent !important;
|
|
556
|
+
}
|
|
557
|
+
:root {
|
|
558
|
+
--color-background: transparent !important;
|
|
559
|
+
--color-card: hsl(var(--card) / 0.15) !important;
|
|
560
|
+
--color-popover: hsl(var(--popover) / 0.8) !important;
|
|
561
|
+
--color-muted: hsl(var(--muted) / 0.25) !important;
|
|
562
|
+
}
|
|
563
|
+
.kaizen-terminal, .xterm-viewport, .xterm-screen {
|
|
564
|
+
background-color: transparent !important;
|
|
565
|
+
}
|
|
566
|
+
`)}else b.push(`
|
|
567
|
+
body {
|
|
568
|
+
background-image: none !important;
|
|
569
|
+
}
|
|
570
|
+
body::before {
|
|
571
|
+
display: none;
|
|
572
|
+
}
|
|
573
|
+
#root {
|
|
574
|
+
background-color: transparent;
|
|
575
|
+
}
|
|
576
|
+
`);m.textContent=b.join(`
|
|
577
|
+
`)},[e,s,a,c]);const u=m=>{n(m)},f=_.useMemo(()=>{const m=e==="custom"?i==="system"?Bl():i:e==="system"?Bl():e;return{theme:e,resolvedTheme:m,setTheme:u}},[e,i,n]);return g.jsx(ND.Provider,{value:f,children:t})}function aZ(){const t=_.useContext(ND);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t}const lZ={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"},cZ={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 DD(t){return{cols:Math.max(1,t.cols||80),rows:Math.max(1,t.rows||24)}}function OD(t,e){var S,x,C,k,E;const n=t.element,r=(k=(C=(x=(S=t._core)==null?void 0:S._renderService)==null?void 0:x.dimensions)==null?void 0:C.css)==null?void 0:k.cell,i=(r==null?void 0:r.width)??0,s=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(i)||!Number.isFinite(s)||i<=0||s<=0)return null;const a=e.getBoundingClientRect(),c=window.getComputedStyle(e),d=window.getComputedStyle(n),u=t.options.scrollback===0?0:((E=t.options.overviewRuler)==null?void 0:E.width)??14,f=parseFloat(c.paddingLeft)+parseFloat(c.paddingRight)+parseFloat(d.paddingLeft)+parseFloat(d.paddingRight),m=parseFloat(c.paddingTop)+parseFloat(c.paddingBottom)+parseFloat(d.paddingTop)+parseFloat(d.paddingBottom),v=Math.max(0,a.width-f-u-1),b=Math.max(0,a.height-m);return{cols:Math.max(2,Math.floor(v/i)),rows:Math.max(1,Math.floor(b/s))}}function Om(t){t.refresh(0,Math.max(0,t.rows-1))}function jm(t,e,n,r,i){const s=OD(t,e)??DD(t);return n.current&&n.current.cols===s.cols&&n.current.rows===s.rows||(t.resize(s.cols,s.rows),n.current=s,r&&i(s.cols,s.rows)),s}function uZ(t){const e=ke.c(55),{projectId:n,terminalId:r,socket:i,scrollback:s,connectionStatus:a,clearVersion:c,focusRequestVersion:d,onPathChange:u}=t,f=c===void 0?0:c,m=d===void 0?0:d,{resolvedTheme:v}=aZ(),b=_.useRef(null),S=_.useRef(null),x=_.useRef(null),C=_.useRef(!1),k=_.useRef(0),E=_.useRef(null),R=_.useRef(null),[M,O]=_.useState(null),[D,P]=_.useState(null),z=v==="dark"?cZ:lZ;let Y;e[0]!==i||e[1]!==r?(Y=(se,oe)=>{i.command({type:"terminal.resize",terminalId:r,cols:se,rows:oe}).catch(mZ)},e[0]=i,e[1]=r,e[2]=Y):Y=e[2];const L=Y;let W;e[3]!==L?(W=()=>{const se=()=>{const oe=S.current,ee=b.current;!oe||!ee||!C.current||jm(oe,ee,R,!0,L)};requestAnimationFrame(()=>{se(),setTimeout(se,0)})},e[3]=L,e[4]=W):W=e[4];const V=W;let F;e[5]!==V||e[6]!==s||e[7]!==L||e[8]!==i||e[9]!==r||e[10]!==z?(F=()=>{const se=new rZ({scrollback:s,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:z}),oe=new HG;se.loadAddon(oe),se.loadAddon(new GG),S.current=se;const ee=b.current;ee&&(se.open(ee),x.current&&se.write(x.current),jm(se,ee,R,!1,fZ),Om(se),V());const Q=se.onData(ie=>{i.command({type:"terminal.input",terminalId:r,data:ie}).catch(xe=>{P(xe instanceof Error?xe.message:String(xe))})}),te=se.onResize(ie=>{const{cols:xe,rows:Ae}=ie;if(!C.current)return;const Ke={cols:xe,rows:Ae};R.current&&R.current.cols===xe&&R.current.rows===Ae||(R.current=Ke,L(xe,Ae))}),he=new ResizeObserver(()=>{const ie=S.current,xe=b.current;!ie||!xe||jm(ie,xe,R,C.current,(Ae,Ke)=>{i.command({type:"terminal.resize",terminalId:r,cols:Ae,rows:Ke}).catch(hZ)})});return ee&&he.observe(ee),()=>{he.disconnect(),te.dispose(),Q.dispose(),x.current=oe.serialize(),se.dispose(),S.current=null}},e[5]=V,e[6]=s,e[7]=L,e[8]=i,e[9]=r,e[10]=z,e[11]=F):F=e[11];let U;e[12]!==s||e[13]!==i||e[14]!==r||e[15]!==z?(U=[s,i,r,z],e[12]=s,e[13]=i,e[14]=r,e[15]=z,e[16]=U):U=e[16],_.useEffect(F,U);let H,j;e[17]!==s?(H=()=>{const se=S.current;se&&(se.options.scrollback=s)},j=[s],e[17]=s,e[18]=H,e[19]=j):(H=e[18],j=e[19]),_.useEffect(H,j);let G,B;e[20]!==z?(B=()=>{const se=S.current;se&&(se.options.theme=z,Om(se))},G=[z],e[20]=z,e[21]=G,e[22]=B):(G=e[21],B=e[22]),_.useEffect(B,G);let K,A;e[23]!==m?(K=()=>{if(m===0)return;const se=S.current;se&&requestAnimationFrame(()=>{se.focus()})},A=[m],e[23]=m,e[24]=K,e[25]=A):(K=e[24],A=e[25]),_.useEffect(K,A);let I,$;e[26]!==f||e[27]!==i||e[28]!==r?(I=()=>{if(f===0)return;const se=S.current;se&&(C.current=!1,k.current=k.current+1,E.current=null,x.current=null,O(null),P(null),se.reset(),Om(se),i.command({type:"terminal.close",terminalId:r}).catch(oe=>{P(oe instanceof Error?oe.message:String(oe))}))},$=[f,i,r],e[26]=f,e[27]=i,e[28]=r,e[29]=I,e[30]=$):(I=e[29],$=e[30]),_.useEffect(I,$);let T;e[31]!==(M==null?void 0:M.cwd)||e[32]!==u?(T=()=>{u==null||u((M==null?void 0:M.cwd)??null)},e[31]=M==null?void 0:M.cwd,e[32]=u,e[33]=T):T=e[33];const X=M==null?void 0:M.cwd;let Z;e[34]!==u||e[35]!==X?(Z=[X,u],e[34]=u,e[35]=X,e[36]=Z):Z=e[36],_.useEffect(T,Z);let J;e[37]!==a||e[38]!==n||e[39]!==V||e[40]!==s||e[41]!==i||e[42]!==r?(J=()=>{const se=Q=>{const te=S.current;if(!te)return;const he=JSON.stringify({cwd:Q.cwd,shell:Q.shell,cols:Q.cols,rows:Q.rows,scrollback:Q.scrollback,status:Q.status,exitCode:Q.exitCode,serializedState:Q.serializedState});if(E.current===he){O({cwd:Q.cwd,shell:Q.shell,status:Q.status,exitCode:Q.exitCode}),x.current=Q.serializedState||null;return}E.current=he,O({cwd:Q.cwd,shell:Q.shell,status:Q.status,exitCode:Q.exitCode}),x.current=Q.serializedState||null,te.options.scrollback=Q.scrollback,te.reset(),Q.serializedState&&te.write(Q.serializedState),Om(te)},oe=()=>{const Q=S.current,te=b.current;if(!Q||!te)return;const he=OD(Q,te)??DD(Q);Q.resize(he.cols,he.rows),R.current=he,i.command({type:"terminal.create",projectId:n,terminalId:r,cols:he.cols,rows:he.rows,scrollback:s}).then(ie=>{C.current=!0,P(null),ie&&se(ie),V()}).catch(ie=>{P(ie instanceof Error?ie.message:String(ie))})},ee=()=>{const Q=k.current=k.current+1,te=()=>{if(k.current!==Q)return;const he=S.current,ie=b.current;if(!he||!ie)return;jm(he,ie,R,!1,dZ);const xe=ie.getBoundingClientRect();if(xe.width<=0||xe.height<=0){requestAnimationFrame(te);return}oe()};requestAnimationFrame(()=>{requestAnimationFrame(te)})};return ee(),i.subscribeTerminal(r,{onSnapshot:Q=>{if(!Q){C.current=!1,E.current=null,a==="connected"&&ee();return}C.current=!0,P(null),se(Q),V()},onEvent:Q=>{const te=S.current;if(te){if(Q.type==="terminal.output"){te.write(Q.data);return}Q.type==="terminal.exit"&&O(he=>({cwd:(he==null?void 0:he.cwd)??"",shell:(he==null?void 0:he.shell)??"",status:"exited",exitCode:Q.exitCode}))}}})},e[37]=a,e[38]=n,e[39]=V,e[40]=s,e[41]=i,e[42]=r,e[43]=J):J=e[43];let re;e[44]!==a||e[45]!==n||e[46]!==s||e[47]!==i||e[48]!==r?(re=[a,n,s,i,r],e[44]=a,e[45]=n,e[46]=s,e[47]=i,e[48]=r,e[49]=re):re=e[49],_.useEffect(J,re);let ae;e[50]===Symbol.for("react.memo_cache_sentinel")?(ae=g.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden px-3 py-1",children:g.jsx("div",{ref:b,className:"kaizen-terminal min-h-0 min-w-0 flex-1 overflow-hidden w-full"})}),e[50]=ae):ae=e[50];let ue;e[51]!==D?(ue=D?g.jsxs("div",{className:"px-3 py-1 text-xs text-destructive",children:["Terminal error: ",D]}):null,e[51]=D,e[52]=ue):ue=e[52];let me;return e[53]!==ue?(me=g.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden pb-4",children:[ae,ue]}),e[53]=ue,e[54]=me):me=e[54],me}function dZ(){}function hZ(){}function fZ(){}function mZ(){}const pZ=24;function jD(t){return t+pZ}function gZ(t,e){return Math.max(1,t)*jD(e)}function Wb(t){const e=ke.c(44),{projectId:n,layout:r,socket:i,connectionStatus:s,scrollback:a,minColumnWidth:c,maximized:d,focusRequestVersion:u,splitTerminalShortcut:f,onToggleMaximized:m,onAddTerminal:v,onRemoveTerminal:b,onTerminalLayout:S}=t,x=d===void 0?!1:d,C=u===void 0?0:u,k=_.useRef(null);let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E={},e[0]=E):E=e[0];const R=_.useRef(E);let M;e[1]===Symbol.for("react.memo_cache_sentinel")?(M=[],e[1]=M):M=e[1];const O=_.useRef(M),[D,P]=_.useState(0);let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={},e[2]=z):z=e[2];const[Y,L]=_.useState(z);let W;e[3]===Symbol.for("react.memo_cache_sentinel")?(W={},e[3]=W):W=e[3];const[V,F]=_.useState(W);let U,H;e[4]===Symbol.for("react.memo_cache_sentinel")?(U=()=>{const oe=k.current;if(!oe)return;const ee=()=>{P(oe.getBoundingClientRect().width)},Q=new ResizeObserver(ee);return Q.observe(oe),ee(),()=>Q.disconnect()},H=[],e[4]=U,e[5]=H):(U=e[4],H=e[5]),_.useLayoutEffect(U,H);const j=r.terminals.length;let G;e[6]!==c?(G=jD(c),e[6]=c,e[7]=G):G=e[7];const B=G;let K;e[8]!==c||e[9]!==j?(K=gZ(j,c),e[8]=c,e[9]=j,e[10]=K):K=e[10];const I=Math.max(D,K);let $;e[11]!==r.terminals?($=r.terminals.map(_Z).join(":"),e[11]=r.terminals,e[12]=$):$=e[12];const T=$;let X,Z;e[13]!==r.terminals?(X=()=>{const oe=O.current,ee=r.terminals.map(bZ),Q=ee.find(he=>!oe.includes(he));if(O.current=ee,!Q||oe.length===0)return;const te=R.current[Q];te&&te.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},Z=[r.terminals],e[13]=r.terminals,e[14]=X,e[15]=Z):(X=e[14],Z=e[15]),_.useLayoutEffect(X,Z);const J=I||"100%";let re;e[16]!==J?(re={width:J},e[16]=J,e[17]=re):re=e[17];let ae;e[18]!==r.terminals||e[19]!==S||e[20]!==n?(ae=oe=>S(n,r.terminals.map(ee=>oe[ee.id]??ee.size)),e[18]=r.terminals,e[19]=S,e[20]=n,e[21]=ae):ae=e[21];let ue;e[22]!==V||e[23]!==s||e[24]!==C||e[25]!==r.terminals||e[26]!==x||e[27]!==B||e[28]!==v||e[29]!==b||e[30]!==m||e[31]!==Y||e[32]!==n||e[33]!==a||e[34]!==i||e[35]!==f?(ue=r.terminals.map((oe,ee)=>g.jsxs(_.Fragment,{children:[g.jsx(Ll,{id:oe.id,defaultSize:`${oe.size}%`,minSize:`${B}px`,className:"min-h-0 overflow-hidden",style:{minWidth:B},children:g.jsxs("div",{ref:Q=>{R.current[oe.id]=Q},className:"flex h-full min-h-0 min-w-0 flex-col border-r border-border bg-transparent last:border-r-0",style:{minWidth:B},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:Y[oe.id]??""})]})}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(vt,{variant:"ghost",size:"icon-sm",className:"md:hidden","aria-label":"Send Ctrl+C",onClick:()=>{i.command({type:"terminal.input",terminalId:oe.id,data:""}).catch(vZ)},title:"Send Ctrl+C",children:g.jsx(oz,{className:"size-3.5"})}),g.jsx(vt,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>F(Q=>({...Q,[oe.id]:(Q[oe.id]??0)+1})),children:g.jsx(o8,{className:"size-3.5"})}),g.jsxs(Gd,{children:[g.jsx(Yd,{asChild:!0,children:g.jsx(vt,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>v(n,oe.id),children:g.jsx(yy,{className:"size-3.5"})})}),g.jsx(Fl,{side:"bottom",shortcut:f})]}),m?g.jsx(vt,{variant:"ghost",size:"icon-sm","aria-label":x?"Restore terminal size":"Maximize terminal",onClick:m,children:x?g.jsx(z8,{className:"size-3.5"}):g.jsx(j8,{className:"size-3.5"})}):null,g.jsx(vt,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>b(n,oe.id),children:g.jsx(is,{className:"size-3.5"})})]})]}),g.jsx(uZ,{projectId:n,terminalId:oe.id,socket:i,scrollback:a,connectionStatus:s,clearVersion:V[oe.id]??0,focusRequestVersion:ee===0?C:0,onPathChange:Q=>L(te=>te[oe.id]===Q?te:{...te,[oe.id]:Q})})]})}),ee<r.terminals.length-1?g.jsx(ap,{withHandle:!0,orientation:"horizontal"}):null]},oe.id)),e[22]=V,e[23]=s,e[24]=C,e[25]=r.terminals,e[26]=x,e[27]=B,e[28]=v,e[29]=b,e[30]=m,e[31]=Y,e[32]=n,e[33]=a,e[34]=i,e[35]=f,e[36]=ue):ue=e[36];let me;e[37]!==T||e[38]!==ae||e[39]!==ue?(me=g.jsx(op,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:ae,children:ue},T),e[37]=T,e[38]=ae,e[39]=ue,e[40]=me):me=e[40];let se;return e[41]!==re||e[42]!==me?(se=g.jsx("div",{className:"flex h-full min-h-0 flex-col",children:g.jsx("div",{ref:k,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:g.jsx("div",{className:"h-full min-h-0",style:re,children:me})})}),e[41]=re,e[42]=me,e[43]=se):se=e[43],se}function vZ(){}function bZ(t){return t.id}function _Z(t){return t.id}function d3(t){if(!t)return;const e=Number.parseInt(t,10);return Number.isFinite(e)&&e>0?e:void 0}function yZ(t){var r;if(!t)return null;const e=t.trim();if(!e||/^(https?:|mailto:|ftp:|file:)/i.test(e)||!e.startsWith("/"))return null;const n=/^(?<path>\/.+?)#L(?<line>\d+)(?:C(?<column>\d+))?$/.exec(e);return(r=n==null?void 0:n.groups)!=null&&r.path?{path:n.groups.path,line:d3(n.groups.line),column:d3(n.groups.column)}:{path:e}}function Vb(t,e){if(!t)return"";if(e){const n=e.endsWith("/")?e:`${e}/`;if(t.startsWith(n))return t.slice(n.length);if(t===e)return""}return t.replace(/^\/home\/user\/workspace\//,"")}const qx=()=>{},LD=_.createContext(qx);function xZ(t){const e=ke.c(3),{children:n,onOpenLocalLink:r}=t,i=r??qx;let s;return e[0]!==n||e[1]!==i?(s=g.jsx(LD.Provider,{value:i,children:n}),e[0]=n,e[1]=i,e[2]=s):s=e[2],s}const X_={Task:bp,TaskOutput:bp,Bash:n4,Glob:sb,Grep:sb,ExitPlanMode:vk,Read:p8,Edit:u8,Write:h8,NotebookEdit:Ul,WebFetch:TP,TodoWrite:BP,WebSearch:sb,KillShell:iz,AskUserQuestion:XR,Skill:gn,EnterPlanMode:vk},ID=cz;function PD(t){return X_[t]?X_[t]:ID}function ea(t){const e=ke.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=Ce("flex gap-3 justify-start items-center",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=g.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function SZ(t){const e=ke.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=Ce("flex items-center gap-1.5 text-xs",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=g.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function Yo(t){const e=ke.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=Ce("font-medium text-foreground/80",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=g.jsx("span",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function wZ(t){const e=ke.c(2),{children:n}=t;let r;return e[0]!==n?(r=g.jsx("span",{className:"text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Xh(t){const e=ke.c(14),{children:n,expandedContent:r,defaultExpanded:i}=t,s=i===void 0?!1:i,[a,c]=_.useState(s);let d;e[0]!==a?(d=()=>c(!a),e[0]=a,e[1]=d):d=e[1];const u=`group/expandable-row cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${a?"":"hover:opacity-60 transition-opacity"}`;let f;e[2]!==n?(f=g.jsx("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:n}),e[2]=n,e[3]=f):f=e[3];const m=`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 ${a?"rotate-90 opacity-100":""}`;let v;e[4]!==m?(v=g.jsx(Ni,{className:m}),e[4]=m,e[5]=v):v=e[5];let b;e[6]!==d||e[7]!==u||e[8]!==f||e[9]!==v?(b=g.jsxs("button",{onClick:d,className:u,children:[f,v]}),e[6]=d,e[7]=u,e[8]=f,e[9]=v,e[10]=b):b=e[10];const S=a&&r;let x;return e[11]!==b||e[12]!==S?(x=g.jsxs("div",{className:"flex flex-col w-full",children:[b,S]}),e[11]=b,e[12]=S,e[13]=x):x=e[13],x}function qb(t){const e=ke.c(24),{label:n,children:r,copyText:i}=t,[s,a]=_.useState(!1);let c;e[0]!==r||e[1]!==i?(c=i??Yp(r),e[0]=r,e[1]=i,e[2]=c):c=e[2];const d=c;let u;e[3]!==d?(u=async()=>{await navigator.clipboard.writeText(d),a(!0),setTimeout(()=>a(!1),2e3)},e[3]=d,e[4]=u):u=e[4];const f=u;let m;e[5]!==n?(m=g.jsx("span",{className:"font-medium text-muted-foreground",children:n}),e[5]=n,e[6]=m):m=e[6];let v;e[7]!==r?(v=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:r}),e[7]=r,e[8]=v):v=e[8];const b=!s&&"hover:text-foreground",S=s&&"hover:!bg-transparent hover:!border-transparent";let x;e[9]!==b||e[10]!==S?(x=Ce("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",b,S),e[9]=b,e[10]=S,e[11]=x):x=e[11];let C;e[12]!==s?(C=s?g.jsx(di,{className:"h-3.5 w-3.5 text-green-400"}):g.jsx(lu,{className:"h-4 w-4"}),e[12]=s,e[13]=C):C=e[13];let k;e[14]!==f||e[15]!==x||e[16]!==C?(k=g.jsx(vt,{variant:"ghost",size:"icon",className:x,onClick:f,children:C}),e[14]=f,e[15]=x,e[16]=C,e[17]=k):k=e[17];let E;e[18]!==v||e[19]!==k?(E=g.jsxs("div",{className:"relative group/codeblock",children:[v,k]}),e[18]=v,e[19]=k,e[20]=E):E=e[20];let R;return e[21]!==E||e[22]!==m?(R=g.jsxs("div",{children:[m,E]}),e[21]=E,e[22]=m,e[23]=R):R=e[23],R}function zD(t){const e=ke.c(8),{children:n,icon:r,className:i}=t;let s;e[0]!==i?(s=Ce("inline-flex items-center gap-1 px-2 py-1 bg-muted border border-border rounded-full",i),e[0]=i,e[1]=s):s=e[1];let a;e[2]!==r?(a=r&&g.jsx(r,{className:"h-3 w-3 text-muted-foreground"}),e[2]=r,e[3]=a):a=e[3];let c;return e[4]!==n||e[5]!==s||e[6]!==a?(c=g.jsxs("span",{className:s,children:[a,n]}),e[4]=n,e[5]=s,e[6]=a,e[7]=c):c=e[7],c}function Qh(t){const e=ke.c(8),{children:n,className:r}=t;let i;e[0]!==r?(i=Ce("grid grid-cols-[auto_1fr] gap-2 min-w-0",r),e[0]=r,e[1]=i):i=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=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"})}),e[2]=s):s=e[2];let a;e[3]!==n?(a=g.jsx("div",{className:"-ml-[1px] min-w-0 overflow-hidden",children:n}),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=g.jsxs("div",{className:i,children:[s,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Yp(t){if(typeof t=="string")return t;if(typeof t=="number")return String(t);if(Array.isArray(t))return t.map(Yp).join("");if(t&&typeof t=="object"&&"props"in t){const e=t.props;return Yp(e.children)}return""}function h3(t,e){return _.isValidElement(t)?_.cloneElement(t,{className:Ce(t.props.className,e)}):t}const CZ={h1:({children:t})=>g.jsx("h1",{className:"text-[20px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:t}),h2:({children:t})=>g.jsx("h2",{className:"text-[18px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:t}),h3:({children:t})=>g.jsx("h3",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:t}),h4:({children:t})=>g.jsx("h4",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:t}),h5:({children:t})=>g.jsx("h5",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:t}),h6:({children:t})=>g.jsx("h6",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:t}),pre:({children:t,...e})=>{const[n,r]=_.useState(!1),i=Yp(t),s=async()=>{await navigator.clipboard.writeText(i),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",...e,children:t}),g.jsx(vt,{variant:"ghost",size:"icon",className:Ce("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:s,children:n?g.jsx(di,{className:"h-4 w-4 text-green-400"}):g.jsx(lu,{className:"h-4 w-4"})})]})},code:({children:t,className:e,...n})=>e?g.jsx("code",{className:"block text-xs whitespace-pre",...n,children:t}):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:t}),table:({children:t,...e})=>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",...e,children:t})}),tbody:({children:t,...e})=>g.jsx("tbody",{className:"divide-y divide-border",...e,children:t}),th:({children:t,...e})=>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",...e,children:t}),td:({children:t,...e})=>g.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal ",...e,children:t}),p:({children:t,...e})=>g.jsx("p",{className:"break-words mt-5 mb-3 first:mt-0 last:mb-0",...e,children:t}),blockquote:({children:t,...e})=>(()=>{const n=_.Children.toArray(t),r=n[0];r!==void 0&&(n[0]=h3(r,"mt-0"));const i=n.length-1,s=n[i];return s!==void 0&&(n[i]=h3(s,"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",...e,children:n})})(),a:({children:t,...e})=>g.jsx("a",{className:"break-all [overflow-wrap:anywhere] 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",...e,children:t})};function Zh(t){return{...CZ,a:({children:e,href:n,onClick:r,...i})=>{const s=(t==null?void 0:t.onOpenLocalLink)??_.useContext(LD),a=yZ(n);return g.jsx("a",{className:"break-all [overflow-wrap:anywhere] transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40",href:n,target:a?void 0:"_blank",rel:a?void 0:"noopener noreferrer",onClick:c=>{r==null||r(c),!(c.defaultPrevented||!a||s===qx)&&(c.preventDefault(),s(a))},...i,children:e})}}}const kZ={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function EZ(t){const e=ke.c(7),{status:n}=t,r=(n?kZ[n]:void 0)||"Processing...",i=n==="failed";let s;e[0]!==i?(s=i?g.jsx(is,{className:"size-4.5 text-red-500"}):g.jsx(Fn,{className:"size-4.5 animate-spin text-muted-icon"}),e[0]=i,e[1]=s):s=e[1];let a;e[2]!==r?(a=g.jsx(Eg,{className:"ml-[1px] text-sm",shimmerWidth:44,children:r}),e[2]=r,e[3]=a):a=e[3];let c;return e[4]!==s||e[5]!==a?(c=g.jsx(ea,{className:"ml-[1px]",children:g.jsxs(SZ,{children:[s,a]})}),e[4]=s,e[5]=a,e[6]=c):c=e[6],c}const BD=_.forwardRef((t,e)=>{const n=ke.c(12);let r,i,s;n[0]!==t?({className:i,children:r,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s):(r=n[1],i=n[2],s=n[3]);let a;n[4]!==i?(a=Ce("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",i),n[4]=i,n[5]=a):a=n[5];let c;n[6]===Symbol.for("react.memo_cache_sentinel")?(c={WebkitOverflowScrolling:"touch"},n[6]=c):c=n[6];let d;return n[7]!==r||n[8]!==s||n[9]!==e||n[10]!==a?(d=g.jsx("div",{ref:e,className:a,style:c,...s,children:r}),n[7]=r,n[8]=s,n[9]=e,n[10]=a,n[11]=d):d=n[11],d});BD.displayName="ScrollArea";function RZ(t){return t==="localhost"||t==="127.0.0.1"||t==="::1"}const qg=20,Q_=50,FD=30;function HD(t){return Number.isFinite(t)?Math.min(Q_,Math.max(qg,t)):FD}function TZ(){return{isVisible:!1,size:qg}}function Lm(t,e){return t[e]??TZ()}function MZ(t){return!t||typeof t!="object"?{projects:{}}:{projects:Object.fromEntries(Object.entries(t.projects??{}).map(([r,i])=>[r,{isVisible:!1,size:HD(i.size??FD)}]))}}const dh=fi()(Li(t=>({projects:{},toggleVisibility:e=>t(n=>({projects:{...n.projects,[e]:{...Lm(n.projects,e),isVisible:!Lm(n.projects,e).isVisible}}})),setVisibility:(e,n)=>t(r=>({projects:{...r.projects,[e]:{...Lm(r.projects,e),isVisible:n}}})),setSize:(e,n)=>t(r=>({projects:{...r.projects,[e]:{...Lm(r.projects,e),size:HD(n)}}})),clearProject:e=>t(n=>{const{[e]:r,...i}=n.projects;return{projects:i}})}),{name:"right-sidebar-layouts",version:2,migrate:MZ})),AZ={isVisible:!1,size:qg},Kx=[60,40];function NZ(){return{isVisible:!1,mainSizes:[...Kx],terminals:[],nextTerminalIndex:0}}function DZ(t,e){return t[e]??NZ()}function Kb(t){if(t.length===0)return[];const e=t.reduce((n,r)=>n+Math.max(r,0),0);return!Number.isFinite(e)||e<=0?Array.from({length:t.length},()=>100/t.length):t.map(n=>Math.max(n,0)/e*100)}function OZ(t){let e=t,n="";do n=String.fromCharCode(65+e%26)+n,e=Math.floor(e/26)-1;while(e>=0);return`Terminal ${n}`}function jZ(t){if(t.length===0)return t;const e=t.length+1;return t.map(n=>({...n,size:n.size*t.length/e}))}function Zc(t,e,n){return{...t,[e]:n(DZ(t,e))}}const Ha=fi()(Li(t=>({projects:{},addTerminal:(e,n)=>t(r=>({projects:Zc(r.projects,e,i=>{var d,u;const s=jZ(i.terminals),a={id:((u=(d=globalThis.crypto)==null?void 0:d.randomUUID)==null?void 0:u.call(d))??`terminal-${Date.now()}-${i.nextTerminalIndex}`,title:OZ(i.nextTerminalIndex),size:100/(s.length+1)},c=n?Math.max(s.findIndex(f=>f.id===n)+1,0):s.length;return{...i,isVisible:!0,nextTerminalIndex:i.nextTerminalIndex+1,terminals:[...s.slice(0,c),a,...s.slice(c)]}})})),removeTerminal:(e,n)=>t(r=>({projects:Zc(r.projects,e,i=>{const s=i.terminals.filter(c=>c.id!==n);if(s.length===0)return{...i,isVisible:!1,terminals:[]};const a=Kb(s.map(c=>c.size));return{...i,terminals:s.map((c,d)=>({...c,size:a[d]??100/s.length}))}})})),toggleVisibility:e=>t(n=>({projects:Zc(n.projects,e,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),resetMainSizes:e=>t(n=>({projects:Zc(n.projects,e,r=>({...r,mainSizes:[...Kx]}))})),setMainSizes:(e,n)=>t(r=>{if(n.length!==2)return r;const i=Kb(n);return{projects:Zc(r.projects,e,s=>({...s,mainSizes:i}))}}),setTerminalSizes:(e,n)=>t(r=>({projects:Zc(r.projects,e,i=>{if(n.length!==i.terminals.length)return i;const s=Kb(n);return{...i,terminals:i.terminals.map((a,c)=>({...a,size:s[c]??a.size}))}})})),clearProject:e=>t(n=>{const{[e]:r,...i}=n.projects;return{projects:i}})}),{name:"terminal-layouts",version:1})),LZ={isVisible:!1,mainSizes:[...Kx],terminals:[],nextTerminalIndex:0},IZ=35;function PZ(t,e){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?0:t*(e/100)}function zZ(t,e){const n=PZ(t,e);return n>=0&&n<IZ}const ou=350,BZ=[.4,0,.2,1],FZ=8,f3=1e-6;function HZ(t,e,n){const r=1-t;return 3*r*r*t*e+3*r*t*t*n+t*t*t}function $Z(t,e,n){const r=1-t;return 3*r*r*t*e+3*r*t*t*n+t*t*t}function UZ(t,e,n){const r=1-t;return 3*r*r*e+6*r*t*(n-e)+3*t*t*(1-n)}function WZ(t,e,n){let r=t;for(let i=0;i<FZ;i+=1){const s=HZ(r,e,n)-t;if(Math.abs(s)<f3)return r;const a=UZ(r,e,n);if(Math.abs(a)<f3)break;r-=s/a}return r}function VZ(t){if(t<=0)return 0;if(t>=1)return 1;const[e,n,r,i]=BZ,s=WZ(t,e,r);return $Z(s,n,i)}function $D(t,e,n){const r=VZ(n);return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function qZ(t){const e=ke.c(12),{projectId:n,shouldRenderRightSidebarLayout:r,showRightSidebar:i,rightSidebarSize:s}=t,a=_.useRef(null),c=_.useRef(null),d=_.useRef(null),u=_.useRef(null),f=_.useRef(null),m=_.useRef(!1),v=_.useRef(null),b=_.useRef(!1),S=_.useRef(!1);let x,C;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>()=>{u.current!==null&&window.cancelAnimationFrame(u.current),f.current!==null&&window.clearTimeout(f.current)},C=[],e[0]=x,e[1]=C):(x=e[0],C=e[1]),_.useEffect(x,C);let k,E;e[2]!==n||e[3]!==s||e[4]!==r||e[5]!==i?(k=()=>{var j,G,B,K,A,I;if(!r){u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null),m.current=!1;return}const D=a.current;if(!D)return;u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null);const P=v.current,z=P!==null&&P!==n,Y=i&&!S.current,L=!b.current,W=i?[100-s,s]:[100,0],V=z||L&&i,F=Y||L?[100,0]:[D.getLayout().workspace??W[0],D.getLayout().rightSidebar??W[1]];if(v.current=n,b.current=r,S.current=i,V||Math.abs(F[0]-W[0])<.1&&Math.abs(F[1]-W[1])<.1){D.setLayout({workspace:W[0],rightSidebar:W[1]}),(j=c.current)==null||j.setAttribute("data-right-sidebar-open",i?"true":"false"),(G=d.current)==null||G.setAttribute("data-right-sidebar-open",i?"true":"false"),(B=d.current)==null||B.setAttribute("data-right-sidebar-animated","false");return}m.current=!0,(K=c.current)==null||K.setAttribute("data-right-sidebar-open",i?"true":"false"),(A=d.current)==null||A.setAttribute("data-right-sidebar-open",i?"true":"false"),(I=d.current)==null||I.setAttribute("data-right-sidebar-animated","true"),D.setLayout({workspace:F[0],rightSidebar:F[1]});const U=performance.now(),H=$=>{const T=Math.min(1,($-U)/ou),X=$D(F,W,T);if(D.setLayout({workspace:X[0],rightSidebar:X[1]}),T<1){u.current=window.requestAnimationFrame(H);return}D.setLayout({workspace:W[0],rightSidebar:W[1]}),u.current=null,f.current=window.setTimeout(()=>{m.current=!1,f.current=null},0)};u.current=window.requestAnimationFrame(H)},E=[n,s,r,i],e[2]=n,e[3]=s,e[4]=r,e[5]=i,e[6]=k,e[7]=E):(k=e[6],E=e[7]),_.useLayoutEffect(k,E);let R,M;e[8]!==r?(R=()=>{r||(b.current=!1,S.current=!1)},M=[r],e[8]=r,e[9]=R,e[10]=M):(R=e[9],M=e[10]),_.useEffect(R,M);let O;return e[11]===Symbol.for("react.memo_cache_sentinel")?(O={isAnimating:m,panelGroupRef:a,sidebarPanelRef:c,sidebarVisualRef:d},e[11]=O):O=e[11],O}function KZ(t){const e=t.previousProjectId!==null&&t.previousProjectId!==t.projectId,n=t.previousProjectId===null&&t.projectId!==null;return!e&&!n&&t.showTerminalPane&&!t.wasTerminalVisible}function GZ({previousProjectId:t,projectId:e,previousShouldRenderTerminalLayout:n,previousShowTerminalPane:r,showTerminalPane:i,terminalLayout:s,liveLayout:a}){const c=t!==null&&t!==e,d=i&&!r,u=!n,f=t===null&&e!==null,m=i?s.mainSizes:[100,0];return{currentLayout:d||u?[100,0]:a,shouldSkipAnimation:c||f&&u,targetLayout:m}}function YZ(t){const e=ke.c(22),{chatInputRef:n,projectId:r,shouldRenderTerminalLayout:i,showTerminalPane:s,terminalLayout:a}=t,c=_.useRef(null),d=_.useRef(null),u=_.useRef(null),f=_.useRef(null),m=_.useRef(null),v=_.useRef(!1),b=_.useRef(null),S=_.useRef(!1),x=_.useRef(!1),C=_.useRef(!1),[k,E]=_.useState(0);let R,M;e[0]!==n||e[1]!==r||e[2]!==s?(R=()=>{var U;const V=b.current,F=C.current;KZ({previousProjectId:V,projectId:r,showTerminalPane:s,wasTerminalVisible:F})&&E(XZ),V!==null&&V===r&&!s&&F&&((U=n.current)==null||U.focus({preventScroll:!0})),C.current=s,b.current=r},M=[n,r,s],e[0]=n,e[1]=r,e[2]=s,e[3]=R,e[4]=M):(R=e[3],M=e[4]),_.useEffect(R,M);let O,D;e[5]===Symbol.for("react.memo_cache_sentinel")?(O=()=>()=>{f.current!==null&&window.cancelAnimationFrame(f.current),m.current!==null&&window.clearTimeout(m.current)},D=[],e[5]=O,e[6]=D):(O=e[5],D=e[6]),_.useEffect(O,D);let P;e[7]!==r||e[8]!==i||e[9]!==s||e[10]!==a?(P=()=>{var K,A,I,$,T,X;if(!i){f.current!==null&&(window.cancelAnimationFrame(f.current),f.current=null),m.current!==null&&(window.clearTimeout(m.current),m.current=null),v.current=!1;return}const V=c.current;if(!V)return;f.current!==null&&(window.cancelAnimationFrame(f.current),f.current=null),m.current!==null&&(window.clearTimeout(m.current),m.current=null);const F=b.current,{currentLayout:U,shouldSkipAnimation:H,targetLayout:j}=GZ({previousProjectId:F,projectId:r,previousShouldRenderTerminalLayout:S.current,previousShowTerminalPane:x.current,showTerminalPane:s,terminalLayout:a,liveLayout:[V.getLayout().chat??a.mainSizes[0],V.getLayout().terminal??a.mainSizes[1]]});if(S.current=i,x.current=s,H||Math.abs(U[0]-j[0])<.1&&Math.abs(U[1]-j[1])<.1){V.setLayout({chat:j[0],terminal:j[1]}),(K=d.current)==null||K.setAttribute("data-terminal-open",s?"true":"false"),(A=u.current)==null||A.setAttribute("data-terminal-open",s?"true":"false"),(I=u.current)==null||I.setAttribute("data-terminal-animated","false");return}v.current=!0,($=d.current)==null||$.setAttribute("data-terminal-open",s?"true":"false"),(T=u.current)==null||T.setAttribute("data-terminal-open",s?"true":"false"),(X=u.current)==null||X.setAttribute("data-terminal-animated","true"),V.setLayout({chat:U[0],terminal:U[1]});const G=performance.now(),B=Z=>{const J=Math.min(1,(Z-G)/ou),re=$D(U,j,J);if(V.setLayout({chat:re[0],terminal:re[1]}),J<1){f.current=window.requestAnimationFrame(B);return}V.setLayout({chat:j[0],terminal:j[1]}),f.current=null,m.current=window.setTimeout(()=>{v.current=!1,m.current=null},0)};f.current=window.requestAnimationFrame(B)},e[7]=r,e[8]=i,e[9]=s,e[10]=a,e[11]=P):P=e[11];let z;e[12]!==r||e[13]!==i||e[14]!==s||e[15]!==a.mainSizes?(z=[r,i,s,a.mainSizes],e[12]=r,e[13]=i,e[14]=s,e[15]=a.mainSizes,e[16]=z):z=e[16],_.useLayoutEffect(P,z);let Y,L;e[17]!==i?(Y=()=>{i||(S.current=!1,x.current=!1)},L=[i],e[17]=i,e[18]=Y,e[19]=L):(Y=e[18],L=e[19]),_.useEffect(Y,L);let W;return e[20]!==k?(W={isAnimating:v,mainPanelGroupRef:c,terminalFocusRequestVersion:k,terminalPanelRef:d,terminalVisualRef:u},e[20]=k,e[21]=W):W=e[21],W}function XZ(t){return t+1}function QZ(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ZZ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JZ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eJ={};function m3(t,e){return(eJ.jsx?JZ:ZZ).test(t)}const tJ=/[ \t\n\f\r]/g;function nJ(t){return typeof t=="object"?t.type==="text"?p3(t.value):!1:p3(t)}function p3(t){return t.replace(tJ,"")===""}class Jh{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Jh.prototype.normal={};Jh.prototype.property={};Jh.prototype.space=void 0;function UD(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Jh(n,r,e)}function Z_(t){return t.toLowerCase()}class mi{constructor(e,n){this.attribute=n,this.property=e}}mi.prototype.attribute="";mi.prototype.booleanish=!1;mi.prototype.boolean=!1;mi.prototype.commaOrSpaceSeparated=!1;mi.prototype.commaSeparated=!1;mi.prototype.defined=!1;mi.prototype.mustUseProperty=!1;mi.prototype.number=!1;mi.prototype.overloadedBoolean=!1;mi.prototype.property="";mi.prototype.spaceSeparated=!1;mi.prototype.space=void 0;let rJ=0;const Nt=cc(),Yn=cc(),J_=cc(),We=cc(),vn=cc(),gu=cc(),Ti=cc();function cc(){return 2**++rJ}const ey=Object.freeze(Object.defineProperty({__proto__:null,boolean:Nt,booleanish:Yn,commaOrSpaceSeparated:Ti,commaSeparated:gu,number:We,overloadedBoolean:J_,spaceSeparated:vn},Symbol.toStringTag,{value:"Module"})),Gb=Object.keys(ey);class Gx extends mi{constructor(e,n,r,i){let s=-1;if(super(e,n),g3(this,"space",i),typeof r=="number")for(;++s<Gb.length;){const a=Gb[s];g3(this,Gb[s],(r&ey[a])===ey[a])}}}Gx.prototype.defined=!0;function g3(t,e,n){n&&(t[e]=n)}function Wu(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new Gx(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[Z_(r)]=r,n[Z_(s.attribute)]=r}return new Jh(e,n,t.space)}const WD=Wu({properties:{ariaActiveDescendant:null,ariaAtomic:Yn,ariaAutoComplete:null,ariaBusy:Yn,ariaChecked:Yn,ariaColCount:We,ariaColIndex:We,ariaColSpan:We,ariaControls:vn,ariaCurrent:null,ariaDescribedBy:vn,ariaDetails:null,ariaDisabled:Yn,ariaDropEffect:vn,ariaErrorMessage:null,ariaExpanded:Yn,ariaFlowTo:vn,ariaGrabbed:Yn,ariaHasPopup:null,ariaHidden:Yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vn,ariaLevel:We,ariaLive:null,ariaModal:Yn,ariaMultiLine:Yn,ariaMultiSelectable:Yn,ariaOrientation:null,ariaOwns:vn,ariaPlaceholder:null,ariaPosInSet:We,ariaPressed:Yn,ariaReadOnly:Yn,ariaRelevant:null,ariaRequired:Yn,ariaRoleDescription:vn,ariaRowCount:We,ariaRowIndex:We,ariaRowSpan:We,ariaSelected:Yn,ariaSetSize:We,ariaSort:null,ariaValueMax:We,ariaValueMin:We,ariaValueNow:We,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function VD(t,e){return e in t?t[e]:e}function qD(t,e){return VD(t,e.toLowerCase())}const iJ=Wu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gu,acceptCharset:vn,accessKey:vn,action:null,allow:null,allowFullScreen:Nt,allowPaymentRequest:Nt,allowUserMedia:Nt,alt:null,as:null,async:Nt,autoCapitalize:null,autoComplete:vn,autoFocus:Nt,autoPlay:Nt,blocking:vn,capture:null,charSet:null,checked:Nt,cite:null,className:vn,cols:We,colSpan:null,content:null,contentEditable:Yn,controls:Nt,controlsList:vn,coords:We|gu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Nt,defer:Nt,dir:null,dirName:null,disabled:Nt,download:J_,draggable:Yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Nt,formTarget:null,headers:vn,height:We,hidden:J_,high:We,href:null,hrefLang:null,htmlFor:vn,httpEquiv:vn,id:null,imageSizes:null,imageSrcSet:null,inert:Nt,inputMode:null,integrity:null,is:null,isMap:Nt,itemId:null,itemProp:vn,itemRef:vn,itemScope:Nt,itemType:vn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Nt,low:We,manifest:null,max:null,maxLength:We,media:null,method:null,min:null,minLength:We,multiple:Nt,muted:Nt,name:null,nonce:null,noModule:Nt,noValidate:Nt,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:Nt,optimum:We,pattern:null,ping:vn,placeholder:null,playsInline:Nt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Nt,referrerPolicy:null,rel:vn,required:Nt,reversed:Nt,rows:We,rowSpan:We,sandbox:vn,scope:null,scoped:Nt,seamless:Nt,selected:Nt,shadowRootClonable:Nt,shadowRootDelegatesFocus:Nt,shadowRootMode:null,shape:null,size:We,sizes:null,slot:null,span:We,spellCheck:Yn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:We,step:null,style:null,tabIndex:We,target:null,title:null,translate:null,type:null,typeMustMatch:Nt,useMap:null,value:Yn,width:We,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vn,axis:null,background:null,bgColor:null,border:We,borderColor:null,bottomMargin:We,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Nt,declare:Nt,event:null,face:null,frame:null,frameBorder:null,hSpace:We,leftMargin:We,link:null,longDesc:null,lowSrc:null,marginHeight:We,marginWidth:We,noResize:Nt,noHref:Nt,noShade:Nt,noWrap:Nt,object:null,profile:null,prompt:null,rev:null,rightMargin:We,rules:null,scheme:null,scrolling:Yn,standby:null,summary:null,text:null,topMargin:We,valueType:null,version:null,vAlign:null,vLink:null,vSpace:We,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Nt,disableRemotePlayback:Nt,prefix:null,property:null,results:We,security:null,unselectable:null},space:"html",transform:qD}),sJ=Wu({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:Ti,accentHeight:We,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:We,amplitude:We,arabicForm:null,ascent:We,attributeName:null,attributeType:null,azimuth:We,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:We,by:null,calcMode:null,capHeight:We,className:vn,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:We,diffuseConstant:We,direction:null,display:null,dur:null,divisor:We,dominantBaseline:null,download:Nt,dx:null,dy:null,edgeMode:null,editable:null,elevation:We,enableBackground:null,end:null,event:null,exponent:We,externalResourcesRequired:null,fill:null,fillOpacity:We,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:gu,g2:gu,glyphName:gu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:We,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:We,horizOriginX:We,horizOriginY:We,id:null,ideographic:We,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:We,k:We,k1:We,k2:We,k3:We,k4:We,kernelMatrix:Ti,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:We,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:We,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:We,overlineThickness:We,paintOrder:null,panose1:null,path:null,pathLength:We,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:We,pointsAtY:We,pointsAtZ:We,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ti,rev:Ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ti,requiredFeatures:Ti,requiredFonts:Ti,requiredFormats:Ti,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:We,specularExponent:We,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:We,strikethroughThickness:We,string:null,stroke:null,strokeDashArray:Ti,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:We,strokeOpacity:We,strokeWidth:null,style:null,surfaceScale:We,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ti,tabIndex:We,tableValues:null,target:null,targetX:We,targetY:We,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ti,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:We,underlineThickness:We,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:We,values:null,vAlphabetic:We,vMathematical:We,vectorEffect:null,vHanging:We,vIdeographic:We,version:null,vertAdvY:We,vertOriginX:We,vertOriginY:We,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:We,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:VD}),KD=Wu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),GD=Wu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qD}),YD=Wu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),oJ={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"},aJ=/[A-Z]/g,v3=/-[a-z]/g,lJ=/^data[-\w.:]+$/i;function cJ(t,e){const n=Z_(e);let r=e,i=mi;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&lJ.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(v3,dJ);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!v3.test(s)){let a=s.replace(aJ,uJ);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=Gx}return new i(r,e)}function uJ(t){return"-"+t.toLowerCase()}function dJ(t){return t.charAt(1).toUpperCase()}const hJ=UD([WD,iJ,KD,GD,YD],"html"),Yx=UD([WD,sJ,KD,GD,YD],"svg");function fJ(t){return t.join(" ").trim()}var Jc={},Yb,b3;function mJ(){if(b3)return Yb;b3=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
578
|
+
`,u="/",f="*",m="",v="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 E=1,R=1;function M(U){var H=U.match(e);H&&(E+=H.length);var j=U.lastIndexOf(d);R=~j?U.length-j:R+U.length}function O(){var U={line:E,column:R};return function(H){return H.position=new D(U),Y(),H}}function D(U){this.start=U,this.end={line:E,column:R},this.source=k.source}D.prototype.content=C;function P(U){var H=new Error(k.source+":"+E+":"+R+": "+U);if(H.reason=U,H.filename=k.source,H.line=E,H.column=R,H.source=C,!k.silent)throw H}function z(U){var H=U.exec(C);if(H){var j=H[0];return M(j),C=C.slice(j.length),H}}function Y(){z(n)}function L(U){var H;for(U=U||[];H=W();)H!==!1&&U.push(H);return U}function W(){var U=O();if(!(u!=C.charAt(0)||f!=C.charAt(1))){for(var H=2;m!=C.charAt(H)&&(f!=C.charAt(H)||u!=C.charAt(H+1));)++H;if(H+=2,m===C.charAt(H-1))return P("End of comment missing");var j=C.slice(2,H-2);return R+=2,M(j),C=C.slice(H),R+=2,U({type:v,comment:j})}}function V(){var U=O(),H=z(r);if(H){if(W(),!z(i))return P("property missing ':'");var j=z(s),G=U({type:b,property:x(H[0].replace(t,m)),value:j?x(j[0].replace(t,m)):m});return z(a),G}}function F(){var U=[];L(U);for(var H;H=V();)H!==!1&&(U.push(H),L(U));return U}return Y(),F()}function x(C){return C?C.replace(c,m):m}return Yb=S,Yb}var _3;function pJ(){if(_3)return Jc;_3=1;var t=Jc&&Jc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.default=n;const e=t(mJ());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,e.default)(r),c=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:u,value:f}=d;c?i(u,f,d):f&&(s=s||{},s[u]=f)}),s}return Jc}var $d={},y3;function gJ(){if(y3)return $d;y3=1,Object.defineProperty($d,"__esModule",{value:!0}),$d.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(u){return!u||n.test(u)||t.test(u)},a=function(u,f){return f.toUpperCase()},c=function(u,f){return"".concat(f,"-")},d=function(u,f){return f===void 0&&(f={}),s(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,c):u=u.replace(r,c),u.replace(e,a))};return $d.camelCase=d,$d}var Ud,x3;function vJ(){if(x3)return Ud;x3=1;var t=Ud&&Ud.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(pJ()),n=gJ();function r(i,s){var a={};return!i||typeof i!="string"||(0,e.default)(i,function(c,d){c&&d&&(a[(0,n.camelCase)(c,s)]=d)}),a}return r.default=r,Ud=r,Ud}var bJ=vJ();const _J=tg(bJ),XD=QD("end"),Xx=QD("start");function QD(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function yJ(t){const e=Xx(t),n=XD(t);if(e&&n)return{start:e,end:n}}function hh(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?S3(t.position):"start"in t||"end"in t?S3(t):"line"in t||"column"in t?ty(t):""}function ty(t){return w3(t&&t.line)+":"+w3(t&&t.column)}function S3(t){return ty(t&&t.start)+"-"+ty(t&&t.end)}function w3(t){return t&&typeof t=="number"?t:1}class zr extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?s.ruleId=r:(s.source=r.slice(0,d),s.ruleId=r.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=hh(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zr.prototype.file="";zr.prototype.name="";zr.prototype.reason="";zr.prototype.message="";zr.prototype.stack="";zr.prototype.column=void 0;zr.prototype.line=void 0;zr.prototype.ancestors=void 0;zr.prototype.cause=void 0;zr.prototype.fatal=void 0;zr.prototype.place=void 0;zr.prototype.ruleId=void 0;zr.prototype.source=void 0;const Qx={}.hasOwnProperty,xJ=new Map,SJ=/[A-Z]/g,wJ=new Set(["table","tbody","thead","tfoot","tr"]),CJ=new Set(["td","th"]),ZD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kJ(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=OJ(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=DJ(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Yx:hJ,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=JD(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function JD(t,e,n){if(e.type==="element")return EJ(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return RJ(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return MJ(t,e,n);if(e.type==="mdxjsEsm")return TJ(t,e);if(e.type==="root")return AJ(t,e,n);if(e.type==="text")return NJ(t,e)}function EJ(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Yx,t.schema=i),t.ancestors.push(e);const s=t6(t,e.tagName,!1),a=jJ(t,e);let c=Jx(t,e);return wJ.has(e.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!nJ(d):!0})),e6(t,a,s,e),Zx(a,c),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function RJ(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Th(t,e.position)}function TJ(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Th(t,e.position)}function MJ(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Yx,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:t6(t,e.name,!0),a=LJ(t,e),c=Jx(t,e);return e6(t,a,s,e),Zx(a,c),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function AJ(t,e,n){const r={};return Zx(r,Jx(t,e)),t.create(e,t.Fragment,r,n)}function NJ(t,e){return e.value}function e6(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Zx(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function DJ(t,e,n){return r;function r(i,s,a,c){const u=Array.isArray(a.children)?n:e;return c?u(s,a,c):u(s,a)}}function OJ(t,e){return n;function n(r,i,s,a){const c=Array.isArray(s.children),d=Xx(r);return e(i,s,a,c,{columnNumber:d?d.column-1:void 0,fileName:t,lineNumber:d?d.line:void 0},void 0)}}function jJ(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Qx.call(e.properties,i)){const s=IJ(t,i,e.properties[i]);if(s){const[a,c]=s;t.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&CJ.has(e.tagName)?r=c:n[a]=c}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function LJ(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const c=a.properties[0];c.type,Object.assign(n,t.evaluater.evaluateExpression(c.argument))}else Th(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const c=r.value.data.estree.body[0];c.type,s=t.evaluater.evaluateExpression(c.expression)}else Th(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Jx(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:xJ;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const u=i.get(d)||0;a=d+"-"+u,i.set(d,u+1)}}const c=JD(t,s,a);c!==void 0&&n.push(c)}return n}function IJ(t,e,n){const r=cJ(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?QZ(n):fJ(n)),r.property==="style"){let i=typeof n=="object"?n:PJ(t,String(n));return t.stylePropertyNameCase==="css"&&(i=zJ(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?oJ[r.property]||r.property:r.attribute,n]}}function PJ(t,e){try{return _J(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new zr("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=ZD+"#cannot-parse-style-attribute",i}}function t6(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const c=m3(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}r=a}else r=m3(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return Qx.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);Th(t)}function Th(t,e){const n=new zr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=ZD+"#cannot-handle-mdx-estrees-without-createevaluater",n}function zJ(t){const e={};let n;for(n in t)Qx.call(t,n)&&(e[BJ(n)]=t[n]);return e}function BJ(t){let e=t.replace(SJ,FJ);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function FJ(t){return"-"+t.toLowerCase()}const Xb={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"]},HJ={};function eS(t,e){const n=HJ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return n6(t,r,i)}function n6(t,e,n){if($J(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return C3(t.children,e,n)}return Array.isArray(t)?C3(t,e,n):""}function C3(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=n6(t[i],e,n);return r.join("")}function $J(t){return!!(t&&typeof t=="object")}const k3=document.createElement("i");function tS(t){const e="&"+t+";";k3.innerHTML=e;const n=k3.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Oi(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function Ji(t,e){return t.length>0?(Oi(t,t.length,0,e),t):e}const E3={}.hasOwnProperty;function r6(t){const e={};let n=-1;for(;++n<t.length;)UJ(e,t[n]);return e}function UJ(t,e){let n;for(n in e){const i=(E3.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){E3.call(i,a)||(i[a]=[]);const c=s[a];WJ(i[a],Array.isArray(c)?c:c?[c]:[])}}}function WJ(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Oi(t,0,0,r)}function i6(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function xs(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Gr=cl(/[A-Za-z]/),Ir=cl(/[\dA-Za-z]/),VJ=cl(/[#-'*+\--9=?A-Z^-~]/);function Xp(t){return t!==null&&(t<32||t===127)}const ny=cl(/\d/),qJ=cl(/[\dA-Fa-f]/),KJ=cl(/[!-/:-@[-`{-~]/);function bt(t){return t!==null&&t<-2}function un(t){return t!==null&&(t<0||t===32)}function zt(t){return t===-2||t===-1||t===32}const Kg=cl(new RegExp("\\p{P}|\\p{S}","u")),ec=cl(/\s/);function cl(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Vu(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&Ir(t.charCodeAt(n+1))&&Ir(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const c=t.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(a=String.fromCharCode(s,c),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Vt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(d){return zt(d)?(t.enter(n),c(d)):e(d)}function c(d){return zt(d)&&s++<i?(t.consume(d),c):(t.exit(n),e(d))}}const GJ={tokenize:YJ};function YJ(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),Vt(t,e,"linePrefix")}function i(c){return t.enter("paragraph"),s(c)}function s(c){const d=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(c)}function a(c){if(c===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(c);return}return bt(c)?(t.consume(c),t.exit("chunkText"),s):(t.consume(c),a)}}const XJ={tokenize:QJ},R3={tokenize:ZJ};function QJ(t){const e=this,n=[];let r=0,i,s,a;return c;function c(R){if(r<n.length){const M=n[r];return e.containerState=M[1],t.attempt(M[0].continuation,d,u)(R)}return u(R)}function d(R){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&E();const M=e.events.length;let O=M,D;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){D=e.events[O][1].end;break}k(r);let P=M;for(;P<e.events.length;)e.events[P][1].end={...D},P++;return Oi(e.events,O+1,0,e.events.slice(M)),e.events.length=P,u(R)}return c(R)}function u(R){if(r===n.length){if(!i)return v(R);if(i.currentConstruct&&i.currentConstruct.concrete)return S(R);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(R3,f,m)(R)}function f(R){return i&&E(),k(r),v(R)}function m(R){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,S(R)}function v(R){return e.containerState={},t.attempt(R3,b,S)(R)}function b(R){return r++,n.push([e.currentConstruct,e.containerState]),v(R)}function S(R){if(R===null){i&&E(),k(0),t.consume(R);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),x(R)}function x(R){if(R===null){C(t.exit("chunkFlow"),!0),k(0),t.consume(R);return}return bt(R)?(t.consume(R),C(t.exit("chunkFlow")),r=0,e.interrupt=void 0,c):(t.consume(R),x)}function C(R,M){const O=e.sliceStream(R);if(M&&O.push(null),R.previous=s,s&&(s.next=R),s=R,i.defineSkip(R.start),i.write(O),e.parser.lazy[R.start.line]){let D=i.events.length;for(;D--;)if(i.events[D][1].start.offset<a&&(!i.events[D][1].end||i.events[D][1].end.offset>a))return;const P=e.events.length;let z=P,Y,L;for(;z--;)if(e.events[z][0]==="exit"&&e.events[z][1].type==="chunkFlow"){if(Y){L=e.events[z][1].end;break}Y=!0}for(k(r),D=P;D<e.events.length;)e.events[D][1].end={...L},D++;Oi(e.events,z+1,0,e.events.slice(P)),e.events.length=D}}function k(R){let M=n.length;for(;M-- >R;){const O=n[M];e.containerState=O[1],O[0].exit.call(e,t)}n.length=R}function E(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function ZJ(t,e,n){return Vt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Eu(t){if(t===null||un(t)||ec(t))return 1;if(Kg(t))return 2}function Gg(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const ry={name:"attention",resolveAll:JJ,tokenize:eee};function JJ(t,e){let n=-1,r,i,s,a,c,d,u,f;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;d=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[r][1].end},v={...t[n][1].start};T3(m,-d),T3(v,d),a={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...t[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:v},s={type:d>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},t[r][1].end={...a.start},t[n][1].start={...c.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=Ji(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=Ji(u,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),u=Ji(u,Gg(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=Ji(u,[["exit",s,e],["enter",c,e],["exit",c,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(f=2,u=Ji(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):f=0,Oi(t,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function eee(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Eu(r);let s;return a;function a(d){return s=d,t.enter("attentionSequence"),c(d)}function c(d){if(d===s)return t.consume(d),c;const u=t.exit("attentionSequence"),f=Eu(d),m=!f||f===2&&i||n.includes(d),v=!i||i===2&&f||n.includes(r);return u._open=!!(s===42?m:m&&(i||!v)),u._close=!!(s===42?v:v&&(f||!m)),e(d)}}function T3(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const tee={name:"autolink",tokenize:nee};function nee(t,e,n){let r=0;return i;function i(b){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(b){return Gr(b)?(t.consume(b),a):b===64?n(b):u(b)}function a(b){return b===43||b===45||b===46||Ir(b)?(r=1,c(b)):u(b)}function c(b){return b===58?(t.consume(b),r=0,d):(b===43||b===45||b===46||Ir(b))&&r++<32?(t.consume(b),c):(r=0,u(b))}function d(b){return b===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):b===null||b===32||b===60||Xp(b)?n(b):(t.consume(b),d)}function u(b){return b===64?(t.consume(b),f):VJ(b)?(t.consume(b),u):n(b)}function f(b){return Ir(b)?m(b):n(b)}function m(b){return b===46?(t.consume(b),r=0,f):b===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):v(b)}function v(b){if((b===45||Ir(b))&&r++<63){const S=b===45?v:m;return t.consume(b),S}return n(b)}}const ef={partial:!0,tokenize:ree};function ree(t,e,n){return r;function r(s){return zt(s)?Vt(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||bt(s)?e(s):n(s)}}const s6={continuation:{tokenize:see},exit:oee,name:"blockQuote",tokenize:iee};function iee(t,e,n){const r=this;return i;function i(a){if(a===62){const c=r.containerState;return c.open||(t.enter("blockQuote",{_container:!0}),c.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return zt(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function see(t,e,n){const r=this;return i;function i(a){return zt(a)?Vt(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(s6,e,n)(a)}}function oee(t){t.exit("blockQuote")}const o6={name:"characterEscape",tokenize:aee};function aee(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return KJ(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const a6={name:"characterReference",tokenize:lee};function lee(t,e,n){const r=this;let i=0,s,a;return c;function c(m){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),d}function d(m){return m===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(m),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),s=31,a=Ir,f(m))}function u(m){return m===88||m===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(m),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=qJ,f):(t.enter("characterReferenceValue"),s=7,a=ny,f(m))}function f(m){if(m===59&&i){const v=t.exit("characterReferenceValue");return a===Ir&&!tS(r.sliceSerialize(v))?n(m):(t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(m)&&i++<s?(t.consume(m),f):n(m)}}const M3={partial:!0,tokenize:uee},A3={concrete:!0,name:"codeFenced",tokenize:cee};function cee(t,e,n){const r=this,i={partial:!0,tokenize:O};let s=0,a=0,c;return d;function d(D){return u(D)}function u(D){const P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,c=D,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),f(D)}function f(D){return D===c?(a++,t.consume(D),f):a<3?n(D):(t.exit("codeFencedFenceSequence"),zt(D)?Vt(t,m,"whitespace")(D):m(D))}function m(D){return D===null||bt(D)?(t.exit("codeFencedFence"),r.interrupt?e(D):t.check(M3,x,M)(D)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||bt(D)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),m(D)):zt(D)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Vt(t,b,"whitespace")(D)):D===96&&D===c?n(D):(t.consume(D),v)}function b(D){return D===null||bt(D)?m(D):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||bt(D)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),m(D)):D===96&&D===c?n(D):(t.consume(D),S)}function x(D){return t.attempt(i,M,C)(D)}function C(D){return t.enter("lineEnding"),t.consume(D),t.exit("lineEnding"),k}function k(D){return s>0&&zt(D)?Vt(t,E,"linePrefix",s+1)(D):E(D)}function E(D){return D===null||bt(D)?t.check(M3,x,M)(D):(t.enter("codeFlowValue"),R(D))}function R(D){return D===null||bt(D)?(t.exit("codeFlowValue"),E(D)):(t.consume(D),R)}function M(D){return t.exit("codeFenced"),e(D)}function O(D,P,z){let Y=0;return L;function L(H){return D.enter("lineEnding"),D.consume(H),D.exit("lineEnding"),W}function W(H){return D.enter("codeFencedFence"),zt(H)?Vt(D,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):V(H)}function V(H){return H===c?(D.enter("codeFencedFenceSequence"),F(H)):z(H)}function F(H){return H===c?(Y++,D.consume(H),F):Y>=a?(D.exit("codeFencedFenceSequence"),zt(H)?Vt(D,U,"whitespace")(H):U(H)):z(H)}function U(H){return H===null||bt(H)?(D.exit("codeFencedFence"),P(H)):z(H)}}}function uee(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const Qb={name:"codeIndented",tokenize:hee},dee={partial:!0,tokenize:fee};function hee(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Vt(t,s,"linePrefix",5)(u)}function s(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?d(u):bt(u)?t.attempt(dee,a,d)(u):(t.enter("codeFlowValue"),c(u))}function c(u){return u===null||bt(u)?(t.exit("codeFlowValue"),a(u)):(t.consume(u),c)}function d(u){return t.exit("codeIndented"),e(u)}}function fee(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):bt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Vt(t,s,"linePrefix",5)(a)}function s(a){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(a):bt(a)?i(a):n(a)}}const mee={name:"codeText",previous:gee,resolve:pee,tokenize:vee};function pee(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function gee(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function vee(t,e,n){let r=0,i,s;return a;function a(m){return t.enter("codeText"),t.enter("codeTextSequence"),c(m)}function c(m){return m===96?(t.consume(m),r++,c):(t.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(t.enter("space"),t.consume(m),t.exit("space"),d):m===96?(s=t.enter("codeTextSequence"),i=0,f(m)):bt(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),d):(t.enter("codeTextData"),u(m))}function u(m){return m===null||m===32||m===96||bt(m)?(t.exit("codeTextData"),d(m)):(t.consume(m),u)}function f(m){return m===96?(t.consume(m),i++,f):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(m)):(s.type="codeTextData",u(m))}}class bee{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Wd(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Wd(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Wd(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Wd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Wd(this.left,n.reverse())}}}function Wd(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function l6(t){const e={};let n=-1,r,i,s,a,c,d,u;const f=new bee(t);for(;++n<f.length;){for(;n in e;)n=e[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,_ee(f,n)),n=e[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=f.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},c=f.slice(i,n),c.unshift(r),f.splice(i,n-i+1,c))}}return Oi(t,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function _ee(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const c=a.events,d=[],u={};let f,m,v=-1,b=n,S=0,x=0;const C=[x];for(;b;){for(;t.get(++i)[1]!==b;);s.push(i),b._tokenizer||(f=r.sliceStream(b),b.next||f.push(null),m&&a.defineSkip(b.start),b._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),b._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=n;++v<c.length;)c[v][0]==="exit"&&c[v-1][0]==="enter"&&c[v][1].type===c[v-1][1].type&&c[v][1].start.line!==c[v][1].end.line&&(x=v+1,C.push(x),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(a.events=[],b?(b._tokenizer=void 0,b.previous=void 0):C.pop(),v=C.length;v--;){const k=c.slice(C[v],C[v+1]),E=s.pop();d.push([E,E+k.length-1]),t.splice(E,2,k)}for(d.reverse(),v=-1;++v<d.length;)u[S+d[v][0]]=S+d[v][1],S+=d[v][1]-d[v][0]-1;return u}const yee={resolve:See,tokenize:wee},xee={partial:!0,tokenize:Cee};function See(t){return l6(t),t}function wee(t,e){let n;return r;function r(c){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?s(c):bt(c)?t.check(xee,a,s)(c):(t.consume(c),i)}function s(c){return t.exit("chunkContent"),t.exit("content"),e(c)}function a(c){return t.consume(c),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Cee(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Vt(t,s,"linePrefix")}function s(a){if(a===null||bt(a))return n(a);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function c6(t,e,n,r,i,s,a,c,d){const u=d||Number.POSITIVE_INFINITY;let f=0;return m;function m(k){return k===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(k),t.exit(s),v):k===null||k===32||k===41||Xp(k)?n(k):(t.enter(r),t.enter(a),t.enter(c),t.enter("chunkString",{contentType:"string"}),x(k))}function v(k){return k===62?(t.enter(s),t.consume(k),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(c),t.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(t.exit("chunkString"),t.exit(c),v(k)):k===null||k===60||bt(k)?n(k):(t.consume(k),k===92?S:b)}function S(k){return k===60||k===62||k===92?(t.consume(k),b):b(k)}function x(k){return!f&&(k===null||k===41||un(k))?(t.exit("chunkString"),t.exit(c),t.exit(a),t.exit(r),e(k)):f<u&&k===40?(t.consume(k),f++,x):k===41?(t.consume(k),f--,x):k===null||k===32||k===40||Xp(k)?n(k):(t.consume(k),k===92?C:x)}function C(k){return k===40||k===41||k===92?(t.consume(k),x):x(k)}}function u6(t,e,n,r,i,s){const a=this;let c=0,d;return u;function u(b){return t.enter(r),t.enter(i),t.consume(b),t.exit(i),t.enter(s),f}function f(b){return c>999||b===null||b===91||b===93&&!d||b===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?n(b):b===93?(t.exit(s),t.enter(i),t.consume(b),t.exit(i),t.exit(r),e):bt(b)?(t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),f):(t.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||bt(b)||c++>999?(t.exit("chunkString"),f(b)):(t.consume(b),d||(d=!zt(b)),b===92?v:m)}function v(b){return b===91||b===92||b===93?(t.consume(b),c++,m):m(b)}}function d6(t,e,n,r,i,s){let a;return c;function c(v){return v===34||v===39||v===40?(t.enter(r),t.enter(i),t.consume(v),t.exit(i),a=v===40?41:v,d):n(v)}function d(v){return v===a?(t.enter(i),t.consume(v),t.exit(i),t.exit(r),e):(t.enter(s),u(v))}function u(v){return v===a?(t.exit(s),d(a)):v===null?n(v):bt(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),Vt(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===a||v===null||bt(v)?(t.exit("chunkString"),u(v)):(t.consume(v),v===92?m:f)}function m(v){return v===a||v===92?(t.consume(v),f):f(v)}}function fh(t,e){let n;return r;function r(i){return bt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):zt(i)?Vt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const kee={name:"definition",tokenize:Ree},Eee={partial:!0,tokenize:Tee};function Ree(t,e,n){const r=this;let i;return s;function s(b){return t.enter("definition"),a(b)}function a(b){return u6.call(r,t,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function c(b){return i=xs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),d):n(b)}function d(b){return un(b)?fh(t,u)(b):u(b)}function u(b){return c6(t,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function f(b){return t.attempt(Eee,m,m)(b)}function m(b){return zt(b)?Vt(t,v,"whitespace")(b):v(b)}function v(b){return b===null||bt(b)?(t.exit("definition"),r.parser.defined.push(i),e(b)):n(b)}}function Tee(t,e,n){return r;function r(c){return un(c)?fh(t,i)(c):n(c)}function i(c){return d6(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return zt(c)?Vt(t,a,"whitespace")(c):a(c)}function a(c){return c===null||bt(c)?e(c):n(c)}}const Mee={name:"hardBreakEscape",tokenize:Aee};function Aee(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return bt(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const Nee={name:"headingAtx",resolve:Dee,tokenize:Oee};function Dee(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Oi(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function Oee(t,e,n){let r=0;return i;function i(f){return t.enter("atxHeading"),s(f)}function s(f){return t.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(t.consume(f),a):f===null||un(f)?(t.exit("atxHeadingSequence"),c(f)):n(f)}function c(f){return f===35?(t.enter("atxHeadingSequence"),d(f)):f===null||bt(f)?(t.exit("atxHeading"),e(f)):zt(f)?Vt(t,c,"whitespace")(f):(t.enter("atxHeadingText"),u(f))}function d(f){return f===35?(t.consume(f),d):(t.exit("atxHeadingSequence"),c(f))}function u(f){return f===null||f===35||un(f)?(t.exit("atxHeadingText"),c(f)):(t.consume(f),u)}}const jee=["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"],N3=["pre","script","style","textarea"],Lee={concrete:!0,name:"htmlFlow",resolveTo:zee,tokenize:Bee},Iee={partial:!0,tokenize:Hee},Pee={partial:!0,tokenize:Fee};function zee(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Bee(t,e,n){const r=this;let i,s,a,c,d;return u;function u(T){return f(T)}function f(T){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(T),m}function m(T){return T===33?(t.consume(T),v):T===47?(t.consume(T),s=!0,x):T===63?(t.consume(T),i=3,r.interrupt?e:A):Gr(T)?(t.consume(T),a=String.fromCharCode(T),C):n(T)}function v(T){return T===45?(t.consume(T),i=2,b):T===91?(t.consume(T),i=5,c=0,S):Gr(T)?(t.consume(T),i=4,r.interrupt?e:A):n(T)}function b(T){return T===45?(t.consume(T),r.interrupt?e:A):n(T)}function S(T){const X="CDATA[";return T===X.charCodeAt(c++)?(t.consume(T),c===X.length?r.interrupt?e:V:S):n(T)}function x(T){return Gr(T)?(t.consume(T),a=String.fromCharCode(T),C):n(T)}function C(T){if(T===null||T===47||T===62||un(T)){const X=T===47,Z=a.toLowerCase();return!X&&!s&&N3.includes(Z)?(i=1,r.interrupt?e(T):V(T)):jee.includes(a.toLowerCase())?(i=6,X?(t.consume(T),k):r.interrupt?e(T):V(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):s?E(T):R(T))}return T===45||Ir(T)?(t.consume(T),a+=String.fromCharCode(T),C):n(T)}function k(T){return T===62?(t.consume(T),r.interrupt?e:V):n(T)}function E(T){return zt(T)?(t.consume(T),E):L(T)}function R(T){return T===47?(t.consume(T),L):T===58||T===95||Gr(T)?(t.consume(T),M):zt(T)?(t.consume(T),R):L(T)}function M(T){return T===45||T===46||T===58||T===95||Ir(T)?(t.consume(T),M):O(T)}function O(T){return T===61?(t.consume(T),D):zt(T)?(t.consume(T),O):R(T)}function D(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(t.consume(T),d=T,P):zt(T)?(t.consume(T),D):z(T)}function P(T){return T===d?(t.consume(T),d=null,Y):T===null||bt(T)?n(T):(t.consume(T),P)}function z(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||un(T)?O(T):(t.consume(T),z)}function Y(T){return T===47||T===62||zt(T)?R(T):n(T)}function L(T){return T===62?(t.consume(T),W):n(T)}function W(T){return T===null||bt(T)?V(T):zt(T)?(t.consume(T),W):n(T)}function V(T){return T===45&&i===2?(t.consume(T),j):T===60&&i===1?(t.consume(T),G):T===62&&i===4?(t.consume(T),I):T===63&&i===3?(t.consume(T),A):T===93&&i===5?(t.consume(T),K):bt(T)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Iee,$,F)(T)):T===null||bt(T)?(t.exit("htmlFlowData"),F(T)):(t.consume(T),V)}function F(T){return t.check(Pee,U,$)(T)}function U(T){return t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),H}function H(T){return T===null||bt(T)?F(T):(t.enter("htmlFlowData"),V(T))}function j(T){return T===45?(t.consume(T),A):V(T)}function G(T){return T===47?(t.consume(T),a="",B):V(T)}function B(T){if(T===62){const X=a.toLowerCase();return N3.includes(X)?(t.consume(T),I):V(T)}return Gr(T)&&a.length<8?(t.consume(T),a+=String.fromCharCode(T),B):V(T)}function K(T){return T===93?(t.consume(T),A):V(T)}function A(T){return T===62?(t.consume(T),I):T===45&&i===2?(t.consume(T),A):V(T)}function I(T){return T===null||bt(T)?(t.exit("htmlFlowData"),$(T)):(t.consume(T),I)}function $(T){return t.exit("htmlFlow"),e(T)}}function Fee(t,e,n){const r=this;return i;function i(a){return bt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function Hee(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(ef,e,n)}}const $ee={name:"htmlText",tokenize:Uee};function Uee(t,e,n){const r=this;let i,s,a;return c;function c(A){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(A),d}function d(A){return A===33?(t.consume(A),u):A===47?(t.consume(A),O):A===63?(t.consume(A),R):Gr(A)?(t.consume(A),z):n(A)}function u(A){return A===45?(t.consume(A),f):A===91?(t.consume(A),s=0,S):Gr(A)?(t.consume(A),E):n(A)}function f(A){return A===45?(t.consume(A),b):n(A)}function m(A){return A===null?n(A):A===45?(t.consume(A),v):bt(A)?(a=m,G(A)):(t.consume(A),m)}function v(A){return A===45?(t.consume(A),b):m(A)}function b(A){return A===62?j(A):A===45?v(A):m(A)}function S(A){const I="CDATA[";return A===I.charCodeAt(s++)?(t.consume(A),s===I.length?x:S):n(A)}function x(A){return A===null?n(A):A===93?(t.consume(A),C):bt(A)?(a=x,G(A)):(t.consume(A),x)}function C(A){return A===93?(t.consume(A),k):x(A)}function k(A){return A===62?j(A):A===93?(t.consume(A),k):x(A)}function E(A){return A===null||A===62?j(A):bt(A)?(a=E,G(A)):(t.consume(A),E)}function R(A){return A===null?n(A):A===63?(t.consume(A),M):bt(A)?(a=R,G(A)):(t.consume(A),R)}function M(A){return A===62?j(A):R(A)}function O(A){return Gr(A)?(t.consume(A),D):n(A)}function D(A){return A===45||Ir(A)?(t.consume(A),D):P(A)}function P(A){return bt(A)?(a=P,G(A)):zt(A)?(t.consume(A),P):j(A)}function z(A){return A===45||Ir(A)?(t.consume(A),z):A===47||A===62||un(A)?Y(A):n(A)}function Y(A){return A===47?(t.consume(A),j):A===58||A===95||Gr(A)?(t.consume(A),L):bt(A)?(a=Y,G(A)):zt(A)?(t.consume(A),Y):j(A)}function L(A){return A===45||A===46||A===58||A===95||Ir(A)?(t.consume(A),L):W(A)}function W(A){return A===61?(t.consume(A),V):bt(A)?(a=W,G(A)):zt(A)?(t.consume(A),W):Y(A)}function V(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(t.consume(A),i=A,F):bt(A)?(a=V,G(A)):zt(A)?(t.consume(A),V):(t.consume(A),U)}function F(A){return A===i?(t.consume(A),i=void 0,H):A===null?n(A):bt(A)?(a=F,G(A)):(t.consume(A),F)}function U(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||un(A)?Y(A):(t.consume(A),U)}function H(A){return A===47||A===62||un(A)?Y(A):n(A)}function j(A){return A===62?(t.consume(A),t.exit("htmlTextData"),t.exit("htmlText"),e):n(A)}function G(A){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),B}function B(A){return zt(A)?Vt(t,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):K(A)}function K(A){return t.enter("htmlTextData"),a(A)}}const nS={name:"labelEnd",resolveAll:Kee,resolveTo:Gee,tokenize:Yee},Wee={tokenize:Xee},Vee={tokenize:Qee},qee={tokenize:Zee};function Kee(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&Oi(t,0,t.length,n),t}function Gee(t,e){let n=t.length,r=0,i,s,a,c;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const d={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},f={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return c=[["enter",d,e],["enter",u,e]],c=Ji(c,t.slice(s+1,s+r+3)),c=Ji(c,[["enter",f,e]]),c=Ji(c,Gg(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),c=Ji(c,[["exit",f,e],t[a-2],t[a-1],["exit",u,e]]),c=Ji(c,t.slice(a+1)),c=Ji(c,[["exit",d,e]]),Oi(t,s,t.length,c),t}function Yee(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return c;function c(v){return s?s._inactive?m(v):(a=r.parser.defined.includes(xs(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(v),t.exit("labelMarker"),t.exit("labelEnd"),d):n(v)}function d(v){return v===40?t.attempt(Wee,f,a?f:m)(v):v===91?t.attempt(Vee,f,a?u:m)(v):a?f(v):m(v)}function u(v){return t.attempt(qee,f,m)(v)}function f(v){return e(v)}function m(v){return s._balanced=!0,n(v)}}function Xee(t,e,n){return r;function r(m){return t.enter("resource"),t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),i}function i(m){return un(m)?fh(t,s)(m):s(m)}function s(m){return m===41?f(m):c6(t,a,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function a(m){return un(m)?fh(t,d)(m):f(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?d6(t,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):f(m)}function u(m){return un(m)?fh(t,f)(m):f(m)}function f(m){return m===41?(t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),t.exit("resource"),e):n(m)}}function Qee(t,e,n){const r=this;return i;function i(c){return u6.call(r,t,s,a,"reference","referenceMarker","referenceString")(c)}function s(c){return r.parser.defined.includes(xs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(c):n(c)}function a(c){return n(c)}}function Zee(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const Jee={name:"labelStartImage",resolveAll:nS.resolveAll,tokenize:ete};function ete(t,e,n){const r=this;return i;function i(c){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(c),t.exit("labelImageMarker"),s}function s(c){return c===91?(t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelImage"),a):n(c)}function a(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):e(c)}}const tte={name:"labelStartLink",resolveAll:nS.resolveAll,tokenize:nte};function nte(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const Zb={name:"lineEnding",tokenize:rte};function rte(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Vt(t,e,"linePrefix")}}const gp={name:"thematicBreak",tokenize:ite};function ite(t,e,n){let r=0,i;return s;function s(u){return t.enter("thematicBreak"),a(u)}function a(u){return i=u,c(u)}function c(u){return u===i?(t.enter("thematicBreakSequence"),d(u)):r>=3&&(u===null||bt(u))?(t.exit("thematicBreak"),e(u)):n(u)}function d(u){return u===i?(t.consume(u),r++,d):(t.exit("thematicBreakSequence"),zt(u)?Vt(t,c,"whitespace")(u):c(u))}}const li={continuation:{tokenize:lte},exit:ute,name:"list",tokenize:ate},ste={partial:!0,tokenize:dte},ote={partial:!0,tokenize:cte};function ate(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return c;function c(b){const S=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:ny(b)){if(r.containerState.type||(r.containerState.type=S,t.enter(S,{_container:!0})),S==="listUnordered")return t.enter("listItemPrefix"),b===42||b===45?t.check(gp,n,u)(b):u(b);if(!r.interrupt||b===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),d(b)}return n(b)}function d(b){return ny(b)&&++a<10?(t.consume(b),d):(!r.interrupt||a<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(t.exit("listItemValue"),u(b)):n(b)}function u(b){return t.enter("listItemMarker"),t.consume(b),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,t.check(ef,r.interrupt?n:f,t.attempt(ste,v,m))}function f(b){return r.containerState.initialBlankLine=!0,s++,v(b)}function m(b){return zt(b)?(t.enter("listItemPrefixWhitespace"),t.consume(b),t.exit("listItemPrefixWhitespace"),v):n(b)}function v(b){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(b)}}function lte(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(ef,i,s);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Vt(t,e,"listItemIndent",r.containerState.size+1)(c)}function s(c){return r.containerState.furtherBlankLines||!zt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(ote,e,a)(c))}function a(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Vt(t,t.attempt(li,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function cte(t,e,n){const r=this;return Vt(t,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(s):n(s)}}function ute(t){t.exit(this.containerState.type)}function dte(t,e,n){const r=this;return Vt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!zt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const D3={name:"setextUnderline",resolveTo:hte,tokenize:fte};function hte(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function fte(t,e,n){const r=this;let i;return s;function s(u){let f=r.events.length,m;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){m=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(t.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return t.enter("setextHeadingLineSequence"),c(u)}function c(u){return u===i?(t.consume(u),c):(t.exit("setextHeadingLineSequence"),zt(u)?Vt(t,d,"lineSuffix")(u):d(u))}function d(u){return u===null||bt(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const mte={tokenize:pte};function pte(t){const e=this,n=t.attempt(ef,r,t.attempt(this.parser.constructs.flowInitial,i,Vt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(yee,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const gte={resolveAll:f6()},vte=h6("string"),bte=h6("text");function h6(t){return{resolveAll:f6(t==="text"?_te:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,c);return a;function a(f){return u(f)?s(f):c(f)}function c(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),d}function d(f){return u(f)?(n.exit("data"),s(f)):(n.consume(f),d)}function u(f){if(f===null)return!0;const m=i[f];let v=-1;if(m)for(;++v<m.length;){const b=m[v];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function f6(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function _te(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,a=-1,c=0,d;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)c++,a--;if(a)break;a=-1}else if(u===-2)d=!0,c++;else if(u!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(c=0),c){const u={type:n===t.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(t.splice(n,0,["enter",u,e],["exit",u,e]),n+=2)}n++}return t}const yte={42:li,43:li,45:li,48:li,49:li,50:li,51:li,52:li,53:li,54:li,55:li,56:li,57:li,62:s6},xte={91:kee},Ste={[-2]:Qb,[-1]:Qb,32:Qb},wte={35:Nee,42:gp,45:[D3,gp],60:Lee,61:D3,95:gp,96:A3,126:A3},Cte={38:a6,92:o6},kte={[-5]:Zb,[-4]:Zb,[-3]:Zb,33:Jee,38:a6,42:ry,60:[tee,$ee],91:tte,92:[Mee,o6],93:nS,95:ry,96:mee},Ete={null:[ry,gte]},Rte={null:[42,95]},Tte={null:[]},Mte=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Rte,contentInitial:xte,disable:Tte,document:yte,flow:wte,flowInitial:Ste,insideSpan:Ete,string:Cte,text:kte},Symbol.toStringTag,{value:"Module"}));function Ate(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],c=[];const d={attempt:P(O),check:P(D),consume:E,enter:R,exit:M,interrupt:P(D,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:S,parser:t,previous:null,sliceSerialize:v,sliceStream:b,write:m};let f=e.tokenize.call(u,d);return e.resolveAll&&s.push(e),u;function m(W){return a=Ji(a,W),C(),a[a.length-1]!==null?[]:(z(e,0),u.events=Gg(s,u.events,u),u.events)}function v(W,V){return Dte(b(W),V)}function b(W){return Nte(a,W)}function S(){const{_bufferIndex:W,_index:V,line:F,column:U,offset:H}=r;return{_bufferIndex:W,_index:V,line:F,column:U,offset:H}}function x(W){i[W.line]=W.column,L()}function C(){let W;for(;r._index<a.length;){const V=a[r._index];if(typeof V=="string")for(W=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===W&&r._bufferIndex<V.length;)k(V.charCodeAt(r._bufferIndex));else k(V)}}function k(W){f=f(W)}function E(W){bt(W)?(r.line++,r.column=1,r.offset+=W===-3?2:1,L()):W!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=W}function R(W,V){const F=V||{};return F.type=W,F.start=S(),u.events.push(["enter",F,u]),c.push(F),F}function M(W){const V=c.pop();return V.end=S(),u.events.push(["exit",V,u]),V}function O(W,V){z(W,V.from)}function D(W,V){V.restore()}function P(W,V){return F;function F(U,H,j){let G,B,K,A;return Array.isArray(U)?$(U):"tokenize"in U?$([U]):I(U);function I(J){return re;function re(ae){const ue=ae!==null&&J[ae],me=ae!==null&&J.null,se=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(me)?me:me?[me]:[]];return $(se)(ae)}}function $(J){return G=J,B=0,J.length===0?j:T(J[B])}function T(J){return re;function re(ae){return A=Y(),K=J,J.partial||(u.currentConstruct=J),J.name&&u.parser.constructs.disable.null.includes(J.name)?Z():J.tokenize.call(V?Object.assign(Object.create(u),V):u,d,X,Z)(ae)}}function X(J){return W(K,A),H}function Z(J){return A.restore(),++B<G.length?T(G[B]):j}}}function z(W,V){W.resolveAll&&!s.includes(W)&&s.push(W),W.resolve&&Oi(u.events,V,u.events.length-V,W.resolve(u.events.slice(V),u)),W.resolveTo&&(u.events=W.resolveTo(u.events,u))}function Y(){const W=S(),V=u.previous,F=u.currentConstruct,U=u.events.length,H=Array.from(c);return{from:U,restore:j};function j(){r=W,u.previous=V,u.currentConstruct=F,u.events.length=U,c=H,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Nte(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const c=a[0];typeof c=="string"?a[0]=c.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function Dte(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
579
|
+
`;break}case-3:{a=`\r
|
|
580
|
+
`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function Ote(t){const r={constructs:r6([Mte,...(t||{}).extensions||[]]),content:i(GJ),defined:[],document:i(XJ),flow:i(mte),lazy:{},string:i(vte),text:i(bte)};return r;function i(s){return a;function a(c){return Ate(r,s,c)}}}function jte(t){for(;!l6(t););return t}const O3=/[\0\t\n\r]/g;function Lte(){let t=1,e="",n=!0,r;return i;function i(s,a,c){const d=[];let u,f,m,v,b;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),m=0,e="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(O3.lastIndex=m,u=O3.exec(s),v=u&&u.index!==void 0?u.index:s.length,b=s.charCodeAt(v),!u){e=s.slice(m);break}if(b===10&&m===v&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<v&&(d.push(s.slice(m,v)),t+=v-m),b){case 0:{d.push(65533),t++;break}case 9:{for(f=Math.ceil(t/4)*4,d.push(-2);t++<f;)d.push(-1);break}case 10:{d.push(-4),t=1;break}default:r=!0,t=1}m=v+1}return c&&(r&&d.push(-5),e&&d.push(e),d.push(null)),d}}const Ite=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Pte(t){return t.replace(Ite,zte)}function zte(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return i6(n.slice(s?2:1),s?16:10)}return tS(n)||t}const m6={}.hasOwnProperty;function Bte(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),Fte(n)(jte(Ote(n).document().write(Lte()(t,e,!0))))}function Fte(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ae),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:s(te),blockQuote:s(me),characterEscape:Y,characterReference:Y,codeFenced:s(se),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(se,a),codeText:s(oe,a),codeTextData:Y,data:Y,codeFlowValue:Y,definition:s(ee),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Q),hardBreakEscape:s(he),hardBreakTrailing:s(he),htmlFlow:s(ie,a),htmlFlowData:Y,htmlText:s(ie,a),htmlTextData:Y,image:s(xe),label:a,link:s(Ae),listItem:s(mt),listItemValue:v,listOrdered:s(Ke,m),listUnordered:s(Ke),paragraph:s(Ye),reference:T,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(te),strong:s(Ze),thematicBreak:s(it)},exit:{atxHeading:d(),atxHeadingSequence:O,autolink:d(),autolinkEmail:ue,autolinkProtocol:ae,blockQuote:d(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:J,characterReference:re,codeFenced:d(C),codeFencedFence:x,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:L,codeIndented:d(k),codeText:d(H),codeTextData:L,data:L,definition:d(),definitionDestinationString:M,definitionLabelString:E,definitionTitleString:R,emphasis:d(),hardBreakEscape:d(V),hardBreakTrailing:d(V),htmlFlow:d(F),htmlFlowData:L,htmlText:d(U),htmlTextData:L,image:d(G),label:K,labelText:B,lineEnding:W,link:d(j),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:X,resourceDestinationString:A,resourceTitleString:I,resource:$,setextHeading:d(z),setextHeadingLineSequence:P,setextHeadingText:D,strong:d(),thematicBreak:d()}};p6(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ce){let Re={type:"root",children:[]};const Ue={stack:[Re],tokenStack:[],config:e,enter:c,exit:u,buffer:a,resume:f,data:n},Je=[];let Ve=-1;for(;++Ve<ce.length;)if(ce[Ve][1].type==="listOrdered"||ce[Ve][1].type==="listUnordered")if(ce[Ve][0]==="enter")Je.push(Ve);else{const ze=Je.pop();Ve=i(ce,ze,Ve)}for(Ve=-1;++Ve<ce.length;){const ze=e[ce[Ve][0]];m6.call(ze,ce[Ve][1].type)&&ze[ce[Ve][1].type].call(Object.assign({sliceSerialize:ce[Ve][2].sliceSerialize},Ue),ce[Ve][1])}if(Ue.tokenStack.length>0){const ze=Ue.tokenStack[Ue.tokenStack.length-1];(ze[1]||j3).call(Ue,void 0,ze[0])}for(Re.position={start:Ba(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Ba(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<e.transforms.length;)Re=e.transforms[Ve](Re)||Re;return Re}function i(ce,Re,Ue){let Je=Re-1,Ve=-1,ze=!1,He,Xe,ut,ft;for(;++Je<=Ue;){const rt=ce[Je];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Ve++:Ve--,ft=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(He&&!ft&&!Ve&&!ut&&(ut=Je),ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ft=void 0}if(!Ve&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Ve===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(He){let Tt=Je;for(Xe=void 0;Tt--;){const lt=ce[Tt];if(lt[1].type==="lineEnding"||lt[1].type==="lineEndingBlank"){if(lt[0]==="exit")continue;Xe&&(ce[Xe][1].type="lineEndingBlank",ze=!0),lt[1].type="lineEnding",Xe=Tt}else if(!(lt[1].type==="linePrefix"||lt[1].type==="blockQuotePrefix"||lt[1].type==="blockQuotePrefixWhitespace"||lt[1].type==="blockQuoteMarker"||lt[1].type==="listItemIndent"))break}ut&&(!Xe||ut<Xe)&&(He._spread=!0),He.end=Object.assign({},Xe?ce[Xe][1].start:rt[1].end),ce.splice(Xe||Je,0,["exit",He,rt[2]]),Je++,Ue++}if(rt[1].type==="listItemPrefix"){const Tt={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};He=Tt,ce.splice(Je,0,["enter",Tt,rt[2]]),Je++,Ue++,ut=void 0,ft=!0}}}return ce[Re][1]._spread=ze,Ue}function s(ce,Re){return Ue;function Ue(Je){c.call(this,ce(Je),Je),Re&&Re.call(this,Je)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(ce,Re,Ue){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Re,Ue||void 0]),ce.position={start:Ba(Re.start),end:void 0}}function d(ce){return Re;function Re(Ue){ce&&ce.call(this,Ue),u.call(this,Ue)}}function u(ce,Re){const Ue=this.stack.pop(),Je=this.tokenStack.pop();if(Je)Je[0].type!==ce.type&&(Re?Re.call(this,ce,Je[0]):(Je[1]||j3).call(this,ce,Je[0]));else throw new Error("Cannot close `"+ce.type+"` ("+hh({start:ce.start,end:ce.end})+"): it’s not open");Ue.position.end=Ba(ce.end)}function f(){return eS(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function v(ce){if(this.data.expectingFirstListItemValue){const Re=this.stack[this.stack.length-2];Re.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.lang=ce}function S(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.meta=ce}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ce.replace(/(\r?\n|\r)$/g,"")}function E(ce){const Re=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=Re,Ue.identifier=xs(this.sliceSerialize(ce)).toLowerCase()}function R(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.title=ce}function M(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.url=ce}function O(ce){const Re=this.stack[this.stack.length-1];if(!Re.depth){const Ue=this.sliceSerialize(ce).length;Re.depth=Ue}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function P(ce){const Re=this.stack[this.stack.length-1];Re.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(ce){const Ue=this.stack[this.stack.length-1].children;let Je=Ue[Ue.length-1];(!Je||Je.type!=="text")&&(Je=tt(),Je.position={start:Ba(ce.start),end:void 0},Ue.push(Je)),this.stack.push(Je)}function L(ce){const Re=this.stack.pop();Re.value+=this.sliceSerialize(ce),Re.position.end=Ba(ce.end)}function W(ce){const Re=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ue=Re.children[Re.children.length-1];Ue.position.end=Ba(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Re.type)&&(Y.call(this,ce),L.call(this,ce))}function V(){this.data.atHardBreak=!0}function F(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ce}function U(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ce}function H(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ce}function j(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Re,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function G(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Re,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function B(ce){const Re=this.sliceSerialize(ce),Ue=this.stack[this.stack.length-2];Ue.label=Pte(Re),Ue.identifier=xs(Re).toLowerCase()}function K(){const ce=this.stack[this.stack.length-1],Re=this.resume(),Ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ue.type==="link"){const Je=ce.children;Ue.children=Je}else Ue.alt=Re}function A(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.url=ce}function I(){const ce=this.resume(),Re=this.stack[this.stack.length-1];Re.title=ce}function $(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function X(ce){const Re=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=Re,Ue.identifier=xs(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function Z(ce){this.data.characterReferenceType=ce.type}function J(ce){const Re=this.sliceSerialize(ce),Ue=this.data.characterReferenceType;let Je;Ue?(Je=i6(Re,Ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Je=tS(Re);const Ve=this.stack[this.stack.length-1];Ve.value+=Je}function re(ce){const Re=this.stack.pop();Re.position.end=Ba(ce.end)}function ae(ce){L.call(this,ce);const Re=this.stack[this.stack.length-1];Re.url=this.sliceSerialize(ce)}function ue(ce){L.call(this,ce);const Re=this.stack[this.stack.length-1];Re.url="mailto:"+this.sliceSerialize(ce)}function me(){return{type:"blockquote",children:[]}}function se(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Q(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function he(){return{type:"break"}}function ie(){return{type:"html",value:""}}function xe(){return{type:"image",title:null,url:"",alt:null}}function Ae(){return{type:"link",title:null,url:"",children:[]}}function Ke(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function mt(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Ye(){return{type:"paragraph",children:[]}}function Ze(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function it(){return{type:"thematicBreak"}}}function Ba(t){return{line:t.line,column:t.column,offset:t.offset}}function p6(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?p6(t,r):Hte(t,r)}}function Hte(t,e){let n;for(n in e)if(m6.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function j3(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+hh({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+hh({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+hh({start:e.start,end:e.end})+") is still open")}function $te(t){const e=this;e.parser=n;function n(r){return Bte(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Ute(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function Wte(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
581
|
+
`}]}function Vte(t,e){const n=e.value?e.value+`
|
|
582
|
+
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function qte(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Kte(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Gte(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Vu(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,c=t.footnoteCounts.get(r);c===void 0?(c=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,c+=1,t.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,d);const u={type:"element",tagName:"sup",properties:{},children:[d]};return t.patch(e,u),t.applyData(e,u)}function Yte(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Xte(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function g6(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Qte(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return g6(t,e);const i={src:Vu(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function Zte(t,e){const n={src:Vu(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Jte(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function ene(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return g6(t,e);const i={href:Vu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function tne(t,e){const n={href:Vu(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function nne(t,e,n){const r=t.all(e),i=n?rne(n):v6(e),s={},a=[];if(typeof e.checked=="boolean"){const f=r[0];let m;f&&f.type==="element"&&f.tagName==="p"?m=f:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const f=r[c];(i||c!==0||f.type!=="element"||f.tagName!=="p")&&a.push({type:"text",value:`
|
|
583
|
+
`}),f.type==="element"&&f.tagName==="p"&&!i?a.push(...f.children):a.push(f)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
584
|
+
`});const u={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,u),t.applyData(e,u)}function rne(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=v6(n[r])}return e}function v6(t){const e=t.spread;return e??t.children.length>1}function ine(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function sne(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function one(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function ane(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function lne(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},c=Xx(e.children[1]),d=XD(e.children[e.children.length-1]);c&&d&&(a.position={start:c,end:d}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function cne(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,c=a?a.length:e.children.length;let d=-1;const u=[];for(;++d<c;){const m=e.children[d],v={},b=a?a[d]:void 0;b&&(v.align=b);let S={type:"element",tagName:s,properties:v,children:[]};m&&(S.children=t.all(m),t.patch(m,S),S=t.applyData(m,S)),u.push(S)}const f={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(e,f),t.applyData(e,f)}function une(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const L3=9,I3=32;function dne(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(P3(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(P3(e.slice(i),i>0,!1)),s.join("")}function P3(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===L3||s===I3;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===L3||s===I3;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function hne(t,e){const n={type:"text",value:dne(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function fne(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const mne={blockquote:Ute,break:Wte,code:Vte,delete:qte,emphasis:Kte,footnoteReference:Gte,heading:Yte,html:Xte,imageReference:Qte,image:Zte,inlineCode:Jte,linkReference:ene,link:tne,listItem:nne,list:ine,paragraph:sne,root:one,strong:ane,table:lne,tableCell:une,tableRow:cne,text:hne,thematicBreak:fne,toml:Im,yaml:Im,definition:Im,footnoteDefinition:Im};function Im(){}const b6=-1,Yg=0,mh=1,Qp=2,rS=3,iS=4,sS=5,oS=6,_6=7,y6=8,z3=typeof self=="object"?self:globalThis,pne=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case Yg:case b6:return n(a,i);case mh:{const c=n([],i);for(const d of a)c.push(r(d));return c}case Qp:{const c=n({},i);for(const[d,u]of a)c[r(d)]=r(u);return c}case rS:return n(new Date(a),i);case iS:{const{source:c,flags:d}=a;return n(new RegExp(c,d),i)}case sS:{const c=n(new Map,i);for(const[d,u]of a)c.set(r(d),r(u));return c}case oS:{const c=n(new Set,i);for(const d of a)c.add(r(d));return c}case _6:{const{name:c,message:d}=a;return n(new z3[c](d),i)}case y6:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:c}=new Uint8Array(a);return n(new DataView(c),a)}}return n(new z3[s](a),i)};return r},B3=t=>pne(new Map,t)(0),eu="",{toString:gne}={},{keys:vne}=Object,Vd=t=>{const e=typeof t;if(e!=="object"||!t)return[Yg,e];const n=gne.call(t).slice(8,-1);switch(n){case"Array":return[mh,eu];case"Object":return[Qp,eu];case"Date":return[rS,eu];case"RegExp":return[iS,eu];case"Map":return[sS,eu];case"Set":return[oS,eu];case"DataView":return[mh,n]}return n.includes("Array")?[mh,n]:n.includes("Error")?[_6,n]:[Qp,n]},Pm=([t,e])=>t===Yg&&(e==="function"||e==="symbol"),bne=(t,e,n,r)=>{const i=(a,c)=>{const d=r.push(a)-1;return n.set(c,d),d},s=a=>{if(n.has(a))return n.get(a);let[c,d]=Vd(a);switch(c){case Yg:{let f=a;switch(d){case"bigint":c=y6,f=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+d);f=null;break;case"undefined":return i([b6],a)}return i([c,f],a)}case mh:{if(d){let v=a;return d==="DataView"?v=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(v=new Uint8Array(a)),i([d,[...v]],a)}const f=[],m=i([c,f],a);for(const v of a)f.push(s(v));return m}case Qp:{if(d)switch(d){case"BigInt":return i([d,a.toString()],a);case"Boolean":case"Number":case"String":return i([d,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const f=[],m=i([c,f],a);for(const v of vne(a))(t||!Pm(Vd(a[v])))&&f.push([s(v),s(a[v])]);return m}case rS:return i([c,a.toISOString()],a);case iS:{const{source:f,flags:m}=a;return i([c,{source:f,flags:m}],a)}case sS:{const f=[],m=i([c,f],a);for(const[v,b]of a)(t||!(Pm(Vd(v))||Pm(Vd(b))))&&f.push([s(v),s(b)]);return m}case oS:{const f=[],m=i([c,f],a);for(const v of a)(t||!Pm(Vd(v)))&&f.push(s(v));return m}}const{message:u}=a;return i([c,{name:d,message:u}],a)};return s},F3=(t,{json:e,lossy:n}={})=>{const r=[];return bne(!(e||n),!!e,new Map,r)(t),r},Zp=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?B3(F3(t,e)):structuredClone(t):(t,e)=>B3(F3(t,e));function _ne(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function yne(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function xne(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||_ne,r=t.options.footnoteBackLabel||yne,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[d]);if(!u)continue;const f=t.all(u),m=String(u.identifier).toUpperCase(),v=Vu(m.toLowerCase());let b=0;const S=[],x=t.footnoteCounts.get(m);for(;x!==void 0&&++b<=x;){S.length>0&&S.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,b);typeof E=="string"&&(E={type:"text",value:E}),S.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,b),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const C=f[f.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const E=C.children[C.children.length-1];E&&E.type==="text"?E.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...S)}else f.push(...S);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+v},children:t.wrap(f,!0)};t.patch(u,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Zp(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
585
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(c,!0)},{type:"text",value:`
|
|
586
|
+
`}]}}const Xg=function(t){if(t==null)return kne;if(typeof t=="function")return Qg(t);if(typeof t=="object")return Array.isArray(t)?Sne(t):wne(t);if(typeof t=="string")return Cne(t);throw new Error("Expected function, string, or object as test")};function Sne(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Xg(t[n]);return Qg(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function wne(t){const e=t;return Qg(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function Cne(t){return Qg(e);function e(n){return n&&n.type===t}}function Qg(t){return e;function e(n,r,i){return!!(Ene(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function kne(){return!0}function Ene(t){return t!==null&&typeof t=="object"&&"type"in t}const x6=[],Rne=!0,iy=!1,Tne="skip";function S6(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=Xg(i),a=r?-1:1;c(t,void 0,[])();function c(d,u,f){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(d.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=x6,S,x,C;if((!e||s(d,u,f[f.length-1]||void 0))&&(b=Mne(n(d,f)),b[0]===iy))return b;if("children"in d&&d.children){const k=d;if(k.children&&b[0]!==Tne)for(x=(r?k.children.length:-1)+a,C=f.concat(k);x>-1&&x<k.children.length;){const E=k.children[x];if(S=c(E,x,C)(),S[0]===iy)return S;x=typeof S[1]=="number"?S[1]:x+a}}return b}}}function Mne(t){return Array.isArray(t)?t:typeof t=="number"?[Rne,t]:t==null?x6:[t]}function aS(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),S6(t,s,c,i);function c(d,u){const f=u[u.length-1],m=f?f.children.indexOf(d):void 0;return a(d,m,f)}}const sy={}.hasOwnProperty,Ane={};function Nne(t,e){const n=e||Ane,r=new Map,i=new Map,s=new Map,a={...mne,...n.handlers},c={all:u,applyData:One,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:d,options:n,patch:Dne,wrap:Lne};return aS(t,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const m=f.type==="definition"?r:i,v=String(f.identifier).toUpperCase();m.has(v)||m.set(v,f)}}),c;function d(f,m){const v=f.type,b=c.handlers[v];if(sy.call(c.handlers,v)&&b)return b(c,f,m);if(c.options.passThrough&&c.options.passThrough.includes(v)){if("children"in f){const{children:x,...C}=f,k=Zp(C);return k.children=c.all(f),k}return Zp(f)}return(c.options.unknownHandler||jne)(c,f,m)}function u(f){const m=[];if("children"in f){const v=f.children;let b=-1;for(;++b<v.length;){const S=c.one(v[b],f);if(S){if(b&&v[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=H3(S.value)),!Array.isArray(S)&&S.type==="element")){const x=S.children[0];x&&x.type==="text"&&(x.value=H3(x.value))}Array.isArray(S)?m.push(...S):m.push(S)}}}return m}}function Dne(t,e){t.position&&(e.position=yJ(t))}function One(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,Zp(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function jne(t,e){const n=e.data||{},r="value"in e&&!(sy.call(n,"hProperties")||sy.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Lne(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
587
|
+
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
588
|
+
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
589
|
+
`}),n}function H3(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function $3(t,e){const n=Nne(t,e),r=n.one(t,void 0),i=xne(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
590
|
+
`},i),s}function Ine(t,e){return t&&"run"in t?async function(n,r){const i=$3(n,{file:r,...e});await t.run(i,r)}:function(n,r){return $3(n,{file:r,...t||e})}}function U3(t){if(t)throw t}var Jb,W3;function Pne(){if(W3)return Jb;W3=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},s=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var f=t.call(u,"constructor"),m=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!m)return!1;var v;for(v in u);return typeof v>"u"||t.call(u,v)},a=function(u,f){n&&f.name==="__proto__"?n(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},c=function(u,f){if(f==="__proto__")if(t.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return Jb=function d(){var u,f,m,v,b,S,x=arguments[0],C=1,k=arguments.length,E=!1;for(typeof x=="boolean"&&(E=x,x=arguments[1]||{},C=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});C<k;++C)if(u=arguments[C],u!=null)for(f in u)m=c(x,f),v=c(u,f),x!==v&&(E&&v&&(s(v)||(b=i(v)))?(b?(b=!1,S=m&&i(m)?m:[]):S=m&&s(m)?m:{},a(x,{name:f,newValue:d(E,S,v)})):typeof v<"u"&&a(x,{name:f,newValue:v}));return x},Jb}var zne=Pne();const e1=tg(zne);function oy(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Bne(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);c(null,...i);function c(d,...u){const f=t[++s];let m=-1;if(d){a(d);return}for(;++m<i.length;)(u[m]===null||u[m]===void 0)&&(u[m]=i[m]);i=u,f?Fne(f,c)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function Fne(t,e){let n;return r;function r(...a){const c=t.length>a.length;let d;c&&a.push(i);try{d=t.apply(this,a)}catch(u){const f=u;if(c&&n)throw f;return i(f)}c||(d&&d.then&&typeof d.then=="function"?d.then(s,i):d instanceof Error?i(d):s(d))}function i(a,...c){n||(n=!0,e(a,...c))}function s(a){i(null,a)}}const qs={basename:Hne,dirname:$ne,extname:Une,join:Wne,sep:"/"};function Hne(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');tf(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,c=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),c>-1&&(t.codePointAt(i)===e.codePointAt(c--)?c<0&&(r=i):(c=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function $ne(t){if(tf(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Une(t){tf(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const c=t.codePointAt(e);if(c===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),c===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Wne(...t){let e=-1,n;for(;++e<t.length;)tf(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Vne(n)}function Vne(t){tf(t);const e=t.codePointAt(0)===47;let n=qne(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function qne(t,e){let n="",r=0,i=-1,s=0,a=-1,c,d;for(;++a<=t.length;){if(a<t.length)c=t.codePointAt(a);else{if(c===47)break;c=47}if(c===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else c===46&&s>-1?s++:s=-1}return n}function tf(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Kne={cwd:Gne};function Gne(){return"/"}function ay(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Yne(t){if(typeof t=="string")t=new URL(t);else if(!ay(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Xne(t)}function Xne(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const t1=["history","path","basename","stem","extname","dirname"];class w6{constructor(e){let n;e?ay(e)?n={path:e}:typeof e=="string"||Qne(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":Kne.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<t1.length;){const s=t1[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)t1.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?qs.basename(this.path):void 0}set basename(e){r1(e,"basename"),n1(e,"basename"),this.path=qs.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?qs.dirname(this.path):void 0}set dirname(e){V3(this.basename,"dirname"),this.path=qs.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?qs.extname(this.path):void 0}set extname(e){if(n1(e,"extname"),V3(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=qs.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ay(e)&&(e=Yne(e)),r1(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?qs.basename(this.path,this.extname):void 0}set stem(e){r1(e,"stem"),n1(e,"stem"),this.path=qs.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new zr(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function n1(t,e){if(t&&t.includes(qs.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+qs.sep+"`")}function r1(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function V3(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Qne(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Zne=function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Jne={}.hasOwnProperty;class lS extends Zne{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=Bne()}copy(){const e=new lS;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(e1(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(o1("data",this.frozen),this.namespace[e]=n,this):Jne.call(this.namespace,e)&&this.namespace[e]||void 0:e?(o1("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=zm(e),r=this.parser||this.Parser;return i1("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),i1("process",this.parser||this.Parser),s1("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const c=zm(e),d=r.parse(c);r.run(d,c,function(f,m,v){if(f||!m||!v)return u(f);const b=m,S=r.stringify(b,v);nre(S)?v.value=S:v.result=S,u(f,v)});function u(f,m){f||!m?a(f):s?s(m):n(void 0,m)}}}processSync(e){let n=!1,r;return this.freeze(),i1("processSync",this.parser||this.Parser),s1("processSync",this.compiler||this.Compiler),this.process(e,i),K3("processSync","process",n),r;function i(s,a){n=!0,U3(s),r=a}}run(e,n,r){q3(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,c){const d=zm(n);i.run(e,d,u);function u(f,m,v){const b=m||e;f?c(f):a?a(b):r(void 0,b,v)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),K3("runSync","run",r),i;function s(a,c){U3(a),i=c,r=!0}}stringify(e,n){this.freeze();const r=zm(n),i=this.compiler||this.Compiler;return s1("stringify",i),q3(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(o1("use",this.frozen),e!=null)if(typeof e=="function")d(e,n);else if(typeof e=="object")Array.isArray(e)?c(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(u){if(typeof u=="function")d(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...m]=u;d(f,m)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))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");c(u.plugins),u.settings&&(i.settings=e1(!0,i.settings,u.settings))}function c(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const m=u[f];s(m)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function d(u,f){let m=-1,v=-1;for(;++m<r.length;)if(r[m][0]===u){v=m;break}if(v===-1)r.push([u,...f]);else if(f.length>0){let[b,...S]=f;const x=r[v][1];oy(x)&&oy(b)&&(b=e1(!0,x,b)),r[v]=[u,b,...S]}}}}const ere=new lS().freeze();function i1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function s1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function o1(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function q3(t){if(!oy(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function K3(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function zm(t){return tre(t)?t:new w6(t)}function tre(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function nre(t){return typeof t=="string"||rre(t)}function rre(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ire="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",G3=[],Y3={allowDangerousHtml:!0},sre=/^(https?|ircs?|mailto|xmpp)$/i,ore=[{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 nf(t){const e=are(t),n=lre(t);return cre(e.runSync(e.parse(n),n),t)}function are(t){const e=t.rehypePlugins||G3,n=t.remarkPlugins||G3,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Y3}:Y3;return ere().use($te).use(n).use(Ine,r).use(e)}function lre(t){const e=t.children||"",n=new w6;return typeof e=="string"&&(n.value=e),n}function cre(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,c=e.unwrapDisallowed,d=e.urlTransform||ure;for(const f of ore)Object.hasOwn(e,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+ire+f.id,void 0);return aS(t,u),kJ(t,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function u(f,m,v){if(f.type==="raw"&&v&&typeof m=="number")return a?v.children.splice(m,1):v.children[m]={type:"text",value:f.value},m;if(f.type==="element"){let b;for(b in Xb)if(Object.hasOwn(Xb,b)&&Object.hasOwn(f.properties,b)){const S=f.properties[b],x=Xb[b];(x===null||x.includes(f.tagName))&&(f.properties[b]=d(String(S||""),b,f))}}if(f.type==="element"){let b=n?!n.includes(f.tagName):s?s.includes(f.tagName):!1;if(!b&&r&&typeof m=="number"&&(b=!r(f,m,v)),b&&v&&typeof m=="number")return c&&f.children?v.children.splice(m,1,...f.children):v.children.splice(m,1),m}}}function ure(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||sre.test(t.slice(0,e))?t:""}function X3(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function dre(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function hre(t,e,n){const i=Xg((n||{}).ignore||[]),s=fre(e);let a=-1;for(;++a<s.length;)S6(t,"text",c);function c(u,f){let m=-1,v;for(;++m<f.length;){const b=f[m],S=v?v.children:void 0;if(i(b,S?S.indexOf(b):void 0,v))return;v=b}if(v)return d(u,f)}function d(u,f){const m=f[f.length-1],v=s[a][0],b=s[a][1];let S=0;const C=m.children.indexOf(u);let k=!1,E=[];v.lastIndex=0;let R=v.exec(u.value);for(;R;){const M=R.index,O={index:R.index,input:R.input,stack:[...f,u]};let D=b(...R,O);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=M+1:(S!==M&&E.push({type:"text",value:u.value.slice(S,M)}),Array.isArray(D)?E.push(...D):D&&E.push(D),S=M+R[0].length,k=!0),!v.global)break;R=v.exec(u.value)}return k?(S<u.value.length&&E.push({type:"text",value:u.value.slice(S)}),m.children.splice(C,1,...E)):E=[u],C+E.length}}function fre(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([mre(i[0]),pre(i[1])])}return e}function mre(t){return typeof t=="string"?new RegExp(dre(t),"g"):t}function pre(t){return typeof t=="function"?t:function(){return t}}const a1="phrasing",l1=["autolink","link","image","label"];function gre(){return{transforms:[wre],enter:{literalAutolink:bre,literalAutolinkEmail:c1,literalAutolinkHttp:c1,literalAutolinkWww:c1},exit:{literalAutolink:Sre,literalAutolinkEmail:xre,literalAutolinkHttp:_re,literalAutolinkWww:yre}}}function vre(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:a1,notInConstruct:l1},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:a1,notInConstruct:l1},{character:":",before:"[ps]",after:"\\/",inConstruct:a1,notInConstruct:l1}]}}function bre(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function c1(t){this.config.enter.autolinkProtocol.call(this,t)}function _re(t){this.config.exit.autolinkProtocol.call(this,t)}function yre(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function xre(t){this.config.exit.autolinkEmail.call(this,t)}function Sre(t){this.exit(t)}function wre(t){hre(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Cre],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),kre]],{ignore:["link","linkReference"]})}function Cre(t,e,n,r,i){let s="";if(!C6(i)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!Ere(n)))return!1;const a=Rre(n+r);if(!a[0])return!1;const c={type:"link",title:null,url:s+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[c,{type:"text",value:a[1]}]:c}function kre(t,e,n,r){return!C6(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function Ere(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function Rre(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=X3(t,"(");let s=X3(t,")");for(;r!==-1&&i>s;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[t,n]}function C6(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||ec(n)||Kg(n))&&(!e||n!==47)}k6.peek=Ire;function Tre(){this.buffer()}function Mre(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Are(){this.buffer()}function Nre(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Dre(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xs(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Ore(t){this.exit(t)}function jre(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xs(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Lre(t){this.exit(t)}function Ire(){return"["}function k6(t,e,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),c=n.enter("reference");return s+=i.move(n.safe(n.associationId(t),{after:"]",before:s})),c(),a(),s+=i.move("]"),s}function Pre(){return{enter:{gfmFootnoteCallString:Tre,gfmFootnoteCall:Mre,gfmFootnoteDefinitionLabelString:Are,gfmFootnoteDefinition:Nre},exit:{gfmFootnoteCallString:Dre,gfmFootnoteCall:Ore,gfmFootnoteDefinitionLabelString:jre,gfmFootnoteDefinition:Lre}}}function zre(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:k6},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const c=s.createTracker(a);let d=c.move("[^");const u=s.enter("footnoteDefinition"),f=s.enter("label");return d+=c.move(s.safe(s.associationId(r),{before:d,after:"]"})),f(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((e?`
|
|
591
|
+
`:" ")+s.indentLines(s.containerFlow(r,c.current()),e?E6:Bre))),u(),d}}function Bre(t,e,n){return e===0?t:E6(t,e,n)}function E6(t,e,n){return(n?"":" ")+t}const Fre=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];R6.peek=Vre;function Hre(){return{canContainEols:["delete"],enter:{strikethrough:Ure},exit:{strikethrough:Wre}}}function $re(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Fre}],handlers:{delete:R6}}}function Ure(t){this.enter({type:"delete",children:[]},t)}function Wre(t){this.exit(t)}function R6(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(t,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function Vre(){return"~"}function qre(t){return t.length}function Kre(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||qre,s=[],a=[],c=[],d=[];let u=0,f=-1;for(;++f<t.length;){const x=[],C=[];let k=-1;for(t[f].length>u&&(u=t[f].length);++k<t[f].length;){const E=Gre(t[f][k]);if(n.alignDelimiters!==!1){const R=i(E);C[k]=R,(d[k]===void 0||R>d[k])&&(d[k]=R)}x.push(E)}a[f]=x,c[f]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<u;)s[m]=Q3(r[m]);else{const x=Q3(r);for(;++m<u;)s[m]=x}m=-1;const v=[],b=[];for(;++m<u;){const x=s[m];let C="",k="";x===99?(C=":",k=":"):x===108?C=":":x===114&&(k=":");let E=n.alignDelimiters===!1?1:Math.max(1,d[m]-C.length-k.length);const R=C+"-".repeat(E)+k;n.alignDelimiters!==!1&&(E=C.length+E+k.length,E>d[m]&&(d[m]=E),b[m]=E),v[m]=R}a.splice(1,0,v),c.splice(1,0,b),f=-1;const S=[];for(;++f<a.length;){const x=a[f],C=c[f];m=-1;const k=[];for(;++m<u;){const E=x[m]||"";let R="",M="";if(n.alignDelimiters!==!1){const O=d[m]-(C[m]||0),D=s[m];D===114?R=" ".repeat(O):D===99?O%2?(R=" ".repeat(O/2+.5),M=" ".repeat(O/2-.5)):(R=" ".repeat(O/2),M=R):M=" ".repeat(O)}n.delimiterStart!==!1&&!m&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||m)&&k.push(" "),n.alignDelimiters!==!1&&k.push(R),k.push(E),n.alignDelimiters!==!1&&k.push(M),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||m!==u-1)&&k.push("|")}S.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return S.join(`
|
|
592
|
+
`)}function Gre(t){return t==null?"":String(t)}function Q3(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function Yre(t,e,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(t,s.current()),Xre);return i(),a}function Xre(t,e,n){return">"+(n?"":" ")+t}function Qre(t,e){return Z3(t,e.inConstruct,!0)&&!Z3(t,e.notInConstruct,!1)}function Z3(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function J3(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
593
|
+
`&&Qre(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
594
|
+
`}function Zre(t,e){const n=String(t);let r=n.indexOf(e),i=r,s=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+e.length,r=n.indexOf(e,i);return a}function Jre(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function eie(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function tie(t,e,n,r){const i=eie(n),s=t.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Jre(t,n)){const m=n.enter("codeIndented"),v=n.indentLines(s,nie);return m(),v}const c=n.createTracker(r),d=i.repeat(Math.max(Zre(s,i)+1,3)),u=n.enter("codeFenced");let f=c.move(d);if(t.lang){const m=n.enter(`codeFencedLang${a}`);f+=c.move(n.safe(t.lang,{before:f,after:" ",encode:["`"],...c.current()})),m()}if(t.lang&&t.meta){const m=n.enter(`codeFencedMeta${a}`);f+=c.move(" "),f+=c.move(n.safe(t.meta,{before:f,after:`
|
|
595
|
+
`,encode:["`"],...c.current()})),m()}return f+=c.move(`
|
|
596
|
+
`),s&&(f+=c.move(s+`
|
|
597
|
+
`)),f+=c.move(d),u(),f}function nie(t,e,n){return(n?"":" ")+t}function cS(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function rie(t,e,n,r){const i=cS(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let u=d.move("[");return u+=d.move(n.safe(n.associationId(t),{before:u,after:"]",...d.current()})),u+=d.move("]: "),c(),!t.url||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),u+=d.move("<"),u+=d.move(n.safe(t.url,{before:u,after:">",...d.current()})),u+=d.move(">")):(c=n.enter("destinationRaw"),u+=d.move(n.safe(t.url,{before:u,after:t.title?" ":`
|
|
598
|
+
`,...d.current()}))),c(),t.title&&(c=n.enter(`title${s}`),u+=d.move(" "+i),u+=d.move(n.safe(t.title,{before:u,after:i,...d.current()})),u+=d.move(i),c()),a(),u}function iie(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Mh(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Jp(t,e,n){const r=Eu(t),i=Eu(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}T6.peek=sie;function T6(t,e,n,r){const i=iie(n),s=n.enter("emphasis"),a=n.createTracker(r),c=a.move(i);let d=a.move(n.containerPhrasing(t,{after:i,before:c,...a.current()}));const u=d.charCodeAt(0),f=Jp(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(d=Mh(u)+d.slice(1));const m=d.charCodeAt(d.length-1),v=Jp(r.after.charCodeAt(0),m,i);v.inside&&(d=d.slice(0,-1)+Mh(m));const b=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:v.outside,before:f.outside},c+d+b}function sie(t,e,n){return n.options.emphasis||"*"}function oie(t,e){let n=!1;return aS(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,iy}),!!((!t.depth||t.depth<3)&&eS(t)&&(e.options.setext||n))}function aie(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(r);if(oie(t,n)){const f=n.enter("headingSetext"),m=n.enter("phrasing"),v=n.containerPhrasing(t,{...s.current(),before:`
|
|
599
|
+
`,after:`
|
|
600
|
+
`});return m(),f(),v+`
|
|
601
|
+
`+(i===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
602
|
+
`))+1))}const a="#".repeat(i),c=n.enter("headingAtx"),d=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(t,{before:"# ",after:`
|
|
603
|
+
`,...s.current()});return/^[\t ]/.test(u)&&(u=Mh(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),d(),c(),u}M6.peek=lie;function M6(t){return t.value||""}function lie(){return"<"}A6.peek=cie;function A6(t,e,n,r){const i=cS(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let u=d.move("![");return u+=d.move(n.safe(t.alt,{before:u,after:"]",...d.current()})),u+=d.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),u+=d.move("<"),u+=d.move(n.safe(t.url,{before:u,after:">",...d.current()})),u+=d.move(">")):(c=n.enter("destinationRaw"),u+=d.move(n.safe(t.url,{before:u,after:t.title?" ":")",...d.current()}))),c(),t.title&&(c=n.enter(`title${s}`),u+=d.move(" "+i),u+=d.move(n.safe(t.title,{before:u,after:i,...d.current()})),u+=d.move(i),c()),u+=d.move(")"),a(),u}function cie(){return"!"}N6.peek=uie;function N6(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let a=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const u=n.safe(t.alt,{before:d,after:"]",...c.current()});d+=c.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:d,after:"]",...c.current()});return a(),n.stack=f,s(),i==="full"||!u||u!==m?d+=c.move(m+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function uie(){return"!"}D6.peek=die;function D6(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],c=n.compilePattern(a);let d;if(a.atBreak)for(;d=c.exec(r);){let u=d.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(d.index+1)}}return i+r+i}function die(){return"`"}function O6(t,e){const n=eS(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}j6.peek=hie;function j6(t,e,n,r){const i=cS(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let c,d;if(O6(t,n)){const f=n.stack;n.stack=[],c=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(t,{before:m,after:">",...a.current()})),m+=a.move(">"),c(),n.stack=f,m}c=n.enter("link"),d=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(t,{before:u,after:"](",...a.current()})),u+=a.move("]("),d(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(d=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(t.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(d=n.enter("destinationRaw"),u+=a.move(n.safe(t.url,{before:u,after:t.title?" ":")",...a.current()}))),d(),t.title&&(d=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(t.title,{before:u,after:i,...a.current()})),u+=a.move(i),d()),u+=a.move(")"),c(),u}function hie(t,e,n){return O6(t,n)?"<":"["}L6.peek=fie;function L6(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let a=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const u=n.containerPhrasing(t,{before:d,after:"]",...c.current()});d+=c.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:d,after:"]",...c.current()});return a(),n.stack=f,s(),i==="full"||!u||u!==m?d+=c.move(m+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function fie(){return"["}function uS(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function mie(t){const e=uS(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function pie(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function I6(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function gie(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=t.ordered?pie(n):uS(n);const c=t.ordered?a==="."?")":".":mie(n);let d=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const f=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),I6(n)===a&&f){let m=-1;for(;++m<t.children.length;){const v=t.children[m];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(a=c),n.bulletCurrent=a;const u=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function vie(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function bie(t,e,n,r){const i=vie(n);let s=n.bulletCurrent||uS(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const c=n.createTracker(r);c.move(s+" ".repeat(a-s.length)),c.shift(a);const d=n.enter("listItem"),u=n.indentLines(n.containerFlow(t,c.current()),f);return d(),u;function f(m,v,b){return v?(b?"":" ".repeat(a))+m:(b?s:s+" ".repeat(a-s.length))+m}}function _ie(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(t,r);return s(),i(),a}const yie=Xg(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function xie(t,e,n,r){return(t.children.some(function(a){return yie(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function Sie(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}P6.peek=wie;function P6(t,e,n,r){const i=Sie(n),s=n.enter("strong"),a=n.createTracker(r),c=a.move(i+i);let d=a.move(n.containerPhrasing(t,{after:i,before:c,...a.current()}));const u=d.charCodeAt(0),f=Jp(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(d=Mh(u)+d.slice(1));const m=d.charCodeAt(d.length-1),v=Jp(r.after.charCodeAt(0),m,i);v.inside&&(d=d.slice(0,-1)+Mh(m));const b=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:v.outside,before:f.outside},c+d+b}function wie(t,e,n){return n.options.strong||"*"}function Cie(t,e,n,r){return n.safe(t.value,r)}function kie(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function Eie(t,e,n){const r=(I6(n)+(n.options.ruleSpaces?" ":"")).repeat(kie(n));return n.options.ruleSpaces?r.slice(0,-1):r}const z6={blockquote:Yre,break:J3,code:tie,definition:rie,emphasis:T6,hardBreak:J3,heading:aie,html:M6,image:A6,imageReference:N6,inlineCode:D6,link:j6,linkReference:L6,list:gie,listItem:bie,paragraph:_ie,root:xie,strong:P6,text:Cie,thematicBreak:Eie};function Rie(){return{enter:{table:Tie,tableData:eR,tableHeader:eR,tableRow:Aie},exit:{codeText:Nie,table:Mie,tableData:u1,tableHeader:u1,tableRow:u1}}}function Tie(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function Mie(t){this.exit(t),this.data.inTable=void 0}function Aie(t){this.enter({type:"tableRow",children:[]},t)}function u1(t){this.exit(t)}function eR(t){this.enter({type:"tableCell",children:[]},t)}function Nie(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Die));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function Die(t,e){return e==="|"?e:t}function Oie(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
604
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:a,tableCell:d,tableRow:c}};function a(b,S,x,C){return u(f(b,x,C),b.align)}function c(b,S,x,C){const k=m(b,x,C),E=u([k]);return E.slice(0,E.indexOf(`
|
|
605
|
+
`))}function d(b,S,x,C){const k=x.enter("tableCell"),E=x.enter("phrasing"),R=x.containerPhrasing(b,{...C,before:s,after:s});return E(),k(),R}function u(b,S){return Kre(b,{align:S,alignDelimiters:r,padding:n,stringLength:i})}function f(b,S,x){const C=b.children;let k=-1;const E=[],R=S.enter("table");for(;++k<C.length;)E[k]=m(C[k],S,x);return R(),E}function m(b,S,x){const C=b.children;let k=-1;const E=[],R=S.enter("tableRow");for(;++k<C.length;)E[k]=d(C[k],b,S,x);return R(),E}function v(b,S,x){let C=z6.inlineCode(b,S,x);return x.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function jie(){return{exit:{taskListCheckValueChecked:tR,taskListCheckValueUnchecked:tR,paragraph:Iie}}}function Lie(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Pie}}}function tR(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function Iie(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,a;for(;++s<i.length;){const c=i[s];if(c.type==="paragraph"){a=c;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function Pie(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",c=n.createTracker(r);s&&c.move(a);let d=z6.listItem(t,e,n,{...r,...c.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),d;function u(f){return f+a}}function zie(){return[gre(),Pre(),Hre(),Rie(),jie()]}function Bie(t){return{extensions:[vre(),zre(t),$re(),Oie(t),Lie()]}}const Fie={tokenize:qie,partial:!0},B6={tokenize:Kie,partial:!0},F6={tokenize:Gie,partial:!0},H6={tokenize:Yie,partial:!0},Hie={tokenize:Xie,partial:!0},$6={name:"wwwAutolink",tokenize:Wie,previous:W6},U6={name:"protocolAutolink",tokenize:Vie,previous:V6},ta={name:"emailAutolink",tokenize:Uie,previous:q6},io={};function $ie(){return{text:io}}let jl=48;for(;jl<123;)io[jl]=ta,jl++,jl===58?jl=65:jl===91&&(jl=97);io[43]=ta;io[45]=ta;io[46]=ta;io[95]=ta;io[72]=[ta,U6];io[104]=[ta,U6];io[87]=[ta,$6];io[119]=[ta,$6];function Uie(t,e,n){const r=this;let i,s;return a;function a(m){return!ly(m)||!q6.call(r,r.previous)||dS(r.events)?n(m):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),c(m))}function c(m){return ly(m)?(t.consume(m),c):m===64?(t.consume(m),d):n(m)}function d(m){return m===46?t.check(Hie,f,u)(m):m===45||m===95||Ir(m)?(s=!0,t.consume(m),d):f(m)}function u(m){return t.consume(m),i=!0,d}function f(m){return s&&i&&Gr(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(m)):n(m)}}function Wie(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!W6.call(r,r.previous)||dS(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(Fie,t.attempt(B6,t.attempt(F6,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function Vie(t,e,n){const r=this;let i="",s=!1;return a;function a(m){return(m===72||m===104)&&V6.call(r,r.previous)&&!dS(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(m),t.consume(m),c):n(m)}function c(m){if(Gr(m)&&i.length<5)return i+=String.fromCodePoint(m),t.consume(m),c;if(m===58){const v=i.toLowerCase();if(v==="http"||v==="https")return t.consume(m),d}return n(m)}function d(m){return m===47?(t.consume(m),s?u:(s=!0,d)):n(m)}function u(m){return m===null||Xp(m)||un(m)||ec(m)||Kg(m)?n(m):t.attempt(B6,t.attempt(F6,f),n)(m)}function f(m){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(m)}}function qie(t,e,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),i):a===46&&r===3?(t.consume(a),s):n(a)}function s(a){return a===null?n(a):e(a)}}function Kie(t,e,n){let r,i,s;return a;function a(u){return u===46||u===95?t.check(H6,d,c)(u):u===null||un(u)||ec(u)||u!==45&&Kg(u)?d(u):(s=!0,t.consume(u),a)}function c(u){return u===95?r=!0:(i=r,r=void 0),t.consume(u),a}function d(u){return i||r||!s?n(u):e(u)}}function Gie(t,e){let n=0,r=0;return i;function i(a){return a===40?(n++,t.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(H6,e,s)(a):a===null||un(a)||ec(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function Yie(t,e,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(t.consume(c),r):c===38?(t.consume(c),s):c===93?(t.consume(c),i):c===60||c===null||un(c)||ec(c)?e(c):n(c)}function i(c){return c===null||c===40||c===91||un(c)||ec(c)?e(c):r(c)}function s(c){return Gr(c)?a(c):n(c)}function a(c){return c===59?(t.consume(c),r):Gr(c)?(t.consume(c),a):n(c)}}function Xie(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Ir(s)?n(s):e(s)}}function W6(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||un(t)}function V6(t){return!Gr(t)}function q6(t){return!(t===47||ly(t))}function ly(t){return t===43||t===45||t===46||t===95||Ir(t)}function dS(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Qie={tokenize:sse,partial:!0};function Zie(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:nse,continuation:{tokenize:rse},exit:ise}},text:{91:{name:"gfmFootnoteCall",tokenize:tse},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Jie,resolveTo:ese}}}}function Jie(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const d=r.events[i][1];if(d.type==="labelImage"){a=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!a||!a._balanced)return n(d);const u=xs(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(d):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),e(d))}}function ese(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...c),t}function tse(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return c;function c(m){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(t.enter("gfmFootnoteCallMarker"),t.consume(m),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(m){if(s>999||m===93&&!a||m===null||m===91||un(m))return n(m);if(m===93){t.exit("chunkString");const v=t.exit("gfmFootnoteCallString");return i.includes(xs(r.sliceSerialize(v)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(m)}return un(m)||(a=!0),s++,t.consume(m),m===92?f:u}function f(m){return m===91||m===92||m===93?(t.consume(m),s++,u):u(m)}}function nse(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,c;return d;function d(S){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(S){return S===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(S)}function f(S){if(a>999||S===93&&!c||S===null||S===91||un(S))return n(S);if(S===93){t.exit("chunkString");const x=t.exit("gfmFootnoteDefinitionLabelString");return s=xs(r.sliceSerialize(x)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),v}return un(S)||(c=!0),a++,t.consume(S),S===92?m:f}function m(S){return S===91||S===92||S===93?(t.consume(S),a++,f):f(S)}function v(S){return S===58?(t.enter("definitionMarker"),t.consume(S),t.exit("definitionMarker"),i.includes(s)||i.push(s),Vt(t,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return e(S)}}function rse(t,e,n){return t.check(ef,e,t.attempt(Qie,e,n))}function ise(t){t.exit("gfmFootnoteDefinition")}function sse(t,e,n){const r=this;return Vt(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(s):n(s)}}function ose(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,c){let d=-1;for(;++d<a.length;)if(a[d][0]==="enter"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._close){let u=d;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[d][1].end.offset-a[d][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[d][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[d][1].end)},m={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[d][1].start)},v=[["enter",f,c],["enter",a[u][1],c],["exit",a[u][1],c],["enter",m,c]],b=c.parser.constructs.insideSpan.null;b&&Oi(v,v.length,0,Gg(b,a.slice(u+1,d),c)),Oi(v,v.length,0,[["exit",m,c],["enter",a[d][1],c],["exit",a[d][1],c],["exit",f,c]]),Oi(a,u-1,d-u+3,v),d=u+v.length-2;break}}for(d=-1;++d<a.length;)a[d][1].type==="strikethroughSequenceTemporary"&&(a[d][1].type="data");return a}function s(a,c,d){const u=this.previous,f=this.events;let m=0;return v;function v(S){return u===126&&f[f.length-1][1].type!=="characterEscape"?d(S):(a.enter("strikethroughSequenceTemporary"),b(S))}function b(S){const x=Eu(u);if(S===126)return m>1?d(S):(a.consume(S),m++,b);if(m<2&&!n)return d(S);const C=a.exit("strikethroughSequenceTemporary"),k=Eu(S);return C._open=!k||k===2&&!!x,C._close=!x||x===2&&!!k,c(S)}}}class ase{constructor(){this.map=[]}add(e,n,r){lse(this,e,n,r)}consume(e){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function lse(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function cse(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function use(){return{flow:{null:{name:"table",tokenize:dse,resolveAll:hse}}}}function dse(t,e,n){const r=this;let i=0,s=0,a;return c;function c(L){let W=r.events.length-1;for(;W>-1;){const U=r.events[W][1].type;if(U==="lineEnding"||U==="linePrefix")W--;else break}const V=W>-1?r.events[W][1].type:null,F=V==="tableHead"||V==="tableRow"?D:d;return F===D&&r.parser.lazy[r.now().line]?n(L):F(L)}function d(L){return t.enter("tableHead"),t.enter("tableRow"),u(L)}function u(L){return L===124||(a=!0,s+=1),f(L)}function f(L){return L===null?n(L):bt(L)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),b):n(L):zt(L)?Vt(t,f,"whitespace")(L):(s+=1,a&&(a=!1,i+=1),L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),a=!0,f):(t.enter("data"),m(L)))}function m(L){return L===null||L===124||un(L)?(t.exit("data"),f(L)):(t.consume(L),L===92?v:m)}function v(L){return L===92||L===124?(t.consume(L),m):m(L)}function b(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(t.enter("tableDelimiterRow"),a=!1,zt(L)?Vt(t,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):S(L))}function S(L){return L===45||L===58?C(L):L===124?(a=!0,t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),x):O(L)}function x(L){return zt(L)?Vt(t,C,"whitespace")(L):C(L)}function C(L){return L===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),k):L===45?(s+=1,k(L)):L===null||bt(L)?M(L):O(L)}function k(L){return L===45?(t.enter("tableDelimiterFiller"),E(L)):O(L)}function E(L){return L===45?(t.consume(L),E):L===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),R):(t.exit("tableDelimiterFiller"),R(L))}function R(L){return zt(L)?Vt(t,M,"whitespace")(L):M(L)}function M(L){return L===124?S(L):L===null||bt(L)?!a||i!==s?O(L):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(L)):O(L)}function O(L){return n(L)}function D(L){return t.enter("tableRow"),P(L)}function P(L){return L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),P):L===null||bt(L)?(t.exit("tableRow"),e(L)):zt(L)?Vt(t,P,"whitespace")(L):(t.enter("data"),z(L))}function z(L){return L===null||L===124||un(L)?(t.exit("data"),P(L)):(t.consume(L),L===92?Y:z)}function Y(L){return L===92||L===124?(t.consume(L),z):z(L)}}function hse(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],c=!1,d=0,u,f,m;const v=new ase;for(;++n<t.length;){const b=t[n],S=b[1];b[0]==="enter"?S.type==="tableHead"?(c=!1,d!==0&&(nR(v,e,d,u,f),f=void 0,d=0),u={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",u,e]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,m=void 0,s=[0,0,0,0],a=[0,n+1,0,0],c&&(c=!1,f={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",f,e]])),i=S.type==="tableDelimiterRow"?2:f?3:1):i&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],m=Bm(v,e,s,i,void 0,m),s=[0,0,0,0]),a[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],m=Bm(v,e,s,i,void 0,m)),s=a,a=[s[1],n,0,0])):S.type==="tableHead"?(c=!0,d=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(d=n,s[1]!==0?(a[0]=a[1],m=Bm(v,e,s,i,n,m)):a[1]!==0&&(m=Bm(v,e,a,i,n,m)),i=0):i&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(a[3]=n)}for(d!==0&&nR(v,e,d,u,f),v.consume(e.events),n=-1;++n<e.events.length;){const b=e.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=cse(e.events,n))}return t}function Bm(t,e,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},nu(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const d=nu(e.events,n[1]);if(s={type:a,start:Object.assign({},d),end:Object.assign({},d)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const u=nu(e.events,n[2]),f=nu(e.events,n[3]),m={type:c,start:Object.assign({},u),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",m,e]]),r!==2){const v=e.events[n[2]],b=e.events[n[3]];if(v[1].end=Object.assign({},b[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,x=n[3]-n[2]-1;t.add(S,x,[])}}t.add(n[3]+1,0,[["exit",m,e]])}return i!==void 0&&(s.end=Object.assign({},nu(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function nR(t,e,n,r,i){const s=[],a=nu(e.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,e])),r.end=Object.assign({},a),s.push(["exit",r,e]),t.add(n+1,0,s)}function nu(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const fse={name:"tasklistCheck",tokenize:pse};function mse(){return{text:{91:fse}}}function pse(t,e,n){const r=this;return i;function i(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),s)}function s(d){return un(d)?(t.enter("taskListCheckValueUnchecked"),t.consume(d),t.exit("taskListCheckValueUnchecked"),a):d===88||d===120?(t.enter("taskListCheckValueChecked"),t.consume(d),t.exit("taskListCheckValueChecked"),a):n(d)}function a(d){return d===93?(t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),c):n(d)}function c(d){return bt(d)?e(d):zt(d)?t.check({tokenize:gse},e,n)(d):n(d)}}function gse(t,e,n){return Vt(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function vse(t){return r6([$ie(),Zie(),ose(t),use(),mse()])}const bse={};function rf(t){const e=this,n=t||bse,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(vse(n)),s.push(zie()),a.push(Bie(n))}function _se(t){const e=ke.c(11),{content:n,attachments:r}=t,[i,s]=_.useState(null),a=(r==null?void 0:r.filter(Sse))??[],c=(r==null?void 0:r.filter(xse))??[],d=a.find(k=>k.id===i)??null;_.useEffect(()=>{d||s(null)},[d]);const u="flex gap-2 justify-end",f="max-w-[85%] sm:max-w-[80%] min-w-0 rounded-[20px] py-1.5 px-3.5 bg-muted text-primary border border-border prose prose-sm prose-invert break-words [overflow-wrap:anywhere] [&_p]:whitespace-pre-line",m=c.length?g.jsx("div",{className:"mb-2 flex flex-col gap-2 max-w-[420px]",children:c.map(yse)}):null,v=a.length?g.jsx("div",{className:"mb-2 grid max-w-[420px] grid-cols-2 gap-2",children:a.map(k=>g.jsxs("button",{type:"button",className:"overflow-hidden rounded-lg border border-border/80 bg-background/70 text-left cursor-zoom-in",onClick:()=>s(k.id),children:[g.jsx("img",{src:k.previewUrl,alt:k.name,className:"h-full max-h-[220px] w-full object-cover"}),g.jsx("div",{className:"border-t border-border/60 px-2 py-1 text-[11px] text-muted-foreground",children:k.name})]},k.id))}):null;let b;e[0]!==n?(b=n.trim()?g.jsx(nf,{remarkPlugins:[rf],components:Zh(),children:n}):null,e[0]=n,e[1]=b):b=e[1];let S;e[2]!==m||e[3]!==v||e[4]!==b?(S=g.jsx("div",{className:u,children:g.jsxs("div",{className:f,children:[m,v,b]})}),e[2]=m,e[3]=v,e[4]=b,e[5]=S):S=e[5];let x;e[6]!==d?(x=d?g.jsx("button",{type:"button",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4 cursor-zoom-out",onClick:()=>s(null),children:g.jsx("img",{src:d.previewUrl,alt:d.name,className:"max-h-full max-w-full rounded-xl shadow-2xl"})}):null,e[6]=d,e[7]=x):x=e[7];let C;return e[8]!==S||e[9]!==x?(C=g.jsxs(g.Fragment,{children:[S,x]}),e[8]=S,e[9]=x,e[10]=C):C=e[10],C}function yse(t){return g.jsxs("a",{href:t.previewUrl,target:"_blank",rel:"noreferrer",className:"flex items-center gap-3 rounded-lg border border-border/80 bg-background/70 px-3 py-2 no-underline transition-colors hover:bg-background",children:[g.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:g.jsx(ag,{className:"h-5 w-5"})}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"truncate text-sm text-foreground",children:t.name}),g.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[Math.max(1,Math.round(t.sizeBytes/1024))," KB"]})]})]},t.id)}function xse(t){return t.type==="document"||t.type==="text"}function Sse(t){return t.type==="image"}function wse(t){const e=ke.c(2),{json:n}=t;let r;return e[0]!==n?(r=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:n})})}),e[0]=n,e[1]=r):r=e[1],r}function K6(t){const e=ke.c(22),{title:n,count:r,children:i,badge:s}=t,[a,c]=_.useState(!1);if(r===0)return null;let d;e[0]!==a?(d=()=>c(!a),e[0]=a,e[1]=d):d=e[1];const u=a&&"rotate-90";let f;e[2]!==u?(f=Ce("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",u),e[2]=u,e[3]=f):f=e[3];let m;e[4]!==f?(m=g.jsx(Ni,{className:f}),e[4]=f,e[5]=m):m=e[5];let v;e[6]!==n?(v=g.jsx("span",{className:"text-muted-foreground font-medium",children:n}),e[6]=n,e[7]=v):v=e[7];let b;e[8]!==r?(b=g.jsx("span",{className:"text-muted-foreground/60",children:r}),e[8]=r,e[9]=b):b=e[9];let S;e[10]!==s||e[11]!==d||e[12]!==m||e[13]!==v||e[14]!==b?(S=g.jsxs("button",{onClick:d,className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[m,v,b,s]}),e[10]=s,e[11]=d,e[12]=m,e[13]=v,e[14]=b,e[15]=S):S=e[15];let x;e[16]!==i||e[17]!==a?(x=a&&g.jsx("div",{className:"ml-5",children:i}),e[16]=i,e[17]=a,e[18]=x):x=e[18];let C;return e[19]!==S||e[20]!==x?(C=g.jsxs("div",{className:"flex flex-col gap-1.5",children:[S,x]}),e[19]=S,e[20]=x,e[21]=C):C=e[21],C}function d1(t){const e=ke.c(13),{title:n,items:r,icon:i,getIcon:s}=t;if(r.length===0)return null;const a=r.length;let c;if(e[0]!==s||e[1]!==i||e[2]!==r){let f;e[4]!==s||e[5]!==i?(f=m=>g.jsx(zD,{icon:s?s(m):i,children:m},m),e[4]=s,e[5]=i,e[6]=f):f=e[6],c=r.map(f),e[0]=s,e[1]=i,e[2]=r,e[3]=c}else c=e[3];let d;e[7]!==c?(d=g.jsx("div",{className:"flex flex-wrap gap-1.5",children:c}),e[7]=c,e[8]=d):d=e[8];let u;return e[9]!==r.length||e[10]!==d||e[11]!==n?(u=g.jsx(K6,{title:n,count:a,children:d}),e[9]=r.length,e[10]=d,e[11]=n,e[12]=u):u=e[12],u}function Cse(t){const e=t.match(/^mcp__([^_]+)__(.+)$/);return e?{server:e[1],tool:e[2]}:null}function G6(t){const e=ke.c(4),{status:n}=t,r=n==="connected"?"bg-emerald-500":n==="pending"?"bg-yellow-500":"bg-red-500";let i;e[0]!==r?(i=Ce("inline-block h-2 w-2 rounded-full shrink-0",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==i?(s=g.jsx("span",{className:i}),e[2]=i,e[3]=s):s=e[3],s}function kse(t){switch(t){case"connected":return"Connected";case"failed":return"Failed";case"needs-auth":return"Needs auth";case"pending":return"Connecting...";case"disabled":return"Disabled";default:return t}}function Y6(t){const e=ke.c(38),{server:n}=t,[r,i]=_.useState(!1),s=n.status==="connected";let a;e[0]!==s||e[1]!==r||e[2]!==n.tools?(a=()=>s&&n.tools.length>0&&i(!r),e[0]=s,e[1]=r,e[2]=n.tools,e[3]=a):a=e[3];const c=s&&n.tools.length>0&&"cursor-pointer hover:opacity-60 transition-opacity";let d;e[4]!==c?(d=Ce("flex items-center gap-1.5",c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==s||e[7]!==r||e[8]!==n.tools?(u=s&&n.tools.length>0&&g.jsx(Ni,{className:Ce("h-3 w-3 text-muted-foreground transition-transform duration-200",r&&"rotate-90")}),e[6]=s,e[7]=r,e[8]=n.tools,e[9]=u):u=e[9];let f;e[10]!==n.status?(f=g.jsx(G6,{status:n.status}),e[10]=n.status,e[11]=f):f=e[11];let m;e[12]!==n.name?(m=B1(n.name),e[12]=n.name,e[13]=m):m=e[13];let v;e[14]!==m?(v=g.jsx("span",{className:"text-muted-foreground font-medium",children:m}),e[14]=m,e[15]=v):v=e[15];let b;e[16]!==s||e[17]!==n.status||e[18]!==n.tools?(b=s?g.jsxs("span",{className:"text-muted-foreground/50",children:[n.tools.length," tools"]}):g.jsx("span",{className:"text-muted-foreground/50",children:kse(n.status)}),e[16]=s,e[17]=n.status,e[18]=n.tools,e[19]=b):b=e[19];let S;e[20]!==a||e[21]!==d||e[22]!==u||e[23]!==f||e[24]!==v||e[25]!==b?(S=g.jsxs("button",{onClick:a,className:d,children:[u,f,v,b]}),e[20]=a,e[21]=d,e[22]=u,e[23]=f,e[24]=v,e[25]=b,e[26]=S):S=e[26];let x;e[27]!==s||e[28]!==n.error?(x=!s&&n.error&&g.jsx("span",{className:"text-destructive ml-5",children:n.error}),e[27]=s,e[28]=n.error,e[29]=x):x=e[29];let C;e[30]!==r||e[31]!==n.name||e[32]!==n.tools?(C=r&&n.tools.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5 ml-5",children:n.tools.map(E=>g.jsx(zD,{icon:PD(`mcp__${n.name}__${E}`),children:E},E))}),e[30]=r,e[31]=n.name,e[32]=n.tools,e[33]=C):C=e[33];let k;return e[34]!==x||e[35]!==C||e[36]!==S?(k=g.jsxs("div",{className:"flex flex-col gap-1.5",children:[S,x,C]}),e[34]=x,e[35]=C,e[36]=S,e[37]=k):k=e[37],k}function Ese(t){const e=ke.c(18),{servers:n}=t;if(n.length===0)return null;let r,i,s,a,c,d,u;if(e[0]!==n){const v=n.filter(Ase),b=n.filter(Mse),S=b.length>0?g.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[g.jsx(G6,{status:"failed"}),g.jsxs("span",{className:"text-muted-foreground/60",children:[b.length," disconnected"]})]}):null;r=K6,c="MCP Servers",d=n.length,u=S,i="flex flex-col gap-2",s=v.map(Tse),a=b.map(Rse),e[0]=n,e[1]=r,e[2]=i,e[3]=s,e[4]=a,e[5]=c,e[6]=d,e[7]=u}else r=e[1],i=e[2],s=e[3],a=e[4],c=e[5],d=e[6],u=e[7];let f;e[8]!==i||e[9]!==s||e[10]!==a?(f=g.jsxs("div",{className:i,children:[s,a]}),e[8]=i,e[9]=s,e[10]=a,e[11]=f):f=e[11];let m;return e[12]!==r||e[13]!==c||e[14]!==d||e[15]!==u||e[16]!==f?(m=g.jsx(r,{title:c,count:d,badge:u,children:f}),e[12]=r,e[13]=c,e[14]=d,e[15]=u,e[16]=f,e[17]=m):m=e[17],m}function Rse(t){return g.jsx(Y6,{server:t},t.name)}function Tse(t){return g.jsx(Y6,{server:t},t.name)}function Mse(t){return t.status!=="connected"}function Ase(t){return t.status==="connected"}function Nse(t){const e=ke.c(16),{rawJson:n}=t,[r,i]=_.useState(!1);let s;e[0]!==r?(s=()=>i(!r),e[0]=r,e[1]=s):s=e[1];const a=r&&"rotate-90";let c;e[2]!==a?(c=Ce("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",a),e[2]=a,e[3]=c):c=e[3];let d;e[4]!==c?(d=g.jsx(Ni,{className:c}),e[4]=c,e[5]=d):d=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=g.jsx("span",{className:"text-muted-foreground font-medium",children:"Raw Message"}),e[6]=u):u=e[6];let f;e[7]!==s||e[8]!==d?(f=g.jsxs("button",{onClick:s,className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[d,u]}),e[7]=s,e[8]=d,e[9]=f):f=e[9];let m;e[10]!==r||e[11]!==n?(m=r&&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:n}),e[10]=r,e[11]=n,e[12]=m):m=e[12];let v;return e[13]!==f||e[14]!==m?(v=g.jsxs("div",{className:"flex flex-col gap-1.5",children:[f,m]}),e[13]=f,e[14]=m,e[15]=v):v=e[15],v}function Dse(t){const e=ke.c(30),{message:n,rawJson:r}=t;let i,s;if(e[0]!==n.mcpServers||e[1]!==n.tools){const M=new Map;i=[];for(const O of n.tools){const D=Cse(O);if(D){const P=M.get(D.server)||[];P.push(D.tool),M.set(D.server,P)}else i.push(O)}s=n.mcpServers.map(O=>({name:O.name,status:O.status,error:O.error,tools:M.get(O.name)||[]})),e[0]=n.mcpServers,e[1]=n.tools,e[2]=i,e[3]=s}else i=e[2],s=e[3];const a=s;let c;e[4]!==i||e[5]!==a?(c={coreTools:i,mcpServersWithTools:a},e[4]=i,e[5]=a,e[6]=c):c=e[6];const{coreTools:d,mcpServersWithTools:u}=c;let f;e[7]!==n.model?(f=g.jsx(wZ,{children:n.model}),e[7]=n.model,e[8]=f):f=e[8];let m;e[9]!==d?(m=g.jsx(d1,{title:"Tools",items:d,getIcon:Ose}),e[9]=d,e[10]=m):m=e[10];let v;e[11]!==n.agents?(v=g.jsx(d1,{title:"Agents",items:n.agents,icon:xy}),e[11]=n.agents,e[12]=v):v=e[12];let b;e[13]!==n.slashCommands?(b=g.jsx(d1,{title:"Commands",items:n.slashCommands,icon:e4}),e[13]=n.slashCommands,e[14]=b):b=e[14];let S;e[15]!==u?(S=g.jsx(Ese,{servers:u}),e[15]=u,e[16]=S):S=e[16];let x;e[17]!==r?(x=r&&g.jsx(Nse,{rawJson:r}),e[17]=r,e[18]=x):x=e[18];let C;e[19]!==f||e[20]!==m||e[21]!==v||e[22]!==b||e[23]!==S||e[24]!==x?(C=g.jsx(Qh,{className:"my-4 text-xs",children:g.jsxs("div",{className:"flex flex-col gap-3",children:[f,m,v,b,S,x]})}),e[19]=f,e[20]=m,e[21]=v,e[22]=b,e[23]=S,e[24]=x,e[25]=C):C=e[25];let k,E;e[26]===Symbol.for("react.memo_cache_sentinel")?(k=g.jsx(jP,{className:"h-5 w-5 text-logo"}),E=g.jsx(Yo,{children:"Session Started"}),e[26]=k,e[27]=E):(k=e[26],E=e[27]);let R;return e[28]!==C?(R=g.jsx(ea,{children:g.jsxs(Xh,{expandedContent:C,children:[k,E]})}),e[28]=C,e[29]=R):R=e[29],R}function Ose(t){return X_[t]??ID}function jse(t){const e=ke.c(8),{message:n}=t;let r;e[0]!==n.accountInfo?(r=JSON.stringify(n.accountInfo,null,2),e[0]=n.accountInfo,e[1]=r):r=e[1];let i;e[2]!==r?(i=g.jsx(Qh,{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:r})}),e[2]=r,e[3]=i):i=e[3];let s,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=g.jsx("div",{className:"size-5 flex justify-center items-center ",children:g.jsx(xy,{className:"h-4 w-4 text-muted-foreground"})}),a=g.jsx(Yo,{children:"Account"}),e[4]=s,e[5]=a):(s=e[4],a=e[5]);let c;return e[6]!==i?(c=g.jsx(ea,{className:"hidden",children:g.jsxs(Xh,{expandedContent:i,children:[s,a]})}),e[6]=i,e[7]=c):c=e[7],c}function Lse(t){const e=ke.c(4),{message:n,isStreaming:r}=t;let i,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[rf],s=Zh(),e[0]=i,e[1]=s):(i=e[0],s=e[1]);let a;return e[2]!==n.text?(a=g.jsx("div",{className:"text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-full min-w-0 break-words [overflow-wrap:anywhere] space-y-4",children:g.jsx(nf,{remarkPlugins:i,components:s,children:n.text})}),e[2]=n.text,e[3]=a):a=e[3],a}function Ise(t){const e=ke.c(8),{message:n}=t;let r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=[rf],i=Zh(),e[0]=r,e[1]=i):(r=e[0],i=e[1]);let s;e[2]!==n.text?(s=g.jsx(Qh,{className:"my-4 text-sm text-muted-foreground/90",children:g.jsx("div",{className:"text-pretty prose prose-sm max-w-full px-0.5 opacity-90 dark:prose-invert",children:g.jsx(nf,{remarkPlugins:r,components:i,children:n.text})})}),e[2]=n.text,e[3]=s):s=e[3];let a,c;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(Gn,{className:"h-4 w-4 text-muted-icon"}),c=g.jsx(Yo,{className:"text-left text-muted-foreground",children:"Thinking"}),e[4]=a,e[5]=c):(a=e[4],c=e[5]);let d;return e[6]!==s?(d=g.jsx(ea,{className:"w-full",children:g.jsxs(Xh,{expandedContent:s,children:[a,c]})}),e[6]=s,e[7]=d):d=e[7],d}function Pse(t,e){return e<=0?0:Math.max(0,Math.min(100,(t+1)/e*100))}function zse(t){const e=ke.c(17),{question:n,currentIndex:r,totalQuestions:i,onBack:s,children:a}=t,c=s&&r>0;let d;e[0]!==r||e[1]!==s||e[2]!==c||e[3]!==i?(d=c?g.jsx("button",{onClick:s,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:g.jsx(GR,{className:"h-4 w-4 -ml-0.5",strokeWidth:3})}):i>1?g.jsxs("span",{className:"font-bold text-muted-foreground whitespace-nowrap",children:[r+1," of ",i]}):null,e[0]=r,e[1]=s,e[2]=c,e[3]=i,e[4]=d):d=e[4];let u;e[5]!==n||e[6]!==d?(u=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:[d,n]}),e[5]=n,e[6]=d,e[7]=u):u=e[7];let f;e[8]!==r||e[9]!==i?(f=i>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:`${Pse(r,i)}%`}})}),e[8]=r,e[9]=i,e[10]=f):f=e[10];let m;e[11]!==u||e[12]!==f?(m=g.jsxs("div",{className:"relative",children:[u,f]}),e[11]=u,e[12]=f,e[13]=m):m=e[13];let v;return e[14]!==a||e[15]!==m?(v=g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[m,a]}),e[14]=a,e[15]=m,e[16]=v):v=e[16],v}function rR(t){const e=ke.c(7),{label:n,description:r}=t;let i;e[0]!==n?(i=g.jsx("span",{className:"text-foreground text-sm",children:n}),e[0]=n,e[1]=i):i=e[1];let s;e[2]!==r?(s=r&&g.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:r}),e[2]=r,e[3]=s):s=e[3];let a;return e[4]!==i||e[5]!==s?(a=g.jsxs(g.Fragment,{children:[i,s]}),e[4]=i,e[5]=s,e[6]=a):a=e[6],a}function X6(t){const e=ke.c(10),{selected:n,multiSelect:r,onClick:i}=t,s=r?"rounded":"rounded-full",a=n?"border-slate-500/0 bg-foreground":"border-muted-foreground/50 bg-background",c=i&&n&&"cursor-pointer";let d;e[0]!==s||e[1]!==a||e[2]!==c?(d=Ce("flex-shrink-0 w-5 h-5 border-1 flex items-center justify-center",s,a,c),e[0]=s,e[1]=a,e[2]=c,e[3]=d):d=e[3];let u;e[4]!==n?(u=n&&g.jsx(di,{strokeWidth:3,className:"translate-y-[0.5px] h-3 w-3 text-white dark:text-background"}),e[4]=n,e[5]=u):u=e[5];let f;return e[6]!==i||e[7]!==d||e[8]!==u?(f=g.jsx("button",{type:"button",onClick:i,className:d,children:u}),e[6]=i,e[7]=d,e[8]=u,e[9]=f):f=e[9],f}function Bse(t){const e=ke.c(23),{option:n,selected:r,multiSelect:i,onClick:s,isLast:a}=t,c=a?"":"border-b border-border";if(s){let m;e[0]!==c?(m=Ce("w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",c,"transition-all cursor-pointer"),e[0]=c,e[1]=m):m=e[1];let v;e[2]!==n.description||e[3]!==n.label?(v=g.jsx("div",{className:"flex-1 min-w-0",children:g.jsx(rR,{label:n.label,description:n.description})}),e[2]=n.description,e[3]=n.label,e[4]=v):v=e[4];let b;e[5]!==i||e[6]!==r?(b=g.jsx(X6,{selected:r,multiSelect:i}),e[5]=i,e[6]=r,e[7]=b):b=e[7];let S;e[8]!==v||e[9]!==b?(S=g.jsxs("div",{className:"flex items-center justify-between gap-3",children:[v,b]}),e[8]=v,e[9]=b,e[10]=S):S=e[10];let x;return e[11]!==s||e[12]!==m||e[13]!==S?(x=g.jsx("button",{onClick:s,className:m,children:S}),e[11]=s,e[12]=m,e[13]=S,e[14]=x):x=e[14],x}let d;e[15]!==c?(d=Ce("w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",c),e[15]=c,e[16]=d):d=e[16];let u;e[17]!==n.description||e[18]!==n.label?(u=g.jsx(rR,{label:n.label,description:n.description}),e[17]=n.description,e[18]=n.label,e[19]=u):u=e[19];let f;return e[20]!==d||e[21]!==u?(f=g.jsx("div",{className:d,children:u}),e[20]=d,e[21]=u,e[22]=f):f=e[22],f}function Fse(t){return t==null?void 0:t.answers}function ph(t){return t?Object.values(t).some(e=>e.length>0):!1}function Hse(t,e){return ph(t)?t:ph(e)?e:t??e??{}}function gs(t){return t.id||t.question}function $se({message:t,onSubmit:e,isLatest:n}){var B,K;const r=t.input.questions,i=!!t.result,s=Fse(t.result),a=((B=t.result)==null?void 0:B.discarded)===!0,[c,d]=_.useState(0),[u,f]=_.useState({}),[m,v]=_.useState({}),[b,S]=_.useState(s??null),[x,C]=_.useState(i),[k,E]=_.useState(!1);_.useEffect(()=>{if(!t.result){S(null),C(!1);return}if(!ph(s)||a){S(null),C(!1);return}ph(s)&&(S(s),C(!0))},[a,t.result,s]);const R=(A,I)=>{var J;const $=(J=m[A])==null?void 0:J.trim(),T=u[A]||"",X=I||r.find(re=>gs(re)===A);if(X!=null&&X.multiSelect)return[T,$].filter(Boolean).flatMap(re=>re.split(", ").filter(Boolean));const Z=$||T;return Z?[Z]:[]},M=A=>{const I=u[gs(A)]||"";return A.multiSelect?I.split(", ").filter(Boolean):[I]},O=(A,I)=>{const $=gs(A);if(A.multiSelect){const T=u[$]?u[$].split(", ").filter(Boolean):[],X=T.includes(I)?T.filter(Z=>Z!==I):[...T,I];f({...u,[$]:X.join(", ")})}else f({...u,[$]:I}),v({...m,[$]:""}),c<r.length-1&&setTimeout(()=>d(c+1),150)},D=(A,I)=>{const $=gs(A);v({...m,[$]:I}),I&&!A.multiSelect&&f({...u,[$]:""})},P=A=>{const I=gs(A);A.multiSelect&&m[I]&&v({...m,[I]:""})},z=r.every(A=>R(gs(A),A).length>0),Y=r[c],L=c===r.length-1,W=Y&&R(gs(Y),Y).length>0,V=()=>{c<r.length-1&&d(c+1)},F=()=>{c>0&&d(c-1)},U=async()=>{if(!z||k)return;const A={};for(const I of r){const $=gs(I);A[$]=R($,I)}E(!0);try{await e(t.toolId,r,A),S(A),C(!0)}catch{S(null),C(!1)}finally{E(!1)}},H=A=>{if(A.key==="Enter"&&!(!Y||!W||k)){if(A.preventDefault(),L){U();return}V()}};if(x||i){const A=a||!ph(s)?{}:Hse(s,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:a?"Discarded":"Answers"})]}),r.map((I,$)=>{const T=A[gs(I)]||A[I.question]||[],X=$===r.length-1;return g.jsxs("div",{className:Ce("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!X&&"border-b border-border"),children:[g.jsx("div",{className:"text-sm text-pretty",children:I.question}),T.length>0&&g.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:T.join(", ")}),T.length===0&&g.jsx("div",{className:"text-sm font-medium text-right italic",children:a?"Discarded":"No Response"})]},gs(I))})]})})}if(!n)return g.jsx("div",{className:"w-full py-2",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(XR,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!Y)return null;const j=M(Y),G=m[gs(Y)]||"";return g.jsxs("div",{className:"w-full space-y-3",children:[g.jsxs(zse,{question:Y.question,currentIndex:c,totalQuestions:r.length,onBack:c>0?F:void 0,children:[(K=Y.options)==null?void 0:K.map(A=>g.jsx(Bse,{option:A,selected:j.includes(A.label),multiSelect:Y.multiSelect,onClick:()=>O(Y,A.label)},A.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:G,onChange:A=>D(Y,A.target.value),onKeyDown:H,placeholder:"Other...",className:"flex-1 px-3 !py-1 pl-4 min-h-[55px] min-w-0 text-base md:text-sm bg-transparent outline-none text-foreground placeholder:text-muted-foreground"}),g.jsx(X6,{selected:!!G,multiSelect:Y.multiSelect,onClick:Y.multiSelect&&G?()=>P(Y):void 0})]})})]}),g.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!L&&W&&(Y.multiSelect||!!G)&&g.jsx(vt,{size:"sm",onClick:V,children:"Next"}),L&&g.jsx(vt,{size:"sm",onClick:()=>void U(),disabled:!z||k,className:Ce((!z||k)&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}function Use(t){const e=ke.c(27);let n,r,i,s,a,c,d,u,f;e[0]!==t?({to:u,onNavigate:s,replace:c,children:n,className:r,disabled:d,variant:f,size:a,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=c,e[7]=d,e[8]=u,e[9]=f):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],d=e[7],u=e[8],f=e[9]);const m=c===void 0?!1:c,v=d===void 0?!1:d;let b;e[10]!==v||e[11]!==s?(b=function(M){if(v){M.preventDefault(),M.stopPropagation();return}s==null||s()},e[10]=v,e[11]=s,e[12]=b):b=e[12];const S=b,x=v||void 0,C=v?-1:void 0;let k;e[13]!==r||e[14]!==v||e[15]!==a||e[16]!==f?(k=Ce(v4({variant:f,size:a}),v&&"cursor-not-allowed opacity-50",r),e[13]=r,e[14]=v,e[15]=a,e[16]=f,e[17]=k):k=e[17];let E;return e[18]!==n||e[19]!==S||e[20]!==i||e[21]!==m||e[22]!==x||e[23]!==C||e[24]!==k||e[25]!==u?(E=g.jsx(Dh,{...i,to:u,replace:m,onClick:S,"aria-disabled":x,tabIndex:C,className:k,children:n}),e[18]=n,e[19]=S,e[20]=i,e[21]=m,e[22]=x,e[23]=C,e[24]=k,e[25]=u,e[26]=E):E=e[26],E}function Wse(t){const e=ke.c(8),{level:n,className:r}=t,i=n==="paid"?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300";let s;e[0]!==r||e[1]!==i?(s=Ce("inline-flex items-center rounded-full border px-2.5 py-1 text-[11px] font-medium",i,r),e[0]=r,e[1]=i,e[2]=s):s=e[2];let a;e[3]!==n?(a=kx(n),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==s||e[6]!==a?(c=g.jsx("span",{className:s,children:a}),e[5]=s,e[6]=a,e[7]=c):c=e[7],c}async function Vse(t){const e=await new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{if(typeof i.result=="string"){n(i.result);return}r(new Error("Failed to read image attachment"))},i.onerror=()=>r(i.error??new Error("Failed to read image attachment")),i.readAsDataURL(t)});return{type:"image",name:t.name,mimeType:t.type,sizeBytes:t.size,dataUrl:e}}function Fm(t){return String(t).padStart(2,"0")}function qse(t,e=new Date){const n=t?new Date(t):null,r=n&&!Number.isNaN(n.getTime())?n:e;return["kaizen-plan",`${r.getFullYear()}-${Fm(r.getMonth()+1)}-${Fm(r.getDate())}`,`${Fm(r.getHours())}-${Fm(r.getMinutes())}.md`].join("-")}function Kse(t){const e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.position="fixed",e.style.opacity="0",e.style.pointerEvents="none",document.body.appendChild(e),e.focus(),e.select();const n=document.execCommand("copy");return document.body.removeChild(e),n}function iR(){const t=ke.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=g.jsx("div",{className:"my-1 h-px bg-border","aria-hidden":"true"}),t[0]=e):e=t[0],e}function sR(t){const e=ke.c(2),{children:n}=t;let r;return e[0]!==n?(r=g.jsx("div",{className:"px-3 py-1 text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Hm(t){const e=ke.c(13),{icon:n,label:r,onSelect:i,disabled:s}=t,a=s===void 0?!1:s,c=a?"cursor-not-allowed text-muted-foreground/60":"text-foreground hover:bg-accent";let d;e[0]!==c?(d=Ce("flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm transition-colors",c),e[0]=c,e[1]=d):d=e[1];let u;e[2]!==a||e[3]!==i?(u=v=>{v.preventDefault(),v.stopPropagation(),a||i==null||i()},e[2]=a,e[3]=i,e[4]=u):u=e[4];let f;e[5]!==r?(f=g.jsx("span",{children:r}),e[5]=r,e[6]=f):f=e[6];let m;return e[7]!==a||e[8]!==n||e[9]!==d||e[10]!==u||e[11]!==f?(m=g.jsxs("button",{type:"button",className:d,onClick:u,disabled:a,children:[n,f]}),e[7]=a,e[8]=n,e[9]=d,e[10]=u,e[11]=f,e[12]=m):m=e[12],m}function Gse(t){const e=ke.c(5),{onNavigate:n}=t,r=Yr();let i;e[0]!==r.pathname?(i=r.pathname.startsWith("/settings"),e[0]=r.pathname,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=g.jsx(Use,{variant:"outline",size:"sm",className:"w-full",to:aq,replace:i,onNavigate:n,children:"Open Account"}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function oR(t){const e=ke.c(5),{renderAccountAction:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=g.jsx(Wse,{level:"account"}),e[0]=r):r=e[0];let i;e[1]!==n?(i=n(Yse),e[1]=n,e[2]=i):i=e[2];let s;return e[3]!==i?(s=g.jsxs(g.Fragment,{children:[r,i]}),e[3]=i,e[4]=s):s=e[4],s}function Yse(){}function Xse(t){const e=ke.c(7);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];const{remoteAuth:r}=Hu();let i;e[2]!==r?(i=Bg(r),e[2]=r,e[3]=i):i=e[3];const s=i;let a;return e[4]!==s.features.handoff.enabled||e[5]!==n?(a=g.jsx(Zse,{...n,handoffEnabled:s.features.handoff.enabled,renderAccountAction:Qse}),e[4]=s.features.handoff.enabled,e[5]=n,e[6]=a):a=e[6],a}function Qse(t){return g.jsx(Gse,{onNavigate:t})}function Zse({message:t,onConfirm:e,onHandoff:n,isLatest:r,isActionable:i=r,availableProviders:s,handoffPendingStatus:a=null,handoffEnabled:c,renderAccountAction:d}){const u=!!t.result,[f,m]=_.useState(!1),[v,b]=_.useState(!1),[S,x]=_.useState(!1),[C,k]=_.useState(""),[E,R]=_.useState([]),[M,O]=_.useState(null),[D,P]=_.useState(!1),[z,Y]=_.useState(null),[L,W]=_.useState(null),[V,F]=_.useState(!1),[U,H]=_.useState(null),j=_.useRef(null),G=_.useRef(null),B=_.useRef(null),K=t.input,A=hr.planHandoff(t.toolId,"idle"),I=QV(L??A),$=a??I,T=$!==null,X=z==="suggest_edits",Z=z!==null,J=pK(ie=>ie.entries),re=new Set(s.map(ie=>ie.id)),ae=J.filter(ie=>re.has(ie.provider));_.useEffect(()=>{S&&j.current&&j.current.focus()},[S]),_.useEffect(()=>()=>{for(const ie of E)URL.revokeObjectURL(ie.previewUrl);B.current&&clearTimeout(B.current)},[E]);const ue=async()=>{var ie;if(K!=null&&K.plan)try{if((ie=navigator.clipboard)!=null&&ie.writeText)await navigator.clipboard.writeText(K.plan);else if(!Kse(K.plan))throw new Error("Clipboard copy failed");b(!0),ru("Plan copied to clipboard."),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>b(!1),2e3)}catch{ru("Failed to copy plan.")}},me=_.useCallback(()=>{if(!(K!=null&&K.plan))return;const ie=new Blob([K.plan],{type:"text/markdown;charset=utf-8"}),xe=URL.createObjectURL(ie),Ae=document.createElement("a");Ae.href=xe,Ae.download=qse(t.timestamp),Ae.click(),URL.revokeObjectURL(xe)},[K==null?void 0:K.plan,t.timestamp]),se=_.useCallback(async ie=>{if(!(K!=null&&K.plan)||L!==null)return;const xe=hr.planHandoff(t.toolId,ie.id);W(xe);try{await Ho(xe,()=>n(t.toolId,K.plan,ie),{statusLabel:"Starting new chat..."}),F(!1),H(null)}catch(Ae){throw F(!1),H(null),Ae}finally{W(Ae=>Ae===xe?null:Ae)}},[L,K==null?void 0:K.plan,t.toolId,n]),oe=_.useCallback(ie=>{const xe=ie.filter(Ae=>Ae.type.startsWith("image/"));if(xe.length===0){O("Only PNG, JPEG, WEBP, and GIF images are supported.");return}R(Ae=>{const Ke=[...Ae];let mt=null;for(const Ye of xe){if(!Ap.includes(Ye.type)){mt=`Unsupported image type: ${Ye.type||"unknown"}`;continue}if(Ye.size<=0||Ye.size>IT){mt=`${Ye.name} is empty or larger than 10 MB.`;continue}if(Ke.length>=Mp){mt=`You can attach up to ${Mp} images per message.`;break}Ke.push({id:Ai(),file:Ye,name:Ye.name||"image",mimeType:Ye.type,sizeBytes:Ye.size,previewUrl:URL.createObjectURL(Ye)})}return O(mt),Ke})},[]),ee=_.useCallback(ie=>{R(xe=>{const Ae=xe.find(Ke=>Ke.id===ie);return Ae&&URL.revokeObjectURL(Ae.previewUrl),xe.filter(Ke=>Ke.id!==ie)}),O(null)},[]),Q=async()=>{if(!C.trim()&&E.length===0)return;const ie=hr.planRespond(t.toolId,"suggest_edits");Y("suggest_edits");try{const xe=E.length?await Promise.all(E.map(Ae=>Vse(Ae.file))):void 0;await Ho(ie,()=>e(t.toolId,!1,void 0,C.trim(),xe),{statusLabel:"Sending edits..."})}finally{Y(xe=>xe==="suggest_edits"?null:xe)}},te=u?t.result:null,he=(te==null?void 0:te.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:[(K==null?void 0:K.plan)&&g.jsx(vt,{type:"button",variant:"ghost",size:"icon",className:Ce("absolute top-2 right-2 z-10 h-8 w-8 rounded-md text-muted-foreground opacity-100 transition-opacity",!v&&"md:opacity-0 md:group-hover/plan:opacity-100",!v&&"hover:text-foreground",v&&"hover:!bg-transparent hover:!border-transparent"),onClick:ie=>{ie.preventDefault(),ie.stopPropagation(),ue()},"aria-label":v?"Plan copied":"Copy plan",title:v?"Plan copied":"Copy plan",children:v?g.jsx(di,{className:"h-4 w-4 text-green-400"}):g.jsx(lu,{className:"h-4 w-4"})}),g.jsxs("div",{className:Ce("!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",u&&!f?"max-h-[min(400px,40vh)] ":"",u?"hover:!pb-[32px]":""),children:[u&&g.jsxs(vt,{type:"button",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:ie=>{ie.preventDefault(),ie.stopPropagation(),m(!f)},children:[f?"Show Less":"Show More",g.jsx(og,{className:`size-3.5 transition-transform ${f?"rotate-180":""}`})]}),K!=null&&K.plan?g.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[g.jsx(nf,{remarkPlugins:[rf],components:Zh(),children:K.plan}),g.jsx("div",{className:"mt-5"})]}):g.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),u?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:he?"Discarded":te!=null&&te.clearContext?"Approved & Cleared Context":te!=null&&te.confirmed?"Approved":te!=null&&te.message?`Adjusted: "${te.message}"`:"Adjusted Plan"}),g.jsx(n8,{className:"inline h-4 w-4 ml-1.5 -mt-0.5"})]})}):r?i?g.jsxs("div",{className:"flex flex-col gap-3",children:[!S&&g.jsx("div",{className:"flex flex-col gap-2 mx-2 md:flex-row md:items-center md:justify-between",children:T?g.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-border bg-muted px-3 py-2 text-sm text-muted-foreground dark:bg-card",children:[g.jsx(Fn,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),g.jsx("span",{children:$})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex items-center gap-2",children:K!=null&&K.plan?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"hidden items-center gap-2 md:flex",children:g.jsxs(Qy,{open:V,onOpenChange:F,children:[g.jsx(Zy,{asChild:!0,children:g.jsx(vt,{type:"button",size:"icon",variant:"outline",className:"rounded-full","aria-label":"More plan actions",title:"More plan actions",disabled:T,children:g.jsx(pk,{className:"h-4 w-4"})})}),g.jsxs(kg,{align:"start",className:"w-64 p-1.5",children:[g.jsx(Hm,{icon:v?g.jsx(di,{className:"h-4 w-4 text-green-400"}):g.jsx(lu,{className:"h-4 w-4"}),label:v?"Copied":"Copy",onSelect:()=>void ue(),disabled:T}),g.jsx(Hm,{icon:g.jsx(mk,{className:"h-4 w-4"}),label:"Download .md",onSelect:me,disabled:T}),g.jsx(iR,{}),g.jsx(sR,{children:"Hand Off to..."}),c?ae.length>0?ae.map(ie=>g.jsx(Hm,{icon:L===hr.planHandoff(t.toolId,ie.id)?g.jsx(Fn,{className:"h-4 w-4 animate-spin"}):g.jsx(qr,{className:"h-4 w-4"}),label:L===hr.planHandoff(t.toolId,ie.id)?"Starting new chat...":ie.label,onSelect:()=>{se(ie)},disabled:L!==null},ie.id)):g.jsx(Hm,{icon:g.jsx(qr,{className:"h-4 w-4"}),label:"No Hand Off entries configured",disabled:!0}):g.jsx("div",{className:"rounded-lg border border-border px-3 py-2",children:g.jsx(oR,{renderAccountAction:ie=>d(()=>{ie(),F(!1)})})})]})]})}),g.jsxs("div",{className:"md:hidden",children:[g.jsx(vt,{type:"button",size:"icon",variant:"outline",className:"rounded-full","aria-label":"More plan actions",title:"More plan actions",disabled:T,onClick:ie=>{const xe=ie.currentTarget.getBoundingClientRect();H({x:xe.left,y:xe.bottom+4})},children:g.jsx(pk,{className:"h-4 w-4"})}),g.jsxs(Ag,{open:U!==null,onOpenChange:ie=>{ie||H(null)},position:U,children:[g.jsxs(Za,{onSelect:()=>{H(null),ue()},children:[g.jsx(lu,{className:"h-4 w-4"}),g.jsx("span",{children:"Copy"})]}),g.jsxs(Za,{onSelect:()=>{H(null),me()},children:[g.jsx(mk,{className:"h-4 w-4"}),g.jsx("span",{children:"Download .md"})]}),g.jsx(iR,{}),g.jsx(sR,{children:"Hand Off to..."}),c?ae.length>0?ae.map(ie=>g.jsxs(Za,{onSelect:()=>{se(ie)},children:[L===hr.planHandoff(t.toolId,ie.id)?g.jsx(Fn,{className:"h-4 w-4 animate-spin"}):g.jsx(qr,{className:"h-4 w-4"}),g.jsx("span",{children:L===hr.planHandoff(t.toolId,ie.id)?"Starting new chat...":ie.label})]},ie.id)):g.jsx("div",{className:"px-3 py-2 text-xs font-medium text-muted-foreground/60",children:"No Hand Off entries configured"}):g.jsx("div",{className:"px-3 py-2",children:g.jsx(oR,{renderAccountAction:ie=>d(()=>{ie(),H(null)})})})]})]})]}):null}),g.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2",children:[g.jsxs(vt,{type:"button",size:"sm",onClick:()=>{const ie=hr.planRespond(t.toolId,"approve_clear");Y("approve_clear"),Ho(ie,()=>e(t.toolId,!0,!0),{statusLabel:"Approving and clearing context..."}).finally(()=>{Y(xe=>xe==="approve_clear"?null:xe)})},className:"rounded-full bg-primary text-primary-foreground pr-4 md:order-last",disabled:Z,children:[z==="approve_clear"?g.jsx(Fn,{className:"h-4 w-4 mr-1.5 animate-spin"}):g.jsx(PP,{className:"h-4 w-4 mr-1.5"}),z==="approve_clear"?"Clearing...":"Approve & Clear"]}),g.jsxs("div",{className:"flex items-stretch md:items-center gap-2 md:contents",children:[g.jsxs(vt,{type:"button",size:"sm",variant:"outline",onClick:()=>x(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",disabled:Z,children:[X?g.jsx(Fn,{className:"h-4 w-4 mr-1.5 animate-spin"}):g.jsx(Ul,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),g.jsxs(vt,{type:"button",size:"sm",variant:"outline",onClick:()=>{const ie=hr.planRespond(t.toolId,"approve");Y("approve"),Ho(ie,()=>e(t.toolId,!0),{statusLabel:"Approving plan..."}).finally(()=>{Y(xe=>xe==="approve"?null:xe)})},className:"rounded-full border-border flex-1 md:flex-initial",disabled:Z,children:[z==="approve"?g.jsx(Fn,{className:"h-4 w-4 mr-1.5 animate-spin"}):g.jsx(di,{className:"h-4 w-4 mr-1.5"}),z==="approve"?"Approving...":"Approve"]})]})]})]})}),S&&g.jsxs("div",{className:Ce("flex flex-col gap-2 rounded-2xl border bg-muted dark:bg-card px-4 py-3 transition-colors",D?"border-foreground/40 bg-muted/80":"border-border"),onDragEnter:ie=>{ie.dataTransfer.types.includes("Files")&&(ie.preventDefault(),P(!0))},onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&(ie.preventDefault(),ie.dataTransfer.dropEffect="copy",P(!0))},onDragLeave:ie=>{if(!ie.dataTransfer.types.includes("Files"))return;ie.preventDefault();const xe=ie.relatedTarget;xe instanceof Node&&ie.currentTarget.contains(xe)||P(!1)},onDrop:ie=>{var xe;ie.dataTransfer.types.includes("Files")&&(ie.preventDefault(),P(!1),oe(Array.from(ie.dataTransfer.files)),(xe=j.current)==null||xe.focus())},children:[g.jsx("input",{ref:G,type:"file",accept:Ap.join(","),multiple:!0,className:"hidden",onChange:ie=>{oe(Array.from(ie.target.files??[])),ie.target.value=""}}),E.length?g.jsx("div",{className:"grid grid-cols-2 gap-2 pt-1 pb-2 sm:grid-cols-3",children:E.map(ie=>g.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/80 bg-background/80",children:[g.jsx("img",{src:ie.previewUrl,alt:ie.name,className:"h-28 w-full object-cover"}),g.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 px-2 py-1.5",children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"truncate text-xs text-foreground",children:ie.name}),g.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[Math.max(1,Math.round(ie.sizeBytes/1024))," KB"]})]}),g.jsx(vt,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>ee(ie.id),disabled:X,children:g.jsx(is,{className:"h-3.5 w-3.5"})})]})]},ie.id))}):null,g.jsx("textarea",{ref:j,value:C,onChange:ie=>k(ie.target.value),onPaste:ie=>{const xe=Array.from(ie.clipboardData.files);xe.some(Ae=>Ae.type.startsWith("image/"))&&(ie.preventDefault(),oe(xe))},onKeyDown:ie=>{ie.key==="Enter"&&!ie.shiftKey&&(C.trim()||E.length>0)&&(ie.preventDefault(),Q()),ie.key==="Escape"&&(x(!1),k(""),R([]),O(null))},placeholder:"Describe what you'd like to change...",rows:3,className:"w-full bg-transparent text-[16px] md:text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none"}),M?g.jsx("div",{className:"text-xs text-destructive",children:M}):null,g.jsxs("div",{className:"flex items-center justify-between mt-1",children:[g.jsx(vt,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full text-muted-foreground hover:text-foreground",onClick:()=>{var ie;return(ie=G.current)==null?void 0:ie.click()},disabled:X,children:g.jsx(ZR,{className:"h-4 w-4"})}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(vt,{type:"button",size:"sm",variant:"ghost",onClick:()=>{x(!1),k(""),R([]),O(null)},className:"rounded-full text-muted-foreground",disabled:X,children:"Cancel"}),g.jsxs(vt,{type:"button",size:"sm",disabled:!C.trim()&&E.length===0||X,onClick:()=>void Q(),className:"rounded-full bg-primary text-primary-foreground disabled:opacity-50 disabled:pointer-events-none",children:[g.jsx(Y8,{className:"h-4 w-4 mr-1.5"}),X?"Adjusting...":"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"})}):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 Jse={completed:{Icon:di,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:Fn,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:QP,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function eoe(t){const e=ke.c(7),{message:n}=t,r=n.input.todos;if(!r.length)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=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(T8,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),e[0]=i):i=e[0];let s;if(e[1]!==r){let c;e[3]!==r.length?(c=(d,u)=>{const f=u===r.length-1,{Icon:m,iconClass:v,textClass:b}=Jse[d.status];return g.jsxs("div",{className:Ce("flex items-center gap-3 px-4 py-2.5 bg-background",!f&&"border-b border-border"),children:[g.jsx(m,{className:Ce("h-4 w-4 flex-shrink-0",v)}),g.jsx("span",{className:Ce("text-sm",b),children:d.status==="in_progress"?d.activeForm:d.content})]},u)},e[3]=r.length,e[4]=c):c=e[4],s=r.map(c),e[1]=r,e[2]=s}else s=e[2];let a;return e[5]!==s?(a=g.jsx("div",{className:"w-full",children:g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[i,g.jsx("div",{children:s})]})}),e[5]=s,e[6]=a):a=e[6],a}function toe(t){const e=t.split(`
|
|
606
|
+
`),n=/^\s*(\d+)→(.*)$/;return e.map(r=>{const i=r.match(n);return i?{lineNumber:parseInt(i[1],10),content:i[2]}:{lineNumber:null,content:r}})}function noe(t){return t.replace(/<[^>]+>/g,"")}function roe(t,e){const n=t.split(`
|
|
607
|
+
`),r=e.split(`
|
|
608
|
+
`),i=ioe(n,r),s=soe(n,r,i);return ooe(s)}function ioe(t,e){const n=t.length,r=e.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let s=1;s<=n;s++)for(let a=1;a<=r;a++)i[s][a]=t[s-1]===e[a-1]?i[s-1][a-1]+1:Math.max(i[s-1][a],i[s][a-1]);return i}function soe(t,e,n){const r=[];let i=t.length,s=e.length;for(;i>0||s>0;)i>0&&s>0&&t[i-1]===e[s-1]?(r.push({type:"context",text:t[i-1],oldIdx:i,newIdx:s}),i--,s--):s>0&&(i===0||n[i][s-1]>=n[i-1][s])?(r.push({type:"added",text:e[s-1],oldIdx:i,newIdx:s}),s--):(r.push({type:"removed",text:t[i-1],oldIdx:i,newIdx:s}),i--);return r.reverse()}function ooe(t){return t.map(e=>{const n=e.type==="removed"?"-":e.type==="added"?"+":" ";return{type:e.type,content:`${n}${e.text}`}})}function h1(t){const e=ke.c(20),{content:n,isDiff:r,oldString:i,newString:s}=t,a=r===void 0?!1:r;let c;e:{if(a&&i!==void 0&&s!==void 0){let C;e[0]!==s||e[1]!==i?(C=roe(i,s),e[0]=s,e[1]=i,e[2]=C):C=e[2],c=C;break e}let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[3]=x):x=e[3],c=x}const d=c;let u;e:{if(!a){let C;e[4]!==n?(C=toe(n),e[4]=n,e[5]=C):C=e[5],u=C;break e}let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[6]=x):x=e[6],u=x}const f=u;let m;e[7]!==f?(m=f.some(loe),e[7]=f,e[8]=m):m=e[8];const v=m;if(a&&d.length>0){let x;e[9]!==d?(x=d.map(aoe),e[9]=d,e[10]=x):x=e[10];let C;return e[11]!==x?(C=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:x})})})}),e[11]=x,e[12]=C):C=e[12],C}let b;if(e[13]!==v||e[14]!==f){let x;e[16]!==v?(x=(C,k)=>g.jsxs("tr",{children:[v&&g.jsx("td",{className:"px-2 py-0 select-none w-0 whitespace-nowrap text-muted-foreground/50 text-right",children:C.lineNumber!==null?C.lineNumber:""}),g.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:noe(C.content)})]},k),e[16]=v,e[17]=x):x=e[17],b=f.map(x),e[13]=v,e[14]=f,e[15]=b}else b=e[15];let S;return e[18]!==b?(S=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:b})})})}),e[18]=b,e[19]=S):S=e[19],S}function aoe(t,e){const n=t.type==="removed"?"bg-red-500/10 dark:bg-red-500/15":t.type==="added"?"bg-green-500/10 dark:bg-green-500/15":"",r=t.type==="removed"?"text-red-700 dark:text-red-400":t.type==="added"?"text-green-700 dark:text-green-400":"text-foreground";return g.jsxs("tr",{className:n,children:[g.jsx("td",{className:`px-2 py-0 select-none w-0 whitespace-nowrap ${t.type==="removed"?"text-red-500/50":t.type==="added"?"text-green-500/50":"text-muted-foreground/50"}`,children:t.type==="removed"?"-":t.type==="added"?"+":" "}),g.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${r}`,children:t.content.slice(1)})]},e)}function loe(t){return t.lineNumber!==null}function Q6(t){var $;const e=ke.c(78),{message:n,isLoading:r,localPath:i}=t,s=r===void 0?!1:r,a=n.result!==void 0,c=!a&&s;let d;e:{if(typeof n.result=="string"){d=n.result;break e}if(!n.result){d="";break e}if(typeof n.result=="object"&&n.result!==null&&"content"in n.result){const X=n.result.content;if(typeof X=="string"){d=X;break e}}let T;e[0]!==n.result?(T=JSON.stringify(n.result,null,2),e[0]=n.result,e[1]=T):T=e[1],d=T}const u=d;let f;if(e[2]!==n.input||e[3]!==n.toolKind||e[4]!==u){e:{if((n.toolKind==="read_file"||n.toolKind==="write_file"||n.toolKind==="edit_file")&&n.input.filePath){f=n.input.filePath;break e}if(n.toolKind==="edit_file"){const T=u.match(/^Updated\s+(.+)$/m);if(T!=null&&T[1]){f=T[1].trim();break e}}f=""}e[2]=n.input,e[3]=n.toolKind,e[4]=u,e[5]=f}else f=e[5];const m=f;let v;e:{if(n.toolKind==="skill"){v=n.input.skill;break e}if(n.toolKind==="glob"){v=`Search files ${n.input.pattern==="**/*"?"in all directories":`matching ${n.input.pattern}`}`;break e}if(n.toolKind==="grep"){const T=n.input.pattern,X=n.input.outputMode;if(X==="count"){v=`Count \`${T}\` occurrences`;break e}if(X==="content"){v=`Find \`${T}\` in text`;break e}v=`Find \`${T}\` in files`;break e}if(n.toolKind==="bash"){let T;e[6]!==n.input.command||e[7]!==n.input.description?(T=n.input.description||(n.input.command?LH(n.input.command):"Bash"),e[6]=n.input.command,e[7]=n.input.description,e[8]=T):T=e[8],v=T;break e}if(n.toolKind==="web_search"){v=n.input.query||"Web Search";break e}if(n.toolKind==="read_file"){let T;e[9]!==m||e[10]!==i?(T=m?`Read ${Vb(m,i)}`:"Read file",e[9]=m,e[10]=i,e[11]=T):T=e[11],v=T;break e}if(n.toolKind==="write_file"){let T;e[12]!==m||e[13]!==i?(T=m?`Write ${Vb(m,i)}`:"Write file",e[12]=m,e[13]=i,e[14]=T):T=e[14],v=T;break e}if(n.toolKind==="edit_file"){let T;e[15]!==m||e[16]!==i?(T=m?`Edit ${Vb(m,i)}`:"Edit file",e[15]=m,e[16]=i,e[17]=T):T=e[17],v=T;break e}if(n.toolKind==="mcp_generic"){let T;e[18]!==n.input.tool?(T=B1(n.input.tool),e[18]=n.input.tool,e[19]=T):T=e[19];let X;e[20]!==n.input.server?(X=B1(n.input.server),e[20]=n.input.server,e[21]=X):X=e[21],v=`${T} from ${X}`;break e}if(n.toolKind==="subagent_task"){v=n.input.subagentType||n.toolName;break e}v=n.toolName}const b=v,S=n.toolKind==="subagent_task";let x;e:{if(n.toolKind==="skill"){x=n.input.skill;break e}x=void 0}const C=x,k=n.toolKind==="bash",E=n.toolKind==="write_file",R=n.toolKind==="edit_file",M=n.toolKind==="read_file";let O;e[22]!==M||e[23]!==u?(O=M&&!!u.trim(),e[22]=M,e[23]=u,e[24]=O):O=e[24];const D=O;let P;e[25]!==R||e[26]!==n.input?(P=R&&(!!n.input.oldString.trim()||!!n.input.newString.trim()),e[25]=R,e[26]=n.input,e[27]=P):P=e[27];const z=P;let Y;e:switch(n.toolKind){case"bash":{Y=n.input.command;break e}case"write_file":{Y=n.input.content;break e}default:{let T;e[28]!==n.input?(T=JSON.stringify(n.input,null,2),e[28]=n.input,e[29]=T):T=e[29],Y=T}}const L=Y;let W;e[30]!==z||e[31]!==L||e[32]!==k||e[33]!==R||e[34]!==M||e[35]!==E||e[36]!==n.input||e[37]!==n.isError||e[38]!==u?(W=R?z?g.jsx(h1,{content:"",isDiff:!0,oldString:n.input.oldString,newString:n.input.newString}):u.trim()?g.jsx(qb,{label:n.isError?"Error":"Result",copyText:u,children:u}):g.jsx("div",{className:"text-muted-foreground text-xs",children:"Cursor completed this edit, but ACP did not include the file diff details."}):!M&&!E&&g.jsx(qb,{label:k?g.jsxs("span",{className:"flex items-center gap-2 w-full",children:[g.jsx("span",{children:"Command"}),!!n.input.timeoutMs&&g.jsxs("span",{className:"text-muted-foreground",children:["timeout: ",String(n.input.timeoutMs),"ms"]}),!!n.input.runInBackground&&g.jsx("span",{className:"text-muted-foreground",children:"background"})]}):E?"Contents":"Input",copyText:L,children:L}),e[30]=z,e[31]=L,e[32]=k,e[33]=R,e[34]=M,e[35]=E,e[36]=n.input,e[37]=n.isError,e[38]=u,e[39]=W):W=e[39];let V;e[40]!==D||e[41]!==a||e[42]!==M||e[43]!==n.isError||e[44]!==u?(V=a&&M&&!n.isError&&(D?g.jsx(h1,{content:u}):g.jsx("div",{className:"text-muted-foreground text-xs",children:"Cursor completed this read, but ACP did not include the file contents."})),e[40]=D,e[41]=a,e[42]=M,e[43]=n.isError,e[44]=u,e[45]=V):V=e[45];let F;e[46]!==E||e[47]!==n.input||e[48]!==n.isError?(F=E&&!n.isError&&g.jsx(h1,{content:n.input.content}),e[46]=E,e[47]=n.input,e[48]=n.isError,e[49]=F):F=e[49];let U;e[50]!==a||e[51]!==R||e[52]!==M||e[53]!==E||e[54]!==n.isError||e[55]!==u?(U=a&&!M&&!(E&&!n.isError)&&!(R&&!n.isError)&&g.jsx(qb,{label:n.isError?"Error":"Result",copyText:u,children:u}),e[50]=a,e[51]=R,e[52]=M,e[53]=E,e[54]=n.isError,e[55]=u,e[56]=U):U=e[56];let H;e[57]!==V||e[58]!==F||e[59]!==U||e[60]!==W?(H=g.jsx(Qh,{className:"my-4 text-sm",children:g.jsxs("div",{className:"flex flex-col gap-2",children:[W,V,F,U]})}),e[57]=V,e[58]=F,e[59]=U,e[60]=W,e[61]=H):H=e[61];let j;e:{if(n.isError){let J;e[62]===Symbol.for("react.memo_cache_sentinel")?(J=g.jsx(is,{className:"size-4 text-destructive"}),e[62]=J):J=e[62],j=J;break e}if(S){let J;e[63]===Symbol.for("react.memo_cache_sentinel")?(J=g.jsx(xy,{className:"size-4 text-muted-icon"}),e[63]=J):J=e[63],j=J;break e}let T;e[64]!==n.toolName?(T=PD(n.toolName),e[64]=n.toolName,e[65]=T):T=e[65];const X=T;let Z;e[66]!==X?(Z=g.jsx(X,{className:"size-4 text-muted-icon"}),e[66]=X,e[67]=Z):Z=e[67],j=Z}let G;e[68]!==j?(G=g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:j}),e[68]=j,e[69]=G):G=e[69];const B=Math.max(20,((($=C||b)==null?void 0:$.length)??33)*3),K=C||b;let A;e[70]!==c||e[71]!==B||e[72]!==K?(A=g.jsx(Yo,{className:"text-left transition-opacity duration-200 truncate",children:g.jsx(Eg,{animate:c,shimmerWidth:B,children:K})}),e[70]=c,e[71]=B,e[72]=K,e[73]=A):A=e[73];let I;return e[74]!==H||e[75]!==G||e[76]!==A?(I=g.jsx(ea,{className:"w-full",children:g.jsxs(Xh,{expandedContent:H,children:[G,A]})}),e[74]=H,e[75]=G,e[76]=A,e[77]=I):I=e[77],I}function coe(t){const e=ke.c(9),{message:n}=t,r=uoe;if(!n.success){const f=n.result||"An unknown error occurred.";let m;return e[0]!==f?(m=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:f}),e[0]=f,e[1]=m):m=e[1],m}const i=`px-0.5 text-xs tracking-wide ${n.durationMs>6e4?"":"hidden"}`;let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=g.jsx("div",{className:"w-full h-[1px] bg-border"}),e[2]=s):s=e[2];const a=r(n.durationMs);let c;e[3]!==a?(c=g.jsxs(Yo,{className:"whitespace-nowrap text-[11px] tracking-widest text-muted-foreground/60 uppercase flex-shrink-0",children:["Worked for ",a]}),e[3]=a,e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=g.jsx("div",{className:"w-full h-[1px] bg-border"}),e[5]=d):d=e[5];let u;return e[6]!==i||e[7]!==c?(u=g.jsxs(ea,{className:i,children:[s,c,d]}),e[6]=i,e[7]=c,e[8]=u):u=e[8],u}function uoe(t){if(t<1e3)return`${t}ms`;const e=Math.floor(t/1e3),n=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return n>0?`${n}h${r>0?` ${r}m`:""}`:r>0?`${r}m${i>0?` ${i}s`:""}`:`${i}s`}function doe(t){const e=ke.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=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(YP,{className:"h-4 w-4 ml-1.5"}),g.jsx("em",{children:"Interrupted"})]})}),e[0]=n):n=e[0],n}function eg(t){const e=ke.c(15),{size:n}=t,r=n===void 0?4:n,i=`0 0 100 ${r}`,s=`${r}px`;let a;e[0]!==s?(a={height:s},e[0]=s,e[1]=a):a=e[1];const c=`M0 ${r} L${r/2} 0 L${r} ${r}`;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d={stroke:"currentColor"},e[2]=d):d=e[2];let u;e[3]!==c?(u=g.jsx("path",{d:c,fill:"none",stroke:"currentColor",strokeWidth:"0.5",className:"text-muted-foreground/30",style:d}),e[3]=c,e[4]=u):u=e[4];let f;e[5]!==r||e[6]!==u?(f=g.jsx("pattern",{id:"zigzag",width:r,height:r,patternUnits:"userSpaceOnUse",children:u}),e[5]=r,e[6]=u,e[7]=f):f=e[7];let m;e[8]!==r?(m=g.jsx("rect",{width:"100%",height:r,fill:"url(#zigzag)",className:"text-muted-foreground/30"}),e[8]=r,e[9]=m):m=e[9];let v;return e[10]!==i||e[11]!==a||e[12]!==f||e[13]!==m?(v=g.jsxs("svg",{className:"flex-1",viewBox:i,preserveAspectRatio:"none",style:a,children:[f,m]}),e[10]=i,e[11]=a,e[12]=f,e[13]=m,e[14]=v):v=e[14],v}function hoe(){const t=ke.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(eg,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),g.jsx(eg,{})]}),t[0]=e):e=t[0],e}function foe(){const t=ke.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(eg,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),g.jsx(eg,{})]}),t[0]=e):e=t[0],e}function moe(t){const e=ke.c(8),{message:n}=t;let r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=[rf],i=Zh(),e[0]=r,e[1]=i):(r=e[0],i=e[1]);let s;e[2]!==n.summary?(s=g.jsx(Qh,{className:"my-4 text-xs",children:g.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:g.jsx(nf,{remarkPlugins:r,components:i,children:n.summary})})}),e[2]=n.summary,e[3]=s):s=e[3];let a,c;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(QR,{className:"h-4.5 w-4.5 text-muted-foreground"})}),c=g.jsx(Yo,{children:"Summarized"}),e[4]=a,e[5]=c):(a=e[4],c=e[5]);let d;return e[6]!==s?(d=g.jsx(ea,{children:g.jsxs(Xh,{expandedContent:s,children:[a,c]})}),e[6]=s,e[7]=d):d=e[7],d}const poe={compacting:"Compacting..."};function goe(t){const e=ke.c(3),{message:n}=t,r=poe[n.status]||n.status;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(QR,{className:"h-4.5 w-4.5 text-muted-foreground"})}),e[0]=i):i=e[0];let s;return e[1]!==r?(s=g.jsxs(ea,{className:"grid grid-cols-[auto_1fr] items-center gap-1.5 text-sm animate-pulse",children:[i,g.jsx(Yo,{className:"text-left transition-opacity duration-200 truncate",children:r})]}),e[1]=r,e[2]=s):s=e[2],s}const voe={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"}},boe={key:"other",singular:"tool call",plural:"tool calls"};function _oe(t){return voe[t]??boe}function yoe(t){const e=new Map,n=[];for(const r of t){const i=r.toolKind,s=_oe(i),a=e.get(s.key);a?a.count++:(e.set(s.key,{category:s,count:1}),n.push(s.key))}return n.map(r=>{const{category:i,count:s}=e.get(r);return`${s} ${s===1?i.singular:i.plural}`}).join(", ")}function xoe(t){const e=ke.c(26),{messages:n,isLoading:r,localPath:i}=t,[s,a]=_.useState(!1);let c;e[0]!==n?(c=yoe(n),e[0]=n,e[1]=c):c=e[1];const d=c;let u;e[2]!==n?(u=n.some(Soe),e[2]=n,e[3]=u):u=e[3];const m=u&&r;let v;e[4]!==s?(v=()=>a(!s),e[4]=s,e[5]=v):v=e[5];const b=`group cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${!s&&!m?"hover:opacity-60 transition-opacity":""}`,S=`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${s?"rotate-90":""}`;let x;e[6]!==S?(x=g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(Ni,{className:S})}),e[6]=S,e[7]=x):x=e[7];let C;e[8]!==d||e[9]!==m?(C=g.jsx(Yo,{className:"text-left",children:g.jsx(Eg,{animate:m,children:d})}),e[8]=d,e[9]=m,e[10]=C):C=e[10];let k;e[11]!==x||e[12]!==C?(k=g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[x,C]}),e[11]=x,e[12]=C,e[13]=k):k=e[13];let E;e[14]!==v||e[15]!==b||e[16]!==k?(E=g.jsx("button",{onClick:v,className:b,children:k}),e[14]=v,e[15]=b,e[16]=k,e[17]=E):E=e[17];let R;e[18]!==s||e[19]!==r||e[20]!==i||e[21]!==n?(R=s&&g.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[n.map(O=>g.jsx(Q6,{message:O,isLoading:r,localPath:i},O.id)),n.length>5&&g.jsx("button",{onClick:()=>a(!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(Ni,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),g.jsx(Yo,{className:"text-left",children:"Collapse"})]})})]}),e[18]=s,e[19]=r,e[20]=i,e[21]=n,e[22]=R):R=e[22];let M;return e[23]!==R||e[24]!==E?(M=g.jsx(ea,{className:"w-full",children:g.jsxs("div",{className:"flex flex-col w-full",children:[E,R]})}),e[23]=R,e[24]=E,e[25]=M):M=e[25],M}function Soe(t){return t.result===void 0}const woe=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function aR(t){if(t.kind!=="tool")return!1;const e=t.toolName;return!woe.has(e)}function Coe(t,e,n){return t?t.kind==="status"&&e<n.length-1:!1}function koe(t,e={}){var s;const n=[];let r=0;const i=a=>(a==null?void 0:a.kind)==="tool"&&a.toolName==="TodoWrite"&&a.id!==e.TodoWrite;for(;r<t.length;){const a=t[r];if(aR(a)){const c=[a],d=r;for(r+=1;r<t.length;){const u=t[r];if(aR(u)){c.push(u),r+=1;continue}if(Coe(u,r,t)){r+=1;continue}if(i(u)){r+=1;continue}break}c.length>=2?n.push({type:"tool-group",key:`group-${((s=c[0])==null?void 0:s.id)??d}`,messages:c,startIndex:d}):n.push({type:"single",key:a.id,message:a,index:d});continue}n.push({type:"single",key:a.id,message:a,index:r}),r+=1}return n}function Eoe(t,e){var r;if(!e)return null;let n=-1;for(let i=t.length-1;i>=0;i-=1)if(((r=t[i])==null?void 0:r.kind)==="user_prompt"){n=i;break}if(n<0)return null;for(let i=t.length-1;i>n;i-=1){const s=t[i];if((s==null?void 0:s.kind)==="assistant_text")return s.id}return null}function Roe(t,e){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect().top-n.top+t.scrollTop;return{viewportHeight:t.clientHeight,viewportWidth:t.clientWidth,viewportStart:Math.max(0,t.scrollTop-i)}}function Toe(t){const e=ke.c(67),{messages:n,isLoading:r,hasOlderMessages:i,oldestLoadedEntryId:s,isLoadingOlderMessages:a,isAtBottom:c,localPath:d,latestToolIds:u,onOpenLocalLink:f,onAskUserQuestionSubmit:m,onExitPlanModeConfirm:v,onHandoff:b,onLoadOlder:S,pendingTool:x,availableProviders:C,scrollContainerRef:k}=t,E=_.useRef(null),R=_.useRef(null);let M;e[0]===Symbol.for("react.memo_cache_sentinel")?(M={viewportHeight:0,viewportWidth:0,viewportStart:0},e[0]=M):M=e[0];const[O,D]=_.useState(M);let P;e[1]!==n?(P=n.filter(Noe),e[1]=n,e[2]=P):P=e[2];const z=P;let Y;e[3]!==u||e[4]!==z?(Y=koe(z,u),e[3]=u,e[4]=z,e[5]=Y):Y=e[5];const L=Y;let W;e[6]!==z?(W=z.findIndex(Aoe),e[6]=z,e[7]=W):W=e[7];const V=W;let F;e[8]!==z?(F=z.findIndex(Moe),e[8]=z,e[9]=F):F=e[9];const U=F;let H;e[10]!==r||e[11]!==z?(H=Eoe(z,r),e[10]=r,e[11]=z,e[12]=H):H=e[12];const j=H;let G;e[13]!==k?(G=()=>{const me=k.current,se=E.current;if(!me||!se)return;const oe=()=>{const Q=Roe(me,se);D(te=>te.viewportHeight===Q.viewportHeight&&te.viewportWidth===Q.viewportWidth&&te.viewportStart===Q.viewportStart?te:Q)};oe();const ee=new ResizeObserver(oe);return ee.observe(me),ee.observe(se),me.addEventListener("scroll",oe,{passive:!0}),()=>{ee.disconnect(),me.removeEventListener("scroll",oe)}},e[13]=k,e[14]=G):G=e[14];let B;e[15]!==n.length||e[16]!==k?(B=[n.length,k],e[15]=n.length,e[16]=k,e[17]=B):B=e[17],_.useEffect(G,B);let K,A;e[18]!==c||e[19]!==s||e[20]!==O.viewportStart?(A=()=>{if(c||O.viewportStart>480){R.current=null;return}s&&R.current!==s&&(R.current=null)},K=[c,s,O.viewportStart],e[18]=c,e[19]=s,e[20]=O.viewportStart,e[21]=K,e[22]=A):(K=e[21],A=e[22]),_.useEffect(A,K);let I;e[23]!==i||e[24]!==c||e[25]!==a||e[26]!==s||e[27]!==S||e[28]!==k||e[29]!==O.viewportStart?(I=()=>{if(!i||!s||a||c||O.viewportStart>480)return;const me=k.current;if(me){const se=me.scrollHeight-me.scrollTop-me.clientHeight;if(dN(se))return}R.current!==s&&(R.current=s,S())},e[23]=i,e[24]=c,e[25]=a,e[26]=s,e[27]=S,e[28]=k,e[29]=O.viewportStart,e[30]=I):I=e[30];let $;e[31]!==i||e[32]!==c||e[33]!==a||e[34]!==n.length||e[35]!==s||e[36]!==S||e[37]!==O.viewportStart?($=[i,c,s,a,n.length,S,O.viewportStart],e[31]=i,e[32]=c,e[33]=a,e[34]=n.length,e[35]=s,e[36]=S,e[37]=O.viewportStart,e[38]=$):$=e[38],_.useEffect(I,$);let T;e[39]!==C||e[40]!==U||e[41]!==V||e[42]!==r||e[43]!==j||e[44]!==u||e[45]!==d||e[46]!==m||e[47]!==v||e[48]!==b||e[49]!==x||e[50]!==z?(T=function(se,oe){if(se.kind==="user_prompt")return g.jsx(_se,{content:se.content,attachments:se.attachments},se.id);switch(se.kind){case"unknown":return g.jsx(wse,{json:se.json},se.id);case"system_init":return oe===V?g.jsx(Dse,{message:se,rawJson:se.debugRaw},se.id):null;case"account_info":return oe===U?g.jsx(jse,{message:se},se.id):null;case"assistant_text":return g.jsx(Lse,{message:se,isStreaming:r&&se.id===j},se.id);case"assistant_thought":return g.jsx(Ise,{message:se},se.id);case"tool":return se.toolKind==="ask_user_question"?g.jsx($se,{message:se,onSubmit:m,isLatest:se.id===u.AskUserQuestion},se.id):se.toolKind==="exit_plan_mode"?g.jsx(Xse,{message:se,onConfirm:v,onHandoff:b,isLatest:se.id===u.ExitPlanMode,isActionable:(x==null?void 0:x.toolKind)==="exit_plan_mode"&&x.toolUseId===se.toolId,availableProviders:C},se.id):se.toolKind==="todo_write"?se.id!==u.TodoWrite?null:g.jsx(eoe,{message:se},se.id):g.jsx(Q6,{message:se,isLoading:r,localPath:d},se.id);case"result":{const ee=z[oe+1],Q=z[oe-1];return(ee==null?void 0:ee.kind)==="context_cleared"||(Q==null?void 0:Q.kind)==="context_cleared"?null:g.jsx(coe,{message:se},se.id)}case"interrupted":return g.jsx(doe,{message:se},se.id);case"compact_boundary":return g.jsx(hoe,{},se.id);case"context_cleared":return g.jsx(foe,{},se.id);case"compact_summary":return g.jsx(moe,{message:se},se.id);case"status":return oe===z.length-1?g.jsx(goe,{message:se},se.id):null}},e[39]=C,e[40]=U,e[41]=V,e[42]=r,e[43]=j,e[44]=u,e[45]=d,e[46]=m,e[47]=v,e[48]=b,e[49]=x,e[50]=z,e[51]=T):T=e[51];const X=T;let Z;e[52]!==r||e[53]!==d||e[54]!==X?(Z=function(se,oe){if(se.type==="tool-group")return g.jsx("div",{className:oe?void 0:"pb-5",children:g.jsx("div",{className:"group relative",[Sp]:"",children:g.jsx(xoe,{messages:se.messages,isLoading:r,localPath:d})})},se.key);const ee=X(se.message,se.index);return ee?g.jsx("div",{className:oe?void 0:"pb-5",children:g.jsx("div",{id:`msg-${se.message.id}`,className:"group relative",[Sp]:"",children:ee})},se.key):null},e[52]=r,e[53]=d,e[54]=X,e[55]=Z):Z=e[55];const J=Z;let re;if(e[56]!==J||e[57]!==L){let me;e[59]!==J||e[60]!==L.length?(me=(se,oe)=>J(se,oe===L.length-1),e[59]=J,e[60]=L.length,e[61]=me):me=e[61],re=L.map(me),e[56]=J,e[57]=L,e[58]=re}else re=e[58];let ae;e[62]!==re?(ae=g.jsx("div",{ref:E,children:re}),e[62]=re,e[63]=ae):ae=e[63];let ue;return e[64]!==f||e[65]!==ae?(ue=g.jsx(xZ,{onOpenLocalLink:f,children:ae}),e[64]=f,e[65]=ae,e[66]=ue):ue=e[66],ue}function Moe(t){return t.kind==="account_info"}function Aoe(t){return t.kind==="system_init"}function Noe(t){return!t.hidden}function Doe(t){const e=ke.c(6),{rootRef:n,fallbackRef:r,enabled:i,canCancel:s}=t;let a,c;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==n?(a=()=>{if(!i)return;let d=0,u=null;const f=x=>{const C=x instanceof Element?x:null,k=n.current,E=r.current;if(Fk({trigger:"pointer",activeElement:document.activeElement,pointerStartTarget:u,pointerEndTarget:C,root:k,fallback:E,hasActiveOverlay:Bk(document),hasActiveSelection:z7(window.getSelection())})!=="restore"){u=null;return}E==null||E.focus({preventScroll:!0}),u=null},m=x=>{cancelAnimationFrame(d),u=x.target instanceof Element?x.target:null},v=x=>{cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{f(x.target)})},b=()=>{u=null;const x=r.current;!x||x.disabled||x.focus({preventScroll:!0})},S=x=>{if(x.key!=="Escape")return;const C=r.current;Fk({trigger:"escape",activeElement:document.activeElement,fallback:C,hasActiveOverlay:Bk(document),canCancel:s,defaultPrevented:x.defaultPrevented})==="escape-focus"&&(x.preventDefault(),C==null||C.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",m,!0),window.addEventListener("pointerup",v,!0),window.addEventListener("keydown",S,!0),window.addEventListener(xp,b),()=>{cancelAnimationFrame(d),window.removeEventListener("pointerdown",m,!0),window.removeEventListener("pointerup",v,!0),window.removeEventListener("keydown",S,!0),window.removeEventListener(xp,b)}},c=[s,i,r,n],e[0]=s,e[1]=i,e[2]=r,e[3]=n,e[4]=a,e[5]=c):(a=e[4],c=e[5]),_.useEffect(a,c)}const $m="Use any pull-request skills to create a new pull request for these local changes. Write a clear, concise title, description, and testing summary.",Um="Use any pull-request skills to update the existing pull request for these local changes. Commit the local changes with a clear, concise message and summarize what changed.",au=["codex"],Ooe=new Set(rc.map(t=>t.id));function lR(t){if(!Array.isArray(t))return[...au];const e=t.filter(n=>typeof n=="string"&&Ooe.has(n));return e.length>0?Array.from(new Set(e)):[...au]}const f1=fi()(Li(t=>({pullRequestPrompt:$m,pullRequestUpdatePrompt:Um,pullRequestProviders:[...au],setPullRequestPrompt:e=>t({pullRequestPrompt:e}),setPullRequestUpdatePrompt:e=>t({pullRequestUpdatePrompt:e}),setPullRequestProviders:e=>t({pullRequestProviders:lR(e)}),togglePullRequestProvider:e=>t(n=>{const r=n.pullRequestProviders.includes(e)?n.pullRequestProviders.filter(i=>i!==e):[...n.pullRequestProviders,e];return{pullRequestProviders:r.length>0?r:[...au]}}),resetToDefaults:()=>t({pullRequestPrompt:$m,pullRequestUpdatePrompt:Um,pullRequestProviders:[...au]})}),{name:"slash-command-settings",version:1,migrate:t=>{if(!t||typeof t!="object")return{pullRequestPrompt:$m,pullRequestUpdatePrompt:Um,pullRequestProviders:[...au]};const e=t;return{...e,pullRequestPrompt:typeof e.pullRequestPrompt=="string"?e.pullRequestPrompt:$m,pullRequestUpdatePrompt:typeof e.pullRequestUpdatePrompt=="string"?e.pullRequestUpdatePrompt:Um,pullRequestProviders:lR(e.pullRequestProviders)}}}));function Wm(t){return!t||typeof t!="object"||Array.isArray(t)?null:t}function joe(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function Loe(t,e){const n=joe(e);switch(t.toolKind){case"ask_user_question":{const i=Wm(n),s=Wm(i==null?void 0:i.answers)??(i||{});return{answers:Object.fromEntries(Object.entries(s).map(([a,c])=>Array.isArray(c)?[a,c.map(d=>String(d))]:c&&typeof c=="object"&&Array.isArray(c.answers)?[a,c.answers.map(d=>String(d))]:c==null||c===""?[a,[]]:[a,[String(c)]])),...(i==null?void 0:i.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const i=Wm(n);return{confirmed:typeof(i==null?void 0:i.confirmed)=="boolean"?i.confirmed:void 0,clearContext:typeof(i==null?void 0:i.clearContext)=="boolean"?i.clearContext:void 0,suppressFollowUp:typeof(i==null?void 0:i.suppressFollowUp)=="boolean"?i.suppressFollowUp:void 0,message:typeof(i==null?void 0:i.message)=="string"?i.message:void 0,...(i==null?void 0:i.discarded)===!0?{discarded:!0}:{}}}case"read_file":if(typeof n=="string")return n;const r=Wm(n);return{content:typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(n,null,2)};default:return n}}function Z6(t){return new Date(t).toISOString()}function Yi(t){return{id:t._id,messageId:t.messageId,timestamp:Z6(t.createdAt),hidden:t.hidden}}function Ioe(t){return{id:t._id,messageId:t.messageId,hidden:t.hidden,kind:"tool",toolKind:t.tool.toolKind,toolName:t.tool.toolName,toolId:t.tool.toolId,input:t.tool.input,timestamp:Z6(t.createdAt)}}function Poe(t){if(t.debugRaw)try{return JSON.parse(t.debugRaw).tool_use_result}catch{return}}function zoe(t){if(t!=null&&t.length)return t.map(e=>({...e,previewUrl:`/attachments/${e.relativePath.split("/").map(encodeURIComponent).join("/")}`}))}function cR(t,e){const n=t.at(-1);if((n==null?void 0:n.kind)===e.kind&&n.hidden===e.hidden&&n.messageId===e.messageId){n.text+=e.text;return}t.push(e)}function uR(t){if(!t||typeof t!="object"||!("answers"in t))return!1;const e=t.answers;return Object.values(e).some(n=>Array.isArray(n)&&n.length>0)}function Boe(t){const e=new Map,n=[];for(const r of t)switch(r.kind){case"user_prompt":n.push({...Yi(r),kind:"user_prompt",content:r.content,attachments:zoe(r.attachments)});break;case"system_init":n.push({...Yi(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({...Yi(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":cR(n,{...Yi(r),kind:"assistant_text",text:r.text});break;case"assistant_thought":cR(n,{...Yi(r),kind:"assistant_thought",text:r.text});break;case"tool_call":{const i=n.at(-1);(i==null?void 0:i.kind)==="assistant_text"&&r.tool.toolKind==="ask_user_question"&&(i.hidden=!0);const s=Ioe(r);e.set(r.tool.toolId,{hydrated:s,normalized:r.tool,precedingAssistantText:(i==null?void 0:i.kind)==="assistant_text"?i:void 0}),n.push(s);break}case"tool_result":{const i=e.get(r.toolId);if(i){const s=i.normalized.toolKind==="ask_user_question"||i.normalized.toolKind==="exit_plan_mode"?Poe(r)??r.content:r.content,a=Loe(i.normalized,s);(i.normalized.toolKind!=="ask_user_question"||!uR(i.hydrated.result)||uR(a))&&(i.hydrated.result=a,i.hydrated.rawResult=s),i.hydrated.isError=r.isError,i.normalized.toolKind==="exit_plan_mode"&&i.precedingAssistantText&&i.hydrated.result&&(i.precedingAssistantText.hidden=!0)}break}case"result":n.push({...Yi(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...Yi(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...Yi(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...Yi(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...Yi(r),kind:"context_cleared"});break;case"interrupted":n.push({...Yi(r),kind:"interrupted"});break;default:n.push({...Yi(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const Foe=["AskUserQuestion","ExitPlanMode","TodoWrite"],Hoe=new Set(["TodoWrite"]);function $oe(t,e){for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(r.kind!=="tool")continue;const i=r;if(i.toolName===e&&!i.result)return i.id}return null}function Uoe(t,e){for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(r.kind!=="tool")continue;const i=r;if(i.toolName===e)return i.id}return null}function Woe(t){const e={};for(const n of Foe)e[n]=Hoe.has(n)?Uoe(t,n):$oe(t,n);return e}function Voe(t){return t==="starting"||t==="running"||t==="waiting_for_user"}function cy(t){return t==="starting"||t==="running"||t==="waiting_for_user"}function J6(){return typeof window>"u"?null:(window.__KAIZEN_PERF__??(window.__KAIZEN_PERF__={timings:{},counters:{}}),window.__KAIZEN_PERF__)}function eO(){return typeof window>"u"?!1:window.localStorage.getItem("kaizen.debug.perf")==="1"}function tO(t,e,n){const r=J6();r&&(r.timings[t]={value:e,meta:n,recordedAt:Date.now()},eO()&&console.debug(`[kaizen][perf] timing ${t}=${e}`,n??{}))}function dR(t,e=1,n){var s;const r=J6();if(!r)return;const i=(((s=r.counters[t])==null?void 0:s.value)??0)+e;r.counters[t]={value:i,meta:n,recordedAt:Date.now()},eO()&&console.debug(`[kaizen][perf] counter ${t}=${i}`,n??{})}function qoe(t){const e=new Set;return t.filter(n=>{const r=n.localPath??n.projectId;return!r||e.has(r)?!1:(e.add(r),!0)})}function Koe(t,e,n){return{...t,projectGroups:t.projectGroups.map(r=>{if(r.groupKey!==e)return r;const i=new Map(r.features.map(a=>[a.featureId,a])),s=n.map(a=>i.get(a)).filter(a=>!!a);return s.length!==r.features.length?r:{...r,features:s}})}}function Goe(t,e){const n=t.stage==="done"?1:0,r=e.stage==="done"?1:0;return n!==r?n-r:t.sortOrder!==e.sortOrder?t.sortOrder-e.sortOrder:e.updatedAt-t.updatedAt}function Yoe(t,e,n){const r=t.filter(s=>s.featureId!==e);if(n==="done"){const s=r.filter(c=>c.stage==="done").map(c=>c.sortOrder),a=r.map(c=>c.sortOrder);return s.length>0?Math.max(...s)+1:a.length>0?Math.max(...a)+1:0}const i=r.filter(s=>s.stage!=="done").map(s=>s.sortOrder);return i.length===0?0:Math.max(...i)+1}function Xoe(t,e,n,r=Date.now()){return{...t,projectGroups:t.projectGroups.map(i=>{const s=i.features.find(d=>d.featureId===e);if(!s||s.stage===n)return i;const a=s.stage==="done"||n==="done",c=i.features.map(d=>d.featureId===e?{...d,stage:n,updatedAt:r,sortOrder:a?Yoe(i.features,e,n):d.sortOrder}:d).sort(Goe);return{...i,features:c}})}}function Qoe(){return{projectBrowserStateById:{},projectGeneralChatsBrowserStateById:{},featureBrowserStateById:{},featureStageById:{},featureOrderByProjectId:{}}}function Zoe(t,e){let n={...t,projectGroups:t.projectGroups.map(r=>{var i,s;return{...r,browserState:((i=e.projectBrowserStateById[r.groupKey])==null?void 0:i.value)??r.browserState,generalChatsBrowserState:((s=e.projectGeneralChatsBrowserStateById[r.groupKey])==null?void 0:s.value)??r.generalChatsBrowserState,features:r.features.map(a=>{var c;return{...a,browserState:((c=e.featureBrowserStateById[a.featureId])==null?void 0:c.value)??a.browserState}})}})};for(const[r,i]of Object.entries(e.featureOrderByProjectId))n=Koe(n,r,i.value);for(const[r,i]of Object.entries(e.featureStageById))n=Xoe(n,r,i.value);return n}function nO(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0}function Vm(t,e){const n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:n.every(i=>{var s,a,c,d;return((s=t[i])==null?void 0:s.value)===((a=e[i])==null?void 0:a.value)&&((c=t[i])==null?void 0:c.opId)===((d=e[i])==null?void 0:d.opId)})}function Joe(t,e){const n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:n.every(i=>{var s,a;return e[i]?((s=t[i])==null?void 0:s.opId)===((a=e[i])==null?void 0:a.opId)&&nO(t[i].value,e[i].value):!1})}function m1(t,e){return t.projectGroups.find(n=>n.groupKey===e)}function hR(t,e){return t.projectGroups.flatMap(n=>n.features).find(n=>n.featureId===e)}function eae(t,e){const n=Object.fromEntries(Object.entries(e.projectBrowserStateById).filter(([c,d])=>{var u;return((u=m1(t,c))==null?void 0:u.browserState)!==d.value})),r=Object.fromEntries(Object.entries(e.projectGeneralChatsBrowserStateById).filter(([c,d])=>{var u;return((u=m1(t,c))==null?void 0:u.generalChatsBrowserState)!==d.value})),i=Object.fromEntries(Object.entries(e.featureBrowserStateById).filter(([c,d])=>{var u;return((u=hR(t,c))==null?void 0:u.browserState)!==d.value})),s=Object.fromEntries(Object.entries(e.featureStageById).filter(([c,d])=>{var u;return((u=hR(t,c))==null?void 0:u.stage)!==d.value})),a=Object.fromEntries(Object.entries(e.featureOrderByProjectId).filter(([c,d])=>{const u=m1(t,c);return u?!nO(u.features.map(f=>f.featureId),d.value):!1}));return{projectBrowserStateById:n,projectGeneralChatsBrowserStateById:r,featureBrowserStateById:i,featureStageById:s,featureOrderByProjectId:a}}function tae(t,e){return Vm(t.projectBrowserStateById,e.projectBrowserStateById)&&Vm(t.projectGeneralChatsBrowserStateById,e.projectGeneralChatsBrowserStateById)&&Vm(t.featureBrowserStateById,e.featureBrowserStateById)&&Vm(t.featureStageById,e.featureStageById)&&Joe(t.featureOrderByProjectId,e.featureOrderByProjectId)}function qd(t,e,n){var s;if(!(e in t)||((s=t[e])==null?void 0:s.opId)!==n)return t;const{[e]:r,...i}=t;return i}const rO=_.createContext(void 0);function nae(t){const e=new Map;for(const n of t.projectGroups)for(const r of[...n.generalChats,...n.features.flatMap(i=>i.chats)])e.set(r.chatId,r.status);return e}function uy(t,e){switch(e.type){case"sidebar.project-added":{const n=[...t.projectGroups];return n.splice(e.index,0,{...e.project,features:[],generalChats:[]}),{...t,projectGroups:n}}case"sidebar.project-removed":return{...t,projectGroups:t.projectGroups.filter(n=>n.groupKey!==e.projectId)};case"sidebar.project-moved":{const n=t.projectGroups.findIndex(s=>s.groupKey===e.projectId);if(n===-1)return t;const r=[...t.projectGroups],[i]=r.splice(n,1);return r.splice(e.index,0,i),{...t,projectGroups:r}}case"sidebar.project-fields-set":return{...t,projectGroups:t.projectGroups.map(n=>n.groupKey===e.projectId?{...n,...e.patch}:n)};case"sidebar.feature-added":return{...t,projectGroups:t.projectGroups.map(n=>{if(n.groupKey!==e.projectId)return n;const r=[...n.features];return r.splice(e.index,0,e.feature),{...n,features:r}})};case"sidebar.feature-removed":return{...t,projectGroups:t.projectGroups.map(n=>n.groupKey!==e.projectId?n:{...n,features:n.features.filter(r=>r.featureId!==e.featureId)})};case"sidebar.feature-moved":return{...t,projectGroups:t.projectGroups.map(n=>{if(n.groupKey!==e.projectId)return n;const r=n.features.findIndex(a=>a.featureId===e.featureId);if(r===-1)return n;const i=[...n.features],[s]=i.splice(r,1);return i.splice(e.index,0,s),{...n,features:i}})};case"sidebar.feature-fields-set":return{...t,projectGroups:t.projectGroups.map(n=>n.groupKey!==e.projectId?n:{...n,features:n.features.map(r=>r.featureId===e.featureId?{...r,...e.patch}:r)})};case"sidebar.chat-added":return{...t,projectGroups:t.projectGroups.map(n=>{if(n.groupKey!==e.projectId)return n;if(e.featureId)return{...n,features:n.features.map(i=>{if(i.featureId!==e.featureId)return i;const s=[...i.chats];return s.splice(e.index,0,e.chat),{...i,chats:s}})};const r=[...n.generalChats];return r.splice(e.index,0,e.chat),{...n,generalChats:r}})};case"sidebar.chat-removed":return{...t,projectGroups:t.projectGroups.map(n=>n.groupKey!==e.projectId?n:e.featureId?{...n,features:n.features.map(r=>r.featureId!==e.featureId?r:{...r,chats:r.chats.filter(i=>i.chatId!==e.chatId)})}:{...n,generalChats:n.generalChats.filter(r=>r.chatId!==e.chatId)})};case"sidebar.chat-moved":{const n=uy(t,{type:"sidebar.chat-removed",projectId:e.projectId,featureId:e.fromFeatureId,chatId:e.chatId}),r=t.projectGroups.flatMap(i=>[...i.generalChats,...i.features.flatMap(s=>s.chats)]).find(i=>i.chatId===e.chatId);return r?uy(n,{type:"sidebar.chat-added",projectId:e.projectId,featureId:e.toFeatureId,chat:{...r,featureId:e.toFeatureId},index:e.index}):n}case"sidebar.chat-fields-set":return{...t,projectGroups:t.projectGroups.map(n=>n.groupKey!==e.projectId?n:e.featureId?{...n,features:n.features.map(r=>r.featureId!==e.featureId?r:{...r,chats:r.chats.map(i=>i.chatId===e.chatId?{...i,...e.patch}:i)})}:{...n,generalChats:n.generalChats.map(r=>r.chatId===e.chatId?{...r,...e.patch}:r)})};case"sidebar.provider-usage-set":return{...t,providerUsage:e.providerUsage}}}function rae({children:t,activeChatId:e,activeOverviewFeatureId:n}){const r=tc(),i=Ly(),{socket:s}=Vh(),{setCommandError:a,handleOpenCreateFeatureModal:c}=Fu(),[d,u]=_.useState({projectGroups:[]}),[f,m]=_.useState(Qoe),[v,b]=_.useState(null),[S,x]=_.useState(null),[C,k]=_.useState(!1),[E,R]=_.useState(!1),[M,O]=_.useState(!1),[D,P]=_.useState(!1),[z,Y]=_.useState(new Set),L=_.useRef(1),W=_.useRef(d),V=_.useRef(new Map),F=_.useRef(typeof document>"u"?!0:document.visibilityState==="visible"),U=dh(ee=>ee.setVisibility),H=_.useMemo(()=>Zoe(d,f),[d,f]),j=_.useCallback(ee=>{W.current=ee,u(ee),m(Q=>{const te=eae(ee,Q);return tae(Q,te)?Q:te})},[]);function G(){const ee=L.current;return L.current+=1,ee}_.useEffect(()=>{function ee(){const Q=document.visibilityState==="visible";F.current=Q,!(!Q||!e)&&Y(te=>{if(!te.has(e))return te;const he=new Set(te);return he.delete(e),he})}return document.addEventListener("visibilitychange",ee),()=>document.removeEventListener("visibilitychange",ee)},[e]),_.useEffect(()=>s.subscribe({type:"sidebar"},ee=>{j(ee),k(!0),a(null)},ee=>{const Q=performance.now(),te=uy(W.current,ee);j(te),tO("sidebar_event_apply_ms",Math.round(performance.now()-Q),{type:ee.type}),k(!0),a(null)}),[j,a,s]),_.useEffect(()=>{const ee=nae(H),Q=V.current,te=F.current;Y(he=>{let ie=he;for(const[xe,Ae]of ee){const Ke=Q.get(xe);cy(Ae)&&ie.has(xe)&&(ie===he&&(ie=new Set(he)),ie.delete(xe)),Ke&&cy(Ke)&&Ae==="idle"&&(xe!==e||!te)&&(ie===he&&(ie=new Set(he)),ie.add(xe))}return ie}),V.current=ee},[e,H]),_.useEffect(()=>s.subscribe({type:"local-projects"},ee=>{b(ee),R(!0),a(null)}),[a,s]),_.useEffect(()=>{if(!n){x(null);return}return x(null),s.subscribe({type:"feature-overview",featureId:n},ee=>{x(ee),a(null)})},[n,a,s]),_.useEffect(()=>{if(!e)return;const ee=u_(H.projectGroups,e);ee&&U(ee,!1)},[e,U,H.projectGroups]);function B(ee){Y(Q=>{if(!Q.has(ee))return Q;const te=new Set(Q);return te.delete(ee),te})}async function K(ee){const Q=ee.split("/").filter(Boolean).pop()??ee;if(await i.confirm({title:"Hide Project",description:`Hide "${Q}" from ${ys}? This only removes it from ${ys} until you re-add it or reset local state.`,confirmLabel:"Hide",confirmVariant:"destructive"}))try{await s.command({type:"project.hide",localPath:ee}),a(null)}catch(he){a(he instanceof Error?he.message:String(he))}}async function A(ee){const Q=new URL(Hg("/api/directories"),window.location.origin);ee&&Q.searchParams.set("path",ee);const te=await fetch(Q.toString());if(!te.ok){let ie="Failed to load directories";try{const xe=await te.json();xe.error&&(ie=xe.error)}catch{}throw new Error(ie)}const he=await te.json();return a(null),he}async function I(ee){const Q=H.projectGroups.flatMap(he=>he.features).find(he=>he.featureId===ee);if(!Q)return;const te=await i.prompt({title:"Rename Feature",placeholder:"Feature name",initialValue:Q.title,confirmLabel:"Rename"});if(!(!te||te===Q.title))try{await s.command({type:"feature.rename",featureId:ee,title:te}),a(null)}catch(he){a(he instanceof Error?he.message:String(he))}}async function $(ee){const Q=H.projectGroups.flatMap(he=>he.features).find(he=>he.featureId===ee);if(!(!Q||!await i.confirm({title:"Delete Feature",description:`Delete "${Q.title}"? Its chats will move to General and the feature folder will be removed.`,confirmLabel:"Delete",confirmVariant:"destructive"})))try{await s.command({type:"feature.delete",featureId:ee}),n===ee&&r("/"),a(null)}catch(he){a(he instanceof Error?he.message:String(he))}}async function T(ee,Q){const te=G();m(he=>({...he,featureBrowserStateById:{...he.featureBrowserStateById,[ee]:{value:Q,opId:te}}}));try{await s.command({type:"feature.setBrowserState",featureId:ee,browserState:Q}),a(null)}catch(he){m(ie=>({...ie,featureBrowserStateById:qd(ie.featureBrowserStateById,ee,te)})),a(he instanceof Error?he.message:String(he))}}async function X(ee,Q){const te=G();m(he=>({...he,projectBrowserStateById:{...he.projectBrowserStateById,[ee]:{value:Q,opId:te}}}));try{await s.command({type:"project.setBrowserState",projectId:ee,browserState:Q}),a(null)}catch(he){m(ie=>({...ie,projectBrowserStateById:qd(ie.projectBrowserStateById,ee,te)})),a(he instanceof Error?he.message:String(he))}}async function Z(ee,Q){const te=G();m(he=>({...he,projectGeneralChatsBrowserStateById:{...he.projectGeneralChatsBrowserStateById,[ee]:{value:Q,opId:te}}}));try{await s.command({type:"project.setGeneralChatsBrowserState",projectId:ee,browserState:Q}),a(null)}catch(he){m(ie=>({...ie,projectGeneralChatsBrowserStateById:qd(ie.projectGeneralChatsBrowserStateById,ee,te)})),a(he instanceof Error?he.message:String(he))}}async function J(ee,Q){const te=G();m(he=>({...he,featureStageById:{...he.featureStageById,[ee]:{value:Q,opId:te}}}));try{await s.command({type:"feature.setStage",featureId:ee,stage:Q}),a(null)}catch(he){m(ie=>({...ie,featureStageById:qd(ie.featureStageById,ee,te)})),a(he instanceof Error?he.message:String(he))}}async function re(ee,Q){try{const te=await s.command({type:"feature.updateOverview",featureId:ee,content:Q});return a(null),te}catch(te){const he=te instanceof Error?te.message:String(te);throw a(he),te}}async function ae(ee,Q){const te=G();m(he=>({...he,featureOrderByProjectId:{...he.featureOrderByProjectId,[ee]:{value:Q,opId:te}}}));try{const he=await s.command({type:"feature.reorder",projectId:ee,orderedFeatureIds:Q});j(he.sidebar),a(null)}catch(he){m(ie=>({...ie,featureOrderByProjectId:qd(ie.featureOrderByProjectId,ee,te)})),a(he instanceof Error?he.message:String(he))}}async function ue(ee,Q){await s.command({type:"project.setProjectMetadataDirectoryCommitMode",projectId:ee.projectId,localPath:ee.localPath,commitProjectMetadata:Q})}async function me(ee){try{await Promise.all(qoe((v==null?void 0:v.projects.map(Q=>({localPath:Q.localPath})))??H.projectGroups.map(Q=>({projectId:Q.groupKey,localPath:Q.localPath}))).map(Q=>ue(Q,ee))),a(null)}catch(Q){throw a(Q instanceof Error?Q.message:String(Q)),Q}}async function se(ee){const Q=H.projectGroups.find(ie=>ie.groupKey===ee);if(!Q)return;const te=Q.localPath.split("/").filter(Boolean).pop()??Q.localPath;if(await i.confirm({title:"Hide Project",description:`Hide "${te}" from ${ys}? Existing chats for this project will be removed from ${ys}, but the project itself is not deleted.`,confirmLabel:"Hide",confirmVariant:"destructive"}))try{await s.command({type:"project.remove",projectId:ee}),Ha.getState().clearProject(ee),dh.getState().clearProject(ee),(e&&u_(H.projectGroups,e)===ee||(S==null?void 0:S.projectId)===ee)&&r("/"),a(null)}catch(ie){a(ie instanceof Error?ie.message:String(ie))}}const oe=_.useMemo(()=>({sidebarData:H,completedChatIds:z,localProjects:v,featureOverviewSnapshot:S,sidebarReady:C,localProjectsReady:E,sidebarOpen:M,sidebarCollapsed:D,openSidebar:()=>O(!0),closeSidebar:()=>O(!1),collapseSidebar:()=>P(!0),expandSidebar:()=>P(!1),toggleProjectsSidebar:ee=>{if(ee){O(!1),P(Q=>!Q);return}O(Q=>!Q)},clearCompletedChatId:B,handleCreateFeature:ee=>c(ee),handleOpenFeatureOverview:ee=>{r(`/overview/${ee}`),O(!1),a(null)},handleRenameFeature:I,handleDeleteFeature:$,handleSetProjectBrowserState:X,handleSetProjectGeneralChatsBrowserState:Z,handleSetFeatureBrowserState:T,handleSetFeatureStage:J,handleReorderFeatures:ae,handleHideLocalProject:K,handleListDirectories:A,handleRemoveProject:se,handleUpdateFeatureOverview:re,handleSetCommitProjectMetadataDirectory:me}),[z,S,B,$,K,c,A,se,I,ae,me,T,J,X,Z,re,v,E,r,a,D,H,M,C,s]);return g.jsx(rO.Provider,{value:oe,children:t})}function hS(){const t=_.useContext(rO);if(!t)throw new Error("useSidebarContext must be used within SidebarProvider");return t}const iae=1e3,sae=4,oae=40*1024*1024,iO=_.createContext(void 0);function Kd(t,e){return!!(t&&e&&t.runtime.chatId===e)}function qm(t,e){return(t?JSON.stringify(t).length:0)+JSON.stringify(e).length+256}function aae(t){return!!(t.activeChatId&&t.restoredFromCache&&!t.restoredFromFreshCache)}function lae(t){var n;if(!(t!=null&&t.length))return null;let e=((n=t[0])==null?void 0:n.createdAt)??null;for(const r of t)(e===null||r.createdAt>e)&&(e=r.createdAt);return e}function p1(t,e){const n=t.filter(r=>r._id!==e);return n.length===t.length?t:n}const dy="optimistic:";function fR(t){return t.startsWith(dy)}function cae(t){const e=tl(t.loadedTranscriptEntries,[t.entry]);return{snapshot:t.snapshot&&t.snapshot.runtime.chatId===t.chatId?{...t.snapshot,messages:tl(t.snapshot.messages,[t.entry]),transcript:{...t.snapshot.transcript,entries:tl(t.snapshot.transcript.entries,[t.entry])}}:t.snapshot,loadedTranscriptEntries:e}}function uae(t){return{snapshot:t.snapshot===null?null:{...t.snapshot,messages:p1(t.snapshot.messages,t.entryId),transcript:{...t.snapshot.transcript,entries:p1(t.snapshot.transcript.entries,t.entryId)}},loadedTranscriptEntries:p1(t.loadedTranscriptEntries,t.entryId)}}function dae(t){return t.map(e=>JSON.stringify({_id:e._id,messageId:e.messageId??null,createdAt:e.createdAt,hidden:e.hidden??!1,kind:e.kind,payload:hae(e)})).join("")}function hae(t){switch(t.kind){case"user_prompt":return{content:t.content,attachments:t.attachments??[]};case"system_init":return{provider:t.provider,model:t.model,tools:t.tools,agents:t.agents,slashCommands:t.slashCommands,mcpServers:t.mcpServers,debugRaw:t.debugRaw??null};case"account_info":return t.accountInfo;case"assistant_text":case"assistant_thought":return t.text;case"tool_call":return t.tool;case"tool_result":return{toolId:t.toolId,content:t.content,isError:t.isError??!1,debugRaw:t.debugRaw??null};case"result":return{subtype:t.subtype,isError:t.isError,durationMs:t.durationMs,result:t.result,costUsd:t.costUsd??null};case"status":return t.status;case"compact_boundary":case"context_cleared":case"interrupted":return null;case"compact_summary":return t.summary;default:return t}}function fae(t){var n,r,i;const e=lae(t.loadedTranscriptEntries.length>0?t.loadedTranscriptEntries:(n=t.snapshot)==null?void 0:n.transcript.entries);return{cachedStatus:((r=t.snapshot)==null?void 0:r.runtime.status)??null,cachedUpdatedAt:((i=t.snapshot)==null?void 0:i.runtime.updatedAt)??e}}function mae(t){return t?t.updatedAt??t.lastMessageAt??null:null}function pae(t){return t.queuedReason===t.nextReason&&t.isQueued}function gae(t){return t.currentChat?t.cachedStatus===t.currentChat.status&&t.cachedUpdatedAt===mae(t.currentChat):!1}function tl(t,e){if(e.length===0)return t;if(t.length===0)return e===t?t:[...e];const n=new Set(t.map(f=>f._id)),r=new Set(t.flatMap(f=>f.kind==="tool_result"&&f.toolId&&fR(f._id)?[f.toolId]:[]));let i=!0,s=t[t.length-1];for(const f of e){if(n.has(f._id)){i=!1;break}if(f.createdAt<s.createdAt||f.createdAt===s.createdAt&&f._id.localeCompare(s._id)<=0){i=!1;break}if(f.kind==="tool_result"&&f.toolId&&r.has(f.toolId)){i=!1;break}s=f}if(i)return[...t,...e];const a=new Map;for(const f of t)a.set(f._id,f);for(const f of e)a.set(f._id,f);const c=new Set,d=new Map;for(const f of a.values()){if(f.kind!=="tool_result"||!f.toolId)continue;const m=d.get(f.toolId)??[];m.push(f._id),d.set(f.toolId,m),fR(f._id)&&c.add(f._id)}for(const f of d.values()){if(f.length<2)continue;const m=f.some(b=>c.has(b)),v=f.filter(b=>!c.has(b));if(!(!m||v.length!==1))for(const b of f)c.has(b)&&a.delete(b)}const u=[...a.values()].sort((f,m)=>f.createdAt!==m.createdAt?f.createdAt-m.createdAt:f._id.localeCompare(m._id));if(t.length===u.length){let f=!1;for(let m=0;m<t.length;m+=1){const v=t[m],b=u[m];if((v==null?void 0:v._id)!==(b==null?void 0:b._id)||!vae(v,b)){f=!0;break}}if(!f)return t}return u}function vae(t,e){if(t===e)return!0;if(!t||!e)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(!(i in e)||!Object.is(t[i],e[i]))return!1;return!0}function sO(t){return t.flatMap(e=>[...e.generalChats,...e.features.flatMap(n=>n.chats)])}function mR(t){return sO(t).some(e=>e.status==="starting"||e.status==="running")}function pR(t){return t.chat.chatId===t.activeChatId||t.chat.provider!=="claude"&&t.chat.provider!=="codex"&&t.chat.provider!=="cursor"||t.chat.status==="starting"||t.chat.status==="running"?null:t.chat.status==="waiting_for_user"?"waiting_for_user":t.completedChatIds.has(t.chat.chatId)?"completed":null}function bae(t){const e=[];for(const n of t.cachedChatIdsNewestFirst){if(e.length>=t.limit)break;if(n===t.activeChatId)continue;const r=tu(t.projectGroups,n);r&&(r.status!=="starting"&&r.status!=="running"||e.push(n))}return e}function gR(t,e){if(!t||t.runtime.chatId!==e.chatId)return t;switch(e.type){case"chat.message-appended":{const n=tl(t.transcript.entries,[e.entry]),r=Math.max(t.runtime.updatedAt??0,e.entry.createdAt);return{...t,messages:n,runtime:{...t.runtime,updatedAt:r},transcript:{...t.transcript,entries:n}}}case"chat.messages-appended":{const n=tl(t.transcript.entries,e.entries),r=e.entries.reduce((i,s)=>Math.max(i,s.createdAt),t.runtime.updatedAt??0);return{...t,messages:n,runtime:{...t.runtime,updatedAt:r},transcript:{...t.transcript,entries:n}}}case"chat.status-set":return{...t,runtime:{...t.runtime,status:e.status}};case"chat.title-set":return{...t,runtime:{...t.runtime,title:e.title}};case"chat.provider-set":return{...t,runtime:{...t.runtime,provider:e.provider}};case"chat.plan-mode-set":return{...t,runtime:{...t.runtime,planMode:e.planMode}};case"chat.pending-tool-set":return{...t,runtime:{...t.runtime,pendingTool:e.pendingTool}};case"chat.session-token-set":return{...t,runtime:{...t.runtime,sessionToken:e.sessionToken,hydrationState:e.hydrationState}};case"chat.usage-set":return{...t,usage:e.usage};case"chat.available-providers-set":return{...t,availableProviders:e.availableProviders,providerSettings:e.providerSettings??t.providerSettings};case"chat.transcript-window-meta-set":return{...t,transcript:{...t.transcript,hasOlder:e.hasOlder,oldestEntryId:e.oldestEntryId,hydrationState:e.hydrationState??t.transcript.hydrationState}};case"chat.deleted":return null}}function _ae({children:t,activeChatId:e}){var so,oo,na;const n=tc(),r=Ly(),{socket:i}=Vh(),{providerSettings:s}=Hu(),{sidebarData:a,sidebarReady:c,localProjects:d,featureOverviewSnapshot:u,closeSidebar:f,completedChatIds:m,clearCompletedChatId:v}=hS(),{createFeatureModalProjectId:b,handleCloseCreateFeatureModal:S,setCommandError:x}=Fu(),[C,k]=_.useState(null),[E,R]=_.useState(!1),[M,O]=_.useState(null),[D,P]=_.useState(null),[z,Y]=_.useState([]),L=_.useRef([]),[W,V]=_.useState(!1),[F,U]=_.useState(null),[H,j]=_.useState(!1),[G,B]=_.useState(null),[K,A]=_.useState(!1),[I,$]=_.useState(!1),[T,X]=_.useState(148),[Z,J]=_.useState(!0),re=_.useRef(null),ae=_.useRef(!1),ue=_.useRef(null),me=_.useRef(!0),se=_.useRef(null),oe=_.useRef(null),ee=_.useRef(!1),Q=_.useRef(null),te=_.useRef(null),he=_.useRef(null),ie=_.useRef(null),xe=_.useRef(!1),Ae=_.useRef(null),Ke=_.useRef(null),mt=_.useRef(new Map),Ye=_.useRef(null),Ze=_.useRef(new Map),tt=_.useRef(0),it=_.useRef(new Map),ce=_.useRef([]),Re=_.useRef(new Map),Ue=_.useRef(null),[Je,Ve]=_.useState(0),[ze,He]=_.useState(0);function Xe(){Ke.current=null,oe.current=null,L.current=[],k(null),Y([]),V(!1),U(null),j(!1)}function ut(be){const we=Ae.current;if(!we)return()=>{};const Te=cae({snapshot:oe.current,chatId:we,loadedTranscriptEntries:L.current,entry:be}),Pe=Te.snapshot;return Pe&&(oe.current=Pe,k(Pe)),L.current=Te.loadedTranscriptEntries,Y(Te.loadedTranscriptEntries),()=>{var Ft;if(Ae.current!==we)return;const Ge=uae({snapshot:((Ft=oe.current)==null?void 0:Ft.runtime.chatId)===we?oe.current:null,loadedTranscriptEntries:L.current,entryId:be._id});oe.current=Ge.snapshot,L.current=Ge.loadedTranscriptEntries,k(Ge.snapshot),Y(Ge.loadedTranscriptEntries)}}function ft(be){const we=Ze.current.get(be);we&&(tt.current-=we.estimatedBytes,Ze.current.delete(be),Ve(Te=>Te+1))}function rt(be,we){const Te=Ze.current.get(be);Te&&(tt.current-=Te.estimatedBytes,Ze.current.delete(be));const Pe={...we,...fae({snapshot:we.snapshot,loadedTranscriptEntries:we.loadedTranscriptEntries})};for(Ze.current.set(be,Pe),tt.current+=Pe.estimatedBytes,Ve(Ge=>Ge+1);tt.current>oae&&Ze.current.size>1;){const Ge=Ze.current.keys().next().value;if(!Ge||Ge===e)break;const Ft=Ze.current.get(Ge);Ft&&(tt.current-=Ft.estimatedBytes),Ze.current.delete(Ge),Ve(hn=>hn+1)}}function Tt(be){const we=Ze.current.get(be);if(!we)return null;if(!Kd(we.snapshot,be))return tt.current-=we.estimatedBytes,Ze.current.delete(be),null;const Te={...we,isFresh:gae({cachedStatus:we.cachedStatus,cachedUpdatedAt:we.cachedUpdatedAt,currentChat:tu(a.projectGroups,be)})};return Ze.current.delete(be),Ze.current.set(be,Te),oe.current=Te.snapshot,k(Te.snapshot),Y(Te.loadedTranscriptEntries),Ke.current=Te.oldestLoadedEntryId,V(Te.hasOlderMessages),U(Te.oldestLoadedEntryId),j(!1),R(!0),Te}_.useLayoutEffect(()=>{L.current=z},[z]),_.useLayoutEffect(()=>{me.current=Z}),_.useEffect(()=>{if(!e){Ae.current=null,te.current=null,Ke.current=null,ie.current=null,oe.current=null,k(null),Y([]),V(!1),U(null),j(!1),A(!1),R(!0);return}const we=Ae.current!==e;if(Ae.current=e,we){Ye.current={chatId:e,startedAt:performance.now()},te.current=null,he.current=null,ie.current=null,Xe(),R(!1);const Te=Tt(e),Pe=!!Te;A(aae({activeChatId:e,restoredFromCache:Pe,restoredFromFreshCache:Te==null?void 0:Te.isFresh})),Pe?dR("chat_cache_hit_count",1,{chatId:e}):(dR("chat_cache_miss_count",1,{chatId:e}),Xe())}return i.subscribe({type:"chat",chatId:e},Te=>{Ae.current===e&&(oe.current=Te,k(Te),A(!1),R(!0),x(null))},Te=>{if(Ae.current!==e)return;A(!1);const Pe=gR(oe.current,Te);Pe===null?(ft(e),Xe()):(oe.current=Pe,k(Pe)),R(!0),x(null)})},[e,x,i]),_.useEffect(()=>{e&&v(e)},[e,v]),_.useEffect(()=>{const be=new Set(bae({cachedChatIdsNewestFirst:[...Ze.current.keys()].reverse(),projectGroups:a.projectGroups,activeChatId:e,limit:sae}));for(const[we,Te]of it.current)be.has(we)||(Te(),it.current.delete(we));for(const we of be){if(it.current.has(we))continue;const Te=i.subscribe({type:"chat",chatId:we},Pe=>{if(Ae.current!==we){if(!Kd(Pe,we)){ft(we);return}rt(we,{snapshot:Pe,loadedTranscriptEntries:[...Pe.transcript.entries],hasOlderMessages:Pe.transcript.hasOlder,oldestLoadedEntryId:Pe.transcript.oldestEntryId,estimatedBytes:qm(Pe,Pe.transcript.entries),cachedStatus:null,cachedUpdatedAt:null,isFresh:!0})}},Pe=>{if(Ae.current===we)return;const Ge=Ze.current.get(we),Ft=gR((Ge==null?void 0:Ge.snapshot)??null,Pe);if(Ft===null){ft(we);return}const hn=tl((Ge==null?void 0:Ge.loadedTranscriptEntries)??[],Ft.transcript.entries);rt(we,{snapshot:Ft,loadedTranscriptEntries:hn,hasOlderMessages:(Ge==null?void 0:Ge.hasOlderMessages)??Ft.transcript.hasOlder,oldestLoadedEntryId:(Ge==null?void 0:Ge.oldestLoadedEntryId)??Ft.transcript.oldestEntryId,estimatedBytes:qm(Ft,hn),cachedStatus:null,cachedUpdatedAt:null,isFresh:!0})});it.current.set(we,Te)}},[e,Je,a.projectGroups,i]),_.useEffect(()=>{const be=new Set,we=ce.current.filter(Pe=>{const Ge=tu(a.projectGroups,Pe);return!!(Ge&&Ge.chatId!==e)});let Te=we.length!==ce.current.length;for(const Pe of sO(a.projectGroups)){be.add(Pe.chatId);const Ge=pR({chat:Pe,activeChatId:e,completedChatIds:m});if(!Ge){Re.current.delete(Pe.chatId);continue}const Ft=we.includes(Pe.chatId);pae({queuedReason:Re.current.get(Pe.chatId),nextReason:Ge,isQueued:Ft})||(Re.current.set(Pe.chatId,Ge),Ft||(we.push(Pe.chatId),Te=!0))}for(const Pe of[...Re.current.keys()])be.has(Pe)||Re.current.delete(Pe);Te&&(ce.current=we,He(Pe=>Pe+1))},[e,m,a.projectGroups]),_.useEffect(()=>{u&&O(u.projectId)},[u]),_.useEffect(()=>()=>{for(const be of it.current.values())be();it.current.clear()},[]),_.useEffect(()=>{if(Ue.current||mR(a.projectGroups))return;const be=ce.current.find(Te=>Te!==e);if(!be)return;const we=window.setTimeout(()=>{const Te=tu(a.projectGroups,be),Pe=Te?pR({chat:Te,activeChatId:e,completedChatIds:m}):null;if(!Te||!Pe||mR(a.projectGroups)){ce.current=ce.current.filter(Ge=>Ge!==be),He(Ge=>Ge+1);return}Ue.current=be,i.command({type:"chat.prefetch",chatId:be}).then(Ge=>{if(!Kd(Ge,be)){ft(be);return}rt(be,{snapshot:Ge,loadedTranscriptEntries:[...Ge.transcript.entries],hasOlderMessages:Ge.transcript.hasOlder,oldestLoadedEntryId:Ge.transcript.oldestEntryId,estimatedBytes:qm(Ge,Ge.transcript.entries),cachedStatus:null,cachedUpdatedAt:null,isFresh:!0})}).catch(Ge=>{}).finally(()=>{Ue.current===be&&(Ue.current=null),ce.current=ce.current.filter(Ge=>Ge!==be),He(Ge=>Ge+1)})},iae);return()=>window.clearTimeout(we)},[e,ze,m,a.projectGroups,i]),_.useEffect(()=>{if(M)return;const be=a.projectGroups[0];be&&O(be.groupKey)},[M,a.projectGroups]),_.useEffect(()=>{if(!e||!c||!E)return;if(a.projectGroups.some(we=>[...we.generalChats,...we.features.flatMap(Te=>Te.chats)].some(Te=>Te.chatId===e))){D===e&&P(null);return}D!==e&&n("/")},[e,E,n,D,a.projectGroups,c]),_.useEffect(()=>{e&&Kd(C,e)&&rt(e,{snapshot:C,loadedTranscriptEntries:z,hasOlderMessages:W,oldestLoadedEntryId:F,estimatedBytes:qm(C,z),cachedStatus:null,cachedUpdatedAt:null,isFresh:!0})},[e,C,W,z,F]),_.useEffect(()=>{if(!C)return;O(C.runtime.projectId),C.transcript.hydrationState==="provider"?ie.current=C.runtime.chatId:ie.current===C.runtime.chatId&&(ie.current=null),!!Ke.current&&Ke.current!==C.transcript.oldestEntryId?(Y(we=>{var Pe;const Te=tl(we,C.transcript.entries);return Ke.current=((Pe=Te[0])==null?void 0:Pe._id)??null,Te}),V(we=>we&&C.transcript.hasOlder)):(Ke.current=C.transcript.oldestEntryId,Y([...C.transcript.entries]),V(C.transcript.hasOlder),U(C.transcript.oldestEntryId))},[C]),_.useEffect(()=>{ee.current=!1,Q.current!==null&&(window.cancelAnimationFrame(Q.current),Q.current=null),ie.current=null,ae.current=!1,ue.current=null,J(!0)},[e]),_.useEffect(()=>()=>{Q.current!==null&&window.cancelAnimationFrame(Q.current)},[]),_.useLayoutEffect(()=>{if(!ee.current)return;const be=re.current;be&&me.current&&(be.scrollTop=be.scrollHeight)},[e,z]),_.useLayoutEffect(()=>{const be=se.current;if(!be)return;const we=new ResizeObserver(()=>{X(be.getBoundingClientRect().height)});return we.observe(be),X(be.getBoundingClientRect().height),()=>we.disconnect()},[]);const lt=e?(()=>{const be=Ze.current.get(e)??null;return Kd((be==null?void 0:be.snapshot)??null,e)?be:null})():null,ht=_.useMemo(()=>{const be=xK(C,e);return be||((lt==null?void 0:lt.snapshot)??null)},[lt,e,C]),Be=z.length>0?z:(lt==null?void 0:lt.loadedTranscriptEntries)??[],$e=_.useMemo(()=>{const be=ht;if(!be)return[];const we=Be,Te=be.runtime.chatId,Pe=dae(we),Ge=mt.current.get(Te);if((Ge==null?void 0:Ge.signature)===Pe)return Ge.messages;const Ft=Boe(we);return mt.current.set(Te,{signature:Pe,messages:Ft}),Ft},[ht,Be]),Le=_.useMemo(()=>Woe($e),[$e]),Fe=(ht==null?void 0:ht.runtime)??null,ye=(ht==null?void 0:ht.usage)??null,Ie=e&&D===e&&!Fe?"starting":Fe==null?void 0:Fe.status,Qe=!!(e&&!ht),gt=(ht==null?void 0:ht.availableProviders)??jT((s==null?void 0:s.settings)??Tp),Wt=cy(Ie),wt=Voe(Ie),xt=vK(T),Qt=!Z&&$e.length>0,kt=((so=d==null?void 0:d.projects[0])==null?void 0:so.localPath)??null,Dt=(u==null?void 0:u.localPath)??(Fe==null?void 0:Fe.localPath)??kt??((oo=a.projectGroups[0])==null?void 0:oo.localPath),wn=!!(M??(u==null?void 0:u.projectId)??(Fe==null?void 0:Fe.projectId)??((na=a.projectGroups[0])==null?void 0:na.groupKey)??kt);_.useEffect(()=>{!e||!ht||H||z.length>0||ht.transcript.hydrationState==="provider"&&he.current!==e&&(he.current=e,dn())},[e,ht,H,z.length]),_.useEffect(()=>{const be=Ye.current;!e||!be||be.chatId!==e||!E||($e.length>0||Fe)&&(tO("chat_switch_ready_ms",Math.round(performance.now()-be.startedAt),{chatId:e,cached:!!lt}),Ye.current=null)},[lt,e,E,$e.length,Fe==null?void 0:Fe.status]),_.useLayoutEffect(()=>{if(ee.current)return;const be=re.current;be&&(e&&!Fe||(be.scrollTo({top:be.scrollHeight,behavior:"auto"}),Q.current!==null&&window.cancelAnimationFrame(Q.current),Q.current=window.requestAnimationFrame(()=>{const we=re.current;we&&(we.scrollTo({top:we.scrollHeight,behavior:"auto"}),Q.current=null)}),ee.current=!0))},[e,T,$e.length,Fe]),_.useEffect(()=>{if(!ee.current||!Z)return;const be=window.requestAnimationFrame(()=>{const we=re.current;!we||!Z||(we.scrollTop=we.scrollHeight)});return()=>window.cancelAnimationFrame(be)},[e,T,Z]);function Zt(){const be=re.current;if(!be)return;const we=be.scrollTop,Te=be.scrollHeight-we-be.clientHeight,Pe=dN(Te);ue.current!==null&&we<ue.current&&(ae.current=!1),ue.current=we,Pe&&(ae.current=!1),ae.current||J(Pe)}function bn(){const be=re.current;J(!0),be&&(be.scrollTop=be.scrollHeight,ue.current=be.scrollTop,ae.current=!1)}function Hn(){bn()}async function dn(){var Ft,hn;const be=F??"",we=te.current;if(we&&we.chatId===e&&we.beforeEntryId===be)return;const Te=(ht==null?void 0:ht.transcript.hydrationState)==="provider"&&z.length===0;if(!e||H||!Te&&!F)return;const Pe=e,Ge=be;try{te.current={chatId:Pe,beforeEntryId:Ge},j(!0);const fn=await i.command({type:"chat.loadMore",chatId:Pe,beforeEntryId:Te?void 0:Ge||void 0});if(Ae.current!==Pe)return;Y(as=>tl(as,fn.entries)),fn.hydrationState==="provider"?ie.current=Pe:ie.current===Pe&&(ie.current=null),Ke.current=fn.oldestEntryId,V(fn.hasOlder),U(fn.oldestEntryId),x(null)}catch(fn){Ae.current===Pe&&x(fn instanceof Error?fn.message:String(fn))}finally{((Ft=te.current)==null?void 0:Ft.chatId)===Pe&&((hn=te.current)==null?void 0:hn.beforeEntryId)===Ge&&(te.current=null),Ae.current===Pe&&j(!1)}}async function pe(be,we){$o.getState().initializeComposerForNewChat();const Te=await i.command({type:"chat.create",projectId:be,featureId:we});O(be),P(Te.chatId),n(`/chat/${Te.chatId}`),f(),x(null)}async function de(be,we=fu.getState().commitProjectMetadataDirectory){await i.command({type:"project.setProjectMetadataDirectoryCommitMode",projectId:be.projectId,localPath:be.localPath,commitProjectMetadata:we})}async function Oe(be){return be.kind==="project_id"?{projectId:be.projectId}:be.kind==="local_path"?{projectId:(await i.command({type:"project.open",localPath:be.localPath})).projectId,localPath:be.localPath}:{projectId:(await i.command(be.project.mode==="new"?{type:"project.create",localPath:be.project.localPath,title:be.project.title}:{type:"project.open",localPath:be.project.localPath})).projectId,localPath:be.project.localPath}}async function Et(be){try{const we=be.kind==="project_id"?null:be.kind==="local_path"?be.localPath:be.project.localPath;we&&B(we);const{projectId:Te}=await Oe(be);await de({projectId:Te}),await pe(Te)}catch(we){x(we instanceof Error?we.message:String(we))}finally{B(null)}}async function _n(be,we){try{await pe(be,we)}catch(Te){x(Te instanceof Error?Te.message:String(Te))}}async function An(be){const we=b;if(we&&!(I||xe.current))try{xe.current=!0,$(!0);const Te=await i.command({type:"feature.create",projectId:we,title:be.title,description:be.description,generateOverview:fu.getState().showFeatureOverviewInSidebar});S(),await pe(we,Te.featureId)}catch(Te){x(Te instanceof Error?Te.message:String(Te))}finally{xe.current=!1,$(!1)}}async function Jn(be){await Et({kind:"local_path",localPath:be})}async function $n(be){await Et({kind:"project_request",project:be})}async function tn(be,we){var Te;try{let Pe=M??((Te=a.projectGroups[0])==null?void 0:Te.groupKey)??null;if(!e&&!Pe&&kt&&(Pe=(await i.command({type:"project.open",localPath:kt})).projectId,O(Pe)),!e&&!Pe)throw new Error("Open a project first");if(we!=null&&we.provider&&!JF(we.provider,(s==null?void 0:s.settings)??Tp))throw new Error(`${we.provider} is inactive.`);bn();const Ge=await i.command({type:"chat.send",chatId:e??void 0,projectId:e?void 0:Pe??void 0,provider:we==null?void 0:we.provider,message:be,model:we==null?void 0:we.model,modelOptions:we==null?void 0:we.modelOptions,planMode:we==null?void 0:we.planMode});!e&&Ge.chatId&&(P(Ge.chatId),n(`/chat/${Ge.chatId}`)),x(null)}catch(Pe){throw x(Pe instanceof Error?Pe.message:String(Pe)),Pe}}async function er(){if(e)try{await i.command({type:"chat.cancel",chatId:e})}catch(be){x(be instanceof Error?be.message:String(be))}}async function lr(be){if(await r.confirm({title:"Delete Chat",description:`Delete "${be.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await i.command({type:"chat.delete",chatId:be.chatId}),be.chatId===e){const Te=gK(a.projectGroups,be.chatId);n(Te?`/chat/${Te}`:"/")}}catch(Te){x(Te instanceof Error?Te.message:String(Te))}}async function Br(be){const we=await r.prompt({title:"Rename Chat",placeholder:"Chat name",initialValue:be.title,confirmLabel:"Rename"}),Te=we==null?void 0:we.trim();if(!(!Te||Te===be.title))try{await i.command({type:"chat.rename",chatId:be.chatId,title:Te}),x(null)}catch(Pe){x(Pe instanceof Error?Pe.message:String(Pe))}}async function Rn(be,we){try{await i.command({type:"chat.setFeature",chatId:be,featureId:we}),x(null)}catch(Te){x(Te instanceof Error?Te.message:String(Te))}}async function nn(be){var Te,Pe;const we=(Fe==null?void 0:Fe.localPath)??((Te=d==null?void 0:d.projects[0])==null?void 0:Te.localPath)??((Pe=a.projectGroups[0])==null?void 0:Pe.localPath);if(we)try{x(null),await a_({socket:i,action:be,localPath:we})}catch(Ge){x(Ge instanceof Error?Ge.message:String(Ge))}}function Fr(){var Pe;const be=e?tu(a.projectGroups,e):null,we=e?u_(a.projectGroups,e):null;if(be&&we){x(null),_n(we,be.featureId??void 0);return}const Te=yK({selectedProjectId:M,sidebarProjectId:(Pe=a.projectGroups[0])==null?void 0:Pe.groupKey,fallbackLocalProjectPath:kt});if(Te){x(null),Et(Te);return}x("Open a project first")}async function xr(be,we,Te){if(!e)return;const Pe=ut({_id:`${dy}${Ai()}`,createdAt:Date.now(),kind:"tool_result",toolId:be,content:{answers:Te},isError:!1});try{await i.command({type:"chat.respondTool",chatId:e,toolUseId:be,result:{questions:we,answers:Te}})}catch(Ge){Pe(),x(Ge instanceof Error?Ge.message:String(Ge))}}async function Jr(be,we,Te,Pe,Ge){if(!e)return;const Ft={confirmed:we,...Te?{clearContext:!0}:{},...Pe?{message:Pe}:{},...Ge?{attachments:Ge}:{}},hn=ut({_id:`${dy}${Ai()}`,createdAt:Date.now(),kind:"tool_result",toolId:be,content:Ft,isError:!1});try{await i.command({type:"chat.respondTool",chatId:e,toolUseId:be,result:Ft}),we&&$o.getState().setComposerPlanMode(!1)}catch(fn){hn(),we&&$o.getState().setComposerPlanMode(!0),x(fn instanceof Error?fn.message:String(fn))}}async function Un(be,we,Te){if(!e||!(Fe!=null&&Fe.projectId))return;const Pe=Fe.projectId,Ge=tu(a.projectGroups,e),Ft=(Ge==null?void 0:Ge.featureId)??void 0;try{const hn=await CK({socket:i,sourceChatId:e,toolUseId:be,projectId:Pe,featureId:Ft,entry:Te,planText:we});$o.getState().setComposerPlanMode(!1),O(Pe),P(hn.chatId),n(`/chat/${hn.chatId}`),f(),x(null)}catch(hn){throw x(hn instanceof Error?hn.message:String(hn)),hn}}const ul=_.useMemo(()=>({activeChatId:e,chatSnapshot:C,runtime:Fe,usage:ye,messages:$e,latestToolIds:Le,availableProviders:gt,processingStatus:Ie,isChatLoading:Qe,isRefreshingActiveChat:K,isProcessing:Wt,canCancel:wt,chatReady:E,pendingChatId:D,selectedProjectId:M,startingLocalPath:G,hasSelectedProject:wn,navbarLocalPath:Dt,scrollRef:re,inputRef:se,transcriptPaddingBottom:xt,showScrollButton:Qt,hasOlderMessages:W,oldestLoadedEntryId:F,isLoadingOlderMessages:H,updateScrollState:Zt,scrollToBottom:Hn,loadOlderMessages:dn,createChatForProject:pe,handleCreateChat:_n,handleConfirmCreateFeature:An,handleOpenLocalProject:Jn,handleCreateProject:$n,handleSend:tn,handleCancel:er,handleRenameChat:Br,handleDeleteChat:lr,handleSetChatFeature:Rn,handleOpenExternal:nn,handleCompose:Fr,handleAskUserQuestion:xr,handleExitPlanMode:Jr,handleHandoff:Un,isCreatingFeature:I}),[e,gt,wt,E,C,pe,b,r,bn,kt,xr,er,Fr,An,_n,$n,lr,Jr,Un,nn,Jn,tn,Rn,Br,wn,W,Qe,I,H,Wt,K,Le,dn,$e,Dt,n,F,D,Ie,s,Fe,M,x,Qt,a.projectGroups,G,Hn,i,xt,Zt,ye]);return g.jsx(iO.Provider,{value:ul,children:t})}function oO(){const t=_.useContext(iO);if(!t)throw new Error("useChatContext must be used within ChatProvider");return t}const Km="How can I help you?",yae=19,vR=72,xae=48,Gm="max-w-[800px] md:max-w-[920px]";function Sae(t){return t.isRefreshingActiveChat&&t.messageCount>0}function wae(t){return t.messageCount>0?null:t.isChatLoading?"loading":t.isProviderRecovering?"recovering":t.isProviderUnavailable?"unavailable":t.isProcessing?null:"empty"}function Cae(){var Fe,ye,Ie,Qe,gt,Wt,wt,xt,Qt,kt,Dt,wn,Zt,bn,Hn,dn,pe;const t=Vh(),e=Hu(),n=hS(),r=oO(),i=Fu(),s={...t,...e,...n,...r,...i},a=oN(de=>de.isOpen),c=_.useRef(null),d=_.useRef(null),u=_.useRef(null),[f,m]=_.useState(""),[v,b]=_.useState(!1),[S,x]=_.useState(0),[C,k]=_.useState(!1),[E,R]=_.useState(null),[M,O]=_.useState(0),D=_.useRef(((Fe=s.runtime)==null?void 0:Fe.planMode)??!1),P=_.useRef(null),z=zg("(min-width: 768px)"),Y=typeof window>"u"?!0:RZ(window.location.hostname),L=((ye=s.runtime)==null?void 0:ye.projectId)??null,W=_.useMemo(()=>hr.chatPlanMode(s.activeChatId??L??"composer"),[L,s.activeChatId]),F=Ha(de=>L?de.projects[L]:void 0)??LZ,H=dh(de=>L?de.projects[L]:void 0)??AZ,j=Ha(de=>de.addTerminal),G=Ha(de=>de.removeTerminal),B=Ha(de=>de.toggleVisibility),K=Ha(de=>de.resetMainSizes),A=Ha(de=>de.setMainSizes),I=Ha(de=>de.setTerminalSizes),$=dh(de=>de.toggleVisibility),T=dh(de=>de.setSize),X=Fp(de=>de.scrollbackLines),Z=Fp(de=>de.minColumnWidth),J=s.keybindings,re=$o(de=>de.composerState.provider),ae=f1(de=>de.pullRequestPrompt),ue=f1(de=>de.pullRequestUpdatePrompt),me=f1(de=>de.pullRequestProviders),se=_.useMemo(()=>({pullRequestPrompt:ae,pullRequestUpdatePrompt:ue,pullRequestProviders:me}),[ae,me,ue]),oe=_.useMemo(()=>lN(J),[J]),ee=((Ie=s.runtime)==null?void 0:Ie.provider)??re,Q=Sae({isRefreshingActiveChat:s.isRefreshingActiveChat,messageCount:s.messages.length}),te=wae({isChatLoading:s.isChatLoading,isProviderRecovering:s.activeChatId!==null&&((Qe=s.chatSnapshot)==null?void 0:Qe.transcript.hydrationState)==="provider"&&s.chatSnapshot.transcript.hasOlder,isProviderUnavailable:s.activeChatId!==null&&((gt=s.chatSnapshot)==null?void 0:gt.transcript.hydrationState)==="provider"&&!s.chatSnapshot.transcript.hasOlder,isProcessing:s.isProcessing,messageCount:s.messages.length}),he=_.useMemo(()=>BE({currentProvider:ee,settings:se}),[ee,se]),ie=F.terminals.length>0,xe=!!(L&&F.isVisible&&ie),Ae=!!(L&&ie),Ke=!!(L&&H.isVisible),mt=!!(L&&!z&&Ke),Ye=!!(L&&z),Ze=Math.max(80,s.transcriptPaddingBottom-xae),{isAnimating:tt,mainPanelGroupRef:it,terminalFocusRequestVersion:ce,terminalPanelRef:Re,terminalVisualRef:Ue}=YZ({showTerminalPane:xe,shouldRenderTerminalLayout:Ae,projectId:L,terminalLayout:F,chatInputRef:u}),{isAnimating:Je,panelGroupRef:Ve,sidebarPanelRef:ze,sidebarVisualRef:He}=qZ({projectId:L,shouldRenderRightSidebarLayout:Ye,showRightSidebar:Ke,rightSidebarSize:H.size});Doe({rootRef:d,fallbackRef:u,enabled:s.hasSelectedProject&&s.processingStatus!=="waiting_for_user",canCancel:s.canCancel}),_.useEffect(()=>{var de;E===null&&(D.current=((de=s.runtime)==null?void 0:de.planMode)??!1)},[E,s.activeChatId,(Wt=s.runtime)==null?void 0:Wt.planMode]),_.useEffect(()=>{var Et;const de=((Et=s.runtime)==null?void 0:Et.planMode)??!1;if(E===null){D.current=de;return}const Oe=P.current;if(!Oe){D.current=de;return}if(s.activeChatId===null){wm(Oe),P.current=null,R(null),D.current=de;return}E.chatId===s.activeChatId&&de!==E.originalRuntimePlanMode&&(de!==E.value&&$o.getState().setComposerPlanMode(de),wm(Oe),P.current=null,R(null),D.current=de)},[E,s.activeChatId,(wt=s.runtime)==null?void 0:wt.planMode]);const Xe=()=>{if(L){if(ie){k(!1),B(L);return}j(L)}},ut=()=>{k(de=>!de)},ft=de=>{var An;if(!L||!xe||tt.current)return;const Oe=de.chat,Et=de.terminal;if(!Number.isFinite(Oe)||!Number.isFinite(Et))return;const _n=((An=c.current)==null?void 0:An.getBoundingClientRect().height)??0;if(zZ(_n,Et)){K(L),B(L);return}A(L,[Oe,Et])};_.useEffect(()=>{if(s.messages.length!==0)return;m(""),b(!1);let de=0;const Oe=window.setInterval(()=>{de+=1,m(Km.slice(0,de)),de>=Km.length&&(window.clearInterval(Oe),b(!0))},yae);return()=>window.clearInterval(Oe)},[s.activeChatId,s.messages.length]),_.useEffect(()=>{function de(Oe){if(L){if(Ya(oe,"toggleEmbeddedTerminal",Oe)){Oe.preventDefault(),Xe();return}if(Ya(oe,"toggleRightSidebar",Oe)){Oe.preventDefault(),$(L);return}if(Ya(oe,"openInFinder",Oe)){if(!Y)return;Oe.preventDefault(),s.handleOpenExternal("open_finder");return}if(Ya(oe,"openInEditor",Oe)){if(!Y)return;Oe.preventDefault(),s.handleOpenExternal("open_editor");return}Ya(oe,"addSplitTerminal",Oe)&&(Oe.preventDefault(),j(L))}}return window.addEventListener("keydown",de),()=>window.removeEventListener("keydown",de)},[j,Y,Xe,L,oe,$]),_.useEffect(()=>{xe||k(!1)},[xe]),_.useEffect(()=>{const de=window.requestAnimationFrame(()=>{s.updateScrollState()}),Oe=window.setTimeout(()=>{s.updateScrollState()},ou);return()=>{window.cancelAnimationFrame(de),window.clearTimeout(Oe)}},[Ae,xe,s.updateScrollState]),_.useEffect(()=>{function de(){s.updateScrollState()}return window.addEventListener("resize",de),()=>window.removeEventListener("resize",de)},[s.updateScrollState]),_.useEffect(()=>{const de=c.current;if(!de||!Ae)return;const Oe=()=>{const _n=de.getBoundingClientRect().height;if(_n<=0)return;const An=_n*(F.mainSizes[1]/100);An<=0||x(Jn=>Math.abs(Jn-An)<1?Jn:An)},Et=new ResizeObserver(Oe);return Et.observe(de),Oe(),()=>Et.disconnect()},[L,Ae,F.mainSizes]);const rt=de=>Number.isFinite(de)?Math.min(Q_,Math.max(qg,de)):H.size,Tt=()=>{L&&$(L)},lt=_.useCallback(()=>{var de,Oe;return((de=s.runtime)==null?void 0:de.projectId)??s.selectedProjectId??((Oe=s.sidebarData.projectGroups[0])==null?void 0:Oe.groupKey)??null},[(xt=s.runtime)==null?void 0:xt.projectId,s.selectedProjectId,s.sidebarData.projectGroups]),ht=_.useCallback(async de=>{const Oe=lt();if(!Oe)throw new Error("Open a project first");const Et=await s.socket.command({type:"feature.create",projectId:Oe,title:de,description:"",generateOverview:fu.getState().showFeatureOverviewInSidebar});await s.handleCreateChat(Oe,Et.featureId)},[lt,s.handleCreateChat,s.socket]),Be=_.useCallback(()=>{const de=lt();if(!de)throw new Error("Open a project first");s.handleCreateFeature(de)},[lt,s.handleCreateFeature]),$e=_.useCallback(async(de,Oe)=>{var _n,An;const Et=de.text.trim();if(Et.startsWith("/")){const Jn=((_n=s.runtime)==null?void 0:_n.provider)??(Oe==null?void 0:Oe.provider)??re,$n=BE({currentProvider:Jn,settings:se}),tn=(An=Et.split(" ")[0])==null?void 0:An.slice(1).toLowerCase(),er=$n.find(lr=>lr.name.toLowerCase()===tn);if(er!=null&&er.handler){const lr={handleCompose:s.handleCompose,setPlanMode:Rn=>{var nn;if(!(E!==null&&E.chatId!==s.activeChatId)){if($o.getState().setComposerPlanMode(Rn),s.activeChatId){const Fr=((nn=s.runtime)==null?void 0:nn.planMode)??!1;if(Rn===Fr){wm(W),P.current=null,R(null);return}P.current=W,JA(W,{statusLabel:Rn?"Switching to plan mode...":"Switching to implement mode..."}),R({chatId:s.activeChatId,originalRuntimePlanMode:Fr,value:Rn})}else wm(W),P.current=null,R(null);O(Fr=>Fr+1)}},sendMessage:(Rn,nn)=>s.handleSend(Rn,nn),openFeatureModal:Be,createFeature:ht},Br=Et.slice(tn!=null&&tn.length?tn.length+1:0).trim();await er.handler(lr,{commandText:Et,remainder:Br,message:de,options:Oe});return}}return s.handleSend(de,Oe)},[re,se,W,lt,Be,ht,s.activeChatId,s.handleCancel,s.handleCompose,s.handleCreateFeature,s.handleCreateChat,s.handleSend,(Qt=s.runtime)==null?void 0:Qt.provider,s.socket]),Le=g.jsxs(bN,{ref:d,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",children:[g.jsxs(yN,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[g.jsx(nG,{sidebarCollapsed:s.sidebarCollapsed,hasCompletedChats:s.completedChatIds.size>0,onOpenSidebar:s.openSidebar,onExpandSidebar:s.expandSidebar,usage:s.usage,localPath:s.navbarLocalPath,embeddedTerminalVisible:xe,onToggleEmbeddedTerminal:L?Xe:void 0,rightSidebarVisible:Ke,onToggleRightSidebar:L?()=>$(L):void 0,onOpenExternal:Y?de=>{s.handleOpenExternal(de)}:void 0,editorLabel:s.editorLabel,projectId:L??void 0,socket:s.socket,finderShortcut:Y?oe.bindings.openInFinder:void 0,editorShortcut:Y?oe.bindings.openInEditor:void 0,terminalShortcut:oe.bindings.toggleEmbeddedTerminal,rightSidebarShortcut:oe.bindings.toggleRightSidebar}),g.jsxs(BD,{ref:s.scrollRef,onScroll:s.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[(kt=s.runtime)!=null&&kt.inactiveProviderMessage?g.jsxs("div",{className:Ce("mx-auto mt-[72px] rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-900 dark:text-amber-200",Gm),children:["This thread uses ",s.runtime.provider,", which is currently inactive. ",s.runtime.inactiveProviderMessage]}):null,s.messages.length===0&&!s.isProcessing?g.jsx("div",{style:{height:s.transcriptPaddingBottom},"aria-hidden":"true"}):null,s.messages.length>0||s.isProcessing?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:Ce("mx-auto animate-fade-in space-y-5 pt-[72px]",Gm),children:[s.messages.length>0?g.jsx(Toe,{messages:s.messages,isLoading:s.isProcessing,hasOlderMessages:s.hasOlderMessages,oldestLoadedEntryId:s.oldestLoadedEntryId,isLoadingOlderMessages:s.isLoadingOlderMessages,isAtBottom:s.showScrollButton===!1,localPath:(Dt=s.runtime)==null?void 0:Dt.localPath,latestToolIds:s.latestToolIds,pendingTool:((wn=s.runtime)==null?void 0:wn.pendingTool)??null,onOpenLocalLink:s.handleOpenLocalLink,onAskUserQuestionSubmit:s.handleAskUserQuestion,onExitPlanModeConfirm:s.handleExitPlanMode,onHandoff:s.handleHandoff,onLoadOlder:s.loadOlderMessages,availableProviders:s.availableProviders,scrollContainerRef:s.scrollRef}):null,s.isProcessing?g.jsx(EZ,{status:s.processingStatus}):null,s.commandError?g.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3",children:s.commandError}):null]}),g.jsx("div",{style:{height:s.transcriptPaddingBottom},"aria-hidden":"true"})]}):null]}),Q?g.jsx("div",{className:"pointer-events-none absolute inset-x-4 z-20 animate-fade-in",style:{top:vR,bottom:s.transcriptPaddingBottom},children:g.jsx("div",{className:Ce("mx-auto flex h-full items-center justify-center",Gm),children:g.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-border bg-background/90 px-4 py-2 text-sm text-muted-foreground shadow-sm backdrop-blur",children:[g.jsx(Fn,{className:"size-4 animate-spin"}),g.jsx("span",{children:"Refreshing chat…"})]})})}):null,te?g.jsx("div",{className:"pointer-events-none absolute inset-x-4 animate-fade-in",style:{top:vR,bottom:s.transcriptPaddingBottom},children:g.jsx("div",{className:Ce("mx-auto flex h-full items-center justify-center",Gm),children:g.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground gap-4 opacity-70",children:[g.jsx(sh,{className:"size-8 text-muted-foreground kaizen-empty-state-flower"}),te==="loading"||te==="recovering"||te==="unavailable"?g.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[te==="unavailable"?null:g.jsx(Fn,{className:"size-10 animate-spin text-muted-foreground/80"}),g.jsx("div",{className:"text-sm text-muted-foreground/90",children:te==="recovering"?"Recovering chat…":te==="unavailable"?"Chat history is unavailable.":"Loading chat…"})]}):g.jsx("div",{className:"text-base font-normal text-muted-foreground text-center max-w-xs flex items-center kaizen-empty-state-text","aria-label":Km,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:Km}),g.jsx("span",{className:"kaizen-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:f}),g.jsx("span",{className:"kaizen-typewriter-cursor-slot","aria-hidden":"true",children:g.jsx("span",{className:"kaizen-typewriter-cursor","data-typing-complete":v?"true":"false"})})]})]})})]})})},s.activeChatId??"new-chat"):null,g.jsx("div",{style:{bottom:Ze},className:Ce("pointer-events-none absolute left-1/2 -translate-x-1/2 z-30 transition-all",s.showScrollButton&&!a?"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:s.scrollToBottom,style:{lineHeight:0},className:"pointer-events-auto h-9 w-9 grid place-items-center transition-colors bg-background/80 dark:bg-card/40 backdrop-blur-lg hover:bg-muted/80 border border-border rounded-full cursor-pointer text-foreground/80 hover:text-foreground",children:g.jsx(AP,{style:{display:"block"},className:"h-4 w-4"})})})]}),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:s.inputRef,children:g.jsx(QK,{ref:u,onSubmit:$e,onCancel:()=>{s.handleCancel()},disabled:!s.hasSelectedProject||((Zt=s.runtime)==null?void 0:Zt.status)==="waiting_for_user"||!!((bn=s.runtime)!=null&&bn.inactiveProviderMessage),canCancel:s.canCancel,chatId:s.activeChatId,activeProvider:((Hn=s.runtime)==null?void 0:Hn.provider)??null,activeModel:((dn=s.runtime)==null?void 0:dn.model)??null,activePlanMode:((pe=s.runtime)==null?void 0:pe.planMode)??!1,availableProviders:s.availableProviders,keybindings:oe,slashCommands:he,requestedPlanMode:(E==null?void 0:E.chatId)===s.activeChatId?E.value:null,requestedPlanModeVersion:M,pendingPlanMode:(E==null?void 0:E.chatId)===s.activeChatId?E.value:null},s.activeChatId??"new-chat")})})]});return g.jsxs("div",{ref:c,className:"flex-1 flex flex-col min-w-0 relative",children:[Ye&&L?g.jsxs(op,{groupRef:Ve,orientation:"horizontal",className:"flex-1 min-h-0",onLayoutChange:de=>{var Et;if(!Ke||Je.current)return;const Oe=rt(de.rightSidebar);Math.abs(Oe-de.rightSidebar)<.1||(Et=Ve.current)==null||Et.setLayout({workspace:100-Oe,rightSidebar:Oe})},onLayoutChanged:de=>{!Ke||Je.current||T(L,rt(de.rightSidebar))},children:[g.jsx(Ll,{id:"workspace",defaultSize:`${100-H.size}%`,minSize:"50%",className:"min-h-0 min-w-0",children:Ae?g.jsxs(op,{groupRef:it,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:ft,children:[g.jsx(Ll,{id:"chat",defaultSize:`${F.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:Le}),g.jsx(ap,{withHandle:!0,orientation:"vertical",disabled:!xe,className:Ce(!xe&&"pointer-events-none opacity-0")}),g.jsx(Ll,{id:"terminal",defaultSize:`${F.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:Re,children:g.jsx("div",{ref:Ue,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":xe?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${ou}ms`},children:g.jsx("div",{style:S>0?{height:`${S}px`}:void 0,children:C?null:g.jsx(Wb,{projectId:L,layout:F,onAddTerminal:j,socket:s.socket,connectionStatus:s.connectionStatus,scrollback:X,minColumnWidth:Z,maximized:!1,splitTerminalShortcut:oe.bindings.addSplitTerminal,focusRequestVersion:ce,onToggleMaximized:ut,onRemoveTerminal:(de,Oe)=>{s.socket.command({type:"terminal.close",terminalId:Oe}).catch(()=>{}),G(de,Oe)},onTerminalLayout:I})})})})]},L):Le}),g.jsx(ap,{withHandle:!0,orientation:"horizontal",disabled:!Ke,className:Ce(!Ke&&"pointer-events-none opacity-0")}),g.jsx(Ll,{id:"rightSidebar",defaultSize:`${H.size}%`,maxSize:`${Q_}%`,className:"min-h-0 min-w-0",elementRef:ze,children:g.jsx("div",{ref:He,className:"h-full min-h-0 overflow-hidden","data-right-sidebar-open":Ke?"true":"false","data-right-sidebar-animated":"false","data-right-sidebar-visual":!0,style:{"--terminal-toggle-duration":`${ou}ms`},children:g.jsx(XE,{onClose:()=>$(L)})})})]},`${L}-right-sidebar`):Ae&&L?g.jsxs(op,{groupRef:it,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:ft,children:[g.jsx(Ll,{id:"chat",defaultSize:`${F.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:Le}),g.jsx(ap,{withHandle:!0,orientation:"vertical",disabled:!xe,className:Ce(!xe&&"pointer-events-none opacity-0")}),g.jsx(Ll,{id:"terminal",defaultSize:`${F.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:Re,children:g.jsx("div",{ref:Ue,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":xe?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${ou}ms`},children:g.jsx("div",{style:S>0?{height:`${S}px`}:void 0,children:C?null:g.jsx(Wb,{projectId:L,layout:F,onAddTerminal:j,socket:s.socket,connectionStatus:s.connectionStatus,scrollback:X,minColumnWidth:Z,maximized:!1,splitTerminalShortcut:oe.bindings.addSplitTerminal,focusRequestVersion:ce,onToggleMaximized:ut,onRemoveTerminal:(de,Oe)=>{s.socket.command({type:"terminal.close",terminalId:Oe}).catch(()=>{}),G(de,Oe)},onTerminalLayout:I})})})})]},L):Le,C&&L&&xe?g.jsx("div",{className:"absolute inset-0 z-30 flex min-h-0 min-w-0 flex-col bg-background/96 backdrop-blur-sm",children:g.jsx(Wb,{projectId:L,layout:F,onAddTerminal:j,socket:s.socket,connectionStatus:s.connectionStatus,scrollback:X,minColumnWidth:Z,maximized:!0,splitTerminalShortcut:oe.bindings.addSplitTerminal,focusRequestVersion:ce,onToggleMaximized:ut,onRemoveTerminal:(de,Oe)=>{s.socket.command({type:"terminal.close",terminalId:Oe}).catch(()=>{}),G(de,Oe)},onTerminalLayout:I})}):null,mt?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"fixed inset-0 z-40 bg-black/40 md:hidden",onClick:Tt}),g.jsx("div",{className:"fixed inset-0 z-50 flex flex-col bg-background/95 backdrop-blur-2xl md:hidden",children:g.jsx(XE,{onClose:Tt,className:"h-[var(--app-shell-height)]"})})]}):null]})}const kae="web+kaizen";function hy(t){return!t||!t.startsWith("/")||t.startsWith("//")?"/":t}function Eae(t){const e=new URLSearchParams(t),n=hy(e.get("target"));if(n!=="/")return n;const r=e.get("launch");if(!r)return"/";try{const i=new URL(r);return hy(i.searchParams.get("target"))}catch{return"/"}}function Rae(t){const e=new URL(`${kae}://open`);return e.searchParams.set("target",hy(t)),e.toString()}function Tae(t){return t.innerWidth<=820||t.matchMedia("(pointer: coarse)").matches}function Mae(t){return/\b(?:Chrome|CriOS|Edg|EdgA|EdgiOS)\b/i.test(t)}function Aae(t){return/iPhone|iPad|iPod/i.test(t)?"In Safari, tap Share, then Add to Home Screen.":/Android/i.test(t)?"Use your browser menu to install Kaizen to the home screen.":"Use your browser install action to save Kaizen as an app, or continue in the browser."}function Nae(){const t=ke.c(29),e=Yr(),n=cN();let r;t[0]!==e.search?(r=Eae(e.search),t[0]=e.search,t[1]=r):r=t[1];const i=r,[s,a]=_.useState(!1),[c,d]=_.useState(null);let u,f;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{const W=function(F){F.preventDefault(),d(F)};return window.addEventListener("beforeinstallprompt",W),()=>{window.removeEventListener("beforeinstallprompt",W)}},f=[],t[2]=u,t[3]=f):(u=t[2],f=t[3]),_.useEffect(u,f);let m,v;t[4]!==n||t[5]!==e.search||t[6]!==i?(m=()=>{if(n){window.location.replace(i);return}if(new URLSearchParams(e.search).has("launch")){window.location.replace(i);return}if(!Tae(window)){window.location.replace(i);return}if(!Mae(navigator.userAgent)){a(!0);return}const F=Rae(i),U=window.setTimeout(()=>{a(!0)},900),H=()=>{document.visibilityState==="hidden"&&window.clearTimeout(U)};return document.addEventListener("visibilitychange",H),window.location.assign(F),()=>{window.clearTimeout(U),document.removeEventListener("visibilitychange",H)}},v=[n,e.search,i],t[4]=n,t[5]=e.search,t[6]=i,t[7]=m,t[8]=v):(m=t[7],v=t[8]),_.useEffect(m,v);let b;t[9]!==c?(b=async function(){c&&(await c.prompt(),await c.userChoice.catch(Dae),d(null))},t[9]=c,t[10]=b):b=t[10];const S=b;let x;t[11]===Symbol.for("react.memo_cache_sentinel")?(x=Aae(navigator.userAgent),t[11]=x):x=t[11];const C=x;let k;t[12]===Symbol.for("react.memo_cache_sentinel")?(k=g.jsx("div",{className:"absolute inset-x-0 top-0 h-40 bg-[radial-gradient(circle_at_center,rgba(249,115,22,0.12),transparent_68%)] dark:bg-[radial-gradient(circle_at_center,rgba(251,146,60,0.14),transparent_68%)]"}),t[12]=k):k=t[12];let E,R;t[13]===Symbol.for("react.memo_cache_sentinel")?(E=g.jsx("div",{className:"mb-6 inline-flex rounded-full border border-orange-200 bg-orange-50 px-3 py-1 text-xs font-semibold uppercase tracking-[0.2em] text-orange-700 dark:border-orange-400/30 dark:bg-orange-400/10 dark:text-orange-200",children:"Remote handoff"}),R=g.jsxs("h1",{className:"font-logo text-3xl leading-none tracking-tight",children:["Open ",ys]}),t[13]=E,t[14]=R):(E=t[13],R=t[14]);const M=s?"Kaizen could not jump straight into the installed app on this device. You can keep going in the browser or install it for one-tap launches next time.":"Trying to open your installed Kaizen app. If it does not switch automatically, use the browser fallback below.";let O;t[15]!==M?(O=g.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-600 dark:text-slate-300",children:M}),t[15]=M,t[16]=O):O=t[16];let D;t[17]!==i?(D=g.jsx(Dh,{to:i,className:"block rounded-2xl bg-slate-950 px-4 py-3 text-center text-sm font-semibold text-white transition hover:bg-slate-800 dark:bg-white dark:text-slate-950 dark:hover:bg-slate-200",children:"Continue in browser"}),t[17]=i,t[18]=D):D=t[18];let P;t[19]!==S||t[20]!==c?(P=c?g.jsx("button",{type:"button",onClick:()=>{S()},className:"block w-full rounded-2xl border border-orange-300 bg-orange-50 px-4 py-3 text-sm font-semibold text-orange-800 transition hover:bg-orange-100 dark:border-orange-400/40 dark:bg-orange-400/10 dark:text-orange-100 dark:hover:bg-orange-400/20",children:"Install Kaizen"}):null,t[19]=S,t[20]=c,t[21]=P):P=t[21];let z;t[22]!==D||t[23]!==P?(z=g.jsxs("div",{className:"mt-6 space-y-3",children:[D,P]}),t[22]=D,t[23]=P,t[24]=z):z=t[24];let Y;t[25]===Symbol.for("react.memo_cache_sentinel")?(Y=g.jsxs("div",{className:"mt-6 rounded-2xl border border-slate-200/80 bg-slate-50/90 p-4 text-sm leading-6 text-slate-700 dark:border-slate-700 dark:bg-slate-800/80 dark:text-slate-200",children:[g.jsx("p",{className:"font-semibold text-slate-950 dark:text-white",children:"Install hint"}),g.jsx("p",{className:"mt-1",children:C})]}),t[25]=Y):Y=t[25];let L;return t[26]!==O||t[27]!==z?(L=g.jsxs("main",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-[radial-gradient(circle_at_top,rgba(241,245,249,0.96),rgba(255,255,255,1)_42%),linear-gradient(135deg,#fff8ef_0%,#ffffff_45%,#eef6ff_100%)] px-5 py-8 text-slate-950 dark:bg-[radial-gradient(circle_at_top,rgba(30,41,59,0.92),rgba(15,23,42,1)_46%),linear-gradient(135deg,#0f172a_0%,#111827_45%,#1f2937_100%)] dark:text-slate-50",children:[k,g.jsxs("section",{className:"relative w-full max-w-sm overflow-hidden rounded-[2rem] border border-white/70 bg-white/88 p-6 shadow-[0_30px_120px_-32px_rgba(15,23,42,0.42)] backdrop-blur-xl dark:border-slate-700/70 dark:bg-slate-900/88",children:[E,R,O,z,Y]})]}),t[26]=O,t[27]=z,t[28]=L):L=t[28],L}function Dae(){}const Oae=3210;function jae(t,e){const n=new URLSearchParams(t),r=Number(n.get("localPort"));if(Number.isFinite(r)&&r>0)return Math.round(r);const i=Number(e);return Number.isFinite(i)&&i>0?Math.round(i):Oae}function Lae(t){return`tailscale serve --bg --https 443 http://127.0.0.1:${String(t)}`}function Iae(t){return new URLSearchParams(t).get("reason")==="serve_permission_denied"?"serve_permission_denied":null}function Pae(t){const n=new URLSearchParams(t).get("setupCommand");return n!=null&&n.trim()?n:null}const zae="https://tailscale.com/download",Bae="https://tailscale.com/kb/1242/tailscale-serve",Fae="https://tailscale.com/docs/how-to/set-up-https-certificates";function Hae(){const t=ke.c(35),e=Yr();let n;t[0]!==e.search?(n=jae(e.search,window.location.port),t[0]=e.search,t[1]=n):n=t[1];const r=n;let i;t[2]!==e.search?(i=Iae(e.search),t[2]=e.search,t[3]=i):i=t[3];const s=i;let a;t[4]!==e.search?(a=Pae(e.search),t[4]=e.search,t[5]=a):a=t[5];const c=a;let d;t[6]!==r?(d=Lae(r),t[6]=r,t[7]=d):d=t[7];const u=d;let f;t[8]===Symbol.for("react.memo_cache_sentinel")?(f=g.jsx("div",{className:"absolute inset-x-0 top-0 h-40 bg-[radial-gradient(circle_at_center,rgba(249,115,22,0.12),transparent_68%)] dark:bg-[radial-gradient(circle_at_center,rgba(251,146,60,0.14),transparent_68%)]"}),t[8]=f):f=t[8];let m,v,b;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=g.jsx("div",{className:"mb-6 inline-flex rounded-full border border-orange-200 bg-orange-50 px-3 py-1 text-xs font-semibold uppercase tracking-[0.2em] text-orange-700 dark:border-orange-400/30 dark:bg-orange-400/10 dark:text-orange-200",children:"Remote setup"}),v=g.jsxs("h1",{className:"font-logo text-3xl leading-none tracking-tight",children:["Enable remote ",ys]}),b=g.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-600 dark:text-slate-300",children:"Kaizen remote mode works best over Tailscale. If HTTPS handoff is not ready yet, use the steps below to install Tailscale, join your tailnet, and expose this local Kaizen session through Tailscale Serve."}),t[9]=m,t[10]=v,t[11]=b):(m=t[9],v=t[10],b=t[11]);let S;t[12]!==c||t[13]!==s?(S=s==="serve_permission_denied"&&c?g.jsxs("section",{className:"mt-6 rounded-2xl border border-orange-300 bg-orange-50/90 p-4 text-sm leading-6 text-orange-950 dark:border-orange-400/40 dark:bg-orange-400/10 dark:text-orange-100",children:[g.jsx("p",{className:"font-semibold",children:"One-time machine setup needed"}),g.jsx("p",{className:"mt-1",children:"Tailscale is connected, but this user is not allowed to change Serve config yet. Run this once on the Kaizen machine:"}),g.jsx("pre",{className:"mt-3 overflow-x-auto rounded-2xl bg-slate-950 p-4 text-xs text-slate-50",children:g.jsx("code",{children:c})})]}):null,t[12]=c,t[13]=s,t[14]=S):S=t[14];let x,C;t[15]===Symbol.for("react.memo_cache_sentinel")?(C=g.jsx("p",{className:"font-semibold text-slate-950 dark:text-white",children:"1. Install and connect Tailscale"}),x=g.jsx("p",{className:"mt-1 text-slate-700 dark:text-slate-200",children:"Install Tailscale on this machine and on the device you want to open Kaizen from. Then sign in and connect both devices to the same tailnet."}),t[15]=x,t[16]=C):(x=t[15],C=t[16]);let k;t[17]===Symbol.for("react.memo_cache_sentinel")?(k=g.jsxs("section",{className:"rounded-2xl border border-slate-200/80 bg-slate-50/90 p-4 dark:border-slate-700 dark:bg-slate-800/80",children:[C,x,g.jsxs("div",{className:"mt-3 flex flex-wrap gap-3",children:[g.jsx("a",{href:zae,target:"_blank",rel:"noreferrer",className:"rounded-xl border border-slate-300 px-3 py-2 font-medium text-slate-900 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-100 dark:hover:bg-slate-700",children:"Download Tailscale"}),g.jsx("code",{className:"rounded-xl bg-slate-950 px-3 py-2 text-xs text-slate-50 dark:bg-slate-950",children:"tailscale up"})]})]}),t[17]=k):k=t[17];let E,R;t[18]===Symbol.for("react.memo_cache_sentinel")?(E=g.jsx("p",{className:"font-semibold text-slate-950 dark:text-white",children:"2. Turn on HTTPS handoff with Tailscale Serve"}),R=g.jsx("p",{className:"mt-1 text-slate-700 dark:text-slate-200",children:"Run this on the machine where Kaizen is already running. It tells Tailscale to publish your local Kaizen port behind your tailnet HTTPS URL."}),t[18]=E,t[19]=R):(E=t[18],R=t[19]);let M;t[20]!==u?(M=g.jsx("pre",{className:"mt-3 overflow-x-auto rounded-2xl bg-slate-950 p-4 text-xs text-slate-50",children:g.jsx("code",{children:u})}),t[20]=u,t[21]=M):M=t[21];let O;t[22]===Symbol.for("react.memo_cache_sentinel")?(O=g.jsx("p",{className:"mt-3 text-slate-700 dark:text-slate-200",children:"If Tailscale says Serve is not enabled on your tailnet, an admin needs to enable HTTPS certificates and Serve support first."}),t[22]=O):O=t[22];let D;t[23]===Symbol.for("react.memo_cache_sentinel")?(D=g.jsxs("div",{className:"mt-3 flex flex-wrap gap-3",children:[g.jsx("a",{href:Bae,target:"_blank",rel:"noreferrer",className:"rounded-xl border border-slate-300 px-3 py-2 font-medium text-slate-900 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-100 dark:hover:bg-slate-700",children:"Tailscale Serve docs"}),g.jsx("a",{href:Fae,target:"_blank",rel:"noreferrer",className:"rounded-xl border border-slate-300 px-3 py-2 font-medium text-slate-900 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-100 dark:hover:bg-slate-700",children:"Enable HTTPS certs"})]}),t[23]=D):D=t[23];let P;t[24]!==M?(P=g.jsxs("section",{className:"rounded-2xl border border-slate-200/80 bg-slate-50/90 p-4 dark:border-slate-700 dark:bg-slate-800/80",children:[E,R,M,O,D]}),t[24]=M,t[25]=P):P=t[25];let z;t[26]===Symbol.for("react.memo_cache_sentinel")?(z=g.jsx("p",{className:"font-semibold text-slate-950 dark:text-white",children:"3. Start Kaizen remote mode again"}),t[26]=z):z=t[26];let Y;t[27]===Symbol.for("react.memo_cache_sentinel")?(Y=g.jsx("pre",{className:"mt-3 overflow-x-auto rounded-2xl bg-slate-950 p-4 text-xs text-slate-50",children:g.jsx("code",{children:"kaizen --remote"})}),t[27]=Y):Y=t[27];let L;t[28]===Symbol.for("react.memo_cache_sentinel")?(L=g.jsxs("section",{className:"rounded-2xl border border-slate-200/80 bg-slate-50/90 p-4 dark:border-slate-700 dark:bg-slate-800/80",children:[z,Y,g.jsxs("p",{className:"mt-3 text-slate-700 dark:text-slate-200",children:["Once Serve is ready, Kaizen should print an"," ",g.jsx("span",{className:"font-semibold",children:"https://…ts.net/open"})," QR handoff URL instead of the HTTP fallback."]})]}),t[28]=L):L=t[28];let W;t[29]!==P?(W=g.jsxs("div",{className:"mt-6 space-y-4 text-sm leading-6",children:[k,P,L]}),t[29]=P,t[30]=W):W=t[30];let V;t[31]===Symbol.for("react.memo_cache_sentinel")?(V=g.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:g.jsx(Dh,{to:"/",className:"rounded-2xl bg-slate-950 px-4 py-3 text-sm font-semibold text-white transition hover:bg-slate-800 dark:bg-white dark:text-slate-950 dark:hover:bg-slate-200",children:"Back to Kaizen"})}),t[31]=V):V=t[31];let F;return t[32]!==W||t[33]!==S?(F=g.jsxs("main",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-[radial-gradient(circle_at_top,rgba(241,245,249,0.96),rgba(255,255,255,1)_42%),linear-gradient(135deg,#fff8ef_0%,#ffffff_45%,#eef6ff_100%)] px-5 py-8 text-slate-950 dark:bg-[radial-gradient(circle_at_top,rgba(30,41,59,0.92),rgba(15,23,42,1)_46%),linear-gradient(135deg,#0f172a_0%,#111827_45%,#1f2937_100%)] dark:text-slate-50",children:[f,g.jsxs("section",{className:"relative w-full max-w-2xl overflow-hidden rounded-[2rem] border border-white/70 bg-white/88 p-6 shadow-[0_30px_120px_-32px_rgba(15,23,42,0.42)] backdrop-blur-xl dark:border-slate-700/70 dark:bg-slate-900/88",children:[m,v,b,S,W,V]})]}),t[32]=W,t[33]=S,t[34]=F):F=t[34],F}function bR(){return{baselineEstablished:!1,dedupeByChatId:new Map,statusByChatId:new Map}}function $ae(t){const e=[];for(const n of t.projectGroups){for(const r of n.generalChats)e.push({chat:r,projectTitle:n.title});for(const r of n.features)for(const i of r.chats)e.push({chat:i,projectTitle:n.title})}return e}function Vle(t=null){return sf()?Notification.permission:t??"unsupported"}function qle(t){return t==="granted"?"Allowed":t==="denied"?"Blocked":t==="default"?"Not requested":"Unsupported"}async function Kle(){return sf()?Notification.requestPermission():"unsupported"}function sf(){return typeof window<"u"&&window.isSecureContext&&typeof Notification<"u"}function Uae({activeChatId:t,chatId:e,documentVisible:n}){return!n||t!==e}function aO(t){return t==="starting"||t==="running"}function Wae(t,e){const n=aO(t),r=t==="waiting_for_user";return n&&e==="waiting_for_user"?"needs_input":(n||r)&&e==="idle"?"completed":null}function Vae({activeChatId:t,documentVisible:e,previousState:n,sidebarData:r}){const i=new Map,s=new Map(n.dedupeByChatId),a=[],c=$ae(r);for(const{chat:d,projectTitle:u}of c){const f=n.statusByChatId.get(d.chatId);if(i.set(d.chatId,d.status),(aO(d.status)||d.status==="failed")&&s.delete(d.chatId),!n.baselineEstablished)continue;const m=Wae(f,d.status);m&&Uae({activeChatId:t,chatId:d.chatId,documentVisible:e})&&s.get(d.chatId)!==m&&(s.set(d.chatId,m),a.push({chatId:d.chatId,chatTitle:d.title,eventId:`${d.chatId}:${m}:${Date.now()}`,projectTitle:u,kind:m}))}return{events:a,nextState:{baselineEstablished:!0,dedupeByChatId:s,statusByChatId:i}}}let g1=null;function qae(){if(typeof window>"u")return null;const t=window.AudioContext;return t?(g1||(g1=Promise.resolve(new t)),g1):null}function _R({audioContext:t,startAt:e,duration:n,frequency:r,gainValue:i}){const s=t.createOscillator(),a=t.createGain(),c=e+.012,d=e+Math.max(n-.08,.02),u=e+n;s.type="sine",s.frequency.setValueAtTime(r,e),a.gain.setValueAtTime(1e-4,e),a.gain.exponentialRampToValueAtTime(i,c),a.gain.setValueAtTime(i,d),a.gain.exponentialRampToValueAtTime(1e-4,u),s.connect(a),a.connect(t.destination),s.start(e),s.stop(u)}async function Kae(){const t=await qae();if(!t)return;t.state==="suspended"&&await t.resume();const e=t.currentTime;_R({audioContext:t,startAt:e,duration:.24,frequency:880,gainValue:.14}),_R({audioContext:t,startAt:e+.12,duration:.34,frequency:1318.51,gainValue:.18})}function Gae(t){typeof navigator>"u"||typeof navigator.vibrate!="function"||navigator.vibrate(t==="needs_input"?[180,100,180]:[120])}function Yae(t,e){if(!sf()||Notification.permission!=="granted")return null;const n=new Notification(t.chatTitle,{body:t.kind==="needs_input"?`${t.projectTitle} needs your input in ${ys}.`:`${t.projectTitle} finished responding in ${ys}.`,tag:t.eventId!==void 0?`kaizen:${t.eventId}`:`kaizen:${t.chatId}:${t.kind}:${Date.now()}`,icon:"/app-icon-192.png",badge:"/app-icon-96.png",requireInteraction:t.kind==="needs_input"});return n.onclick=()=>{window.focus(),e(),n.close()},n}async function Xae({event:t,onBrowserNotificationClick:e,preferences:n}){if(sf()){if(n.browserNotificationsEnabled&&Yae(t,e),n.soundEnabled)try{await Kae()}catch{}n.vibrationEnabled&&Gae(t.kind)}}function Qae(t){return{browserNotificationsEnabled:(t==null?void 0:t.browserNotificationsEnabled)===!0,soundEnabled:(t==null?void 0:t.soundEnabled)===!0,vibrationEnabled:(t==null?void 0:t.vibrationEnabled)===!0,lastPermissionState:(t==null?void 0:t.lastPermissionState)==="granted"||(t==null?void 0:t.lastPermissionState)==="denied"||(t==null?void 0:t.lastPermissionState)==="default"||(t==null?void 0:t.lastPermissionState)==="unsupported"?t.lastPermissionState:null}}function Zae(t){return t.signedIn&&t.browserNotificationsEnabled}const v1=fi()(Li(t=>({browserNotificationsEnabled:!1,soundEnabled:!1,vibrationEnabled:!1,lastPermissionState:null,setBrowserNotificationsEnabled:e=>t({browserNotificationsEnabled:e}),setSoundEnabled:e=>t({soundEnabled:e}),setVibrationEnabled:e=>t({vibrationEnabled:e}),setLastPermissionState:e=>t({lastPermissionState:e})}),{name:"notification-preferences",migrate:t=>Qae(t)}));function Jae(t){const e=ke.c(15),{activeChatId:n,connectionStatus:r,sidebarData:i}=t,s=tc(),{remoteAuth:a}=Hu(),c=Bg(a),d=v1(nle),u=v1(tle),f=v1(ele),m=Zae({browserNotificationsEnabled:d,signedIn:c.signedIn});let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=bR(),e[0]=v):v=e[0];const b=_.useRef(v),S=_.useRef(typeof document>"u"?!0:document.visibilityState==="visible");let x,C;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{const O=function(){S.current=document.visibilityState==="visible"};return document.addEventListener("visibilitychange",O),()=>document.removeEventListener("visibilitychange",O)},C=[],e[1]=x,e[2]=C):(x=e[1],C=e[2]),_.useEffect(x,C);let k,E;e[3]!==r?(k=()=>{r!=="connected"&&(b.current={...bR(),dedupeByChatId:b.current.dedupeByChatId})},E=[r],e[3]=r,e[4]=k,e[5]=E):(k=e[4],E=e[5]),_.useEffect(k,E);let R,M;return e[6]!==c.features.browserNotifications.enabled||e[7]!==n||e[8]!==m||e[9]!==s||e[10]!==i||e[11]!==u||e[12]!==f?(R=()=>{if(!c.features.browserNotifications.enabled||!sf())return;const{events:O,nextState:D}=Vae({activeChatId:n,documentVisible:S.current,previousState:b.current,sidebarData:i});b.current=D;for(const P of O)Xae({event:P,onBrowserNotificationClick:()=>{s(`/chat/${P.chatId}`)},preferences:{browserNotificationsEnabled:m,soundEnabled:u,vibrationEnabled:f}})},M=[n,c.features.browserNotifications.enabled,m,s,i,u,f],e[6]=c.features.browserNotifications.enabled,e[7]=n,e[8]=m,e[9]=s,e[10]=i,e[11]=u,e[12]=f,e[13]=R,e[14]=M):(R=e[13],M=e[14]),_.useEffect(R,M),null}function ele(t){return t.vibrationEnabled}function tle(t){return t.soundEnabled}function nle(t){return t.browserNotificationsEnabled}function rle(){const t=typeof navigator<"u"&&navigator.standalone===!0,e=typeof window<"u"&&window.matchMedia("(display-mode: standalone)").matches;return t||e}function ile(){const t=window.visualViewport,e=Math.round((t==null?void 0:t.height)??window.innerHeight),n=Math.max(0,Math.round((t==null?void 0:t.offsetTop)??0));return{height:e,offsetTop:n}}function sle(){const t=ke.c(1);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],_.useLayoutEffect(ole,e)}function ole(){let t=0,e=null,n=0;const r=rle(),i=()=>{t=0;const{height:c,offsetTop:d}=ile();e===null&&(e=d),c>n&&(n=c);const u=Math.max(0,d-e),f=n-c>120||u>12,m=document.documentElement;m.style.setProperty("--app-shell-height",`${c}px`),m.style.setProperty("--app-shell-offset-top",r?f?`max(0px, calc(${u}px - env(safe-area-inset-top)))`:"0px":`${u}px`),m.style.setProperty("--app-composer-bottom-padding",r?f?"0px":"max(12px, env(safe-area-inset-bottom))":f?"12px":"20px")},s=()=>{t!==0&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(i)};s();const a=window.visualViewport;return window.addEventListener("resize",s),window.addEventListener("orientationchange",s),a==null||a.addEventListener("resize",s),a==null||a.addEventListener("scroll",s),()=>{t!==0&&window.cancelAnimationFrame(t),window.removeEventListener("resize",s),window.removeEventListener("orientationchange",s),a==null||a.removeEventListener("resize",s),a==null||a.removeEventListener("scroll",s)}}function ale(t){const e=ke.c(7),{children:n,activeChatId:r,activeOverviewFeatureId:i}=t;let s;e[0]!==r||e[1]!==n?(s=g.jsx(_ae,{activeChatId:r,children:n}),e[0]=r,e[1]=n,e[2]=s):s=e[2];let a;return e[3]!==r||e[4]!==i||e[5]!==s?(a=g.jsx(kK,{children:g.jsx(MK,{children:g.jsx(AK,{children:g.jsx(rae,{activeChatId:r,activeOverviewFeatureId:i,children:s})})})}),e[3]=r,e[4]=i,e[5]=s,e[6]=a):a=e[6],a}const lle=`${Ky}last-seen-version`,cle=_.lazy(()=>_y(()=>import("./FeatureOverviewPage-Cbp5uhtA.js"),__vite__mapDeps([0,1])).then(t=>({default:t.FeatureOverviewPage}))),ule=_.lazy(()=>_y(()=>import("./LocalProjectsPage-CihqlQOs.js"),[]).then(t=>({default:t.LocalProjectsPage}))),dle=_.lazy(()=>_y(()=>import("./SettingsPage-jZce-i3Z.js"),__vite__mapDeps([2,1])).then(t=>({default:t.SettingsPage})));function b1(t){const e=ke.c(6),{label:n}=t;let r,i,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=g.jsx("div",{className:"mb-3 h-4 w-32 animate-pulse rounded-full bg-muted"}),i=g.jsx("div",{className:"mb-2 h-7 w-56 animate-pulse rounded-full bg-muted"}),s=g.jsx("div",{className:"mb-6 h-4 w-72 animate-pulse rounded-full bg-muted"}),e[0]=r,e[1]=i,e[2]=s):(r=e[0],i=e[1],s=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsxs("div",{className:"grid gap-3",children:[g.jsx("div",{className:"h-16 animate-pulse rounded-2xl bg-muted/80"}),g.jsx("div",{className:"h-16 animate-pulse rounded-2xl bg-muted/70"}),g.jsx("div",{className:"h-16 animate-pulse rounded-2xl bg-muted/60"})]}),e[3]=a):a=e[3];let c;return e[4]!==n?(c=g.jsx("div",{className:"flex flex-1 min-w-0 items-center justify-center bg-background",children:g.jsx("div",{className:"w-full max-w-3xl px-6",children:g.jsxs("div",{className:"rounded-3xl border border-border/70 bg-card/60 p-6 shadow-sm",children:[r,i,s,a,g.jsx("div",{className:"mt-4 text-sm text-muted-foreground",children:n})]})})}),e[4]=n,e[5]=c):c=e[5],c}function hle(t,e){return!(!e||t.defaultPrevented||t.isComposing||Uq(t.target))}function fle(){const t=ke.c(4),e=IR(),n=e.chatId??null,r=e.featureId??null;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=g.jsx(mle,{}),t[0]=i):i=t[0];let s;return t[1]!==n||t[2]!==r?(s=g.jsx(ale,{activeChatId:n,activeOverviewFeatureId:r,children:i}),t[1]=n,t[2]=r,t[3]=s):s=t[3],s}function mle(){const t=ke.c(108),e=Yr(),n=IR(),r=Vh(),i=Hu(),s=hS(),a=oO(),c=Fu(),d=n.featureId??null;let u;t[0]!==a||t[1]!==r||t[2]!==i||t[3]!==s||t[4]!==d||t[5]!==c?(u={...r,...i,...s,...a,...c,activeOverviewFeatureId:d},t[0]=a,t[1]=r,t[2]=i,t[3]=s,t[4]=d,t[5]=c,t[6]=u):u=t[6];const f=u,m=zg("(min-width: 768px)"),v=PE(gle),b=PE(ple),S=e.pathname==="/";let x;t[7]===Symbol.for("react.memo_cache_sentinel")?(x=LF.split("/")[1]??"unknown",t[7]=x):x=t[7];const C=x;let k;t[8]!==f.keybindings?(k=lN(f.keybindings),t[8]=f.keybindings,t[9]=k):k=t[9];const E=k;sle();let R,M;t[10]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{window.localStorage.setItem(lle,C)},M=[C],t[10]=R,t[11]=M):(R=t[10],M=t[11]),_.useEffect(R,M);let O;t[12]!==m||t[13]!==E||t[14]!==f?(O=()=>{const te=function(ie){const xe=Ya(E,"toggleProjectsSidebar",ie);hle(ie,xe)&&(ie.preventDefault(),f.toggleProjectsSidebar(m))};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},t[12]=m,t[13]=E,t[14]=f,t[15]=O):O=t[15];let D;t[16]!==m||t[17]!==E||t[18]!==f.toggleProjectsSidebar?(D=[m,E,f.toggleProjectsSidebar],t[16]=m,t[17]=E,t[18]=f.toggleProjectsSidebar,t[19]=D):D=t[19],_.useEffect(O,D);let P;t[20]===Symbol.for("react.memo_cache_sentinel")?(P={top:"var(--app-shell-offset-top)"},t[20]=P):P=t[20];let z,Y,L,W,V,F,U,H,j,G;t[21]!==f?(G=(te,he)=>{Ho(hr.chatCreate(te,he),()=>f.handleCreateChat(te,he),{statusLabel:"Starting chat..."})},z=te=>{f.handleCreateFeature(te)},Y=te=>{f.handleRenameFeature(te)},L=te=>{f.handleDeleteFeature(te)},W=(te,he)=>{f.handleSetProjectBrowserState(te,he)},V=(te,he)=>{f.handleSetProjectGeneralChatsBrowserState(te,he)},F=(te,he)=>{f.handleSetFeatureBrowserState(te,he)},U=(te,he)=>{f.handleSetFeatureStage(te,he)},H=(te,he)=>{f.handleSetChatFeature(te,he)},j=(te,he)=>{f.handleReorderFeatures(te,he)},t[21]=f,t[22]=z,t[23]=Y,t[24]=L,t[25]=W,t[26]=V,t[27]=F,t[28]=U,t[29]=H,t[30]=j,t[31]=G):(z=t[22],Y=t[23],L=t[24],W=t[25],V=t[26],F=t[27],U=t[28],H=t[29],j=t[30],G=t[31]);let B,K,A,I;t[32]!==f?(B=te=>{f.handleOpenFeatureOverview(te)},K=te=>{f.handleRenameChat(te)},A=te=>{f.handleDeleteChat(te)},I=te=>{Ho(hr.projectRemove(te),()=>f.handleRemoveProject(te),{statusLabel:"Hiding project..."})},t[32]=f,t[33]=B,t[34]=K,t[35]=A,t[36]=I):(B=t[33],K=t[34],A=t[35],I=t[36]);let $;t[37]!==f?($=te=>f.handleOpenProviderLogin(te),t[37]=f,t[38]=$):$=t[38];let T;t[39]!==f?(T=()=>{f.handleInstallUpdate()},t[39]=f,t[40]=T):T=t[40];let X;t[41]!==v||t[42]!==m||t[43]!==E.bindings.toggleProjectsSidebar||t[44]!==b||t[45]!==S||t[46]!==f.activeChatId||t[47]!==f.activeOverviewFeatureId||t[48]!==f.closeSidebar||t[49]!==f.completedChatIds||t[50]!==f.connectionStatus||t[51]!==f.expandSidebar||t[52]!==f.folderGroupsEnabled||t[53]!==f.handleRefreshProviderUsage||t[54]!==f.kanbanStatusesEnabled||t[55]!==f.openSidebar||t[56]!==f.providerSettings||t[57]!==f.remoteAuth||t[58]!==f.showFeatureOverviewInSidebar||t[59]!==f.sidebarCollapsed||t[60]!==f.sidebarData||t[61]!==f.sidebarOpen||t[62]!==f.sidebarReady||t[63]!==f.startingLocalPath||t[64]!==f.toggleProjectsSidebar||t[65]!==f.updateSnapshot||t[66]!==z||t[67]!==Y||t[68]!==L||t[69]!==W||t[70]!==V||t[71]!==F||t[72]!==U||t[73]!==H||t[74]!==j||t[75]!==B||t[76]!==K||t[77]!==A||t[78]!==I||t[79]!==$||t[80]!==T||t[81]!==G?(X=g.jsx(Tq,{data:f.sidebarData,completedChatIds:f.completedChatIds,activeChatId:f.activeChatId,activeOverviewFeatureId:f.activeOverviewFeatureId,connectionStatus:f.connectionStatus,ready:f.sidebarReady,open:f.sidebarOpen,collapsed:f.sidebarCollapsed,isDesktopViewport:m,showMobileOpenButton:S,onOpen:f.openSidebar,onClose:f.closeSidebar,onToggle:f.toggleProjectsSidebar,onExpand:f.expandSidebar,desktopWidth:v,toggleShortcut:E.bindings.toggleProjectsSidebar,onResizeDesktopWidth:b,onCreateChat:G,onCreateFeature:z,onRenameFeature:Y,onDeleteFeature:L,onSetProjectBrowserState:W,onSetProjectGeneralChatsBrowserState:V,onSetFeatureBrowserState:F,onSetFeatureStage:U,onSetChatFeature:H,onReorderFeatures:j,folderGroupsEnabled:f.folderGroupsEnabled,showFeatureOverviewInSidebar:f.showFeatureOverviewInSidebar,kanbanStatusesEnabled:f.kanbanStatusesEnabled,onOpenFeatureOverview:B,onRenameChat:K,onDeleteChat:A,onRemoveProject:I,onRefreshProviderUsage:f.handleRefreshProviderUsage,onOpenProviderLogin:$,providerSettings:f.providerSettings,remoteAuth:f.remoteAuth,startingLocalPath:f.startingLocalPath,updateSnapshot:f.updateSnapshot,onInstallUpdate:T}),t[41]=v,t[42]=m,t[43]=E.bindings.toggleProjectsSidebar,t[44]=b,t[45]=S,t[46]=f.activeChatId,t[47]=f.activeOverviewFeatureId,t[48]=f.closeSidebar,t[49]=f.completedChatIds,t[50]=f.connectionStatus,t[51]=f.expandSidebar,t[52]=f.folderGroupsEnabled,t[53]=f.handleRefreshProviderUsage,t[54]=f.kanbanStatusesEnabled,t[55]=f.openSidebar,t[56]=f.providerSettings,t[57]=f.remoteAuth,t[58]=f.showFeatureOverviewInSidebar,t[59]=f.sidebarCollapsed,t[60]=f.sidebarData,t[61]=f.sidebarOpen,t[62]=f.sidebarReady,t[63]=f.startingLocalPath,t[64]=f.toggleProjectsSidebar,t[65]=f.updateSnapshot,t[66]=z,t[67]=Y,t[68]=L,t[69]=W,t[70]=V,t[71]=F,t[72]=U,t[73]=H,t[74]=j,t[75]=B,t[76]=K,t[77]=A,t[78]=I,t[79]=$,t[80]=T,t[81]=G,t[82]=X):X=t[82];const Z=f.createFeatureModalProjectId!==null;let J,re;t[83]!==f?(J=te=>{te||f.handleCloseCreateFeatureModal()},re=te=>f.handleConfirmCreateFeature(te),t[83]=f,t[84]=J,t[85]=re):(J=t[84],re=t[85]);let ae;t[86]!==f.isCreatingFeature||t[87]!==Z||t[88]!==J||t[89]!==re?(ae=g.jsx(V7,{open:Z,isSubmitting:f.isCreatingFeature,onOpenChange:J,onConfirm:re}),t[86]=f.isCreatingFeature,t[87]=Z,t[88]=J,t[89]=re,t[90]=ae):ae=t[90];let ue,me;t[91]!==f?(ue=te=>{te||f.handleCloseCursorCurlImport()},me=te=>f.handleSubmitCursorCurlImport(te),t[91]=f,t[92]=ue,t[93]=me):(ue=t[92],me=t[93]);let se;t[94]!==f.cursorCurlImportOpen||t[95]!==ue||t[96]!==me?(se=g.jsx(q7,{open:f.cursorCurlImportOpen,onOpenChange:ue,onSubmit:me}),t[94]=f.cursorCurlImportOpen,t[95]=ue,t[96]=me,t[97]=se):se=t[97];let oe;t[98]!==f.activeChatId||t[99]!==f.connectionStatus||t[100]!==f.sidebarData?(oe=g.jsx(Jae,{activeChatId:f.activeChatId,connectionStatus:f.connectionStatus,sidebarData:f.sidebarData}),t[98]=f.activeChatId,t[99]=f.connectionStatus,t[100]=f.sidebarData,t[101]=oe):oe=t[101];let ee;t[102]===Symbol.for("react.memo_cache_sentinel")?(ee=g.jsx(aI,{}),t[102]=ee):ee=t[102];let Q;return t[103]!==X||t[104]!==ae||t[105]!==se||t[106]!==oe?(Q=g.jsxs("div",{className:"relative flex h-[var(--app-shell-height)] min-h-[var(--app-shell-height)] overflow-hidden",style:P,children:[X,ae,se,oe,ee]}),t[103]=X,t[104]=ae,t[105]=se,t[106]=oe,t[107]=Q):Q=t[107],Q}function ple(t){return t.setWidth}function gle(t){return t.widthPx}function vle(){const t=ke.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=g.jsx(jo,{path:"/open",element:g.jsx(Nae,{})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=g.jsx(jo,{path:"/remote-setup",element:g.jsx(Hae,{})}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=g.jsx(fle,{}),t[2]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=g.jsx(jo,{path:"/",element:g.jsx(_.Suspense,{fallback:g.jsx(b1,{label:"Loading local projects..."}),children:g.jsx(ule,{})})}),t[3]=i):i=t[3];let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=g.jsx(jo,{path:"/settings",element:g.jsx(oI,{to:"/settings/general",replace:!0})}),t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=g.jsx(jo,{path:"/settings/:sectionId",element:g.jsx(_.Suspense,{fallback:g.jsx(b1,{label:"Loading settings..."}),children:g.jsx(dle,{})})}),t[5]=a):a=t[5];let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=g.jsx(jo,{path:"/chat/:chatId",element:g.jsx(Cae,{})}),t[6]=c):c=t[6];let d;return t[7]===Symbol.for("react.memo_cache_sentinel")?(d=g.jsx(TF,{children:g.jsxs($7,{children:[g.jsxs(cI,{children:[e,n,g.jsxs(jo,{element:r,children:[i,s,a,c,g.jsx(jo,{path:"/overview/:featureId",element:g.jsx(_.Suspense,{fallback:g.jsx(b1,{label:"Loading feature overview..."}),children:g.jsx(cle,{})})})]})]}),g.jsx(yP,{})]})}),t[7]=d):d=t[7],d}const lO=document.getElementById("root");if(!lO)throw new Error("Missing #root");lL.createRoot(lO).render(g.jsx(jI,{basename:uN(),children:g.jsx(oZ,{children:g.jsx(vle,{})})}));export{v4 as $,Oy as A,vt as B,bN as C,My as D,Ni as E,b8 as F,_le as G,ys as H,jy as I,Ele as J,n4 as K,Fn as L,nf as M,yy as N,LF as O,Ul as P,_s as Q,op as R,BD as S,fg as T,UV as U,sE as V,vu as W,di as X,lu as Y,oO as Z,Fu as _,ke as a,Bg as a0,pK as a1,Zn as a2,zV as a3,GA as a4,BV as a5,QA as a6,rc as a7,Ex as a8,ZA as a9,aK as aA,oK as aB,r_ as aC,cK as aD,lK as aE,i_ as aF,TH as aG,Dle as aH,jle as aI,sf as aJ,Vle as aK,Kle as aL,Zae as aM,Xae as aN,ZF as aO,sq as aP,Lo as aQ,aq as aR,Wse as aa,Lle as ab,f1 as ac,au as ad,qr as ae,JP as af,Ole as ag,Yr as ah,IR as ai,aZ as aj,Fp as ak,$o as al,fu as am,v1 as an,lN as ao,kle as ap,tH as aq,Tp as ar,Hg as as,JR as at,is as au,Nle as av,hK as aw,HV as ax,qle as ay,wle as az,Vh as b,st as c,Hu as d,hS as e,zg as f,hr as g,hu as h,Ce as i,Zh as j,g as k,RZ as l,Ho as m,rf as n,yN as o,Ll as p,ap as q,_ as r,zo as s,Bo as t,tc as u,Fo as v,hg as w,Dy as x,Ay as y,Cle as z};
|