clauder-hub 0.1.19 → 0.1.21

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.
Files changed (26) hide show
  1. package/package.json +1 -1
  2. package/server/dist/index.js +878 -578
  3. package/web/dist/assets/{MonacoEditor-F_ZgRGGt.js → MonacoEditor-BTVIBYvB.js} +3 -3
  4. package/web/dist/assets/{cssMode-DBhyCd0X.js → cssMode-C586Sf_r.js} +1 -1
  5. package/web/dist/assets/{freemarker2-CD30JI-K.js → freemarker2-C-cc3Gll.js} +1 -1
  6. package/web/dist/assets/{handlebars-CrVV4_mK.js → handlebars-DvIHaXiS.js} +1 -1
  7. package/web/dist/assets/{html-Bfe2eAe1.js → html-B6mVPILf.js} +1 -1
  8. package/web/dist/assets/{htmlMode-DoOJFt62.js → htmlMode-DdTtdH0Z.js} +1 -1
  9. package/web/dist/assets/{index-RzRaOMgG.js → index-BQk7iZCf.js} +1 -1
  10. package/web/dist/assets/index-BRBOC-HN.css +32 -0
  11. package/web/dist/assets/index-D7vjfqSK.js +640 -0
  12. package/web/dist/assets/{javascript-C43JYjgB.js → javascript-B_oWtDTg.js} +1 -1
  13. package/web/dist/assets/{jsonMode-DnYHCxH8.js → jsonMode-qce5w2Wk.js} +1 -1
  14. package/web/dist/assets/{liquid-BWmioas6.js → liquid-7IWcrKEP.js} +1 -1
  15. package/web/dist/assets/{lspLanguageFeatures-C40s-86R.js → lspLanguageFeatures-CmmvUFJp.js} +1 -1
  16. package/web/dist/assets/{mdx-Ds2ff-68.js → mdx-C7aHCLPx.js} +1 -1
  17. package/web/dist/assets/{python-BMT7eQL4.js → python-DM5DwMK7.js} +1 -1
  18. package/web/dist/assets/{razor-ClzP2hyU.js → razor-B7mgUEn8.js} +1 -1
  19. package/web/dist/assets/{tsMode-BaAHnSPR.js → tsMode-DxSLItWY.js} +1 -1
  20. package/web/dist/assets/{typescript-AWjavLb_.js → typescript-ByJ-uQZm.js} +1 -1
  21. package/web/dist/assets/{workers-D82kkn_x.js → workers-CJj-afeH.js} +1 -1
  22. package/web/dist/assets/{xml-COVjqCbe.js → xml-qEcmYLej.js} +1 -1
  23. package/web/dist/assets/{yaml-BNVB9coa.js → yaml-DJRPJYdB.js} +1 -1
  24. package/web/dist/index.html +2 -2
  25. package/web/dist/assets/index-BpTziG8o.js +0 -630
  26. package/web/dist/assets/index-Dt3TWUGi.css +0 -32
@@ -1,630 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MonacoEditor-F_ZgRGGt.js","assets/MonacoEditor-BbYsqB7V.css"])))=>i.map(i=>d[i]);
2
- var iy=e=>{throw TypeError(e)};var ry=(e,i,r)=>i.has(e)||iy("Cannot "+r);var un=(e,i,r)=>(ry(e,i,"read from private field"),r?r.call(e):i.get(e)),sy=(e,i,r)=>i.has(e)?iy("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,r),jp=(e,i,r,s)=>(ry(e,i,"write to private field"),s?s.call(e,r):i.set(e,r),r);function L3(e,i){for(var r=0;r<i.length;r++){const s=i[r];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in e)){const d=Object.getOwnPropertyDescriptor(s,l);d&&Object.defineProperty(e,l,d.get?d:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const d of l)if(d.type==="childList")for(const p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&s(p)}).observe(document,{childList:!0,subtree:!0});function r(l){const d={};return l.integrity&&(d.integrity=l.integrity),l.referrerPolicy&&(d.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?d.credentials="include":l.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(l){if(l.ep)return;l.ep=!0;const d=r(l);fetch(l.href,d)}})();function fg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Op={exports:{}},Sl={};/**
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 oy;function M3(){if(oy)return Sl;oy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(s,l,d){var p=null;if(d!==void 0&&(p=""+d),l.key!==void 0&&(p=""+l.key),"key"in l){d={};for(var a in l)a!=="key"&&(d[a]=l[a])}else d=l;return l=d.ref,{$$typeof:e,type:s,key:p,ref:l!==void 0?l:null,props:d}}return Sl.Fragment=i,Sl.jsx=r,Sl.jsxs=r,Sl}var ay;function j3(){return ay||(ay=1,Op.exports=M3()),Op.exports}var v=j3(),Np={exports:{}},He={};/**
11
- * @license React
12
- * react.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 ly;function O3(){if(ly)return He;ly=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),p=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),_=Symbol.for("react.view_transition"),x=Symbol.iterator;function C(V){return V===null||typeof V!="object"?null:(V=x&&V[x]||V["@@iterator"],typeof V=="function"?V:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,b={};function S(V,ne,le){this.props=V,this.context=ne,this.refs=b,this.updater=le||y}S.prototype.isReactComponent={},S.prototype.setState=function(V,ne){if(typeof V!="object"&&typeof V!="function"&&V!=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,V,ne,"setState")},S.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function w(){}w.prototype=S.prototype;function T(V,ne,le){this.props=V,this.context=ne,this.refs=b,this.updater=le||y}var D=T.prototype=new w;D.constructor=T,m(D,S.prototype),D.isPureReactComponent=!0;var R=Array.isArray;function L(){}var A={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(V,ne,le){var K=le.ref;return{$$typeof:e,type:V,key:ne,ref:K!==void 0?K:null,props:le}}function I(V,ne){return M(V.type,ne,V.props)}function B(V){return typeof V=="object"&&V!==null&&V.$$typeof===e}function H(V){var ne={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(le){return ne[le]})}var F=/\/+/g;function W(V,ne){return typeof V=="object"&&V!==null&&V.key!=null?H(""+V.key):ne.toString(36)}function G(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(L,L):(V.status="pending",V.then(function(ne){V.status==="pending"&&(V.status="fulfilled",V.value=ne)},function(ne){V.status==="pending"&&(V.status="rejected",V.reason=ne)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function Q(V,ne,le,K,$){var oe=typeof V;(oe==="undefined"||oe==="boolean")&&(V=null);var ee=!1;if(V===null)ee=!0;else switch(oe){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(V.$$typeof){case e:case i:ee=!0;break;case g:return ee=V._init,Q(ee(V._payload),ne,le,K,$)}}if(ee)return $=$(V),ee=K===""?"."+W(V,0):K,R($)?(le="",ee!=null&&(le=ee.replace(F,"$&/")+"/"),Q($,ne,le,"",function(Se){return Se})):$!=null&&(B($)&&($=I($,le+($.key==null||V&&V.key===$.key?"":(""+$.key).replace(F,"$&/")+"/")+ee)),ne.push($)),1;ee=0;var ue=K===""?".":K+":";if(R(V))for(var he=0;he<V.length;he++)K=V[he],oe=ue+W(K,he),ee+=Q(K,ne,le,oe,$);else if(he=C(V),typeof he=="function")for(V=he.call(V),he=0;!(K=V.next()).done;)K=K.value,oe=ue+W(K,he++),ee+=Q(K,ne,le,oe,$);else if(oe==="object"){if(typeof V.then=="function")return Q(G(V),ne,le,K,$);throw ne=String(V),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return ee}function X(V,ne,le){if(V==null)return V;var K=[],$=0;return Q(V,K,"","",function(oe){return ne.call(le,oe,$++)}),K}function z(V){if(V._status===-1){var ne=V._result,le=ne();le.then(function(K){(V._status===0||V._status===-1)&&(V._status=1,V._result=K,le.status===void 0&&(le.status="fulfilled",le.value=K))},function(K){(V._status===0||V._status===-1)&&(V._status=2,V._result=K,le.status===void 0&&(le.status="rejected",le.reason=K))}),V._status===-1&&(V._status=0,V._result=le)}if(V._status===1)return V._result.default;throw V._result}var O=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",V);return}console.error(V)};function Y(V){var ne=A.T,le={};le.types=ne!==null?ne.types:null,A.T=le;try{var K=V(),$=A.S;$!==null&&$(le,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(L,O)}catch(oe){O(oe)}finally{ne!==null&&le.types!==null&&(ne.types=le.types),A.T=ne}}function Z(V){var ne=A.T;if(ne!==null){var le=ne.types;le===null?ne.types=[V]:le.indexOf(V)===-1&&le.push(V)}else Y(Z.bind(null,V))}var U={map:X,forEach:function(V,ne,le){X(V,function(){ne.apply(this,arguments)},le)},count:function(V){var ne=0;return X(V,function(){ne++}),ne},toArray:function(V){return X(V,function(ne){return ne})||[]},only:function(V){if(!B(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return He.Activity=c,He.Children=U,He.Component=S,He.Fragment=r,He.Profiler=l,He.PureComponent=T,He.StrictMode=s,He.Suspense=u,He.ViewTransition=_,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,He.__COMPILER_RUNTIME={__proto__:null,c:function(V){return A.H.useMemoCache(V)}},He.addTransitionType=Z,He.cache=function(V){return function(){return V.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(V,ne,le){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var K=m({},V.props),$=V.key;if(ne!=null)for(oe in ne.key!==void 0&&($=""+ne.key),ne)!j.call(ne,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&ne.ref===void 0||(K[oe]=ne[oe]);var oe=arguments.length-2;if(oe===1)K.children=le;else if(1<oe){for(var ee=Array(oe),ue=0;ue<oe;ue++)ee[ue]=arguments[ue+2];K.children=ee}return M(V.type,$,K)},He.createContext=function(V){return V={$$typeof:p,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:d,_context:V},V},He.createElement=function(V,ne,le){var K,$={},oe=null;if(ne!=null)for(K in ne.key!==void 0&&(oe=""+ne.key),ne)j.call(ne,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&($[K]=ne[K]);var ee=arguments.length-2;if(ee===1)$.children=le;else if(1<ee){for(var ue=Array(ee),he=0;he<ee;he++)ue[he]=arguments[he+2];$.children=ue}if(V&&V.defaultProps)for(K in ee=V.defaultProps,ee)$[K]===void 0&&($[K]=ee[K]);return M(V,oe,$)},He.createRef=function(){return{current:null}},He.forwardRef=function(V){return{$$typeof:a,render:V}},He.isValidElement=B,He.lazy=function(V){return{$$typeof:g,_payload:{_status:-1,_result:V},_init:z}},He.memo=function(V,ne){return{$$typeof:f,type:V,compare:ne===void 0?null:ne}},He.startTransition=Y,He.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},He.use=function(V){return A.H.use(V)},He.useActionState=function(V,ne,le){return A.H.useActionState(V,ne,le)},He.useCallback=function(V,ne){return A.H.useCallback(V,ne)},He.useContext=function(V){return A.H.useContext(V)},He.useDebugValue=function(){},He.useDeferredValue=function(V,ne){return A.H.useDeferredValue(V,ne)},He.useEffect=function(V,ne){return A.H.useEffect(V,ne)},He.useEffectEvent=function(V){return A.H.useEffectEvent(V)},He.useId=function(){return A.H.useId()},He.useImperativeHandle=function(V,ne,le){return A.H.useImperativeHandle(V,ne,le)},He.useInsertionEffect=function(V,ne){return A.H.useInsertionEffect(V,ne)},He.useLayoutEffect=function(V,ne){return A.H.useLayoutEffect(V,ne)},He.useMemo=function(V,ne){return A.H.useMemo(V,ne)},He.useOptimistic=function(V,ne){return A.H.useOptimistic(V,ne)},He.useReducer=function(V,ne,le){return A.H.useReducer(V,ne,le)},He.useRef=function(V){return A.H.useRef(V)},He.useState=function(V){return A.H.useState(V)},He.useSyncExternalStore=function(V,ne,le){return A.H.useSyncExternalStore(V,ne,le)},He.useTransition=function(){return A.H.useTransition()},He.version="19.3.1",He}var cy;function pg(){return cy||(cy=1,Np.exports=O3()),Np.exports}var P=pg();const Ll=fg(P),_a=L3({__proto__:null,default:Ll},[P]);var Bp={exports:{}},Cl={},Pp={exports:{}},Ip={};/**
19
- * @license React
20
- * scheduler.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 uy;function N3(){return uy||(uy=1,(function(e){function i(G,Q){var X=G.length;G.push(Q);e:for(;0<X;){var z=X-1>>>1,O=G[z];if(0<l(O,Q))G[z]=Q,G[X]=O,X=z;else break e}}function r(G){return G.length===0?null:G[0]}function s(G){if(G.length===0)return null;var Q=G[0],X=G.pop();if(X!==Q){G[0]=X;e:for(var z=0,O=G.length,Y=O>>>1;z<Y;){var Z=2*(z+1)-1,U=G[Z],V=Z+1,ne=G[V];if(0>l(U,X))V<O&&0>l(ne,U)?(G[z]=ne,G[V]=X,z=V):(G[z]=U,G[Z]=X,z=Z);else if(V<O&&0>l(ne,X))G[z]=ne,G[V]=X,z=V;else break e}}return Q}function l(G,Q){var X=G.sortIndex-Q.sortIndex;return X!==0?X:G.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;e.unstable_now=function(){return d.now()}}else{var p=Date,a=p.now();e.unstable_now=function(){return p.now()-a}}var u=[],f=[],g=1,c=null,_=3,x=!1,C=!1,y=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function T(G){for(var Q=r(f);Q!==null;){if(Q.callback===null)s(f);else if(Q.startTime<=G)s(f),Q.sortIndex=Q.expirationTime,i(u,Q);else break;Q=r(f)}}function D(G){if(y=!1,T(G),!C)if(r(u)!==null)C=!0,R||(R=!0,B());else{var Q=r(f);Q!==null&&W(D,Q.startTime-G)}}var R=!1,L=-1,A=5,j=-1;function M(){return m?!0:!(e.unstable_now()-j<A)}function I(){if(m=!1,R){var G=e.unstable_now();j=G;var Q=!0;try{e:{C=!1,y&&(y=!1,S(L),L=-1),x=!0;var X=_;try{t:{for(T(G),c=r(u);c!==null&&!(c.expirationTime>G&&M());){var z=c.callback;if(typeof z=="function"){c.callback=null,_=c.priorityLevel;var O=z(c.expirationTime<=G);if(G=e.unstable_now(),typeof O=="function"){c.callback=O,T(G),Q=!0;break t}c===r(u)&&s(u),T(G)}else s(u);c=r(u)}if(c!==null)Q=!0;else{var Y=r(f);Y!==null&&W(D,Y.startTime-G),Q=!1}}break e}finally{c=null,_=X,x=!1}Q=void 0}}finally{Q?B():R=!1}}}var B;if(typeof w=="function")B=function(){w(I)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,F=H.port2;H.port1.onmessage=I,B=function(){F.postMessage(null)}}else B=function(){b(I,0)};function W(G,Q){L=b(function(){G(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(G){switch(_){case 1:case 2:case 3:var Q=3;break;default:Q=_}var X=_;_=Q;try{return G()}finally{_=X}},e.unstable_requestPaint=function(){m=!0},e.unstable_runWithPriority=function(G,Q){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var X=_;_=G;try{return Q()}finally{_=X}},e.unstable_scheduleCallback=function(G,Q,X){var z=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?z+X:z):X=z,G){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=X+O,G={id:g++,callback:Q,priorityLevel:G,startTime:X,expirationTime:O,sortIndex:-1},X>z?(G.sortIndex=X,i(f,G),r(u)===null&&G===r(f)&&(y?(S(L),L=-1):y=!0,W(D,X-z))):(G.sortIndex=O,i(u,G),C||x||(C=!0,R||(R=!0,B()))),G},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(G){var Q=_;return function(){var X=_;_=Q;try{return G.apply(this,arguments)}finally{_=X}}}})(Ip)),Ip}var hy;function B3(){return hy||(hy=1,Pp.exports=N3()),Pp.exports}var zp={exports:{}},hn={};/**
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 dy;function P3(){if(dy)return hn;dy=1;var e=pg();function i(g){var c="https://react.dev/errors/"+g;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)c+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal"),d=Symbol.for("react.recoverable"),p=Symbol.for("react.optimistic_key");function a(g,c,_){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:x==null?null:x===p?p:""+x,children:g,containerInfo:c,implementation:_}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(g,c){if(g==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,hn.browser=function(g){return{$$typeof:d,_reason:g}},hn.createPortal=function(g,c){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(i(299));return a(g,c,null,_)},hn.flushSync=function(g){var c=u.T,_=s.p;try{if(u.T=null,s.p=2,g)return g()}finally{u.T=c,s.p=_,s.d.f()}},hn.preconnect=function(g,c){typeof g=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,s.d.C(g,c))},hn.prefetchDNS=function(g){typeof g=="string"&&s.d.D(g)},hn.preinit=function(g,c){if(typeof g=="string"&&c&&typeof c.as=="string"){var _=c.as,x=f(_,c.crossOrigin),C=typeof c.integrity=="string"?c.integrity:void 0,y=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;_==="style"?s.d.S(g,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:x,integrity:C,fetchPriority:y}):_==="script"&&s.d.X(g,{crossOrigin:x,integrity:C,fetchPriority:y,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},hn.preinitModule=function(g,c){if(typeof g=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var _=f(c.as,c.crossOrigin);s.d.M(g,{crossOrigin:_,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0})}}else c==null&&s.d.M(g)},hn.preload=function(g,c){if(typeof g=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var _=c.as,x=f(_,c.crossOrigin);s.d.L(g,_,{crossOrigin:x,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},hn.preloadModule=function(g,c){if(typeof g=="string")if(c){var _=f(c.as,c.crossOrigin);s.d.m(g,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:_,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0})}else s.d.m(g)},hn.requestFormReset=function(g){s.d.r(g)},hn.unstable_batchedUpdates=function(g,c){return g(c)},hn.useFormState=function(g,c,_){return u.H.useFormState(g,c,_)},hn.useFormStatus=function(){return u.H.useHostTransitionStatus()},hn.version="19.3.1",hn}var fy;function Lw(){if(fy)return zp.exports;fy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),zp.exports=P3(),zp.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 py;function I3(){if(py)return Cl;py=1;var e=B3(),i=pg(),r=Lw();function s(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){for(var n=t,o=n;o&&!o.alternate;)n=o,(n.flags&4098)!==0&&(t=n.return),o=n.return;for(;n.return;)n=n.return;return n.tag===3?t:null}function p(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function a(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function u(t){if(d(t)!==t)throw Error(s(188))}function f(t){var n=t.alternate;if(!n){if(n=d(t),n===null)throw Error(s(188));return n!==t?null:t}for(var o=t,h=n;;){var E=o.return;if(E===null)break;var k=E.alternate;if(k===null){if(h=E.return,h!==null){o=h;continue}break}if(E.child===k.child){for(k=E.child;k;){if(k===o)return u(E),t;if(k===h)return u(E),n;k=k.sibling}throw Error(s(188))}if(o.return!==h.return)o=E,h=k;else{for(var N=!1,q=E.child;q;){if(q===o){N=!0,o=E,h=k;break}if(q===h){N=!0,h=E,o=k;break}q=q.sibling}if(!N){for(q=k.child;q;){if(q===o){N=!0,o=k,h=E;break}if(q===h){N=!0,h=k,o=E;break}q=q.sibling}if(!N)throw Error(s(189))}}if(o.alternate!==h)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?t:n}function g(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=g(t),n!==null)return n;t=t.sibling}return null}function c(t,n,o,h,E,k){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&o(t,h,E,k)||(t.tag!==22||t.memoizedState===null)&&(n||t.tag!==5&&t.tag!==27)&&c(t.child,n,o,h,E,k))return!0;t=t.sibling}return!1}function _(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function x(t){var n=!1;for(t=t.return;t!==null&&(t.tag===4&&(n=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return n}function C(t){var n=[null,null],o=_(t);return o===null||y(n,t,o.child,{foundSelf:!1}),n}function y(t,n,o,h){for(;o!==null;){if(o===n)h.foundSelf=!0;else if(o.tag===5||o.tag===27||o.tag===6){if(h.foundSelf)return t[1]=o,!0;t[0]=o}else if((o.tag!==22||o.memoizedState===null)&&y(t,n,o.child,h))return!0;o=o.sibling}return!1}function m(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(s(559))}}var b=null,S=null;function w(t,n,o){return t===o?!0:t===n?(b=t,!0):!1}function T(t,n,o){return t===o?(S=t,!1):t===n?(S!==null&&(b=t),!0):!1}function D(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function R(t,n,o){for(var h=0,E=t;E;E=o(E))h++;E=0;for(var k=n;k;k=o(k))E++;for(;0<h-E;)t=o(t),h--;for(;0<E-h;)n=o(n),E--;for(;h--;){if(t===n||n!==null&&t===n.alternate)return t;t=o(t),n=o(n)}return null}var L=Object.assign,A=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),W=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),Z=Symbol.for("react.legacy_hidden"),U=Symbol.for("react.memo_cache_sentinel"),V=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),le=Symbol.iterator;function K(t){return t===null||typeof t!="object"?null:(t=le&&t[le]||t["@@iterator"],typeof t=="function"?t:null)}var $=Symbol.for("react.client.reference");function oe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===$?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case I:return"Fragment";case H:return"Profiler";case B:return"StrictMode";case Q:return"Suspense";case X:return"SuspenseList";case Y:return"Activity";case V:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case M:return"Portal";case W:return t.displayName||"Context";case F:return(t._context.displayName||"Context")+".Consumer";case G:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case z:return n=t.displayName||null,n!==null?n:oe(t.type)||"Memo";case O:n=t._payload,t=t._init;try{return oe(t(n))}catch{}}return null}var ee=Array.isArray,ue=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se={pending:!1,data:null,method:null,action:null},we=[],Re=-1;function qe(t){return{current:t}}function ke(t){0>Re||(t.current=we[Re],we[Re]=null,Re--)}function ze(t,n){Re++,we[Re]=t.current,t.current=n}var Mt=qe(null),$e=qe(null),Be=qe(null),Ie=qe(null);function Te(t,n){switch(ze(Be,n),ze($e,t),ze(Mt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?dx(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=dx(n),t=fx(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ke(Mt),ze(Mt,t)}function Ve(){ke(Mt),ke($e),ke(Be)}function gt(t){var n=t.memoizedState;n!==null&&(Ko._currentValue=n.memoizedState,ze(Ie,t)),n=Mt.current;var o=fx(n,t.type);n!==o&&(ze($e,t),ze(Mt,o))}function st(t){$e.current===t&&(ke(Mt),ke($e)),Ie.current===t&&(ke(Ie),Ko._currentValue=Se)}var fe,_e;function De(t){if(fe===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);fe=n&&n[1]||"",_e=-1<o.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+fe+t+_e}var Le=!1;function Fe(t,n){if(!t||Le)return"";Le=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(n){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(Ee){var ie=Ee}Reflect.construct(t,[],me)}else{try{me.call()}catch(Ee){ie=Ee}me=!1;try{var ce=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),me=!0,new t}finally{me&&(ce!==void 0?Object.defineProperty(t.prototype,"props",ce):delete t.prototype.props)}}}else{try{throw Error()}catch(Ee){ie=Ee}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(Ee){if(Ee&&ie&&typeof Ee.stack=="string")return[Ee.stack,ie.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=h.DetermineComponentFrameRoot(),N=k[0],q=k[1];if(N&&q){var J=N.split(`
45
- `),se=q.split(`
46
- `);for(E=h=0;h<J.length&&!J[h].includes("DetermineComponentFrameRoot");)h++;for(;E<se.length&&!se[E].includes("DetermineComponentFrameRoot");)E++;if(h===J.length||E===se.length)for(h=J.length-1,E=se.length-1;1<=h&&0<=E&&J[h]!==se[E];)E--;for(;1<=h&&0<=E;h--,E--)if(J[h]!==se[E]){if(h!==1||E!==1)do if(h--,E--,0>E||J[h]!==se[E]){var de=`
47
- `+J[h].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=h&&0<=E);break}}}finally{Le=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?De(o):""}function Me(t,n){switch(t.tag){case 26:case 27:case 5:return De(t.type);case 16:return De("Lazy");case 13:return t.child!==n&&n!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Fe(t.type,!1);case 11:return Fe(t.type.render,!1);case 1:return Fe(t.type,!0);case 31:return De("Activity");case 30:return De("ViewTransition");default:return""}}function Tt(t){try{var n="",o=null;do n+=Me(t,o),o=t,t=t.return;while(t);return n}catch(h){return`
48
- Error generating stack: `+h.message+`
49
- `+h.stack}}var qt=Object.prototype.hasOwnProperty,kn=e.unstable_scheduleCallback,ei=e.unstable_cancelCallback,ti=e.unstable_shouldYield,oo=e.unstable_requestPaint,Vt=e.unstable_now,Wt=e.unstable_getCurrentPriorityLevel,ni=e.unstable_ImmediatePriority,xn=e.unstable_UserBlockingPriority,ao=e.unstable_NormalPriority,z5=e.unstable_LowPriority,Pv=e.unstable_IdlePriority,H5=e.log,F5=e.unstable_setDisableYieldValue,Da=null,zn=null;function Tr(t){if(typeof H5=="function"&&F5(t),zn&&typeof zn.setStrictMode=="function")try{zn.setStrictMode(Da,t)}catch{}}var Hn=Math.clz32?Math.clz32:q5,U5=Math.log,$5=Math.LN2;function q5(t){return t>>>=0,t===0?32:31-(U5(t)/$5|0)|0}var uc=256,hc=262144,dc=4194304;function vs(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function fc(t,n,o){var h=t.pendingLanes;if(h===0)return 0;var E=0,k=t.suspendedLanes,N=t.pingedLanes;t=t.warmLanes;var q=h&134217727;return q!==0?(h=q&~k,h!==0?E=vs(h):(N&=q,N!==0?E=vs(N):o||(o=q&~t,o!==0&&(E=vs(o))))):(q=h&~k,q!==0?E=vs(q):N!==0?E=vs(N):o||(o=h&~t,o!==0&&(E=vs(o)))),E===0?0:n!==0&&n!==E&&(n&k)===0&&(k=E&-E,o=n&-n,k>=o||k===32&&(o&4194048)!==0)?n:E}function La(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Iv(t,n){(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var h=31-Hn(o),E=1<<h;n|=t[h],o&=~E}return n}function V5(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 zv(){var t=dc;return dc<<=1,(dc&62914560)===0&&(dc=4194304),t}function sd(t){for(var n=[],o=0;31>o;o++)n.push(t);return n}function Ma(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function W5(t,n,o,h,E,k){var N=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var q=t.entanglements,J=t.expirationTimes,se=t.hiddenUpdates;for(o=N&~o;0<o;){var de=31-Hn(o),me=1<<de;q[de]=0,J[de]=-1;var ie=se[de];if(ie!==null)for(se[de]=null,de=0;de<ie.length;de++){var ce=ie[de];ce!==null&&(ce.lane&=-536870913)}o&=~me}h!==0&&Hv(t,h,0),k!==0&&E===0&&t.tag!==0&&(t.suspendedLanes|=k&~(N&~n))}function Hv(t,n,o){t.pendingLanes|=n,t.suspendedLanes&=~n;var h=31-Hn(n);t.entangledLanes|=n,t.entanglements[h]=t.entanglements[h]|1073741824|o&261930}function Fv(t,n){var o=t.entangledLanes|=n;for(t=t.entanglements;o;){var h=31-Hn(o),E=1<<h;E&n|t[h]&n&&(t[h]|=n),o&=~E}}function Uv(t,n){var o=n&-n;return o=(o&42)!==0?1:od(o),(o&(t.suspendedLanes|n))!==0?0:o}function od(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function ad(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function $v(){var t=he.p;return t!==0?t:(t=window.event,t===void 0?32:Xx(t.type))}function qv(t,n){var o=he.p;try{return he.p=t,n()}finally{he.p=o}}var Yi=Math.random().toString(36).slice(2),rn="__reactFiber$"+Yi,Tn="__reactProps$"+Yi,lo="__reactContainer$"+Yi,Vv="__reactEvents$"+Yi,G5="__reactListeners$"+Yi,Y5="__reactHandles$"+Yi,Wv="__reactResources$"+Yi,ja="__reactMarker$"+Yi,pc="__reactLoad$"+Yi;function mc(t){delete t[rn],delete t[Tn],delete t[G5],delete t[Y5]}function _s(t){var n;if(n=t[rn])return n;for(var o=t.parentNode;o;){if(n=o[lo]||o[rn]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(t=Dx(t);t!==null;){if(o=t[rn])return o;t=Dx(t)}return n}t=o,o=t.parentNode}return null}function co(t){if(t=t[rn]||t[lo]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Oa(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(s(33))}function uo(t){var n=t[Wv];return n||(n=t[Wv]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Xt(t){t[ja]=!0}function Gv(t){t[pc]=void 0}var Yv=new Set,Kv={};function xs(t,n){ho(t,n),ho(t+"Capture",n)}function ho(t,n){for(Kv[t]=n,t=0;t<n.length;t++)Yv.add(n[t])}var K5=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]*$"),Xv={},Qv={};function X5(t){return qt.call(Qv,t)?!0:qt.call(Xv,t)?!1:K5.test(t)?Qv[t]=!0:(Xv[t]=!0,!1)}var ot=!1;function Zv(){var t=ot;return ot=!1,t}function gc(t,n,o){if(X5(n))if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var h=n.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,o)}}function vc(t,n,o){if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,o)}}function Ki(t,n,o,h){if(h===null)t.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(n,o,h)}}function Fn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Jv(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Q5(t,n,o){var h=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var E=h.get,k=h.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return E.call(this)},set:function(N){o=""+N,k.call(this,N)}}),Object.defineProperty(t,n,{enumerable:h.enumerable}),{getValue:function(){return o},setValue:function(N){o=""+N},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ld(t){if(!t._valueTracker){var n=Jv(t)?"checked":"value";t._valueTracker=Q5(t,n,""+t[n])}}function e_(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var o=n.getValue(),h="";return t&&(h=Jv(t)?t.checked?"true":"false":t.value),t=h,t!==o?(n.setValue(t),!0):!1}var Z5=/[\n"\\]/g;function ii(t){return t.replace(Z5,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function cd(t,n,o,h,E,k,N,q){t.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.type=N:t.removeAttribute("type"),n!=null?N==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Fn(n)):t.value!==""+Fn(n)&&(t.value=""+Fn(n)):N!=="submit"&&N!=="reset"||t.removeAttribute("value"),n!=null?N==="number"&&t.value==n?ud(t,Fn(t.value)):ud(t,Fn(n)):o!=null?ud(t,Fn(o)):h!=null&&t.removeAttribute("value"),E==null&&k!=null&&(t.defaultChecked=!!k),E!=null&&(t.checked=E&&typeof E!="function"&&typeof E!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?t.name=""+Fn(q):t.removeAttribute("name")}function t_(t,n,o,h,E,k,N,q){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.type=k),n!=null||o!=null){if(!(k!=="submit"&&k!=="reset"||n!=null)){ld(t);return}o=o!=null?""+Fn(o):"",n=n!=null?""+Fn(n):o,q||n===t.value||(t.value=n),t.defaultValue=n}h=h??E,h=typeof h!="function"&&typeof h!="symbol"&&!!h,t.checked=q?t.checked:!!h,t.defaultChecked=!!h,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(t.name=N),ld(t)}function ud(t,n){t.defaultValue!==""+n&&(t.defaultValue=""+n)}function fo(t,n,o,h){if(t=t.options,n){n={};for(var E=0;E<o.length;E++)n["$"+o[E]]=!0;for(o=0;o<t.length;o++)E=n.hasOwnProperty("$"+t[o].value),t[o].selected!==E&&(t[o].selected=E),E&&h&&(t[o].defaultSelected=!0)}else{for(o=""+Fn(o),n=null,E=0;E<t.length;E++){if(t[E].value===o){t[E].selected=!0,h&&(t[E].defaultSelected=!0);return}n!==null||t[E].disabled||(n=t[E])}n!==null&&(n.selected=!0)}}function n_(t,n,o){if(n!=null&&(n=""+Fn(n),n!==t.value&&(t.value=n),o==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=o!=null?""+Fn(o):""}function i_(t,n,o,h){if(n==null){if(h!=null){if(o!=null)throw Error(s(92));if(ee(h)){if(1<h.length)throw Error(s(93));h=h[0]}o=h}o==null&&(o=""),n=o}o=Fn(n),t.defaultValue=o,h=t.textContent,h===o&&h!==""&&h!==null&&(t.value=h),ld(t)}function po(t,n){if(n){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=n;return}}t.textContent=n}var J5=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 r_(t,n,o){var h=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?h?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":h?t.setProperty(n,o):typeof o!="number"||o===0||J5.has(n)?n==="float"?t.cssFloat=o:t[n]=(""+o).trim():t[n]=o+"px"}function s_(t,n,o){if(n!=null&&typeof n!="object")throw Error(s(62));if(t=t.style,o!=null){for(var h in o)!o.hasOwnProperty(h)||n!=null&&n.hasOwnProperty(h)||(h.indexOf("--")===0?t.setProperty(h,""):h==="float"?t.cssFloat="":t[h]="",ot=!0);for(var E in n)h=n[E],n.hasOwnProperty(E)&&o[E]!==h&&(r_(t,E,h),ot=!0)}else for(var k in n)n.hasOwnProperty(k)&&r_(t,k,n[k])}function hd(t){if(t.indexOf("-")===-1)return!1;switch(t){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 eE=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"],["maskType","mask-type"],["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"]]),tE=/^[\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 _c(t){return tE.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ti(){}var dd=null;function fd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var mo=null,go=null;function o_(t){var n=co(t);if(n&&(t=n.stateNode)){var o=t[Tn]||null;e:switch(t=n.stateNode,n.type){case"input":if(cd(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+ii(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var h=o[n];if(h!==t&&h.form===t.form){var E=h[Tn]||null;if(!E)throw Error(s(90));cd(h,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(n=0;n<o.length;n++)h=o[n],h.form===t.form&&e_(h)}break e;case"textarea":n_(t,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&fo(t,!!o.multiple,n,!1)}}}var pd=!1;function a_(t,n,o){if(pd)return t(n,o);pd=!0;try{var h=t(n);return h}finally{if(pd=!1,(mo!==null||go!==null)&&(_u(),mo&&(n=mo,t=go,go=mo=null,o_(n),t)))for(n=0;n<t.length;n++)o_(t[n])}}function Na(t,n){var o=t.stateNode;if(o===null)return null;var h=o[Tn]||null;if(h===null)return null;o=h[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(t=t.type,h=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!h;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(s(231,n,typeof o));return o}var Xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),md=!1;if(Xi)try{var Ba={};Object.defineProperty(Ba,"passive",{get:function(){md=!0}}),window.addEventListener("test",Ba,Ba),window.removeEventListener("test",Ba,Ba)}catch{md=!1}var Rr=null,gd=null,xc=null;function l_(){if(xc)return xc;var t,n=gd,o=n.length,h,E="value"in Rr?Rr.value:Rr.textContent,k=E.length;for(t=0;t<o&&n[t]===E[t];t++);var N=o-t;for(h=1;h<=N&&n[o-h]===E[k-h];h++);return xc=E.slice(t,1<h?1-h:void 0)}function yc(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function bc(){return!0}function c_(){return!1}function yn(t){function n(o,h,E,k,N){this._reactName=o,this._targetInst=E,this.type=h,this.nativeEvent=k,this.target=N,this.currentTarget=null;for(var q in t)t.hasOwnProperty(q)&&(o=t[q],this[q]=o?o(k):k[q]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?bc:c_,this.isPropagationStopped=c_,this}return L(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=bc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=bc)},persist:function(){},isPersistent:bc}),n}var Ar={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wc=yn(Ar),Pa=L({},Ar,{view:0,detail:0}),nE=yn(Pa),vd,_d,Ia,Sc=L({},Pa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yd,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ia&&(Ia&&t.type==="mousemove"?(vd=t.screenX-Ia.screenX,_d=t.screenY-Ia.screenY):_d=vd=0,Ia=t),vd)},movementY:function(t){return"movementY"in t?t.movementY:_d}}),u_=yn(Sc),iE=L({},Sc,{dataTransfer:0}),rE=yn(iE),sE=L({},Pa,{relatedTarget:0}),xd=yn(sE),oE=L({},Ar,{animationName:0,elapsedTime:0,pseudoElement:0}),aE=yn(oE),lE=L({},Ar,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),cE=yn(lE),uE=L({},Ar,{data:0}),h_=yn(uE),hE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dE={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"},fE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pE(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=fE[t])?!!n[t]:!1}function yd(){return pE}var mE=L({},Pa,{key:function(t){if(t.key){var n=hE[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=yc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?dE[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yd,charCode:function(t){return t.type==="keypress"?yc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?yc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),gE=yn(mE),vE=L({},Sc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),d_=yn(vE),_E=L({},Ar,{submitter:0}),xE=yn(_E),yE=L({},Pa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yd}),bE=yn(yE),wE=L({},Ar,{propertyName:0,elapsedTime:0,pseudoElement:0}),SE=yn(wE),CE=L({},Sc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),EE=yn(CE),kE=L({},Ar,{newState:0,oldState:0,source:0}),TE=yn(kE),RE=[9,13,27,32],bd=Xi&&"CompositionEvent"in window,za=null;Xi&&"documentMode"in document&&(za=document.documentMode);var AE=Xi&&"TextEvent"in window&&!za,f_=Xi&&(!bd||za&&8<za&&11>=za),p_=" ",m_=!1;function g_(t,n){switch(t){case"keyup":return RE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function v_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var vo=!1;function DE(t,n){switch(t){case"compositionend":return v_(n);case"keypress":return n.which!==32?null:(m_=!0,p_);case"textInput":return t=n.data,t===p_&&m_?null:t;default:return null}}function LE(t,n){if(vo)return t==="compositionend"||!bd&&g_(t,n)?(t=l_(),xc=gd=Rr=null,vo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return f_&&n.locale!=="ko"?null:n.data;default:return null}}var ME={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 __(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!ME[t.type]:n==="textarea"}function x_(t,n,o,h){mo?go?go.push(h):go=[h]:mo=h,n=Cu(n,"onChange"),0<n.length&&(o=new wc("onChange","change",null,o,h),t.push({event:o,listeners:n}))}var Ha=null,Fa=null;function jE(t){ox(t,0)}function Cc(t){var n=Oa(t);if(e_(n))return t}function y_(t,n){if(t==="change")return n}var b_=!1;if(Xi){var wd;if(Xi){var Sd="oninput"in document;if(!Sd){var w_=document.createElement("div");w_.setAttribute("oninput","return;"),Sd=typeof w_.oninput=="function"}wd=Sd}else wd=!1;b_=wd&&(!document.documentMode||9<document.documentMode)}function S_(){Ha&&(Ha.detachEvent("onpropertychange",C_),Fa=Ha=null)}function C_(t){if(t.propertyName==="value"&&Cc(Fa)){var n=[];x_(n,Fa,t,fd(t)),a_(jE,n)}}function OE(t,n,o){t==="focusin"?(S_(),Ha=n,Fa=o,Ha.attachEvent("onpropertychange",C_)):t==="focusout"&&S_()}function NE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Cc(Fa)}function BE(t,n){if(t==="click")return Cc(n)}function PE(t,n){if(t==="input"||t==="change")return Cc(n)}function IE(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Un=typeof Object.is=="function"?Object.is:IE;function Ua(t,n){if(Un(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var o=Object.keys(t),h=Object.keys(n);if(o.length!==h.length)return!1;for(h=0;h<o.length;h++){var E=o[h];if(!qt.call(n,E)||!Un(t[E],n[E]))return!1}return!0}function Cd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function E_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function k_(t,n){var o=E_(t);t=0;for(var h;o;){if(o.nodeType===3){if(h=t+o.textContent.length,t<=n&&h>=n)return{node:o,offset:n-t};t=h}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=E_(o)}}function T_(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?T_(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function R_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Cd(t.document);n instanceof t.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)t=n.contentWindow;else break;n=Cd(t.document)}return n}function Ed(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var zE=Xi&&"documentMode"in document&&11>=document.documentMode,_o=null,kd=null,$a=null,Td=!1;function A_(t,n,o){var h=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Td||_o==null||_o!==Cd(h)||(h=_o,"selectionStart"in h&&Ed(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),$a&&Ua($a,h)||($a=h,h=Cu(kd,"onSelect"),0<h.length&&(n=new wc("onSelect","select",null,n,o),t.push({event:n,listeners:h}),n.target=_o)))}function ys(t,n){var o={};return o[t.toLowerCase()]=n.toLowerCase(),o["Webkit"+t]="webkit"+n,o["Moz"+t]="moz"+n,o}var xo={animationend:ys("Animation","AnimationEnd"),animationiteration:ys("Animation","AnimationIteration"),animationstart:ys("Animation","AnimationStart"),transitionrun:ys("Transition","TransitionRun"),transitionstart:ys("Transition","TransitionStart"),transitioncancel:ys("Transition","TransitionCancel"),transitionend:ys("Transition","TransitionEnd")},Rd={},D_={};Xi&&(D_=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function bs(t){if(Rd[t])return Rd[t];if(!xo[t])return t;var n=xo[t],o;for(o in n)if(n.hasOwnProperty(o)&&o in D_)return Rd[t]=n[o];return t}var L_=bs("animationend"),M_=bs("animationiteration"),j_=bs("animationstart"),HE=bs("transitionrun"),FE=bs("transitionstart"),UE=bs("transitioncancel"),O_=bs("transitionend"),N_=new Map,Ad="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Ad.push("scrollEnd");function vi(t,n){N_.set(t,n),xs(n,[t])}var $E=0;function Qi(t,n){if(t.name!=null&&t.name!=="auto")return t.name;if(n.autoName!==null)return n.autoName;t=bi.identifierPrefix;var o=$E++;return t="_"+t+"t_"+o.toString(32)+"_",n.autoName=t}function B_(t){if(t==null||typeof t=="string")return t;var n=null,o=zo;if(o!==null)for(var h=0;h<o.length;h++){var E=t[o[h]];if(E!=null){if(E==="none")return"none";n=n==null?E:n+(" "+E)}}return n??t.default}function Zi(t,n){return t=B_(t),n=B_(n),n==null?t==="auto"?null:t:n==="auto"?null:n}var Ec=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ri=[],yo=0,Dd=0;function kc(){for(var t=yo,n=Dd=yo=0;n<t;){var o=ri[n];ri[n++]=null;var h=ri[n];ri[n++]=null;var E=ri[n];ri[n++]=null;var k=ri[n];if(ri[n++]=null,h!==null&&E!==null){var N=h.pending;N===null?E.next=E:(E.next=N.next,N.next=E),h.pending=E}k!==0&&P_(o,E,k)}}function Tc(t,n,o,h){ri[yo++]=t,ri[yo++]=n,ri[yo++]=o,ri[yo++]=h,Dd|=h,t.lanes|=h,t=t.alternate,t!==null&&(t.lanes|=h)}function Ld(t,n,o,h){return Tc(t,n,o,h),Rc(t)}function ws(t,n){return Tc(t,null,null,n),Rc(t)}function P_(t,n,o){t.lanes|=o;var h=t.alternate;h!==null&&(h.lanes|=o);for(var E=!1,k=t.return;k!==null;)k.childLanes|=o,h=k.alternate,h!==null&&(h.childLanes|=o),k.tag===22&&(t=k.stateNode,t===null||t._visibility&1||(E=!0)),t=k,k=k.return;return t.tag===3?(k=t.stateNode,E&&n!==null&&(E=31-Hn(o),t=k.hiddenUpdates,h=t[E],h===null?t[E]=[n]:h.push(n),n.lane=o|536870912),k):null}function Rc(t){if(50<hl)throw hl=0,vu=null,Error(s(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var bo={};function qE(t,n,o,h){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(t,n,o,h){return new qE(t,n,o,h)}function Md(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ji(t,n){var o=t.alternate;return o===null?(o=Rn(t.tag,n,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=n,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&1206910976,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,n=t.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function I_(t,n){t.flags&=1206910978;var o=t.alternate;return o===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,n=o.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Ac(t,n,o,h,E,k){var N=0;if(h=t,typeof h=="function")Md(h)&&(N=1);else if(typeof h=="string")N=_3(t,o,Mt.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(h){case Y:return t=Rn(31,o,n,E),t.elementType=Y,t.lanes=k,t;case I:return Ss(o.children,E,k,n);case B:N=8,E|=24;break;case H:return t=Rn(12,o,n,E|2),t.elementType=H,t.lanes=k,t;case Q:return t=Rn(13,o,n,E),t.elementType=Q,t.lanes=k,t;case X:return t=Rn(19,o,n,E),t.elementType=X,t.lanes=k,t;case Z:case V:return t=E|32,t=Rn(30,o,n,t),t.elementType=V,t.lanes=k,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof h=="object"&&h!==null)switch(h.$$typeof){case W:N=10;break e;case F:N=9;break e;case G:N=11;break e;case z:N=14;break e;case O:N=16,h=null;break e}N=29,o=Error(s(130,t===null?"null":typeof t,"")),h=null}return n=Rn(N,o,n,E),n.elementType=t,n.type=h,n.lanes=k,n}function Ss(t,n,o,h){return t=Rn(7,t,h,n),t.lanes=o,t}function jd(t,n,o){return t=Rn(6,t,null,n),t.lanes=o,t}function z_(t){var n=Rn(18,null,null,0);return n.stateNode=t,n}function Od(t,n,o){return n=Rn(4,t.children!==null?t.children:[],t.key,n),n.lanes=o,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var H_=new WeakMap;function si(t,n){if(typeof t=="object"&&t!==null){var o=H_.get(t);return o!==void 0?o:(n={value:t,source:n,stack:Tt(n)},H_.set(t,n),n)}return{value:t,source:n,stack:Tt(n)}}var wo=[],So=0,Dc=null,qa=0,oi=[],ai=0,Dr=null,Ri=1,Ai="";function er(t,n){wo[So++]=qa,wo[So++]=Dc,Dc=t,qa=n}function F_(t,n,o){oi[ai++]=Ri,oi[ai++]=Ai,oi[ai++]=Dr,Dr=t;var h=Ri;t=Ai;var E=32-Hn(h)-1;h&=~(1<<E),o+=1;var k=32-Hn(n)+E;if(30<k){var N=E-E%5;k=(h&(1<<N)-1).toString(32),h>>=N,E-=N,Ri=1<<32-Hn(n)+E|o<<E|h,Ai=k+t}else Ri=1<<k|o<<E|h,Ai=t}function Lc(t){t.return!==null&&(er(t,1),F_(t,1,0))}function Nd(t){for(;t===Dc;)Dc=wo[--So],wo[So]=null,qa=wo[--So],wo[So]=null;for(;t===Dr;)Dr=oi[--ai],oi[ai]=null,Ai=oi[--ai],oi[ai]=null,Ri=oi[--ai],oi[ai]=null}function U_(t,n){oi[ai++]=Ri,oi[ai++]=Ai,oi[ai++]=Dr,Ri=n.id,Ai=n.overflow,Dr=t}var Qt=null,bt=null,Ke=!1,Lr=null,li=!1,Bd=Error(s(519));function Mr(t){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Va(si(n,t)),Bd}function $_(t){var n=t.stateNode,o=t.type,h=t.memoizedProps;switch(n[rn]=t,n[Tn]=h,o){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(o=0;o<fl.length;o++)Ze(fl[o],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":Ze("invalid",n),t_(n,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Ze("invalid",n);break;case"textarea":Ze("invalid",n),i_(n,h.value,h.defaultValue,h.children)}o=h.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||h.suppressHydrationWarning===!0||ux(n.textContent,o)?(h.popover!=null&&(Ze("beforetoggle",n),Ze("toggle",n)),h.onScroll!=null&&Ze("scroll",n),h.onScrollEnd!=null&&Ze("scrollend",n),h.onClick!=null&&(n.onclick=Ti),n=!0):n=!1,n||Mr(t,!0)}function Mc(t){for(Qt=t.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:li=!1;return;case 27:case 3:li=!0;return;default:Qt=Qt.return}}function Co(t){if(t!==Qt)return!1;if(!Ke)return Mc(t),Ke=!0,!1;var n=t.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||fp(t.type,t.memoizedProps)),o=!o),o&&bt&&Mr(t),Mc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));bt=Ax(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));bt=Ax(t)}else n===27?(n=bt,Yr(t.type)?(t=wp,wp=null,bt=t):bt=n):bt=Qt?ui(t.stateNode.nextSibling):null;return!0}function Cs(){bt=Qt=null,Ke=!1}function Pd(){var t=Lr;return t!==null&&(Ln===null?Ln=t:Ln.push.apply(Ln,t),Lr=null),t}function Va(t){Lr===null?Lr=[t]:Lr.push(t)}var Id=qe(null),Es=null,tr=null;function jr(t,n,o){ze(Id,n._currentValue),n._currentValue=o}function nr(t){t._currentValue=Id.current,ke(Id)}function jc(t,n,o){for(;t!==null;){var h=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,h!==null&&(h.childLanes|=n)):h!==null&&(h.childLanes&n)!==n&&(h.childLanes|=n),t===o)break;t=t.return}}function zd(t,n,o,h){var E=t.child;for(E!==null&&(E.return=t);E!==null;){var k=E.dependencies;if(k!==null){var N=E.child;k=k.firstContext;e:for(;k!==null;){var q=k;k=E;for(var J=0;J<n.length;J++)if(q.context===n[J]){k.lanes|=o,q=k.alternate,q!==null&&(q.lanes|=o),jc(k.return,o,t),h||(N=null);break e}k=q.next}}else if(E.tag===18){if(N=E.return,N===null)throw Error(s(341));N.lanes|=o,k=N.alternate,k!==null&&(k.lanes|=o),jc(N,o,t),N=null}else E.tag===13&&E.memoizedState!==null&&E.memoizedState.dehydrated===null?(E.lanes|=o,N=E.alternate,N!==null&&(N.lanes|=o),jc(E.return,o,t),N=E.child,N=N!==null?N.sibling:null):N=E.child;if(N!==null)N.return=E;else for(N=E;N!==null;){if(N===t){N=null;break}if(E=N.sibling,E!==null){E.return=N.return,N=E;break}N=N.return}E=N}}function ks(t,n,o,h){t=null;for(var E=n,k=!1;E!==null;){if(!k){if((E.flags&524288)!==0)k=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var N=E.alternate;if(N===null)throw Error(s(387));if(N=N.memoizedProps,N!==null){var q=E.type;Un(E.pendingProps.value,N.value)||(t!==null?t.push(q):t=[q])}}else if(E===Ie.current){if(N=E.alternate,N===null)throw Error(s(387));N.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(t!==null?t.push(Ko):t=[Ko])}E=E.return}return t!==null&&zd(n,t,o,h),n.flags|=262144,t!==null}function Oc(t){for(t=t.firstContext;t!==null;){if(!Un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ts(t){Es=t,tr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function sn(t){return q_(Es,t)}function Nc(t,n){return Es===null&&Ts(t),q_(t,n)}function q_(t,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},tr===null){if(t===null)throw Error(s(308));tr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else tr=tr.next=n;return o}var VE=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(o,h){t.push(h)}};this.abort=function(){n.aborted=!0,t.forEach(function(o){return o()})}},WE=e.unstable_scheduleCallback,GE=e.unstable_NormalPriority,Bt={$$typeof:W,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hd(){return{controller:new VE,data:new Map,refCount:0}}function Wa(t){t.refCount--,t.refCount===0&&WE(GE,function(){t.controller.abort()})}function V_(t,n){if((t.pendingLanes&4194048)!==0){var o=t.transitionTypes;for(o===null&&(o=t.transitionTypes=[]),t=0;t<n.length;t++){var h=n[t];o.indexOf(h)===-1&&o.push(h)}}}var Ga=null;function YE(t){var n=t.transitionTypes;return t.transitionTypes=null,n}var Ya=null,Fd=0,Rs=0,Eo=null;function KE(t,n){if(Ya===null){var o=Ya=[];Fd=0,Rs=rp(),Eo={status:"pending",value:void 0,then:function(h){o.push(h)}}}return Fd++,n.then(W_,W_),n}function W_(){if(--Fd===0&&(Ga=null,Ya!==null)){Eo!==null&&(Eo.status="fulfilled");var t=Ya;Ya=null,Rs=0,Eo=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function XE(t,n){var o=[],h={status:"pending",value:null,reason:null,then:function(E){o.push(E)}};return t.then(function(){h.status="fulfilled",h.value=n;for(var E=0;E<o.length;E++)(0,o[E])(n)},function(E){for(h.status="rejected",h.reason=E,E=0;E<o.length;E++)(0,o[E])(void 0)}),h}var G_=ue.S;ue.S=function(t,n){if(z0=Vt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&KE(t,n),Ga!==null)for(var o=$o;o!==null;)V_(o,Ga),o=o.next;if(o=t.types,o!==null){for(var h=$o;h!==null;)V_(h,o),h=h.next;if(Rs!==0){h=Ga,h===null&&(h=Ga=[]);for(var E=0;E<o.length;E++){var k=o[E];h.indexOf(k)===-1&&h.push(k)}}}G_!==null&&G_(t,n)};var As=qe(null);function Ud(){var t=As.current;return t!==null?t:_t.pooledCache}function Bc(t,n){n===null?ze(As,As.current):ze(As,n.pool)}function Y_(){var t=Ud();return t===null?null:{parent:Bt._currentValue,pool:t}}var ko=Error(s(460)),$d=Error(s(474)),Pc=Error(s(542)),Ic={then:function(){}};function K_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function X_(t,n,o){switch(o=t[o],o===void 0?t.push(n):o!==n&&(n.then(Ti,Ti),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Z_(t),t===void 0&&!("reason"in n)?Error(s(600)):t;default:if(typeof n.status=="string")n.then(Ti,Ti);else{if(t=_t,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=n,t.status="pending",t.then(function(h){if(n.status==="pending"){var E=n;E.status="fulfilled",E.value=h}},function(h){if(n.status==="pending"){var E=n;E.status="rejected",E.reason=h}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Z_(t),t}throw Ls=n,ko}}function Ds(t){try{var n=t._init;return n(t._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Ls=o,ko):o}}var Ls=null;function Q_(){if(Ls===null)throw Error(s(459));var t=Ls;return Ls=null,t}function Z_(t){if(t===ko||t===Pc)throw Error(s(483))}var To=null,Ka=0;function zc(t){var n=Ka;return Ka+=1,To===null&&(To=[]),X_(To,t,n)}function Or(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Hc(t,n){throw n.$$typeof===A?Error(s(525)):(t=Object.prototype.toString.call(n),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function J_(t){function n(re,te){if(t){var ae=re.deletions;ae===null?(re.deletions=[te],re.flags|=16):ae.push(te)}}function o(re,te){if(!t)return null;for(;te!==null;)n(re,te),te=te.sibling;return null}function h(re){for(var te=new Map;re!==null;)re.key===null?te.set(re.index,re):te.set(re.key,re),re=re.sibling;return te}function E(re,te){return re=Ji(re,te),re.index=0,re.sibling=null,re}function k(re,te,ae){return re.index=ae,t?(ae=re.alternate,ae!==null?(ae=ae.index,ae<te?(re.flags|=2,te):ae):(re.flags|=134217730,te)):(re.flags|=1048576,te)}function N(re){return t&&re.alternate===null&&(re.flags|=134217730),re}function q(re,te,ae,pe){return te===null||te.tag!==6?(te=jd(ae,re.mode,pe),te.return=re,te):(te=E(te,ae),te.return=re,te)}function J(re,te,ae,pe){var Ae=ae.type;return Ae===I?(re=de(re,te,ae.props.children,pe,ae.key),Or(re,ae),re):te!==null&&(te.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===O&&Ds(Ae)===te.type)?(te=E(te,ae.props),Or(te,ae),te.return=re,te):(te=Ac(ae.type,ae.key,ae.props,null,re.mode,pe),Or(te,ae),te.return=re,te)}function se(re,te,ae,pe){return te===null||te.tag!==4||te.stateNode.containerInfo!==ae.containerInfo||te.stateNode.implementation!==ae.implementation?(te=Od(ae,re.mode,pe),te.return=re,te):(te=E(te,ae.children||[]),te.return=re,te)}function de(re,te,ae,pe,Ae){return te===null||te.tag!==7?(te=Ss(ae,re.mode,pe,Ae),te.return=re,te):(te=E(te,ae),te.return=re,te)}function me(re,te,ae){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=jd(""+te,re.mode,ae),te.return=re,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case j:return ae=Ac(te.type,te.key,te.props,null,re.mode,ae),Or(ae,te),ae.return=re,ae;case M:return te=Od(te,re.mode,ae),te.return=re,te;case O:return te=Ds(te),me(re,te,ae)}if(ee(te)||K(te))return te=Ss(te,re.mode,ae,null),te.return=re,te;if(typeof te.then=="function")return me(re,zc(te),ae);if(te.$$typeof===W)return me(re,Nc(re,te),ae);Hc(re,te)}return null}function ie(re,te,ae,pe){var Ae=te!==null?te.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Ae!==null?null:q(re,te,""+ae,pe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case j:return ae.key===Ae?J(re,te,ae,pe):null;case M:return ae.key===Ae?se(re,te,ae,pe):null;case O:return ae=Ds(ae),ie(re,te,ae,pe)}if(ee(ae)||K(ae))return Ae!==null?null:de(re,te,ae,pe,null);if(typeof ae.then=="function")return ie(re,te,zc(ae),pe);if(ae.$$typeof===W)return ie(re,te,Nc(re,ae),pe);Hc(re,ae)}return null}function ce(re,te,ae,pe,Ae){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return re=re.get(ae)||null,q(te,re,""+pe,Ae);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case j:return re=re.get(pe.key===null?ae:pe.key)||null,J(te,re,pe,Ae);case M:return re=re.get(pe.key===null?ae:pe.key)||null,se(te,re,pe,Ae);case O:return pe=Ds(pe),ce(re,te,ae,pe,Ae)}if(ee(pe)||K(pe))return re=re.get(ae)||null,de(te,re,pe,Ae,null);if(typeof pe.then=="function")return ce(re,te,ae,zc(pe),Ae);if(pe.$$typeof===W)return ce(re,te,ae,Nc(te,pe),Ae);Hc(te,pe)}return null}function Ee(re,te,ae,pe){for(var Ae=null,et=null,Oe=te,Pe=te=0,zt=null;Oe!==null&&Pe<ae.length;Pe++){Oe.index>Pe?(zt=Oe,Oe=null):zt=Oe.sibling;var rt=ie(re,Oe,ae[Pe],pe);if(rt===null){Oe===null&&(Oe=zt);break}t&&Oe&&rt.alternate===null&&n(re,Oe),te=k(rt,te,Pe),et===null?Ae=rt:et.sibling=rt,et=rt,Oe=zt}if(Pe===ae.length)return o(re,Oe),Ke&&er(re,Pe),Ae;if(Oe===null){for(;Pe<ae.length;Pe++)Oe=me(re,ae[Pe],pe),Oe!==null&&(te=k(Oe,te,Pe),et===null?Ae=Oe:et.sibling=Oe,et=Oe);return Ke&&er(re,Pe),Ae}for(Oe=h(Oe);Pe<ae.length;Pe++)zt=ce(Oe,re,Pe,ae[Pe],pe),zt!==null&&(t&&(rt=zt.alternate,rt!==null&&Oe.delete(rt.key===null?Pe:rt.key)),te=k(zt,te,Pe),et===null?Ae=zt:et.sibling=zt,et=zt);return t&&Oe.forEach(function(Jr){return n(re,Jr)}),Ke&&er(re,Pe),Ae}function je(re,te,ae,pe){if(ae==null)throw Error(s(151));for(var Ae=null,et=null,Oe=te,Pe=te=0,zt=null,rt=ae.next();Oe!==null&&!rt.done;Pe++,rt=ae.next()){Oe.index>Pe?(zt=Oe,Oe=null):zt=Oe.sibling;var Jr=ie(re,Oe,rt.value,pe);if(Jr===null){Oe===null&&(Oe=zt);break}t&&Oe&&Jr.alternate===null&&n(re,Oe),te=k(Jr,te,Pe),et===null?Ae=Jr:et.sibling=Jr,et=Jr,Oe=zt}if(rt.done)return o(re,Oe),Ke&&er(re,Pe),Ae;if(Oe===null){for(;!rt.done;Pe++,rt=ae.next())rt=me(re,rt.value,pe),rt!==null&&(te=k(rt,te,Pe),et===null?Ae=rt:et.sibling=rt,et=rt);return Ke&&er(re,Pe),Ae}for(Oe=h(Oe);!rt.done;Pe++,rt=ae.next())rt=ce(Oe,re,Pe,rt.value,pe),rt!==null&&(t&&(zt=rt.alternate,zt!==null&&Oe.delete(zt.key===null?Pe:zt.key)),te=k(rt,te,Pe),et===null?Ae=rt:et.sibling=rt,et=rt);return t&&Oe.forEach(function(D3){return n(re,D3)}),Ke&&er(re,Pe),Ae}function Ge(re,te,ae,pe){if(typeof ae=="object"&&ae!==null&&ae.type===I&&ae.key===null&&ae.props.ref===void 0&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case j:e:{for(var Ae=ae.key;te!==null;){if(te.key===Ae){if(Ae=ae.type,Ae===I){if(te.tag===7){o(re,te.sibling),pe=E(te,ae.props.children),Or(pe,ae),pe.return=re,re=pe;break e}}else if(te.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===O&&Ds(Ae)===te.type){o(re,te.sibling),pe=E(te,ae.props),Or(pe,ae),pe.return=re,re=pe;break e}o(re,te);break}else n(re,te);te=te.sibling}ae.type===I?(pe=Ss(ae.props.children,re.mode,pe,ae.key),Or(pe,ae),pe.return=re,re=pe):(pe=Ac(ae.type,ae.key,ae.props,null,re.mode,pe),Or(pe,ae),pe.return=re,re=pe)}return N(re);case M:e:{for(Ae=ae.key;te!==null;){if(te.key===Ae)if(te.tag===4&&te.stateNode.containerInfo===ae.containerInfo&&te.stateNode.implementation===ae.implementation){o(re,te.sibling),pe=E(te,ae.children||[]),pe.return=re,re=pe;break e}else{o(re,te);break}else n(re,te);te=te.sibling}pe=Od(ae,re.mode,pe),pe.return=re,re=pe}return N(re);case O:return ae=Ds(ae),Ge(re,te,ae,pe)}if(ee(ae))return Ee(re,te,ae,pe);if(K(ae)){if(Ae=K(ae),typeof Ae!="function")throw Error(s(150));return ae=Ae.call(ae),je(re,te,ae,pe)}if(typeof ae.then=="function")return Ge(re,te,zc(ae),pe);if(ae.$$typeof===W)return Ge(re,te,Nc(re,ae),pe);Hc(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,te!==null&&te.tag===6?(o(re,te.sibling),pe=E(te,ae),pe.return=re,re=pe):(o(re,te),pe=jd(ae,re.mode,pe),pe.return=re,re=pe),N(re)):o(re,te)}return function(re,te,ae,pe){try{Ka=0;var Ae=Ge(re,te,ae,pe);return To=null,Ae}catch(Oe){if(Oe===ko||Oe===Pc)throw Oe;var et=Rn(29,Oe,null,re.mode);return et.lanes=pe,et.return=re,et}finally{}}}var Ms=J_(!0),e1=J_(!1),Nr=!1;function qd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Br(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Pr(t,n,o){var h=t.updateQueue;if(h===null)return null;if(h=h.shared,(lt&2)!==0){var E=h.pending;return E===null?n.next=n:(n.next=E.next,E.next=n),h.pending=n,n=Rc(t),P_(t,null,o),n}return Tc(t,h,n,o),Rc(t)}function Xa(t,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var h=n.lanes;h&=t.pendingLanes,o|=h,n.lanes=o,Fv(t,o)}}function Wd(t,n){var o=t.updateQueue,h=t.alternate;if(h!==null&&(h=h.updateQueue,o===h)){var E=null,k=null;if(o=o.firstBaseUpdate,o!==null){do{var N={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};k===null?E=k=N:k=k.next=N,o=o.next}while(o!==null);k===null?E=k=n:k=k.next=n}else E=k=n;o={baseState:h.baseState,firstBaseUpdate:E,lastBaseUpdate:k,shared:h.shared,callbacks:h.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=n:t.next=n,o.lastBaseUpdate=n}var Gd=!1;function Qa(){if(Gd){var t=Eo;if(t!==null)throw t}}function Za(t,n,o,h){Gd=!1;var E=t.updateQueue;Nr=!1;var k=E.firstBaseUpdate,N=E.lastBaseUpdate,q=E.shared.pending;if(q!==null){E.shared.pending=null;var J=q,se=J.next;J.next=null,N===null?k=se:N.next=se,N=J;var de=t.alternate;de!==null&&(de=de.updateQueue,q=de.lastBaseUpdate,q!==N&&(q===null?de.firstBaseUpdate=se:q.next=se,de.lastBaseUpdate=J))}if(k!==null){var me=E.baseState;N=0,de=se=J=null,q=k;do{var ie=q.lane&-536870913,ce=ie!==q.lane;if(ce?(Je&ie)===ie:(h&ie)===ie){ie!==0&&ie===Rs&&(Gd=!0),de!==null&&(de=de.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Ee=t,je=q;ie=n;var Ge=o;switch(je.tag){case 1:if(Ee=je.payload,typeof Ee=="function"){me=Ee.call(Ge,me,ie);break e}me=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=je.payload,ie=typeof Ee=="function"?Ee.call(Ge,me,ie):Ee,ie==null)break e;me=L({},me,ie);break e;case 2:Nr=!0}}ie=q.callback,ie!==null&&(t.flags|=64,ce&&(t.flags|=8192),ce=E.callbacks,ce===null?E.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:q.tag,payload:q.payload,callback:q.callback,next:null},de===null?(se=de=ce,J=me):de=de.next=ce,N|=ie;if(q=q.next,q===null){if(q=E.shared.pending,q===null)break;ce=q,q=ce.next,ce.next=null,E.lastBaseUpdate=ce,E.shared.pending=null}}while(!0);de===null&&(J=me),E.baseState=J,E.firstBaseUpdate=se,E.lastBaseUpdate=de,k===null&&(E.shared.lanes=0),qr|=N,t.lanes=N,t.memoizedState=me}}function t1(t,n){if(typeof t!="function")throw Error(s(191,t));t.call(n)}function n1(t,n){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)t1(o[t],n)}var Ir=qe(null),Fc=qe(0);function i1(t,n){t=ar,ze(Fc,t),ze(Ir,n),ar=t|n.baseLanes}function Yd(){ze(Fc,ar),ze(Ir,Ir.current)}function Kd(){ar=Fc.current,ke(Ir),ke(Fc)}var on=qe(null),gn=null;function zr(t){var n=t.alternate;ze(an,an.current&1),ze(on,t),gn===null&&(n===null||Ir.current!==null||n.memoizedState!==null)&&(gn=t)}function Xd(t){ze(an,an.current),ze(on,t),gn===null&&(gn=t)}function r1(t){t.tag===22?(ze(an,an.current),ze(on,t),gn===null&&(gn=t)):Hr()}function Hr(){ze(an,an.current),ze(on,on.current)}function $n(t){ke(on),gn===t&&(gn=null),ke(an)}var an=qe(0);function Ja(t,n){ze(on,on.current),ze(an,n)}function Qd(t){ke(an),ke(on),gn===t&&(gn=null)}function Uc(t){for(var n=t;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||yp(o)||bp(o)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!=="independent"){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ir=0,We=null,vt=null,Pt=null,$c=!1,Ro=!1,js=!1,qc=0,el=0,Ao=null,QE=0;function At(){throw Error(s(321))}function Zd(t,n){if(n===null)return!1;for(var o=0;o<n.length&&o<t.length;o++)if(!Un(t[o],n[o]))return!1;return!0}function Jd(t,n,o,h,E,k){return ir=k,We=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,ue.H=t===null||t.memoizedState===null?F1:U1,js=!1,k=o(h,E),js=!1,Ro&&(k=o1(n,o,h,E)),s1(t),k}function s1(t){ue.H=Qc;var n=vt!==null&&vt.next!==null;if(ir=0,Pt=vt=We=null,$c=!1,el=0,Ao=null,n)throw Error(s(300));t===null||It||(t=t.dependencies,t!==null&&Oc(t)&&(It=!0))}function o1(t,n,o,h){We=t;var E=0;do{if(Ro&&(Ao=null),el=0,Ro=!1,25<=E)throw Error(s(301));if(E+=1,Pt=vt=null,t.updateQueue!=null){var k=t.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}ue.H=sk,k=n(o,h)}while(Ro);return k}function ZE(){var t=ue.H,n=t.useState()[0];return n=typeof n.then=="function"?tl(n):n,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(We.flags|=1024),n}function ef(){var t=qc!==0;return qc=0,t}function tf(t,n,o){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~o}function nf(t){if($c){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}$c=!1}ir=0,Pt=vt=We=null,Ro=!1,el=qc=0,Ao=null}function bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?We.memoizedState=Pt=t:Pt=Pt.next=t,Pt}function jt(){if(vt===null){var t=We.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var n=Pt===null?We.memoizedState:Pt.next;if(n!==null)Pt=n,vt=t;else{if(t===null)throw We.alternate===null?Error(s(467)):Error(s(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Pt===null?We.memoizedState=Pt=t:Pt=Pt.next=t}return Pt}function Vc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tl(t){var n=el;return el+=1,Ao===null&&(Ao=[]),t=X_(Ao,t,n),n=We,(Pt===null?n.memoizedState:Pt.next)===null&&(n=n.alternate,ue.H=n===null||n.memoizedState===null?F1:U1),t}function Wc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return tl(t);if(t.$$typeof===ne)return;if(t.$$typeof===W)return sn(t)}throw Error(s(438,String(t)))}function rf(t){var n=null,o=We.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var h=We.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(n={data:h.data.map(function(E){return E.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=Vc(),We.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(t),h=0;h<t;h++)o[h]=U;return n.index++,o}function rr(t,n){return typeof n=="function"?n(t):n}function Gc(t){var n=jt();return sf(n,vt,t)}function sf(t,n,o){var h=t.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=o;var E=t.baseQueue,k=h.pending;if(k!==null){if(E!==null){var N=E.next;E.next=k.next,k.next=N}n.baseQueue=E=k,h.pending=null}if(k=t.baseState,E===null)t.memoizedState=k;else{n=E.next;var q=N=null,J=null,se=n,de=!1;do{var me=se.lane&-536870913;if(me!==se.lane?(Je&me)===me:(ir&me)===me){var ie=se.revertLane;if(ie===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),me===Rs&&(de=!0);else if((ir&ie)===ie){se=se.next,ie===Rs&&(de=!0);continue}else me={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},J===null?(q=J=me,N=k):J=J.next=me,We.lanes|=ie,qr|=ie;me=se.action,js&&o(k,me),k=se.hasEagerState?se.eagerState:o(k,me)}else ie={lane:me,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},J===null?(q=J=ie,N=k):J=J.next=ie,We.lanes|=me,qr|=me;se=se.next}while(se!==null&&se!==n);if(J===null?N=k:J.next=q,!Un(k,t.memoizedState)&&(It=!0,de&&(o=Eo,o!==null)))throw o;t.memoizedState=k,t.baseState=N,t.baseQueue=J,h.lastRenderedState=k}return E===null&&(h.lanes=0),[t.memoizedState,h.dispatch]}function of(t){var n=jt(),o=n.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=t;var h=o.dispatch,E=o.pending,k=n.memoizedState;if(E!==null){o.pending=null;var N=E=E.next;do k=t(k,N.action),N=N.next;while(N!==E);Un(k,n.memoizedState)||(It=!0),n.memoizedState=k,n.baseQueue===null&&(n.baseState=k),o.lastRenderedState=k}return[k,h]}function a1(t,n,o){var h=We,E=jt(),k=Ke;if(k){if(o===void 0)throw Error(s(407));o=o()}else o=n();var N=!Un((vt||E).memoizedState,o);if(N&&(E.memoizedState=o,It=!0),E=E.queue,cf(u1.bind(null,h,E,t),[t]),t=E.getSnapshot!==n||N||Pt!==null&&(Pt.memoizedState.tag&1)!==0,Do(t?9:8,{destroy:void 0},c1.bind(null,h,E,o,n),null),t){if(h.flags|=2048,_t===null)throw Error(s(349));k||(ir&127)!==0||l1(h,n,o)}return o}function l1(t,n,o){t.flags|=16384,t={getSnapshot:n,value:o},n=We.updateQueue,n===null?(n=Vc(),We.updateQueue=n,n.stores=[t]):(o=n.stores,o===null?n.stores=[t]:o.push(t))}function c1(t,n,o,h){n.value=o,n.getSnapshot=h,h1(n)&&d1(t)}function u1(t,n,o){return o(function(){h1(n)&&d1(t)})}function h1(t){var n=t.getSnapshot;t=t.value;try{var o=n();return!Un(t,o)}catch{return!0}}function d1(t){var n=ws(t,2);n!==null&&Mn(n,t,2)}function af(t){var n=bn();if(typeof t=="function"){var o=t;if(t=o(),js){Tr(!0);try{o()}finally{Tr(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:t},n}function f1(t,n,o,h){return t.baseState=o,sf(t,vt,typeof h=="function"?h:rr)}function JE(t,n,o,h,E){if(Xc(t))throw Error(s(485));if(t=n.action,t!==null){var k={payload:E,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){k.listeners.push(N)}};ue.T!==null?o(!0):k.isTransition=!1,h(k),o=n.pending,o===null?(k.next=n.pending=k,p1(n,k)):(k.next=o.next,n.pending=o.next=k)}}function p1(t,n){var o=n.action,h=n.payload,E=t.state;if(n.isTransition){var k=ue.T,N={};N.types=k!==null?k.types:null,ue.T=N;try{var q=o(E,h),J=ue.S;J!==null&&J(N,q),m1(t,n,q)}catch(se){lf(t,n,se)}finally{k!==null&&N.types!==null&&(k.types=N.types),ue.T=k}}else try{k=o(E,h),m1(t,n,k)}catch(se){lf(t,n,se)}}function m1(t,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(h){g1(t,n,h)},function(h){return lf(t,n,h)}):g1(t,n,o)}function g1(t,n,o){n.status="fulfilled",n.value=o,v1(n),t.state=o,n=t.pending,n!==null&&(o=n.next,o===n?t.pending=null:(o=o.next,n.next=o,p1(t,o)))}function lf(t,n,o){var h=t.pending;if(t.pending=null,h!==null){h=h.next;do n.status="rejected",n.reason=o,v1(n),n=n.next;while(n!==h)}t.action=null}function v1(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function _1(t,n){return n}function x1(t,n){if(Ke){var o=_t.formState;if(o!==null){e:{var h=We;if(Ke){if(bt){t:{for(var E=bt,k=li;E.nodeType!==8;){if(!k){E=null;break t}if(E=ui(E.nextSibling),E===null){E=null;break t}}k=E.data,E=k==="F!"||k==="F"?E:null}if(E){bt=ui(E.nextSibling),h=E.data==="F!";break e}}Mr(h)}h=!1}h&&(n=o[0])}}return o=bn(),o.memoizedState=o.baseState=n,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_1,lastRenderedState:n},o.queue=h,o=I1.bind(null,We,h),h.dispatch=o,h=af(!1),k=pf.bind(null,We,!1,h.queue),h=bn(),E={state:n,dispatch:null,action:t,pending:null},h.queue=E,o=JE.bind(null,We,E,k,o),E.dispatch=o,h.memoizedState=t,[n,o,!1]}function y1(t){var n=jt();return b1(n,vt,t)}function b1(t,n,o){if(n=sf(t,n,_1)[0],t=Gc(rr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var h=tl(n)}catch(N){throw N===ko?Pc:N}else h=n;n=jt();var E=n.queue,k=E.dispatch;return o!==n.memoizedState&&(We.flags|=2048,Do(9,{destroy:void 0},ek.bind(null,E,o),null)),[h,k,t]}function ek(t,n){t.action=n}function w1(t){var n=jt(),o=vt;if(o!==null)return b1(n,o,t);jt(),n=n.memoizedState,o=jt();var h=o.queue.dispatch;return o.memoizedState=t,[n,h,!1]}function Do(t,n,o,h){return t={tag:t,create:o,deps:h,inst:n,next:null},n=We.updateQueue,n===null&&(n=Vc(),We.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=t.next=t:(h=o.next,o.next=t,t.next=h,n.lastEffect=t),t}function S1(){return jt().memoizedState}function Yc(t,n,o,h){var E=bn();We.flags|=t,E.memoizedState=Do(1|n,{destroy:void 0},o,h===void 0?null:h)}function Kc(t,n,o,h){var E=jt();h=h===void 0?null:h;var k=E.memoizedState.inst;vt!==null&&h!==null&&Zd(h,vt.memoizedState.deps)?E.memoizedState=Do(n,k,o,h):(We.flags|=t,E.memoizedState=Do(1|n,k,o,h))}function C1(t,n){Yc(8390656,8,t,n)}function cf(t,n){Kc(2048,8,t,n)}function tk(t){We.flags|=4;var n=We.updateQueue;if(n===null)n=Vc(),We.updateQueue=n,n.events=[t];else{var o=n.events;o===null?n.events=[t]:o.push(t)}}function E1(t){var n=jt().memoizedState;return tk({ref:n,nextImpl:t}),function(){if((lt&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function k1(t,n){return Kc(4,2,t,n)}function T1(t,n){return Kc(4,4,t,n)}function R1(t,n){if(typeof n=="function"){t=t();var o=n(t);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function A1(t,n,o){o=o!=null?o.concat([t]):null,Kc(4,4,R1.bind(null,n,t),o)}function uf(){}function D1(t,n){var o=jt();n=n===void 0?null:n;var h=o.memoizedState;return n!==null&&Zd(n,h[1])?h[0]:(o.memoizedState=[t,n],t)}function L1(t,n){var o=jt();n=n===void 0?null:n;var h=o.memoizedState;if(n!==null&&Zd(n,h[1]))return h[0];if(h=t(),js){Tr(!0);try{t()}finally{Tr(!1)}}return o.memoizedState=[h,n],h}function hf(t,n,o){return o===void 0||(ir&1073741824)!==0&&(Je&261930)===0?t.memoizedState=n:(t.memoizedState=o,t=F0(),We.lanes|=t,qr|=t,o)}function M1(t,n,o,h){return Un(o,n)?o:Ir.current!==null?(t=hf(t,o,h),Un(t,n)||(It=!0),t):(ir&106)===0||(ir&1073741824)!==0&&(Je&261930)===0?(It=!0,t.memoizedState=o):(t=F0(),We.lanes|=t,qr|=t,n)}function j1(t,n,o,h,E){var k=he.p;he.p=k!==0&&8>k?k:8;var N=ue.T,q={};q.types=N!==null?N.types:null,ue.T=q,pf(t,!1,n,o);try{var J=E(),se=ue.S;if(se!==null&&se(q,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var de=XE(J,h);nl(t,n,de,Gn(t))}else nl(t,n,h,Gn(t))}catch(me){nl(t,n,{then:function(){},status:"rejected",reason:me},Gn())}finally{he.p=k,N!==null&&q.types!==null&&(N.types=q.types),ue.T=N}}function nk(){}function df(t,n,o,h){if(t.tag!==5)throw Error(s(476));var E=O1(t).queue;j1(t,E,n,Se,o===null?nk:function(){return N1(t),o(h)})}function O1(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:Se,baseState:Se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:Se},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:o},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function N1(t){var n=O1(t);n.next===null&&(n=t.alternate.memoizedState),nl(t,n.next.queue,{},Gn())}function ff(){return sn(Ko)}function B1(){return jt().memoizedState}function P1(){return jt().memoizedState}function ik(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var o=Gn();t=Br(o);var h=Pr(n,t,o);h!==null&&(Mn(h,n,o),Xa(h,n,o)),n={cache:Hd()},t.payload=n;return}n=n.return}}function rk(t,n,o){var h=Gn();o={lane:h,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Xc(t)?z1(n,o):(o=Ld(t,n,o,h),o!==null&&(Mn(o,t,h),H1(o,n,h)))}function I1(t,n,o){var h=Gn();nl(t,n,o,h)}function nl(t,n,o,h){var E={lane:h,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Xc(t))z1(n,E);else{var k=t.alternate;if(t.lanes===0&&(k===null||k.lanes===0)&&(k=n.lastRenderedReducer,k!==null))try{var N=n.lastRenderedState,q=k(N,o);if(E.hasEagerState=!0,E.eagerState=q,Un(q,N))return Tc(t,n,E,0),_t===null&&kc(),!1}catch{}finally{}if(o=Ld(t,n,E,h),o!==null)return Mn(o,t,h),H1(o,n,h),!0}return!1}function pf(t,n,o,h){if(h={lane:2,revertLane:rp(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Xc(t)){if(n)throw Error(s(479))}else n=Ld(t,o,h,2),n!==null&&Mn(n,t,2)}function Xc(t){var n=t.alternate;return t===We||n!==null&&n===We}function z1(t,n){Ro=$c=!0;var o=t.pending;o===null?n.next=n:(n.next=o.next,o.next=n),t.pending=n}function H1(t,n,o){if((o&4194048)!==0){var h=n.lanes;h&=t.pendingLanes,o|=h,n.lanes=o,Fv(t,o)}}var Qc={readContext:sn,use:Wc,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At,useEffectEvent:At},F1={readContext:sn,use:Wc,useCallback:function(t,n){return bn().memoizedState=[t,n===void 0?null:n],t},useContext:sn,useEffect:C1,useImperativeHandle:function(t,n,o){o=o!=null?o.concat([t]):null,Yc(4194308,4,R1.bind(null,n,t),o)},useLayoutEffect:function(t,n){return Yc(4194308,4,t,n)},useInsertionEffect:function(t,n){Yc(4,2,t,n)},useMemo:function(t,n){var o=bn();n=n===void 0?null:n;var h=t();if(js){Tr(!0);try{t()}finally{Tr(!1)}}return o.memoizedState=[h,n],h},useReducer:function(t,n,o){var h=bn();if(o!==void 0){var E=o(n);if(js){Tr(!0);try{o(n)}finally{Tr(!1)}}}else E=n;return h.memoizedState=h.baseState=E,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:E},h.queue=t,t=t.dispatch=rk.bind(null,We,t),[h.memoizedState,t]},useRef:function(t){var n=bn();return t={current:t},n.memoizedState=t},useState:function(t){t=af(t);var n=t.queue,o=I1.bind(null,We,n);return n.dispatch=o,[t.memoizedState,o]},useDebugValue:uf,useDeferredValue:function(t,n){var o=bn();return hf(o,t,n)},useTransition:function(){var t=af(!1);return t=j1.bind(null,We,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,o){var h=We,E=bn();if(Ke){if(o===void 0)throw Error(s(407));o=o()}else{if(o=n(),_t===null)throw Error(s(349));(Je&127)!==0||l1(h,n,o)}E.memoizedState=o;var k={value:o,getSnapshot:n};return E.queue=k,C1(u1.bind(null,h,k,t),[t]),h.flags|=2048,Do(9,{destroy:void 0},c1.bind(null,h,k,o,n),null),o},useId:function(){var t=bn(),n=_t.identifierPrefix;if(Ke){var o=Ai,h=Ri;o=(h&~(1<<32-Hn(h)-1)).toString(32)+o,n="_"+n+"R_"+o,o=qc++,0<o&&(n+="H"+o.toString(32)),n+="_"}else o=QE++,n="_"+n+"r_"+o.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:ff,useFormState:x1,useActionState:x1,useOptimistic:function(t){var n=bn();n.memoizedState=n.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=pf.bind(null,We,!0,o),o.dispatch=n,[t,n]},useMemoCache:rf,useCacheRefresh:function(){return bn().memoizedState=ik.bind(null,We)},useEffectEvent:function(t){var n=bn(),o={impl:t};return n.memoizedState=o,function(){if((lt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}},U1={readContext:sn,use:Wc,useCallback:D1,useContext:sn,useEffect:cf,useImperativeHandle:A1,useInsertionEffect:k1,useLayoutEffect:T1,useMemo:L1,useReducer:Gc,useRef:S1,useState:function(){return Gc(rr)},useDebugValue:uf,useDeferredValue:function(t,n){var o=jt();return M1(o,vt.memoizedState,t,n)},useTransition:function(){var t=Gc(rr)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:tl(t),n]},useSyncExternalStore:a1,useId:B1,useHostTransitionStatus:ff,useFormState:y1,useActionState:y1,useOptimistic:function(t,n){var o=jt();return f1(o,vt,t,n)},useMemoCache:rf,useCacheRefresh:P1,useEffectEvent:E1},sk={readContext:sn,use:Wc,useCallback:D1,useContext:sn,useEffect:cf,useImperativeHandle:A1,useInsertionEffect:k1,useLayoutEffect:T1,useMemo:L1,useReducer:of,useRef:S1,useState:function(){return of(rr)},useDebugValue:uf,useDeferredValue:function(t,n){var o=jt();return vt===null?hf(o,t,n):M1(o,vt.memoizedState,t,n)},useTransition:function(){var t=of(rr)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:tl(t),n]},useSyncExternalStore:a1,useId:B1,useHostTransitionStatus:ff,useFormState:w1,useActionState:w1,useOptimistic:function(t,n){var o=jt();return vt!==null?f1(o,vt,t,n):(o.baseState=t,[t,o.queue.dispatch])},useMemoCache:rf,useCacheRefresh:P1,useEffectEvent:E1};function mf(t,n,o,h){n=t.memoizedState,o=o(h,n),o=o==null?n:L({},n,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var gf={enqueueSetState:function(t,n,o){t=t._reactInternals;var h=Gn(),E=Br(h);E.payload=n,o!=null&&(E.callback=o),n=Pr(t,E,h),n!==null&&(Mn(n,t,h),Xa(n,t,h))},enqueueReplaceState:function(t,n,o){t=t._reactInternals;var h=Gn(),E=Br(h);E.tag=1,E.payload=n,o!=null&&(E.callback=o),n=Pr(t,E,h),n!==null&&(Mn(n,t,h),Xa(n,t,h))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var o=Gn(),h=Br(o);h.tag=2,n!=null&&(h.callback=n),n=Pr(t,h,o),n!==null&&(Mn(n,t,o),Xa(n,t,o))}};function $1(t,n,o,h,E,k,N){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(h,k,N):n.prototype&&n.prototype.isPureReactComponent?!Ua(o,h)||!Ua(E,k):!0}function q1(t,n,o,h){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,h),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,h),n.state!==t&&gf.enqueueReplaceState(n,n.state,null)}function Os(t,n){var o=n;if("ref"in n){o={};for(var h in n)h!=="ref"&&(o[h]=n[h])}if(t=t.defaultProps){o===n&&(o=L({},o));for(var E in t)o[E]===void 0&&(o[E]=t[E])}return o}function V1(t){Ec(t)}function W1(t){console.error(t)}function G1(t){Ec(t)}function Zc(t,n){try{var o=t.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(h){setTimeout(function(){throw h})}}function Y1(t,n,o){try{var h=t.onCaughtError;h(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function vf(t,n,o){return o=Br(o),o.tag=3,o.payload={element:null},o.callback=function(){Zc(t,n)},o}function K1(t){return t=Br(t),t.tag=3,t}function X1(t,n,o,h){var E=o.type.getDerivedStateFromError;if(typeof E=="function"){var k=h.value;t.payload=function(){return E(k)},t.callback=function(){Y1(n,o,h)}}var N=o.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(t.callback=function(){Y1(n,o,h),typeof E!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var q=h.stack;this.componentDidCatch(h.value,{componentStack:q!==null?q:""})})}function ok(t,n,o,h,E){if(o.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(n=o.alternate,n!==null&&ks(n,o,E,!0),o=on.current,o!==null){switch(o.tag){case 31:case 13:case 19:return gn===null?xu():o.alternate===null&&Dt===0&&(Dt=3),o.flags&=-257,o.flags|=65536,o.lanes=E,h===Ic?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([h]):n.add(h),tp(t,h,E)),!1;case 22:return o.flags|=65536,h===Ic?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([h])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([h]):o.add(h)),tp(t,h,E)),!1}throw Error(s(435,o.tag))}return tp(t,h,E),xu(),!1}if(Ke)return n=on.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=E,h!==Bd&&(t=Error(s(422),{cause:h}),Va(si(t,o)))):(h!==Bd&&(n=Error(s(423),{cause:h}),Va(si(n,o))),t=t.current.alternate,t.flags|=65536,E&=-E,t.lanes|=E,h=si(h,o),E=vf(t.stateNode,h,E),Wd(t,E),Dt!==4&&(Dt=2)),!1;var k=Error(s(520),{cause:h});if(k=si(k,o),ul===null?ul=[k]:ul.push(k),Dt!==4&&(Dt=2),n===null)return!0;h=si(h,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,t=E&-E,o.lanes|=t,t=vf(o.stateNode,h,t),Wd(o,t),!1;case 1:if(n=o.type,k=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Vr===null||!Vr.has(k))))return o.flags|=65536,E&=-E,o.lanes|=E,E=K1(E),X1(E,t,o,h),Wd(o,E),!1;break;case 22:if(o.memoizedState!==null)return o.flags|=65536,!1}o=o.return}while(o!==null);return!1}var _f=Error(s(461)),It=!1;function Gt(t,n,o,h){n.child=t===null?e1(n,null,o,h):Ms(n,t.child,o,h)}function Q1(t,n,o,h,E){o=o.render;var k=n.ref;if("ref"in h){var N={};for(var q in h)q!=="ref"&&(N[q]=h[q])}else N=h;return Ts(n),h=Jd(t,n,o,N,k,E),q=ef(),t!==null&&!It?(tf(t,n,E),sr(t,n,E)):(Ke&&q&&Lc(n),n.flags|=1,Gt(t,n,h,E),n.child)}function Z1(t,n,o,h,E){if(t===null){var k=o.type;return typeof k=="function"&&!Md(k)&&k.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=k,J1(t,n,k,h,E)):(t=Ac(o.type,null,h,n,n.mode,E),t.ref=n.ref,t.return=n,n.child=t)}if(k=t.child,!kf(t,E)){var N=k.memoizedProps;if(o=o.compare,o=o!==null?o:Ua,o(N,h)&&t.ref===n.ref)return sr(t,n,E)}return n.flags|=1,t=Ji(k,h),t.ref=n.ref,t.return=n,n.child=t}function J1(t,n,o,h,E){if(t!==null){var k=t.memoizedProps;if(Ua(k,h)&&t.ref===n.ref)if(It=!1,n.pendingProps=h=k,kf(t,E))(t.flags&131072)!==0&&(It=!0);else return n.lanes=t.lanes,sr(t,n,E)}return xf(t,n,o,h,E)}function e0(t,n,o,h){var E=h.children,k=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((n.flags&128)!==0){if(k=k!==null?k.baseLanes|o:o,t!==null){for(h=n.child=t.child,E=0;h!==null;)E=E|h.lanes|h.childLanes,h=h.sibling;h=E&~k}else h=0,n.child=null;return t0(t,n,k,o,h)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Bc(n,k!==null?k.cachePool:null),k!==null?i1(n,k):Yd(),r1(n);else return h=n.lanes=536870912,t0(t,n,k!==null?k.baseLanes|o:o,o,h)}else k!==null?(Bc(n,k.cachePool),i1(n,k),Hr(),n.memoizedState=null):(t!==null&&Bc(n,null),Yd(),Hr());return Gt(t,n,E,o),n.child}function il(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function t0(t,n,o,h,E){var k=Ud();return k=k===null?null:{parent:Bt._currentValue,pool:k},n.memoizedState={baseLanes:o,cachePool:k},t!==null&&Bc(n,null),Yd(),r1(n),t!==null&&ks(t,n,h,!0),n.childLanes=E,null}function Jc(t,n){return n=eu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function n0(t,n,o){return Ms(n,t.child,null,o),t=Jc(n,n.pendingProps),t.flags|=2,$n(n),n.memoizedState=null,t}function ak(t,n,o){var h=n.pendingProps,E=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ke){if(h.mode==="hidden")return t=Jc(n,h),n.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},il(null,t);if(Xd(n),(t=bt)?(t=Rx(t,li),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Dr!==null?{id:Ri,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},o=z_(t),o.return=n,n.child=o,Qt=n,bt=null)):t=null,t===null)throw Mr(n);return n.lanes=536870912,null}return Jc(n,h)}var k=t.memoizedState;if(k!==null){var N=k.dehydrated;if(Xd(n),E)if(n.flags&256)n.flags&=-257,n=n0(t,n,o);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(s(558));else if(It||ks(t,n,o,!1),E=(o&t.childLanes)!==0,It||E){if(Ir.current===null){if(h=_t,h!==null&&(N=Uv(h,o),N!==0&&N!==k.retryLane))throw k.retryLane=N,ws(t,N),Mn(h,t,N),_f;xu()}n=n0(t,n,o)}else t=k.treeContext,bt=ui(N.nextSibling),Qt=n,Ke=!0,Lr=null,li=!1,t!==null&&U_(n,t),n=Jc(n,h),n.flags|=134221824;return n}return t=Ji(t.child,{mode:h.mode,children:h.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Lo(t,n){var o=n.ref;if(o===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(s(284));(t===null||t.ref!==o)&&(n.flags|=4194816)}}function xf(t,n,o,h,E){return Ts(n),o=Jd(t,n,o,h,void 0,E),h=ef(),t!==null&&!It?(tf(t,n,E),sr(t,n,E)):(Ke&&h&&Lc(n),n.flags|=1,Gt(t,n,o,E),n.child)}function i0(t,n,o,h,E,k){return Ts(n),n.updateQueue=null,o=o1(n,h,o,E),s1(t),h=ef(),t!==null&&!It?(tf(t,n,k),sr(t,n,k)):(Ke&&h&&Lc(n),n.flags|=1,Gt(t,n,o,k),n.child)}function r0(t,n,o,h,E){if(Ts(n),n.stateNode===null){var k=bo,N=o.contextType;typeof N=="object"&&N!==null&&(k=sn(N)),k=new o(h,k),n.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=gf,n.stateNode=k,k._reactInternals=n,k=n.stateNode,k.props=h,k.state=n.memoizedState,k.refs={},qd(n),N=o.contextType,k.context=typeof N=="object"&&N!==null?sn(N):bo,k.state=n.memoizedState,N=o.getDerivedStateFromProps,typeof N=="function"&&(mf(n,o,N,h),k.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(N=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),N!==k.state&&gf.enqueueReplaceState(k,k.state,null),Za(n,h,k,E),Qa(),k.state=n.memoizedState),typeof k.componentDidMount=="function"&&(n.flags|=4194308),h=!0}else if(t===null){k=n.stateNode;var q=n.memoizedProps,J=Os(o,q);k.props=J;var se=k.context,de=o.contextType;N=bo,typeof de=="object"&&de!==null&&(N=sn(de));var me=o.getDerivedStateFromProps;de=typeof me=="function"||typeof k.getSnapshotBeforeUpdate=="function",q=n.pendingProps!==q,de||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(q||se!==N)&&q1(n,k,h,N),Nr=!1;var ie=n.memoizedState;k.state=ie,Za(n,h,k,E),Qa(),se=n.memoizedState,q||ie!==se||Nr?(typeof me=="function"&&(mf(n,o,me,h),se=n.memoizedState),(J=Nr||$1(n,o,J,h,ie,se,N))?(de||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(n.flags|=4194308)):(typeof k.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=h,n.memoizedState=se),k.props=h,k.state=se,k.context=N,h=J):(typeof k.componentDidMount=="function"&&(n.flags|=4194308),h=!1)}else{k=n.stateNode,Vd(t,n),N=n.memoizedProps,de=Os(o,N),k.props=de,me=n.pendingProps,ie=k.context,se=o.contextType,J=bo,typeof se=="object"&&se!==null&&(J=sn(se)),q=o.getDerivedStateFromProps,(se=typeof q=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(N!==me||ie!==J)&&q1(n,k,h,J),Nr=!1,ie=n.memoizedState,k.state=ie,Za(n,h,k,E),Qa();var ce=n.memoizedState;N!==me||ie!==ce||Nr||t!==null&&t.dependencies!==null&&Oc(t.dependencies)?(typeof q=="function"&&(mf(n,o,q,h),ce=n.memoizedState),(de=Nr||$1(n,o,de,h,ie,ce,J)||t!==null&&t.dependencies!==null&&Oc(t.dependencies))?(se||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(h,ce,J),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(h,ce,J)),typeof k.componentDidUpdate=="function"&&(n.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof k.componentDidUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=1024),n.memoizedProps=h,n.memoizedState=ce),k.props=h,k.state=ce,k.context=J,h=de):(typeof k.componentDidUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=1024),h=!1)}return k=h,Lo(t,n),h=(n.flags&128)!==0,k||h?(k=n.stateNode,o=h&&typeof o.getDerivedStateFromError!="function"?null:k.render(),n.flags|=1,t!==null&&h?(n.child=Ms(n,t.child,null,E),n.child=Ms(n,null,o,E)):Gt(t,n,o,E),n.memoizedState=k.state,t=n.child):t=sr(t,n,E),t}function s0(t,n,o,h){return Cs(),n.flags|=256,Gt(t,n,o,h),n.child}var yf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bf(t){return{baseLanes:t,cachePool:Y_()}}function wf(t,n,o){return t=t!==null?t.childLanes&~o:0,n&&(t|=Wn),t}function o0(t,n,o){var h=n.pendingProps,E=!1,k=(n.flags&128)!==0,N;if((N=k)||(N=t!==null&&t.memoizedState===null?!1:(an.current&2)!==0),N&&(E=!0,n.flags&=-129),N=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ke){if(E?zr(n):Hr(),(t=bt)?(t=Rx(t,li),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Dr!==null?{id:Ri,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},o=z_(t),o.return=n,n.child=o,Qt=n,bt=null)):t=null,t===null)throw Mr(n);return bp(t)?n.lanes=32:n.lanes=536870912,null}return k=h.children,h=h.fallback,E?(Hr(),E=n.mode,k=eu({mode:"hidden",children:k},E),h=Ss(h,E,o,null),k.return=n,h.return=n,k.sibling=h,n.child=k,h=n.child,h.memoizedState=bf(o),h.childLanes=wf(t,N,o),n.memoizedState=yf,il(null,h)):(zr(n),Sf(n,k))}var q=t.memoizedState;if(q!==null){var J=q.dehydrated;if(J!==null)return lk(t,n,k,N,h,J,q,o)}return E?(Hr(),E=h.fallback,k=n.mode,q=t.child,J=q.sibling,h=Ji(q,{mode:"hidden",children:h.children}),h.subtreeFlags=q.subtreeFlags&1206910976,J!==null?E=Ji(J,E):(E=Ss(E,k,o,null),E.flags|=2),E.return=n,h.return=n,h.sibling=E,n.child=h,il(null,h),h=n.child,E=t.child.memoizedState,E===null?E=bf(o):(k=E.cachePool,k!==null?(q=Bt._currentValue,k=k.parent!==q?{parent:q,pool:q}:k):k=Y_(),E={baseLanes:E.baseLanes|o,cachePool:k}),h.memoizedState=E,h.childLanes=wf(t,N,o),n.memoizedState=yf,il(t.child,h)):(zr(n),o=t.child,t=o.sibling,o=Ji(o,{mode:"visible",children:h.children}),o.return=n,o.sibling=null,t!==null&&(N=n.deletions,N===null?(n.deletions=[t],n.flags|=16):N.push(t)),n.child=o,n.memoizedState=null,o)}function Sf(t,n){return n=eu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function eu(t,n){return t=Rn(22,t,null,n),t.lanes=0,t}function tu(t,n,o){return Ms(n,t.child,null,o),t=Sf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function lk(t,n,o,h,E,k,N,q){if(o)return n.flags&256?(zr(n),n.flags&=-257,tu(t,n,q)):n.memoizedState!==null?(Hr(),n.child=t.child,n.flags|=128,null):(Hr(),k=E.fallback,N=n.mode,E=eu({mode:"visible",children:E.children},N),k=Ss(k,N,q,null),k.flags|=2,E.return=n,k.return=n,E.sibling=k,n.child=E,Ms(n,t.child,null,q),E=n.child,E.memoizedState=bf(q),E.childLanes=wf(t,h,q),n.memoizedState=yf,il(null,E));if(zr(n),bp(k)){if(h=k.nextSibling&&k.nextSibling.dataset,h)var J=h.dgst;return h=J,h!==""&&(E=Error(s(419)),E.stack="",E.digest=h,Va({value:E,source:null,stack:null})),tu(t,n,q)}if(It||ks(t,n,q,!1),h=(q&t.childLanes)!==0,It||h){if(Ir.current!==null)return tu(t,n,q);if(h=_t,h!==null&&(E=Uv(h,q),E!==0&&E!==N.retryLane))throw N.retryLane=E,ws(t,E),Mn(h,t,E),_f;return yp(k)||xu(),tu(t,n,q)}return yp(k)?(n.flags|=192,n.child=t.child,null):(t=N.treeContext,bt=ui(k.nextSibling),Qt=n,Ke=!0,Lr=null,li=!1,t!==null&&U_(n,t),n=Sf(n,E.children),n.flags|=134221824,n)}function a0(t,n,o){t.lanes|=n;var h=t.alternate;h!==null&&(h.lanes|=n),jc(t.return,n,o)}function l0(t){for(var n=null;t!==null;){var o=t.alternate;o!==null&&Uc(o)===null&&(n=t),t=t.sibling}return n}function nu(t,n,o,h,E,k){var N=t.memoizedState;N===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:h,tail:o,tailMode:E,treeForkCount:k}:(N.isBackwards=n,N.rendering=null,N.renderingStartTime=0,N.last=h,N.tail=o,N.tailMode=E,N.treeForkCount=k)}function Cf(t){var n=t.child;for(t.child=null;n!==null;){var o=n.sibling;n.sibling=t.child,t.child=n,n=o}}function Ef(t,n,o){var h=n.pendingProps,E=h.revealOrder,k=h.tail;h=h.children;var N=an.current;if(n.flags&128)return Ja(n,N),null;var q=(N&2)!==0;if(q?(N=N&1|2,n.flags|=128):N&=1,Ja(n,N),E==="backwards"&&t!==null?(Cf(t),Gt(t,n,h,o),Cf(t)):Gt(t,n,h,o),h=Ke?qa:0,!q&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&a0(t,o,n);else if(t.tag===19)a0(t,o,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(E){case"backwards":o=l0(n.child),o===null?(E=n.child,n.child=null):(E=o.sibling,o.sibling=null,Cf(n)),nu(n,!0,E,null,k,h);break;case"unstable_legacy-backwards":for(o=null,E=n.child,n.child=null;E!==null;){if(t=E.alternate,t!==null&&Uc(t)===null){n.child=E;break}t=E.sibling,E.sibling=o,o=E,E=t}nu(n,!0,o,null,k,h);break;case"together":nu(n,!1,null,null,void 0,h);break;case"independent":n.memoizedState=null;break;default:o=l0(n.child),o===null?(E=n.child,n.child=null):(E=o.sibling,o.sibling=null),nu(n,!1,E,o,k,h)}return n.child}function c0(t,n,o){var h=n.pendingProps;return jr(n,n.type,h.value),Gt(t,n,h.children,o),n.child}function sr(t,n,o){if(t!==null&&(n.dependencies=t.dependencies),qr|=n.lanes,(o&n.childLanes)===0)if(t!==null){if(ks(t,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(s(153));if(n.child!==null){for(t=n.child,o=Ji(t,t.pendingProps),n.child=o,o.return=n;t.sibling!==null;)t=t.sibling,o=o.sibling=Ji(t,t.pendingProps),o.return=n;o.sibling=null}return n.child}function kf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Oc(t)))}function ck(t,n,o){switch(n.tag){case 3:Te(n,n.stateNode.containerInfo),jr(n,Bt,t.memoizedState.cache),Cs();break;case 27:case 5:gt(n);break;case 4:Te(n,n.stateNode.containerInfo);break;case 10:jr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Xd(n),null;break;case 13:var h=n.memoizedState;if(h!==null){if(h.dehydrated!==null)return zr(n),n.flags|=128,null;h=ks(t,n,o,!1);var E=n.child.childLanes;return h||(o&E)!==0?o0(t,n,o):(zr(n),t=sr(t,n,o),t!==null?t.sibling:null)}zr(n);break;case 19:if(n.flags&128)return Ef(t,n,o);if(E=(t.flags&128)!==0,h=(o&n.childLanes)!==0,h||(ks(t,n,o,!1),h=(o&n.childLanes)!==0),E){if(h)return Ef(t,n,o);n.flags|=128}if(E=n.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Ja(n,an.current),h)break;return null;case 22:return n.lanes=0,e0(t,n,o,n.pendingProps);case 24:jr(n,Bt,t.memoizedState.cache)}return sr(t,n,o)}function u0(t,n,o){if(t!==null)if(t.memoizedProps!==n.pendingProps)It=!0;else{if(!kf(t,o)&&(n.flags&128)===0)return It=!1,ck(t,n,o);It=(t.flags&131072)!==0}else It=!1,Ke&&(n.flags&1048576)!==0&&F_(n,qa,n.index);switch(n.lanes=0,n.tag){case 16:e:{var h=n.pendingProps;if(t=Ds(n.elementType),n.type=t,typeof t=="function")Md(t)?(h=Os(t,h),n.tag=1,n=r0(null,n,t,h,o)):(n.tag=0,n=xf(null,n,t,h,o));else{if(t!=null){var E=t.$$typeof;if(E===G){n.tag=11,n=Q1(null,n,t,h,o);break e}else if(E===z){n.tag=14,n=Z1(null,n,t,h,o);break e}else if(E===W){n.tag=10,n.type=t,n=c0(null,n,o);break e}}throw n=oe(t)||t,Error(s(306,n,""))}}return n;case 0:return xf(t,n,n.type,n.pendingProps,o);case 1:return h=n.type,E=Os(h,n.pendingProps),r0(t,n,h,E,o);case 3:e:{if(Te(n,n.stateNode.containerInfo),t===null)throw Error(s(387));h=n.pendingProps;var k=n.memoizedState;E=k.element,Vd(t,n),Za(n,h,null,o);var N=n.memoizedState;if(h=N.cache,jr(n,Bt,h),h!==k.cache&&zd(n,[Bt],o,!0),Qa(),h=N.element,k.isDehydrated)if(k={element:h,isDehydrated:!1,cache:N.cache},n.updateQueue.baseState=k,n.memoizedState=k,n.flags&256){n=s0(t,n,h,o);break e}else if(h!==E){E=si(Error(s(424)),n),Va(E),n=s0(t,n,h,o);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(bt=ui(t.firstChild),Qt=n,Ke=!0,Lr=null,li=!0,o=e1(n,null,h,o),n.child=o;o;)o.flags=o.flags&-3|134221824,o=o.sibling}else{if(Cs(),h===E){n=sr(t,n,o);break e}Gt(t,n,h,o)}n=n.child}return n;case 26:return Lo(t,n),t===null?(o=Nx(n.type,null,n.pendingProps,null))?n.memoizedState=o:Ke||(n.stateNode=px(n.type,n.pendingProps,Be.current,n)):n.memoizedState=Nx(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return gt(n),t===null&&Ke&&(h=n.stateNode=Lx(n.type,n.pendingProps,Be.current),Qt=n,li=!0,E=bt,Yr(n.type)?(wp=E,bt=ui(h.firstChild)):bt=E),Gt(t,n,n.pendingProps.children,o),Lo(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ke&&((E=h=bt)&&(h=i3(h,n.type,n.pendingProps,li),h!==null?(n.stateNode=h,Qt=n,bt=ui(h.firstChild),li=!1,E=!0):E=!1),E||Mr(n)),gt(n),E=n.type,k=n.pendingProps,N=t!==null?t.memoizedProps:null,h=k.children,fp(E,k)?h=null:N!==null&&fp(E,N)&&(n.flags|=32),n.memoizedState!==null&&(E=Jd(t,n,ZE,null,null,o),Ko._currentValue=E),Lo(t,n),Gt(t,n,h,o),n.child;case 6:return t===null&&Ke&&((t=o=bt)&&(o=r3(o,n.pendingProps,li),o!==null?(n.stateNode=o,Qt=n,bt=null,t=!0):t=!1),t||Mr(n)),null;case 13:return o0(t,n,o);case 4:return Te(n,n.stateNode.containerInfo),h=n.pendingProps,t===null?n.child=Ms(n,null,h,o):Gt(t,n,h,o),n.child;case 11:return Q1(t,n,n.type,n.pendingProps,o);case 7:return h=n.pendingProps,Lo(t,n),Gt(t,n,h,o),n.child;case 8:return Gt(t,n,n.pendingProps.children,o),n.child;case 12:return Gt(t,n,n.pendingProps.children,o),n.child;case 10:return c0(t,n,o);case 9:return E=n.type._context,h=n.pendingProps.children,Ts(n),E=sn(E),h=h(E),n.flags|=1,Gt(t,n,h,o),n.child;case 14:return Z1(t,n,n.type,n.pendingProps,o);case 15:return J1(t,n,n.type,n.pendingProps,o);case 19:return Ef(t,n,o);case 31:return ak(t,n,o);case 22:return e0(t,n,o,n.pendingProps);case 24:return Ts(n),h=sn(Bt),t===null?(E=Ud(),E===null&&(E=_t,k=Hd(),E.pooledCache=k,k.refCount++,k!==null&&(E.pooledCacheLanes|=o),E=k),n.memoizedState={parent:h,cache:E},qd(n),jr(n,Bt,E)):((t.lanes&o)!==0&&(Vd(t,n),Za(n,null,null,o),Qa()),E=t.memoizedState,k=n.memoizedState,E.parent!==h?(E={parent:h,cache:h},n.memoizedState=E,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=E),jr(n,Bt,h)):(h=k.cache,jr(n,Bt,h),h!==E.cache&&zd(n,[Bt],o,!0))),Gt(t,n,n.pendingProps.children,o),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),h=n.pendingProps,h.name!=null&&h.name!=="auto"?n.flags|=t===null?18882560:18874368:Ke&&Lc(n),t!==null&&t.memoizedProps.name!==h.name?n.flags|=4194816:Lo(t,n),Gt(t,n,h.children,o),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function or(t){t.flags|=4}function Tf(t,n,o,h,E){var k;if((k=(t.mode&32)!==0)&&(k=o===null?zx(n,h):zx(n,h)&&(h.src!==o.src||h.srcSet!==o.srcSet)),k){if(t.flags|=16777216,(E&335544128)===E)if(t.stateNode.complete)t.flags|=8192;else if(V0())t.flags|=8192;else throw Ls=Ic,$d}else t.flags&=-16777217}function h0(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Hx(n))if(V0())t.flags|=8192;else throw Ls=Ic,$d}function iu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?zv():536870912,t.lanes|=n,Bo|=n)}function rl(t,n){if(!Ke)switch(t.tailMode){case"visible":break;case"collapsed":for(var o=t.tail,h=null;o!==null;)o.alternate!==null&&(h=o),o=o.sibling;h===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:h.sibling=null;break;default:for(n=t.tail,o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t.tail=null:o.sibling=null}}function wt(t){var n=t.alternate!==null&&t.alternate.child===t.child,o=0,h=0;if(n)for(var E=t.child;E!==null;)o|=E.lanes|E.childLanes,h|=E.subtreeFlags&1206910976,h|=E.flags&1206910976,E.return=t,E=E.sibling;else for(E=t.child;E!==null;)o|=E.lanes|E.childLanes,h|=E.subtreeFlags,h|=E.flags,E.return=t,E=E.sibling;return t.subtreeFlags|=h,t.childLanes=o,n}function uk(t,n,o){var h=n.pendingProps;switch(Nd(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(n),null;case 1:return wt(n),null;case 3:return o=n.stateNode,h=null,t!==null&&(h=t.memoizedState.cache),n.memoizedState.cache!==h&&(n.flags|=2048),nr(Bt),Ve(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(Co(n)?or(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Pd())),wt(n),null;case 26:var E=n.type,k=n.memoizedState;return t===null?(or(n),k!==null?(wt(n),h0(n,k)):(wt(n),Tf(n,E,null,h,o))):k?k!==t.memoizedState?(or(n),wt(n),h0(n,k)):(wt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==h&&or(n),wt(n),Tf(n,E,t,h,o)),null;case 27:if(st(n),o=Be.current,E=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==h&&or(n);else{if(!h){if(n.stateNode===null)throw Error(s(166));return wt(n),n.subtreeFlags&=-33554433,null}t=Mt.current,Co(n)?$_(n):(t=Lx(E,h,o),n.stateNode=t,or(n))}return wt(n),n.subtreeFlags&=-33554433,null;case 5:if(st(n),E=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==h&&or(n);else{if(!h){if(n.stateNode===null)throw Error(s(166));return wt(n),n.subtreeFlags&=-33554433,null}if(k=Mt.current,Co(n))$_(n);else{var N=ml(Be.current);switch(k){case 1:k=N.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:k=N.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":k=N.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":k=N.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":k=N.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof h.is=="string"?N.createElement("select",{is:h.is}):N.createElement("select"),h.multiple?k.multiple=!0:h.size&&(k.size=h.size);break;default:k=typeof h.is=="string"?N.createElement(E,{is:h.is}):N.createElement(E)}}k[rn]=n,k[Tn]=h;e:for(N=n.child;N!==null;){if(N.tag===5||N.tag===6)k.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===n)break e;for(;N.sibling===null;){if(N.return===null||N.return===n)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}n.stateNode=k;e:switch(cn(k,E,h),E){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&or(n)}}return wt(n),n.subtreeFlags&=-33554433,Tf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,o),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==h&&or(n);else{if(typeof h!="string"&&n.stateNode===null)throw Error(s(166));if(t=Be.current,Co(n)){if(t=n.stateNode,o=n.memoizedProps,h=null,E=Qt,E!==null)switch(E.tag){case 27:case 5:h=E.memoizedProps}t[rn]=n,t=!!(t.nodeValue===o||h!==null&&h.suppressHydrationWarning===!0||ux(t.nodeValue,o)),t||Mr(n,!0)}else t=ml(t).createTextNode(h),t[rn]=n,n.stateNode=t}return wt(n),null;case 31:if(o=n.memoizedState,t===null||t.memoizedState!==null){if(h=Co(n),o!==null){if(t===null){if(!h)throw Error(s(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[rn]=n}else Cs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wt(n),t=!1}else o=Pd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),t=!0;if(!t)return n.flags&256?($n(n),n):($n(n),null);if((n.flags&128)!==0)throw Error(s(558))}return wt(n),null;case 13:if(h=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(E=Co(n),h!==null&&h.dehydrated!==null){if(t===null){if(!E)throw Error(s(318));if(E=n.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(s(317));E[rn]=n}else Cs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wt(n),E=!1}else E=Pd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=E),E=!0;if(!E)return n.flags&256?($n(n),n):($n(n),null)}return $n(n),(n.flags&128)!==0?(n.lanes=o,n):(o=h!==null,t=t!==null&&t.memoizedState!==null,o&&(h=n.child,E=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(E=h.alternate.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==E&&(h.flags|=2048)),o!==t&&o&&(n.child.flags|=8192),iu(n,n.updateQueue),wt(n),null);case 4:return Ve(),t===null&&lp(n.stateNode.containerInfo),n.flags|=67108864,wt(n),null;case 10:return nr(n.type),wt(n),null;case 19:if(Qd(n),h=n.memoizedState,h===null)return wt(n),null;if(E=(n.flags&128)!==0,k=h.rendering,k===null)if(E)rl(h,!1);else{if(Dt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(k=Uc(t),k!==null){for(n.flags|=128,rl(h,!1),t=k.updateQueue,n.updateQueue=t,iu(n,t),n.subtreeFlags=0,t=o,o=n.child;o!==null;)I_(o,t),o=o.sibling;return Ja(n,an.current&1|2),Ke&&er(n,h.treeForkCount),n.child}t=t.sibling}h.tail!==null&&Vt()>mu&&(n.flags|=128,E=!0,rl(h,!1),n.lanes=4194304)}else{if(!E)if(t=Uc(k),t!==null){if(n.flags|=128,E=!0,t=t.updateQueue,n.updateQueue=t,iu(n,t),rl(h,!0),h.tail===null&&h.tailMode!=="collapsed"&&h.tailMode!=="visible"&&!k.alternate&&!Ke)return wt(n),null}else 2*Vt()-h.renderingStartTime>mu&&o!==536870912&&(n.flags|=128,E=!0,rl(h,!1),n.lanes=4194304);h.isBackwards?(k.sibling=n.child,n.child=k):(t=h.last,t!==null?t.sibling=k:n.child=k,h.last=k)}if(h.tail!==null){t=h.tail;e:{for(o=t;o!==null;){if(o.alternate!==null){o=!1;break e}o=o.sibling}o=!0}return h.rendering=t,h.tail=t.sibling,h.renderingStartTime=Vt(),t.sibling=null,k=an.current,k=E?k&1|2:k&1,h.tailMode==="visible"||h.tailMode==="collapsed"||!o||Ke?Ja(n,k):(o=k,ze(on,n),ze(an,o),gn===null&&(gn=n)),Ke&&er(n,h.treeForkCount),t}return wt(n),null;case 22:case 23:return $n(n),Kd(),h=n.memoizedState!==null,t!==null?t.memoizedState!==null!==h&&(n.flags|=8192):h&&(n.flags|=8192),h?(o&536870912)!==0&&(n.flags&128)===0&&(wt(n),n.subtreeFlags&6&&(n.flags|=8192)):wt(n),o=n.updateQueue,o!==null&&iu(n,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),h=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(h=n.memoizedState.cachePool.pool),h!==o&&(n.flags|=2048),t!==null&&ke(As),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),nr(Bt),wt(n),null;case 25:return null;case 30:return n.flags|=33554432,wt(n),null}throw Error(s(156,n.tag))}function hk(t,n){switch(Nd(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return nr(Bt),Ve(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return st(n),null;case 31:if(n.memoizedState!==null){if($n(n),n.alternate===null)throw Error(s(340));Cs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if($n(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Cs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Qd(n),t=n.flags,t&65536?(n.flags=t&-65537|128,t=n.memoizedState,t!==null&&(t.rendering=null,t.tail=null),n.flags|=4,n):null;case 4:return Ve(),null;case 10:return nr(n.type),null;case 22:case 23:return $n(n),Kd(),t!==null&&ke(As),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return nr(Bt),null;case 25:return null;default:return null}}function d0(t,n){switch(Nd(n),n.tag){case 3:nr(Bt),Ve();break;case 26:case 27:case 5:st(n);break;case 4:Ve();break;case 31:n.memoizedState!==null&&$n(n);break;case 13:$n(n);break;case 19:Qd(n);break;case 10:nr(n.type);break;case 22:case 23:$n(n),Kd(),t!==null&&ke(As);break;case 24:nr(Bt)}}function sl(t,n){try{var o=n.updateQueue,h=o!==null?o.lastEffect:null;if(h!==null){var E=h.next;o=E;do{if((o.tag&t)===t){h=void 0;var k=o.create,N=o.inst;h=k(),N.destroy=h}o=o.next}while(o!==E)}}catch(q){ft(n,n.return,q)}}function Fr(t,n,o){try{var h=n.updateQueue,E=h!==null?h.lastEffect:null;if(E!==null){var k=E.next;h=k;do{if((h.tag&t)===t){var N=h.inst,q=N.destroy;if(q!==void 0){N.destroy=void 0,E=n;var J=o,se=q;try{se()}catch(de){ft(E,J,de)}}}h=h.next}while(h!==k)}}catch(de){ft(n,n.return,de)}}function f0(t){var n=t.updateQueue;if(n!==null){var o=t.stateNode;try{n1(n,o)}catch(h){ft(t,t.return,h)}}}function p0(t,n,o){o.props=Os(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(h){ft(t,n,h)}}function Di(t,n){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var h=t.stateNode;break;case 30:var E=t.stateNode,k=Qi(t.memoizedProps,E);(E.ref===null||E.ref.name!==k)&&(E.ref=bx(k)),h=E.ref;break;case 7:if(t.stateNode===null){var N=new Yn(t);c(t.child,!1,t3,N,void 0,void 0),t.stateNode=N}h=t.stateNode;break;default:h=t.stateNode}typeof o=="function"?t.refCleanup=o(h):o.current=h}}catch(q){ft(t,n,q)}}function ln(t,n){var o=t.ref,h=t.refCleanup;if(o!==null)if(typeof h=="function")try{h()}catch(E){ft(t,n,E)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(E){ft(t,n,E)}else o.current=null}function ru(t,n){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&n!==null)for(var o=0;o<n.length;o++)Tx(t.stateNode,n[o])}function m0(t){for(var n=t.return;n!==null&&(Af(n)&&Tx(t.stateNode,n.stateNode),!Rf(n));)n=n.return}function ol(t){for(var n=t.return;n!==null&&(Af(n)&&n3(t.stateNode,n.stateNode),!Rf(n));)n=n.return}function Rf(t){return t.tag===5||t.tag===3||t.tag===27}function Af(t){return t&&t.tag===7&&t.stateNode!==null}function Df(t){var n=t.type,o=t.memoizedProps,h=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&h.focus();break e;case"img":o.src?h.src=o.src:o.srcSet&&(h.srcset=o.srcSet)}}catch(E){ft(t,t.return,E)}}function Lf(t,n,o){try{var h=t.stateNode;Pk(h,t.type,o,n),h[Tn]=n}catch(E){ft(t,t.return,E)}}function g0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Yr(t.type)||t.tag===4}function Mf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||g0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Yr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function jf(t,n,o,h){var E=t.tag;if(E===5||E===6)E=t.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(E,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(E),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Ti)),ru(t,h),ot=!0;else if(E!==4&&(E===27&&(ru(t,h),h=null,Yr(t.type)&&(o=t.stateNode,n=null)),t=t.child,t!==null))for(jf(t,n,o,h),t=t.sibling;t!==null;)jf(t,n,o,h),t=t.sibling}function su(t,n,o,h){var E=t.tag;if(E===5||E===6)E=t.stateNode,n?o.insertBefore(E,n):o.appendChild(E),ru(t,h),ot=!0;else if(E!==4&&(E===27&&(ru(t,h),h=null,Yr(t.type)&&(o=t.stateNode)),t=t.child,t!==null))for(su(t,n,o,h),t=t.sibling;t!==null;)su(t,n,o,h),t=t.sibling}function v0(t){var n=t.stateNode,o=t.memoizedProps;try{for(var h=t.type,E=n.attributes;E.length;)n.removeAttributeNode(E[0]);cn(n,h,o),n[rn]=t,n[Tn]=o}catch(k){ft(t,t.return,k)}}var ou=!1,qn=null;function _0(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(ou=!0)}var Li=null;function x0(){var t=Li;return Li=null,t}var An=0;function Mo(t,n,o,h,E){return An=0,y0(t.child,n,o,h,E)}function y0(t,n,o,h,E){for(var k=!1;t!==null;){if(t.tag===5){var N=t.stateNode;if(h!==null){var q=gp(N);h.push(q),q.view&&(k=!0)}else k||gp(N).view&&(k=!0);ou=!0,xx(N,An===0?n:n+"_"+An,o),An++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&E||y0(t.child,n,o,h,E)&&(k=!0));t=t.sibling}return k}function Mi(t,n){for(;t!==null;)t.tag===5?yx(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&n||Mi(t.child,n)),t=t.sibling}function au(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(au(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var n=t.memoizedProps;if(n.name==null||n.name==="auto")throw Error(s(544));var o=n.name;n=Zi(n.default,n.share),n!=="none"&&(Mo(t,o,n,null,!1)||Mi(t.child,!1))}t=t.sibling}}function Of(t,n){if(t.tag===30){var o=t.stateNode,h=t.memoizedProps,E=Qi(h,o),k=Zi(h.default,o.paired?h.share:h.enter);k!=="none"?Mo(t,E,k,null,!1)?(au(t),o.paired||n||Ho(t,h.onEnter)):Mi(t.child,!1):au(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Of(t,n),t=t.sibling;else au(t)}function Nf(t){if(qn!==null&&qn.size!==0){var n=qn;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var o=t.memoizedProps,h=o.name;if(h!=null&&h!=="auto"){var E=n.get(h);if(E!==void 0){var k=Zi(o.default,o.share);if(k!=="none"&&(Mo(t,h,k,null,!1)?(k=t.stateNode,E.paired=k,k.paired=E,Ho(t,o.onShare)):Mi(t.child,!1)),n.delete(h),n.size===0)break}}}Nf(t)}t=t.sibling}}}function Bf(t){if(t.tag===30){var n=t.memoizedProps,o=Qi(n,t.stateNode),h=qn!==null?qn.get(o):void 0,E=Zi(n.default,h!==void 0?n.share:n.exit);E!=="none"&&(Mo(t,o,E,null,!1)?h!==void 0?(E=t.stateNode,h.paired=E,E.paired=h,qn.delete(o),Ho(t,n.onShare)):Ho(t,n.onExit):Mi(t.child,!1)),qn!==null&&Nf(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Bf(t),t=t.sibling;else qn!==null&&Nf(t)}function b0(t){for(t=t.child;t!==null;){if(t.tag===30){var n=t.memoizedProps,o=Qi(n,t.stateNode);n=Zi(n.default,n.update),t.flags&=-5,n!=="none"&&Mo(t,o,n,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&b0(t);t=t.sibling}}function Pf(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var n=t.stateNode;n.paired!==null&&(n.paired=null,Mi(t.child,!1))}Pf(t)}t=t.sibling}}function lu(t){if(t.tag===30)t.stateNode.paired=null,Mi(t.child,!1),Pf(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)lu(t),t=t.sibling;else Pf(t)}function w0(t){for(t=t.child;t!==null;)t.tag===30?Mi(t.child,!1):(t.subtreeFlags&33554432)!==0&&w0(t),t=t.sibling}function If(t,n,o,h,E,k,N){for(var q=!1;n!==null;){if(n.tag===5){var J=n.stateNode;if(k!==null&&An<k.length){var se=k[An],de=gp(J);(se.view||de.view)&&(q=!0);var me;if(me=(t.flags&4)===0)if(de.clip)me=!0;else{me=se.rect;var ie=de.rect;me=me.y!==ie.y||me.x!==ie.x||me.height!==ie.height||me.width!==ie.width}me&&(t.flags|=4),de.abs?de=!se.abs:(se=se.rect,de=de.rect,de=se.height!==de.height||se.width!==de.width),de&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&xx(J,An===0?o:o+"_"+An,E),q&&(t.flags&4)!==0||(Li===null&&(Li=[]),Li.push(J,An===0?h:h+"_"+An,n.memoizedProps)),An++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&N?t.flags|=n.flags&32:If(t,n.child,o,h,E,k,N)&&(q=!0));n=n.sibling}return q}function S0(t,n){for(t=t.child;t!==null;){if(t.tag===30){var o=t.memoizedProps,h=t.stateNode,E=Qi(o,h),k=Zi(o.default,o.update),N;N=t.memoizedState,t.memoizedState=null,h=t;var q=t.child;An=0,E=If(h,q,E,E,k,N,!1),(t.flags&4)!==0&&E&&Ho(t,o.onUpdate)}else(t.subtreeFlags&33554432)!==0&&S0(t);t=t.sibling}}var Zt=!1,ut=!1,ji=!1,zf=!1,C0=typeof WeakSet=="function"?WeakSet:Set,Jt=null,Oi=!1,al=!1,cu=!1,Hf=!1;function dk(t,n,o){if(t=t.containerInfo,hp=Xo,t=R_(t),Ed(t)){if("selectionStart"in t)var h={start:t.selectionStart,end:t.selectionEnd};else e:{h=(h=t.ownerDocument)&&h.defaultView||window;var E=h.getSelection&&h.getSelection();if(E&&E.rangeCount!==0){h=E.anchorNode;var k=E.anchorOffset,N=E.focusNode;E=E.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var q=0,J=-1,se=-1,de=0,me=0,ie=t,ce=null;t:for(;;){for(var Ee;ie!==h||k!==0&&ie.nodeType!==3||(J=q+k),ie!==N||E!==0&&ie.nodeType!==3||(se=q+E),ie.nodeType===3&&(q+=ie.nodeValue.length),(Ee=ie.firstChild)!==null;)ce=ie,ie=Ee;for(;;){if(ie===t)break t;if(ce===h&&++de===k&&(J=q),ce===N&&++me===E&&(se=q),(Ee=ie.nextSibling)!==null)break;ie=ce,ce=ie.parentNode}ie=Ee}h=J===-1||se===-1?null:{start:J,end:se}}else h=null}h=h||{start:0,end:0}}else h=null;for(dp={focusedElem:t,selectionRange:h},Xo=!1,o=(o&335544064)===o,Jt=n,n=o?9270:1024;Jt!==null;){if(t=Jt,o&&(h=t.deletions,h!==null))for(k=0;k<h.length;k++)o&&Bf(h[k]);if(t.alternate===null&&(t.flags&2)!==0)o&&_0(t),uu(o);else{if(t.tag===22){if(h=t.alternate,t.memoizedState!==null){h!==null&&h.memoizedState===null&&o&&Bf(h),uu(o);continue}else if(h!==null&&h.memoizedState!==null){o&&_0(t),uu(o);continue}}h=t.child,(t.subtreeFlags&n)!==0&&h!==null?(h.return=t,Jt=h):(o&&b0(t),uu(o))}}qn=null}function uu(t){for(;Jt!==null;){var n=Jt,o=t,h=n.alternate,E=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((E&1024)!==0&&h!==null){o=void 0,E=h.memoizedProps,h=h.memoizedState;var k=n.stateNode;try{var N=Os(n.type,E);o=k.getSnapshotBeforeUpdate(N,h),k.__reactInternalSnapshotBeforeUpdate=o}catch(q){ft(n,n.return,q)}}break;case 3:if((E&1024)!==0){if(h=n.stateNode.containerInfo,o=h.nodeType,o===9)xp(h);else if(o===1)switch(h.nodeName){case"HEAD":case"HTML":case"BODY":xp(h);break;default:h.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:o&&h!==null&&(o=Qi(h.memoizedProps,h.stateNode),E=n.memoizedProps,E=Zi(E.default,E.update),E!=="none"&&Mo(h,o,E,h.memoizedState=[],!0));break;default:if((E&1024)!==0)throw Error(s(163))}if(h=n.sibling,h!==null){h.return=n.return,Jt=h;break}Jt=n.return}}function E0(t,n,o){var h=o.flags;switch(o.tag){case 0:case 11:case 15:Ni(t,o),h&4&&sl(5,o);break;case 1:if(Ni(t,o),h&4)if(t=o.stateNode,n===null)try{t.componentDidMount()}catch(N){ft(o,o.return,N)}else{var E=Os(o.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(E,n,t.__reactInternalSnapshotBeforeUpdate)}catch(N){ft(o,o.return,N)}}h&64&&f0(o),h&512&&Di(o,o.return);break;case 3:if(Ni(t,o),h&64&&(t=o.updateQueue,t!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{n1(t,n)}catch(N){ft(o,o.return,N)}}break;case 27:n===null&&h&4&&v0(o);case 26:case 5:Ni(t,o),n===null&&h&4&&Df(o),h&512&&Di(o,o.return);break;case 12:Ni(t,o);break;case 31:Ni(t,o),h&4&&A0(t,o);break;case 13:Ni(t,o),h&4&&D0(t,o),h&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=Ck.bind(null,o),s3(t,o))));break;case 22:if(h=o.memoizedState!==null||Zt,!h){var k=n!==null&&n.memoizedState!==null||ut;n=Zt,E=ut,Zt=h,(ut=k)&&!E?(h=2,(o.subtreeFlags&8772)!==0&&(h|=1),yi(t,o,h)):Ni(t,o),Zt=n,ut=E}break;case 30:Ni(t,o),h&512&&Di(o,o.return);break;case 7:h&512&&Di(o,o.return);default:Ni(t,o)}}function Ff(t,n){for(t=t.child;t!==null;)k0(t,n),t=t.sibling}function k0(t,n){switch(t.tag){case 5:case 26:try{var o=t.stateNode;if(n){var h=o.style;typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"}else{var E=t.stateNode,k=t.memoizedProps.style,N=k!=null&&k.hasOwnProperty("display")?k.display:null;E.style.display=N==null||typeof N=="boolean"?"":(""+N).trim()}}catch(J){ft(t,t.return,J)}Uf(t,n);break;case 6:try{t.stateNode.nodeValue=n?"":t.memoizedProps,ot=!0}catch(J){ft(t,t.return,J)}break;case 18:try{var q=t.stateNode;n?_x(q,!0):_x(t.stateNode,!1)}catch(J){ft(t,t.return,J)}break;case 22:case 23:t.memoizedState===null&&Ff(t,n);break;default:Ff(t,n)}}function Uf(t,n){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var o=t,h=n;switch(o.tag){case 4:k0(o,h);break e;case 22:o.memoizedState===null&&Uf(o,h);break e;default:Uf(o,h)}}t=t.sibling}}function T0(t){var n=t.alternate;n!==null&&(t.alternate=null,T0(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&mc(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Et=null,Dn=!1;function _i(t,n,o){for(o=o.child;o!==null;)R0(t,n,o),o=o.sibling}function R0(t,n,o){if(zn&&typeof zn.onCommitFiberUnmount=="function")try{zn.onCommitFiberUnmount(Da,o)}catch{}switch(o.tag){case 26:ut||ln(o,n),_i(t,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&!ut&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ut||ln(o,n),ol(o);var h=Et,E=Dn;Yr(o.type)&&(Et=o.stateNode,Dn=!1),_i(t,n,o),Mx(o.stateNode,o.type,o.memoizedProps),Et=h,Dn=E;break;case 5:ut||ln(o,n),ol(o);case 6:if(o.tag===6&&ol(o),h=Et,E=Dn,Et=null,_i(t,n,o),Et=h,Dn=E,Et!==null)if(Dn)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(o.stateNode),ot=!0}catch(k){ft(o,n,k)}else try{Et.removeChild(o.stateNode),ot=!0}catch(k){ft(o,n,k)}break;case 18:Et!==null&&(Dn?(t=Et,vx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),Qo(t)):vx(Et,o.stateNode));break;case 4:h=Et,E=Dn,Et=o.stateNode.containerInfo,Dn=!0,_i(t,n,o),Et=h,Dn=E;break;case 0:case 11:case 14:case 15:Fr(2,o,n),ut||Fr(4,o,n),_i(t,n,o);break;case 1:ut||(ln(o,n),h=o.stateNode,typeof h.componentWillUnmount=="function"&&p0(o,n,h)),_i(t,n,o);break;case 21:_i(t,n,o);break;case 22:ut=(h=ut)||o.memoizedState!==null,_i(t,n,o),ut=h;break;case 30:ln(o,n),_i(t,n,o);break;case 7:ut||ln(o,n),_i(t,n,o);break;default:_i(t,n,o)}}function A0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Qo(t)}catch(o){ft(n,n.return,o)}}}function D0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Qo(t)}catch(o){ft(n,n.return,o)}}function fk(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new C0),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new C0),n;default:throw Error(s(435,t.tag))}}function hu(t,n){var o=fk(t);n.forEach(function(h){if(!o.has(h)){o.add(h);var E=Ek.bind(null,t,h);h.then(E,E)}})}function wn(t,n,o){var h=n.deletions;if(h!==null)for(var E=0;E<h.length;E++){var k=h[E],N=t,q=n,J=q;e:for(;J!==null;){switch(J.tag){case 27:if(Yr(J.type)){Et=J.stateNode,Dn=!1;break e}break;case 5:Et=J.stateNode,Dn=!1;break e;case 3:case 4:Et=J.stateNode.containerInfo,Dn=!0;break e}J=J.return}if(Et===null)throw Error(s(160));R0(N,q,k),Et=null,Dn=!1,N=k.alternate,N!==null&&(N.return=null),k.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)L0(n,t,o),n=n.sibling}var xi=null;function L0(t,n,o){var h=t.alternate,E=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(E&4&&(h=t.updateQueue,h=h!==null?h.events:null,h!==null))for(var k=0;k<h.length;k++){var N=h[k];N.ref.impl=N.nextImpl}wn(n,t,o),Sn(t),E&4&&(Fr(3,t,t.return),sl(3,t),Fr(5,t,t.return));break;case 1:wn(n,t,o),Sn(t),E&512&&(ut||h===null||ln(h,h.return)),E&64&&Zt&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?n:o.concat(n))));break;case 26:if(k=xi,wn(n,t,o),Sn(t),E&512&&(ut||h===null||ln(h,h.return)),E&4)if(E=h!==null?h.memoizedState:null,o=t.memoizedState,h===null)if(o===null)if(t.stateNode===null)if(Zt)t.stateNode=px(t.type,t.memoizedProps,n.containerInfo,t);else{e:{n=t.type,o=t.memoizedProps,E=k.ownerDocument||k;t:switch(n){case"title":h=E.getElementsByTagName("title")[0],(!h||h[ja]||h[rn]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=E.createElement(n),E.head.insertBefore(h,E.querySelector("head > title"))),cn(h,n,o),h[rn]=t,Xt(h),n=h;break e;case"link":if(k=Ix("link","href",E).get(n+(o.href||""))){for(N=0;N<k.length;N++)if(h=k[N],h.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&h.getAttribute("rel")===(o.rel==null?null:o.rel)&&h.getAttribute("title")===(o.title==null?null:o.title)&&h.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){k.splice(N,1);break t}}h=E.createElement(n),cn(h,n,o),E.head.appendChild(h);break;case"meta":if(k=Ix("meta","content",E).get(n+(o.content||""))){for(N=0;N<k.length;N++)if(h=k[N],h.getAttribute("content")===(o.content==null?null:""+o.content)&&h.getAttribute("name")===(o.name==null?null:o.name)&&h.getAttribute("property")===(o.property==null?null:o.property)&&h.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&h.getAttribute("charset")===(o.charSet==null?null:o.charSet)){k.splice(N,1);break t}}h=E.createElement(n),cn(h,n,o),E.head.appendChild(h);break;default:throw Error(s(468,n))}h[rn]=t,Xt(h),n=h}t.stateNode=n}else Zt||kp(k,t.type,t.stateNode);else t.stateNode=Px(k,o,t.memoizedProps);else E!==o?(E===null?(n=h.stateNode,n===null||ut||n.parentNode.removeChild(n)):E.count--,o===null?Zt||kp(k,t.type,t.stateNode):Px(k,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Lf(t,t.memoizedProps,h.memoizedProps);break;case 27:wn(n,t,o),Sn(t),E&512&&(ut||h===null||ln(h,h.return)),h!==null&&E&4&&Lf(t,t.memoizedProps,h.memoizedProps);break;case 5:if(k=ji,ji=!1,wn(n,t,o),ji=k,Sn(t),E&512&&(ut||h===null||ln(h,h.return)),t.flags&32){n=t.stateNode;try{po(n,""),ot=!0}catch(de){ft(t,t.return,de)}}E&4&&t.stateNode!=null&&(n=t.memoizedProps,Lf(t,n,h!==null?h.memoizedProps:n)),E&1024&&(zf=!0);break;case 6:if(wn(n,t,o),Sn(t),E&4){if(t.stateNode===null)throw Error(s(162));n=t.memoizedProps,o=t.stateNode;try{o.nodeValue=n,ot=!0}catch(de){ft(t,t.return,de)}}break;case 3:if(ot=!1,ku=null,k=xi,xi=gl(n.containerInfo),wn(n,t,o),xi=k,Sn(t),E&4&&h!==null&&h.memoizedState.isDehydrated)try{Qo(n.containerInfo)}catch(de){ft(t,t.return,de)}zf&&(zf=!1,M0(t)),ot=!1;break;case 4:E=ji,ji=Zt,h=Zv(),k=xi,xi=gl(t.stateNode.containerInfo),wn(n,t,o),Sn(t),xi=k,ot&&al&&(cu=!0),ot=h,ji=E;break;case 12:wn(n,t,o),Sn(t);break;case 31:wn(n,t,o),Sn(t),E&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,hu(t,n)));break;case 13:wn(n,t,o),Sn(t),t.child.flags&8192&&t.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(pu=Vt()),E&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,hu(t,n)));break;case 22:k=t.memoizedState!==null,N=h!==null&&h.memoizedState!==null;var q=Zt,J=ut,se=ji;Zt=q||k,ji=se||k,ut=J||N,wn(n,t,o),ut=J,ji=se,Zt=q,Sn(t),E&8192&&(n=t.stateNode,n._visibility=k?n._visibility&-2:n._visibility|1,!k||h===null||N||Zt||ut||(n=N||ut,o=Zt,h=ut,Zt=k||Zt,ut=n,Ur(t,2),Zt=o,ut=h),!k&&ji||Ff(t,k)),E&4&&(n=t.updateQueue,n!==null&&(o=n.retryQueue,o!==null&&(n.retryQueue=null,hu(t,o))));break;case 19:wn(n,t,o),Sn(t),E&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,hu(t,n)));break;case 30:E&512&&(ut||h===null||ln(h,h.return)),E=Zv(),k=al,N=(o&335544064)===o,q=t.memoizedProps,al=N&&Zi(q.default,q.update)!=="none",wn(n,t,o),Sn(t),N&&h!==null&&ot&&(t.flags|=4),al=k,ot=E;break;case 21:break;case 7:E&512&&(ut||h===null||ln(h,h.return)),h&&h.stateNode!==null&&(h.stateNode._fragmentFiber=t);default:wn(n,t,o),Sn(t)}}function Sn(t){var n=t.flags;if(n&2){try{for(var o,h=t.return;h!==null;){if(g0(h)){o=h;break}h=h.return}h=null;for(var E=t.return;E!==null;){if(Af(E)){var k=E.stateNode;h===null?h=[k]:h.push(k)}if(Rf(E))break;E=E.return}var N=h;if(o==null)throw Error(s(160));switch(o.tag){case 27:var q=o.stateNode,J=Mf(t);su(t,J,q,N);break;case 5:var se=o.stateNode;o.flags&32&&(po(se,""),o.flags&=-33);var de=Mf(t);su(t,de,se,N);break;case 3:case 4:var me=o.stateNode.containerInfo,ie=Mf(t);jf(t,ie,me,N);break;default:throw Error(s(161))}}catch(ce){ft(t,t.return,ce)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function M0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;M0(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,Xo=!0,n.reset(),Xo=!1),t=t.sibling}}function jo(t,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)j0(n,t),n=n.sibling;else S0(n)}function j0(t,n){var o=t.alternate;if(o===null)Of(t,!1);else switch(t.tag){case 3:if(Hf=Oi=!1,x0(),jo(n,t),!Oi&&!cu){if(t=Li,t!==null)for(var h=0;h<t.length;h+=3){o=t[h];var E=t[h+1];yx(o,t[h+2]),o=o.ownerDocument.documentElement,o!==null&&o.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+E+")"})}t=n.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Hf=!0}Li=null;break;case 5:jo(n,t);break;case 4:h=Oi,Oi=!1,jo(n,t),Oi&&(cu=!0),Oi=h;break;case 22:t.memoizedState===null&&(o.memoizedState!==null?Of(t,!1):jo(n,t));break;case 30:h=Oi,E=x0(),Oi=!1,jo(n,t),Oi&&(t.flags|=4);var k=t.memoizedProps,N=t.stateNode;n=Qi(k,N),N=Qi(o.memoizedProps,N);var q=Zi(k.default,k.update);q==="none"?n=!1:(k=o.memoizedState,o.memoizedState=null,o=t.child,An=0,n=If(t,o,n,N,q,k,!0),An!==(k===null?0:k.length)&&(t.flags|=32)),(t.flags&4)!==0&&n?(Ho(t,t.memoizedProps.onUpdate),Li=E):E!==null&&(E.push.apply(E,Li),Li=E),Oi=(t.flags&32)!==0?!0:h;break;default:jo(n,t)}}function Ni(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)E0(t,n.alternate,n),n=n.sibling}function Ur(t,n){for(t=t.child;t!==null;){var o=t,h=n;switch(o.tag){case 0:case 11:case 14:case 15:Fr(4,o,o.return),Ur(o,h);break;case 1:ln(o,o.return);var E=o.stateNode;typeof E.componentWillUnmount=="function"&&p0(o,o.return,E),Ur(o,h);break;case 27:(h&2)!==0&&Mx(o.stateNode,o.type,o.memoizedProps);case 5:ln(o,o.return),o.tag!==5&&o.tag!==27||ol(o),Ur(o,h);break;case 6:ol(o);break;case 26:ln(o,o.return),E=o.stateNode,o.memoizedState!==null||E===null||ut||E.parentNode.removeChild(E),Ur(o,h);break;case 22:o.memoizedState===null&&Ur(o,h);break;case 30:ln(o,o.return),Ur(o,h);break;case 7:ln(o,o.return);default:Ur(o,h)}t=t.sibling}}function yi(t,n,o){for(o=(n.subtreeFlags&8772)!==0?o:o&-2,n=n.child;n!==null;){var h=n.alternate,E=t,k=n,N=k.flags,q=(o&1)!==0;switch(k.tag){case 0:case 11:case 15:yi(E,k,o),sl(4,k);break;case 1:if(yi(E,k,o),h=k,E=h.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(de){ft(h,h.return,de)}if(h=k,E=h.updateQueue,E!==null){var J=h.stateNode;try{var se=E.shared.hiddenCallbacks;if(se!==null)for(E.shared.hiddenCallbacks=null,E=0;E<se.length;E++)t1(se[E],J)}catch(de){ft(h,h.return,de)}}q&&N&64&&f0(k),Di(k,k.return);break;case 27:(o&2)!==0&&v0(k);case 5:k.tag!==5&&k.tag!==27||m0(k),yi(E,k,o),q&&h===null&&N&4&&Df(k),Di(k,k.return);break;case 6:m0(k);break;case 26:J=k.stateNode,k.memoizedState!==null||J===null||Zt||kp(gl(J.ownerDocument),k.type,J),yi(E,k,o),q&&h===null&&N&4&&Df(k),Di(k,k.return);break;case 12:yi(E,k,o);break;case 31:yi(E,k,o),q&&N&4&&A0(E,k);break;case 13:yi(E,k,o),q&&N&4&&D0(E,k);break;case 22:k.memoizedState===null&&yi(E,k,o),Di(k,k.return);break;case 30:yi(E,k,o),Di(k,k.return);break;case 7:Di(k,k.return);default:yi(E,k,o)}n=n.sibling}}function $f(t,n){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&Wa(o))}function qf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Wa(t))}function ci(t,n,o,h){var E=(o&335544064)===o;if(n.subtreeFlags&(E?10262:10256))for(n=n.child;n!==null;)O0(t,n,o,h),n=n.sibling;else E&&w0(n)}function O0(t,n,o,h){var E=(o&335544064)===o;E&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&lu(n);var k=n.flags;switch(n.tag){case 0:case 11:case 15:ci(t,n,o,h),k&2048&&sl(9,n);break;case 1:ci(t,n,o,h);break;case 3:ci(t,n,o,h),E&&Hf&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),k&2048&&(k=null,n.alternate!==null&&(k=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==k&&(n.refCount++,k!=null&&Wa(k)));break;case 12:if(k&2048){ci(t,n,o,h),k=n.stateNode;try{var N=n.memoizedProps,q=N.id,J=N.onPostCommit;typeof J=="function"&&J(q,n.alternate===null?"mount":"update",k.passiveEffectDuration,-0)}catch(se){ft(n,n.return,se)}}else ci(t,n,o,h);break;case 31:ci(t,n,o,h);break;case 13:ci(t,n,o,h);break;case 23:break;case 22:N=n.stateNode,q=n.alternate,n.memoizedState!==null?(E&&q!==null&&q.memoizedState===null&&lu(q),N._visibility&2?ci(t,n,o,h):ll(t,n)):(E&&q!==null&&q.memoizedState!==null&&lu(n),N._visibility&2?ci(t,n,o,h):(N._visibility|=2,Oo(t,n,o,h,(n.subtreeFlags&10256)!==0||!1))),k&2048&&$f(q,n);break;case 24:ci(t,n,o,h),k&2048&&qf(n.alternate,n);break;case 30:E&&(k=n.alternate,k!==null&&(Mi(k.child,!0),Mi(n.child,!0))),ci(t,n,o,h);break;default:ci(t,n,o,h)}}function Oo(t,n,o,h,E){for(E=E&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var k=t,N=n,q=o,J=h,se=N.flags;switch(N.tag){case 0:case 11:case 15:Oo(k,N,q,J,E),sl(8,N);break;case 23:break;case 22:var de=N.stateNode;N.memoizedState!==null?de._visibility&2?Oo(k,N,q,J,E):ll(k,N):(de._visibility|=2,Oo(k,N,q,J,E)),E&&se&2048&&$f(N.alternate,N);break;case 24:Oo(k,N,q,J,E),E&&se&2048&&qf(N.alternate,N);break;default:Oo(k,N,q,J,E)}n=n.sibling}}function ll(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=t,h=n,E=h.flags;switch(h.tag){case 22:ll(o,h),E&2048&&$f(h.alternate,h);break;case 24:ll(o,h),E&2048&&qf(h.alternate,h);break;default:ll(o,h)}n=n.sibling}}var Ns=8192;function Bs(t,n,o){if(t.subtreeFlags&Ns)for(t=t.child;t!==null;)N0(t,n,o),t=t.sibling}function N0(t,n,o){switch(t.tag){case 26:Bs(t,n,o),t.flags&Ns&&(t.memoizedState!==null?x3(o,xi,t.memoizedState,t.memoizedProps):(t=t.stateNode,(n&335544128)===n&&Ux(o,t)));break;case 5:Bs(t,n,o),t.flags&Ns&&(t=t.stateNode,(n&335544128)===n&&Ux(o,t));break;case 3:case 4:var h=xi;xi=gl(t.stateNode.containerInfo),Bs(t,n,o),xi=h;break;case 22:t.memoizedState===null&&(h=t.alternate,h!==null&&h.memoizedState!==null?(h=Ns,Ns=16777216,Bs(t,n,o),Ns=h):Bs(t,n,o));break;case 30:if((t.flags&Ns)!==0&&(h=t.memoizedProps.name,h!=null&&h!=="auto")){var E=t.stateNode;E.paired=null,qn===null&&(qn=new Map),qn.set(h,E)}Bs(t,n,o);break;default:Bs(t,n,o)}}function B0(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function cl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var h=n[o];Jt=h,I0(h,t)}B0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)P0(t),t=t.sibling}function P0(t){switch(t.tag){case 0:case 11:case 15:cl(t),t.flags&2048&&Fr(9,t,t.return);break;case 3:cl(t);break;case 12:cl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,du(t)):cl(t);break;default:cl(t)}}function du(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var h=n[o];Jt=h,I0(h,t)}B0(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Fr(8,n,n.return),du(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,du(n));break;default:du(n)}t=t.sibling}}function I0(t,n){for(;Jt!==null;){var o=Jt;switch(o.tag){case 0:case 11:case 15:Fr(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var h=o.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Wa(o.memoizedState.cache)}if(h=o.child,h!==null)h.return=o,Jt=h;else e:for(o=t;Jt!==null;){h=Jt;var E=h.sibling,k=h.return;if(T0(h),h===o){Jt=null;break e}if(E!==null){E.return=k,Jt=E;break e}Jt=k}}}var pk={getCacheForType:function(t){var n=sn(Bt),o=n.data.get(t);return o===void 0&&(o=t(),n.data.set(t,o)),o},cacheSignal:function(){return sn(Bt).controller.signal}},mk=typeof WeakMap=="function"?WeakMap:Map,lt=0,_t=null,Qe=null,Je=0,dt=0,Vn=null,$r=!1,No=!1,Vf=!1,ar=0,Dt=0,qr=0,Ps=0,fu=0,Wn=0,Bo=0,ul=null,Ln=null,Wf=!1,pu=0,z0=0,mu=1/0,gu=null,Vr=null,Rt=0,bi=null,Is=null,Bi=0,Gf=0,Yf=null,H0=null,Po=null,Io=null,zo=null,hl=0,vu=null;function Gn(){return(lt&2)!==0&&Je!==0?Je&-Je:ue.T!==null?rp():$v()}function F0(){if(Wn===0)if((Je&536870912)===0||Ke){var t=hc;hc<<=1,(hc&3932160)===0&&(hc=262144),Wn=t}else Wn=536870912;return t=on.current,t!==null&&(t.flags|=32),Wn}function Ho(t,n){if(n!=null){var o=t.stateNode,h=o.ref;h===null&&(h=o.ref=bx(Qi(t.memoizedProps,o))),Io===null&&(Io=[]),Io.push(n.bind(null,h))}}function Mn(t,n,o){(t===_t&&(dt===2||dt===9)||t.cancelPendingCommit!==null)&&(Fo(t,0),Wr(t,Je,Wn,!1)),Ma(t,o),((lt&2)===0||t!==_t)&&(t===_t&&((lt&2)===0&&(Ps|=o),Dt===4&&Wr(t,Je,Wn,!1)),Pi(t))}function U0(t,n,o){if((lt&6)!==0)throw Error(s(327));var h=!o&&(n&127)===0&&(n&t.expiredLanes)===0||La(t,n),E=h?_k(t,n):Xf(t,n,!0),k=h;do{if(E===0){No&&!h&&Wr(t,n,0,!1);break}else{if(o=t.current.alternate,k&&!gk(o)){E=Xf(t,n,!1),k=!1;continue}if(E===2){if(k=n,t.errorRecoveryDisabledLanes&k)var N=0;else N=t.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){n=N;e:{var q=t;E=ul;var J=q.current.memoizedState.isDehydrated;if(J&&(Fo(q,N).flags|=256),N=Xf(q,N,!1),N!==2&&N!==6){if(Vf&&!J){q.errorRecoveryDisabledLanes|=k,Ps|=k,E=4;break e}k=Ln,Ln=E,k!==null&&(Ln===null?Ln=k:Ln.push.apply(Ln,k))}E=N}if(k=!1,E!==2)continue}}if(E===1){Fo(t,0),Wr(t,n,0,!0);break}e:{switch(h=t,k=E,k){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:Wr(h,n,Wn,!$r);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(E=pu+300-Vt(),10<E)){if(Wr(h,n,Wn,!$r),fc(h,0,!0)!==0)break e;Bi=n,h.timeoutHandle=mp($0.bind(null,h,o,Ln,gu,Wf,n,Wn,Ps,Bo,$r,k,"Throttled",-0,0),E);break e}$0(h,o,Ln,gu,Wf,n,Wn,Ps,Bo,$r,k,null,-0,0)}}break}while(!0);Pi(t)}function $0(t,n,o,h,E,k,N,q,J,se,de,me,ie,ce){t.timeoutHandle=-1;var Ee=n.subtreeFlags,je=(k&335544064)===k;if(me=null,(je||Ee&8192||(Ee&16785408)===16785408)&&(me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ti},qn=null,N0(n,k,me),je&&(Ee=me,je=t.containerInfo,je=(je.nodeType===9?je:je.ownerDocument).__reactViewTransition,je!=null&&(Ee.count++,Ee.waitingForViewTransition=!0,Ee=xl.bind(Ee),je.finished.then(Ee,Ee))),Ee=(k&62914560)===k?pu-Vt():(k&4194048)===k?z0-Vt():0,Ee=y3(me,Ee),Ee!==null)){Bi=k,t.cancelPendingCommit=Ee(Q0.bind(null,t,n,k,o,h,E,N,q,J,se,de,me,null,ie,ce)),Wr(t,k,N,!se);return}Q0(t,n,k,o,h,E,N,q,J,se,de,me)}function gk(t){for(var n=t;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var h=0;h<o.length;h++){var E=o[h],k=E.getSnapshot;E=E.value;try{if(!Un(k(),E))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Wr(t,n,o,h){n=Iv(t,n),n&=~fu,n&=~Ps,t.suspendedLanes|=n,t.pingedLanes&=~n,h&&(t.warmLanes|=n),h=t.expirationTimes;for(var E=n;0<E;){var k=31-Hn(E),N=1<<k;h[k]=-1,E&=~N}o!==0&&Hv(t,o,n)}function _u(){return(lt&6)===0?(dl(0),!1):!0}function Kf(){if(Qe!==null){if(dt===0)var t=Qe.return;else t=Qe,tr=Es=null,nf(t),To=null,Ka=0,t=Qe;for(;t!==null;)d0(t.alternate,t),t=t.return;Qe=null}}function Fo(t,n){var o=t.timeoutHandle;return o!==-1&&(t.timeoutHandle=-1,Hk(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),Bi=0,Kf(),_t=t,Qe=o=Ji(t.current,null),Je=n,dt=0,Vn=null,$r=!1,No=La(t,n),Vf=!1,Bo=Wn=fu=Ps=qr=Dt=0,Ln=ul=null,Wf=!1,ar=Iv(t,n),kc(),o}function q0(t,n){We=null,ue.H=Qc,n===ko||n===Pc?(n=Q_(),dt=3):n===$d?(n=Q_(),dt=4):dt=n===_f?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Vn=n,Qe===null&&(Dt=1,Zc(t,si(n,t.current)))}function V0(){var t=on.current;return t===null?!0:(Je&4194048)===Je?gn===null:(Je&62914560)===Je||(Je&536870912)!==0?t===gn:!1}function W0(){var t=ue.H;return ue.H=Qc,t===null?Qc:t}function G0(){var t=ue.A;return ue.A=pk,t}function xu(){Dt=4,$r||(Je&4194048)!==Je&&on.current!==null||(No=!0),(qr&134217727)===0&&(Ps&134217727)===0||_t===null||Wr(_t,Je,Wn,!1)}function Xf(t,n,o){var h=lt;lt|=2;var E=W0(),k=G0();(_t!==t||Je!==n)&&(gu=null,Fo(t,n)),n=!1;var N=Dt;e:do try{if(dt!==0&&Qe!==null){var q=Qe,J=Vn;switch(dt){case 8:Kf(),N=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(n=!0);var se=dt;if(dt=0,Vn=null,Uo(t,q,J,se),o&&No){N=0;break e}break;default:se=dt,dt=0,Vn=null,Uo(t,q,J,se)}}vk(),N=Dt;break}catch(de){q0(t,de)}while(!0);return n&&t.shellSuspendCounter++,tr=Es=null,lt=h,ue.H=E,ue.A=k,Qe===null&&(_t=null,Je=0,kc()),N}function vk(){for(;Qe!==null;)Y0(Qe)}function _k(t,n){var o=lt;lt|=2;var h=W0(),E=G0();_t!==t||Je!==n?(gu=null,mu=Vt()+500,Fo(t,n)):No=La(t,n);e:do try{if(dt!==0&&Qe!==null){n=Qe;var k=Vn;t:switch(dt){case 1:dt=0,Vn=null,Uo(t,n,k,1);break;case 2:case 9:if(K_(k)){dt=0,Vn=null,K0(n);break}n=function(){dt!==2&&dt!==9||_t!==t||(dt=7),Pi(t)},k.then(n,n);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:K_(k)?(dt=0,Vn=null,K0(n)):(dt=0,Vn=null,Uo(t,n,k,7));break;case 5:var N=null;switch(Qe.tag){case 26:N=Qe.memoizedState;case 5:case 27:var q=Qe;if(N?Hx(N):q.stateNode.complete){dt=0,Vn=null;var J=q.sibling;if(J!==null)Qe=J;else{var se=q.return;se!==null?(Qe=se,yu(se)):Qe=null}break t}}dt=0,Vn=null,Uo(t,n,k,5);break;case 6:dt=0,Vn=null,Uo(t,n,k,6);break;case 8:Kf(),Dt=6;break e;default:throw Error(s(462))}}xk();break}catch(de){q0(t,de)}while(!0);return tr=Es=null,ue.H=h,ue.A=E,lt=o,Qe!==null?0:(_t=null,Je=0,kc(),Dt)}function xk(){for(;Qe!==null&&!ti();)Y0(Qe)}function Y0(t){var n=u0(t.alternate,t,ar);t.memoizedProps=t.pendingProps,n===null?yu(t):Qe=n}function K0(t){var n=t,o=n.alternate;switch(n.tag){case 15:case 0:n=i0(o,n,n.pendingProps,n.type,void 0,Je);break;case 11:n=i0(o,n,n.pendingProps,n.type.render,n.ref,Je);break;case 5:nf(n);var h=n;h===Qt&&(Ke?(Mc(h),h.tag===5&&h.stateNode!=null&&(bt=h.stateNode)):(Mc(h),Ke=!0));default:d0(o,n),n=Qe=I_(n,ar),n=u0(o,n,ar)}t.memoizedProps=t.pendingProps,n===null?yu(t):Qe=n}function Uo(t,n,o,h){tr=Es=null,nf(n),To=null,Ka=0;var E=n.return;try{if(ok(t,E,n,o,Je)){Dt=1,Zc(t,si(o,t.current)),Qe=null;return}}catch(k){if(E!==null)throw Qe=E,k;Dt=1,Zc(t,si(o,t.current)),Qe=null;return}n.flags&32768?(Ke||h===1?t=!0:No||(Je&536870912)!==0?t=!1:($r=t=!0,(h===2||h===9||h===3||h===6)&&(h=on.current,h!==null&&h.tag===13&&(h.flags|=16384))),X0(n,t)):yu(n)}function yu(t){var n=t;do{if((n.flags&32768)!==0){X0(n,$r);return}t=n.return;var o=uk(n.alternate,n,ar);if(o!==null){Qe=o;return}if(n=n.sibling,n!==null){Qe=n;return}Qe=n=t}while(n!==null);Dt===0&&(Dt=5)}function X0(t,n){do{var o=hk(t.alternate,t);if(o!==null){o.flags&=32767,Qe=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(t=t.sibling,t!==null)){Qe=t;return}Qe=t=o}while(t!==null);Dt=6,Qe=null}function Q0(t,n,o,h,E,k,N,q,J,se,de,me){t.cancelPendingCommit=null;do bu();while(Rt!==0);if((lt&6)!==0)throw Error(s(327));if(n!==null){if(n===t.current)throw Error(s(177));t===_t&&(Qe=_t=null,Je=0),Is=n,bi=t,Bi=o,Yf=E,H0=h,yk(t,n,o,N,q,J,me)}}function yk(t,n,o,h,E,k,N){var q=n.lanes|n.childLanes;if(Gf=q,q|=Dd,W5(t,o,q,h,E,k),Io=null,(o&335544064)===o?(zo=YE(t),h=10262):(zo=null,h=10256),(n.subtreeFlags&h)!==0||(n.flags&h)!==0?(t.callbackNode=null,t.callbackPriority=0,kk(ao,function(){return ep(),null})):(t.callbackNode=null,t.callbackPriority=0),ou=!1,h=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||h){h=ue.T,ue.T=null,E=he.p,he.p=2,k=lt,lt|=4;try{dk(t,n,o)}finally{lt=k,he.p=E,ue.T=h}}Rt=1,ou?Po=Wk(N,t.containerInfo,zo,Qf,Zf,wk,Jf,ep,bk):(Qf(),Zf(),Jf())}function bk(t){if(Rt!==0){var n=bi.onRecoverableError;n(t,{componentStack:null})}}function wk(){Rt===3&&(Rt=0,j0(Is,bi),Rt=4)}function Qf(){if(Rt===1){Rt=0;var t=bi,n=Is,o=Bi,h=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||h){h=ue.T,ue.T=null;var E=he.p;he.p=2;var k=lt;lt|=4;try{al=cu=!1,L0(n,t,o),o=dp;var N=R_(t.containerInfo),q=o.focusedElem,J=o.selectionRange;if(N!==q&&q&&q.ownerDocument&&T_(q.ownerDocument.documentElement,q)){if(J!==null&&Ed(q)){var se=J.start,de=J.end;if(de===void 0&&(de=se),"selectionStart"in q)q.selectionStart=se,q.selectionEnd=Math.min(de,q.value.length);else{var me=q.ownerDocument||document,ie=me&&me.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),Ee=q.textContent.length,je=Math.min(J.start,Ee),Ge=J.end===void 0?je:Math.min(J.end,Ee);!ce.extend&&je>Ge&&(N=Ge,Ge=je,je=N);var re=k_(q,je),te=k_(q,Ge);if(re&&te&&(ce.rangeCount!==1||ce.anchorNode!==re.node||ce.anchorOffset!==re.offset||ce.focusNode!==te.node||ce.focusOffset!==te.offset)){var ae=me.createRange();ae.setStart(re.node,re.offset),ce.removeAllRanges(),je>Ge?(ce.addRange(ae),ce.extend(te.node,te.offset)):(ae.setEnd(te.node,te.offset),ce.addRange(ae))}}}}for(me=[],ce=q;ce=ce.parentNode;)ce.nodeType===1&&me.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<me.length;q++){var pe=me[q];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Xo=!!hp,dp=hp=null}finally{lt=k,he.p=E,ue.T=h}}t.current=n,Rt=2}}function Zf(){if(Rt===2){Rt=0;var t=bi,n=Is,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=ue.T,ue.T=null;var h=he.p;he.p=2;var E=lt;lt|=4;try{E0(t,n.alternate,n)}finally{lt=E,he.p=h,ue.T=o}}Rt=3}}function Jf(){if(Rt===4||Rt===3){Rt=0;var t=Po;Po=null,oo();var n=bi,o=Is,h=Bi,E=H0,k=(h&335544064)===h?10262:10256;if((o.subtreeFlags&k)!==0||(o.flags&k)!==0?Rt=5:(Rt=0,Is=bi=null,Z0(n,n.pendingLanes)),k=n.pendingLanes,k===0&&(Vr=null),ad(h),o=o.stateNode,zn&&typeof zn.onCommitFiberRoot=="function")try{zn.onCommitFiberRoot(Da,o,void 0,(o.current.flags&128)===128)}catch{}if(E!==null){o=ue.T,k=he.p,he.p=2,ue.T=null;try{for(var N=n.onRecoverableError,q=0;q<E.length;q++){var J=E[q];N(J.value,{componentStack:J.stack})}}finally{ue.T=o,he.p=k}}if(E=Io,N=zo,zo=null,E!==null&&(Io=null,N===null&&(N=[]),t!==null))for(J=0;J<E.length;J++)o=(0,E[J])(N),o!==void 0&&t.finished.finally(o);(Bi&3)!==0&&bu(),Pi(n),k=n.pendingLanes,(h&261930)!==0&&(k&42)!==0?n===vu?hl++:(hl=0,vu=n):(hl=0,vu=null),dl(0)}}function Z0(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Wa(n)))}function bu(){return Po!==null&&(Po.skipTransition(),Po=null),Qf(),Zf(),Jf(),ep()}function ep(){if(Rt!==5)return!1;var t=bi,n=Gf;Gf=0;var o=ad(Bi),h=ue.T,E=he.p;try{he.p=32>o?32:o,ue.T=null,o=Yf,Yf=null;var k=bi,N=Bi;if(Rt=0,Is=bi=null,Bi=0,(lt&6)!==0)throw Error(s(331));var q=lt;if(lt|=4,P0(k.current),O0(k,k.current,N,o),lt=q,dl(0,!1),zn&&typeof zn.onPostCommitFiberRoot=="function")try{zn.onPostCommitFiberRoot(Da,k)}catch{}return!0}finally{he.p=E,ue.T=h,Z0(t,n)}}function J0(t,n,o){n=si(o,n),n=vf(t.stateNode,n,2),t=Pr(t,n,2),t!==null&&(Ma(t,2),Pi(t))}function ft(t,n,o){if(t.tag===3)J0(t,t,o);else for(;n!==null;){if(n.tag===3){J0(n,t,o);break}else if(n.tag===1){var h=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Vr===null||!Vr.has(h))){t=si(o,t),o=K1(2),h=Pr(n,o,2),h!==null&&(X1(o,h,n,t),Ma(h,2),Pi(h));break}}n=n.return}}function tp(t,n,o){var h=t.pingCache;if(h===null){h=t.pingCache=new mk;var E=new Set;h.set(n,E)}else E=h.get(n),E===void 0&&(E=new Set,h.set(n,E));E.has(o)||(Vf=!0,E.add(o),t=Sk.bind(null,t,n,o),n.then(t,t))}function Sk(t,n,o){var h=t.pingCache;h!==null&&h.delete(n),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,_t===t&&(Je&o)===o&&((Dt===4||Dt===3&&(Je&62914560)===Je&&300>Vt()-pu)&&(lt&2)===0?Fo(t,0):fu|=o,Bo===Je&&(Bo=0)),Pi(t)}function ex(t,n){n===0&&(n=zv()),t=ws(t,n),t!==null&&(Ma(t,n),Pi(t))}function Ck(t){var n=t.memoizedState,o=0;n!==null&&(o=n.retryLane),ex(t,o)}function Ek(t,n){var o=0;switch(t.tag){case 31:case 13:var h=t.stateNode,E=t.memoizedState;E!==null&&(o=E.retryLane);break;case 19:h=t.stateNode;break;case 22:h=t.stateNode._retryCache;break;default:throw Error(s(314))}h!==null&&h.delete(n),ex(t,o)}function kk(t,n){return kn(t,n)}var $o=null,qo=null,np=!1,wu=!1,ip=!1,Gr=0;function Pi(t){t!==qo&&t.next===null&&(qo===null?$o=qo=t:qo=qo.next=t),wu=!0,np||(np=!0,Rk())}function dl(t,n){if(!ip&&wu){ip=!0;do for(var o=!1,h=$o;h!==null;){if(t!==0){var E=h.pendingLanes;if(E===0)var k=0;else{var N=h.suspendedLanes,q=h.pingedLanes;k=(1<<31-Hn(42|t)+1)-1,k&=E&~(N&~q),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(o=!0,rx(h,k))}else k=Je,k=fc(h,h===_t?k:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(k&3)===0||La(h,k)||(o=!0,rx(h,k));h=h.next}while(o);ip=!1}}function Tk(){tx()}function tx(){wu=np=!1;var t=0;Gr!==0&&zk()&&(t=Gr);for(var n=Vt(),o=null,h=$o;h!==null;){var E=h.next,k=nx(h,n);k===0?(h.next=null,o===null?$o=E:o.next=E,E===null&&(qo=o)):(o=h,(t!==0||(k&3)!==0)&&(wu=!0)),h=E}Rt!==0&&Rt!==5||dl(t),Gr!==0&&(Gr=0)}function nx(t,n){for(var o=t.suspendedLanes,h=t.pingedLanes,E=t.expirationTimes,k=t.pendingLanes&-62914561;0<k;){var N=31-Hn(k),q=1<<N,J=E[N];J===-1?((q&o)===0||(q&h)!==0)&&(E[N]=V5(q,n)):J<=n&&(t.expiredLanes|=q),k&=~q}if(n=_t,o=Je,o=fc(t,t===n?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),h=t.callbackNode,o===0||t===n&&(dt===2||dt===9)||t.cancelPendingCommit!==null)return h!==null&&h!==null&&ei(h),t.callbackNode=null,t.callbackPriority=0;if((o&3)===0||La(t,o)){if(n=o&-o,n===t.callbackPriority)return n;switch(h!==null&&ei(h),ad(o)){case 2:case 8:o=xn;break;case 32:o=ao;break;case 268435456:o=Pv;break;default:o=ao}return h=ix.bind(null,t),o=kn(o,h),t.callbackPriority=n,t.callbackNode=o,n}return h!==null&&h!==null&&ei(h),t.callbackPriority=2,t.callbackNode=null,2}function ix(t,n){if(Rt!==0&&Rt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(bu()&&t.callbackNode!==o)return null;var h=Je;return h=fc(t,t===_t?h:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),h===0?null:(U0(t,h,n),nx(t,Vt()),t.callbackNode!=null&&t.callbackNode===o?ix.bind(null,t):null)}function rx(t,n){if(bu())return null;U0(t,n,!0)}function Rk(){Fk(function(){(lt&6)!==0?kn(ni,Tk):tx()})}function rp(){if(Gr===0){var t=Rs;t===0&&(t=uc,uc<<=1,(uc&261888)===0&&(uc=256)),Gr=t}return Gr}function sx(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:_c(t)}function Ak(t,n,o,h,E){if(n==="submit"&&o&&o.stateNode===E){var k=sx((E[Tn]||null).action),N=h.submitter;N&&(n=(n=N[Tn]||null)?sx(n.formAction):N.getAttribute("formAction"),n!==null&&(k=n,N=null));var q=new wc("action","action",null,h,E);t.push({event:q,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Gr!==0){var J=new FormData(E,N);df(o,{pending:!0,data:J,method:E.method,action:k},null,J)}}else typeof k=="function"&&(q.preventDefault(),J=new FormData(E,N),df(o,{pending:!0,data:J,method:E.method,action:k},k,J))},currentTarget:E}]})}}for(var sp=0;sp<Ad.length;sp++){var op=Ad[sp],Dk=op.toLowerCase(),Lk=op[0].toUpperCase()+op.slice(1);vi(Dk,"on"+Lk)}vi(L_,"onAnimationEnd"),vi(M_,"onAnimationIteration"),vi(j_,"onAnimationStart"),vi("dblclick","onDoubleClick"),vi("focusin","onFocus"),vi("focusout","onBlur"),vi(HE,"onTransitionRun"),vi(FE,"onTransitionStart"),vi(UE,"onTransitionCancel"),vi(O_,"onTransitionEnd"),ho("onMouseEnter",["mouseout","mouseover"]),ho("onMouseLeave",["mouseout","mouseover"]),ho("onPointerEnter",["pointerout","pointerover"]),ho("onPointerLeave",["pointerout","pointerover"]),xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xs("onBeforeInput",["compositionend","keypress","textInput","paste"]),xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="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(" "),Mk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fl));function ox(t,n){n=(n&4)!==0;for(var o=0;o<t.length;o++){var h=t[o],E=h.event;h=h.listeners;e:{var k=void 0;if(n)for(var N=h.length-1;0<=N;N--){var q=h[N],J=q.instance,se=q.currentTarget;if(q=q.listener,J!==k&&E.isPropagationStopped())break e;k=q,E.currentTarget=se;try{k(E)}catch(de){Ec(de)}E.currentTarget=null,k=J}else for(N=0;N<h.length;N++){if(q=h[N],J=q.instance,se=q.currentTarget,q=q.listener,J!==k&&E.isPropagationStopped())break e;k=q,E.currentTarget=se;try{k(E)}catch(de){Ec(de)}E.currentTarget=null,k=J}}}}function Ze(t,n){var o=n[Vv];o===void 0&&(o=n[Vv]=new Set);var h=t+"__bubble";o.has(h)||(ax(n,t,2,!1),o.add(h))}function ap(t,n,o){var h=0;n&&(h|=4),ax(o,t,h,n)}var Su="_reactListening"+Math.random().toString(36).slice(2);function lp(t){if(!t[Su]){t[Su]=!0,Yv.forEach(function(o){o!=="selectionchange"&&(Mk.has(o)||ap(o,!1,t),ap(o,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Su]||(n[Su]=!0,ap("selectionchange",!1,n))}}function ax(t,n,o,h){switch(Xx(n)){case 2:var E=C3;break;case 8:E=E3;break;default:E=Rp}o=E.bind(null,n,o,t),E=void 0,!md||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(E=!0),h?E!==void 0?t.addEventListener(n,o,{capture:!0,passive:E}):t.addEventListener(n,o,!0):E!==void 0?t.addEventListener(n,o,{passive:E}):t.addEventListener(n,o,!1)}function cp(t,n,o,h,E){var k=h;if((n&1)===0&&(n&2)===0&&h!==null)e:for(;;){if(h===null)return;var N=h.tag;if(N===3||N===4){var q=h.stateNode.containerInfo;if(q===E)break;if(N===4)for(N=h.return;N!==null;){var J=N.tag;if((J===3||J===4)&&N.stateNode.containerInfo===E)return;N=N.return}for(;q!==null;){if(N=_s(q),N===null)return;if(J=N.tag,J===5||J===6||J===26||J===27){h=k=N;continue e}q=q.parentNode}}h=h.return}a_(function(){var se=k,de=fd(o),me=[];e:{var ie=N_.get(t);if(ie!==void 0){var ce=wc,Ee=t;switch(t){case"keypress":if(yc(o)===0)break e;case"keydown":case"keyup":ce=gE;break;case"focusin":Ee="focus",ce=xd;break;case"focusout":Ee="blur",ce=xd;break;case"beforeblur":case"afterblur":ce=xd;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=u_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=rE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=bE;break;case L_:case M_:case j_:ce=aE;break;case O_:ce=SE;break;case"scroll":case"scrollend":ce=nE;break;case"wheel":ce=EE;break;case"copy":case"cut":case"paste":ce=cE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=d_;break;case"submit":ce=xE;break;case"toggle":case"beforetoggle":ce=TE}var je=(n&4)!==0,Ge=!je&&(t==="scroll"||t==="scrollend"),re=je?ie!==null?ie+"Capture":null:ie;je=[];for(var te=se,ae;te!==null;){var pe=te;if(ae=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ae===null||re===null||(pe=Na(te,re),pe!=null&&je.push(pl(te,pe,ae))),Ge)break;te=te.return}0<je.length&&(ie=new ce(ie,Ee,null,o,de),me.push({event:ie,listeners:je}))}}if((n&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",ce&&o!==dd&&(Ee=o.relatedTarget||o.fromElement)&&(_s(Ee)||Ee[lo]))break e;(ie||ce)&&(Ee=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,ie?(ce=o.relatedTarget||o.toElement,ie=se,ce=ce?_s(ce):null,ce!==null&&(Ge=d(ce),je=ce.tag,ce!==Ge||je!==5&&je!==27&&je!==6)&&(ce=null)):(ie=null,ce=se),ie!==ce&&(je=u_,pe="onMouseLeave",re="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(je=d_,pe="onPointerLeave",re="onPointerEnter",te="pointer"),Ge=ie==null?Ee:Oa(ie),ae=ce==null?Ee:Oa(ce),Ee=new je(pe,te+"leave",ie,o,de),Ee.target=Ge,Ee.relatedTarget=ae,pe=null,_s(de)===se&&(je=new je(re,te+"enter",ce,o,de),je.target=ae,je.relatedTarget=Ge,pe=je),Ge=pe,je=ie&&ce?R(ie,ce,jk):null,ie!==null&&lx(me,Ee,ie,je,!1),ce!==null&&Ge!==null&&lx(me,Ge,ce,je,!0)))}e:{if(ie=se?Oa(se):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var Ae=y_;else if(__(ie))if(b_)Ae=PE;else{Ae=NE;var et=OE}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?se&&hd(se.elementType)&&(Ae=y_):Ae=BE;if(Ae&&(Ae=Ae(t,se))){x_(me,Ae,o,de);break e}et&&et(t,ie,se)}switch(et=se?Oa(se):window,t){case"focusin":(__(et)||et.contentEditable==="true")&&(_o=et,kd=se,$a=null);break;case"focusout":$a=kd=_o=null;break;case"mousedown":Td=!0;break;case"contextmenu":case"mouseup":case"dragend":Td=!1,A_(me,o,de);break;case"selectionchange":if(zE)break;case"keydown":case"keyup":A_(me,o,de)}var Oe;if(bd)e:{switch(t){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else vo?g_(t,o)&&(Pe="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(Pe="onCompositionStart");Pe&&(f_&&o.locale!=="ko"&&(vo||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&vo&&(Oe=l_()):(Rr=de,gd="value"in Rr?Rr.value:Rr.textContent,vo=!0)),et=Cu(se,Pe),0<et.length&&(Pe=new h_(Pe,t,null,o,de),me.push({event:Pe,listeners:et}),Oe?Pe.data=Oe:(Oe=v_(o),Oe!==null&&(Pe.data=Oe)))),(Oe=AE?DE(t,o):LE(t,o))&&(Pe=Cu(se,"onBeforeInput"),0<Pe.length&&(et=new h_("onBeforeInput","beforeinput",null,o,de),me.push({event:et,listeners:Pe}),et.data=Oe)),Ak(me,t,se,o,de)}ox(me,n)})}function pl(t,n,o){return{instance:t,listener:n,currentTarget:o}}function Cu(t,n){for(var o=n+"Capture",h=[];t!==null;){var E=t,k=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||k===null||(E=Na(t,o),E!=null&&h.unshift(pl(t,E,k)),E=Na(t,n),E!=null&&h.push(pl(t,E,k))),t.tag===3)return h;t=t.return}return[]}function jk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function lx(t,n,o,h,E){for(var k=n._reactName,N=[];o!==null&&o!==h;){var q=o,J=q.alternate,se=q.stateNode;if(q=q.tag,J!==null&&J===h)break;q!==5&&q!==26&&q!==27||se===null||(J=se,E?(se=Na(o,k),se!=null&&N.unshift(pl(o,se,J))):E||(se=Na(o,k),se!=null&&N.push(pl(o,se,J)))),o=o.return}N.length!==0&&t.push({event:n,listeners:N})}var Ok=/\r\n?/g,Nk=/\u0000|\uFFFD/g;function cx(t){return(typeof t=="string"?t:""+t).replace(Ok,`
50
- `).replace(Nk,"")}function ux(t,n){return n=cx(n),cx(t)===n}function pt(t,n,o,h,E,k){switch(o){case"children":if(typeof h=="string")n==="body"||n==="textarea"&&h===""||po(t,h);else if(typeof h=="number"||typeof h=="bigint")n!=="body"&&po(t,""+h);else return;break;case"className":vc(t,"class",h);break;case"tabIndex":vc(t,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":vc(t,o,h);break;case"style":s_(t,h,k);return;case"data":if(n!=="object"){vc(t,"data",h);break}case"src":case"href":if(h===""&&(n!=="a"||o!=="href")){t.removeAttribute(o);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){t.removeAttribute(o);break}h=_c(h),t.setAttribute(o,h);break;case"action":case"formAction":if(typeof h=="function"){t.setAttribute(o,"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 k=="function"&&(o==="formAction"?(n!=="input"&&pt(t,n,"name",E.name,E,null),pt(t,n,"formEncType",E.formEncType,E,null),pt(t,n,"formMethod",E.formMethod,E,null),pt(t,n,"formTarget",E.formTarget,E,null)):(pt(t,n,"encType",E.encType,E,null),pt(t,n,"method",E.method,E,null),pt(t,n,"target",E.target,E,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){t.removeAttribute(o);break}h=_c(h),t.setAttribute(o,h);break;case"onClick":h!=null&&(t.onclick=Ti);return;case"onScroll":h!=null&&Ze("scroll",t);return;case"onScrollEnd":h!=null&&Ze("scrollend",t);return;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(s(61));if(o=h.__html,o!=null){if(E.children!=null)throw Error(s(60));(k!=null?k.__html:void 0)!==o&&(t.innerHTML=o)}}break;case"multiple":t.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":t.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){t.removeAttribute("xlink:href");break}o=_c(h),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(o,h):t.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":h&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":h===!0?t.setAttribute(o,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(o,h):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?t.setAttribute(o,h):t.removeAttribute(o);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?t.removeAttribute(o):t.setAttribute(o,h);break;case"popover":Ze("beforetoggle",t),Ze("toggle",t),gc(t,"popover",h);break;case"xlinkActuate":Ki(t,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Ki(t,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Ki(t,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Ki(t,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Ki(t,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Ki(t,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Ki(t,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Ki(t,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Ki(t,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":gc(t,"is",h);break;case"innerText":case"textContent":return;default:if(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")o=eE.get(o)||o,gc(t,o,h);else return}ot=!0}function up(t,n,o,h,E,k){switch(o){case"style":s_(t,h,k);return;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(s(61));if(o=h.__html,o!=null){if(E.children!=null)throw Error(s(60));(k!=null?k.__html:void 0)!==o&&(t.innerHTML=o)}}break;case"children":if(typeof h=="string")po(t,h);else if(typeof h=="number"||typeof h=="bigint")po(t,""+h);else return;break;case"onScroll":h!=null&&Ze("scroll",t);return;case"onScrollEnd":h!=null&&Ze("scrollend",t);return;case"onClick":h!=null&&(t.onclick=Ti);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Kv.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(E=o.endsWith("Capture"),k=o.slice(2,E?o.length-7:void 0),n=t[Tn]||null,n=n!=null?n[o]:null,typeof n=="function"&&t.removeEventListener(k,n,E),typeof h=="function")){typeof n!="function"&&n!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(k,h,E);break e}ot=!0,o in t?t[o]=h:h===!0?t.setAttribute(o,""):gc(t,o,h)}return}ot=!0}function cn(t,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",t),Ze("load",t);var h=!1,E=!1,k;for(k in o)if(o.hasOwnProperty(k)){var N=o[k];if(N!=null)switch(k){case"src":h=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:pt(t,n,k,N,o,null)}}E&&pt(t,n,"srcSet",o.srcSet,o,null),h&&pt(t,n,"src",o.src,o,null);return;case"input":Ze("invalid",t);var q=k=N=E=null,J=null,se=null;for(h in o)if(o.hasOwnProperty(h)){var de=o[h];if(de!=null)switch(h){case"name":E=de;break;case"type":N=de;break;case"checked":J=de;break;case"defaultChecked":se=de;break;case"value":k=de;break;case"defaultValue":q=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,n));break;default:pt(t,n,h,de,o,null)}}t_(t,k,q,J,se,N,E,!1);return;case"select":Ze("invalid",t),h=N=k=null;for(E in o)if(o.hasOwnProperty(E)&&(q=o[E],q!=null))switch(E){case"value":k=q;break;case"defaultValue":N=q;break;case"multiple":h=q;default:pt(t,n,E,q,o,null)}n=k,o=N,t.multiple=!!h,n!=null?fo(t,!!h,n,!1):o!=null&&fo(t,!!h,o,!0);return;case"textarea":Ze("invalid",t),k=E=h=null;for(N in o)if(o.hasOwnProperty(N)&&(q=o[N],q!=null))switch(N){case"value":h=q;break;case"defaultValue":E=q;break;case"children":k=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(91));break;default:pt(t,n,N,q,o,null)}i_(t,h,E,k);return;case"option":for(J in o)if(o.hasOwnProperty(J)&&(h=o[J],h!=null))switch(J){case"selected":t.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:pt(t,n,J,h,o,null)}return;case"dialog":Ze("beforetoggle",t),Ze("toggle",t),Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":Ze("load",t);break;case"video":case"audio":for(h=0;h<fl.length;h++)Ze(fl[h],t);break;case"image":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"embed":case"source":case"link":Ze("error",t),Ze("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in o)if(o.hasOwnProperty(se)&&(h=o[se],h!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:pt(t,n,se,h,o,null)}return;default:if(hd(n)){for(de in o)o.hasOwnProperty(de)&&(h=o[de],h!==void 0&&up(t,n,de,h,o,void 0));return}}for(q in o)o.hasOwnProperty(q)&&(h=o[q],h!=null&&pt(t,n,q,h,o,null))}var Bk={};function Pk(t,n,o,h){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,k=null,N=null,q=null,J=null,se=null,de=null;for(ce in o){var me=o[ce];if(o.hasOwnProperty(ce)&&me!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":J=me;default:h.hasOwnProperty(ce)||pt(t,n,ce,null,h,me)}}for(var ie in h){var ce=h[ie];if(me=o[ie],h.hasOwnProperty(ie)&&(ce!=null||me!=null))switch(ie){case"type":ce!==me&&(ot=!0),k=ce;break;case"name":ce!==me&&(ot=!0),E=ce;break;case"checked":ce!==me&&(ot=!0),se=ce;break;case"defaultChecked":ce!==me&&(ot=!0),de=ce;break;case"value":ce!==me&&(ot=!0),N=ce;break;case"defaultValue":ce!==me&&(ot=!0),q=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,n));break;default:ce!==me&&pt(t,n,ie,ce,h,me)}}cd(t,N,q,J,se,de,k,E);return;case"select":ce=N=q=ie=null;for(k in o)if(J=o[k],o.hasOwnProperty(k)&&J!=null)switch(k){case"value":break;case"multiple":ce=J;default:h.hasOwnProperty(k)||pt(t,n,k,null,h,J)}for(E in h)if(k=h[E],J=o[E],h.hasOwnProperty(E)&&(k!=null||J!=null))switch(E){case"value":k!==J&&(ot=!0),ie=k;break;case"defaultValue":k!==J&&(ot=!0),q=k;break;case"multiple":k!==J&&(ot=!0),N=k;default:k!==J&&pt(t,n,E,k,h,J)}n=q,o=N,h=ce,ie!=null?fo(t,!!o,ie,!1):!!h!=!!o&&(n!=null?fo(t,!!o,n,!0):fo(t,!!o,o?[]:"",!1));return;case"textarea":ce=ie=null;for(q in o)if(E=o[q],o.hasOwnProperty(q)&&E!=null&&!h.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:pt(t,n,q,null,h,E)}for(N in h)if(E=h[N],k=o[N],h.hasOwnProperty(N)&&(E!=null||k!=null))switch(N){case"value":E!==k&&(ot=!0),ie=E;break;case"defaultValue":E!==k&&(ot=!0),ce=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(s(91));break;default:E!==k&&pt(t,n,N,E,h,k)}n_(t,ie,ce);return;case"option":for(var Ee in o)if(ie=o[Ee],o.hasOwnProperty(Ee)&&ie!=null&&!h.hasOwnProperty(Ee))switch(Ee){case"selected":t.selected=!1;break;default:pt(t,n,Ee,null,h,ie)}for(J in h)if(ie=h[J],ce=o[J],h.hasOwnProperty(J)&&ie!==ce&&(ie!=null||ce!=null))switch(J){case"selected":ie!==ce&&(ot=!0),t.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:pt(t,n,J,ie,h,ce)}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 je in o)ie=o[je],o.hasOwnProperty(je)&&ie!=null&&!h.hasOwnProperty(je)&&pt(t,n,je,null,h,ie);for(se in h)if(ie=h[se],ce=o[se],h.hasOwnProperty(se)&&ie!==ce&&(ie!=null||ce!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,n));break;default:pt(t,n,se,ie,h,ce)}return;default:if(hd(n)){for(var Ge in o)ie=o[Ge],o.hasOwnProperty(Ge)&&ie!==void 0&&!h.hasOwnProperty(Ge)&&up(t,n,Ge,void 0,h,ie);for(de in h)ie=h[de],ce=o[de],!h.hasOwnProperty(de)||ie===ce||ie===void 0&&ce===void 0||up(t,n,de,ie,h,ce);return}}for(var re in o)ie=o[re],o.hasOwnProperty(re)&&ie!=null&&!h.hasOwnProperty(re)&&pt(t,n,re,null,h,ie);for(me in h)ie=h[me],ce=o[me],!h.hasOwnProperty(me)||ie===ce||ie==null&&ce==null||pt(t,n,me,ie,h,ce)}function hx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ik(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,o=performance.getEntriesByType("resource"),h=0;h<o.length;h++){var E=o[h],k=E.transferSize,N=E.initiatorType,q=E.duration;if(k&&q&&hx(N)){for(N=0,q=E.responseEnd,h+=1;h<o.length;h++){var J=o[h],se=J.startTime;if(se>q)break;var de=J.transferSize,me=J.initiatorType;de&&hx(me)&&(J=J.responseEnd,N+=de*(J<q?1:(q-se)/(J-se)))}if(--h,n+=8*(k+N)/(E.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var hp=null,dp=null;function ml(t){return t.nodeType===9?t:t.ownerDocument}function dx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fx(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function px(t,n,o,h){return o=ml(o).createElement(t),o[rn]=h,o[Tn]=n,cn(o,t,n),Xt(o),o}function fp(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var pp=null;function zk(){var t=window.event;return t&&t.type==="popstate"?t===pp?!1:(pp=t,!0):(pp=null,!1)}var mp=typeof setTimeout=="function"?setTimeout:void 0,Hk=typeof clearTimeout=="function"?clearTimeout:void 0,mx=typeof Promise=="function"?Promise:void 0,gx=typeof requestAnimationFrame=="function"?requestAnimationFrame:mp,Fk=typeof queueMicrotask=="function"?queueMicrotask:typeof mx<"u"?function(t){return mx.resolve(null).then(t).catch(Uk)}:mp;function Uk(t){setTimeout(function(){throw t})}function Yr(t){return t==="head"}function vx(t,n){var o=n,h=0;do{var E=o.nextSibling;if(t.removeChild(o),E&&E.nodeType===8)if(o=E.data,o==="/$"||o==="/&"){if(h===0){t.removeChild(E),Qo(n);return}h--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")h++;else if(o==="html")Sp(t.ownerDocument.documentElement);else if(o==="head"){o=t.ownerDocument.head,Sp(o);for(var k=o.firstChild;k;){var N=k.nextSibling,q=k.nodeName;k[ja]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&k.rel.toLowerCase()==="stylesheet"||o.removeChild(k),k=N}}else o==="body"&&Sp(t.ownerDocument.body);o=E}while(o);Qo(n)}function _x(t,n){var o=t;t=0;do{var h=o.nextSibling;if(o.nodeType===1?n?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(n?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),h&&h.nodeType===8)if(o=h.data,o==="/$"){if(t===0)break;t--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||t++;o=h}while(o)}function xx(t,n,o){if(n=CSS.escape(n)!==n?"r-"+btoa(n).replace(/=/g,""):n,t.style.viewTransitionName=n,o!=null&&(t.style.viewTransitionClass=o),o=getComputedStyle(t),o.display==="inline"){if(n=t.getClientRects(),n.length===1)var h=1;else for(var E=h=0;E<n.length;E++){var k=n[E];0<k.width&&0<k.height&&h++}h===1&&(t=t.style,t.display=n.length===1?"inline-block":"block",t.marginTop="-"+o.paddingTop,t.marginBottom="-"+o.paddingBottom)}}function yx(t,n){t=t.style,n=n.style;var o=n!=null?n.hasOwnProperty("viewTransitionName")?n.viewTransitionName:n.hasOwnProperty("view-transition-name")?n["view-transition-name"]:null:null;t.viewTransitionName=o==null||typeof o=="boolean"?"":(""+o).trim(),o=n!=null?n.hasOwnProperty("viewTransitionClass")?n.viewTransitionClass:n.hasOwnProperty("view-transition-class")?n["view-transition-class"]:null:null,t.viewTransitionClass=o==null||typeof o=="boolean"?"":(""+o).trim(),t.display==="inline-block"&&(n==null?t.display=t.margin="":(o=n.display,t.display=o==null||typeof o=="boolean"?"":o,o=n.margin,o!=null?t.margin=o:(o=n.hasOwnProperty("marginTop")?n.marginTop:n["margin-top"],t.marginTop=o==null||typeof o=="boolean"?"":o,n=n.hasOwnProperty("marginBottom")?n.marginBottom:n["margin-bottom"],t.marginBottom=n==null||typeof n=="boolean"?"":n)))}function $k(t,n,o){return o=o.ownerDocument.defaultView,{rect:t,abs:n.position==="absolute"||n.position==="fixed",clip:n.clipPath!=="none"||n.overflow!=="visible"||n.filter!=="none"||n.mask!=="none"||n.mask!=="none"||n.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=o.innerHeight&&t.left<=o.innerWidth}}function gp(t){var n=t.getBoundingClientRect(),o=getComputedStyle(t);return $k(n,o,t)}function qk(t){return t.documentElement.clientHeight}function Vk(t){this.addEventListener("load",t),this.addEventListener("error",t)}function Wk(t,n,o,h,E,k,N,q,J){var se=n.nodeType===9?n:n.ownerDocument;try{var de=se.startViewTransition({update:function(){var ie=se.defaultView,ce=ie.navigation&&ie.navigation.transition,Ee=se.fonts.status;h();var je=[];if(Ee==="loaded"&&(qk(se),se.fonts.status==="loading"&&je.push(se.fonts.ready)),Ee=je.length,t!==null)for(var Ge=t.suspenseyImages,re=0,te=0;te<Ge.length;te++){var ae=Ge[te];if(!ae.complete){var pe=ae.getBoundingClientRect();if(0<pe.bottom&&0<pe.right&&pe.top<ie.innerHeight&&pe.left<ie.innerWidth){if(re+=Fx(ae),re>Tu){je.length=Ee;break}ae=new Promise(Vk.bind(ae)),je.push(ae)}}}if(0<je.length)return ie=Promise.race([Promise.all(je),new Promise(function(Ae){return setTimeout(Ae,500)})]).then(E,E),(ce?Promise.allSettled([ce.finished,ie]):ie).then(k,k);if(E(),ce)return ce.finished.then(k,k);k()},types:o});se.__reactViewTransition=de;var me=[];return de.ready.then(function(){for(var ie=se.documentElement.getAnimations({subtree:!0}),ce=0;ce<ie.length;ce++){var Ee=ie[ce],je=Ee.effect,Ge=je.pseudoElement;if(Ge!=null&&Ge.startsWith("::view-transition")){me.push(Ee),Ee=je.getKeyframes();for(var re=Ge=void 0,te=!0,ae=0;ae<Ee.length;ae++){var pe=Ee[ae],Ae=pe.width;if(Ge===void 0)Ge=Ae;else if(Ge!==Ae){te=!1;break}if(Ae=pe.height,re===void 0)re=Ae;else if(re!==Ae){te=!1;break}delete pe.width,delete pe.height,pe.transform==="none"&&delete pe.transform}te&&Ge!==void 0&&re!==void 0&&(je.setKeyframes(Ee),te=getComputedStyle(je.target,je.pseudoElement),te.width!==Ge||te.height!==re)&&(te=Ee[0],te.width=Ge,te.height=re,te=Ee[Ee.length-1],te.width=Ge,te.height=re,je.setKeyframes(Ee))}}N()},function(ie){se.__reactViewTransition===de&&(se.__reactViewTransition=null);try{if(typeof ie=="object"&&ie!==null)switch(ie.name){case"InvalidStateError":(ie.message==="View transition was skipped because document visibility state is hidden."||ie.message==="Skipping view transition because document visibility state has become hidden."||ie.message==="Skipping view transition because viewport size changed."||ie.message==="Transition was aborted because of invalid state")&&(ie=null)}ie!==null&&J(ie)}finally{h(),E(),N()}}),de.finished.finally(function(){for(var ie=0;ie<me.length;ie++)me[ie].cancel();se.__reactViewTransition===de&&(se.__reactViewTransition=null),q()}),de}catch{return h(),E(),N(),null}}function zs(t,n){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+n+")"}zs.prototype.animate=function(t,n){return n=typeof n=="number"?{duration:n}:L({},n),n.pseudoElement=this._selector,this._scope.animate(t,n)},zs.prototype.getAnimations=function(){for(var t=this._scope,n=this._selector,o=t.getAnimations({subtree:!0}),h=[],E=0;E<o.length;E++){var k=o[E].effect;k!==null&&k.target===t&&k.pseudoElement===n&&h.push(o[E])}return h},zs.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function bx(t){return{name:t,group:new zs("group",t),imagePair:new zs("image-pair",t),old:new zs("old",t),new:new zs("new",t)}}function Yn(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}Yn.prototype.addEventListener=function(t,n,o){var h=null,E=null;if(!(o!=null&&typeof o!="boolean"&&(h=o.signal||null,h!==null&&h.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var k=this._eventListeners;if(Sx(k,t,n,o)===-1){var N=this,q=n;o!=null&&typeof o!="boolean"&&o.once===!0&&(q=function(J){N.removeEventListener(t,n,o),typeof n=="function"?n.call(this,J):n.handleEvent(J)}),h!==null&&(E=N.removeEventListener.bind(N,t,n,o),h.addEventListener("abort",E,{once:!0}),E=h.removeEventListener.bind(h,"abort",E)),h=Vo(o),k.push({type:t,listener:n,optionsOrUseCapture:o,attachedListener:q,cleanup:E}),c(this._fragmentFiber.child,!1,Gk,t,q,h)}this._eventListeners=k}};function Gk(t,n,o,h){return m(t).addEventListener(n,o,h),!1}Yn.prototype.removeEventListener=function(t,n,o){var h=this._eventListeners;if(h!==null&&(n=Sx(h,t,n,o),n!==-1)){var E=h[n];o=E.attachedListener;var k=E.cleanup;E=Vo(E.optionsOrUseCapture),c(this._fragmentFiber.child,!1,Yk,t,o,E),h.splice(n,1),k!==null&&k()}};function Yk(t,n,o,h){return m(t).removeEventListener(n,o,h),!1}function Vo(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function wx(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function Sx(t,n,o,h){if(t.length===0)return-1;h=wx(h);for(var E=0;E<t.length;E++){var k=t[E];if(k.type===n&&k.listener===o&&wx(k.optionsOrUseCapture)===h)return E}return-1}Yn.prototype.dispatchEvent=function(t){var n=_(this._fragmentFiber);if(n===null)return!0;n=m(n);var o=this._eventListeners;if(o!==null&&0<o.length||!t.bubbles){var h=n.nodeType===9?n.createComment(""):document.createTextNode("");if(o)for(var E=0;E<o.length;E++){var k=o[E];h.addEventListener(k.type,k.attachedListener,Vo(k.optionsOrUseCapture))}if(n.appendChild(h),t=h.dispatchEvent(t),o)for(E=0;E<o.length;E++)k=o[E],h.removeEventListener(k.type,k.attachedListener,Vo(k.optionsOrUseCapture));return n.removeChild(h),t}return n.dispatchEvent(t)},Yn.prototype.focus=function(t){c(this._fragmentFiber.child,!0,Cx,t,void 0,void 0)};function Cx(t,n){return t.tag===6?!1:(t=m(t),o3(t,n))}Yn.prototype.focusLast=function(t){var n=[];c(this._fragmentFiber.child,!0,vp,n,void 0,void 0);for(var o=n.length-1;0<=o&&!Cx(n[o],t);o--);};function vp(t,n){return n.push(t),!1}Yn.prototype.blur=function(){var t=_(this._fragmentFiber);t!==null&&(t=m(t),t=ml(t).activeElement,t!==null&&c(this._fragmentFiber.child,!1,Kk,t,void 0,void 0))};function Kk(t,n){return t.tag===6?!1:(t=m(t),t===n||t.contains(n)?(n.blur(),!0):!1)}Yn.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),c(this._fragmentFiber.child,!1,Xk,t,void 0,void 0)};function Xk(t,n){return t.tag===6||(t=m(t),n.observe(t)),!1}Yn.prototype.unobserveUsing=function(t){var n=this._observers;if(n!==null&&n.has(t)){n.delete(t),c(this._fragmentFiber.child,!1,Qk,t,void 0,void 0);for(var o=n=0;o<wi.length;o++){var h=wi[o];h.fragmentInstance===this&&h.observer===t?t.unobserve(h.instance):wi[n++]=h}wi.length=n}};function Qk(t,n){return t.tag===6||(t=m(t),n.unobserve(t)),!1}var wi=[],_p=!1;function Zk(t,n,o){wi.push({fragmentInstance:t,observer:n,instance:o}),_p||(_p=!0,a3(function(){_p=!1;var h=wi;wi=[];for(var E=0;E<h.length;E++){var k=h[E];k.observer.unobserve(k.instance)}}))}Yn.prototype.getClientRects=function(){var t=[];return c(this._fragmentFiber.child,!1,Jk,t,void 0,void 0),t};function Jk(t,n){if(t.tag===6){t=t.stateNode;var o=t.ownerDocument.createRange();o.selectNodeContents(t),n.push.apply(n,o.getClientRects())}else t=m(t),n.push.apply(n,t.getClientRects());return!1}Yn.prototype.getRootNode=function(t){var n=_(this._fragmentFiber);return n===null?this:m(n).getRootNode(t)},Yn.prototype.compareDocumentPosition=function(t){var n=_(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var o=[];c(this._fragmentFiber.child,!1,vp,o,void 0,void 0);var h=m(n);if(o.length===0){if(o=h,x(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(o=n)}n=this._fragmentFiber;var E=h=o.compareDocumentPosition(t);return o===t?E=Node.DOCUMENT_POSITION_CONTAINS:h&Node.DOCUMENT_POSITION_CONTAINED_BY&&(o=C(n)[1],o===null?E=Node.DOCUMENT_POSITION_PRECEDING:(t=m(o).compareDocumentPosition(t),E=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),E|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=m(o[0]),E=m(o[o.length-1]);var k=x(this._fragmentFiber)?n.parentElement:h;if(k==null)return Node.DOCUMENT_POSITION_DISCONNECTED;h=k.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,k=k.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY;var N=n.compareDocumentPosition(t),q=E.compareDocumentPosition(t),J=N&Node.DOCUMENT_POSITION_CONTAINED_BY||q&Node.DOCUMENT_POSITION_CONTAINED_BY;return q=h&&k&&N&Node.DOCUMENT_POSITION_FOLLOWING&&q&Node.DOCUMENT_POSITION_PRECEDING,n=h&&n===t||k&&E===t||J||q?Node.DOCUMENT_POSITION_CONTAINED_BY:!h&&n===t||!k&&E===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:N,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||e3(n,this._fragmentFiber,o[0],o[o.length-1],t)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function e3(t,n,o,h,E){var k=_s(E);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(o=!!k)e:{for(;k!==null;){if(k.tag===7&&(k===n||k.alternate===n)){o=!0;break e}k=k.return}o=!1}return o}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(k===null)return k=E.ownerDocument,E===k||E===k.documentElement||E===k.body;e:{for(k=n,n=_(n);k!==null;){if(!(k.tag!==5&&k.tag!==3&&k.tag!==27||k!==n&&k.alternate!==n)){k=!0;break e}k=k.return}k=!1}return k}return t&Node.DOCUMENT_POSITION_PRECEDING?((n=!!k)&&!(n=k===o)&&(n=R(o,k,D),n===null?n=!1:(c(n,!0,w,k,o),k=b,b=null,n=k!==null)),n):t&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!k)&&!(n=k===h)&&(n=R(h,k,D),n===null?n=!1:(c(n,!0,T,k,h),k=b,S=b=null,n=k!==null)),n):!1}function Ex(t,n){var o=t.ownerDocument.createRange();o.selectNodeContents(t),t=o.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,n?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}Yn.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(s(566));var n=[];c(this._fragmentFiber.child,!1,vp,n,void 0,void 0);var o=t!==!1;if(n.length===0){var h=C(this._fragmentFiber);if(h=o?h[1]||h[0]||_(this._fragmentFiber):h[0]||h[1],h===null)return;if(h.tag===6){t=m(h),Ex(t,o);return}if(h=m(h),h.nodeType!==9){if(h.nodeType===11){o="host"in h?h.host:null,o!==null&&o.scrollIntoView(t);return}h.scrollIntoView(t)}}for(h=o?n.length-1:0;h!==(o?-1:n.length);){var E=n[h];E.tag===6?(E=m(E),Ex(E,o)):m(E).scrollIntoView(t),h+=o?-1:1}};function t3(t,n){return t=m(t),kx(t,n),!1}function kx(t,n){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(n)}function Tx(t,n){var o=n._eventListeners;if(o!==null)for(var h=0;h<o.length;h++){var E=o[h];t.addEventListener(E.type,E.attachedListener,Vo(E.optionsOrUseCapture))}t.nodeType!==3&&(o=n._observers,o!==null&&o.forEach(function(k){for(var N=0,q=0;q<wi.length;q++){var J=wi[q];(J.fragmentInstance!==n||J.observer!==k||J.instance!==t)&&(wi[N++]=J)}wi.length=N,k.observe(t)}),kx(t,n))}function n3(t,n){var o=n._eventListeners;if(o!==null)for(var h=0;h<o.length;h++){var E=o[h];t.removeEventListener(E.type,E.attachedListener,Vo(E.optionsOrUseCapture))}t.nodeType!==3&&(o=n._observers,o!==null&&o.forEach(function(k){typeof k.rootMargin=="string"?Zk(n,k,t):k.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(n))}function xp(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":xp(o),mc(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function i3(t,n,o,h){for(;t.nodeType===1;){var E=o;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!h&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(h){if(!t[ja])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(k=t.getAttribute("rel"),k==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(k!==E.rel||t.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||t.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||t.getAttribute("title")!==(E.title==null?null:E.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(k=t.getAttribute("src"),(k!==(E.src==null?null:E.src)||t.getAttribute("type")!==(E.type==null?null:E.type)||t.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&k&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var k=E.name==null?null:""+E.name;if(E.type==="hidden"&&t.getAttribute("name")===k)return t}else return t;if(t=ui(t.nextSibling),t===null)break}return null}function r3(t,n,o){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=ui(t.nextSibling),t===null))return null;return t}function Rx(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ui(t.nextSibling),t===null))return null;return t}function yp(t){return t.data==="$?"||t.data==="$~"}function bp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function s3(t,n){var o=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||o.readyState!=="loading")n();else{var h=function(){n(),o.removeEventListener("DOMContentLoaded",h)};o.addEventListener("DOMContentLoaded",h),t._reactRetry=h}}function ui(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var wp=null;function Ax(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var o=t.data;if(o==="/$"||o==="/&"){if(n===0)return ui(t.nextSibling);n--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||n++}t=t.nextSibling}return null}function Dx(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(n===0)return t;n--}else o!=="/$"&&o!=="/&"||n++}t=t.previousSibling}return null}function o3(t,n){function o(){h=!0}if(t.ownerDocument.activeElement===t)return!0;var h=!1;try{t.ownerDocument.addEventListener("focus",o,!0),(t.focus||HTMLElement.prototype.focus).call(t,n)}finally{t.ownerDocument.removeEventListener("focus",o,!0)}return h}function a3(t){gx(function(){gx(function(n){return t(n)})})}function Lx(t,n,o){switch(n=ml(o),t){case"html":if(t=n.documentElement,!t)throw Error(s(452));return t;case"head":if(t=n.head,!t)throw Error(s(453));return t;case"body":if(t=n.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Mx(t,n,o){for(var h in o){var E=o[h];o.hasOwnProperty(h)&&E!=null&&pt(t,n,h,null,Bk,E)}o.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Ti&&(t.onclick=null),mc(t)}function Sp(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);mc(t)}var hi=new Map,jx=new Set;function gl(t){if(typeof t.getRootNode=="function"){var n=t.getRootNode();if(n.nodeType===9||n.nodeType===11)return n}return t.nodeType===9?t:t.ownerDocument}var lr=he.d;he.d={f:l3,r:c3,D:u3,C:h3,L:d3,m:f3,X:m3,S:p3,M:g3};function l3(){var t=lr.f(),n=_u();return t||n}function c3(t){var n=co(t);n!==null&&n.tag===5&&n.type==="form"?N1(n):lr.r(t)}var Wo=typeof document>"u"?null:document;function Ox(t,n,o){var h=Wo;if(h&&typeof n=="string"&&n){var E=ii(n);E='link[rel="'+t+'"][href="'+E+'"]',typeof o=="string"&&(E+='[crossorigin="'+o+'"]'),jx.has(E)||(jx.add(E),t={rel:t,crossOrigin:o,href:n},h.querySelector(E)===null&&(n=h.createElement("link"),cn(n,"link",t),Xt(n),h.head.appendChild(n)))}}function u3(t){lr.D(t),Ox("dns-prefetch",t,null)}function h3(t,n){lr.C(t,n),Ox("preconnect",t,n)}function d3(t,n,o){lr.L(t,n,o);var h=Wo;if(h&&t&&n){var E='link[rel="preload"][as="'+ii(n)+'"]';n==="image"&&o&&o.imageSrcSet?(E+='[imagesrcset="'+ii(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(E+='[imagesizes="'+ii(o.imageSizes)+'"]')):E+='[href="'+ii(t)+'"]';var k=E;switch(n){case"style":k=Go(t);break;case"script":k=Yo(t)}if(!(hi.has(k)||(t=L({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:t,as:n},o),hi.set(k,t),h.querySelector(E)!==null||n==="style"&&h.querySelector(vl(k))||n==="script"&&h.querySelector(_l(k))))){var N=h.createElement("link");cn(N,"link",t),n==="style"&&(N[pc]=!0,N.onload=N.onerror=function(){Gv(N)}),Xt(N),h.head.appendChild(N)}}}function f3(t,n){lr.m(t,n);var o=Wo;if(o&&t){var h=n&&typeof n.as=="string"?n.as:"script",E='link[rel="modulepreload"][as="'+ii(h)+'"][href="'+ii(t)+'"]',k=E;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=Yo(t)}if(!hi.has(k)&&(t=L({rel:"modulepreload",href:t},n),hi.set(k,t),o.querySelector(E)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(_l(k)))return}h=o.createElement("link"),cn(h,"link",t),Xt(h),o.head.appendChild(h)}}}function p3(t,n,o){lr.S(t,n,o);var h=Wo;if(h&&t){var E=uo(h).hoistableStyles,k=Go(t);n=n||"default";var N=E.get(k);if(!N){var q={loading:0,preload:null};if(N=h.querySelector(vl(k)))q.loading=5;else{t=L({rel:"stylesheet",href:t,"data-precedence":n},o),(o=hi.get(k))&&Cp(t,o);var J=N=h.createElement("link");Xt(J),cn(J,"link",t),J._p=new Promise(function(se,de){J.onload=se,J.onerror=de}),J.addEventListener("load",function(){q.loading|=1}),J.addEventListener("error",function(){q.loading|=2}),q.loading|=4,Eu(N,n,h)}N={type:"stylesheet",instance:N,count:1,state:q},E.set(k,N)}}}function m3(t,n){lr.X(t,n);var o=Wo;if(o&&t){var h=uo(o).hoistableScripts,E=Yo(t),k=h.get(E);k||(k=o.querySelector(_l(E)),k||(t=L({src:t,async:!0},n),(n=hi.get(E))&&Ep(t,n),k=o.createElement("script"),Xt(k),cn(k,"link",t),o.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},h.set(E,k))}}function g3(t,n){lr.M(t,n);var o=Wo;if(o&&t){var h=uo(o).hoistableScripts,E=Yo(t),k=h.get(E);k||(k=o.querySelector(_l(E)),k||(t=L({src:t,async:!0,type:"module"},n),(n=hi.get(E))&&Ep(t,n),k=o.createElement("script"),Xt(k),cn(k,"link",t),o.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},h.set(E,k))}}function Nx(t,n,o,h){var E=(E=Be.current)?gl(E):null;if(!E)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(o=Go(o.href),n=uo(E).hoistableStyles,h=n.get(o),h||(h={type:"style",instance:null,count:0,state:null},n.set(o,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=Go(o.href);var k=uo(E).hoistableStyles,N=k.get(t);if(N||(E=E.ownerDocument||E,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(t,N),(k=E.querySelector(vl(t)))?k._p||(N.instance=k,N.state.loading=5):(k=hi.get(t),k||(k={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},hi.set(t,k)),v3(E,t,k,N.state))),n&&h===null)throw Error(s(528,""));return N}if(n&&h!==null)throw Error(s(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(o=Yo(o),n=uo(E).hoistableScripts,h=n.get(o),h||(h={type:"script",instance:null,count:0,state:null},n.set(o,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Go(t){return'href="'+ii(t)+'"'}function vl(t){return'link[rel="stylesheet"]['+t+"]"}function Bx(t){return L({},t,{"data-precedence":t.precedence,precedence:null})}function v3(t,n,o,h){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[pc]!==!0){h.loading=1;return}}else n=t.createElement("link"),n[pc]=!0,n.onload=n.onerror=Gv.bind(null,n),cn(n,"link",o),Xt(n),t.head.appendChild(n);h.preload=n,n.addEventListener("load",function(){return h.loading|=1}),n.addEventListener("error",function(){return h.loading|=2})}function Yo(t){return'[src="'+ii(t)+'"]'}function _l(t){return"script[async]"+t}function Px(t,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var h=t.querySelector('style[data-href~="'+ii(o.href)+'"]');if(h)return n.instance=h,Xt(h),h;var E=L({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return h=(t.ownerDocument||t).createElement("style"),Xt(h),cn(h,"style",E),Eu(h,o.precedence,t),n.instance=h;case"stylesheet":E=Go(o.href);var k=t.querySelector(vl(E));if(k)return n.state.loading|=4,n.instance=k,Xt(k),k;h=Bx(o),(E=hi.get(E))&&Cp(h,E),k=(t.ownerDocument||t).createElement("link"),Xt(k);var N=k;return N._p=new Promise(function(q,J){N.onload=q,N.onerror=J}),cn(k,"link",h),n.state.loading|=4,Eu(k,o.precedence,t),n.instance=k;case"script":return k=Yo(o.src),(E=t.querySelector(_l(k)))?(n.instance=E,Xt(E),E):(h=o,(E=hi.get(k))&&(h=L({},o),Ep(h,E)),t=t.ownerDocument||t,E=t.createElement("script"),Xt(E),cn(E,"link",h),t.head.appendChild(E),n.instance=E);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(h=n.instance,n.state.loading|=4,Eu(h,o.precedence,t));return n.instance}function Eu(t,n,o){for(var h=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=h.length?h[h.length-1]:null,k=E,N=0;N<h.length;N++){var q=h[N];if(q.dataset.precedence===n)k=q;else if(k!==E)break}k?k.parentNode.insertBefore(t,k.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(t,n.firstChild))}function Cp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Ep(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var ku=null;function Ix(t,n,o){if(ku===null){var h=new Map,E=ku=new Map;E.set(o,h)}else E=ku,h=E.get(o),h||(h=new Map,E.set(o,h));if(h.has(t))return h;for(h.set(t,null),o=o.getElementsByTagName(t),E=0;E<o.length;E++){var k=o[E];if(!(k[ja]||k[rn]||t==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var N=k.getAttribute(n)||"";N=t+N;var q=h.get(N);q?q.push(k):h.set(N,[k])}}return h}function kp(t,n,o){t=t.ownerDocument||t,t.head.insertBefore(o,n==="title"?t.querySelector("head > title"):null)}function _3(t,n,o){if(o===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function zx(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Hx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Fx(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Ux(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=Fx(n),t.suspenseyImages.push(n)),t=b3.bind(t),n.decode().then(t,t))}function x3(t,n,o,h){if(o.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var E=Go(h.href),k=n.querySelector(vl(E));if(k){n=k._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=xl.bind(t),n.then(t,t)),o.state.loading|=4,o.instance=k,Xt(k);return}k=n.ownerDocument||n,h=Bx(h),(E=hi.get(E))&&Cp(h,E),k=k.createElement("link"),Xt(k);var N=k;N._p=new Promise(function(q,J){N.onload=q,N.onerror=J}),cn(k,"link",h),o.instance=k}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(o,n),(n=o.state.preload)&&(o.state.loading&3)===0&&(t.count++,o=xl.bind(t),n.addEventListener("load",o),n.addEventListener("error",o))}}var Tu=0;function y3(t,n){return t.stylesheets&&t.count===0&&Au(t,t.stylesheets),0<t.count||0<t.imgCount?function(o){var h=setTimeout(function(){if(t.stylesheets&&Au(t,t.stylesheets),t.unsuspend){var k=t.unsuspend;t.unsuspend=null,k()}},6e4+n);0<t.imgBytes&&Tu===0&&(Tu=62500*Ik());var E=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Au(t,t.stylesheets),t.unsuspend)){var k=t.unsuspend;t.unsuspend=null,k()}},(t.imgBytes>Tu?50:800)+n);return t.unsuspend=o,function(){t.unsuspend=null,clearTimeout(h),clearTimeout(E)}}:null}function $x(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)Au(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function xl(){this.count--,$x(this)}function b3(){this.imgCount--,$x(this)}var Ru=null;function Au(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ru=new Map,n.forEach(w3,t),Ru=null,xl.call(t))}function w3(t,n){if(!(n.state.loading&4)){var o=Ru.get(t);if(o)var h=o.get(null);else{o=new Map,Ru.set(t,o);for(var E=t.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<E.length;k++){var N=E[k];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(o.set(N.dataset.precedence,N),h=N)}h&&o.set(null,h)}E=n.instance,N=E.getAttribute("data-precedence"),k=o.get(N)||h,k===h&&o.set(null,E),o.set(N,E),this.count++,h=xl.bind(this),E.addEventListener("load",h),E.addEventListener("error",h),k?k.parentNode.insertBefore(E,k.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(E,t.firstChild)),n.state.loading|=4}}var Ko={$$typeof:W,Provider:null,Consumer:null,_currentValue:Se,_currentValue2:Se,_threadCount:0};function S3(t,n,o,h,E,k,N,q,J){this.tag=1,this.containerInfo=t,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=sd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sd(0),this.hiddenUpdates=sd(null),this.identifierPrefix=h,this.onUncaughtError=E,this.onCaughtError=k,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.transitionTypes=null,this.incompleteTransitions=new Map}function qx(t,n,o,h,E,k,N,q,J,se,de,me){return t=new S3(t,n,o,N,J,se,de,me,q),n=1,k===!0&&(n|=24),k=Rn(3,null,null,n),t.current=k,k.stateNode=t,n=Hd(),n.refCount++,t.pooledCache=n,n.refCount++,k.memoizedState={element:h,isDehydrated:o,cache:n},qd(k),t}function Vx(t){return t?(t=bo,t):bo}function Wx(t,n,o,h,E,k){E=Vx(E),h.context===null?h.context=E:h.pendingContext=E,h=Br(n),h.payload={element:o},k=k===void 0?null:k,k!==null&&(h.callback=k),o=Pr(t,h,n),o!==null&&(Mn(o,t,n),Xa(o,t,n))}function Gx(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<n?o:n}}function Tp(t,n){Gx(t,n),(t=t.alternate)&&Gx(t,n)}function Yx(t){if(t.tag===13||t.tag===31){var n=ws(t,67108864);n!==null&&Mn(n,t,67108864),Tp(t,67108864)}}function Kx(t){if(t.tag===13||t.tag===31){var n=Gn();n=od(n);var o=ws(t,n);o!==null&&Mn(o,t,n),Tp(t,n)}}var Xo=!0;function C3(t,n,o,h){var E=ue.T;ue.T=null;var k=he.p;try{he.p=2,Rp(t,n,o,h)}finally{he.p=k,ue.T=E}}function E3(t,n,o,h){var E=ue.T;ue.T=null;var k=he.p;try{he.p=8,Rp(t,n,o,h)}finally{he.p=k,ue.T=E}}function Rp(t,n,o,h){if(Xo){var E=Ap(h);if(E===null)cp(t,n,h,Du,o),Qx(t,h);else if(T3(E,t,n,o,h))h.stopPropagation();else if(Qx(t,h),n&4&&-1<k3.indexOf(t)){for(;E!==null;){var k=co(E);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var N=vs(k.pendingLanes);if(N!==0){var q=k;for(q.pendingLanes|=2,q.entangledLanes|=2;N;){var J=1<<31-Hn(N);q.entanglements[1]|=J,N&=~J}Pi(k),(lt&6)===0&&(mu=Vt()+500,dl(0))}}break;case 31:case 13:q=ws(k,2),q!==null&&Mn(q,k,2),_u(),Tp(k,2)}if(k=Ap(h),k===null&&cp(t,n,h,Du,o),k===E)break;E=k}E!==null&&h.stopPropagation()}else cp(t,n,h,null,o)}}function Ap(t){return t=fd(t),Dp(t)}var Du=null;function Dp(t){if(Du=null,t=_s(t),t!==null){var n=d(t);if(n===null)t=null;else{var o=n.tag;if(o===13){if(t=p(n),t!==null)return t;t=null}else if(o===31){if(t=a(n),t!==null)return t;t=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Du=t,null}function Xx(t){switch(t){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Wt()){case ni:return 2;case xn:return 8;case ao:case z5:return 32;case Pv:return 268435456;default:return 32}default:return 32}}var Lp=!1,Kr=null,Xr=null,Qr=null,yl=new Map,bl=new Map,Zr=[],k3="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 Qx(t,n){switch(t){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Xr=null;break;case"mouseover":case"mouseout":Qr=null;break;case"pointerover":case"pointerout":yl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":bl.delete(n.pointerId)}}function wl(t,n,o,h,E,k){return t===null||t.nativeEvent!==k?(t={blockedOn:n,domEventName:o,eventSystemFlags:h,nativeEvent:k,targetContainers:[E]},n!==null&&(n=co(n),n!==null&&Yx(n)),t):(t.eventSystemFlags|=h,n=t.targetContainers,E!==null&&n.indexOf(E)===-1&&n.push(E),t)}function T3(t,n,o,h,E){switch(n){case"focusin":return Kr=wl(Kr,t,n,o,h,E),!0;case"dragenter":return Xr=wl(Xr,t,n,o,h,E),!0;case"mouseover":return Qr=wl(Qr,t,n,o,h,E),!0;case"pointerover":var k=E.pointerId;return yl.set(k,wl(yl.get(k)||null,t,n,o,h,E)),!0;case"gotpointercapture":return k=E.pointerId,bl.set(k,wl(bl.get(k)||null,t,n,o,h,E)),!0}return!1}function Zx(t){var n=_s(t.target);if(n!==null){var o=d(n);if(o!==null){if(n=o.tag,n===13){if(n=p(o),n!==null){t.blockedOn=n,qv(t.priority,function(){Kx(o)});return}}else if(n===31){if(n=a(o),n!==null){t.blockedOn=n,qv(t.priority,function(){Kx(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Lu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var o=Ap(t.nativeEvent);if(o===null){o=t.nativeEvent;var h=new o.constructor(o.type,o);dd=h,o.target.dispatchEvent(h),dd=null}else return n=co(o),n!==null&&Yx(n),t.blockedOn=o,!1;n.shift()}return!0}function Jx(t,n,o){Lu(t)&&o.delete(n)}function R3(){Lp=!1,Kr!==null&&Lu(Kr)&&(Kr=null),Xr!==null&&Lu(Xr)&&(Xr=null),Qr!==null&&Lu(Qr)&&(Qr=null),yl.forEach(Jx),bl.forEach(Jx)}function Mu(t,n){t.blockedOn===n&&(t.blockedOn=null,Lp||(Lp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,R3)))}var ju=null;function ey(t){ju!==t&&(ju=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ju===t&&(ju=null);for(var n=0;n<t.length;n+=3){var o=t[n],h=t[n+1],E=t[n+2];if(typeof h!="function"){if(Dp(h||o)===null)continue;break}var k=co(o);k!==null&&(t.splice(n,3),n-=3,df(k,{pending:!0,data:E,method:o.method,action:h},h,E))}}))}function Qo(t){function n(J){return Mu(J,t)}Kr!==null&&Mu(Kr,t),Xr!==null&&Mu(Xr,t),Qr!==null&&Mu(Qr,t),yl.forEach(n),bl.forEach(n);for(var o=0;o<Zr.length;o++){var h=Zr[o];h.blockedOn===t&&(h.blockedOn=null)}for(;0<Zr.length&&(o=Zr[0],o.blockedOn===null);)Zx(o),o.blockedOn===null&&Zr.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(h=0;h<o.length;h+=3){var E=o[h],k=o[h+1],N=E[Tn]||null;if(typeof k=="function")N||ey(o);else if(N){var q=null;if(k&&k.hasAttribute("formAction")){if(E=k,N=k[Tn]||null)q=N.formAction;else if(Dp(E)!==null)continue}else q=N.action;typeof q=="function"?o[h+1]=q:(o.splice(h,3),h-=3),ey(o)}}}function ty(){function t(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(N){return E=N})},focusReset:"manual",scroll:"manual"})}function n(){E!==null&&(E(),E=null),h||setTimeout(o,20)}function o(){if(!h&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,E=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(o,100),function(){h=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),E!==null&&(E(),E=null)}}}function Mp(t){this._internalRoot=t}Ou.prototype.render=Mp.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(s(409));var o=n.current,h=Gn();Wx(o,h,t,n,null,null)},Ou.prototype.unmount=Mp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Wx(t.current,2,null,t,null,null),_u(),n[lo]=null}};function Ou(t){this._internalRoot=t}Ou.prototype.unstable_scheduleHydration=function(t){if(t){var n=$v();t={blockedOn:null,target:t,priority:n};for(var o=0;o<Zr.length&&n!==0&&n<Zr[o].priority;o++);Zr.splice(o,0,t),o===0&&Zx(t)}};var ny=i.version;if(ny!=="19.3.1")throw Error(s(527,ny,"19.3.1"));he.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=f(n),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var A3={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ue,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nu.isDisabled&&Nu.supportsFiber)try{Da=Nu.inject(A3),zn=Nu}catch{}}return Cl.createRoot=function(t,n){if(!l(t))throw Error(s(299));var o=!1,h="",E=V1,k=W1,N=G1;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(h=n.identifierPrefix),n.onUncaughtError!==void 0&&(E=n.onUncaughtError),n.onCaughtError!==void 0&&(k=n.onCaughtError),n.onRecoverableError!==void 0&&(N=n.onRecoverableError)),n=qx(t,1,!1,null,null,o,h,null,E,k,N,ty),t[lo]=n.current,lp(t),new Mp(n)},Cl.hydrateRoot=function(t,n,o){if(!l(t))throw Error(s(299));var h=!1,E="",k=V1,N=W1,q=G1,J=null;return o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(E=o.identifierPrefix),o.onUncaughtError!==void 0&&(k=o.onUncaughtError),o.onCaughtError!==void 0&&(N=o.onCaughtError),o.onRecoverableError!==void 0&&(q=o.onRecoverableError),o.formState!==void 0&&(J=o.formState)),n=qx(t,1,!0,n,o??null,h,E,J,k,N,q,ty),n.context=Vx(null),o=n.current,h=Gn(),h=od(h),E=Br(h),E.callback=null,Pr(o,E,h),o=h,n.current.lanes=o,Ma(n,o),Pi(n),t[lo]=n.current,lp(t),new Ou(n)},Cl.version="19.3.1",Cl}var my;function z3(){if(my)return Bp.exports;my=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Bp.exports=I3(),Bp.exports}var H3=z3();/**
51
- * @license lucide-react v0.469.0 - ISC
52
- *
53
- * This source code is licensed under the ISC license.
54
- * See the LICENSE file in the root directory of this source tree.
55
- */const F3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Mw=(...e)=>e.filter((i,r,s)=>!!i&&i.trim()!==""&&s.indexOf(i)===r).join(" ").trim();/**
56
- * @license lucide-react v0.469.0 - ISC
57
- *
58
- * This source code is licensed under the ISC license.
59
- * See the LICENSE file in the root directory of this source tree.
60
- */var U3={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"};/**
61
- * @license lucide-react v0.469.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const $3=P.forwardRef(({color:e="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:l="",children:d,iconNode:p,...a},u)=>P.createElement("svg",{ref:u,...U3,width:i,height:i,stroke:e,strokeWidth:s?Number(r)*24/Number(i):r,className:Mw("lucide",l),...a},[...p.map(([f,g])=>P.createElement(f,g)),...Array.isArray(d)?d:[d]]));/**
66
- * @license lucide-react v0.469.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const Ce=(e,i)=>{const r=P.forwardRef(({className:s,...l},d)=>P.createElement($3,{ref:d,iconNode:i,className:Mw(`lucide-${F3(e)}`,s),...l}));return r.displayName=`${e}`,r};/**
71
- * @license lucide-react v0.469.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const q3=Ce("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
76
- * @license lucide-react v0.469.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const Wl=Ce("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
81
- * @license lucide-react v0.469.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const jw=Ce("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
86
- * @license lucide-react v0.469.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const pa=Ce("BellOff",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);/**
91
- * @license lucide-react v0.469.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const ls=Ce("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
96
- * @license lucide-react v0.469.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const V3=Ce("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
101
- * @license lucide-react v0.469.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const W3=Ce("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]);/**
106
- * @license lucide-react v0.469.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const Ow=Ce("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
111
- * @license lucide-react v0.469.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const kh=Ce("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
116
- * @license lucide-react v0.469.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const Gl=Ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
121
- * @license lucide-react v0.469.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const xa=Ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
126
- * @license lucide-react v0.469.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const G3=Ce("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
131
- * @license lucide-react v0.469.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const ya=Ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
136
- * @license lucide-react v0.469.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const Y3=Ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
141
- * @license lucide-react v0.469.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const Nw=Ce("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
146
- * @license lucide-react v0.469.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const Bw=Ce("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
151
- * @license lucide-react v0.469.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const Pw=Ce("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
156
- * @license lucide-react v0.469.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const Iw=Ce("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["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"}]]);/**
161
- * @license lucide-react v0.469.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const Gs=Ce("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
166
- * @license lucide-react v0.469.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const wm=Ce("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
171
- * @license lucide-react v0.469.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const K3=Ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
176
- * @license lucide-react v0.469.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const X3=Ce("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
181
- * @license lucide-react v0.469.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const Th=Ce("Copy",[["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"}]]);/**
186
- * @license lucide-react v0.469.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const Q3=Ce("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
191
- * @license lucide-react v0.469.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const zw=Ce("Ellipsis",[["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"}]]);/**
196
- * @license lucide-react v0.469.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const ba=Ce("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
201
- * @license lucide-react v0.469.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const Z3=Ce("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
206
- * @license lucide-react v0.469.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const mg=Ce("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
211
- * @license lucide-react v0.469.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const Sm=Ce("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
216
- * @license lucide-react v0.469.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const J3=Ce("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
221
- * @license lucide-react v0.469.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const Cm=Ce("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
226
- * @license lucide-react v0.469.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const gg=Ce("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
231
- * @license lucide-react v0.469.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const Hw=Ce("FolderGit2",[["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"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
236
- * @license lucide-react v0.469.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const Ks=Ce("FolderOpen",[["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"}]]);/**
241
- * @license lucide-react v0.469.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const Em=Ce("FolderPlus",[["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"}]]);/**
246
- * @license lucide-react v0.469.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const vg=Ce("Folder",[["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"}]]);/**
251
- * @license lucide-react v0.469.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const e4=Ce("GitBranch",[["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"}]]);/**
256
- * @license lucide-react v0.469.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const t4=Ce("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/**
261
- * @license lucide-react v0.469.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const n4=Ce("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
266
- * @license lucide-react v0.469.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const i4=Ce("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
271
- * @license lucide-react v0.469.0 - ISC
272
- *
273
- * This source code is licensed under the ISC license.
274
- * See the LICENSE file in the root directory of this source tree.
275
- */const r4=Ce("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
276
- * @license lucide-react v0.469.0 - ISC
277
- *
278
- * This source code is licensed under the ISC license.
279
- * See the LICENSE file in the root directory of this source tree.
280
- */const s4=Ce("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
281
- * @license lucide-react v0.469.0 - ISC
282
- *
283
- * This source code is licensed under the ISC license.
284
- * See the LICENSE file in the root directory of this source tree.
285
- */const o4=Ce("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
286
- * @license lucide-react v0.469.0 - ISC
287
- *
288
- * This source code is licensed under the ISC license.
289
- * See the LICENSE file in the root directory of this source tree.
290
- */const a4=Ce("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
291
- * @license lucide-react v0.469.0 - ISC
292
- *
293
- * This source code is licensed under the ISC license.
294
- * See the LICENSE file in the root directory of this source tree.
295
- */const _g=Ce("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
296
- * @license lucide-react v0.469.0 - ISC
297
- *
298
- * This source code is licensed under the ISC license.
299
- * See the LICENSE file in the root directory of this source tree.
300
- */const l4=Ce("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
301
- * @license lucide-react v0.469.0 - ISC
302
- *
303
- * This source code is licensed under the ISC license.
304
- * See the LICENSE file in the root directory of this source tree.
305
- */const c4=Ce("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
306
- * @license lucide-react v0.469.0 - ISC
307
- *
308
- * This source code is licensed under the ISC license.
309
- * See the LICENSE file in the root directory of this source tree.
310
- */const Ml=Ce("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
311
- * @license lucide-react v0.469.0 - ISC
312
- *
313
- * This source code is licensed under the ISC license.
314
- * See the LICENSE file in the root directory of this source tree.
315
- */const u4=Ce("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
316
- * @license lucide-react v0.469.0 - ISC
317
- *
318
- * This source code is licensed under the ISC license.
319
- * See the LICENSE file in the root directory of this source tree.
320
- */const xg=Ce("ListX",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"m19 10-4 4",key:"1tz659"}],["path",{d:"m15 10 4 4",key:"1n7nei"}]]);/**
321
- * @license lucide-react v0.469.0 - ISC
322
- *
323
- * This source code is licensed under the ISC license.
324
- * See the LICENSE file in the root directory of this source tree.
325
- */const h4=Ce("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
326
- * @license lucide-react v0.469.0 - ISC
327
- *
328
- * This source code is licensed under the ISC license.
329
- * See the LICENSE file in the root directory of this source tree.
330
- */const Fw=Ce("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
331
- * @license lucide-react v0.469.0 - ISC
332
- *
333
- * This source code is licensed under the ISC license.
334
- * See the LICENSE file in the root directory of this source tree.
335
- */const Uw=Ce("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
336
- * @license lucide-react v0.469.0 - ISC
337
- *
338
- * This source code is licensed under the ISC license.
339
- * See the LICENSE file in the root directory of this source tree.
340
- */const d4=Ce("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
341
- * @license lucide-react v0.469.0 - ISC
342
- *
343
- * This source code is licensed under the ISC license.
344
- * See the LICENSE file in the root directory of this source tree.
345
- */const f4=Ce("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
346
- * @license lucide-react v0.469.0 - ISC
347
- *
348
- * This source code is licensed under the ISC license.
349
- * See the LICENSE file in the root directory of this source tree.
350
- */const $w=Ce("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
351
- * @license lucide-react v0.469.0 - ISC
352
- *
353
- * This source code is licensed under the ISC license.
354
- * See the LICENSE file in the root directory of this source tree.
355
- */const p4=Ce("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
356
- * @license lucide-react v0.469.0 - ISC
357
- *
358
- * This source code is licensed under the ISC license.
359
- * See the LICENSE file in the root directory of this source tree.
360
- */const Wi=Ce("Pencil",[["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"}]]);/**
361
- * @license lucide-react v0.469.0 - ISC
362
- *
363
- * This source code is licensed under the ISC license.
364
- * See the LICENSE file in the root directory of this source tree.
365
- */const ma=Ce("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
366
- * @license lucide-react v0.469.0 - ISC
367
- *
368
- * This source code is licensed under the ISC license.
369
- * See the LICENSE file in the root directory of this source tree.
370
- */const m4=Ce("PlugZap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]);/**
371
- * @license lucide-react v0.469.0 - ISC
372
- *
373
- * This source code is licensed under the ISC license.
374
- * See the LICENSE file in the root directory of this source tree.
375
- */const Yl=Ce("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
376
- * @license lucide-react v0.469.0 - ISC
377
- *
378
- * This source code is licensed under the ISC license.
379
- * See the LICENSE file in the root directory of this source tree.
380
- */const Qn=Ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
381
- * @license lucide-react v0.469.0 - ISC
382
- *
383
- * This source code is licensed under the ISC license.
384
- * See the LICENSE file in the root directory of this source tree.
385
- */const g4=Ce("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
386
- * @license lucide-react v0.469.0 - ISC
387
- *
388
- * This source code is licensed under the ISC license.
389
- * See the LICENSE file in the root directory of this source tree.
390
- */const Kl=Ce("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
391
- * @license lucide-react v0.469.0 - ISC
392
- *
393
- * This source code is licensed under the ISC license.
394
- * See the LICENSE file in the root directory of this source tree.
395
- */const Xl=Ce("RefreshCw",[["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"}]]);/**
396
- * @license lucide-react v0.469.0 - ISC
397
- *
398
- * This source code is licensed under the ISC license.
399
- * See the LICENSE file in the root directory of this source tree.
400
- */const v4=Ce("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
401
- * @license lucide-react v0.469.0 - ISC
402
- *
403
- * This source code is licensed under the ISC license.
404
- * See the LICENSE file in the root directory of this source tree.
405
- */const _4=Ce("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
406
- * @license lucide-react v0.469.0 - ISC
407
- *
408
- * This source code is licensed under the ISC license.
409
- * See the LICENSE file in the root directory of this source tree.
410
- */const x4=Ce("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
411
- * @license lucide-react v0.469.0 - ISC
412
- *
413
- * This source code is licensed under the ISC license.
414
- * See the LICENSE file in the root directory of this source tree.
415
- */const Rh=Ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
416
- * @license lucide-react v0.469.0 - ISC
417
- *
418
- * This source code is licensed under the ISC license.
419
- * See the LICENSE file in the root directory of this source tree.
420
- */const qw=Ce("Send",[["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"}]]);/**
421
- * @license lucide-react v0.469.0 - ISC
422
- *
423
- * This source code is licensed under the ISC license.
424
- * See the LICENSE file in the root directory of this source tree.
425
- */const y4=Ce("ShieldQuestion",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
426
- * @license lucide-react v0.469.0 - ISC
427
- *
428
- * This source code is licensed under the ISC license.
429
- * See the LICENSE file in the root directory of this source tree.
430
- */const b4=Ce("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
431
- * @license lucide-react v0.469.0 - ISC
432
- *
433
- * This source code is licensed under the ISC license.
434
- * See the LICENSE file in the root directory of this source tree.
435
- */const yg=Ce("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
436
- * @license lucide-react v0.469.0 - ISC
437
- *
438
- * This source code is licensed under the ISC license.
439
- * See the LICENSE file in the root directory of this source tree.
440
- */const bg=Ce("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
441
- * @license lucide-react v0.469.0 - ISC
442
- *
443
- * This source code is licensed under the ISC license.
444
- * See the LICENSE file in the root directory of this source tree.
445
- */const Ah=Ce("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
446
- * @license lucide-react v0.469.0 - ISC
447
- *
448
- * This source code is licensed under the ISC license.
449
- * See the LICENSE file in the root directory of this source tree.
450
- */const Vw=Ce("StepForward",[["line",{x1:"6",x2:"6",y1:"4",y2:"20",key:"fy8qot"}],["polygon",{points:"10,4 20,12 10,20",key:"1mc1pf"}]]);/**
451
- * @license lucide-react v0.469.0 - ISC
452
- *
453
- * This source code is licensed under the ISC license.
454
- * See the LICENSE file in the root directory of this source tree.
455
- */const Ww=Ce("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]);/**
456
- * @license lucide-react v0.469.0 - ISC
457
- *
458
- * This source code is licensed under the ISC license.
459
- * See the LICENSE file in the root directory of this source tree.
460
- */const yr=Ce("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
461
- * @license lucide-react v0.469.0 - ISC
462
- *
463
- * This source code is licensed under the ISC license.
464
- * See the LICENSE file in the root directory of this source tree.
465
- */const Gw=Ce("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
466
- * @license lucide-react v0.469.0 - ISC
467
- *
468
- * This source code is licensed under the ISC license.
469
- * See the LICENSE file in the root directory of this source tree.
470
- */const w4=Ce("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
471
- * @license lucide-react v0.469.0 - ISC
472
- *
473
- * This source code is licensed under the ISC license.
474
- * See the LICENSE file in the root directory of this source tree.
475
- */const Yw=Ce("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
476
- * @license lucide-react v0.469.0 - ISC
477
- *
478
- * This source code is licensed under the ISC license.
479
- * See the LICENSE file in the root directory of this source tree.
480
- */const Ql=Ce("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
481
- * @license lucide-react v0.469.0 - ISC
482
- *
483
- * This source code is licensed under the ISC license.
484
- * See the LICENSE file in the root directory of this source tree.
485
- */const pn=Ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);let lh=null;const fi="global";function gy(e){lh=e}function Bu(){return lh}function gi(){if(!lh)throw new Error("No project is open.");return`/api/p/${encodeURIComponent(lh)}`}function kt(e,i){return Vs(`${gi()}${e}`,i)}function vn(e,i){return Vs(`/api${e}`,i)}async function Vs(e,i){const r=await fetch(e,{...i,headers:{"Content-Type":"application/json",...(i==null?void 0:i.headers)??{}}}),s=await r.text();let l={};try{l=s?JSON.parse(s):{}}catch{throw r.ok?new Error("The server returned a response that was not JSON."):new Error(`${r.status} ${r.statusText}`)}if(!r.ok)throw new Error(l.error??r.statusText);return l}const Ot=(e,i)=>kt(e,{method:"POST",body:i===void 0?void 0:JSON.stringify(i)}),Cn=(e,i)=>kt(e,{method:"PUT",body:JSON.stringify(i)}),Zo=e=>kt(e,{method:"DELETE"}),ve={health:()=>kt("/health"),hub:()=>vn("/hub"),checkClaude:()=>vn("/claude/check",{method:"POST"}),projects:()=>vn("/projects"),addProject:e=>vn("/projects",{method:"POST",body:JSON.stringify({path:e})}),openedProject:e=>vn(`/projects/${encodeURIComponent(e)}/open`,{method:"POST"}),removeProject:e=>vn(`/projects/${encodeURIComponent(e)}`,{method:"DELETE"}),folders:e=>vn(`/folders${e?`?path=${encodeURIComponent(e)}`:""}`),globalOverview:()=>vn("/global/overview"),globalInbox:()=>vn("/global/inbox"),globalLive:()=>vn("/global/live"),closeOpenSessions:(e,i)=>Vs(`/api/p/${encodeURIComponent(e)}/open-sessions/close`,{method:"POST",body:JSON.stringify({ids:i})}),startSessionIn:(e,i)=>Vs(`/api/p/${encodeURIComponent(e)}/sessions`,{method:"POST",body:JSON.stringify(i)}),setMuted:(e,i)=>vn(`/global/muted/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({muted:i})}),answerIn:(e,i,r)=>vn(`/p/${encodeURIComponent(e)}/interactions/${i}/answer`,{method:"POST",body:JSON.stringify({answer:r})}),chooseIn:(e,i,r)=>vn(`/p/${encodeURIComponent(e)}/interactions/${i}/choose`,{method:"POST",body:JSON.stringify({ref:r})}),pauseNotificationsIn:(e,i)=>vn(`/p/${encodeURIComponent(e)}/notifications/paused`,{method:"PUT",body:JSON.stringify({paused:i})}),revealIn:e=>vn(`/p/${encodeURIComponent(e)}/files/reveal`,{method:"POST",body:JSON.stringify({path:""})}),dismissIn:(e,i)=>vn(`/p/${encodeURIComponent(e)}/interactions/${i}/dismiss`,{method:"POST"}),sessions:()=>kt("/sessions"),sessionsIn:e=>Vs(`/api/p/${encodeURIComponent(e)}/sessions`),session:e=>kt(`/sessions/${e}`),startSession:e=>Ot("/sessions",e),startPurpose:(e,i,r={})=>Ot("/purpose-sessions",{kind:e,targetId:i,...r}),resumeSession:(e,i={})=>Ot(`/sessions/${e}/resume`,i),killSession:(e,i)=>i?Vs(`/api/p/${encodeURIComponent(i)}/sessions/${e}/kill`,{method:"POST"}):Ot(`/sessions/${e}/kill`),renameSession:(e,i,r)=>r?Vs(`/api/p/${encodeURIComponent(r)}/sessions/${e}/title`,{method:"PUT",body:JSON.stringify({title:i})}):Cn(`/sessions/${e}/title`,{title:i}),deletionPlan:e=>kt(`/sessions/${e}/deletion`),deleteSession:(e,i=!0)=>Zo(`/sessions/${e}?temp=${i?1:0}`),interactions:e=>kt(`/interactions${e?`?status=${e}`:""}`),answer:(e,i)=>Ot(`/interactions/${e}/answer`,{answer:i}),choose:(e,i)=>Ot(`/interactions/${e}/choose`,{ref:i}),dismiss:e=>Ot(`/interactions/${e}/dismiss`),inventory:()=>kt("/inventory"),stats:()=>kt("/stats"),categories:()=>kt("/categories"),saveCategory:e=>e.id?Cn(`/categories/${e.id}`,e):Ot("/categories",e),deleteCategory:e=>Zo(`/categories/${e}`),prompts:()=>kt("/prompts"),savePrompt:(e,i)=>Cn(`/prompts/${e}`,{text:i}),previewSystemPrompt:e=>kt(`/prompts/preview?category=${encodeURIComponent(e)}`),memory:()=>kt("/memory"),memoryFile:e=>kt(`/memory/file?path=${encodeURIComponent(e)}`),saveMemoryFile:(e,i)=>Cn("/memory/file",{path:e,content:i}),channels:()=>kt("/channels"),setNotificationsPaused:e=>Cn("/notifications/paused",{paused:e}),setNotifyKinds:e=>Cn("/notifications/kinds",{kinds:e}),setSessionQuiet:(e,i)=>Cn(`/sessions/${e}/quiet`,{quiet:i}),dismissWaiting:e=>Ot(`/sessions/${e}/dismiss-waiting`),saveChannel:e=>e.id?Cn(`/channels/${e.id}`,e):Ot("/channels",e),deleteChannel:e=>Zo(`/channels/${e}`),testChannel:e=>Ot(`/channels/${e}/test`),jobs:()=>kt("/jobs"),saveJob:e=>e.id?Cn(`/jobs/${e.id}`,e):Ot("/jobs",e),deleteJob:e=>Zo(`/jobs/${e}`),rotateJobToken:e=>Ot(`/jobs/${e}/rotate`),runJob:(e,i)=>Ot(`/jobs/${e}/run`,{params:i}),runs:()=>kt("/runs"),queueRun:(e,i)=>Ot("/runs",{prompt:e,category:i}),cancelRun:e=>Ot(`/runs/${e}/cancel`),stopRun:e=>Ot(`/runs/${e}/stop`),resumeRun:e=>Ot(`/runs/${e}/resume`),toolsetCatalog:()=>kt("/toolset/catalog"),setSessionToolset:(e,i)=>Cn(`/sessions/${e}/toolset`,{toolset:i}),setSessionSetup:(e,i)=>Cn(`/sessions/${e}/setup`,i),presets:()=>kt("/presets"),savePreset:e=>e.id?Cn(`/presets/${e.id}`,e):Ot("/presets",e),deletePreset:e=>Zo(`/presets/${e}`),setDefaultItem:(e,i,r)=>Cn("/toolset/default",{kind:e,id:i,enabled:r}),claudeSettings:()=>kt("/claude-settings"),saveClaudeSettings:e=>Cn("/claude-settings",e),mcpCatalog:()=>kt("/mcp/catalog"),suggestions:()=>kt("/mcp/suggestions"),mcpSuggestionsEnabled:()=>kt("/mcp-suggestions/enabled"),setMcpSuggestionsEnabled:e=>Cn("/mcp-suggestions/enabled",{enabled:e}),installSuggestion:e=>Ot(`/mcp/suggestions/${e}/install`),skipSuggestion:(e,i="")=>Ot(`/mcp/suggestions/${e}/skip`,{note:i}),deleteSuggestion:e=>Zo(`/mcp/suggestions/${e}`)};function Kw(e){var i,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(i=0;i<l;i++)e[i]&&(r=Kw(e[i]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function Xw(){for(var e,i,r=0,s="",l=arguments.length;r<l;r++)(e=arguments[r])&&(i=Kw(e))&&(s&&(s+=" "),s+=i);return s}const wg="-",S4=e=>{const i=E4(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:p=>{const a=p.split(wg);return a[0]===""&&a.length!==1&&a.shift(),Qw(a,i)||C4(p)},getConflictingClassGroupIds:(p,a)=>{const u=r[p]||[];return a&&s[p]?[...u,...s[p]]:u}}},Qw=(e,i)=>{var p;if(e.length===0)return i.classGroupId;const r=e[0],s=i.nextPart.get(r),l=s?Qw(e.slice(1),s):void 0;if(l)return l;if(i.validators.length===0)return;const d=e.join(wg);return(p=i.validators.find(({validator:a})=>a(d)))==null?void 0:p.classGroupId},vy=/^\[(.+)\]$/,C4=e=>{if(vy.test(e)){const i=vy.exec(e)[1],r=i==null?void 0:i.substring(0,i.indexOf(":"));if(r)return"arbitrary.."+r}},E4=e=>{const{theme:i,prefix:r}=e,s={nextPart:new Map,validators:[]};return T4(Object.entries(e.classGroups),r).forEach(([d,p])=>{km(p,s,d,i)}),s},km=(e,i,r,s)=>{e.forEach(l=>{if(typeof l=="string"){const d=l===""?i:_y(i,l);d.classGroupId=r;return}if(typeof l=="function"){if(k4(l)){km(l(s),i,r,s);return}i.validators.push({validator:l,classGroupId:r});return}Object.entries(l).forEach(([d,p])=>{km(p,_y(i,d),r,s)})})},_y=(e,i)=>{let r=e;return i.split(wg).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},k4=e=>e.isThemeGetter,T4=(e,i)=>i?e.map(([r,s])=>{const l=s.map(d=>typeof d=="string"?i+d:typeof d=="object"?Object.fromEntries(Object.entries(d).map(([p,a])=>[i+p,a])):d);return[r,l]}):e,R4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let i=0,r=new Map,s=new Map;const l=(d,p)=>{r.set(d,p),i++,i>e&&(i=0,s=r,r=new Map)};return{get(d){let p=r.get(d);if(p!==void 0)return p;if((p=s.get(d))!==void 0)return l(d,p),p},set(d,p){r.has(d)?r.set(d,p):l(d,p)}}},Zw="!",A4=e=>{const{separator:i,experimentalParseClassName:r}=e,s=i.length===1,l=i[0],d=i.length,p=a=>{const u=[];let f=0,g=0,c;for(let m=0;m<a.length;m++){let b=a[m];if(f===0){if(b===l&&(s||a.slice(m,m+d)===i)){u.push(a.slice(g,m)),g=m+d;continue}if(b==="/"){c=m;continue}}b==="["?f++:b==="]"&&f--}const _=u.length===0?a:a.substring(g),x=_.startsWith(Zw),C=x?_.substring(1):_,y=c&&c>g?c-g:void 0;return{modifiers:u,hasImportantModifier:x,baseClassName:C,maybePostfixModifierPosition:y}};return r?a=>r({className:a,parseClassName:p}):p},D4=e=>{if(e.length<=1)return e;const i=[];let r=[];return e.forEach(s=>{s[0]==="["?(i.push(...r.sort(),s),r=[]):r.push(s)}),i.push(...r.sort()),i},L4=e=>({cache:R4(e.cacheSize),parseClassName:A4(e),...S4(e)}),M4=/\s+/,j4=(e,i)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:l}=i,d=[],p=e.trim().split(M4);let a="";for(let u=p.length-1;u>=0;u-=1){const f=p[u],{modifiers:g,hasImportantModifier:c,baseClassName:_,maybePostfixModifierPosition:x}=r(f);let C=!!x,y=s(C?_.substring(0,x):_);if(!y){if(!C){a=f+(a.length>0?" "+a:a);continue}if(y=s(_),!y){a=f+(a.length>0?" "+a:a);continue}C=!1}const m=D4(g).join(":"),b=c?m+Zw:m,S=b+y;if(d.includes(S))continue;d.push(S);const w=l(y,C);for(let T=0;T<w.length;++T){const D=w[T];d.push(b+D)}a=f+(a.length>0?" "+a:a)}return a};function O4(){let e=0,i,r,s="";for(;e<arguments.length;)(i=arguments[e++])&&(r=Jw(i))&&(s&&(s+=" "),s+=r);return s}const Jw=e=>{if(typeof e=="string")return e;let i,r="";for(let s=0;s<e.length;s++)e[s]&&(i=Jw(e[s]))&&(r&&(r+=" "),r+=i);return r};function N4(e,...i){let r,s,l,d=p;function p(u){const f=i.reduce((g,c)=>c(g),e());return r=L4(f),s=r.cache.get,l=r.cache.set,d=a,a(u)}function a(u){const f=s(u);if(f)return f;const g=j4(u,r);return l(u,g),g}return function(){return d(O4.apply(null,arguments))}}const Ct=e=>{const i=r=>r[e]||[];return i.isThemeGetter=!0,i},eS=/^\[(?:([a-z-]+):)?(.+)\]$/i,B4=/^\d+\/\d+$/,P4=new Set(["px","full","screen"]),I4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,z4=/\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$/,H4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,F4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cr=e=>ua(e)||P4.has(e)||B4.test(e),es=e=>wa(e,"length",X4),ua=e=>!!e&&!Number.isNaN(Number(e)),Hp=e=>wa(e,"number",ua),El=e=>!!e&&Number.isInteger(Number(e)),$4=e=>e.endsWith("%")&&ua(e.slice(0,-1)),Ye=e=>eS.test(e),ts=e=>I4.test(e),q4=new Set(["length","size","percentage"]),V4=e=>wa(e,q4,tS),W4=e=>wa(e,"position",tS),G4=new Set(["image","url"]),Y4=e=>wa(e,G4,Z4),K4=e=>wa(e,"",Q4),kl=()=>!0,wa=(e,i,r)=>{const s=eS.exec(e);return s?s[1]?typeof i=="string"?s[1]===i:i.has(s[1]):r(s[2]):!1},X4=e=>z4.test(e)&&!H4.test(e),tS=()=>!1,Q4=e=>F4.test(e),Z4=e=>U4.test(e),J4=()=>{const e=Ct("colors"),i=Ct("spacing"),r=Ct("blur"),s=Ct("brightness"),l=Ct("borderColor"),d=Ct("borderRadius"),p=Ct("borderSpacing"),a=Ct("borderWidth"),u=Ct("contrast"),f=Ct("grayscale"),g=Ct("hueRotate"),c=Ct("invert"),_=Ct("gap"),x=Ct("gradientColorStops"),C=Ct("gradientColorStopPositions"),y=Ct("inset"),m=Ct("margin"),b=Ct("opacity"),S=Ct("padding"),w=Ct("saturate"),T=Ct("scale"),D=Ct("sepia"),R=Ct("skew"),L=Ct("space"),A=Ct("translate"),j=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Ye,i],B=()=>[Ye,i],H=()=>["",cr,es],F=()=>["auto",ua,Ye],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Ye],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[ua,Ye];return{cacheSize:500,separator:":",theme:{colors:[kl],spacing:[cr,es],blur:["none","",ts,Ye],brightness:Y(),borderColor:[e],borderRadius:["none","","full",ts,Ye],borderSpacing:B(),borderWidth:H(),contrast:Y(),grayscale:z(),hueRotate:Y(),invert:z(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[$4,es],inset:I(),margin:I(),opacity:Y(),padding:B(),saturate:Y(),scale:Y(),sepia:z(),skew:Y(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[ts]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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"],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:[...W(),Ye]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",El,Ye]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",El,Ye]}],"grid-cols":[{"grid-cols":[kl]}],"col-start-end":[{col:["auto",{span:["full",El,Ye]},Ye]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[kl]}],"row-start-end":[{row:["auto",{span:[El,Ye]},Ye]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,i]}],"min-w":[{"min-w":[Ye,i,"min","max","fit"]}],"max-w":[{"max-w":[Ye,i,"none","full","min","max","fit","prose",{screen:[ts]},ts]}],h:[{h:[Ye,i,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,i,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,i,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,i,"auto","min","max","fit"]}],"font-size":[{text:["base",ts,es]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hp]}],"font-family":[{font:[kl]}],"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:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",ua,Hp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",cr,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",cr,es]}],"underline-offset":[{"underline-offset":["auto",cr,Ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),W4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",V4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Y4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[d]}],"rounded-s":[{"rounded-s":[d]}],"rounded-e":[{"rounded-e":[d]}],"rounded-t":[{"rounded-t":[d]}],"rounded-r":[{"rounded-r":[d]}],"rounded-b":[{"rounded-b":[d]}],"rounded-l":[{"rounded-l":[d]}],"rounded-ss":[{"rounded-ss":[d]}],"rounded-se":[{"rounded-se":[d]}],"rounded-ee":[{"rounded-ee":[d]}],"rounded-es":[{"rounded-es":[d]}],"rounded-tl":[{"rounded-tl":[d]}],"rounded-tr":[{"rounded-tr":[d]}],"rounded-br":[{"rounded-br":[d]}],"rounded-bl":[{"rounded-bl":[d]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:G()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[cr,Ye]}],"outline-w":[{outline:[cr,es]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[cr,es]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ts,K4]}],"shadow-color":[{shadow:[kl]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",ts,Ye]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[c]}],saturate:[{saturate:[w]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[p]}],"border-spacing-x":[{"border-spacing-x":[p]}],"border-spacing-y":[{"border-spacing-y":[p]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ye]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[El,Ye]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",Ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[cr,es,Hp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},eT=N4(J4);function ye(...e){return eT(Xw(e))}function On(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Sg(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024**3).toFixed(1)} GB`}function os(e){return e?e.input+e.output+e.cacheRead+e.cacheCreation:0}function fs(e){if(!e)return"";const i=Math.max(0,(Date.now()-Date.parse(e))/1e3);return i<60?"just now":i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:`${Math.floor(i/86400)}d ago`}function Xs(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"}function tT(e){return e==="Agent"||e==="Task"?"agents":e==="Skill"?"skills":e.startsWith("mcp__")?"mcp":"built-in"}function nT(e){const i=e.slice(5),r=i.indexOf("__");return r===-1?{server:i,tool:""}:{server:i.slice(0,r),tool:i.slice(r+2)}}function iT(e){const i={"built-in":[],agents:[],skills:[],mcp:[]};for(const[r,s]of Object.entries(e))i[tT(r)].push({name:r,...s});for(const r of Object.values(i))r.sort((s,l)=>l.count-s.count);return i}const xy=e=>{let i;const r=new Set,s=(f,g)=>{const c=typeof f=="function"?f(i):f;if(!Object.is(c,i)){const _=i;i=g??(typeof c!="object"||c===null)?c:Object.assign({},i,c),r.forEach(x=>x(i,_))}},l=()=>i,a={setState:s,getState:l,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f))},u=i=e(s,l,a);return a},rT=(e=>e?xy(e):xy),sT=e=>e;function oT(e,i=sT){const r=Ll.useSyncExternalStore(e.subscribe,Ll.useCallback(()=>i(e.getState()),[e,i]),()=>i(e.getInitialState()));return Ll.useDebugValue(r),r}const yy=e=>{const i=rT(e),r=s=>oT(i,s);return Object.assign(r,i),r},no=(e=>e?yy(e):yy),dr=no(e=>({item:null,set:i=>e({item:i})})),en=no(e=>({drafts:{},put:(i,r)=>e(s=>({drafts:{...s.drafts,[i]:r}})),drop:i=>e(r=>{const{[i]:s,...l}=r.drafts;return{drafts:l}}),move:(i,r)=>e(s=>({drafts:Object.fromEntries(Object.entries(s.drafts).map(([l,d])=>[l===i?r:l.startsWith(`${i}/`)?r+l.slice(i.length):l,d]))}))})),rs=e=>!!(e&&e.text!==e.base),Zu=new Map;let Pu=null;function aT(e){e!==Pu&&(Pu&&Zu.set(Pu,en.getState().drafts),en.setState({drafts:e&&Zu.get(e)||{}}),e&&Zu.delete(e),Pu=e)}window.addEventListener("beforeunload",e=>{[en.getState().drafts,...Zu.values()].some(r=>Object.values(r).some(rs))&&e.preventDefault()});const by="clauder-hub:auto-save",wy=no(e=>({on:(()=>{try{return localStorage.getItem(by)==="1"}catch{return!1}})(),set:i=>{try{localStorage.setItem(by,i?"1":"0")}catch{}e({on:i})}}));let Pl=null;function nS(){if(!Pl)return[];try{const e=JSON.parse(localStorage.getItem(Pl)??"[]");return Array.isArray(e)?e.filter(i=>typeof(i==null?void 0:i.path)=="string").map(i=>({path:i.path,preview:!!i.preview})):[]}catch{return[]}}function lT(e){if(Pl)try{localStorage.setItem(Pl,JSON.stringify(e))}catch{}}const iS=(e,i)=>e===i||e.startsWith(`${i}/`),Bn=no((e,i)=>{const r=s=>{lT(s),e({tabs:s})};return{tabs:nS(),show:s=>{const l=i().tabs;if(l.some(p=>p.path===s))return;const d=l.findIndex(p=>p.preview);if(d===-1)return r([...l,{path:s,preview:!0}]);r(l.map((p,a)=>a===d?{path:s,preview:!0}:p))},pin:s=>{const l=i().tabs;if(!l.some(d=>d.path===s&&d.preview)){l.some(d=>d.path===s)||r([...l,{path:s,preview:!1}]);return}r(l.map(d=>d.path===s?{...d,preview:!1}:d))},close:(s,l)=>{var c;const d=i().tabs,p=new Set(s),a=d.filter(_=>!p.has(_.path));if(r(a),!l||!p.has(l))return l;const u=d.findIndex(_=>_.path===l),f=d.slice(u+1).find(_=>!p.has(_.path)),g=d.slice(0,u).reverse().find(_=>!p.has(_.path));return((c=f??g)==null?void 0:c.path)??null},reorder:(s,l)=>{const d=[...i().tabs],p=d.findIndex(f=>f.path===s),a=d.findIndex(f=>f.path===l);if(p===-1||a===-1||p===a)return;const[u]=d.splice(p,1);d.splice(a,0,u),r(d)},rename:(s,l)=>r(i().tabs.map(d=>iS(d.path,s)?{...d,path:l+d.path.slice(s.length)}:d))}}),ch=new Map;function cT(e,i){ch.set(e,i)}function uT(e){const i=ch.get(e)??null;return ch.delete(e),i}function hT(e){ch.clear(),Pl=e?`clauder-hub:open-files:${e}`:null,Bn.setState({tabs:nS()})}function dT(e){return Bn.getState().tabs.filter(i=>iS(i.path,e)).map(i=>i.path)}function Sy(e){aT(e),hT(e),dr.getState().set(null)}function fT(e){const i=r=>[...r].sort((s,l)=>(l.lastAt??l.startedAt??"").localeCompare(s.lastAt??s.startedAt??""))[0]??null;return i(e.filter(r=>r.live&&r.status==="waiting"))??i(e.filter(r=>r.live&&(r.status==="running"||r.status==="idle")))??i(e.filter(r=>r.status==="done"))??i(e.filter(r=>!r.purpose))}const pT=["overview","inbox","automation","instructions","agents","skills","commands","mcp-servers","hooks","plugins","channels","hub-prompts","claude-settings","mcp-suggestions","presets","categories"];let Jo=null,Fp=null;function Cy(e){try{return decodeURIComponent(e)}catch{return e}}function Ey(){let e=window.location.hash.replace(/^#\/?/,"");const i=e.startsWith("w/");i&&(e=e.slice(2));const r=e.indexOf("/"),s=Cy(r===-1?e:e.slice(0,r))||fi;return e=r===-1?"":e.slice(r+1),e.startsWith("session/")?{projectId:s,view:{kind:"session",id:e.slice(8)},windowed:i}:e.startsWith("file/")?{projectId:s,view:{kind:"file",path:e.slice(5).split("/").map(Cy).join("/")},windowed:i}:{projectId:s,view:{kind:"page",page:pT.find(l=>l===e)??"overview"},windowed:i}}function la(e,i,r){if(!e)return la(fi,i,r);const s=i.kind==="session"?`session/${i.id}`:i.kind==="file"?`file/${i.path.split("/").map(encodeURIComponent).join("/")}`:i.page;return`#/${r?"w/":""}${encodeURIComponent(e)}/${s}`}function Cg(e){const i=ge.getState().projectId,r=e.kind==="session"?`clauder-${i}-${e.id}`:e.kind==="file"?`clauder-file-${i}-${e.path}`:`clauder-${i}-${e.page}`;window.open(`${location.origin}${location.pathname}${la(i,e,!0)}`,r,"popup,width=1280,height=820")}const mT={sessions:0,transcript:0,interactions:0,runs:0,jobs:0,mcp:0,channels:0,files:0,projects:0},rS=1e4,jl=new Map;function sS(e,i=!1){const r=jl.get(e);if(r&&Date.now()-r.at<rS)return i&&jl.delete(e),r.read;const s=l=>fetch(`/api/p/${encodeURIComponent(e)}${l}`).then(async d=>{const p=await d.json().catch(()=>({}));if(!d.ok)throw new Error(p.error??`${d.status} ${d.statusText}`);return p});return Promise.all([s("/health"),s("/sessions"),s("/interactions?status=open")])}function Tm(e){if(e===ge.getState().projectId)return;const i=jl.get(e);if(i&&Date.now()-i.at<rS)return;const r=sS(e);r.catch(()=>jl.delete(e)),jl.set(e,{at:Date.now(),read:r})}const ge=no((e,i)=>{let r=null;const s=async(d,p)=>{r=d,e({switching:d});try{const[a,u,f]=await sS(d,!0);if(r!==d)return;r=null,gy(d),Sy(d),e({projectId:d,health:a,sessions:u,open:f,transcriptTicks:{},view:p.view,windowed:p.windowed,switching:null}),d!==fi&&ve.openedProject(d).catch(()=>{})}catch(a){if(r!==d)return;if(r=null,e({switching:null}),/no such project/i.test(a.message)){i().notify(`The hub has no project '${d}'. Open its folder again from here.`,"error"),i().openProject(fi);return}i().notify(`Could not open the project: ${a.message}`,"error"),history.replaceState(null,"",la(i().projectId,i().view,i().windowed))}},l=async d=>{if(r=null,gy(d),Sy(d),e({projectId:d,health:null,sessions:[],open:[],transcriptTicks:{}}),!!d)try{const[p]=await Promise.all([ve.health(),i().refreshSessions(),i().refreshOpen()]);i().projectId===d&&e({health:p}),d!==fi&&ve.openedProject(d).catch(()=>{})}catch(p){if(i().projectId!==d)return;/no such project/i.test(p.message)?(i().notify(`The hub has no project '${d}'. Open its folder again from here.`,"error"),i().openProject(fi)):i().notify(`Could not open the project: ${p.message}`,"error")}};return{health:null,switching:null,sessions:[],open:[],...Ey(),ticks:{...mT},transcriptTicks:{},toast:null,boot:async()=>{window.addEventListener("hashchange",()=>{const u=Ey(),f=u.projectId!==i().projectId;if(f&&u.projectId&&i().health)return void s(u.projectId,u);r=null,e({view:u.view,windowed:u.windowed,switching:null}),f&&l(u.projectId)}),Jo==null||Jo.close(),Jo=new EventSource("/api/stream");const d=new Set;let p=null;const a=()=>{p=null;const u={...i().ticks},f={...i().transcriptTicks};for(const c of d)c.startsWith("transcript:")?f[c.slice(11)]=Date.now():u[c]+=1;const g=new Set(d);d.clear(),e({ticks:u,transcriptTicks:f}),i().projectId&&((g.has("sessions")||g.has("transcript")||g.has("interactions"))&&i().refreshSessions(),g.has("interactions")&&i().refreshOpen())};Jo.onmessage=u=>{const f=JSON.parse(u.data);f.project&&f.project!==i().projectId?d.add("projects"):(d.add(f.topic==="transcript"?`transcript:${f.payload.sessionId}`:f.topic),f.topic==="transcript"&&d.add("transcript")),p??(p=setTimeout(a,400))},Jo.onopen=()=>{i().projectId&&(i().refreshSessions(),i().refreshOpen())},await l(i().projectId)},go:d=>{window.location.hash=la(i().projectId,d,i().windowed).slice(1),e({view:d})},openProject:d=>{const p=a=>{const u=la(d,a,!1);window.location.hash===u&&d&&d!==i().projectId&&(i().health?s(d,{view:a,windowed:!1}):l(d)),window.location.hash=u.slice(1)};if(!d||d===fi||d===i().projectId)return p({kind:"page",page:"overview"});ve.sessionsIn(d).then(a=>{const u=fT(a);if(!u)return p({kind:"page",page:"overview"});p({kind:"session",id:u.id})},()=>p({kind:"page",page:"overview"}))},openSessionIn:(d,p)=>{if(d===i().projectId)return i().go({kind:"session",id:p});window.location.hash=la(d,{kind:"session",id:p},!1).slice(1)},refreshSessions:async()=>{const d=i().projectId;if(!d)return;const p=await ve.sessions();i().projectId===d&&e({sessions:p})},refreshOpen:async()=>{const d=i().projectId;if(!d)return;const p=await ve.interactions("open");i().projectId===d&&e({open:p})},notify:(d,p="info")=>{Fp&&clearTimeout(Fp),e({toast:{text:d,tone:p}}),Fp=setTimeout(()=>e({toast:null}),p==="error"?6e3:3e3)}}});function ct(e,i,r=null){const s=ge(c=>i.map(_=>c.ticks[_]).join(",")),[l,d]=P.useState(null),[p,a]=P.useState(null),[u,f]=P.useState(0);P.useEffect(()=>{let c=!1;return e().then(_=>{c||(d(_),a(null))},_=>!c&&a(_.message)),()=>{c=!0}},[s,u,JSON.stringify(r)]);const g=P.useCallback(()=>f(c=>c+1),[]);return{data:l,error:p,reload:g}}async function it(e,i){try{const r=await e();return i&&ge.getState().notify(i),r}catch(r){ge.getState().notify(r.message,"error");return}}function io(){const e=ge(l=>l.go),[i,r]=P.useState(!1);return{starting:i,start:async(l,d)=>{if(i)return;r(!0);const p=Math.max(80,Math.floor((window.innerWidth-340)/7.8)),a=Math.max(24,Math.floor((window.innerHeight-220)/17)),u=await it(()=>ve.startPurpose(l,d,{cols:p,rows:a}));r(!1),u&&(await ge.getState().refreshSessions(),e({kind:"session",id:u.sessionId}))}}}const ky=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ty=Xw,gT=(e,i)=>r=>{var s;if((i==null?void 0:i.variants)==null)return Ty(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:l,defaultVariants:d}=i,p=Object.keys(l).map(f=>{const g=r==null?void 0:r[f],c=d==null?void 0:d[f];if(g===null)return null;const _=ky(g)||ky(c);return l[f][_]}),a=r&&Object.entries(r).reduce((f,g)=>{let[c,_]=g;return _===void 0||(f[c]=_),f},{}),u=i==null||(s=i.compoundVariants)===null||s===void 0?void 0:s.reduce((f,g)=>{let{class:c,className:_,...x}=g;return Object.entries(x).every(C=>{let[y,m]=C;return Array.isArray(m)?m.includes({...d,...a}[y]):{...d,...a}[y]===m})?[...f,c,_]:f},[]);return Ty(e,p,u,r==null?void 0:r.class,r==null?void 0:r.className)},vT=gT("inline-flex items-center justify-center gap-1.5 font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed shrink-0",{variants:{variant:{foreground:"bg-foreground text-background hover:bg-foreground/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",muted:"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground",ghost:"text-muted-foreground hover:bg-muted hover:text-foreground",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",success:"bg-success text-success-foreground hover:bg-success/90"},size:{sm:"text-xs px-3 py-1.5 rounded",md:"text-sm px-4 py-2 rounded-md",lg:"text-base px-5 py-2.5 rounded-md",icon:"p-1.5 rounded-md"}},defaultVariants:{variant:"muted",size:"sm"}}),xe=P.forwardRef(({className:e,variant:i,size:r,...s},l)=>v.jsx("button",{ref:l,className:ye(vT({variant:i,size:r}),e),...s}));xe.displayName="Button";var _T=Object.defineProperty,Sa=(e,i)=>_T(e,"name",{value:i,configurable:!0}),oS=!!(typeof window<"u"&&window.document&&window.document.createElement);function tt(e,i,{checkForDefaultPrevented:r=!0}={}){return Sa(function(l){if(e==null||e(l),r===!1||!l||!l.defaultPrevented)return i==null?void 0:i(l)},"handleEvent")}Sa(tt,"composeEventHandlers");function xT(e){var i;if(!oS)throw new Error("Cannot access window outside of the DOM");return((i=e==null?void 0:e.ownerDocument)==null?void 0:i.defaultView)??window}Sa(xT,"getOwnerWindow");function Rm(e){if(!oS)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Sa(Rm,"getOwnerDocument");function aS(e,i=!1){const{activeElement:r}=Rm(e);if(!(r!=null&&r.nodeName))return null;if(lS(r)&&r.contentDocument)return aS(r.contentDocument.body,i);if(i){const s=r.getAttribute("aria-activedescendant");if(s){const l=Rm(r).getElementById(s);if(l)return l}}return r}Sa(aS,"getActiveElement");function lS(e){return e.tagName==="IFRAME"}Sa(lS,"isFrame");var yT=Object.defineProperty,Eg=(e,i)=>yT(e,"name",{value:i,configurable:!0});function Am(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}Eg(Am,"setRef");function cS(...e){return i=>{let r=!1;const s=e.map(l=>{const d=Am(l,i);return!r&&typeof d=="function"&&(r=!0),d});if(r)return()=>{for(let l=0;l<s.length;l++){const d=s[l];typeof d=="function"?d():Am(e[l],null)}}}}Eg(cS,"composeRefs");function ht(...e){return P.useCallback(cS(...e),e)}Eg(ht,"useComposedRefs");var bT=Object.defineProperty,pi=(e,i)=>bT(e,"name",{value:i,configurable:!0});function wT(e,i){const r=P.createContext(i);r.displayName=e+"Context";const s=pi(d=>{const{children:p,...a}=d,u=P.useMemo(()=>a,Object.values(a));return v.jsx(r.Provider,{value:u,children:p})},"Provider");s.displayName=e+"Provider";function l(d,p={}){const{optional:a=!1}=p,u=P.useContext(r);if(u)return u;if(i!==void 0)return i;if(!a)throw new Error(`\`${d}\` must be used within \`${e}\``)}return pi(l,"useContext"),[s,l]}pi(wT,"createContext");function br(e,i=[]){let r=[];function s(d,p){const a=P.createContext(p);a.displayName=d+"Context";const u=r.length;r=[...r,p];const f=pi(c=>{var b;const{scope:_,children:x,...C}=c,y=((b=_==null?void 0:_[e])==null?void 0:b[u])||a,m=P.useMemo(()=>C,Object.values(C));return v.jsx(y.Provider,{value:m,children:x})},"Provider");f.displayName=d+"Provider";function g(c,_,x={}){var b;const{optional:C=!1}=x,y=((b=_==null?void 0:_[e])==null?void 0:b[u])||a,m=P.useContext(y);if(m)return m;if(p!==void 0)return p;if(!C)throw new Error(`\`${c}\` must be used within \`${d}\``)}return pi(g,"useContext"),[f,g]}pi(s,"createContext");const l=pi(()=>{const d=r.map(p=>P.createContext(p));return pi(function(a){const u=(a==null?void 0:a[e])||d;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])},"useScope")},"createScope");return l.scopeName=e,[s,uS(l,...i)]}pi(br,"createContextScope");function uS(...e){const i=e[0];if(e.length===1)return i;const r=pi(()=>{const s=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return pi(function(d){const p=s.reduce((a,{useScope:u,scopeName:f})=>{const c=u(d)[`__scope${f}`];return{...a,...c}},{});return P.useMemo(()=>({[`__scope${i.scopeName}`]:p}),[p])},"useComposedScopes")},"createScope");return r.scopeName=i.scopeName,r}pi(uS,"composeContextScopes");var $t=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},ST=Object.defineProperty,CT=(e,i)=>ST(e,"name",{value:i,configurable:!0}),ET=_a[" useId ".trim().toString()]||(()=>{}),kT=0;function Ui(e){const[i,r]=P.useState(ET());return $t(()=>{e||r(s=>s??String(kT++))},[e]),e||(i?`radix-${i}`:"")}CT(Ui,"useId");var TT=Object.defineProperty,RT=(e,i)=>TT(e,"name",{value:i,configurable:!0}),Ry=_a[" useEffectEvent ".trim().toString()],Ay=_a[" useInsertionEffect ".trim().toString()];function hS(e){if(typeof Ry=="function")return Ry(e);const i=P.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ay=="function"?Ay(()=>{i.current=e}):$t(()=>{i.current=e}),P.useMemo(()=>((...r)=>{var s;return(s=i.current)==null?void 0:s.call(i,...r)}),[])}RT(hS,"useEffectEvent");var AT=Object.defineProperty,Zl=(e,i)=>AT(e,"name",{value:i,configurable:!0}),DT=_a[" useInsertionEffect ".trim().toString()]||$t;function Qs({prop:e,defaultProp:i,onChange:r=Zl(()=>{},"onChange"),caller:s}){const[l,d,p]=dS({defaultProp:i,onChange:r}),a=e!==void 0,u=a?e:l,f=P.useCallback(g=>{var c;if(a){const _=fS(g)?g(e):g;_!==e&&((c=p.current)==null||c.call(p,_))}else d(g)},[a,e,d,p]);return[u,f]}Zl(Qs,"useControllableState");function dS({defaultProp:e,onChange:i}){const[r,s]=P.useState(e),l=P.useRef(r),d=P.useRef(i);return DT(()=>{d.current=i},[i]),P.useEffect(()=>{var p;l.current!==r&&((p=d.current)==null||p.call(d,r),l.current=r)},[r,l]),[r,s,d]}Zl(dS,"useUncontrolledState");function fS(e){return typeof e=="function"}Zl(fS,"isFunction");var Dy=Symbol("RADIX:SYNC_STATE");function LT(e,i,r,s){const{prop:l,defaultProp:d,onChange:p,caller:a}=i,u=l!==void 0,f=hS(p),g=[{...r,state:d}];s&&g.push(s);const[c,_]=P.useReducer((m,b)=>{if(b.type===Dy)return{...m,state:b.state};const S=e(m,b);return u&&!Object.is(S.state,m.state)&&f(S.state),S},...g),x=c.state,C=P.useRef(x);P.useEffect(()=>{C.current!==x&&(C.current=x,u||f(x))},[x,C,u]);const y=P.useMemo(()=>l!==void 0?{...c,state:l}:c,[c,l]);return P.useEffect(()=>{u&&!Object.is(l,c.state)&&_({type:Dy,state:l})},[l,c.state,u]),[y,_]}Zl(LT,"useControllableStateReducer");var Jl=Lw(),MT=Object.defineProperty,Jn=(e,i)=>MT(e,"name",{value:i,configurable:!0});function gr(e){const i=P.forwardRef((r,s)=>{let{children:l,...d}=r,p=null,a=!1;const u=[];l=yS(l),P.Children.forEach(l,_=>{var x;if(_S(_)){a=!0;const C=_;let y="child"in C.props?C.props.child:C.props.children;for(;kg(y)&&typeof uh=="function";)y=uh(y._payload);p=jT(C,y),u.push((x=p==null?void 0:p.props)==null?void 0:x.children)}else u.push(_)}),p?p=P.cloneElement(p,void 0,u):!a&&P.Children.count(l)===1&&P.isValidElement(l)&&(p=l);const f=p?vS(p):void 0,g=ht(s,f);if(!p){if(l||l===0)throw new Error(a?BT(e):NT(e));return l}const c=gS(d,p.props??{});return p.type!==P.Fragment&&(c.ref=s?g:f),P.cloneElement(p,c)});return i.displayName=`${e}.Slot`,i}Jn(gr,"createSlot");var pS=Symbol.for("radix.slottable");function mS(e){const i=Jn(r=>"child"in r?r.children(r.child):r.children,"Slottable");return i.displayName=`${e}.Slottable`,i.__radixId=pS,i}Jn(mS,"createSlottable");var jT=Jn((e,i)=>"child"in e.props?P.isValidElement(i)?P.cloneElement(i,void 0,e.props.children(i.props.children)):null:P.isValidElement(i)?i:null,"getSlottableElementFromSlottable");function gS(e,i){const r={...i};for(const s in i){const l=e[s],d=i[s];/^on[A-Z]/.test(s)?l&&d?r[s]=(...a)=>{const u=d(...a);return l(...a),u}:l&&(r[s]=l):s==="style"?r[s]={...l,...d}:s==="className"?r[s]=[l,d].filter(Boolean).join(" "):s==="aria-describedby"&&(r[s]=bS(d,l))}return{...e,...r}}Jn(gS,"mergeProps");function vS(e){var s,l;let i=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=i&&"isReactWarning"in i&&i.isReactWarning;return r?e.ref:(i=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=i&&"isReactWarning"in i&&i.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}Jn(vS,"getElementRef");function _S(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pS}Jn(_S,"isSlottable");var OT=Symbol.for("react.lazy");function kg(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===OT&&"_payload"in e&&xS(e._payload)}Jn(kg,"isLazyComponent");function xS(e){return typeof e=="object"&&e!==null&&"then"in e}Jn(xS,"isPromiseLike");function yS(e){let i=e;for(;kg(i)&&typeof uh=="function";)i=uh(i._payload);return i}Jn(yS,"useUnwrappedLazy");function bS(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Jn(bS,"concatAriaDescribedby");var NT=Jn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),BT=Jn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),uh=_a[" use ".trim().toString()],PT=Object.defineProperty,IT=(e,i)=>PT(e,"name",{value:i,configurable:!0}),zT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],St=zT.reduce((e,i)=>{const r=gr(`Primitive.${i}`),s=P.forwardRef((l,d)=>{const{asChild:p,...a}=l,u=p?r:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(u,{...a,ref:d})});return s.displayName=`Primitive.${i}`,{...e,[i]:s}},{});function wS(e,i){e&&Jl.flushSync(()=>e.dispatchEvent(i))}IT(wS,"dispatchDiscreteCustomEvent");var HT=Object.defineProperty,FT=(e,i)=>HT(e,"name",{value:i,configurable:!0}),Ly=_a[" useInsertionEffect ".trim().toString()];function $i(e){const i=P.useRef(e);return typeof Ly=="function"?Ly(()=>{i.current=e}):$t(()=>{i.current=e}),P.useMemo(()=>((...r)=>{var s;return(s=i.current)==null?void 0:s.call(i,...r)}),[])}FT($i,"useCallbackRef");var UT=Object.defineProperty,tn=(e,i)=>UT(e,"name",{value:i,configurable:!0}),Dm="dismissableLayer.update",$T="dismissableLayer.pointerDownOutside",qT="dismissableLayer.focusOutside",My,SS=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Dh=P.forwardRef(tn(function(i,r){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:l=!1,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:a,onInteractOutside:u,onDismiss:f,...g}=i,c=P.useContext(SS),[_,x]=P.useState(null),C=(_==null?void 0:_.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=P.useState({}),m=ht(r,x),b=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=S?b.indexOf(S):-1,T=_?b.indexOf(_):-1,D=c.layersWithOutsidePointerEventsDisabled.size>0,R=T>=w,L=P.useRef(!1),A=ES(B=>{p==null||p(B),u==null||u(B),B.defaultPrevented||f==null||f()},{ownerDocument:C,deferPointerDownOutside:l,isDeferredPointerDownOutsideRef:L,dismissableSurfaces:c.dismissableSurfaces,shouldHandlePointerDownOutside:P.useCallback(B=>{if(!(B instanceof Node))return!1;const H=[...c.branches].some(F=>F.contains(B));return R&&!H},[c.branches,R])}),j=kS(B=>{if(l&&L.current)return;const H=B.target;[...c.branches].some(W=>W.contains(H))||(a==null||a(B),u==null||u(B),B.defaultPrevented||f==null||f())},C),M=_?T===b.length-1:!1,I=$i(B=>{B.key==="Escape"&&(d==null||d(B),!B.defaultPrevented&&f&&(B.preventDefault(),f()))});return P.useEffect(()=>{if(M)return C.addEventListener("keydown",I,{capture:!0}),()=>C.removeEventListener("keydown",I,{capture:!0})},[C,M,I]),P.useEffect(()=>{if(_)return s&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(My=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(_)),c.layers.add(_),Lm(),()=>{s&&(c.layersWithOutsidePointerEventsDisabled.delete(_),c.layersWithOutsidePointerEventsDisabled.size===0&&(C.body.style.pointerEvents=My))}},[_,C,s,c]),P.useEffect(()=>()=>{_&&(c.layers.delete(_),c.layersWithOutsidePointerEventsDisabled.delete(_),Lm())},[_,c]),P.useEffect(()=>{const B=tn(()=>y({}),"handleUpdate");return document.addEventListener(Dm,B),()=>document.removeEventListener(Dm,B)},[]),v.jsx(St.div,{...g,ref:m,style:{pointerEvents:D?R?"auto":"none":void 0,...i.style},onFocusCapture:tt(i.onFocusCapture,j.onFocusCapture),onBlurCapture:tt(i.onBlurCapture,j.onBlurCapture),onPointerDownCapture:tt(i.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function CS(){const e=P.useContext(SS),[i,r]=P.useState(null);return P.useEffect(()=>{if(i)return e.dismissableSurfaces.add(i),()=>{e.dismissableSurfaces.delete(i)}},[i,e.dismissableSurfaces]),r}tn(CS,"useDismissableLayerSurface");var VT=tn(()=>!0,"IS_TRUE");function ES(e,i){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:l,dismissableSurfaces:d,shouldHandlePointerDownOutside:p=VT}=i,a=$i(e),u=P.useRef(!1),f=P.useRef(!1),g=P.useRef(new Map),c=P.useRef(()=>{});return P.useEffect(()=>{function _(){f.current=!1,l.current=!1,g.current.clear()}tn(_,"resetOutsideInteraction");function x(){return Array.from(g.current.values()).some(Boolean)}tn(x,"isOutsideInteractionIntercepted");function C(w){if(!f.current)return;const T=w.target;T instanceof Node&&[...d].some(R=>R.contains(T))||g.current.set(w.type,!0),w.type==="click"&&window.setTimeout(()=>{f.current&&c.current()},0)}tn(C,"handleInteractionCapture");function y(w){f.current&&g.current.set(w.type,!1)}tn(y,"handleInteractionBubble");const m=tn(w=>{if(w.target&&!u.current){let T=function(){r.removeEventListener("click",c.current);const R=x();_(),R||Tg($T,a,D,{discrete:!0})};if(tn(T,"handleAndDispatchPointerDownOutsideEvent"),!p(w.target)){r.removeEventListener("click",c.current),_(),u.current=!1;return}const D={originalEvent:w};f.current=!0,l.current=s&&w.button===0,g.current.clear(),!s||w.button!==0?T():(r.removeEventListener("click",c.current),c.current=T,r.addEventListener("click",c.current,{once:!0}))}else r.removeEventListener("click",c.current),_();u.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const w of b)r.addEventListener(w,C,!0),r.addEventListener(w,y);const S=window.setTimeout(()=>{r.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(S),r.removeEventListener("pointerdown",m),r.removeEventListener("click",c.current);for(const w of b)r.removeEventListener(w,C,!0),r.removeEventListener(w,y)}},[r,a,s,l,d,p]),{onPointerDownCapture:tn(()=>u.current=!0,"onPointerDownCapture")}}tn(ES,"usePointerDownOutside");function kS(e,i=globalThis==null?void 0:globalThis.document){const r=$i(e),s=P.useRef(!1);return P.useEffect(()=>{const l=tn(d=>{d.target&&!s.current&&Tg(qT,r,{originalEvent:d},{discrete:!1})},"handleFocus");return i.addEventListener("focusin",l),()=>i.removeEventListener("focusin",l)},[i,r]),{onFocusCapture:tn(()=>s.current=!0,"onFocusCapture"),onBlurCapture:tn(()=>s.current=!1,"onBlurCapture")}}tn(kS,"useFocusOutside");function Lm(){const e=new CustomEvent(Dm);document.dispatchEvent(e)}tn(Lm,"dispatchUpdate");function Tg(e,i,r,{discrete:s}){const l=r.originalEvent.target,d=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});i&&l.addEventListener(e,i,{once:!0}),s?wS(l,d):l.dispatchEvent(d)}tn(Tg,"handleAndDispatchCustomEvent");var WT=Object.defineProperty,Ft=(e,i)=>WT(e,"name",{value:i,configurable:!0}),Up="focusScope.autoFocusOnMount",$p="focusScope.autoFocusOnUnmount",jy={bubbles:!1,cancelable:!0},Rg=P.forwardRef(Ft(function(i,r){const{loop:s=!1,trapped:l=!1,branches:d,onMountAutoFocus:p,onUnmountAutoFocus:a,...u}=i,[f,g]=P.useState(null),c=$i(p),_=$i(a),x=P.useRef(null),C=ht(r,g),y=P.useRef(d);P.useEffect(()=>{y.current=d});const m=P.useCallback(w=>{var T;return w?f!=null&&f.contains(w)?!0:!!((T=y.current)!=null&&T.some(D=>D.contains(w))):!1},[f]),b=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(l){let w=function(L){if(b.paused||!f)return;const A=L.target;m(A)?x.current=A:ur(x.current,{select:!0})},T=function(L){if(b.paused||!f)return;const A=L.relatedTarget;A!==null&&(m(A)||ur(x.current,{select:!0}))},D=function(L){if(document.activeElement===document.body)for(const j of L)j.removedNodes.length>0&&ur(f)};Ft(w,"handleFocusIn"),Ft(T,"handleFocusOut"),Ft(D,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",T);const R=new MutationObserver(D);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",T),R.disconnect()}}},[l,f,b.paused,m]),P.useEffect(()=>{if(f){Oy.add(b);const w=document.activeElement;if(!f.contains(w)){const D=new CustomEvent(Up,jy);f.addEventListener(Up,c),f.dispatchEvent(D),D.defaultPrevented||(RS(jS(Mg(f)),{select:!0}),document.activeElement===w&&ur(f))}return()=>{f.removeEventListener(Up,c);const D=f.ownerDocument,R=CustomEvent;setTimeout(()=>{const L=new R($p,jy);f.addEventListener($p,_),f.dispatchEvent(L),L.defaultPrevented||ur(w??D.body,{select:!0}),f.removeEventListener($p,_),Oy.remove(b)},0)}}},[f,c,_,b]);const S=P.useCallback(w=>{if(!s&&!l||b.paused)return;const T=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,D=document.activeElement;if(T&&D){const R=w.currentTarget,[L,A]=AS(R);L&&A?!w.shiftKey&&D===A?(w.preventDefault(),s&&ur(L,{select:!0})):w.shiftKey&&D===L&&(w.preventDefault(),s&&ur(A,{select:!0})):D===R&&w.preventDefault()}},[s,l,b.paused]);return v.jsx(St.div,{tabIndex:-1,...u,ref:C,onKeyDown:S})},"FocusScope")),TS=P.createContext(null);function Ag({registry:e,children:i}){return e?v.jsx(TS.Provider,{value:e,children:i}):i}Ft(Ag,"FocusScopeBranchProvider");function Dg(){const[e,i]=P.useState([]),r=P.useMemo(()=>({add:Ft(s=>i(l=>l.includes(s)?l:[...l,s]),"add"),remove:Ft(s=>i(l=>l.filter(d=>d!==s)),"remove")}),[]);return{nodes:e,registry:r}}Ft(Dg,"useFocusScopeBranchRegistry");function Lg(e){const i=P.useContext(TS);P.useEffect(()=>{if(!(!e||!i))return i.add(e),()=>i.remove(e)},[e,i])}Ft(Lg,"useFocusScopeBranch");function RS(e,{select:i=!1}={}){const r=document.activeElement;for(const s of e)if(ur(s,{select:i}),document.activeElement!==r)return}Ft(RS,"focusFirst");function AS(e){const i=Mg(e),r=Mm(i,e),s=Mm(i.reverse(),e);return[r,s]}Ft(AS,"getTabbableEdges");function Mg(e){const i=[],s=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ft(l=>{const d=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||d?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;s.nextNode();)i.push(s.currentNode);return i}Ft(Mg,"getTabbableCandidates");function Mm(e,i){const r=typeof i.checkVisibility=="function"&&i.checkVisibility({checkVisibilityCSS:!0});for(const s of e)if(!(r?!s.checkVisibility({checkVisibilityCSS:!0}):DS(s,{upTo:i})))return s}Ft(Mm,"findVisible");function DS(e,{upTo:i}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(i!==void 0&&e===i)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Ft(DS,"isHidden");function LS(e){return e.tagName==="INPUT"&&typeof e.select=="function"}Ft(LS,"isSelectableInput");function ur(e,{select:i=!1}={}){if(e&&e.focus){const s=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==s&&LS(e)&&i&&e.select()}}Ft(ur,"focus");var Oy=MS();function MS(){let e=[];return{add(i){const r=e[0];i!==r&&(r==null||r.pause()),e=jm(e,i),e.unshift(i)},remove(i){var r;e=jm(e,i),(r=e[0])==null||r.resume()}}}Ft(MS,"createFocusScopesStack");function jm(e,i){const r=[...e],s=r.indexOf(i);return s!==-1&&r.splice(s,1),r}Ft(jm,"arrayRemove");function jS(e){return e.filter(i=>i.tagName!=="A")}Ft(jS,"removeLinks");var GT=Object.defineProperty,YT=(e,i)=>GT(e,"name",{value:i,configurable:!0}),Lh=P.forwardRef(YT(function(i,r){var u;const{container:s,...l}=i,[d,p]=P.useState(!1);$t(()=>p(!0),[]);const a=s||d&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return a?Jl.createPortal(v.jsx(St.div,{...l,ref:r}),a):null},"Portal")),KT=Object.defineProperty,vr=(e,i)=>KT(e,"name",{value:i,configurable:!0});function OS(e,i){return P.useReducer((r,s)=>i[r][s]??r,e)}vr(OS,"useStateMachine");var wr=vr(e=>{const{present:i,children:r}=e,s=NS(i),l=typeof r=="function"?r({present:s.isPresent}):P.Children.only(r),d=BS(s.ref,PS(l));return typeof r=="function"||s.isPresent?P.cloneElement(l,{ref:d}):null},"Presence");function NS(e){const[i,r]=P.useState(),s=P.useRef(null),l=P.useRef(e),d=P.useRef("none"),p=P.useRef(void 0),a=e?"mounted":"unmounted",[u,f]=OS(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{u==="mounted"?(d.current=p.current??sa(s.current),p.current=void 0):d.current="none"},[u]),$t(()=>{const g=s.current,c=l.current;if(c!==e){const x=d.current,C=sa(g);e?(p.current=C,f("MOUNT")):C==="none"||(g==null?void 0:g.display)==="none"?f("UNMOUNT"):f(c&&x!==C?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,f]),$t(()=>{if(i){let g;const c=i.ownerDocument.defaultView??window,_=vr(C=>{const m=sa(s.current).includes(CSS.escape(C.animationName));if(C.target===i&&m&&(f("ANIMATION_END"),!l.current)){const b=i.style.animationFillMode;i.style.animationFillMode="forwards",g=c.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=b)})}},"handleAnimationEnd"),x=vr(C=>{C.target===i&&(d.current=sa(s.current))},"handleAnimationStart");return i.addEventListener("animationstart",x),i.addEventListener("animationcancel",_),i.addEventListener("animationend",_),()=>{c.clearTimeout(g),i.removeEventListener("animationstart",x),i.removeEventListener("animationcancel",_),i.removeEventListener("animationend",_)}}else f("ANIMATION_END")},[i,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:P.useCallback(g=>{if(g){const c=getComputedStyle(g);s.current=c,p.current=sa(c)}else s.current=null;r(g)},[])}}vr(NS,"usePresence");function Om(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}vr(Om,"setRef");function BS(...e){const i=P.useRef(e);return i.current=e,P.useCallback(r=>{const s=i.current;let l=!1;const d=s.map(p=>{const a=Om(p,r);return!l&&typeof a=="function"&&(l=!0),a});if(l)return()=>{for(let p=0;p<d.length;p++){const a=d[p];typeof a=="function"?a():Om(s[p],null)}}},[])}vr(BS,"useStableComposedRefs");function sa(e){return(e==null?void 0:e.animationName)||"none"}vr(sa,"getAnimationName");function PS(e){var s,l;let i=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=i&&"isReactWarning"in i&&i.isReactWarning;return r?e.ref:(i=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=i&&"isReactWarning"in i&&i.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}vr(PS,"getElementRef");var XT=Object.defineProperty,jg=(e,i)=>XT(e,"name",{value:i,configurable:!0}),Iu=0,Ii=null;function QT(e){return ec(),e.children}jg(QT,"FocusGuards");function ec(){P.useEffect(()=>{Ii||(Ii={start:Nm(),end:Nm()});const{start:e,end:i}=Ii;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==i&&document.body.insertAdjacentElement("beforeend",i),Iu++,()=>{Iu===1&&(Ii==null||Ii.start.remove(),Ii==null||Ii.end.remove(),Ii=null),Iu=Math.max(0,Iu-1)}},[])}jg(ec,"useFocusGuards");function Nm(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}jg(Nm,"createFocusGuard");var Hi=function(){return Hi=Object.assign||function(i){for(var r,s=1,l=arguments.length;s<l;s++){r=arguments[s];for(var d in r)Object.prototype.hasOwnProperty.call(r,d)&&(i[d]=r[d])}return i},Hi.apply(this,arguments)};function IS(e,i){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,s=Object.getOwnPropertySymbols(e);l<s.length;l++)i.indexOf(s[l])<0&&Object.prototype.propertyIsEnumerable.call(e,s[l])&&(r[s[l]]=e[s[l]]);return r}function ZT(e,i,r){if(r||arguments.length===2)for(var s=0,l=i.length,d;s<l;s++)(d||!(s in i))&&(d||(d=Array.prototype.slice.call(i,0,s)),d[s]=i[s]);return e.concat(d||Array.prototype.slice.call(i))}var Ju="right-scroll-bar-position",eh="width-before-scroll-bar",JT="with-scroll-bars-hidden",eR="--removed-body-scroll-bar-size";function qp(e,i){return typeof e=="function"?e(i):e&&(e.current=i),e}function tR(e,i){var r=P.useState(function(){return{value:e,callback:i,facade:{get current(){return r.value},set current(s){var l=r.value;l!==s&&(r.value=s,r.callback(s,l))}}}})[0];return r.callback=i,r.facade}var nR=typeof window<"u"?P.useLayoutEffect:P.useEffect,Ny=new WeakMap;function iR(e,i){var r=tR(null,function(s){return e.forEach(function(l){return qp(l,s)})});return nR(function(){var s=Ny.get(r);if(s){var l=new Set(s),d=new Set(e),p=r.current;l.forEach(function(a){d.has(a)||qp(a,null)}),d.forEach(function(a){l.has(a)||qp(a,p)})}Ny.set(r,e)},[e]),r}function rR(e){return e}function sR(e,i){i===void 0&&(i=rR);var r=[],s=!1,l={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(d){var p=i(d,s);return r.push(p),function(){r=r.filter(function(a){return a!==p})}},assignSyncMedium:function(d){for(s=!0;r.length;){var p=r;r=[],p.forEach(d)}r={push:function(a){return d(a)},filter:function(){return r}}},assignMedium:function(d){s=!0;var p=[];if(r.length){var a=r;r=[],a.forEach(d),p=r}var u=function(){var g=p;p=[],g.forEach(d)},f=function(){return Promise.resolve().then(u)};f(),r={push:function(g){p.push(g),f()},filter:function(g){return p=p.filter(g),r}}}};return l}function oR(e){e===void 0&&(e={});var i=sR(null);return i.options=Hi({async:!0,ssr:!1},e),i}var zS=function(e){var i=e.sideCar,r=IS(e,["sideCar"]);if(!i)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=i.read();if(!s)throw new Error("Sidecar medium not found");return P.createElement(s,Hi({},r))};zS.isSideCarExport=!0;function aR(e,i){return e.useMedium(i),zS}var HS=oR(),Vp=function(){},Mh=P.forwardRef(function(e,i){var r=P.useRef(null),s=P.useState({onScrollCapture:Vp,onWheelCapture:Vp,onTouchMoveCapture:Vp}),l=s[0],d=s[1],p=e.forwardProps,a=e.children,u=e.className,f=e.removeScrollBar,g=e.enabled,c=e.shards,_=e.sideCar,x=e.noRelative,C=e.noIsolation,y=e.inert,m=e.allowPinchZoom,b=e.as,S=b===void 0?"div":b,w=e.gapMode,T=IS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=_,R=iR([r,i]),L=Hi(Hi({},T),l);return P.createElement(P.Fragment,null,g&&P.createElement(D,{sideCar:HS,removeScrollBar:f,shards:c,noRelative:x,noIsolation:C,inert:y,setCallbacks:d,allowPinchZoom:!!m,lockRef:r,gapMode:w}),p?P.cloneElement(P.Children.only(a),Hi(Hi({},L),{ref:R})):P.createElement(S,Hi({},L,{className:u,ref:R}),a))});Mh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mh.classNames={fullWidth:eh,zeroRight:Ju};var lR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var i=lR();return i&&e.setAttribute("nonce",i),e}function uR(e,i){e.styleSheet?e.styleSheet.cssText=i:e.appendChild(document.createTextNode(i))}function hR(e){var i=document.head||document.getElementsByTagName("head")[0];i.appendChild(e)}var dR=function(){var e=0,i=null;return{add:function(r){e==0&&(i=cR())&&(uR(i,r),hR(i)),e++},remove:function(){e--,!e&&i&&(i.parentNode&&i.parentNode.removeChild(i),i=null)}}},fR=function(){var e=dR();return function(i,r){P.useEffect(function(){return e.add(i),function(){e.remove()}},[i&&r])}},FS=function(){var e=fR(),i=function(r){var s=r.styles,l=r.dynamic;return e(s,l),null};return i},pR={left:0,top:0,right:0,gap:0},Wp=function(e){return parseInt(e||"",10)||0},mR=function(e){var i=window.getComputedStyle(document.body),r=i[e==="padding"?"paddingLeft":"marginLeft"],s=i[e==="padding"?"paddingTop":"marginTop"],l=i[e==="padding"?"paddingRight":"marginRight"];return[Wp(r),Wp(s),Wp(l)]},gR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pR;var i=mR(e),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:i[0],top:i[1],right:i[2],gap:Math.max(0,s-r+i[2]-i[0])}},vR=FS(),ha="data-scroll-locked",_R=function(e,i,r,s){var l=e.left,d=e.top,p=e.right,a=e.gap;return r===void 0&&(r="margin"),`
486
- .`.concat(JT,` {
487
- overflow: hidden `).concat(s,`;
488
- padding-right: `).concat(a,"px ").concat(s,`;
489
- }
490
- body[`).concat(ha,`] {
491
- overflow: hidden `).concat(s,`;
492
- overscroll-behavior: contain;
493
- `).concat([i&&"position: relative ".concat(s,";"),r==="margin"&&`
494
- padding-left: `.concat(l,`px;
495
- padding-top: `).concat(d,`px;
496
- padding-right: `).concat(p,`px;
497
- margin-left:0;
498
- margin-top:0;
499
- margin-right: `).concat(a,"px ").concat(s,`;
500
- `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(s,";")].filter(Boolean).join(""),`
501
- }
502
-
503
- .`).concat(Ju,` {
504
- right: `).concat(a,"px ").concat(s,`;
505
- }
506
-
507
- .`).concat(eh,` {
508
- margin-right: `).concat(a,"px ").concat(s,`;
509
- }
510
-
511
- .`).concat(Ju," .").concat(Ju,` {
512
- right: 0 `).concat(s,`;
513
- }
514
-
515
- .`).concat(eh," .").concat(eh,` {
516
- margin-right: 0 `).concat(s,`;
517
- }
518
-
519
- body[`).concat(ha,`] {
520
- `).concat(eR,": ").concat(a,`px;
521
- }
522
- `)},By=function(){var e=parseInt(document.body.getAttribute(ha)||"0",10);return isFinite(e)?e:0},xR=function(){P.useEffect(function(){return document.body.setAttribute(ha,(By()+1).toString()),function(){var e=By()-1;e<=0?document.body.removeAttribute(ha):document.body.setAttribute(ha,e.toString())}},[])},yR=function(e){var i=e.noRelative,r=e.noImportant,s=e.gapMode,l=s===void 0?"margin":s;xR();var d=P.useMemo(function(){return gR(l)},[l]);return P.createElement(vR,{styles:_R(d,!i,l,r?"":"!important")})},Bm=!1;if(typeof window<"u")try{var zu=Object.defineProperty({},"passive",{get:function(){return Bm=!0,!0}});window.addEventListener("test",zu,zu),window.removeEventListener("test",zu,zu)}catch{Bm=!1}var ea=Bm?{passive:!1}:!1,bR=function(e){return e.tagName==="TEXTAREA"},US=function(e,i){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[i]!=="hidden"&&!(r.overflowY===r.overflowX&&!bR(e)&&r[i]==="visible")},wR=function(e){return US(e,"overflowY")},SR=function(e){return US(e,"overflowX")},Py=function(e,i){var r=i.ownerDocument,s=i;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var l=$S(e,s);if(l){var d=qS(e,s),p=d[1],a=d[2];if(p>a)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},CR=function(e){var i=e.scrollTop,r=e.scrollHeight,s=e.clientHeight;return[i,r,s]},ER=function(e){var i=e.scrollLeft,r=e.scrollWidth,s=e.clientWidth;return[i,r,s]},$S=function(e,i){return e==="v"?wR(i):SR(i)},qS=function(e,i){return e==="v"?CR(i):ER(i)},kR=function(e,i){return e==="h"&&i==="rtl"?-1:1},TR=function(e,i,r,s,l){var d=kR(e,window.getComputedStyle(i).direction),p=d*s,a=r.target,u=i.contains(a),f=!1,g=p>0,c=0,_=0;do{if(!a)break;var x=qS(e,a),C=x[0],y=x[1],m=x[2],b=y-m-d*C;(C||b)&&$S(e,a)&&(c+=b,_+=C);var S=a.parentNode;a=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!u&&a!==document.body||u&&(i.contains(a)||i===a));return(g&&Math.abs(c)<1||!g&&Math.abs(_)<1)&&(f=!0),f},Hu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Iy=function(e){return[e.deltaX,e.deltaY]},zy=function(e){return e&&"current"in e?e.current:e},RR=function(e,i){return e[0]===i[0]&&e[1]===i[1]},AR=function(e){return`
523
- .block-interactivity-`.concat(e,` {pointer-events: none;}
524
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
525
- `)},DR=0,ta=[];function LR(e){var i=P.useRef([]),r=P.useRef([0,0]),s=P.useRef(),l=P.useState(DR++)[0],d=P.useState(FS)[0],p=P.useRef(e);P.useEffect(function(){p.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var y=ZT([e.lockRef.current],(e.shards||[]).map(zy),!0).filter(Boolean);return y.forEach(function(m){return m.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),y.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(y,m){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!p.current.allowPinchZoom;var b=Hu(y),S=r.current,w="deltaX"in y?y.deltaX:S[0]-b[0],T="deltaY"in y?y.deltaY:S[1]-b[1],D,R=y.target,L=Math.abs(w)>Math.abs(T)?"h":"v";if("touches"in y&&L==="h"&&R.type==="range")return!1;var A=window.getSelection(),j=A&&A.anchorNode,M=j?j===R||j.contains(R):!1;if(M)return!1;var I=Py(L,R);if(!I)return!0;if(I?D=L:(D=L==="v"?"h":"v",I=Py(L,R)),!I)return!1;if(!s.current&&"changedTouches"in y&&(w||T)&&(s.current=D),!D)return!0;var B=s.current||D;return TR(B,m,y,B==="h"?w:T)},[]),u=P.useCallback(function(y){var m=y;if(!(!ta.length||ta[ta.length-1]!==d)){var b="deltaY"in m?Iy(m):Hu(m),S=i.current.filter(function(D){return D.name===m.type&&(D.target===m.target||m.target===D.shadowParent)&&RR(D.delta,b)})[0];if(S&&S.should){m.cancelable&&m.preventDefault();return}if(!S){var w=(p.current.shards||[]).map(zy).filter(Boolean).filter(function(D){return D.contains(m.target)}),T=w.length>0?a(m,w[0]):!p.current.noIsolation;T&&m.cancelable&&m.preventDefault()}}},[]),f=P.useCallback(function(y,m,b,S){var w={name:y,delta:m,target:b,should:S,shadowParent:MR(b)};i.current.push(w),setTimeout(function(){i.current=i.current.filter(function(T){return T!==w})},1)},[]),g=P.useCallback(function(y){r.current=Hu(y),s.current=void 0},[]),c=P.useCallback(function(y){f(y.type,Iy(y),y.target,a(y,e.lockRef.current))},[]),_=P.useCallback(function(y){f(y.type,Hu(y),y.target,a(y,e.lockRef.current))},[]);P.useEffect(function(){return ta.push(d),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:_}),document.addEventListener("wheel",u,ea),document.addEventListener("touchmove",u,ea),document.addEventListener("touchstart",g,ea),function(){ta=ta.filter(function(y){return y!==d}),document.removeEventListener("wheel",u,ea),document.removeEventListener("touchmove",u,ea),document.removeEventListener("touchstart",g,ea)}},[]);var x=e.removeScrollBar,C=e.inert;return P.createElement(P.Fragment,null,C?P.createElement(d,{styles:AR(l)}):null,x?P.createElement(yR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function MR(e){for(var i=null;e!==null;)e instanceof ShadowRoot&&(i=e.host,e=e.host),e=e.parentNode;return i}const jR=aR(HS,LR);var jh=P.forwardRef(function(e,i){return P.createElement(Mh,Hi({},e,{ref:i,sideCar:jR}))});jh.classNames=Mh.classNames;var OR=function(e){if(typeof document>"u")return null;var i=Array.isArray(e)?e[0]:e;return i.ownerDocument.body},na=new WeakMap,Fu=new WeakMap,Uu={},Gp=0,VS=function(e){return e&&(e.host||VS(e.parentNode))},NR=function(e,i){return i.map(function(r){if(e.contains(r))return r;var s=VS(r);return s&&e.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},BR=function(e,i,r,s){var l=NR(i,Array.isArray(e)?e:[e]);Uu[r]||(Uu[r]=new WeakMap);var d=Uu[r],p=[],a=new Set,u=new Set(l),f=function(c){!c||a.has(c)||(a.add(c),f(c.parentNode))};l.forEach(f);var g=function(c){!c||u.has(c)||Array.prototype.forEach.call(c.children,function(_){if(a.has(_))g(_);else try{var x=_.getAttribute(s),C=x!==null&&x!=="false",y=(na.get(_)||0)+1,m=(d.get(_)||0)+1;na.set(_,y),d.set(_,m),p.push(_),y===1&&C&&Fu.set(_,!0),m===1&&_.setAttribute(r,"true"),C||_.setAttribute(s,"true")}catch(b){console.error("aria-hidden: cannot operate on ",_,b)}})};return g(i),a.clear(),Gp++,function(){p.forEach(function(c){var _=na.get(c)-1,x=d.get(c)-1;na.set(c,_),d.set(c,x),_||(Fu.has(c)||c.removeAttribute(s),Fu.delete(c)),x||c.removeAttribute(r)}),Gp--,Gp||(na=new WeakMap,na=new WeakMap,Fu=new WeakMap,Uu={})}},Og=function(e,i,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),l=OR(e);return l?(s.push.apply(s,Array.from(l.querySelectorAll("[aria-live], script"))),BR(s,l,r,"aria-hidden")):function(){return null}},PR=Object.defineProperty,Pn=(e,i)=>PR(e,"name",{value:i,configurable:!0}),Ng="Dialog",[WS,HB]=br(Ng),[IR,ki]=WS(Ng),GS=Pn(e=>{const{__scopeDialog:i,children:r,open:s,defaultOpen:l,onOpenChange:d,modal:p=!0}=e,a=P.useRef(null),u=P.useRef(null),{nodes:f,registry:g}=Dg(),[c,_]=Qs({prop:s,defaultProp:l??!1,onChange:d,caller:Ng}),[x,C]=P.useState(0),[y,m]=P.useState(0);return v.jsx(IR,{scope:i,triggerRef:a,contentRef:u,contentId:Ui(),titleId:Ui(),descriptionId:Ui(),titlePresent:x>0,descriptionPresent:y>0,setTitleCount:C,setDescriptionCount:m,open:c,onOpenChange:_,onOpenToggle:P.useCallback(()=>_(b=>!b),[_]),modal:p,branchNodes:f,branchRegistry:g,children:r})},"Dialog"),zR="DialogTrigger",HR=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,d=ki(zR,s),p=ht(r,d.triggerRef);return v.jsx(St.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":Oh(d.open),...l,ref:p,onClick:tt(i.onClick,d.onOpenToggle)})},"DialogTrigger")),YS="DialogPortal",[FR,KS]=WS(YS,{forceMount:void 0}),XS=Pn(e=>{const{__scopeDialog:i,forceMount:r,children:s,container:l}=e,d=ki(YS,i);return v.jsx(FR,{scope:i,forceMount:r,children:P.Children.map(s,p=>v.jsx(wr,{present:r||d.open,children:v.jsx(Lh,{asChild:!0,container:l,children:p})}))})},"DialogPortal"),Pm="DialogOverlay",QS=P.forwardRef(Pn(function(i,r){const s=KS(Pm,i.__scopeDialog),{forceMount:l=s.forceMount,...d}=i,p=ki(Pm,i.__scopeDialog);return p.modal?v.jsx(wr,{present:l||p.open,children:v.jsx($R,{...d,ref:r})}):null},"DialogOverlay")),UR=gr("DialogOverlay.RemoveScroll"),$R=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,d=ki(Pm,s),p=CS(),a=ht(r,p);return v.jsx(jh,{as:UR,allowPinchZoom:!0,shards:P.useMemo(()=>[d.contentRef,...d.branchNodes.map(u=>({current:u}))],[d.contentRef,d.branchNodes]),children:v.jsx(St.div,{"data-state":Oh(d.open),...l,ref:a,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),Il="DialogContent",ZS=P.forwardRef(Pn(function(i,r){const s=KS(Il,i.__scopeDialog),{forceMount:l=s.forceMount,...d}=i,p=ki(Il,i.__scopeDialog);return v.jsx(wr,{present:l||p.open,children:p.modal?v.jsx(qR,{...d,ref:r}):v.jsx(VR,{...d,ref:r})})},"DialogContent")),qR=P.forwardRef(Pn(function(i,r){const s=ki(Il,i.__scopeDialog),l=P.useRef(null),d=ht(r,s.contentRef,l);return P.useEffect(()=>{const p=l.current;if(p)return Og(p)},[]),v.jsx(JS,{...i,ref:d,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:tt(i.onCloseAutoFocus,p=>{var a;p.preventDefault(),(a=s.triggerRef.current)==null||a.focus()}),onPointerDownOutside:tt(i.onPointerDownOutside,p=>{const a=p.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&p.preventDefault()}),onFocusOutside:tt(i.onFocusOutside,p=>p.preventDefault())})},"DialogContentModal")),VR=P.forwardRef(Pn(function(i,r){const s=ki(Il,i.__scopeDialog),l=P.useRef(!1),d=P.useRef(!1);return v.jsx(JS,{...i,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var a,u;(a=i.onCloseAutoFocus)==null||a.call(i,p),p.defaultPrevented||(l.current||(u=s.triggerRef.current)==null||u.focus(),p.preventDefault()),l.current=!1,d.current=!1},onInteractOutside:p=>{var f,g;(f=i.onInteractOutside)==null||f.call(i,p),p.defaultPrevented||(l.current=!0,p.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const a=p.target;((g=s.triggerRef.current)==null?void 0:g.contains(a))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&d.current&&p.preventDefault()}})},"DialogContentNonModal")),JS=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,trapFocus:l,onOpenAutoFocus:d,onCloseAutoFocus:p,"aria-describedby":a,children:u,...f}=i,g=ki(Il,s);return ec(),v.jsx(Ag,{registry:g.branchRegistry,children:v.jsx(Rg,{asChild:!0,loop:!0,trapped:l,branches:g.branchNodes,onMountAutoFocus:d,onUnmountAutoFocus:p,children:v.jsx(Dh,{role:"dialog",id:g.contentId,"aria-labelledby":g.titlePresent?g.titleId:void 0,"aria-describedby":g.descriptionPresent?iC(a,g.descriptionId):a,"data-state":Oh(g.open),...f,ref:r,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1),children:u})})})},"DialogContentImpl")),eC=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,d=ki("DialogTitle",s),{setTitleCount:p}=d;return $t(()=>(p(a=>a+1),()=>p(a=>a-1)),[p]),v.jsx(St.h2,{id:d.titleId,...l,ref:r})},"DialogTitle")),tC=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,d=ki("DialogDescription",s),{setDescriptionCount:p}=d;return $t(()=>(p(a=>a+1),()=>p(a=>a-1)),[p]),v.jsx(St.p,{id:d.descriptionId,...l,ref:r})},"DialogDescription")),WR="DialogClose",nC=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,d=ki(WR,s);return v.jsx(St.button,{type:"button",...l,ref:r,onClick:tt(i.onClick,()=>d.onOpenChange(!1))})},"DialogClose"));function iC(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Pn(iC,"concatAriaDescribedby");function Oh(e){return e?"open":"closed"}Pn(Oh,"getState");function rC({open:e,onOpenChange:i,title:r,description:s,children:l,footer:d,headerAction:p,maxWidth:a="max-w-md",height:u,disableOutsideClose:f}){return v.jsx(GS,{open:e,onOpenChange:i,children:v.jsxs(XS,{children:[v.jsx(QS,{className:"fixed inset-0 z-50 bg-foreground/40 animate-in fade-in-0"}),v.jsxs(ZS,{className:`fixed left-1/2 top-1/2 z-50 flex w-[calc(100%-1.5rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl bg-card shadow-xl focus:outline-none animate-in fade-in-0 zoom-in-95 sm:w-[calc(100%-2rem)] ${a} max-h-[calc(100dvh-1.5rem)] sm:max-h-[calc(100dvh-2rem)] ${u??""}`,onInteractOutside:f?g=>g.preventDefault():void 0,children:[v.jsxs("div",{className:"flex shrink-0 items-start justify-between gap-3 px-4 py-4 sm:px-5",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx(eC,{className:"text-sm font-semibold text-foreground",children:r}),s&&v.jsx(tC,{className:"mt-0.5 truncate text-xs text-muted-foreground",title:s,children:s})]}),v.jsxs("div",{className:"mt-0.5 flex shrink-0 items-center gap-1",children:[p,v.jsx(nC,{asChild:!0,children:v.jsx(xe,{variant:"ghost",size:"icon","aria-label":"Close",children:v.jsx(pn,{size:15})})})]})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pb-4 pt-1 sm:px-5",children:l}),d&&v.jsx("div",{className:"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border px-4 pb-4 pt-3 sm:px-5",children:d})]})]})})}const sC=P.createContext(null);function Hy({children:e}){const[i,r]=P.useState(null),[s,l]=P.useState(!1),d=P.useRef(null),p=P.useCallback(f=>{var g;return(g=d.current)==null||g.call(d,!1),r(f),new Promise(c=>{d.current=c})},[]),a=f=>{var g;(g=d.current)==null||g.call(d,f),d.current=null,r(null),l(!1)},u=async()=>{if(!(i!=null&&i.run))return a(!0);l(!0);try{await i.run(),a(!0)}catch(f){ge.getState().notify(f.message,"error"),l(!1)}};return v.jsxs(sC.Provider,{value:p,children:[e,i&&v.jsx(rC,{open:!0,onOpenChange:f=>!f&&!s&&a(!1),title:i.title,description:i.description,maxWidth:i.maxWidth??"max-w-md",disableOutsideClose:s,footer:v.jsxs(v.Fragment,{children:[v.jsx(xe,{disabled:s,onClick:()=>a(!1),children:"Cancel"}),v.jsx(xe,{variant:i.tone??"primary",disabled:s,onClick:()=>void u(),autoFocus:!0,children:s?"Working...":i.confirmLabel??"Confirm"})]}),children:i.body})]})}function mn(){const e=P.useContext(sC);if(!e)throw new Error("useConfirm needs a ConfirmProvider above it.");return e}function zl({text:e,className:i}){const[r,s]=P.useState(!1),l=async d=>{d.stopPropagation();try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return v.jsx("button",{onClick:l,title:`Copy: ${e}`,className:ye("shrink-0 rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",i),children:r?v.jsx(Gl,{size:11,className:"text-severity-suggestion"}):v.jsx(Th,{size:11})})}var GR=Object.defineProperty,YR=(e,i)=>GR(e,"name",{value:i,configurable:!0});function Bg(e){const[i,r]=P.useState(void 0);return $t(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let s=0;const l=new ResizeObserver(d=>{if(!Array.isArray(d)||!d.length)return;const p=d[0];window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{let a,u;if("borderBoxSize"in p){const f=p.borderBoxSize,g=Array.isArray(f)?f[0]:f;a=g.inlineSize,u=g.blockSize}else a=e.offsetWidth,u=e.offsetHeight;r({width:a,height:u})})});return l.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(s),l.unobserve(e)}}else r(void 0)},[e]),i}YR(Bg,"useSize");var KR=Object.defineProperty,_r=(e,i)=>KR(e,"name",{value:i,configurable:!0}),Pg="Checkbox",[XR,FB]=br(Pg),[QR,Ig]=XR(Pg);function oC(e){const{__scopeCheckbox:i,checked:r,children:s,defaultChecked:l,disabled:d,form:p,name:a,onCheckedChange:u,required:f,value:g="on",internal_do_not_use_render:c}=e,[_,x]=Qs({prop:r,defaultProp:l??!1,onChange:u,caller:Pg}),[C,y]=P.useState(null),[m,b]=P.useState(null),[S,w]=P.useState(null),T=C?!!p||!!C.closest("form"):!0,D={checked:_,disabled:d,setChecked:x,control:C,setControl:y,name:a,form:p,value:g,userClick:S,onUserClick:w,required:f,defaultChecked:mi(l)?!1:l,isFormControl:T,bubbleInput:m,setBubbleInput:b};return v.jsx(QR,{scope:i,...D,children:aC(c)?c(D):s})}_r(oC,"CheckboxProvider");var ZR="CheckboxTrigger",JR=P.forwardRef(_r(function({__scopeCheckbox:i,onKeyDown:r,onClick:s,...l},d){const{control:p,value:a,disabled:u,checked:f,required:g,setControl:c,setChecked:_,onUserClick:x,isFormControl:C,bubbleInput:y}=Ig(ZR,i),m=ht(d,c),b=P.useRef(f);return P.useEffect(()=>{const S=p==null?void 0:p.form;if(S){const w=_r(()=>_(b.current),"reset");return S.addEventListener("reset",w),()=>S.removeEventListener("reset",w)}},[p,_]),v.jsx(St.button,{type:"button",role:"checkbox","aria-checked":mi(f)?"mixed":f,"aria-required":g,"data-state":zg(f),"data-disabled":u?"":void 0,disabled:u,value:a,...l,ref:m,onKeyDown:tt(r,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:tt(s,S=>{const w=S.isPropagationStopped();x({requestedChecked:mi(f)?!0:!f,hasConsumerStoppedPropagation:w}),_(T=>mi(T)?!0:!T),y&&C&&(w||S.stopPropagation())})})},"CheckboxTrigger")),eA=P.forwardRef(_r(function(i,r){const{__scopeCheckbox:s,name:l,checked:d,defaultChecked:p,required:a,disabled:u,value:f,onCheckedChange:g,form:c,..._}=i;return v.jsx(oC,{__scopeCheckbox:s,checked:d,defaultChecked:p,disabled:u,required:a,onCheckedChange:g,name:l,form:c,value:f,internal_do_not_use_render:({isFormControl:x})=>v.jsxs(v.Fragment,{children:[v.jsx(JR,{..._,ref:r,__scopeCheckbox:s}),x&&v.jsx(rA,{__scopeCheckbox:s})]})})},"Checkbox")),tA="CheckboxIndicator",nA=P.forwardRef(_r(function(i,r){const{__scopeCheckbox:s,forceMount:l,...d}=i,p=Ig(tA,s);return v.jsx(wr,{present:l||mi(p.checked)||p.checked===!0,children:v.jsx(St.span,{"data-state":zg(p.checked),"data-disabled":p.disabled?"":void 0,...d,ref:r,style:{pointerEvents:"none",...i.style}})})},"CheckboxIndicator")),iA="CheckboxBubbleInput",rA=P.forwardRef(_r(function({__scopeCheckbox:i,onClick:r,...s},l){const{control:d,userClick:p,checked:a,defaultChecked:u,required:f,disabled:g,name:c,value:_,form:x,bubbleInput:C,setBubbleInput:y}=Ig(iA,i),m=ht(l,y),b=Bg(d),S=P.useRef(!1),w=P.useRef(a),T=P.useRef(p),D=P.useRef(null);P.useEffect(()=>{const L=C;if(!L)return;const A=window.HTMLInputElement.prototype,M=Object.getOwnPropertyDescriptor(A,"checked").set;if(!M)return;const I=w.current!==a;w.current=a;const B=p!==null&&p!==T.current;if(T.current=p,B)D.current=I?null:p,I&&(L.indeterminate=mi(a),M.call(L,mi(a)?!1:a)),L.dispatchEvent(new Event("click",{bubbles:!p.hasConsumerStoppedPropagation}));else if(I){const H=D.current;D.current=null;const F=(H==null?void 0:H.requestedChecked)===a;S.current=!0,L.indeterminate=mi(a),M.call(L,mi(a)?!1:a),L.dispatchEvent(new Event("click",{bubbles:!(F&&H.hasConsumerStoppedPropagation)})),S.current=!1}},[C,a,p]);const R=P.useRef(mi(a)?!1:a);return v.jsx(St.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:f,disabled:g,name:c,value:_,form:x,...s,tabIndex:-1,ref:m,onClick:tt(r,L=>{S.current&&L.stopPropagation()}),style:{...s.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function aC(e){return typeof e=="function"}_r(aC,"isFunction");function mi(e){return e==="indeterminate"}_r(mi,"isIndeterminate");function zg(e){return mi(e)?"indeterminate":e?"checked":"unchecked"}_r(zg,"getState");function tc({id:e,label:i,ariaLabel:r,checked:s,onCheckedChange:l,disabled:d,title:p,className:a}){const u=e??(i?`cb-${String(i).toLowerCase().replace(/\s+/g,"-")}`:void 0);return v.jsxs("div",{className:ye("flex items-center gap-2",a),title:p,children:[v.jsx(eA,{id:u,checked:s,onCheckedChange:f=>l(f===!0),"aria-label":r,disabled:d,className:"h-4 w-4 shrink-0 cursor-pointer rounded border border-border bg-transparent focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:v.jsx(nA,{className:"flex items-center justify-center",children:v.jsx(Gl,{className:"h-3 w-3 text-primary",strokeWidth:3})})}),i&&v.jsx("label",{htmlFor:u,className:"cursor-pointer select-none text-xs",children:i})]})}function nn({icon:e,title:i,hint:r,variant:s="card",className:l}){return s==="inline"?v.jsx("div",{className:ye("px-2 py-3 text-xs text-muted-foreground",l),children:i}):v.jsxs("div",{className:ye("card flex flex-col items-center gap-1.5 p-8 text-center",l),children:[e&&v.jsx(e,{size:20,className:"text-muted-foreground/60"}),v.jsx("div",{className:"text-sm text-muted-foreground",children:i}),r&&v.jsx("div",{className:"max-w-sm text-xs text-muted-foreground/70",children:r})]})}const Zn=P.forwardRef(({className:e,size:i="sm",...r},s)=>v.jsx("input",{ref:s,className:ye("w-full rounded border bg-transparent font-sans","focus:outline-none focus:ring-1 focus:ring-ring","placeholder:text-muted-foreground disabled:opacity-50",i==="sm"?"px-2 py-1.5 text-xs":"px-3 py-2 text-sm",e),...r}));Zn.displayName="Input";const sA=["top","right","bottom","left"],cs=Math.min,fr=Math.max,hh=Math.round,$u=Math.floor,pr=e=>({x:e,y:e}),oA={left:"right",right:"left",bottom:"top",top:"bottom"};function lC(e,i,r){return fr(e,cs(i,r))}function xr(e,i){return typeof e=="function"?e(i):e}function us(e){return e.split("-")[0]}function Ca(e){return e.split("-")[1]}function Hg(e){return e==="x"?"y":"x"}function Fg(e){return e==="y"?"height":"width"}function Fi(e){const i=e[0];return i==="t"||i==="b"?"y":"x"}function Ug(e){return Hg(Fi(e))}function aA(e,i,r){r===void 0&&(r=!1);const s=Ca(e),l=Ug(e),d=Fg(l);let p=l==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return i.reference[d]>i.floating[d]&&(p=dh(p)),[p,dh(p)]}function lA(e){const i=dh(e);return[Im(e),i,Im(i)]}function Im(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Fy=["left","right"],Uy=["right","left"],cA=["top","bottom"],uA=["bottom","top"];function hA(e,i,r){switch(e){case"top":case"bottom":return r?i?Uy:Fy:i?Fy:Uy;case"left":case"right":return i?cA:uA;default:return[]}}function dA(e,i,r,s){const l=Ca(e);let d=hA(us(e),r==="start",s);return l&&(d=d.map(p=>p+"-"+l),i&&(d=d.concat(d.map(Im)))),d}function dh(e){const i=us(e);return oA[i]+e.slice(i.length)}function fA(e){var i,r,s,l;return{top:(i=e.top)!=null?i:0,right:(r=e.right)!=null?r:0,bottom:(s=e.bottom)!=null?s:0,left:(l=e.left)!=null?l:0}}function cC(e){return typeof e!="number"?fA(e):{top:e,right:e,bottom:e,left:e}}function fh(e){const{x:i,y:r,width:s,height:l}=e;return{width:s,height:l,top:r,left:i,right:i+s,bottom:r+l,x:i,y:r}}function $y(e,i,r){let{reference:s,floating:l}=e;const d=Fi(i),p=Ug(i),a=Fg(p),u=us(i),f=d==="y",g=s.x+s.width/2-l.width/2,c=s.y+s.height/2-l.height/2,_=s[a]/2-l[a]/2;let x;switch(u){case"top":x={x:g,y:s.y-l.height};break;case"bottom":x={x:g,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:c};break;case"left":x={x:s.x-l.width,y:c};break;default:x={x:s.x,y:s.y}}const C=Ca(i);return C&&(x[p]+=_*(C==="end"?1:-1)*(r&&f?-1:1)),x}async function pA(e,i){var r;i===void 0&&(i={});const{x:s,y:l,platform:d,rects:p,elements:a,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:c="floating",altBoundary:_=!1,padding:x=0}=xr(i,e),C=cC(x),m=a[_?c==="floating"?"reference":"floating":c],b=fh(await d.getClippingRect({element:(r=await(d.isElement==null?void 0:d.isElement(m)))==null||r?m:m.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(a.floating)),boundary:f,rootBoundary:g,strategy:u})),S=c==="floating"?{x:s,y:l,width:p.floating.width,height:p.floating.height}:p.reference,w=await(d.getOffsetParent==null?void 0:d.getOffsetParent(a.floating)),T=await(d.isElement==null?void 0:d.isElement(w))&&await(d.getScale==null?void 0:d.getScale(w))||{x:1,y:1},D=fh(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:w,strategy:u}):S);return{top:(b.top-D.top+C.top)/T.y,bottom:(D.bottom-b.bottom+C.bottom)/T.y,left:(b.left-D.left+C.left)/T.x,right:(D.right-b.right+C.right)/T.x}}const mA=50,gA=async(e,i,r)=>{const{placement:s="bottom",strategy:l="absolute",middleware:d=[],platform:p}=r,a=p.detectOverflow?p:{...p,detectOverflow:pA},u=await(p.isRTL==null?void 0:p.isRTL(i));let f=await p.getElementRects({reference:e,floating:i,strategy:l}),{x:g,y:c}=$y(f,s,u),_=s,x=0;const C={};for(let y=0;y<d.length;y++){const m=d[y];if(!m)continue;const{name:b,fn:S}=m,{x:w,y:T,data:D,reset:R}=await S({x:g,y:c,initialPlacement:s,placement:_,strategy:l,middlewareData:C,rects:f,platform:a,elements:{reference:e,floating:i}});g=w??g,c=T??c,C[b]={...C[b],...D},R&&x<mA&&(x++,typeof R=="object"&&(R.placement&&(_=R.placement),R.rects&&(f=R.rects===!0?await p.getElementRects({reference:e,floating:i,strategy:l}):R.rects),{x:g,y:c}=$y(f,_,u)),y=-1)}return{x:g,y:c,placement:_,strategy:l,middlewareData:C}},vA=e=>({name:"arrow",options:e,async fn(i){const{x:r,y:s,placement:l,rects:d,platform:p,elements:a,middlewareData:u}=i,{element:f,padding:g=0}=xr(e,i)||{};if(f==null)return{};const c=cC(g),_={x:r,y:s},x=Ug(l),C=Fg(x),y=await p.getDimensions(f),m=x==="y",b=m?"top":"left",S=m?"bottom":"right",w=m?"clientHeight":"clientWidth",T=d.reference[C]+d.reference[x]-_[x]-d.floating[C],D=_[x]-d.reference[x],R=await(p.getOffsetParent==null?void 0:p.getOffsetParent(f));let L=R?R[w]:0;(!L||!await(p.isElement==null?void 0:p.isElement(R)))&&(L=a.floating[w]||d.floating[C]);const A=T/2-D/2,j=L/2-y[C]/2-1,M=cs(c[b],j),I=cs(c[S],j),B=L-y[C]-I,H=L/2-y[C]/2+A,F=lC(M,H,B),W=!u.arrow&&Ca(l)!=null&&H!==F&&d.reference[C]/2-(H<M?M:I)-y[C]/2<0,G=W?H<M?H-M:H-B:0;return{[x]:_[x]+G,data:{[x]:F,centerOffset:H-F-G,...W&&{alignmentOffset:G}},reset:W}}}),_A=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(i){var r,s;const{placement:l,middlewareData:d,rects:p,initialPlacement:a,platform:u,elements:f}=i,{mainAxis:g=!0,crossAxis:c=!0,fallbackPlacements:_,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:y=!0,...m}=xr(e,i);if((r=d.arrow)!=null&&r.alignmentOffset)return{};const b=us(l),S=Fi(a),w=us(a)===a,T=await(u.isRTL==null?void 0:u.isRTL(f.floating)),D=_||(w||!y?[dh(a)]:lA(a)),R=C!=="none";!_&&R&&D.push(...dA(a,y,C,T));const L=[a,...D],A=await u.detectOverflow(i,m),j=[];let M=((s=d.flip)==null?void 0:s.overflows)||[];if(g&&j.push(A[b]),c){const F=aA(l,p,T);j.push(A[F[0]],A[F[1]])}if(M=[...M,{placement:l,overflows:j}],!j.every(F=>F<=0)){var I,B;const F=(((I=d.flip)==null?void 0:I.index)||0)+1,W=L[F];if(W&&(!(c==="alignment"?S!==Fi(W):!1)||M.every(X=>Fi(X.placement)===S?X.overflows[0]>0:!0)))return{data:{index:F,overflows:M},reset:{placement:W}};let G=(B=M.filter(Q=>Q.overflows[0]<=0).sort((Q,X)=>Q.overflows[1]-X.overflows[1])[0])==null?void 0:B.placement;if(!G)switch(x){case"bestFit":{var H;const Q=(H=M.filter(X=>{if(R){const z=Fi(X.placement);return z===S||z==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(z=>z>0).reduce((z,O)=>z+O,0)]).sort((X,z)=>X[1]-z[1])[0])==null?void 0:H[0];Q&&(G=Q);break}case"initialPlacement":G=a;break}if(l!==G)return{reset:{placement:G}}}return{}}}};function qy(e,i){return{top:e.top-i.height,right:e.right-i.width,bottom:e.bottom-i.height,left:e.left-i.width}}function Vy(e){return sA.some(i=>e[i]>=0)}const xA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(i){const{rects:r,platform:s}=i,{strategy:l="referenceHidden",...d}=xr(e,i);switch(l){case"referenceHidden":{const p=await s.detectOverflow(i,{...d,elementContext:"reference"}),a=qy(p,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Vy(a)}}}case"escaped":{const p=await s.detectOverflow(i,{...d,altBoundary:!0}),a=qy(p,r.floating);return{data:{escapedOffsets:a,escaped:Vy(a)}}}default:return{}}}}},uC=new Set(["left","top"]);async function yA(e,i){const{placement:r,platform:s,elements:l}=e,d=await(s.isRTL==null?void 0:s.isRTL(l.floating)),p=us(r),a=Ca(r),u=Fi(r)==="y",f=uC.has(p)?-1:1,g=d&&u?-1:1,c=xr(i,e);let{mainAxis:_,crossAxis:x,alignmentAxis:C}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof C=="number"&&(x=a==="end"?C*-1:C),u?{x:x*g,y:_*f}:{x:_*f,y:x*g}}const bA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(i){var r,s;const{x:l,y:d,placement:p,middlewareData:a}=i,u=await yA(i,e);return p===((r=a.offset)==null?void 0:r.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:l+u.x,y:d+u.y,data:{...u,placement:p}}}}},wA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(i){const{x:r,y:s,placement:l,platform:d}=i,{mainAxis:p=!0,crossAxis:a=!1,limiter:u={fn:S=>{let{x:w,y:T}=S;return{x:w,y:T}}},...f}=xr(e,i),g={x:r,y:s},c=await d.detectOverflow(i,f),_=Fi(l),x=Hg(_);let C=g[x],y=g[_];const m=(S,w)=>lC(w+c[S==="y"?"top":"left"],w,w-c[S==="y"?"bottom":"right"]);p&&(C=m(x,C)),a&&(y=m(_,y));const b=u.fn({...i,[x]:C,[_]:y});return{...b,data:{x:b.x-r,y:b.y-s,enabled:{[x]:p,[_]:a}}}}}},SA=function(e){return e===void 0&&(e={}),{options:e,fn(i){var r,s;const{x:l,y:d,placement:p,rects:a,middlewareData:u}=i,{offset:f=0,mainAxis:g=!0,crossAxis:c=!0}=xr(e,i),_={x:l,y:d},x=Fi(p),C=Hg(x);let y=_[C],m=_[x];const b=xr(f,i),S=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(r=b.mainAxis)!=null?r:0,crossAxis:(s=b.crossAxis)!=null?s:0};if(g){const D=C==="y"?"height":"width",R=a.reference[C]-a.floating[D]+S.mainAxis,L=a.reference[C]+a.reference[D]-S.mainAxis;y<R?y=R:y>L&&(y=L)}if(c){var w,T;const D=C==="y"?"width":"height",R=uC.has(us(p)),L=a.reference[x]-a.floating[D]+(R&&((w=u.offset)==null?void 0:w[x])||0)+(R?0:S.crossAxis),A=a.reference[x]+a.reference[D]+(R?0:((T=u.offset)==null?void 0:T[x])||0)-(R?S.crossAxis:0);m<L?m=L:m>A&&(m=A)}return{[C]:y,[x]:m}}}},CA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(i){const{placement:r,rects:s,platform:l,elements:d}=i,{apply:p=()=>{},...a}=xr(e,i),u=await l.detectOverflow(i,a),f=us(r),g=Ca(r),c=Fi(r)==="y",{width:_,height:x}=s.floating;let C,y;f==="top"||f==="bottom"?(C=f,y=g===(await(l.isRTL==null?void 0:l.isRTL(d.floating))?"start":"end")?"left":"right"):(y=f,C=g==="end"?"top":"bottom");const m=x-u.top-u.bottom,b=_-u.left-u.right,S=cs(x-u[C],m),w=cs(_-u[y],b),T=i.middlewareData.shift,D=!T;let R=S,L=w;T!=null&&T.enabled.x&&(L=b),T!=null&&T.enabled.y&&(R=m),D&&!g&&(c?L=_-2*fr(u.left,u.right):R=x-2*fr(u.top,u.bottom)),await p({...i,availableWidth:L,availableHeight:R});const A=await l.getDimensions(d.floating);return _!==A.width||x!==A.height?{reset:{rects:!0}}:{}}}};function Nh(){return typeof window<"u"}function Ea(e){return hC(e)?(e.nodeName||"").toLowerCase():"#document"}function Nn(e){var i;return(e==null||(i=e.ownerDocument)==null?void 0:i.defaultView)||window}function Sr(e){var i;return(i=(hC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:i.documentElement}function hC(e){return Nh()?e instanceof Node||e instanceof Nn(e).Node:!1}function qi(e){return Nh()?e instanceof Element||e instanceof Nn(e).Element:!1}function ps(e){return Nh()?e instanceof HTMLElement||e instanceof Nn(e).HTMLElement:!1}function Wy(e){return!Nh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nn(e).ShadowRoot}function Bh(e){const{overflow:i,overflowX:r,overflowY:s,display:l}=Vi(e);return/auto|scroll|overlay|hidden|clip/.test(i+s+r)&&l!=="inline"&&l!=="contents"}function EA(e){return/^(table|td|th)$/.test(Ea(e))}function Ph(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const kA=/transform|translate|scale|rotate|perspective|filter/,TA=/paint|layout|strict|content/,Hs=e=>!!e&&e!=="none";let Yp;function $g(e){const i=qi(e)?Vi(e):e;return Hs(i.transform)||Hs(i.translate)||Hs(i.scale)||Hs(i.rotate)||Hs(i.perspective)||!qg()&&(Hs(i.backdropFilter)||Hs(i.filter))||kA.test(i.willChange||"")||TA.test(i.contain||"")}function RA(e){let i=Zs(e);for(;ps(i)&&!Hl(i);){if($g(i))return i;if(Ph(i))return null;i=Zs(i)}return null}function qg(){return Yp==null&&(Yp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Yp}function Hl(e){return/^(html|body|#document)$/.test(Ea(e))}function Vi(e){return Nn(e).getComputedStyle(e)}function Ih(e){return qi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zs(e){if(Ea(e)==="html")return e;const i=e.assignedSlot||e.parentNode||Wy(e)&&e.host||Sr(e);return Wy(i)?i.host:i}function dC(e){const i=Zs(e);return Hl(i)?(e.ownerDocument||e).body:ps(i)&&Bh(i)?i:dC(i)}function Fl(e,i,r){var s;i===void 0&&(i=[]),r===void 0&&(r=!0);const l=dC(e),d=l===((s=e.ownerDocument)==null?void 0:s.body),p=Nn(l);if(d){const a=zm(p);return i.concat(p,p.visualViewport||[],Bh(l)?l:[],a&&r?Fl(a):[])}else return i.concat(l,Fl(l,[],r))}function zm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fC(e){const i=Vi(e);let r=parseFloat(i.width)||0,s=parseFloat(i.height)||0;const l=ps(e),d=l?e.offsetWidth:r,p=l?e.offsetHeight:s,a=hh(r)!==d||hh(s)!==p;return a&&(r=d,s=p),{width:r,height:s,$:a}}function Vg(e){return qi(e)?e:e.contextElement}function da(e){const i=Vg(e);if(!ps(i))return pr(1);const r=i.getBoundingClientRect(),{width:s,height:l,$:d}=fC(i);let p=(d?hh(r.width):r.width)/s,a=(d?hh(r.height):r.height)/l;return(!p||!Number.isFinite(p))&&(p=1),(!a||!Number.isFinite(a))&&(a=1),{x:p,y:a}}const AA=pr(0);function pC(e){const i=Nn(e);return!qg()||!i.visualViewport?AA:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function DA(e,i,r){return i===void 0&&(i=!1),!!r&&i&&r===Nn(e)}function Js(e,i,r,s){i===void 0&&(i=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),d=Vg(e);let p=pr(1);i&&(s?qi(s)&&(p=da(s)):p=da(e));const a=DA(d,r,s)?pC(d):pr(0);let u=(l.left+a.x)/p.x,f=(l.top+a.y)/p.y,g=l.width/p.x,c=l.height/p.y;if(d&&s){const _=Nn(d),x=qi(s)?Nn(s):s;let C=_,y=zm(C);for(;y&&x!==C;){const m=da(y),b=y.getBoundingClientRect(),S=Vi(y),w=b.left+(y.clientLeft+parseFloat(S.paddingLeft))*m.x,T=b.top+(y.clientTop+parseFloat(S.paddingTop))*m.y;u*=m.x,f*=m.y,g*=m.x,c*=m.y,u+=w,f+=T,C=Nn(y),y=zm(C)}}return fh({width:g,height:c,x:u,y:f})}function zh(e,i){const r=Ih(e).scrollLeft;return i?i.left+r:Js(Sr(e)).left+r}function mC(e,i){const r=e.getBoundingClientRect(),s=r.left+i.scrollLeft-zh(e,r),l=r.top+i.scrollTop;return{x:s,y:l}}function LA(e){let{elements:i,rect:r,offsetParent:s,strategy:l}=e;const d=l==="fixed",p=Sr(s),a=i?Ph(i.floating):!1;if(s===p||a&&d)return r;let u={scrollLeft:0,scrollTop:0},f=pr(1);const g=pr(0),c=ps(s);if((c||!d)&&((Ea(s)!=="body"||Bh(p))&&(u=Ih(s)),c)){const x=Js(s);f=da(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const _=p&&!c&&!d?mC(p,u):pr(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-u.scrollLeft*f.x+g.x+_.x,y:r.y*f.y-u.scrollTop*f.y+g.y+_.y}}function MA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function jA(e){const i=Ih(e),r=e.ownerDocument.body,s=fr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=fr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let d=-i.scrollLeft+zh(e);const p=-i.scrollTop;return Vi(r).direction==="rtl"&&(d+=fr(e.clientWidth,r.clientWidth)-s),{width:s,height:l,x:d,y:p}}const OA=25;function NA(e,i,r){r===void 0&&(r="viewport");const s=r==="layoutViewport",l=Nn(e),d=Sr(e),p=l.visualViewport;let a=d.clientWidth,u=d.clientHeight,f=0,g=0;if(p){const _=!qg()||i==="fixed";s?_||(f=-p.offsetLeft,g=-p.offsetTop):(a=p.width,u=p.height,_&&(f=p.offsetLeft,g=p.offsetTop))}if(zh(d)<=0){const _=d.ownerDocument,x=_.body,C=getComputedStyle(x),y=_.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,m=Math.abs(d.clientWidth-x.clientWidth-y),b=getComputedStyle(d).scrollbarGutter==="stable both-edges"?m/2:m;b<=OA&&(a-=b)}return{width:a,height:u,x:f,y:g}}function BA(e,i){const r=Js(e,!0,i==="fixed"),s=r.top+e.clientTop,l=r.left+e.clientLeft,d=da(e),p=e.clientWidth*d.x,a=e.clientHeight*d.y,u=l*d.x,f=s*d.y;return{width:p,height:a,x:u,y:f}}function Gy(e,i,r){let s;if(i==="viewport"||i==="layoutViewport")s=NA(e,r,i);else if(i==="document")s=jA(Sr(e));else if(qi(i))s=BA(i,r);else{const l=pC(e);s={x:i.x-l.x,y:i.y-l.y,width:i.width,height:i.height}}return fh(s)}function PA(e,i){const r=i.get(e);if(r)return r;let s=Fl(e,[],!1).filter(a=>qi(a)&&Ea(a)!=="body"),l=null;const d=Vi(e).position==="fixed";let p=d?Zs(e):e;for(;qi(p)&&!Hl(p);){const a=Vi(p),u=$g(p),f=l?l.position:d?"fixed":"";!u&&(f==="fixed"||f==="absolute"&&a.position==="static")?s=s.filter(c=>c!==p):l=a,p=Zs(p)}return i.set(e,s),s}function IA(e){let{element:i,boundary:r,rootBoundary:s,strategy:l}=e;const p=[...r==="clippingAncestors"?Ph(i)?[]:PA(i,this._c):[].concat(r),s],a=Gy(i,p[0],l);let u=a.top,f=a.right,g=a.bottom,c=a.left;for(let _=1;_<p.length;_++){const x=Gy(i,p[_],l);u=fr(x.top,u),f=cs(x.right,f),g=cs(x.bottom,g),c=fr(x.left,c)}return{width:f-c,height:g-u,x:c,y:u}}function zA(e){const{width:i,height:r}=fC(e);return{width:i,height:r}}function HA(e,i,r){const s=ps(i),l=Sr(i),d=r==="fixed",p=Js(e,!0,d,i);let a={scrollLeft:0,scrollTop:0};const u=pr(0);if((s||!d)&&((Ea(i)!=="body"||Bh(l))&&(a=Ih(i)),s)){const _=Js(i,!0,d,i);u.x=_.x+i.clientLeft,u.y=_.y+i.clientTop}!s&&l&&(u.x=zh(l));const f=l&&!s&&!d?mC(l,a):pr(0),g=p.left+a.scrollLeft-u.x-f.x,c=p.top+a.scrollTop-u.y-f.y;return{x:g,y:c,width:p.width,height:p.height}}function Kp(e){return Vi(e).position==="static"}function Yy(e,i){if(!ps(e)||Vi(e).position==="fixed")return null;if(i)return i(e);let r=e.offsetParent;return Sr(e)===r&&(r=r.ownerDocument.body),r}function gC(e,i){const r=Nn(e);if(Ph(e))return r;if(!ps(e)){let l=Zs(e);for(;l&&!Hl(l);){if(qi(l)&&!Kp(l))return l;l=Zs(l)}return r}let s=Yy(e,i);for(;s&&EA(s)&&Kp(s);)s=Yy(s,i);return s&&Hl(s)&&Kp(s)&&!$g(s)?r:s||RA(e)||r}const FA=async function(e){const i=this.getOffsetParent||gC,r=this.getDimensions,s=await r(e.floating);return{reference:HA(e.reference,await i(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function UA(e){return Vi(e).direction==="rtl"}const $A={convertOffsetParentRelativeRectToViewportRelativeRect:LA,getDocumentElement:Sr,getClippingRect:IA,getOffsetParent:gC,getElementRects:FA,getClientRects:MA,getDimensions:zA,getScale:da,isElement:qi,isRTL:UA};function vC(e,i){return e.x===i.x&&e.y===i.y&&e.width===i.width&&e.height===i.height}function qA(e,i,r){let s=null,l;const d=Sr(e);function p(){var g;clearTimeout(l),(g=s)==null||g.disconnect(),s=null}function a(g,c){g===void 0&&(g=!1),c===void 0&&(c=1),p();const _=e.getBoundingClientRect(),{left:x,top:C,width:y,height:m}=_;if(g||i(),!y||!m)return;const b=$u(C),S=$u(d.clientWidth-(x+y)),w=$u(d.clientHeight-(C+m)),T=$u(x),R={rootMargin:-b+"px "+-S+"px "+-w+"px "+-T+"px",threshold:fr(0,cs(1,c))||1};let L=!0;function A(j){const M=j[0].intersectionRatio;if(!vC(_,e.getBoundingClientRect()))return a();if(M!==c){if(!L)return a();M?a(!1,M):l=setTimeout(()=>{a(!1,1e-7)},1e3)}L=!1}try{s=new IntersectionObserver(A,{...R,root:d.ownerDocument})}catch{s=new IntersectionObserver(A,R)}s.observe(e)}const u=Nn(e),f=()=>a(r);return u.addEventListener("resize",f),a(!0),()=>{u.removeEventListener("resize",f),p()}}function VA(e,i,r,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:d=!0,elementResize:p=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=s,f=Vg(e),g=l||d?[...f?Fl(f):[],...i?Fl(i):[]]:[];g.forEach(b=>{l&&b.addEventListener("scroll",r),d&&b.addEventListener("resize",r)});const c=f&&a?qA(f,r,d):null;let _=-1,x=null;p&&(x=new ResizeObserver(b=>{let[S]=b;S&&S.target===f&&x&&i&&(x.unobserve(i),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var w;(w=x)==null||w.observe(i)})),r()}),f&&!u&&x.observe(f),i&&x.observe(i));let C,y=u?Js(e):null;u&&m();function m(){const b=Js(e);y&&!vC(y,b)&&r(),y=b,C=requestAnimationFrame(m)}return r(),()=>{var b;g.forEach(S=>{l&&S.removeEventListener("scroll",r),d&&S.removeEventListener("resize",r)}),c==null||c(),(b=x)==null||b.disconnect(),x=null,u&&cancelAnimationFrame(C)}}const WA=bA,GA=wA,YA=_A,KA=CA,XA=xA,Ky=vA,QA=SA,ZA=(e,i,r)=>{const s=new Map,l=r??{},d={...$A,...l.platform,_c:s};return gA(e,i,{...l,platform:d})};var JA=typeof document<"u",e6=function(){},th=JA?P.useLayoutEffect:e6;function ph(e,i){if(e===i)return!0;if(typeof e!=typeof i)return!1;if(typeof e=="function"&&e.toString()===i.toString())return!0;let r,s,l;if(e&&i&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==i.length)return!1;for(s=r;s--!==0;)if(!ph(e[s],i[s]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(i).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(i,l[s]))return!1;for(s=r;s--!==0;){const d=l[s];if(!(d==="_owner"&&e.$$typeof)&&!ph(e[d],i[d]))return!1}return!0}return e!==e&&i!==i}function _C(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xy(e,i){const r=_C(e);return Math.round(i*r)/r}function Xp(e){const i=P.useRef(e);return th(()=>{i.current=e}),i}function t6(e){e===void 0&&(e={});const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:l,elements:{reference:d,floating:p}={},transform:a=!0,whileElementsMounted:u,open:f}=e,[g,c]=P.useState({x:0,y:0,strategy:r,placement:i,middlewareData:{},isPositioned:!1}),[_,x]=P.useState(s);ph(_,s)||x(s);const[C,y]=P.useState(null),[m,b]=P.useState(null),S=P.useCallback(X=>{X!==R.current&&(R.current=X,y(X))},[]),w=P.useCallback(X=>{X!==L.current&&(L.current=X,b(X))},[]),T=d||C,D=p||m,R=P.useRef(null),L=P.useRef(null),A=P.useRef(g),j=u!=null,M=Xp(u),I=Xp(l),B=Xp(f),H=P.useCallback(()=>{if(!R.current||!L.current)return;const X={placement:i,strategy:r,middleware:_};I.current&&(X.platform=I.current),ZA(R.current,L.current,X).then(z=>{const O={...z,isPositioned:B.current!==!1};F.current&&!ph(A.current,O)&&(A.current=O,Jl.flushSync(()=>{c(O)}))})},[_,i,r,I,B]);th(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,c(X=>({...X,isPositioned:!1})))},[f]);const F=P.useRef(!1);th(()=>(F.current=!0,()=>{F.current=!1}),[]),th(()=>{if(T&&(R.current=T),D&&(L.current=D),T&&D){if(M.current)return M.current(T,D,H);H()}},[T,D,H,M,j]);const W=P.useMemo(()=>({reference:R,floating:L,setReference:S,setFloating:w}),[S,w]),G=P.useMemo(()=>({reference:T,floating:D}),[T,D]),Q=P.useMemo(()=>{const X={position:r,left:0,top:0};if(!G.floating)return X;const z=Xy(G.floating,g.x),O=Xy(G.floating,g.y);return a?{...X,transform:"translate("+z+"px, "+O+"px)",..._C(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:z,top:O}},[r,a,G.floating,g.x,g.y]);return P.useMemo(()=>({...g,update:H,refs:W,elements:G,floatingStyles:Q}),[g,H,W,G,Q])}const n6=e=>{function i(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:l}=typeof e=="function"?e(r):e;return s&&i(s)?s.current!=null?Ky({element:s.current,padding:l}).fn(r):{}:s?Ky({element:s,padding:l}).fn(r):{}}}},i6=(e,i)=>{const r=WA(e);return{name:r.name,fn:r.fn,options:[e,i]}},r6=(e,i)=>{const r=GA(e);return{name:r.name,fn:r.fn,options:[e,i]}},s6=(e,i)=>({fn:QA(e).fn,options:[e,i]}),o6=(e,i)=>{const r=YA(e);return{name:r.name,fn:r.fn,options:[e,i]}},a6=(e,i)=>{const r=KA(e);return{name:r.name,fn:r.fn,options:[e,i]}},l6=(e,i)=>{const r=XA(e);return{name:r.name,fn:r.fn,options:[e,i]}},c6=(e,i)=>{const r=n6(e);return{name:r.name,fn:r.fn,options:[e,i]}};var u6=Object.defineProperty,h6=(e,i)=>u6(e,"name",{value:i,configurable:!0}),d6=P.forwardRef(h6(function(i,r){const{children:s,width:l=10,height:d=5,...p}=i;return v.jsx(St.svg,{...p,ref:r,width:l,height:d,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:i.asChild?s:v.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),f6=Object.defineProperty,mr=(e,i)=>f6(e,"name",{value:i,configurable:!0}),Qy={Partial:"partial"},Zy={Optimized:"optimized",Always:"always"},xC="Popper",[yC,ka]=br(xC),[p6,bC]=yC(xC),Wg=mr(e=>{const{__scopePopper:i,children:r}=e,[s,l]=P.useState(null),[d,p]=P.useState(void 0);return v.jsx(p6,{scope:i,anchor:s,onAnchorChange:l,placementState:d,setPlacementState:p,children:r})},"Popper"),m6="PopperAnchor",Gg=P.forwardRef(mr(function(i,r){const{__scopePopper:s,virtualRef:l,...d}=i,p=bC(m6,s),a=P.useRef(null),u=p.onAnchorChange,f=P.useCallback(y=>{a.current=y,y&&u(y)},[u]),g=ht(r,f),c=P.useRef(null);P.useEffect(()=>{if(!l)return;const y=c.current;c.current=l.current,y!==c.current&&u(c.current)});const _=p.placementState&&Hh(p.placementState),x=_==null?void 0:_[0],C=_==null?void 0:_[1];return l?null:v.jsx(St.div,{"data-radix-popper-side":x,"data-radix-popper-align":C,...d,ref:g})},"PopperAnchor")),wC="PopperContent",[g6,v6]=yC(wC),Yg=P.forwardRef(mr(function(i,r){var oe,ee,ue,he,Se,we,Re;const{__scopePopper:s,side:l="bottom",sideOffset:d=0,align:p="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:g=[],collisionPadding:c=0,sticky:_=Qy.Partial,hideWhenDetached:x=!1,updatePositionStrategy:C=Zy.Optimized,onPlaced:y,...m}=i,b=bC(wC,s),[S,w]=P.useState(null),T=ht(r,w),[D,R]=P.useState(null),L=Bg(D),A=(L==null?void 0:L.width)??0,j=(L==null?void 0:L.height)??0,M=l+(p!=="center"?"-"+p:""),I=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},B=Array.isArray(g)?g:[g],H=B.length>0,F={padding:I,boundary:B.filter(SC),altBoundary:H},{refs:W,floatingStyles:G,placement:Q,isPositioned:X,middlewareData:z}=t6({strategy:"fixed",placement:M,whileElementsMounted:mr((...qe)=>VA(...qe,{animationFrame:C===Zy.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[i6({mainAxis:d+j,alignmentAxis:a}),f&&r6({mainAxis:!0,crossAxis:!1,..._===Qy.Partial?{limiter:s6()}:{},...F}),f&&o6({...F}),a6({...F,apply:mr(({elements:qe,rects:ke,availableWidth:ze,availableHeight:Mt})=>{const{width:$e,height:Be}=ke.reference,Ie=qe.floating.style;Ie.setProperty("--radix-popper-available-width",`${ze}px`),Ie.setProperty("--radix-popper-available-height",`${Mt}px`),Ie.setProperty("--radix-popper-anchor-width",`${$e}px`),Ie.setProperty("--radix-popper-anchor-height",`${Be}px`)},"apply")}),D&&c6({element:D,padding:u}),b6({arrowWidth:A,arrowHeight:j}),x&&l6(H?{strategy:"referenceHidden",...F}:{strategy:"referenceHidden",padding:F.padding,altBoundary:F.altBoundary})]}),O=b.setPlacementState;$t(()=>(O(Q),()=>{O(void 0)}),[Q,O]);const[Y,Z]=Hh(Q),U=$i(y);$t(()=>{X&&(U==null||U())},[X,U]);const V=(oe=z.arrow)==null?void 0:oe.x,ne=(ee=z.arrow)==null?void 0:ee.y,le=((ue=z.arrow)==null?void 0:ue.centerOffset)!==0,[K,$]=P.useState();return $t(()=>{S&&$(window.getComputedStyle(S).zIndex)},[S]),v.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:X?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(he=z.transformOrigin)==null?void 0:he.x,(Se=z.transformOrigin)==null?void 0:Se.y].join(" "),...((we=z.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:i.dir,children:v.jsx(g6,{scope:s,placedSide:Y,placedAlign:Z,onArrowChange:R,arrowX:V,arrowY:ne,shouldHideArrow:le,children:v.jsx(St.div,{"data-side":Y,"data-align":Z,...m,ref:T,style:{...m.style,animation:X?(Re=m.style)==null?void 0:Re.animation:"none"}})})})},"PopperContent")),_6="PopperArrow",x6={top:"bottom",right:"left",bottom:"top",left:"right"},y6=P.forwardRef(mr(function(i,r){const{__scopePopper:s,...l}=i,d=v6(_6,s),p=x6[d.placedSide];return v.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[p]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:v.jsx(d6,{...l,ref:r,style:{...l.style,display:"block"}})})},"PopperArrow"));function SC(e){return e!==null}mr(SC,"isNotNull");var b6=mr(e=>({name:"transformOrigin",options:e,fn(i){var m,b,S;const{placement:r,rects:s,middlewareData:l}=i,p=((m=l.arrow)==null?void 0:m.centerOffset)!==0,a=p?0:e.arrowWidth,u=p?0:e.arrowHeight,[f,g]=Hh(r),c={start:"0%",center:"50%",end:"100%"}[g],_=(((b=l.arrow)==null?void 0:b.x)??0)+a/2,x=(((S=l.arrow)==null?void 0:S.y)??0)+u/2;let C="",y="";return f==="bottom"?(C=p?c:`${_}px`,y=`${-u}px`):f==="top"?(C=p?c:`${_}px`,y=`${s.floating.height+u}px`):f==="right"?(C=`${-u}px`,y=p?c:`${x}px`):f==="left"&&(C=`${s.floating.width+u}px`,y=p?c:`${x}px`),{data:{x:C,y}}}}),"transformOrigin");function Hh(e){const[i,r="center"]=e.split("-");return[i,r]}mr(Hh,"getSideAndAlignFromPlacement");var w6=Object.defineProperty,Cr=(e,i)=>w6(e,"name",{value:i,configurable:!0}),Kg="Popover",[CC,UB]=br(Kg,[ka]),Xg=ka(),[S6,Ta]=CC(Kg),C6=Cr(e=>{const{__scopePopover:i,children:r,open:s,defaultOpen:l,onOpenChange:d,modal:p=!1}=e,a=Xg(i),u=P.useRef(null),[f,g]=P.useState(!1),[c,_]=P.useState(0),[x,C]=P.useState(0),[y,m]=Qs({prop:s,defaultProp:l??!1,onChange:d,caller:Kg});return v.jsx(Wg,{...a,children:v.jsx(S6,{scope:i,contentId:Ui(),titleId:Ui(),descriptionId:Ui(),titlePresent:c>0,descriptionPresent:x>0,setTitleCount:_,setDescriptionCount:C,triggerRef:u,open:y,onOpenChange:m,onOpenToggle:P.useCallback(()=>m(b=>!b),[m]),hasCustomAnchor:f,onCustomAnchorAdd:P.useCallback(()=>g(!0),[]),onCustomAnchorRemove:P.useCallback(()=>g(!1),[]),modal:p,children:r})})},"Popover"),E6="PopoverTrigger",k6=P.forwardRef(Cr(function(i,r){const{__scopePopover:s,...l}=i,d=Ta(E6,s),p=Xg(s),a=ht(r,d.triggerRef),u=v.jsx(St.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":Qg(d.open),...l,ref:a,onClick:tt(i.onClick,d.onOpenToggle)});return d.hasCustomAnchor?u:v.jsx(Gg,{asChild:!0,...p,children:u})},"PopoverTrigger")),EC="PopoverPortal",[T6,R6]=CC(EC,{forceMount:void 0}),A6=Cr(e=>{const{__scopePopover:i,forceMount:r,children:s,container:l}=e,d=Ta(EC,i);return v.jsx(T6,{scope:i,forceMount:r,children:v.jsx(wr,{present:r||d.open,children:v.jsx(Lh,{asChild:!0,container:l,children:s})})})},"PopoverPortal"),Ul="PopoverContent",D6=P.forwardRef(Cr(function(i,r){const s=R6(Ul,i.__scopePopover),{forceMount:l=s.forceMount,...d}=i,p=Ta(Ul,i.__scopePopover);return v.jsx(wr,{present:l||p.open,children:p.modal?v.jsx(M6,{...d,ref:r}):v.jsx(j6,{...d,ref:r})})},"PopoverContent")),L6=gr("PopoverContent.RemoveScroll"),M6=P.forwardRef(Cr(function(i,r){const s=Ta(Ul,i.__scopePopover),l=P.useRef(null),d=ht(r,l),p=P.useRef(!1),{nodes:a,registry:u}=Dg();return P.useEffect(()=>{const f=l.current;if(f)return Og(f)},[]),v.jsx(jh,{as:L6,allowPinchZoom:!0,shards:P.useMemo(()=>[l,...a.map(f=>({current:f}))],[l,a]),children:v.jsx(kC,{...i,ref:d,branchNodes:a,branchRegistry:u,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tt(i.onCloseAutoFocus,f=>{var g;f.preventDefault(),p.current||(g=s.triggerRef.current)==null||g.focus()}),onPointerDownOutside:tt(i.onPointerDownOutside,f=>{const g=f.detail.originalEvent,c=g.button===0&&g.ctrlKey===!0,_=g.button===2||c;p.current=_},{checkForDefaultPrevented:!1}),onFocusOutside:tt(i.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),j6=P.forwardRef(Cr(function(i,r){const s=Ta(Ul,i.__scopePopover),l=P.useRef(!1),d=P.useRef(!1);return v.jsx(kC,{...i,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var a,u;(a=i.onCloseAutoFocus)==null||a.call(i,p),p.defaultPrevented||(l.current||(u=s.triggerRef.current)==null||u.focus(),p.preventDefault()),l.current=!1,d.current=!1},onInteractOutside:p=>{var f,g;(f=i.onInteractOutside)==null||f.call(i,p),p.defaultPrevented||(l.current=!0,p.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const a=p.target;((g=s.triggerRef.current)==null?void 0:g.contains(a))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&d.current&&p.preventDefault()}})},"PopoverContentNonModal")),kC=P.forwardRef(Cr(function(i,r){const{__scopePopover:s,trapFocus:l,onOpenAutoFocus:d,onCloseAutoFocus:p,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:g,onInteractOutside:c,"aria-describedby":_,branchNodes:x,branchRegistry:C,...y}=i,m=Ta(Ul,s),b=Xg(s),[S,w]=P.useState(null),T=ht(r,w);return Lg(S),ec(),v.jsx(Ag,{registry:C,children:v.jsx(Rg,{asChild:!0,loop:!0,trapped:l,branches:x,onMountAutoFocus:d,onUnmountAutoFocus:p,children:v.jsx(Dh,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:g,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:v.jsx(Yg,{"data-state":Qg(m.open),role:"dialog",id:m.contentId,"aria-labelledby":m.titlePresent?m.titleId:void 0,"aria-describedby":m.descriptionPresent?TC(_,m.descriptionId):_,...b,...y,ref:T,style:{...y.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)"}})})})})},"PopoverContentImpl"));function Qg(e){return e?"open":"closed"}Cr(Qg,"getState");function TC(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Cr(TC,"concatAriaDescribedby");function Fh({trigger:e,children:i,side:r="bottom",align:s="start",className:l,open:d,onOpenChange:p}){return v.jsxs(C6,{open:d,onOpenChange:p,children:[v.jsx(k6,{asChild:!0,children:e}),v.jsx(A6,{children:v.jsx(D6,{side:r,align:s,sideOffset:6,collisionPadding:8,className:ye("z-50 rounded-lg border bg-card p-3 shadow-lg focus:outline-none","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",l),children:i})})]})}const O6={on:"bg-foreground text-background",off:"bg-muted text-muted-foreground",critical:"bg-severity-critical text-primary-foreground",warning:"bg-severity-warning text-background",suggestion:"bg-severity-suggestion text-background",success:"bg-success text-success-foreground"};function nt({tone:e="on",icon:i,children:r,className:s,title:l}){return v.jsxs("span",{title:l,className:ye("inline-flex shrink-0 items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium",O6[e],s),children:[i&&v.jsx(i,{className:"h-2.5 w-2.5"}),r]})}const Jy="clauder-hub:automation-tab";function N6(){var u,f,g,c;const e=ct(()=>ve.jobs(),["jobs"]),i=ct(()=>ve.runs(),["runs"]),{starting:r,start:s}=io(),[l,d]=P.useState(()=>{try{return localStorage.getItem(Jy)==="queue"?"queue":"jobs"}catch{return"jobs"}}),p=_=>{d(_);try{localStorage.setItem(Jy,_)}catch{}},a=(i.data??[]).filter(_=>_.status==="queued"||_.status==="running").length;return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Operation"}),v.jsx("h1",{className:"text-base font-semibold",children:"Automation"}),v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"Cron and webhook runs, one session at a time, while the hub runs.",children:"Cron and webhook runs, one session at a time, while the hub runs."})]}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.jsxs(xe,{disabled:r,onClick:()=>void s("queue-run"),title:"Opens a Claude session to queue a run",children:[v.jsx(ma,{size:12})," Queue a run"]}),v.jsxs(xe,{variant:"primary",disabled:r,onClick:()=>void s("create-job"),title:"Opens a Claude session to create a job",children:[v.jsx(Qn,{size:12})," New job"]})]})]}),v.jsx("div",{className:"no-scrollbar flex gap-1 overflow-x-auto border-b",children:[["jobs","Jobs",((u=e.data)==null?void 0:u.length)??0,"Every job of this project"],["queue","Queue",((f=i.data)==null?void 0:f.length)??0,a?`${a} waiting or running now`:"Nothing waiting or running now"]].map(([_,x,C,y])=>v.jsxs("button",{onClick:()=>p(_),title:y,className:ye("flex shrink-0 items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-xs transition-colors",l===_?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:[x,v.jsx("span",{className:ye("grid h-4 min-w-[1rem] place-items-center rounded-full px-1 text-[10px] font-semibold leading-none tabular-nums",_==="queue"&&a>0?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:C})]},_))}),l==="jobs"?(g=e.data)!=null&&g.length?v.jsx("div",{className:"divide-y rounded-md border",children:e.data.map(_=>v.jsx(B6,{job:_,onEdit:()=>void s("edit-job",_.id)},_.id))}):v.jsx(nn,{variant:"inline",title:"No jobs yet. A cron job runs a prompt on a schedule; a manual / webhook job runs when you press Run, type /job in a channel, or something calls its URL."}):(c=i.data)!=null&&c.length?v.jsx(H6,{runs:i.data}):v.jsx(nn,{variant:"inline",title:"Nothing has run yet."})]})})}function B6({job:e,onEdit:i}){var d;const r=mn(),l=`curl -X POST "${`${location.origin}${gi()}/trigger/${e.id}`}" -H "x-clauder-token: ${e.token}" -H "content-type: application/json" -d "{\\"issue\\":\\"ABC-123\\"}"`;return v.jsxs("div",{className:"px-3 py-2.5",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[e.kind==="cron"?v.jsx(kh,{size:14,className:"shrink-0 text-muted-foreground"}):v.jsx(Yw,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate text-xs font-medium",children:e.name}),!e.enabled&&v.jsx(nt,{tone:"off",children:"disabled"}),v.jsx(nt,{tone:"off",title:e.kind==="cron"?"Runs on its schedule while the hub runs, and whenever it is run by hand":"No schedule: runs when you press Run, type /job in a channel, or something calls its URL",children:e.kind==="cron"?"cron":"manual / webhook"}),v.jsx(nt,{tone:"off",children:e.category||"no category"}),v.jsx(P6,{job:e,curl:l}),v.jsxs("span",{className:"ml-auto flex gap-1",children:[v.jsx(xe,{variant:"ghost",size:"icon",title:"Run now",onClick:()=>{var a;const p=Object.fromEntries((e.params??[]).map(u=>[u.name,u.default]));r({title:`Run '${e.name}' now?`,description:"Joins the queue as an unattended session.",body:v.jsxs("div",{className:"space-y-3",children:[(a=e.params)!=null&&a.length?v.jsx(I6,{params:e.params,values:p}):null,v.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 text-[11px]",children:e.prompt})]}),confirmLabel:"Queue it",run:async()=>{var u;await ve.runJob(e.id,(u=e.params)!=null&&u.length?p:void 0),ge.getState().notify("Queued.")}})},children:v.jsx(ma,{size:13})}),v.jsx(xe,{variant:"ghost",size:"icon",title:"Edit with Claude",onClick:i,children:v.jsx(Wi,{size:13})}),v.jsx(xe,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void r({title:`Delete the job '${e.name}'?`,description:"Its schedule or webhook stops. Past runs stay.",confirmLabel:"Delete",tone:"destructive",run:()=>ve.deleteJob(e.id)}),children:v.jsx(yr,{size:13})})]})]}),v.jsx("div",{className:"mt-1 line-clamp-2 break-words pl-6 text-[11px] text-muted-foreground",children:e.prompt}),(d=e.params)!=null&&d.length?v.jsx("div",{className:"mt-1 flex flex-wrap gap-1 pl-6",children:e.params.map(p=>v.jsxs("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",title:p.description??p.label??p.name,children:[p.name,": ",p.type," = ",String(p.default)]},p.name))}):null,v.jsxs("div",{className:"mt-1 flex flex-wrap gap-3 pl-6 text-[11px] text-muted-foreground",children:[e.kind==="cron"?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"font-mono",children:e.schedule}),v.jsxs("span",{children:["next: ",e.nextRunAt?Xs(e.nextRunAt):"-"]})]}):v.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[v.jsxs("span",{className:"break-all font-mono",children:["POST ",gi(),"/trigger/",e.id]}),v.jsx(zl,{text:l}),v.jsx("span",{children:"copy curl"}),v.jsx(xe,{variant:"ghost",size:"icon",title:"New token",onClick:()=>void r({title:"Issue a new token?",description:"Callers using the old token stop working.",confirmLabel:"Issue new token",tone:"destructive",run:()=>ve.rotateJobToken(e.id)}),children:v.jsx(Xl,{size:11})})]}),v.jsxs("span",{children:["last run: ",e.lastRunAt?fs(e.lastRunAt):"never"]})]})]})}function P6({job:e,curl:i}){var s;const r=`curl -X POST "http://127.0.0.1:${location.port||80}${gi()}/jobs/${e.id}/run" -H "content-type: application/json" -d "{}"`;return v.jsxs(Fh,{align:"start",className:"w-[30rem] max-w-[calc(100vw-1rem)] space-y-2.5 text-[11px]",trigger:v.jsxs("button",{className:"flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground",title:"Every way to start this job",children:[v.jsx(Iw,{size:11})," How to run"]}),children:[v.jsxs("div",{className:"text-xs font-semibold",children:["How to run ‘",e.name,"’"]}),e.kind==="cron"?v.jsxs(ia,{title:"On its schedule",children:[v.jsx("span",{className:"font-mono",children:e.schedule}),", next ",e.nextRunAt?Xs(e.nextRunAt):"-",", while the hub runs",e.enabled?"":" (disabled now)","."]}):v.jsx(ia,{title:"No schedule",children:"It runs only when started one of the ways below."}),v.jsxs(ia,{title:"From this page",children:["Press ",v.jsx(ma,{size:11,className:"inline"})," Run. It asks first, then joins the project’s queue (one run at a time). In the queue below, ",v.jsx(Ah,{size:10,className:"inline"})," stops a running run and ",v.jsx(Vw,{size:10,className:"inline"})," resumes a stopped one where it left off."]}),v.jsxs(ia,{title:"From a channel",children:[v.jsxs("span",{className:"font-mono",children:["/job ",e.name]})," on Telegram (",v.jsx("span",{className:"font-mono",children:"!job"})," on Slack), or ",v.jsx("span",{className:"font-mono",children:"/jobs"})," and pick it. It asks before it queues. ",v.jsx("span",{className:"font-mono",children:"/stop"})," stops it, ",v.jsx("span",{className:"font-mono",children:"/resume"})," carries it on."]}),e.kind==="webhook"&&v.jsxs(ia,{title:"From another tool (webhook)",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsxs("span",{className:"min-w-0 break-all font-mono",children:["POST ",gi(),"/trigger/",e.id]}),v.jsx(zl,{text:i})]}),"With the header ",v.jsx("span",{className:"font-mono",children:"x-clauder-token"})," (the job’s token, in the copied curl; renew it with ",v.jsx(Xl,{size:10,className:"inline"})," on the row). The JSON body reaches the prompt as ",v.jsx("span",{className:"font-mono",children:"{{payload}}"})," or ",v.jsx("span",{className:"font-mono",children:"{{payload.field}}"}),"."]}),v.jsxs(ia,{title:"From an app on this machine",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsxs("span",{className:"min-w-0 break-all font-mono",children:["POST ",gi(),"/jobs/",e.id,"/run"]}),v.jsx(zl,{text:r})]}),"No token: the hub only listens on 127.0.0.1. An optional ",v.jsx("span",{className:"font-mono",children:'{"payload": {...}}'})," body fills the prompt as above",(s=e.params)!=null&&s.length?v.jsxs(v.Fragment,{children:[", and ",v.jsx("span",{className:"font-mono",children:'{"params": {...}}'})," sets its parameters (left out: their defaults)"]}):null,"."]})]})}function I6({params:e,values:i}){const[r,s]=P.useState(()=>Object.fromEntries(e.map(d=>[d.name,d.type==="boolean"?!!d.default:String(d.default)]))),l=(d,p)=>{s(a=>({...a,[d.name]:p})),i[d.name]=d.type==="number"&&typeof p=="string"&&p.trim()!==""&&Number.isFinite(Number(p))?Number(p):p};return v.jsx("div",{className:"space-y-2",children:e.map(d=>v.jsxs("div",{className:"space-y-1",children:[d.type==="boolean"?v.jsx(tc,{id:`param-${d.name}`,label:d.label||d.name,checked:r[d.name]===!0,onCheckedChange:p=>l(d,p)}):v.jsxs("label",{className:"block space-y-1",children:[v.jsxs("div",{className:"text-xs font-medium",children:[d.label||d.name," ",v.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:`{{${d.name}}}`})]}),v.jsx(Zn,{type:d.type==="number"?"number":"text",value:String(r[d.name]??""),onChange:p=>l(d,p.target.value)})]}),d.description&&v.jsx("div",{className:"text-[11px] text-muted-foreground",children:d.description})]},d.name))})}function ia({title:e,children:i}){return v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-foreground",children:e}),v.jsx("div",{className:"text-muted-foreground",children:i})]})}const z6={queued:"off",running:"warning",done:"success",exited:"off",cancelled:"off"};function H6({runs:e}){const i=ge(l=>l.go),r=mn(),s=l=>l.jobName??l.prompt.slice(0,60);return v.jsx("div",{className:"divide-y rounded-md border",children:e.map(l=>v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs",children:[v.jsx(nt,{tone:z6[l.status],children:l.status}),l.resume&&v.jsx(nt,{tone:"off",title:"Queued again to carry on its own session",children:"resumed"}),v.jsx("span",{className:"hidden w-16 shrink-0 text-[11px] text-muted-foreground sm:block",children:l.source}),v.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l.jobName&&v.jsxs("span",{className:"font-medium",children:[l.jobName,": "]}),v.jsx("span",{className:"text-muted-foreground",children:l.prompt})]}),l.params&&Object.keys(l.params).length>0&&v.jsx("span",{className:"hidden max-w-[40%] shrink-0 truncate font-mono text-[10px] text-muted-foreground md:block",title:JSON.stringify(l.params,null,2),children:Object.entries(l.params).map(([d,p])=>`${d}=${p}`).join(" ")}),v.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:fs(l.createdAt)}),l.sessionId&&v.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>i({kind:"session",id:l.sessionId}),children:"Open"}),l.status==="running"&&l.sessionId&&v.jsx(xe,{variant:"ghost",size:"icon",title:"Stop",onClick:()=>void r({title:`Stop '${s(l)}'?`,description:"Its terminal closes and the queue moves on. The conversation is kept: Resume carries on from where it stopped.",confirmLabel:"Stop",tone:"destructive",run:()=>ve.stopRun(l.id)}),children:v.jsx(Ah,{size:13})}),l.status==="exited"&&l.sessionId&&v.jsx(xe,{variant:"ghost",size:"icon",title:"Resume",onClick:()=>void r({title:`Resume '${s(l)}'?`,description:"Joins the back of the queue as an unattended run and carries on its own conversation from where it stopped.",confirmLabel:"Queue it",run:async()=>{const{position:d}=await ve.resumeRun(l.id);ge.getState().notify(`Queued, number ${d} in line.`)}}),children:v.jsx(Vw,{size:13})}),l.status==="queued"&&v.jsx(xe,{variant:"ghost",size:"icon",title:"Cancel",onClick:()=>void it(()=>ve.cancelRun(l.id)),children:v.jsx(pn,{size:13})})]},l.id))})}function ss({label:e,value:i,hint:r}){return v.jsxs("div",{className:"card px-3 py-2.5",title:r,children:[v.jsx("div",{className:"text-[11px] text-muted-foreground",children:e}),v.jsx("div",{className:"mt-0.5 text-lg font-semibold tabular-nums",children:i})]})}function RC({tokens:e}){return v.jsxs("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:[v.jsx(ss,{label:"Input",value:On(e.input),hint:`${e.input.toLocaleString()} uncached input tokens`}),v.jsx(ss,{label:"Output",value:On(e.output),hint:`${e.output.toLocaleString()} output tokens`}),v.jsx(ss,{label:"Cache read",value:On(e.cacheRead),hint:`${e.cacheRead.toLocaleString()} tokens read from the prompt cache`}),v.jsx(ss,{label:"Cache write",value:On(e.cacheCreation),hint:`${e.cacheCreation.toLocaleString()} tokens written to the prompt cache`})]})}function as({rows:e,empty:i="Nothing yet.",limit:r=12,format:s=On}){const[l,d]=P.useState(!1);if(!e.length)return v.jsx("div",{className:"px-1 py-2 text-xs text-muted-foreground",children:i});const p=[...e].sort((f,g)=>g.value-f.value),a=l?p:p.slice(0,r),u=Math.max(...p.map(f=>f.value),1);return v.jsxs("div",{className:"space-y-1.5",children:[a.map(f=>v.jsxs("div",{className:"group",title:`${f.label}: ${f.value.toLocaleString()}${f.note?` (${f.note})`:""}`,children:[v.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[v.jsxs("span",{className:"min-w-0 truncate font-mono text-[11px]",children:[f.label,f.sublabel&&v.jsx("span",{className:"ml-1.5 font-sans text-muted-foreground",children:f.sublabel})]}),v.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[s(f.value),f.note&&v.jsx("span",{className:"ml-1 text-severity-critical",children:f.note})]})]}),v.jsx("div",{className:"mt-0.5 h-1.5 rounded-full bg-foreground/10",children:v.jsx("div",{className:"h-1.5 rounded-full bg-series transition-all group-hover:opacity-80",style:{width:`${Math.max(2,f.value/u*100)}%`}})})]},f.key)),p.length>r&&v.jsx("button",{className:"text-[11px] text-muted-foreground hover:text-foreground",onClick:()=>d(!l),children:l?"Show fewer":`Show all ${p.length}`})]})}function F6({days:e,valueOf:i,label:r}){const[s,l]=P.useState(null),d=Object.entries(e).sort(([f],[g])=>f.localeCompare(g)).slice(-30);if(!d.length)return v.jsx("div",{className:"px-1 py-2 text-xs text-muted-foreground",children:"No sessions yet."});const p=Math.max(...d.map(([,f])=>i(f)),1),a=s??d[d.length-1][0],u=i(e[a]);return v.jsxs("div",{children:[v.jsxs("div",{className:"mb-2 flex items-baseline gap-2 text-xs",children:[v.jsx("span",{className:"font-medium tabular-nums",children:On(u)}),v.jsxs("span",{className:"text-muted-foreground",children:[r," on ",a]})]}),v.jsx("div",{className:"flex h-28 items-end gap-[2px]",onMouseLeave:()=>l(null),children:d.map(([f,g])=>{const c=i(g);return v.jsx("div",{className:"flex h-full max-w-8 flex-1 cursor-default items-end",onMouseEnter:()=>l(f),children:v.jsx("div",{className:ye("w-full rounded-t bg-series transition-opacity",s&&s!==f&&"opacity-50"),style:{height:`${Math.max(2,c/p*100)}%`}})},f)})}),v.jsxs("div",{className:"mt-1 flex justify-between text-[10px] text-muted-foreground",children:[v.jsx("span",{children:d[0][0]}),v.jsx("span",{children:d[d.length-1][0]})]})]})}function Lt({title:e,description:i,children:r,action:s,className:l}){return v.jsxs("section",{className:ye("card p-4",l),children:[v.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[v.jsxs("div",{children:[v.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e}),i&&v.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:i})]}),s]}),r]})}const U6=[{name:"feature",description:"New behaviour",deliverables:[{name:"PR",description:"link to the pull request",required:!0},{name:"Documentation",description:"path or link to the docs written or updated",required:!0},{name:"Test evidence",description:"how it was tested and the result",required:!0}]},{name:"bugfix",description:"A defect fixed",deliverables:[{name:"PR",description:"link to the pull request",required:!0},{name:"RCA",description:"root cause analysis, a few sentences or a file path",required:!0},{name:"Test evidence",description:"the failing case now passing",required:!0}]}];function $6(){var s;const e=ct(()=>ve.categories(),[]),{starting:i,start:r}=io();return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Settings"}),v.jsx("h1",{className:"text-base font-semibold",children:"Task categories"}),v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"What counts as done for each kind of task.",children:"What counts as done for each kind of task."})]}),v.jsxs(xe,{variant:"primary",className:"shrink-0",disabled:i,onClick:()=>void r("create-category"),title:"Opens a Claude session to define a category",children:[v.jsx(Qn,{size:12})," New category"]})]}),(s=e.data)==null?void 0:s.map(l=>v.jsx(q6,{category:l,onEdit:()=>void r("edit-category",l.id),onDeleted:e.reload},l.id)),e.data&&!e.data.length&&v.jsx(nn,{title:"No categories yet.",hint:"Without any, a triggered session reports a summary and evidence of its own choosing. Start from the examples, or describe your own to Claude."}),e.data&&!e.data.length&&v.jsx("div",{className:"flex justify-center",children:v.jsx(xe,{onClick:()=>void Promise.all(U6.map(l=>ve.saveCategory(l))).then(e.reload),children:"Add the feature and bugfix examples"})})]})})}function q6({category:e,onEdit:i,onDeleted:r}){const s=mn();return v.jsx(Lt,{title:e.name,description:e.description||void 0,action:v.jsxs("div",{className:"flex gap-1",children:[v.jsx(xe,{variant:"ghost",size:"icon",title:"Edit with Claude",onClick:i,children:v.jsx(Wi,{size:13})}),v.jsx(xe,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void s({title:`Delete the category '${e.name}'?`,description:"Sessions using it can no longer close against it.",confirmLabel:"Delete",tone:"destructive",run:async()=>{await ve.deleteCategory(e.id),r()}}),children:v.jsx(yr,{size:13})})]}),children:e.deliverables.length?v.jsx("div",{className:"divide-y rounded-md border",children:e.deliverables.map(l=>v.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"text-xs font-medium",children:l.name}),l.description&&v.jsx("div",{className:"break-words text-[11px] text-muted-foreground",children:l.description})]}),v.jsx(nt,{tone:l.required?"on":"off",children:l.required?"required":"optional"})]},l.name))}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No fixed deliverables."})})}const V6={permission:"Permission requests",question:"Questions",turn:"End of each turn",mcp:"MCP suggestions",done:"Task done"},Hm="clauder:highlight-notifications";let Fm=!1;function W6(){Fm=!0,ge.getState().go({kind:"page",page:"channels"}),window.dispatchEvent(new Event(Hm))}function AC({on:e,label:i,onToggle:r,className:s}){return v.jsx("button",{role:"switch","aria-checked":e,"aria-label":i,title:i,onClick:r,className:ye("relative h-5 w-9 shrink-0 rounded-full transition-colors",e?"bg-primary":"bg-foreground/20",s),children:v.jsx("span",{className:ye("absolute top-0.5 h-4 w-4 rounded-full bg-background transition-all",e?"left-[18px]":"left-0.5")})})}function DC({global:e=!1}){var C,y,m,b,S;const i=ct(()=>ve.channels(),["channels"]),{starting:r,start:s}=io(),l=mn(),d=((C=i.data)==null?void 0:C.kinds)??[],p=((y=i.data)==null?void 0:y.paused)??!1,a=new Set(((m=i.data)==null?void 0:m.notifyKinds)??[]),u=(b=i.data)==null?void 0:b.channels.find(w=>w.kind==="device"),f=(((S=i.data)==null?void 0:S.channels)??[]).filter(w=>w.kind!=="device"),g=P.useRef(null),[c,_]=P.useState(!1);P.useEffect(()=>{const w=()=>{!Fm||!g.current||(Fm=!1,g.current.scrollIntoView({block:"center",behavior:"smooth"}),_(!0),window.setTimeout(()=>_(!1),2200))};return w(),window.addEventListener(Hm,w),()=>window.removeEventListener(Hm,w)},[i.data!==null]);const x=w=>void it(()=>ve.setNotifyKinds(a.has(w)?[...a].filter(T=>T!==w):[...a,w]));return v.jsx("div",{className:e?"":"h-full overflow-y-auto",children:v.jsxs("div",{className:ye("space-y-4",!e&&"p-5"),children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:e?"Every project":"Settings"}),v.jsx("h1",{className:"text-base font-semibold",children:e?"Global channels":"Channels"}),e?v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"One bot for every project: their questions arrive here, named after the project, and /projects, /use pick one.",children:"One bot for every project: their questions arrive here, named after the project."}):v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"Where sessions reach you. A reply goes back into the session.",children:"Where sessions reach you. A reply goes back into the session."})]}),v.jsxs(xe,{variant:"primary",className:"shrink-0",disabled:r,onClick:()=>void s("create-channel"),title:"Opens a Claude session to connect a channel",children:[v.jsx(Qn,{size:12})," Add channel"]})]}),i.data&&v.jsx(Lt,{title:"Notifications",description:p?"Paused: no channel hears of anything; questions still wait in the inbox.":"For every channel below, this computer included.",action:v.jsxs("div",{ref:g,className:ye("flex items-center gap-2 rounded-full py-0.5 pl-2.5 pr-0.5 transition-shadow",c&&"ring-2 ring-primary ring-offset-2 ring-offset-background animate-pulse"),children:[v.jsx("span",{className:ye("text-[11px] font-medium",p?"text-severity-warning":"text-muted-foreground"),children:p?"Paused on every channel":"On for every channel"}),v.jsx(AC,{on:!p,label:p?"Turn notifications back on":"Pause notifications on every channel",onToggle:()=>void it(()=>ve.setNotificationsPaused(!p))})]}),children:v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[v.jsx("span",{className:"mr-1 text-[11px] text-muted-foreground",children:"Notify for"}),(i.data.interactionKinds??[]).map(w=>v.jsx("button",{disabled:p,onClick:()=>x(w),className:ye("rounded-full border px-2.5 py-0.5 text-[11px] transition-colors disabled:cursor-not-allowed disabled:opacity-40",a.has(w)?"border-primary bg-primary/15 text-foreground":"text-muted-foreground hover:bg-muted"),children:V6[w]??w},w))]})}),v.jsx(Lt,{title:"Channels",description:"Send /help to the Telegram bot, or !help in the Slack channel, for the commands: new session, run, sessions, summary, stop, queue.",children:i.data&&(!e||f.length)?v.jsxs("div",{className:"divide-y rounded-md border",children:[!e&&v.jsx(G6,{channel:u}),f.map(w=>{var T;return v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[v.jsx(Kl,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[v.jsx("span",{className:"min-w-0 truncate font-medium",children:w.name}),v.jsx(nt,{tone:"off",children:((T=d.find(D=>D.kind===w.kind))==null?void 0:T.label)??w.kind}),v.jsx(nt,{tone:w.status.ok?"success":w.enabled?"warning":"off",children:w.status.ok?"connected":w.enabled?"not connected":"off"})]}),v.jsx("div",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:w.status.detail}),w.kind==="http"&&v.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground",children:[v.jsxs("span",{className:"truncate font-mono",children:["POST ",`${location.origin}${gi()}/channels/${w.id}/reply`]}),v.jsx(zl,{text:`${location.origin}${gi()}/channels/${w.id}/reply`})]})]}),v.jsx(xe,{variant:"ghost",size:"icon",title:"Send a test message",onClick:()=>void it(()=>ve.testChannel(w.id),"Test message sent."),children:v.jsx(qw,{size:13})}),v.jsx(xe,{variant:"ghost",size:"icon",title:"Edit with Claude",onClick:()=>void s("edit-channel",w.id),children:v.jsx(Wi,{size:13})}),v.jsx(xe,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void l({title:`Remove '${w.name}'?`,description:"Sessions stop reaching you there.",confirmLabel:"Remove",tone:"destructive",run:()=>ve.deleteChannel(w.id)}),children:v.jsx(yr,{size:13})})]},w.id)})]}):i.data&&v.jsx(nn,{variant:"inline",title:"No channels yet. Without one, questions wait in the dashboard's inbox and the terminal."})})]})})}function G6({channel:e}){const i=!!(e!=null&&e.enabled),r=()=>it(()=>ve.saveChannel({id:e==null?void 0:e.id,kind:"device",name:"This computer",config:{},enabled:!i,kinds:e==null?void 0:e.kinds}));return v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[v.jsx(f4,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[v.jsx("span",{className:"min-w-0 truncate font-medium",children:"This computer"}),v.jsx(nt,{tone:"off",children:"System notifications"}),v.jsx(nt,{tone:i&&(e!=null&&e.status.ok)?"success":i?"warning":"off",children:i?e!=null&&e.status.ok?"on":"not working":"off"})]}),v.jsx("div",{className:ye("mt-0.5 truncate text-[11px]",i&&e&&!e.status.ok?"text-severity-critical":"text-muted-foreground"),children:i&&e&&!e.status.ok?e.status.detail:"From the hub itself; they arrive even with the browser closed."})]}),i&&e&&v.jsx(xe,{variant:"ghost",size:"icon",title:"Send a test notification",onClick:()=>void it(()=>ve.testChannel(e.id),"Test notification sent."),children:v.jsx(qw,{size:13})}),v.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:i?"On":"Off"}),v.jsx(AC,{on:i,label:i?"Stop notifying on this computer":"Notify on this computer",onToggle:()=>void r()})]})}function Er({group:e,title:i,description:r,action:s}){return v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:e}),v.jsx("h1",{className:"text-base font-semibold",children:i}),r&&v.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",title:r,children:r})]}),s&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:s})]})}function Zg({onClick:e}){return v.jsxs(xe,{variant:"ghost",className:"-ml-2 mb-3 md:hidden",onClick:e,children:[v.jsx(G3,{size:13})," Back"]})}function Fs({label:e,hint:i,children:r}){return v.jsxs("label",{className:"block space-y-1",children:[v.jsx("div",{className:"text-xs font-medium",children:e}),r,i&&v.jsx("div",{className:"text-[11px] text-muted-foreground",children:i})]})}var Y6=Object.defineProperty,K6=(e,i)=>Y6(e,"name",{value:i,configurable:!0});function Um(e,[i,r]){return Math.min(r,Math.max(i,e))}K6(Um,"clamp");var X6=Object.defineProperty,Yt=(e,i)=>X6(e,"name",{value:i,configurable:!0});function LC(e){const i=e+"CollectionProvider",[r,s]=br(i),[l,d]=r(i,{collectionRef:{current:null},itemMap:new Map}),p=Yt(y=>{const{scope:m,children:b}=y,S=P.useRef(null),w=P.useRef(new Map).current;return v.jsx(l,{scope:m,itemMap:w,collectionRef:S,children:b})},"CollectionProvider");p.displayName=i;const a=e+"CollectionSlot",u=gr(a),f=P.forwardRef((y,m)=>{const{scope:b,children:S}=y,w=d(a,b),T=ht(m,w.collectionRef);return v.jsx(u,{ref:T,children:S})});f.displayName=a;const g=e+"CollectionItemSlot",c="data-radix-collection-item",_=gr(g),x=P.forwardRef((y,m)=>{const{scope:b,children:S,...w}=y,T=P.useRef(null),D=ht(m,T),R=d(g,b);return P.useEffect(()=>(R.itemMap.set(T,{ref:T,...w}),()=>void R.itemMap.delete(T))),v.jsx(_,{[c]:"",ref:D,children:S})});x.displayName=g;function C(y){const m=d(e+"CollectionConsumer",y);return P.useCallback(()=>{const S=m.collectionRef.current;if(!S)return[];const w=Array.from(S.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((R,L)=>w.indexOf(R.ref.current)-w.indexOf(L.ref.current))},[m.collectionRef,m.itemMap])}return Yt(C,"useCollection"),[{Provider:p,Slot:f,ItemSlot:x},C,s]}Yt(LC,"createCollection");var eb=new WeakMap,Nt,Xn,qu=(Xn=class extends Map{constructor(r){super(r);sy(this,Nt);jp(this,Nt,[...super.keys()]),eb.set(this,!0)}set(r,s){return eb.get(this)&&!this.has(r)&&un(this,Nt).push(r),super.set(r,s),this}insert(r,s,l){const d=this.has(s),p=d?this.size:this.size+1,a=Jg(r),u=a>=0?Math.min(a,p-1):Math.max(p+a,0);if(d?un(this,Nt).indexOf(s)===u:u===this.size)return this.set(s,l),this;const f=un(this,Nt).filter(c=>c!==s);f.splice(u,0,s);const g=f.map(c=>[c,c===s?l:this.get(c)]);this.clear();for(const[c,_]of g)this.set(c,_);return this}with(r,s,l){const d=new Xn(this);return d.insert(r,s,l),d}before(r){const s=un(this,Nt).indexOf(r)-1;if(!(s<0))return this.entryAt(s)}setBefore(r,s,l){const d=un(this,Nt).indexOf(r);if(d===-1)return this;const p=un(this,Nt).indexOf(s),a=p!==-1&&p<d?d-1:d;return this.insert(a,s,l)}after(r){let s=un(this,Nt).indexOf(r);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(r,s,l){const d=un(this,Nt).indexOf(r);if(d===-1)return this;const p=un(this,Nt).indexOf(s),a=p!==-1&&p<=d?d:d+1;return this.insert(a,s,l)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return jp(this,Nt,[]),super.clear()}delete(r){const s=super.delete(r);return s&&un(this,Nt).splice(un(this,Nt).indexOf(r),1),s}deleteAt(r){const s=this.keyAt(r);return s!==void 0?this.delete(s):!1}at(r){const s=nh(un(this,Nt),r);if(s!==void 0)return this.get(s)}entryAt(r){const s=nh(un(this,Nt),r);if(s!==void 0)return[s,this.get(s)]}indexOf(r){return un(this,Nt).indexOf(r)}keyAt(r){return nh(un(this,Nt),r)}from(r,s){const l=this.indexOf(r);if(l===-1)return;let d=l+s;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(r,s){const l=this.indexOf(r);if(l===-1)return;let d=l+s;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(r,s){let l=0;for(const d of this){if(Reflect.apply(r,s,[d,l,this]))return d;l++}}findIndex(r,s){let l=0;for(const d of this){if(Reflect.apply(r,s,[d,l,this]))return l;l++}return-1}filter(r,s){const l=[];let d=0;for(const p of this)Reflect.apply(r,s,[p,d,this])&&l.push(p),d++;return new Xn(l)}map(r,s){const l=[];let d=0;for(const p of this)l.push([p[0],Reflect.apply(r,s,[p,d,this])]),d++;return new Xn(l)}reduce(...r){const[s,l]=r,d=r.length>1;if(!d&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let p=0,a=l;for(const u of this)p===0&&!d?a=u:a=Reflect.apply(s,this,[a,u,p,this]),p++;return a}reduceRight(...r){const[s,l]=r,d=r.length>1;if(!d&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let p=l;for(let a=this.size-1;a>=0;a--){const u=this.entryAt(a);a===this.size-1&&!d?p=u:p=Reflect.apply(s,this,[p,u,a,this])}return p}sort(r){if(typeof r!="function")throw new TypeError("OrderedDict.sort requires a compare function");const s=[...this.entries()].sort(r);this.clear();for(const[l,d]of s)this.set(l,d);return this}toSorted(r){if(typeof r!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const s=[...this.entries()].sort(r);return new Xn(s)}toReversed(){const r=new Xn;for(let s=this.size-1;s>=0;s--){const l=this.keyAt(s),d=this.get(l);r.set(l,d)}return r}toSpliced(...r){const s=[...this.entries()];return s.splice(...r),new Xn(s)}slice(r,s){const l=new Xn;for(const d of un(this,Nt).slice(r,s))l.set(d,this.get(d));return l}every(r,s){let l=0;for(const d of this){if(!Reflect.apply(r,s,[d,l,this]))return!1;l++}return!0}some(r,s){let l=0;for(const d of this){if(Reflect.apply(r,s,[d,l,this]))return!0;l++}return!1}},Nt=new WeakMap,Yt(Xn,"OrderedDict"),Xn);function nh(e,i){if("at"in Array.prototype)return Array.prototype.at.call(e,i);const r=MC(e,i);return r===-1?void 0:e[r]}Yt(nh,"at");function MC(e,i){const r=e.length,s=Jg(i),l=s>=0?s:r+s;return l<0||l>=r?-1:l}Yt(MC,"toSafeIndex");function Jg(e){return e!==e||e===0?0:Math.trunc(e)}Yt(Jg,"toSafeInteger");function Q6(e){const i=e+"CollectionProvider",[r,s]=br(i),[l,d]=r(i);l.displayName=e+"CollectionStableContextProvider";const[p,a]=r(i);p.displayName=e+"CollectionStatefulContextProvider";const u=Yt(({state:R,...L})=>R?v.jsx(g,{...L,state:R}):v.jsx(f,{...L}),"CollectionProvider");u.displayName=i;const f=Yt(R=>{const L=S();return v.jsx(g,{...R,state:L})},"CollectionInit");f.displayName=e+"CollectionInit";const g=Yt(R=>{const{scope:L,children:A,state:j}=R,M=P.useRef(null),[I,B]=P.useState(null),H=ht(M,B),[F,W]=j,G=P.useRef(new qu),Q=P.useCallback(()=>{const X=G.current;return NC(X)||X.sort(ih),X},[]);return P.useEffect(()=>{if(!I)return;const X=BC(()=>{W(z=>{const O=z.toSorted(ih);return O.some(([Z],U)=>z.keyAt(U)!==Z)?O:z})});return X.observe(I,{childList:!0,subtree:!0}),()=>{X.disconnect()}},[I,W]),v.jsx(l,{scope:L,collectionElementRef:H,collectionElementRefObject:M,getCollection:Q,setCollection:W,registryRef:G,children:v.jsx(p,{scope:L,collectionElement:I,collection:F,children:A})})},"CollectionProviderImpl");g.displayName=e+"CollectionProviderImpl";const c=e+"CollectionSlot",_=gr(c),x=P.forwardRef((R,L)=>{const{scope:A,children:j}=R,M=d(c,A),I=ht(L,M.collectionElementRef);return v.jsx(_,{ref:I,children:j})});x.displayName=c;const C=e+"CollectionItemSlot",y="data-radix-collection-item",m=gr(C),b=P.forwardRef((R,L)=>{const{scope:A,children:j,...M}=R,I=P.useRef(null),B=d(C,A),{setCollection:H,registryRef:F}=B,W=P.useRef(M);jC(W.current,M)||(W.current=M);const G=W.current,Q=P.useCallback(O=>{const Y=F.current;O?Y.set(O,{...W.current,element:O}):I.current&&Y.delete(I.current)},[F]),X=ht(L,Q,I);$t(()=>{const O=I.current,Y=F.current;O&&Y.has(O)&&Y.set(O,{...G,element:O})},[G,F]);const z=P.useRef(null);return P.useEffect(()=>{const O=I.current,Y=z.current;((Y==null?void 0:Y.element)??null)===O&&(!O||(Y==null?void 0:Y.itemData)===G)||(z.current=O?{element:O,itemData:G}:null,H(Z=>{const U=new qu(Z);return Y&&Y.element!==O&&U.delete(Y.element),O&&U.set(O,{...G,element:O}),U.sort(ih)}))}),P.useEffect(()=>()=>{const O=z.current;z.current=null,O&&H(Y=>{if(!Y.has(O.element))return Y;const Z=new qu(Y);return Z.delete(O.element),Z})},[H]),v.jsx(m,{[y]:"",ref:X,children:j})});b.displayName=C;function S(){return P.useState(new qu)}Yt(S,"useInitCollection");function w(R){const{collection:L}=a(e+"CollectionConsumer",R);return L}Yt(w,"useCollection");function T(R){const{getCollection:L}=d(e+"CollectionConsumer",R);return L}return Yt(T,"useGetCollection"),[{Provider:u,Slot:x,ItemSlot:b},{createCollectionScope:s,useCollection:w,useGetCollection:T,useInitCollection:S}]}Yt(Q6,"createCollection");function jC(e,i){if(e===i)return!0;if(typeof e!="object"||typeof i!="object"||e==null||i==null)return!1;const r=Object.keys(e),s=Object.keys(i);if(r.length!==s.length)return!1;for(const l of r)if(!Object.prototype.hasOwnProperty.call(i,l)||e[l]!==i[l])return!1;return!0}Yt(jC,"shallowEqual");function OC(e,i){return!!(i.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Yt(OC,"isElementPreceding");function NC(e){let i;for(const r of e.keys()){if(i){const s=i.compareDocumentPosition(r);if(!(s&Node.DOCUMENT_POSITION_DISCONNECTED)&&s&Node.DOCUMENT_POSITION_PRECEDING)return!1}i=r}return!0}Yt(NC,"isInDocumentOrder");function ih(e,i){return!e[1].element||!i[1].element?0:OC(e[1].element,i[1].element)?-1:1}Yt(ih,"sortByDocumentPosition");function BC(e){return new MutationObserver(r=>{for(const s of r)if(s.type==="childList"){e();return}})}Yt(BC,"getChildListObserver");var Z6=Object.defineProperty,J6=(e,i)=>Z6(e,"name",{value:i,configurable:!0}),eD={LTR:"ltr"},tD=P.createContext(void 0);function PC(e){const i=P.useContext(tD);return e||i||eD.LTR}J6(PC,"useDirection");var nD=Object.defineProperty,iD=(e,i)=>nD(e,"name",{value:i,configurable:!0}),IC=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"}),rD=P.forwardRef(iD(function(i,r){return v.jsx(St.span,{...i,ref:r,style:{...IC,...i.style}})},"VisuallyHidden")),sD=Object.defineProperty,mt=(e,i)=>sD(e,"name",{value:i,configurable:!0}),tb={ItemAligned:"item-aligned",Popper:"popper"},oD={RTL:"rtl"},aD=[" ","Enter","ArrowUp","ArrowDown"],lD=[" ","Enter"],ga="Select",[Uh,ev,cD]=LC(ga),[ro,$B]=br(ga,[cD,ka]),tv=ka(),[uD,ms]=ro(ga),[hD,dD]=ro(ga);function zC(e){const{__scopeSelect:i,children:r,open:s,defaultOpen:l,onOpenChange:d,value:p,defaultValue:a,onValueChange:u,dir:f,name:g,autoComplete:c,disabled:_,required:x,form:C,internal_do_not_use_render:y}=e,m=tv(i),[b,S]=P.useState(null),[w,T]=P.useState(null),[D,R]=P.useState(!1),L=PC(f),[A,j]=Qs({prop:s,defaultProp:l??!1,onChange:d,caller:ga}),[M,I]=Qs({prop:p,defaultProp:a,onChange:u,caller:ga}),B=P.useRef(null),H=P.useRef(!1),[F,W]=P.useState(null),G=mt(le=>{W({value:le,hasConsumerStoppedPropagation:H.current}),I(le)},"handleUserSelect"),Q=P.useRef(M);P.useEffect(()=>{const le=C?b==null?void 0:b.ownerDocument.getElementById(C):b==null?void 0:b.form;if(le instanceof HTMLFormElement){const K=mt(()=>I(Q.current),"reset");return le.addEventListener("reset",K),()=>le.removeEventListener("reset",K)}},[C,b,I]);const X=b?!!C||!!b.closest("form"):!0,[z,O]=P.useState(new Set),Y=Ui(),Z=Array.from(z).map(le=>le.props.value).join(";"),U=P.useCallback(le=>{O(K=>new Set(K).add(le))},[]),V=P.useCallback(le=>{O(K=>{const $=new Set(K);return $.delete(le),$})},[]),ne={required:x,trigger:b,onTriggerChange:S,valueNode:w,onValueNodeChange:T,valueNodeHasChildren:D,onValueNodeHasChildrenChange:R,contentId:Y,value:M,onValueChange:I,hasConsumerStoppedPropagationRef:H,userSelection:F,onUserSelect:G,open:A,onOpenChange:j,dir:L,triggerPointerDownPosRef:B,disabled:_,name:g,autoComplete:c,form:C,nativeOptions:z,nativeSelectKey:Z,isFormControl:X};return v.jsx(Wg,{...m,children:v.jsx(uD,{scope:i,...ne,children:v.jsx(Uh.Provider,{scope:i,children:v.jsx(hD,{scope:i,onNativeOptionAdd:U,onNativeOptionRemove:V,children:UC(y)?y(ne):r})})})})}mt(zC,"SelectProvider");var fD=mt(e=>{const{__scopeSelect:i,children:r,...s}=e;return v.jsx(zC,{__scopeSelect:i,...s,internal_do_not_use_render:({isFormControl:l})=>v.jsxs(v.Fragment,{children:[r,l?v.jsx(ID,{__scopeSelect:i}):null]})})},"Select"),pD="SelectTrigger",mD=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,disabled:l=!1,...d}=i,p=tv(s),a=ms(pD,s),u=a.disabled||l,f=ht(r,a.onTriggerChange),g=ev(s),c=P.useRef("touch"),[_,x,C]=nv(m=>{const b=g().filter(T=>!T.disabled),S=b.find(T=>T.value===a.value),w=iv(b,m,S);w!==void 0&&a.onUserSelect(w.value)}),y=mt(m=>{u||(a.onOpenChange(!0),C()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})},"handleOpen");return v.jsx(Gg,{asChild:!0,...p,children:v.jsx(St.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":nc(a.value)?"":void 0,...d,ref:f,onClick:tt(d.onClick,m=>{m.currentTarget.focus(),c.current!=="mouse"&&y(m)}),onPointerDown:tt(d.onPointerDown,m=>{c.current=m.pointerType;const b=m.target;b.hasPointerCapture(m.pointerId)&&b.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:tt(d.onKeyDown,m=>{const b=_.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&(a.hasConsumerStoppedPropagationRef.current=m.isPropagationStopped(),x(m.key)),!(b&&m.key===" ")&&aD.includes(m.key)&&(y(),m.preventDefault())})})})},"SelectTrigger")),gD="SelectValue",vD=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,className:l,style:d,children:p,placeholder:a="",...u}=i,f=ms(gD,s),{onValueNodeHasChildrenChange:g}=f,c=p!==void 0,_=ht(r,f.onValueNodeChange);$t(()=>{g(c)},[g,c]);const x=nc(f.value);return v.jsx(St.span,{...u,asChild:x?!1:u.asChild,ref:_,style:{pointerEvents:"none"},children:v.jsx(P.Fragment,{children:x?a:p},x?"placeholder":"value")})},"SelectValue")),_D=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,children:l,...d}=i;return v.jsx(St.span,{"aria-hidden":!0,...d,ref:r,children:l||"▼"})},"SelectIcon")),xD="SelectPortal",[yD,bD]=ro(xD,{forceMount:void 0}),wD=mt(e=>{const{__scopeSelect:i,forceMount:r,...s}=e;return v.jsx(yD,{scope:e.__scopeSelect,forceMount:r,children:v.jsx(Lh,{asChild:!0,...s})})},"SelectPortal"),eo="SelectContent",SD=P.forwardRef(mt(function(i,r){const s=bD(eo,i.__scopeSelect),{forceMount:l=s.forceMount,...d}=i,p=ms(eo,i.__scopeSelect),[a,u]=P.useState();return $t(()=>{u(new DocumentFragment)},[]),v.jsx(wr,{present:l||p.open,children:({present:f})=>f?v.jsx(kD,{...d,ref:r}):v.jsx(CD,{...d,fragment:a})})},"SelectContent")),CD=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,children:l,fragment:d}=i;return d?Jl.createPortal(v.jsx(HC,{scope:s,children:v.jsx(Uh.Slot,{scope:s,children:v.jsx("div",{ref:r,children:l})})}),d):null},"SelectContentFragment")),Si=10,[HC,$h]=ro(eo),ED=gr("SelectContent.RemoveScroll"),kD=P.forwardRef(mt(function(i,r){const{__scopeSelect:s}=i,{position:l=tb.ItemAligned,onCloseAutoFocus:d,onEscapeKeyDown:p,onPointerDownOutside:a,side:u,sideOffset:f,align:g,alignOffset:c,arrowPadding:_,collisionBoundary:x,collisionPadding:C,sticky:y,hideWhenDetached:m,avoidCollisions:b,...S}=i,w=ms(eo,s),[T,D]=P.useState(null),[R,L]=P.useState(null),A=ht(r,D),[j,M]=P.useState(null),[I,B]=P.useState(null),H=ev(s),[F,W]=P.useState(!1),G=P.useRef(!1),Q=P.useRef(!1),X=P.useRef(!1);P.useEffect(()=>{if(T)return Og(T)},[T]),ec();const z=P.useCallback(ee=>{const[ue,...he]=H().map(Re=>Re.ref.current),[Se]=he.slice(-1),we=document.activeElement;for(const Re of ee)if(Re===we||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===ue&&R&&(R.scrollTop=0),Re===Se&&R&&(R.scrollTop=R.scrollHeight),Re==null||Re.focus(),document.activeElement!==we))return},[H,R]),O=P.useCallback(()=>z([j,T]),[z,j,T]);P.useEffect(()=>{F&&O()},[F,O]);const{onOpenChange:Y,triggerPointerDownPosRef:Z}=w;P.useEffect(()=>{if(T){let ee={x:0,y:0};const ue=mt(Se=>{var we,Re;ee={x:Math.abs(Math.round(Se.pageX)-(((we=Z.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(Se.pageY)-(((Re=Z.current)==null?void 0:Re.y)??0))}},"handlePointerMove"),he=mt(Se=>{ee.x<=10&&ee.y<=10?Se.preventDefault():Se.composedPath().includes(T)||Y(!1),document.removeEventListener("pointermove",ue),Z.current=null},"handlePointerUp");return Z.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",he,{capture:!0})}}},[T,Y,Z]),P.useEffect(()=>{const ee=mt(()=>Y(!1),"close");return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[Y]);const[U,V]=nv(ee=>{const ue=H().filter(we=>!we.disabled),he=ue.find(we=>we.ref.current===document.activeElement),Se=iv(ue,ee,he);Se&&setTimeout(()=>{var we;return(we=Se.ref.current)==null?void 0:we.focus()})}),ne=P.useCallback((ee,ue,he)=>{const Se=!Q.current;Se&&(Q.current=!0);const we=!G.current&&!he;w.value!==void 0&&w.value===ue||we?(M(ee),we&&(G.current=!0)):Se&&M(ee)},[w.value]),le=P.useCallback(()=>T==null?void 0:T.focus(),[T]),K=P.useCallback((ee,ue,he)=>{if(!ee)return;const Se=!X.current;Se&&(X.current=!0);const we=!G.current&&!he;(w.value!==void 0&&w.value===ue||we||Se)&&B(ee)},[w.value]),$=l===tb.Popper?nb:TD,oe=$===nb?{side:u,sideOffset:f,align:g,alignOffset:c,arrowPadding:_,collisionBoundary:x,collisionPadding:C,sticky:y,hideWhenDetached:m,avoidCollisions:b}:{};return v.jsx(HC,{scope:s,content:T,viewport:R,onViewportChange:L,itemRefCallback:ne,selectedItem:j,onItemLeave:le,itemTextRefCallback:K,focusSelectedItem:O,selectedItemText:I,position:l,isPositioned:F,searchRef:U,children:v.jsx(jh,{as:ED,allowPinchZoom:!0,children:v.jsx(Rg,{asChild:!0,trapped:w.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:tt(d,ee=>{var ue;(ue=w.trigger)==null||ue.focus({preventScroll:!0}),ee.preventDefault()}),children:v.jsx(Dh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:a,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:v.jsx($,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:ee=>ee.preventDefault(),...S,...oe,onPlaced:()=>W(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:tt(S.onKeyDown,ee=>{const ue=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ue&&ee.key.length===1&&V(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let Se=H().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const we=ee.target,Re=Se.indexOf(we);Se=Se.slice(Re+1)}setTimeout(()=>z(Se)),ee.preventDefault()}})})})})})})},"SelectContentImpl")),TD=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,onPlaced:l,...d}=i,p=ms(eo,s),a=$h(eo,s),[u,f]=P.useState(null),[g,c]=P.useState(null),_=ht(r,c),x=ev(s),C=P.useRef(!1),y=P.useRef(!0),{viewport:m,selectedItem:b,selectedItemText:S,focusSelectedItem:w}=a,T=P.useCallback(()=>{if(p.trigger&&p.valueNode&&u&&g&&m&&b&&S){const A=p.trigger.getBoundingClientRect(),j=g.getBoundingClientRect(),M=p.valueNode.getBoundingClientRect(),I=S.getBoundingClientRect();if(p.dir!==oD.RTL){const he=I.left-j.left,Se=M.left-he,we=A.left-Se,Re=A.width+we,qe=Math.max(Re,j.width),ke=window.innerWidth-Si,ze=Um(Se,[Si,Math.max(Si,ke-qe)]);u.style.minWidth=Re+"px",u.style.left=ze+"px"}else{const he=j.right-I.right,Se=window.innerWidth-M.right-he,we=window.innerWidth-A.right-Se,Re=A.width+we,qe=Math.max(Re,j.width),ke=window.innerWidth-Si,ze=Um(Se,[Si,Math.max(Si,ke-qe)]);u.style.minWidth=Re+"px",u.style.right=ze+"px"}const B=x(),H=window.innerHeight-Si*2,F=m.scrollHeight,W=window.getComputedStyle(g),G=parseInt(W.borderTopWidth,10),Q=parseInt(W.paddingTop,10),X=parseInt(W.borderBottomWidth,10),z=parseInt(W.paddingBottom,10),O=G+Q+F+z+X,Y=Math.min(b.offsetHeight*5,O),Z=window.getComputedStyle(m),U=parseInt(Z.paddingTop,10),V=parseInt(Z.paddingBottom,10),ne=A.top+A.height/2-Si,le=H-ne,K=b.offsetHeight/2,$=b.offsetTop+K,oe=G+Q+$,ee=O-oe;if(oe<=ne){const he=B.length>0&&b===B[B.length-1].ref.current;u.style.bottom="0px";const Se=g.clientHeight-m.offsetTop-m.offsetHeight,we=Math.max(le,K+(he?V:0)+Se+X),Re=oe+we;u.style.height=Re+"px"}else{const he=B.length>0&&b===B[0].ref.current;u.style.top="0px";const we=Math.max(ne,G+m.offsetTop+(he?U:0)+K)+ee;u.style.height=we+"px",m.scrollTop=oe-ne+m.offsetTop}u.style.margin=`${Si}px 0`,u.style.minHeight=Y+"px",u.style.maxHeight=H+"px",l==null||l(),requestAnimationFrame(()=>C.current=!0)}},[x,p.trigger,p.valueNode,u,g,m,b,S,p.dir,l]);$t(()=>T(),[T]);const[D,R]=P.useState();$t(()=>{g&&R(window.getComputedStyle(g).zIndex)},[g]);const L=P.useCallback(A=>{A&&y.current===!0&&(T(),w==null||w(),y.current=!1)},[T,w]);return v.jsx(RD,{scope:s,contentWrapper:u,shouldExpandOnScrollRef:C,onScrollButtonChange:L,children:v.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:v.jsx(St.div,{...d,ref:_,style:{boxSizing:"border-box",maxHeight:"100%",...d.style}})})})},"SelectItemAlignedPosition")),nb=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,align:l="start",collisionPadding:d=Si,...p}=i,a=tv(s);return v.jsx(Yg,{...a,...p,ref:r,align:l,collisionPadding:d,style:{boxSizing:"border-box",...p.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)"}})},"SelectPopperPosition")),[RD,AD]=ro(eo,{}),ib="SelectViewport",DD=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,nonce:l,...d}=i,p=$h(ib,s),a=AD(ib,s),u=ht(r,p.onViewportChange),f=P.useRef(0);return v.jsxs(v.Fragment,{children:[v.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:l}),v.jsx(Uh.Slot,{scope:s,children:v.jsx(St.div,{"data-radix-select-viewport":"",role:"presentation",...d,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...d.style},onScroll:tt(d.onScroll,g=>{const c=g.currentTarget,{contentWrapper:_,shouldExpandOnScrollRef:x}=a;if(x!=null&&x.current&&_){const C=Math.abs(f.current-c.scrollTop);if(C>0){const y=window.innerHeight-Si*2,m=parseFloat(_.style.minHeight),b=parseFloat(_.style.height),S=Math.max(m,b);if(S<y){const w=S+C,T=Math.min(y,w),D=w-T;_.style.height=T+"px",_.style.bottom==="0px"&&(c.scrollTop=D>0?D:0,_.style.justifyContent="flex-end")}}}f.current=c.scrollTop})})})]})},"SelectViewport")),LD="SelectGroup",[qB,VB]=ro(LD),$m="SelectItem",[MD,FC]=ro($m),jD=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,value:l,disabled:d=!1,textValue:p,...a}=i,u=ms($m,s),f=$h($m,s),g=u.value===l,[c,_]=P.useState(p??""),[x,C]=P.useState(!1),y=$i(T=>{var D;return(D=f.itemRefCallback)==null?void 0:D.call(f,T,l,d)}),m=ht(r,y),b=Ui(),S=P.useRef("touch");function w(T){u.hasConsumerStoppedPropagationRef.current=T.isPropagationStopped(),u.onUserSelect(l),u.onOpenChange(!1)}return mt(w,"handleSelect"),v.jsx(MD,{scope:s,value:l,disabled:d,textId:b,isSelected:g,onItemTextChange:P.useCallback(T=>{_(D=>D||((T==null?void 0:T.textContent)??"").trim())},[]),children:v.jsx(Uh.ItemSlot,{scope:s,value:l,disabled:d,textValue:c,children:v.jsx(St.div,{role:"option","aria-labelledby":b,"data-highlighted":x?"":void 0,"aria-selected":g&&x,"data-state":g?"checked":"unchecked","aria-disabled":d||void 0,"data-disabled":d?"":void 0,tabIndex:d?void 0:-1,...a,ref:m,onFocus:tt(a.onFocus,()=>C(!0)),onBlur:tt(a.onBlur,()=>C(!1)),onClick:tt(a.onClick,T=>{d||S.current!=="mouse"&&w(T)}),onPointerUp:tt(a.onPointerUp,T=>{d||S.current==="mouse"&&w(T)}),onPointerDown:tt(a.onPointerDown,T=>{S.current=T.pointerType}),onPointerMove:tt(a.onPointerMove,T=>{var D;S.current=T.pointerType,d?(D=f.onItemLeave)==null||D.call(f):S.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:tt(a.onPointerLeave,T=>{var D;T.currentTarget===document.activeElement&&((D=f.onItemLeave)==null||D.call(f))}),onKeyDown:tt(a.onKeyDown,T=>{var R;d||T.target!==T.currentTarget||((R=f.searchRef)==null?void 0:R.current)!==""&&T.key===" "||(lD.includes(T.key)&&w(T),T.key===" "&&T.preventDefault())})})})})},"SelectItem")),Vu="SelectItemText",OD=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,className:l,style:d,...p}=i,a=ms(Vu,s),u=$h(Vu,s),f=FC(Vu,s),g=dD(Vu,s),[c,_]=P.useState(null),x=$i(w=>{var T;return(T=u.itemTextRefCallback)==null?void 0:T.call(u,w,f.value,f.disabled)}),C=ht(r,_,f.onItemTextChange,x),y=c==null?void 0:c.textContent,m=P.useMemo(()=>v.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=g;return $t(()=>(b(m),()=>S(m)),[b,S,m]),v.jsxs(v.Fragment,{children:[v.jsx(St.span,{id:f.textId,...p,ref:C}),f.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!nc(a.value)?Jl.createPortal(p.children,a.valueNode):null]})},"SelectItemText")),ND="SelectItemIndicator",BD=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,...l}=i;return FC(ND,s).isSelected?v.jsx(St.span,{"aria-hidden":!0,...l,ref:r}):null},"SelectItemIndicator")),PD="SelectBubbleInput",ID=P.forwardRef(mt(function({__scopeSelect:i,...r},s){const l=ms(PD,i),{value:d,onValueChange:p,required:a,disabled:u,name:f,autoComplete:g,form:c,userSelection:_}=l,{nativeOptions:x,nativeSelectKey:C}=l,y=P.useRef(null),m=ht(s,y),b=d??"",S=P.useRef(b),w=P.useRef(_),T=P.useRef(!1),D=Array.from(x).some(R=>(R.props.value??"")==="");return P.useEffect(()=>{const R=y.current;if(!R)return;const L=window.HTMLSelectElement.prototype,j=Object.getOwnPropertyDescriptor(L,"value").set,M=_!==null&&_!==w.current;w.current=_;const I=S.current!==b;S.current=b;const B=M&&I;if(M&&!I&&_.value!==b&&!_.hasConsumerStoppedPropagation&&j){T.current=!0;try{j.call(R,_.value),R.dispatchEvent(new Event("change",{bubbles:!0}))}finally{T.current=!1,j.call(R,b)}return}const H=B&&!_.hasConsumerStoppedPropagation;if(I&&j){const F=new Event("change",{bubbles:H});j.call(R,b),R.dispatchEvent(F)}},[b,_]),v.jsxs(St.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:f,autoComplete:g,disabled:u,form:c,onChange:R=>{T.current||p(R.target.value)},...r,style:{...IC,...r.style},ref:m,defaultValue:b,children:[nc(d)&&!D?v.jsx("option",{value:""}):null,Array.from(x)]},C)},"SelectBubbleInput"));function UC(e){return typeof e=="function"}mt(UC,"isFunction");function nc(e){return e===""||e===void 0}mt(nc,"shouldShowPlaceholder");function nv(e){const i=$i(e),r=P.useRef(""),s=P.useRef(0),l=P.useCallback(p=>{const a=r.current+p;i(a);function u(f){r.current=f,window.clearTimeout(s.current),f!==""&&(s.current=window.setTimeout(()=>u(""),1e3))}mt(u,"updateSearch"),u(a)},[i]),d=P.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,l,d]}mt(nv,"useTypeaheadSearch");function iv(e,i,r){const l=i.length>1&&Array.from(i).every(f=>f===i[0])?i[0]:i,d=r?e.indexOf(r):-1;let p=$C(e,Math.max(d,0));l.length===1&&(p=p.filter(f=>f!==r));const u=p.find(f=>f.textValue.toLowerCase().startsWith(l.toLowerCase()));return u!==r?u:void 0}mt(iv,"findNextItem");function $C(e,i){return e.map((r,s)=>e[(i+s)%e.length])}mt($C,"wrapArray");const qC="__empty__",VC=e=>e===""?qC:e,zD=e=>e===qC?"":e;function ca({value:e,onValueChange:i,placeholder:r,size:s="sm",disabled:l,className:d,children:p}){return v.jsxs(fD,{value:VC(e),onValueChange:a=>i(zD(a)),disabled:l,children:[v.jsxs(mD,{className:ye("flex w-full select-none items-center justify-between rounded border bg-transparent font-sans","focus:outline-none focus:ring-1 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","data-[placeholder]:text-muted-foreground/60",s==="sm"?"gap-1 px-2 py-1.5 text-xs":"gap-2 px-3 py-2 text-sm",d),children:[v.jsx(vD,{placeholder:r}),v.jsx(_D,{asChild:!0,children:v.jsx(xa,{className:ye("shrink-0 text-muted-foreground",s==="sm"?"h-3 w-3":"h-4 w-4")})})]}),v.jsx(wD,{children:v.jsx(SD,{position:"popper",sideOffset:4,className:ye("z-50 min-w-[var(--radix-select-trigger-width)] overflow-hidden","rounded-lg border bg-card shadow-lg","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"),children:v.jsx(DD,{className:"p-1",children:p})})})]})}const En=P.forwardRef(({value:e,children:i,className:r},s)=>v.jsxs(jD,{ref:s,value:VC(e),className:ye("relative flex w-full cursor-pointer select-none items-center rounded","px-2 py-1.5 pr-7 text-xs outline-none","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),children:[v.jsx(OD,{children:i}),v.jsx(BD,{className:"absolute right-2 flex items-center justify-center",children:v.jsx(Gl,{className:"h-3 w-3 text-foreground"})})]}));En.displayName="SelectItem";const rv=P.forwardRef(({className:e,size:i="sm",...r},s)=>v.jsx("textarea",{ref:s,className:ye("w-full resize-y rounded border bg-transparent font-serif leading-relaxed","focus:outline-none focus:ring-1 focus:ring-ring","placeholder:text-muted-foreground disabled:opacity-50",i==="sm"?"px-2 py-1.5 text-xs":"px-3 py-2 text-sm",e),...r}));rv.displayName="Textarea";const rb={manual:"Manual: ask before edits and commands",default:"Default (older name of Manual)",acceptEdits:"Accept edits: ask only for commands",plan:"Plan: read and plan, change nothing",auto:"Auto: a classifier decides what to ask",dontAsk:"Don't ask: deny what is not allowed",bypassPermissions:"Bypass: never ask"},HD=["default","fable","opus","sonnet","haiku","opus[1m]","sonnet[1m]","claude-fable-5-1","claude-opus-5-5","claude-sonnet-5-5","claude-haiku-5-5"],Wu="";function FD(){var _,x;const e=ct(()=>ve.claudeSettings(),[]),[i,r]=P.useState(null),[s,l]=P.useState(""),[d,p]=P.useState(""),[a,u]=P.useState("");P.useEffect(()=>{if(!e.data)return;const C=e.data.settings;r(C),l(C.model),p(C.fallbackModel),u(C.addDirs.join(`
526
- `))},[e.data]);const f=async C=>{const y=await it(()=>ve.saveClaudeSettings(C),"Saved. New sessions use it.");y&&r(y)},g=((_=e.data)==null?void 0:_.permissionModes)??[],c=((x=e.data)==null?void 0:x.efforts)??[];return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsx(Er,{group:"Settings",title:"Claude settings",description:"How the hub starts claude. Applies to sessions started from now on; empty keeps your own Claude Code setting."}),i&&v.jsxs(v.Fragment,{children:[v.jsx(Lt,{title:"Permissions",description:"Which mode a session starts in.",children:v.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[v.jsx(Fs,{label:"Sessions you open",hint:"New session, resumes and hub tasks.",children:v.jsxs(ca,{value:i.permissionMode,onValueChange:C=>void f({permissionMode:C}),children:[v.jsx(En,{value:Wu,children:"Your Claude Code setting"}),g.map(C=>v.jsx(En,{value:C,children:rb[C]??C},C))]})}),v.jsx(Fs,{label:"Unattended runs",hint:"Cron, webhook and queued runs. Their questions go to the channels.",children:v.jsxs(ca,{value:i.runPermissionMode,onValueChange:C=>void f({runPermissionMode:C}),children:[v.jsx(En,{value:Wu,children:"Your Claude Code setting"}),g.map(C=>v.jsx(En,{value:C,children:rb[C]??C},C))]})})]})}),v.jsxs(Lt,{title:"Model",description:"An alias or a full model id.",children:[v.jsx("datalist",{id:"claude-models",children:HD.map(C=>v.jsx("option",{value:C},C))}),v.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[v.jsx(Fs,{label:"Model",children:v.jsx(Zn,{list:"claude-models",value:s,placeholder:"Your Claude Code setting",onChange:C=>l(C.target.value),onBlur:()=>s!==i.model&&void f({model:s.trim()})})}),v.jsx(Fs,{label:"Fallback model",hint:"Used when the model is overloaded.",children:v.jsx(Zn,{list:"claude-models",value:d,placeholder:"None",onChange:C=>p(C.target.value),onBlur:()=>d!==i.fallbackModel&&void f({fallbackModel:d.trim()})})}),v.jsx(Fs,{label:"Effort",children:v.jsxs(ca,{value:i.effort,onValueChange:C=>void f({effort:C}),children:[v.jsx(En,{value:Wu,children:"Your Claude Code setting"}),c.map(C=>v.jsx(En,{value:C,children:C},C))]})})]})]}),v.jsx(Lt,{title:"Access",description:"What else a session can reach.",children:v.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[v.jsx(Fs,{label:"Extra directories",hint:"One path per line, passed as --add-dir.",children:v.jsx(rv,{rows:3,className:"font-mono",value:a,placeholder:"C:\\Source code\\shared-lib",onChange:C=>u(C.target.value),onBlur:()=>a!==i.addDirs.join(`
527
- `)&&void f({addDirs:a.split(`
528
- `)})})}),v.jsx(Fs,{label:"Claude in Chrome",children:v.jsxs(ca,{value:i.chrome,onValueChange:C=>void f({chrome:C}),children:[v.jsx(En,{value:Wu,children:"Your Claude Code setting"}),v.jsx(En,{value:"on",children:"On"}),v.jsx(En,{value:"off",children:"Off"})]})})]})})]})]})})}class WC extends Error{constructor(i,r){super(i),this.status=r}}async function oa(e,i){const r=await fetch(`${gi()}/files${e}`,{...i,headers:{"Content-Type":"application/json"}}),s=await r.json().catch(()=>({}));if(!r.ok)throw new WC(s.error??r.statusText,r.status);return s}const ns=(e,i,r)=>oa(i,{method:e,body:JSON.stringify(r)}),Kt={list:(e,i)=>oa(`/list?path=${encodeURIComponent(e)}${i?"&ignored=1":""}`),read:e=>oa(`/read?path=${encodeURIComponent(e)}`),blame:e=>oa(`/blame?path=${encodeURIComponent(e)}`),commit:e=>oa(`/commit?sha=${encodeURIComponent(e)}`),stat:e=>oa(`/stat?path=${encodeURIComponent(e)}`),write:(e,i,r)=>ns("PUT","/write",{path:e,content:i,expectedMtimeMs:r}),create:e=>ns("POST","/create",{path:e}),mkdir:e=>ns("POST","/mkdir",{path:e}),rename:(e,i)=>ns("POST","/rename",{from:e,to:i}),remove:e=>ns("POST","/delete",{path:e}),reveal:e=>ns("POST","/reveal",{path:e}),copyToClipboard:e=>ns("POST","/clipboard",{path:e}),copy:(e,i)=>ns("POST","/copy",{from:e,folder:i})},UD=e=>/\.(md|markdown|mdx)$/i.test(e),$D=e=>/\.(html?|xhtml)$/i.test(e);function sb(e){var r;const i=((r=e.split(".").pop())==null?void 0:r.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif","svg"].includes(i)?"image":["mp3","wav","ogg","oga","m4a","aac","flac","opus","weba"].includes(i)?"audio":["mp4","webm","ogv","mov","m4v","mkv"].includes(i)?"video":null}const qm=e=>`${gi()}/files/raw/${e.split("/").map(encodeURIComponent).join("/")}`,qD="modulepreload",VD=function(e){return"/"+e},ob={},WD=function(i,r,s){let l=Promise.resolve();if(r&&r.length>0){let p=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(c=>({status:"fulfilled",value:c}),c=>({status:"rejected",reason:c}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));l=p(r.map(f=>{if(f=VD(f),f in ob)return;ob[f]=!0;const g=f.endsWith(".css"),c=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${c}`))return;const _=document.createElement("link");if(_.rel=g?"stylesheet":qD,g||(_.as="script"),_.crossOrigin="",_.href=f,u&&_.setAttribute("nonce",u),document.head.appendChild(_),g)return new Promise((x,C)=>{_.addEventListener("load",x),_.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${f}`)))})}))}function d(p){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=p,window.dispatchEvent(a),!a.defaultPrevented)throw p}return l.then(p=>{for(const a of p||[])a.status==="rejected"&&d(a.reason);return i().catch(d)})},GD=P.lazy(()=>WD(()=>import("./MonacoEditor-F_ZgRGGt.js").then(e=>e.b),__vite__mapDeps([0,1])));function GC(e){return v.jsx(P.Suspense,{fallback:v.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading editor..."}),children:v.jsx(GD,{...e})})}function YD(e,i){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const KD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QD={};function ab(e,i){return(QD.jsx?XD:KD).test(e)}const ZD=/[ \t\n\f\r]/g;function JD(e){return typeof e=="object"?e.type==="text"?lb(e.value):!1:lb(e)}function lb(e){return e.replace(ZD,"")===""}class ic{constructor(i,r,s){this.normal=r,this.property=i,s&&(this.space=s)}}ic.prototype.normal={};ic.prototype.property={};ic.prototype.space=void 0;function YC(e,i){const r={},s={};for(const l of e)Object.assign(r,l.property),Object.assign(s,l.normal);return new ic(r,s,i)}function Vm(e){return e.toLowerCase()}class In{constructor(i,r){this.attribute=r,this.property=i}}In.prototype.attribute="";In.prototype.booleanish=!1;In.prototype.boolean=!1;In.prototype.commaOrSpaceSeparated=!1;In.prototype.commaSeparated=!1;In.prototype.defined=!1;In.prototype.mustUseProperty=!1;In.prototype.number=!1;In.prototype.overloadedBoolean=!1;In.prototype.property="";In.prototype.spaceSeparated=!1;In.prototype.space=void 0;let eL=0;const Ue=so(),Ht=so(),Wm=so(),be=so(),xt=so(),Ys=so(),Kn=so();function so(){return 2**++eL}const Gm=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Ht,commaOrSpaceSeparated:Kn,commaSeparated:Ys,number:be,overloadedBoolean:Wm,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),Qp=Object.keys(Gm);class sv extends In{constructor(i,r,s,l){let d=-1;if(super(i,r),cb(this,"space",l),typeof s=="number")for(;++d<Qp.length;){const p=Qp[d];cb(this,Qp[d],(s&Gm[p])===Gm[p])}}}sv.prototype.defined=!0;function cb(e,i,r){r&&(e[i]=r)}function Ra(e){const i={},r={};for(const[s,l]of Object.entries(e.properties)){const d=new sv(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(d.mustUseProperty=!0),i[s]=d,r[Vm(s)]=s,r[Vm(d.attribute)]=s}return new ic(i,r,e.space)}const KC=Ra({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:xt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:be,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:xt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Ht,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function XC(e,i){return i in e?e[i]:i}function QC(e,i){return XC(e,i.toLowerCase())}const tL=Ra({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ys,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alpha:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:xt,autoFocus:Ue,autoPlay:Ue,blocking:xt,capture:null,charSet:null,checked:Ue,cite:null,className:xt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:Ht,controls:Ue,controlsList:xt,coords:be|Ys,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Wm,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:xt,height:be,hidden:Wm,high:be,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:xt,itemRef:xt,itemScope:Ue,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:be,pattern:null,ping:xt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:xt,required:Ue,reversed:Ue,rows:be,rowSpan:be,sandbox:xt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootCustomElementRegistry:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shadowRootSerializable:Ue,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Ht,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ue,disablePictureInPicture:Ue,disableRemotePlayback:Ue,exportParts:Ys,part:xt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:QC}),nL=Ra({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",maskType:"mask-type",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:Kn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:xt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ys,g2:Ys,glyphName:Ys,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kn,rev:Kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kn,requiredFeatures:Kn,requiredFonts:Kn,requiredFormats:Kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:XC}),ZC=Ra({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),JC=Ra({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:QC}),e2=Ra({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),iL={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"},rL=/[A-Z]/g,ub=/-[a-z]/g,sL=/^data[-\w.:]+$/i;function oL(e,i){const r=Vm(i);let s=i,l=In;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&sL.test(i)){if(i.charAt(4)==="-"){const d=i.slice(5).replace(ub,lL);s="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=i.slice(4);if(!ub.test(d)){let p=d.replace(rL,aL);p.charAt(0)!=="-"&&(p="-"+p),i="data"+p}}l=sv}return new l(s,i)}function aL(e){return"-"+e.toLowerCase()}function lL(e){return e.charAt(1).toUpperCase()}const cL=YC([KC,tL,ZC,JC,e2],"html"),ov=YC([KC,nL,ZC,JC,e2],"svg");function uL(e){return e.join(" ").trim()}var ra={},Zp,hb;function hL(){if(hb)return Zp;hb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,d=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
529
- `,f="/",g="*",c="",_="comment",x="declaration";function C(m,b){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];b=b||{};var S=1,w=1;function T(F){var W=F.match(i);W&&(S+=W.length);var G=F.lastIndexOf(u);w=~G?F.length-G:w+F.length}function D(){var F={line:S,column:w};return function(W){return W.position=new R(F),j(),W}}function R(F){this.start=F,this.end={line:S,column:w},this.source=b.source}R.prototype.content=m;function L(F){var W=new Error(b.source+":"+S+":"+w+": "+F);if(W.reason=F,W.filename=b.source,W.line=S,W.column=w,W.source=m,!b.silent)throw W}function A(F){var W=F.exec(m);if(W){var G=W[0];return T(G),m=m.slice(G.length),W}}function j(){A(r)}function M(F){var W;for(F=F||[];W=I();)W!==!1&&F.push(W);return F}function I(){var F=D();if(!(f!=m.charAt(0)||g!=m.charAt(1))){for(var W=2;c!=m.charAt(W)&&(g!=m.charAt(W)||f!=m.charAt(W+1));)++W;if(W+=2,c===m.charAt(W-1))return L("End of comment missing");var G=m.slice(2,W-2);return w+=2,T(G),m=m.slice(W),w+=2,F({type:_,comment:G})}}function B(){var F=D(),W=A(s);if(W){if(I(),!A(l))return L("property missing ':'");var G=A(d),Q=F({type:x,property:y(W[0].replace(e,c)),value:G?y(G[0].replace(e,c)):c});return A(p),Q}}function H(){var F=[];M(F);for(var W;W=B();)W!==!1&&(F.push(W),M(F));return F}return j(),H()}function y(m){return m?m.replace(a,c):c}return Zp=C,Zp}var db;function dL(){if(db)return ra;db=1;var e=ra&&ra.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ra,"__esModule",{value:!0}),ra.default=r;const i=e(hL());function r(s,l){let d=null;if(!s||typeof s!="string")return d;const p=(0,i.default)(s),a=typeof l=="function";return p.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:g}=u;a?l(f,g,u):g&&(d=d||{},d[f]=g)}),d}return ra}var Tl={},fb;function fL(){if(fb)return Tl;fb=1,Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,d=function(f){return!f||r.test(f)||e.test(f)},p=function(f,g){return g.toUpperCase()},a=function(f,g){return"".concat(g,"-")},u=function(f,g){return g===void 0&&(g={}),d(f)?f:(f=f.toLowerCase(),g.reactCompat?f=f.replace(l,a):f=f.replace(s,a),f.replace(i,p))};return Tl.camelCase=u,Tl}var Rl,pb;function pL(){if(pb)return Rl;pb=1;var e=Rl&&Rl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},i=e(dL()),r=fL();function s(l,d){var p={};return!l||typeof l!="string"||(0,i.default)(l,function(a,u){a&&u&&(p[(0,r.camelCase)(a,d)]=u)}),p}return s.default=s,Rl=s,Rl}var mL=pL();const gL=fg(mL),t2=n2("end"),av=n2("start");function n2(e){return i;function i(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function vL(e){const i=av(e),r=t2(e);if(i&&r)return{start:i,end:r}}function Ol(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?mb(e.position):"start"in e||"end"in e?mb(e):"line"in e||"column"in e?Ym(e):""}function Ym(e){return gb(e&&e.line)+":"+gb(e&&e.column)}function mb(e){return Ym(e&&e.start)+"-"+Ym(e&&e.end)}function gb(e){return e&&typeof e=="number"?e:1}class _n extends Error{constructor(i,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let l="",d={},p=!1;if(r&&("line"in r&&"column"in r?d={place:r}:"start"in r&&"end"in r?d={place:r}:"type"in r?d={ancestors:[r],place:r.position}:d={...r}),typeof i=="string"?l=i:!d.cause&&i&&(p=!0,l=i.message,d.cause=i),!d.ruleId&&!d.source&&typeof s=="string"){const u=s.indexOf(":");u===-1?d.ruleId=s:(d.source=s.slice(0,u),d.ruleId=s.slice(u+1))}if(!d.place&&d.ancestors&&d.ancestors){const u=d.ancestors[d.ancestors.length-1];u&&(d.place=u.position)}const a=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=a?a.line:void 0,this.name=Ol(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=p&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}_n.prototype.file="";_n.prototype.name="";_n.prototype.reason="";_n.prototype.message="";_n.prototype.stack="";_n.prototype.column=void 0;_n.prototype.line=void 0;_n.prototype.ancestors=void 0;_n.prototype.cause=void 0;_n.prototype.fatal=void 0;_n.prototype.place=void 0;_n.prototype.ruleId=void 0;_n.prototype.source=void 0;const lv={}.hasOwnProperty,_L=new Map,xL=/[A-Z]/g,yL=new Set(["table","tbody","thead","tfoot","tr"]),bL=new Set(["td","th"]),i2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wL(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=i.filePath||void 0;let s;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=DL(r,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=AL(r,i.jsx,i.jsxs)}const l={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:s,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?ov:cL,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},d=r2(l,e,void 0);return d&&typeof d!="string"?d:l.create(e,l.Fragment,{children:d||void 0},void 0)}function r2(e,i,r){if(i.type==="element")return SL(e,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return CL(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return kL(e,i,r);if(i.type==="mdxjsEsm")return EL(e,i);if(i.type==="root")return TL(e,i,r);if(i.type==="text")return RL(e,i)}function SL(e,i,r){const s=e.schema;let l=s;i.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=ov,e.schema=l),e.ancestors.push(i);const d=o2(e,i.tagName,!1),p=LL(e,i);let a=uv(e,i);return yL.has(i.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!JD(u):!0})),s2(e,p,d,i),cv(p,a),e.ancestors.pop(),e.schema=s,e.create(i,d,p,r)}function CL(e,i){if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}$l(e,i.position)}function EL(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);$l(e,i.position)}function kL(e,i,r){const s=e.schema;let l=s;i.name==="svg"&&s.space==="html"&&(l=ov,e.schema=l),e.ancestors.push(i);const d=i.name===null?e.Fragment:o2(e,i.name,!0),p=ML(e,i),a=uv(e,i);return s2(e,p,d,i),cv(p,a),e.ancestors.pop(),e.schema=s,e.create(i,d,p,r)}function TL(e,i,r){const s={};return cv(s,uv(e,i)),e.create(i,e.Fragment,s,r)}function RL(e,i){return i.value}function s2(e,i,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(i.node=s)}function cv(e,i){if(i.length>0){const r=i.length>1?i:i[0];r&&(e.children=r)}}function AL(e,i,r){return s;function s(l,d,p,a){const f=Array.isArray(p.children)?r:i;return a?f(d,p,a):f(d,p)}}function DL(e,i){return r;function r(s,l,d,p){const a=Array.isArray(d.children),u=av(s);return i(l,d,p,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function LL(e,i){const r={};let s,l;for(l in i.properties)if(l!=="children"&&lv.call(i.properties,l)){const d=jL(e,l,i.properties[l]);if(d){const[p,a]=d;e.tableCellAlignToStyle&&p==="align"&&typeof a=="string"&&bL.has(i.tagName)?s=a:r[p]=a}}if(s){const d=r.style||(r.style={});d[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function ML(e,i){const r={};for(const s of i.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const d=s.data.estree.body[0];d.type;const p=d.expression;p.type;const a=p.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else $l(e,i.position);else{const l=s.name;let d;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const a=s.value.data.estree.body[0];a.type,d=e.evaluater.evaluateExpression(a.expression)}else $l(e,i.position);else d=s.value===null?!0:s.value;r[l]=d}return r}function uv(e,i){const r=[];let s=-1;const l=e.passKeys?new Map:_L;for(;++s<i.children.length;){const d=i.children[s];let p;if(e.passKeys){const u=d.type==="element"?d.tagName:d.type==="mdxJsxFlowElement"||d.type==="mdxJsxTextElement"?d.name:void 0;if(u){const f=l.get(u)||0;p=u+"-"+f,l.set(u,f+1)}}const a=r2(e,d,p);a!==void 0&&r.push(a)}return r}function jL(e,i,r){const s=oL(e.schema,i);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?YD(r):uL(r)),s.property==="style"){let l=typeof r=="object"?r:OL(e,String(r));return e.stylePropertyNameCase==="css"&&(l=NL(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?iL[s.property]||s.property:s.attribute,r]}}function OL(e,i){try{return gL(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,l=new _n("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=i2+"#cannot-parse-style-attribute",l}}function o2(e,i,r){let s;if(!r)s={type:"Literal",value:i};else if(i.includes(".")){const l=i.split(".");let d=-1,p;for(;++d<l.length;){const a=ab(l[d])?{type:"Identifier",name:l[d]}:{type:"Literal",value:l[d]};p=p?{type:"MemberExpression",object:p,property:a,computed:!!(d&&a.type==="Literal"),optional:!1}:a}s=p}else s=ab(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(s.type==="Literal"){const l=s.value;return lv.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);$l(e)}function $l(e,i){const r=new _n("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=i2+"#cannot-handle-mdx-estrees-without-createevaluater",r}function NL(e){const i={};let r;for(r in e)lv.call(e,r)&&(i[BL(r)]=e[r]);return i}function BL(e){let i=e.replace(xL,PL);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function PL(e){return"-"+e.toLowerCase()}const Jp={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"]},IL={};function hv(e,i){const r=IL,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return a2(e,s,l)}function a2(e,i,r){if(zL(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return vb(e.children,i,r)}return Array.isArray(e)?vb(e,i,r):""}function vb(e,i,r){const s=[];let l=-1;for(;++l<e.length;)s[l]=a2(e[l],i,r);return s.join("")}function zL(e){return!!(e&&typeof e=="object")}const _b=document.createElement("i");function dv(e){const i="&"+e+";";_b.innerHTML=i;const r=_b.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===i?!1:r}function Ci(e,i,r,s){const l=e.length;let d=0,p;if(i<0?i=-i>l?0:l+i:i=i>l?l:i,r=r>0?r:0,s.length<1e4)p=Array.from(s),p.unshift(i,r),e.splice(...p);else for(r&&e.splice(i,r);d<s.length;)p=s.slice(d,d+1e4),p.unshift(i,0),e.splice(...p),d+=1e4,i+=1e4}function di(e,i){return e.length>0?(Ci(e,e.length,0,i),e):i}const xb={}.hasOwnProperty;function l2(e){const i={};let r=-1;for(;++r<e.length;)HL(i,e[r]);return i}function HL(e,i){let r;for(r in i){const l=(xb.call(e,r)?e[r]:void 0)||(e[r]={}),d=i[r];let p;if(d)for(p in d){xb.call(l,p)||(l[p]=[]);const a=d[p];FL(l[p],Array.isArray(a)?a:a?[a]:[])}}}function FL(e,i){let r=-1;const s=[];for(;++r<i.length;)(i[r].add==="after"?e:s).push(i[r]);Ci(e,0,0,s)}function c2(e,i){const r=Number.parseInt(e,i);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ei(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dn=gs(/[A-Za-z]/),fn=gs(/[\dA-Za-z]/),UL=gs(/[#-'*+\--9=?A-Z^-~]/);function mh(e){return e!==null&&(e<32||e===127)}const Km=gs(/\d/),$L=gs(/[\dA-Fa-f]/),u2=gs(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const qh=gs(new RegExp("\\p{P}|\\p{S}","u")),to=gs(/\s/);function gs(e){return i;function i(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Aa(e){const i=[];let r=-1,s=0,l=0;for(;++r<e.length;){const d=e.charCodeAt(r);let p="";if(d===37&&fn(e.charCodeAt(r+1))&&fn(e.charCodeAt(r+2)))l=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(p=String.fromCharCode(d));else if(d>55295&&d<57344){const a=e.charCodeAt(r+1);d<56320&&a>56319&&a<57344?(p=String.fromCharCode(d,a),l=1):p="�"}else p=String.fromCharCode(d);p&&(i.push(e.slice(s,r),encodeURIComponent(p)),s=r+l+1,p=""),l&&(r+=l,l=0)}return i.join("")+e.slice(s)}function at(e,i,r,s){const l=s?s-1:1/0;let d=0;return p;function p(u){return Xe(u)?(e.enter(r),a(u)):i(u)}function a(u){return Xe(u)&&d++<l?(e.consume(u),a):(e.exit(r),i(u))}}function h2(e,i,r,s,l,d){let p=0;return a;function a(g){return Xe(g)?(e.enter(s),u(g)):f(g)}function u(g){return Xe(g)&&p<d?(e.consume(g),p++,u):(e.exit(s),f(g))}function f(g){return p>=l?i(g):r(g)}}const qL={tokenize:VL};function VL(e){const i=e.attempt(this.parser.constructs.contentInitial,s,l);let r;return i;function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),at(e,i,"linePrefix")}function l(a){return e.enter("paragraph"),d(a)}function d(a){const u=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,p(a)}function p(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ne(a)?(e.consume(a),e.exit("chunkText"),d):(e.consume(a),p)}}let gh=class{constructor(){this.index=new Map,this.map=[]}add(i,r,s){yb(this,i,r,s,!1)}addBefore(i,r,s){yb(this,i,r,s,!0)}consume(i){if(this.map.sort(function(d,p){return d[0]-p[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let l=s.pop();for(;l;){for(const d of l)i.push(d);l=s.pop()}this.map.length=0,this.index.clear()}};function yb(e,i,r,s,l){if(r===0&&s.length===0)return;const d=e.index.get(i);if(d){d[1]+=r,l?(s.push(...d[2]),d[2]=s):d[2].push(...s);return}const p=[i,r,s];e.map.push(p),e.index.set(i,p)}const WL={tokenize:GL},bb={tokenize:YL};function GL(e){const i=this,r=[];let s=0,l,d,p;return a;function a(w){if(s<r.length){const T=r[s];return i.containerState=T[1],e.attempt(T[0].continuation,u,f)(w)}return f(w)}function u(w){if(s++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,l&&S();const T=i.events.length;let D=T,R;for(;D--;)if(i.events[D][0]==="exit"&&i.events[D][1].type==="chunkFlow"){R=i.events[D][1].end;break}b(s);let L=T;for(;L<i.events.length;)i.events[L][1].end={...R},L++;const A=new gh;return A.add(D+1,0,i.events.slice(T)),A.add(T,L-T,[]),A.consume(i.events),f(w)}return a(w)}function f(w){if(s===r.length){if(!l)return _(w);if(l.currentConstruct&&l.currentConstruct.concrete)return C(w);i.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(bb,g,c)(w)}function g(w){return l&&S(),b(s),_(w)}function c(w){return i.parser.lazy[i.now().line]=s!==r.length,p=i.now().offset,C(w)}function _(w){return i.containerState={},e.attempt(bb,x,C)(w)}function x(w){return s++,r.push([i.currentConstruct,i.containerState]),_(w)}function C(w){if(w===null){l&&S(),b(0),e.consume(w);return}return l=l||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:d}),y(w)}function y(w){if(w===null){m(e.exit("chunkFlow"),!0),b(0),e.consume(w);return}return Ne(w)?(e.consume(w),m(e.exit("chunkFlow")),s=0,i.interrupt=void 0,a):(e.consume(w),y)}function m(w,T){const D=i.sliceStream(w);if(T&&D.push(null),w.previous=d,d&&(d.next=w),d=w,l.defineSkip(w.start),l.write(D),i.parser.lazy[w.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<p&&(!l.events[R][1].end||l.events[R][1].end.offset>p))return;const L=i.events.length;let A=L,j,M;for(;A--;)if(i.events[A][0]==="exit"&&i.events[A][1].type==="chunkFlow"){if(j){M=i.events[A][1].end;break}j=!0}for(b(s),R=L;R<i.events.length;)i.events[R][1].end={...M},R++;const I=new gh;I.add(A+1,0,i.events.slice(L)),I.add(L,R-L,[]),I.consume(i.events)}}function b(w){let T=r.length;for(;T-- >w;){const D=r[T];i.containerState=D[1],D[0].exit.call(i,e)}r.length=w}function S(){l.write([null]),d=void 0,l=void 0,i.containerState._closeFlow=void 0}}function YL(e,i,r){return at(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hs(e){if(e===null||yt(e)||to(e))return 1;if(qh(e))return 2}function Vh(e,i,r){const s=[];let l=-1;for(;++l<e.length;){const d=e[l].resolveAll;d&&!s.includes(d)&&(i=d(i,r),s.push(d))}return i}const Xm={name:"attention",resolveAll:KL,tokenize:XL};function KL(e,i){let r=-1,s;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){let l=r;for(;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&i.sliceSerialize(e[l][1]).charCodeAt(0)===i.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;const d=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1,p={...e[l][1].end},a={...e[r][1].start};wb(p,-d),wb(a,d);const u={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[l][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:a},g={type:d>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},c={type:d>1?"strong":"emphasis",start:{...u.start},end:{...f.end}};e[l][1].end={...u.start},e[r][1].start={...f.end},s=[],e[l][1].end.offset-e[l][1].start.offset&&(s=di(s,[["enter",e[l][1],i],["exit",e[l][1],i]])),s=di(s,[["enter",c,i],["enter",u,i],["exit",u,i],["enter",g,i]]),s=di(s,Vh(i.parser.constructs.insideSpan.null,e.slice(l+1,r),i)),s=di(s,[["exit",g,i],["enter",f,i],["exit",f,i],["exit",c,i]]);let _=0;e[r][1].end.offset-e[r][1].start.offset&&(_=2,s=di(s,[["enter",e[r][1],i],["exit",e[r][1],i]])),Ci(e,l-1,r-l+3,s),r=l+s.length-_-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function XL(e,i){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,l=hs(s);let d;return p;function p(u){return d=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===d)return e.consume(u),a;const f=e.exit("attentionSequence"),g=hs(u),c=!g||g===2&&l||r.includes(u)&&u!==42&&u!==95,_=!l||l===2&&g||r.includes(s)&&s!==42&&s!==95;return f._open=!!(d===42?c:c&&(l||!_)),f._close=!!(d===42?_:_&&(g||!c)),i(u)}}function wb(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const QL={name:"autolink",tokenize:ZL};function ZL(e,i,r){let s=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),d}function d(x){return dn(x)?(e.consume(x),p):x===64?r(x):f(x)}function p(x){return x===43||x===45||x===46||fn(x)?(s=1,a(x)):f(x)}function a(x){return x===58?(e.consume(x),s=0,u):(x===43||x===45||x===46||fn(x))&&s++<32?(e.consume(x),a):(s=0,f(x))}function u(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):x===null||x===32||x===60||mh(x)?r(x):(e.consume(x),u)}function f(x){return x===64?(e.consume(x),g):UL(x)?(e.consume(x),f):r(x)}function g(x){return fn(x)?c(x):r(x)}function c(x){return x===46?(e.consume(x),s=0,g):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):_(x)}function _(x){if((x===45||fn(x))&&s++<63){const C=x===45?_:c;return e.consume(x),C}return r(x)}}const rc={partial:!0,tokenize:JL};function JL(e,i,r){return s;function s(d){return Xe(d)?at(e,l,"linePrefix")(d):l(d)}function l(d){return d===null||Ne(d)?i(d):r(d)}}const d2={continuation:{tokenize:tM},exit:nM,name:"blockQuote",tokenize:eM};function eM(e,i,r){const s=this;return l;function l(p){if(p===62){const a=s.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(p),e.exit("blockQuoteMarker"),d}return r(p)}function d(p){return Xe(p)?(e.enter("blockQuotePrefixWhitespace"),e.consume(p),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(p))}}function tM(e,i,r){const s=this;return l;function l(p){return Xe(p)?at(e,d,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p):d(p)}function d(p){return e.attempt(d2,i,r)(p)}}function nM(e){e.exit("blockQuote")}const f2={name:"characterEscape",tokenize:iM};function iM(e,i,r){return s;function s(d){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(d),e.exit("escapeMarker"),l}function l(d){return u2(d)?(e.enter("characterEscapeValue"),e.consume(d),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(d)}}const p2={name:"characterReference",tokenize:rM};function rM(e,i,r){const s=this;let l=0,d,p;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),d=31,p=fn,g(c))}function f(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),d=6,p=$L,g):(e.enter("characterReferenceValue"),d=7,p=Km,g(c))}function g(c){if(c===59&&l){const _=e.exit("characterReferenceValue");return p===fn&&!dv(s.sliceSerialize(_))?r(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return p(c)&&l++<d?(e.consume(c),g):r(c)}}const Qm={partial:!0,tokenize:sM};function sM(e,i,r){const s=this;return l;function l(p){return p===null?r(p):(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d)}function d(p){return s.parser.lazy[s.now().line]?r(p):i(p)}}const Sb={concrete:!0,name:"codeFenced",tokenize:oM};function oM(e,i,r){const s=this,l={partial:!0,tokenize:D};let d=0,p=0,a;return u;function u(R){return f(R)}function f(R){const L=s.events[s.events.length-1];return d=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,a=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===a?(p++,e.consume(R),g):p<3?r(R):(e.exit("codeFencedFenceSequence"),Xe(R)?at(e,c,"whitespace")(R):c(R))}function c(R){return R===null||Ne(R)?(e.exit("codeFencedFence"),s.interrupt?i(R):e.check(Qm,y,T)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(R))}function _(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(R)):Xe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,x,"whitespace")(R)):R===96&&R===a?r(R):(e.consume(R),_)}function x(R){return R===null||Ne(R)?c(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(R))}function C(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(R)):R===96&&R===a?r(R):(e.consume(R),C)}function y(R){return e.attempt(l,T,m)(R)}function m(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),b}function b(R){return d>0&&Xe(R)?at(e,S,"linePrefix",d+1)(R):S(R)}function S(R){return R===null||Ne(R)?e.check(Qm,y,T)(R):(e.enter("codeFlowValue"),w(R))}function w(R){return R===null||Ne(R)?(e.exit("codeFlowValue"),S(R)):(e.consume(R),w)}function T(R){return e.exit("codeFenced"),i(R)}function D(R,L,A){let j=0;return M;function M(W){return R.enter("lineEnding"),R.consume(W),R.exit("lineEnding"),I}function I(W){return R.enter("codeFencedFence"),Xe(W)?at(R,B,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):B(W)}function B(W){return W===a?(R.enter("codeFencedFenceSequence"),H(W)):A(W)}function H(W){return W===a?(j++,R.consume(W),H):j>=p?(R.exit("codeFencedFenceSequence"),Xe(W)?at(R,F,"whitespace")(W):F(W)):A(W)}function F(W){return W===null||Ne(W)?(R.exit("codeFencedFence"),L(W)):A(W)}}}const em={name:"codeIndented",tokenize:lM},aM={partial:!0,tokenize:cM};function lM(e,i,r){return s;function s(a){return e.enter("codeIndented"),h2(e,l,r,"linePrefix",4,4)(a)}function l(a){return a===null?p(a):Ne(a)?e.attempt(aM,l,p)(a):(e.enter("codeFlowValue"),d(a))}function d(a){return a===null||Ne(a)?(e.exit("codeFlowValue"),l(a)):(e.consume(a),d)}function p(a){return e.exit("codeIndented"),i(a)}}function cM(e,i,r){const s=this;return l;function l(p){return s.parser.lazy[s.now().line]?r(p):Ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):h2(e,i,d,"linePrefix",4,4)(p)}function d(p){return Ne(p)?l(p):r(p)}}const uM={name:"codeText",previous:dM,resolve:hM,tokenize:fM};function hM(e){let i=e.length-4,r=3,s,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(s=r;++s<i;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[i][1].type="codeTextPadding",r+=2,i-=2;break}}for(s=r-1,i++;++s<=i;)l===void 0?s!==i&&e[s][1].type!=="lineEnding"&&(l=s):(s===i||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),i-=s-l-2,s=l+2),l=void 0);return e}function dM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fM(e,i,r){let s=0,l,d;return p;function p(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),s++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?r(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(d=e.enter("codeTextSequence"),l=0,g(c)):Ne(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),f(c))}function f(c){return c===null||c===32||c===96||Ne(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),f)}function g(c){return c===96?(e.consume(c),l++,g):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),i(c)):(d.type="codeTextData",f(c))}}class pM{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(i,s):i>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(i,r,s){const l=r||0;this.setCursor(Math.trunc(i));const d=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&Al(this.left,s),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),Al(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Al(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const r=this.left.splice(i,Number.POSITIVE_INFINITY);Al(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Al(this.left,r.reverse())}}}function Al(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function m2(e){const i={};let r=-1,s,l,d,p,a,u,f;const g=new pM(e);for(;++r<g.length;){for(;r in i;)r=i[r];if(s=g.get(r),r&&s[1].type==="chunkFlow"&&g.get(r-1)[1].type==="listItemPrefix"&&(u=s[1]._tokenizer.events,d=0,d<u.length&&u[d][1].type==="lineEndingBlank"&&(d+=2),d<u.length&&u[d][1].type==="content"))for(;++d<u.length&&u[d][1].type!=="content";)u[d][1].type==="chunkText"&&(u[d][1]._isInFirstContentOfListItem=!0,d++);if(s[0]==="enter")s[1].contentType&&(Object.assign(i,mM(g,r)),r=i[r],f=!0);else if(s[1]._container){for(d=r,l=void 0;d--;)if(p=g.get(d),p[1].type==="lineEnding"||p[1].type==="lineEndingBlank")p[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),p[1].type="lineEnding",l=d);else if(!(p[1].type==="linePrefix"||p[1].type==="listItemIndent"))break;l&&(s[1].end={...g.get(l)[1].start},a=g.slice(l,r),a.unshift(s),g.splice(l,r-l+1,a))}}return Ci(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!f}function mM(e,i){const r=e.get(i)[1],s=e.get(i)[2];let l=i-1;const d=[];let p=r._tokenizer;p||(p=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(p._contentTypeTextTrailing=!0));const a=p.events,u=[],f={};let g,c,_=-1,x=r,C=0,y=0;const m=[y];for(;x;){for(;e.get(++l)[1]!==x;);d.push(l),x._tokenizer||(g=s.sliceStream(x),x.next||g.push(null),c&&p.defineSkip(x.start),x._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=!0),p.write(g),x._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=void 0)),c=x,x=x.next}for(x=r;++_<a.length;)a[_][0]==="exit"&&a[_-1][0]==="enter"&&a[_][1].type===a[_-1][1].type&&a[_][1].start.line!==a[_][1].end.line&&(y=_+1,m.push(y),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(p.events=[],x?(x._tokenizer=void 0,x.previous=void 0):m.pop(),_=m.length;_--;){const b=a.slice(m[_],m[_+1]),S=d.pop();u.push([S,S+b.length-1]),e.splice(S,2,b)}for(u.reverse(),_=-1;++_<u.length;)f[C+u[_][0]]=C+u[_][1],C+=u[_][1]-u[_][0]-1;return f}const gM={resolve:_M,tokenize:xM},vM={partial:!0,tokenize:yM};function _M(e){return m2(e),e}function xM(e,i){let r;return s;function s(a){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(a)}function l(a){return a===null?d(a):Ne(a)?e.check(vM,p,d)(a):(e.consume(a),l)}function d(a){return e.exit("chunkContent"),e.exit("content"),i(a)}function p(a){return e.consume(a),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function yM(e,i,r){const s=this;return l;function l(p){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),at(e,d,"linePrefix")}function d(p){if(p===null||Ne(p))return r(p);const a=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?i(p):e.interrupt(s.parser.constructs.flow,r,i)(p)}}function g2(e,i,r,s,l,d,p,a,u){const f=u||Number.POSITIVE_INFINITY;let g=0;return c;function c(b){return b===60?(e.enter(s),e.enter(l),e.enter(d),e.consume(b),e.exit(d),_):b===null||b===32||b===41||mh(b)?r(b):(e.enter(s),e.enter(p),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(b))}function _(b){return b===62?(e.enter(d),e.consume(b),e.exit(d),e.exit(l),e.exit(s),i):(e.enter(a),e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===62?(e.exit("chunkString"),e.exit(a),_(b)):b===null||b===60||Ne(b)?r(b):(e.consume(b),b===92?C:x)}function C(b){return b===60||b===62||b===92?(e.consume(b),x):x(b)}function y(b){return!g&&(b===null||b===41||yt(b))?(e.exit("chunkString"),e.exit(a),e.exit(p),e.exit(s),i(b)):g<f&&b===40?(e.consume(b),g++,y):b===41?(e.consume(b),g--,y):b===null||b===32||b===40||mh(b)?r(b):(e.consume(b),b===92?m:y)}function m(b){return b===40||b===41||b===92?(e.consume(b),y):y(b)}}function v2(e,i,r,s,l,d){const p=this;let a=0,u;return f;function f(x){return e.enter(s),e.enter(l),e.consume(x),e.exit(l),e.enter(d),g}function g(x){return a>999||x===null||x===91||x===93&&!u||x===94&&!a&&"_hiddenFootnoteSupport"in p.parser.constructs?r(x):x===93?(e.exit(d),e.enter(l),e.consume(x),e.exit(l),e.exit(s),i):Ne(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),c(x))}function c(x){return x===null||x===91||x===93||Ne(x)||a++>999?(e.exit("chunkString"),g(x)):(e.consume(x),u||(u=!Xe(x)),x===92?_:c)}function _(x){return x===91||x===92||x===93?(e.consume(x),a++,c):c(x)}}function _2(e,i,r,s,l,d){let p;return a;function a(_){return _===34||_===39||_===40?(e.enter(s),e.enter(l),e.consume(_),e.exit(l),p=_===40?41:_,u):r(_)}function u(_){return _===p?(e.enter(l),e.consume(_),e.exit(l),e.exit(s),i):(e.enter(d),f(_))}function f(_){return _===p?(e.exit(d),u(p)):_===null?r(_):Ne(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),at(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(_))}function g(_){return _===p||_===null||Ne(_)?(e.exit("chunkString"),f(_)):(e.consume(_),_===92?c:g)}function c(_){return _===p||_===92?(e.consume(_),g):g(_)}}function Nl(e,i){let r;return s;function s(l){return Ne(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,s):Xe(l)?at(e,s,r?"linePrefix":"lineSuffix")(l):i(l)}}const bM={name:"definition",tokenize:SM},wM={partial:!0,tokenize:CM};function SM(e,i,r){const s=this;let l;return d;function d(x){return e.enter("definition"),p(x)}function p(x){return v2.call(s,e,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function a(x){return l=Ei(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),u):r(x)}function u(x){return yt(x)?Nl(e,f)(x):f(x)}function f(x){return g2(e,g,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function g(x){return e.attempt(wM,c,c)(x)}function c(x){return Xe(x)?at(e,_,"whitespace")(x):_(x)}function _(x){return x===null||Ne(x)?(e.exit("definition"),s.parser.defined.push(l),i(x)):r(x)}}function CM(e,i,r){return s;function s(a){return yt(a)?Nl(e,l)(a):r(a)}function l(a){return _2(e,d,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function d(a){return Xe(a)?at(e,p,"whitespace")(a):p(a)}function p(a){return a===null||Ne(a)?i(a):r(a)}}const EM={name:"hardBreakEscape",tokenize:kM};function kM(e,i,r){return s;function s(d){return e.enter("hardBreakEscape"),e.consume(d),l}function l(d){return Ne(d)?(e.exit("hardBreakEscape"),i(d)):r(d)}}const TM={name:"headingAtx",resolve:RM,tokenize:AM};function RM(e,i){let r=e.length-2,s=3;if(e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s){const l={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},d={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"};Ci(e,s,r-s+1,[["enter",l,i],["enter",d,i],["exit",d,i],["exit",l,i]])}return e}function AM(e,i,r){let s=0;return l;function l(g){return e.enter("atxHeading"),d(g)}function d(g){return e.enter("atxHeadingSequence"),p(g)}function p(g){return g===35&&s++<6?(e.consume(g),p):g===null||yt(g)?(e.exit("atxHeadingSequence"),a(g)):r(g)}function a(g){return g===35?(e.enter("atxHeadingSequence"),u(g)):g===null||Ne(g)?(e.exit("atxHeading"),i(g)):Xe(g)?at(e,a,"whitespace")(g):(e.enter("atxHeadingText"),f(g))}function u(g){return g===35?(e.consume(g),u):(e.exit("atxHeadingSequence"),a(g))}function f(g){return g===null||g===35||yt(g)?(e.exit("atxHeadingText"),a(g)):(e.consume(g),f)}}const x2=["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"],Zm=["pre","script","style","textarea"],DM={concrete:!0,name:"htmlFlow",resolveTo:MM,tokenize:jM},LM={partial:!0,tokenize:OM};function MM(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function jM(e,i,r){const s=this;let l,d,p,a,u;return f;function f(U){return g(U)}function g(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),c}function c(U){return U===33?(e.consume(U),_):U===47?(e.consume(U),d=!0,y):U===63?(e.consume(U),l=3,s.interrupt?i:O):dn(U)?(e.consume(U),p=String.fromCharCode(U),m):r(U)}function _(U){return U===45?(e.consume(U),l=2,x):U===91?(e.consume(U),l=5,a=0,C):dn(U)?(e.consume(U),l=4,s.interrupt?i:O):r(U)}function x(U){return U===45?(e.consume(U),s.interrupt?i:O):r(U)}function C(U){const V="CDATA[";return U===V.charCodeAt(a++)?(e.consume(U),a===V.length?s.interrupt?i:B:C):r(U)}function y(U){return dn(U)?(e.consume(U),p=String.fromCharCode(U),m):r(U)}function m(U){if(U===null||U===47||U===62||yt(U)){const V=U===47,ne=p.toLowerCase();return!V&&!d&&Zm.includes(ne)?(l=1,s.interrupt?i(U):B(U)):x2.includes(p.toLowerCase())?(l=6,V?(e.consume(U),b):s.interrupt?i(U):B(U)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(U):d?S(U):w(U))}return U===45||fn(U)?(e.consume(U),p+=String.fromCharCode(U),m):r(U)}function b(U){return U===62?(e.consume(U),s.interrupt?i:B):r(U)}function S(U){return Xe(U)?(e.consume(U),S):M(U)}function w(U){return U===47?(e.consume(U),M):U===58||U===95||dn(U)?(e.consume(U),T):Xe(U)?(e.consume(U),w):M(U)}function T(U){return U===45||U===46||U===58||U===95||fn(U)?(e.consume(U),T):D(U)}function D(U){return U===61?(e.consume(U),R):Xe(U)?(e.consume(U),D):w(U)}function R(U){return U===null||U===60||U===61||U===62||U===96?r(U):U===34||U===39?(e.consume(U),u=U,L):Xe(U)?(e.consume(U),R):A(U)}function L(U){return U===u?(e.consume(U),u=null,j):U===null||Ne(U)?r(U):(e.consume(U),L)}function A(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||yt(U)?D(U):(e.consume(U),A)}function j(U){return U===47||U===62||Xe(U)?w(U):r(U)}function M(U){return U===62?(e.consume(U),I):r(U)}function I(U){return U===null||Ne(U)?B(U):Xe(U)?(e.consume(U),I):r(U)}function B(U){return U===45&&l===2?(e.consume(U),G):U===60&&l===1?(e.consume(U),Q):U===62&&l===4?(e.consume(U),Y):U===63&&l===3?(e.consume(U),O):U===93&&l===5?(e.consume(U),z):Ne(U)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(LM,Z,H)(U)):U===null||Ne(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),B)}function H(U){return e.check(Qm,F,Z)(U)}function F(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),W}function W(U){return U===null||Ne(U)?H(U):(e.enter("htmlFlowData"),B(U))}function G(U){return U===45?(e.consume(U),O):B(U)}function Q(U){return U===47?(e.consume(U),p="",X):B(U)}function X(U){if(U===62){const V=p.toLowerCase();return Zm.includes(V)?(e.consume(U),Y):B(U)}return dn(U)&&p.length<8?(e.consume(U),p+=String.fromCharCode(U),X):B(U)}function z(U){return U===93?(e.consume(U),O):B(U)}function O(U){return U===62?(e.consume(U),Y):U===45&&l===2?(e.consume(U),O):B(U)}function Y(U){return U===null||Ne(U)?(e.exit("htmlFlowData"),Z(U)):(e.consume(U),Y)}function Z(U){return e.exit("htmlFlow"),i(U)}}function OM(e,i,r){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(rc,i,r)}}const NM={name:"htmlText",tokenize:BM};function BM(e,i,r){const s=this;let l,d,p;return a;function a(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),u}function u(O){return O===33?(e.consume(O),f):O===47?(e.consume(O),D):O===63?(e.consume(O),w):dn(O)?(e.consume(O),A):r(O)}function f(O){return O===45?(e.consume(O),g):O===91?(e.consume(O),d=0,C):dn(O)?(e.consume(O),S):r(O)}function g(O){return O===45?(e.consume(O),x):r(O)}function c(O){return O===null?r(O):O===45?(e.consume(O),_):Ne(O)?(p=c,Q(O)):(e.consume(O),c)}function _(O){return O===45?(e.consume(O),x):c(O)}function x(O){return O===62?G(O):O===45?_(O):c(O)}function C(O){const Y="CDATA[";return O===Y.charCodeAt(d++)?(e.consume(O),d===Y.length?y:C):r(O)}function y(O){return O===null?r(O):O===93?(e.consume(O),m):Ne(O)?(p=y,Q(O)):(e.consume(O),y)}function m(O){return O===93?(e.consume(O),b):y(O)}function b(O){return O===62?G(O):O===93?(e.consume(O),b):y(O)}function S(O){return O===null||O===62?G(O):Ne(O)?(p=S,Q(O)):(e.consume(O),S)}function w(O){return O===null?r(O):O===63?(e.consume(O),T):Ne(O)?(p=w,Q(O)):(e.consume(O),w)}function T(O){return O===62?G(O):w(O)}function D(O){return dn(O)?(e.consume(O),R):r(O)}function R(O){return O===45||fn(O)?(e.consume(O),R):L(O)}function L(O){return Ne(O)?(p=L,Q(O)):Xe(O)?(e.consume(O),L):G(O)}function A(O){return O===45||fn(O)?(e.consume(O),A):O===47||O===62||yt(O)?j(O):r(O)}function j(O){return O===47?(e.consume(O),G):O===58||O===95||dn(O)?(e.consume(O),M):Ne(O)?(p=j,Q(O)):Xe(O)?(e.consume(O),j):G(O)}function M(O){return O===45||O===46||O===58||O===95||fn(O)?(e.consume(O),M):I(O)}function I(O){return O===61?(e.consume(O),B):Ne(O)?(p=I,Q(O)):Xe(O)?(e.consume(O),I):j(O)}function B(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),l=O,H):Ne(O)?(p=B,Q(O)):Xe(O)?(e.consume(O),B):(e.consume(O),F)}function H(O){return O===l?(e.consume(O),l=void 0,W):O===null?r(O):Ne(O)?(p=H,Q(O)):(e.consume(O),H)}function F(O){return O===null||O===34||O===39||O===60||O===61||O===96?r(O):O===47||O===62||yt(O)?j(O):(e.consume(O),F)}function W(O){return O===47||O===62||yt(O)?j(O):r(O)}function G(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):r(O)}function Q(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),X}function X(O){return Xe(O)?at(e,z,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):z(O)}function z(O){return e.enter("htmlTextData"),p(O)}}const fv={name:"labelEnd",resolveAll:HM,resolveTo:FM,tokenize:UM},PM={tokenize:$M},IM={tokenize:qM},zM={tokenize:VM};function HM(e){let i=-1;const r=[];for(;++i<e.length;){const s=e[i][1];if(r.push(e[i]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",i+=l}}return e.length!==r.length&&Ci(e,0,e.length,r),e}function FM(e,i){let r=e.length,s=0,l,d,p;for(;r--;){const g=e[r][1];if(l){if(g.type==="link"||g.type==="labelLink"&&g._inactive)break;e[r][0]==="enter"&&g.type==="labelLink"&&(g._inactive=!0)}else if(d){if(e[r][0]==="enter"&&(g.type==="labelImage"||g.type==="labelLink")&&!g._balanced&&(l=r,g.type!=="labelLink")){s=2;break}}else g.type==="labelEnd"&&(d=r)}const a={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[d][1].end}},f={type:"labelText",start:{...e[l+s+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",a,i],["enter",u,i]],p=di(p,e.slice(l+1,l+s+3)),p=di(p,[["enter",f,i]]),p=di(p,Vh(i.parser.constructs.insideSpan.null,e.slice(l+s+4,d-3),i)),p=di(p,[["exit",f,i],e[d-2],e[d-1],["exit",u,i]]),p=di(p,e.slice(d+1)),p=di(p,[["exit",a,i]]),Ci(e,l,e.length,p),e}function UM(e,i,r){const s=this,l=s._labelStarts;let d,p;if(l){for(;l.length>0&&l[l.length-1]._balanced;)l.pop();d=l[l.length-1]}return a;function a(_){return d?d._inactive?c(_):(p=s.parser.defined.includes(Ei(s.sliceSerialize({start:d.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),u):r(_)}function u(_){return _===40?e.attempt(PM,g,p?g:c)(_):_===91?e.attempt(IM,g,p?f:c)(_):p?g(_):c(_)}function f(_){return e.attempt(zM,g,c)(_)}function g(_){return l.pop(),i(_)}function c(_){return d._balanced=!0,r(_)}}function $M(e,i,r){return s;function s(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),l}function l(c){return yt(c)?Nl(e,d)(c):d(c)}function d(c){return c===41?g(c):g2(e,p,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function p(c){return yt(c)?Nl(e,u)(c):g(c)}function a(c){return r(c)}function u(c){return c===34||c===39||c===40?_2(e,f,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):g(c)}function f(c){return yt(c)?Nl(e,g)(c):g(c)}function g(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),i):r(c)}}function qM(e,i,r){const s=this;return l;function l(a){return v2.call(s,e,d,p,"reference","referenceMarker","referenceString")(a)}function d(a){return s.parser.defined.includes(Ei(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?i(a):r(a)}function p(a){return r(a)}}function VM(e,i,r){return s;function s(d){return e.enter("reference"),e.enter("referenceMarker"),e.consume(d),e.exit("referenceMarker"),l}function l(d){return d===93?(e.enter("referenceMarker"),e.consume(d),e.exit("referenceMarker"),e.exit("reference"),i):r(d)}}const WM={name:"labelStartImage",resolveAll:fv.resolveAll,tokenize:GM};function GM(e,i,r){const s=this;let l;return d;function d(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),p}function p(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),l=e.exit("labelImage"),a):r(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(u):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),i(u))}}const YM={name:"labelStartLink",resolveAll:fv.resolveAll,tokenize:KM};function KM(e,i,r){const s=this;let l;return d;function d(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),l=e.exit("labelLink"),p}function p(a){return a===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(a):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),i(a))}}const tm={name:"lineEnding",tokenize:XM};function XM(e,i){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),at(e,i,"linePrefix")}}const rh={name:"thematicBreak",tokenize:QM};function QM(e,i,r){let s=0,l;return d;function d(f){return e.enter("thematicBreak"),p(f)}function p(f){return l=f,a(f)}function a(f){return f===l?(e.enter("thematicBreakSequence"),u(f)):s>=3&&(f===null||Ne(f))?(e.exit("thematicBreak"),i(f)):r(f)}function u(f){return f===l?(e.consume(f),s++,u):(e.exit("thematicBreakSequence"),Xe(f)?at(e,a,"whitespace")(f):a(f))}}const jn={continuation:{tokenize:tj},exit:ij,name:"list",tokenize:ej},ZM={partial:!0,tokenize:rj},JM={partial:!0,tokenize:nj};function ej(e,i,r){const s=this,l=s.events[s.events.length-1];let d=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,p=0;return a;function a(x){const C=s.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!s.containerState.marker||x===s.containerState.marker:Km(x)){if(s.containerState.type||(s.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(rh,r,f)(x):f(x);if(!s.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(x)}return r(x)}function u(x){return Km(x)&&++p<10?(e.consume(x),u):(!s.interrupt||p<2)&&(s.containerState.marker?x===s.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),f(x)):r(x)}function f(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||x,e.check(rc,s.interrupt?r:g,e.attempt(ZM,_,c))}function g(x){return s.containerState.initialBlankLine=!0,d++,_(x)}function c(x){return Xe(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),_):r(x)}function _(x){return s.containerState.size=d+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(x)}}function tj(e,i,r){const s=this;return s.containerState._closeFlow=void 0,e.check(rc,l,d);function l(a){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,at(e,i,"listItemIndent",s.containerState.size+1)(a)}function d(a){return s.containerState.furtherBlankLines||!Xe(a)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,p(a)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(JM,i,p)(a))}function p(a){return s.containerState._closeFlow=!0,s.interrupt=void 0,at(e,e.attempt(jn,i,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function nj(e,i,r){const s=this;return at(e,l,"listItemIndent",s.containerState.size+1);function l(d){const p=s.events[s.events.length-1];return p&&p[1].type==="listItemIndent"&&p[2].sliceSerialize(p[1],!0).length===s.containerState.size?i(d):r(d)}}function ij(e){e.exit(this.containerState.type)}function rj(e,i,r){const s=this;return at(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(d){const p=s.events[s.events.length-1];return!Xe(d)&&p&&p[1].type==="listItemPrefixWhitespace"?i(d):r(d)}}const Cb={name:"setextUnderline",resolveTo:sj,tokenize:oj};function sj(e,i){const r=new gh;let s=e.length,l,d,p;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){l=s;break}e[s][1].type==="paragraph"&&(d=s)}else e[s][1].type==="content"&&r.add(s,1,[]),!p&&e[s][1].type==="definition"&&(p=s);const a={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[d][1].type="setextHeadingText",p?(r.add(d,0,[["enter",a,i]]),r.add(p+1,0,[["exit",e[l][1],i]]),e[l][1].end={...e[p][1].end}):e[l][1]=a,r.add(e.length,0,[["exit",a,i]]),r.consume(e),e}function oj(e,i,r){const s=this;let l;return d;function d(f){let g=s.events.length,c;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){c=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||c)?(e.enter("setextHeadingLine"),l=f,p(f)):r(f)}function p(f){return e.enter("setextHeadingLineSequence"),a(f)}function a(f){return f===l?(e.consume(f),a):(e.exit("setextHeadingLineSequence"),Xe(f)?at(e,u,"lineSuffix")(f):u(f))}function u(f){return f===null||Ne(f)?(e.exit("setextHeadingLine"),i(f)):r(f)}}const aj={tokenize:lj};function lj(e){const i=this,r=e.attempt(rc,s,e.attempt(this.parser.constructs.flowInitial,l,at(e,e.attempt(this.parser.constructs.flow,l,e.attempt(gM,l)),"linePrefix")));return r;function s(d){if(d===null){e.consume(d);return}return e.enter("lineEndingBlank"),e.consume(d),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r}function l(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),i.currentConstruct=void 0,r}}const cj={resolveAll:b2()},uj=y2("string"),hj=y2("text");function y2(e){return{resolveAll:b2(e==="text"?dj:void 0),tokenize:i};function i(r){const s=this,l=this.parser.constructs[e],d=r.attempt(l,p,a);return p;function p(g){return f(g)?d(g):a(g)}function a(g){if(g===null){r.consume(g);return}return r.enter("data"),r.consume(g),u}function u(g){return f(g)?(r.exit("data"),d(g)):(r.consume(g),u)}function f(g){if(g===null)return!0;const c=l[g];let _=-1;if(c)for(;++_<c.length;){const x=c[_];if(!x.previous||x.previous.call(s,s.previous))return!0}return!1}}}function b2(e){return i;function i(r,s){let l=-1,d;for(;++l<=r.length;)d===void 0?r[l]&&r[l][1].type==="data"&&(d=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==d+2&&(r[d][1].end=r[l-1][1].end,r.splice(d+2,l-d-2),l=d+2),d=void 0);return e?e(r,s):r}}function dj(e,i){const r=new gh;let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const l=e[s-1][1],d=i.sliceStream(l);let p=d.length,a=-1,u=0,f;for(;p--;){const g=d[p];if(typeof g=="string"){for(a=g.length;g.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(g===-2)f=!0,u++;else if(g!==-1){p++;break}}if(i._contentTypeTextTrailing&&s===e.length&&(u=0),u){const g={type:s===e.length||f||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:p?a:l.start._bufferIndex+a,_index:l.start._index+p,line:l.end.line,column:l.end.column-u,offset:l.end.offset-u},end:{...l.end}};l.end={...g.start},l.start.offset===l.end.offset?Object.assign(l,g):r.add(s,0,[["enter",g,i],["exit",g,i]])}s++}return r.consume(e),e}const fj={42:jn,43:jn,45:jn,48:jn,49:jn,50:jn,51:jn,52:jn,53:jn,54:jn,55:jn,56:jn,57:jn,62:d2},pj={91:bM},mj={[-2]:em,[-1]:em,32:em},gj={35:TM,42:rh,45:[Cb,rh],60:DM,61:Cb,95:rh,96:Sb,126:Sb},vj={38:p2,92:f2},_j={[-5]:tm,[-4]:tm,[-3]:tm,33:WM,38:p2,42:Xm,60:[QL,NM],91:YM,92:[EM,f2],93:fv,95:Xm,96:uM},xj={null:[Xm,cj]},yj={null:[42,95]},bj={null:[]},wj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:yj,contentInitial:pj,disable:bj,document:fj,flow:gj,flowInitial:mj,insideSpan:xj,string:vj,text:_j},Symbol.toStringTag,{value:"Module"}));function Sj(e,i,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},d=[];let p=[],a=[];const u={attempt:L(D),check:L(R),consume:S,enter:w,exit:T,interrupt:L(R,{interrupt:!0})},f={code:null,containerState:{},defineSkip:y,events:[],now:C,parser:e,previous:null,sliceSerialize:_,sliceStream:x,write:c};let g=i.tokenize.call(f,u);return i.resolveAll&&d.push(i),f;function c(I){return p=di(p,I),m(),p[p.length-1]!==null?[]:(A(i,0),f.events=Vh(d,f.events,f),f.events)}function _(I,B){return Ej(x(I),B)}function x(I){return Cj(p,I)}function C(){const{_bufferIndex:I,_index:B,line:H,column:F,offset:W}=s;return{_bufferIndex:I,_index:B,line:H,column:F,offset:W}}function y(I){l[I.line]=I.column,M()}function m(){for(;s._index<p.length;){const I=p[s._index];if(typeof I=="string"){const B=s._index;for(s._bufferIndex<0&&(s._bufferIndex=0);s._index===B&&s._bufferIndex<I.length;)b(I.charCodeAt(s._bufferIndex))}else b(I)}}function b(I){g=g(I)}function S(I){Ne(I)?(s.line++,s.column=1,s.offset+=I===-3?2:1,M()):I!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===p[s._index].length&&(s._bufferIndex=-1,s._index++)),f.previous=I}function w(I,B){const H=B||{};return H.type=I,H.start=C(),f.events.push(["enter",H,f]),a.push(H),H}function T(I){const B=a.pop();return B.end=C(),f.events.push(["exit",B,f]),B}function D(I,B){A(I,B.from)}function R(I,B){B.restore()}function L(I,B){return H;function H(F,W,G){let Q,X,z,O;return Array.isArray(F)?Z(F):"tokenize"in F?Z([F]):Y(F);function Y(le){return K;function K($){const oe=$!==null&&le[$],ee=$!==null&&le.null,ue=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return Z(ue)($)}}function Z(le){return Q=le,X=0,le.length===0?G:U(le[X])}function U(le){return K;function K($){return O=j(),z=le,le.partial||(f.currentConstruct=le),le.name&&f.parser.constructs.disable.null.includes(le.name)?ne():le.tokenize.call(B?Object.assign(Object.create(f),B):f,u,V,ne)($)}}function V(le){return I(z,O),W}function ne(le){return O.restore(),++X<Q.length?U(Q[X]):G}}}function A(I,B){I.resolveAll&&!d.includes(I)&&d.push(I),I.resolve&&Ci(f.events,B,f.events.length-B,I.resolve(f.events.slice(B),f)),I.resolveTo&&(f.events=I.resolveTo(f.events,f))}function j(){const I=C(),B=f.previous,H=f.currentConstruct,F=f.events.length,W=Array.from(a);return{from:F,restore:G};function G(){s=I,f.previous=B,f.currentConstruct=H,f.events.length=F,a=W,M()}}function M(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function Cj(e,i){const r=i.start._index,s=i.start._bufferIndex,l=i.end._index,d=i.end._bufferIndex;let p;if(r===l)p=[e[r].slice(s,d)];else{if(p=e.slice(r,l),s>-1){const a=p[0];typeof a=="string"?p[0]=a.slice(s):p.shift()}d>0&&p.push(e[l].slice(0,d))}return p}function Ej(e,i){let r=-1;const s=[];let l;for(;++r<e.length;){const d=e[r];let p;if(typeof d=="string")p=d;else switch(d){case-5:{p="\r";break}case-4:{p=`
530
- `;break}case-3:{p=`\r
531
- `;break}case-2:{p=i?" ":" ";break}case-1:{if(!i&&l)continue;p=" ";break}default:p=String.fromCharCode(d)}l=d===-2,s.push(p)}return s.join("")}function kj(e){const s={constructs:l2([wj,...(e||{}).extensions||[]]),content:l(qL),defined:[],document:l(WL),flow:l(aj),lazy:{},string:l(uj),text:l(hj)};return s;function l(d){return p;function p(a){return Sj(s,d,a)}}}function Tj(e){for(;!m2(e););return e}const Eb=/[\0\t\n\r]/g;function Rj(){let e=1,i="",r=!0,s;return l;function l(d,p,a){d=i+(typeof d=="string"?d.toString():new TextDecoder(p||void 0).decode(d));const u=[];let f=0;for(i="",r&&(d.charCodeAt(0)===65279&&f++,r=void 0);f<d.length;){Eb.lastIndex=f;const g=Eb.exec(d),c=g&&g.index!==void 0?g.index:d.length,_=d.charCodeAt(c);if(!g){i=d.slice(f);break}if(_===10&&f===c&&s)u.push(-3),s=void 0;else switch(s&&(u.push(-5),s=void 0),f<c&&(u.push(d.slice(f,c)),e+=c-f),_){case 0:{u.push(65533),e++;break}case 9:{const x=Math.ceil(e/4)*4;for(u.push(-2);e++<x;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:s=!0,e=1}f=c+1}return a&&(s&&u.push(-5),i&&u.push(i),u.push(null)),u}}const Aj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dj(e){return e.replace(Aj,Lj)}function Lj(e,i,r){if(i)return i;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),d=l===120||l===88;return c2(r.slice(d?2:1),d?16:10)}return dv(r)||e}const w2={}.hasOwnProperty;function Mj(e,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),jj(r)(Tj(kj(r).document().write(Rj()(e,i,!0))))}function jj(e){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:p($e),autolinkProtocol:M,autolinkEmail:M,atxHeading:p(qe),blockQuote:p(ue),characterEscape:M,characterReference:M,codeFenced:p(he),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:p(he,a),codeText:p(Se,a),codeTextData:M,data:M,codeFlowValue:M,definition:p(we),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:p(Re),hardBreakEscape:p(ke),hardBreakTrailing:p(ke),htmlFlow:p(ze,a),htmlFlowData:M,htmlText:p(ze,a),htmlTextData:M,image:p(Mt),label:a,link:p($e),listItem:p(Ie),listItemValue:x,listOrdered:p(Be,_),listUnordered:p(Be),paragraph:p(Te),reference:V,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:p(qe),strong:p(Ve),thematicBreak:p(st)},exit:{atxHeading:f(),atxHeadingSequence:R,autolink:f(),autolinkEmail:ee,autolinkProtocol:oe,blockQuote:f(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:K,characterReference:$,codeFenced:f(b),codeFencedFence:m,codeFencedFenceInfo:C,codeFencedFenceMeta:y,codeFlowValue:I,codeIndented:f(S),codeText:f(G),codeTextData:I,data:I,definition:f(),definitionDestinationString:D,definitionLabelString:w,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(H),hardBreakTrailing:f(H),htmlFlow:f(F),htmlFlowData:I,htmlText:f(W),htmlTextData:I,image:f(X),label:O,labelText:z,lineEnding:B,link:f(Q),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ne,resourceDestinationString:Y,resourceTitleString:Z,resource:U,setextHeading:f(j),setextHeadingLineSequence:A,setextHeadingText:L,strong:f(),thematicBreak:f()}};S2(i,(e||{}).mdastExtensions||[]);const r={};return s;function s(fe){let _e={type:"root",children:[],position:void 0};const De={stack:[_e],tokenStack:[],config:i,enter:u,exit:g,buffer:a,resume:c,data:r},Le=[],Fe=[];let Me=-1;for(;++Me<fe.length;)if(Fe.push(fe[Me]),fe[Me][1].type==="listOrdered"||fe[Me][1].type==="listUnordered")if(fe[Me][0]==="enter")Le.push(Fe.length-1);else{const Tt=Le.pop();d(Fe,Tt)}for(fe=Fe,Me=-1;++Me<fe.length;){const Tt=i[fe[Me][0]];fe[Me][0]==="enter"&&i.beforeEnter.length>0&&l(i.beforeEnter,{...De,sliceSerialize:fe[Me][2].sliceSerialize},fe[Me][1]),w2.call(Tt,fe[Me][1].type)&&Tt[fe[Me][1].type].call({...De,sliceSerialize:fe[Me][2].sliceSerialize},fe[Me][1]),fe[Me][0]==="exit"&&i.afterExit.length>0&&l(i.afterExit,{...De,sliceSerialize:fe[Me][2].sliceSerialize},fe[Me][1])}if(De.tokenStack.length>0){const Tt=De.tokenStack[De.tokenStack.length-1];(Tt[1]||kb).call(De,void 0,Tt[0])}for(_e.position={start:is(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:is(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me<i.transforms.length;)_e=i.transforms[Me](_e)||_e;return _e}function l(fe,_e,De){let Le=-1;for(;++Le<fe.length;)fe[Le].call(_e,De)}function d(fe,_e){const De=fe.length-1;let Le=_e-1,Fe=-1,Me=!1,Tt,qt,kn,ei;const ti=[];for(;++Le<=De;){const Wt=fe[Le];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?Fe++:Fe--,ei=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(Tt&&!ei&&!Fe&&!kn&&(kn=Le),ei=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ei=void 0}if(!Fe&&Wt[0]==="enter"&&Wt[1].type==="listItemPrefix"||Fe===-1&&Wt[0]==="exit"&&(Wt[1].type==="listUnordered"||Wt[1].type==="listOrdered")){if(Tt){let ni=Le;for(qt=void 0;ni--;){const xn=fe[ni];if(xn[1].type==="lineEnding"||xn[1].type==="lineEndingBlank"){if(xn[0]==="exit")continue;qt&&(fe[qt][1].type="lineEndingBlank",Me=!0),xn[1].type="lineEnding",qt=ni}else if(!(xn[1].type==="linePrefix"||xn[1].type==="blockQuotePrefix"||xn[1].type==="blockQuotePrefixWhitespace"||xn[1].type==="blockQuoteMarker"||xn[1].type==="listItemIndent"))break}kn&&(!qt||kn<qt)&&(Tt._spread=!0),Tt.end=Object.assign({},qt?fe[qt][1].start:Wt[1].end),ti.push({at:qt||Le,event:["exit",Tt,Wt[2]]})}if(Wt[1].type==="listItemPrefix"){const ni={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};Tt=ni,ti.push({at:Le,event:["enter",ni,Wt[2]]}),kn=void 0,ei=!0}}}const oo=fe.splice(_e);let Vt=0;for(Le=-1;++Le<oo.length;){for(;Vt<ti.length&&ti[Vt].at===_e+Le;)fe.push(ti[Vt++].event);fe.push(oo[Le])}fe[_e][1]._spread=Me}function p(fe,_e){return De;function De(Le){u.call(this,fe(Le),Le),_e&&_e.call(this,Le)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(fe,_e,De){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([_e,De||void 0]),fe.position={start:is(_e.start),end:void 0}}function f(fe){return _e;function _e(De){fe&&fe.call(this,De),g.call(this,De)}}function g(fe,_e){const De=this.stack.pop(),Le=this.tokenStack.pop();if(!Le)throw new Error("Cannot close `"+fe.type+"` ("+Ol({start:fe.start,end:fe.end})+"): it’s not open");Le[0].type!==fe.type&&(_e?_e.call(this,fe,Le[0]):(Le[1]||kb).call(this,fe,Le[0])),De.position.end=is(fe.end)}function c(){return hv(this.stack.pop())}function _(){this.data.expectingFirstListItemValue=!0}function x(fe){if(this.data.expectingFirstListItemValue){const _e=this.stack[this.stack.length-2];_e.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function C(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.lang=fe}function y(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.meta=fe}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe.replace(/(\r?\n|\r)$/g,"")}function w(fe){const _e=this.resume(),De=this.stack[this.stack.length-1];De.label=_e,De.identifier=Ei(this.sliceSerialize(fe)).toLowerCase()}function T(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function D(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.url=fe}function R(fe){const _e=this.stack[this.stack.length-1];if(!_e.depth){const De=this.sliceSerialize(fe).length;_e.depth=De}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function M(fe){const De=this.stack[this.stack.length-1].children;let Le=De[De.length-1];(!Le||Le.type!=="text")&&(Le=gt(),Le.position={start:is(fe.start),end:void 0},De.push(Le)),this.stack.push(Le)}function I(fe){const _e=this.stack.pop();_e.value+=this.sliceSerialize(fe),_e.position.end=is(fe.end)}function B(fe){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=_e.children[_e.children.length-1];De.position.end=is(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(_e.type)&&(M.call(this,fe),I.call(this,fe))}function H(){this.data.atHardBreak=!0}function F(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function W(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function G(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function Q(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=_e,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function X(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=_e,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function z(fe){const _e=this.sliceSerialize(fe),De=this.stack[this.stack.length-2];De.label=Dj(_e),De.identifier=Ei(_e).toLowerCase()}function O(){const fe=this.stack[this.stack.length-1],_e=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Le=fe.children;De.children=Le}else De.alt=_e}function Y(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.url=fe}function Z(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function U(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function ne(fe){const _e=this.resume(),De=this.stack[this.stack.length-1];De.label=_e,De.identifier=Ei(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function le(fe){this.data.characterReferenceType=fe.type}function K(fe){const _e=this.sliceSerialize(fe),De=this.data.characterReferenceType;let Le;De?(Le=c2(_e,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=dv(_e);const Fe=this.stack[this.stack.length-1];Fe.value+=Le}function $(fe){const _e=this.stack.pop();_e.position.end=is(fe.end)}function oe(fe){I.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(fe)}function ee(fe){I.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(fe)}function ue(){return{type:"blockquote",children:[],position:void 0}}function he(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Se(){return{type:"inlineCode",value:"",position:void 0}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Re(){return{type:"emphasis",children:[],position:void 0}}function qe(){return{type:"heading",depth:0,children:[],position:void 0}}function ke(){return{type:"break",position:void 0}}function ze(){return{type:"html",value:"",position:void 0}}function Mt(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function $e(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Be(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[],position:void 0}}function Ie(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[],position:void 0}}function Te(){return{type:"paragraph",children:[],position:void 0}}function Ve(){return{type:"strong",children:[],position:void 0}}function gt(){return{type:"text",value:"",position:void 0}}function st(){return{type:"thematicBreak",position:void 0}}}function is(e){return{line:e.line,column:e.column,offset:e.offset}}function S2(e,i){let r=-1;for(;++r<i.length;){const s=i[r];Array.isArray(s)?S2(e,s):Oj(e,s)}}function Oj(e,i){let r;for(r in i)if(w2.call(i,r))switch(r){case"canContainEols":{const s=i[r];s&&e[r].push(...s);break}case"transforms":{const s=i[r];s&&e[r].push(...s);break}case"afterExit":case"beforeEnter":{const s=i[r];s&&e[r].push(s);break}case"enter":case"exit":{const s=i[r];s&&Object.assign(e[r],s);break}}}function kb(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Ol({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Ol({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Ol({start:i.start,end:i.end})+") is still open")}function Nj(e){const i=this;i.parser=r;function r(s){return Mj(s,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function Bj(e,i){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)}function Pj(e,i){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:`
532
- `}]}function Ij(e,i){const r=i.value?i.value+`
533
- `:"",s={},l=i.lang?i.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let d={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return i.meta&&(d.data={meta:i.meta}),e.patch(i,d),d=e.applyData(i,d),d={type:"element",tagName:"pre",properties:{},children:[d]},e.patch(i,d),d}function zj(e,i){const r={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function Hj(e,i){const r={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function Fj(e,i){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(i.identifier).toUpperCase(),l=Aa(s.toLowerCase()),d=e.footnoteOrder.indexOf(s);let p,a=e.footnoteCounts.get(s);a===void 0?(a=0,e.footnoteOrder.push(s),p=e.footnoteOrder.length):p=d+1,a+=1,e.footnoteCounts.set(s,a);const u={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(p)}]};e.patch(i,u);const f={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(i,f),e.applyData(i,f)}function Uj(e,i){const r={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function $j(e,i){if(e.options.allowDangerousHtml){const r={type:"raw",value:i.value};return e.patch(i,r),e.applyData(i,r)}}function C2(e,i){const r=i.referenceType;let s="]";if(r==="collapsed"?s+="[]":r==="full"&&(s+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+s}];const l=e.all(i),d=l[0];d&&d.type==="text"?d.value="["+d.value:l.unshift({type:"text",value:"["});const p=l[l.length-1];return p&&p.type==="text"?p.value+=s:l.push({type:"text",value:s}),l}function qj(e,i){const r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return C2(e,i);const l={src:Aa(s.url||""),alt:i.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const d={type:"element",tagName:"img",properties:l,children:[]};return e.patch(i,d),e.applyData(i,d)}function Vj(e,i){const r={src:Aa(i.url)};i.alt!==null&&i.alt!==void 0&&(r.alt=i.alt),i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(i,s),e.applyData(i,s)}function Wj(e,i){const r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,r);const s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(i,s),e.applyData(i,s)}function Gj(e,i){const r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return C2(e,i);const l={href:Aa(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const d={type:"element",tagName:"a",properties:l,children:e.all(i)};return e.patch(i,d),e.applyData(i,d)}function Yj(e,i){const r={href:Aa(i.url)};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(i)};return e.patch(i,s),e.applyData(i,s)}function Kj(e,i,r){const s=e.all(i),l=r?Xj(r):E2(i),d={},p=[];if(typeof i.checked=="boolean"){const g=s[0];let c;g&&g.type==="element"&&g.tagName==="p"?c=g:(c={type:"element",tagName:"p",properties:{},children:[]},s.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let a=-1;for(;++a<s.length;){const g=s[a];(l||a!==0||g.type!=="element"||g.tagName!=="p")&&p.push({type:"text",value:`
534
- `}),g.type==="element"&&g.tagName==="p"&&!l?p.push(...g.children):p.push(g)}const u=s[s.length-1];u&&(l||u.type!=="element"||u.tagName!=="p")&&p.push({type:"text",value:`
535
- `});const f={type:"element",tagName:"li",properties:d,children:p};return e.patch(i,f),e.applyData(i,f)}function Xj(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const r=e.children;let s=-1;for(;!i&&++s<r.length;)i=E2(r[s])}return i}function E2(e){const i=e.spread;return i??e.children.length>1}function Qj(e,i){const r={},s=e.all(i);let l=-1;for(typeof i.start=="number"&&i.start!==1&&(r.start=i.start);++l<s.length;){const p=s[l];if(p.type==="element"&&p.tagName==="li"&&p.properties&&Array.isArray(p.properties.className)&&p.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const d={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:e.wrap(s,!0)};return e.patch(i,d),e.applyData(i,d)}function Zj(e,i){const r={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function Jj(e,i){const r={type:"root",children:e.wrap(e.all(i))};return e.patch(i,r),e.applyData(i,r)}function eO(e,i){const r={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function tO(e,i){const r=e.all(i),s=r.shift(),l=[];if(s){const p={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(i.children[0],p),l.push(p)}if(r.length>0){const p={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},a=av(i.children[1]),u=t2(i.children[i.children.length-1]);a&&u&&(p.position={start:a,end:u}),l.push(p)}const d={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(i,d),e.applyData(i,d)}function nO(e,i,r){const s=r?r.children:void 0,d=(s?s.indexOf(i):1)===0?"th":"td",p=r&&r.type==="table"?r.align:void 0,a=p?p.length:i.children.length;let u=-1;const f=[];for(;++u<a;){const c=i.children[u],_={},x=p?p[u]:void 0;x&&(_.align=x);let C={type:"element",tagName:d,properties:_,children:[]};c&&(C.children=e.all(c),e.patch(c,C),C=e.applyData(c,C)),f.push(C)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(i,g),e.applyData(i,g)}function iO(e,i){const r={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}const Tb=9,Rb=32;function rO(e){const i=String(e),r=/\r?\n|\r/g;let s=r.exec(i),l=0;const d=[];for(;s;)d.push(Ab(i.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=r.exec(i);return d.push(Ab(i.slice(l),l>0,!1)),d.join("")}function Ab(e,i,r){let s=0,l=e.length;if(i){let d=e.codePointAt(s);for(;d===Tb||d===Rb;)s++,d=e.codePointAt(s)}if(r){let d=e.codePointAt(l-1);for(;d===Tb||d===Rb;)l--,d=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function sO(e,i){const r={type:"text",value:rO(String(i.value))};return e.patch(i,r),e.applyData(i,r)}function oO(e,i){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,r),e.applyData(i,r)}const aO={blockquote:Bj,break:Pj,code:Ij,delete:zj,emphasis:Hj,footnoteReference:Fj,heading:Uj,html:$j,imageReference:qj,image:Vj,inlineCode:Wj,linkReference:Gj,link:Yj,listItem:Kj,list:Qj,paragraph:Zj,root:Jj,strong:eO,table:tO,tableCell:iO,tableRow:nO,text:sO,thematicBreak:oO,toml:Gu,yaml:Gu,definition:Gu,footnoteDefinition:Gu};function Gu(){}const k2=-1,Wh=0,Bl=1,vh=2,pv=3,mv=4,gv=5,vv=6,T2=7,R2=8,{defineProperty:lO}=Object,A2=typeof self=="object"?self:globalThis,Db=(e,i)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new A2[e](i)},cO=(e,i)=>{const r=(l,d)=>(e.set(d,l),l),s=l=>{if(e.has(l))return e.get(l);const[d,p]=i[l];switch(d){case Wh:case k2:return r(p,l);case Bl:{const a=r([],l);for(const u of p)a.push(s(u));return a}case vh:{const a=r({},l);for(const[u,f]of p){const g=s(u),c=s(f);g==="__proto__"?lO(a,g,{value:c,configurable:!0,enumerable:!0,writable:!0}):a[g]=c}return a}case pv:return r(new Date(p),l);case mv:{const{source:a,flags:u}=p;return r(new RegExp(a,u),l)}case gv:{const a=r(new Map,l);for(const[u,f]of p)a.set(s(u),s(f));return a}case vv:{const a=r(new Set,l);for(const u of p)a.add(s(u));return a}case T2:{const{name:a,message:u}=p;return r(typeof A2[a]=="function"?Db(a,u):new Error(u),l)}case R2:return r(BigInt(p),l);case"BigInt":return r(Object(BigInt(p)),l);case"ArrayBuffer":return r(new Uint8Array(p).buffer,p);case"DataView":{const{buffer:a}=new Uint8Array(p);return r(new DataView(a),p)}case"-0":return-0}return r(Db(d,p),l)};return s},Lb=e=>cO(new Map,e)(0),qs="",{toString:uO}={},{keys:hO,is:dO}=Object,Dl=e=>{const i=typeof e;if(i!=="object"||!e)return[Wh,i];const r=uO.call(e).slice(8,-1);switch(r){case"Array":return[Bl,qs];case"Object":return[vh,qs];case"Date":return[pv,qs];case"RegExp":return[mv,qs];case"Map":return[gv,qs];case"Set":return[vv,qs];case"DataView":return[Bl,r]}return r.includes("Array")?[Bl,r]:e instanceof Error?[T2,e.name||"Error"]:[vh,r]},Yu=([e,i])=>e===Wh&&(i==="function"||i==="symbol"),fO=(e,i,r,s)=>{const l=(p,a)=>{const u=s.push(p)-1;return r.set(a,u),u},d=p=>{if(r.has(p))return r.get(p);let[a,u]=Dl(p);switch(a){case Wh:{let g=p;switch(u){case"bigint":a=R2,g=p.toString();break;case"number":if(!p&&dO(p,-0))return s.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);g=null;break;case"undefined":return l([k2],p)}return l([a,g],p)}case Bl:{if(u){let _=p;return u==="DataView"?_=new Uint8Array(p.buffer):u==="ArrayBuffer"&&(_=new Uint8Array(p)),l([u,[..._]],p)}const g=[],c=l([a,g],p);for(const _ of p)g.push(d(_));return c}case vh:{if(u)switch(u){case"BigInt":return l([u,p.toString()],p);case"Boolean":case"Number":case"String":return l([u,p.valueOf()],p)}if(i&&"toJSON"in p)return d(p.toJSON());const g=[],c=l([a,g],p);for(const _ of hO(p))(e||!Yu(Dl(p[_])))&&g.push([d(_),d(p[_])]);return c}case pv:return l([a,isNaN(p.getTime())?qs:p.toISOString()],p);case mv:{const{source:g,flags:c}=p;return l([a,{source:g,flags:c}],p)}case gv:{const g=[],c=l([a,g],p);for(const[_,x]of p)(e||!(Yu(Dl(_))||Yu(Dl(x))))&&g.push([d(_),d(x)]);return c}case vv:{const g=[],c=l([a,g],p);for(const _ of p)(e||!Yu(Dl(_)))&&g.push(d(_));return c}}const{message:f}=p;return l([a,{name:u,message:f}],p)};return d},Mb=(e,{json:i,lossy:r}={})=>{const s=[];return fO(!(i||r),!!i,new Map,s)(e),s},_h=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?Lb(Mb(e,i)):structuredClone(e):(e,i)=>Lb(Mb(e,i));function pO(e,i){const r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function mO(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function gO(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||pO,s=e.options.footnoteBackLabel||mO,l=e.options.footnoteLabel||"Footnotes",d=e.options.footnoteLabelTagName||"h2",p=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[u]);if(!f)continue;const g=e.all(f),c=String(f.identifier).toUpperCase(),_=Aa(c.toLowerCase());let x=0;const C=[],y=e.footnoteCounts.get(c);for(;y!==void 0&&++x<=y;){C.length>0&&C.push({type:"text",value:" "});let S=typeof r=="string"?r:r(u,x);typeof S=="string"&&(S={type:"text",value:S}),C.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+_+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(u,x),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const m=g[g.length-1];if(m&&m.type==="element"&&m.tagName==="p"){const S=m.children[m.children.length-1];S&&S.type==="text"?S.value+=" ":m.children.push({type:"text",value:" "}),m.children.push(...C)}else g.push(...C);const b={type:"element",tagName:"li",properties:{id:i+"fn-"+_},children:e.wrap(g,!0)};e.patch(f,b),a.push(b)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{..._h(p),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
536
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
537
- `}]}}const Gh=(function(e){if(e==null)return yO;if(typeof e=="function")return Yh(e);if(typeof e=="object")return Array.isArray(e)?vO(e):_O(e);if(typeof e=="string")return xO(e);throw new Error("Expected function, string, or object as test")});function vO(e){const i=[];let r=-1;for(;++r<e.length;)i[r]=Gh(e[r]);return Yh(s);function s(...l){let d=-1;for(;++d<i.length;)if(i[d].apply(this,l))return!0;return!1}}function _O(e){const i=e;return Yh(r);function r(s){const l=s;let d;for(d in e)if(l[d]!==i[d])return!1;return!0}}function xO(e){return Yh(i);function i(r){return r&&r.type===e}}function Yh(e){return i;function i(r,s,l){return!!(bO(r)&&e.call(this,r,typeof s=="number"?s:void 0,l||void 0))}}function yO(){return!0}function bO(e){return e!==null&&typeof e=="object"&&"type"in e}const D2=[],wO=!0,sh=!1,Jm="skip";function eg(e,i,r,s){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let l=!0,d,p,a,u;if(typeof r=="function"||r&&typeof r=="object"?(d=i,p=r,s&&(l=!1)):(p=i,r&&(l=!1)),typeof p=="function")a=p;else if(p&&typeof p=="object"){if(!(p.enter===null||p.enter===void 0))if(typeof p.enter=="function")a=p.enter;else throw new Error("Unexpected value `"+p.enter+"` for `visitors.enter`, expected optional visitor");if(typeof p.exit=="function")u=p.exit;else throw new Error("Unexpected value `"+p.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+p+"` for `enter` or `visitors`, expected visitor or object with visitors");const f=Gh(d),g=l?1:-1;c(e,void 0,[])();function c(_,x,C){const y=_&&typeof _=="object"?_:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(_.type+(b?"<"+b+">":""))+")"})}return m;function m(){const b=!d||f(_,x,C[C.length-1]||void 0);let S=D2;if(a&&b&&(S=jb(a(_,C,x)),S[0]===sh))return S;if("children"in _&&_.children){const w=_;if(w.children&&S[0]!==Jm){let T=(l?-1:w.children.length)+g;const D=[...C,w];for(;T>-1&&T<w.children.length;){const R=w.children[T],L=c(R,T,D)();if(L[0]===sh)return L;T=typeof L[1]=="number"?L[1]:T+g}}}if(u&&b){const w=jb(u(_,C,x));if(w[0]===Jm)throw new Error("Unexpected value `"+w[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(w[0]===sh||typeof w[1]=="number")return w}return S}}}function jb(e){return Array.isArray(e)?e:typeof e=="number"?[wO,e]:e==null?D2:[e]}function _v(e,i,r,s){let l,d,p;d=i,p=r,typeof d=="function"?eg(e,l,tg(d),p):eg(e,l,SO(d),p)}function SO(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?tg(e.enter):e.enter,exit:typeof e.exit=="function"?tg(e.exit):e.exit}}function tg(e){return i;function i(r,s,l){return e(r,l,s[s.length-1])}}const ng={}.hasOwnProperty,CO={};function EO(e,i){const r=i||CO,s=new Map,l=new Map,d=new Map,p={...aO,...r.handlers},a={all:f,applyData:TO,definitionById:s,footnoteById:l,footnoteCounts:d,footnoteOrder:[],handlers:p,one:u,options:r,patch:kO,wrap:AO};return _v(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const c=g.type==="definition"?s:l,_=String(g.identifier).toUpperCase();c.has(_)||c.set(_,g)}}),a;function u(g,c){const _=g.type,x=a.handlers[_];if(ng.call(a.handlers,_)&&x)return x(a,g,c);if(a.options.passThrough&&a.options.passThrough.includes(_)){if("children"in g){const{children:y,...m}=g,b=_h(m);return b.children=a.all(g),b}return _h(g)}return(a.options.unknownHandler||RO)(a,g,c)}function f(g){const c=[];if("children"in g){const _=g.children;let x=-1;for(;++x<_.length;){const C=a.one(_[x],g);if(C){if(x&&_[x-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=Ob(C.value)),!Array.isArray(C)&&C.type==="element")){const y=C.children[0];y&&y.type==="text"&&(y.value=Ob(y.value))}Array.isArray(C)?c.push(...C):c.push(C)}}}return c}}function kO(e,i){e.position&&(i.position=vL(e))}function TO(e,i){let r=i;if(e&&e.data){const s=e.data.hName,l=e.data.hChildren,d=e.data.hProperties;if(typeof s=="string")if(r.type==="element")r.tagName=s;else{const p="children"in r?r.children:[r];r={type:"element",tagName:s,properties:{},children:p}}r.type==="element"&&d&&Object.assign(r.properties,_h(d)),"children"in r&&r.children&&l!==null&&l!==void 0&&(r.children=l)}return r}function RO(e,i){const r=i.data||{},s="value"in i&&!(ng.call(r,"hProperties")||ng.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,s),e.applyData(i,s)}function AO(e,i){const r=[];let s=-1;for(i&&r.push({type:"text",value:`
538
- `});++s<e.length;)s&&r.push({type:"text",value:`
539
- `}),r.push(e[s]);return i&&e.length>0&&r.push({type:"text",value:`
540
- `}),r}function Ob(e){let i=0,r=e.charCodeAt(i);for(;r===9||r===32;)i++,r=e.charCodeAt(i);return e.slice(i)}function Nb(e,i){const r=EO(e,i),s=r.one(e,void 0),l=gO(r),d=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&d.children.push({type:"text",value:`
541
- `},l),d}function DO(e,i){return e&&"run"in e?async function(r,s){const l=Nb(r,{file:s,...i});await e.run(l,s)}:function(r,s){return Nb(r,{file:s,...e||i})}}function Bb(e){if(e)throw e}var nm,Pb;function LO(){if(Pb)return nm;Pb=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(f){return typeof Array.isArray=="function"?Array.isArray(f):i.call(f)==="[object Array]"},d=function(f){if(!f||i.call(f)!=="[object Object]")return!1;var g=e.call(f,"constructor"),c=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!g&&!c)return!1;var _;for(_ in f);return typeof _>"u"||e.call(f,_)},p=function(f,g){r&&g.name==="__proto__"?r(f,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):f[g.name]=g.newValue},a=function(f,g){if(g==="__proto__")if(e.call(f,g)){if(s)return s(f,g).value}else return;return f[g]};return nm=function u(){var f,g,c,_,x,C,y=arguments[0],m=1,b=arguments.length,S=!1;for(typeof y=="boolean"&&(S=y,y=arguments[1]||{},m=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});m<b;++m)if(f=arguments[m],f!=null)for(g in f)c=a(y,g),_=a(f,g),y!==_&&(S&&_&&(d(_)||(x=l(_)))?(x?(x=!1,C=c&&l(c)?c:[]):C=c&&d(c)?c:{},p(y,{name:g,newValue:u(S,C,_)})):typeof _<"u"&&p(y,{name:g,newValue:_}));return y},nm}var MO=LO();const im=fg(MO);function ig(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jO(){const e=[],i={run:r,use:s};return i;function r(...l){let d=-1;const p=l.pop();if(typeof p!="function")throw new TypeError("Expected function as last argument, not "+p);a(null,...l);function a(u,...f){const g=e[++d];let c=-1;if(u){p(u);return}for(;++c<l.length;)(f[c]===null||f[c]===void 0)&&(f[c]=l[c]);l=f,g?OO(g,a)(...f):p(null,...f)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),i}}function OO(e,i){let r;return s;function s(...p){const a=e.length>p.length;let u;a&&p.push(l);try{u=e.apply(this,p)}catch(f){const g=f;if(a&&r)throw g;return l(g)}a||(u&&u.then&&typeof u.then=="function"?u.then(d,l):u instanceof Error?l(u):d(u))}function l(p,...a){r||(r=!0,i(p,...a))}function d(p){l(null,p)}}const zi={basename:NO,dirname:BO,extname:PO,join:IO,sep:"/"};function NO(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');sc(e);let r=0,s=-1,l=e.length,d;if(i===void 0||i.length===0||i.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(d){r=l+1;break}}else s<0&&(d=!0,s=l+1);return s<0?"":e.slice(r,s)}if(i===e)return"";let p=-1,a=i.length-1;for(;l--;)if(e.codePointAt(l)===47){if(d){r=l+1;break}}else p<0&&(d=!0,p=l+1),a>-1&&(e.codePointAt(l)===i.codePointAt(a--)?a<0&&(s=l):(a=-1,s=p));return r===s?s=p:s<0&&(s=e.length),e.slice(r,s)}function BO(e){if(sc(e),e.length===0)return".";let i=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){i=r;break}}else s||(s=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function PO(e){sc(e);let i=e.length,r=-1,s=0,l=-1,d=0,p;for(;i--;){const a=e.codePointAt(i);if(a===47){if(p){s=i+1;break}continue}r<0&&(p=!0,r=i+1),a===46?l<0?l=i:d!==1&&(d=1):l>-1&&(d=-1)}return l<0||r<0||d===0||d===1&&l===r-1&&l===s+1?"":e.slice(l,r)}function IO(...e){let i=-1,r;for(;++i<e.length;)sc(e[i]),e[i]&&(r=r===void 0?e[i]:r+"/"+e[i]);return r===void 0?".":zO(r)}function zO(e){sc(e);const i=e.codePointAt(0)===47;let r=HO(e,!i);return r.length===0&&!i&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),i?"/"+r:r}function HO(e,i){let r="",s=0,l=-1,d=0,p=-1,a,u;for(;++p<=e.length;){if(p<e.length)a=e.codePointAt(p);else{if(a===47)break;a=47}if(a===47){if(!(l===p-1||d===1))if(l!==p-1&&d===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(u=r.lastIndexOf("/"),u!==r.length-1){u<0?(r="",s=0):(r=r.slice(0,u),s=r.length-1-r.lastIndexOf("/")),l=p,d=0;continue}}else if(r.length>0){r="",s=0,l=p,d=0;continue}}i&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(l+1,p):r=e.slice(l+1,p),s=p-l-1;l=p,d=0}else a===46&&d>-1?d++:d=-1}return r}function sc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const FO={cwd:UO};function UO(){return"/"}function rg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $O(e){if(typeof e=="string")e=new URL(e);else if(!rg(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return qO(e)}function qO(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const i=e.pathname;let r=-1;for(;++r<i.length;)if(i.codePointAt(r)===37&&i.codePointAt(r+1)===50){const s=i.codePointAt(r+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(i)}const rm=["history","path","basename","stem","extname","dirname"];class L2{constructor(i){let r;i?rg(i)?r={path:i}:typeof i=="string"||VO(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":FO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<rm.length;){const d=rm[s];d in r&&r[d]!==void 0&&r[d]!==null&&(this[d]=d==="history"?[...r[d]]:r[d])}let l;for(l in r)rm.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?zi.basename(this.path):void 0}set basename(i){om(i,"basename"),sm(i,"basename"),this.path=zi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?zi.dirname(this.path):void 0}set dirname(i){Ib(this.basename,"dirname"),this.path=zi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?zi.extname(this.path):void 0}set extname(i){if(sm(i,"extname"),Ib(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){rg(i)&&(i=$O(i)),om(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?zi.basename(this.path,this.extname):void 0}set stem(i){om(i,"stem"),sm(i,"stem"),this.path=zi.join(this.dirname||"",i+(this.extname||""))}fail(i,r,s){const l=this.message(i,r,s);throw l.fatal=!0,l}info(i,r,s){const l=this.message(i,r,s);return l.fatal=void 0,l}message(i,r,s){const l=new _n(i,r,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function sm(e,i){if(e&&e.includes(zi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+zi.sep+"`")}function om(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function Ib(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function VO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const WO=(function(e){const s=this.constructor.prototype,l=s[e],d=function(){return l.apply(d,arguments)};return Object.setPrototypeOf(d,s),d}),GO={}.hasOwnProperty;class xv extends WO{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=jO()}copy(){const i=new xv;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];i.use(...s)}return i.data(im(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(cm("data",this.frozen),this.namespace[i]=r,this):GO.call(this.namespace,i)&&this.namespace[i]||void 0:i?(cm("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=r.call(i,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const r=Ku(i),s=this.parser||this.Parser;return am("parse",s),s(String(r),r)}process(i,r){const s=this;return this.freeze(),am("process",this.parser||this.Parser),lm("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(d,p){const a=Ku(i),u=s.parse(a);s.run(u,a,function(g,c,_){if(g||!c||!_)return f(g);const x=c,C=s.stringify(x,_);XO(C)?_.value=C:_.result=C,f(g,_)});function f(g,c){g||!c?p(g):d?d(c):r(void 0,c)}}}processSync(i){let r=!1,s;return this.freeze(),am("processSync",this.parser||this.Parser),lm("processSync",this.compiler||this.Compiler),this.process(i,l),Hb("processSync","process",r),s;function l(d,p){r=!0,Bb(d),s=p}}run(i,r,s){zb(i),this.freeze();const l=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?d(void 0,s):new Promise(d);function d(p,a){const u=Ku(r);l.run(i,u,f);function f(g,c,_){const x=c||i;g?a(g):p?p(x):s(void 0,x,_)}}}runSync(i,r){let s=!1,l;return this.run(i,r,d),Hb("runSync","run",s),l;function d(p,a){Bb(p),l=a,s=!0}}stringify(i,r){this.freeze();const s=Ku(r),l=this.compiler||this.Compiler;return lm("stringify",l),zb(i),l(i,s)}use(i,...r){const s=this.attachers,l=this.namespace;if(cm("use",this.frozen),i!=null)if(typeof i=="function")u(i,r);else if(typeof i=="object")Array.isArray(i)?a(i):p(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function d(f){if(typeof f=="function")u(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[g,...c]=f;u(g,c)}else p(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function p(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(f.plugins),f.settings&&(l.settings=im(!0,l.settings,f.settings))}function a(f){let g=-1;if(f!=null)if(Array.isArray(f))for(;++g<f.length;){const c=f[g];d(c)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function u(f,g){let c=-1,_=-1;for(;++c<s.length;)if(s[c][0]===f){_=c;break}if(_===-1)s.push([f,...g]);else if(g.length>0){let[x,...C]=g;const y=s[_][1];ig(y)&&ig(x)&&(x=im(!0,y,x)),s[_]=[f,x,...C]}}}}const YO=new xv().freeze();function am(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function lm(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function cm(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zb(e){if(!ig(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Hb(e,i,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Ku(e){return KO(e)?e:new L2(e)}function KO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function XO(e){return typeof e=="string"||QO(e)}function QO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ZO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Fb=[],Ub={allowDangerousHtml:!0},JO=/^(https?|ircs?|mailto|xmpp)$/i,eN=[{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 tN(e){const i=nN(e),r=iN(e);return rN(i.runSync(i.parse(r),r),e)}function nN(e){const i=e.rehypePlugins||Fb,r=e.remarkPlugins||Fb,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ub}:Ub;return YO().use(Nj).use(r).use(DO,s).use(i)}function iN(e){const i=e.children||"",r=new L2;return typeof i=="string"&&(r.value=i),r}function rN(e,i){const r=i.allowedElements,s=i.allowElement,l=i.components,d=i.disallowedElements,p=i.skipHtml,a=i.unwrapDisallowed,u=i.urlTransform||sN;for(const g of eN)Object.hasOwn(i,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+ZO+g.id,void 0);return _v(e,f),wL(e,{Fragment:v.Fragment,components:l,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function f(g,c,_){if(g.type==="raw"&&_&&typeof c=="number")return p?_.children.splice(c,1):_.children[c]={type:"text",value:g.value},c;if(g.type==="element"){let x;for(x in Jp)if(Object.hasOwn(Jp,x)&&Object.hasOwn(g.properties,x)){const C=g.properties[x],y=Jp[x];(y===null||y.includes(g.tagName))&&(g.properties[x]=u(String(C||""),x,g))}}if(g.type==="element"){let x=r?!r.includes(g.tagName):d?d.includes(g.tagName):!1;if(!x&&s&&typeof c=="number"&&(x=!s(g,c,_)),x&&_&&typeof c=="number")return a&&g.children?_.children.splice(c,1,...g.children):_.children.splice(c,1),c}}}function sN(e){const i=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return i===-1||l!==-1&&i>l||r!==-1&&i>r||s!==-1&&i>s||JO.test(e.slice(0,i))?e:""}function $b(e,i){const r=String(e);if(typeof i!="string")throw new TypeError("Expected character");let s=0,l=r.indexOf(i);for(;l!==-1;)s++,l=r.indexOf(i,l+i.length);return s}function oN(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function aN(e,i,r){const l=Gh((r||{}).ignore||[]),d=lN(i);let p=-1;for(;++p<d.length;)eg(e,a);function a(f,g,c){if(f.type==="text"&&typeof c=="number")return u(f,g,c);if(l(f,c,g[g.length-1]))return Jm}function u(f,g,c){const _=g[g.length-1],x=d[p][0],C=d[p][1];let y=0,m=!1,b=[];x.lastIndex=0;let S=x.exec(f.value);for(;S;){const T=S.index,D={index:S.index,input:S.input,stack:[...g,f]};let R=C(...S,D);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1)x.lastIndex=T+1;else{if(y!==T&&w({type:"text",value:f.value.slice(y,T)}),Array.isArray(R))for(const L of R)w(L);else R&&w(R);y=T+S[0].length,m=!0}if(!x.global)break;S=x.exec(f.value)}return m?(y<f.value.length&&w({type:"text",value:f.value.slice(y)}),_.children.splice(c,1,...b)):b=[f],c+b.length;function w(T){const D=b[b.length-1];D&&D.type==="text"&&T.type==="text"?D.value+=T.value:b.push(T)}}}function lN(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=[],r=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<r.length;){const l=r[s];i.push([cN(l[0]),uN(l[1])])}return i}function cN(e){return typeof e=="string"?new RegExp(oN(e),"g"):e}function uN(e){return typeof e=="function"?e:function(){return e}}const um="phrasing",hm=["autolink","link","image","label"];function hN(){return{transforms:[_N],enter:{literalAutolink:fN,literalAutolinkEmail:dm,literalAutolinkHttp:dm,literalAutolinkWww:dm},exit:{literalAutolink:vN,literalAutolinkEmail:gN,literalAutolinkHttp:pN,literalAutolinkWww:mN}}}function dN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:um,notInConstruct:hm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:um,notInConstruct:hm},{character:":",before:"[ps]",after:"\\/",inConstruct:um,notInConstruct:hm}]}}function fN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function dm(e){this.config.enter.autolinkProtocol.call(this,e)}function pN(e){this.config.exit.autolinkProtocol.call(this,e)}function mN(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function gN(e){this.config.exit.autolinkEmail.call(this,e)}function vN(e){this.exit(e)}function _N(e){aN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yN]],{ignore:["link","linkReference"]})}function xN(e,i,r,s,l){let d="";if(!M2(l)||(/^w/i.test(i)&&(r=i+r,i="",d="http://"),!bN(r)))return!1;const p=wN(r+s);if(!p[0])return!1;const a={type:"link",title:null,url:d+i+p[0],children:[{type:"text",value:i+p[0]}]};return p[1]?[a,{type:"text",value:p[1]}]:a}function yN(e,i,r,s){return!M2(s,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r}]}}function bN(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function wN(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let r=i[0],s=r.indexOf(")");const l=$b(e,"(");let d=$b(e,")");for(;s!==-1&&l>d;)e+=r.slice(0,s+1),r=r.slice(s+1),s=r.indexOf(")"),d++;return[e,r]}function M2(e,i){const r=e.input.charCodeAt(e.index-1);return(e.index===0||to(r)||qh(r))&&(!i||r!==47)}j2.peek=LN;function SN(){this.buffer()}function CN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function EN(){this.buffer()}function kN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function TN(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ei(this.sliceSerialize(e)).toLowerCase(),r.label=i}function RN(e){this.exit(e)}function AN(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ei(this.sliceSerialize(e)).toLowerCase(),r.label=i}function DN(e){this.exit(e)}function LN(){return"["}function j2(e,i,r,s){const l=r.createTracker(s);let d=l.move("[^");const p=r.enter("footnoteReference"),a=r.enter("reference");return d+=l.move(r.safe(r.associationId(e),{after:"]",before:d})),a(),p(),d+=l.move("]"),d}function MN(){return{enter:{gfmFootnoteCallString:SN,gfmFootnoteCall:CN,gfmFootnoteDefinitionLabelString:EN,gfmFootnoteDefinition:kN},exit:{gfmFootnoteCallString:TN,gfmFootnoteCall:RN,gfmFootnoteDefinitionLabelString:AN,gfmFootnoteDefinition:DN}}}function jN(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:r,footnoteReference:j2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(s,l,d,p){const a=d.createTracker(p);let u=a.move("[^");const f=d.enter("footnoteDefinition"),g=d.enter("label");return u+=a.move(d.safe(d.associationId(s),{before:u,after:"]"})),g(),u+=a.move("]:"),s.children&&s.children.length>0&&(a.shift(4),u+=a.move((i?`
542
- `:" ")+d.indentLines(d.containerFlow(s,a.current()),i?O2:ON))),f(),u}}function ON(e,i,r){return i===0?e:O2(e,i,r)}function O2(e,i,r){return(r?"":" ")+e}const NN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];yv.attention=HN;yv.peek=FN;function BN(){return{canContainEols:["delete"],enter:{strikethrough:IN},exit:{strikethrough:zN}}}function PN(){return{handlers:{delete:yv},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:NN}]}}function IN(e){this.enter({type:"delete",children:[],position:void 0},e)}function zN(e){this.exit(e)}function yv(e,i,r,s){const l=r.createTracker(s),d=r.stack.includes("strikethrough")?"~":"~~",p=r.enter("strikethrough");let a=l.move(d);return a+=r.containerPhrasing(e,{...l.current(),before:a,after:"~"}),a+=l.move(d),p(),a}function HN(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function FN(){return"~"}function UN(e){return e.length}function $N(e,i){const r=i||{},s=(r.align||[]).concat(),l=r.stringLength||UN,d=[],p=[],a=[],u=[];let f=0,g=-1;for(;++g<e.length;){const y=[],m=[];let b=-1;for(e[g].length>f&&(f=e[g].length);++b<e[g].length;){const S=qN(e[g][b]);if(r.alignDelimiters!==!1){const w=l(S);m[b]=w,(u[b]===void 0||w>u[b])&&(u[b]=w)}y.push(S)}p[g]=y,a[g]=m}let c=-1;if(typeof s=="object"&&"length"in s)for(;++c<f;)d[c]=qb(s[c]);else{const y=qb(s);for(;++c<f;)d[c]=y}c=-1;const _=[],x=[];for(;++c<f;){const y=d[c];let m="",b="";y===99?(m=":",b=":"):y===108?m=":":y===114&&(b=":");let S=r.alignDelimiters===!1?1:Math.max(1,u[c]-m.length-b.length);const w=m+"-".repeat(S)+b;r.alignDelimiters!==!1&&(S=m.length+S+b.length,S>u[c]&&(u[c]=S),x[c]=S),_[c]=w}p.splice(1,0,_),a.splice(1,0,x),g=-1;const C=[];for(;++g<p.length;){const y=p[g],m=a[g];c=-1;const b=[];for(;++c<f;){const S=y[c]||"";let w="",T="";if(r.alignDelimiters!==!1){const D=u[c]-(m[c]||0),R=d[c];R===114?w=" ".repeat(D):R===99?D%2?(w=" ".repeat(D/2+.5),T=" ".repeat(D/2-.5)):(w=" ".repeat(D/2),T=w):T=" ".repeat(D)}r.delimiterStart!==!1&&!c&&b.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&S==="")&&(r.delimiterStart!==!1||c)&&b.push(" "),r.alignDelimiters!==!1&&b.push(w),b.push(S),r.alignDelimiters!==!1&&b.push(T),r.padding!==!1&&b.push(" "),(r.delimiterEnd!==!1||c!==f-1)&&b.push("|")}C.push(r.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return C.join(`
543
- `)}function qN(e){return e==null?"":String(e)}function qb(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}const VN=Gh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function WN(e,i,r,s){const l=r.enter("blockquote"),d=r.createTracker(s);d.move("> "),d.shift(2);const p=r.indentLines(r.containerFlow(e,d.current()),GN);return l(),p}function GN(e,i,r){return">"+(r?"":" ")+e}function YN(e,i){return Vb(e,i.inConstruct,!0)&&!Vb(e,i.notInConstruct,!1)}function Vb(e,i,r){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return r;let s=-1;for(;++s<i.length;)if(e.includes(i[s]))return!0;return!1}function Wb(e,i,r,s){let l=-1;for(;++l<r.unsafe.length;){const d=r.unsafe[l];if(d.character===`
544
- `&&!d.before&&!d.after&&YN(r.stack,d))return/[\t ]/.test(s.before)?"":" "}return`\\
545
- `}function KN(e,i){const r=String(e);let s=r.indexOf(i),l=s,d=0,p=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++d>p&&(p=d):d=1,l=s+i.length,s=r.indexOf(i,l);return p}function XN(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function QN(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function ZN(e,i,r,s){const l=QN(r),d=e.value||"";if(XN(e,r)){const c=r.enter("codeIndented"),_=r.indentLines(d,JN);return c(),_}const p=r.createTracker(s),a=l.repeat(Math.max(KN(d,l)+1,3)),u=r.enter("codeFenced"),f=l==="`"?"GraveAccent":"Tilde";let g=p.move(a);if(e.lang){const c=r.enter(`codeFencedLang${f}`);g+=p.move(r.safe(e.lang,{before:g,after:" ",encode:["`"],...p.current()})),c()}if(e.lang&&e.meta){const c=r.enter(`codeFencedMeta${f}`);g+=p.move(" "),g+=p.move(r.safe(e.meta,{before:g,after:`
546
- `,encode:["`"],...p.current()})),c()}return g+=p.move(`
547
- `),d&&(g+=p.move(d+`
548
- `)),g+=p.move(a),u(),g}function JN(e,i,r){return(r?"":" ")+e}function bv(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function e7(e,i,r,s){const l=bv(r),d=l==='"'?"Quote":"Apostrophe",p=r.enter("definition");let a=r.enter("label");const u=r.createTracker(s);let f=u.move("[");return f+=u.move(r.safe(r.associationId(e),{before:f,after:"]",...u.current()})),f+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=r.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(r.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(a=r.enter("destinationRaw"),f+=u.move(r.safe(e.url,{before:f,after:e.title?" ":`
549
- `,...u.current()}))),a(),e.title&&(a=r.enter(`title${d}`),f+=u.move(" "+l),f+=u.move(r.safe(e.title,{before:f,after:l,...u.current()})),f+=u.move(l),a()),p(),f}function t7(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function xh(e){const i=e.codePointAt(0);return i===void 0?"":String.fromCodePoint(i)}function fa(e){const i=e.codePointAt(e.length-2);return i!==void 0&&i>65535?e.slice(-2):e.slice(-1)}function N2(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Gb(e,i,r){const s=hs(e),l=hs(i);return s===void 0?l===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function n7(e){if(e.charCodeAt(0)!==60)return;const i=e.charCodeAt(1);if(i===33){const a=e.charCodeAt(2);return a===45?2:a===91?5:dn(a)?4:void 0}if(i===63)return 3;const r=i===47,s=r?2:1;let l=s,d=e.charCodeAt(l);if(!dn(d))return;for(;d===45||fn(d);)d=e.charCodeAt(++l);const p=e.slice(s,l).toLowerCase();return!r&&d!==47&&Zm.includes(p)?1:x2.includes(p)?6:7}const i7=new Map([["*",!1],["_",!0]]);function r7(e,i,r){const s=new Set;for(const d of e){const p=r.get(d);if(p&&d.attention&&i.some(a=>a.attention===d.attention))for(const a of p.tokens)s.add(a.attention)}const l=[];for(const d of e)d.attention&&s.delete(d.attention)&&l.push(d.attention);return l.reverse(),l}function B2(e,i,r){const s=[],l=new Map,d=new Map;let p=0;for(;p<e.length;){if(!e[p].attention){p++;continue}const a=e[p].value.charAt(0),u=i7.get(a);let f=p+1;for(;f<e.length&&e[f].attention&&e[f].value.charAt(0)===a;)f++;const g=p?e[p-1].value:i,c=hs(g.charCodeAt(g.length-1)),_=hs((f<e.length?e[f].value:r).charCodeAt(0)),x=!_||_===2&&!!c,C=!c||c===2&&!!_,y={tokens:e.slice(p,f),markers:[],start:0,end:0,open:u?x&&(!!c||!C):x,close:u?C&&(!!_||!x):C,split:u!==void 0};for(const m of y.tokens){l.set(m,[...y.tokens]),d.set(m,y);let b=m.value.length;for(;b--;)y.markers.push(m)}y.end=y.markers.length,s.push(y),p=f}for(o7(s,l),p=-1;++p<e.length;){const a=l.get(e[p]);if(a)return{attention:r7(e,a,d),index:p}}}function Xu(e,i){const r=e[i?0:e.length-1];if(!r||r.attention)return;const s=i?xh(r.value):fa(r.value),l=N2(s.codePointAt(0));if(i)r.value=l+r.value.slice(s.length);else{let d=r.value.slice(0,r.value.length-s.length),p=0;for(;d.charCodeAt(d.length-1-p)===92;)p++;p%2&&(d+="\\"),r.value=d+l}}function s7(e,i,r,s,l){for(const d of r.attention){const p=i.get(d)||d.sequences[0];for(const a of d.sequences){if(a===p)continue;const u=new Map(i);u.set(d,a);const f=Sv(e,u,s,l),g=B2(f,s,l);if(!g||g.index>r.index)return{chosen:u,mistake:g,tokens:f}}}}function o7(e,i){const r=new Map;for(const s of e){const l=s.tokens[0].value.charAt(0);let d=r.get(l);d||(d=[],r.set(l,d));let p=s.close?d.length:0;for(;p--&&s.start<s.end;){const a=d[p],u=a.end-a.start,f=s.end-s.start;if(s.split?(a.close||s.open)&&f%3&&!((u+f)%3):u!==a.markers.length||u!==f)continue;const g=s.split?u>1&&f>1?2:1:f,c=a.markers.slice(a.end-g,a.end),_=s.markers.slice(s.start,s.start+g),x=c[0],C=_[0];if(x===c[g-1]&&x.value.length===g&&C===_[g-1]&&C.value.length===g&&x.attention===C.attention)i.delete(x),i.delete(C);else{const y=[...new Set([...c,..._])];for(const m of y){const b=i.get(m);b&&b.push(...y)}}a.end-=g,s.start+=g,a.start===a.end&&d.splice(p,1),p=d.length}s.open&&s.start<s.end&&d.push(s)}}function a7(e,i,r){if(i.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(r.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const l of r)if(!Number.isSafeInteger(l)||l<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+l+"` as size, expected positive integer");const s=[];for(const l of i){if(l.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+l+"` as marker, expected a single ascii character");if(!u2(l.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+l+"` as marker, expected ascii punctuation");for(const d of r)s.push(l.repeat(d))}return s}function l7(e,i,r){const s=i.indexStack,l=e.children||[],d=[];let p=-1,a=r.before;s.push(-1);let u=i.createTracker(r);for(;++p<l.length;){const f=l[p];let g;if(s[s.length-1]=p,p+1<l.length){let x=i.handle.handlers[l[p+1].type];x&&x.peek&&(x=x.peek),g=x?xh(x(l[p+1],e,i,{before:"",after:"",...u.current()})):""}else g=r.after;const c=d[d.length-1];typeof c=="string"&&(a==="\r"||a===`
550
- `)&&f.type==="html"&&n7(f.value)!==7&&(d[d.length-1]=c.replace(/(\r?\n|\r)$/," "),a=" ",u=i.createTracker(r),u.move(Kh(d,r.before,r.after)));const _=i.handle.handlers[f.type];if(_&&_.attention){const x=wv(f,_.attention,i,u);d.push(x),a=fa(x.sequences[0])}else{const x=i.handle(f,e,i,{...u.current(),after:g,before:a});if(!x)continue;u.move(x),d.push(x),a=fa(x)}}return s.pop(),d}function wv(e,i,r,s){const{construct:l,markers:d,sizes:p}=i(e,r),a=a7(e.type,d,p),u=a[0],f=r.enter(l);s.move(u);const g=l7(e,r,{...s.current(),before:u,after:u});return s.move(Kh(g,u,u)),s.move(u),f(),{children:g,sequences:a}}function Sv(e,i,r,s){const l=[];let d,p=fa(r),a=-1;for(;++a<e.length;){const u=e[a];if(typeof u=="string"){const w={value:u,attention:void 0};d&&d===xh(u)&&Xu([w],!0),d=void 0,l.push(w),w.value&&(p=fa(w.value));continue}const f=i.get(u)||u.sequences[0],g=f.charAt(0),c=e[a+1],_=p,x=xh(c===void 0?s:typeof c=="string"?c:i.get(c)||c.sequences[0]),C=Sv(u.children,i,f,f),y=C.length>0?C[0].value:"",m=Gb(_.charCodeAt(_.length-1),y.charCodeAt(0),g);m.inside&&Xu(C,!0);const b=C.length>0?fa(C[C.length-1].value):"",S=Gb(x.charCodeAt(0),b.charCodeAt(b.length-1),g);S.inside&&Xu(C,!1),m.outside&&_!==`
551
- `&&_!=="\r"&&Xu(l,!1),S.outside&&(d=x),l.push({value:f,attention:u},...C,{value:f,attention:u}),p=f.charAt(f.length-1)}return l}function Kh(e,i,r){let s=new Map;const l=Sv(e,s,i,r);let d=l,p=B2(d,i,r);for(;p;){const u=s7(e,s,p,i,r);if(!u){d=l;break}s=u.chosen,d=u.tokens,p=u.mistake}let a="";for(const u of d)a+=u.value;return a}Cv.attention=P2;Cv.peek=c7;function Cv(e,i,r,s){const l=r.enter("phrasing"),d=wv(e,P2,r,r.createTracker(s)),p=Kh([d],s.before,s.after);return l(),p}function P2(e,i){return{construct:"emphasis",markers:t7(i)==="*"?["*","_"]:["_","*"],sizes:[1]}}function c7(e,i,r){return r.options.emphasis||"*"}function u7(e,i){let r=!1;return _v(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return r=!0,sh}),!!((!e.depth||e.depth<3)&&hv(e)&&(i.options.setext||r))}function h7(e,i,r,s){const l=Math.max(Math.min(6,e.depth||1),1),d=r.createTracker(s);if(u7(e,r)){const c=r.enter("headingSetext"),_=r.enter("phrasing"),x=r.containerPhrasing(e,{...d.current(),before:`
552
- `,after:`
553
- `});return _(),c(),x+`
554
- `+(l===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
555
- `))+1))}const p="#".repeat(l),a=r.enter("headingAtx"),u=r.enter("phrasing");d.move(p+" ");let f=r.containerPhrasing(e,{before:"# ",after:`
556
- `,...d.current()});const g=f.charCodeAt(0);return(g===9||g===32)&&(f=N2(g)+f.slice(1)),f=f?p+" "+f:p,r.options.closeAtx&&(f+=" "+p),u(),a(),f}I2.peek=d7;function I2(e){return e.value||""}function d7(){return"<"}z2.peek=f7;function z2(e,i,r,s){const l=bv(r),d=l==='"'?"Quote":"Apostrophe",p=r.enter("image");let a=r.enter("label");const u=r.createTracker(s);let f=u.move("![");return f+=u.move(r.safe(e.alt,{before:f,after:"]",...u.current()})),f+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=r.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(r.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(a=r.enter("destinationRaw"),f+=u.move(r.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=r.enter(`title${d}`),f+=u.move(" "+l),f+=u.move(r.safe(e.title,{before:f,after:l,...u.current()})),f+=u.move(l),a()),f+=u.move(")"),p(),f}function f7(){return"!"}H2.peek=p7;function H2(e,i,r,s){const l=e.referenceType,d=r.enter("imageReference");let p=r.enter("label");const a=r.createTracker(s);let u=a.move("![");const f=r.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(f+"]["),p();const g=r.stack;r.stack=g.filter(function(_){return _!=="phrasing"}),p=r.enter("reference");const c=r.safe(r.associationId(e),{before:u,after:"]",...a.current()});return p(),r.stack=g,d(),l==="full"||!f||f!==c?u+=a.move(c+"]"):l==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function p7(){return"!"}F2.peek=m7;function F2(e,i,r){let s=e.value||"",l="`",d=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^\n\r ]/.test(s)&&(/^[\n\r ]/.test(s)&&/[\n\r ]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++d<r.unsafe.length;){const p=r.unsafe[d],a=r.compilePattern(p);if(!p.atBreak)continue;let u;for(;u=a.exec(s);){let f=u.index;s.charCodeAt(f)===10&&s.charCodeAt(f-1)===13&&f--,s=s.slice(0,f)+" "+s.slice(u.index+1)}}return l+s+l}function m7(){return"`"}function U2(e,i){const r=hv(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}$2.peek=g7;function $2(e,i,r,s){const l=bv(r),d=l==='"'?"Quote":"Apostrophe",p=r.createTracker(s);if(U2(e,r)){const C=r.stack;r.stack=C.filter(function(b){return b!=="phrasing"});const y=r.enter("autolink");let m=p.move("<");return m+=p.move(r.containerPhrasing(e,{before:m,after:">",...p.current()})),m+=p.move(">"),y(),r.stack=C,m}const a=r.enter("link");let u=r.enter("label"),f=p.move("[");const g=r.containerPhrasing(e,{before:f,after:"](",...p.current()});f+=p.move(g),u(),f+=p.move("](");const c=/[\0- \u007F]/.test(e.url),_=s.before.charAt(s.before.length-1);let x=e.title||void 0;if(!x&&!c&&(_===`
557
- `||_==="\r")){let C=0;for(;C<g.length&&g.charCodeAt(C)!==93;)C+=g.charCodeAt(C)===92?2:1;g.charCodeAt(C+1)===58&&(x="")}return!e.url&&typeof x=="string"||c?(u=r.enter("destinationLiteral"),f+=p.move("<"),f+=p.move(r.safe(e.url,{before:f,after:">",...p.current()})),f+=p.move(">")):(u=r.enter("destinationRaw"),f+=p.move(r.safe(e.url,{before:f,after:typeof x=="string"?" ":")",...p.current()}))),u(),typeof x=="string"&&(u=r.enter(`title${d}`),f+=p.move(" "+l),f+=p.move(r.safe(x,{before:f,after:l,...p.current()})),f+=p.move(l),u()),f+=p.move(")"),a(),f}function g7(e,i,r){return U2(e,r)?"<":"["}q2.peek=v7;function q2(e,i,r,s){const l=e.referenceType,d=r.enter("linkReference");let p=r.enter("label");const a=r.createTracker(s);let u=a.move("[");const f=r.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(f+"]["),p();const g=r.stack;r.stack=g.filter(function(_){return _!=="phrasing"}),p=r.enter("reference");const c=r.safe(r.associationId(e),{before:u,after:"]",...a.current()});return p(),r.stack=g,d(),l==="full"||!f||f!==c?u+=a.move(c+"]"):l==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function v7(){return"["}function Ev(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function _7(e){const i=Ev(e),r=e.options.bulletOther;if(!r)return i==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+r+"`) to be different");return r}function x7(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function V2(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function y7(e,i,r,s){const l=r.enter("list"),d=r.bulletCurrent;let p=e.ordered?x7(r):Ev(r);const a=e.ordered?p==="."?")":".":_7(r);let u=i&&r.bulletLastUsed?p===r.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((p==="*"||p==="-")&&g&&(!g.children||!g.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(u=!0),V2(r)===p&&g){let c=-1;for(;++c<e.children.length;){const _=e.children[c];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(p=a),r.bulletCurrent=p;const f=r.containerFlow(e,s);return r.bulletLastUsed=p,r.bulletCurrent=d,l(),f}function b7(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function w7(e,i,r,s){const l=b7(r);let d=r.bulletCurrent||Ev(r);i&&i.type==="list"&&i.ordered&&(d=(typeof i.start=="number"&&i.start>-1?i.start:1)+(r.options.incrementListMarker===!1?0:i.children.indexOf(e))+d);let p=d.length+1;(l==="tab"||l==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(p=Math.ceil(p/4)*4);const a=r.createTracker(s);a.move(d+" ".repeat(p-d.length)),a.shift(p);const u=r.enter("listItem"),f=r.indentLines(r.containerFlow(e,a.current()),g);return u(),f;function g(c,_,x){return _?(x?"":" ".repeat(p))+c:(x?d:d+" ".repeat(p-d.length))+c}}function S7(e,i,r,s){const l=r.enter("paragraph"),d=r.enter("phrasing"),p=r.containerPhrasing(e,s);return d(),l(),p}function C7(e,i,r,s){if(!e.children.some(function(a){return VN(a)}))return r.containerFlow(e,s);const d=r.enter("phrasing"),p=r.containerPhrasing(e,s);return d(),p}function E7(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}kv.attention=W2;kv.peek=k7;function kv(e,i,r,s){const l=r.enter("phrasing"),d=wv(e,W2,r,r.createTracker(s)),p=Kh([d],s.before,s.after);return l(),p}function W2(e,i){return{construct:"strong",markers:E7(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function k7(e,i,r){return r.options.strong||"*"}function T7(e,i,r,s){const l=i?i.children:[],d=r.indexStack[r.indexStack.length-1];return r.safe(e.value,{...s,afterNode:l[d+1],beforeNode:l[d-1]})}function R7(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function A7(e,i,r){const s=(V2(r)+(r.options.ruleSpaces?" ":"")).repeat(R7(r));return r.options.ruleSpaces?s.slice(0,-1):s}const G2={blockquote:WN,break:Wb,code:ZN,definition:e7,emphasis:Cv,hardBreak:Wb,heading:h7,html:I2,image:z2,imageReference:H2,inlineCode:F2,link:$2,linkReference:q2,list:y7,listItem:w7,paragraph:S7,root:C7,strong:kv,text:T7,thematicBreak:A7};function D7(){return{enter:{table:L7,tableData:Yb,tableHeader:Yb,tableRow:j7},exit:{codeText:O7,table:M7,tableData:fm,tableHeader:fm,tableRow:fm}}}function L7(e){const i=e._align;this.enter({type:"table",align:i.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function M7(e){this.exit(e),this.data.inTable=void 0}function j7(e){this.enter({type:"tableRow",children:[]},e)}function fm(e){this.exit(e)}function Yb(e){this.enter({type:"tableCell",children:[]},e)}function O7(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,N7));const r=this.stack[this.stack.length-1];r.type,r.value=i,this.exit(e)}function N7(e,i){return i==="|"?i:e}function B7(e){const i=e||{},r=i.tableCellPadding,s=i.tablePipeAlign,l=i.stringLength,d=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
558
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:p,tableCell:u,tableRow:a}};function p(x,C,y,m){return f(g(x,y,m),x.align)}function a(x,C,y,m){const b=c(x,y,m),S=f([b]);return S.slice(0,S.indexOf(`
559
- `))}function u(x,C,y,m){const b=y.enter("tableCell"),S=y.enter("phrasing"),w=y.containerPhrasing(x,{...m,before:d,after:d});return S(),b(),w}function f(x,C){return $N(x,{align:C,alignDelimiters:s,padding:r,stringLength:l})}function g(x,C,y){const m=x.children;let b=-1;const S=[],w=C.enter("table");for(;++b<m.length;)S[b]=c(m[b],C,y);return w(),S}function c(x,C,y){const m=x.children;let b=-1;const S=[],w=C.enter("tableRow");for(;++b<m.length;)S[b]=u(m[b],x,C,y);return w(),S}function _(x,C,y){let m=G2.inlineCode(x,C,y);return y.stack.includes("tableCell")&&(m=m.replace(/\|/g,"\\$&")),m}}function P7(){return{exit:{taskListCheckValueChecked:Kb,taskListCheckValueUnchecked:Kb,paragraph:z7}}}function I7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:H7}}}function Kb(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function z7(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const s=r.children[0];if(s&&s.type==="text"){const l=i.children;let d=-1,p;for(;++d<l.length;){const a=l[d];if(a.type==="paragraph"){p=a;break}}p===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function H7(e,i,r,s){const l=e.children[0],d=typeof e.checked=="boolean"&&l&&l.type==="paragraph",p="["+(e.checked?"x":" ")+"] ",a=r.createTracker(s);d&&a.move(p);let u=G2.listItem(e,i,r,{...s,...a.current()});return d&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),u;function f(g){return g+p}}function F7(){return[hN(),MN(),BN(),D7(),P7()]}function U7(e){return{extensions:[dN(),jN(e),PN(),B7(e),I7()]}}const $7={tokenize:K7,partial:!0},Y2={tokenize:X7,partial:!0},K2={tokenize:Q7,partial:!0},X2={tokenize:Z7,partial:!0},q7={tokenize:J7,partial:!0},Q2={name:"wwwAutolink",tokenize:G7,previous:J2},Z2={name:"protocolAutolink",tokenize:Y7,previous:e5},kr={name:"emailAutolink",tokenize:W7,previous:t5},Gi={};function V7(){return{text:Gi}}let Us=48;for(;Us<123;)Gi[Us]=kr,Us++,Us===58?Us=65:Us===91&&(Us=97);Gi[43]=kr;Gi[45]=kr;Gi[46]=kr;Gi[95]=kr;Gi[72]=[kr,Z2];Gi[104]=[kr,Z2];Gi[87]=[kr,Q2];Gi[119]=[kr,Q2];function W7(e,i,r){const s=this;let l,d;return p;function p(c){return!sg(c)||!t5.call(s,s.previous)||Tv(s.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return sg(c)?(e.consume(c),a):c===64?(e.consume(c),u):r(c)}function u(c){return c===46?e.check(q7,g,f)(c):c===45||c===95||fn(c)?(d=!0,e.consume(c),u):g(c)}function f(c){return e.consume(c),l=!0,u}function g(c){return d&&l&&dn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(c)):r(c)}}function G7(e,i,r){const s=this;return l;function l(p){return p!==87&&p!==119||!J2.call(s,s.previous)||Tv(s.events)?r(p):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check($7,e.attempt(Y2,e.attempt(K2,d),r),r)(p))}function d(p){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(p)}}function Y7(e,i,r){const s=this;let l="",d=!1;return p;function p(c){return(c===72||c===104)&&e5.call(s,s.previous)&&!Tv(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),a):r(c)}function a(c){if(dn(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const _=l.toLowerCase();if(_==="http"||_==="https")return e.consume(c),u}return r(c)}function u(c){return c===47?(e.consume(c),d?f:(d=!0,u)):r(c)}function f(c){return c===null||mh(c)||yt(c)||to(c)||qh(c)?r(c):e.attempt(Y2,e.attempt(K2,g),r)(c)}function g(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(c)}}function K7(e,i,r){let s=0;return l;function l(p){return(p===87||p===119)&&s<3?(s++,e.consume(p),l):p===46&&s===3?(e.consume(p),d):r(p)}function d(p){return p===null?r(p):i(p)}}function X7(e,i,r){let s,l,d;return p;function p(f){return f===46||f===95?e.check(X2,u,a)(f):f===null||yt(f)||to(f)||f!==45&&qh(f)?u(f):(d=!0,e.consume(f),p)}function a(f){return f===95?s=!0:(l=s,s=void 0),e.consume(f),p}function u(f){return l||s||!d?r(f):i(f)}}function Q7(e,i){let r=0,s=0;return l;function l(p){return p===40?(r++,e.consume(p),l):p===41&&s<r?d(p):p===33||p===34||p===38||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===60||p===63||p===93||p===95||p===126?e.check(X2,i,d)(p):p===null||yt(p)||to(p)?i(p):(e.consume(p),l)}function d(p){return p===41&&s++,e.consume(p),l}}function Z7(e,i,r){return s;function s(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),s):a===38?(e.consume(a),d):a===93?(e.consume(a),l):a===60||a===null||yt(a)||to(a)?i(a):r(a)}function l(a){return a===null||a===40||a===91||yt(a)||to(a)?i(a):s(a)}function d(a){return dn(a)?p(a):r(a)}function p(a){return a===59?(e.consume(a),s):dn(a)?(e.consume(a),p):r(a)}}function J7(e,i,r){return s;function s(d){return e.consume(d),l}function l(d){return fn(d)?r(d):i(d)}}function J2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function e5(e){return!dn(e)}function t5(e){return!(e===47||sg(e))}function sg(e){return e===43||e===45||e===46||e===95||fn(e)}function Tv(e){let i=e.length,r=!1;for(;i--;){const s=e[i][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const e8={tokenize:l8,partial:!0};function t8(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:s8,continuation:{tokenize:o8},exit:a8}},text:{91:{name:"gfmFootnoteCall",tokenize:r8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:n8,resolveTo:i8}}}}function n8(e,i,r){const s=this;let l=s.events.length;const d=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let p;for(;l--;){const u=s.events[l][1];if(u.type==="labelImage"){p=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!p||!p._balanced)return r(u);const f=Ei(s.sliceSerialize({start:p.end,end:s.now()}));return f.codePointAt(0)!==94||!d.includes(f.slice(1))?r(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),i(u))}}function i8(e,i){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},p={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},a=[e[r+1],e[r+2],["enter",s,i],e[r+3],e[r+4],["enter",l,i],["exit",l,i],["enter",d,i],["enter",p,i],["exit",p,i],["exit",d,i],e[e.length-2],e[e.length-1],["exit",s,i]];return e.splice(r,e.length-r+1,...a),e}function r8(e,i,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let d=0,p;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?r(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(c){if(d>999||c===93&&!p||c===null||c===91||yt(c))return r(c);if(c===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return l.includes(Ei(s.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):r(c)}return yt(c)||(p=!0),d++,e.consume(c),c===92?g:f}function g(c){return c===91||c===92||c===93?(e.consume(c),d++,f):f(c)}}function s8(e,i,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let d,p=0,a;return u;function u(C){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(C){return C===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):r(C)}function g(C){if(p>999||C===93&&!a||C===null||C===91||yt(C))return r(C);if(C===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return d=Ei(s.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return yt(C)||(a=!0),p++,e.consume(C),C===92?c:g}function c(C){return C===91||C===92||C===93?(e.consume(C),p++,g):g(C)}function _(C){return C===58?(e.enter("definitionMarker"),e.consume(C),e.exit("definitionMarker"),l.includes(d)||l.push(d),at(e,x,"gfmFootnoteDefinitionWhitespace")):r(C)}function x(C){return i(C)}}function o8(e,i,r){return e.check(rc,i,e.attempt(e8,i,r))}function a8(e){e.exit("gfmFootnoteDefinition")}function l8(e,i,r){const s=this;return at(e,l,"gfmFootnoteDefinitionIndent",5);function l(d){const p=s.events[s.events.length-1];return p&&p[1].type==="gfmFootnoteDefinitionIndent"&&p[2].sliceSerialize(p[1],!0).length===4?i(d):r(d)}}function c8(e){let r=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:d,resolveAll:l};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(p,a){let u=-1;for(;++u<p.length;)if(p[u][0]==="enter"&&p[u][1].type==="strikethroughSequenceTemporary"&&p[u][1]._close){let f=u;for(;f--;)if(p[f][0]==="exit"&&p[f][1].type==="strikethroughSequenceTemporary"&&p[f][1]._open&&p[u][1].end.offset-p[u][1].start.offset===p[f][1].end.offset-p[f][1].start.offset){p[u][1].type="strikethroughSequence",p[f][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},p[f][1].start),end:Object.assign({},p[u][1].end)},c={type:"strikethroughText",start:Object.assign({},p[f][1].end),end:Object.assign({},p[u][1].start)},_=[["enter",g,a],["enter",p[f][1],a],["exit",p[f][1],a],["enter",c,a]],x=a.parser.constructs.insideSpan.null;x&&Ci(_,_.length,0,Vh(x,p.slice(f+1,u),a)),Ci(_,_.length,0,[["exit",c,a],["enter",p[u][1],a],["exit",p[u][1],a],["exit",g,a]]),Ci(p,f-1,u-f+3,_),u=f+_.length-2;break}}for(u=-1;++u<p.length;)p[u][1].type==="strikethroughSequenceTemporary"&&(p[u][1].type="data");return p}function d(p,a,u){const f=this.previous,g=this.events;let c=0;return _;function _(C){return f===126&&g[g.length-1][1].type!=="characterEscape"?u(C):(p.enter("strikethroughSequenceTemporary"),x(C))}function x(C){const y=hs(f);if(C===126)return c>1?u(C):(p.consume(C),c++,x);if(c<2&&!r)return u(C);const m=p.exit("strikethroughSequenceTemporary"),b=hs(C);return m._open=!b||b===2&&!!y,m._close=!y||y===2&&!!b,a(C)}}}class u8{constructor(){this.map=[],this.index=new Map}add(i,r,s){h8(this,i,r,s)}consume(i){if(this.map.sort(function(d,p){return d[0]-p[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let l=s.pop();for(;l;){for(const d of l)i.push(d);l=s.pop()}this.map.length=0,this.index.clear()}}function h8(e,i,r,s){if(r===0&&s.length===0)return;const l=e.index.get(i);if(l){l[1]+=r,l[2].push(...s);return}const d=[i,r,s];e.map.push(d),e.index.set(i,d)}function d8(e,i){let r=!1;const s=[];for(;i<e.length;){const l=e[i];if(r){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const d=s.length-1;s[d]=s[d]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(r=!0);i+=1}return s}function f8(){return{flow:{null:{name:"table",tokenize:p8,resolveAll:m8}}}}function p8(e,i,r){const s=this;let l=0,d=0,p;return a;function a(M){let I=s.events.length-1;for(;I>-1;){const{type:F}=s.events[I][1];if(F==="lineEnding"||F==="linePrefix")I--;else break}const B=I>-1?s.events[I][1].type:null,H=B==="tableHead"||B==="tableRow"?R:u;return H===R&&s.parser.lazy[s.now().line]?r(M):H(M)}function u(M){return e.enter("tableHead"),e.enter("tableRow"),f(M)}function f(M){return M===124||(p=!0,d+=1),g(M)}function g(M){return M===null?r(M):Ne(M)?d>1?(d=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),x):r(M):Xe(M)?at(e,g,"whitespace")(M):(d+=1,p&&(p=!1,l+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),p=!0,g):(e.enter("data"),c(M)))}function c(M){return M===null||M===124||yt(M)?(e.exit("data"),g(M)):(e.consume(M),M===92?_:c)}function _(M){return M===92||M===124?(e.consume(M),c):c(M)}function x(M){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(M):(e.enter("tableDelimiterRow"),p=!1,Xe(M)?at(e,C,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):C(M))}function C(M){return M===45||M===58?m(M):M===124?(p=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),y):D(M)}function y(M){return Xe(M)?at(e,m,"whitespace")(M):m(M)}function m(M){return M===58?(d+=1,p=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),b):M===45?(d+=1,b(M)):M===null||Ne(M)?T(M):D(M)}function b(M){return M===45?(e.enter("tableDelimiterFiller"),S(M)):D(M)}function S(M){return M===45?(e.consume(M),S):M===58?(p=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(M))}function w(M){return Xe(M)?at(e,T,"whitespace")(M):T(M)}function T(M){return M===124?C(M):M===null||Ne(M)?!p||l!==d?D(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(M)):D(M)}function D(M){return r(M)}function R(M){return e.enter("tableRow"),L(M)}function L(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),L):M===null||Ne(M)?(e.exit("tableRow"),i(M)):Xe(M)?at(e,L,"whitespace")(M):(e.enter("data"),A(M))}function A(M){return M===null||M===124||yt(M)?(e.exit("data"),L(M)):(e.consume(M),M===92?j:A)}function j(M){return M===92||M===124?(e.consume(M),A):A(M)}}function m8(e,i){let r=-1,s=!0,l=0,d=[0,0,0,0],p=[0,0,0,0],a=!1,u=0,f,g,c;const _=new u8;for(;++r<e.length;){const x=e[r],C=x[1];x[0]==="enter"?C.type==="tableHead"?(a=!1,u!==0&&(Xb(_,i,u,f,g),g=void 0,u=0),f={type:"table",start:Object.assign({},C.start),end:Object.assign({},C.end)},_.add(r,0,[["enter",f,i]])):C.type==="tableRow"||C.type==="tableDelimiterRow"?(s=!0,c=void 0,d=[0,0,0,0],p=[0,r+1,0,0],a&&(a=!1,g={type:"tableBody",start:Object.assign({},C.start),end:Object.assign({},C.end)},_.add(r,0,[["enter",g,i]])),l=C.type==="tableDelimiterRow"?2:g?3:1):l&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")?(s=!1,p[2]===0&&(d[1]!==0&&(p[0]=p[1],c=Qu(_,i,d,l,void 0,c),d=[0,0,0,0]),p[2]=r)):C.type==="tableCellDivider"&&(s?s=!1:(d[1]!==0&&(p[0]=p[1],c=Qu(_,i,d,l,void 0,c)),d=p,p=[d[1],r,0,0])):C.type==="tableHead"?(a=!0,u=r):C.type==="tableRow"||C.type==="tableDelimiterRow"?(u=r,d[1]!==0?(p[0]=p[1],c=Qu(_,i,d,l,r,c)):p[1]!==0&&(c=Qu(_,i,p,l,r,c)),l=0):l&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")&&(p[3]=r)}for(u!==0&&Xb(_,i,u,f,g),_.consume(i.events),r=-1;++r<i.events.length;){const x=i.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=d8(i.events,r))}return e}function Qu(e,i,r,s,l,d){const p=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(d.end=Object.assign({},aa(i.events,r[0])),e.add(r[0],0,[["exit",d,i]]));const u=aa(i.events,r[1]);if(d={type:p,start:Object.assign({},u),end:Object.assign({},u)},e.add(r[1],0,[["enter",d,i]]),r[2]!==0){const f=aa(i.events,r[2]),g=aa(i.events,r[3]),c={type:a,start:Object.assign({},f),end:Object.assign({},g)};if(e.add(r[2],0,[["enter",c,i]]),s!==2){const _=i.events[r[2]],x=i.events[r[3]];if(_[1].end=Object.assign({},x[1].end),_[1].type="chunkText",_[1].contentType="text",r[3]>r[2]+1){const C=r[2]+1,y=r[3]-r[2]-1;e.add(C,y,[])}}e.add(r[3]+1,0,[["exit",c,i]])}return l!==void 0&&(d.end=Object.assign({},aa(i.events,l)),e.add(l,0,[["exit",d,i]]),d=void 0),d}function Xb(e,i,r,s,l){const d=[],p=aa(i.events,r);l&&(l.end=Object.assign({},p),d.push(["exit",l,i])),s.end=Object.assign({},p),d.push(["exit",s,i]),e.add(r+1,0,d)}function aa(e,i){const r=e[i],s=r[0]==="enter"?"start":"end";return r[1][s]}const g8={name:"tasklistCheck",tokenize:_8};function v8(){return{text:{91:g8}}}function _8(e,i,r){const s=this;return l;function l(u){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),d)}function d(u){return yt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),p):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),p):r(u)}function p(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(u)}function a(u){return Ne(u)?i(u):Xe(u)?e.check({tokenize:x8},i,r)(u):r(u)}}function x8(e,i,r){return at(e,s,"whitespace");function s(l){return l===null?r(l):i(l)}}function y8(e){return l2([V7(),t8(),c8(e),f8(),v8()])}const b8={};function w8(e){const i=this,r=e||b8,s=i.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),d=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),p=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(y8(r)),d.push(F7()),p.push(U7(r))}function Rv({children:e,className:i}){return v.jsx("div",{className:ye("space-y-2 font-serif leading-relaxed",i),children:v.jsx(tN,{remarkPlugins:[w8],components:{p:({children:r})=>v.jsx("p",{className:"whitespace-pre-wrap",children:r}),h1:({children:r})=>v.jsx("h1",{className:"font-sans text-sm font-semibold",children:r}),h2:({children:r})=>v.jsx("h2",{className:"font-sans text-sm font-semibold",children:r}),h3:({children:r})=>v.jsx("h3",{className:"font-sans text-xs font-semibold uppercase tracking-wide",children:r}),ul:({children:r})=>v.jsx("ul",{className:"list-disc space-y-1 pl-4",children:r}),ol:({children:r})=>v.jsx("ol",{className:"list-decimal space-y-1 pl-4",children:r}),li:({children:r})=>v.jsx("li",{className:"marker:text-muted-foreground",children:r}),a:({children:r,href:s})=>v.jsx("a",{href:s,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2",children:r}),blockquote:({children:r})=>v.jsx("blockquote",{className:"border-l-2 border-border pl-3 italic text-foreground/80",children:r}),code:({className:r,children:s})=>!!r?v.jsx("code",{className:"block overflow-x-auto font-mono text-xs",children:s}):v.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]",children:s}),pre:({children:r})=>v.jsx("pre",{className:"overflow-x-auto rounded-md bg-muted p-2 font-mono text-xs",children:r}),table:({children:r})=>v.jsx("div",{className:"overflow-x-auto",children:v.jsx("table",{className:"w-full border-collapse text-xs",children:r})}),th:({children:r})=>v.jsx("th",{className:"border-b px-2 py-1 text-left font-sans font-medium",children:r}),td:({children:r})=>v.jsx("td",{className:"border-b border-border/50 px-2 py-1 align-top",children:r}),hr:()=>v.jsx("hr",{className:"border-border"})},children:e})})}function S8(e){const i=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(e);if(!i)return{fields:[],body:e};const r=[];for(const s of i[1].split(/\r?\n/)){const l=/^([A-Za-z0-9_-]+):\s*(.*)$/.exec(s);l?r.push([l[1],l[2]]):r.length&&s.trim()&&(r[r.length-1][1]+=` ${s.trim()}`)}return{fields:r,body:e.slice(i[0].length)}}function C8({mode:e,onChange:i,editable:r}){const s=[["view",mg,"View mode"],["edit",Wi,r?"Edit mode":"Edit mode (read-only)"]];return v.jsx("div",{className:"flex rounded-md border bg-card p-0.5",children:s.map(([l,d,p])=>v.jsx("button",{title:p,"aria-label":p,"aria-pressed":e===l,onClick:()=>i(l),className:ye("rounded p-1 transition-colors",e===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:v.jsx(d,{size:13})},l))})}function oc({value:e,onChange:i,rows:r=24,fill:s=!1,blame:l,fileBlame:d,defaultMode:p="view",className:a}){const[u,f]=P.useState(p),{fields:g,body:c}=S8(e),_={height:s?"100%":`${r*1.6+1}rem`};return v.jsxs("div",{className:ye("flex flex-col overflow-hidden rounded border bg-transparent",s&&"h-full",a),children:[v.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b px-2 py-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:u==="view"?"View":i?"Edit":"Raw (read-only)"}),v.jsx(C8,{mode:u,onChange:f,editable:!!i})]}),u==="view"?v.jsxs("div",{className:ye("overflow-y-auto px-4 py-3",s&&"min-h-0 flex-1"),style:s?void 0:_,children:[g.length>0&&v.jsx("table",{className:"mb-3 w-full border-collapse text-[11px]",children:v.jsx("tbody",{children:g.map(([x,C])=>v.jsxs("tr",{className:"border-b border-border/60",children:[v.jsx("td",{className:"w-32 py-1 pr-3 align-top font-mono text-muted-foreground",children:x}),v.jsx("td",{className:"py-1 align-top [overflow-wrap:anywhere]",children:C})]},x))})}),c.trim()?v.jsx(Rv,{className:"text-xs",children:c}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Empty."})]}):v.jsx("div",{className:ye(s&&"min-h-0 flex-1"),style:s?void 0:_,children:v.jsx(GC,{value:e,onChange:i,language:"markdown",wrap:!0,blame:l,fileBlame:d})})]})}function E8(e,i){const r=e.split(`
560
- `),s=i.split(`
561
- `),l=Array.from({length:r.length+1},()=>new Uint32Array(s.length+1));for(let u=r.length-1;u>=0;u-=1)for(let f=s.length-1;f>=0;f-=1)l[u][f]=r[u]===s[f]?l[u+1][f+1]+1:Math.max(l[u+1][f],l[u][f+1]);const d=[];let p=0,a=0;for(;p<r.length&&a<s.length;)r[p]===s[a]?(d.push({type:" ",line:r[p]}),p+=1,a+=1):l[p+1][a]>=l[p][a+1]?d.push({type:"-",line:r[p++]}):d.push({type:"+",line:s[a++]});for(;p<r.length;)d.push({type:"-",line:r[p++]});for(;a<s.length;)d.push({type:"+",line:s[a++]});return d}function yh({before:e,after:i}){const r=E8(e,i);return v.jsx("pre",{className:"max-h-[60vh] overflow-auto rounded border font-mono text-[11px]",children:r.filter((s,l)=>s.type!==" "||r.slice(Math.max(0,l-2),l+3).some(d=>d.type!==" ")).map((s,l)=>v.jsxs("div",{className:ye("px-2",s.type==="+"&&"bg-success/20",s.type==="-"&&"bg-destructive/20"),children:[s.type," ",s.line]},l))})}function n5({path:e,title:i,badge:r,subtitle:s,onSaved:l}){const d=mn(),[p,a]=P.useState(null),[u,f]=P.useState(!1),[g,c]=P.useState(""),[_,x]=P.useState(null);if(P.useEffect(()=>{a(null),x(null),ve.memoryFile(e).then(m=>{a(m.content),c(m.content),f(m.writable)},m=>x(m.message))},[e]),_)return v.jsx("div",{className:"text-xs text-severity-critical",children:_});if(p===null)return v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."});const C=g!==p,y=()=>d({title:`Write ${i}?`,description:"Writes the real file on disk.",body:v.jsx(yh,{before:p,after:g}),confirmLabel:"Write file",maxWidth:"max-w-3xl",run:async()=>{const m=await ve.saveMemoryFile(e,g);a(m.content),ge.getState().notify("Written."),l==null||l()}});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsxs("h2",{className:"flex items-center gap-2 font-mono text-sm font-semibold",children:[v.jsx("span",{className:"min-w-0 truncate",children:i}),r]}),v.jsxs("p",{className:"break-all text-[11px] text-muted-foreground",children:[s??e,!u&&" · read-only (managed by a plugin)",u&&!p&&" · does not exist yet; saving creates it"]})]}),u&&v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[C&&v.jsx(xe,{onClick:()=>c(p),children:"Discard"}),v.jsx(xe,{variant:"primary",disabled:!C,onClick:()=>void y(),children:"Review & save"})]})]}),v.jsx(oc,{rows:26,value:g,onChange:u?c:void 0})]})}function k8({path:e,kind:i,tick:r}){const[s,l]=P.useState(!1),[d,p]=P.useState(0);P.useEffect(()=>{let u=!1;return Kt.stat(e).then(f=>!u&&p(f.mtimeMs),()=>{}),()=>{u=!0}},[e,r]),P.useEffect(()=>l(!1),[e,d]);const a=`${qm(e)}?v=${d}`;return s?v.jsx(nn,{icon:Cm,title:"The browser cannot show this file.",hint:"Its format is not one this browser plays or displays."}):v.jsxs("div",{className:"flex h-full items-center justify-center overflow-auto rounded border bg-muted/20 p-3",children:[i==="image"&&v.jsx("img",{src:a,alt:e,onError:()=>l(!0),className:"max-h-full max-w-full object-contain"}),i==="audio"&&v.jsx("audio",{controls:!0,src:a,onError:()=>l(!0),className:"w-full max-w-xl"},a),i==="video"&&v.jsx("video",{controls:!0,src:a,onError:()=>l(!0),className:"max-h-full max-w-full"},a)]})}function Qb(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const T8=1500,R8=1e3,Zb="clauder-hub:file-blame";function A8(e){const i=Math.floor((Date.now()/1e3-e)/86400);if(i<1){const r=Math.floor((Date.now()/1e3-e)/3600);return r<1?"just now":`${r} hour${r>1?"s":""} ago`}return i<30?`${i} day${i>1?"s":""} ago`:new Date(e*1e3).toLocaleDateString()}const D8=e=>Kt.commit(e).then(i=>i.message);function L8({path:e}){const i=en(U=>U.drafts[e]),{put:r,drop:s}=en.getState(),l=ge(U=>U.ticks.files),[d,p]=P.useState(null),[a,u]=P.useState(null),[f,g]=P.useState(!1),[c,_]=P.useState(!1),[x,C]=P.useState(null),y=P.useRef(!1),m=P.useRef(null),b=P.useRef(0),S=P.useRef(0),w=rs(i),T=sb(e),D=$D(e),[R,L]=P.useState("preview"),[A,j]=P.useState(null),[M,I]=P.useState(()=>{try{return localStorage.getItem(Zb)==="1"}catch{return!1}}),B=()=>{const U=!M;I(U);try{localStorage.setItem(Zb,U?"1":"0")}catch{}},H=i==null?void 0:i.mtimeMs;P.useEffect(()=>{if(H===void 0)return;let U=!1;return Kt.blame(e).then(V=>!U&&j(V),()=>!U&&j(null)),()=>{U=!0}},[e,H]);const F=P.useMemo(()=>A!=null&&A.available&&!w?{you:A.you,commits:A.commits,lines:A.lines,details:D8}:void 0,[A,w]),W=(()=>{if(!(A!=null&&A.available))return null;const U=Object.values(A.commits).filter(K=>!K.uncommitted),V=U.sort((K,$)=>$.time-K.time)[0],ne=new Set(U.map(K=>K.author)).size,le=Object.values(A.commits).some(K=>K.uncommitted);return{latest:V,authors:ne,uncommitted:le,you:A.you}})(),G=P.useCallback((U=!1)=>{if(!U&&rs(en.getState().drafts[e])||sb(e))return;const V=Bu();Kt.read(e).then(ne=>{if(Bu()===V){if(u(null),_(!1),C(null),ne.kind!=="text"){p({kind:ne.kind,size:ne.size}),s(e);return}p(null),r(e,{text:ne.content,base:ne.content,mtimeMs:ne.mtimeMs})}},ne=>u(ne.message))},[e,r,s]);P.useEffect(()=>G(),[G,l]);const Q=P.useCallback(async(U=!1,V=!1)=>{var K;const ne=en.getState().drafts[e];if(!ne||y.current)return;const le=Bu();g(!0),y.current=!0;try{const $=await Kt.write(e,ne.text,U?void 0:ne.mtimeMs);if(m.current=null,Bu()!==le)return;const oe=((K=en.getState().drafts[e])==null?void 0:K.text)??ne.text;r(e,{text:oe,base:ne.text,mtimeMs:$.mtimeMs}),_(!1),C(null),V||ge.getState().notify("Saved.")}catch($){$ instanceof WC&&$.status===409?_(!0):(m.current=ne.text,ge.getState().notify($.message,"error"))}finally{g(!1),y.current=!1}},[e,r]);P.useEffect(()=>{let U=!1;const V=async()=>{const le=en.getState().drafts[e];if(U||!le||y.current||document.hidden)return;const K=await Kt.stat(e).catch(()=>null);if(!K||U||y.current)return;const $=en.getState().drafts[e];if($){if(!K.exists){if(S.current===-1)return;C(oe=>(oe==null?void 0:oe.state)==="deleted"?oe:{state:"deleted",comparing:!1});return}if(K.mtimeMs!==$.mtimeMs){if(!rs($))return G(!0);b.current=K.mtimeMs,K.mtimeMs!==S.current&&C(oe=>(oe==null?void 0:oe.state)==="changed"?oe:{state:"changed",comparing:!1})}}},ne=setInterval(()=>void V(),T8);return()=>{U=!0,clearInterval(ne)}},[e,G]);const X=wy(U=>U.on);P.useEffect(()=>{if(!X||!w||c||x||(i==null?void 0:i.text)===m.current)return;const U=window.setTimeout(()=>void Q(!1,!0),R8);return()=>window.clearTimeout(U)},[X,w,c,x,i==null?void 0:i.text,Q]);const z=async()=>{const U=await Kt.read(e).catch(()=>null);(U==null?void 0:U.kind)==="text"&&C({state:"changed",content:U.content,comparing:!0})};P.useEffect(()=>{const U=V=>{(V.ctrlKey||V.metaKey)&&V.key.toLowerCase()==="s"&&(V.preventDefault(),rs(en.getState().drafts[e])&&Q())};return window.addEventListener("keydown",U,!0),()=>window.removeEventListener("keydown",U,!0)},[e,Q]),P.useEffect(()=>Bn.getState().show(e),[e]);const O=U=>{const V=en.getState().drafts[e];V&&r(e,{...V,text:U}),Bn.getState().pin(e)},Y=e.split("/").pop()??e,Z=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"project root";return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsxs("div",{className:"space-y-3 px-5 pb-3 pt-4",children:[v.jsx(Er,{group:"Files",title:Y,description:Z,action:(T||i)&&v.jsxs(v.Fragment,{children:[D&&i&&v.jsxs(xe,{onClick:()=>L(R==="preview"?"code":"preview"),title:R==="preview"?"Edit the HTML":"Show the page",children:[R==="preview"?v.jsx(K3,{size:13}):v.jsx(mg,{size:13})," ",R==="preview"?"Code":"Preview"]}),(T||D)&&v.jsx("a",{href:qm(e),target:"_blank",rel:"noreferrer",title:"Open in a new browser tab",className:"inline-flex items-center rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(ba,{size:13})}),i&&v.jsxs(v.Fragment,{children:[w&&!X&&v.jsx("span",{className:"self-center text-[11px] text-severity-warning",children:"Unsaved, kept while this page is open"}),v.jsx(tc,{label:"Auto save",title:"For every file: saves 1 second after you stop typing",checked:X,onCheckedChange:U=>{wy.getState().set(U),ge.getState().notify(U?"Auto save on: every file saves itself 1 second after you stop typing.":"Auto save off: save with the Save button or Ctrl+S.")},className:"mr-1"}),w&&v.jsx(xe,{onClick:()=>r(e,{...i,text:i.base}),children:"Discard"}),v.jsxs(xe,{variant:"primary",disabled:!w||f,onClick:()=>void Q(),title:"Save (Ctrl+S)",children:[v.jsx(_4,{size:13})," ",f?"Saving...":"Save"]})]})]})}),A&&v.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[v.jsx(t4,{size:13,className:"shrink-0"}),A.available?v.jsxs(v.Fragment,{children:[(W==null?void 0:W.latest)&&v.jsxs("span",{className:"min-w-0 truncate",title:W.latest.summary,children:["Last change: ",v.jsx("span",{className:"text-foreground",children:W.latest.author===W.you?"You":W.latest.author}),", ",A8(W.latest.time)," · ",W.latest.summary]}),v.jsxs("span",{children:[(W==null?void 0:W.authors)??0," author",(W==null?void 0:W.authors)===1?"":"s"]}),(W==null?void 0:W.uncommitted)&&v.jsx("span",{className:"text-severity-warning",children:"uncommitted changes"}),w&&v.jsx("span",{children:"blame hidden while editing"}),v.jsxs("button",{className:ye("ml-auto rounded px-1.5 py-0.5 transition-colors",M?"bg-primary/15 text-primary":"hover:bg-muted hover:text-foreground"),onClick:B,title:"Show who last changed every line",children:["File blame ",M?"on":"off"]})]}):v.jsx("span",{children:A.reason})]}),x&&!c&&v.jsxs("div",{className:"space-y-2 rounded-md border border-severity-warning/50 bg-severity-warning/10 px-3 py-2 text-xs",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx("span",{className:"flex-1",children:x.state==="deleted"?"This file was deleted on disk. Your unsaved edits are still here.":"This file changed on disk while you were editing it. Your edits are kept; saving will ask before overwriting."}),x.state==="changed"&&v.jsx(xe,{onClick:()=>x.comparing?C({...x,comparing:!1}):void z(),children:x.comparing?"Hide changes":"Compare"}),x.state==="changed"&&v.jsx(xe,{onClick:()=>G(!0),children:"Reload from disk"}),v.jsx(xe,{variant:"ghost",onClick:()=>{S.current=x.state==="deleted"?-1:b.current,C(null)},children:"Keep editing"})]}),x.comparing&&x.content!==void 0&&i&&v.jsx(yh,{before:x.content,after:i.text})]}),c&&v.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-severity-warning/50 bg-severity-warning/10 px-3 py-2 text-xs",children:[v.jsx("span",{className:"flex-1",children:"This file changed on disk since it was opened. Overwrite it with your version, or reload it and lose your edits."}),v.jsx(xe,{variant:"primary",onClick:()=>void Q(!0),children:"Overwrite"}),v.jsx(xe,{onClick:()=>G(!0),children:"Reload from disk"})]})]}),v.jsx("div",{className:"min-h-0 flex-1 px-5 pb-5",children:T?v.jsx(k8,{path:e,kind:T,tick:l}):a?v.jsx(nn,{icon:Cm,title:a}):d?v.jsx(nn,{icon:Cm,title:d.kind==="binary"?"A binary file":"Too large to open here",hint:d.kind==="binary"?`${Qb(d.size)}; it is not shown as text.`:`${Qb(d.size)}; files over 2 MB are not opened in the editor.`}):i?D&&R==="preview"?v.jsx("iframe",{title:Y,src:`${qm(e)}?v=${i.mtimeMs}`,sandbox:"allow-scripts allow-forms allow-popups allow-modals",className:"h-full w-full rounded border bg-white"},i.mtimeMs):UD(e)?v.jsx(oc,{fill:!0,value:i.text,onChange:O,blame:F,fileBlame:M}):v.jsx("div",{className:"h-full overflow-hidden rounded border",children:v.jsx(GC,{path:e,value:i.text,onChange:O,blame:F,fileBlame:M})}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})})]})}function M8({value:e,onChange:i,categories:r,allowNone:s=!0}){return v.jsxs(ca,{value:e,onValueChange:i,children:[s&&v.jsx(En,{value:"",children:"None (stays open until you stop it)"}),v.jsx(En,{value:"auto",children:"Auto (Claude picks one)"}),r.map(l=>v.jsx(En,{value:l.name,children:l.name},l.id))]})}const j8={"claude-system":"Appended to Claude's system prompt","claude-typed":"Typed into the session",channel:"Sent to channels"};function O8(){const e=ct(()=>ve.prompts(),[]),[i,r]=P.useState("preview"),[s,l]=P.useState(!1),d=p=>{r(p),l(!0)};return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsx("div",{className:"border-b px-5 py-4",children:v.jsx(Er,{group:"Settings",title:"Hub prompts",description:"Text the hub adds to sessions and sends to channels."})}),v.jsxs("div",{className:"flex min-h-0 flex-1",children:[v.jsxs("div",{className:ye("w-full shrink-0 overflow-y-auto p-3 md:block md:w-56 md:border-r lg:w-72",s&&"hidden"),children:[v.jsx(Jb,{active:i==="preview",onClick:()=>d("preview"),children:"Preview what a session gets"}),["claude-system","claude-typed","channel"].map(p=>v.jsxs("div",{className:"mt-3",children:[v.jsx("div",{className:"px-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:j8[p]}),(e.data??[]).filter(a=>a.audience===p).map(a=>v.jsxs(Jb,{active:i===a.key,onClick:()=>d(a.key),children:[v.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.label}),a.overridden&&v.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-primary",title:"Edited"})]},a.key))]},p))]}),v.jsxs("div",{className:ye("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!s&&"hidden"),children:[v.jsx(Zg,{onClick:()=>l(!1)}),i==="preview"?v.jsx(B8,{}):e.data&&v.jsx(N8,{prompt:e.data.find(p=>p.key===i),onSaved:e.reload},i)]})]})]})}function Jb({active:e,onClick:i,children:r}){return v.jsxs("button",{onClick:i,className:ye("flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs",e?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(Uw,{size:12,className:"shrink-0"}),r]})}function N8({prompt:e,onSaved:i}){const r=mn(),[s,l]=P.useState(e.text),d=s!==e.text,p=()=>r({title:`Save "${e.label}"?`,description:"New sessions get the new text.",body:v.jsx(yh,{before:e.text,after:s}),confirmLabel:"Save",maxWidth:"max-w-3xl",run:async()=>{await ve.savePrompt(e.key,s),ge.getState().notify("Saved."),i()}}),a=()=>r({title:"Restore the default text?",description:"Your version is discarded.",body:v.jsx(yh,{before:e.text,after:e.defaultText}),confirmLabel:"Restore default",tone:"destructive",maxWidth:"max-w-3xl",run:async()=>{await ve.savePrompt(e.key,null),l(e.defaultText),i()}});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsxs("h2",{className:"flex items-center gap-2 text-sm font-semibold",children:[e.label,e.overridden&&v.jsx(nt,{tone:"on",children:"edited"})]}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:e.description})]}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.overridden&&v.jsxs(xe,{variant:"ghost",onClick:()=>void a(),children:[v.jsx(v4,{size:12})," Restore default"]}),d&&v.jsx(xe,{onClick:()=>l(e.text),children:"Discard"}),v.jsx(xe,{variant:"primary",disabled:!d,onClick:()=>void p(),children:"Review & save"})]})]}),e.placeholders.length>0&&v.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Placeholders:"," ",e.placeholders.map(u=>v.jsx("code",{className:"mr-1 rounded bg-muted px-1 font-mono",children:`{{${u}}}`},u))]}),v.jsx(oc,{rows:22,value:s,onChange:l})]})}function B8(){const[e,i]=P.useState(""),[r,s]=P.useState([]),l=ct(()=>ve.previewSystemPrompt(e),[],e);return P.useEffect(()=>{ve.categories().then(s)},[]),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{children:[v.jsx("h2",{className:"text-sm font-semibold",children:"What the hub appends to a session"}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Passed with --append-system-prompt-file, after Claude Code's own system prompt and your CLAUDE.md files, which still load as usual. Pick a category to see the done protocol a triggered run gets."})]}),v.jsx("div",{className:"w-full max-w-[18rem]",children:v.jsx(M8,{value:e,onChange:i,categories:r})}),l.data?v.jsx(oc,{rows:24,value:l.data.text}):v.jsx(nn,{variant:"inline",title:"Loading..."})]})}function i5(e){const[i,r]=P.useState(()=>window.matchMedia(e).matches);return P.useEffect(()=>{const s=window.matchMedia(e),l=()=>r(s.matches);return l(),s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[e]),i}function bh(e,i,{min:r=200,max:s=720}={}){const l=P.useCallback(f=>Math.min(s,Math.max(r,Math.round(f))),[r,s]),[d,p]=P.useState(()=>{try{const f=Number(localStorage.getItem(e));return f?l(f):i}catch{return i}});P.useEffect(()=>{try{localStorage.setItem(e,String(d))}catch{}},[e,d]);const a=P.useCallback(f=>p(g=>l(g+f)),[l]),u=P.useCallback(()=>p(i),[i]);return{width:d,resizeBy:a,reset:u}}function og({placeholder:e,disabled:i,onSend:r,value:s,onChange:l,autoFocus:d,className:p}){return v.jsx(rv,{rows:1,autoFocus:d,value:s,disabled:i,placeholder:`${e.replace(/\.\.\.$/,"")} (Enter to send)`,onChange:a=>l(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),s.trim()&&r(s))},className:ye("min-h-[32px] flex-1 font-sans",p)})}const ag=e=>`clauder-hub:answer:${e}`;function P8(e,i){const[r,s]=P.useState(()=>{try{const d=localStorage.getItem(ag(e));return d?{...i,...JSON.parse(d)}:i}catch{return i}});return[r,d=>{s(d);try{localStorage.setItem(ag(e),JSON.stringify(d))}catch{}}]}function I8(e){try{localStorage.removeItem(ag(e))}catch{}}function z8(e){const i=e.findIndex(r=>/recommended/i.test(r.label));return i===-1?0:i}function H8({interactionId:e,questions:i,busy:r,onChoose:s,onReply:l}){const d=i.length>1,[p,a]=P8(e,{picks:{},otherOpen:{},others:{},free:""}),{picks:u,otherOpen:f,others:g,free:c}=p,_=y=>a({...p,...y}),x=y=>{const m=u[y];return!!(m&&("option"in m||m.other.trim()))},C=()=>i.map((y,m)=>{const b=u[m];return"option"in b?String(b.option+1):b.other.trim()}).join(`
562
- `);return v.jsxs("div",{className:"space-y-3",children:[i.map((y,m)=>{const b=z8(y.options),S=u[m];return v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx("span",{className:"mt-px grid h-5 w-5 shrink-0 place-items-center rounded-full bg-primary/15 text-[11px] font-semibold tabular-nums text-primary",children:m+1}),v.jsxs("div",{className:"min-w-0",children:[y.header&&v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:y.header}),v.jsx("div",{className:"break-words text-sm font-semibold leading-snug",children:y.question})]})]}),v.jsxs("div",{className:"space-y-1 pl-7",children:[y.options.map((w,T)=>{const D=!!(S&&"option"in S&&S.option===T);return v.jsxs("button",{disabled:r,onClick:()=>d?_({picks:{...u,[m]:{option:T}}}):s(T),className:ye("flex w-full items-start gap-2.5 rounded-md border px-3 py-1.5 text-left transition-colors hover:bg-muted disabled:opacity-50",T===b&&"border-primary",D&&"bg-primary/15"),children:[v.jsx("span",{className:"mt-px shrink-0 text-xs tabular-nums text-muted-foreground",children:T+1}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("span",{className:"block text-xs font-medium",children:w.label}),w.description&&v.jsx("span",{className:"block text-[11px] text-muted-foreground",children:w.description})]})]},T)}),f[m]?v.jsx("div",{className:ye("rounded-md border px-2 py-1",S&&"other"in S&&"bg-primary/15"),children:v.jsx(og,{autoFocus:!0,placeholder:"Your own answer",disabled:r,value:g[m]??"",onChange:w=>_({others:{...g,[m]:w},...d?{picks:{...u,[m]:{other:w}}}:{}}),onSend:w=>d?_({picks:{...u,[m]:{other:w}}}):l(w),className:"border-0 bg-transparent px-1 focus:ring-0"})}):v.jsxs("button",{disabled:r,onClick:()=>_({otherOpen:{...f,[m]:!0}}),className:"flex w-full items-center gap-2.5 rounded-md border border-dashed px-3 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",children:[v.jsx(Wi,{size:12,className:"shrink-0"})," Other, in your own words..."]})]})]},m)}),d&&v.jsxs("div",{className:"flex items-end gap-1.5",children:[v.jsx(og,{placeholder:"Or answer all of it in your own words",disabled:r,value:c,onChange:y=>_({free:y}),onSend:y=>l(y)}),v.jsx(xe,{variant:"primary",disabled:r||!i.every((y,m)=>x(m)),onClick:()=>l(C()),children:"Send answers"})]})]})}function F8(e,i){P.useEffect(()=>{i||I8(e)},[e,i])}const U8={permission:{label:"Permission",icon:y4},question:{label:"Question",icon:Iw},turn:{label:"Waiting",icon:d4},mcp:{label:"MCP suggested",icon:Yl},done:{label:"Done",icon:Pw}};function $8(e){var d,p;const i=e.answer;if(!i)return null;const r=e.presented,s={permission:{1:0,2:1,3:2},mcp:{install:0,skip:1}},l=e.kind==="question"?Number(i)-1:(d=s[e.kind])==null?void 0:d[i];return l!==void 0&&Number.isInteger(l)&&((p=r==null?void 0:r.choices[l])==null?void 0:p.label)||i}function ql({interaction:e,showSession:i=!1,compact:r=!1,project:s}){var D,R;const l=ge(L=>L.sessions),d=ge(L=>L.go),p=L=>s?window.location.hash=`#/${encodeURIComponent(s.id)}/session/${L.id}`:d(L),[a,u]=P.useState(""),[f,g]=P.useState(!1),[c,_]=P.useState(!1),x=U8[e.kind],C=e.status==="open",y=l.find(L=>L.id===e.sessionId);F8(e.id,C);const m=e.presented??{kind:e.kind,sessionTitle:(y==null?void 0:y.title)??"",headline:e.title,choices:[],quickReplies:[],freeText:"Reply to the session...",details:e.body?{label:"Details",text:e.body,format:"markdown"}:void 0},b=async L=>{g(!0);const A=await it(L,"Sent to the session.");g(!1),A&&u("")},S=L=>b(()=>s?ve.chooseIn(s.id,e.id,L.ref):ve.choose(e.id,L.ref)),w=L=>L.trim()&&b(()=>s?ve.answerIn(s.id,e.id,L):ve.answer(e.id,L)),T=async()=>{g(!0),await it(()=>s?ve.dismissIn(s.id,e.id):ve.dismiss(e.id),"Dismissed."),g(!1)};return v.jsxs("div",{className:ye("card p-3",C&&"border-primary/60"),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(nt,{tone:C?"warning":e.kind==="done"?"success":"off",icon:x.icon,children:x.label}),s&&v.jsx(nt,{tone:"off",children:s.name}),i&&v.jsx("button",{className:"min-w-0 truncate text-xs font-medium hover:underline",onClick:()=>p({kind:"session",id:e.sessionId}),children:(y==null?void 0:y.title)??(((D=e.presented)==null?void 0:D.sessionTitle)||e.sessionId.slice(0,8))}),v.jsx("span",{className:"ml-auto shrink-0 text-[11px] text-muted-foreground",children:fs(e.createdAt)}),i&&v.jsxs(xe,{variant:"muted",className:"shrink-0",title:y!=null&&y.live?"Open the session's terminal":"Open the session (not running; resume it there)","aria-label":"Open the session's terminal",onClick:()=>p({kind:"session",id:e.sessionId}),children:[v.jsx(bg,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Terminal"})]}),C&&v.jsx(xe,{variant:"ghost",size:"icon",className:"shrink-0",disabled:f,title:"Dismiss (nothing is sent to the session)","aria-label":"Dismiss",onClick:()=>void T(),children:v.jsx(pn,{size:13})})]}),v.jsx("div",{className:ye("mt-2 break-words text-sm font-medium",e.kind==="permission"&&"font-mono text-[13px]",r&&"line-clamp-2"),children:m.headline}),m.question&&!r&&v.jsx("div",{className:"mt-0.5 break-words text-xs text-muted-foreground",children:m.question}),C&&!r&&v.jsx("div",{className:"mt-3 space-y-2.5",children:e.kind==="question"&&((R=m.questions)!=null&&R.length)?v.jsx(H8,{interactionId:e.id,questions:m.questions,busy:f,onChoose:L=>void S({ref:`o:${L}`}),onReply:L=>void w(L)}):v.jsxs(v.Fragment,{children:[m.choices.some(L=>L.description)?v.jsx("div",{className:"space-y-1",children:m.choices.map((L,A)=>v.jsxs("button",{disabled:f,onClick:()=>void S(L),className:ye("flex w-full items-start gap-2.5 rounded-md border px-3 py-2 text-left transition-colors hover:bg-muted disabled:opacity-50",L.tone==="primary"&&"border-primary"),children:[v.jsx("span",{className:"mt-px shrink-0 text-xs tabular-nums text-muted-foreground",children:A+1}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("span",{className:"block text-xs font-medium",children:L.label}),L.description&&v.jsx("span",{className:"block text-[11px] text-muted-foreground",children:L.description})]})]},L.ref))}):m.choices.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.choices.map(L=>v.jsx(xe,{variant:L.tone==="primary"?"primary":L.tone==="danger"?"destructive":"muted",disabled:f,onClick:()=>void S(L),children:L.label},L.ref))}),m.quickReplies.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.quickReplies.map(L=>v.jsx("button",{disabled:f,onClick:()=>void S(L),className:"rounded-full border px-2.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",children:L.label},L.ref))}),m.freeText&&v.jsx(og,{placeholder:m.freeText,disabled:f,value:a,onChange:u,onSend:L=>void w(L)})]})}),m.details&&!r&&v.jsxs("div",{className:"mt-2",children:[v.jsxs("button",{className:"flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",onClick:()=>_(!c),children:[v.jsx(ya,{size:12,className:ye("transition-transform",c&&"rotate-90")}),m.details.label]}),c&&(m.details.format==="code"?v.jsx("pre",{className:"mt-1.5 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded bg-muted p-2 font-mono text-[11px]",children:m.details.text}):v.jsx(Rv,{className:"mt-1.5 max-h-72 overflow-auto rounded bg-muted/40 p-2 text-xs",children:m.details.text}))]}),!C&&e.status==="answered"&&v.jsxs("div",{className:"mt-2 break-words text-[11px] text-muted-foreground",children:[e.answeredBy,": ",v.jsx("span",{className:"text-foreground",children:$8(e)})]}),!C&&e.status==="closed"&&e.answeredBy&&e.kind!=="done"&&v.jsxs("div",{className:"mt-2 text-[11px] text-muted-foreground",children:["Closed (",e.answeredBy,")."]})]})}function q8({size:e=18,className:i}){return v.jsxs("svg",{viewBox:"0 18 48 30",width:e,height:e*30/48,className:i,role:"img","aria-label":"Clauder Hub",children:[v.jsx("rect",{width:"36",height:"24",x:"6",y:"18",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"9",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"15",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"30",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"36",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"7.5",height:"6",y:"33",fill:"#d77757"}),v.jsx("rect",{width:"7.5",height:"6",x:"40.5",y:"33",fill:"#d77757"}),v.jsx("rect",{width:"9",height:"9",x:"12",y:"24"}),v.jsx("rect",{width:"9",height:"9",x:"27",y:"24"}),v.jsx("rect",{width:"3",height:"6",x:"22.5",y:"22.5",transform:"rotate(90 24 25.5)"}),v.jsx("rect",{width:"3",height:"7",x:"37",y:"22",transform:"rotate(90 38.5 25.5)"}),v.jsx("rect",{width:"3",height:"7",x:"8",y:"22",transform:"rotate(90 9.5 25.5)"})]})}function V8({temp:e,choice:i}){const[r,s]=P.useState(i.current);return v.jsxs("div",{className:"space-y-0.5 rounded-md border px-2.5 py-2",children:[v.jsx(tc,{label:`Also clear its Claude temp folder (${Sg(e.bytes)})`,checked:r,onCheckedChange:l=>{i.current=l,s(l)}}),v.jsx("div",{className:"truncate pl-6 font-mono text-[10px] text-muted-foreground",title:e.path,children:e.path})]})}function Xh(e){const{view:i,sessions:r,go:s}=ge.getState();if(i.kind!=="session"||!e.includes(i.id))return;const l=r.filter(u=>u.live||u.id===i.id),d=l.findIndex(u=>u.id===i.id),p=u=>!e.includes(u.id),a=l.slice(0,Math.max(d,0)).reverse().find(p)??l.slice(d+1).find(p);a&&s({kind:"session",id:a.id})}function Qh(){const e=mn(),i=P.useRef(""),r=P.useRef(!0),s=a=>!a||a===ge.getState().projectId;return{rename:(a,u)=>(i.current=a.title,e({title:"Rename session",description:"Also shown in Claude Code's /resume.",body:v.jsx(Zn,{autoFocus:!0,size:"md",defaultValue:a.title,onChange:f=>i.current=f.target.value,onFocus:f=>f.target.select()}),confirmLabel:"Rename",run:async()=>{await ve.renameSession(a.id,i.current,s(u)?void 0:u),s(u)&&await ge.getState().refreshSessions()}})),remove:async a=>{const u=await ve.deletionPlan(a.id).catch(g=>(ge.getState().notify(g.message,"error"),null));if(!u)return!1;r.current=!0;const f=await e({title:`Delete "${a.title}" permanently?`,description:a.live?"It is running and will be stopped first. This cannot be undone.":"Removed from ~/.claude. This cannot be undone.",body:v.jsxs("div",{className:"space-y-2 text-xs",children:[u.files.length?v.jsx("div",{className:"divide-y rounded-md border",children:u.files.map(g=>v.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"truncate font-mono text-[11px]",title:g.path,children:g.path}),v.jsx("div",{className:"text-[10px] text-muted-foreground",children:g.what})]}),v.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:Sg(g.bytes)})]},g.path))}):v.jsx("div",{className:"text-muted-foreground",children:"No files on disk; only the hub's own record of it goes."}),u.temp&&v.jsx(V8,{temp:u.temp,choice:r}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Also removed: its interactions and MCP suggestions in the hub. Kept: your prompt history (~/.claude/history.jsonl), which every project shares."})]}),confirmLabel:"Delete permanently",tone:"destructive",maxWidth:"max-w-xl",run:async()=>{await ve.deleteSession(a.id,r.current),await ge.getState().refreshSessions(),ge.getState().notify("Deleted.")}});if(f){const{view:g,go:c}=ge.getState();g.kind==="session"&&g.id===a.id&&c({kind:"page",page:"overview"})}return f},stop:(a,u)=>e({title:`Stop "${a.title}"?`,description:"The conversation is kept for a later resume.",confirmLabel:"Stop",tone:"destructive",run:async()=>{await ve.killSession(a.id,s(u)?void 0:u),s(u)&&Xh([a.id])}})}}const ac=no(()=>({projects:null}));function ew(){const e=ct(()=>ve.globalLive(),["projects","sessions","interactions","channels"]);return P.useEffect(()=>{e.data&&ac.setState({projects:e.data})},[e.data]),null}const wh=e=>e.live&&(e.status==="waiting"||e.openInteractions>0);function lg(e){return e.flatMap(i=>i.open.map(r=>({project:i,session:r})))}function W8(){return ac(e=>e.projects?lg(e.projects).filter(i=>wh(i.session)).length:0)}const $s=[];function oh(e,i){ge.getState().openSessionIn(e,i)}const G8=[{keys:"Ctrl+K",what:"Find and open a session or project"},{keys:"Alt+1 … Alt+9",what:"Open the 1st … 9th session of the Open sessions panel"},{keys:"Alt+`",what:"Back to the session shown before"},{keys:"Alt+W",what:"Next session waiting on you, in any project"},{keys:"Ctrl+`",what:"Show the sidebar's live sessions"},{keys:"Ctrl+Enter",what:"Send now (Claude Code's Ctrl+X Ctrl+S), in a terminal"},{keys:"Ctrl+F",what:"Find in the terminal's scrollback"},{keys:"Ctrl+C",what:"Copy the selection in a terminal (without one, ^C goes to Claude)"},{keys:"Right click",what:"Copy the selection in a terminal"},{keys:"Ctrl+V",what:"Paste into a terminal"},{keys:"Ctrl+click",what:"Open a file path or link printed in a terminal"},{keys:"Drop a file",what:"On a terminal: saves it and pastes its path"}];function tw(){const e=ge(d=>d.projectId),i=ge(d=>d.view),r=ge(d=>d.windowed),[s,l]=P.useState(!1);return P.useEffect(()=>{if(!e||i.kind!=="session")return;const d=$s[$s.length-1];d&&d.projectId===e&&d.id===i.id||($s.push({projectId:e,id:i.id}),$s.length>50&&$s.shift())},[e,i]),P.useEffect(()=>{if(r)return;const d=p=>{if(p.metaKey)return;const a=ac.getState().projects??[],{projectId:u,view:f}=ge.getState(),g=()=>{p.preventDefault(),p.stopPropagation()};if(p.ctrlKey&&!p.altKey&&!p.shiftKey&&p.code==="KeyK"){g(),l(_=>!_);return}if(!p.altKey||p.ctrlKey)return;const c=/^Digit([1-9])$/.exec(p.code);if(c&&!p.shiftKey){const _=lg(a)[Number(c[1])-1];g(),_&&oh(_.project.id,_.session.id);return}if(p.code==="Backquote"&&!p.shiftKey){g();for(let _=$s.length-1;_>=0;_-=1){const x=$s[_];if(!(x.projectId===u&&f.kind==="session"&&x.id===f.id))return oh(x.projectId,x.id)}return}if(p.code==="KeyW"&&!p.shiftKey){g();const _=lg(a).filter(y=>wh(y.session));if(!_.length)return ge.getState().notify("No session is waiting on you.");const x=_.findIndex(y=>y.project.id===u&&f.kind==="session"&&y.session.id===f.id),C=_[(x+1)%_.length];oh(C.project.id,C.session.id)}};return window.addEventListener("keydown",d,!0),()=>window.removeEventListener("keydown",d,!0)},[r]),s?v.jsx(K8,{onClose:()=>l(!1)}):null}function Y8(e,i){if(!i)return 0;const r=e.toLowerCase(),s=i.toLowerCase().trim(),l=r.indexOf(s);if(l!==-1)return 1e3-l;if(s.split(/\s+/).filter(Boolean).every(a=>r.includes(a)))return 500;let p=0;for(const a of r)a===s[p]&&(p+=1);return p===s.length?100:null}function K8({onClose:e}){const i=ac(C=>C.projects)??[],[r,s]=P.useState([]),[l,d]=P.useState(""),[p,a]=P.useState(0),u=P.useRef(null),f=P.useRef(null),g=P.useRef(document.activeElement);P.useEffect(()=>{var C;(C=u.current)==null||C.focus(),ve.projects().then(s,()=>{})},[]);const c=P.useMemo(()=>{const C=[];for(const y of i)for(const m of y.open)C.push({kind:"session",key:`o:${y.id}:${m.id}`,project:y,session:m,open:!0,label:`${m.title} ${y.name}`});for(const y of i)for(const m of y.recent)C.push({kind:"session",key:`r:${y.id}:${m.id}`,project:y,session:m,open:!1,label:`${m.title} ${y.name}`});for(const y of r)C.push({kind:"project",key:`p:${y.id}`,project:y,label:`${y.name} ${y.root}`});return C.map((y,m)=>({item:y,order:m,score:Y8(y.label,l)})).filter(y=>y.score!==null).sort((y,m)=>m.score-y.score||y.order-m.order).slice(0,50).map(y=>y.item)},[i,r,l]);P.useEffect(()=>a(0),[l]),P.useEffect(()=>{var C,y;(y=(C=f.current)==null?void 0:C.querySelector(`[data-index="${p}"]`))==null||y.scrollIntoView({block:"nearest"})},[p]);const _=()=>{var C,y;e(),(y=(C=g.current)==null?void 0:C.focus)==null||y.call(C)},x=C=>{C&&(e(),C.kind==="session"?oh(C.project.id,C.session.id):ge.getState().openProject(C.project.id))};return v.jsx("div",{className:"fixed inset-0 z-[65] flex items-start justify-center bg-foreground/30 px-4 pt-[12vh] animate-in fade-in-0",onMouseDown:C=>C.target===C.currentTarget&&_(),children:v.jsxs("div",{role:"dialog","aria-label":"Open a session or project",className:"w-full max-w-lg overflow-hidden rounded-xl border bg-card shadow-2xl",children:[v.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[v.jsx(Rh,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsx("input",{ref:u,value:l,onChange:C=>d(C.target.value),placeholder:"Open a session or project...","aria-label":"Find a session or project",onKeyDown:C=>{C.key==="Escape"?(C.preventDefault(),_()):C.key==="ArrowDown"?(C.preventDefault(),a(y=>Math.min(c.length-1,y+1))):C.key==="ArrowUp"?(C.preventDefault(),a(y=>Math.max(0,y-1))):C.key==="Enter"&&(C.preventDefault(),x(c[p]))},className:"min-w-0 flex-1 bg-transparent text-sm focus:outline-none"}),v.jsx("kbd",{className:"rounded border px-1 text-[10px] text-muted-foreground",children:"Esc"})]}),v.jsxs("div",{ref:f,className:"max-h-[50vh] overflow-y-auto p-1",children:[!c.length&&v.jsx("div",{className:"px-3 py-4 text-xs text-muted-foreground",children:"Nothing matches."}),c.map((C,y)=>v.jsxs("button",{"data-index":y,onMouseMove:()=>a(y),onMouseEnter:()=>C.project.id!==fi&&Tm(C.project.id),onClick:()=>x(C),className:ye("flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-xs",y===p?"bg-primary/15":"hover:bg-muted"),children:[C.kind==="session"?v.jsx(bg,{size:13,className:ye("shrink-0",C.open&&wh(C.session)?"text-severity-warning":C.open?"text-success":"text-muted-foreground")}):v.jsx(Ks,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:C.kind==="session"?C.session.title:C.project.name}),v.jsx("span",{className:"shrink-0 truncate text-[10px] text-muted-foreground",children:C.kind==="session"?`${C.project.name} · ${C.open?wh(C.session)?"waiting":C.session.live?"open":"stopped":C.session.lastAt?fs(C.session.lastAt):"recent"}`:"project"})]},C.key))]}),v.jsxs("div",{className:"flex gap-3 border-t px-3 py-1.5 text-[10px] text-muted-foreground",children:[v.jsx("span",{children:"↑↓ to move"}),v.jsx("span",{children:"Enter to open"}),v.jsx("span",{children:"A stopped session resumes when opened"})]})]})})}function X8(){return v.jsxs(Fh,{align:"start",className:"w-[22rem] max-w-[calc(100vw-1rem)] p-2",trigger:v.jsx("button",{title:"Keyboard shortcuts","aria-label":"Keyboard shortcuts",className:"self-center rounded p-0.5 text-muted-foreground/70 hover:bg-muted hover:text-foreground",children:v.jsx(a4,{size:13})}),children:[v.jsx("div",{className:"px-1 pb-1.5 text-xs font-semibold",children:"Keyboard shortcuts"}),v.jsx("div",{className:"space-y-0.5",children:G8.map(e=>v.jsxs("div",{className:"flex items-start gap-3 rounded px-1 py-1 text-[11px]",children:[v.jsx("kbd",{className:"w-24 shrink-0 whitespace-nowrap rounded border bg-muted px-1 py-0.5 text-center font-mono text-[10px]",children:e.keys}),v.jsx("span",{className:"text-muted-foreground",children:e.what})]},e.keys))})]})}const Q8=async()=>{const e=await fetch(`${gi()}/git`),i=await e.json().catch(()=>({}));if(!e.ok)throw new Error(i.error??e.statusText);return i.git??null};function Z8(){const e=ct(Q8,["files","runs"]),{reload:i}=e;P.useEffect(()=>{const d=window.setInterval(i,3e4);return window.addEventListener("focus",i),()=>{window.clearInterval(d),window.removeEventListener("focus",i)}},[i]);const r=e.data;if(!r)return null;const s=r.staged+r.changed+r.untracked,l=[r.branch?`Branch ${r.branch}`:"No branch",r.ahead!==null?`${r.ahead} to push, ${r.behind} to pull`:"No upstream",`${r.staged} staged, ${r.changed} changed, ${r.untracked} untracked${r.conflicted?`, ${r.conflicted} in conflict`:""}`,r.last?`Last commit ${r.last.hash} ${fs(r.last.at)}: ${r.last.subject}`:"No commit yet","Click to read again"].join(`
563
- `);return v.jsxs("button",{onClick:i,title:l,"aria-label":"Git status",className:"group flex h-7 shrink-0 items-center gap-1.5 border-t px-3 text-[11px] text-muted-foreground hover:bg-muted hover:text-foreground",children:[v.jsx(e4,{size:12,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 truncate font-mono",children:r.branch??"no branch"}),r.ahead?v.jsxs("span",{className:"flex shrink-0 items-center tabular-nums",children:[v.jsx(jw,{size:10}),r.ahead]}):null,r.behind?v.jsxs("span",{className:"flex shrink-0 items-center tabular-nums",children:[v.jsx(q3,{size:10}),r.behind]}):null,v.jsx("span",{className:"flex-1"}),r.conflicted>0&&v.jsxs("span",{className:"shrink-0 tabular-nums text-destructive",children:[r.conflicted," conflict",r.conflicted>1?"s":""]}),v.jsx("span",{className:ye("shrink-0 tabular-nums",s?"text-severity-warning":""),children:s?`${s} changed`:"clean"}),v.jsx(Xl,{size:10,className:"hidden shrink-0 group-hover:block"})]})}let r5=null;const J8=fetch("/api/file-icons/manifest").then(e=>e.ok?e.json():null).then(e=>r5=e).catch(()=>null);function e9(e,i,r,s){const l=i.toLowerCase(),d=(u,f)=>Object.hasOwn(u,f)?u[f]:void 0;if(r)return d(s?e.folderNamesExpanded:e.folderNames,l)??(s?e.folderExpanded:e.folder);const p=d(e.fileNames,l);if(p)return p;const a=l.split(".");for(let u=1;u<a.length;u++){const f=d(e.fileExtensions,a.slice(u).join("."));if(f)return f}return e.file}function s5({name:e,folder:i=!1,open:r=!1,size:s=14,className:l}){const[d,p]=P.useState(r5);if(P.useEffect(()=>{d||J8.then(a=>a&&p(a))},[d]),!d){const a=i?r?Ks:vg:gg;return v.jsx(a,{size:s-1,className:ye("shrink-0",l)})}return v.jsx("img",{src:`/api/file-icons/${e9(d,e,i,r)}.svg`,alt:"",width:s,height:s,draggable:!1,className:ye("shrink-0",l)})}var t9=Object.defineProperty,Ut=(e,i)=>t9(e,"name",{value:i,configurable:!0}),[Av,GB]=br("Tooltip",[ka]),Zh=ka(),n9="TooltipProvider",i9=700,cg="tooltip.open",[r9,Dv]=Av(n9),s9=Ut(e=>{const{__scopeTooltip:i,delayDuration:r=i9,skipDelayDuration:s=300,disableHoverableContent:l=!1,children:d}=e,p=P.useRef(!0),a=P.useRef(!1),u=P.useRef(0);return P.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),v.jsx(r9,{scope:i,isOpenDelayedRef:p,delayDuration:r,onOpen:P.useCallback(()=>{s<=0||(window.clearTimeout(u.current),p.current=!1)},[s]),onClose:P.useCallback(()=>{s<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>p.current=!0,s))},[s]),isPointerInTransitRef:a,onPointerInTransitChange:P.useCallback(f=>{a.current=f},[]),disableHoverableContent:l,children:d})},"TooltipProvider"),ug="Tooltip",[o9,lc]=Av(ug),a9=Ut(e=>{const{__scopeTooltip:i,children:r,open:s,defaultOpen:l,onOpenChange:d,disableHoverableContent:p,delayDuration:a}=e,u=Dv(ug,e.__scopeTooltip),f=Zh(i),[g,c]=P.useState(null),[_,x]=P.useState(void 0),C=Ui(),y=P.useRef(0),m=p??u.disableHoverableContent,b=a??u.delayDuration,S=P.useRef(!1),[w,T]=Qs({prop:s,defaultProp:l??!1,onChange:Ut(M=>{M?(u.onOpen(),document.dispatchEvent(new CustomEvent(cg))):u.onClose(),d==null||d(M)},"onChange"),caller:ug}),D=P.useMemo(()=>w?S.current?"delayed-open":"instant-open":"closed",[w]),R=P.useCallback(()=>{window.clearTimeout(y.current),y.current=0,S.current=!1,T(!0)},[T]),L=P.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),A=P.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{S.current=!0,T(!0),y.current=0},b)},[b,T]);P.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const j=_??C;return v.jsx(Wg,{...f,children:v.jsx(o9,{scope:i,contentId:j,setContentId:x,open:w,stateAttribute:D,trigger:g,onTriggerChange:c,onTriggerEnter:P.useCallback(()=>{u.isOpenDelayedRef.current?A():R()},[u.isOpenDelayedRef,A,R]),onTriggerLeave:P.useCallback(()=>{m?L():(window.clearTimeout(y.current),y.current=0)},[L,m]),onOpen:R,onClose:L,disableHoverableContent:m,children:r})})},"Tooltip"),nw="TooltipTrigger",l9=P.forwardRef(Ut(function(i,r){const{__scopeTooltip:s,"aria-describedby":l,...d}=i,p=lc(nw,s),a=Dv(nw,s),u=Zh(s),f=P.useRef(null),g=ht(r,f,p.onTriggerChange),c=P.useRef(!1),_=P.useRef(!1),x=P.useCallback(()=>c.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),v.jsx(Gg,{asChild:!0,...u,children:v.jsx(St.button,{"aria-describedby":p.open?p5(l,p.contentId):l,"data-state":p.stateAttribute,...d,ref:g,onPointerMove:tt(i.onPointerMove,C=>{C.pointerType!=="touch"&&!_.current&&!a.isPointerInTransitRef.current&&(p.onTriggerEnter(),_.current=!0)}),onPointerLeave:tt(i.onPointerLeave,()=>{p.onTriggerLeave(),_.current=!1}),onPointerDown:tt(i.onPointerDown,()=>{p.open&&p.onClose(),c.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:tt(i.onFocus,()=>{c.current||p.onOpen()}),onBlur:tt(i.onBlur,p.onClose),onClick:tt(i.onClick,p.onClose)})})},"TooltipTrigger")),o5="TooltipPortal",[c9,u9]=Av(o5,{forceMount:void 0}),h9=Ut(e=>{const{__scopeTooltip:i,forceMount:r,children:s,container:l}=e,d=lc(o5,i);return v.jsx(c9,{scope:i,forceMount:r,children:v.jsx(wr,{present:r||d.open,children:v.jsx(Lh,{asChild:!0,container:l,children:s})})})},"TooltipPortal"),Vl="TooltipContent",d9=P.forwardRef(Ut(function(i,r){const s=u9(Vl,i.__scopeTooltip),{forceMount:l=s.forceMount,side:d="top",...p}=i,a=lc(Vl,i.__scopeTooltip);return v.jsx(wr,{present:l||a.open,children:a.disableHoverableContent?v.jsx(a5,{side:d,...p,ref:r}):v.jsx(f9,{side:d,...p,ref:r})})},"TooltipContent")),f9=P.forwardRef(Ut(function(i,r){const s=lc(Vl,i.__scopeTooltip),l=Dv(Vl,i.__scopeTooltip),d=P.useRef(null),p=ht(r,d),[a,u]=P.useState(null),{trigger:f,onClose:g}=s,c=d.current,{onPointerInTransitChange:_}=l,x=P.useCallback(()=>{u(null),_(!1)},[_]),C=P.useCallback((y,m)=>{const b=y.currentTarget,S={x:y.clientX,y:y.clientY},w=l5(S,b.getBoundingClientRect()),T=c5(S,w),D=u5(m.getBoundingClientRect()),R=d5([...T,...D]);u(R),_(!0)},[_]);return P.useEffect(()=>()=>x(),[x]),P.useEffect(()=>{if(f&&c){const y=Ut(b=>C(b,c),"handleTriggerLeave"),m=Ut(b=>C(b,f),"handleContentLeave");return f.addEventListener("pointerleave",y),c.addEventListener("pointerleave",m),()=>{f.removeEventListener("pointerleave",y),c.removeEventListener("pointerleave",m)}}},[f,c,C,x]),P.useEffect(()=>{if(a){const y=Ut(m=>{const b=m.target,S={x:m.clientX,y:m.clientY},w=(f==null?void 0:f.contains(b))||(c==null?void 0:c.contains(b)),T=!h5(S,a);w?x():T&&(x(),g())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[f,c,a,g,x]),v.jsx(a5,{...i,ref:p})},"TooltipContentHoverable")),p9=mS("TooltipContent"),a5=P.forwardRef(Ut(function(i,r){const{__scopeTooltip:s,children:l,"aria-label":d,id:p,onEscapeKeyDown:a,onPointerDownOutside:u,...f}=i,g=lc(Vl,s),c=Zh(s),{onClose:_}=g,[x,C]=P.useState(null),y=ht(r,C);Lg(x),P.useEffect(()=>(document.addEventListener(cg,_),()=>document.removeEventListener(cg,_)),[_]),P.useEffect(()=>{if(g.trigger){const b=Ut(S=>{S.target instanceof Node&&S.target.contains(g.trigger)&&_()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[g.trigger,_]);const{setContentId:m}=g;return $t(()=>(m(p),()=>{m(void 0)}),[p,m]),v.jsx(Dh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:b=>b.preventDefault(),onDismiss:_,children:v.jsxs(Yg,{"data-state":g.stateAttribute,role:d?void 0:"tooltip",id:d?void 0:g.contentId,...c,...f,ref:y,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(p9,{children:l}),d?v.jsx(rD,{id:g.contentId,role:"tooltip",children:d}):null]})})},"TooltipContentImpl")),m9=P.forwardRef(Ut(function(i,r){const{__scopeTooltip:s,...l}=i,d=Zh(s);return v.jsx(y6,{...d,...l,ref:r})},"TooltipArrow"));function l5(e,i){const r=Math.abs(i.top-e.y),s=Math.abs(i.bottom-e.y),l=Math.abs(i.right-e.x),d=Math.abs(i.left-e.x);switch(Math.min(r,s,l,d)){case d:return"left";case l:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}Ut(l5,"getExitSideFromRect");function c5(e,i,r=5){const s=[];switch(i){case"top":s.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":s.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":s.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":s.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return s}Ut(c5,"getPaddedExitPoints");function u5(e){const{top:i,right:r,bottom:s,left:l}=e;return[{x:l,y:i},{x:r,y:i},{x:r,y:s},{x:l,y:s}]}Ut(u5,"getPointsFromRect");function h5(e,i){const{x:r,y:s}=e;let l=!1;for(let d=0,p=i.length-1;d<i.length;p=d++){const a=i[d],u=i[p],f=a.x,g=a.y,c=u.x,_=u.y;g>s!=_>s&&r<(c-f)*(s-g)/(_-g)+f&&(l=!l)}return l}Ut(h5,"isPointInPolygon");function d5(e){const i=e.slice();return i.sort((r,s)=>r.x<s.x?-1:r.x>s.x?1:r.y<s.y?-1:r.y>s.y?1:0),f5(i)}Ut(d5,"getHull");function f5(e){if(e.length<=1)return e.slice();const i=[];for(let s=0;s<e.length;s++){const l=e[s];for(;i.length>=2;){const d=i[i.length-1],p=i[i.length-2];if((d.x-p.x)*(l.y-p.y)>=(d.y-p.y)*(l.x-p.x))i.pop();else break}i.push(l)}i.pop();const r=[];for(let s=e.length-1;s>=0;s--){const l=e[s];for(;r.length>=2;){const d=r[r.length-1],p=r[r.length-2];if((d.x-p.x)*(l.y-p.y)>=(d.y-p.y)*(l.x-p.x))r.pop();else break}r.push(l)}return r.pop(),i.length===1&&r.length===1&&i[0].x===r[0].x&&i[0].y===r[0].y?i:i.concat(r)}Ut(f5,"getHullPresorted");function p5(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Ut(p5,"concatAriaDescribedby");function hr({content:e,children:i,side:r="top",asChild:s=!1,className:l,wide:d}){return e?v.jsx(s9,{delayDuration:300,children:v.jsxs(a9,{children:[v.jsx(l9,{asChild:!0,children:s?i:v.jsx("span",{className:ye("inline-flex",l),children:i})}),v.jsx(h9,{children:v.jsxs(d9,{side:r,sideOffset:6,collisionPadding:8,className:ye("z-[100] rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95 dark:bg-secondary dark:text-foreground",d?"max-w-md":"max-w-xs"),children:[e,v.jsx(m9,{className:"fill-foreground dark:fill-secondary"})]})})]})}):v.jsx(v.Fragment,{children:i})}const iw=()=>`clauder-hub:files-expanded:${ge.getState().projectId}`,rw="clauder-hub:files-show-ignored",m5=P.createContext(null),Jh=()=>P.useContext(m5);function sw(e,i){try{const r=localStorage.getItem(e);return r===null?i:JSON.parse(r)}catch{return i}}function ow(e,i){try{localStorage.setItem(e,JSON.stringify(i))}catch{}}const g5=(e,i)=>e?`${e}/${i}`:i,v5=e=>e.includes("/")?e.slice(0,e.lastIndexOf("/")):"";async function hg(e,i,r){const s=dr.getState().item;if(!s)return;if(s.mode==="copy"){await it(()=>Kt.copy(s.path,e))&&e&&r(e);return}const l=s.path.split("/").pop()??s.path,d=g5(e,l);if(d===s.path)return dr.getState().set(null);const p=await it(()=>Kt.rename(s.path,d));if(!p)return;dr.getState().set(null),en.getState().move(s.path,p.path),Bn.getState().rename(s.path,p.path),e&&r(e);const a=ge.getState().view;a.kind==="file"&&(a.path===s.path||a.path.startsWith(`${s.path}/`))&&i({kind:"file",path:p.path+a.path.slice(s.path.length)})}function g9(){const[e,i]=P.useState(()=>sw(rw,!1)),[r,s]=P.useState(()=>new Set(sw(iw(),[]))),[l,d]=P.useState(0),[p,a]=P.useState(null),[u,f]=P.useState(null),g=dr(m=>m.item),c=ge(m=>m.go);P.useEffect(()=>ow(iw(),[...r]),[r]),P.useEffect(()=>{const m=()=>d(b=>b+1);return window.addEventListener("focus",m),()=>window.removeEventListener("focus",m)},[]);const _=(m,b)=>s(S=>{const w=new Set(S);return b??!w.has(m)?w.add(m):w.delete(m),w}),x={showIgnored:e,epoch:l,expanded:r,toggle:_,editing:p,setEditing:a,openMenu:(m,b,S)=>f({entry:m,x:b,y:S})},C=ge(m=>{var b;return((b=m.health)==null?void 0:b.project)??"Project"}),y=m=>{m.defaultPrevented||(m.preventDefault(),f({entry:{name:C,path:"",kind:"dir",size:0,ignored:!1},x:m.clientX,y:m.clientY}))};return v.jsxs(m5.Provider,{value:x,children:[v.jsxs("div",{className:"flex min-h-full flex-col",onContextMenu:y,children:[v.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-0.5 bg-background px-3 pb-1",children:[v.jsx("div",{className:"flex-1 text-[10px] text-muted-foreground",children:"Project files"}),v.jsx(hr,{content:"New file",asChild:!0,children:v.jsx(xe,{variant:"ghost",size:"icon","aria-label":"New file",onClick:()=>a({kind:"file",parent:""}),children:v.jsx(Sm,{size:13})})}),v.jsx(hr,{content:"New folder",asChild:!0,children:v.jsx(xe,{variant:"ghost",size:"icon","aria-label":"New folder",onClick:()=>a({kind:"folder",parent:""}),children:v.jsx(Em,{size:13})})}),v.jsx(hr,{content:e?"Hide ignored":"Show ignored",asChild:!0,children:v.jsx(xe,{variant:"ghost",size:"icon","aria-label":"Show ignored","aria-pressed":e,className:ye(e&&"bg-muted text-foreground"),onClick:()=>{i(!e),ow(rw,!e)},children:e?v.jsx(mg,{size:13}):v.jsx(Z3,{size:13})})}),g&&v.jsx(hr,{content:`Paste ${g.path.split("/").pop()} into the project root`,asChild:!0,children:v.jsx(xe,{variant:"ghost",size:"icon","aria-label":"Paste into the project root",onClick:()=>void hg("",c,m=>_(m,!0)),children:v.jsx(wm,{size:13})})}),v.jsx(hr,{content:"Refresh",asChild:!0,children:v.jsx(xe,{variant:"ghost",size:"icon","aria-label":"Refresh",onClick:()=>d(l+1),children:v.jsx(Xl,{size:13})})})]}),v.jsx("div",{className:"flex-1 px-2",children:v.jsx(_5,{path:"",depth:0})})]}),u&&v.jsx(_9,{...u,onClose:()=>f(null)})]})}function _5({path:e,depth:i}){const{showIgnored:r,epoch:s,editing:l}=Jh(),{data:d,error:p}=ct(()=>Kt.list(e,r),["files","sessions"],[e,r,s]),a=l&&l.kind!=="rename"&&l.parent===e?l.kind:null,u={paddingLeft:`${i*12+8}px`};return v.jsxs(v.Fragment,{children:[a&&v.jsx(x5,{depth:i,icon:a==="folder"?vg:gg,initial:""}),p&&v.jsx("div",{className:"py-1 text-[11px] text-severity-critical",style:u,children:p}),!d&&!p&&v.jsx("div",{className:"py-1 text-[11px] text-muted-foreground",style:u,children:"Loading..."}),d&&!d.entries.length&&!a&&v.jsx("div",{className:"py-1 text-[11px] text-muted-foreground",style:u,children:"Empty"}),d==null?void 0:d.entries.map(f=>v.jsx(v9,{entry:f,depth:i},f.path))]})}function v9({entry:e,depth:i}){const{expanded:r,toggle:s,editing:l,openMenu:d}=Jh(),p=ge(x=>x.go),a=ge(x=>x.view.kind==="file"&&x.view.path===e.path),u=en(x=>rs(x.drafts[e.path])),f=dr(x=>{var C;return((C=x.item)==null?void 0:C.mode)==="cut"&&x.item.path===e.path}),g=e.kind==="dir"&&r.has(e.path),c=P.useRef({fired:!1}),_=()=>window.clearTimeout(c.current.timer);return(l==null?void 0:l.kind)==="rename"&&l.entry.path===e.path?v.jsx(x5,{depth:i,icon:e.kind==="dir"?vg:gg,initial:e.name}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>{c.current.fired||(e.kind==="dir"?s(e.path):p({kind:"file",path:e.path}))},onDoubleClick:()=>e.kind==="file"&&Bn.getState().pin(e.path),onContextMenu:x=>{x.preventDefault(),d(e,x.clientX,x.clientY)},onPointerDown:x=>{if(c.current.fired=!1,x.pointerType!=="touch")return;const{clientX:C,clientY:y}=x;window.clearTimeout(c.current.timer),c.current.timer=window.setTimeout(()=>{c.current.fired=!0,d(e,C,y)},500)},onPointerUp:_,onPointerLeave:_,onPointerCancel:_,title:e.path,className:ye("flex w-full select-none items-center gap-1.5 rounded-md py-1 pr-8 text-left text-xs transition-colors [-webkit-touch-callout:none] md:pr-2",a?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground",e.ignored&&"opacity-55",f&&"opacity-45"),style:{paddingLeft:`${i*12+4}px`},children:[e.kind==="dir"?g?v.jsx(xa,{size:11,className:"shrink-0"}):v.jsx(ya,{size:11,className:"shrink-0"}):v.jsx("span",{className:"w-[11px] shrink-0"}),v.jsx(s5,{name:e.name,folder:e.kind==="dir",open:g}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.name}),u&&v.jsx("span",{title:"Unsaved changes",className:"h-1.5 w-1.5 shrink-0 rounded-full bg-severity-warning"})]}),v.jsx("button",{"aria-label":"File actions",title:"File actions",onClick:x=>{const C=x.currentTarget.getBoundingClientRect();d(e,C.right-192,C.bottom+4)},className:"absolute right-1 top-0.5 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground md:hidden",children:v.jsx(zw,{size:13})})]}),g&&v.jsx(_5,{path:e.path,depth:i+1})]})}function x5({depth:e,icon:i,initial:r}){const{editing:s,setEditing:l,toggle:d}=Jh(),p=ge(c=>c.go),[a,u]=P.useState(r),f=P.useRef(!1),g=async()=>{const c=a.trim();if(f.current)return;if(!s||!c)return l(null);if(s.kind==="rename"&&/[\\/]/.test(c)){ge.getState().notify("A name cannot contain / or \\. To move it, use Cut and Paste.","error");return}const _=s.kind==="rename"?v5(s.entry.path):s.parent,x=c.startsWith("/")?c.replace(/^\/+/,""):g5(_,c);if(f.current=!0,s.kind==="rename"){const C=s.entry.path;if(x===C)return l(null);const y=await it(()=>Kt.rename(C,x));if(f.current=!1,!y)return;en.getState().move(C,y.path),Bn.getState().rename(C,y.path);const m=ge.getState().view;m.kind==="file"&&(m.path===C||m.path.startsWith(`${C}/`))&&p({kind:"file",path:y.path+m.path.slice(C.length)})}else{const C=await it(()=>s.kind==="folder"?Kt.mkdir(x):Kt.create(x));if(f.current=!1,!C)return;s.kind==="file"?p({kind:"file",path:C.path}):d(C.path,!0)}l(null)};return v.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 pr-2",style:{paddingLeft:`${e*12+19}px`},children:[v.jsx(i,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("input",{autoFocus:!0,value:a,onChange:c=>u(c.target.value),onFocus:c=>{const _=r.lastIndexOf(".");c.currentTarget.setSelectionRange(0,_>0?_:r.length)},onKeyDown:c=>{c.key==="Enter"&&g(),c.key==="Escape"&&l(null)},onBlur:()=>!f.current&&l(null),placeholder:(s==null?void 0:s.kind)==="folder"?"Folder name":"File name",spellCheck:!1,className:"min-w-0 flex-1 rounded border border-primary/60 bg-background px-1.5 py-0.5 text-xs focus:outline-none"})]})}function _9({entry:e,x:i,y:r,onClose:s}){const{setEditing:l,toggle:d}=Jh(),p=ge(m=>m.go),a=ge(m=>{var b;return((b=m.health)==null?void 0:b.projectRoot)??""}),u=dr(m=>m.item),f=a.includes("\\"),g=e.path==="",c=g?a:a?f?`${a}\\${e.path.replace(/\//g,"\\")}`:`${a}/${e.path}`:e.path,_=(m,b)=>{var S;return void((S=navigator.clipboard)==null?void 0:S.writeText(m).then(()=>ge.getState().notify(`Copied the ${b}.`),()=>ge.getState().notify("The browser did not allow copying.","error")))};P.useEffect(()=>{const m=()=>s(),b=S=>S.key==="Escape"&&s();return window.addEventListener("pointerdown",m),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),window.addEventListener("keydown",b),()=>{window.removeEventListener("pointerdown",m),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m),window.removeEventListener("keydown",b)}},[s]);const x=async()=>{if(!await it(()=>Kt.remove(e.path),`Deleted ${e.name}.`))return;const{drafts:b,drop:S}=en.getState();for(const R of Object.keys(b))(R===e.path||R.startsWith(`${e.path}/`))&&S(R);const w=ge.getState().view,T=w.kind==="file"?w.path:null,D=Bn.getState().close(dT(e.path),T);T&&D!==T?p(D?{kind:"file",path:D}:{kind:"page",page:"overview"}):w.kind==="file"&&(w.path===e.path||w.path.startsWith(`${e.path}/`))&&p({kind:"page",page:"overview"})},C=(m,b,S,w=!1)=>{const T=b;return v.jsxs("button",{onPointerDown:D=>{D.stopPropagation(),s(),window.setTimeout(S)},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs",w?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[v.jsx(T,{size:13}),m]})},y=m=>()=>{d(e.path,!0),l({kind:m,parent:e.path})};return g?v.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.max(8,Math.min(r,window.innerHeight-220))},onPointerDown:m=>m.stopPropagation(),children:[C("New file",Sm,()=>l({kind:"file",parent:""})),C("New folder",Em,()=>l({kind:"folder",parent:""})),u&&C("Paste",wm,()=>void hg("",p,m=>d(m,!0))),v.jsx("div",{className:"my-1 border-t"}),C("Copy Path",Ml,()=>_(c,"path")),C("Reveal in File Explorer",Ks,()=>void it(()=>Kt.reveal("")))]}):v.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.max(8,Math.min(r,window.innerHeight-380))},onPointerDown:m=>m.stopPropagation(),children:[e.kind==="file"?v.jsxs(v.Fragment,{children:[C("Open",Wl,()=>p({kind:"file",path:e.path})),C("Open in new window",ba,()=>Cg({kind:"file",path:e.path}))]}):v.jsxs(v.Fragment,{children:[C("New file",Sm,y("file")),C("New folder",Em,y("folder"))]}),v.jsx("div",{className:"my-1 border-t"}),C("Cut",x4,()=>dr.getState().set({mode:"cut",path:e.path})),C("Copy",Th,()=>{dr.getState().set({mode:"copy",path:e.path}),it(()=>Kt.copyToClipboard(e.path),"Copied: paste it here, or with Ctrl+V in Slack, Teams or a mail.")}),u&&C(`Paste${e.kind==="dir"?" into folder":" here"}`,wm,()=>void hg(e.kind==="dir"?e.path:v5(e.path),p,m=>d(m,!0))),v.jsx("div",{className:"my-1 border-t"}),C("Copy Path",Ml,()=>_(c,"path")),C("Copy Relative Path",Ml,()=>_(e.path,"relative path")),C("Reveal in File Explorer",Ks,()=>void it(()=>Kt.reveal(e.path))),v.jsx("div",{className:"my-1 border-t"}),C("Rename",Wi,()=>l({kind:"rename",entry:e})),v.jsx("div",{className:"my-1 border-t"}),C("Delete",yr,()=>void x(),!0)]})}const aw=[{id:"operation",label:"Operation",items:[{page:"overview",label:"Overview",icon:l4},{page:"inbox",label:"Inbox",icon:ls},{page:"automation",label:"Automation",icon:kh}]},{id:"project",label:"Project",items:[{page:"instructions",label:"Instructions",icon:W3},{page:"agents",label:"Agents",icon:Ow},{page:"skills",label:"Skills",icon:yg},{page:"commands",label:"Commands",icon:X3},{page:"mcp-servers",label:"MCP servers",icon:Yl},{page:"hooks",label:"Hooks",icon:Yw},{page:"plugins",label:"Plugins",icon:g4}]},{id:"settings",label:"Settings",items:[{page:"claude-settings",label:"Claude settings",icon:b4},{page:"channels",label:"Channels",icon:Kl},{page:"hub-prompts",label:"Hub prompts",icon:Uw},{page:"mcp-suggestions",label:"MCP suggestions",icon:m4},{page:"presets",label:"Toolset presets",icon:_g},{page:"categories",label:"Task categories",icon:Ww}]}];function ed({session:e}){const i=e.status==="waiting"?"bg-severity-warning animate-status-pulse":e.status==="running"?"bg-success animate-status-pulse":e.status==="idle"?"bg-success":e.status==="done"?"border border-success bg-transparent":"bg-muted-foreground/40";return v.jsx("span",{className:ye("inline-block h-2 w-2 shrink-0 rounded-full",i)})}const x9={manual:"hub",cron:"cron",webhook:"webhook",queue:"queue",external:"terminal"},lw="clauder-hub:folded-groups",cw="clauder-hub:sidebar-tab",y9="clauder-hub:history-hide-tasks",dg="clauder:focus-sessions";function b9(e,i){const[r,s]=P.useState(()=>{try{const d=localStorage.getItem(e);return d===null?i:d==="1"}catch{return i}});return[r,d=>{s(d);try{localStorage.setItem(e,d?"1":"0")}catch{}}]}function w9(){const[e,i]=P.useState(()=>{try{const s=localStorage.getItem(cw);return s==="workspace"||s==="files"?s:"sessions"}catch{return"sessions"}});return[e,s=>{i(s);try{localStorage.setItem(cw,s)}catch{}}]}function S9(){const[e,i]=P.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem(lw)??"[]"))}catch{return new Set}});return P.useEffect(()=>{try{localStorage.setItem(lw,JSON.stringify([...e]))}catch{}},[e]),[e,s=>i(l=>{const d=new Set(l);return d.has(s)?d.delete(s):d.add(s),d})]}function y5(e){const i=ge(d=>d.go),[r,s]=P.useState(!1);return{starting:r,newSession:async()=>{if(r)return;s(!0);const d=Math.max(80,Math.floor((window.innerWidth-e-40)/7.8)),p=Math.max(24,Math.floor((window.innerHeight-140)/17)),a=await it(()=>ve.startSession({cols:d,rows:p}));s(!1),a&&(await ge.getState().refreshSessions(),i({kind:"session",id:a.sessionId}))}}}const C9=[{kind:"hub",label:"Hub task",icon:Ql},{kind:"create-job",label:"Create a job",icon:kh},{kind:"queue-run",label:"Queue a run",icon:ma},{kind:"create-category",label:"New task category",icon:Ww},{kind:"create-preset",label:"New toolset preset",icon:_g},{kind:"create-channel",label:"Add a channel",icon:Kl}];function b5({beside:e,size:i="sm",full:r=!1}){const{starting:s,newSession:l}=y5(e),{starting:d,start:p}=io(),[a,u]=P.useState(!1),f=s||d,g=c=>{u(!1),c()};return v.jsxs("div",{className:ye("flex",r&&"w-full"),children:[v.jsxs(xe,{variant:"primary",size:i,className:"flex-1 rounded-r-none",disabled:f,onClick:()=>void l(),"aria-label":"New session",children:[v.jsx(Qn,{size:i==="md"?14:13})," ",f?"Starting...":"New session"]}),v.jsxs(Fh,{open:a,onOpenChange:u,align:"end",className:"w-56 p-1",trigger:v.jsx(xe,{variant:"primary",size:i,className:"rounded-l-none border-l border-primary-foreground/25 px-2",disabled:f,"aria-label":"More ways to start",title:"Plain session or hub task",children:v.jsx(xa,{size:14})}),children:[v.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>g(l),children:[v.jsx(Qn,{size:13})," New session"]}),v.jsx("div",{className:"mx-2 mb-0.5 mt-1.5 border-t pt-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Hub task"}),C9.map(c=>v.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>g(()=>p(c.kind)),children:[v.jsx(c.icon,{size:13,className:"text-primary"})," ",c.label]},c.kind))]})]})}function E9({onMenu:e}){const i=ge(r=>r.health);return v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[v.jsx(xe,{variant:"ghost",size:"icon",onClick:e,"aria-label":"Open menu",title:"Menu",children:v.jsx(Fw,{size:16})}),v.jsx(va,{}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx(nd,{}),v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:(i==null?void 0:i.project)??"..."}),v.jsx(Lv,{})]})]}),v.jsx(b5,{beside:0})]})}function uw({width:e,collapsed:i,onToggle:r,drawer:s=!1}){const{sessions:l,open:d,view:p,go:a,health:u}=ge(),[f,g]=P.useState(""),[c,_]=S9(),[x,C]=w9(),{starting:y,newSession:m}=y5(s?0:i?48:Number(e)),b=P.useMemo(()=>{const I=f.trim().toLowerCase();return I?l.filter(B=>`${B.title} ${B.firstPrompt??""} ${B.id}`.toLowerCase().includes(I)):l},[l,f]),S=b.filter(I=>I.live),w=b.filter(I=>!I.live),[T,D]=b9(y9,!0),R=T?w.filter(I=>!I.purpose):w,[L,A]=P.useState(0),j=P.useRef(null);P.useEffect(()=>{const I=()=>{C("sessions"),A(B=>B+1),window.setTimeout(()=>{var B;return(B=j.current)==null?void 0:B.scrollIntoView({block:"nearest",behavior:"smooth"})},50)};return window.addEventListener(dg,I),()=>window.removeEventListener(dg,I)},[C]);const M=I=>p.kind==="page"&&p.page===I;return i?v.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-center gap-1 overflow-y-auto border-r py-3",children:[v.jsx(va,{className:"mb-2"}),v.jsx(hr,{content:"New session",side:"right",asChild:!0,children:v.jsx(xe,{variant:"primary",size:"icon",disabled:y,onClick:()=>void m(),children:v.jsx(Qn,{size:14})})}),aw.map(I=>v.jsx("div",{className:"flex flex-col items-center gap-1 border-t pt-1",children:I.items.map(B=>v.jsx(hr,{content:`${I.label} · ${B.label}`,side:"right",asChild:!0,children:v.jsx(xe,{variant:"ghost",size:"icon",className:ye(M(B.page)&&"bg-muted text-foreground"),onClick:()=>a({kind:"page",page:B.page}),children:v.jsx(B.icon,{size:15})})},B.page))},I.id)),v.jsx("div",{className:"flex-1"}),v.jsx(xe,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Expand sidebar",children:v.jsx(Bw,{size:15})})]}):v.jsxs("aside",{className:"flex shrink-0 flex-col",style:{width:e},children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 pb-2 pt-3",children:[v.jsx(va,{}),v.jsxs("div",{className:"min-w-0",children:[v.jsx(nd,{}),v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx(hr,{content:u==null?void 0:u.projectRoot,wide:!0,className:"min-w-0",children:v.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:(u==null?void 0:u.project)??"..."})}),v.jsx(Lv,{})]})]}),s?v.jsx(xe,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":"Close menu",children:v.jsx(pn,{size:15})}):v.jsx(xe,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":"Collapse sidebar",children:v.jsx(Nw,{size:15})})]}),v.jsx("div",{className:"px-3 pb-2",children:v.jsx(b5,{beside:i?48:typeof e=="number"?e:280,size:"md",full:!0})}),v.jsx("div",{className:"mx-3 mb-2 flex rounded-md bg-muted p-0.5",children:[["sessions","Sessions",null],["workspace","Workspace",d.length?String(d.length):null],["files","Files",null]].map(([I,B,H])=>v.jsxs("button",{onClick:()=>C(I),className:ye("flex flex-1 items-center justify-center gap-1.5 rounded px-2 py-1 text-xs transition-colors",x===I?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[B,I==="sessions"&&S.length>0&&v.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success",title:`${S.length} running`}),H&&v.jsx("span",{className:ye("rounded-full px-1.5 text-[10px] font-semibold",I==="workspace"?"bg-severity-warning text-background":"bg-success/20 text-success"),children:H})]},I))}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pb-3",children:x==="files"?v.jsx(g9,{}):x==="workspace"?v.jsx("nav",{className:"px-2",children:aw.map(I=>{const B=c.has(I.id),H=I.items.some(F=>M(F.page));return v.jsxs("div",{className:"pb-1",children:[v.jsxs("button",{onClick:()=>_(I.id),className:"flex w-full items-center gap-1 px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",children:[B?v.jsx(ya,{size:11}):v.jsx(xa,{size:11}),I.label,B&&I.id==="operation"&&d.length>0&&v.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] text-background",children:d.length})]}),(!B||H)&&I.items.filter(F=>!B||M(F.page)).map(F=>v.jsxs("button",{onClick:()=>a({kind:"page",page:F.page}),className:ye("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs transition-colors",M(F.page)?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(F.icon,{size:14}),F.label,F.page==="inbox"&&d.length>0&&v.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:d.length})]},F.page))]},I.id)})}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"sticky top-0 z-10 bg-background px-3 pb-1",children:v.jsxs("div",{className:"relative",children:[v.jsx(Rh,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(Zn,{value:f,onChange:I=>g(I.target.value),placeholder:"Search sessions",className:"pl-6"})]})}),v.jsxs("div",{className:"px-2",children:[v.jsx("div",{ref:j,children:v.jsx(hw,{title:`Live (${S.length})`,sessions:S,flash:L})}),v.jsx(hw,{title:`History (${R.length})`,sessions:R,action:v.jsxs("label",{className:"flex cursor-pointer select-none items-center gap-1",title:"Hide the hub's own configuration sessions",children:[v.jsx("input",{type:"checkbox",className:"h-3 w-3 accent-[hsl(var(--primary))]",checked:T,onChange:I=>D(I.target.checked)}),"Hide hub tasks"]})}),!b.length&&v.jsx("div",{className:"px-2 pt-3 text-xs text-muted-foreground",children:f?"No match.":"No sessions yet. Start one above."})]})]})}),v.jsx(Z8,{})]})}function k9({session:e,x:i,y:r,onClose:s}){const l=ge(a=>a.go),d=Qh();P.useEffect(()=>{const a=()=>s(),u=f=>f.key==="Escape"&&s();return window.addEventListener("pointerdown",a),window.addEventListener("scroll",a,!0),window.addEventListener("resize",a),window.addEventListener("keydown",u),()=>{window.removeEventListener("pointerdown",a),window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",a),window.removeEventListener("keydown",u)}},[s]);const p=(a,u,f,g={})=>{const c=u;return v.jsxs("button",{disabled:g.disabled,title:g.hint,onPointerDown:_=>{_.stopPropagation(),!g.disabled&&(s(),f())},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs disabled:cursor-not-allowed disabled:opacity-40",g.danger?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[v.jsx(c,{size:13}),a]})};return v.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.min(r,window.innerHeight-270)},onPointerDown:a=>a.stopPropagation(),children:[p("Open",Wl,()=>l({kind:"session",id:e.id})),p("Open in new window",ba,()=>Cg({kind:"session",id:e.id})),p("Rename",Wi,()=>void d.rename(e)),v.jsx("div",{className:"my-1 border-t"}),e.quiet?p("Allow notifications",ls,()=>void it(()=>ve.setSessionQuiet(e.id,!1),"Notifications back on for this session.")):p("Do not disturb",pa,()=>void it(()=>ve.setSessionQuiet(e.id,!0),"Nothing from this session goes out on a channel."),{hint:"Its questions still wait in the inbox; no channel hears of them"}),p(`Clear waiting${e.openInteractions?` (${e.openInteractions})`:""}`,xg,()=>void it(()=>ve.dismissWaiting(e.id),"Cleared."),{disabled:!e.openInteractions,hint:"Puts away what it waits on, unanswered; nothing is typed into it"}),v.jsx("div",{className:"my-1 border-t"}),e.live&&p("Stop",Ah,()=>void d.stop(e),{hint:"Stops its terminal; the conversation is kept for a later resume"}),p("Delete permanently",yr,()=>void d.remove(e),{danger:!0,hint:e.live?"Stops it first":void 0})]})}function hw({title:e,sessions:i,action:r,flash:s=0}){const{view:l,go:d}=ge(),[p,a]=P.useState(null),u=P.useRef({fired:!1}),f=(c,_)=>{if(u.current.fired=!1,_.pointerType!=="touch")return;const{clientX:x,clientY:C}=_;window.clearTimeout(u.current.timer),u.current.timer=window.setTimeout(()=>{u.current.fired=!0,a({session:c,x,y:C})},500)},g=()=>window.clearTimeout(u.current.timer);return!i.length&&!r?null:v.jsxs("div",{className:ye("mt-3 rounded-md",s>0&&"sessions-flash"),children:[p&&v.jsx(k9,{...p,onClose:()=>a(null)}),v.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1 text-[10px] text-muted-foreground",children:[v.jsx("span",{children:e}),r]}),v.jsx("div",{className:"space-y-0.5",children:i.map(c=>{const _=l.kind==="session"&&l.id===c.id;return v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>!u.current.fired&&d({kind:"session",id:c.id}),onContextMenu:x=>{x.preventDefault(),a({session:c,x:x.clientX,y:x.clientY})},onPointerDown:x=>f(c,x),onPointerUp:g,onPointerLeave:g,onPointerCancel:g,className:ye("block w-full select-none rounded-md px-2 py-1.5 pr-8 text-left transition-colors [-webkit-touch-callout:none] md:select-auto md:pr-2",_?"bg-muted":"hover:bg-muted/60"),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ed,{session:c}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:c.title}),c.purpose&&v.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 rounded bg-primary/15 px-1 text-[9px] font-medium text-primary",title:`Hub task: ${c.purpose.title}`,children:[v.jsx(Ql,{size:9})," task"]}),c.quiet&&v.jsx("span",{className:"shrink-0 text-muted-foreground",title:"Do not disturb: no channel hears from it",children:v.jsx(pa,{size:11})}),c.openInteractions>0&&v.jsx("span",{className:"grid h-4 min-w-[1rem] shrink-0 place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none text-background",children:c.openInteractions})]}),v.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 pl-4 text-[10px] text-muted-foreground",children:[v.jsx("span",{children:x9[c.origin]}),v.jsx("span",{children:"·"}),v.jsx("span",{children:fs(c.lastAt)}),c.tokens&&v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"·"}),v.jsxs("span",{children:[On(os(c.tokens))," tok"]})]}),c.diskBytes?v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"·"}),v.jsx("span",{title:"On disk: transcript, subagents, file snapshots and temp folder",children:Sg(c.diskBytes)})]}):null]})]}),v.jsx("button",{"aria-label":"Session actions",title:"Session actions",onClick:x=>{const C=x.currentTarget.getBoundingClientRect();a({session:c,x:C.right-192,y:C.bottom+4})},className:"absolute right-1 top-1 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground md:hidden",children:v.jsx(zw,{size:14})})]},c.id)})})]},s)}function w5({x:e,y:i,items:r,onClose:s}){return P.useEffect(()=>{const l=()=>s(),d=p=>p.key==="Escape"&&s();return window.addEventListener("pointerdown",l),window.addEventListener("keydown",d),()=>{window.removeEventListener("pointerdown",l),window.removeEventListener("keydown",d)}},[s]),v.jsx("div",{role:"menu",className:"fixed z-50 w-44 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(e,window.innerWidth-184),top:Math.min(i,window.innerHeight-180)},onPointerDown:l=>l.stopPropagation(),children:r.map(([l,d,p,a,u])=>v.jsxs("button",{disabled:u,onClick:()=>{s(),p()},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent",a&&"mt-1 border-t pt-2"),children:[v.jsx(d,{size:13}),l]},l))})}function T9(){const e=ge(_=>_.sessions),i=ge(_=>_.view),r=ge(_=>_.go),s=mn(),l=P.useRef(null),d=Qh(),[p,a]=P.useState(null),u=e.filter(_=>_.live),f=i.kind==="session"?i.id:null;if(P.useEffect(()=>{var _,x;f&&((x=(_=l.current)==null?void 0:_.querySelector(`[data-session="${CSS.escape(f)}"]`))==null||x.scrollIntoView({block:"nearest",inline:"nearest"}))},[f,u.length]),!u.length)return null;const g=_=>d.stop(_),c=(_,x)=>s({title:`Stop ${x?"all ":""}${_.length} ${x?"running":"other"} terminal${_.length>1?"s":""}?`,description:"Their conversations are kept for a later resume.",body:v.jsx("div",{className:"space-y-0.5 text-[11px] text-muted-foreground",children:_.map(C=>v.jsx("div",{className:"truncate",children:C.title},C.id))}),confirmLabel:x?"Stop all":"Stop others",tone:"destructive",run:async()=>{await Promise.all(_.map(C=>ve.killSession(C.id))),Xh(_.map(C=>C.id))}});return v.jsxs("div",{ref:l,className:"no-scrollbar flex shrink-0 overflow-x-auto border-b bg-muted/30",children:[p&&v.jsx(w5,{x:p.x,y:p.y,onClose:()=>a(null),items:[["Open",Wl,()=>r({kind:"session",id:p.session.id})],["Rename",Wi,()=>void d.rename(p.session)],["Close",pn,()=>void g(p.session),!0],["Close Others",Gs,()=>void c(u.filter(_=>_.id!==p.session.id),!1),!1,u.length<2],["Close All",Gs,()=>void c(u,!0)]]}),v.jsx("div",{className:"flex shrink-0 items-center px-2 text-muted-foreground",title:"Running terminals",children:v.jsx(bg,{size:13})}),u.map(_=>{const x=_.id===f;return v.jsxs("div",{"data-session":_.id,title:_.status==="waiting"?`${_.title} (waiting on you)`:_.title,onClick:()=>r({kind:"session",id:_.id}),onContextMenu:C=>{C.preventDefault(),a({session:_,x:C.clientX,y:C.clientY})},onAuxClick:C=>{C.button===1&&(C.preventDefault(),g(_))},className:ye("group flex max-w-[16rem] shrink-0 cursor-pointer select-none items-center gap-1.5 border-r border-t-2 px-3 py-1.5 text-xs transition-colors",x?"-mb-px border-t-primary bg-background text-foreground":"border-t-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(ed,{session:_}),v.jsx("span",{className:"truncate",children:_.title}),_.openInteractions>0&&v.jsx("span",{className:"grid h-4 min-w-[1rem] shrink-0 place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none text-background",children:_.openInteractions}),v.jsx("button",{"aria-label":`Stop ${_.title}`,title:"Stop this terminal",onClick:C=>{C.stopPropagation(),g(_)},className:ye("grid h-4 w-4 shrink-0 place-items-center rounded hover:bg-muted",!x&&"invisible group-hover:visible"),children:v.jsx(pn,{size:12})})]},_.id)})]})}const S5="clauder-hub:live-panel";function R9(){try{return localStorage.getItem(S5)!=="0"}catch{return!0}}const td=no((e,i)=>({open:R9(),toggle:()=>{const r=!i().open;e({open:r});try{localStorage.setItem(S5,r?"1":"0")}catch{}}}));function A9(){const{open:e,toggle:i}=td(),r=e?$w:p4;return v.jsx("button",{onClick:i,title:e?"Hide the live sessions panel":"Show the live sessions of every project, on the right","aria-label":e?"Hide live sessions":"Show live sessions","aria-pressed":e,className:"self-center rounded p-0.5 text-muted-foreground/70 hover:bg-muted hover:text-foreground",children:v.jsx(r,{size:13})})}function D9({status:e}){return v.jsx("span",{className:ye("inline-block h-2 w-2 shrink-0 rounded-full",e==="waiting"?"bg-severity-warning animate-status-pulse":e==="running"?"bg-success animate-status-pulse":e==="idle"?"bg-success":e==="done"?"border border-success bg-transparent":"bg-muted-foreground/40")})}function C5({width:e}){const i=td(a=>a.toggle),r=ac(a=>a.projects),s=r??[],l=s.reduce((a,u)=>a+u.open.length,0),d=s.filter(a=>a.open.some(u=>!u.live)),p=()=>it(()=>Promise.all(d.map(a=>ve.closeOpenSessions(a.id,a.open.filter(u=>!u.live).map(u=>u.id)))));return v.jsxs("aside",{"aria-label":"Live sessions",style:{width:e},className:"flex shrink-0 flex-col border-l bg-background",children:[v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2",children:[v.jsx("span",{className:"text-xs font-semibold",children:"Open sessions"}),v.jsx("span",{className:"grid h-4 min-w-[1rem] place-items-center rounded-full bg-muted px-1 text-[10px] font-semibold leading-none tabular-nums text-muted-foreground",children:l}),v.jsx("div",{className:"flex-1"}),v.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>void p(),disabled:!d.length,title:"Close every stopped session, in every project","aria-label":"Close stopped sessions",children:v.jsx(xg,{size:13})}),v.jsx(xe,{variant:"ghost",size:"icon",onClick:i,title:"Hide this panel","aria-label":"Hide live sessions",children:v.jsx($w,{size:13})})]}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:[r&&!s.length&&v.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No session is open in any project."}),s.map(a=>v.jsx(L9,{project:a},a.id))]})]})}function L9({project:e}){const i=ge(S=>S.projectId),r=ge(S=>S.view),s=ge(S=>S.openProject),l=ge(S=>S.openSessionIn),[d,p]=P.useState(!1),[a,u]=P.useState(!1),[f,g]=P.useState(null),[c,_]=P.useState(null),x=Qh(),C=mn(),y=i===e.id,m=(S,w)=>{if(!S.length)return;const T=async()=>{await ve.closeOpenSessions(e.id,S.map(R=>R.id)),y&&Xh(S.filter(R=>R.live).map(R=>R.id))},D=S.filter(R=>R.live).length;return D?C({title:S.length===1?`Close "${S[0].title}"?`:`Close ${w} in ${e.name}?`,description:`${D===1?"Its terminal stops":`${D} terminals stop`}; the conversation${S.length>1?"s are":" is"} kept for a later resume.`,body:S.length>1?v.jsx("div",{className:"space-y-0.5 text-[11px] text-muted-foreground",children:S.map(R=>v.jsx("div",{className:"truncate",children:R.title},R.id))}):void 0,confirmLabel:"Close",tone:"destructive",run:T}):void it(T)},b=async()=>{if(d)return;p(!0);const S=document.querySelector("main"),w=Math.max(80,Math.floor((((S==null?void 0:S.clientWidth)??window.innerWidth)-40)/7.8)),T=Math.max(24,Math.floor((window.innerHeight-140)/17)),D=await it(()=>ve.startSessionIn(e.id,{cols:w,rows:T}));p(!1),D&&(y&&await ge.getState().refreshSessions(),l(e.id,D.sessionId))};return v.jsxs("div",{className:"px-1.5 py-1",children:[c&&v.jsx(Ov,{project:e,x:c.x,y:c.y,onClose:()=>_(null)}),v.jsxs("div",{className:"group flex items-center gap-1 px-1.5 py-1",onMouseEnter:()=>!y&&Tm(e.id),onContextMenu:S=>{S.preventDefault(),_({x:S.clientX,y:S.clientY})},children:[v.jsx("button",{onClick:()=>s(e.id),title:`Open ${e.name}`,className:ye("min-w-0 flex-1 truncate text-left text-[11px] font-semibold uppercase tracking-wide hover:text-foreground",y?"text-foreground":"text-muted-foreground"),children:e.name}),v.jsxs(Fh,{open:a,onOpenChange:u,align:"end",className:"w-64 p-1",trigger:v.jsx(xe,{variant:"ghost",size:"icon",className:"h-6 w-6",title:`Resume a session of ${e.name}`,"aria-label":"Resume a session",disabled:!e.recent.length,children:v.jsx(i4,{size:12})}),children:[v.jsx("div",{className:"px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Resume"}),e.recent.map(S=>v.jsxs("button",{onClick:()=>{u(!1),l(e.id,S.id)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",children:[v.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.title}),S.lastAt&&v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:fs(S.lastAt)})]},S.id))]}),v.jsx(xe,{variant:"ghost",size:"icon",className:"h-6 w-6",title:`New session in ${e.name}`,"aria-label":"New session",disabled:d,onClick:()=>void b(),children:v.jsx(Qn,{size:12})})]}),e.open.map(S=>{const w=y&&r.kind==="session"&&r.id===S.id,T=()=>l(e.id,S.id);return v.jsxs("div",{role:"button",tabIndex:0,onClick:T,onMouseEnter:()=>!y&&Tm(e.id),onKeyDown:D=>{D.key!=="Enter"&&D.key!==" "||(D.preventDefault(),T())},onContextMenu:D=>{D.preventDefault(),g({session:S,x:D.clientX,y:D.clientY})},title:S.live?S.title:`${S.title} (stopped; opening it resumes it)`,className:ye("group/row flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs",w?"bg-primary/15 text-foreground":"hover:bg-muted",!S.live&&!w&&"text-muted-foreground"),children:[v.jsx(D9,{status:S.status}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.title}),S.openInteractions>0&&v.jsx("span",{className:"grid h-4 min-w-[1rem] place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none tabular-nums text-background",children:S.openInteractions}),v.jsx("button",{onClick:D=>{D.stopPropagation(),m([S],"it")},title:S.live?"Close: stops its terminal, after asking":"Close","aria-label":`Close ${S.title}`,className:"invisible grid h-4 w-4 shrink-0 place-items-center rounded text-muted-foreground hover:bg-foreground/10 hover:text-foreground group-hover/row:visible group-focus-within/row:visible",children:v.jsx(pn,{size:12})})]},S.id)}),f&&v.jsx(w5,{x:f.x,y:f.y,onClose:()=>g(null),items:[["Open",Wl,()=>l(e.id,f.session.id)],["Rename",Wi,()=>void x.rename(f.session,e.id)],["Close",pn,()=>void m([f.session],"it"),!0],["Close Stopped",xg,()=>void m(e.open.filter(S=>!S.live),"the stopped ones"),!1,!e.open.some(S=>!S.live)],["Close Others",Gs,()=>void m(e.open.filter(S=>S.id!==f.session.id),"the others"),!1,e.open.length<2],["Close All",Gs,()=>void m(e.open,"all")]]})]})}function E5({open:e,onOpenChange:i}){const r=ge(x=>x.openProject),[s,l]=P.useState(null),[d,p]=P.useState(""),[a,u]=P.useState(null),[f,g]=P.useState(!1),c=async x=>{try{const C=await ve.folders(x);l(C),p(C.path),u(null)}catch(C){u(C.message)}};P.useEffect(()=>{e&&c(s==null?void 0:s.path)},[e]);const _=async x=>{g(!0);try{const C=await ve.addProject(x);i(!1),r(C.id)}catch(C){u(C.message)}finally{g(!1)}};return v.jsx(rC,{open:e,onOpenChange:i,title:"Open folder",description:"Its sessions, jobs and channels run in the hub from now on.",maxWidth:"max-w-xl",height:"h-[min(36rem,calc(100dvh-2rem))]",footer:v.jsxs(v.Fragment,{children:[v.jsx(xe,{onClick:()=>i(!1),children:"Cancel"}),v.jsx(xe,{variant:"primary",disabled:!d.trim()||f,onClick:()=>void _(d.trim()),children:f?"Opening...":"Open this folder"})]}),children:v.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[v.jsxs("form",{className:"flex gap-1.5",onSubmit:x=>{x.preventDefault(),c(d.trim())},children:[v.jsx(Zn,{value:d,onChange:x=>p(x.target.value),placeholder:"C:\\Source code\\your-repo",className:"font-mono"}),v.jsx(xe,{type:"submit",title:"Go to this folder",children:v.jsx(ya,{size:13})})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[v.jsxs(xe,{variant:"ghost",disabled:!(s!=null&&s.parent),onClick:()=>(s==null?void 0:s.parent)&&void c(s.parent),title:"Up one folder",children:[v.jsx(jw,{size:12})," Up"]}),v.jsxs(xe,{variant:"ghost",onClick:()=>void c(s==null?void 0:s.home),children:[v.jsx(r4,{size:12})," Home"]}),((s==null?void 0:s.drives.length)??0)>1&&s.drives.map(x=>v.jsxs(xe,{variant:"ghost",onClick:()=>void c(x),children:[v.jsx(n4,{size:12})," ",x]},x))]}),a&&v.jsx("div",{className:"text-xs text-severity-critical",children:a}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto rounded-md border",children:s!=null&&s.folders.length?s.folders.map(x=>v.jsxs("button",{onClick:()=>void c(x.path),onDoubleClick:()=>void _(x.path),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs hover:bg-muted",title:x.git?"A git repository. Double-click to open it.":x.path,children:[x.git?v.jsx(Hw,{size:13,className:"shrink-0 text-primary"}):v.jsx(Ks,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.name}),x.git&&v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"git"})]},x.path)):v.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:s?"No folders in here.":"Loading..."})})]})})}function va({className:e}){const i=ge(r=>r.openProject);return v.jsx("button",{onClick:()=>i(fi),title:"Global: every project","aria-label":"Go to Global",className:ye("shrink-0 rounded hover:opacity-80",e),children:v.jsx(q8,{size:20})})}let dw=null;function nd(){const e=ge(s=>s.openProject),[i,r]=P.useState(null);return P.useEffect(()=>{dw??(dw=ve.hub().then(s=>s.version??null).catch(()=>null)),dw.then(r)},[]),v.jsxs("span",{className:"flex items-baseline gap-1.5",children:[v.jsx("button",{onClick:()=>e(fi),title:"Global: every project",className:"text-left text-sm font-semibold leading-tight hover:underline",children:"Clauder Hub"}),i&&v.jsxs("span",{className:"text-[10px] font-normal leading-tight text-muted-foreground/70",children:["v",i]}),v.jsx(M9,{}),v.jsx(A9,{}),v.jsx(X8,{})]})}function M9(){var r;const e=ge(s=>s.projectId),i=ct(()=>ve.channels(),["channels"],e);return!((r=i.data)!=null&&r.paused)||!i.data.channels.length?null:v.jsx("button",{onClick:W6,title:"Notifications are paused on every channel. Click to turn them back on.","aria-label":"Notifications paused",className:"self-center text-severity-warning hover:text-foreground",children:v.jsx(pa,{size:12})})}function Lv(){const e=ge(l=>l.projectId),i=ge(l=>l.openProject),s=(ct(()=>ve.projects(),["projects"]).data??[]).filter(l=>l.id!==e).reduce((l,d)=>l+d.waiting,0);return v.jsxs("button",{onClick:()=>i(fi),className:"flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground",title:"Back to the global home: every project",children:["Change",s>0&&v.jsx("span",{className:"grid h-3.5 min-w-[0.875rem] place-items-center rounded-full bg-severity-warning px-1 text-[9px] font-semibold leading-none tabular-nums text-background",children:s})]})}function Sh({onDrag:e,onReset:i}){const r=P.useRef(0);return v.jsx("div",{role:"separator","aria-orientation":"vertical",title:"Drag to resize, double-click to reset",className:"group relative w-1 shrink-0 cursor-col-resize bg-border/60 transition-colors hover:bg-primary/60",onDoubleClick:i,onPointerDown:s=>{s.preventDefault(),s.currentTarget.setPointerCapture(s.pointerId),r.current=s.clientX,document.body.style.userSelect="none"},onPointerMove:s=>{if(!s.currentTarget.hasPointerCapture(s.pointerId))return;const l=s.clientX-r.current;l&&(r.current=s.clientX,e(l))},onPointerUp:s=>{s.currentTarget.releasePointerCapture(s.pointerId),document.body.style.userSelect=""},onPointerCancel:()=>{document.body.style.userSelect=""},children:v.jsx("span",{className:"absolute inset-y-0 -left-1 -right-1"})})}function k5({tools:e}){const i=iT(e),r={};for(const l of i.mcp){const{server:d,tool:p}=nT(l.name),a=r[d]??(r[d]={count:0,errors:0,tools:[]});a.count+=l.count,a.errors+=l.errors,a.tools.push(`${p} ×${l.count}`)}const s=l=>l.map(d=>({key:d.name,label:d.name,value:d.count,note:d.errors?`${d.errors} failed`:void 0}));return v.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[v.jsx(Lt,{title:`Built-in tools (${i["built-in"].reduce((l,d)=>l+d.count,0)})`,children:v.jsx(as,{rows:s(i["built-in"]),format:String})}),v.jsx(Lt,{title:`MCP servers (${i.mcp.reduce((l,d)=>l+d.count,0)})`,description:"Calls grouped by server; hover a bar for its tools.",children:v.jsx(as,{rows:Object.entries(r).map(([l,d])=>({key:l,label:l,value:d.count,note:d.errors?`${d.errors} failed`:void 0,sublabel:d.tools.slice(0,3).join(", ")})),format:String,empty:"No MCP calls."})})]})}function j9({agent:e}){const[i,r]=P.useState(!1),s=Object.values(e.tools).reduce((l,d)=>l+d.count,0);return v.jsxs("div",{className:"rounded-md border",children:[v.jsxs("button",{className:"flex w-full items-center gap-2 px-2.5 py-2 text-left",onClick:()=>r(!i),style:{paddingLeft:10+(e.depth-1)*16},children:[i?v.jsx(xa,{size:13}):v.jsx(ya,{size:13}),v.jsx(Ow,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:e.agentType}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:e.description}),v.jsxs("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:[s," calls · ",On(os(e.tokens))," tok"]})]}),i&&v.jsxs("div",{className:"grid gap-3 border-t p-3 md:grid-cols-2",children:[v.jsxs("div",{className:"space-y-1 text-[11px] text-muted-foreground",children:[v.jsxs("div",{children:["Model: ",e.model??"inherited",e.fork&&" · fork"]}),v.jsxs("div",{children:[Xs(e.startedAt)," → ",Xs(e.lastAt)]}),v.jsxs("div",{children:["Output ",On(e.tokens.output)," · cache read ",On(e.tokens.cacheRead)]})]}),v.jsx(as,{rows:Object.entries(e.tools).map(([l,d])=>({key:l,label:l,value:d.count})),format:String,limit:6,empty:"No tool calls."}),e.recent.length>0&&v.jsx("div",{className:"md:col-span-2",children:v.jsx(T5,{calls:e.recent.slice(-10)})})]})]})}function T5({calls:e}){return v.jsx("div",{className:"divide-y rounded-md border",children:[...e].reverse().map(i=>v.jsxs("div",{className:"flex items-baseline gap-2 px-2.5 py-1.5 text-[11px]",children:[v.jsx("span",{className:"hidden w-20 shrink-0 whitespace-nowrap tabular-nums text-muted-foreground sm:block",children:i.ts?new Date(i.ts).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}),v.jsx("span",{className:ye("max-w-[60%] shrink-0 truncate font-mono sm:max-w-none",i.error&&"text-severity-critical"),children:i.name.startsWith("mcp__")?i.name.replace(/^mcp__/,"mcp:"):i.name}),v.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:i.summary})]},i.id))})}function O9({data:e}){const i=e.detail;if(!i)return v.jsx("div",{className:"p-6 text-xs text-muted-foreground",children:"Claude has not written anything for this session yet."});const r=i.totals,s=Object.values(r.tools).reduce((l,d)=>l+d.count,0);return v.jsxs("div",{className:"space-y-3",children:[v.jsx(RC,{tokens:r.tokens}),v.jsxs("div",{className:"grid gap-3 lg:grid-cols-3",children:[v.jsx(Lt,{title:"Tokens by model",children:v.jsx(as,{rows:Object.entries(r.tokensByModel).filter(([,l])=>os(l)>0).map(([l,d])=>({key:l,label:l,value:os(d)}))})}),v.jsx(Lt,{title:"Skills & commands",children:v.jsx(as,{rows:Object.entries(i.skills).map(([l,d])=>({key:l,label:l,value:d})),format:String,empty:"No skills used."})}),v.jsx(Lt,{title:"Shape",children:v.jsxs("div",{className:"space-y-1 text-xs",children:[v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Prompts"}),v.jsx("span",{className:"tabular-nums",children:e.session.turns??0})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Tool calls (all agents)"}),v.jsx("span",{className:"tabular-nums",children:s})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Subagents"}),v.jsx("span",{className:"tabular-nums",children:i.subagents.length})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Branch"}),v.jsx("span",{className:"font-mono text-[11px]",children:e.session.gitBranch??"-"})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Permission mode"}),v.jsx("span",{children:e.session.permissionMode??"-"})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Claude Code"}),v.jsx("span",{children:e.session.version??"-"})]})]})})]}),v.jsx(k5,{tools:r.tools}),v.jsx(Lt,{title:`Subagents (${i.subagents.length})`,description:"Each one's own tokens and calls; a fork's inherited context is counted once, on its parent.",children:i.subagents.length?v.jsx("div",{className:"space-y-1.5",children:i.subagents.map(l=>v.jsx(j9,{agent:l},l.id))}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No subagents."})}),v.jsx(Lt,{title:"Recent calls (main thread)",children:i.recent.length?v.jsx(T5,{calls:i.recent.slice(-40)}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No tool calls yet."})})]})}const N9=(e,i)=>JSON.stringify(e)===JSON.stringify(i),pm=e=>e.variables.length?e:{...e,variables:[{name:"",value:""}]};function B9({sessionId:e,live:i,current:r}){const s=mn(),[l,d]=P.useState(()=>pm(r));P.useEffect(()=>d(pm(r)),[JSON.stringify(r)]);const p={notes:l.notes.trim(),variables:l.variables.map(g=>({name:g.name.trim(),value:g.value.trim()})).filter(g=>g.name)},a=!N9(p,r),u=(g,c)=>d({...l,variables:l.variables.map((_,x)=>x===g?{..._,...c}:_)}),f=()=>s({title:i?"Save and restart this session?":"Save this setup?",description:i?"Restarts it on the same conversation.":"Applies on the next resume.",confirmLabel:i?"Save & restart":"Save",tone:i?"destructive":"primary",run:async()=>{await ve.setSessionSetup(e,p),ge.getState().notify(i?"Restarting with the new setup.":"Saved.")}});return v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("h2",{className:"text-sm font-semibold",children:"Setup"}),v.jsx("p",{className:"truncate text-[11px] text-muted-foreground",children:"For this session only, appended to its system prompt. Applies at start-up."})]}),v.jsxs("div",{className:"flex gap-1.5",children:[v.jsx(xe,{disabled:!a,onClick:()=>d(pm(r)),children:"Reset"}),v.jsx(xe,{variant:"primary",disabled:!a,onClick:()=>void f(),children:i?"Save & restart":"Save"})]})]}),v.jsxs("section",{className:"space-y-1.5",children:[v.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Notes"}),v.jsx(oc,{rows:10,defaultMode:"edit",value:l.notes,onChange:g=>d({...l,notes:g})})]}),v.jsxs("section",{className:"space-y-1.5",children:[v.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Names"}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Short names you use in this session and what each stands for, e.g. OUT → C:\\reports\\2026."}),l.variables.map((g,c)=>v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(Zn,{className:"w-48 shrink-0 font-mono",placeholder:"Name",value:g.name,onChange:_=>u(c,{name:_.target.value})}),v.jsx(Zn,{className:"min-w-0 flex-1",placeholder:"What it stands for",value:g.value,onChange:_=>u(c,{value:_.target.value})}),v.jsx(xe,{variant:"ghost",size:"icon",title:"Remove",onClick:()=>d({...l,variables:l.variables.filter((_,x)=>x!==c)}),children:v.jsx(pn,{size:13})})]},c)),v.jsxs(xe,{variant:"ghost",onClick:()=>d({...l,variables:[...l.variables,{name:"",value:""}]}),children:[v.jsx(Qn,{size:12})," Add a name"]})]})]})}function Mv({title:e,subtitle:i,badge:r,mono:s,defaultOpen:l,children:d}){const[p,a]=P.useState(!!l);return v.jsxs("div",{className:"rounded-md bg-muted/30",children:[v.jsxs("button",{onClick:()=>a(!p),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50",children:[v.jsx(ya,{size:13,className:ye("shrink-0 transition-transform",p&&"rotate-90")}),v.jsxs("span",{className:"min-w-0 flex-1",children:[v.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[v.jsx("span",{className:ye("min-w-0 truncate text-xs font-medium",s&&"font-mono"),title:typeof e=="string"?e:void 0,children:e}),r&&v.jsx("span",{className:"shrink-0",children:r})]}),i&&v.jsx("span",{className:"block truncate text-[11px] text-muted-foreground",children:i})]})]}),p&&v.jsx("div",{className:"bg-muted/20 px-3 py-2",children:d})]})}function ds(){return v.jsx(nt,{tone:"on",className:"px-1 py-0 text-[9px] leading-[14px]",title:"Applies to every project on this machine, not only this one.",children:"global"})}const P9=[{kind:"plugins",title:"Plugins"},{kind:"agents",title:"Agents"},{kind:"skills",title:"Skills"},{kind:"mcp",title:"MCP servers"}];function I9({on:e,disabled:i,onToggle:r}){return v.jsx("button",{role:"switch","aria-checked":e,disabled:i,onClick:r,className:ye("relative h-4 w-7 shrink-0 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-40",e?"bg-primary":"bg-foreground/20"),children:v.jsx("span",{className:ye("absolute top-0.5 h-3 w-3 rounded-full bg-background transition-all",e?"left-3.5":"left-0.5")})})}function R5({catalog:e,value:i,onChange:r}){const[s,l]=P.useState(""),d=P.useMemo(()=>new Set(e.filter(g=>g.kind==="plugins"&&g.scope==="user").map(g=>g.id)),[e]),p=g=>g.scope==="user"||g.scope==="plugin"&&!!(g.plugin&&d.has(g.plugin)),a=g=>{const c=i[g.kind];r({...i,[g.kind]:c.includes(g.id)?c.filter(_=>_!==g.id):[...c,g.id]})},u=(g,c,_)=>{const x=new Set(_.map(y=>y.id)),C=i[g].filter(y=>!x.has(y));r({...i,[g]:c?C:[...C,...x]})},f=s.trim().toLowerCase();return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"relative",children:[v.jsx(Rh,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(Zn,{value:s,onChange:g=>l(g.target.value),placeholder:"Filter",className:"pl-6"})]}),P9.map(({kind:g,title:c})=>{const _=e.filter(y=>y.kind===g);if(!_.length)return null;const x=f?_.filter(y=>`${y.label} ${y.description}`.toLowerCase().includes(f)):_,C=_.filter(y=>i[g].includes(y.id)||y.plugin&&i.plugins.includes(y.plugin)).length;return v.jsxs(Mv,{title:c,badge:v.jsx(nt,{tone:C?"warning":"off",children:C?`${C} of ${_.length} off`:`${_.length} on`}),defaultOpen:!0,children:[v.jsxs("div",{className:"mb-1.5 flex gap-3 text-[11px] text-muted-foreground",children:[v.jsx("button",{className:"hover:text-foreground",onClick:()=>u(g,!0,x),children:"All on"}),v.jsx("button",{className:"hover:text-foreground",onClick:()=>u(g,!1,x),children:"All off"})]}),x.length?v.jsx("div",{className:"divide-y rounded-md border bg-background",children:x.map(y=>{const m=!!(y.plugin&&i.plugins.includes(y.plugin)),b=!m&&!i[g].includes(y.id);return v.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[v.jsx(I9,{on:b,disabled:m,onToggle:()=>a(y)}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px] text-foreground",children:y.label}),p(y)&&v.jsx(ds,{})]}),y.description&&v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:y.description})]}),m?v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"off with its plugin"}):!y.leavesContext&&v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",title:"Turning this off blocks its use; Claude may still see it listed.",children:"blocks use only"}),v.jsx("span",{className:"hidden w-16 shrink-0 text-right text-[10px] text-muted-foreground sm:block",children:y.scope})]},y.id)})}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No match."})]},g)})]})}function Ch(e){return e.agents.length+e.skills.length+e.mcp.length+e.plugins.length}const z9=(e,i)=>JSON.stringify(e)===JSON.stringify(i);function H9({sessionId:e,live:i,current:r}){const s=mn(),l=ct(()=>ve.toolsetCatalog(),[]),d=ct(()=>ve.presets(),["jobs"]),[p,a]=P.useState(r),u=P.useRef("");P.useEffect(()=>a(r),[JSON.stringify(r)]);const f=!z9(p,r),g=()=>s({title:i?"Apply and restart this session?":"Save this toolset?",description:i?"Restarts it on the same conversation.":"Applies on the next resume.",confirmLabel:i?"Apply & restart":"Save",tone:i?"destructive":"primary",run:async()=>{await ve.setSessionToolset(e,p),ge.getState().notify(i?"Restarting with the new toolset.":"Saved.")}}),c=()=>(u.current="",s({title:"Save as a preset",description:"Reusable by jobs and new sessions.",body:v.jsx(Zn,{autoFocus:!0,placeholder:"Preset name, e.g. Frontend only",onChange:_=>u.current=_.target.value}),confirmLabel:"Save preset",run:async()=>{await ve.savePreset({name:u.current,toolset:p}),ge.getState().notify("Preset saved."),d.reload()}}));return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("h2",{className:"text-sm font-semibold",children:"Toolset"}),v.jsxs("p",{className:"truncate text-[11px] text-muted-foreground",children:[Ch(r)?`${Ch(r)} turned off for this session.`:"Everything is on."," Applies at start-up."]})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.data&&d.data.length>0&&v.jsxs(ca,{value:"",onValueChange:_=>{var C;const x=(C=d.data)==null?void 0:C.find(y=>y.id===_);x&&a(x.toolset)},className:"w-40",children:[v.jsx(En,{value:"",children:"Use a preset..."}),d.data.map(_=>v.jsxs(En,{value:_.id,children:[_.name,_.isDefault?" (default)":""]},_.id))]}),v.jsx(xe,{onClick:()=>void c(),children:"Save as preset"}),f&&v.jsx(xe,{onClick:()=>a(r),children:"Discard"}),v.jsx(xe,{variant:"primary",disabled:!f,onClick:()=>void g(),children:i?"Apply & restart":"Save"})]})]}),l.data?v.jsx(R5,{catalog:l.data,value:p,onChange:a}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})]})}var mm={exports:{}},fw;function F9(){return fw||(fw=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const d=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(d._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,d=l._renderService.dimensions;if(d.css.cell.width===0||d.css.cell.height===0)return;const p=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(a.getPropertyValue("height")),f=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),c=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),_=f-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-p;return{cols:Math.max(2,Math.floor(_/d.css.cell.width)),rows:Math.max(1,Math.floor(c/d.css.cell.height))}}}})(),r})()))})(mm)),mm.exports}var U9=F9(),gm={exports:{}},pw;function $9(){return pw||(pw=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={345:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const g=[];for(let c=0;c<this._listeners.length;c++)g.push(this._listeners[c]);for(let c=0;c<g.length;c++)g[c].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,f){return u((g=>f.fire(g)))},a.runAndSubscribe=function(u,f){return f(void 0),u((g=>f(g)))}},859:(p,a)=>{function u(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},a.toDisposable=function(f){return{dispose:f}},a.disposeArray=u,a.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var u=s[p]={exports:{}};return r[p](u,u.exports,l),u.exports}var d={};return(()=>{var p=d;Object.defineProperty(p,"__esModule",{value:!0}),p.SearchAddon=void 0;const a=l(345),u=l(859),f=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class g extends u.Disposable{constructor(_){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new u.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new u.MutableDisposable,this._onDidChangeResults=this.register(new a.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(_==null?void 0:_.highlightLimit)??1e3}activate(_){this._terminal=_,this.register(this._terminal.onWriteParsed((()=>this._updateMatches()))),this.register(this._terminal.onResize((()=>this._updateMatches()))),this.register((0,u.toDisposable)((()=>this.clearDecorations())))}_updateMatches(){var _;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((_=this._lastSearchOptions)!=null&&_.decorations)&&(this._highlightTimeout=setTimeout((()=>{const x=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(x,{...this._lastSearchOptions,incremental:!0,noScroll:!0})}),200))}clearDecorations(_){this._selectedDecoration.clear(),(0,u.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),_||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(_,x){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const C=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,x);this._lastSearchOptions=x,x!=null&&x.decorations&&(this._cachedSearchTerm===void 0||_!==this._cachedSearchTerm||C)&&this._highlightAllMatches(_,x);const y=this._findNextAndSelect(_,x);return this._fireResults(x),this._cachedSearchTerm=_,y}_highlightAllMatches(_,x){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!_||_.length===0)return void this.clearDecorations();x=x||{},this.clearDecorations(!0);const C=[];let y,m=this._find(_,0,0,x);for(;m&&((y==null?void 0:y.row)!==m.row||(y==null?void 0:y.col)!==m.col)&&!(C.length>=this._highlightLimit);)y=m,C.push(y),m=this._find(_,y.col+y.term.length>=this._terminal.cols?y.row+1:y.row,y.col+y.term.length>=this._terminal.cols?0:y.col+1,x);for(const b of C){const S=this._createResultDecoration(b,x.decorations);S&&(this._highlightedLines.add(S.marker.line),this._highlightDecorations.push({decoration:S,match:b,dispose(){S.dispose()}}))}}_find(_,x,C,y){var S;if(!this._terminal||!_||_.length===0)return(S=this._terminal)==null||S.clearSelection(),void this.clearDecorations();if(C>this._terminal.cols)throw new Error(`Invalid col: ${C} to search in terminal of ${this._terminal.cols} cols`);let m;this._initLinesCache();const b={startRow:x,startCol:C};if(m=this._findInLine(_,b,y),!m)for(let w=x+1;w<this._terminal.buffer.active.baseY+this._terminal.rows&&(b.startRow=w,b.startCol=0,m=this._findInLine(_,b,y),!m);w++);return m}_findNextAndSelect(_,x){var w;if(!this._terminal||!_||_.length===0)return(w=this._terminal)==null||w.clearSelection(),this.clearDecorations(),!1;const C=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=0,m=0;C&&(this._cachedSearchTerm===_?(y=C.end.x,m=C.end.y):(y=C.start.x,m=C.start.y)),this._initLinesCache();const b={startRow:m,startCol:y};let S=this._findInLine(_,b,x);if(!S)for(let T=m+1;T<this._terminal.buffer.active.baseY+this._terminal.rows&&(b.startRow=T,b.startCol=0,S=this._findInLine(_,b,x),!S);T++);if(!S&&m!==0)for(let T=0;T<m&&(b.startRow=T,b.startCol=0,S=this._findInLine(_,b,x),!S);T++);return!S&&C&&(b.startRow=C.start.y,b.startCol=0,S=this._findInLine(_,b,x)),this._selectResult(S,x==null?void 0:x.decorations,x==null?void 0:x.noScroll)}findPrevious(_,x){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const C=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,x);this._lastSearchOptions=x,x!=null&&x.decorations&&(this._cachedSearchTerm===void 0||_!==this._cachedSearchTerm||C)&&this._highlightAllMatches(_,x);const y=this._findPreviousAndSelect(_,x);return this._fireResults(x),this._cachedSearchTerm=_,y}_didOptionsChange(_,x){return!!x&&(_.caseSensitive!==x.caseSensitive||_.regex!==x.regex||_.wholeWord!==x.wholeWord)}_fireResults(_){if(_!=null&&_.decorations){let x=-1;if(this._selectedDecoration.value){const C=this._selectedDecoration.value.match;for(let y=0;y<this._highlightDecorations.length;y++){const m=this._highlightDecorations[y].match;if(m.row===C.row&&m.col===C.col&&m.size===C.size){x=y;break}}}this._onDidChangeResults.fire({resultIndex:x,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(_,x){var T;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!_||_.length===0)return(T=this._terminal)==null||T.clearSelection(),this.clearDecorations(),!1;const C=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=this._terminal.buffer.active.baseY+this._terminal.rows-1,m=this._terminal.cols;const b=!0;this._initLinesCache();const S={startRow:y,startCol:m};let w;if(C&&(S.startRow=y=C.start.y,S.startCol=m=C.start.x,this._cachedSearchTerm!==_&&(w=this._findInLine(_,S,x,!1),w||(S.startRow=y=C.end.y,S.startCol=m=C.end.x))),w||(w=this._findInLine(_,S,x,b)),!w){S.startCol=Math.max(S.startCol,this._terminal.cols);for(let D=y-1;D>=0&&(S.startRow=D,w=this._findInLine(_,S,x,b),!w);D--);}if(!w&&y!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let D=this._terminal.buffer.active.baseY+this._terminal.rows-1;D>=y&&(S.startRow=D,w=this._findInLine(_,S,x,b),!w);D--);return this._selectResult(w,x==null?void 0:x.decorations,x==null?void 0:x.noScroll)}_initLinesCache(){const _=this._terminal;this._linesCache||(this._linesCache=new Array(_.buffer.active.length),this._linesCacheDisposables.value=(0,u.getDisposeArrayDisposable)([_.onLineFeed((()=>this._destroyLinesCache())),_.onCursorMove((()=>this._destroyLinesCache())),_.onResize((()=>this._destroyLinesCache()))])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout((()=>this._destroyLinesCache()),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(_,x,C){return(_===0||f.includes(x[_-1]))&&(_+C.length===x.length||f.includes(x[_+C.length]))}_findInLine(_,x,C={},y=!1){var I;const m=this._terminal,b=x.startRow,S=x.startCol,w=m.buffer.active.getLine(b);if(w!=null&&w.isWrapped)return y?void(x.startCol+=m.cols):(x.startRow--,x.startCol+=m.cols,this._findInLine(_,x,C));let T=(I=this._linesCache)==null?void 0:I[b];T||(T=this._translateBufferLineToStringWithWrap(b,!0),this._linesCache&&(this._linesCache[b]=T));const[D,R]=T,L=this._bufferColsToStringOffset(b,S),A=C.caseSensitive?_:_.toLowerCase(),j=C.caseSensitive?D:D.toLowerCase();let M=-1;if(C.regex){const B=RegExp(A,"g");let H;if(y)for(;H=B.exec(j.slice(0,L));)M=B.lastIndex-H[0].length,_=H[0],B.lastIndex-=_.length-1;else H=B.exec(j.slice(L)),H&&H[0].length>0&&(M=L+(B.lastIndex-H[0].length),_=H[0])}else y?L-A.length>=0&&(M=j.lastIndexOf(A,L-A.length)):M=j.indexOf(A,L);if(M>=0){if(C.wholeWord&&!this._isWholeWord(M,j,_))return;let B=0;for(;B<R.length-1&&M>=R[B+1];)B++;let H=B;for(;H<R.length-1&&M+_.length>=R[H+1];)H++;const F=M-R[B],W=M+_.length-R[H],G=this._stringLengthToBufferSize(b+B,F);return{term:_,col:G,row:b+B,size:this._stringLengthToBufferSize(b+H,W)-G+m.cols*(H-B)}}}_stringLengthToBufferSize(_,x){const C=this._terminal.buffer.active.getLine(_);if(!C)return 0;for(let y=0;y<x;y++){const m=C.getCell(y);if(!m)break;const b=m.getChars();b.length>1&&(x-=b.length-1);const S=C.getCell(y+1);S&&S.getWidth()===0&&x++}return x}_bufferColsToStringOffset(_,x){const C=this._terminal;let y=_,m=0,b=C.buffer.active.getLine(y);for(;x>0&&b;){for(let S=0;S<x&&S<C.cols;S++){const w=b.getCell(S);if(!w)break;w.getWidth()&&(m+=w.getCode()===0?1:w.getChars().length)}if(y++,b=C.buffer.active.getLine(y),b&&!b.isWrapped)break;x-=C.cols}return m}_translateBufferLineToStringWithWrap(_,x){var S;const C=this._terminal,y=[],m=[0];let b=C.buffer.active.getLine(_);for(;b;){const w=C.buffer.active.getLine(_+1),T=!!w&&w.isWrapped;let D=b.translateToString(!T&&x);if(T&&w){const R=b.getCell(b.length-1);R&&R.getCode()===0&&R.getWidth()===1&&((S=w.getCell(0))==null?void 0:S.getWidth())===2&&(D=D.slice(0,-1))}if(y.push(D),!T)break;m.push(m[m.length-1]+D.length),_++,b=w}return[y.join(""),m]}_selectResult(_,x,C){const y=this._terminal;if(this._selectedDecoration.clear(),!_)return y.clearSelection(),!1;if(y.select(_.col,_.row,_.size),x){const m=y.registerMarker(-y.buffer.active.baseY-y.buffer.active.cursorY+_.row);if(m){const b=y.registerDecoration({marker:m,x:_.col,width:_.size,backgroundColor:x.activeMatchBackground,layer:"top",overviewRulerOptions:{color:x.activeMatchColorOverviewRuler}});if(b){const S=[];S.push(m),S.push(b.onRender((w=>this._applyStyles(w,x.activeMatchBorder,!0)))),S.push(b.onDispose((()=>(0,u.disposeArray)(S)))),this._selectedDecoration.value={decoration:b,match:_,dispose(){b.dispose()}}}}}if(!C&&(_.row>=y.buffer.active.viewportY+y.rows||_.row<y.buffer.active.viewportY)){let m=_.row-y.buffer.active.viewportY;m-=Math.floor(y.rows/2),y.scrollLines(m)}return!0}_applyStyles(_,x,C){_.classList.contains("xterm-find-result-decoration")||(_.classList.add("xterm-find-result-decoration"),x&&(_.style.outline=`1px solid ${x}`)),C&&_.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(_,x){const C=this._terminal,y=C.registerMarker(-C.buffer.active.baseY-C.buffer.active.cursorY+_.row);if(!y)return;const m=C.registerDecoration({marker:y,x:_.col,width:_.size,backgroundColor:x.matchBackground,overviewRulerOptions:this._highlightedLines.has(y.line)?void 0:{color:x.matchOverviewRuler,position:"center"}});if(m){const b=[];b.push(y),b.push(m.onRender((S=>this._applyStyles(S,x.matchBorder,!1)))),b.push(m.onDispose((()=>(0,u.disposeArray)(b))))}return m}}p.SearchAddon=g})(),d})()))})(gm)),gm.exports}var q9=$9(),ah={exports:{}},V9=ah.exports,mw;function W9(){return mw||(mw=1,(function(e,i){(function(r,s){e.exports=s()})(V9,(()=>(()=>{var r={433:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV11=void 0;const f=u(938),g=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],c=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],_=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],x=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let C;function y(m,b){let S,w=0,T=b.length-1;if(m<b[0][0]||m>b[T][1])return!1;for(;T>=w;)if(S=w+T>>1,m>b[S][1])w=S+1;else{if(!(m<b[S][0]))return!0;T=S-1}return!1}a.UnicodeV11=class{constructor(){if(this.version="11",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160);for(let m=0;m<g.length;++m)C.fill(0,g[m][0],g[m][1]+1);for(let m=0;m<_.length;++m)C.fill(2,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?C[m]:y(m,c)?0:y(m,x)?2:1}charProperties(m,b){let S=this.wcwidth(m),w=S===0&&b!==0;if(w){const T=f.UnicodeService.extractWidth(b);T===0?w=!1:T>S&&(S=T)}return f.UnicodeService.createPropertyValue(0,S,w)}}},345:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const g=[];for(let c=0;c<this._listeners.length;c++)g.push(this._listeners[c]);for(let c=0;c<g.length;c++)g[c].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,f){return u((g=>f.fire(g)))},a.runAndSubscribe=function(u,f){return f(void 0),u((g=>f(g)))}},490:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const f=u(938),g=[[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]],c=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;a.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<g.length;++x)_.fill(0,g[x][0],g[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(C,y){let m,b=0,S=y.length-1;if(C<y[0][0]||C>y[S][1])return!1;for(;S>=b;)if(m=b+S>>1,C>y[m][1])b=m+1;else{if(!(C<y[m][0]))return!0;S=m-1}return!1})(x,c)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let y=this.wcwidth(x),m=y===0&&C!==0;if(m){const b=f.UnicodeService.extractWidth(C);b===0?m=!1:b>y&&(y=b)}return f.UnicodeService.createPropertyValue(0,y,m)}}},938:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const f=u(345),g=u(490);class c{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,y=!1){return(16777215&x)<<3|(3&C)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const x=new g.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,y=0;const m=x.length;for(let b=0;b<m;++b){let S=x.charCodeAt(b);if(55296<=S&&S<=56319){if(++b>=m)return C+this.wcwidth(S);const D=x.charCodeAt(b);56320<=D&&D<=57343?S=1024*(S-55296)+D-56320+65536:C+=this.wcwidth(D)}const w=this.charProperties(S,y);let T=c.extractWidth(w);c.extractShouldJoin(w)&&(T-=c.extractWidth(y)),C+=T,y=w}return C}charProperties(x,C){return this._activeProvider.charProperties(x,C)}}a.UnicodeService=c}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var u=s[p]={exports:{}};return r[p](u,u.exports,l),u.exports}var d={};return(()=>{var p=d;Object.defineProperty(p,"__esModule",{value:!0}),p.Unicode11Addon=void 0;const a=l(433);p.Unicode11Addon=class{activate(u){u.unicode.register(new a.UnicodeV11)}dispose(){}}})(),d})()))})(ah)),ah.exports}var G9=W9(),vm={exports:{}},gw;function Y9(){return gw||(gw=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={6:(p,a)=>{function u(g){try{const c=new URL(g),_=c.password&&c.username?`${c.protocol}//${c.username}:${c.password}@${c.host}`:c.username?`${c.protocol}//${c.username}@${c.host}`:`${c.protocol}//${c.host}`;return g.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(g,c,_,x={}){this._terminal=g,this._regex=c,this._handler=_,this._options=x}provideLinks(g,c){const _=f.computeLink(g,this._regex,this._terminal,this._handler);c(this._addCallbacks(_))}_addCallbacks(g){return g.map((c=>(c.leave=this._options.leave,c.hover=(_,x)=>{if(this._options.hover){const{range:C}=c;this._options.hover(_,x,C)}},c)))}};class f{static computeLink(c,_,x,C){const y=new RegExp(_.source,(_.flags||"")+"g"),[m,b]=f._getWindowedLineStrings(c-1,x),S=m.join("");let w;const T=[];for(;w=y.exec(S);){const D=w[0];if(!u(D))continue;const[R,L]=f._mapStrIdx(x,b,0,w.index),[A,j]=f._mapStrIdx(x,R,L,D.length);if(R===-1||L===-1||A===-1||j===-1)continue;const M={start:{x:L+1,y:R+1},end:{x:j,y:A+1}};T.push({range:M,text:D,activate:C})}return T}static _getWindowedLineStrings(c,_){let x,C=c,y=c,m=0,b="";const S=[];if(x=_.buffer.active.getLine(c)){const w=x.translateToString(!0);if(x.isWrapped&&w[0]!==" "){for(m=0;(x=_.buffer.active.getLine(--C))&&m<2048&&(b=x.translateToString(!0),m+=b.length,S.push(b),x.isWrapped&&b.indexOf(" ")===-1););S.reverse()}for(S.push(w),m=0;(x=_.buffer.active.getLine(++y))&&x.isWrapped&&m<2048&&(b=x.translateToString(!0),m+=b.length,S.push(b),b.indexOf(" ")===-1););}return[S,C]}static _mapStrIdx(c,_,x,C){const y=c.buffer.active,m=y.getNullCell();let b=x;for(;C;){const S=y.getLine(_);if(!S)return[-1,-1];for(let w=b;w<S.length;++w){S.getCell(w,m);const T=m.getChars();if(m.getWidth()&&(C-=T.length||1,w===S.length-1&&T==="")){const D=y.getLine(_+1);D&&D.isWrapped&&(D.getCell(0,m),m.getWidth()===2&&(C+=1))}if(C<0)return[_,w]}_++,b=0}return[_,b]}}a.LinkComputer=f}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var u=s[p]={exports:{}};return r[p](u,u.exports,l),u.exports}var d={};return(()=>{var p=d;Object.defineProperty(p,"__esModule",{value:!0}),p.WebLinksAddon=void 0;const a=l(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(g,c){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}p.WebLinksAddon=class{constructor(g=f,c={}){this._handler=g,this._options=c}activate(g){this._terminal=g;const c=this._options,_=c.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,_,this._handler,c))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),d})()))})(vm)),vm.exports}var K9=Y9(),_m={exports:{}},vw;function X9(){return vw||(vw=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={965:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GlyphRenderer=void 0;const f=u(374),g=u(509),c=u(855),_=u(859),x=u(381),C=11,y=C*Float32Array.BYTES_PER_ELEMENT;let m,b=0,S=0,w=0;class T extends _.Disposable{constructor(R,L,A,j){super(),this._terminal=R,this._gl=L,this._dimensions=A,this._optionsService=j,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const M=this._gl;g.TextureAtlas.maxAtlasPages===void 0&&(g.TextureAtlas.maxAtlasPages=Math.min(32,(0,f.throwIfFalsy)(M.getParameter(M.MAX_TEXTURE_IMAGE_UNITS))),g.TextureAtlas.maxTextureSize=(0,f.throwIfFalsy)(M.getParameter(M.MAX_TEXTURE_SIZE))),this._program=(0,f.throwIfFalsy)((0,x.createProgram)(M,`#version 300 es
564
- layout (location = 0) in vec2 a_unitquad;
565
- layout (location = 1) in vec2 a_cellpos;
566
- layout (location = 2) in vec2 a_offset;
567
- layout (location = 3) in vec2 a_size;
568
- layout (location = 4) in float a_texpage;
569
- layout (location = 5) in vec2 a_texcoord;
570
- layout (location = 6) in vec2 a_texsize;
571
-
572
- uniform mat4 u_projection;
573
- uniform vec2 u_resolution;
574
-
575
- out vec2 v_texcoord;
576
- flat out int v_texpage;
577
-
578
- void main() {
579
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
580
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
581
- v_texpage = int(a_texpage);
582
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
583
- }`,(function(G){let Q="";for(let X=1;X<G;X++)Q+=` else if (v_texpage == ${X}) { outColor = texture(u_texture[${X}], v_texcoord); }`;return`#version 300 es
584
- precision lowp float;
585
-
586
- in vec2 v_texcoord;
587
- flat in int v_texpage;
588
-
589
- uniform sampler2D u_texture[${G}];
590
-
591
- out vec4 outColor;
592
-
593
- void main() {
594
- if (v_texpage == 0) {
595
- outColor = texture(u_texture[0], v_texcoord);
596
- } ${Q}
597
- }`})(g.TextureAtlas.maxAtlasPages))),this.register((0,_.toDisposable)((()=>M.deleteProgram(this._program)))),this._projectionLocation=(0,f.throwIfFalsy)(M.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,f.throwIfFalsy)(M.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,f.throwIfFalsy)(M.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=M.createVertexArray(),M.bindVertexArray(this._vertexArrayObject);const I=new Float32Array([0,0,1,0,0,1,1,1]),B=M.createBuffer();this.register((0,_.toDisposable)((()=>M.deleteBuffer(B)))),M.bindBuffer(M.ARRAY_BUFFER,B),M.bufferData(M.ARRAY_BUFFER,I,M.STATIC_DRAW),M.enableVertexAttribArray(0),M.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const H=new Uint8Array([0,1,2,3]),F=M.createBuffer();this.register((0,_.toDisposable)((()=>M.deleteBuffer(F)))),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,F),M.bufferData(M.ELEMENT_ARRAY_BUFFER,H,M.STATIC_DRAW),this._attributesBuffer=(0,f.throwIfFalsy)(M.createBuffer()),this.register((0,_.toDisposable)((()=>M.deleteBuffer(this._attributesBuffer)))),M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.enableVertexAttribArray(2),M.vertexAttribPointer(2,2,M.FLOAT,!1,y,0),M.vertexAttribDivisor(2,1),M.enableVertexAttribArray(3),M.vertexAttribPointer(3,2,M.FLOAT,!1,y,2*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(3,1),M.enableVertexAttribArray(4),M.vertexAttribPointer(4,1,M.FLOAT,!1,y,4*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(4,1),M.enableVertexAttribArray(5),M.vertexAttribPointer(5,2,M.FLOAT,!1,y,5*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(5,1),M.enableVertexAttribArray(6),M.vertexAttribPointer(6,2,M.FLOAT,!1,y,7*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(6,1),M.enableVertexAttribArray(1),M.vertexAttribPointer(1,2,M.FLOAT,!1,y,9*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(1,1),M.useProgram(this._program);const W=new Int32Array(g.TextureAtlas.maxAtlasPages);for(let G=0;G<g.TextureAtlas.maxAtlasPages;G++)W[G]=G;M.uniform1iv(this._textureLocation,W),M.uniformMatrix4fv(this._projectionLocation,!1,x.PROJECTION_MATRIX),this._atlasTextures=[];for(let G=0;G<g.TextureAtlas.maxAtlasPages;G++){const Q=new x.GLTexture((0,f.throwIfFalsy)(M.createTexture()));this.register((0,_.toDisposable)((()=>M.deleteTexture(Q.texture)))),M.activeTexture(M.TEXTURE0+G),M.bindTexture(M.TEXTURE_2D,Q.texture),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_S,M.CLAMP_TO_EDGE),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_T,M.CLAMP_TO_EDGE),M.texImage2D(M.TEXTURE_2D,0,M.RGBA,1,1,0,M.RGBA,M.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[G]=Q}M.enable(M.BLEND),M.blendFunc(M.SRC_ALPHA,M.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(R,L,A,j,M,I,B,H,F){this._updateCell(this._vertices.attributes,R,L,A,j,M,I,B,H,F)}_updateCell(R,L,A,j,M,I,B,H,F,W){b=(A*this._terminal.cols+L)*C,j!==c.NULL_CELL_CODE&&j!==void 0?this._atlas&&(m=H&&H.length>1?this._atlas.getRasterizedGlyphCombinedChar(H,M,I,B,!1):this._atlas.getRasterizedGlyph(j,M,I,B,!1),S=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),M!==W&&m.offset.x>S?(w=m.offset.x-S,R[b]=-(m.offset.x-w)+this._dimensions.device.char.left,R[b+1]=-m.offset.y+this._dimensions.device.char.top,R[b+2]=(m.size.x-w)/this._dimensions.device.canvas.width,R[b+3]=m.size.y/this._dimensions.device.canvas.height,R[b+4]=m.texturePage,R[b+5]=m.texturePositionClipSpace.x+w/this._atlas.pages[m.texturePage].canvas.width,R[b+6]=m.texturePositionClipSpace.y,R[b+7]=m.sizeClipSpace.x-w/this._atlas.pages[m.texturePage].canvas.width,R[b+8]=m.sizeClipSpace.y):(R[b]=-m.offset.x+this._dimensions.device.char.left,R[b+1]=-m.offset.y+this._dimensions.device.char.top,R[b+2]=m.size.x/this._dimensions.device.canvas.width,R[b+3]=m.size.y/this._dimensions.device.canvas.height,R[b+4]=m.texturePage,R[b+5]=m.texturePositionClipSpace.x,R[b+6]=m.texturePositionClipSpace.y,R[b+7]=m.sizeClipSpace.x,R[b+8]=m.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,f.allowRescaling)(j,F,m.size.x,this._dimensions.device.cell.width)&&(R[b+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):R.fill(0,b,b+C-1-2)}clear(){const R=this._terminal,L=R.cols*R.rows*C;this._vertices.count!==L?this._vertices.attributes=new Float32Array(L):this._vertices.attributes.fill(0);let A=0;for(;A<this._vertices.attributesBuffers.length;A++)this._vertices.count!==L?this._vertices.attributesBuffers[A]=new Float32Array(L):this._vertices.attributesBuffers[A].fill(0);this._vertices.count=L,A=0;for(let j=0;j<R.rows;j++)for(let M=0;M<R.cols;M++)this._vertices.attributes[A+9]=M/R.cols,this._vertices.attributes[A+10]=j/R.rows,A+=C}handleResize(){const R=this._gl;R.useProgram(this._program),R.viewport(0,0,R.canvas.width,R.canvas.height),R.uniform2f(this._resolutionLocation,R.canvas.width,R.canvas.height),this.clear()}render(R){if(!this._atlas)return;const L=this._gl;L.useProgram(this._program),L.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const A=this._vertices.attributesBuffers[this._activeBuffer];let j=0;for(let M=0;M<R.lineLengths.length;M++){const I=M*this._terminal.cols*C,B=this._vertices.attributes.subarray(I,I+R.lineLengths[M]*C);A.set(B,j),j+=B.length}L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.bufferData(L.ARRAY_BUFFER,A.subarray(0,j),L.STREAM_DRAW);for(let M=0;M<this._atlas.pages.length;M++)this._atlas.pages[M].version!==this._atlasTextures[M].version&&this._bindAtlasPageTexture(L,this._atlas,M);L.drawElementsInstanced(L.TRIANGLE_STRIP,4,L.UNSIGNED_BYTE,0,j/C)}setAtlas(R){this._atlas=R;for(const L of this._atlasTextures)L.version=-1}_bindAtlasPageTexture(R,L,A){R.activeTexture(R.TEXTURE0+A),R.bindTexture(R.TEXTURE_2D,this._atlasTextures[A].texture),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,R.RGBA,R.UNSIGNED_BYTE,L.pages[A].canvas),R.generateMipmap(R.TEXTURE_2D),this._atlasTextures[A].version=L.pages[A].version}setDimensions(R){this._dimensions=R}}a.GlyphRenderer=T},742:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RectangleRenderer=void 0;const f=u(374),g=u(859),c=u(310),_=u(381),x=8*Float32Array.BYTES_PER_ELEMENT;class C{constructor(){this.attributes=new Float32Array(160),this.count=0}}let y=0,m=0,b=0,S=0,w=0,T=0,D=0;class R extends g.Disposable{constructor(A,j,M,I){super(),this._terminal=A,this._gl=j,this._dimensions=M,this._themeService=I,this._vertices=new C,this._verticesCursor=new C;const B=this._gl;this._program=(0,f.throwIfFalsy)((0,_.createProgram)(B,`#version 300 es
598
- layout (location = 0) in vec2 a_position;
599
- layout (location = 1) in vec2 a_size;
600
- layout (location = 2) in vec4 a_color;
601
- layout (location = 3) in vec2 a_unitquad;
602
-
603
- uniform mat4 u_projection;
604
-
605
- out vec4 v_color;
606
-
607
- void main() {
608
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
609
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
610
- v_color = a_color;
611
- }`,`#version 300 es
612
- precision lowp float;
613
-
614
- in vec4 v_color;
615
-
616
- out vec4 outColor;
617
-
618
- void main() {
619
- outColor = v_color;
620
- }`)),this.register((0,g.toDisposable)((()=>B.deleteProgram(this._program)))),this._projectionLocation=(0,f.throwIfFalsy)(B.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=B.createVertexArray(),B.bindVertexArray(this._vertexArrayObject);const H=new Float32Array([0,0,1,0,0,1,1,1]),F=B.createBuffer();this.register((0,g.toDisposable)((()=>B.deleteBuffer(F)))),B.bindBuffer(B.ARRAY_BUFFER,F),B.bufferData(B.ARRAY_BUFFER,H,B.STATIC_DRAW),B.enableVertexAttribArray(3),B.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const W=new Uint8Array([0,1,2,3]),G=B.createBuffer();this.register((0,g.toDisposable)((()=>B.deleteBuffer(G)))),B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,G),B.bufferData(B.ELEMENT_ARRAY_BUFFER,W,B.STATIC_DRAW),this._attributesBuffer=(0,f.throwIfFalsy)(B.createBuffer()),this.register((0,g.toDisposable)((()=>B.deleteBuffer(this._attributesBuffer)))),B.bindBuffer(B.ARRAY_BUFFER,this._attributesBuffer),B.enableVertexAttribArray(0),B.vertexAttribPointer(0,2,B.FLOAT,!1,x,0),B.vertexAttribDivisor(0,1),B.enableVertexAttribArray(1),B.vertexAttribPointer(1,2,B.FLOAT,!1,x,2*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(1,1),B.enableVertexAttribArray(2),B.vertexAttribPointer(2,4,B.FLOAT,!1,x,4*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(2,1),this._updateCachedColors(I.colors),this.register(this._themeService.onChangeColors((Q=>{this._updateCachedColors(Q),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(A){const j=this._gl;j.useProgram(this._program),j.bindVertexArray(this._vertexArrayObject),j.uniformMatrix4fv(this._projectionLocation,!1,_.PROJECTION_MATRIX),j.bindBuffer(j.ARRAY_BUFFER,this._attributesBuffer),j.bufferData(j.ARRAY_BUFFER,A.attributes,j.DYNAMIC_DRAW),j.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,j.UNSIGNED_BYTE,0,A.count)}handleResize(){this._updateViewportRectangle()}setDimensions(A){this._dimensions=A}_updateCachedColors(A){this._bgFloat=this._colorToFloat32Array(A.background),this._cursorFloat=this._colorToFloat32Array(A.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(A){const j=this._terminal,M=this._vertices;let I,B,H,F,W,G,Q,X,z,O,Y,Z=1;for(I=0;I<j.rows;I++){for(H=-1,F=0,W=0,G=!1,B=0;B<j.cols;B++)Q=(I*j.cols+B)*c.RENDER_MODEL_INDICIES_PER_CELL,X=A.cells[Q+c.RENDER_MODEL_BG_OFFSET],z=A.cells[Q+c.RENDER_MODEL_FG_OFFSET],O=!!(67108864&z),(X!==F||z!==W&&(G||O))&&((F!==0||G&&W!==0)&&(Y=8*Z++,this._updateRectangle(M,Y,W,F,H,B,I)),H=B,F=X,W=z,G=O);(F!==0||G&&W!==0)&&(Y=8*Z++,this._updateRectangle(M,Y,W,F,H,j.cols,I))}M.count=Z}updateCursor(A){const j=this._verticesCursor,M=A.cursor;if(!M||M.style==="block")return void(j.count=0);let I,B=0;M.style!=="bar"&&M.style!=="outline"||(I=8*B++,this._addRectangleFloat(j.attributes,I,M.x*this._dimensions.device.cell.width,M.y*this._dimensions.device.cell.height,M.style==="bar"?M.dpr*M.cursorWidth:M.dpr,this._dimensions.device.cell.height,this._cursorFloat)),M.style!=="underline"&&M.style!=="outline"||(I=8*B++,this._addRectangleFloat(j.attributes,I,M.x*this._dimensions.device.cell.width,(M.y+1)*this._dimensions.device.cell.height-M.dpr,M.width*this._dimensions.device.cell.width,M.dpr,this._cursorFloat)),M.style==="outline"&&(I=8*B++,this._addRectangleFloat(j.attributes,I,M.x*this._dimensions.device.cell.width,M.y*this._dimensions.device.cell.height,M.width*this._dimensions.device.cell.width,M.dpr,this._cursorFloat),I=8*B++,this._addRectangleFloat(j.attributes,I,(M.x+M.width)*this._dimensions.device.cell.width-M.dpr,M.y*this._dimensions.device.cell.height,M.dpr,this._dimensions.device.cell.height,this._cursorFloat)),j.count=B}_updateRectangle(A,j,M,I,B,H,F){if(67108864&M)switch(50331648&M){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&M].rgba;break;case 50331648:y=(16777215&M)<<8;break;default:y=this._themeService.colors.foreground.rgba}else switch(50331648&I){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:y=(16777215&I)<<8;break;default:y=this._themeService.colors.background.rgba}A.attributes.length<j+4&&(A.attributes=(0,_.expandFloat32Array)(A.attributes,this._terminal.rows*this._terminal.cols*8)),m=B*this._dimensions.device.cell.width,b=F*this._dimensions.device.cell.height,S=(y>>24&255)/255,w=(y>>16&255)/255,T=(y>>8&255)/255,D=1,this._addRectangle(A.attributes,j,m,b,(H-B)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,S,w,T,D)}_addRectangle(A,j,M,I,B,H,F,W,G,Q){A[j]=M/this._dimensions.device.canvas.width,A[j+1]=I/this._dimensions.device.canvas.height,A[j+2]=B/this._dimensions.device.canvas.width,A[j+3]=H/this._dimensions.device.canvas.height,A[j+4]=F,A[j+5]=W,A[j+6]=G,A[j+7]=Q}_addRectangleFloat(A,j,M,I,B,H,F){A[j]=M/this._dimensions.device.canvas.width,A[j+1]=I/this._dimensions.device.canvas.height,A[j+2]=B/this._dimensions.device.canvas.width,A[j+3]=H/this._dimensions.device.canvas.height,A[j+4]=F[0],A[j+5]=F[1],A[j+6]=F[2],A[j+7]=F[3]}_colorToFloat32Array(A){return new Float32Array([(A.rgba>>24&255)/255,(A.rgba>>16&255)/255,(A.rgba>>8&255)/255,(255&A.rgba)/255])}}a.RectangleRenderer=R},310:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderModel=a.COMBINED_CHAR_BIT_MASK=a.RENDER_MODEL_EXT_OFFSET=a.RENDER_MODEL_FG_OFFSET=a.RENDER_MODEL_BG_OFFSET=a.RENDER_MODEL_INDICIES_PER_CELL=void 0;const f=u(296);a.RENDER_MODEL_INDICIES_PER_CELL=4,a.RENDER_MODEL_BG_OFFSET=1,a.RENDER_MODEL_FG_OFFSET=2,a.RENDER_MODEL_EXT_OFFSET=3,a.COMBINED_CHAR_BIT_MASK=2147483648,a.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,f.createSelectionRenderModel)()}resize(g,c){const _=g*c*a.RENDER_MODEL_INDICIES_PER_CELL;_!==this.cells.length&&(this.cells=new Uint32Array(_),this.lineLengths=new Uint32Array(c))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.JoinedCellData=a.WebglRenderer=void 0;const f=u(820),g=u(274),c=u(627),_=u(457),x=u(56),C=u(374),y=u(345),m=u(859),b=u(147),S=u(782),w=u(855),T=u(965),D=u(742),R=u(310),L=u(733);class A extends m.Disposable{constructor(B,H,F,W,G,Q,X,z,O){super(),this._terminal=B,this._characterJoinerService=H,this._charSizeService=F,this._coreBrowserService=W,this._coreService=G,this._decorationService=Q,this._optionsService=X,this._themeService=z,this._cursorBlinkStateManager=new m.MutableDisposable,this._charAtlasDisposable=this.register(new m.MutableDisposable),this._observerDisposable=this.register(new m.MutableDisposable),this._model=new R.RenderModel,this._workCell=new S.CellData,this._workCell2=new S.CellData,this._rectangleRenderer=this.register(new m.MutableDisposable),this._glyphRenderer=this.register(new m.MutableDisposable),this._onChangeTextureAtlas=this.register(new y.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new y.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new y.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new y.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new g.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new L.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,X,this._themeService)],this.dimensions=(0,C.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(X.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const Y={antialias:!1,depth:!1,preserveDrawingBuffer:O};if(this._gl=this._canvas.getContext("webgl2",Y),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,f.addDisposableDomListener)(this._canvas,"webglcontextlost",(Z=>{console.log("webglcontextlost event received"),Z.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(Z)}),3e3)}))),this.register((0,f.addDisposableDomListener)(this._canvas,"webglcontextrestored",(Z=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,c.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((Z,U)=>this._setCanvasDevicePixelDimensions(Z,U))),this.register(this._coreBrowserService.onWindowChange((Z=>{this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,Z,((U,V)=>this._setCanvasDevicePixelDimensions(U,V)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,m.toDisposable)((()=>{var Z;for(const U of this._renderLayers)U.dispose();(Z=this._canvas.parentElement)==null||Z.removeChild(this._canvas),(0,c.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var B;return(B=this._charAtlas)==null?void 0:B.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(B,H){var F,W,G,Q;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const X of this._renderLayers)X.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(F=this._rectangleRenderer.value)==null||F.setDimensions(this.dimensions),(W=this._rectangleRenderer.value)==null||W.handleResize(),(G=this._glyphRenderer.value)==null||G.setDimensions(this.dimensions),(Q=this._glyphRenderer.value)==null||Q.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var B;for(const H of this._renderLayers)H.handleBlur(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.pause(),this._requestRedrawViewport()}handleFocus(){var B;for(const H of this._renderLayers)H.handleFocus(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.resume(),this._requestRedrawViewport()}handleSelectionChanged(B,H,F){for(const W of this._renderLayers)W.handleSelectionChanged(this._terminal,B,H,F);this._model.selection.update(this._core,B,H,F),this._requestRedrawViewport()}handleCursorMove(){var B;for(const H of this._renderLayers)H.handleCursorMove(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new D.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new T.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var H;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const B=(0,c.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==B&&(this._onChangeTextureAtlas.fire(B.pages[0].canvas),this._charAtlasDisposable.value=(0,m.getDisposeArrayDisposable)([(0,y.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,y.forwardEvent)(B.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=B,this._charAtlas.warmUp(),(H=this._glyphRenderer.value)==null||H.setAtlas(this._charAtlas)}_clearModel(B){var H;this._model.clear(),B&&((H=this._glyphRenderer.value)==null||H.clear())}clearTextureAtlas(){var B;(B=this._charAtlas)==null||B.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var B;this._clearModel(!0);for(const H of this._renderLayers)H.reset(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(B){return-1}deregisterCharacterJoiner(B){return!1}renderRows(B,H){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const F of this._renderLayers)F.handleGridChanged(this._terminal,B,H);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(B,H),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new _.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(B,H){const F=this._core;let W,G,Q,X,z,O,Y,Z,U,V,ne,le,K,$,oe=this._workCell;B=M(B,F.rows-1,0),H=M(H,F.rows-1,0);const ee=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ue=ee-F.buffer.ydisp,he=Math.min(this._terminal.buffer.active.cursorX,F.cols-1);let Se=-1;const we=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Re=!1;for(G=B;G<=H;G++)for(Q=G+F.buffer.ydisp,X=F.buffer.lines.get(Q),this._model.lineLengths[G]=0,z=this._characterJoinerService.getJoinedCharacters(Q),K=0;K<F.cols;K++)if(W=this._cellColorResolver.result.bg,X.loadCell(K,oe),K===0&&(W=this._cellColorResolver.result.bg),O=!1,Y=K,z.length>0&&K===z[0][0]&&(O=!0,Z=z.shift(),oe=new j(oe,X.translateToString(!0,Z[0],Z[1]),Z[1]-Z[0]),Y=Z[1]-1),U=oe.getChars(),V=oe.getCode(),le=(G*F.cols+K)*R.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(oe,K,Q,this.dimensions.device.cell.width),we&&Q===ee&&(K===he&&(this._model.cursor={x:he,y:ue,width:oe.getWidth(),style:this._coreBrowserService.isFocused?F.options.cursorStyle||"block":F.options.cursorInactiveStyle,cursorWidth:F.options.cursorWidth,dpr:this._devicePixelRatio},Se=he+oe.getWidth()-1),K>=he&&K<=Se&&(this._coreBrowserService.isFocused&&(F.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&F.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),V!==w.NULL_CELL_CODE&&(this._model.lineLengths[G]=K+1),(this._model.cells[le]!==V||this._model.cells[le+R.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[le+R.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[le+R.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Re=!0,U.length>1&&(V|=R.COMBINED_CHAR_BIT_MASK),this._model.cells[le]=V,this._model.cells[le+R.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[le+R.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[le+R.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ne=oe.getWidth(),this._glyphRenderer.value.updateCell(K,G,V,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,U,ne,W),O))for(oe=this._workCell,K++;K<Y;K++)$=(G*F.cols+K)*R.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(K,G,w.NULL_CELL_CODE,0,0,0,w.NULL_CELL_CHAR,0,0),this._model.cells[$]=w.NULL_CELL_CODE,this._model.cells[$+R.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[$+R.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[$+R.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Re&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(B,H){this._canvas.width===B&&this._canvas.height===H||(this._canvas.width=B,this._canvas.height=H,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const B=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:B,end:B})}}a.WebglRenderer=A;class j extends b.AttributeData{constructor(B,H,F){super(),this.content=0,this.combinedData="",this.fg=B.fg,this.bg=B.bg,this.combinedData=H,this._width=F}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(B){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function M(I,B,H=0){return Math.max(Math.min(I,B),H)}a.JoinedCellData=j},381:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GLTexture=a.expandFloat32Array=a.createShader=a.createProgram=a.PROJECTION_MATRIX=void 0;const f=u(374);function g(c,_,x){const C=(0,f.throwIfFalsy)(c.createShader(_));if(c.shaderSource(C,x),c.compileShader(C),c.getShaderParameter(C,c.COMPILE_STATUS))return C;console.error(c.getShaderInfoLog(C)),c.deleteShader(C)}a.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),a.createProgram=function(c,_,x){const C=(0,f.throwIfFalsy)(c.createProgram());if(c.attachShader(C,(0,f.throwIfFalsy)(g(c,c.VERTEX_SHADER,_))),c.attachShader(C,(0,f.throwIfFalsy)(g(c,c.FRAGMENT_SHADER,x))),c.linkProgram(C),c.getProgramParameter(C,c.LINK_STATUS))return C;console.error(c.getProgramInfoLog(C)),c.deleteProgram(C)},a.createShader=g,a.expandFloat32Array=function(c,_){const x=Math.min(2*c.length,_),C=new Float32Array(x);for(let y=0;y<c.length;y++)C[y]=c[y];return C},a.GLTexture=class{constructor(c){this.texture=c,this.version=-1}}},592:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BaseRenderLayer=void 0;const f=u(627),g=u(237),c=u(374),_=u(859);class x extends _.Disposable{constructor(y,m,b,S,w,T,D,R){super(),this._container=m,this._alpha=w,this._coreBrowserService=T,this._optionsService=D,this._themeService=R,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${b}-layer`),this._canvas.style.zIndex=S.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((L=>{this._refreshCharAtlas(y,L),this.reset(y)}))),this.register((0,_.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,c.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(y){}handleFocus(y){}handleCursorMove(y){}handleGridChanged(y,m,b){}handleSelectionChanged(y,m,b,S=!1){}_setTransparency(y,m){if(m===this._alpha)return;const b=this._canvas;this._alpha=m,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,b),this._refreshCharAtlas(y,this._themeService.colors),this.handleGridChanged(y,0,y.rows-1)}_refreshCharAtlas(y,m){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,f.acquireTextureAtlas)(y,this._optionsService.rawOptions,m,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(y,m){this._deviceCellWidth=m.device.cell.width,this._deviceCellHeight=m.device.cell.height,this._deviceCharWidth=m.device.char.width,this._deviceCharHeight=m.device.char.height,this._deviceCharLeft=m.device.char.left,this._deviceCharTop=m.device.char.top,this._canvas.width=m.device.canvas.width,this._canvas.height=m.device.canvas.height,this._canvas.style.width=`${m.css.canvas.width}px`,this._canvas.style.height=`${m.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(y,this._themeService.colors)}_fillBottomLineAtCells(y,m,b=1){this._ctx.fillRect(y*this._deviceCellWidth,(m+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,b*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(y,m,b,S){this._alpha?this._ctx.clearRect(y*this._deviceCellWidth,m*this._deviceCellHeight,b*this._deviceCellWidth,S*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(y*this._deviceCellWidth,m*this._deviceCellHeight,b*this._deviceCellWidth,S*this._deviceCellHeight))}_fillCharTrueColor(y,m,b,S){this._ctx.font=this._getFont(y,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(b,S,m.getWidth()),this._ctx.fillText(m.getChars(),b*this._deviceCellWidth+this._deviceCharLeft,S*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(y,m,b){this._ctx.beginPath(),this._ctx.rect(y*this._deviceCellWidth,m*this._deviceCellHeight,b*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(y,m,b){return`${b?"italic":""} ${m?y.options.fontWeightBold:y.options.fontWeight} ${y.options.fontSize*this._coreBrowserService.dpr}px ${y.options.fontFamily}`}}a.BaseRenderLayer=x},733:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkRenderLayer=void 0;const f=u(197),g=u(237),c=u(592);class _ extends c.BaseRenderLayer{constructor(C,y,m,b,S,w,T){super(m,C,"link",y,!0,S,w,T),this.register(b.onShowLinkUnderline((D=>this._handleShowLinkUnderline(D)))),this.register(b.onHideLinkUnderline((D=>this._handleHideLinkUnderline(D))))}resize(C,y){super.resize(C,y),this._state=void 0}reset(C){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const C=this._state.y2-this._state.y1-1;C>0&&this._clearCells(0,this._state.y1+1,this._state.cols,C),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(C){if(C.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:C.fg!==void 0&&(0,f.is256Color)(C.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[C.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,C.y1===C.y2)this._fillBottomLineAtCells(C.x1,C.y1,C.x2-C.x1);else{this._fillBottomLineAtCells(C.x1,C.y1,C.cols-C.x1);for(let y=C.y1+1;y<C.y2;y++)this._fillBottomLineAtCells(0,y,C.cols);this._fillBottomLineAtCells(0,C.y2,C.x2)}this._state=C}_handleHideLinkUnderline(C){this._clearCurrentLink()}}a.LinkRenderLayer=_},820:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(u,f,g,c){u.addEventListener(f,g,c);let _=!1;return{dispose:()=>{_||(_=!0,u.removeEventListener(f,g,c))}}}},274:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellColorResolver=void 0;const f=u(855),g=u(160),c=u(374);let _,x=0,C=0,y=!1,m=!1,b=!1,S=0;a.CellColorResolver=class{constructor(w,T,D,R,L,A){this._terminal=w,this._optionService=T,this._selectionRenderModel=D,this._decorationService=R,this._coreBrowserService=L,this._themeService=A,this.result={fg:0,bg:0,ext:0}}resolve(w,T,D,R){if(this.result.bg=w.bg,this.result.fg=w.fg,this.result.ext=268435456&w.bg?w.extended.ext:0,C=0,x=0,m=!1,y=!1,b=!1,_=this._themeService.colors,S=0,w.getCode()!==f.NULL_CELL_CODE&&w.extended.underlineStyle===4){const L=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));S=T*R%(2*Math.round(L))}if(this._decorationService.forEachDecorationAtCell(T,D,"bottom",(L=>{L.backgroundColorRGB&&(C=L.backgroundColorRGB.rgba>>8&16777215,m=!0),L.foregroundColorRGB&&(x=L.foregroundColorRGB.rgba>>8&16777215,y=!0)})),b=this._selectionRenderModel.isCellSelected(this._terminal,T,D),b){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:C=(16777215&this.result.fg)<<8|255;break;default:C=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:C=(16777215&this.result.bg)<<8|255}C=g.rgba.blend(C,4294967040&(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else C=(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(m=!0,_.selectionForeground&&(x=_.selectionForeground.rgba>>8&16777215,y=!0),(0,c.treatGlyphAsBackgroundColor)(w.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)x=(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}x=g.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}y=!0}}this._decorationService.forEachDecorationAtCell(T,D,"top",(L=>{L.backgroundColorRGB&&(C=L.backgroundColorRGB.rgba>>8&16777215,m=!0),L.foregroundColorRGB&&(x=L.foregroundColorRGB.rgba>>8&16777215,y=!0)})),m&&(C=b?-16777216&w.bg&-134217729|C|50331648:-16777216&w.bg|C|50331648),y&&(x=-16777216&w.fg&-67108865|x|50331648),67108864&this.result.fg&&(m&&!y&&(x=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&_.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,y=!0),!m&&y&&(C=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&_.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,m=!0)),_=void 0,this.result.bg=m?C:this.result.bg,this.result.fg=y?x:this.result.fg,this.result.ext&=536870911,this.result.ext|=S<<29&3758096384}}},627:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeTerminalFromCache=a.acquireTextureAtlas=void 0;const f=u(509),g=u(197),c=[];a.acquireTextureAtlas=function(_,x,C,y,m,b,S,w){const T=(0,g.generateConfig)(y,m,b,S,x,C,w);for(let L=0;L<c.length;L++){const A=c[L],j=A.ownedBy.indexOf(_);if(j>=0){if((0,g.configEquals)(A.config,T))return A.atlas;A.ownedBy.length===1?(A.atlas.dispose(),c.splice(L,1)):A.ownedBy.splice(j,1);break}}for(let L=0;L<c.length;L++){const A=c[L];if((0,g.configEquals)(A.config,T))return A.ownedBy.push(_),A.atlas}const D=_._core,R={atlas:new f.TextureAtlas(document,T,D.unicodeService),config:T,ownedBy:[_]};return c.push(R),R.atlas},a.removeTerminalFromCache=function(_){for(let x=0;x<c.length;x++){const C=c[x].ownedBy.indexOf(_);if(C!==-1){c[x].ownedBy.length===1?(c[x].atlas.dispose(),c.splice(x,1)):c[x].ownedBy.splice(C,1);break}}}},197:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.is256Color=a.configEquals=a.generateConfig=void 0;const f=u(160);a.generateConfig=function(g,c,_,x,C,y,m){const b={foreground:y.foreground,background:y.background,cursor:f.NULL_COLOR,cursorAccent:f.NULL_COLOR,selectionForeground:f.NULL_COLOR,selectionBackgroundTransparent:f.NULL_COLOR,selectionBackgroundOpaque:f.NULL_COLOR,selectionInactiveBackgroundTransparent:f.NULL_COLOR,selectionInactiveBackgroundOpaque:f.NULL_COLOR,ansi:y.ansi.slice(),contrastCache:y.contrastCache,halfContrastCache:y.halfContrastCache};return{customGlyphs:C.customGlyphs,devicePixelRatio:m,letterSpacing:C.letterSpacing,lineHeight:C.lineHeight,deviceCellWidth:g,deviceCellHeight:c,deviceCharWidth:_,deviceCharHeight:x,fontFamily:C.fontFamily,fontSize:C.fontSize,fontWeight:C.fontWeight,fontWeightBold:C.fontWeightBold,allowTransparency:C.allowTransparency,drawBoldTextInBrightColors:C.drawBoldTextInBrightColors,minimumContrastRatio:C.minimumContrastRatio,colors:b}},a.configEquals=function(g,c){for(let _=0;_<g.colors.ansi.length;_++)if(g.colors.ansi[_].rgba!==c.colors.ansi[_].rgba)return!1;return g.devicePixelRatio===c.devicePixelRatio&&g.customGlyphs===c.customGlyphs&&g.lineHeight===c.lineHeight&&g.letterSpacing===c.letterSpacing&&g.fontFamily===c.fontFamily&&g.fontSize===c.fontSize&&g.fontWeight===c.fontWeight&&g.fontWeightBold===c.fontWeightBold&&g.allowTransparency===c.allowTransparency&&g.deviceCharWidth===c.deviceCharWidth&&g.deviceCharHeight===c.deviceCharHeight&&g.drawBoldTextInBrightColors===c.drawBoldTextInBrightColors&&g.minimumContrastRatio===c.minimumContrastRatio&&g.colors.foreground.rgba===c.colors.foreground.rgba&&g.colors.background.rgba===c.colors.background.rgba},a.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const f=u(399);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},457:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CursorBlinkStateManager=void 0,a.CursorBlinkStateManager=class{constructor(u,f){this._renderCallback=u,this._coreBrowserService=f,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const f=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,f>0)return void this._restartInterval(f)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const f=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(f)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tryDrawCustomChar=a.powerlineDefinitions=a.boxDrawingDefinitions=a.blockElementDefinitions=void 0;const f=u(374);a.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const g={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};a.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(y,m)=>`M0,${.5-m} L1,${.5-m} M0,${.5+m} L1,${.5+m}`},"║":{1:(y,m)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╒":{1:(y,m)=>`M.5,1 L.5,${.5-m} L1,${.5-m} M.5,${.5+m} L1,${.5+m}`},"╓":{1:(y,m)=>`M${.5-y},1 L${.5-y},.5 L1,.5 M${.5+y},.5 L${.5+y},1`},"╔":{1:(y,m)=>`M1,${.5-m} L${.5-y},${.5-m} L${.5-y},1 M1,${.5+m} L${.5+y},${.5+m} L${.5+y},1`},"╕":{1:(y,m)=>`M0,${.5-m} L.5,${.5-m} L.5,1 M0,${.5+m} L.5,${.5+m}`},"╖":{1:(y,m)=>`M${.5+y},1 L${.5+y},.5 L0,.5 M${.5-y},.5 L${.5-y},1`},"╗":{1:(y,m)=>`M0,${.5+m} L${.5-y},${.5+m} L${.5-y},1 M0,${.5-m} L${.5+y},${.5-m} L${.5+y},1`},"╘":{1:(y,m)=>`M.5,0 L.5,${.5+m} L1,${.5+m} M.5,${.5-m} L1,${.5-m}`},"╙":{1:(y,m)=>`M1,.5 L${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╚":{1:(y,m)=>`M1,${.5-m} L${.5+y},${.5-m} L${.5+y},0 M1,${.5+m} L${.5-y},${.5+m} L${.5-y},0`},"╛":{1:(y,m)=>`M0,${.5+m} L.5,${.5+m} L.5,0 M0,${.5-m} L.5,${.5-m}`},"╜":{1:(y,m)=>`M0,.5 L${.5+y},.5 L${.5+y},0 M${.5-y},.5 L${.5-y},0`},"╝":{1:(y,m)=>`M0,${.5-m} L${.5-y},${.5-m} L${.5-y},0 M0,${.5+m} L${.5+y},${.5+m} L${.5+y},0`},"╞":{1:(y,m)=>`M.5,0 L.5,1 M.5,${.5-m} L1,${.5-m} M.5,${.5+m} L1,${.5+m}`},"╟":{1:(y,m)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1 M${.5+y},.5 L1,.5`},"╠":{1:(y,m)=>`M${.5-y},0 L${.5-y},1 M1,${.5+m} L${.5+y},${.5+m} L${.5+y},1 M1,${.5-m} L${.5+y},${.5-m} L${.5+y},0`},"╡":{1:(y,m)=>`M.5,0 L.5,1 M0,${.5-m} L.5,${.5-m} M0,${.5+m} L.5,${.5+m}`},"╢":{1:(y,m)=>`M0,.5 L${.5-y},.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╣":{1:(y,m)=>`M${.5+y},0 L${.5+y},1 M0,${.5+m} L${.5-y},${.5+m} L${.5-y},1 M0,${.5-m} L${.5-y},${.5-m} L${.5-y},0`},"╤":{1:(y,m)=>`M0,${.5-m} L1,${.5-m} M0,${.5+m} L1,${.5+m} M.5,${.5+m} L.5,1`},"╥":{1:(y,m)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},1 M${.5+y},.5 L${.5+y},1`},"╦":{1:(y,m)=>`M0,${.5-m} L1,${.5-m} M0,${.5+m} L${.5-y},${.5+m} L${.5-y},1 M1,${.5+m} L${.5+y},${.5+m} L${.5+y},1`},"╧":{1:(y,m)=>`M.5,0 L.5,${.5-m} M0,${.5-m} L1,${.5-m} M0,${.5+m} L1,${.5+m}`},"╨":{1:(y,m)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╩":{1:(y,m)=>`M0,${.5+m} L1,${.5+m} M0,${.5-m} L${.5-y},${.5-m} L${.5-y},0 M1,${.5-m} L${.5+y},${.5-m} L${.5+y},0`},"╪":{1:(y,m)=>`M.5,0 L.5,1 M0,${.5-m} L1,${.5-m} M0,${.5+m} L1,${.5+m}`},"╫":{1:(y,m)=>`M0,.5 L1,.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╬":{1:(y,m)=>`M0,${.5+m} L${.5-y},${.5+m} L${.5-y},1 M1,${.5+m} L${.5+y},${.5+m} L${.5+y},1 M0,${.5-m} L${.5-y},${.5-m} L${.5-y},0 M1,${.5-m} L${.5+y},${.5-m} L${.5+y},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(y,m)=>`M.5,1 L.5,${.5+m/.15*.5} C.5,${.5+m/.15*.5},.5,.5,1,.5`},"╮":{1:(y,m)=>`M.5,1 L.5,${.5+m/.15*.5} C.5,${.5+m/.15*.5},.5,.5,0,.5`},"╯":{1:(y,m)=>`M.5,0 L.5,${.5-m/.15*.5} C.5,${.5-m/.15*.5},.5,.5,0,.5`},"╰":{1:(y,m)=>`M.5,0 L.5,${.5-m/.15*.5} C.5,${.5-m/.15*.5},.5,.5,1,.5`}},a.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},a.powerlineDefinitions[""]=a.powerlineDefinitions[""],a.powerlineDefinitions[""]=a.powerlineDefinitions[""],a.tryDrawCustomChar=function(y,m,b,S,w,T,D,R){const L=a.blockElementDefinitions[m];if(L)return(function(I,B,H,F,W,G){for(let Q=0;Q<B.length;Q++){const X=B[Q],z=W/8,O=G/8;I.fillRect(H+X.x*z,F+X.y*O,X.w*z,X.h*O)}})(y,L,b,S,w,T),!0;const A=g[m];if(A)return(function(I,B,H,F,W,G){let Q=c.get(B);Q||(Q=new Map,c.set(B,Q));const X=I.fillStyle;if(typeof X!="string")throw new Error(`Unexpected fillStyle type "${X}"`);let z=Q.get(X);if(!z){const O=B[0].length,Y=B.length,Z=I.canvas.ownerDocument.createElement("canvas");Z.width=O,Z.height=Y;const U=(0,f.throwIfFalsy)(Z.getContext("2d")),V=new ImageData(O,Y);let ne,le,K,$;if(X.startsWith("#"))ne=parseInt(X.slice(1,3),16),le=parseInt(X.slice(3,5),16),K=parseInt(X.slice(5,7),16),$=X.length>7&&parseInt(X.slice(7,9),16)||1;else{if(!X.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${X}" when drawing pattern glyph`);[ne,le,K,$]=X.substring(5,X.length-1).split(",").map((oe=>parseFloat(oe)))}for(let oe=0;oe<Y;oe++)for(let ee=0;ee<O;ee++)V.data[4*(oe*O+ee)]=ne,V.data[4*(oe*O+ee)+1]=le,V.data[4*(oe*O+ee)+2]=K,V.data[4*(oe*O+ee)+3]=B[oe][ee]*(255*$);U.putImageData(V,0,0),z=(0,f.throwIfFalsy)(I.createPattern(Z,null)),Q.set(X,z)}I.fillStyle=z,I.fillRect(H,F,W,G)})(y,A,b,S,w,T),!0;const j=a.boxDrawingDefinitions[m];if(j)return(function(I,B,H,F,W,G,Q){I.strokeStyle=I.fillStyle;for(const[X,z]of Object.entries(B)){let O;I.beginPath(),I.lineWidth=Q*Number.parseInt(X),O=typeof z=="function"?z(.15,.15/G*W):z;for(const Y of O.split(" ")){const Z=Y[0],U=x[Z];if(!U){console.error(`Could not find drawing instructions for "${Z}"`);continue}const V=Y.substring(1).split(",");V[0]&&V[1]&&U(I,C(V,W,G,H,F,!0,Q))}I.stroke(),I.closePath()}})(y,j,b,S,w,T,R),!0;const M=a.powerlineDefinitions[m];return!!M&&((function(I,B,H,F,W,G,Q,X){const z=new Path2D;z.rect(H,F,W,G),I.clip(z),I.beginPath();const O=Q/12;I.lineWidth=X*O;for(const Y of B.d.split(" ")){const Z=Y[0],U=x[Z];if(!U){console.error(`Could not find drawing instructions for "${Z}"`);continue}const V=Y.substring(1).split(",");V[0]&&V[1]&&U(I,C(V,W,G,H,F,!1,X,(B.leftPadding??0)*(O/2),(B.rightPadding??0)*(O/2)))}B.type===1?(I.strokeStyle=I.fillStyle,I.stroke()):I.fill(),I.closePath()})(y,M,b,S,w,T,D,R),!0)};const c=new Map;function _(y,m,b=0){return Math.max(Math.min(y,m),b)}const x={C:(y,m)=>y.bezierCurveTo(m[0],m[1],m[2],m[3],m[4],m[5]),L:(y,m)=>y.lineTo(m[0],m[1]),M:(y,m)=>y.moveTo(m[0],m[1])};function C(y,m,b,S,w,T,D,R=0,L=0){const A=y.map((j=>parseFloat(j)||parseInt(j)));if(A.length<2)throw new Error("Too few arguments for instruction");for(let j=0;j<A.length;j+=2)A[j]*=m-R*D-L*D,T&&A[j]!==0&&(A[j]=_(Math.round(A[j]+.5)-.5,m,0)),A[j]+=S+R*D;for(let j=1;j<A.length;j+=2)A[j]*=b,T&&A[j]!==0&&(A[j]=_(Math.round(A[j]+.5)-.5,b,0)),A[j]+=w;return A}},56:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.observeDevicePixelDimensions=void 0;const f=u(859);a.observeDevicePixelDimensions=function(g,c,_){let x=new c.ResizeObserver((C=>{const y=C.find((S=>S.target===g));if(!y)return;if(!("devicePixelContentBoxSize"in y))return x==null||x.disconnect(),void(x=void 0);const m=y.devicePixelContentBoxSize[0].inlineSize,b=y.devicePixelContentBoxSize[0].blockSize;m>0&&b>0&&_(m,b)}));try{x.observe(g,{box:["device-pixel-content-box"]})}catch{x.disconnect(),x=void 0}return(0,f.toDisposable)((()=>x==null?void 0:x.disconnect()))}},374:(p,a)=>{function u(g){return 57508<=g&&g<=57558}function f(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},a.isPowerlineGlyph=u,a.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},a.isEmoji=f,a.allowRescaling=function(g,c,_,x){return c===1&&_>Math.ceil(1.5*x)&&g!==void 0&&g>255&&!f(g)&&!u(g)&&!(function(C){return 57344<=C&&C<=63743})(g)},a.treatGlyphAsBackgroundColor=function(g){return u(g)||(function(c){return 9472<=c&&c<=9631})(g)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(g,c,_=0){return(g-(2*Math.round(c)-_))%(2*Math.round(c))}},296:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,c,_,x=!1){if(this.selectionStart=c,this.selectionEnd=_,!c||!_||c[0]===_[0]&&c[1]===_[1])return void this.clear();const C=g.buffers.active.ydisp,y=c[1]-C,m=_[1]-C,b=Math.max(y,0),S=Math.min(m,g.rows-1);b>=g.rows||S<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=y,this.viewportEndRow=m,this.viewportCappedStartRow=b,this.viewportCappedEndRow=S,this.startCol=c[0],this.endCol=_[0])}isCellSelected(g,c,_){return!!this.hasSelection&&(_-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?c>=this.startCol&&_>=this.viewportCappedStartRow&&c<this.endCol&&_<=this.viewportCappedEndRow:c<this.startCol&&_>=this.viewportCappedStartRow&&c>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol)}}a.createSelectionRenderModel=function(){return new u}},509:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TextureAtlas=void 0;const f=u(237),g=u(860),c=u(374),_=u(160),x=u(345),C=u(485),y=u(385),m=u(147),b=u(855),S={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let w;class T{get pages(){return this._pages}constructor(j,M,I){this._document=j,this._config=M,this._unicodeService=I,this._didWarmUp=!1,this._cacheMap=new C.FourKeyMap,this._cacheMapCombined=new C.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new m.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new x.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new x.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=L(j,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,c.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const j of this.pages)j.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const j=new y.IdleTaskQueue;for(let M=33;M<126;M++)j.enqueue((()=>{if(!this._cacheMap.get(M,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT)){const I=this._drawToCache(M,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT);this._cacheMap.set(M,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT,I)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const j of this._pages)j.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(T.maxAtlasPages&&this._pages.length>=Math.max(4,T.maxAtlasPages)){const M=this._pages.filter((Q=>2*Q.canvas.width<=(T.maxTextureSize||4096))).sort(((Q,X)=>X.canvas.width!==Q.canvas.width?X.canvas.width-Q.canvas.width:X.percentageUsed-Q.percentageUsed));let I=-1,B=0;for(let Q=0;Q<M.length;Q++)if(M[Q].canvas.width!==B)I=Q,B=M[Q].canvas.width;else if(Q-I==3)break;const H=M.slice(I,I+4),F=H.map((Q=>Q.glyphs[0].texturePage)).sort(((Q,X)=>Q>X?1:-1)),W=this.pages.length-H.length,G=this._mergePages(H,W);G.version++;for(let Q=F.length-1;Q>=0;Q--)this._deletePage(F[Q]);this.pages.push(G),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(G.canvas)}const j=new D(this._document,this._textureSize);return this._pages.push(j),this._activePages.push(j),this._onAddTextureAtlasCanvas.fire(j.canvas),j}_mergePages(j,M){const I=2*j[0].canvas.width,B=new D(this._document,I,j);for(const[H,F]of j.entries()){const W=H*F.canvas.width%I,G=Math.floor(H/2)*F.canvas.height;B.ctx.drawImage(F.canvas,W,G);for(const X of F.glyphs)X.texturePage=M,X.sizeClipSpace.x=X.size.x/I,X.sizeClipSpace.y=X.size.y/I,X.texturePosition.x+=W,X.texturePosition.y+=G,X.texturePositionClipSpace.x=X.texturePosition.x/I,X.texturePositionClipSpace.y=X.texturePosition.y/I;this._onRemoveTextureAtlasCanvas.fire(F.canvas);const Q=this._activePages.indexOf(F);Q!==-1&&this._activePages.splice(Q,1)}return B}_deletePage(j){this._pages.splice(j,1);for(let M=j;M<this._pages.length;M++){const I=this._pages[M];for(const B of I.glyphs)B.texturePage--;I.version++}}getRasterizedGlyphCombinedChar(j,M,I,B,H){return this._getFromCacheMap(this._cacheMapCombined,j,M,I,B,H)}getRasterizedGlyph(j,M,I,B,H){return this._getFromCacheMap(this._cacheMap,j,M,I,B,H)}_getFromCacheMap(j,M,I,B,H,F=!1){return w=j.get(M,I,B,H),w||(w=this._drawToCache(M,I,B,H,F),j.set(M,I,B,H,w)),w}_getColorFromAnsiIndex(j){if(j>=this._config.colors.ansi.length)throw new Error("No color found for idx "+j);return this._config.colors.ansi[j]}_getBackgroundColor(j,M,I,B){if(this._config.allowTransparency)return _.NULL_COLOR;let H;switch(j){case 16777216:case 33554432:H=this._getColorFromAnsiIndex(M);break;case 50331648:const F=m.AttributeData.toColorRGB(M);H=_.channels.toColor(F[0],F[1],F[2]);break;default:H=I?_.color.opaque(this._config.colors.foreground):this._config.colors.background}return H}_getForegroundColor(j,M,I,B,H,F,W,G,Q,X){const z=this._getMinimumContrastColor(j,M,I,B,H,F,W,Q,G,X);if(z)return z;let O;switch(H){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&Q&&F<8&&(F+=8),O=this._getColorFromAnsiIndex(F);break;case 50331648:const Y=m.AttributeData.toColorRGB(F);O=_.channels.toColor(Y[0],Y[1],Y[2]);break;default:O=W?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(O=_.color.opaque(O)),G&&(O=_.color.multiplyOpacity(O,f.DIM_OPACITY)),O}_resolveBackgroundRgba(j,M,I){switch(j){case 16777216:case 33554432:return this._getColorFromAnsiIndex(M).rgba;case 50331648:return M<<8;default:return I?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(j,M,I,B){switch(j){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&B&&M<8&&(M+=8),this._getColorFromAnsiIndex(M).rgba;case 50331648:return M<<8;default:return I?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(j,M,I,B,H,F,W,G,Q,X){if(this._config.minimumContrastRatio===1||X)return;const z=this._getContrastCache(Q),O=z.getColor(j,B);if(O!==void 0)return O||void 0;const Y=this._resolveBackgroundRgba(M,I,W),Z=this._resolveForegroundRgba(H,F,W,G),U=_.rgba.ensureContrastRatio(Y,Z,this._config.minimumContrastRatio/(Q?2:1));if(!U)return void z.setColor(j,B,null);const V=_.channels.toColor(U>>24&255,U>>16&255,U>>8&255);return z.setColor(j,B,V),V}_getContrastCache(j){return j?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(j,M,I,B,H=!1){const F=typeof j=="number"?String.fromCharCode(j):j,W=Math.min(this._config.deviceCellWidth*Math.max(F.length,2)+4,this._textureSize);this._tmpCanvas.width<W&&(this._tmpCanvas.width=W);const G=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<G&&(this._tmpCanvas.height=G),this._tmpCtx.save(),this._workAttributeData.fg=I,this._workAttributeData.bg=M,this._workAttributeData.extended.ext=B,this._workAttributeData.isInvisible())return S;const Q=!!this._workAttributeData.isBold(),X=!!this._workAttributeData.isInverse(),z=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),Y=!!this._workAttributeData.isUnderline(),Z=!!this._workAttributeData.isStrikethrough(),U=!!this._workAttributeData.isOverline();let V=this._workAttributeData.getFgColor(),ne=this._workAttributeData.getFgColorMode(),le=this._workAttributeData.getBgColor(),K=this._workAttributeData.getBgColorMode();if(X){const Te=V;V=le,le=Te;const Ve=ne;ne=K,K=Ve}const $=this._getBackgroundColor(K,le,X,z);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const oe=Q?this._config.fontWeightBold:this._config.fontWeight,ee=O?"italic":"";this._tmpCtx.font=`${ee} ${oe} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=f.TEXT_BASELINE;const ue=F.length===1&&(0,c.isPowerlineGlyph)(F.charCodeAt(0)),he=F.length===1&&(0,c.isRestrictedPowerlineGlyph)(F.charCodeAt(0)),Se=this._getForegroundColor(M,K,le,I,ne,V,X,z,Q,(0,c.treatGlyphAsBackgroundColor)(F.charCodeAt(0)));this._tmpCtx.fillStyle=Se.css;const we=he?0:4;let Re=!1;this._config.customGlyphs!==!1&&(Re=(0,g.tryDrawCustomChar)(this._tmpCtx,F,we,we,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,ke=!ue;if(qe=typeof j=="number"?this._unicodeService.wcwidth(j):this._unicodeService.getStringCellWidth(j),Y){this._tmpCtx.save();const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ve=Te%2==1?.5:0;if(this._tmpCtx.lineWidth=Te,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ke=!1,this._tmpCtx.strokeStyle=`rgb(${m.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ke=!1;let Le=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Le<8&&(Le+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Le).css}this._tmpCtx.beginPath();const gt=we,st=Math.ceil(we+this._config.deviceCharHeight)-Ve-(H?2*Te:0),fe=st+Te,_e=st+2*Te;let De=this._workAttributeData.getUnderlineVariantOffset();for(let Le=0;Le<qe;Le++){this._tmpCtx.save();const Fe=gt+Le*this._config.deviceCellWidth,Me=gt+(Le+1)*this._config.deviceCellWidth,Tt=Fe+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Me,st),this._tmpCtx.moveTo(Fe,_e),this._tmpCtx.lineTo(Me,_e);break;case 3:const qt=Te<=1?_e:Math.ceil(we+this._config.deviceCharHeight-Te/2)-Ve,kn=Te<=1?st:Math.ceil(we+this._config.deviceCharHeight+Te/2)-Ve,ei=new Path2D;ei.rect(Fe,st,this._config.deviceCellWidth,_e-st),this._tmpCtx.clip(ei),this._tmpCtx.moveTo(Fe-this._config.deviceCellWidth/2,fe),this._tmpCtx.bezierCurveTo(Fe-this._config.deviceCellWidth/2,kn,Fe,kn,Fe,fe),this._tmpCtx.bezierCurveTo(Fe,qt,Tt,qt,Tt,fe),this._tmpCtx.bezierCurveTo(Tt,kn,Me,kn,Me,fe),this._tmpCtx.bezierCurveTo(Me,qt,Me+this._config.deviceCellWidth/2,qt,Me+this._config.deviceCellWidth/2,fe);break;case 4:const ti=De===0?0:De>=Te?2*Te-De:Te-De;De>=Te||ti===0?(this._tmpCtx.setLineDash([Math.round(Te),Math.round(Te)]),this._tmpCtx.moveTo(Fe+ti,st),this._tmpCtx.lineTo(Me,st)):(this._tmpCtx.setLineDash([Math.round(Te),Math.round(Te)]),this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Fe+ti,st),this._tmpCtx.moveTo(Fe+ti+Te,st),this._tmpCtx.lineTo(Me,st)),De=(0,c.computeNextVariantOffset)(Me-Fe,Te,De);break;case 5:const oo=.6,Vt=.3,Wt=Me-Fe,ni=Math.floor(oo*Wt),xn=Math.floor(Vt*Wt),ao=Wt-ni-xn;this._tmpCtx.setLineDash([ni,xn,ao]),this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Me,st);break;default:this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Me,st)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Re&&this._config.fontSize>=12&&!this._config.allowTransparency&&F!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Le=this._tmpCtx.measureText(F);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Le&&Le.actualBoundingBoxDescent>0){this._tmpCtx.save();const Fe=new Path2D;Fe.rect(gt,st-Math.ceil(Te/2),this._config.deviceCellWidth*qe,_e-st+Math.ceil(Te/2)),this._tmpCtx.clip(Fe),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(F,we,we+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(U){const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ve=Te%2==1?.5:0;this._tmpCtx.lineWidth=Te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(we,we+Ve),this._tmpCtx.lineTo(we+this._config.deviceCharWidth*qe,we+Ve),this._tmpCtx.stroke()}if(Re||this._tmpCtx.fillText(F,we,we+this._config.deviceCharHeight),F==="_"&&!this._config.allowTransparency){let Te=R(this._tmpCtx.getImageData(we,we,this._config.deviceCellWidth,this._config.deviceCellHeight),$,Se,ke);if(Te)for(let Ve=1;Ve<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(F,we,we+this._config.deviceCharHeight-Ve),Te=R(this._tmpCtx.getImageData(we,we,this._config.deviceCellWidth,this._config.deviceCellHeight),$,Se,ke),Te);Ve++);}if(Z){const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Ve=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=Te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(we,we+Math.floor(this._config.deviceCharHeight/2)-Ve),this._tmpCtx.lineTo(we+this._config.deviceCharWidth*qe,we+Math.floor(this._config.deviceCharHeight/2)-Ve),this._tmpCtx.stroke()}this._tmpCtx.restore();const ze=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Mt;if(Mt=this._config.allowTransparency?(function(Te){for(let Ve=0;Ve<Te.data.length;Ve+=4)if(Te.data[Ve+3]>0)return!1;return!0})(ze):R(ze,$,Se,ke),Mt)return S;const $e=this._findGlyphBoundingBox(ze,this._workBoundingBox,W,he,Re,we);let Be,Ie;for(;;){if(this._activePages.length===0){const Te=this._createNewPage();Be=Te,Ie=Te.currentRow,Ie.height=$e.size.y;break}Be=this._activePages[this._activePages.length-1],Ie=Be.currentRow;for(const Te of this._activePages)$e.size.y<=Te.currentRow.height&&(Be=Te,Ie=Te.currentRow);for(let Te=this._activePages.length-1;Te>=0;Te--)for(const Ve of this._activePages[Te].fixedRows)Ve.height<=Ie.height&&$e.size.y<=Ve.height&&(Be=this._activePages[Te],Ie=Ve);if(Ie.y+$e.size.y>=Be.canvas.height||Ie.height>$e.size.y+2){let Te=!1;if(Be.currentRow.y+Be.currentRow.height+$e.size.y>=Be.canvas.height){let Ve;for(const gt of this._activePages)if(gt.currentRow.y+gt.currentRow.height+$e.size.y<gt.canvas.height){Ve=gt;break}if(Ve)Be=Ve;else if(T.maxAtlasPages&&this._pages.length>=T.maxAtlasPages&&Ie.y+$e.size.y<=Be.canvas.height&&Ie.height>=$e.size.y&&Ie.x+$e.size.x<=Be.canvas.width)Te=!0;else{const gt=this._createNewPage();Be=gt,Ie=gt.currentRow,Ie.height=$e.size.y,Te=!0}}Te||(Be.currentRow.height>0&&Be.fixedRows.push(Be.currentRow),Ie={x:0,y:Be.currentRow.y+Be.currentRow.height,height:$e.size.y},Be.fixedRows.push(Ie),Be.currentRow={x:0,y:Ie.y+Ie.height,height:0})}if(Ie.x+$e.size.x<=Be.canvas.width)break;Ie===Be.currentRow?(Ie.x=0,Ie.y+=Ie.height,Ie.height=0):Be.fixedRows.splice(Be.fixedRows.indexOf(Ie),1)}return $e.texturePage=this._pages.indexOf(Be),$e.texturePosition.x=Ie.x,$e.texturePosition.y=Ie.y,$e.texturePositionClipSpace.x=Ie.x/Be.canvas.width,$e.texturePositionClipSpace.y=Ie.y/Be.canvas.height,$e.sizeClipSpace.x/=Be.canvas.width,$e.sizeClipSpace.y/=Be.canvas.height,Ie.height=Math.max(Ie.height,$e.size.y),Ie.x+=$e.size.x,Be.ctx.putImageData(ze,$e.texturePosition.x-this._workBoundingBox.left,$e.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,$e.size.x,$e.size.y),Be.addGlyph($e),Be.version++,$e}_findGlyphBoundingBox(j,M,I,B,H,F){M.top=0;const W=B?this._config.deviceCellHeight:this._tmpCanvas.height,G=B?this._config.deviceCellWidth:I;let Q=!1;for(let X=0;X<W;X++){for(let z=0;z<G;z++){const O=X*this._tmpCanvas.width*4+4*z+3;if(j.data[O]!==0){M.top=X,Q=!0;break}}if(Q)break}M.left=0,Q=!1;for(let X=0;X<F+G;X++){for(let z=0;z<W;z++){const O=z*this._tmpCanvas.width*4+4*X+3;if(j.data[O]!==0){M.left=X,Q=!0;break}}if(Q)break}M.right=G,Q=!1;for(let X=F+G-1;X>=F;X--){for(let z=0;z<W;z++){const O=z*this._tmpCanvas.width*4+4*X+3;if(j.data[O]!==0){M.right=X,Q=!0;break}}if(Q)break}M.bottom=W,Q=!1;for(let X=W-1;X>=0;X--){for(let z=0;z<G;z++){const O=X*this._tmpCanvas.width*4+4*z+3;if(j.data[O]!==0){M.bottom=X,Q=!0;break}}if(Q)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:M.right-M.left+1,y:M.bottom-M.top+1},sizeClipSpace:{x:M.right-M.left+1,y:M.bottom-M.top+1},offset:{x:-M.left+F+(B||H?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-M.top+F+(B||H?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}a.TextureAtlas=T;class D{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(j){this._glyphs.push(j),this._usedPixels+=j.size.x*j.size.y}constructor(j,M,I){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],I)for(const B of I)this._glyphs.push(...B.glyphs),this._usedPixels+=B._usedPixels;this.canvas=L(j,M,M),this.ctx=(0,c.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function R(A,j,M,I){const B=j.rgba>>>24,H=j.rgba>>>16&255,F=j.rgba>>>8&255,W=M.rgba>>>24,G=M.rgba>>>16&255,Q=M.rgba>>>8&255,X=Math.floor((Math.abs(B-W)+Math.abs(H-G)+Math.abs(F-Q))/12);let z=!0;for(let O=0;O<A.data.length;O+=4)A.data[O]===B&&A.data[O+1]===H&&A.data[O+2]===F||I&&Math.abs(A.data[O]-B)+Math.abs(A.data[O+1]-H)+Math.abs(A.data[O+2]-F)<X?A.data[O+3]=0:z=!1;return z}function L(A,j,M){const I=A.createElement("canvas");return I.width=j,I.height=M,I}},160:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let u=0,f=0,g=0,c=0;var _,x,C,y,m;function b(w){const T=w.toString(16);return T.length<2?"0"+T:T}function S(w,T){return w<T?(T+.05)/(w+.05):(w+.05)/(T+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(w){w.toCss=function(T,D,R,L){return L!==void 0?`#${b(T)}${b(D)}${b(R)}${b(L)}`:`#${b(T)}${b(D)}${b(R)}`},w.toRgba=function(T,D,R,L=255){return(T<<24|D<<16|R<<8|L)>>>0},w.toColor=function(T,D,R,L){return{css:w.toCss(T,D,R,L),rgba:w.toRgba(T,D,R,L)}}})(_||(a.channels=_={})),(function(w){function T(D,R){return c=Math.round(255*R),[u,f,g]=m.toChannels(D.rgba),{css:_.toCss(u,f,g,c),rgba:_.toRgba(u,f,g,c)}}w.blend=function(D,R){if(c=(255&R.rgba)/255,c===1)return{css:R.css,rgba:R.rgba};const L=R.rgba>>24&255,A=R.rgba>>16&255,j=R.rgba>>8&255,M=D.rgba>>24&255,I=D.rgba>>16&255,B=D.rgba>>8&255;return u=M+Math.round((L-M)*c),f=I+Math.round((A-I)*c),g=B+Math.round((j-B)*c),{css:_.toCss(u,f,g),rgba:_.toRgba(u,f,g)}},w.isOpaque=function(D){return(255&D.rgba)==255},w.ensureContrastRatio=function(D,R,L){const A=m.ensureContrastRatio(D.rgba,R.rgba,L);if(A)return _.toColor(A>>24&255,A>>16&255,A>>8&255)},w.opaque=function(D){const R=(255|D.rgba)>>>0;return[u,f,g]=m.toChannels(R),{css:_.toCss(u,f,g),rgba:R}},w.opacity=T,w.multiplyOpacity=function(D,R){return c=255&D.rgba,T(D,c*R/255)},w.toColorRGB=function(D){return[D.rgba>>24&255,D.rgba>>16&255,D.rgba>>8&255]}})(x||(a.color=x={})),(function(w){let T,D;try{const R=document.createElement("canvas");R.width=1,R.height=1;const L=R.getContext("2d",{willReadFrequently:!0});L&&(T=L,T.globalCompositeOperation="copy",D=T.createLinearGradient(0,0,1,1))}catch{}w.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),_.toColor(u,f,g);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),c=parseInt(R.slice(4,5).repeat(2),16),_.toColor(u,f,g,c);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const L=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return u=parseInt(L[1]),f=parseInt(L[2]),g=parseInt(L[3]),c=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),_.toColor(u,f,g,c);if(!T||!D)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=D,T.fillStyle=R,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[u,f,g,c]=T.getImageData(0,0,1,1).data,c!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(u,f,g,c),css:R}}})(C||(a.css=C={})),(function(w){function T(D,R,L){const A=D/255,j=R/255,M=L/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))}w.relativeLuminance=function(D){return T(D>>16&255,D>>8&255,255&D)},w.relativeLuminance2=T})(y||(a.rgb=y={})),(function(w){function T(R,L,A){const j=R>>24&255,M=R>>16&255,I=R>>8&255;let B=L>>24&255,H=L>>16&255,F=L>>8&255,W=S(y.relativeLuminance2(B,H,F),y.relativeLuminance2(j,M,I));for(;W<A&&(B>0||H>0||F>0);)B-=Math.max(0,Math.ceil(.1*B)),H-=Math.max(0,Math.ceil(.1*H)),F-=Math.max(0,Math.ceil(.1*F)),W=S(y.relativeLuminance2(B,H,F),y.relativeLuminance2(j,M,I));return(B<<24|H<<16|F<<8|255)>>>0}function D(R,L,A){const j=R>>24&255,M=R>>16&255,I=R>>8&255;let B=L>>24&255,H=L>>16&255,F=L>>8&255,W=S(y.relativeLuminance2(B,H,F),y.relativeLuminance2(j,M,I));for(;W<A&&(B<255||H<255||F<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),H=Math.min(255,H+Math.ceil(.1*(255-H))),F=Math.min(255,F+Math.ceil(.1*(255-F))),W=S(y.relativeLuminance2(B,H,F),y.relativeLuminance2(j,M,I));return(B<<24|H<<16|F<<8|255)>>>0}w.blend=function(R,L){if(c=(255&L)/255,c===1)return L;const A=L>>24&255,j=L>>16&255,M=L>>8&255,I=R>>24&255,B=R>>16&255,H=R>>8&255;return u=I+Math.round((A-I)*c),f=B+Math.round((j-B)*c),g=H+Math.round((M-H)*c),_.toRgba(u,f,g)},w.ensureContrastRatio=function(R,L,A){const j=y.relativeLuminance(R>>8),M=y.relativeLuminance(L>>8);if(S(j,M)<A){if(M<j){const H=T(R,L,A),F=S(j,y.relativeLuminance(H>>8));if(F<A){const W=D(R,L,A);return F>S(j,y.relativeLuminance(W>>8))?H:W}return H}const I=D(R,L,A),B=S(j,y.relativeLuminance(I>>8));if(B<A){const H=T(R,L,A);return B>S(j,y.relativeLuminance(H>>8))?I:H}return I}},w.reduceLuminance=T,w.increaseLuminance=D,w.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(m||(a.rgba=m={})),a.toPaddedHex=b,a.contrastRatio=S},345:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const g=[];for(let c=0;c<this._listeners.length;c++)g.push(this._listeners[c]);for(let c=0;c<g.length;c++)g[c].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,f){return u((g=>f.fire(g)))},a.runAndSubscribe=function(u,f){return f(void 0),u((g=>f(g)))}},859:(p,a)=>{function u(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},a.toDisposable=function(f){return{dispose:f}},a.disposeArray=u,a.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},485:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,c,_){this._data[g]||(this._data[g]={}),this._data[g][c]=_}get(g,c){return this._data[g]?this._data[g][c]:void 0}clear(){this._data={}}}a.TwoKeyMap=u,a.FourKeyMap=class{constructor(){this._data=new u}set(f,g,c,_,x){this._data.get(f,g)||this._data.set(f,g,new u),this._data.get(f,g).set(c,_,x)}get(f,g,c,_){var x;return(x=this._data.get(f,g))==null?void 0:x.get(c,_)}clear(){this._data.clear()}}},399:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const u=a.isNode?"node":navigator.userAgent,f=a.isNode?"node":navigator.platform;a.isFirefox=u.includes("Firefox"),a.isLegacyEdge=u.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(u),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),a.isIpad=f==="iPad",a.isIphone=f==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),a.isLinux=f.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(u)},385:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const f=u(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let C=0,y=0,m=x.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),y=Math.max(C,y),b=x.timeRemaining(),1.5*y>b)return m-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-C))}ms`),void this._start();m=b}this.clear()}}class c extends g{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}a.PriorityTaskQueue=c,a.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:c,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},147:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new u;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=u;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}get underlineVariantOffset(){const c=(3758096384&this._ext)>>29;return c<0?4294967288^c:c}set underlineVariantOffset(c){this._ext&=536870911,this._ext|=c<<29&3758096384}constructor(c=0,_=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=f},782:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const f=u(133),g=u(855),c=u(147);class _ extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const y=new _;return y.setFromCharData(C),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(C[g.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(C[g.CHAR_DATA_CHAR_INDEX].length===2){const m=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const b=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(m-55296)+b-56320+65536|C[g.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[g.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=C[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=_},855:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},133:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},a.utf32ToString=function(u,f=0,g=u.length){let c="";for(let _=f;_<g;++_){let x=u[_];x>65535?(x-=65536,c+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):c+=String.fromCharCode(x)}return c},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const g=u.length;if(!g)return 0;let c=0,_=0;if(this._interim){const x=u.charCodeAt(_++);56320<=x&&x<=57343?f[c++]=1024*(this._interim-55296)+x-56320+65536:(f[c++]=this._interim,f[c++]=x),this._interim=0}for(let x=_;x<g;++x){const C=u.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=g)return this._interim=C,c;const y=u.charCodeAt(x);56320<=y&&y<=57343?f[c++]=1024*(C-55296)+y-56320+65536:(f[c++]=C,f[c++]=y)}else C!==65279&&(f[c++]=C)}return c}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const g=u.length;if(!g)return 0;let c,_,x,C,y=0,m=0,b=0;if(this.interim[0]){let T=!1,D=this.interim[0];D&=(224&D)==192?31:(240&D)==224?15:7;let R,L=0;for(;(R=63&this.interim[++L])&&L<4;)D<<=6,D|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=A-L;for(;b<j;){if(b>=g)return 0;if(R=u[b++],(192&R)!=128){b--,T=!0;break}this.interim[L++]=R,D<<=6,D|=63&R}T||(A===2?D<128?b--:f[y++]=D:A===3?D<2048||D>=55296&&D<=57343||D===65279||(f[y++]=D):D<65536||D>1114111||(f[y++]=D)),this.interim.fill(0)}const S=g-4;let w=b;for(;w<g;){for(;!(!(w<S)||128&(c=u[w])||128&(_=u[w+1])||128&(x=u[w+2])||128&(C=u[w+3]));)f[y++]=c,f[y++]=_,f[y++]=x,f[y++]=C,w+=4;if(c=u[w++],c<128)f[y++]=c;else if((224&c)==192){if(w>=g)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(m=(31&c)<<6|63&_,m<128){w--;continue}f[y++]=m}else if((240&c)==224){if(w>=g)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(w>=g)return this.interim[0]=c,this.interim[1]=_,y;if(x=u[w++],(192&x)!=128){w--;continue}if(m=(15&c)<<12|(63&_)<<6|63&x,m<2048||m>=55296&&m<=57343||m===65279)continue;f[y++]=m}else if((248&c)==240){if(w>=g)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(w>=g)return this.interim[0]=c,this.interim[1]=_,y;if(x=u[w++],(192&x)!=128){w--;continue}if(w>=g)return this.interim[0]=c,this.interim[1]=_,this.interim[2]=x,y;if(C=u[w++],(192&C)!=128){w--;continue}if(m=(7&c)<<18|(63&_)<<12|(63&x)<<6|63&C,m<65536||m>1114111)continue;f[y++]=m}}return y}}},776:function(p,a,u){var f=this&&this.__decorate||function(m,b,S,w){var T,D=arguments.length,R=D<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,b,S,w);else for(var L=m.length-1;L>=0;L--)(T=m[L])&&(R=(D<3?T(R):D>3?T(b,S,R):T(b,S))||R);return D>3&&R&&Object.defineProperty(b,S,R),R},g=this&&this.__param||function(m,b){return function(S,w){b(S,w,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const c=u(859),_=u(97),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let C,y=a.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let b=0;b<m.length;b++)typeof m[b]=="function"&&(m[b]=m[b]())}_log(m,b,S){this._evalLazyOptionalParams(S),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...S)}trace(m,...b){var S;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.trace.bind(this._optionsService.options.logger))??console.log,m,b)}debug(m,...b){var S;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.debug.bind(this._optionsService.options.logger))??console.log,m,b)}info(m,...b){var S;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.info.bind(this._optionsService.options.logger))??console.info,m,b)}warn(m,...b){var S;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.warn.bind(this._optionsService.options.logger))??console.warn,m,b)}error(m,...b){var S;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.error.bind(this._optionsService.options.logger))??console.error,m,b)}};a.LogService=y=f([g(0,_.IOptionsService)],y),a.setTraceLogger=function(m){C=m},a.traceCall=function(m,b,S){if(typeof S.value!="function")throw new Error("not supported");const w=S.value;S.value=function(...T){if(C.logLevel!==_.LogLevelEnum.TRACE)return w.apply(this,T);C.trace(`GlyphRenderer#${w.name}(${T.map((R=>JSON.stringify(R))).join(", ")})`);const D=w.apply(this,T);return C.trace(`GlyphRenderer#${w.name} return`,D),D}}},726:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const u="di$target",f="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[f]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const c=function(_,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,m,b){m[u]===m?m[f].push({id:y,index:b}):(m[f]=[{id:y,index:b}],m[u]=m)})(c,_,C)};return c.toString=()=>g,a.serviceRegistry.set(g,c),c}},97:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const f=u(726);var g;a.IBufferService=(0,f.createDecorator)("BufferService"),a.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),a.ICoreService=(0,f.createDecorator)("CoreService"),a.ICharsetService=(0,f.createDecorator)("CharsetService"),a.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(g||(a.LogLevelEnum=g={})),a.ILogService=(0,f.createDecorator)("LogService"),a.IOptionsService=(0,f.createDecorator)("OptionsService"),a.IOscLinkService=(0,f.createDecorator)("OscLinkService"),a.IUnicodeService=(0,f.createDecorator)("UnicodeService"),a.IDecorationService=(0,f.createDecorator)("DecorationService")}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var u=s[p]={exports:{}};return r[p].call(u.exports,u,u.exports,l),u.exports}var d={};return(()=>{var p=d;Object.defineProperty(p,"__esModule",{value:!0}),p.WebglAddon=void 0;const a=l(345),u=l(859),f=l(399),g=l(666),c=l(776);class _ extends u.Disposable{constructor(C){if(f.isSafari&&(0,f.getSafariVersion)()<16){const y={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",y))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=C,this._onChangeTextureAtlas=this.register(new a.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new a.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new a.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new a.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(C){const y=C._core;if(!C.element)return void this.register(y.onWillOpen((()=>this.activate(C))));this._terminal=C;const m=y.coreService,b=y.optionsService,S=y,w=S._renderService,T=S._characterJoinerService,D=S._charSizeService,R=S._coreBrowserService,L=S._decorationService,A=S._logService,j=S._themeService;(0,c.setTraceLogger)(A),this._renderer=this.register(new g.WebglRenderer(C,T,D,R,m,L,b,j,this._preserveDrawingBuffer)),this.register((0,a.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,a.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,a.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,a.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),w.setRenderer(this._renderer),this.register((0,u.toDisposable)((()=>{const M=this._terminal._core._renderService;M.setRenderer(this._terminal._core._createRenderer()),M.handleResize(C.cols,C.rows)})))}get textureAtlas(){var C;return(C=this._renderer)==null?void 0:C.textureAtlas}clearTextureAtlas(){var C;(C=this._renderer)==null||C.clearTextureAtlas()}}p.WebglAddon=_})(),d})()))})(_m)),_m.exports}var Q9=X9(),xm={exports:{}},_w;function Z9(){return _w||(_w=1,(function(e,i){(function(r,s){e.exports=s()})(globalThis,(()=>(()=>{var r={4567:function(p,a,u){var f=this&&this.__decorate||function(S,w,T,D){var R,L=arguments.length,A=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,w,T,D);else for(var j=S.length-1;j>=0;j--)(R=S[j])&&(A=(L<3?R(A):L>3?R(w,T,A):R(w,T))||A);return L>3&&A&&Object.defineProperty(w,T,A),A},g=this&&this.__param||function(S,w){return function(T,D){w(T,D,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const c=u(9042),_=u(9924),x=u(844),C=u(4725),y=u(2585),m=u(3656);let b=a.AccessibilityManager=class extends x.Disposable{constructor(S,w,T,D){super(),this._terminal=S,this._coreBrowserService=T,this._renderService=D,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
621
- `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,m.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(S){for(let w=0;w<S;w++)this._handleChar(" ")}_handleChar(S){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==S&&(this._charsToAnnounce+=S):this._charsToAnnounce+=S,S===`
622
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=c.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(S){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(S)||this._charsToConsume.push(S)}_refreshRows(S,w){this._liveRegionDebouncer.refresh(S,w,this._terminal.rows)}_renderRows(S,w){const T=this._terminal.buffer,D=T.lines.length.toString();for(let R=S;R<=w;R++){const L=T.lines.get(T.ydisp+R),A=[],j=(L==null?void 0:L.translateToString(!0,void 0,void 0,A))||"",M=(T.ydisp+R+1).toString(),I=this._rowElements[R];I&&(j.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=j,this._rowColumns.set(I,A)),I.setAttribute("aria-posinset",M),I.setAttribute("aria-setsize",D))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(S,w){const T=S.target,D=this._rowElements[w===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(w===0?"1":`${this._terminal.buffer.lines.length}`)||S.relatedTarget!==D)return;let R,L;if(w===0?(R=T,L=this._rowElements.pop(),this._rowContainer.removeChild(L)):(R=this._rowElements.shift(),L=T,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),L.removeEventListener("focus",this._bottomBoundaryFocusListener),w===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(w===0?-1:1),this._rowElements[w===0?1:this._rowElements.length-2].focus(),S.preventDefault(),S.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const S=document.getSelection();if(!S)return;if(S.isCollapsed)return void(this._rowContainer.contains(S.anchorNode)&&this._terminal.clearSelection());if(!S.anchorNode||!S.focusNode)return void console.error("anchorNode and/or focusNode are null");let w={node:S.anchorNode,offset:S.anchorOffset},T={node:S.focusNode,offset:S.focusOffset};if((w.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||w.node===T.node&&w.offset>T.offset)&&([w,T]=[T,w]),w.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(w={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(w.node))return;const D=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(D)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:D,offset:((j=D.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(T.node))return;const R=({node:M,offset:I})=>{const B=M instanceof Text?M.parentNode:M;let H=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(B);if(!F)return console.warn("columns is null. Race condition?"),null;let W=I<F.length?F[I]:F.slice(-1)[0]+1;return W>=this._terminal.cols&&(++H,W=0),{row:H,column:W}},L=R(w),A=R(T);if(L&&A){if(L.row>A.row||L.row===A.row&&L.column>=A.column)throw new Error("invalid range");this._terminal.select(L.column,L.row,(A.row-L.row)*this._terminal.cols-L.column+A.column)}}_handleResize(S){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let w=this._rowContainer.children.length;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);for(;this._rowElements.length>S;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const S=this._coreBrowserService.mainDocument.createElement("div");return S.setAttribute("role","listitem"),S.tabIndex=-1,this._refreshRowDimensions(S),S}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let S=0;S<this._terminal.rows;S++)this._refreshRowDimensions(this._rowElements[S])}}_refreshRowDimensions(S){S.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=b=f([g(1,y.IInstantiationService),g(2,C.ICoreBrowserService),g(3,C.IRenderService)],b)},3614:(p,a)=>{function u(_){return _.replace(/\r?\n/g,"\r")}function f(_,x){return x?"\x1B[200~"+_+"\x1B[201~":_}function g(_,x,C,y){_=f(_=u(_),C.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(_,!0),x.value=""}function c(_,x,C){const y=C.getBoundingClientRect(),m=_.clientX-y.left-10,b=_.clientY-y.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${m}px`,x.style.top=`${b}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=u,a.bracketTextForPaste=f,a.copyHandler=function(_,x){_.clipboardData&&_.clipboardData.setData("text/plain",x.selectionText),_.preventDefault()},a.handlePasteEvent=function(_,x,C,y){_.stopPropagation(),_.clipboardData&&g(_.clipboardData.getData("text/plain"),x,C,y)},a.paste=g,a.moveTextAreaUnderMouseCursor=c,a.rightClickHandler=function(_,x,C,y,m){c(_,x,C),m&&y.rightClickSelect(_),x.value=y.selectionText,x.select()}},7239:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const f=u(1505);a.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(g,c,_){this._css.set(g,c,_)}getCss(g,c){return this._css.get(g,c)}setColor(g,c,_){this._color.set(g,c,_)}getColor(g,c){return this._color.get(g,c)}clear(){this._color.clear(),this._css.clear()}}},3656:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(u,f,g,c){u.addEventListener(f,g,c);let _=!1;return{dispose:()=>{_||(_=!0,u.removeEventListener(f,g,c))}}}},3551:function(p,a,u){var f=this&&this.__decorate||function(b,S,w,T){var D,R=arguments.length,L=R<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,w):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,S,w,T);else for(var A=b.length-1;A>=0;A--)(D=b[A])&&(L=(R<3?D(L):R>3?D(S,w,L):D(S,w))||L);return R>3&&L&&Object.defineProperty(S,w,L),L},g=this&&this.__param||function(b,S){return function(w,T){S(w,T,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const c=u(3656),_=u(8460),x=u(844),C=u(2585),y=u(4725);let m=a.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(b,S,w,T,D){super(),this._element=b,this._mouseService=S,this._renderService=w,this._bufferService=T,this._linkProviderService=D,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,c.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,c.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const S=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!S)return;this._isMouseOut=!1;const w=b.composedPath();for(let T=0;T<w.length;T++){const D=w[T];if(D.classList.contains("xterm"))break;if(D.classList.contains("xterm-hover"))return}this._lastBufferCell&&S.x===this._lastBufferCell.x&&S.y===this._lastBufferCell.y||(this._handleHover(S),this._lastBufferCell=S)}_handleHover(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,S){var T,D;this._activeProviderReplies&&S||((T=this._activeProviderReplies)==null||T.forEach((R=>{R==null||R.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let w=!1;for(const[R,L]of this._linkProviderService.linkProviders.entries())S?(D=this._activeProviderReplies)!=null&&D.get(R)&&(w=this._checkLinkProviderResult(R,b,w)):L.provideLinks(b.y,(A=>{var M,I;if(this._isMouseOut)return;const j=A==null?void 0:A.map((B=>({link:B})));(M=this._activeProviderReplies)==null||M.set(R,j),w=this._checkLinkProviderResult(R,b,w),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,S){const w=new Set;for(let T=0;T<S.size;T++){const D=S.get(T);if(D)for(let R=0;R<D.length;R++){const L=D[R],A=L.link.range.start.y<b?0:L.link.range.start.x,j=L.link.range.end.y>b?this._bufferService.cols:L.link.range.end.x;for(let M=A;M<=j;M++){if(w.has(M)){D.splice(R--,1);break}w.add(M)}}}}_checkLinkProviderResult(b,S,w){var R;if(!this._activeProviderReplies)return w;const T=this._activeProviderReplies.get(b);let D=!1;for(let L=0;L<b;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(D=!0);if(!D&&T){const L=T.find((A=>this._linkAtPosition(A.link,S)));L&&(w=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!w)for(let L=0;L<this._activeProviderReplies.size;L++){const A=(R=this._activeProviderReplies.get(L))==null?void 0:R.find((j=>this._linkAtPosition(j.link,S)));if(A){w=!0,this._handleNewLink(A);break}}return w}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const S=this._positionFromMouseEvent(b,this._element,this._mouseService);S&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,S)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,S){this._currentLink&&this._lastMouseEvent&&(!b||!S||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=S)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._linkAtPosition(b.link,S)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var w,T;return(T=(w=this._currentLink)==null?void 0:w.state)==null?void 0:T.decorations.pointerCursor},set:w=>{var T;(T=this._currentLink)!=null&&T.state&&this._currentLink.state.decorations.pointerCursor!==w&&(this._currentLink.state.decorations.pointerCursor=w,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",w))}},underline:{get:()=>{var w,T;return(T=(w=this._currentLink)==null?void 0:w.state)==null?void 0:T.decorations.underline},set:w=>{var T,D,R;(T=this._currentLink)!=null&&T.state&&((R=(D=this._currentLink)==null?void 0:D.state)==null?void 0:R.decorations.underline)!==w&&(this._currentLink.state.decorations.underline=w,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,w))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((w=>{if(!this._currentLink)return;const T=w.start===0?0:w.start+1+this._bufferService.buffer.ydisp,D=this._bufferService.buffer.ydisp+1+w.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=D&&(this._clearCurrentLink(T,D),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(b,S,w){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),S.hover&&S.hover(w,S.text)}_fireUnderlineEvent(b,S){const w=b.range,T=this._bufferService.buffer.ydisp,D=this._createLinkUnderlineEvent(w.start.x-1,w.start.y-T-1,w.end.x,w.end.y-T-1,void 0);(S?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(D)}_linkLeave(b,S,w){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),S.leave&&S.leave(w,S.text)}_linkAtPosition(b,S){const w=b.range.start.y*this._bufferService.cols+b.range.start.x,T=b.range.end.y*this._bufferService.cols+b.range.end.x,D=S.y*this._bufferService.cols+S.x;return w<=D&&D<=T}_positionFromMouseEvent(b,S,w){const T=w.getCoords(b,S,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,S,w,T,D){return{x1:b,y1:S,x2:w,y2:T,cols:this._bufferService.cols,fg:D}}};a.Linkifier=m=f([g(1,y.IMouseService),g(2,y.IRenderService),g(3,C.IBufferService),g(4,y.ILinkProviderService)],m)},9042:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(p,a,u){var f=this&&this.__decorate||function(y,m,b,S){var w,T=arguments.length,D=T<3?m:S===null?S=Object.getOwnPropertyDescriptor(m,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,m,b,S);else for(var R=y.length-1;R>=0;R--)(w=y[R])&&(D=(T<3?w(D):T>3?w(m,b,D):w(m,b))||D);return T>3&&D&&Object.defineProperty(m,b,D),D},g=this&&this.__param||function(y,m){return function(b,S){m(b,S,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const c=u(511),_=u(2585);let x=a.OscLinkProvider=class{constructor(y,m,b){this._bufferService=y,this._optionsService=m,this._oscLinkService=b}provideLinks(y,m){var j;const b=this._bufferService.buffer.lines.get(y-1);if(!b)return void m(void 0);const S=[],w=this._optionsService.rawOptions.linkHandler,T=new c.CellData,D=b.getTrimmedLength();let R=-1,L=-1,A=!1;for(let M=0;M<D;M++)if(L!==-1||b.hasContent(M)){if(b.loadCell(M,T),T.hasExtendedAttrs()&&T.extended.urlId){if(L===-1){L=M,R=T.extended.urlId;continue}A=T.extended.urlId!==R}else L!==-1&&(A=!0);if(A||L!==-1&&M===D-1){const I=(j=this._oscLinkService.getLinkData(R))==null?void 0:j.uri;if(I){const B={start:{x:L+1,y},end:{x:M+(A||M!==D-1?0:1),y}};let H=!1;if(!(w!=null&&w.allowNonHttpProtocols))try{const F=new URL(I);["http:","https:"].includes(F.protocol)||(H=!0)}catch{H=!0}H||S.push({text:I,range:B,activate:(F,W)=>w?w.activate(F,W,B):C(0,W),hover:(F,W)=>{var G;return(G=w==null?void 0:w.hover)==null?void 0:G.call(w,F,W,B)},leave:(F,W)=>{var G;return(G=w==null?void 0:w.leave)==null?void 0:G.call(w,F,W,B)}})}A=!1,T.hasExtendedAttrs()&&T.extended.urlId?(L=M,R=T.extended.urlId):(L=-1,R=-1)}}m(S)}};function C(y,m){if(confirm(`Do you want to navigate to ${m}?
623
-
624
- WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=x=f([g(0,_.IBufferService),g(1,_.IOptionsService),g(2,_.IOscLinkService)],x)},6193:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(u,f){this._renderCallback=u,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,f,g){this._rowCount=g,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const f=u(3614),g=u(3656),c=u(3551),_=u(9042),x=u(3730),C=u(1680),y=u(3107),m=u(5744),b=u(2950),S=u(1296),w=u(428),T=u(4269),D=u(5114),R=u(8934),L=u(3230),A=u(9312),j=u(4725),M=u(6731),I=u(8055),B=u(8969),H=u(8460),F=u(844),W=u(6114),G=u(8437),Q=u(2584),X=u(7399),z=u(5941),O=u(9074),Y=u(2585),Z=u(5435),U=u(4567),V=u(779);class ne extends B.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(K={}){super(K),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(Y.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(V.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,oe)=>this.refresh($,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,F.toDisposable)((()=>{var $,oe;this._customKeyEventHandler=void 0,(oe=($=this.element)==null?void 0:$.parentNode)==null||oe.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const $ of K){let oe,ee="";switch($.index){case 256:oe="foreground",ee="10";break;case 257:oe="background",ee="11";break;case 258:oe="cursor",ee="12";break;default:oe="ansi",ee="4;"+$.index}switch($.type){case 0:const ue=I.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${ee};${(0,z.toRgbString)(ue)}${Q.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((he=>he.ansi[$.index]=I.channels.toColor(...$.color)));else{const he=oe;this._themeService.modifyColors((Se=>Se[he]=I.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const K=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(K);if(!$)return;const oe=Math.min(this.buffer.x,this.cols-1),ee=this._renderService.dimensions.css.cell.height,ue=$.getWidth(oe),he=this._renderService.dimensions.css.cell.width*ue,Se=this.buffer.y*this._renderService.dimensions.css.cell.height,we=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=we+"px",this.textarea.style.top=Se+"px",this.textarea.style.width=he+"px",this.textarea.style.height=ee+"px",this.textarea.style.lineHeight=ee+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,f.copyHandler)($,this._selectionService)})));const K=$=>(0,f.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,g.addDisposableDomListener)(this.element,"paste",K)),W.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,f.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,f.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,f.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var oe;if(!K)throw new Error("Terminal requires a parent element.");if(K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((oe=this.element)==null?void 0:oe.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=K.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),K.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(ee=>this.updateCursorStyle(ee)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),W.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(D.CoreBrowserService,this.textarea,K.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(ee=>this._handleTextAreaFocus(ee)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(w.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(M.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(T.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(L.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ee=>this._onRender.fire(ee)))),this.onResize((ee=>this._renderService.resize(ee.cols,ee.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(c.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ee=>this._renderService.handleSelectionChanged(ee.start,ee.end,ee.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ee=>{this.textarea.value=ee,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ee=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(ee=>this._selectionService.handleMouseDown(ee)))),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(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ee=>this._handleScreenReaderModeOptionChange(ee)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ee=>{!this._overviewRulerRenderer&&ee&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(S.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,$=this.element;function oe(he){const Se=K._mouseService.getMouseReportCoords(he,K.screenElement);if(!Se)return!1;let we,Re;switch(he.overrideType||he.type){case"mousemove":Re=32,he.buttons===void 0?(we=3,he.button!==void 0&&(we=he.button<3?he.button:3)):we=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Re=0,we=he.button<3?he.button:3;break;case"mousedown":Re=1,we=he.button<3?he.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(he)===!1||K.viewport.getLinesScrolled(he)===0)return!1;Re=he.deltaY<0?0:1,we=4;break;default:return!1}return!(Re===void 0||we===void 0||we>4)&&K.coreMouseService.triggerMouseEvent({col:Se.col,row:Se.row,x:Se.x,y:Se.y,button:we,action:Re,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ue={mouseup:he=>(oe(he),he.buttons||(this._document.removeEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.removeEventListener("mousemove",ee.mousedrag)),this.cancel(he)),wheel:he=>(oe(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&oe(he)},mousemove:he=>{he.buttons||oe(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&he?ee.mousemove||($.addEventListener("mousemove",ue.mousemove),ee.mousemove=ue.mousemove):($.removeEventListener("mousemove",ee.mousemove),ee.mousemove=null),16&he?ee.wheel||($.addEventListener("wheel",ue.wheel,{passive:!1}),ee.wheel=ue.wheel):($.removeEventListener("wheel",ee.wheel),ee.wheel=null),2&he?ee.mouseup||(ee.mouseup=ue.mouseup):(this._document.removeEventListener("mouseup",ee.mouseup),ee.mouseup=null),4&he?ee.mousedrag||(ee.mousedrag=ue.mousedrag):(this._document.removeEventListener("mousemove",ee.mousedrag),ee.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)($,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return oe(he),ee.mouseup&&this._document.addEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.addEventListener("mousemove",ee.mousedrag),this.cancel(he)}))),this.register((0,g.addDisposableDomListener)($,"wheel",(he=>{if(!ee.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const Se=this.viewport.getLinesScrolled(he);if(Se===0)return;const we=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Re="";for(let qe=0;qe<Math.abs(Se);qe++)Re+=we;return this.coreService.triggerDataEvent(Re,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)($,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,g.addDisposableDomListener)($,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(K,$){var oe;(oe=this._renderService)==null||oe.refreshRows(K,$)}updateCursorStyle(K){var $;($=this._selectionService)!=null&&$.shouldColumnSelect(K)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(K,$,oe=0){var ee;oe===1?(super.scrollLines(K,$,oe),this.refresh(0,this.rows-1)):(ee=this.viewport)==null||ee.scrollLines(K)}paste(K){(0,f.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,$,oe){this._selectionService.setSelection(K,$,oe)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,$){var oe;(oe=this._selectionService)==null||oe.selectLines(K,$)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!$&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,X.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),oe.type===3||oe.type===2){const ee=this.rows-1;return this.scrollLines(oe.type===2?-ee:ee),this.cancel(K,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(oe.cancel&&this.cancel(K,!0),!oe.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==Q.C0.ETX&&oe.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,$){const oe=K.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||K.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||K.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?oe:oe&&(!$.keyCode||$.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)$=K.charCode;else if(K.which===null||K.which===void 0)$=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;$=K.which}return!(!$||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=K.data;return this.coreService.triggerDataEvent($,!0),this.cancel(K),!0}return!1}resize(K,$){K!==this.cols||$!==this.rows?super.resize(K,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,$){var oe,ee;(oe=this._charSizeService)==null||oe.measure(),(ee=this.viewport)==null||ee.syncScrollArea(!0)}clear(){var K;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let $=1;$<this.rows;$++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var $,oe;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),($=this._selectionService)==null||$.reset(),this._decorationService.reset(),(oe=this.viewport)==null||oe.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent(Q.C0.ESC+"[I"):this.coreService.triggerDataEvent(Q.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case Z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[4;${oe};${$}t`);break;case Z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ee=this._renderService.dimensions.css.cell.width.toFixed(0),ue=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[6;${ue};${ee}t`)}}cancel(K,$){if(this.options.cancelEvents||$)return K.preventDefault(),K.stopPropagation(),!1}}a.Terminal=ne},9924:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(u,f=1e3){this._renderCallback=u,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,f,g){this._rowCount=g,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const c=Date.now();if(c-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=c,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=c-this._lastRefreshMs,x=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f)}}},1680:function(p,a,u){var f=this&&this.__decorate||function(b,S,w,T){var D,R=arguments.length,L=R<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,w):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,S,w,T);else for(var A=b.length-1;A>=0;A--)(D=b[A])&&(L=(R<3?D(L):R>3?D(S,w,L):D(S,w))||L);return R>3&&L&&Object.defineProperty(S,w,L),L},g=this&&this.__param||function(b,S){return function(w,T){S(w,T,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const c=u(3656),_=u(4725),x=u(8460),C=u(844),y=u(2585);let m=a.Viewport=class extends C.Disposable{constructor(b,S,w,T,D,R,L,A){super(),this._viewportElement=b,this._scrollArea=S,this._bufferService=w,this._optionsService=T,this._charSizeService=D,this._renderService=R,this._coreBrowserService=L,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,c.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const S=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==S&&(this._lastRecordedBufferHeight=S,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const S=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,S){const w=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(S<0&&this._viewportElement.scrollTop!==0||S>0&&w<this._lastRecordedBufferHeight)||(b.cancelable&&b.preventDefault(),!1)}handleWheel(b){const S=this._getPixelsScrolled(b);return S!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+S:this._smoothScrollState.target+=S,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=S,this._bubbleScroll(b,S))}scrollLines(b){if(b!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const S=b*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+S,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!1})}_getPixelsScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let S=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_LINE?S*=this._currentRowHeight:b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._currentRowHeight*this._bufferService.rows),S}getBufferElements(b,S){var A;let w,T="";const D=[],R=S??this._bufferService.buffer.lines.length,L=this._bufferService.buffer.lines;for(let j=b;j<R;j++){const M=L.get(j);if(!M)continue;const I=(A=L.get(j+1))==null?void 0:A.isWrapped;if(T+=M.translateToString(!I),!I||j===L.length-1){const B=document.createElement("div");B.textContent=T,D.push(B),T.length>0&&(w=B),T=""}}return{bufferElements:D,cursorElement:w}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let S=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(S/=this._currentRowHeight+0,this._wheelPartialScroll+=S,S=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._bufferService.rows),S}_applyScrollModifier(b,S){const w=this._optionsService.rawOptions.fastScrollModifier;return w==="alt"&&S.altKey||w==="ctrl"&&S.ctrlKey||w==="shift"&&S.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const S=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,S!==0&&(this._viewportElement.scrollTop+=S,this._bubbleScroll(b,S))}};a.Viewport=m=f([g(2,y.IBufferService),g(3,y.IOptionsService),g(4,_.ICharSizeService),g(5,_.IRenderService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],m)},3107:function(p,a,u){var f=this&&this.__decorate||function(y,m,b,S){var w,T=arguments.length,D=T<3?m:S===null?S=Object.getOwnPropertyDescriptor(m,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,m,b,S);else for(var R=y.length-1;R>=0;R--)(w=y[R])&&(D=(T<3?w(D):T>3?w(m,b,D):w(m,b))||D);return T>3&&D&&Object.defineProperty(m,b,D),D},g=this&&this.__param||function(y,m){return function(b,S){m(b,S,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const c=u(4725),_=u(844),x=u(2585);let C=a.BufferDecorationRenderer=class extends _.Disposable{constructor(y,m,b,S,w){super(),this._screenElement=y,this._bufferService=m,this._coreBrowserService=b,this._decorationService=S,this._renderService=w,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((T=>this._removeDecoration(T)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const y of this._decorationService.decorations)this._renderDecoration(y);this._dimensionsChanged=!1}_renderDecoration(y){this._refreshStyle(y),this._dimensionsChanged&&this._refreshXPosition(y)}_createElement(y){var S;const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((S=y==null?void 0:y.options)==null?void 0:S.layer)==="top"),m.style.width=`${Math.round((y.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(y.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(y.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=y.options.x??0;return b&&b>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(y,m),m}_refreshStyle(y){const m=y.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)y.element&&(y.element.style.display="none",y.onRenderEmitter.fire(y.element));else{let b=this._decorationElements.get(y);b||(b=this._createElement(y),y.element=b,this._decorationElements.set(y,b),this._container.appendChild(b),y.onDispose((()=>{this._decorationElements.delete(y),b.remove()}))),b.style.top=m*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",y.onRenderEmitter.fire(b)}}_refreshXPosition(y,m=y.element){if(!m)return;const b=y.options.x??0;(y.options.anchor||"left")==="right"?m.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(y){var m;(m=this._decorationElements.get(y))==null||m.remove(),this._decorationElements.delete(y),y.dispose()}};a.BufferDecorationRenderer=C=f([g(1,x.IBufferService),g(2,c.ICoreBrowserService),g(3,x.IDecorationService),g(4,c.IRenderService)],C)},5871:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const f of this._zones)if(f.color===u.options.overviewRulerOptions.color&&f.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,u.marker.line))return;if(this._lineAdjacentToZone(f,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(f,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,f){return f>=u.startBufferLine&&f<=u.endBufferLine}_lineAdjacentToZone(u,f,g){return f>=u.startBufferLine-this._linePadding[g||"full"]&&f<=u.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(u,f){u.startBufferLine=Math.min(u.startBufferLine,f),u.endBufferLine=Math.max(u.endBufferLine,f)}}},5744:function(p,a,u){var f=this&&this.__decorate||function(w,T,D,R){var L,A=arguments.length,j=A<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,D):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,T,D,R);else for(var M=w.length-1;M>=0;M--)(L=w[M])&&(j=(A<3?L(j):A>3?L(T,D,j):L(T,D))||j);return A>3&&j&&Object.defineProperty(T,D,j),j},g=this&&this.__param||function(w,T){return function(D,R){T(D,R,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const c=u(5871),_=u(4725),x=u(844),C=u(2585),y={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let S=a.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(w,T,D,R,L,A,j){var I;super(),this._viewportElement=w,this._screenElement=T,this._bufferService=D,this._decorationService=R,this._renderService=L,this._optionsService=A,this._coreBrowserService=j,this._colorZoneStore=new c.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const M=this._canvas.getContext("2d");if(!M)throw new Error("Ctx cannot be null");this._ctx=M,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var B;(B=this._canvas)==null||B.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const w=Math.floor(this._canvas.width/3),T=Math.ceil(this._canvas.width/3);m.full=this._canvas.width,m.left=w,m.center=T,m.right=w,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=m.left,b.right=m.left+m.center}_refreshDrawHeightConstants(){y.full=Math.round(2*this._coreBrowserService.dpr);const w=this._canvas.height/this._bufferService.buffer.lines.length,T=Math.round(Math.max(Math.min(w,12),6)*this._coreBrowserService.dpr);y.left=T,y.center=T,y.right=T}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const T of this._decorationService.decorations)this._colorZoneStore.addDecoration(T);this._ctx.lineWidth=1;const w=this._colorZoneStore.zones;for(const T of w)T.position!=="full"&&this._renderColorZone(T);for(const T of w)T.position==="full"&&this._renderColorZone(T);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(w){this._ctx.fillStyle=w.color,this._ctx.fillRect(b[w.position||"full"],Math.round((this._canvas.height-1)*(w.startBufferLine/this._bufferService.buffers.active.lines.length)-y[w.position||"full"]/2),m[w.position||"full"],Math.round((this._canvas.height-1)*((w.endBufferLine-w.startBufferLine)/this._bufferService.buffers.active.lines.length)+y[w.position||"full"]))}_queueRefresh(w,T){this._shouldUpdateDimensions=w||this._shouldUpdateDimensions,this._shouldUpdateAnchor=T||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=S=f([g(2,C.IBufferService),g(3,C.IDecorationService),g(4,_.IRenderService),g(5,C.IOptionsService),g(6,_.ICoreBrowserService)],S)},2950:function(p,a,u){var f=this&&this.__decorate||function(y,m,b,S){var w,T=arguments.length,D=T<3?m:S===null?S=Object.getOwnPropertyDescriptor(m,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,m,b,S);else for(var R=y.length-1;R>=0;R--)(w=y[R])&&(D=(T<3?w(D):T>3?w(m,b,D):w(m,b))||D);return T>3&&D&&Object.defineProperty(m,b,D),D},g=this&&this.__param||function(y,m){return function(b,S){m(b,S,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const c=u(4725),_=u(2585),x=u(2584);let C=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,m,b,S,w,T){this._textarea=y,this._compositionView=m,this._bufferService=b,this._optionsService=S,this._coreService=w,this._renderService=T,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,b=m.replace(y,"");this._dataAlreadySent=b,m.length>y.length?this._coreService.triggerDataEvent(b,!0):m.length<y.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):m.length===y.length&&m!==y&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.css.cell.height,S=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,w=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=w+"px",this._compositionView.style.top=S+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const T=this._compositionView.getBoundingClientRect();this._textarea.style.left=w+"px",this._textarea.style.top=S+"px",this._textarea.style.width=Math.max(T.width,1)+"px",this._textarea.style.height=Math.max(T.height,1)+"px",this._textarea.style.lineHeight=T.height+"px"}y||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=C=f([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,_.ICoreService),g(5,c.IRenderService)],C)},9806:(p,a)=>{function u(f,g,c){const _=c.getBoundingClientRect(),x=f.getComputedStyle(c),C=parseInt(x.getPropertyValue("padding-left")),y=parseInt(x.getPropertyValue("padding-top"));return[g.clientX-_.left-C,g.clientY-_.top-y]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=u,a.getCoords=function(f,g,c,_,x,C,y,m,b){if(!C)return;const S=u(f,g,c);return S?(S[0]=Math.ceil((S[0]+(b?y/2:0))/y),S[1]=Math.ceil(S[1]/m),S[0]=Math.min(Math.max(S[0],1),_+(b?1:0)),S[1]=Math.min(Math.max(S[1],1),x),S):void 0}},9504:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const f=u(2584);function g(m,b,S,w){const T=m-c(m,S),D=b-c(b,S),R=Math.abs(T-D)-(function(L,A,j){let M=0;const I=L-c(L,j),B=A-c(A,j);for(let H=0;H<Math.abs(I-B);H++){const F=_(L,A)==="A"?-1:1,W=j.buffer.lines.get(I+F*H);W!=null&&W.isWrapped&&M++}return M})(m,b,S);return y(R,C(_(m,b),w))}function c(m,b){let S=0,w=b.buffer.lines.get(m),T=w==null?void 0:w.isWrapped;for(;T&&m>=0&&m<b.rows;)S++,w=b.buffer.lines.get(--m),T=w==null?void 0:w.isWrapped;return S}function _(m,b){return m>b?"A":"B"}function x(m,b,S,w,T,D){let R=m,L=b,A="";for(;R!==S||L!==w;)R+=T?1:-1,T&&R>D.cols-1?(A+=D.buffer.translateBufferLineToString(L,!1,m,R),R=0,m=0,L++):!T&&R<0&&(A+=D.buffer.translateBufferLineToString(L,!1,0,m+1),R=D.cols-1,m=R,L--);return A+D.buffer.translateBufferLineToString(L,!1,m,R)}function C(m,b){const S=b?"O":"[";return f.C0.ESC+S+m}function y(m,b){m=Math.floor(m);let S="";for(let w=0;w<m;w++)S+=b;return S}a.moveToCellSequence=function(m,b,S,w){const T=S.buffer.x,D=S.buffer.y;if(!S.buffer.hasScrollback)return(function(A,j,M,I,B,H){return g(j,I,B,H).length===0?"":y(x(A,j,A,j-c(j,B),!1,B).length,C("D",H))})(T,D,0,b,S,w)+g(D,b,S,w)+(function(A,j,M,I,B,H){let F;F=g(j,I,B,H).length>0?I-c(I,B):j;const W=I,G=(function(Q,X,z,O,Y,Z){let U;return U=g(z,O,Y,Z).length>0?O-c(O,Y):X,Q<z&&U<=O||Q>=z&&U<O?"C":"D"})(A,j,M,I,B,H);return y(x(A,F,M,W,G==="C",B).length,C(G,H))})(T,D,m,b,S,w);let R;if(D===b)return R=T>m?"D":"C",y(Math.abs(T-m),C(R,w));R=D>b?"D":"C";const L=Math.abs(D-b);return y((function(A,j){return j.cols-A})(D>b?m:T,S)+(L-1)*S.cols+1+((D>b?T:m)-1),C(R,w))}},1296:function(p,a,u){var f=this&&this.__decorate||function(H,F,W,G){var Q,X=arguments.length,z=X<3?F:G===null?G=Object.getOwnPropertyDescriptor(F,W):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(H,F,W,G);else for(var O=H.length-1;O>=0;O--)(Q=H[O])&&(z=(X<3?Q(z):X>3?Q(F,W,z):Q(F,W))||z);return X>3&&z&&Object.defineProperty(F,W,z),z},g=this&&this.__param||function(H,F){return function(W,G){F(W,G,H)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const c=u(3787),_=u(2550),x=u(2223),C=u(6171),y=u(6052),m=u(4725),b=u(8055),S=u(8460),w=u(844),T=u(2585),D="xterm-dom-renderer-owner-",R="xterm-rows",L="xterm-fg-",A="xterm-bg-",j="xterm-focus",M="xterm-selection";let I=1,B=a.DomRenderer=class extends w.Disposable{constructor(H,F,W,G,Q,X,z,O,Y,Z,U,V,ne){super(),this._terminal=H,this._document=F,this._element=W,this._screenElement=G,this._viewportElement=Q,this._helperContainer=X,this._linkifier2=z,this._charSizeService=Y,this._optionsService=Z,this._bufferService=U,this._coreBrowserService=V,this._themeService=ne,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,y.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new S.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(M),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((le=>this._injectCss(le)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(c.DomRendererRowFactory,document),this._element.classList.add(D+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((le=>this._handleLinkHover(le)))),this.register(this._linkifier2.onHideLinkUnderline((le=>this._handleLinkLeave(le)))),this.register((0,w.toDisposable)((()=>{this._element.classList.remove(D+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),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/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${R} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${R} .xterm-dim { color: ${b.color.multiplyOpacity(H.foreground,.5).css};}`,F+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const W=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;F+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${G} { 50% { box-shadow: none; }}`,F+=`@keyframes ${Q} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,F+=`${this._terminalSelector} .${R}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${R}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${R}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${M} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${M} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${M} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[X,z]of H.ansi.entries())F+=`${this._terminalSelector} .${L}${X} { color: ${z.css}; }${this._terminalSelector} .${L}${X}.xterm-dim { color: ${b.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${A}${X} { background-color: ${z.css}; }`;F+=`${this._terminalSelector} .${L}${x.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(H.background).css}; }${this._terminalSelector} .${L}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${A}${x.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,F){for(let W=this._rowElements.length;W<=F;W++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,F){this._refreshRowElements(H,F),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,F,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,F,W),this.renderRows(0,this._bufferService.rows-1),!H||!F)return;this._selectionRenderModel.update(this._terminal,H,F,W);const G=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||z<0)return;const O=this._document.createDocumentFragment();if(W){const Y=H[0]>F[0];O.appendChild(this._createSelectionElement(X,Y?F[0]:H[0],Y?H[0]:F[0],z-X+1))}else{const Y=G===X?H[0]:0,Z=X===Q?F[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(X,Y,Z));const U=z-X-1;if(O.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,U)),X!==z){const V=Q===z?F[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(z,0,V))}}this._selectionContainer.appendChild(O)}_createSelectionElement(H,F,W,G=1){const Q=this._document.createElement("div"),X=F*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(W-F);return X+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-X),Q.style.height=G*this.dimensions.css.cell.height+"px",Q.style.top=H*this.dimensions.css.cell.height+"px",Q.style.left=`${X}px`,Q.style.width=`${z}px`,Q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const H of this._rowElements)H.replaceChildren()}renderRows(H,F){const W=this._bufferService.buffer,G=W.ybase+W.y,Q=Math.min(W.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let Y=H;Y<=F;Y++){const Z=Y+W.ydisp,U=this._rowElements[Y],V=W.lines.get(Z);if(!U||!V)break;U.replaceChildren(...this._rowFactory.createRow(V,Z,Z===G,z,O,Q,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${D}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,F,W,G,Q,X){W<0&&(H=0),G<0&&(F=0);const z=this._bufferService.rows-1;W=Math.max(Math.min(W,z),0),G=Math.max(Math.min(G,z),0),Q=Math.min(Q,this._bufferService.cols);const O=this._bufferService.buffer,Y=O.ybase+O.y,Z=Math.min(O.x,Q-1),U=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,ne=this._optionsService.rawOptions.cursorInactiveStyle;for(let le=W;le<=G;++le){const K=le+O.ydisp,$=this._rowElements[le],oe=O.lines.get(K);if(!$||!oe)break;$.replaceChildren(...this._rowFactory.createRow(oe,K,K===Y,V,ne,Z,U,this.dimensions.css.cell.width,this._widthCache,X?le===W?H:0:-1,X?(le===G?F:Q)-1:-1))}}};a.DomRenderer=B=f([g(7,T.IInstantiationService),g(8,m.ICharSizeService),g(9,T.IOptionsService),g(10,T.IBufferService),g(11,m.ICoreBrowserService),g(12,m.IThemeService)],B)},3787:function(p,a,u){var f=this&&this.__decorate||function(R,L,A,j){var M,I=arguments.length,B=I<3?L:j===null?j=Object.getOwnPropertyDescriptor(L,A):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(R,L,A,j);else for(var H=R.length-1;H>=0;H--)(M=R[H])&&(B=(I<3?M(B):I>3?M(L,A,B):M(L,A))||B);return I>3&&B&&Object.defineProperty(L,A,B),B},g=this&&this.__param||function(R,L){return function(A,j){L(A,j,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const c=u(2223),_=u(643),x=u(511),C=u(2585),y=u(8055),m=u(4725),b=u(4269),S=u(6171),w=u(3734);let T=a.DomRendererRowFactory=class{constructor(R,L,A,j,M,I,B){this._document=R,this._characterJoinerService=L,this._optionsService=A,this._coreBrowserService=j,this._coreService=M,this._decorationService=I,this._themeService=B,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,L,A){this._selectionStart=R,this._selectionEnd=L,this._columnSelectMode=A}createRow(R,L,A,j,M,I,B,H,F,W,G){const Q=[],X=this._characterJoinerService.getJoinedCharacters(L),z=this._themeService.colors;let O,Y=R.getNoBgTrimmedLength();A&&Y<I+1&&(Y=I+1);let Z=0,U="",V=0,ne=0,le=0,K=!1,$=0,oe=!1,ee=0;const ue=[],he=W!==-1&&G!==-1;for(let Se=0;Se<Y;Se++){R.loadCell(Se,this._workCell);let we=this._workCell.getWidth();if(we===0)continue;let Re=!1,qe=Se,ke=this._workCell;if(X.length>0&&Se===X[0][0]){Re=!0;const Me=X.shift();ke=new b.JoinedCellData(this._workCell,R.translateToString(!0,Me[0],Me[1]),Me[1]-Me[0]),qe=Me[1]-1,we=ke.getWidth()}const ze=this._isCellInSelection(Se,L),Mt=A&&Se===I,$e=he&&Se>=W&&Se<=G;let Be=!1;this._decorationService.forEachDecorationAtCell(Se,L,void 0,(Me=>{Be=!0}));let Ie=ke.getChars()||_.WHITESPACE_CELL_CHAR;if(Ie===" "&&(ke.isUnderline()||ke.isOverline())&&(Ie=" "),ee=we*H-F.get(Ie,ke.isBold(),ke.isItalic()),O){if(Z&&(ze&&oe||!ze&&!oe&&ke.bg===V)&&(ze&&oe&&z.selectionForeground||ke.fg===ne)&&ke.extended.ext===le&&$e===K&&ee===$&&!Mt&&!Re&&!Be){ke.isInvisible()?U+=_.WHITESPACE_CELL_CHAR:U+=Ie,Z++;continue}Z&&(O.textContent=U),O=this._document.createElement("span"),Z=0,U=""}else O=this._document.createElement("span");if(V=ke.bg,ne=ke.fg,le=ke.extended.ext,K=$e,$=ee,oe=ze,Re&&I>=Se&&I<=qe&&(I=Se),!this._coreService.isCursorHidden&&Mt&&this._coreService.isCursorInitialized){if(ue.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&ue.push("xterm-cursor-blink"),ue.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(M)switch(M){case"outline":ue.push("xterm-cursor-outline");break;case"block":ue.push("xterm-cursor-block");break;case"bar":ue.push("xterm-cursor-bar");break;case"underline":ue.push("xterm-cursor-underline")}}if(ke.isBold()&&ue.push("xterm-bold"),ke.isItalic()&&ue.push("xterm-italic"),ke.isDim()&&ue.push("xterm-dim"),U=ke.isInvisible()?_.WHITESPACE_CELL_CHAR:ke.getChars()||_.WHITESPACE_CELL_CHAR,ke.isUnderline()&&(ue.push(`xterm-underline-${ke.extended.underlineStyle}`),U===" "&&(U=" "),!ke.isUnderlineColorDefault()))if(ke.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${w.AttributeData.toColorRGB(ke.getUnderlineColor()).join(",")})`;else{let Me=ke.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ke.isBold()&&Me<8&&(Me+=8),O.style.textDecorationColor=z.ansi[Me].css}ke.isOverline()&&(ue.push("xterm-overline"),U===" "&&(U=" ")),ke.isStrikethrough()&&ue.push("xterm-strikethrough"),$e&&(O.style.textDecoration="underline");let Te=ke.getFgColor(),Ve=ke.getFgColorMode(),gt=ke.getBgColor(),st=ke.getBgColorMode();const fe=!!ke.isInverse();if(fe){const Me=Te;Te=gt,gt=Me;const Tt=Ve;Ve=st,st=Tt}let _e,De,Le,Fe=!1;switch(this._decorationService.forEachDecorationAtCell(Se,L,void 0,(Me=>{Me.options.layer!=="top"&&Fe||(Me.backgroundColorRGB&&(st=50331648,gt=Me.backgroundColorRGB.rgba>>8&16777215,_e=Me.backgroundColorRGB),Me.foregroundColorRGB&&(Ve=50331648,Te=Me.foregroundColorRGB.rgba>>8&16777215,De=Me.foregroundColorRGB),Fe=Me.options.layer==="top")})),!Fe&&ze&&(_e=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,gt=_e.rgba>>8&16777215,st=50331648,Fe=!0,z.selectionForeground&&(Ve=50331648,Te=z.selectionForeground.rgba>>8&16777215,De=z.selectionForeground)),Fe&&ue.push("xterm-decoration-top"),st){case 16777216:case 33554432:Le=z.ansi[gt],ue.push(`xterm-bg-${gt}`);break;case 50331648:Le=y.channels.toColor(gt>>16,gt>>8&255,255&gt),this._addStyle(O,`background-color:#${D((gt>>>0).toString(16),"0",6)}`);break;default:fe?(Le=z.foreground,ue.push(`xterm-bg-${c.INVERTED_DEFAULT_COLOR}`)):Le=z.background}switch(_e||ke.isDim()&&(_e=y.color.multiplyOpacity(Le,.5)),Ve){case 16777216:case 33554432:ke.isBold()&&Te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Te+=8),this._applyMinimumContrast(O,Le,z.ansi[Te],ke,_e,void 0)||ue.push(`xterm-fg-${Te}`);break;case 50331648:const Me=y.channels.toColor(Te>>16&255,Te>>8&255,255&Te);this._applyMinimumContrast(O,Le,Me,ke,_e,De)||this._addStyle(O,`color:#${D(Te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,Le,z.foreground,ke,_e,De)||fe&&ue.push(`xterm-fg-${c.INVERTED_DEFAULT_COLOR}`)}ue.length&&(O.className=ue.join(" "),ue.length=0),Mt||Re||Be?O.textContent=U:Z++,ee!==this.defaultSpacing&&(O.style.letterSpacing=`${ee}px`),Q.push(O),Se=qe}return O&&Z&&(O.textContent=U),Q}_applyMinimumContrast(R,L,A,j,M,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,S.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const B=this._getContrastCache(j);let H;if(M||I||(H=B.getColor(L.rgba,A.rgba)),H===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);H=y.color.ensureContrastRatio(M||L,I||A,F),B.setColor((M||L).rgba,(I||A).rgba,H??null)}return!!H&&(this._addStyle(R,`color:${H.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,L){R.setAttribute("style",`${R.getAttribute("style")||""}${L};`)}_isCellInSelection(R,L){const A=this._selectionStart,j=this._selectionEnd;return!(!A||!j)&&(this._columnSelectMode?A[0]<=j[0]?R>=A[0]&&L>=A[1]&&R<j[0]&&L<=j[1]:R<A[0]&&L>=A[1]&&R>=j[0]&&L<=j[1]:L>A[1]&&L<j[1]||A[1]===j[1]&&L===A[1]&&R>=A[0]&&R<j[0]||A[1]<j[1]&&L===j[1]&&R<j[0]||A[1]<j[1]&&L===A[1]&&R>=A[0])}};function D(R,L,A){for(;R.length<A;)R=L+R;return R}a.DomRendererRowFactory=T=f([g(1,m.ICharacterJoinerService),g(2,C.IOptionsService),g(3,m.ICoreBrowserService),g(4,C.ICoreService),g(5,C.IDecorationService),g(6,m.IThemeService)],T)},2550:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(u,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const g=u.createElement("span");g.classList.add("xterm-char-measure-element");const c=u.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold";const _=u.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[g,c,_,x],this._container.appendChild(g),this._container.appendChild(c),this._container.appendChild(_),this._container.appendChild(x),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,f,g,c){u===this._font&&f===this._fontSize&&g===this._weight&&c===this._weightBold||(this._font=u,this._fontSize=f,this._weight=g,this._weightBold=c,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${c}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${c}`,this.clear())}get(u,f,g){let c=0;if(!f&&!g&&u.length===1&&(c=u.charCodeAt(0))<256){if(this._flat[c]!==-9999)return this._flat[c];const C=this._measure(u,0);return C>0&&(this._flat[c]=C),C}let _=u;f&&(_+="B"),g&&(_+="I");let x=this._holey.get(_);if(x===void 0){let C=0;f&&(C|=1),g&&(C|=2),x=this._measure(u,C),x>0&&this._holey.set(_,x)}return x}_measure(u,f){const g=this._measureElements[f];return g.textContent=u.repeat(32),g.offsetWidth/32}}},2223:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const f=u(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(p,a)=>{function u(g){return 57508<=g&&g<=57558}function f(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},a.isPowerlineGlyph=u,a.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},a.isEmoji=f,a.allowRescaling=function(g,c,_,x){return c===1&&_>Math.ceil(1.5*x)&&g!==void 0&&g>255&&!f(g)&&!u(g)&&!(function(C){return 57344<=C&&C<=63743})(g)},a.treatGlyphAsBackgroundColor=function(g){return u(g)||(function(c){return 9472<=c&&c<=9631})(g)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(g,c,_=0){return(g-(2*Math.round(c)-_))%(2*Math.round(c))}},6052:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,c,_,x=!1){if(this.selectionStart=c,this.selectionEnd=_,!c||!_||c[0]===_[0]&&c[1]===_[1])return void this.clear();const C=g.buffers.active.ydisp,y=c[1]-C,m=_[1]-C,b=Math.max(y,0),S=Math.min(m,g.rows-1);b>=g.rows||S<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=y,this.viewportEndRow=m,this.viewportCappedStartRow=b,this.viewportCappedEndRow=S,this.startCol=c[0],this.endCol=_[0])}isCellSelected(g,c,_){return!!this.hasSelection&&(_-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?c>=this.startCol&&_>=this.viewportCappedStartRow&&c<this.endCol&&_<=this.viewportCappedEndRow:c<this.startCol&&_>=this.viewportCappedStartRow&&c>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol)}}a.createSelectionRenderModel=function(){return new u}},456:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,f=this.selectionEnd;return!(!u||!f)&&(u[1]>f[1]||u[1]===f[1]&&u[0]>f[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(p,a,u){var f=this&&this.__decorate||function(S,w,T,D){var R,L=arguments.length,A=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,w,T,D);else for(var j=S.length-1;j>=0;j--)(R=S[j])&&(A=(L<3?R(A):L>3?R(w,T,A):R(w,T))||A);return L>3&&A&&Object.defineProperty(w,T,A),A},g=this&&this.__param||function(S,w){return function(T,D){w(T,D,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const c=u(2585),_=u(8460),x=u(844);let C=a.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(S,w,T){super(),this._optionsService=T,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new m(S,w,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const S=this._measureStrategy.measure();S.width===this.width&&S.height===this.height||(this.width=S.width,this.height=S.height,this._onCharSizeChange.fire())}};a.CharSizeService=C=f([g(2,c.IOptionsService)],C);class y extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(w,T){w!==void 0&&w>0&&T!==void 0&&T>0&&(this._result.width=w,this._result.height=T)}}class m extends y{constructor(w,T,D){super(),this._document=w,this._parentElement=T,this._optionsService=D,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends y{constructor(w){super(),this._optionsService=w,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const T=this._ctx.measureText("W");if(!("width"in T&&"fontBoundingBoxAscent"in T&&"fontBoundingBoxDescent"in T))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const w=this._ctx.measureText("W");return this._validateAndSet(w.width,w.fontBoundingBoxAscent+w.fontBoundingBoxDescent),this._result}}},4269:function(p,a,u){var f=this&&this.__decorate||function(b,S,w,T){var D,R=arguments.length,L=R<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,w):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,S,w,T);else for(var A=b.length-1;A>=0;A--)(D=b[A])&&(L=(R<3?D(L):R>3?D(S,w,L):D(S,w))||L);return R>3&&L&&Object.defineProperty(S,w,L),L},g=this&&this.__param||function(b,S){return function(w,T){S(w,T,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const c=u(3734),_=u(643),x=u(511),C=u(2585);class y extends c.AttributeData{constructor(S,w,T){super(),this.content=0,this.combinedData="",this.fg=S.fg,this.bg=S.bg,this.combinedData=w,this._width=T}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(S){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=y;let m=a.CharacterJoinerService=class A5{constructor(S){this._bufferService=S,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(S){const w={id:this._nextCharacterJoinerId++,handler:S};return this._characterJoiners.push(w),w.id}deregister(S){for(let w=0;w<this._characterJoiners.length;w++)if(this._characterJoiners[w].id===S)return this._characterJoiners.splice(w,1),!0;return!1}getJoinedCharacters(S){if(this._characterJoiners.length===0)return[];const w=this._bufferService.buffer.lines.get(S);if(!w||w.length===0)return[];const T=[],D=w.translateToString(!0);let R=0,L=0,A=0,j=w.getFg(0),M=w.getBg(0);for(let I=0;I<w.getTrimmedLength();I++)if(w.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==M){if(I-R>1){const B=this._getJoinedRanges(D,A,L,w,R);for(let H=0;H<B.length;H++)T.push(B[H])}R=I,A=L,j=this._workCell.fg,M=this._workCell.bg}L+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const I=this._getJoinedRanges(D,A,L,w,R);for(let B=0;B<I.length;B++)T.push(I[B])}return T}_getJoinedRanges(S,w,T,D,R){const L=S.substring(w,T);let A=[];try{A=this._characterJoiners[0].handler(L)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const M=this._characterJoiners[j].handler(L);for(let I=0;I<M.length;I++)A5._mergeRanges(A,M[I])}catch(M){console.error(M)}return this._stringRangesToCellRanges(A,D,R),A}_stringRangesToCellRanges(S,w,T){let D=0,R=!1,L=0,A=S[D];if(A){for(let j=T;j<this._bufferService.cols;j++){const M=w.getWidth(j),I=w.getString(j).length||_.WHITESPACE_CELL_CHAR.length;if(M!==0){if(!R&&A[0]<=L&&(A[0]=j,R=!0),A[1]<=L){if(A[1]=j,A=S[++D],!A)break;A[0]<=L?(A[0]=j,R=!0):R=!1}L+=I}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(S,w){let T=!1;for(let D=0;D<S.length;D++){const R=S[D];if(T){if(w[1]<=R[0])return S[D-1][1]=w[1],S;if(w[1]<=R[1])return S[D-1][1]=Math.max(w[1],R[1]),S.splice(D,1),S;S.splice(D,1),D--}else{if(w[1]<=R[0])return S.splice(D,0,w),S;if(w[1]<=R[1])return R[0]=Math.min(w[0],R[0]),S;w[0]<R[1]&&(R[0]=Math.min(w[0],R[0]),T=!0)}}return T?S[S.length-1][1]=w[1]:S.push(w),S}};a.CharacterJoinerService=m=f([g(0,C.IBufferService)],m)},5114:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const f=u(844),g=u(8460),c=u(3656);class _ extends f.Disposable{constructor(y,m,b){super(),this._textarea=y,this._window=m,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((S=>this._screenDprMonitor.setWindow(S)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(y){this._window!==y&&(this._window=y,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}a.CoreBrowserService=_;class x extends f.Disposable{constructor(y){super(),this._parentWindow=y,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(y){this._parentWindow=y,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,c.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var y;this._outerListener&&((y=this._resolutionMediaMatchList)==null||y.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const f=u(844);class g extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const x=this.linkProviders.indexOf(_);x!==-1&&this.linkProviders.splice(x,1)}}}}a.LinkProviderService=g},8934:function(p,a,u){var f=this&&this.__decorate||function(C,y,m,b){var S,w=arguments.length,T=w<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,m):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(C,y,m,b);else for(var D=C.length-1;D>=0;D--)(S=C[D])&&(T=(w<3?S(T):w>3?S(y,m,T):S(y,m))||T);return w>3&&T&&Object.defineProperty(y,m,T),T},g=this&&this.__param||function(C,y){return function(m,b){y(m,b,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const c=u(4725),_=u(9806);let x=a.MouseService=class{constructor(C,y){this._renderService=C,this._charSizeService=y}getCoords(C,y,m,b,S){return(0,_.getCoords)(window,C,y,m,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,S)}getMouseReportCoords(C,y){const m=(0,_.getCoordsRelativeToElement)(window,C,y);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};a.MouseService=x=f([g(0,c.IRenderService),g(1,c.ICharSizeService)],x)},3230:function(p,a,u){var f=this&&this.__decorate||function(S,w,T,D){var R,L=arguments.length,A=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,w,T,D);else for(var j=S.length-1;j>=0;j--)(R=S[j])&&(A=(L<3?R(A):L>3?R(w,T,A):R(w,T))||A);return L>3&&A&&Object.defineProperty(w,T,A),A},g=this&&this.__param||function(S,w){return function(T,D){w(T,D,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const c=u(6193),_=u(4725),x=u(8460),C=u(844),y=u(7226),m=u(2585);let b=a.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(S,w,T,D,R,L,A,j){super(),this._rowCount=S,this._charSizeService=D,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new y.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new c.RenderDebouncer(((M,I)=>this._renderRows(M,I)),A),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(L.onResize((()=>this._fullRefresh()))),this.register(L.buffers.onBufferActivate((()=>{var M;return(M=this._renderer.value)==null?void 0:M.clear()}))),this.register(T.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(T.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(L.cols,L.rows),this._fullRefresh()}))),this.register(T.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(L.buffer.y,L.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,w),this.register(A.onWindowChange((M=>this._registerIntersectionObserver(M,w))))}_registerIntersectionObserver(S,w){if("IntersectionObserver"in S){const T=new S.IntersectionObserver((D=>this._handleIntersectionChange(D[D.length-1])),{threshold:0});T.observe(w),this._observerDisposable.value=(0,C.toDisposable)((()=>T.disconnect()))}}_handleIntersectionChange(S){this._isPaused=S.isIntersecting===void 0?S.intersectionRatio===0:!S.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(S,w,T=!1){this._isPaused?this._needsFullRefresh=!0:(T||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(S,w,this._rowCount))}_renderRows(S,w){this._renderer.value&&(S=Math.min(S,this._rowCount-1),w=Math.min(w,this._rowCount-1),this._renderer.value.renderRows(S,w),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:S,end:w}),this._onRender.fire({start:S,end:w}),this._isNextRenderRedrawOnly=!0)}resize(S,w){this._rowCount=w,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(S){this._renderer.value=S,this._renderer.value&&(this._renderer.value.onRequestRedraw((w=>this.refreshRows(w.start,w.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(S){return this._renderDebouncer.addRefreshCallback(S)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var S,w;this._renderer.value&&((w=(S=this._renderer.value).clearTextureAtlas)==null||w.call(S),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(S,w){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var T;return(T=this._renderer.value)==null?void 0:T.handleResize(S,w)})):this._renderer.value.handleResize(S,w),this._fullRefresh())}handleCharSizeChanged(){var S;(S=this._renderer.value)==null||S.handleCharSizeChanged()}handleBlur(){var S;(S=this._renderer.value)==null||S.handleBlur()}handleFocus(){var S;(S=this._renderer.value)==null||S.handleFocus()}handleSelectionChanged(S,w,T){var D;this._selectionState.start=S,this._selectionState.end=w,this._selectionState.columnSelectMode=T,(D=this._renderer.value)==null||D.handleSelectionChanged(S,w,T)}handleCursorMove(){var S;(S=this._renderer.value)==null||S.handleCursorMove()}clear(){var S;(S=this._renderer.value)==null||S.clear()}};a.RenderService=b=f([g(2,m.IOptionsService),g(3,_.ICharSizeService),g(4,m.IDecorationService),g(5,m.IBufferService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],b)},9312:function(p,a,u){var f=this&&this.__decorate||function(A,j,M,I){var B,H=arguments.length,F=H<3?j:I===null?I=Object.getOwnPropertyDescriptor(j,M):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(A,j,M,I);else for(var W=A.length-1;W>=0;W--)(B=A[W])&&(F=(H<3?B(F):H>3?B(j,M,F):B(j,M))||F);return H>3&&F&&Object.defineProperty(j,M,F),F},g=this&&this.__param||function(A,j){return function(M,I){j(M,I,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const c=u(9806),_=u(9504),x=u(456),C=u(4725),y=u(8460),m=u(844),b=u(6114),S=u(4841),w=u(511),T=u(2585),D=" ",R=new RegExp(D,"g");let L=a.SelectionService=class extends m.Disposable{constructor(A,j,M,I,B,H,F,W,G){super(),this._element=A,this._screenElement=j,this._linkifier=M,this._bufferService=I,this._coreService=B,this._mouseService=H,this._optionsService=F,this._renderService=W,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new w.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const A=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!A||!j||A[0]===j[0]&&A[1]===j[1])}get selectionText(){const A=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!A||!j)return"";const M=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(A[0]===j[0])return"";const B=A[0]<j[0]?A[0]:j[0],H=A[0]<j[0]?j[0]:A[0];for(let F=A[1];F<=j[1];F++){const W=M.translateBufferLineToString(F,!0,B,H);I.push(W)}}else{const B=A[1]===j[1]?j[0]:void 0;I.push(M.translateBufferLineToString(A[1],!0,A[0],B));for(let H=A[1]+1;H<=j[1]-1;H++){const F=M.lines.get(H),W=M.translateBufferLineToString(H,!0);F!=null&&F.isWrapped?I[I.length-1]+=W:I.push(W)}if(A[1]!==j[1]){const H=M.lines.get(j[1]),F=M.translateBufferLineToString(j[1],!0,0,j[0]);H&&H.isWrapped?I[I.length-1]+=F:I.push(F)}}return I.map((B=>B.replace(R," "))).join(b.isWindows?`\r
625
- `:`
626
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&A&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(A){const j=this._getMouseBufferCoords(A),M=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(M&&I&&j)&&this._areCoordsInSelection(j,M,I)}isCellInSelection(A,j){const M=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!M||!I)&&this._areCoordsInSelection([A,j],M,I)}_areCoordsInSelection(A,j,M){return A[1]>j[1]&&A[1]<M[1]||j[1]===M[1]&&A[1]===j[1]&&A[0]>=j[0]&&A[0]<M[0]||j[1]<M[1]&&A[1]===M[1]&&A[0]<M[0]||j[1]<M[1]&&A[1]===j[1]&&A[0]>=j[0]}_selectWordAtCursor(A,j){var B,H;const M=(H=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:H.range;if(M)return this._model.selectionStart=[M.start.x-1,M.start.y-1],this._model.selectionStartLength=(0,S.getRangeLength)(M,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(A);return!!I&&(this._selectWordAt(I,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,j){this._model.clearSelection(),A=Math.max(A,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const j=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(A){let j=(0,c.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const M=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=M?0:(j>M&&(j-=M),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(A){return b.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const j=this._getMouseBufferCoords(A);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(A){return A.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const M=this._bufferService.buffer;if(this._model.selectionEnd[1]<M.lines.length){const I=M.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const j=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const M=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(M&&M[0]!==void 0&&M[1]!==void 0){const I=(0,_.moveToCellSequence)(M[0]-1,M[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,M=!(!A||!j||A[0]===j[0]&&A[1]===j[1]);M?A&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,j,M)):this._oldHasSelection&&this._fireOnSelectionChange(A,j,M)}_fireOnSelectionChange(A,j,M){this._oldSelectionStart=A,this._oldSelectionEnd=j,this._oldHasSelection=M,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(A,j){let M=j;for(let I=0;j>=I;I++){const B=A.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?M--:B>1&&j!==I&&(M+=B-1)}return M}setSelection(A,j,M){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,j],this._model.selectionStartLength=M,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,j,M=!0,I=!0){if(A[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,H=B.lines.get(A[1]);if(!H)return;const F=B.translateBufferLineToString(A[1],!1);let W=this._convertViewportColToCharacterIndex(H,A[0]),G=W;const Q=A[0]-W;let X=0,z=0,O=0,Y=0;if(F.charAt(W)===" "){for(;W>0&&F.charAt(W-1)===" ";)W--;for(;G<F.length&&F.charAt(G+1)===" ";)G++}else{let V=A[0],ne=A[0];H.getWidth(V)===0&&(X++,V--),H.getWidth(ne)===2&&(z++,ne++);const le=H.getString(ne).length;for(le>1&&(Y+=le-1,G+=le-1);V>0&&W>0&&!this._isCharWordSeparator(H.loadCell(V-1,this._workCell));){H.loadCell(V-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,V--):K>1&&(O+=K-1,W-=K-1),W--,V--}for(;ne<H.length&&G+1<F.length&&!this._isCharWordSeparator(H.loadCell(ne+1,this._workCell));){H.loadCell(ne+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ne++):K>1&&(Y+=K-1,G+=K-1),G++,ne++}}G++;let Z=W+Q-X+O,U=Math.min(this._bufferService.cols,G-W+X+z-O-Y);if(j||F.slice(W,G).trim()!==""){if(M&&Z===0&&H.getCodePoint(0)!==32){const V=B.lines.get(A[1]-1);if(V&&H.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const ne=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(ne){const le=this._bufferService.cols-ne.start;Z-=le,U+=le}}}if(I&&Z+U===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const V=B.lines.get(A[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const ne=this._getWordAt([0,A[1]+1],!1,!1,!0);ne&&(U+=ne.length)}}return{start:Z,length:U}}}_selectWordAt(A,j){const M=this._getWordAt(A,j);if(M){for(;M.start<0;)M.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[M.start,A[1]],this._model.selectionStartLength=M.length}}_selectToWordAt(A){const j=this._getWordAt(A,!0);if(j){let M=A[1];for(;j.start<0;)j.start+=this._bufferService.cols,M--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,M++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,M]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const j=this._bufferService.buffer.getWrappedRangeForLine(A),M={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,S.getRangeLength)(M,this._bufferService.cols)}};a.SelectionService=L=f([g(3,T.IBufferService),g(4,T.ICoreService),g(5,C.IMouseService),g(6,T.IOptionsService),g(7,C.IRenderService),g(8,C.ICoreBrowserService)],L)},4725:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const f=u(8343);a.ICharSizeService=(0,f.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),a.IMouseService=(0,f.createDecorator)("MouseService"),a.IRenderService=(0,f.createDecorator)("RenderService"),a.ISelectionService=(0,f.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,f.createDecorator)("ThemeService"),a.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(p,a,u){var f=this&&this.__decorate||function(L,A,j,M){var I,B=arguments.length,H=B<3?A:M===null?M=Object.getOwnPropertyDescriptor(A,j):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(L,A,j,M);else for(var F=L.length-1;F>=0;F--)(I=L[F])&&(H=(B<3?I(H):B>3?I(A,j,H):I(A,j))||H);return B>3&&H&&Object.defineProperty(A,j,H),H},g=this&&this.__param||function(L,A){return function(j,M){A(j,M,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const c=u(7239),_=u(8055),x=u(8460),C=u(844),y=u(2585),m=_.css.toColor("#ffffff"),b=_.css.toColor("#000000"),S=_.css.toColor("#ffffff"),w=_.css.toColor("#000000"),T={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const L=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let j=0;j<216;j++){const M=A[j/36%6|0],I=A[j/6%6|0],B=A[j%6];L.push({css:_.channels.toCss(M,I,B),rgba:_.channels.toRgba(M,I,B)})}for(let j=0;j<24;j++){const M=8+10*j;L.push({css:_.channels.toCss(M,M,M),rgba:_.channels.toRgba(M,M,M)})}return L})());let D=a.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(L){super(),this._optionsService=L,this._contrastCache=new c.ColorContrastCache,this._halfContrastCache=new c.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:b,cursor:S,cursorAccent:w,selectionForeground:void 0,selectionBackgroundTransparent:T,selectionBackgroundOpaque:_.color.blend(b,T),selectionInactiveBackgroundTransparent:T,selectionInactiveBackgroundOpaque:_.color.blend(b,T),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(L={}){const A=this._colors;if(A.foreground=R(L.foreground,m),A.background=R(L.background,b),A.cursor=R(L.cursor,S),A.cursorAccent=R(L.cursorAccent,w),A.selectionBackgroundTransparent=R(L.selectionBackground,T),A.selectionBackgroundOpaque=_.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=R(L.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=_.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=L.selectionForeground?R(L.selectionForeground,_.NULL_COLOR):void 0,A.selectionForeground===_.NULL_COLOR&&(A.selectionForeground=void 0),_.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=_.color.opacity(A.selectionBackgroundTransparent,.3)),_.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=_.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=a.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=R(L.black,a.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=R(L.red,a.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=R(L.green,a.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=R(L.yellow,a.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=R(L.blue,a.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=R(L.magenta,a.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=R(L.cyan,a.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=R(L.white,a.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=R(L.brightBlack,a.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=R(L.brightRed,a.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=R(L.brightGreen,a.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=R(L.brightYellow,a.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=R(L.brightBlue,a.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=R(L.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=R(L.brightCyan,a.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=R(L.brightWhite,a.DEFAULT_ANSI_COLORS[15]),L.extendedAnsi){const j=Math.min(A.ansi.length-16,L.extendedAnsi.length);for(let M=0;M<j;M++)A.ansi[M+16]=R(L.extendedAnsi[M],a.DEFAULT_ANSI_COLORS[M+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(L){this._restoreColor(L),this._onChangeColors.fire(this.colors)}_restoreColor(L){if(L!==void 0)switch(L){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[L]=this._restoreColors.ansi[L]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(L){L(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(L,A){if(L!==void 0)try{return _.css.toColor(L)}catch{}return A}a.ThemeService=D=f([g(0,y.IOptionsService)],D)},6349:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const f=u(8460),g=u(844);class c extends g.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const C=new Array(x);for(let y=0;y<Math.min(x,this.length);y++)C[y]=this._array[this._getCyclicIndex(y)];this._array=C,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let C=this._length;C<x;C++)this._array[C]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,C){this._array[this._getCyclicIndex(x)]=C}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,C,...y){if(C){for(let m=x;m<this._length-C;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+C)];this._length-=C,this.onDeleteEmitter.fire({index:x,amount:C})}for(let m=this._length-1;m>=x;m--)this._array[this._getCyclicIndex(m+y.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<y.length;m++)this._array[this._getCyclicIndex(x+m)]=y[m];if(y.length&&this.onInsertEmitter.fire({index:x,amount:y.length}),this._length+y.length>this._maxLength){const m=this._length+y.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=y.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,C,y){if(!(C<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let b=C-1;b>=0;b--)this.set(x+b+y,this.get(x+b));const m=x+C+y-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<C;m++)this.set(x+m+y,this.get(x+m))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}a.CircularList=c},1439:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function u(f,g=5){if(typeof f!="object")return f;const c=Array.isArray(f)?[]:{};for(const _ in f)c[_]=g<=1?f[_]:f[_]&&u(f[_],g-1);return c}},8055:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let u=0,f=0,g=0,c=0;var _,x,C,y,m;function b(w){const T=w.toString(16);return T.length<2?"0"+T:T}function S(w,T){return w<T?(T+.05)/(w+.05):(w+.05)/(T+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(w){w.toCss=function(T,D,R,L){return L!==void 0?`#${b(T)}${b(D)}${b(R)}${b(L)}`:`#${b(T)}${b(D)}${b(R)}`},w.toRgba=function(T,D,R,L=255){return(T<<24|D<<16|R<<8|L)>>>0},w.toColor=function(T,D,R,L){return{css:w.toCss(T,D,R,L),rgba:w.toRgba(T,D,R,L)}}})(_||(a.channels=_={})),(function(w){function T(D,R){return c=Math.round(255*R),[u,f,g]=m.toChannels(D.rgba),{css:_.toCss(u,f,g,c),rgba:_.toRgba(u,f,g,c)}}w.blend=function(D,R){if(c=(255&R.rgba)/255,c===1)return{css:R.css,rgba:R.rgba};const L=R.rgba>>24&255,A=R.rgba>>16&255,j=R.rgba>>8&255,M=D.rgba>>24&255,I=D.rgba>>16&255,B=D.rgba>>8&255;return u=M+Math.round((L-M)*c),f=I+Math.round((A-I)*c),g=B+Math.round((j-B)*c),{css:_.toCss(u,f,g),rgba:_.toRgba(u,f,g)}},w.isOpaque=function(D){return(255&D.rgba)==255},w.ensureContrastRatio=function(D,R,L){const A=m.ensureContrastRatio(D.rgba,R.rgba,L);if(A)return _.toColor(A>>24&255,A>>16&255,A>>8&255)},w.opaque=function(D){const R=(255|D.rgba)>>>0;return[u,f,g]=m.toChannels(R),{css:_.toCss(u,f,g),rgba:R}},w.opacity=T,w.multiplyOpacity=function(D,R){return c=255&D.rgba,T(D,c*R/255)},w.toColorRGB=function(D){return[D.rgba>>24&255,D.rgba>>16&255,D.rgba>>8&255]}})(x||(a.color=x={})),(function(w){let T,D;try{const R=document.createElement("canvas");R.width=1,R.height=1;const L=R.getContext("2d",{willReadFrequently:!0});L&&(T=L,T.globalCompositeOperation="copy",D=T.createLinearGradient(0,0,1,1))}catch{}w.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),_.toColor(u,f,g);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),c=parseInt(R.slice(4,5).repeat(2),16),_.toColor(u,f,g,c);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const L=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return u=parseInt(L[1]),f=parseInt(L[2]),g=parseInt(L[3]),c=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),_.toColor(u,f,g,c);if(!T||!D)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=D,T.fillStyle=R,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[u,f,g,c]=T.getImageData(0,0,1,1).data,c!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(u,f,g,c),css:R}}})(C||(a.css=C={})),(function(w){function T(D,R,L){const A=D/255,j=R/255,M=L/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))}w.relativeLuminance=function(D){return T(D>>16&255,D>>8&255,255&D)},w.relativeLuminance2=T})(y||(a.rgb=y={})),(function(w){function T(R,L,A){const j=R>>24&255,M=R>>16&255,I=R>>8&255;let B=L>>24&255,H=L>>16&255,F=L>>8&255,W=S(y.relativeLuminance2(B,H,F),y.relativeLuminance2(j,M,I));for(;W<A&&(B>0||H>0||F>0);)B-=Math.max(0,Math.ceil(.1*B)),H-=Math.max(0,Math.ceil(.1*H)),F-=Math.max(0,Math.ceil(.1*F)),W=S(y.relativeLuminance2(B,H,F),y.relativeLuminance2(j,M,I));return(B<<24|H<<16|F<<8|255)>>>0}function D(R,L,A){const j=R>>24&255,M=R>>16&255,I=R>>8&255;let B=L>>24&255,H=L>>16&255,F=L>>8&255,W=S(y.relativeLuminance2(B,H,F),y.relativeLuminance2(j,M,I));for(;W<A&&(B<255||H<255||F<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),H=Math.min(255,H+Math.ceil(.1*(255-H))),F=Math.min(255,F+Math.ceil(.1*(255-F))),W=S(y.relativeLuminance2(B,H,F),y.relativeLuminance2(j,M,I));return(B<<24|H<<16|F<<8|255)>>>0}w.blend=function(R,L){if(c=(255&L)/255,c===1)return L;const A=L>>24&255,j=L>>16&255,M=L>>8&255,I=R>>24&255,B=R>>16&255,H=R>>8&255;return u=I+Math.round((A-I)*c),f=B+Math.round((j-B)*c),g=H+Math.round((M-H)*c),_.toRgba(u,f,g)},w.ensureContrastRatio=function(R,L,A){const j=y.relativeLuminance(R>>8),M=y.relativeLuminance(L>>8);if(S(j,M)<A){if(M<j){const H=T(R,L,A),F=S(j,y.relativeLuminance(H>>8));if(F<A){const W=D(R,L,A);return F>S(j,y.relativeLuminance(W>>8))?H:W}return H}const I=D(R,L,A),B=S(j,y.relativeLuminance(I>>8));if(B<A){const H=T(R,L,A);return B>S(j,y.relativeLuminance(H>>8))?I:H}return I}},w.reduceLuminance=T,w.increaseLuminance=D,w.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(m||(a.rgba=m={})),a.toPaddedHex=b,a.contrastRatio=S},8969:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const f=u(844),g=u(2585),c=u(4348),_=u(7866),x=u(744),C=u(7302),y=u(6975),m=u(8460),b=u(1753),S=u(1480),w=u(7994),T=u(9282),D=u(5435),R=u(5981),L=u(2660);let A=!1;class j extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event((I=>{var B;(B=this._onScrollApi)==null||B.fire(I.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(I){for(const B in I)this.optionsService.options[B]=I[B]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new c.InstantiationService,this.optionsService=this.register(new C.OptionsService(I)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(S.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(w.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(L.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new D.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((B,H)=>this._inputHandler.parse(B,H)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,B){this._writeBuffer.write(I,B)}writeSync(I,B){this._logService.logLevel<=g.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(I,B)}input(I,B=!0){this.coreService.triggerDataEvent(I,B)}resize(I,B){isNaN(I)||isNaN(B)||(I=Math.max(I,x.MINIMUM_COLS),B=Math.max(B,x.MINIMUM_ROWS),this._bufferService.resize(I,B))}scroll(I,B=!1){this._bufferService.scroll(I,B)}scrollLines(I,B,H){this._bufferService.scrollLines(I,B,H)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const B=I-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(I,B){return this._inputHandler.registerEscHandler(I,B)}registerDcsHandler(I,B){return this._inputHandler.registerDcsHandler(I,B)}registerCsiHandler(I,B){return this._inputHandler.registerCsiHandler(I,B)}registerOscHandler(I,B){return this._inputHandler.registerOscHandler(I,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?I=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(T.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,T.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const B of I)B.dispose()}))}}}a.CoreTerminal=j},8460:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const g=[];for(let c=0;c<this._listeners.length;c++)g.push(this._listeners[c]);for(let c=0;c<g.length;c++)g[c].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,f){return u((g=>f.fire(g)))},a.runAndSubscribe=function(u,f){return f(void 0),u((g=>f(g)))}},5435:function(p,a,u){var f=this&&this.__decorate||function(X,z,O,Y){var Z,U=arguments.length,V=U<3?z:Y===null?Y=Object.getOwnPropertyDescriptor(z,O):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(X,z,O,Y);else for(var ne=X.length-1;ne>=0;ne--)(Z=X[ne])&&(V=(U<3?Z(V):U>3?Z(z,O,V):Z(z,O))||V);return U>3&&V&&Object.defineProperty(z,O,V),V},g=this&&this.__param||function(X,z){return function(O,Y){z(O,Y,X)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const c=u(2584),_=u(7116),x=u(2015),C=u(844),y=u(482),m=u(8437),b=u(8460),S=u(643),w=u(511),T=u(3734),D=u(2585),R=u(1480),L=u(6242),A=u(6351),j=u(5941),M={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function B(X,z){if(X>24)return z.setWinLines||!1;switch(X){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var H;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(a.WindowsOptionsReportType=H={}));let F=0;class W extends C.Disposable{getAttrData(){return this._curAttrData}constructor(z,O,Y,Z,U,V,ne,le,K=new x.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=O,this._coreService=Y,this._logService=Z,this._optionsService=U,this._oscLinkService=V,this._coreMouseService=ne,this._unicodeService=le,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new w.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:oe.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,oe,ee)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:oe,data:ee})})),this._parser.setDcsHandlerFallback((($,oe,ee)=>{oe==="HOOK"&&(ee=ee.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:oe,payload:ee})})),this._parser.setPrintHandler((($,oe,ee)=>this.print($,oe,ee))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(c.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(c.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(c.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(c.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(c.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(c.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(c.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(c.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(c.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new L.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new L.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new L.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new L.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new L.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new L.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new L.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new L.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new L.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new L.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new L.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new L.OscHandler(($=>this.restoreCursorColor($)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const $ in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler((($,oe)=>this.requestStatusString($,oe))))}_preserveStack(z,O,Y,Z){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=Y,this._parseStack.position=Z}_logSlowResolvingAsync(z){this._logService.logLevel<=D.LogLevelEnum.WARN&&Promise.race([z,new Promise(((O,Y)=>setTimeout((()=>Y("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,O){let Y,Z=this._activeBuffer.x,U=this._activeBuffer.y,V=0;const ne=this._parseStack.paused;if(ne){if(Y=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(Y),Y;Z=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>I&&(V=this._parseStack.position+I)}if(this._logService.logLevel<=D.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,($=>String.fromCharCode($))).join("")}"`),typeof z=="string"?z.split("").map(($=>$.charCodeAt(0))):z),this._parseBuffer.length<z.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(z.length,I))),ne||this._dirtyRowTracker.clearRange(),z.length>I)for(let $=V;$<z.length;$+=I){const oe=$+I<z.length?$+I:z.length,ee=typeof z=="string"?this._stringDecoder.decode(z.substring($,oe),this._parseBuffer):this._utf8Decoder.decode(z.subarray($,oe),this._parseBuffer);if(Y=this._parser.parse(this._parseBuffer,ee))return this._preserveStack(Z,U,ee,$),this._logSlowResolvingAsync(Y),Y}else if(!ne){const $=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(Y=this._parser.parse(this._parseBuffer,$))return this._preserveStack(Z,U,$,0),this._logSlowResolvingAsync(Y),Y}this._activeBuffer.x===Z&&this._activeBuffer.y===U||this._onCursorMove.fire();const le=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(le,this._bufferService.rows-1))}print(z,O,Y){let Z,U;const V=this._charsetService.charset,ne=this._optionsService.rawOptions.screenReaderMode,le=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,oe=this._curAttrData;let ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&Y-O>0&&ee.getWidth(this._activeBuffer.x-1)===2&&ee.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let ue=this._parser.precedingJoinState;for(let he=O;he<Y;++he){if(Z=z[he],Z<127&&V){const qe=V[String.fromCharCode(Z)];qe&&(Z=qe.charCodeAt(0))}const Se=this._unicodeService.charProperties(Z,ue);U=R.UnicodeService.extractWidth(Se);const we=R.UnicodeService.extractShouldJoin(Se),Re=we?R.UnicodeService.extractWidth(ue):0;if(ue=Se,ne&&this._onA11yChar.fire((0,y.stringFromCodePoint)(Z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-Re>le){if(K){const qe=ee;let ke=this._activeBuffer.x-Re;for(this._activeBuffer.x=Re,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),ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Re>0&&ee instanceof m.BufferLine&&ee.copyCellsFrom(qe,ke,0,Re,!1);ke<le;)qe.setCellFromCodepoint(ke++,0,1,oe)}else if(this._activeBuffer.x=le-1,U===2)continue}if(we&&this._activeBuffer.x){const qe=ee.getWidth(this._activeBuffer.x-1)?1:2;ee.addCodepointToCell(this._activeBuffer.x-qe,Z,U);for(let ke=U-Re;--ke>=0;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if($&&(ee.insertCells(this._activeBuffer.x,U-Re,this._activeBuffer.getNullCell(oe)),ee.getWidth(le-1)===2&&ee.setCellFromCodepoint(le-1,S.NULL_CELL_CODE,S.NULL_CELL_WIDTH,oe)),ee.setCellFromCodepoint(this._activeBuffer.x++,Z,U,oe),U>0)for(;--U;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=ue,this._activeBuffer.x<le&&Y-O>0&&ee.getWidth(this._activeBuffer.x)===0&&!ee.hasContent(this._activeBuffer.x)&&ee.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,O){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,O):this._parser.registerCsiHandler(z,(Y=>!B(Y.params[0],this._optionsService.rawOptions.windowOptions)||O(Y)))}registerDcsHandler(z,O){return this._parser.registerDcsHandler(z,new A.DcsHandler(O))}registerEscHandler(z,O){return this._parser.registerEscHandler(z,O)}registerOscHandler(z,O){return this._parser.registerOscHandler(z,new L.OscHandler(O))}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 z;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&&((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&z.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,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(z,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=z,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+O)}cursorUp(z){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const O=z.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const O=z.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,O,Y,Z=!1,U=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);V.replaceCells(O,Y,this._activeBuffer.getNullCell(this._eraseAttrData()),U),Z&&(V.isWrapped=!1)}_resetBufferLine(z,O=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);Y&&(Y.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),Y.isWrapped=!1)}eraseInDisplay(z,O=!1){let Y;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(Y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(Y),this._eraseInBufferLine(Y++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);Y<this._bufferService.rows;Y++)this._resetBufferLine(Y,O);this._dirtyRowTracker.markDirty(Y);break;case 1:for(Y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(Y),this._eraseInBufferLine(Y,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(Y+1).isWrapped=!1);Y--;)this._resetBufferLine(Y,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(Y=this._bufferService.rows,this._dirtyRowTracker.markDirty(Y-1);Y--;)this._resetBufferLine(Y,O);this._dirtyRowTracker.markDirty(0);break;case 3:const Z=this._activeBuffer.lines.length-this._bufferService.rows;Z>0&&(this._activeBuffer.lines.trimStart(Z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-Z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-Z,0),this._onScroll.fire(0))}return!0}eraseInLine(z,O=!1){switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let O=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const Y=this._activeBuffer.ybase+this._activeBuffer.y,Z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-Z+1;for(;O--;)this._activeBuffer.lines.splice(U-1,1),this._activeBuffer.lines.splice(Y,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(z){this._restrictCursor();let O=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const Y=this._activeBuffer.ybase+this._activeBuffer.y;let Z;for(Z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-Z;O--;)this._activeBuffer.lines.splice(Y,1),this._activeBuffer.lines.splice(Z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(z){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(z){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(z){let O=z.params[0]||1;for(;O--;)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(z){let O=z.params[0]||1;for(;O--;)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(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let Y=this._activeBuffer.scrollTop;Y<=this._activeBuffer.scrollBottom;++Y){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+Y);Z.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let Y=this._activeBuffer.scrollTop;Y<=this._activeBuffer.scrollBottom;++Y){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+Y);Z.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let Y=this._activeBuffer.scrollTop;Y<=this._activeBuffer.scrollBottom;++Y){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+Y);Z.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let Y=this._activeBuffer.scrollTop;Y<=this._activeBuffer.scrollBottom;++Y){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+Y);Z.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(z){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(z.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(z){const O=this._parser.precedingJoinState;if(!O)return!0;const Y=z.params[0]||1,Z=R.UnicodeService.extractWidth(O),U=this._activeBuffer.x-Z,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),ne=new Uint32Array(V.length*Y);let le=0;for(let $=0;$<V.length;){const oe=V.codePointAt($)||0;ne[le++]=oe,$+=oe>65535?2:1}let K=le;for(let $=1;$<Y;++$)ne.copyWithin(K,0,le),K+=le;return this.print(ne,0,K),!0}sendDeviceAttributesPrimary(z){return z.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(c.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(c.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(c.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(c.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(c.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),z.params[O]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(z,O){const Y=this._coreService.decPrivateModes,{activeProtocol:Z,activeEncoding:U}=this._coreMouseService,V=this._coreService,{buffers:ne,cols:le}=this._bufferService,{active:K,alt:$}=ne,oe=this._optionsService.rawOptions,ee=we=>we?1:2,ue=z.params[0];return he=ue,Se=O?ue===2?4:ue===4?ee(V.modes.insertMode):ue===12?3:ue===20?ee(oe.convertEol):0:ue===1?ee(Y.applicationCursorKeys):ue===3?oe.windowOptions.setWinLines?le===80?2:le===132?1:0:0:ue===6?ee(Y.origin):ue===7?ee(Y.wraparound):ue===8?3:ue===9?ee(Z==="X10"):ue===12?ee(oe.cursorBlink):ue===25?ee(!V.isCursorHidden):ue===45?ee(Y.reverseWraparound):ue===66?ee(Y.applicationKeypad):ue===67?4:ue===1e3?ee(Z==="VT200"):ue===1002?ee(Z==="DRAG"):ue===1003?ee(Z==="ANY"):ue===1004?ee(Y.sendFocus):ue===1005?4:ue===1006?ee(U==="SGR"):ue===1015?4:ue===1016?ee(U==="SGR_PIXELS"):ue===1048?1:ue===47||ue===1047||ue===1049?ee(K===$):ue===2004?ee(Y.bracketedPasteMode):0,V.triggerDataEvent(`${c.C0.ESC}[${O?"":"?"}${he};${Se}$y`),!0;var he,Se}_updateAttrColor(z,O,Y,Z,U){return O===2?(z|=50331648,z&=-16777216,z|=T.AttributeData.fromColorRGB([Y,Z,U])):O===5&&(z&=-50331904,z|=33554432|255&Y),z}_extractColor(z,O,Y){const Z=[0,0,-1,0,0,0];let U=0,V=0;do{if(Z[V+U]=z.params[O+V],z.hasSubParams(O+V)){const ne=z.getSubParams(O+V);let le=0;do Z[1]===5&&(U=1),Z[V+le+1+U]=ne[le];while(++le<ne.length&&le+V+1+U<Z.length);break}if(Z[1]===5&&V+U>=2||Z[1]===2&&V+U>=5)break;Z[1]&&(U=1)}while(++V+O<z.length&&V+U<Z.length);for(let ne=2;ne<Z.length;++ne)Z[ne]===-1&&(Z[ne]=0);switch(Z[0]){case 38:Y.fg=this._updateAttrColor(Y.fg,Z[1],Z[3],Z[4],Z[5]);break;case 48:Y.bg=this._updateAttrColor(Y.bg,Z[1],Z[3],Z[4],Z[5]);break;case 58:Y.extended=Y.extended.clone(),Y.extended.underlineColor=this._updateAttrColor(Y.extended.underlineColor,Z[1],Z[3],Z[4],Z[5])}return V}_processUnderline(z,O){O.extended=O.extended.clone(),(!~z||z>5)&&(z=1),O.extended.underlineStyle=z,O.fg|=268435456,z===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(z){z.fg=m.DEFAULT_ATTR_DATA.fg,z.bg=m.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=z.length;let Y;const Z=this._curAttrData;for(let U=0;U<O;U++)Y=z.params[U],Y>=30&&Y<=37?(Z.fg&=-50331904,Z.fg|=16777216|Y-30):Y>=40&&Y<=47?(Z.bg&=-50331904,Z.bg|=16777216|Y-40):Y>=90&&Y<=97?(Z.fg&=-50331904,Z.fg|=16777224|Y-90):Y>=100&&Y<=107?(Z.bg&=-50331904,Z.bg|=16777224|Y-100):Y===0?this._processSGR0(Z):Y===1?Z.fg|=134217728:Y===3?Z.bg|=67108864:Y===4?(Z.fg|=268435456,this._processUnderline(z.hasSubParams(U)?z.getSubParams(U)[0]:1,Z)):Y===5?Z.fg|=536870912:Y===7?Z.fg|=67108864:Y===8?Z.fg|=1073741824:Y===9?Z.fg|=2147483648:Y===2?Z.bg|=134217728:Y===21?this._processUnderline(2,Z):Y===22?(Z.fg&=-134217729,Z.bg&=-134217729):Y===23?Z.bg&=-67108865:Y===24?(Z.fg&=-268435457,this._processUnderline(0,Z)):Y===25?Z.fg&=-536870913:Y===27?Z.fg&=-67108865:Y===28?Z.fg&=-1073741825:Y===29?Z.fg&=2147483647:Y===39?(Z.fg&=-67108864,Z.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):Y===49?(Z.bg&=-67108864,Z.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):Y===38||Y===48||Y===58?U+=this._extractColor(z,U,Z):Y===53?Z.bg|=1073741824:Y===55?Z.bg&=-1073741825:Y===59?(Z.extended=Z.extended.clone(),Z.extended.underlineColor=-1,Z.updateExtended()):Y===100?(Z.fg&=-67108864,Z.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,Z.bg&=-67108864,Z.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",Y);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${c.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,Y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[${O};${Y}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const O=this._activeBuffer.y+1,Y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[?${O};${Y}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(z){const O=z.params[0]||1;switch(O){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const Y=O%2==1;return this._optionsService.options.cursorBlink=Y,!0}setScrollRegion(z){const O=z.params[0]||1;let Y;return(z.length<2||(Y=z.params[1])>this._bufferService.rows||Y===0)&&(Y=this._bufferService.rows),Y>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=Y-1,this._setCursor(0,0)),!0}windowOptions(z){if(!B(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${c.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(z){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(z){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(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const O=[],Y=z.split(";");for(;Y.length>1;){const Z=Y.shift(),U=Y.shift();if(/^\d+$/.exec(Z)){const V=parseInt(Z);if(Q(V))if(U==="?")O.push({type:0,index:V});else{const ne=(0,j.parseColor)(U);ne&&O.push({type:1,index:V,color:ne})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(z){const O=z.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(z,O){this._getCurrentLinkId()&&this._finishHyperlink();const Y=z.split(":");let Z;const U=Y.findIndex((V=>V.startsWith("id=")));return U!==-1&&(Z=Y[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:Z,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,O){const Y=z.split(";");for(let Z=0;Z<Y.length&&!(O>=this._specialColors.length);++Z,++O)if(Y[Z]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const U=(0,j.parseColor)(Y[Z]);U&&this._onColor.fire([{type:1,index:this._specialColors[O],color:U}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const O=[],Y=z.split(";");for(let Z=0;Z<Y.length;++Z)if(/^\d+$/.exec(Y[Z])){const U=parseInt(Y[Z]);Q(U)&&O.push({type:2,index:U})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(z){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(z){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(z){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,_.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(M[z[0]],_.CHARSETS[z[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,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=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new w.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const Y=this._activeBuffer.ybase+this._activeBuffer.y+O,Z=this._activeBuffer.lines.get(Y);Z&&(Z.fill(z),Z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,O){const Y=this._bufferService.buffer,Z=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${c.C0.ESC}${U}${c.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${Y.scrollTop+1};${Y.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[Z.cursorStyle]-(Z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,O){this._dirtyRowTracker.markRangeDirty(z,O)}}a.InputHandler=W;let G=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,z){X>z&&(F=X,X=z,z=F),X<this.start&&(this.start=X),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(X){return 0<=X&&X<256}G=f([g(0,D.IBufferService)],G)},844:(p,a)=>{function u(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},a.toDisposable=function(f){return{dispose:f}},a.disposeArray=u,a.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,c,_){this._data[g]||(this._data[g]={}),this._data[g][c]=_}get(g,c){return this._data[g]?this._data[g][c]:void 0}clear(){this._data={}}}a.TwoKeyMap=u,a.FourKeyMap=class{constructor(){this._data=new u}set(f,g,c,_,x){this._data.get(f,g)||this._data.set(f,g,new u),this._data.get(f,g).set(c,_,x)}get(f,g,c,_){var x;return(x=this._data.get(f,g))==null?void 0:x.get(c,_)}clear(){this._data.clear()}}},6114:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const u=a.isNode?"node":navigator.userAgent,f=a.isNode?"node":navigator.platform;a.isFirefox=u.includes("Firefox"),a.isLegacyEdge=u.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(u),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),a.isIpad=f==="iPad",a.isIphone=f==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),a.isLinux=f.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(u)},6106:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let u=0;a.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(u=this._search(this._getKey(f)),this._array.splice(u,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const g=this._getKey(f);if(g===void 0||(u=this._search(g),u===-1)||this._getKey(this._array[u])!==g)return!1;do if(this._array[u]===f)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===g);return!1}*getKeyIterator(f){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===f)}forEachByKey(f,g){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do g(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let g=0,c=this._array.length-1;for(;c>=g;){let _=g+c>>1;const x=this._getKey(this._array[_]);if(x>f)c=_-1;else{if(!(x<f)){for(;_>0&&this._getKey(this._array[_-1])===f;)_--;return _}g=_+1}}return g}}},7226:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const f=u(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let C=0,y=0,m=x.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),y=Math.max(C,y),b=x.timeRemaining(),1.5*y>b)return m-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-C))}ms`),void this._start();m=b}this.clear()}}class c extends g{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}a.PriorityTaskQueue=c,a.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:c,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const f=u(643);a.updateWindowsModeWrappedState=function(g){const c=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),_=c==null?void 0:c.get(g.cols-1),x=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);x&&_&&(x.isWrapped=_[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&_[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new u;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=u;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}get underlineVariantOffset(){const c=(3758096384&this._ext)>>29;return c<0?4294967288^c:c}set underlineVariantOffset(c){this._ext&=536870911,this._ext|=c<<29&3758096384}constructor(c=0,_=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=f},9092:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const f=u(6349),g=u(7226),c=u(3734),_=u(8437),x=u(4634),C=u(511),y=u(643),m=u(4863),b=u(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(S,w,T){this._hasScrollback=S,this._optionsService=w,this._bufferService=T,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(S){return S?(this._nullCell.fg=S.fg,this._nullCell.bg=S.bg,this._nullCell.extended=S.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new c.ExtendedAttrs),this._nullCell}getWhitespaceCell(S){return S?(this._whitespaceCell.fg=S.fg,this._whitespaceCell.bg=S.bg,this._whitespaceCell.extended=S.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new c.ExtendedAttrs),this._whitespaceCell}getBlankLine(S,w){return new _.BufferLine(this._bufferService.cols,this.getNullCell(S),w)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const S=this.ybase+this.y-this.ydisp;return S>=0&&S<this._rows}_getCorrectBufferLength(S){if(!this._hasScrollback)return S;const w=S+this._optionsService.rawOptions.scrollback;return w>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:w}fillViewportRows(S){if(this.lines.length===0){S===void 0&&(S=_.DEFAULT_ATTR_DATA);let w=this._rows;for(;w--;)this.lines.push(this.getBlankLine(S))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(S,w){const T=this.getNullCell(_.DEFAULT_ATTR_DATA);let D=0;const R=this._getCorrectBufferLength(w);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<S)for(let A=0;A<this.lines.length;A++)D+=+this.lines.get(A).resize(S,T);let L=0;if(this._rows<w)for(let A=this._rows;A<w;A++)this.lines.length<w+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(S,T)):this.ybase>0&&this.lines.length<=this.ybase+this.y+L+1?(this.ybase--,L++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(S,T)));else for(let A=this._rows;A>w;A--)this.lines.length>w+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const A=this.lines.length-R;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=R}this.x=Math.min(this.x,S-1),this.y=Math.min(this.y,w-1),L&&(this.y+=L),this.savedX=Math.min(this.savedX,S-1),this.scrollTop=0}if(this.scrollBottom=w-1,this._isReflowEnabled&&(this._reflow(S,w),this._cols>S))for(let L=0;L<this.lines.length;L++)D+=+this.lines.get(L).resize(S,T);this._cols=S,this._rows=w,this._memoryCleanupQueue.clear(),D>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let S=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,S=!1);let w=0;for(;this._memoryCleanupPosition<this.lines.length;)if(w+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),w>100)return!0;return S}get _isReflowEnabled(){const S=this._optionsService.rawOptions.windowsPty;return S&&S.buildNumber?this._hasScrollback&&S.backend==="conpty"&&S.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(S,w){this._cols!==S&&(S>this._cols?this._reflowLarger(S,w):this._reflowSmaller(S,w))}_reflowLarger(S,w){const T=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,S,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(T.length>0){const D=(0,x.reflowLargerCreateNewLayout)(this.lines,T);(0,x.reflowLargerApplyNewLayout)(this.lines,D.layout),this._reflowLargerAdjustViewport(S,w,D.countRemoved)}}_reflowLargerAdjustViewport(S,w,T){const D=this.getNullCell(_.DEFAULT_ATTR_DATA);let R=T;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<w&&this.lines.push(new _.BufferLine(S,D))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-T,0)}_reflowSmaller(S,w){const T=this.getNullCell(_.DEFAULT_ATTR_DATA),D=[];let R=0;for(let L=this.lines.length-1;L>=0;L--){let A=this.lines.get(L);if(!A||!A.isWrapped&&A.getTrimmedLength()<=S)continue;const j=[A];for(;A.isWrapped&&L>0;)A=this.lines.get(--L),j.unshift(A);const M=this.ybase+this.y;if(M>=L&&M<L+j.length)continue;const I=j[j.length-1].getTrimmedLength(),B=(0,x.reflowSmallerGetNewLineLengths)(j,this._cols,S),H=B.length-j.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const W=[];for(let Y=0;Y<H;Y++){const Z=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);W.push(Z)}W.length>0&&(D.push({start:L+j.length+R,newLines:W}),R+=W.length),j.push(...W);let G=B.length-1,Q=B[G];Q===0&&(G--,Q=B[G]);let X=j.length-H-1,z=I;for(;X>=0;){const Y=Math.min(z,Q);if(j[G]===void 0)break;if(j[G].copyCellsFrom(j[X],z-Y,Q-Y,Y,!0),Q-=Y,Q===0&&(G--,Q=B[G]),z-=Y,z===0){X--;const Z=Math.max(X,0);z=(0,x.getWrappedLineTrimmedLength)(j,Z,this._cols)}}for(let Y=0;Y<j.length;Y++)B[Y]<S&&j[Y].setCell(B[Y],T);let O=H-F;for(;O-- >0;)this.ybase===0?this.y<w-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-w&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+w-1)}if(D.length>0){const L=[],A=[];for(let G=0;G<this.lines.length;G++)A.push(this.lines.get(G));const j=this.lines.length;let M=j-1,I=0,B=D[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let H=0;for(let G=Math.min(this.lines.maxLength-1,j+R-1);G>=0;G--)if(B&&B.start>M+H){for(let Q=B.newLines.length-1;Q>=0;Q--)this.lines.set(G--,B.newLines[Q]);G++,L.push({index:M+1,amount:B.newLines.length}),H+=B.newLines.length,B=D[++I]}else this.lines.set(G,A[M--]);let F=0;for(let G=L.length-1;G>=0;G--)L[G].index+=F,this.lines.onInsertEmitter.fire(L[G]),F+=L[G].amount;const W=Math.max(0,j+R-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(S,w,T=0,D){const R=this.lines.get(S);return R?R.translateToString(w,T,D):""}getWrappedRangeForLine(S){let w=S,T=S;for(;w>0&&this.lines.get(w).isWrapped;)w--;for(;T+1<this.lines.length&&this.lines.get(T+1).isWrapped;)T++;return{first:w,last:T}}setupTabStops(S){for(S!=null?this.tabs[S]||(S=this.prevStop(S)):(this.tabs={},S=0);S<this._cols;S+=this._optionsService.rawOptions.tabStopWidth)this.tabs[S]=!0}prevStop(S){for(S==null&&(S=this.x);!this.tabs[--S]&&S>0;);return S>=this._cols?this._cols-1:S<0?0:S}nextStop(S){for(S==null&&(S=this.x);!this.tabs[++S]&&S<this._cols;);return S>=this._cols?this._cols-1:S<0?0:S}clearMarkers(S){this._isClearing=!0;for(let w=0;w<this.markers.length;w++)this.markers[w].line===S&&(this.markers[w].dispose(),this.markers.splice(w--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].dispose(),this.markers.splice(S--,1);this._isClearing=!1}addMarker(S){const w=new m.Marker(S);return this.markers.push(w),w.register(this.lines.onTrim((T=>{w.line-=T,w.line<0&&w.dispose()}))),w.register(this.lines.onInsert((T=>{w.line>=T.index&&(w.line+=T.amount)}))),w.register(this.lines.onDelete((T=>{w.line>=T.index&&w.line<T.index+T.amount&&w.dispose(),w.line>T.index&&(w.line-=T.amount)}))),w.register(w.onDispose((()=>this._removeMarker(w)))),w}_removeMarker(S){this._isClearing||this.markers.splice(this.markers.indexOf(S),1)}}},8437:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const f=u(3734),g=u(511),c=u(643),_=u(482);a.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let x=0;class C{constructor(m,b,S=!1){this.isWrapped=S,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const w=b||g.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]);for(let T=0;T<m;++T)this.setCell(T,w);this.length=m}get(m){const b=this._data[3*m+0],S=2097151&b;return[this._data[3*m+1],2097152&b?this._combined[m]:S?(0,_.stringFromCodePoint)(S):"",b>>22,2097152&b?this._combined[m].charCodeAt(this._combined[m].length-1):S]}set(m,b){this._data[3*m+1]=b[c.CHAR_DATA_ATTR_INDEX],b[c.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=b[1],this._data[3*m+0]=2097152|m|b[c.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=b[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[c.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const b=this._data[3*m+0];return 2097152&b?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&b}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const b=this._data[3*m+0];return 2097152&b?this._combined[m]:2097151&b?(0,_.stringFromCodePoint)(2097151&b):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,b){return x=3*m,b.content=this._data[x+0],b.fg=this._data[x+1],b.bg=this._data[x+2],2097152&b.content&&(b.combinedData=this._combined[m]),268435456&b.bg&&(b.extended=this._extendedAttrs[m]),b}setCell(m,b){2097152&b.content&&(this._combined[m]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[m]=b.extended),this._data[3*m+0]=b.content,this._data[3*m+1]=b.fg,this._data[3*m+2]=b.bg}setCellFromCodepoint(m,b,S,w){268435456&w.bg&&(this._extendedAttrs[m]=w.extended),this._data[3*m+0]=b|S<<22,this._data[3*m+1]=w.fg,this._data[3*m+2]=w.bg}addCodepointToCell(m,b,S){let w=this._data[3*m+0];2097152&w?this._combined[m]+=(0,_.stringFromCodePoint)(b):2097151&w?(this._combined[m]=(0,_.stringFromCodePoint)(2097151&w)+(0,_.stringFromCodePoint)(b),w&=-2097152,w|=2097152):w=b|4194304,S&&(w&=-12582913,w|=S<<22),this._data[3*m+0]=w}insertCells(m,b,S){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,S),b<this.length-m){const w=new g.CellData;for(let T=this.length-m-b-1;T>=0;--T)this.setCell(m+b+T,this.loadCell(m+T,w));for(let T=0;T<b;++T)this.setCell(m+T,S)}else for(let w=m;w<this.length;++w)this.setCell(w,S);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,S)}deleteCells(m,b,S){if(m%=this.length,b<this.length-m){const w=new g.CellData;for(let T=0;T<this.length-m-b;++T)this.setCell(m+T,this.loadCell(m+b+T,w));for(let T=this.length-b;T<this.length;++T)this.setCell(T,S)}else for(let w=m;w<this.length;++w)this.setCell(w,S);m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,S),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodepoint(m,0,1,S)}replaceCells(m,b,S,w=!1){if(w)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,S),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,S);m<b&&m<this.length;)this.isProtected(m)||this.setCell(m,S),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,S),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,S);m<b&&m<this.length;)this.setCell(m++,S)}resize(m,b){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const S=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*S)this._data=new Uint32Array(this._data.buffer,0,S);else{const w=new Uint32Array(S);w.set(this._data),this._data=w}for(let w=this.length;w<m;++w)this.setCell(w,b)}else{this._data=this._data.subarray(0,S);const w=Object.keys(this._combined);for(let D=0;D<w.length;D++){const R=parseInt(w[D],10);R>=m&&delete this._combined[R]}const T=Object.keys(this._extendedAttrs);for(let D=0;D<T.length;D++){const R=parseInt(T[D],10);R>=m&&delete this._extendedAttrs[R]}}return this.length=m,4*S*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,b=!1){if(b)for(let S=0;S<this.length;++S)this.isProtected(S)||this.setCell(S,m);else{this._combined={},this._extendedAttrs={};for(let S=0;S<this.length;++S)this.setCell(S,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const b in m._combined)this._combined[b]=m._combined[b];this._extendedAttrs={};for(const b in m._extendedAttrs)this._extendedAttrs[b]=m._extendedAttrs[b];this.isWrapped=m.isWrapped}clone(){const m=new C(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const b in this._combined)m._combined[b]=this._combined[b];for(const b in this._extendedAttrs)m._extendedAttrs[b]=this._extendedAttrs[b];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,b,S,w,T){const D=m._data;if(T)for(let L=w-1;L>=0;L--){for(let A=0;A<3;A++)this._data[3*(S+L)+A]=D[3*(b+L)+A];268435456&D[3*(b+L)+2]&&(this._extendedAttrs[S+L]=m._extendedAttrs[b+L])}else for(let L=0;L<w;L++){for(let A=0;A<3;A++)this._data[3*(S+L)+A]=D[3*(b+L)+A];268435456&D[3*(b+L)+2]&&(this._extendedAttrs[S+L]=m._extendedAttrs[b+L])}const R=Object.keys(m._combined);for(let L=0;L<R.length;L++){const A=parseInt(R[L],10);A>=b&&(this._combined[A-b+S]=m._combined[A])}}translateToString(m,b,S,w){b=b??0,S=S??this.length,m&&(S=Math.min(S,this.getTrimmedLength())),w&&(w.length=0);let T="";for(;b<S;){const D=this._data[3*b+0],R=2097151&D,L=2097152&D?this._combined[b]:R?(0,_.stringFromCodePoint)(R):c.WHITESPACE_CELL_CHAR;if(T+=L,w)for(let A=0;A<L.length;++A)w.push(b);b+=D>>22||1}return w&&w.push(b),T}}a.BufferLine=C},4841:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(u,f){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return f*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(p,a)=>{function u(f,g,c){if(g===f.length-1)return f[g].getTrimmedLength();const _=!f[g].hasContent(c-1)&&f[g].getWidth(c-1)===1,x=f[g+1].getWidth(0)===2;return _&&x?c-1:c}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(f,g,c,_,x){const C=[];for(let y=0;y<f.length-1;y++){let m=y,b=f.get(++m);if(!b.isWrapped)continue;const S=[f.get(y)];for(;m<f.length&&b.isWrapped;)S.push(b),b=f.get(++m);if(_>=y&&_<m){y+=S.length-1;continue}let w=0,T=u(S,w,g),D=1,R=0;for(;D<S.length;){const A=u(S,D,g),j=A-R,M=c-T,I=Math.min(j,M);S[w].copyCellsFrom(S[D],R,T,I,!1),T+=I,T===c&&(w++,T=0),R+=I,R===A&&(D++,R=0),T===0&&w!==0&&S[w-1].getWidth(c-1)===2&&(S[w].copyCellsFrom(S[w-1],c-1,T++,1,!1),S[w-1].setCell(c-1,x))}S[w].replaceCells(T,c,x);let L=0;for(let A=S.length-1;A>0&&(A>w||S[A].getTrimmedLength()===0);A--)L++;L>0&&(C.push(y+S.length-L),C.push(L)),y+=S.length-1}return C},a.reflowLargerCreateNewLayout=function(f,g){const c=[];let _=0,x=g[_],C=0;for(let y=0;y<f.length;y++)if(x===y){const m=g[++_];f.onDeleteEmitter.fire({index:y-C,amount:m}),y+=m-1,C+=m,x=g[++_]}else c.push(y);return{layout:c,countRemoved:C}},a.reflowLargerApplyNewLayout=function(f,g){const c=[];for(let _=0;_<g.length;_++)c.push(f.get(g[_]));for(let _=0;_<c.length;_++)f.set(_,c[_]);f.length=g.length},a.reflowSmallerGetNewLineLengths=function(f,g,c){const _=[],x=f.map(((b,S)=>u(f,S,g))).reduce(((b,S)=>b+S));let C=0,y=0,m=0;for(;m<x;){if(x-m<c){_.push(x-m);break}C+=c;const b=u(f,y,g);C>b&&(C-=b,y++);const S=f[y].getWidth(C-1)===2;S&&C--;const w=S?c-1:c;_.push(w),m+=w}return _},a.getWrappedLineTrimmedLength=u},5295:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const f=u(8460),g=u(844),c=u(9092);class _ extends g.Disposable{constructor(C,y){super(),this._optionsService=C,this._bufferService=y,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new c.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new c.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,y){this._normal.resize(C,y),this._alt.resize(C,y),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}a.BufferSet=_},511:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const f=u(482),g=u(643),c=u(3734);class _ extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const y=new _;return y.setFromCharData(C),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(C[g.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(C[g.CHAR_DATA_CHAR_INDEX].length===2){const m=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const b=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(m-55296)+b-56320+65536|C[g.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[g.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=C[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=_},643:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const f=u(8460),g=u(844);class c{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=c._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}a.Marker=c,c._nextId=1},7116:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(p,a)=>{var u,f,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(c){c.NUL="\0",c.SOH="",c.STX="",c.ETX="",c.EOT="",c.ENQ="",c.ACK="",c.BEL="\x07",c.BS="\b",c.HT=" ",c.LF=`
627
- `,c.VT="\v",c.FF="\f",c.CR="\r",c.SO="",c.SI="",c.DLE="",c.DC1="",c.DC2="",c.DC3="",c.DC4="",c.NAK="",c.SYN="",c.ETB="",c.CAN="",c.EM="",c.SUB="",c.ESC="\x1B",c.FS="",c.GS="",c.RS="",c.US="",c.SP=" ",c.DEL=""})(u||(a.C0=u={})),(function(c){c.PAD="€",c.HOP="",c.BPH="‚",c.NBH="ƒ",c.IND="„",c.NEL="…",c.SSA="†",c.ESA="‡",c.HTS="ˆ",c.HTJ="‰",c.VTS="Š",c.PLD="‹",c.PLU="Œ",c.RI="",c.SS2="Ž",c.SS3="",c.DCS="",c.PU1="‘",c.PU2="’",c.STS="“",c.CCH="”",c.MW="•",c.SPA="–",c.EPA="—",c.SOS="˜",c.SGCI="™",c.SCI="š",c.CSI="›",c.ST="œ",c.OSC="",c.PM="ž",c.APC="Ÿ"})(f||(a.C1=f={})),(function(c){c.ST=`${u.ESC}\\`})(g||(a.C1_ESCAPED=g={}))},7399:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const f=u(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(c,_,x,C){const y={type:0,cancel:!1,key:void 0},m=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:c.key==="UIKeyInputUpArrow"?y.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A":c.key==="UIKeyInputLeftArrow"?y.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D":c.key==="UIKeyInputRightArrow"?y.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C":c.key==="UIKeyInputDownArrow"&&(y.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:y.key=c.ctrlKey?"\b":f.C0.DEL,c.altKey&&(y.key=f.C0.ESC+y.key);break;case 9:if(c.shiftKey){y.key=f.C0.ESC+"[Z";break}y.key=f.C0.HT,y.cancel=!0;break;case 13:y.key=c.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,y.cancel=!0;break;case 27:y.key=f.C0.ESC,c.altKey&&(y.key=f.C0.ESC+f.C0.ESC),y.cancel=!0;break;case 37:if(c.metaKey)break;m?(y.key=f.C0.ESC+"[1;"+(m+1)+"D",y.key===f.C0.ESC+"[1;3D"&&(y.key=f.C0.ESC+(x?"b":"[1;5D"))):y.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(c.metaKey)break;m?(y.key=f.C0.ESC+"[1;"+(m+1)+"C",y.key===f.C0.ESC+"[1;3C"&&(y.key=f.C0.ESC+(x?"f":"[1;5C"))):y.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(c.metaKey)break;m?(y.key=f.C0.ESC+"[1;"+(m+1)+"A",x||y.key!==f.C0.ESC+"[1;3A"||(y.key=f.C0.ESC+"[1;5A")):y.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(c.metaKey)break;m?(y.key=f.C0.ESC+"[1;"+(m+1)+"B",x||y.key!==f.C0.ESC+"[1;3B"||(y.key=f.C0.ESC+"[1;5B")):y.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(y.key=f.C0.ESC+"[2~");break;case 46:y.key=m?f.C0.ESC+"[3;"+(m+1)+"~":f.C0.ESC+"[3~";break;case 36:y.key=m?f.C0.ESC+"[1;"+(m+1)+"H":_?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:y.key=m?f.C0.ESC+"[1;"+(m+1)+"F":_?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:c.shiftKey?y.type=2:c.ctrlKey?y.key=f.C0.ESC+"[5;"+(m+1)+"~":y.key=f.C0.ESC+"[5~";break;case 34:c.shiftKey?y.type=3:c.ctrlKey?y.key=f.C0.ESC+"[6;"+(m+1)+"~":y.key=f.C0.ESC+"[6~";break;case 112:y.key=m?f.C0.ESC+"[1;"+(m+1)+"P":f.C0.ESC+"OP";break;case 113:y.key=m?f.C0.ESC+"[1;"+(m+1)+"Q":f.C0.ESC+"OQ";break;case 114:y.key=m?f.C0.ESC+"[1;"+(m+1)+"R":f.C0.ESC+"OR";break;case 115:y.key=m?f.C0.ESC+"[1;"+(m+1)+"S":f.C0.ESC+"OS";break;case 116:y.key=m?f.C0.ESC+"[15;"+(m+1)+"~":f.C0.ESC+"[15~";break;case 117:y.key=m?f.C0.ESC+"[17;"+(m+1)+"~":f.C0.ESC+"[17~";break;case 118:y.key=m?f.C0.ESC+"[18;"+(m+1)+"~":f.C0.ESC+"[18~";break;case 119:y.key=m?f.C0.ESC+"[19;"+(m+1)+"~":f.C0.ESC+"[19~";break;case 120:y.key=m?f.C0.ESC+"[20;"+(m+1)+"~":f.C0.ESC+"[20~";break;case 121:y.key=m?f.C0.ESC+"[21;"+(m+1)+"~":f.C0.ESC+"[21~";break;case 122:y.key=m?f.C0.ESC+"[23;"+(m+1)+"~":f.C0.ESC+"[23~";break;case 123:y.key=m?f.C0.ESC+"[24;"+(m+1)+"~":f.C0.ESC+"[24~";break;default:if(!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)if(x&&!C||!c.altKey||c.metaKey)!x||c.altKey||c.ctrlKey||c.shiftKey||!c.metaKey?c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&c.keyCode>=48&&c.key.length===1?y.key=c.key:c.key&&c.ctrlKey&&(c.key==="_"&&(y.key=f.C0.US),c.key==="@"&&(y.key=f.C0.NUL)):c.keyCode===65&&(y.type=1);else{const b=g[c.keyCode],S=b==null?void 0:b[c.shiftKey?1:0];if(S)y.key=f.C0.ESC+S;else if(c.keyCode>=65&&c.keyCode<=90){const w=c.ctrlKey?c.keyCode-64:c.keyCode+32;let T=String.fromCharCode(w);c.shiftKey&&(T=T.toUpperCase()),y.key=f.C0.ESC+T}else if(c.keyCode===32)y.key=f.C0.ESC+(c.ctrlKey?f.C0.NUL:" ");else if(c.key==="Dead"&&c.code.startsWith("Key")){let w=c.code.slice(3,4);c.shiftKey||(w=w.toLowerCase()),y.key=f.C0.ESC+w,y.cancel=!0}}else c.keyCode>=65&&c.keyCode<=90?y.key=String.fromCharCode(c.keyCode-64):c.keyCode===32?y.key=f.C0.NUL:c.keyCode>=51&&c.keyCode<=55?y.key=String.fromCharCode(c.keyCode-51+27):c.keyCode===56?y.key=f.C0.DEL:c.keyCode===219?y.key=f.C0.ESC:c.keyCode===220?y.key=f.C0.FS:c.keyCode===221&&(y.key=f.C0.GS)}return y}},482:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},a.utf32ToString=function(u,f=0,g=u.length){let c="";for(let _=f;_<g;++_){let x=u[_];x>65535?(x-=65536,c+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):c+=String.fromCharCode(x)}return c},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const g=u.length;if(!g)return 0;let c=0,_=0;if(this._interim){const x=u.charCodeAt(_++);56320<=x&&x<=57343?f[c++]=1024*(this._interim-55296)+x-56320+65536:(f[c++]=this._interim,f[c++]=x),this._interim=0}for(let x=_;x<g;++x){const C=u.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=g)return this._interim=C,c;const y=u.charCodeAt(x);56320<=y&&y<=57343?f[c++]=1024*(C-55296)+y-56320+65536:(f[c++]=C,f[c++]=y)}else C!==65279&&(f[c++]=C)}return c}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const g=u.length;if(!g)return 0;let c,_,x,C,y=0,m=0,b=0;if(this.interim[0]){let T=!1,D=this.interim[0];D&=(224&D)==192?31:(240&D)==224?15:7;let R,L=0;for(;(R=63&this.interim[++L])&&L<4;)D<<=6,D|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=A-L;for(;b<j;){if(b>=g)return 0;if(R=u[b++],(192&R)!=128){b--,T=!0;break}this.interim[L++]=R,D<<=6,D|=63&R}T||(A===2?D<128?b--:f[y++]=D:A===3?D<2048||D>=55296&&D<=57343||D===65279||(f[y++]=D):D<65536||D>1114111||(f[y++]=D)),this.interim.fill(0)}const S=g-4;let w=b;for(;w<g;){for(;!(!(w<S)||128&(c=u[w])||128&(_=u[w+1])||128&(x=u[w+2])||128&(C=u[w+3]));)f[y++]=c,f[y++]=_,f[y++]=x,f[y++]=C,w+=4;if(c=u[w++],c<128)f[y++]=c;else if((224&c)==192){if(w>=g)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(m=(31&c)<<6|63&_,m<128){w--;continue}f[y++]=m}else if((240&c)==224){if(w>=g)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(w>=g)return this.interim[0]=c,this.interim[1]=_,y;if(x=u[w++],(192&x)!=128){w--;continue}if(m=(15&c)<<12|(63&_)<<6|63&x,m<2048||m>=55296&&m<=57343||m===65279)continue;f[y++]=m}else if((248&c)==240){if(w>=g)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(w>=g)return this.interim[0]=c,this.interim[1]=_,y;if(x=u[w++],(192&x)!=128){w--;continue}if(w>=g)return this.interim[0]=c,this.interim[1]=_,this.interim[2]=x,y;if(C=u[w++],(192&C)!=128){w--;continue}if(m=(7&c)<<18|(63&_)<<12|(63&x)<<6|63&C,m<65536||m>1114111)continue;f[y++]=m}}return y}}},225:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const f=u(1480),g=[[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]],c=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;a.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<g.length;++x)_.fill(0,g[x][0],g[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(C,y){let m,b=0,S=y.length-1;if(C<y[0][0]||C>y[S][1])return!1;for(;S>=b;)if(m=b+S>>1,C>y[m][1])b=m+1;else{if(!(C<y[m][0]))return!0;S=m-1}return!1})(x,c)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let y=this.wcwidth(x),m=y===0&&C!==0;if(m){const b=f.UnicodeService.extractWidth(C);b===0?m=!1:b>y&&(y=b)}return f.UnicodeService.createPropertyValue(0,y,m)}}},5981:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const f=u(8460),g=u(844);class c extends g.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C)}_innerWrite(x=0,C=!0){const y=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],b=this._action(m,C);if(b){const w=T=>Date.now()-y>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(y,T);return void b.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(w)}const S=this._callbacks[this._bufferOffset];if(S&&S(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-y>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=c},5941:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function g(c,_){const x=c.toString(16),C=x.length<2?"0"+x:x;switch(_){case 4:return x[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}a.parseColor=function(c){if(!c)return;let _=c.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const x=u.exec(_);if(x){const C=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/C*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/C*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/C*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),f.exec(_)&&[3,6,9,12].includes(_.length))){const x=_.length/3,C=[0,0,0];for(let y=0;y<3;++y){const m=parseInt(_.slice(x*y,x*y+x),16);C[y]=x===1?m<<4:x===2?m:x===3?m>>4:m>>8}return C}},a.toRgbString=function(c,_=16){const[x,C,y]=c;return`rgb:${g(x,_)}/${g(C,_)}/${g(y,_)}`}},5770:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const f=u(482),g=u(8742),c=u(5770),_=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(C,y){this._handlers[C]===void 0&&(this._handlers[C]=[]);const m=this._handlers[C];return m.push(y),{dispose:()=>{const b=m.indexOf(y);b!==-1&&m.splice(b,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(C,y){if(this.reset(),this._ident=C,this._active=this._handlers[C]||_,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(C,y,m){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(C,y,m);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(C,y,m))}unhook(C,y=!0){if(this._active.length){let m=!1,b=this._active.length-1,S=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,m=y,S=this._stack.fallThrough,this._stack.paused=!1),!S&&m===!1){for(;b>=0&&(m=this._active[b].unhook(C),m!==!0);b--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,m;b--}for(;b>=0;b--)if(m=this._active[b].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",C);this._active=_,this._ident=0}};const x=new g.Params;x.addParam(0),a.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=x,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():x,this._data="",this._hitLimit=!1}put(C,y,m){this._hitLimit||(this._data+=(0,f.utf32ToString)(C,y,m),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let y=!1;if(this._hitLimit)y=!1;else if(C&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then((m=>(this._params=x,this._data="",this._hitLimit=!1,m)));return this._params=x,this._data="",this._hitLimit=!1,y}}},2015:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const f=u(844),g=u(8742),c=u(6242),_=u(6351);class x{constructor(b){this.table=new Uint8Array(b)}setDefault(b,S){this.table.fill(b<<4|S)}add(b,S,w,T){this.table[S<<8|b]=w<<4|T}addMany(b,S,w,T){for(let D=0;D<b.length;D++)this.table[S<<8|b[D]]=w<<4|T}}a.TransitionTable=x;const C=160;a.VT500_TRANSITION_TABLE=(function(){const m=new x(4095),b=Array.apply(null,Array(256)).map(((L,A)=>A)),S=(L,A)=>b.slice(L,A),w=S(32,127),T=S(0,24);T.push(25),T.push.apply(T,S(28,32));const D=S(0,14);let R;for(R in m.setDefault(1,0),m.addMany(w,0,2,0),D)m.addMany([24,26,153,154],R,3,0),m.addMany(S(128,144),R,3,0),m.addMany(S(144,152),R,3,0),m.add(156,R,0,0),m.add(27,R,11,1),m.add(157,R,4,8),m.addMany([152,158,159],R,0,7),m.add(155,R,11,3),m.add(144,R,11,9);return m.addMany(T,0,3,0),m.addMany(T,1,3,1),m.add(127,1,0,1),m.addMany(T,8,0,8),m.addMany(T,3,3,3),m.add(127,3,0,3),m.addMany(T,4,3,4),m.add(127,4,0,4),m.addMany(T,6,3,6),m.addMany(T,5,3,5),m.add(127,5,0,5),m.addMany(T,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(w,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(S(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(w,7,0,7),m.addMany(T,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(S(64,127),3,7,0),m.addMany(S(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(S(48,60),4,8,4),m.addMany(S(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(S(32,64),6,0,6),m.add(127,6,0,6),m.addMany(S(64,127),6,0,0),m.addMany(S(32,48),3,9,5),m.addMany(S(32,48),5,9,5),m.addMany(S(48,64),5,0,6),m.addMany(S(64,127),5,7,0),m.addMany(S(32,48),4,9,5),m.addMany(S(32,48),1,9,2),m.addMany(S(32,48),2,9,2),m.addMany(S(48,127),2,10,0),m.addMany(S(48,80),1,10,0),m.addMany(S(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(S(96,127),1,10,0),m.add(80,1,11,9),m.addMany(T,9,0,9),m.add(127,9,0,9),m.addMany(S(28,32),9,0,9),m.addMany(S(32,48),9,9,12),m.addMany(S(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(T,11,0,11),m.addMany(S(32,128),11,0,11),m.addMany(S(28,32),11,0,11),m.addMany(T,10,0,10),m.add(127,10,0,10),m.addMany(S(28,32),10,0,10),m.addMany(S(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(S(32,48),10,9,12),m.addMany(T,12,0,12),m.add(127,12,0,12),m.addMany(S(28,32),12,0,12),m.addMany(S(32,48),12,9,12),m.addMany(S(48,64),12,0,11),m.addMany(S(64,127),12,12,13),m.addMany(S(64,127),10,12,13),m.addMany(S(64,127),9,12,13),m.addMany(T,13,13,13),m.addMany(w,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(C,0,2,0),m.add(C,8,5,8),m.add(C,6,0,6),m.add(C,11,0,11),m.add(C,13,13,13),m})();class y extends f.Disposable{constructor(b=a.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(S,w,T)=>{},this._executeHandlerFb=S=>{},this._csiHandlerFb=(S,w)=>{},this._escHandlerFb=S=>{},this._errorHandlerFb=S=>S,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new c.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,S=[64,126]){let w=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(w=b.prefix.charCodeAt(0),w&&60>w||w>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let D=0;D<b.intermediates.length;++D){const R=b.intermediates.charCodeAt(D);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");w<<=8,w|=R}}if(b.final.length!==1)throw new Error("final must be a single byte");const T=b.final.charCodeAt(0);if(S[0]>T||T>S[1])throw new Error(`final must be in range ${S[0]} .. ${S[1]}`);return w<<=8,w|=T,w}identToString(b){const S=[];for(;b;)S.push(String.fromCharCode(255&b)),b>>=8;return S.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,S){const w=this._identifier(b,[48,126]);this._escHandlers[w]===void 0&&(this._escHandlers[w]=[]);const T=this._escHandlers[w];return T.push(S),{dispose:()=>{const D=T.indexOf(S);D!==-1&&T.splice(D,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,S){this._executeHandlers[b.charCodeAt(0)]=S}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,S){const w=this._identifier(b);this._csiHandlers[w]===void 0&&(this._csiHandlers[w]=[]);const T=this._csiHandlers[w];return T.push(S),{dispose:()=>{const D=T.indexOf(S);D!==-1&&T.splice(D,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,S){return this._dcsParser.registerHandler(this._identifier(b),S)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,S){return this._oscParser.registerHandler(b,S)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}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(b,S,w,T,D){this._parseStack.state=b,this._parseStack.handlers=S,this._parseStack.handlerPos=w,this._parseStack.transition=T,this._parseStack.chunkPos=D}parse(b,S,w){let T,D=0,R=0,L=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,L=this._parseStack.chunkPos+1;else{if(w===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(w===!1&&j>-1){for(;j>=0&&(T=A[j](this._params),T!==!0);j--)if(T instanceof Promise)return this._parseStack.handlerPos=j,T}this._parseStack.handlers=[];break;case 4:if(w===!1&&j>-1){for(;j>=0&&(T=A[j](),T!==!0);j--)if(T instanceof Promise)return this._parseStack.handlerPos=j,T}this._parseStack.handlers=[];break;case 6:if(D=b[this._parseStack.chunkPos],T=this._dcsParser.unhook(D!==24&&D!==26,w),T)return T;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(D=b[this._parseStack.chunkPos],T=this._oscParser.end(D!==24&&D!==26,w),T)return T;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,L=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=L;A<S;++A){switch(D=b[A],R=this._transitions.table[this.currentState<<8|(D<160?D:C)],R>>4){case 2:for(let H=A+1;;++H){if(H>=S||(D=b[H])<32||D>126&&D<C){this._printHandler(b,A,H),A=H-1;break}if(++H>=S||(D=b[H])<32||D>126&&D<C){this._printHandler(b,A,H),A=H-1;break}if(++H>=S||(D=b[H])<32||D>126&&D<C){this._printHandler(b,A,H),A=H-1;break}if(++H>=S||(D=b[H])<32||D>126&&D<C){this._printHandler(b,A,H),A=H-1;break}}break;case 3:this._executeHandlers[D]?this._executeHandlers[D]():this._executeHandlerFb(D),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:D,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|D];let M=j?j.length-1:-1;for(;M>=0&&(T=j[M](this._params),T!==!0);M--)if(T instanceof Promise)return this._preserveStack(3,j,M,R,A),T;M<0&&this._csiHandlerFb(this._collect<<8|D,this._params),this.precedingJoinState=0;break;case 8:do switch(D){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(D-48)}while(++A<S&&(D=b[A])>47&&D<60);A--;break;case 9:this._collect<<=8,this._collect|=D;break;case 10:const I=this._escHandlers[this._collect<<8|D];let B=I?I.length-1:-1;for(;B>=0&&(T=I[B](),T!==!0);B--)if(T instanceof Promise)return this._preserveStack(4,I,B,R,A),T;B<0&&this._escHandlerFb(this._collect<<8|D),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|D,this._params);break;case 13:for(let H=A+1;;++H)if(H>=S||(D=b[H])===24||D===26||D===27||D>127&&D<C){this._dcsParser.put(b,A,H),A=H-1;break}break;case 14:if(T=this._dcsParser.unhook(D!==24&&D!==26),T)return this._preserveStack(6,[],0,R,A),T;D===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let H=A+1;;H++)if(H>=S||(D=b[H])<32||D>127&&D<C){this._oscParser.put(b,A,H),A=H-1;break}break;case 6:if(T=this._oscParser.end(D!==24&&D!==26),T)return this._preserveStack(5,[],0,R,A),T;D===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}a.EscapeSequenceParser=y},6242:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const f=u(5770),g=u(482),c=[];a.OscParser=class{constructor(){this._state=0,this._active=c,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,x){this._handlers[_]===void 0&&(this._handlers[_]=[]);const C=this._handlers[_];return C.push(x),{dispose:()=>{const y=C.indexOf(x);y!==-1&&C.splice(y,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=c,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||c,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,x,C){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(_,x,C);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(_,x,C))}start(){this.reset(),this._state=1}put(_,x,C){if(this._state!==3){if(this._state===1)for(;x<C;){const y=_[x++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&C-x>0&&this._put(_,x,C)}}end(_,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,y=this._active.length-1,m=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,C=x,m=this._stack.fallThrough,this._stack.paused=!1),!m&&C===!1){for(;y>=0&&(C=this._active[y].end(_),C!==!0);y--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,C;y--}for(;y>=0;y--)if(C=this._active[y].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",_);this._active=c,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,x,C){this._hitLimit||(this._data+=(0,g.utf32ToString)(_,x,C),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let x=!1;if(this._hitLimit)x=!1;else if(_&&(x=this._handler(this._data),x instanceof Promise))return x.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,x}}},8742:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const u=2147483647;class f{static fromArray(c){const _=new f;if(!c.length)return _;for(let x=Array.isArray(c[0])?1:0;x<c.length;++x){const C=c[x];if(Array.isArray(C))for(let y=0;y<C.length;++y)_.addSubParam(C[y]);else _.addParam(C)}return _}constructor(c=32,_=32){if(this.maxLength=c,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(c),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(c),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const c=new f(this.maxLength,this.maxSubParamsLength);return c.params.set(this.params),c.length=this.length,c._subParams.set(this._subParams),c._subParamsLength=this._subParamsLength,c._subParamsIdx.set(this._subParamsIdx),c._rejectDigits=this._rejectDigits,c._rejectSubDigits=this._rejectSubDigits,c._digitIsSub=this._digitIsSub,c}toArray(){const c=[];for(let _=0;_<this.length;++_){c.push(this.params[_]);const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&c.push(Array.prototype.slice.call(this._subParams,x,C))}return c}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(c){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=c>u?u:c}}addSubParam(c){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=c>u?u:c,this._subParamsIdx[this.length-1]++}}hasSubParams(c){return(255&this._subParamsIdx[c])-(this._subParamsIdx[c]>>8)>0}getSubParams(c){const _=this._subParamsIdx[c]>>8,x=255&this._subParamsIdx[c];return x-_>0?this._subParams.subarray(_,x):null}getSubParamsAll(){const c={};for(let _=0;_<this.length;++_){const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&(c[_]=this._subParams.slice(x,C))}return c}addDigit(c){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,C=x[_-1];x[_-1]=~C?Math.min(10*C+c,u):c}}a.Params=f},5741:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,f){const g={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(g),f.dispose=()=>this._wrappedAddonDispose(g),f.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let f=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===u){f=g;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(f,1)}}},8771:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const f=u(3785),g=u(511);a.BufferApiView=class{constructor(c,_){this._buffer=c,this.type=_}init(c){return this._buffer=c,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(c){const _=this._buffer.lines.get(c);if(_)return new f.BufferLineApiView(_)}getNullCell(){return new g.CellData}}},3785:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const f=u(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,c){if(!(g<0||g>=this._line.length))return c?(this._line.loadCell(g,c),c):this._line.loadCell(g,new f.CellData)}translateToString(g,c,_){return this._line.translateToString(g,c,_)}}},8285:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const f=u(8771),g=u(8460),c=u(844);class _ extends c.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=_},7975:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,f){return this._core.registerCsiHandler(u,(g=>f(g.toArray())))}addCsiHandler(u,f){return this.registerCsiHandler(u,f)}registerDcsHandler(u,f){return this._core.registerDcsHandler(u,((g,c)=>f(g,c.toArray())))}addDcsHandler(u,f){return this.registerDcsHandler(u,f)}registerEscHandler(u,f){return this._core.registerEscHandler(u,f)}addEscHandler(u,f){return this.registerEscHandler(u,f)}registerOscHandler(u,f){return this._core.registerOscHandler(u,f)}addOscHandler(u,f){return this.registerOscHandler(u,f)}}},7090:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(p,a,u){var f=this&&this.__decorate||function(m,b,S,w){var T,D=arguments.length,R=D<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,b,S,w);else for(var L=m.length-1;L>=0;L--)(T=m[L])&&(R=(D<3?T(R):D>3?T(b,S,R):T(b,S))||R);return D>3&&R&&Object.defineProperty(b,S,R),R},g=this&&this.__param||function(m,b){return function(S,w){b(S,w,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const c=u(8460),_=u(844),x=u(5295),C=u(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let y=a.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(m,this))}resize(m,b){this.cols=m,this.rows=b,this.buffers.resize(m,b),this._onResize.fire({cols:m,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,b=!1){const S=this.buffer;let w;w=this._cachedBlankLine,w&&w.length===this.cols&&w.getFg(0)===m.fg&&w.getBg(0)===m.bg||(w=S.getBlankLine(m,b),this._cachedBlankLine=w),w.isWrapped=b;const T=S.ybase+S.scrollTop,D=S.ybase+S.scrollBottom;if(S.scrollTop===0){const R=S.lines.isFull;D===S.lines.length-1?R?S.lines.recycle().copyFrom(w):S.lines.push(w.clone()):S.lines.splice(D+1,0,w.clone()),R?this.isUserScrolling&&(S.ydisp=Math.max(S.ydisp-1,0)):(S.ybase++,this.isUserScrolling||S.ydisp++)}else{const R=D-T+1;S.lines.shiftElements(T+1,R-1,-1),S.lines.set(D,w.clone())}this.isUserScrolling||(S.ydisp=S.ybase),this._onScroll.fire(S.ydisp)}scrollLines(m,b,S){const w=this.buffer;if(m<0){if(w.ydisp===0)return;this.isUserScrolling=!0}else m+w.ydisp>=w.ybase&&(this.isUserScrolling=!1);const T=w.ydisp;w.ydisp=Math.max(Math.min(w.ydisp+m,w.ybase),0),T!==w.ydisp&&(b||this._onScroll.fire(w.ydisp))}};a.BufferService=y=f([g(0,C.IOptionsService)],y)},7994:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,f){this._charsets[u]=f,this.glevel===u&&(this.charset=f)}}},1753:function(p,a,u){var f=this&&this.__decorate||function(w,T,D,R){var L,A=arguments.length,j=A<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,D):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,T,D,R);else for(var M=w.length-1;M>=0;M--)(L=w[M])&&(j=(A<3?L(j):A>3?L(T,D,j):L(T,D))||j);return A>3&&j&&Object.defineProperty(T,D,j),j},g=this&&this.__param||function(w,T){return function(D,R){T(D,R,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const c=u(2585),_=u(8460),x=u(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:w=>w.button!==4&&w.action===1&&(w.ctrl=!1,w.alt=!1,w.shift=!1,!0)},VT200:{events:19,restrict:w=>w.action!==32},DRAG:{events:23,restrict:w=>w.action!==32||w.button!==3},ANY:{events:31,restrict:w=>!0}};function y(w,T){let D=(w.ctrl?16:0)|(w.shift?4:0)|(w.alt?8:0);return w.button===4?(D|=64,D|=w.action):(D|=3&w.button,4&w.button&&(D|=64),8&w.button&&(D|=128),w.action===32?D|=32:w.action!==0||T||(D|=3)),D}const m=String.fromCharCode,b={DEFAULT:w=>{const T=[y(w,!1)+32,w.col+32,w.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${m(T[0])}${m(T[1])}${m(T[2])}`},SGR:w=>{const T=w.action===0&&w.button!==4?"m":"M";return`\x1B[<${y(w,!0)};${w.col};${w.row}${T}`},SGR_PIXELS:w=>{const T=w.action===0&&w.button!==4?"m":"M";return`\x1B[<${y(w,!0)};${w.x};${w.y}${T}`}};let S=a.CoreMouseService=class extends x.Disposable{constructor(w,T){super(),this._bufferService=w,this._coreService=T,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const D of Object.keys(C))this.addProtocol(D,C[D]);for(const D of Object.keys(b))this.addEncoding(D,b[D]);this.reset()}addProtocol(w,T){this._protocols[w]=T}addEncoding(w,T){this._encodings[w]=T}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(w){if(!this._protocols[w])throw new Error(`unknown protocol "${w}"`);this._activeProtocol=w,this._onProtocolChange.fire(this._protocols[w].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(w){if(!this._encodings[w])throw new Error(`unknown encoding "${w}"`);this._activeEncoding=w}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(w){if(w.col<0||w.col>=this._bufferService.cols||w.row<0||w.row>=this._bufferService.rows||w.button===4&&w.action===32||w.button===3&&w.action!==32||w.button!==4&&(w.action===2||w.action===3)||(w.col++,w.row++,w.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,w,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(w))return!1;const T=this._encodings[this._activeEncoding](w);return T&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(T):this._coreService.triggerDataEvent(T,!0)),this._lastEvent=w,!0}explainEvents(w){return{down:!!(1&w),up:!!(2&w),drag:!!(4&w),move:!!(8&w),wheel:!!(16&w)}}_equalEvents(w,T,D){if(D){if(w.x!==T.x||w.y!==T.y)return!1}else if(w.col!==T.col||w.row!==T.row)return!1;return w.button===T.button&&w.action===T.action&&w.ctrl===T.ctrl&&w.alt===T.alt&&w.shift===T.shift}};a.CoreMouseService=S=f([g(0,c.IBufferService),g(1,c.ICoreService)],S)},6975:function(p,a,u){var f=this&&this.__decorate||function(S,w,T,D){var R,L=arguments.length,A=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,w,T,D);else for(var j=S.length-1;j>=0;j--)(R=S[j])&&(A=(L<3?R(A):L>3?R(w,T,A):R(w,T))||A);return L>3&&A&&Object.defineProperty(w,T,A),A},g=this&&this.__param||function(S,w){return function(T,D){w(T,D,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const c=u(1439),_=u(8460),x=u(844),C=u(2585),y=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=a.CoreService=class extends x.Disposable{constructor(S,w,T){super(),this._bufferService=S,this._logService=w,this._optionsService=T,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,c.clone)(y),this.decPrivateModes=(0,c.clone)(m)}reset(){this.modes=(0,c.clone)(y),this.decPrivateModes=(0,c.clone)(m)}triggerDataEvent(S,w=!1){if(this._optionsService.rawOptions.disableStdin)return;const T=this._bufferService.buffer;w&&this._optionsService.rawOptions.scrollOnUserInput&&T.ybase!==T.ydisp&&this._onRequestScrollToBottom.fire(),w&&this._onUserInput.fire(),this._logService.debug(`sending data "${S}"`,(()=>S.split("").map((D=>D.charCodeAt(0))))),this._onData.fire(S)}triggerBinaryEvent(S){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${S}"`,(()=>S.split("").map((w=>w.charCodeAt(0))))),this._onBinary.fire(S))}};a.CoreService=b=f([g(0,C.IBufferService),g(1,C.ILogService),g(2,C.IOptionsService)],b)},9074:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const f=u(8055),g=u(8460),c=u(844),_=u(6106);let x=0,C=0;class y extends c.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((S=>S==null?void 0:S.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,c.toDisposable)((()=>this.reset())))}registerDecoration(S){if(S.marker.isDisposed)return;const w=new m(S);if(w){const T=w.marker.onDispose((()=>w.dispose()));w.onDispose((()=>{w&&(this._decorations.delete(w)&&this._onDecorationRemoved.fire(w),T.dispose())})),this._decorations.insert(w),this._onDecorationRegistered.fire(w)}return w}reset(){for(const S of this._decorations.values())S.dispose();this._decorations.clear()}*getDecorationsAtCell(S,w,T){let D=0,R=0;for(const L of this._decorations.getKeyIterator(w))D=L.options.x??0,R=D+(L.options.width??1),S>=D&&S<R&&(!T||(L.options.layer??"bottom")===T)&&(yield L)}forEachDecorationAtCell(S,w,T,D){this._decorations.forEachByKey(w,(R=>{x=R.options.x??0,C=x+(R.options.width??1),S>=x&&S<C&&(!T||(R.options.layer??"bottom")===T)&&D(R)}))}}a.DecorationService=y;class m extends c.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(S){super(),this.options=S,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=S.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const f=u(2585),g=u(8343);class c{constructor(...x){this._entries=new Map;for(const[C,y]of x)this.set(C,y)}set(x,C){const y=this._entries.get(x);return this._entries.set(x,C),y}forEach(x){for(const[C,y]of this._entries.entries())x(C,y)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}a.ServiceCollection=c,a.InstantiationService=class{constructor(){this._services=new c,this._services.set(f.IInstantiationService,this)}setService(_,x){this._services.set(_,x)}getService(_){return this._services.get(_)}createInstance(_,...x){const C=(0,g.getServiceDependencies)(_).sort(((b,S)=>b.index-S.index)),y=[];for(const b of C){const S=this._services.get(b.id);if(!S)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${b.id}.`);y.push(S)}const m=C.length>0?C[0].index:x.length;if(x.length!==m)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${m+1} conflicts with ${x.length} static arguments`);return new _(...x,...y)}}},7866:function(p,a,u){var f=this&&this.__decorate||function(m,b,S,w){var T,D=arguments.length,R=D<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,b,S,w);else for(var L=m.length-1;L>=0;L--)(T=m[L])&&(R=(D<3?T(R):D>3?T(b,S,R):T(b,S))||R);return D>3&&R&&Object.defineProperty(b,S,R),R},g=this&&this.__param||function(m,b){return function(S,w){b(S,w,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const c=u(844),_=u(2585),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let C,y=a.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let b=0;b<m.length;b++)typeof m[b]=="function"&&(m[b]=m[b]())}_log(m,b,S){this._evalLazyOptionalParams(S),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...S)}trace(m,...b){var S;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.trace.bind(this._optionsService.options.logger))??console.log,m,b)}debug(m,...b){var S;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.debug.bind(this._optionsService.options.logger))??console.log,m,b)}info(m,...b){var S;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.info.bind(this._optionsService.options.logger))??console.info,m,b)}warn(m,...b){var S;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.warn.bind(this._optionsService.options.logger))??console.warn,m,b)}error(m,...b){var S;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.error.bind(this._optionsService.options.logger))??console.error,m,b)}};a.LogService=y=f([g(0,_.IOptionsService)],y),a.setTraceLogger=function(m){C=m},a.traceCall=function(m,b,S){if(typeof S.value!="function")throw new Error("not supported");const w=S.value;S.value=function(...T){if(C.logLevel!==_.LogLevelEnum.TRACE)return w.apply(this,T);C.trace(`GlyphRenderer#${w.name}(${T.map((R=>JSON.stringify(R))).join(", ")})`);const D=w.apply(this,T);return C.trace(`GlyphRenderer#${w.name} return`,D),D}}},7302:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const f=u(8460),g=u(844),c=u(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:c.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends g.Disposable{constructor(y){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m={...a.DEFAULT_OPTIONS};for(const b in y)if(b in m)try{const S=y[b];m[b]=this._sanitizeAndValidateOption(b,S)}catch(S){console.error(S)}this.rawOptions=m,this.options={...m},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(y,m){return this.onOptionChange((b=>{b===y&&m(this.rawOptions[y])}))}onMultipleOptionChange(y,m){return this.onOptionChange((b=>{y.indexOf(b)!==-1&&m()}))}_setupOptions(){const y=b=>{if(!(b in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},m=(b,S)=>{if(!(b in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);S=this._sanitizeAndValidateOption(b,S),this.rawOptions[b]!==S&&(this.rawOptions[b]=S,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const S={get:y.bind(this,b),set:m.bind(this,b)};Object.defineProperty(this.options,b,S)}}_sanitizeAndValidateOption(y,m){switch(y){case"cursorStyle":if(m||(m=a.DEFAULT_OPTIONS[y]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(m))throw new Error(`"${m}" is not a valid value for ${y}`);break;case"wordSeparator":m||(m=a.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=_.includes(m)?m:a.DEFAULT_OPTIONS[y];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${y} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${y} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}a.OptionsService=x},2660:function(p,a,u){var f=this&&this.__decorate||function(x,C,y,m){var b,S=arguments.length,w=S<3?C:m===null?m=Object.getOwnPropertyDescriptor(C,y):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(x,C,y,m);else for(var T=x.length-1;T>=0;T--)(b=x[T])&&(w=(S<3?b(w):S>3?b(C,y,w):b(C,y))||w);return S>3&&w&&Object.defineProperty(C,y,w),w},g=this&&this.__param||function(x,C){return function(y,m){C(y,m,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const c=u(2585);let _=a.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const C=this._bufferService.buffer;if(x.id===void 0){const T=C.addMarker(C.ybase+C.y),D={data:x,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(D,T))),this._dataByLinkId.set(D.id,D),D.id}const y=x,m=this._getEntryIdKey(y),b=this._entriesWithId.get(m);if(b)return this.addLineToLink(b.id,C.ybase+C.y),b.id;const S=C.addMarker(C.ybase+C.y),w={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(w,S))),this._entriesWithId.set(w.key,w),this._dataByLinkId.set(w.id,w),w.id}addLineToLink(x,C){const y=this._dataByLinkId.get(x);if(y&&y.lines.every((m=>m.line!==C))){const m=this._bufferService.buffer.addMarker(C);y.lines.push(m),m.onDispose((()=>this._removeMarkerFromLink(y,m)))}}getLinkData(x){var C;return(C=this._dataByLinkId.get(x))==null?void 0:C.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,C){const y=x.lines.indexOf(C);y!==-1&&(x.lines.splice(y,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};a.OscLinkService=_=f([g(0,c.IBufferService)],_)},8343:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const u="di$target",f="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[f]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const c=function(_,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,m,b){m[u]===m?m[f].push({id:y,index:b}):(m[f]=[{id:y,index:b}],m[u]=m)})(c,_,C)};return c.toString=()=>g,a.serviceRegistry.set(g,c),c}},2585:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const f=u(8343);var g;a.IBufferService=(0,f.createDecorator)("BufferService"),a.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),a.ICoreService=(0,f.createDecorator)("CoreService"),a.ICharsetService=(0,f.createDecorator)("CharsetService"),a.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(g||(a.LogLevelEnum=g={})),a.ILogService=(0,f.createDecorator)("LogService"),a.IOptionsService=(0,f.createDecorator)("OptionsService"),a.IOscLinkService=(0,f.createDecorator)("OscLinkService"),a.IUnicodeService=(0,f.createDecorator)("UnicodeService"),a.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(p,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const f=u(8460),g=u(225);class c{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,y=!1){return(16777215&x)<<3|(3&C)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const x=new g.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,y=0;const m=x.length;for(let b=0;b<m;++b){let S=x.charCodeAt(b);if(55296<=S&&S<=56319){if(++b>=m)return C+this.wcwidth(S);const D=x.charCodeAt(b);56320<=D&&D<=57343?S=1024*(S-55296)+D-56320+65536:C+=this.wcwidth(D)}const w=this.charProperties(S,y);let T=c.extractWidth(w);c.extractShouldJoin(w)&&(T-=c.extractWidth(y)),C+=T,y=w}return C}charProperties(x,C){return this._activeProvider.charProperties(x,C)}}a.UnicodeService=c}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var u=s[p]={exports:{}};return r[p].call(u.exports,u,u.exports,l),u.exports}var d={};return(()=>{var p=d;Object.defineProperty(p,"__esModule",{value:!0}),p.Terminal=void 0;const a=l(9042),u=l(3236),f=l(844),g=l(5741),c=l(8285),_=l(7975),x=l(7090),C=["cols","rows"];class y extends f.Disposable{constructor(b){super(),this._core=this.register(new u.Terminal(b)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const S=T=>this._core.options[T],w=(T,D)=>{this._checkReadonlyOptions(T),this._core.options[T]=D};for(const T in this._core.options){const D={get:S.bind(this,T),set:w.bind(this,T)};Object.defineProperty(this._publicOptions,T,D)}}_checkReadonlyOptions(b){if(C.includes(b))throw new Error(`Option "${b}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new c.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let S="none";switch(this._core.coreMouseService.activeProtocol){case"X10":S="x10";break;case"VT200":S="vt200";break;case"DRAG":S="drag";break;case"ANY":S="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:S,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const S in b)this._publicOptions[S]=b[S]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,S=!0){this._core.input(b,S)}resize(b,S){this._verifyIntegers(b,S),this._core.resize(b,S)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,S,w){this._verifyIntegers(b,S,w),this._core.select(b,S,w)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,S){this._verifyIntegers(b,S),this._core.selectLines(b,S)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,S){this._core.write(b,S)}writeln(b,S){this._core.write(b),this._core.write(`\r
628
- `,S)}paste(b){this._core.paste(b)}refresh(b,S){this._verifyIntegers(b,S),this._core.refresh(b,S)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return a}_verifyIntegers(...b){for(const S of b)if(S===1/0||isNaN(S)||S%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const S of b)if(S&&(S===1/0||isNaN(S)||S%1!=0||S<0))throw new Error("This API only accepts positive integers")}}p.Terminal=y})(),d})()))})(xm)),xm.exports}var J9=Z9();const eB=/(?:[A-Za-z]:[\\/]|\.{1,2}[\\/]|[\\/])?(?:[\w.@-]+[\\/])+[\w.@-]+\.[A-Za-z0-9]{1,10}(?::\d+(?::\d+)?)?/g;function id(e){var s;let i=e;if(/^file:/i.test(i))try{i=decodeURIComponent(new URL(i).pathname).replace(/^\/([A-Za-z]:)/,"$1")}catch{return null}i=i.replace(/\\/g,"/").replace(/:\d+(?::\d+)?$/,"");const r=(s=ge.getState().health)==null?void 0:s.projectRoot.replace(/\\/g,"/").replace(/\/$/,"");if(/^([A-Za-z]:)?\//.test(i)){if(!r||!i.toLowerCase().startsWith(`${r.toLowerCase()}/`))return null;i=i.slice(r.length+1)}return i=i.replace(/^(\.\/)+/,""),i&&!i.startsWith("../")?i:null}function jv(e){if(id(e))return null;const i=e.replace(/:\d+(?::\d+)?$/,"");return/^([A-Za-z]:[\\/]|\/)/.test(i)?i:null}const xw=new Map;function tB(e){const i=id(e),r=i?null:jv(e),s=i??r;if(!s)return Promise.resolve(!1);const l=xw.get(s);if(l&&Date.now()-l.at<3e4)return l.exists;const d=(i?Kt.stat(i):fetch(`/api/local-file/stat?path=${encodeURIComponent(r)}`).then(p=>p.json())).then(p=>p.exists,()=>!1);return xw.set(s,{at:Date.now(),exists:d}),d}function nB(e,i){var f;const r=e.buffer.active,s=g=>{var c;return((c=r.getLine(g))==null?void 0:c.translateToString(!0))??""},l=g=>{const c=r.getLine(g+1);return!!(c&&(c.isWrapped||s(g).length>=e.cols-2&&/^ {1,4}\S/.test(s(g+1))))};let d=i;for(;d>0&&l(d-1);)d-=1;let p=i;for(;p<r.length-1&&l(p);)p+=1;let a="";const u=[];for(let g=d;g<=p;g+=1){const c=s(g),_=g>d?((f=/^ {1,4}(?=\S)/.exec(c))==null?void 0:f[0].length)??0:0;for(let x=_;x<c.length;x+=1)u.push({x:x+1,y:g+1});a+=c.slice(_)}return{text:a,cells:u}}function iB(e){var l;const i=[],r=(l=ge.getState().health)==null?void 0:l.projectRoot.replace(/\\/g,"/").replace(/\/$/,"").toLowerCase(),s=e.replace(/\\/g,"/").toLowerCase();for(let d=r?s.indexOf(`${r}/`):-1;r&&d!==-1;d=s.indexOf(`${r}/`,d+1)){const p=/^[^\s:*?"<>|()]+(?::\d+(?::\d+)?)?/.exec(e.slice(d+r.length+1));p&&i.push({index:d,text:e.slice(d,d+r.length+1+p[0].length)})}for(const d of e.matchAll(eB)){const p=d.index;i.some(a=>p<a.index+a.text.length&&a.index<p+d[0].length)||/[a-z][\w+.-]*:\/{1,2}\S*$/i.test(e.slice(0,p))||i.push({index:p,text:d[0]})}return i}function yw(e,i,r){if(!e.ctrlKey&&!e.metaKey)return!1;const s=id(i),l=s?null:jv(i);if(l)return window.open(`/api/local-file?path=${encodeURIComponent(l)}`,"_blank","noopener"),!0;if(!s)return!1;const{sessions:d,go:p}=ge.getState(),a=d.find(u=>u.terminalId===r);return a&&cT(s,a.id),Bn.getState().pin(s),p({kind:"file",path:s}),!0}const rB=8,Ws=new Map;function bw(e,i){e.state=i;for(const r of e.listeners)r()}function sB(){const e=[...Ws.values()].filter(r=>!r.mounted);for(const r of e)(r.ended||r.state==="closed")&&r.dispose();const i=[...Ws.values()].filter(r=>!r.mounted).sort((r,s)=>r.usedAt-s.usedAt);for(;Ws.size>rB&&i.length;)i.shift().dispose()}function oB(e){const i=Ws.get(e);if(i&&i.state!=="closed")return i;i==null||i.dispose();const r=new J9.Terminal({cursorBlink:!0,fontFamily:'ui-monospace, "Cascadia Mono", Consolas, SFMono-Regular, Menlo, monospace',fontSize:13,scrollback:1e4,allowProposedApi:!0,rescaleOverlappingGlyphs:!0,linkHandler:{allowNonHttpProtocols:!0,activate:(c,_)=>{/^https?:/i.test(_)?window.open(_,"_blank","noopener"):yw(c,_,e)}},theme:{background:"#141413",foreground:"#f5f4ee",cursor:"#d77757",selectionBackground:"#d7775755"}}),s=new U9.FitAddon;r.loadAddon(s),r.loadAddon(new K9.WebLinksAddon);const l=new q9.SearchAddon;r.loadAddon(l);const d=r.registerLinkProvider({provideLinks:(c,_)=>{const{text:x,cells:C}=nB(r,c-1),y=iB(x).filter(m=>(id(m.text)||jv(m.text))&&C.slice(m.index,m.index+m.text.length).some(b=>b.y===c));if(!y.length)return _(void 0);Promise.all(y.map(m=>tB(m.text))).then(m=>{const b=y.filter((S,w)=>m[w]).map(S=>({text:S.text,range:{start:C[S.index],end:C[S.index+S.text.length-1]},activate:(w,T)=>void yw(w,T,e)}));_(b.length?b:void 0)})}});r.loadAddon(new G9.Unicode11Addon),r.unicode.activeVersion="11";const p=document.createElement("div");p.className="h-full w-full";const a=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/api/terminals/${e}`),u=c=>a.readyState===WebSocket.OPEN&&a.send(JSON.stringify(c)),f={terminalId:e,term:r,fit:s,search:l,element:p,socket:a,state:"connecting",ended:!1,mounted:!1,usedAt:Date.now(),opened:!1,listeners:new Set,send:u,sendSize:()=>u({type:"resize",cols:r.cols,rows:r.rows}),copy:()=>{const c=r.getSelection();return c?(navigator.clipboard.writeText(c).then(()=>ge.getState().notify("Copied."),()=>ge.getState().notify("Could not copy to the clipboard.","error")),r.clearSelection(),!0):!1},dispose:()=>{Ws.get(e)===f&&Ws.delete(e),d.dispose(),g.dispose(),a.onclose=null,a.close(),r.dispose(),p.remove()}};r.attachCustomKeyEventHandler(c=>c.type!=="keydown"||!c.ctrlKey||c.altKey||c.metaKey?!0:c.code==="KeyV"&&!c.shiftKey?!1:c.code==="KeyC"&&r.hasSelection()?(c.preventDefault(),f.copy(),!1):c.code==="KeyF"&&!c.shiftKey&&f.onFind?(c.preventDefault(),f.onFind(),!1):c.key==="Enter"&&!c.shiftKey?(c.preventDefault(),u({type:"input",data:""}),!1):!0),a.onopen=()=>{bw(f,"open"),f.sendSize(),f.mounted&&r.focus()},a.onmessage=c=>{var x;const _=JSON.parse(c.data);_.type==="output"&&_.data&&r.write(_.data),_.type==="exit"&&(f.ended=!0,r.write(`\r
629
- \x1B[2m[session ended, exit code ${_.code}]\x1B[0m\r
630
- `),(x=f.onExit)==null||x.call(f))},a.onclose=()=>{bw(f,"closed"),f.mounted||f.dispose()};const g=r.onData(c=>u({type:"input",data:c}));return Ws.set(e,f),f}function aB(e,i){if(e.mounted=!0,e.usedAt=Date.now(),i.appendChild(e.element),!e.opened){e.opened=!0,e.term.open(e.element);try{const r=new Q9.WebglAddon;r.onContextLoss(()=>r.dispose()),e.term.loadAddon(r)}catch{}}try{e.fit.fit(),e.sendSize()}catch{}e.term.focus()}const lB=e=>/\s/.test(e)?`"${e}"`:e;function cB({terminalId:e,onExit:i}){const r=P.useRef(null),s=P.useRef(null),[l,d]=P.useState("connecting"),[p,a]=P.useState(!1),[u,f]=P.useState(!1);P.useEffect(()=>{if(!r.current)return;const c=oB(e);s.current=c;const _=()=>d(c.state);c.listeners.add(_),_(),c.onExit=i,c.onFind=()=>a(!0),aB(c,r.current);const x=new ResizeObserver(()=>{try{c.fit.fit(),c.sendSize()}catch{}});return x.observe(r.current),()=>{x.disconnect(),c.listeners.delete(_),c.onExit=void 0,c.onFind=void 0,c.mounted=!1,c.usedAt=Date.now(),c.element.remove(),s.current=null,sB()}},[e]);const g=async c=>{c.preventDefault(),f(!1);const _=s.current;if(!_)return;const x=[...c.dataTransfer.files];if(!x.length){const C=c.dataTransfer.getData("text/plain");C&&_.term.paste(C),_.term.focus();return}try{const C=[];for(const y of x){const m=await fetch(`${gi()}/drop`,{method:"POST",headers:{"Content-Type":"application/octet-stream","X-File-Name":encodeURIComponent(y.name)},body:y}),b=await m.json().catch(()=>({}));if(!m.ok||!b.path)throw new Error(b.error??`${m.status} ${m.statusText}`);C.push(lB(b.path))}_.term.paste(C.join(" ")+" "),_.term.focus()}catch(C){ge.getState().notify(`Could not drop the file: ${C.message}`,"error")}};return v.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden rounded-lg border bg-[#141413]",onDragOver:c=>{[...c.dataTransfer.types].some(_=>_==="Files"||_==="text/plain")&&(c.preventDefault(),c.dataTransfer.dropEffect="copy",f(!0))},onDragLeave:c=>{c.currentTarget.contains(c.relatedTarget)||f(!1)},onDrop:c=>void g(c),children:[v.jsx("div",{ref:r,className:"terminal-host h-full w-full",onContextMenu:c=>{var _;c.preventDefault(),(_=s.current)==null||_.copy()}}),p&&s.current&&v.jsx(hB,{search:s.current.search,onClose:()=>{var c,_;(c=s.current)==null||c.search.clearDecorations(),a(!1),(_=s.current)==null||_.term.focus()}}),u&&v.jsx("div",{className:"pointer-events-none absolute inset-2 grid place-items-center rounded-lg border-2 border-dashed border-primary/70 bg-primary/10 text-xs text-foreground",children:"Drop to paste its path"}),l==="connecting"&&v.jsx("div",{className:"absolute bottom-2 right-3 text-[11px] text-muted-foreground",children:"connecting..."}),l==="closed"&&v.jsx("div",{className:"absolute bottom-2 right-3 text-[11px] text-muted-foreground",children:"detached"})]})}const uB={matchBackground:"#d7775755",matchOverviewRuler:"#d77757",activeMatchBackground:"#d77757",activeMatchColorOverviewRuler:"#f5f4ee"};function hB({search:e,onClose:i}){const[r,s]=P.useState(""),[l,d]=P.useState(null),p=P.useRef(null);P.useEffect(()=>{var f;(f=p.current)==null||f.focus();const u=e.onDidChangeResults(g=>d({index:g.resultIndex,count:g.resultCount}));return()=>u.dispose()},[e]);const a=(u,f=r)=>{if(!f){e.clearDecorations(),d(null);return}const g={decorations:uB,incremental:!1};u?e.findNext(f,g):e.findPrevious(f,g)};return v.jsxs("div",{className:"absolute right-3 top-2 z-10 flex items-center gap-1 rounded-md border bg-background/95 px-1.5 py-1 shadow-lg",children:[v.jsx("input",{ref:p,value:r,placeholder:"Find","aria-label":"Find in the terminal",onChange:u=>{s(u.target.value),a(!0,u.target.value)},onKeyDown:u=>{u.key==="Escape"?(u.preventDefault(),i()):u.key==="Enter"&&(u.preventDefault(),a(!u.shiftKey))},className:"w-44 bg-transparent px-1 text-xs focus:outline-none"}),v.jsx("span",{className:"min-w-[3.5rem] text-right text-[10px] tabular-nums text-muted-foreground",children:r?l&&l.count?`${l.index+1}/${l.count}`:"none":""}),v.jsx("button",{onClick:()=>a(!1),title:"Previous (Shift+Enter)","aria-label":"Previous match",className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(Y3,{size:13})}),v.jsx("button",{onClick:()=>a(!0),title:"Next (Enter)","aria-label":"Next match",className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(xa,{size:13})}),v.jsx("button",{onClick:i,title:"Close (Esc)","aria-label":"Close find",className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(pn,{size:13})})]})}function D5({trigger:e,title:i,icon:r,badge:s,description:l,open:d,onOpenChange:p,children:a}){return v.jsxs(GS,{open:d,onOpenChange:p,children:[v.jsx(HR,{asChild:!0,children:e}),v.jsxs(XS,{children:[v.jsx(QS,{className:"fixed inset-0 z-50 bg-foreground/30 animate-in fade-in-0"}),v.jsxs(ZS,{className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-xl flex-col border-l bg-card shadow-xl focus:outline-none animate-in slide-in-from-right",children:[v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-4 py-3",children:[r,s,v.jsx(eC,{className:"min-w-0 truncate text-sm font-semibold",children:i}),v.jsx(tC,{className:"sr-only",children:l}),v.jsx(nC,{asChild:!0,children:v.jsx(xe,{variant:"ghost",size:"icon",className:"ml-auto","aria-label":"Close",children:v.jsx(pn,{size:15})})})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:a})]})]})]})}function L5({id:e}){const i=ge(w=>w.sessions.find(T=>T.id===e)),r=ge(w=>w.transcriptTicks[e]??0),s=ge(w=>w.ticks.interactions),[l,d]=P.useState(null),[p,a]=P.useState("terminal"),[u,f]=P.useState(!1),g=ge(w=>w.windowed),c=mn(),_=Qh(),[x,C]=P.useState("idle"),y=P.useRef(!1);if(P.useEffect(()=>{y.current||!i||(y.current=!0,!i.live&&(C("starting"),ve.resumeSession(e).then(()=>C("idle"),w=>{C("failed"),ge.getState().notify(w.message,"error")})))},[e,i]),P.useEffect(()=>{d(null),f(!1),a("terminal")},[e]),P.useEffect(()=>{let w=!1;return ve.session(e).then(T=>!w&&d(T),()=>!w&&f(!0)),()=>{w=!0}},[e,r,s,i==null?void 0:i.status,i==null?void 0:i.terminalId]),!i&&u)return v.jsx(nn,{title:"This session is gone.",hint:"Its transcript may have been cleaned up by Claude Code.",className:"m-6"});if(!i)return v.jsx("div",{className:"p-6 text-xs text-muted-foreground",children:"Loading..."});const m=((l==null?void 0:l.interactions)??[]).filter(w=>w.status==="open"),b=()=>it(()=>ve.resumeSession(e)),S=()=>c({title:"Stop this session?",description:"The conversation is kept for a later resume.",confirmLabel:"Stop",tone:"destructive",run:async()=>{await ve.killSession(e),Xh([e])}});return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsxs("header",{className:"flex items-center gap-3 border-b px-3 py-3 sm:px-5",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ed,{session:i}),v.jsx("h1",{className:"truncate text-sm font-semibold",children:i.title})]}),v.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap text-[11px] text-muted-foreground [&>*]:shrink-0",children:[v.jsx(nt,{tone:i.status==="waiting"?"warning":i.status==="running"||i.status==="idle"?"success":i.status==="done"?"on":"off",children:i.status}),v.jsx(nt,{tone:"off",children:i.origin==="external"?"started in a terminal":`from ${i.origin}`}),i.category&&v.jsxs(nt,{tone:"off",children:["category: ",i.category]}),i.purpose&&v.jsxs(nt,{tone:"on",icon:Ql,children:["hub task: ",i.purpose.title]}),v.jsx("span",{children:Xs(i.startedAt)}),i.tokens&&v.jsxs("span",{children:["· ",On(os(i.tokens))," tokens"]}),v.jsxs("span",{className:"inline-flex min-w-0 !shrink items-center gap-1 font-mono",title:`Claude Code session id: ${i.id}`,children:[v.jsx("span",{className:"truncate",children:i.id}),v.jsx(zl,{text:i.id})]})]})]}),v.jsxs("div",{className:"flex shrink-0 gap-1.5",children:[v.jsx(xe,{variant:"ghost",size:"icon",title:"Rename","aria-label":"Rename",onClick:()=>void _.rename(i),children:v.jsx(Wi,{size:13})}),v.jsx(xe,{variant:"ghost",size:"icon",title:i.live?"Stop and delete permanently":"Delete permanently","aria-label":"Delete permanently",onClick:()=>void _.remove(i),children:v.jsx(yr,{size:13})}),!g&&v.jsxs(xe,{variant:"ghost",title:"Open in a window of its own","aria-label":"New window",onClick:()=>Cg({kind:"session",id:e}),children:[v.jsx(ba,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"New window"})]}),i.live?v.jsxs(xe,{variant:"muted",title:"Stop","aria-label":"Stop",onClick:()=>void S(),children:[v.jsx(Ah,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Stop"})]}):v.jsxs(xe,{variant:"primary",title:"Resume here","aria-label":"Resume here",onClick:()=>void b(),children:[v.jsx(ma,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Resume here"})]})]})]}),v.jsx("div",{className:"no-scrollbar flex gap-1 overflow-x-auto border-b px-2 sm:px-4",children:[["terminal","Terminal"],["setup","Setup"],["activity","Activity"],["toolset","Toolset"],["interactions",`Interactions${l!=null&&l.interactions.length?` (${l.interactions.length})`:""}`]].map(([w,T])=>v.jsx("button",{onClick:()=>a(w),className:ye("shrink-0 whitespace-nowrap border-b-2 px-3 py-2 text-xs transition-colors",p===w?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:T},w))}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[v.jsxs("div",{className:ye("relative h-full p-2 sm:p-3",p!=="terminal"&&"hidden"),children:[v.jsxs("div",{className:"absolute right-4 top-4 z-10 flex gap-1.5 sm:right-5 sm:top-5",children:[v.jsx(fB,{items:m}),i.purpose&&(l==null?void 0:l.purposeNote)&&v.jsx(dB,{title:i.purpose.title,note:l.purposeNote})]}),i.terminalId?v.jsx(cB,{terminalId:i.terminalId},i.terminalId):v.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 rounded-lg border border-dashed",children:[x==="starting"?v.jsx("div",{className:"text-xs text-muted-foreground",children:"Starting the terminal..."}):v.jsxs(xe,{variant:"primary",size:"md",onClick:()=>void b(),children:[v.jsx(ma,{size:13})," Start the terminal again"]}),i.done&&v.jsxs("div",{className:"card max-w-lg p-3 text-xs",children:[v.jsx("div",{className:"font-medium",children:i.done.summary}),Object.entries(i.done.deliverables??{}).map(([w,T])=>v.jsxs("div",{className:"mt-1 text-[11px]",children:[v.jsxs("span",{className:"font-medium",children:[w,": "]}),v.jsx("span",{className:"break-all text-muted-foreground",children:typeof T=="string"?T:JSON.stringify(T)})]},w))]})]})]}),p==="activity"&&v.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?v.jsx(O9,{data:l}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="setup"&&v.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?v.jsx(B9,{sessionId:e,live:i.live,current:l.setup}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="toolset"&&v.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?v.jsx(H9,{sessionId:e,live:i.live,current:l.toolset}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="interactions"&&v.jsx("div",{className:"h-full space-y-2 overflow-y-auto p-4",children:l!=null&&l.interactions.length?l.interactions.map(w=>v.jsx(ql,{interaction:w},w.id)):v.jsx(nn,{title:"Nothing asked yet.",hint:"Permission requests, questions, ends of turns and MCP suggestions from this session land here and on every channel."})})]})]})}function dB({title:e,note:i}){return v.jsx(D5,{title:e,icon:v.jsx(Ql,{size:14,className:"shrink-0 text-primary"}),badge:v.jsx(nt,{tone:"on",children:"hub task"}),description:"Parameters, samples and API of this hub task.",trigger:v.jsxs(xe,{variant:"primary",className:"shadow-md",title:"What this hub task is for: parameters, samples, API",children:[v.jsx(V3,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Params & samples"})]}),children:v.jsx(Rv,{className:"text-xs",children:i.replace(/^# .*\n+/,"")})})}function fB({items:e}){const[i,r]=P.useState(!1);return P.useEffect(()=>{i&&!e.length&&r(!1)},[i,e.length]),e.length?v.jsx(D5,{open:i,onOpenChange:r,title:`${e.length} waiting on you`,icon:v.jsx(ls,{size:14,className:"shrink-0 text-severity-warning"}),description:"Questions and requests this session is waiting on.",trigger:v.jsxs(xe,{className:"bg-severity-warning text-background shadow-md hover:bg-severity-warning/90",title:"What this session is waiting on",children:[v.jsx(ls,{size:12,className:"animate-status-pulse"})," ",e.length," ",v.jsx("span",{className:"hidden sm:inline",children:"waiting"})]}),children:v.jsx("div",{className:"space-y-2",children:e.map(s=>v.jsx(ql,{interaction:s},s.id))})}):null}function M5(){const[e,i]=P.useState(null),[r,s]=P.useState(!1),[l,d]=P.useState(!1);P.useEffect(()=>{let g=!0;return ve.hub().then(c=>g&&i(c.claudeStatus)).catch(()=>{}),()=>{g=!1}},[]);const p=async()=>{s(!0);try{i(await ve.checkClaude())}catch{}finally{s(!1)}},a=(e==null?void 0:e.problem)??null,u=e===null;if(P.useEffect(()=>{if(!a&&!u)return;const g=setInterval(()=>void(a?p():ve.hub().then(c=>i(c.claudeStatus)).catch(()=>{})),a?3e4:5e3);return()=>clearInterval(g)},[a,u]),!(e!=null&&e.problem))return null;const f=()=>{var g;(g=navigator.clipboard)==null||g.writeText(e.fix??"").then(()=>{d(!0),setTimeout(()=>d(!1),1500)})};return v.jsxs("div",{role:"alert",className:"flex flex-wrap items-center gap-x-3 gap-y-2 border-b bg-destructive/15 px-5 py-2 text-xs",children:[v.jsx(Gw,{size:14,className:"shrink-0 text-destructive"}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("b",{children:e.message})," Sessions, runs and chat commands cannot start until then."]}),e.fix&&v.jsxs("span",{className:"flex items-center gap-1",children:["Run",v.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:e.fix}),v.jsx(xe,{variant:"ghost",size:"icon",onClick:f,title:l?"Copied":"Copy","aria-label":"Copy the command",children:v.jsx(Th,{size:12})}),e.problem==="missing"?"in a terminal, then sign in with":"in a terminal on this machine.",e.problem==="missing"&&v.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:"claude auth login"})]}),v.jsxs(xe,{variant:"muted",onClick:()=>void p(),disabled:r,className:"ml-auto",children:[v.jsx(Xl,{size:12,className:r?"animate-spin":void 0}),r?"Checking...":"Check again"]})]})}const ym=[{page:"overview",label:"Projects",icon:c4},{page:"inbox",label:"Inbox",icon:s4},{page:"channels",label:"Channels",icon:Kl}];let ww=null;function pB(){return ww??(ww=ve.folders().then(e=>e.home,()=>null)),ww}function Sw(e,i){var r;(r=navigator.clipboard)==null||r.writeText(e).then(()=>ge.getState().notify(`Copied the ${i}.`),()=>ge.getState().notify("The browser did not allow copying.","error"))}function Ov({project:e,x:i,y:r,onClose:s}){const l=ge(g=>g.openProject),d=mn(),p=()=>it(()=>ve.setMuted(e.id,!e.muted),e.muted?`${e.name} is heard on the global channels again.`:`The global channels no longer hear from ${e.name}.`),a=()=>d({title:`Remove ${e.name} from the hub?`,description:"Its running sessions stop and its jobs no longer run. The folder and its saved settings stay.",confirmLabel:"Remove",tone:"destructive",run:async()=>{await ve.removeProject(e.id),ge.getState().notify(`Removed ${e.name}. Opening its folder again brings it back as it was.`)}});P.useEffect(()=>{const g=()=>s(),c=_=>_.key==="Escape"&&s();return window.addEventListener("pointerdown",g),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),window.addEventListener("keydown",c),()=>{window.removeEventListener("pointerdown",g),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),window.removeEventListener("keydown",c)}},[s]);const u=async()=>{const g=await pB(),c=e.root,_=c.includes("\\")?"\\":"/",x=g&&c.toLowerCase().startsWith(`${g.replace(/[\\/]$/,"").toLowerCase()}${_}`);Sw(x?`~${_}${c.slice(g.replace(/[\\/]$/,"").length+1)}`:c,"relative path")},f=(g,c,_,x={})=>{const C=c;return v.jsxs("button",{title:x.hint,onPointerDown:y=>{y.stopPropagation(),s(),_()},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs",x.danger?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[v.jsx(C,{size:13}),g]})};return v.jsxs("div",{role:"menu",className:"fixed z-50 w-56 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-232),top:Math.min(r,window.innerHeight-290)},onPointerDown:g=>g.stopPropagation(),children:[f("Open",Wl,()=>l(e.id)),v.jsx("div",{className:"my-1 border-t"}),e.paused?f("Allow notifications",ls,()=>void it(()=>ve.pauseNotificationsIn(e.id,!1),`Notifications from ${e.name} are back on.`)):f("Do not disturb",pa,()=>void it(()=>ve.pauseNotificationsIn(e.id,!0),`No channel hears from ${e.name} now.`),{hint:"Pauses every channel of this project, and the global ones for it; questions still wait in the inbox"}),f(e.muted?"Hear on global channels":"Mute on global channels",e.muted?Kl:w4,()=>void p(),{hint:"Only the global channels; the project's own channels are not changed"}),v.jsx("div",{className:"my-1 border-t"}),f("Copy Path",Ml,()=>Sw(e.root,"path")),f("Copy Relative Path",Ml,()=>void u(),{hint:"From your home folder, as ~/..."}),f("Reveal in File Explorer",Ks,()=>void it(()=>ve.revealIn(e.id))),v.jsx("div",{className:"my-1 border-t"}),f("Remove from the hub",yr,()=>void a(),{danger:!0,hint:"The folder and its saved settings stay"})]})}function mB({project:e}){const i=ge(a=>a.openProject),r=mn(),s=()=>it(()=>ve.setMuted(e.id,!e.muted),e.muted?`${e.name} is heard on the global channels again.`:`The global channels no longer hear from ${e.name}.`),l=()=>r({title:`Remove ${e.name} from the hub?`,description:"Its running sessions stop and its jobs no longer run. The folder and its saved settings stay.",confirmLabel:"Remove",tone:"destructive",run:async()=>{await ve.removeProject(e.id),ge.getState().notify(`Removed ${e.name}. Opening its folder again brings it back as it was.`)}}),[d,p]=P.useState(null);return v.jsxs("div",{className:"card flex min-w-0 flex-col gap-2 p-3",onContextMenu:a=>{a.preventDefault(),p({x:a.clientX,y:a.clientY})},children:[d&&v.jsx(Ov,{project:e,...d,onClose:()=>p(null)}),v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsxs("button",{onClick:()=>i(e.id),className:"min-w-0 flex-1 text-left",title:e.root,children:[v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-sm font-semibold hover:underline",children:e.name}),e.paused&&v.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 rounded bg-severity-warning/15 px-1 text-[9px] font-medium text-severity-warning",title:"Do not disturb: no channel hears from it",children:[v.jsx(pa,{size:9})," DND"]})]}),v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:e.root})]}),v.jsx("button",{onClick:()=>void s(),title:e.muted?"Muted on the global channels: click to hear from it again":"Heard on the global channels: click to mute","aria-label":e.muted?`Unmute ${e.name}`:`Mute ${e.name}`,className:ye("shrink-0 rounded p-1 hover:bg-muted",e.muted?"text-muted-foreground":"text-foreground"),children:e.muted?v.jsx(pa,{size:13}):v.jsx(ls,{size:13})}),v.jsx("button",{onClick:()=>void l(),title:"Remove from the hub","aria-label":`Remove ${e.name}`,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(pn,{size:13})})]}),v.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px]",children:[v.jsxs("span",{className:ye(e.waiting?"font-semibold text-severity-warning":"text-muted-foreground"),children:["⏳ ",e.waiting," waiting"]}),v.jsxs("span",{className:"text-muted-foreground",children:["▶️ ",e.running," running"]}),v.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:e.runningRun?`Running: ${e.runningRun}`:void 0,children:[v.jsx(u4,{size:11})," ",e.runningRun?"1 running, ":"",e.queued," queued"]})]}),v.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[v.jsxs("span",{className:"flex min-w-0 max-w-full items-center gap-1 truncate",title:e.nextCron?`${e.nextCron.name}: ${Xs(e.nextCron.at)}`:void 0,children:[v.jsx(kh,{size:11,className:"shrink-0"})," ",v.jsx("span",{className:"truncate",children:e.nextCron?`${e.nextCron.name} · ${Xs(e.nextCron.at)}`:"no cron job"})]}),v.jsxs("span",{title:"Sent and written in the sessions active today, cache reads left out",children:[e.activeToday," active today · ",On(e.tokensToday)," tokens"]})]})]})}function j5({children:e}){return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsx("div",{className:"mx-auto max-w-6xl space-y-4 p-5",children:e})})}function gB(){var s;const[e,i]=P.useState(!1),r=ct(()=>ve.globalOverview(),["projects","sessions","interactions","runs","jobs","channels"]);return v.jsxs(j5,{children:[v.jsx(Er,{group:"Global",title:"Projects",description:"Every project in the hub, most recently opened first. The bell says whether the global channels hear from it.",action:v.jsxs(xe,{variant:"primary",onClick:()=>i(!0),children:[v.jsx(Qn,{size:12})," Open folder..."]})}),v.jsx(E5,{open:e,onOpenChange:i}),(s=r.data)!=null&&s.length?v.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3",children:r.data.map(l=>v.jsx(mB,{project:l},l.id))}):v.jsx(nn,{variant:"inline",title:r.data?"No projects yet.":"Loading..."})]})}function vB(){var i;const e=ct(()=>ve.globalInbox(),["projects","interactions"]);return v.jsxs(j5,{children:[v.jsx(Er,{group:"Global",title:"Inbox",description:"Everything waiting on you, in every project."}),(i=e.data)!=null&&i.length?v.jsx("div",{className:"space-y-2",children:e.data.map(r=>v.jsx(ql,{interaction:r,project:r.project,showSession:!0},`${r.project.id}:${r.id}`))}):v.jsx(nn,{icon:ls,title:e.data?"Nothing is waiting on you.":"Loading..."})]})}function Cw({width:e,collapsed:i,onToggle:r,drawer:s=!1}){var S;const l=ge(w=>w.view),d=ge(w=>w.go),p=ge(w=>w.openProject),a=ge(w=>w.sessions),u=ct(()=>ve.projects(),["projects"]),f=ct(()=>ve.globalOverview(),["projects","channels"]),[g,c]=P.useState(null),[_,x]=P.useState(!1),y=((S=ct(()=>ve.globalInbox(),["projects","interactions"]).data)==null?void 0:S.length)??0,m=a.filter(w=>w.origin!=="external"||w.live).slice(0,10),b=w=>l.kind==="page"&&(l.page===w||w==="overview"&&!ym.some(T=>T.page===l.page));return i?v.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-center gap-1 overflow-y-auto border-r py-3",children:[v.jsx(va,{className:"mb-2"}),ym.map(w=>v.jsx(hr,{content:`Global · ${w.label}`,side:"right",asChild:!0,children:v.jsx(xe,{variant:"ghost",size:"icon",className:ye(b(w.page)&&"bg-muted text-foreground"),onClick:()=>d({kind:"page",page:w.page}),children:v.jsx(w.icon,{size:15})})},w.page)),v.jsx("div",{className:"flex-1"}),v.jsx(xe,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Expand sidebar",children:v.jsx(Bw,{size:15})})]}):v.jsxs("aside",{className:"flex shrink-0 flex-col",style:{width:e},children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 pb-2 pt-3",children:[v.jsx(va,{}),v.jsxs("div",{className:"min-w-0",children:[v.jsx(nd,{}),v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:"Global"}),v.jsx(Lv,{})]})]}),v.jsx(xe,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":s?"Close menu":"Collapse sidebar",children:s?v.jsx(pn,{size:15}):v.jsx(Nw,{size:15})})]}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pb-3",children:[v.jsx("nav",{className:"px-2",children:ym.map(w=>v.jsxs("button",{onClick:()=>d({kind:"page",page:w.page}),className:ye("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs transition-colors",b(w.page)?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(w.icon,{size:14}),w.label,w.page==="inbox"&&y>0&&v.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:y})]},w.page))}),v.jsxs("div",{className:"mt-2 px-2",children:[v.jsxs("div",{className:"flex items-center px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:["Projects",v.jsx("button",{onClick:()=>x(!0),title:"Open folder...","aria-label":"Add a project",className:"ml-auto rounded p-0.5 hover:bg-muted hover:text-foreground",children:v.jsx(Qn,{size:12})})]}),g&&v.jsx(Ov,{project:g.project,x:g.x,y:g.y,onClose:()=>c(null)}),(u.data??[]).map(w=>v.jsxs("button",{disabled:!w.exists,onClick:()=>p(w.id),onContextMenu:T=>{var R;T.preventDefault();const D=(R=f.data)==null?void 0:R.find(L=>L.id===w.id);c({project:{id:w.id,name:w.name,root:w.root,muted:D==null?void 0:D.muted,paused:D==null?void 0:D.paused},x:T.clientX,y:T.clientY})},title:w.root,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground disabled:opacity-50",children:[v.jsx(Hw,{size:14,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:w.name}),w.waiting>0&&v.jsx("span",{className:"rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:w.waiting}),w.running>0&&v.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px]",title:`${w.running} running`,children:[v.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success"})," ",w.running]})]},w.id)),u.data&&!u.data.length&&v.jsx("div",{className:"px-2 py-1 text-[11px] text-muted-foreground",children:"No projects yet."})]}),m.length>0&&v.jsxs("div",{className:"mt-2 px-2",children:[v.jsx("div",{className:"px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Hub tasks"}),m.map(w=>v.jsxs("button",{onClick:()=>d({kind:"session",id:w.id}),className:ye("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors",l.kind==="session"&&l.id===w.id?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(Ql,{size:13,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:w.title}),v.jsx(ed,{session:w})]},w.id))]})]}),v.jsxs("div",{className:"border-t px-2 py-2",children:[v.jsxs(xe,{variant:"ghost",className:"w-full justify-start",onClick:()=>x(!0),children:[v.jsx(Qn,{size:13})," Open folder..."]}),v.jsx(E5,{open:_,onOpenChange:x})]})]})}const Ew="clauder-hub:global-sidebar-collapsed";function _B(){const e=ge(g=>g.view),i=bh("clauder-hub:sidebar-width",280,{min:220,max:480}),r=bh("clauder-hub:live-panel-width",260,{min:200,max:420}),s=td(g=>g.open),l=i5("(min-width: 768px)"),[d,p]=P.useState(!1),[a,u]=P.useState(()=>{try{return localStorage.getItem(Ew)==="1"}catch{return!1}});P.useEffect(()=>{document.title="Clauder Hub · Global"},[]),P.useEffect(()=>{try{localStorage.setItem(Ew,a?"1":"0")}catch{}},[a]),P.useEffect(()=>p(!1),[e,l]);const f=e.kind==="session"?v.jsx(L5,{id:e.id},e.id):e.kind==="page"&&e.page==="inbox"?v.jsx(vB,{}):e.kind==="page"&&e.page==="channels"?v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsx("div",{className:"mx-auto max-w-6xl p-5",children:v.jsx(DC,{global:!0})})}):v.jsx(gB,{});return v.jsxs("div",{className:"flex h-screen overflow-hidden",children:[l&&v.jsx(Cw,{width:i.width,collapsed:a,onToggle:()=>u(!a)}),l&&!a&&v.jsx(Sh,{onDrag:i.resizeBy,onReset:i.reset}),!l&&v.jsxs(v.Fragment,{children:[d&&v.jsx("div",{className:"fixed inset-0 z-40 bg-foreground/40 animate-in fade-in-0",onClick:()=>p(!1)}),v.jsx("div",{inert:!d,className:ye("fixed inset-y-0 left-0 z-40 flex border-r bg-background transition-transform duration-200",d?"translate-x-0 shadow-xl":"-translate-x-full"),children:v.jsx(Cw,{width:"min(280px, 85vw)",collapsed:!1,onToggle:()=>p(!1),drawer:!0})})]}),v.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[!l&&v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[v.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>p(!0),"aria-label":"Open menu",title:"Menu",children:v.jsx(Fw,{size:16})}),v.jsx(va,{}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx(nd,{}),v.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Global"})]})]}),v.jsx(M5,{}),v.jsx("div",{className:"min-h-0 flex-1",children:f})]}),l&&s&&v.jsx(Sh,{onDrag:g=>r.resizeBy(-g),onReset:r.reset}),l&&s&&v.jsx(C5,{width:r.width})]})}function xB(){const e=ge(s=>s.open),r=(ct(()=>ve.interactions(),["interactions"]).data??[]).filter(s=>s.status!=="open").slice(0,60);return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Operation"}),v.jsx("h1",{className:"text-base font-semibold",children:"Inbox"}),v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"What sessions are waiting on. The first answer wins, from anywhere.",children:"What sessions are waiting on. The first answer wins, from anywhere."})]}),e.length?v.jsx("div",{className:"space-y-2",children:e.map(s=>v.jsx(ql,{interaction:s,showSession:!0},s.id))}):v.jsx(nn,{icon:ls,title:"Nothing is waiting on you."}),r.length>0&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("h2",{className:"pt-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Recent"}),r.map(s=>v.jsx(ql,{interaction:s,showSession:!0,compact:!0},s.id))]})]})})}function yB(){var p;const e=ct(()=>ve.suggestions(),["mcp"]),i=ct(()=>ve.mcpSuggestionsEnabled(),["mcp"]),r=!!((p=i.data)!=null&&p.enabled),s=ge(a=>a.go),l=(e.data??[]).filter(a=>a.status==="suggested"),d=(e.data??[]).filter(a=>a.status!=="suggested");return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsx(Er,{group:"Settings",title:"MCP suggestions",description:"Servers that blocked sessions asked for. Nothing installs without you.",action:v.jsxs(xe,{onClick:()=>s({kind:"page",page:"mcp-servers"}),children:[v.jsx(Yl,{size:12})," Configured servers"]})}),v.jsx(Lt,{title:"Suggest MCP servers",description:"When on, sessions are told they may stop and ask for a missing MCP server. Off: that part of the system prompt is left out. Applies to sessions started from now on.",action:v.jsx("button",{role:"switch","aria-checked":r,"aria-label":"Suggest MCP servers",disabled:!i.data,onClick:()=>void it(()=>ve.setMcpSuggestionsEnabled(!r),r?"MCP suggestions off.":"MCP suggestions on."),className:ye("relative h-5 w-9 shrink-0 rounded-full transition-colors",r?"bg-primary":"bg-foreground/20"),children:v.jsx("span",{className:ye("absolute top-0.5 h-4 w-4 rounded-full bg-background transition-all",r?"left-[18px]":"left-0.5")})}),children:null}),v.jsx(Lt,{title:`Waiting (${l.length})`,children:l.length?v.jsx("div",{className:"space-y-2",children:l.map(a=>v.jsx(kw,{suggestion:a},a.id))}):v.jsx(nn,{variant:"inline",title:"No session is waiting on an MCP server."})}),d.length>0&&v.jsx(Lt,{title:"History",children:v.jsx("div",{className:"space-y-2",children:d.map(a=>v.jsx(kw,{suggestion:a},a.id))})})]})})}function kw({suggestion:e}){const i=ge(a=>a.go),r=mn(),s=e.status==="installed"?"success":e.status==="failed"?"critical":e.status==="suggested"?"warning":"off",l=()=>r({title:`Install '${e.name}'?`,description:"Adds it to this project's .mcp.json.",body:v.jsxs("div",{className:"space-y-2",children:[v.jsx("pre",{className:"whitespace-pre-wrap rounded bg-muted p-3 font-mono text-[11px]",children:e.runs}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"If it succeeds, the session that asked is restarted on the same conversation so the server loads, and is told to continue."})]}),confirmLabel:"Run it",run:async()=>{const a=await ve.installSuggestion(e.id);ge.getState().notify(a.status==="installed"?"Installed; the session is resuming.":"The install failed; see its output.",a.status==="installed"?"info":"error")}}),d=()=>r({title:`Carry on without '${e.name}'?`,description:"The session continues without it.",confirmLabel:"Skip it",run:()=>ve.skipSuggestion(e.id)}),p=()=>r({title:"Remove this suggestion from the history?",confirmLabel:"Remove",tone:"destructive",run:()=>ve.deleteSuggestion(e.id)});return v.jsxs("div",{className:"rounded-md border p-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx(Yl,{size:14,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 break-all text-xs font-semibold",children:e.name}),v.jsx(nt,{tone:s,children:e.status}),v.jsxs("button",{className:"text-[11px] text-muted-foreground hover:underline",onClick:()=>i({kind:"session",id:e.sessionId}),children:["from session ",e.sessionId.slice(0,8)]}),v.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:fs(e.createdAt)})]}),v.jsx("div",{className:"mt-1.5 break-words text-xs text-muted-foreground",children:e.reason}),v.jsx("pre",{className:"mt-1.5 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 font-mono text-[11px]",children:e.runs??e.command}),e.refused&&v.jsx("div",{className:"mt-1 text-[11px] text-severity-critical",children:e.refused}),e.output&&v.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap rounded border p-2 font-mono text-[10px] text-muted-foreground",children:e.output}),v.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[e.status==="suggested"&&v.jsxs(v.Fragment,{children:[v.jsxs(xe,{variant:"primary",disabled:!e.runs,onClick:()=>void l(),children:[v.jsx(Q3,{size:12})," Install & resume"]}),v.jsxs(xe,{onClick:()=>void d(),children:[v.jsx(pn,{size:12})," Skip"]})]}),e.docs&&v.jsx("a",{href:e.docs,target:"_blank",rel:"noreferrer",children:v.jsxs(xe,{variant:"ghost",children:[v.jsx(ba,{size:12})," Docs"]})}),e.status!=="suggested"&&v.jsx(xe,{variant:"ghost",className:"ml-auto",onClick:()=>void p(),children:v.jsx(yr,{size:12})})]})]})}function bB(){const e=ct(()=>ve.stats(),["sessions","transcript"]),i=ct(()=>ve.inventory(),["sessions"]),r=ge(l=>l.sessions),s=e.data;return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsx(Er,{group:"Operation",title:"Overview",description:"Stats from this project's Claude Code transcripts."}),v.jsxs("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:[v.jsx(ss,{label:"Sessions",value:String((s==null?void 0:s.sessions)??"-")}),v.jsx(ss,{label:"Live now",value:String(r.filter(l=>l.live).length)}),v.jsx(ss,{label:"Waiting on you",value:String(r.filter(l=>l.status==="waiting").length)}),v.jsx(ss,{label:"Tool calls",value:s?On(Object.values(s.tools).reduce((l,d)=>l+d.count,0)):"-"})]}),s&&v.jsx(RC,{tokens:s.tokens}),s&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid gap-3 lg:grid-cols-3",children:[v.jsx(Lt,{title:"Output tokens per day",className:"lg:col-span-2",children:v.jsx(F6,{days:s.byDay,valueOf:l=>l.output,label:"output tokens"})}),v.jsx(Lt,{title:"Tokens by model",children:v.jsx(as,{rows:Object.entries(s.byModel).filter(([,l])=>os(l)>0).map(([l,d])=>({key:l,label:l,value:os(d)}))})})]}),v.jsx(k5,{tools:s.tools}),v.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[v.jsx(Lt,{title:"Subagents by type",description:"How often each was spawned, with its own tokens.",children:v.jsx(as,{rows:Object.entries(s.agents).map(([l,d])=>({key:l,label:l,value:d.count,sublabel:`${On(os(d.tokens))} tok`})),format:String,empty:"No subagents yet."})}),v.jsx(Lt,{title:"Skills & commands",children:v.jsx(as,{rows:Object.entries(s.skills).map(([l,d])=>({key:l,label:l,value:d})),format:String,empty:"No skills used yet."})})]})]}),e.error&&v.jsx("div",{className:"text-xs text-severity-critical",children:e.error}),i.data&&v.jsx(SB,{inventory:i.data})]})})}const wB=[{page:"agents",label:"Agents",count:e=>e.agents.length},{page:"skills",label:"Skills",count:e=>e.skills.length},{page:"commands",label:"Commands",count:e=>e.commands.length},{page:"mcp-servers",label:"MCP servers",count:e=>e.mcpServers.length},{page:"hooks",label:"Hooks",count:e=>e.hooks.length},{page:"plugins",label:"Plugins",count:e=>e.plugins.filter(i=>i.enabled).length}];function SB({inventory:e}){const i=ge(r=>r.go);return v.jsx(Lt,{title:"What sessions can reach for",description:"All scopes together: this project, your user config and enabled plugins. Open one under Project.",children:v.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-6",children:wB.map(r=>v.jsxs("button",{onClick:()=>i({kind:"page",page:r.page}),className:"rounded-md border px-3 py-2 text-left transition-colors hover:bg-muted",children:[v.jsx("div",{className:"text-[11px] text-muted-foreground",children:r.label}),v.jsx("div",{className:"text-lg font-semibold tabular-nums",children:r.count(e)})]},r.page))})})}const CB={name:"",toolset:{agents:[],skills:[],mcp:[],plugins:[]},isDefault:!1};function EB(){const e=ct(()=>ve.presets(),["jobs"]),i=ct(()=>ve.toolsetCatalog(),[]),{starting:r,start:s}=io(),[l,d]=P.useState(null),[p,a]=P.useState(!1),u=_=>{d(_),a(_!==null)},f=e.data??[],g=l==="new"?null:f.find(_=>_.id===l)??f[0]??null,c=l==="new"||!f.length&&e.data!==null;return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsx("div",{className:"border-b px-5 py-4",children:v.jsx(Er,{group:"Settings",title:"Toolset presets",description:"Named sets of agents, skills, MCP servers and plugins to turn off.",action:v.jsxs(xe,{variant:"primary",disabled:r,onClick:()=>void s("create-preset"),title:"Opens a Claude session to describe the preset",children:[v.jsx(Qn,{size:12})," New preset"]})})}),v.jsxs("div",{className:"flex min-h-0 flex-1",children:[v.jsxs("div",{className:ye("w-full shrink-0 space-y-0.5 overflow-y-auto p-3 md:block md:w-56 md:border-r lg:w-72",p&&"hidden"),children:[f.map(_=>v.jsxs("button",{onClick:()=>u(_.id),className:ye("block w-full rounded-md px-2 py-1.5 text-left text-foreground",(g==null?void 0:g.id)===_.id&&!c?"bg-muted":"hover:bg-muted/60"),children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(_g,{size:12,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate text-xs",children:_.name}),_.isDefault&&v.jsx(nt,{tone:"on",children:"default"})]}),v.jsx("div",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:Ch(_.toolset)?`${Ch(_.toolset)} turned off`:"everything on"})]},_.id)),!f.length&&v.jsx(nn,{variant:"inline",title:"No presets yet."})]}),v.jsxs("div",{className:ye("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!p&&"hidden"),children:[v.jsx(Zg,{onClick:()=>a(!1)}),i.data&&(c||g)?v.jsx(kB,{preset:c?CB:g,catalog:i.data,onSaved:_=>{e.reload(),d(_)},onDeleted:()=>{e.reload(),u(null)}},c?"new":g.id):null]})]})]})}function kB({preset:e,catalog:i,onSaved:r,onDeleted:s}){const l=mn(),{starting:d,start:p}=io(),[a,u]=P.useState(e);P.useEffect(()=>u(e),[e]);const f=JSON.stringify(a)!==JSON.stringify(e),g=async()=>{const _=await it(()=>ve.savePreset(a),"Saved.");_&&r(_.id)},c=()=>l({title:`Delete the preset '${e.name}'?`,description:"Jobs using it fall back to the default.",confirmLabel:"Delete",tone:"destructive",run:async()=>{await ve.deletePreset(e.id),ge.getState().notify("Deleted."),s()}});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"flex min-w-0 flex-1 basis-48 items-center gap-3",children:[v.jsx(Zn,{value:a.name,onChange:_=>u({...a,name:_.target.value}),placeholder:"Preset name",className:"max-w-xs",size:"md"}),v.jsx(tc,{label:"Default for new sessions and jobs",checked:a.isDefault,onCheckedChange:_=>u({...a,isDefault:_})})]}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.id&&v.jsxs(xe,{variant:"ghost",disabled:d,onClick:()=>void p("edit-preset",e.id),title:"Describe the change to Claude instead of flipping switches",children:[v.jsx(yg,{size:12})," Edit with Claude"]}),e.id&&v.jsxs(xe,{variant:"ghost",onClick:()=>void c(),children:[v.jsx(yr,{size:12})," Delete"]}),f&&e.id&&v.jsx(xe,{onClick:()=>u(e),children:"Discard"}),v.jsx(xe,{variant:"primary",disabled:!a.name.trim()||!f&&!!e.id,onClick:()=>void g(),children:"Save"})]})]}),v.jsx(R5,{catalog:i,value:a.toolset,onChange:_=>u({...a,toolset:_})})]})}function TB(e){if(e.params.length){const i=e.params.filter(r=>r.required).map(r=>r.name);return{icon:o4,text:i.length?`Needs ${i.join(", ")}`:"Optional settings"}}return e.auth==="oauth"?{icon:h4,text:"Sign in after adding"}:{icon:Gl,text:"Nothing to set up"}}function RB(){var s;const e=ct(()=>ve.mcpCatalog(),["mcp"]),{starting:i,start:r}=io();return(s=e.data)!=null&&s.length?v.jsx(Lt,{title:"Recommended",description:"Common servers. Adding one opens a hub task that asks for what it needs.",action:v.jsxs(xe,{disabled:i,onClick:()=>void r("add-mcp"),title:"Opens a hub task to add any MCP server",children:[v.jsx(yg,{size:12})," Add another server"]}),children:v.jsx("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:e.data.map(l=>{const d=TB(l);return v.jsxs("div",{className:"flex flex-col rounded-md border p-3",children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"truncate text-xs font-semibold",children:l.name}),v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:l.vendor})]}),v.jsx(nt,{tone:"off",children:l.category})]}),v.jsx("p",{className:"mt-1.5 line-clamp-2 flex-1 text-[11px] text-muted-foreground",title:l.description,children:l.description}),v.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[v.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1 truncate text-[10px] text-muted-foreground",title:d.text,children:[v.jsx(d.icon,{size:11,className:"shrink-0"})," ",v.jsx("span",{className:"truncate",children:d.text})]}),v.jsx("a",{href:l.docs,target:"_blank",rel:"noreferrer",title:"Docs",className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(ba,{size:12})}),l.installed?v.jsx(nt,{tone:"success",icon:Gl,children:"added"}):v.jsxs(xe,{className:"shrink-0 bg-white text-neutral-900 hover:bg-white/85",disabled:i,onClick:()=>void r("add-mcp",l.id),children:[v.jsx(Qn,{size:12})," Add"]})]})]},l.id)})})}):null}const AB=["user","project","local","plugin","built-in"],O5={project:"This project (shared, in the repo)",local:"This project (local, only on this machine)",user:"You (every project)",plugin:"Plugins","built-in":"Built into Claude Code"};function Eh(e,i){var r;return e.scope==="user"?!0:e.scope==="plugin"&&((r=i.find(s=>s.id===e.plugin))==null?void 0:r.scope)==="user"}function rd(){return ct(()=>ve.inventory(),["sessions"])}function Nv(){var l;const e=ct(()=>ve.presets(),["jobs"]),i=ct(()=>ve.toolsetCatalog(),["sessions"]);return!e.data||!i.data?null:{off:((l=e.data.find(d=>d.isDefault))==null?void 0:l.toolset)??{agents:[],skills:[],mcp:[],plugins:[]},mcpId:d=>{var p;return(p=i.data.find(a=>a.kind==="mcp"&&a.label===d))==null?void 0:p.id}}}function Bv({defaults:e,kind:i,id:r,plugin:s}){if(!e||!r)return null;const l=!!(s&&e.off.plugins.includes(s));return v.jsx(tc,{ariaLabel:`${r} in new sessions`,title:l?`Off with its plugin ${s}`:"On in new sessions (default preset)",disabled:l,checked:!l&&!e.off[i].includes(r),onCheckedChange:d=>void it(()=>ve.setDefaultItem(i,r,d),`${r} ${d?"on":"off"} in new sessions.`)})}function N5(e){return AB.map(i=>[i,e.filter(r=>r.scope===i)]).filter(([,i])=>i.length)}function B5({items:e,keyOf:i,render:r,detail:s,searchText:l,empty:d,leading:p}){var m;const[a,u]=P.useState(""),[f,g]=P.useState(null),[c,_]=P.useState(!1),x=P.useMemo(()=>{const b=a.trim().toLowerCase();return b?e.filter(S=>l(S).toLowerCase().includes(b)):e},[e,a,l]),C=N5(x),y=e.find(b=>i(b)===f)??((m=C[0])==null?void 0:m[1][0])??null;return e.length?v.jsxs("div",{className:"flex min-h-0 flex-1",children:[v.jsxs("div",{className:ye("w-full shrink-0 overflow-y-auto p-3 md:block md:w-60 md:border-r lg:w-80",c&&"hidden"),children:[v.jsxs("div",{className:"relative mb-2",children:[v.jsx(Rh,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(Zn,{value:a,onChange:b=>u(b.target.value),placeholder:`Filter ${e.length}`,className:"pl-6"})]}),v.jsx("div",{className:"space-y-1.5",children:C.map(([b,S])=>v.jsx(Mv,{title:O5[b],badge:v.jsx(nt,{tone:"off",children:S.length}),defaultOpen:!0,children:S.map(w=>v.jsxs("div",{className:ye("flex items-center gap-1 rounded-md",p&&"pl-2",y&&i(y)===i(w)?"bg-muted":"hover:bg-muted/60"),children:[p==null?void 0:p(w),v.jsx("button",{onClick:()=>{g(i(w)),_(!0)},className:"block min-w-0 flex-1 px-2 py-1.5 text-left text-foreground",children:r(w)})]},i(w)))},b))}),!C.length&&v.jsx("div",{className:"px-1 text-xs text-muted-foreground",children:"No match."})]}),v.jsxs("div",{className:ye("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!c&&"hidden"),children:[v.jsx(Zg,{onClick:()=>_(!1)}),y?s(y):null]})]}):v.jsx(nn,{title:d,className:"m-5"})}function cc({title:e,description:i,children:r}){return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsx("div",{className:"border-b px-5 py-4",children:v.jsx(Er,{group:"Project",title:e,description:i})}),r]})}const Tw={memory:"CLAUDE.md",rules:"Rule","auto-memory":"Auto memory"};function DB(){const e=ct(()=>ve.memory(),[]),i=(e.data??[]).filter(r=>r.group in Tw);return v.jsx(cc,{title:"Instructions",description:"CLAUDE.md, rules and memory that every session loads.",children:e.data&&v.jsx(B5,{items:i,keyOf:r=>r.path,searchText:r=>r.label,empty:"No instruction files.",render:r=>v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(J3,{size:12,className:"shrink-0"}),v.jsx("span",{className:ye("min-w-0 truncate font-mono text-[11px]",!r.exists&&"opacity-50"),children:r.label}),r.scope==="user"&&v.jsx(ds,{}),v.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-muted-foreground",children:r.exists?Tw[r.group]:"new"})]}),detail:r=>v.jsx(n5,{path:r.path,title:r.label,badge:r.scope==="user"?v.jsx(ds,{}):null,onSaved:e.reload},r.path)})})}const LB={agents:{title:"Agents",description:"Subagents Claude can delegate to. Ticked ones are on in new sessions.",empty:"No agents defined. Claude still has its built-in ones (Explore, Plan, general-purpose)."},skills:{title:"Skills",description:"Instructions Claude loads when a task matches. Ticked ones are on in new sessions.",empty:"No skills installed."},commands:{title:"Commands",description:"Slash commands, typed as /name.",empty:"No custom commands."}};function bm({kind:e}){const i=rd(),r=Nv(),s=LB[e];return v.jsx(cc,{title:s.title,description:s.description,children:i.data&&v.jsx(B5,{items:i.data[e],keyOf:l=>l.path||`${l.scope}:${l.name}`,searchText:l=>`${l.name} ${l.description}`,empty:s.empty,leading:e==="commands"?void 0:l=>v.jsx(Bv,{defaults:r,kind:e,id:l.name,plugin:l.plugin}),render:l=>v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:e==="commands"?`/${l.name}`:l.name}),Eh(l,i.data.plugins)&&v.jsx(ds,{})]}),l.description&&v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:l.description})]}),detail:l=>v.jsxs("div",{className:"space-y-3",children:[l.description&&v.jsx("p",{className:"text-xs text-muted-foreground",children:l.description}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.jsx(nt,{tone:"off",children:l.scope}),l.plugin&&v.jsx(nt,{tone:"off",children:l.plugin}),l.model&&v.jsxs(nt,{tone:"off",children:["model: ",l.model]})]}),l.scope==="built-in"?v.jsxs("div",{className:"space-y-1",children:[v.jsx("h2",{className:"font-mono text-sm font-semibold",children:l.name}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Built into Claude Code, so there is no file to show or edit. It can be turned off per session in its Toolset tab, or in a preset."})]}):v.jsx(n5,{path:l.path,title:e==="commands"?`/${l.name}`:l.name,badge:Eh(l,i.data.plugins)?v.jsx(ds,{}):null,subtitle:l.path,onSaved:i.reload},l.path)]})})})}function P5({items:e,row:i,empty:r,footer:s}){return v.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-5",children:[!e.length&&v.jsx(nn,{title:r}),N5(e).map(([l,d])=>v.jsx(Mv,{title:O5[l],badge:v.jsx(nt,{tone:"off",children:d.length}),defaultOpen:!0,children:v.jsx("div",{className:"divide-y rounded-md border bg-background",children:d.map((p,a)=>i(p,a))})},l)),s]})}function MB(){const e=rd(),i=Nv();return v.jsx(cc,{title:"MCP servers",description:"Servers configured in files. claude.ai connectors are not listed.",children:e.data&&v.jsx(P5,{items:e.data.mcpServers,empty:"No MCP servers configured in files.",footer:v.jsx(RB,{}),row:r=>v.jsxs("div",{className:ye("flex items-center gap-2 px-3 py-2",r.disabled&&"opacity-50"),children:[v.jsx(Bv,{defaults:i,kind:"mcp",id:i==null?void 0:i.mcpId(r.name),plugin:r.plugin}),v.jsx(Yl,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:r.name}),Eh(r,e.data.plugins)&&v.jsx(ds,{}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-muted-foreground",title:r.target,children:r.target}),r.disabled&&v.jsx(nt,{tone:"off",children:"disabled"}),v.jsx(nt,{tone:"off",children:r.transport})]},`${r.scope}:${r.name}`)})})}function jB(){const e=rd();return v.jsx(cc,{title:"Hooks",description:"Your hooks, from settings files and plugins.",children:e.data&&v.jsx(P5,{items:e.data.hooks,empty:"No hooks configured.",row:(i,r)=>v.jsxs("div",{className:"px-3 py-2",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px]",children:[v.jsx("span",{className:"font-mono",children:i.event}),Eh(i,e.data.plugins)&&v.jsx(ds,{}),i.matcher&&v.jsx(nt,{tone:"off",children:i.matcher}),v.jsx(nt,{tone:"off",children:i.type}),i.plugin&&v.jsx("span",{className:"text-muted-foreground",children:i.plugin.split("@")[0]})]}),v.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:i.summary,children:i.summary})]},r)})})}function OB(){var l;const e=rd(),i=Nv(),r=((l=e.data)==null?void 0:l.plugins)??[],s=d=>{const p=f=>f.filter(g=>g.plugin===d).length,a=e.data;return[[p(a.agents),"agents"],[p(a.skills),"skills"],[p(a.commands),"commands"],[a.mcpServers.filter(f=>f.plugin===d).length,"MCP"],[a.hooks.filter(f=>f.plugin===d).length,"hooks"]].filter(([f])=>f).map(([f,g])=>`${f} ${g}`).join(" · ")};return v.jsx(cc,{title:"Plugins",description:"Installed plugins and what each adds.",children:e.data&&v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5",children:r.length?v.jsx("div",{className:"divide-y rounded-md border",children:r.map(d=>v.jsxs("div",{className:ye("px-3 py-2",!d.enabled&&"opacity-50"),children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[d.enabled&&v.jsx(Bv,{defaults:i,kind:"plugins",id:d.id}),v.jsx("span",{className:"min-w-0 break-all font-mono text-[11px]",children:d.id}),d.scope==="user"&&v.jsx(ds,{}),v.jsxs(nt,{tone:"off",children:["v",d.version]}),v.jsx(nt,{tone:d.enabled?"success":"off",children:d.enabled?"enabled":"disabled"}),v.jsx(nt,{tone:"off",children:d.scope})]}),v.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:s(d.id)||"Nothing this hub can list."})]},d.id))}):v.jsx(nn,{title:"No plugins installed."})})})}function I5(){const e=mn();return async i=>{if(!i.length)return;const{drafts:r,drop:s}=en.getState(),l=i.filter(_=>rs(r[_]));if(l.length&&!await e({title:l.length===1?`Close ${l[0].split("/").pop()} without saving?`:`Close ${l.length} files without saving?`,description:"Their unsaved edits are lost.",body:l.length>1?v.jsx("div",{className:"space-y-0.5 font-mono text-[11px] text-muted-foreground",children:l.map(x=>v.jsx("div",{children:x},x))}):void 0,confirmLabel:"Discard and close",tone:"destructive"}))return;for(const _ of i)s(_);const{view:d,go:p,sessions:a}=ge.getState(),u=d.kind==="file"?d.path:null,f=new Map(i.map(_=>[_,uT(_)])),g=Bn.getState().close(i,u);if(!u||g===u)return;const c=f.get(u);if(c&&a.some(_=>_.id===c))return p({kind:"session",id:c});p(g?{kind:"file",path:g}:{kind:"page",page:"overview"})}}function NB({path:e,x:i,y:r,onClose:s}){const l=Bn(u=>u.tabs),d=I5();P.useEffect(()=>{const u=()=>s(),f=g=>g.key==="Escape"&&s();return window.addEventListener("pointerdown",u),window.addEventListener("keydown",f),()=>{window.removeEventListener("pointerdown",u),window.removeEventListener("keydown",f)}},[s]);const p=l.findIndex(u=>u.path===e),a=[["Close",pn,()=>void d([e])],["Close Others",Gs,()=>void d(l.filter(u=>u.path!==e).map(u=>u.path)),l.length<2],["Close to the Right",Gs,()=>void d(l.slice(p+1).map(u=>u.path)),p===l.length-1],["Close All",Gs,()=>void d(l.map(u=>u.path))],["Copy Relative Path",Th,()=>{var u;return void((u=navigator.clipboard)==null?void 0:u.writeText(e))}],["Reveal in File Explorer",Ks,()=>void it(()=>Kt.reveal(e))]];return v.jsx("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.min(r,window.innerHeight-230)},onPointerDown:u=>u.stopPropagation(),children:a.map(([u,f,g,c],_)=>v.jsxs("button",{disabled:c,onClick:()=>{s(),g()},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",_===4&&"mt-1 border-t pt-2"),children:[v.jsx(f,{size:13}),u]},u))})}function BB({active:e}){const i=Bn(x=>x.tabs),{pin:r,reorder:s}=Bn.getState(),l=en(x=>x.drafts),d=ge(x=>x.go),p=I5(),[a,u]=P.useState(null),[f,g]=P.useState(null),c=P.useRef(null);if(P.useEffect(()=>{var x,C;e&&((C=(x=c.current)==null?void 0:x.querySelector(`[data-path="${CSS.escape(e)}"]`))==null||C.scrollIntoView({block:"nearest",inline:"nearest"}))},[e,i.length]),!i.length)return null;const _=i.map(x=>x.path.split("/").pop()??x.path);return v.jsxs("div",{ref:c,className:"no-scrollbar flex shrink-0 overflow-x-auto border-b bg-muted/30",children:[a&&v.jsx(NB,{...a,onClose:()=>u(null)}),i.map((x,C)=>{const y=_[C],m=_.filter(T=>T===y).length>1,b=x.path.includes("/")?x.path.slice(0,x.path.lastIndexOf("/")):"",S=rs(l[x.path]),w=x.path===e;return v.jsxs("div",{"data-path":x.path,draggable:!0,title:x.path,onClick:()=>d({kind:"file",path:x.path}),onDoubleClick:()=>r(x.path),onAuxClick:T=>{T.button===1&&(T.preventDefault(),p([x.path]))},onContextMenu:T=>{T.preventDefault(),u({path:x.path,x:T.clientX,y:T.clientY})},onDragStart:T=>{g(x.path),T.dataTransfer.effectAllowed="move"},onDragOver:T=>{!f||f===x.path||(T.preventDefault(),s(f,x.path))},onDragEnd:()=>g(null),className:ye("group flex max-w-[16rem] shrink-0 cursor-pointer select-none items-center gap-1.5 border-r border-t-2 px-3 py-1.5 text-xs transition-colors",w?"-mb-px border-t-primary bg-background text-foreground":"border-t-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground",f===x.path&&"opacity-50"),children:[v.jsx(s5,{name:y,size:13}),v.jsx("span",{className:ye("truncate",x.preview&&"italic"),children:y}),m&&b&&v.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:b}),v.jsx("button",{"aria-label":`Close ${y}`,title:"Close",onClick:T=>{T.stopPropagation(),p([x.path])},className:ye("grid h-4 w-4 shrink-0 place-items-center rounded hover:bg-muted",!S&&!w&&"invisible group-hover:visible"),children:S?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"h-2 w-2 rounded-full bg-foreground group-hover:hidden"}),v.jsx(pn,{size:12,className:"hidden group-hover:block"})]}):v.jsx(pn,{size:12})})]},x.path)})]})}const Rw="clauder-hub:sidebar-collapsed";function Aw({text:e,failed:i}){const r=i?Gw:Pw;return v.jsxs("div",{role:i?"alert":"status",className:ye("fixed bottom-4 left-1/2 z-[60] flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2 rounded-xl px-3.5 py-2.5 text-xs opacity-85 shadow-lg shadow-black/25 transition-opacity animate-in fade-in-0 slide-in-from-bottom-2 hover:opacity-100 sm:max-w-lg",i?"bg-primary text-primary-foreground":"bg-success text-success-foreground"),children:[v.jsx(r,{size:15,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 break-words",children:e})]})}function Dw(){const e=ge(i=>i.switching);return e?v.jsx("div",{role:"progressbar","aria-label":`Opening ${e}`,title:`Opening ${e}...`,className:"pointer-events-none fixed inset-x-0 top-0 z-[70] h-0.5 overflow-hidden bg-primary/20",children:v.jsx("div",{className:"switching-bar h-full w-2/5 bg-primary"})}):null}const PB={overview:()=>v.jsx(bB,{}),inbox:()=>v.jsx(xB,{}),automation:()=>v.jsx(N6,{}),instructions:()=>v.jsx(DB,{}),agents:()=>v.jsx(bm,{kind:"agents"},"agents"),skills:()=>v.jsx(bm,{kind:"skills"},"skills"),commands:()=>v.jsx(bm,{kind:"commands"},"commands"),"mcp-servers":()=>v.jsx(MB,{}),hooks:()=>v.jsx(jB,{}),plugins:()=>v.jsx(OB,{}),channels:()=>v.jsx(DC,{}),"hub-prompts":()=>v.jsx(O8,{}),"claude-settings":()=>v.jsx(FD,{}),"mcp-suggestions":()=>v.jsx(yB,{}),presets:()=>v.jsx(EB,{}),categories:()=>v.jsx($6,{})};function IB(){const{boot:e,view:i,toast:r,health:s,windowed:l,projectId:d}=ge(),[p,a]=P.useState(null),u=bh("clauder-hub:sidebar-width",280,{min:220,max:480}),f=bh("clauder-hub:live-panel-width",260,{min:200,max:420}),g=td(D=>D.open),c=i5("(min-width: 768px)"),[_,x]=P.useState(!1),[C,y]=P.useState(()=>{try{return localStorage.getItem(Rw)==="1"}catch{return!1}});P.useEffect(()=>{try{localStorage.setItem(Rw,C?"1":"0")}catch{}},[C]),P.useEffect(()=>x(!1),[i,c]);const m=ge(D=>D.sessions.some(R=>R.live)),b=Bn(D=>D.tabs.length>0),S=m||b;P.useEffect(()=>{if(!S)return;const D=R=>{R.preventDefault(),R.returnValue=""};return window.addEventListener("beforeunload",D),()=>window.removeEventListener("beforeunload",D)},[S]),P.useEffect(()=>{if(l)return;const D=R=>{!R.ctrlKey||R.altKey||R.metaKey||R.code!=="Backquote"||(R.preventDefault(),R.stopPropagation(),y(!1),c||x(!0),window.setTimeout(()=>window.dispatchEvent(new Event(dg)),30))};return window.addEventListener("keydown",D,!0),()=>window.removeEventListener("keydown",D,!0)},[l,c]),P.useEffect(()=>{if(!_)return;const D=R=>R.key==="Escape"&&x(!1);return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[_]),P.useEffect(()=>{e().catch(D=>a(D.message))},[e]);const w=W8();if(P.useEffect(()=>{s&&(document.title=w?`(${w}) ${s.project}`:s.project)},[s,w]),!s)return v.jsx("div",{className:"grid h-screen place-items-center text-xs text-muted-foreground",children:"Opening the project..."});if(d===fi)return v.jsxs(Hy,{children:[v.jsx(_B,{}),v.jsx(Dw,{}),v.jsx(ew,{}),v.jsx(tw,{}),(p||r)&&v.jsx(Aw,{text:p??(r==null?void 0:r.text),failed:!!p||(r==null?void 0:r.tone)==="error"})]});const T=i.kind==="session"?v.jsx(L5,{id:i.id},i.id):i.kind==="file"?v.jsx(L8,{path:i.path},i.path):PB[i.page]();return v.jsx(Hy,{children:v.jsxs("div",{className:"flex h-screen overflow-hidden",children:[!l&&c&&v.jsx(uw,{width:u.width,collapsed:C,onToggle:()=>y(!C)}),!l&&c&&!C&&v.jsx(Sh,{onDrag:u.resizeBy,onReset:u.reset}),!l&&!c&&v.jsxs(v.Fragment,{children:[_&&v.jsx("div",{className:"fixed inset-0 z-40 bg-foreground/40 animate-in fade-in-0",onClick:()=>x(!1)}),v.jsx("div",{inert:!_,className:ye("fixed inset-y-0 left-0 z-40 flex border-r bg-background transition-transform duration-200",_?"translate-x-0 shadow-xl":"-translate-x-full"),children:v.jsx(uw,{width:"min(280px, 85vw)",collapsed:!1,onToggle:()=>x(!1),drawer:!0})})]}),v.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[!l&&!c&&v.jsx(E9,{onMenu:()=>x(!0)}),v.jsx(M5,{}),!l&&v.jsx(T9,{}),!l&&v.jsx(BB,{active:i.kind==="file"?i.path:null}),v.jsx("div",{className:"min-h-0 flex-1",children:T})]}),!l&&c&&g&&v.jsx(Sh,{onDrag:D=>f.resizeBy(-D),onReset:f.reset}),!l&&c&&g&&v.jsx(C5,{width:f.width}),v.jsx(Dw,{}),v.jsx(ew,{}),v.jsx(tw,{}),(p||r)&&v.jsx(Aw,{text:p??(r==null?void 0:r.text),failed:!!p||(r==null?void 0:r.tone)==="error"})]},d)})}H3.createRoot(document.getElementById("root")).render(v.jsx(Ll.StrictMode,{children:v.jsx(IB,{})}));export{Ll as W,WD as _,Kt as f,fg as g,v as j,P as r,ge as u};