@regression-io/claude-config 0.20.7 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1756 +0,0 @@
1
- function v2(e,t){for(var s=0;s<t.length;s++){const i=t[s];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in e)){const m=Object.getOwnPropertyDescriptor(i,l);m&&Object.defineProperty(e,l,m.get?m:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const m of l)if(m.type==="childList")for(const f of m.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function s(l){const m={};return l.integrity&&(m.integrity=l.integrity),l.referrerPolicy&&(m.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?m.credentials="include":l.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function i(l){if(l.ep)return;l.ep=!0;const m=s(l);fetch(l.href,m)}})();function ff(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kd={exports:{}},Fo={},Gd={exports:{}},We={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Nv;function y2(){if(Nv)return We;Nv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),f=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),d=Symbol.iterator;function _(O){return O===null||typeof O!="object"?null:(O=d&&O[d]||O["@@iterator"],typeof O=="function"?O:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,b={};function v(O,V,Z){this.props=O,this.context=V,this.refs=b,this.updater=Z||S}v.prototype.isReactComponent={},v.prototype.setState=function(O,V){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,V,"setState")},v.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function y(){}y.prototype=v.prototype;function p(O,V,Z){this.props=O,this.context=V,this.refs=b,this.updater=Z||S}var x=p.prototype=new y;x.constructor=p,E(x,v.prototype),x.isPureReactComponent=!0;var k=Array.isArray,P=Object.prototype.hasOwnProperty,T={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function j(O,V,Z){var re,ce={},ue=null,U=null;if(V!=null)for(re in V.ref!==void 0&&(U=V.ref),V.key!==void 0&&(ue=""+V.key),V)P.call(V,re)&&!R.hasOwnProperty(re)&&(ce[re]=V[re]);var D=arguments.length-2;if(D===1)ce.children=Z;else if(1<D){for(var K=Array(D),q=0;q<D;q++)K[q]=arguments[q+2];ce.children=K}if(O&&O.defaultProps)for(re in D=O.defaultProps,D)ce[re]===void 0&&(ce[re]=D[re]);return{$$typeof:e,type:O,key:ue,ref:U,props:ce,_owner:T.current}}function L(O,V){return{$$typeof:e,type:O.type,key:V,ref:O.ref,props:O.props,_owner:O._owner}}function $(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function F(O){var V={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(Z){return V[Z]})}var W=/\/+/g;function H(O,V){return typeof O=="object"&&O!==null&&O.key!=null?F(""+O.key):V.toString(36)}function J(O,V,Z,re,ce){var ue=typeof O;(ue==="undefined"||ue==="boolean")&&(O=null);var U=!1;if(O===null)U=!0;else switch(ue){case"string":case"number":U=!0;break;case"object":switch(O.$$typeof){case e:case t:U=!0}}if(U)return U=O,ce=ce(U),O=re===""?"."+H(U,0):re,k(ce)?(Z="",O!=null&&(Z=O.replace(W,"$&/")+"/"),J(ce,V,Z,"",function(q){return q})):ce!=null&&($(ce)&&(ce=L(ce,Z+(!ce.key||U&&U.key===ce.key?"":(""+ce.key).replace(W,"$&/")+"/")+O)),V.push(ce)),1;if(U=0,re=re===""?".":re+":",k(O))for(var D=0;D<O.length;D++){ue=O[D];var K=re+H(ue,D);U+=J(ue,V,Z,K,ce)}else if(K=_(O),typeof K=="function")for(O=K.call(O),D=0;!(ue=O.next()).done;)ue=ue.value,K=re+H(ue,D++),U+=J(ue,V,Z,K,ce);else if(ue==="object")throw V=String(O),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return U}function G(O,V,Z){if(O==null)return O;var re=[],ce=0;return J(O,re,"","",function(ue){return V.call(Z,ue,ce++)}),re}function Y(O){if(O._status===-1){var V=O._result;V=V(),V.then(function(Z){(O._status===0||O._status===-1)&&(O._status=1,O._result=Z)},function(Z){(O._status===0||O._status===-1)&&(O._status=2,O._result=Z)}),O._status===-1&&(O._status=0,O._result=V)}if(O._status===1)return O._result.default;throw O._result}var ee={current:null},z={transition:null},M={ReactCurrentDispatcher:ee,ReactCurrentBatchConfig:z,ReactCurrentOwner:T};function B(){throw Error("act(...) is not supported in production builds of React.")}return We.Children={map:G,forEach:function(O,V,Z){G(O,function(){V.apply(this,arguments)},Z)},count:function(O){var V=0;return G(O,function(){V++}),V},toArray:function(O){return G(O,function(V){return V})||[]},only:function(O){if(!$(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},We.Component=v,We.Fragment=s,We.Profiler=l,We.PureComponent=p,We.StrictMode=i,We.Suspense=c,We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M,We.act=B,We.cloneElement=function(O,V,Z){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var re=E({},O.props),ce=O.key,ue=O.ref,U=O._owner;if(V!=null){if(V.ref!==void 0&&(ue=V.ref,U=T.current),V.key!==void 0&&(ce=""+V.key),O.type&&O.type.defaultProps)var D=O.type.defaultProps;for(K in V)P.call(V,K)&&!R.hasOwnProperty(K)&&(re[K]=V[K]===void 0&&D!==void 0?D[K]:V[K])}var K=arguments.length-2;if(K===1)re.children=Z;else if(1<K){D=Array(K);for(var q=0;q<K;q++)D[q]=arguments[q+2];re.children=D}return{$$typeof:e,type:O.type,key:ce,ref:ue,props:re,_owner:U}},We.createContext=function(O){return O={$$typeof:f,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:m,_context:O},O.Consumer=O},We.createElement=j,We.createFactory=function(O){var V=j.bind(null,O);return V.type=O,V},We.createRef=function(){return{current:null}},We.forwardRef=function(O){return{$$typeof:a,render:O}},We.isValidElement=$,We.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:Y}},We.memo=function(O,V){return{$$typeof:h,type:O,compare:V===void 0?null:V}},We.startTransition=function(O){var V=z.transition;z.transition={};try{O()}finally{z.transition=V}},We.unstable_act=B,We.useCallback=function(O,V){return ee.current.useCallback(O,V)},We.useContext=function(O){return ee.current.useContext(O)},We.useDebugValue=function(){},We.useDeferredValue=function(O){return ee.current.useDeferredValue(O)},We.useEffect=function(O,V){return ee.current.useEffect(O,V)},We.useId=function(){return ee.current.useId()},We.useImperativeHandle=function(O,V,Z){return ee.current.useImperativeHandle(O,V,Z)},We.useInsertionEffect=function(O,V){return ee.current.useInsertionEffect(O,V)},We.useLayoutEffect=function(O,V){return ee.current.useLayoutEffect(O,V)},We.useMemo=function(O,V){return ee.current.useMemo(O,V)},We.useReducer=function(O,V,Z){return ee.current.useReducer(O,V,Z)},We.useRef=function(O){return ee.current.useRef(O)},We.useState=function(O){return ee.current.useState(O)},We.useSyncExternalStore=function(O,V,Z){return ee.current.useSyncExternalStore(O,V,Z)},We.useTransition=function(){return ee.current.useTransition()},We.version="18.3.1",We}var Pv;function pf(){return Pv||(Pv=1,Gd.exports=y2()),Gd.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Rv;function x2(){if(Rv)return Fo;Rv=1;var e=pf(),t=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function f(a,c,h){var g,d={},_=null,S=null;h!==void 0&&(_=""+h),c.key!==void 0&&(_=""+c.key),c.ref!==void 0&&(S=c.ref);for(g in c)i.call(c,g)&&!m.hasOwnProperty(g)&&(d[g]=c[g]);if(a&&a.defaultProps)for(g in c=a.defaultProps,c)d[g]===void 0&&(d[g]=c[g]);return{$$typeof:t,type:a,key:_,ref:S,props:d,_owner:l.current}}return Fo.Fragment=s,Fo.jsx=f,Fo.jsxs=f,Fo}var Tv;function _2(){return Tv||(Tv=1,Kd.exports=x2()),Kd.exports}var o=_2(),C=pf();const ge=ff(C),mf=v2({__proto__:null,default:ge},[C]);var Il={},qd={exports:{}},dr={},Yd={exports:{}},Xd={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Av;function w2(){return Av||(Av=1,(function(e){function t(z,M){var B=z.length;z.push(M);e:for(;0<B;){var O=B-1>>>1,V=z[O];if(0<l(V,M))z[O]=M,z[B]=V,B=O;else break e}}function s(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var M=z[0],B=z.pop();if(B!==M){z[0]=B;e:for(var O=0,V=z.length,Z=V>>>1;O<Z;){var re=2*(O+1)-1,ce=z[re],ue=re+1,U=z[ue];if(0>l(ce,B))ue<V&&0>l(U,ce)?(z[O]=U,z[ue]=B,O=ue):(z[O]=ce,z[re]=B,O=re);else if(ue<V&&0>l(U,B))z[O]=U,z[ue]=B,O=ue;else break e}}return M}function l(z,M){var B=z.sortIndex-M.sortIndex;return B!==0?B:z.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var m=performance;e.unstable_now=function(){return m.now()}}else{var f=Date,a=f.now();e.unstable_now=function(){return f.now()-a}}var c=[],h=[],g=1,d=null,_=3,S=!1,E=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(z){for(var M=s(h);M!==null;){if(M.callback===null)i(h);else if(M.startTime<=z)i(h),M.sortIndex=M.expirationTime,t(c,M);else break;M=s(h)}}function k(z){if(b=!1,x(z),!E)if(s(c)!==null)E=!0,Y(P);else{var M=s(h);M!==null&&ee(k,M.startTime-z)}}function P(z,M){E=!1,b&&(b=!1,y(j),j=-1),S=!0;var B=_;try{for(x(M),d=s(c);d!==null&&(!(d.expirationTime>M)||z&&!F());){var O=d.callback;if(typeof O=="function"){d.callback=null,_=d.priorityLevel;var V=O(d.expirationTime<=M);M=e.unstable_now(),typeof V=="function"?d.callback=V:d===s(c)&&i(c),x(M)}else i(c);d=s(c)}if(d!==null)var Z=!0;else{var re=s(h);re!==null&&ee(k,re.startTime-M),Z=!1}return Z}finally{d=null,_=B,S=!1}}var T=!1,R=null,j=-1,L=5,$=-1;function F(){return!(e.unstable_now()-$<L)}function W(){if(R!==null){var z=e.unstable_now();$=z;var M=!0;try{M=R(!0,z)}finally{M?H():(T=!1,R=null)}}else T=!1}var H;if(typeof p=="function")H=function(){p(W)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,G=J.port2;J.port1.onmessage=W,H=function(){G.postMessage(null)}}else H=function(){v(W,0)};function Y(z){R=z,T||(T=!0,H())}function ee(z,M){j=v(function(){z(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){E||S||(E=!0,Y(P))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return s(c)},e.unstable_next=function(z){switch(_){case 1:case 2:case 3:var M=3;break;default:M=_}var B=_;_=M;try{return z()}finally{_=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,M){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var B=_;_=z;try{return M()}finally{_=B}},e.unstable_scheduleCallback=function(z,M,B){var O=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?O+B:O):B=O,z){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=B+V,z={id:g++,callback:M,priorityLevel:z,startTime:B,expirationTime:V,sortIndex:-1},B>O?(z.sortIndex=B,t(h,z),s(c)===null&&z===s(h)&&(b?(y(j),j=-1):b=!0,ee(k,B-O))):(z.sortIndex=V,t(c,z),E||S||(E=!0,Y(P))),z},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(z){var M=_;return function(){var B=_;_=M;try{return z.apply(this,arguments)}finally{_=B}}}})(Xd)),Xd}var Dv;function b2(){return Dv||(Dv=1,Yd.exports=w2()),Yd.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Mv;function S2(){if(Mv)return dr;Mv=1;var e=pf(),t=b2();function s(r){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)n+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,l={};function m(r,n){f(r,n),f(r+"Capture",n)}function f(r,n){for(l[r]=n,r=0;r<n.length;r++)i.add(n[r])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,h=/^[: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]*$/,g={},d={};function _(r){return c.call(d,r)?!0:c.call(g,r)?!1:h.test(r)?d[r]=!0:(g[r]=!0,!1)}function S(r,n,u,w){if(u!==null&&u.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return w?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function E(r,n,u,w){if(n===null||typeof n>"u"||S(r,n,u,w))return!0;if(w)return!1;if(u!==null)switch(u.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function b(r,n,u,w,N,A,I){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=w,this.attributeNamespace=N,this.mustUseProperty=u,this.propertyName=r,this.type=n,this.sanitizeURL=A,this.removeEmptyString=I}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){v[r]=new b(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var n=r[0];v[n]=new b(n,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){v[r]=new b(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){v[r]=new b(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){v[r]=new b(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){v[r]=new b(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){v[r]=new b(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){v[r]=new b(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){v[r]=new b(r,5,!1,r.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function p(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var n=r.replace(y,p);v[n]=new b(n,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var n=r.replace(y,p);v[n]=new b(n,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var n=r.replace(y,p);v[n]=new b(n,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){v[r]=new b(r,1,!1,r.toLowerCase(),null,!1,!1)}),v.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){v[r]=new b(r,1,!1,r.toLowerCase(),null,!0,!0)});function x(r,n,u,w){var N=v.hasOwnProperty(n)?v[n]:null;(N!==null?N.type!==0:w||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(E(n,u,N,w)&&(u=null),w||N===null?_(n)&&(u===null?r.removeAttribute(n):r.setAttribute(n,""+u)):N.mustUseProperty?r[N.propertyName]=u===null?N.type===3?!1:"":u:(n=N.attributeName,w=N.attributeNamespace,u===null?r.removeAttribute(n):(N=N.type,u=N===3||N===4&&u===!0?"":""+u,w?r.setAttributeNS(w,n,u):r.setAttribute(n,u))))}var k=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),T=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),$=Symbol.for("react.provider"),F=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),ee=Symbol.for("react.offscreen"),z=Symbol.iterator;function M(r){return r===null||typeof r!="object"?null:(r=z&&r[z]||r["@@iterator"],typeof r=="function"?r:null)}var B=Object.assign,O;function V(r){if(O===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);O=n&&n[1]||""}return`
34
- `+O+r}var Z=!1;function re(r,n){if(!r||Z)return"";Z=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(oe){var w=oe}Reflect.construct(r,[],n)}else{try{n.call()}catch(oe){w=oe}r.call(n.prototype)}else{try{throw Error()}catch(oe){w=oe}r()}}catch(oe){if(oe&&w&&typeof oe.stack=="string"){for(var N=oe.stack.split(`
35
- `),A=w.stack.split(`
36
- `),I=N.length-1,X=A.length-1;1<=I&&0<=X&&N[I]!==A[X];)X--;for(;1<=I&&0<=X;I--,X--)if(N[I]!==A[X]){if(I!==1||X!==1)do if(I--,X--,0>X||N[I]!==A[X]){var Q=`
37
- `+N[I].replace(" at new "," at ");return r.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",r.displayName)),Q}while(1<=I&&0<=X);break}}}finally{Z=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?V(r):""}function ce(r){switch(r.tag){case 5:return V(r.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return r=re(r.type,!1),r;case 11:return r=re(r.type.render,!1),r;case 1:return r=re(r.type,!0),r;default:return""}}function ue(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case R:return"Fragment";case T:return"Portal";case L:return"Profiler";case j:return"StrictMode";case H:return"Suspense";case J:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case F:return(r.displayName||"Context")+".Consumer";case $:return(r._context.displayName||"Context")+".Provider";case W:var n=r.render;return r=r.displayName,r||(r=n.displayName||n.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case G:return n=r.displayName||null,n!==null?n:ue(r.type)||"Memo";case Y:n=r._payload,r=r._init;try{return ue(r(n))}catch{}}return null}function U(r){var n=r.type;switch(r.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=n.render,r=r.displayName||r.name||"",n.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(n);case 8:return n===j?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function D(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function K(r){var n=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function q(r){var n=K(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,n),w=""+r[n];if(!r.hasOwnProperty(n)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var N=u.get,A=u.set;return Object.defineProperty(r,n,{configurable:!0,get:function(){return N.call(this)},set:function(I){w=""+I,A.call(this,I)}}),Object.defineProperty(r,n,{enumerable:u.enumerable}),{getValue:function(){return w},setValue:function(I){w=""+I},stopTracking:function(){r._valueTracker=null,delete r[n]}}}}function ie(r){r._valueTracker||(r._valueTracker=q(r))}function ae(r){if(!r)return!1;var n=r._valueTracker;if(!n)return!0;var u=n.getValue(),w="";return r&&(w=K(r)?r.checked?"true":"false":r.value),r=w,r!==u?(n.setValue(r),!0):!1}function ve(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function He(r,n){var u=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Ue(r,n){var u=n.defaultValue==null?"":n.defaultValue,w=n.checked!=null?n.checked:n.defaultChecked;u=D(n.value!=null?n.value:u),r._wrapperState={initialChecked:w,initialValue:u,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Xe(r,n){n=n.checked,n!=null&&x(r,"checked",n,!1)}function Ee(r,n){Xe(r,n);var u=D(n.value),w=n.type;if(u!=null)w==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(w==="submit"||w==="reset"){r.removeAttribute("value");return}n.hasOwnProperty("value")?et(r,n.type,u):n.hasOwnProperty("defaultValue")&&et(r,n.type,D(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(r.defaultChecked=!!n.defaultChecked)}function Ht(r,n,u){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var w=n.type;if(!(w!=="submit"&&w!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+r._wrapperState.initialValue,u||n===r.value||(r.value=n),r.defaultValue=n}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function et(r,n,u){(n!=="number"||ve(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var Pe=Array.isArray;function Ae(r,n,u,w){if(r=r.options,n){n={};for(var N=0;N<u.length;N++)n["$"+u[N]]=!0;for(u=0;u<r.length;u++)N=n.hasOwnProperty("$"+r[u].value),r[u].selected!==N&&(r[u].selected=N),N&&w&&(r[u].defaultSelected=!0)}else{for(u=""+D(u),n=null,N=0;N<r.length;N++){if(r[N].value===u){r[N].selected=!0,w&&(r[N].defaultSelected=!0);return}n!==null||r[N].disabled||(n=r[N])}n!==null&&(n.selected=!0)}}function Ie(r,n){if(n.dangerouslySetInnerHTML!=null)throw Error(s(91));return B({},n,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Fe(r,n){var u=n.value;if(u==null){if(u=n.children,n=n.defaultValue,u!=null){if(n!=null)throw Error(s(92));if(Pe(u)){if(1<u.length)throw Error(s(93));u=u[0]}n=u}n==null&&(n=""),u=n}r._wrapperState={initialValue:D(u)}}function Et(r,n){var u=D(n.value),w=D(n.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),n.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),w!=null&&(r.defaultValue=""+w)}function ct(r){var n=r.textContent;n===r._wrapperState.initialValue&&n!==""&&n!==null&&(r.value=n)}function vr(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ys(r,n){return r==null||r==="http://www.w3.org/1999/xhtml"?vr(n):r==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Vt,Hr=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,u,w,N){MSApp.execUnsafeLocalFunction(function(){return r(n,u,w,N)})}:r})(function(r,n){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=n;else{for(Vt=Vt||document.createElement("div"),Vt.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Vt.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;n.firstChild;)r.appendChild(n.firstChild)}});function ht(r,n){if(n){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=n;return}}r.textContent=n}var ir={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ge=["Webkit","ms","Moz","O"];Object.keys(ir).forEach(function(r){Ge.forEach(function(n){n=n+r.charAt(0).toUpperCase()+r.substring(1),ir[n]=ir[r]})});function ti(r,n,u){return n==null||typeof n=="boolean"||n===""?"":u||typeof n!="number"||n===0||ir.hasOwnProperty(r)&&ir[r]?(""+n).trim():n+"px"}function Ra(r,n){r=r.style;for(var u in n)if(n.hasOwnProperty(u)){var w=u.indexOf("--")===0,N=ti(u,n[u],w);u==="float"&&(u="cssFloat"),w?r.setProperty(u,N):r[u]=N}}var Ta=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ri(r,n){if(n){if(Ta[r]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(s(137,r));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(s(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(s(61))}if(n.style!=null&&typeof n.style!="object")throw Error(s(62))}}function to(r,n){if(r.indexOf("-")===-1)return typeof n.is=="string";switch(r){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 Cn=null;function Pr(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ro=null,Fs=null,xs=null;function so(r){if(r=Co(r)){if(typeof ro!="function")throw Error(s(280));var n=r.stateNode;n&&(n=Qa(n),ro(r.stateNode,r.type,n))}}function $e(r){Fs?xs?xs.push(r):xs=[r]:Fs=r}function ft(){if(Fs){var r=Fs,n=xs;if(xs=Fs=null,so(r),n)for(r=0;r<n.length;r++)so(n[r])}}function wt(r,n){return r(n)}function zt(){}var $s=!1;function yt(r,n,u){if($s)return r(n,u);$s=!0;try{return wt(r,n,u)}finally{$s=!1,(Fs!==null||xs!==null)&&(zt(),ft())}}function jt(r,n){var u=r.stateNode;if(u===null)return null;var w=Qa(u);if(w===null)return null;u=w[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":(w=!w.disabled)||(r=r.type,w=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!w;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(s(231,n,typeof u));return u}var Hs=!1;if(a)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){Hs=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{Hs=!1}function yr(r,n,u,w,N,A,I,X,Q){var oe=Array.prototype.slice.call(arguments,3);try{n.apply(u,oe)}catch(fe){this.onError(fe)}}var Vs=!1,Rr=null,no=!1,du=null,CC={onError:function(r){Vs=!0,Rr=r}};function kC(r,n,u,w,N,A,I,X,Q){Vs=!1,Rr=null,yr.apply(CC,arguments)}function EC(r,n,u,w,N,A,I,X,Q){if(kC.apply(this,arguments),Vs){if(Vs){var oe=Rr;Vs=!1,Rr=null}else throw Error(s(198));no||(no=!0,du=oe)}}function kn(r){var n=r,u=r;if(r.alternate)for(;n.return;)n=n.return;else{r=n;do n=r,(n.flags&4098)!==0&&(u=n.return),r=n.return;while(r)}return n.tag===3?u:null}function Jp(r){if(r.tag===13){var n=r.memoizedState;if(n===null&&(r=r.alternate,r!==null&&(n=r.memoizedState)),n!==null)return n.dehydrated}return null}function Qp(r){if(kn(r)!==r)throw Error(s(188))}function jC(r){var n=r.alternate;if(!n){if(n=kn(r),n===null)throw Error(s(188));return n!==r?null:r}for(var u=r,w=n;;){var N=u.return;if(N===null)break;var A=N.alternate;if(A===null){if(w=N.return,w!==null){u=w;continue}break}if(N.child===A.child){for(A=N.child;A;){if(A===u)return Qp(N),r;if(A===w)return Qp(N),n;A=A.sibling}throw Error(s(188))}if(u.return!==w.return)u=N,w=A;else{for(var I=!1,X=N.child;X;){if(X===u){I=!0,u=N,w=A;break}if(X===w){I=!0,w=N,u=A;break}X=X.sibling}if(!I){for(X=A.child;X;){if(X===u){I=!0,u=A,w=N;break}if(X===w){I=!0,w=A,u=N;break}X=X.sibling}if(!I)throw Error(s(189))}}if(u.alternate!==w)throw Error(s(190))}if(u.tag!==3)throw Error(s(188));return u.stateNode.current===u?r:n}function Zp(r){return r=jC(r),r!==null?em(r):null}function em(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var n=em(r);if(n!==null)return n;r=r.sibling}return null}var tm=t.unstable_scheduleCallback,rm=t.unstable_cancelCallback,NC=t.unstable_shouldYield,PC=t.unstable_requestPaint,pt=t.unstable_now,RC=t.unstable_getCurrentPriorityLevel,hu=t.unstable_ImmediatePriority,sm=t.unstable_UserBlockingPriority,Aa=t.unstable_NormalPriority,TC=t.unstable_LowPriority,nm=t.unstable_IdlePriority,Da=null,ss=null;function AC(r){if(ss&&typeof ss.onCommitFiberRoot=="function")try{ss.onCommitFiberRoot(Da,r,void 0,(r.current.flags&128)===128)}catch{}}var Vr=Math.clz32?Math.clz32:LC,DC=Math.log,MC=Math.LN2;function LC(r){return r>>>=0,r===0?32:31-(DC(r)/MC|0)|0}var Ma=64,La=4194304;function io(r){switch(r&-r){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: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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Oa(r,n){var u=r.pendingLanes;if(u===0)return 0;var w=0,N=r.suspendedLanes,A=r.pingedLanes,I=u&268435455;if(I!==0){var X=I&~N;X!==0?w=io(X):(A&=I,A!==0&&(w=io(A)))}else I=u&~N,I!==0?w=io(I):A!==0&&(w=io(A));if(w===0)return 0;if(n!==0&&n!==w&&(n&N)===0&&(N=w&-w,A=n&-n,N>=A||N===16&&(A&4194240)!==0))return n;if((w&4)!==0&&(w|=u&16),n=r.entangledLanes,n!==0)for(r=r.entanglements,n&=w;0<n;)u=31-Vr(n),N=1<<u,w|=r[u],n&=~N;return w}function OC(r,n){switch(r){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function IC(r,n){for(var u=r.suspendedLanes,w=r.pingedLanes,N=r.expirationTimes,A=r.pendingLanes;0<A;){var I=31-Vr(A),X=1<<I,Q=N[I];Q===-1?((X&u)===0||(X&w)!==0)&&(N[I]=OC(X,n)):Q<=n&&(r.expiredLanes|=X),A&=~X}}function fu(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function im(){var r=Ma;return Ma<<=1,(Ma&4194240)===0&&(Ma=64),r}function pu(r){for(var n=[],u=0;31>u;u++)n.push(r);return n}function oo(r,n,u){r.pendingLanes|=n,n!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,n=31-Vr(n),r[n]=u}function BC(r,n){var u=r.pendingLanes&~n;r.pendingLanes=n,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=n,r.mutableReadLanes&=n,r.entangledLanes&=n,n=r.entanglements;var w=r.eventTimes;for(r=r.expirationTimes;0<u;){var N=31-Vr(u),A=1<<N;n[N]=0,w[N]=-1,r[N]=-1,u&=~A}}function mu(r,n){var u=r.entangledLanes|=n;for(r=r.entanglements;u;){var w=31-Vr(u),N=1<<w;N&n|r[w]&n&&(r[w]|=n),u&=~N}}var Je=0;function om(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var am,gu,lm,cm,um,vu=!1,Ia=[],zs=null,Ws=null,Us=null,ao=new Map,lo=new Map,Ks=[],FC="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 submit".split(" ");function dm(r,n){switch(r){case"focusin":case"focusout":zs=null;break;case"dragenter":case"dragleave":Ws=null;break;case"mouseover":case"mouseout":Us=null;break;case"pointerover":case"pointerout":ao.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":lo.delete(n.pointerId)}}function co(r,n,u,w,N,A){return r===null||r.nativeEvent!==A?(r={blockedOn:n,domEventName:u,eventSystemFlags:w,nativeEvent:A,targetContainers:[N]},n!==null&&(n=Co(n),n!==null&&gu(n)),r):(r.eventSystemFlags|=w,n=r.targetContainers,N!==null&&n.indexOf(N)===-1&&n.push(N),r)}function $C(r,n,u,w,N){switch(n){case"focusin":return zs=co(zs,r,n,u,w,N),!0;case"dragenter":return Ws=co(Ws,r,n,u,w,N),!0;case"mouseover":return Us=co(Us,r,n,u,w,N),!0;case"pointerover":var A=N.pointerId;return ao.set(A,co(ao.get(A)||null,r,n,u,w,N)),!0;case"gotpointercapture":return A=N.pointerId,lo.set(A,co(lo.get(A)||null,r,n,u,w,N)),!0}return!1}function hm(r){var n=En(r.target);if(n!==null){var u=kn(n);if(u!==null){if(n=u.tag,n===13){if(n=Jp(u),n!==null){r.blockedOn=n,um(r.priority,function(){lm(u)});return}}else if(n===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ba(r){if(r.blockedOn!==null)return!1;for(var n=r.targetContainers;0<n.length;){var u=xu(r.domEventName,r.eventSystemFlags,n[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var w=new u.constructor(u.type,u);Cn=w,u.target.dispatchEvent(w),Cn=null}else return n=Co(u),n!==null&&gu(n),r.blockedOn=u,!1;n.shift()}return!0}function fm(r,n,u){Ba(r)&&u.delete(n)}function HC(){vu=!1,zs!==null&&Ba(zs)&&(zs=null),Ws!==null&&Ba(Ws)&&(Ws=null),Us!==null&&Ba(Us)&&(Us=null),ao.forEach(fm),lo.forEach(fm)}function uo(r,n){r.blockedOn===n&&(r.blockedOn=null,vu||(vu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,HC)))}function ho(r){function n(N){return uo(N,r)}if(0<Ia.length){uo(Ia[0],r);for(var u=1;u<Ia.length;u++){var w=Ia[u];w.blockedOn===r&&(w.blockedOn=null)}}for(zs!==null&&uo(zs,r),Ws!==null&&uo(Ws,r),Us!==null&&uo(Us,r),ao.forEach(n),lo.forEach(n),u=0;u<Ks.length;u++)w=Ks[u],w.blockedOn===r&&(w.blockedOn=null);for(;0<Ks.length&&(u=Ks[0],u.blockedOn===null);)hm(u),u.blockedOn===null&&Ks.shift()}var si=k.ReactCurrentBatchConfig,Fa=!0;function VC(r,n,u,w){var N=Je,A=si.transition;si.transition=null;try{Je=1,yu(r,n,u,w)}finally{Je=N,si.transition=A}}function zC(r,n,u,w){var N=Je,A=si.transition;si.transition=null;try{Je=4,yu(r,n,u,w)}finally{Je=N,si.transition=A}}function yu(r,n,u,w){if(Fa){var N=xu(r,n,u,w);if(N===null)Ou(r,n,w,$a,u),dm(r,w);else if($C(N,r,n,u,w))w.stopPropagation();else if(dm(r,w),n&4&&-1<FC.indexOf(r)){for(;N!==null;){var A=Co(N);if(A!==null&&am(A),A=xu(r,n,u,w),A===null&&Ou(r,n,w,$a,u),A===N)break;N=A}N!==null&&w.stopPropagation()}else Ou(r,n,w,null,u)}}var $a=null;function xu(r,n,u,w){if($a=null,r=Pr(w),r=En(r),r!==null)if(n=kn(r),n===null)r=null;else if(u=n.tag,u===13){if(r=Jp(n),r!==null)return r;r=null}else if(u===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;r=null}else n!==r&&(r=null);return $a=r,null}function pm(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(RC()){case hu:return 1;case sm:return 4;case Aa:case TC:return 16;case nm:return 536870912;default:return 16}default:return 16}}var Gs=null,_u=null,Ha=null;function mm(){if(Ha)return Ha;var r,n=_u,u=n.length,w,N="value"in Gs?Gs.value:Gs.textContent,A=N.length;for(r=0;r<u&&n[r]===N[r];r++);var I=u-r;for(w=1;w<=I&&n[u-w]===N[A-w];w++);return Ha=N.slice(r,1<w?1-w:void 0)}function Va(r){var n=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&n===13&&(r=13)):r=n,r===10&&(r=13),32<=r||r===13?r:0}function za(){return!0}function gm(){return!1}function xr(r){function n(u,w,N,A,I){this._reactName=u,this._targetInst=N,this.type=w,this.nativeEvent=A,this.target=I,this.currentTarget=null;for(var X in r)r.hasOwnProperty(X)&&(u=r[X],this[X]=u?u(A):A[X]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?za:gm,this.isPropagationStopped=gm,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=za)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=za)},persist:function(){},isPersistent:za}),n}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wu=xr(ni),fo=B({},ni,{view:0,detail:0}),WC=xr(fo),bu,Su,po,Wa=B({},fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ku,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==po&&(po&&r.type==="mousemove"?(bu=r.screenX-po.screenX,Su=r.screenY-po.screenY):Su=bu=0,po=r),bu)},movementY:function(r){return"movementY"in r?r.movementY:Su}}),vm=xr(Wa),UC=B({},Wa,{dataTransfer:0}),KC=xr(UC),GC=B({},fo,{relatedTarget:0}),Cu=xr(GC),qC=B({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),YC=xr(qC),XC=B({},ni,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),JC=xr(XC),QC=B({},ni,{data:0}),ym=xr(QC),ZC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ek={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"},tk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rk(r){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(r):(r=tk[r])?!!n[r]:!1}function ku(){return rk}var sk=B({},fo,{key:function(r){if(r.key){var n=ZC[r.key]||r.key;if(n!=="Unidentified")return n}return r.type==="keypress"?(r=Va(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?ek[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ku,charCode:function(r){return r.type==="keypress"?Va(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Va(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),nk=xr(sk),ik=B({},Wa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xm=xr(ik),ok=B({},fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ku}),ak=xr(ok),lk=B({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),ck=xr(lk),uk=B({},Wa,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),dk=xr(uk),hk=[9,13,27,32],Eu=a&&"CompositionEvent"in window,mo=null;a&&"documentMode"in document&&(mo=document.documentMode);var fk=a&&"TextEvent"in window&&!mo,_m=a&&(!Eu||mo&&8<mo&&11>=mo),wm=" ",bm=!1;function Sm(r,n){switch(r){case"keyup":return hk.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ii=!1;function pk(r,n){switch(r){case"compositionend":return Cm(n);case"keypress":return n.which!==32?null:(bm=!0,wm);case"textInput":return r=n.data,r===wm&&bm?null:r;default:return null}}function mk(r,n){if(ii)return r==="compositionend"||!Eu&&Sm(r,n)?(r=mm(),Ha=_u=Gs=null,ii=!1,r):null;switch(r){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 _m&&n.locale!=="ko"?null:n.data;default:return null}}var gk={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 km(r){var n=r&&r.nodeName&&r.nodeName.toLowerCase();return n==="input"?!!gk[r.type]:n==="textarea"}function Em(r,n,u,w){$e(w),n=Ya(n,"onChange"),0<n.length&&(u=new wu("onChange","change",null,u,w),r.push({event:u,listeners:n}))}var go=null,vo=null;function vk(r){Wm(r,0)}function Ua(r){var n=ui(r);if(ae(n))return r}function yk(r,n){if(r==="change")return n}var jm=!1;if(a){var ju;if(a){var Nu="oninput"in document;if(!Nu){var Nm=document.createElement("div");Nm.setAttribute("oninput","return;"),Nu=typeof Nm.oninput=="function"}ju=Nu}else ju=!1;jm=ju&&(!document.documentMode||9<document.documentMode)}function Pm(){go&&(go.detachEvent("onpropertychange",Rm),vo=go=null)}function Rm(r){if(r.propertyName==="value"&&Ua(vo)){var n=[];Em(n,vo,r,Pr(r)),yt(vk,n)}}function xk(r,n,u){r==="focusin"?(Pm(),go=n,vo=u,go.attachEvent("onpropertychange",Rm)):r==="focusout"&&Pm()}function _k(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Ua(vo)}function wk(r,n){if(r==="click")return Ua(n)}function bk(r,n){if(r==="input"||r==="change")return Ua(n)}function Sk(r,n){return r===n&&(r!==0||1/r===1/n)||r!==r&&n!==n}var zr=typeof Object.is=="function"?Object.is:Sk;function yo(r,n){if(zr(r,n))return!0;if(typeof r!="object"||r===null||typeof n!="object"||n===null)return!1;var u=Object.keys(r),w=Object.keys(n);if(u.length!==w.length)return!1;for(w=0;w<u.length;w++){var N=u[w];if(!c.call(n,N)||!zr(r[N],n[N]))return!1}return!0}function Tm(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Am(r,n){var u=Tm(r);r=0;for(var w;u;){if(u.nodeType===3){if(w=r+u.textContent.length,r<=n&&w>=n)return{node:u,offset:n-r};r=w}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Tm(u)}}function Dm(r,n){return r&&n?r===n?!0:r&&r.nodeType===3?!1:n&&n.nodeType===3?Dm(r,n.parentNode):"contains"in r?r.contains(n):r.compareDocumentPosition?!!(r.compareDocumentPosition(n)&16):!1:!1}function Mm(){for(var r=window,n=ve();n instanceof r.HTMLIFrameElement;){try{var u=typeof n.contentWindow.location.href=="string"}catch{u=!1}if(u)r=n.contentWindow;else break;n=ve(r.document)}return n}function Pu(r){var n=r&&r.nodeName&&r.nodeName.toLowerCase();return n&&(n==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||n==="textarea"||r.contentEditable==="true")}function Ck(r){var n=Mm(),u=r.focusedElem,w=r.selectionRange;if(n!==u&&u&&u.ownerDocument&&Dm(u.ownerDocument.documentElement,u)){if(w!==null&&Pu(u)){if(n=w.start,r=w.end,r===void 0&&(r=n),"selectionStart"in u)u.selectionStart=n,u.selectionEnd=Math.min(r,u.value.length);else if(r=(n=u.ownerDocument||document)&&n.defaultView||window,r.getSelection){r=r.getSelection();var N=u.textContent.length,A=Math.min(w.start,N);w=w.end===void 0?A:Math.min(w.end,N),!r.extend&&A>w&&(N=w,w=A,A=N),N=Am(u,A);var I=Am(u,w);N&&I&&(r.rangeCount!==1||r.anchorNode!==N.node||r.anchorOffset!==N.offset||r.focusNode!==I.node||r.focusOffset!==I.offset)&&(n=n.createRange(),n.setStart(N.node,N.offset),r.removeAllRanges(),A>w?(r.addRange(n),r.extend(I.node,I.offset)):(n.setEnd(I.node,I.offset),r.addRange(n)))}}for(n=[],r=u;r=r.parentNode;)r.nodeType===1&&n.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<n.length;u++)r=n[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var kk=a&&"documentMode"in document&&11>=document.documentMode,oi=null,Ru=null,xo=null,Tu=!1;function Lm(r,n,u){var w=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Tu||oi==null||oi!==ve(w)||(w=oi,"selectionStart"in w&&Pu(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),xo&&yo(xo,w)||(xo=w,w=Ya(Ru,"onSelect"),0<w.length&&(n=new wu("onSelect","select",null,n,u),r.push({event:n,listeners:w}),n.target=oi)))}function Ka(r,n){var u={};return u[r.toLowerCase()]=n.toLowerCase(),u["Webkit"+r]="webkit"+n,u["Moz"+r]="moz"+n,u}var ai={animationend:Ka("Animation","AnimationEnd"),animationiteration:Ka("Animation","AnimationIteration"),animationstart:Ka("Animation","AnimationStart"),transitionend:Ka("Transition","TransitionEnd")},Au={},Om={};a&&(Om=document.createElement("div").style,"AnimationEvent"in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),"TransitionEvent"in window||delete ai.transitionend.transition);function Ga(r){if(Au[r])return Au[r];if(!ai[r])return r;var n=ai[r],u;for(u in n)if(n.hasOwnProperty(u)&&u in Om)return Au[r]=n[u];return r}var Im=Ga("animationend"),Bm=Ga("animationiteration"),Fm=Ga("animationstart"),$m=Ga("transitionend"),Hm=new Map,Vm="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function qs(r,n){Hm.set(r,n),m(n,[r])}for(var Du=0;Du<Vm.length;Du++){var Mu=Vm[Du],Ek=Mu.toLowerCase(),jk=Mu[0].toUpperCase()+Mu.slice(1);qs(Ek,"on"+jk)}qs(Im,"onAnimationEnd"),qs(Bm,"onAnimationIteration"),qs(Fm,"onAnimationStart"),qs("dblclick","onDoubleClick"),qs("focusin","onFocus"),qs("focusout","onBlur"),qs($m,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),m("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),m("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),m("onBeforeInput",["compositionend","keypress","textInput","paste"]),m("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _o="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(" "),Nk=new Set("cancel close invalid load scroll toggle".split(" ").concat(_o));function zm(r,n,u){var w=r.type||"unknown-event";r.currentTarget=u,EC(w,n,void 0,r),r.currentTarget=null}function Wm(r,n){n=(n&4)!==0;for(var u=0;u<r.length;u++){var w=r[u],N=w.event;w=w.listeners;e:{var A=void 0;if(n)for(var I=w.length-1;0<=I;I--){var X=w[I],Q=X.instance,oe=X.currentTarget;if(X=X.listener,Q!==A&&N.isPropagationStopped())break e;zm(N,X,oe),A=Q}else for(I=0;I<w.length;I++){if(X=w[I],Q=X.instance,oe=X.currentTarget,X=X.listener,Q!==A&&N.isPropagationStopped())break e;zm(N,X,oe),A=Q}}}if(no)throw r=du,no=!1,du=null,r}function tt(r,n){var u=n[Vu];u===void 0&&(u=n[Vu]=new Set);var w=r+"__bubble";u.has(w)||(Um(n,r,2,!1),u.add(w))}function Lu(r,n,u){var w=0;n&&(w|=4),Um(u,r,w,n)}var qa="_reactListening"+Math.random().toString(36).slice(2);function wo(r){if(!r[qa]){r[qa]=!0,i.forEach(function(u){u!=="selectionchange"&&(Nk.has(u)||Lu(u,!1,r),Lu(u,!0,r))});var n=r.nodeType===9?r:r.ownerDocument;n===null||n[qa]||(n[qa]=!0,Lu("selectionchange",!1,n))}}function Um(r,n,u,w){switch(pm(n)){case 1:var N=VC;break;case 4:N=zC;break;default:N=yu}u=N.bind(null,n,u,r),N=void 0,!Hs||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(N=!0),w?N!==void 0?r.addEventListener(n,u,{capture:!0,passive:N}):r.addEventListener(n,u,!0):N!==void 0?r.addEventListener(n,u,{passive:N}):r.addEventListener(n,u,!1)}function Ou(r,n,u,w,N){var A=w;if((n&1)===0&&(n&2)===0&&w!==null)e:for(;;){if(w===null)return;var I=w.tag;if(I===3||I===4){var X=w.stateNode.containerInfo;if(X===N||X.nodeType===8&&X.parentNode===N)break;if(I===4)for(I=w.return;I!==null;){var Q=I.tag;if((Q===3||Q===4)&&(Q=I.stateNode.containerInfo,Q===N||Q.nodeType===8&&Q.parentNode===N))return;I=I.return}for(;X!==null;){if(I=En(X),I===null)return;if(Q=I.tag,Q===5||Q===6){w=A=I;continue e}X=X.parentNode}}w=w.return}yt(function(){var oe=A,fe=Pr(u),pe=[];e:{var he=Hm.get(r);if(he!==void 0){var _e=wu,Se=r;switch(r){case"keypress":if(Va(u)===0)break e;case"keydown":case"keyup":_e=nk;break;case"focusin":Se="focus",_e=Cu;break;case"focusout":Se="blur",_e=Cu;break;case"beforeblur":case"afterblur":_e=Cu;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=vm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=KC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=ak;break;case Im:case Bm:case Fm:_e=YC;break;case $m:_e=ck;break;case"scroll":_e=WC;break;case"wheel":_e=dk;break;case"copy":case"cut":case"paste":_e=JC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=xm}var je=(n&4)!==0,mt=!je&&r==="scroll",se=je?he!==null?he+"Capture":null:he;je=[];for(var te=oe,ne;te!==null;){ne=te;var me=ne.stateNode;if(ne.tag===5&&me!==null&&(ne=me,se!==null&&(me=jt(te,se),me!=null&&je.push(bo(te,me,ne)))),mt)break;te=te.return}0<je.length&&(he=new _e(he,Se,null,u,fe),pe.push({event:he,listeners:je}))}}if((n&7)===0){e:{if(he=r==="mouseover"||r==="pointerover",_e=r==="mouseout"||r==="pointerout",he&&u!==Cn&&(Se=u.relatedTarget||u.fromElement)&&(En(Se)||Se[_s]))break e;if((_e||he)&&(he=fe.window===fe?fe:(he=fe.ownerDocument)?he.defaultView||he.parentWindow:window,_e?(Se=u.relatedTarget||u.toElement,_e=oe,Se=Se?En(Se):null,Se!==null&&(mt=kn(Se),Se!==mt||Se.tag!==5&&Se.tag!==6)&&(Se=null)):(_e=null,Se=oe),_e!==Se)){if(je=vm,me="onMouseLeave",se="onMouseEnter",te="mouse",(r==="pointerout"||r==="pointerover")&&(je=xm,me="onPointerLeave",se="onPointerEnter",te="pointer"),mt=_e==null?he:ui(_e),ne=Se==null?he:ui(Se),he=new je(me,te+"leave",_e,u,fe),he.target=mt,he.relatedTarget=ne,me=null,En(fe)===oe&&(je=new je(se,te+"enter",Se,u,fe),je.target=ne,je.relatedTarget=mt,me=je),mt=me,_e&&Se)t:{for(je=_e,se=Se,te=0,ne=je;ne;ne=li(ne))te++;for(ne=0,me=se;me;me=li(me))ne++;for(;0<te-ne;)je=li(je),te--;for(;0<ne-te;)se=li(se),ne--;for(;te--;){if(je===se||se!==null&&je===se.alternate)break t;je=li(je),se=li(se)}je=null}else je=null;_e!==null&&Km(pe,he,_e,je,!1),Se!==null&&mt!==null&&Km(pe,mt,Se,je,!0)}}e:{if(he=oe?ui(oe):window,_e=he.nodeName&&he.nodeName.toLowerCase(),_e==="select"||_e==="input"&&he.type==="file")var Ne=yk;else if(km(he))if(jm)Ne=bk;else{Ne=_k;var De=xk}else(_e=he.nodeName)&&_e.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(Ne=wk);if(Ne&&(Ne=Ne(r,oe))){Em(pe,Ne,u,fe);break e}De&&De(r,he,oe),r==="focusout"&&(De=he._wrapperState)&&De.controlled&&he.type==="number"&&et(he,"number",he.value)}switch(De=oe?ui(oe):window,r){case"focusin":(km(De)||De.contentEditable==="true")&&(oi=De,Ru=oe,xo=null);break;case"focusout":xo=Ru=oi=null;break;case"mousedown":Tu=!0;break;case"contextmenu":case"mouseup":case"dragend":Tu=!1,Lm(pe,u,fe);break;case"selectionchange":if(kk)break;case"keydown":case"keyup":Lm(pe,u,fe)}var Me;if(Eu)e:{switch(r){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else ii?Sm(r,u)&&(Be="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Be="onCompositionStart");Be&&(_m&&u.locale!=="ko"&&(ii||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&ii&&(Me=mm()):(Gs=fe,_u="value"in Gs?Gs.value:Gs.textContent,ii=!0)),De=Ya(oe,Be),0<De.length&&(Be=new ym(Be,r,null,u,fe),pe.push({event:Be,listeners:De}),Me?Be.data=Me:(Me=Cm(u),Me!==null&&(Be.data=Me)))),(Me=fk?pk(r,u):mk(r,u))&&(oe=Ya(oe,"onBeforeInput"),0<oe.length&&(fe=new ym("onBeforeInput","beforeinput",null,u,fe),pe.push({event:fe,listeners:oe}),fe.data=Me))}Wm(pe,n)})}function bo(r,n,u){return{instance:r,listener:n,currentTarget:u}}function Ya(r,n){for(var u=n+"Capture",w=[];r!==null;){var N=r,A=N.stateNode;N.tag===5&&A!==null&&(N=A,A=jt(r,u),A!=null&&w.unshift(bo(r,A,N)),A=jt(r,n),A!=null&&w.push(bo(r,A,N))),r=r.return}return w}function li(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Km(r,n,u,w,N){for(var A=n._reactName,I=[];u!==null&&u!==w;){var X=u,Q=X.alternate,oe=X.stateNode;if(Q!==null&&Q===w)break;X.tag===5&&oe!==null&&(X=oe,N?(Q=jt(u,A),Q!=null&&I.unshift(bo(u,Q,X))):N||(Q=jt(u,A),Q!=null&&I.push(bo(u,Q,X)))),u=u.return}I.length!==0&&r.push({event:n,listeners:I})}var Pk=/\r\n?/g,Rk=/\u0000|\uFFFD/g;function Gm(r){return(typeof r=="string"?r:""+r).replace(Pk,`
38
- `).replace(Rk,"")}function Xa(r,n,u){if(n=Gm(n),Gm(r)!==n&&u)throw Error(s(425))}function Ja(){}var Iu=null,Bu=null;function Fu(r,n){return r==="textarea"||r==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var $u=typeof setTimeout=="function"?setTimeout:void 0,Tk=typeof clearTimeout=="function"?clearTimeout:void 0,qm=typeof Promise=="function"?Promise:void 0,Ak=typeof queueMicrotask=="function"?queueMicrotask:typeof qm<"u"?function(r){return qm.resolve(null).then(r).catch(Dk)}:$u;function Dk(r){setTimeout(function(){throw r})}function Hu(r,n){var u=n,w=0;do{var N=u.nextSibling;if(r.removeChild(u),N&&N.nodeType===8)if(u=N.data,u==="/$"){if(w===0){r.removeChild(N),ho(n);return}w--}else u!=="$"&&u!=="$?"&&u!=="$!"||w++;u=N}while(u);ho(n)}function Ys(r){for(;r!=null;r=r.nextSibling){var n=r.nodeType;if(n===1||n===3)break;if(n===8){if(n=r.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return r}function Ym(r){r=r.previousSibling;for(var n=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(n===0)return r;n--}else u==="/$"&&n++}r=r.previousSibling}return null}var ci=Math.random().toString(36).slice(2),ns="__reactFiber$"+ci,So="__reactProps$"+ci,_s="__reactContainer$"+ci,Vu="__reactEvents$"+ci,Mk="__reactListeners$"+ci,Lk="__reactHandles$"+ci;function En(r){var n=r[ns];if(n)return n;for(var u=r.parentNode;u;){if(n=u[_s]||u[ns]){if(u=n.alternate,n.child!==null||u!==null&&u.child!==null)for(r=Ym(r);r!==null;){if(u=r[ns])return u;r=Ym(r)}return n}r=u,u=r.parentNode}return null}function Co(r){return r=r[ns]||r[_s],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function ui(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(s(33))}function Qa(r){return r[So]||null}var zu=[],di=-1;function Xs(r){return{current:r}}function rt(r){0>di||(r.current=zu[di],zu[di]=null,di--)}function Qe(r,n){di++,zu[di]=r.current,r.current=n}var Js={},Wt=Xs(Js),or=Xs(!1),jn=Js;function hi(r,n){var u=r.type.contextTypes;if(!u)return Js;var w=r.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===n)return w.__reactInternalMemoizedMaskedChildContext;var N={},A;for(A in u)N[A]=n[A];return w&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=n,r.__reactInternalMemoizedMaskedChildContext=N),N}function ar(r){return r=r.childContextTypes,r!=null}function Za(){rt(or),rt(Wt)}function Xm(r,n,u){if(Wt.current!==Js)throw Error(s(168));Qe(Wt,n),Qe(or,u)}function Jm(r,n,u){var w=r.stateNode;if(n=n.childContextTypes,typeof w.getChildContext!="function")return u;w=w.getChildContext();for(var N in w)if(!(N in n))throw Error(s(108,U(r)||"Unknown",N));return B({},u,w)}function el(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Js,jn=Wt.current,Qe(Wt,r),Qe(or,or.current),!0}function Qm(r,n,u){var w=r.stateNode;if(!w)throw Error(s(169));u?(r=Jm(r,n,jn),w.__reactInternalMemoizedMergedChildContext=r,rt(or),rt(Wt),Qe(Wt,r)):rt(or),Qe(or,u)}var ws=null,tl=!1,Wu=!1;function Zm(r){ws===null?ws=[r]:ws.push(r)}function Ok(r){tl=!0,Zm(r)}function Qs(){if(!Wu&&ws!==null){Wu=!0;var r=0,n=Je;try{var u=ws;for(Je=1;r<u.length;r++){var w=u[r];do w=w(!0);while(w!==null)}ws=null,tl=!1}catch(N){throw ws!==null&&(ws=ws.slice(r+1)),tm(hu,Qs),N}finally{Je=n,Wu=!1}}return null}var fi=[],pi=0,rl=null,sl=0,Tr=[],Ar=0,Nn=null,bs=1,Ss="";function Pn(r,n){fi[pi++]=sl,fi[pi++]=rl,rl=r,sl=n}function eg(r,n,u){Tr[Ar++]=bs,Tr[Ar++]=Ss,Tr[Ar++]=Nn,Nn=r;var w=bs;r=Ss;var N=32-Vr(w)-1;w&=~(1<<N),u+=1;var A=32-Vr(n)+N;if(30<A){var I=N-N%5;A=(w&(1<<I)-1).toString(32),w>>=I,N-=I,bs=1<<32-Vr(n)+N|u<<N|w,Ss=A+r}else bs=1<<A|u<<N|w,Ss=r}function Uu(r){r.return!==null&&(Pn(r,1),eg(r,1,0))}function Ku(r){for(;r===rl;)rl=fi[--pi],fi[pi]=null,sl=fi[--pi],fi[pi]=null;for(;r===Nn;)Nn=Tr[--Ar],Tr[Ar]=null,Ss=Tr[--Ar],Tr[Ar]=null,bs=Tr[--Ar],Tr[Ar]=null}var _r=null,wr=null,nt=!1,Wr=null;function tg(r,n){var u=Or(5,null,null,0);u.elementType="DELETED",u.stateNode=n,u.return=r,n=r.deletions,n===null?(r.deletions=[u],r.flags|=16):n.push(u)}function rg(r,n){switch(r.tag){case 5:var u=r.type;return n=n.nodeType!==1||u.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(r.stateNode=n,_r=r,wr=Ys(n.firstChild),!0):!1;case 6:return n=r.pendingProps===""||n.nodeType!==3?null:n,n!==null?(r.stateNode=n,_r=r,wr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(u=Nn!==null?{id:bs,overflow:Ss}:null,r.memoizedState={dehydrated:n,treeContext:u,retryLane:1073741824},u=Or(18,null,null,0),u.stateNode=n,u.return=r,r.child=u,_r=r,wr=null,!0):!1;default:return!1}}function Gu(r){return(r.mode&1)!==0&&(r.flags&128)===0}function qu(r){if(nt){var n=wr;if(n){var u=n;if(!rg(r,n)){if(Gu(r))throw Error(s(418));n=Ys(u.nextSibling);var w=_r;n&&rg(r,n)?tg(w,u):(r.flags=r.flags&-4097|2,nt=!1,_r=r)}}else{if(Gu(r))throw Error(s(418));r.flags=r.flags&-4097|2,nt=!1,_r=r}}}function sg(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;_r=r}function nl(r){if(r!==_r)return!1;if(!nt)return sg(r),nt=!0,!1;var n;if((n=r.tag!==3)&&!(n=r.tag!==5)&&(n=r.type,n=n!=="head"&&n!=="body"&&!Fu(r.type,r.memoizedProps)),n&&(n=wr)){if(Gu(r))throw ng(),Error(s(418));for(;n;)tg(r,n),n=Ys(n.nextSibling)}if(sg(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));e:{for(r=r.nextSibling,n=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(n===0){wr=Ys(r.nextSibling);break e}n--}else u!=="$"&&u!=="$!"&&u!=="$?"||n++}r=r.nextSibling}wr=null}}else wr=_r?Ys(r.stateNode.nextSibling):null;return!0}function ng(){for(var r=wr;r;)r=Ys(r.nextSibling)}function mi(){wr=_r=null,nt=!1}function Yu(r){Wr===null?Wr=[r]:Wr.push(r)}var Ik=k.ReactCurrentBatchConfig;function ko(r,n,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(s(309));var w=u.stateNode}if(!w)throw Error(s(147,r));var N=w,A=""+r;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===A?n.ref:(n=function(I){var X=N.refs;I===null?delete X[A]:X[A]=I},n._stringRef=A,n)}if(typeof r!="string")throw Error(s(284));if(!u._owner)throw Error(s(290,r))}return r}function il(r,n){throw r=Object.prototype.toString.call(n),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":r))}function ig(r){var n=r._init;return n(r._payload)}function og(r){function n(se,te){if(r){var ne=se.deletions;ne===null?(se.deletions=[te],se.flags|=16):ne.push(te)}}function u(se,te){if(!r)return null;for(;te!==null;)n(se,te),te=te.sibling;return null}function w(se,te){for(se=new Map;te!==null;)te.key!==null?se.set(te.key,te):se.set(te.index,te),te=te.sibling;return se}function N(se,te){return se=an(se,te),se.index=0,se.sibling=null,se}function A(se,te,ne){return se.index=ne,r?(ne=se.alternate,ne!==null?(ne=ne.index,ne<te?(se.flags|=2,te):ne):(se.flags|=2,te)):(se.flags|=1048576,te)}function I(se){return r&&se.alternate===null&&(se.flags|=2),se}function X(se,te,ne,me){return te===null||te.tag!==6?(te=$d(ne,se.mode,me),te.return=se,te):(te=N(te,ne),te.return=se,te)}function Q(se,te,ne,me){var Ne=ne.type;return Ne===R?fe(se,te,ne.props.children,me,ne.key):te!==null&&(te.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Y&&ig(Ne)===te.type)?(me=N(te,ne.props),me.ref=ko(se,te,ne),me.return=se,me):(me=Pl(ne.type,ne.key,ne.props,null,se.mode,me),me.ref=ko(se,te,ne),me.return=se,me)}function oe(se,te,ne,me){return te===null||te.tag!==4||te.stateNode.containerInfo!==ne.containerInfo||te.stateNode.implementation!==ne.implementation?(te=Hd(ne,se.mode,me),te.return=se,te):(te=N(te,ne.children||[]),te.return=se,te)}function fe(se,te,ne,me,Ne){return te===null||te.tag!==7?(te=In(ne,se.mode,me,Ne),te.return=se,te):(te=N(te,ne),te.return=se,te)}function pe(se,te,ne){if(typeof te=="string"&&te!==""||typeof te=="number")return te=$d(""+te,se.mode,ne),te.return=se,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case P:return ne=Pl(te.type,te.key,te.props,null,se.mode,ne),ne.ref=ko(se,null,te),ne.return=se,ne;case T:return te=Hd(te,se.mode,ne),te.return=se,te;case Y:var me=te._init;return pe(se,me(te._payload),ne)}if(Pe(te)||M(te))return te=In(te,se.mode,ne,null),te.return=se,te;il(se,te)}return null}function he(se,te,ne,me){var Ne=te!==null?te.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return Ne!==null?null:X(se,te,""+ne,me);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case P:return ne.key===Ne?Q(se,te,ne,me):null;case T:return ne.key===Ne?oe(se,te,ne,me):null;case Y:return Ne=ne._init,he(se,te,Ne(ne._payload),me)}if(Pe(ne)||M(ne))return Ne!==null?null:fe(se,te,ne,me,null);il(se,ne)}return null}function _e(se,te,ne,me,Ne){if(typeof me=="string"&&me!==""||typeof me=="number")return se=se.get(ne)||null,X(te,se,""+me,Ne);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case P:return se=se.get(me.key===null?ne:me.key)||null,Q(te,se,me,Ne);case T:return se=se.get(me.key===null?ne:me.key)||null,oe(te,se,me,Ne);case Y:var De=me._init;return _e(se,te,ne,De(me._payload),Ne)}if(Pe(me)||M(me))return se=se.get(ne)||null,fe(te,se,me,Ne,null);il(te,me)}return null}function Se(se,te,ne,me){for(var Ne=null,De=null,Me=te,Be=te=0,Rt=null;Me!==null&&Be<ne.length;Be++){Me.index>Be?(Rt=Me,Me=null):Rt=Me.sibling;var qe=he(se,Me,ne[Be],me);if(qe===null){Me===null&&(Me=Rt);break}r&&Me&&qe.alternate===null&&n(se,Me),te=A(qe,te,Be),De===null?Ne=qe:De.sibling=qe,De=qe,Me=Rt}if(Be===ne.length)return u(se,Me),nt&&Pn(se,Be),Ne;if(Me===null){for(;Be<ne.length;Be++)Me=pe(se,ne[Be],me),Me!==null&&(te=A(Me,te,Be),De===null?Ne=Me:De.sibling=Me,De=Me);return nt&&Pn(se,Be),Ne}for(Me=w(se,Me);Be<ne.length;Be++)Rt=_e(Me,se,Be,ne[Be],me),Rt!==null&&(r&&Rt.alternate!==null&&Me.delete(Rt.key===null?Be:Rt.key),te=A(Rt,te,Be),De===null?Ne=Rt:De.sibling=Rt,De=Rt);return r&&Me.forEach(function(ln){return n(se,ln)}),nt&&Pn(se,Be),Ne}function je(se,te,ne,me){var Ne=M(ne);if(typeof Ne!="function")throw Error(s(150));if(ne=Ne.call(ne),ne==null)throw Error(s(151));for(var De=Ne=null,Me=te,Be=te=0,Rt=null,qe=ne.next();Me!==null&&!qe.done;Be++,qe=ne.next()){Me.index>Be?(Rt=Me,Me=null):Rt=Me.sibling;var ln=he(se,Me,qe.value,me);if(ln===null){Me===null&&(Me=Rt);break}r&&Me&&ln.alternate===null&&n(se,Me),te=A(ln,te,Be),De===null?Ne=ln:De.sibling=ln,De=ln,Me=Rt}if(qe.done)return u(se,Me),nt&&Pn(se,Be),Ne;if(Me===null){for(;!qe.done;Be++,qe=ne.next())qe=pe(se,qe.value,me),qe!==null&&(te=A(qe,te,Be),De===null?Ne=qe:De.sibling=qe,De=qe);return nt&&Pn(se,Be),Ne}for(Me=w(se,Me);!qe.done;Be++,qe=ne.next())qe=_e(Me,se,Be,qe.value,me),qe!==null&&(r&&qe.alternate!==null&&Me.delete(qe.key===null?Be:qe.key),te=A(qe,te,Be),De===null?Ne=qe:De.sibling=qe,De=qe);return r&&Me.forEach(function(g2){return n(se,g2)}),nt&&Pn(se,Be),Ne}function mt(se,te,ne,me){if(typeof ne=="object"&&ne!==null&&ne.type===R&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case P:e:{for(var Ne=ne.key,De=te;De!==null;){if(De.key===Ne){if(Ne=ne.type,Ne===R){if(De.tag===7){u(se,De.sibling),te=N(De,ne.props.children),te.return=se,se=te;break e}}else if(De.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Y&&ig(Ne)===De.type){u(se,De.sibling),te=N(De,ne.props),te.ref=ko(se,De,ne),te.return=se,se=te;break e}u(se,De);break}else n(se,De);De=De.sibling}ne.type===R?(te=In(ne.props.children,se.mode,me,ne.key),te.return=se,se=te):(me=Pl(ne.type,ne.key,ne.props,null,se.mode,me),me.ref=ko(se,te,ne),me.return=se,se=me)}return I(se);case T:e:{for(De=ne.key;te!==null;){if(te.key===De)if(te.tag===4&&te.stateNode.containerInfo===ne.containerInfo&&te.stateNode.implementation===ne.implementation){u(se,te.sibling),te=N(te,ne.children||[]),te.return=se,se=te;break e}else{u(se,te);break}else n(se,te);te=te.sibling}te=Hd(ne,se.mode,me),te.return=se,se=te}return I(se);case Y:return De=ne._init,mt(se,te,De(ne._payload),me)}if(Pe(ne))return Se(se,te,ne,me);if(M(ne))return je(se,te,ne,me);il(se,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,te!==null&&te.tag===6?(u(se,te.sibling),te=N(te,ne),te.return=se,se=te):(u(se,te),te=$d(ne,se.mode,me),te.return=se,se=te),I(se)):u(se,te)}return mt}var gi=og(!0),ag=og(!1),ol=Xs(null),al=null,vi=null,Xu=null;function Ju(){Xu=vi=al=null}function Qu(r){var n=ol.current;rt(ol),r._currentValue=n}function Zu(r,n,u){for(;r!==null;){var w=r.alternate;if((r.childLanes&n)!==n?(r.childLanes|=n,w!==null&&(w.childLanes|=n)):w!==null&&(w.childLanes&n)!==n&&(w.childLanes|=n),r===u)break;r=r.return}}function yi(r,n){al=r,Xu=vi=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&n)!==0&&(lr=!0),r.firstContext=null)}function Dr(r){var n=r._currentValue;if(Xu!==r)if(r={context:r,memoizedValue:n,next:null},vi===null){if(al===null)throw Error(s(308));vi=r,al.dependencies={lanes:0,firstContext:r}}else vi=vi.next=r;return n}var Rn=null;function ed(r){Rn===null?Rn=[r]:Rn.push(r)}function lg(r,n,u,w){var N=n.interleaved;return N===null?(u.next=u,ed(n)):(u.next=N.next,N.next=u),n.interleaved=u,Cs(r,w)}function Cs(r,n){r.lanes|=n;var u=r.alternate;for(u!==null&&(u.lanes|=n),u=r,r=r.return;r!==null;)r.childLanes|=n,u=r.alternate,u!==null&&(u.childLanes|=n),u=r,r=r.return;return u.tag===3?u.stateNode:null}var Zs=!1;function td(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cg(r,n){r=r.updateQueue,n.updateQueue===r&&(n.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function ks(r,n){return{eventTime:r,lane:n,tag:0,payload:null,callback:null,next:null}}function en(r,n,u){var w=r.updateQueue;if(w===null)return null;if(w=w.shared,(Ke&2)!==0){var N=w.pending;return N===null?n.next=n:(n.next=N.next,N.next=n),w.pending=n,Cs(r,u)}return N=w.interleaved,N===null?(n.next=n,ed(w)):(n.next=N.next,N.next=n),w.interleaved=n,Cs(r,u)}function ll(r,n,u){if(n=n.updateQueue,n!==null&&(n=n.shared,(u&4194240)!==0)){var w=n.lanes;w&=r.pendingLanes,u|=w,n.lanes=u,mu(r,u)}}function ug(r,n){var u=r.updateQueue,w=r.alternate;if(w!==null&&(w=w.updateQueue,u===w)){var N=null,A=null;if(u=u.firstBaseUpdate,u!==null){do{var I={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};A===null?N=A=I:A=A.next=I,u=u.next}while(u!==null);A===null?N=A=n:A=A.next=n}else N=A=n;u={baseState:w.baseState,firstBaseUpdate:N,lastBaseUpdate:A,shared:w.shared,effects:w.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=n:r.next=n,u.lastBaseUpdate=n}function cl(r,n,u,w){var N=r.updateQueue;Zs=!1;var A=N.firstBaseUpdate,I=N.lastBaseUpdate,X=N.shared.pending;if(X!==null){N.shared.pending=null;var Q=X,oe=Q.next;Q.next=null,I===null?A=oe:I.next=oe,I=Q;var fe=r.alternate;fe!==null&&(fe=fe.updateQueue,X=fe.lastBaseUpdate,X!==I&&(X===null?fe.firstBaseUpdate=oe:X.next=oe,fe.lastBaseUpdate=Q))}if(A!==null){var pe=N.baseState;I=0,fe=oe=Q=null,X=A;do{var he=X.lane,_e=X.eventTime;if((w&he)===he){fe!==null&&(fe=fe.next={eventTime:_e,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var Se=r,je=X;switch(he=n,_e=u,je.tag){case 1:if(Se=je.payload,typeof Se=="function"){pe=Se.call(_e,pe,he);break e}pe=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=je.payload,he=typeof Se=="function"?Se.call(_e,pe,he):Se,he==null)break e;pe=B({},pe,he);break e;case 2:Zs=!0}}X.callback!==null&&X.lane!==0&&(r.flags|=64,he=N.effects,he===null?N.effects=[X]:he.push(X))}else _e={eventTime:_e,lane:he,tag:X.tag,payload:X.payload,callback:X.callback,next:null},fe===null?(oe=fe=_e,Q=pe):fe=fe.next=_e,I|=he;if(X=X.next,X===null){if(X=N.shared.pending,X===null)break;he=X,X=he.next,he.next=null,N.lastBaseUpdate=he,N.shared.pending=null}}while(!0);if(fe===null&&(Q=pe),N.baseState=Q,N.firstBaseUpdate=oe,N.lastBaseUpdate=fe,n=N.shared.interleaved,n!==null){N=n;do I|=N.lane,N=N.next;while(N!==n)}else A===null&&(N.shared.lanes=0);Dn|=I,r.lanes=I,r.memoizedState=pe}}function dg(r,n,u){if(r=n.effects,n.effects=null,r!==null)for(n=0;n<r.length;n++){var w=r[n],N=w.callback;if(N!==null){if(w.callback=null,w=u,typeof N!="function")throw Error(s(191,N));N.call(w)}}}var Eo={},is=Xs(Eo),jo=Xs(Eo),No=Xs(Eo);function Tn(r){if(r===Eo)throw Error(s(174));return r}function rd(r,n){switch(Qe(No,n),Qe(jo,r),Qe(is,Eo),r=n.nodeType,r){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:ys(null,"");break;default:r=r===8?n.parentNode:n,n=r.namespaceURI||null,r=r.tagName,n=ys(n,r)}rt(is),Qe(is,n)}function xi(){rt(is),rt(jo),rt(No)}function hg(r){Tn(No.current);var n=Tn(is.current),u=ys(n,r.type);n!==u&&(Qe(jo,r),Qe(is,u))}function sd(r){jo.current===r&&(rt(is),rt(jo))}var it=Xs(0);function ul(r){for(var n=r;n!==null;){if(n.tag===13){var u=n.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break;for(;n.sibling===null;){if(n.return===null||n.return===r)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var nd=[];function id(){for(var r=0;r<nd.length;r++)nd[r]._workInProgressVersionPrimary=null;nd.length=0}var dl=k.ReactCurrentDispatcher,od=k.ReactCurrentBatchConfig,An=0,ot=null,bt=null,Nt=null,hl=!1,Po=!1,Ro=0,Bk=0;function Ut(){throw Error(s(321))}function ad(r,n){if(n===null)return!1;for(var u=0;u<n.length&&u<r.length;u++)if(!zr(r[u],n[u]))return!1;return!0}function ld(r,n,u,w,N,A){if(An=A,ot=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,dl.current=r===null||r.memoizedState===null?Vk:zk,r=u(w,N),Po){A=0;do{if(Po=!1,Ro=0,25<=A)throw Error(s(301));A+=1,Nt=bt=null,n.updateQueue=null,dl.current=Wk,r=u(w,N)}while(Po)}if(dl.current=ml,n=bt!==null&&bt.next!==null,An=0,Nt=bt=ot=null,hl=!1,n)throw Error(s(300));return r}function cd(){var r=Ro!==0;return Ro=0,r}function os(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?ot.memoizedState=Nt=r:Nt=Nt.next=r,Nt}function Mr(){if(bt===null){var r=ot.alternate;r=r!==null?r.memoizedState:null}else r=bt.next;var n=Nt===null?ot.memoizedState:Nt.next;if(n!==null)Nt=n,bt=r;else{if(r===null)throw Error(s(310));bt=r,r={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Nt===null?ot.memoizedState=Nt=r:Nt=Nt.next=r}return Nt}function To(r,n){return typeof n=="function"?n(r):n}function ud(r){var n=Mr(),u=n.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=r;var w=bt,N=w.baseQueue,A=u.pending;if(A!==null){if(N!==null){var I=N.next;N.next=A.next,A.next=I}w.baseQueue=N=A,u.pending=null}if(N!==null){A=N.next,w=w.baseState;var X=I=null,Q=null,oe=A;do{var fe=oe.lane;if((An&fe)===fe)Q!==null&&(Q=Q.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),w=oe.hasEagerState?oe.eagerState:r(w,oe.action);else{var pe={lane:fe,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};Q===null?(X=Q=pe,I=w):Q=Q.next=pe,ot.lanes|=fe,Dn|=fe}oe=oe.next}while(oe!==null&&oe!==A);Q===null?I=w:Q.next=X,zr(w,n.memoizedState)||(lr=!0),n.memoizedState=w,n.baseState=I,n.baseQueue=Q,u.lastRenderedState=w}if(r=u.interleaved,r!==null){N=r;do A=N.lane,ot.lanes|=A,Dn|=A,N=N.next;while(N!==r)}else N===null&&(u.lanes=0);return[n.memoizedState,u.dispatch]}function dd(r){var n=Mr(),u=n.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=r;var w=u.dispatch,N=u.pending,A=n.memoizedState;if(N!==null){u.pending=null;var I=N=N.next;do A=r(A,I.action),I=I.next;while(I!==N);zr(A,n.memoizedState)||(lr=!0),n.memoizedState=A,n.baseQueue===null&&(n.baseState=A),u.lastRenderedState=A}return[A,w]}function fg(){}function pg(r,n){var u=ot,w=Mr(),N=n(),A=!zr(w.memoizedState,N);if(A&&(w.memoizedState=N,lr=!0),w=w.queue,hd(vg.bind(null,u,w,r),[r]),w.getSnapshot!==n||A||Nt!==null&&Nt.memoizedState.tag&1){if(u.flags|=2048,Ao(9,gg.bind(null,u,w,N,n),void 0,null),Pt===null)throw Error(s(349));(An&30)!==0||mg(u,n,N)}return N}function mg(r,n,u){r.flags|=16384,r={getSnapshot:n,value:u},n=ot.updateQueue,n===null?(n={lastEffect:null,stores:null},ot.updateQueue=n,n.stores=[r]):(u=n.stores,u===null?n.stores=[r]:u.push(r))}function gg(r,n,u,w){n.value=u,n.getSnapshot=w,yg(n)&&xg(r)}function vg(r,n,u){return u(function(){yg(n)&&xg(r)})}function yg(r){var n=r.getSnapshot;r=r.value;try{var u=n();return!zr(r,u)}catch{return!0}}function xg(r){var n=Cs(r,1);n!==null&&qr(n,r,1,-1)}function _g(r){var n=os();return typeof r=="function"&&(r=r()),n.memoizedState=n.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:To,lastRenderedState:r},n.queue=r,r=r.dispatch=Hk.bind(null,ot,r),[n.memoizedState,r]}function Ao(r,n,u,w){return r={tag:r,create:n,destroy:u,deps:w,next:null},n=ot.updateQueue,n===null?(n={lastEffect:null,stores:null},ot.updateQueue=n,n.lastEffect=r.next=r):(u=n.lastEffect,u===null?n.lastEffect=r.next=r:(w=u.next,u.next=r,r.next=w,n.lastEffect=r)),r}function wg(){return Mr().memoizedState}function fl(r,n,u,w){var N=os();ot.flags|=r,N.memoizedState=Ao(1|n,u,void 0,w===void 0?null:w)}function pl(r,n,u,w){var N=Mr();w=w===void 0?null:w;var A=void 0;if(bt!==null){var I=bt.memoizedState;if(A=I.destroy,w!==null&&ad(w,I.deps)){N.memoizedState=Ao(n,u,A,w);return}}ot.flags|=r,N.memoizedState=Ao(1|n,u,A,w)}function bg(r,n){return fl(8390656,8,r,n)}function hd(r,n){return pl(2048,8,r,n)}function Sg(r,n){return pl(4,2,r,n)}function Cg(r,n){return pl(4,4,r,n)}function kg(r,n){if(typeof n=="function")return r=r(),n(r),function(){n(null)};if(n!=null)return r=r(),n.current=r,function(){n.current=null}}function Eg(r,n,u){return u=u!=null?u.concat([r]):null,pl(4,4,kg.bind(null,n,r),u)}function fd(){}function jg(r,n){var u=Mr();n=n===void 0?null:n;var w=u.memoizedState;return w!==null&&n!==null&&ad(n,w[1])?w[0]:(u.memoizedState=[r,n],r)}function Ng(r,n){var u=Mr();n=n===void 0?null:n;var w=u.memoizedState;return w!==null&&n!==null&&ad(n,w[1])?w[0]:(r=r(),u.memoizedState=[r,n],r)}function Pg(r,n,u){return(An&21)===0?(r.baseState&&(r.baseState=!1,lr=!0),r.memoizedState=u):(zr(u,n)||(u=im(),ot.lanes|=u,Dn|=u,r.baseState=!0),n)}function Fk(r,n){var u=Je;Je=u!==0&&4>u?u:4,r(!0);var w=od.transition;od.transition={};try{r(!1),n()}finally{Je=u,od.transition=w}}function Rg(){return Mr().memoizedState}function $k(r,n,u){var w=nn(r);if(u={lane:w,action:u,hasEagerState:!1,eagerState:null,next:null},Tg(r))Ag(n,u);else if(u=lg(r,n,u,w),u!==null){var N=rr();qr(u,r,w,N),Dg(u,n,w)}}function Hk(r,n,u){var w=nn(r),N={lane:w,action:u,hasEagerState:!1,eagerState:null,next:null};if(Tg(r))Ag(n,N);else{var A=r.alternate;if(r.lanes===0&&(A===null||A.lanes===0)&&(A=n.lastRenderedReducer,A!==null))try{var I=n.lastRenderedState,X=A(I,u);if(N.hasEagerState=!0,N.eagerState=X,zr(X,I)){var Q=n.interleaved;Q===null?(N.next=N,ed(n)):(N.next=Q.next,Q.next=N),n.interleaved=N;return}}catch{}finally{}u=lg(r,n,N,w),u!==null&&(N=rr(),qr(u,r,w,N),Dg(u,n,w))}}function Tg(r){var n=r.alternate;return r===ot||n!==null&&n===ot}function Ag(r,n){Po=hl=!0;var u=r.pending;u===null?n.next=n:(n.next=u.next,u.next=n),r.pending=n}function Dg(r,n,u){if((u&4194240)!==0){var w=n.lanes;w&=r.pendingLanes,u|=w,n.lanes=u,mu(r,u)}}var ml={readContext:Dr,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useInsertionEffect:Ut,useLayoutEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useMutableSource:Ut,useSyncExternalStore:Ut,useId:Ut,unstable_isNewReconciler:!1},Vk={readContext:Dr,useCallback:function(r,n){return os().memoizedState=[r,n===void 0?null:n],r},useContext:Dr,useEffect:bg,useImperativeHandle:function(r,n,u){return u=u!=null?u.concat([r]):null,fl(4194308,4,kg.bind(null,n,r),u)},useLayoutEffect:function(r,n){return fl(4194308,4,r,n)},useInsertionEffect:function(r,n){return fl(4,2,r,n)},useMemo:function(r,n){var u=os();return n=n===void 0?null:n,r=r(),u.memoizedState=[r,n],r},useReducer:function(r,n,u){var w=os();return n=u!==void 0?u(n):n,w.memoizedState=w.baseState=n,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:n},w.queue=r,r=r.dispatch=$k.bind(null,ot,r),[w.memoizedState,r]},useRef:function(r){var n=os();return r={current:r},n.memoizedState=r},useState:_g,useDebugValue:fd,useDeferredValue:function(r){return os().memoizedState=r},useTransition:function(){var r=_g(!1),n=r[0];return r=Fk.bind(null,r[1]),os().memoizedState=r,[n,r]},useMutableSource:function(){},useSyncExternalStore:function(r,n,u){var w=ot,N=os();if(nt){if(u===void 0)throw Error(s(407));u=u()}else{if(u=n(),Pt===null)throw Error(s(349));(An&30)!==0||mg(w,n,u)}N.memoizedState=u;var A={value:u,getSnapshot:n};return N.queue=A,bg(vg.bind(null,w,A,r),[r]),w.flags|=2048,Ao(9,gg.bind(null,w,A,u,n),void 0,null),u},useId:function(){var r=os(),n=Pt.identifierPrefix;if(nt){var u=Ss,w=bs;u=(w&~(1<<32-Vr(w)-1)).toString(32)+u,n=":"+n+"R"+u,u=Ro++,0<u&&(n+="H"+u.toString(32)),n+=":"}else u=Bk++,n=":"+n+"r"+u.toString(32)+":";return r.memoizedState=n},unstable_isNewReconciler:!1},zk={readContext:Dr,useCallback:jg,useContext:Dr,useEffect:hd,useImperativeHandle:Eg,useInsertionEffect:Sg,useLayoutEffect:Cg,useMemo:Ng,useReducer:ud,useRef:wg,useState:function(){return ud(To)},useDebugValue:fd,useDeferredValue:function(r){var n=Mr();return Pg(n,bt.memoizedState,r)},useTransition:function(){var r=ud(To)[0],n=Mr().memoizedState;return[r,n]},useMutableSource:fg,useSyncExternalStore:pg,useId:Rg,unstable_isNewReconciler:!1},Wk={readContext:Dr,useCallback:jg,useContext:Dr,useEffect:hd,useImperativeHandle:Eg,useInsertionEffect:Sg,useLayoutEffect:Cg,useMemo:Ng,useReducer:dd,useRef:wg,useState:function(){return dd(To)},useDebugValue:fd,useDeferredValue:function(r){var n=Mr();return bt===null?n.memoizedState=r:Pg(n,bt.memoizedState,r)},useTransition:function(){var r=dd(To)[0],n=Mr().memoizedState;return[r,n]},useMutableSource:fg,useSyncExternalStore:pg,useId:Rg,unstable_isNewReconciler:!1};function Ur(r,n){if(r&&r.defaultProps){n=B({},n),r=r.defaultProps;for(var u in r)n[u]===void 0&&(n[u]=r[u]);return n}return n}function pd(r,n,u,w){n=r.memoizedState,u=u(w,n),u=u==null?n:B({},n,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var gl={isMounted:function(r){return(r=r._reactInternals)?kn(r)===r:!1},enqueueSetState:function(r,n,u){r=r._reactInternals;var w=rr(),N=nn(r),A=ks(w,N);A.payload=n,u!=null&&(A.callback=u),n=en(r,A,N),n!==null&&(qr(n,r,N,w),ll(n,r,N))},enqueueReplaceState:function(r,n,u){r=r._reactInternals;var w=rr(),N=nn(r),A=ks(w,N);A.tag=1,A.payload=n,u!=null&&(A.callback=u),n=en(r,A,N),n!==null&&(qr(n,r,N,w),ll(n,r,N))},enqueueForceUpdate:function(r,n){r=r._reactInternals;var u=rr(),w=nn(r),N=ks(u,w);N.tag=2,n!=null&&(N.callback=n),n=en(r,N,w),n!==null&&(qr(n,r,w,u),ll(n,r,w))}};function Mg(r,n,u,w,N,A,I){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(w,A,I):n.prototype&&n.prototype.isPureReactComponent?!yo(u,w)||!yo(N,A):!0}function Lg(r,n,u){var w=!1,N=Js,A=n.contextType;return typeof A=="object"&&A!==null?A=Dr(A):(N=ar(n)?jn:Wt.current,w=n.contextTypes,A=(w=w!=null)?hi(r,N):Js),n=new n(u,A),r.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=gl,r.stateNode=n,n._reactInternals=r,w&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=N,r.__reactInternalMemoizedMaskedChildContext=A),n}function Og(r,n,u,w){r=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(u,w),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(u,w),n.state!==r&&gl.enqueueReplaceState(n,n.state,null)}function md(r,n,u,w){var N=r.stateNode;N.props=u,N.state=r.memoizedState,N.refs={},td(r);var A=n.contextType;typeof A=="object"&&A!==null?N.context=Dr(A):(A=ar(n)?jn:Wt.current,N.context=hi(r,A)),N.state=r.memoizedState,A=n.getDerivedStateFromProps,typeof A=="function"&&(pd(r,n,A,u),N.state=r.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(n=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),n!==N.state&&gl.enqueueReplaceState(N,N.state,null),cl(r,u,N,w),N.state=r.memoizedState),typeof N.componentDidMount=="function"&&(r.flags|=4194308)}function _i(r,n){try{var u="",w=n;do u+=ce(w),w=w.return;while(w);var N=u}catch(A){N=`
39
- Error generating stack: `+A.message+`
40
- `+A.stack}return{value:r,source:n,stack:N,digest:null}}function gd(r,n,u){return{value:r,source:null,stack:u??null,digest:n??null}}function vd(r,n){try{console.error(n.value)}catch(u){setTimeout(function(){throw u})}}var Uk=typeof WeakMap=="function"?WeakMap:Map;function Ig(r,n,u){u=ks(-1,u),u.tag=3,u.payload={element:null};var w=n.value;return u.callback=function(){Sl||(Sl=!0,Ad=w),vd(r,n)},u}function Bg(r,n,u){u=ks(-1,u),u.tag=3;var w=r.type.getDerivedStateFromError;if(typeof w=="function"){var N=n.value;u.payload=function(){return w(N)},u.callback=function(){vd(r,n)}}var A=r.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(u.callback=function(){vd(r,n),typeof w!="function"&&(rn===null?rn=new Set([this]):rn.add(this));var I=n.stack;this.componentDidCatch(n.value,{componentStack:I!==null?I:""})}),u}function Fg(r,n,u){var w=r.pingCache;if(w===null){w=r.pingCache=new Uk;var N=new Set;w.set(n,N)}else N=w.get(n),N===void 0&&(N=new Set,w.set(n,N));N.has(u)||(N.add(u),r=i2.bind(null,r,n,u),n.then(r,r))}function $g(r){do{var n;if((n=r.tag===13)&&(n=r.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return r;r=r.return}while(r!==null);return null}function Hg(r,n,u,w,N){return(r.mode&1)===0?(r===n?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(n=ks(-1,1),n.tag=2,en(u,n,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=N,r)}var Kk=k.ReactCurrentOwner,lr=!1;function tr(r,n,u,w){n.child=r===null?ag(n,null,u,w):gi(n,r.child,u,w)}function Vg(r,n,u,w,N){u=u.render;var A=n.ref;return yi(n,N),w=ld(r,n,u,w,A,N),u=cd(),r!==null&&!lr?(n.updateQueue=r.updateQueue,n.flags&=-2053,r.lanes&=~N,Es(r,n,N)):(nt&&u&&Uu(n),n.flags|=1,tr(r,n,w,N),n.child)}function zg(r,n,u,w,N){if(r===null){var A=u.type;return typeof A=="function"&&!Fd(A)&&A.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(n.tag=15,n.type=A,Wg(r,n,A,w,N)):(r=Pl(u.type,null,w,n,n.mode,N),r.ref=n.ref,r.return=n,n.child=r)}if(A=r.child,(r.lanes&N)===0){var I=A.memoizedProps;if(u=u.compare,u=u!==null?u:yo,u(I,w)&&r.ref===n.ref)return Es(r,n,N)}return n.flags|=1,r=an(A,w),r.ref=n.ref,r.return=n,n.child=r}function Wg(r,n,u,w,N){if(r!==null){var A=r.memoizedProps;if(yo(A,w)&&r.ref===n.ref)if(lr=!1,n.pendingProps=w=A,(r.lanes&N)!==0)(r.flags&131072)!==0&&(lr=!0);else return n.lanes=r.lanes,Es(r,n,N)}return yd(r,n,u,w,N)}function Ug(r,n,u){var w=n.pendingProps,N=w.children,A=r!==null?r.memoizedState:null;if(w.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qe(bi,br),br|=u;else{if((u&1073741824)===0)return r=A!==null?A.baseLanes|u:u,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:r,cachePool:null,transitions:null},n.updateQueue=null,Qe(bi,br),br|=r,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=A!==null?A.baseLanes:u,Qe(bi,br),br|=w}else A!==null?(w=A.baseLanes|u,n.memoizedState=null):w=u,Qe(bi,br),br|=w;return tr(r,n,N,u),n.child}function Kg(r,n){var u=n.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(n.flags|=512,n.flags|=2097152)}function yd(r,n,u,w,N){var A=ar(u)?jn:Wt.current;return A=hi(n,A),yi(n,N),u=ld(r,n,u,w,A,N),w=cd(),r!==null&&!lr?(n.updateQueue=r.updateQueue,n.flags&=-2053,r.lanes&=~N,Es(r,n,N)):(nt&&w&&Uu(n),n.flags|=1,tr(r,n,u,N),n.child)}function Gg(r,n,u,w,N){if(ar(u)){var A=!0;el(n)}else A=!1;if(yi(n,N),n.stateNode===null)yl(r,n),Lg(n,u,w),md(n,u,w,N),w=!0;else if(r===null){var I=n.stateNode,X=n.memoizedProps;I.props=X;var Q=I.context,oe=u.contextType;typeof oe=="object"&&oe!==null?oe=Dr(oe):(oe=ar(u)?jn:Wt.current,oe=hi(n,oe));var fe=u.getDerivedStateFromProps,pe=typeof fe=="function"||typeof I.getSnapshotBeforeUpdate=="function";pe||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(X!==w||Q!==oe)&&Og(n,I,w,oe),Zs=!1;var he=n.memoizedState;I.state=he,cl(n,w,I,N),Q=n.memoizedState,X!==w||he!==Q||or.current||Zs?(typeof fe=="function"&&(pd(n,u,fe,w),Q=n.memoizedState),(X=Zs||Mg(n,u,X,w,he,Q,oe))?(pe||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(n.flags|=4194308)):(typeof I.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=w,n.memoizedState=Q),I.props=w,I.state=Q,I.context=oe,w=X):(typeof I.componentDidMount=="function"&&(n.flags|=4194308),w=!1)}else{I=n.stateNode,cg(r,n),X=n.memoizedProps,oe=n.type===n.elementType?X:Ur(n.type,X),I.props=oe,pe=n.pendingProps,he=I.context,Q=u.contextType,typeof Q=="object"&&Q!==null?Q=Dr(Q):(Q=ar(u)?jn:Wt.current,Q=hi(n,Q));var _e=u.getDerivedStateFromProps;(fe=typeof _e=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(X!==pe||he!==Q)&&Og(n,I,w,Q),Zs=!1,he=n.memoizedState,I.state=he,cl(n,w,I,N);var Se=n.memoizedState;X!==pe||he!==Se||or.current||Zs?(typeof _e=="function"&&(pd(n,u,_e,w),Se=n.memoizedState),(oe=Zs||Mg(n,u,oe,w,he,Se,Q)||!1)?(fe||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(w,Se,Q),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(w,Se,Q)),typeof I.componentDidUpdate=="function"&&(n.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof I.componentDidUpdate!="function"||X===r.memoizedProps&&he===r.memoizedState||(n.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||X===r.memoizedProps&&he===r.memoizedState||(n.flags|=1024),n.memoizedProps=w,n.memoizedState=Se),I.props=w,I.state=Se,I.context=Q,w=oe):(typeof I.componentDidUpdate!="function"||X===r.memoizedProps&&he===r.memoizedState||(n.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||X===r.memoizedProps&&he===r.memoizedState||(n.flags|=1024),w=!1)}return xd(r,n,u,w,A,N)}function xd(r,n,u,w,N,A){Kg(r,n);var I=(n.flags&128)!==0;if(!w&&!I)return N&&Qm(n,u,!1),Es(r,n,A);w=n.stateNode,Kk.current=n;var X=I&&typeof u.getDerivedStateFromError!="function"?null:w.render();return n.flags|=1,r!==null&&I?(n.child=gi(n,r.child,null,A),n.child=gi(n,null,X,A)):tr(r,n,X,A),n.memoizedState=w.state,N&&Qm(n,u,!0),n.child}function qg(r){var n=r.stateNode;n.pendingContext?Xm(r,n.pendingContext,n.pendingContext!==n.context):n.context&&Xm(r,n.context,!1),rd(r,n.containerInfo)}function Yg(r,n,u,w,N){return mi(),Yu(N),n.flags|=256,tr(r,n,u,w),n.child}var _d={dehydrated:null,treeContext:null,retryLane:0};function wd(r){return{baseLanes:r,cachePool:null,transitions:null}}function Xg(r,n,u){var w=n.pendingProps,N=it.current,A=!1,I=(n.flags&128)!==0,X;if((X=I)||(X=r!==null&&r.memoizedState===null?!1:(N&2)!==0),X?(A=!0,n.flags&=-129):(r===null||r.memoizedState!==null)&&(N|=1),Qe(it,N&1),r===null)return qu(n),r=n.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((n.mode&1)===0?n.lanes=1:r.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(I=w.children,r=w.fallback,A?(w=n.mode,A=n.child,I={mode:"hidden",children:I},(w&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=I):A=Rl(I,w,0,null),r=In(r,w,u,null),A.return=n,r.return=n,A.sibling=r,n.child=A,n.child.memoizedState=wd(u),n.memoizedState=_d,r):bd(n,I));if(N=r.memoizedState,N!==null&&(X=N.dehydrated,X!==null))return Gk(r,n,I,w,X,N,u);if(A){A=w.fallback,I=n.mode,N=r.child,X=N.sibling;var Q={mode:"hidden",children:w.children};return(I&1)===0&&n.child!==N?(w=n.child,w.childLanes=0,w.pendingProps=Q,n.deletions=null):(w=an(N,Q),w.subtreeFlags=N.subtreeFlags&14680064),X!==null?A=an(X,A):(A=In(A,I,u,null),A.flags|=2),A.return=n,w.return=n,w.sibling=A,n.child=w,w=A,A=n.child,I=r.child.memoizedState,I=I===null?wd(u):{baseLanes:I.baseLanes|u,cachePool:null,transitions:I.transitions},A.memoizedState=I,A.childLanes=r.childLanes&~u,n.memoizedState=_d,w}return A=r.child,r=A.sibling,w=an(A,{mode:"visible",children:w.children}),(n.mode&1)===0&&(w.lanes=u),w.return=n,w.sibling=null,r!==null&&(u=n.deletions,u===null?(n.deletions=[r],n.flags|=16):u.push(r)),n.child=w,n.memoizedState=null,w}function bd(r,n){return n=Rl({mode:"visible",children:n},r.mode,0,null),n.return=r,r.child=n}function vl(r,n,u,w){return w!==null&&Yu(w),gi(n,r.child,null,u),r=bd(n,n.pendingProps.children),r.flags|=2,n.memoizedState=null,r}function Gk(r,n,u,w,N,A,I){if(u)return n.flags&256?(n.flags&=-257,w=gd(Error(s(422))),vl(r,n,I,w)):n.memoizedState!==null?(n.child=r.child,n.flags|=128,null):(A=w.fallback,N=n.mode,w=Rl({mode:"visible",children:w.children},N,0,null),A=In(A,N,I,null),A.flags|=2,w.return=n,A.return=n,w.sibling=A,n.child=w,(n.mode&1)!==0&&gi(n,r.child,null,I),n.child.memoizedState=wd(I),n.memoizedState=_d,A);if((n.mode&1)===0)return vl(r,n,I,null);if(N.data==="$!"){if(w=N.nextSibling&&N.nextSibling.dataset,w)var X=w.dgst;return w=X,A=Error(s(419)),w=gd(A,w,void 0),vl(r,n,I,w)}if(X=(I&r.childLanes)!==0,lr||X){if(w=Pt,w!==null){switch(I&-I){case 4:N=2;break;case 16:N=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:N=32;break;case 536870912:N=268435456;break;default:N=0}N=(N&(w.suspendedLanes|I))!==0?0:N,N!==0&&N!==A.retryLane&&(A.retryLane=N,Cs(r,N),qr(w,r,N,-1))}return Bd(),w=gd(Error(s(421))),vl(r,n,I,w)}return N.data==="$?"?(n.flags|=128,n.child=r.child,n=o2.bind(null,r),N._reactRetry=n,null):(r=A.treeContext,wr=Ys(N.nextSibling),_r=n,nt=!0,Wr=null,r!==null&&(Tr[Ar++]=bs,Tr[Ar++]=Ss,Tr[Ar++]=Nn,bs=r.id,Ss=r.overflow,Nn=n),n=bd(n,w.children),n.flags|=4096,n)}function Jg(r,n,u){r.lanes|=n;var w=r.alternate;w!==null&&(w.lanes|=n),Zu(r.return,n,u)}function Sd(r,n,u,w,N){var A=r.memoizedState;A===null?r.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:w,tail:u,tailMode:N}:(A.isBackwards=n,A.rendering=null,A.renderingStartTime=0,A.last=w,A.tail=u,A.tailMode=N)}function Qg(r,n,u){var w=n.pendingProps,N=w.revealOrder,A=w.tail;if(tr(r,n,w.children,u),w=it.current,(w&2)!==0)w=w&1|2,n.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=n.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Jg(r,u,n);else if(r.tag===19)Jg(r,u,n);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}w&=1}if(Qe(it,w),(n.mode&1)===0)n.memoizedState=null;else switch(N){case"forwards":for(u=n.child,N=null;u!==null;)r=u.alternate,r!==null&&ul(r)===null&&(N=u),u=u.sibling;u=N,u===null?(N=n.child,n.child=null):(N=u.sibling,u.sibling=null),Sd(n,!1,N,u,A);break;case"backwards":for(u=null,N=n.child,n.child=null;N!==null;){if(r=N.alternate,r!==null&&ul(r)===null){n.child=N;break}r=N.sibling,N.sibling=u,u=N,N=r}Sd(n,!0,u,null,A);break;case"together":Sd(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function yl(r,n){(n.mode&1)===0&&r!==null&&(r.alternate=null,n.alternate=null,n.flags|=2)}function Es(r,n,u){if(r!==null&&(n.dependencies=r.dependencies),Dn|=n.lanes,(u&n.childLanes)===0)return null;if(r!==null&&n.child!==r.child)throw Error(s(153));if(n.child!==null){for(r=n.child,u=an(r,r.pendingProps),n.child=u,u.return=n;r.sibling!==null;)r=r.sibling,u=u.sibling=an(r,r.pendingProps),u.return=n;u.sibling=null}return n.child}function qk(r,n,u){switch(n.tag){case 3:qg(n),mi();break;case 5:hg(n);break;case 1:ar(n.type)&&el(n);break;case 4:rd(n,n.stateNode.containerInfo);break;case 10:var w=n.type._context,N=n.memoizedProps.value;Qe(ol,w._currentValue),w._currentValue=N;break;case 13:if(w=n.memoizedState,w!==null)return w.dehydrated!==null?(Qe(it,it.current&1),n.flags|=128,null):(u&n.child.childLanes)!==0?Xg(r,n,u):(Qe(it,it.current&1),r=Es(r,n,u),r!==null?r.sibling:null);Qe(it,it.current&1);break;case 19:if(w=(u&n.childLanes)!==0,(r.flags&128)!==0){if(w)return Qg(r,n,u);n.flags|=128}if(N=n.memoizedState,N!==null&&(N.rendering=null,N.tail=null,N.lastEffect=null),Qe(it,it.current),w)break;return null;case 22:case 23:return n.lanes=0,Ug(r,n,u)}return Es(r,n,u)}var Zg,Cd,ev,tv;Zg=function(r,n){for(var u=n.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===n)break;for(;u.sibling===null;){if(u.return===null||u.return===n)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},Cd=function(){},ev=function(r,n,u,w){var N=r.memoizedProps;if(N!==w){r=n.stateNode,Tn(is.current);var A=null;switch(u){case"input":N=He(r,N),w=He(r,w),A=[];break;case"select":N=B({},N,{value:void 0}),w=B({},w,{value:void 0}),A=[];break;case"textarea":N=Ie(r,N),w=Ie(r,w),A=[];break;default:typeof N.onClick!="function"&&typeof w.onClick=="function"&&(r.onclick=Ja)}ri(u,w);var I;u=null;for(oe in N)if(!w.hasOwnProperty(oe)&&N.hasOwnProperty(oe)&&N[oe]!=null)if(oe==="style"){var X=N[oe];for(I in X)X.hasOwnProperty(I)&&(u||(u={}),u[I]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(l.hasOwnProperty(oe)?A||(A=[]):(A=A||[]).push(oe,null));for(oe in w){var Q=w[oe];if(X=N!=null?N[oe]:void 0,w.hasOwnProperty(oe)&&Q!==X&&(Q!=null||X!=null))if(oe==="style")if(X){for(I in X)!X.hasOwnProperty(I)||Q&&Q.hasOwnProperty(I)||(u||(u={}),u[I]="");for(I in Q)Q.hasOwnProperty(I)&&X[I]!==Q[I]&&(u||(u={}),u[I]=Q[I])}else u||(A||(A=[]),A.push(oe,u)),u=Q;else oe==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,X=X?X.__html:void 0,Q!=null&&X!==Q&&(A=A||[]).push(oe,Q)):oe==="children"?typeof Q!="string"&&typeof Q!="number"||(A=A||[]).push(oe,""+Q):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(l.hasOwnProperty(oe)?(Q!=null&&oe==="onScroll"&&tt("scroll",r),A||X===Q||(A=[])):(A=A||[]).push(oe,Q))}u&&(A=A||[]).push("style",u);var oe=A;(n.updateQueue=oe)&&(n.flags|=4)}},tv=function(r,n,u,w){u!==w&&(n.flags|=4)};function Do(r,n){if(!nt)switch(r.tailMode){case"hidden":n=r.tail;for(var u=null;n!==null;)n.alternate!==null&&(u=n),n=n.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var w=null;u!==null;)u.alternate!==null&&(w=u),u=u.sibling;w===null?n||r.tail===null?r.tail=null:r.tail.sibling=null:w.sibling=null}}function Kt(r){var n=r.alternate!==null&&r.alternate.child===r.child,u=0,w=0;if(n)for(var N=r.child;N!==null;)u|=N.lanes|N.childLanes,w|=N.subtreeFlags&14680064,w|=N.flags&14680064,N.return=r,N=N.sibling;else for(N=r.child;N!==null;)u|=N.lanes|N.childLanes,w|=N.subtreeFlags,w|=N.flags,N.return=r,N=N.sibling;return r.subtreeFlags|=w,r.childLanes=u,n}function Yk(r,n,u){var w=n.pendingProps;switch(Ku(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(n),null;case 1:return ar(n.type)&&Za(),Kt(n),null;case 3:return w=n.stateNode,xi(),rt(or),rt(Wt),id(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(r===null||r.child===null)&&(nl(n)?n.flags|=4:r===null||r.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Wr!==null&&(Ld(Wr),Wr=null))),Cd(r,n),Kt(n),null;case 5:sd(n);var N=Tn(No.current);if(u=n.type,r!==null&&n.stateNode!=null)ev(r,n,u,w,N),r.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!w){if(n.stateNode===null)throw Error(s(166));return Kt(n),null}if(r=Tn(is.current),nl(n)){w=n.stateNode,u=n.type;var A=n.memoizedProps;switch(w[ns]=n,w[So]=A,r=(n.mode&1)!==0,u){case"dialog":tt("cancel",w),tt("close",w);break;case"iframe":case"object":case"embed":tt("load",w);break;case"video":case"audio":for(N=0;N<_o.length;N++)tt(_o[N],w);break;case"source":tt("error",w);break;case"img":case"image":case"link":tt("error",w),tt("load",w);break;case"details":tt("toggle",w);break;case"input":Ue(w,A),tt("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!A.multiple},tt("invalid",w);break;case"textarea":Fe(w,A),tt("invalid",w)}ri(u,A),N=null;for(var I in A)if(A.hasOwnProperty(I)){var X=A[I];I==="children"?typeof X=="string"?w.textContent!==X&&(A.suppressHydrationWarning!==!0&&Xa(w.textContent,X,r),N=["children",X]):typeof X=="number"&&w.textContent!==""+X&&(A.suppressHydrationWarning!==!0&&Xa(w.textContent,X,r),N=["children",""+X]):l.hasOwnProperty(I)&&X!=null&&I==="onScroll"&&tt("scroll",w)}switch(u){case"input":ie(w),Ht(w,A,!0);break;case"textarea":ie(w),ct(w);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(w.onclick=Ja)}w=N,n.updateQueue=w,w!==null&&(n.flags|=4)}else{I=N.nodeType===9?N:N.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=vr(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=I.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof w.is=="string"?r=I.createElement(u,{is:w.is}):(r=I.createElement(u),u==="select"&&(I=r,w.multiple?I.multiple=!0:w.size&&(I.size=w.size))):r=I.createElementNS(r,u),r[ns]=n,r[So]=w,Zg(r,n,!1,!1),n.stateNode=r;e:{switch(I=to(u,w),u){case"dialog":tt("cancel",r),tt("close",r),N=w;break;case"iframe":case"object":case"embed":tt("load",r),N=w;break;case"video":case"audio":for(N=0;N<_o.length;N++)tt(_o[N],r);N=w;break;case"source":tt("error",r),N=w;break;case"img":case"image":case"link":tt("error",r),tt("load",r),N=w;break;case"details":tt("toggle",r),N=w;break;case"input":Ue(r,w),N=He(r,w),tt("invalid",r);break;case"option":N=w;break;case"select":r._wrapperState={wasMultiple:!!w.multiple},N=B({},w,{value:void 0}),tt("invalid",r);break;case"textarea":Fe(r,w),N=Ie(r,w),tt("invalid",r);break;default:N=w}ri(u,N),X=N;for(A in X)if(X.hasOwnProperty(A)){var Q=X[A];A==="style"?Ra(r,Q):A==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&Hr(r,Q)):A==="children"?typeof Q=="string"?(u!=="textarea"||Q!=="")&&ht(r,Q):typeof Q=="number"&&ht(r,""+Q):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(l.hasOwnProperty(A)?Q!=null&&A==="onScroll"&&tt("scroll",r):Q!=null&&x(r,A,Q,I))}switch(u){case"input":ie(r),Ht(r,w,!1);break;case"textarea":ie(r),ct(r);break;case"option":w.value!=null&&r.setAttribute("value",""+D(w.value));break;case"select":r.multiple=!!w.multiple,A=w.value,A!=null?Ae(r,!!w.multiple,A,!1):w.defaultValue!=null&&Ae(r,!!w.multiple,w.defaultValue,!0);break;default:typeof N.onClick=="function"&&(r.onclick=Ja)}switch(u){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Kt(n),null;case 6:if(r&&n.stateNode!=null)tv(r,n,r.memoizedProps,w);else{if(typeof w!="string"&&n.stateNode===null)throw Error(s(166));if(u=Tn(No.current),Tn(is.current),nl(n)){if(w=n.stateNode,u=n.memoizedProps,w[ns]=n,(A=w.nodeValue!==u)&&(r=_r,r!==null))switch(r.tag){case 3:Xa(w.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Xa(w.nodeValue,u,(r.mode&1)!==0)}A&&(n.flags|=4)}else w=(u.nodeType===9?u:u.ownerDocument).createTextNode(w),w[ns]=n,n.stateNode=w}return Kt(n),null;case 13:if(rt(it),w=n.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(nt&&wr!==null&&(n.mode&1)!==0&&(n.flags&128)===0)ng(),mi(),n.flags|=98560,A=!1;else if(A=nl(n),w!==null&&w.dehydrated!==null){if(r===null){if(!A)throw Error(s(318));if(A=n.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(s(317));A[ns]=n}else mi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Kt(n),A=!1}else Wr!==null&&(Ld(Wr),Wr=null),A=!0;if(!A)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=u,n):(w=w!==null,w!==(r!==null&&r.memoizedState!==null)&&w&&(n.child.flags|=8192,(n.mode&1)!==0&&(r===null||(it.current&1)!==0?St===0&&(St=3):Bd())),n.updateQueue!==null&&(n.flags|=4),Kt(n),null);case 4:return xi(),Cd(r,n),r===null&&wo(n.stateNode.containerInfo),Kt(n),null;case 10:return Qu(n.type._context),Kt(n),null;case 17:return ar(n.type)&&Za(),Kt(n),null;case 19:if(rt(it),A=n.memoizedState,A===null)return Kt(n),null;if(w=(n.flags&128)!==0,I=A.rendering,I===null)if(w)Do(A,!1);else{if(St!==0||r!==null&&(r.flags&128)!==0)for(r=n.child;r!==null;){if(I=ul(r),I!==null){for(n.flags|=128,Do(A,!1),w=I.updateQueue,w!==null&&(n.updateQueue=w,n.flags|=4),n.subtreeFlags=0,w=u,u=n.child;u!==null;)A=u,r=w,A.flags&=14680066,I=A.alternate,I===null?(A.childLanes=0,A.lanes=r,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=I.childLanes,A.lanes=I.lanes,A.child=I.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=I.memoizedProps,A.memoizedState=I.memoizedState,A.updateQueue=I.updateQueue,A.type=I.type,r=I.dependencies,A.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return Qe(it,it.current&1|2),n.child}r=r.sibling}A.tail!==null&&pt()>Si&&(n.flags|=128,w=!0,Do(A,!1),n.lanes=4194304)}else{if(!w)if(r=ul(I),r!==null){if(n.flags|=128,w=!0,u=r.updateQueue,u!==null&&(n.updateQueue=u,n.flags|=4),Do(A,!0),A.tail===null&&A.tailMode==="hidden"&&!I.alternate&&!nt)return Kt(n),null}else 2*pt()-A.renderingStartTime>Si&&u!==1073741824&&(n.flags|=128,w=!0,Do(A,!1),n.lanes=4194304);A.isBackwards?(I.sibling=n.child,n.child=I):(u=A.last,u!==null?u.sibling=I:n.child=I,A.last=I)}return A.tail!==null?(n=A.tail,A.rendering=n,A.tail=n.sibling,A.renderingStartTime=pt(),n.sibling=null,u=it.current,Qe(it,w?u&1|2:u&1),n):(Kt(n),null);case 22:case 23:return Id(),w=n.memoizedState!==null,r!==null&&r.memoizedState!==null!==w&&(n.flags|=8192),w&&(n.mode&1)!==0?(br&1073741824)!==0&&(Kt(n),n.subtreeFlags&6&&(n.flags|=8192)):Kt(n),null;case 24:return null;case 25:return null}throw Error(s(156,n.tag))}function Xk(r,n){switch(Ku(n),n.tag){case 1:return ar(n.type)&&Za(),r=n.flags,r&65536?(n.flags=r&-65537|128,n):null;case 3:return xi(),rt(or),rt(Wt),id(),r=n.flags,(r&65536)!==0&&(r&128)===0?(n.flags=r&-65537|128,n):null;case 5:return sd(n),null;case 13:if(rt(it),r=n.memoizedState,r!==null&&r.dehydrated!==null){if(n.alternate===null)throw Error(s(340));mi()}return r=n.flags,r&65536?(n.flags=r&-65537|128,n):null;case 19:return rt(it),null;case 4:return xi(),null;case 10:return Qu(n.type._context),null;case 22:case 23:return Id(),null;case 24:return null;default:return null}}var xl=!1,Gt=!1,Jk=typeof WeakSet=="function"?WeakSet:Set,we=null;function wi(r,n){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(w){ut(r,n,w)}else u.current=null}function kd(r,n,u){try{u()}catch(w){ut(r,n,w)}}var rv=!1;function Qk(r,n){if(Iu=Fa,r=Mm(),Pu(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var w=u.getSelection&&u.getSelection();if(w&&w.rangeCount!==0){u=w.anchorNode;var N=w.anchorOffset,A=w.focusNode;w=w.focusOffset;try{u.nodeType,A.nodeType}catch{u=null;break e}var I=0,X=-1,Q=-1,oe=0,fe=0,pe=r,he=null;t:for(;;){for(var _e;pe!==u||N!==0&&pe.nodeType!==3||(X=I+N),pe!==A||w!==0&&pe.nodeType!==3||(Q=I+w),pe.nodeType===3&&(I+=pe.nodeValue.length),(_e=pe.firstChild)!==null;)he=pe,pe=_e;for(;;){if(pe===r)break t;if(he===u&&++oe===N&&(X=I),he===A&&++fe===w&&(Q=I),(_e=pe.nextSibling)!==null)break;pe=he,he=pe.parentNode}pe=_e}u=X===-1||Q===-1?null:{start:X,end:Q}}else u=null}u=u||{start:0,end:0}}else u=null;for(Bu={focusedElem:r,selectionRange:u},Fa=!1,we=n;we!==null;)if(n=we,r=n.child,(n.subtreeFlags&1028)!==0&&r!==null)r.return=n,we=r;else for(;we!==null;){n=we;try{var Se=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var je=Se.memoizedProps,mt=Se.memoizedState,se=n.stateNode,te=se.getSnapshotBeforeUpdate(n.elementType===n.type?je:Ur(n.type,je),mt);se.__reactInternalSnapshotBeforeUpdate=te}break;case 3:var ne=n.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(me){ut(n,n.return,me)}if(r=n.sibling,r!==null){r.return=n.return,we=r;break}we=n.return}return Se=rv,rv=!1,Se}function Mo(r,n,u){var w=n.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var N=w=w.next;do{if((N.tag&r)===r){var A=N.destroy;N.destroy=void 0,A!==void 0&&kd(n,u,A)}N=N.next}while(N!==w)}}function _l(r,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var u=n=n.next;do{if((u.tag&r)===r){var w=u.create;u.destroy=w()}u=u.next}while(u!==n)}}function Ed(r){var n=r.ref;if(n!==null){var u=r.stateNode;switch(r.tag){case 5:r=u;break;default:r=u}typeof n=="function"?n(r):n.current=r}}function sv(r){var n=r.alternate;n!==null&&(r.alternate=null,sv(n)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(n=r.stateNode,n!==null&&(delete n[ns],delete n[So],delete n[Vu],delete n[Mk],delete n[Lk])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function nv(r){return r.tag===5||r.tag===3||r.tag===4}function iv(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||nv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function jd(r,n,u){var w=r.tag;if(w===5||w===6)r=r.stateNode,n?u.nodeType===8?u.parentNode.insertBefore(r,n):u.insertBefore(r,n):(u.nodeType===8?(n=u.parentNode,n.insertBefore(r,u)):(n=u,n.appendChild(r)),u=u._reactRootContainer,u!=null||n.onclick!==null||(n.onclick=Ja));else if(w!==4&&(r=r.child,r!==null))for(jd(r,n,u),r=r.sibling;r!==null;)jd(r,n,u),r=r.sibling}function Nd(r,n,u){var w=r.tag;if(w===5||w===6)r=r.stateNode,n?u.insertBefore(r,n):u.appendChild(r);else if(w!==4&&(r=r.child,r!==null))for(Nd(r,n,u),r=r.sibling;r!==null;)Nd(r,n,u),r=r.sibling}var Lt=null,Kr=!1;function tn(r,n,u){for(u=u.child;u!==null;)ov(r,n,u),u=u.sibling}function ov(r,n,u){if(ss&&typeof ss.onCommitFiberUnmount=="function")try{ss.onCommitFiberUnmount(Da,u)}catch{}switch(u.tag){case 5:Gt||wi(u,n);case 6:var w=Lt,N=Kr;Lt=null,tn(r,n,u),Lt=w,Kr=N,Lt!==null&&(Kr?(r=Lt,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):Lt.removeChild(u.stateNode));break;case 18:Lt!==null&&(Kr?(r=Lt,u=u.stateNode,r.nodeType===8?Hu(r.parentNode,u):r.nodeType===1&&Hu(r,u),ho(r)):Hu(Lt,u.stateNode));break;case 4:w=Lt,N=Kr,Lt=u.stateNode.containerInfo,Kr=!0,tn(r,n,u),Lt=w,Kr=N;break;case 0:case 11:case 14:case 15:if(!Gt&&(w=u.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){N=w=w.next;do{var A=N,I=A.destroy;A=A.tag,I!==void 0&&((A&2)!==0||(A&4)!==0)&&kd(u,n,I),N=N.next}while(N!==w)}tn(r,n,u);break;case 1:if(!Gt&&(wi(u,n),w=u.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=u.memoizedProps,w.state=u.memoizedState,w.componentWillUnmount()}catch(X){ut(u,n,X)}tn(r,n,u);break;case 21:tn(r,n,u);break;case 22:u.mode&1?(Gt=(w=Gt)||u.memoizedState!==null,tn(r,n,u),Gt=w):tn(r,n,u);break;default:tn(r,n,u)}}function av(r){var n=r.updateQueue;if(n!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new Jk),n.forEach(function(w){var N=a2.bind(null,r,w);u.has(w)||(u.add(w),w.then(N,N))})}}function Gr(r,n){var u=n.deletions;if(u!==null)for(var w=0;w<u.length;w++){var N=u[w];try{var A=r,I=n,X=I;e:for(;X!==null;){switch(X.tag){case 5:Lt=X.stateNode,Kr=!1;break e;case 3:Lt=X.stateNode.containerInfo,Kr=!0;break e;case 4:Lt=X.stateNode.containerInfo,Kr=!0;break e}X=X.return}if(Lt===null)throw Error(s(160));ov(A,I,N),Lt=null,Kr=!1;var Q=N.alternate;Q!==null&&(Q.return=null),N.return=null}catch(oe){ut(N,n,oe)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)lv(n,r),n=n.sibling}function lv(r,n){var u=r.alternate,w=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Gr(n,r),as(r),w&4){try{Mo(3,r,r.return),_l(3,r)}catch(je){ut(r,r.return,je)}try{Mo(5,r,r.return)}catch(je){ut(r,r.return,je)}}break;case 1:Gr(n,r),as(r),w&512&&u!==null&&wi(u,u.return);break;case 5:if(Gr(n,r),as(r),w&512&&u!==null&&wi(u,u.return),r.flags&32){var N=r.stateNode;try{ht(N,"")}catch(je){ut(r,r.return,je)}}if(w&4&&(N=r.stateNode,N!=null)){var A=r.memoizedProps,I=u!==null?u.memoizedProps:A,X=r.type,Q=r.updateQueue;if(r.updateQueue=null,Q!==null)try{X==="input"&&A.type==="radio"&&A.name!=null&&Xe(N,A),to(X,I);var oe=to(X,A);for(I=0;I<Q.length;I+=2){var fe=Q[I],pe=Q[I+1];fe==="style"?Ra(N,pe):fe==="dangerouslySetInnerHTML"?Hr(N,pe):fe==="children"?ht(N,pe):x(N,fe,pe,oe)}switch(X){case"input":Ee(N,A);break;case"textarea":Et(N,A);break;case"select":var he=N._wrapperState.wasMultiple;N._wrapperState.wasMultiple=!!A.multiple;var _e=A.value;_e!=null?Ae(N,!!A.multiple,_e,!1):he!==!!A.multiple&&(A.defaultValue!=null?Ae(N,!!A.multiple,A.defaultValue,!0):Ae(N,!!A.multiple,A.multiple?[]:"",!1))}N[So]=A}catch(je){ut(r,r.return,je)}}break;case 6:if(Gr(n,r),as(r),w&4){if(r.stateNode===null)throw Error(s(162));N=r.stateNode,A=r.memoizedProps;try{N.nodeValue=A}catch(je){ut(r,r.return,je)}}break;case 3:if(Gr(n,r),as(r),w&4&&u!==null&&u.memoizedState.isDehydrated)try{ho(n.containerInfo)}catch(je){ut(r,r.return,je)}break;case 4:Gr(n,r),as(r);break;case 13:Gr(n,r),as(r),N=r.child,N.flags&8192&&(A=N.memoizedState!==null,N.stateNode.isHidden=A,!A||N.alternate!==null&&N.alternate.memoizedState!==null||(Td=pt())),w&4&&av(r);break;case 22:if(fe=u!==null&&u.memoizedState!==null,r.mode&1?(Gt=(oe=Gt)||fe,Gr(n,r),Gt=oe):Gr(n,r),as(r),w&8192){if(oe=r.memoizedState!==null,(r.stateNode.isHidden=oe)&&!fe&&(r.mode&1)!==0)for(we=r,fe=r.child;fe!==null;){for(pe=we=fe;we!==null;){switch(he=we,_e=he.child,he.tag){case 0:case 11:case 14:case 15:Mo(4,he,he.return);break;case 1:wi(he,he.return);var Se=he.stateNode;if(typeof Se.componentWillUnmount=="function"){w=he,u=he.return;try{n=w,Se.props=n.memoizedProps,Se.state=n.memoizedState,Se.componentWillUnmount()}catch(je){ut(w,u,je)}}break;case 5:wi(he,he.return);break;case 22:if(he.memoizedState!==null){dv(pe);continue}}_e!==null?(_e.return=he,we=_e):dv(pe)}fe=fe.sibling}e:for(fe=null,pe=r;;){if(pe.tag===5){if(fe===null){fe=pe;try{N=pe.stateNode,oe?(A=N.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(X=pe.stateNode,Q=pe.memoizedProps.style,I=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,X.style.display=ti("display",I))}catch(je){ut(r,r.return,je)}}}else if(pe.tag===6){if(fe===null)try{pe.stateNode.nodeValue=oe?"":pe.memoizedProps}catch(je){ut(r,r.return,je)}}else if((pe.tag!==22&&pe.tag!==23||pe.memoizedState===null||pe===r)&&pe.child!==null){pe.child.return=pe,pe=pe.child;continue}if(pe===r)break e;for(;pe.sibling===null;){if(pe.return===null||pe.return===r)break e;fe===pe&&(fe=null),pe=pe.return}fe===pe&&(fe=null),pe.sibling.return=pe.return,pe=pe.sibling}}break;case 19:Gr(n,r),as(r),w&4&&av(r);break;case 21:break;default:Gr(n,r),as(r)}}function as(r){var n=r.flags;if(n&2){try{e:{for(var u=r.return;u!==null;){if(nv(u)){var w=u;break e}u=u.return}throw Error(s(160))}switch(w.tag){case 5:var N=w.stateNode;w.flags&32&&(ht(N,""),w.flags&=-33);var A=iv(r);Nd(r,A,N);break;case 3:case 4:var I=w.stateNode.containerInfo,X=iv(r);jd(r,X,I);break;default:throw Error(s(161))}}catch(Q){ut(r,r.return,Q)}r.flags&=-3}n&4096&&(r.flags&=-4097)}function Zk(r,n,u){we=r,cv(r)}function cv(r,n,u){for(var w=(r.mode&1)!==0;we!==null;){var N=we,A=N.child;if(N.tag===22&&w){var I=N.memoizedState!==null||xl;if(!I){var X=N.alternate,Q=X!==null&&X.memoizedState!==null||Gt;X=xl;var oe=Gt;if(xl=I,(Gt=Q)&&!oe)for(we=N;we!==null;)I=we,Q=I.child,I.tag===22&&I.memoizedState!==null?hv(N):Q!==null?(Q.return=I,we=Q):hv(N);for(;A!==null;)we=A,cv(A),A=A.sibling;we=N,xl=X,Gt=oe}uv(r)}else(N.subtreeFlags&8772)!==0&&A!==null?(A.return=N,we=A):uv(r)}}function uv(r){for(;we!==null;){var n=we;if((n.flags&8772)!==0){var u=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:Gt||_l(5,n);break;case 1:var w=n.stateNode;if(n.flags&4&&!Gt)if(u===null)w.componentDidMount();else{var N=n.elementType===n.type?u.memoizedProps:Ur(n.type,u.memoizedProps);w.componentDidUpdate(N,u.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var A=n.updateQueue;A!==null&&dg(n,A,w);break;case 3:var I=n.updateQueue;if(I!==null){if(u=null,n.child!==null)switch(n.child.tag){case 5:u=n.child.stateNode;break;case 1:u=n.child.stateNode}dg(n,I,u)}break;case 5:var X=n.stateNode;if(u===null&&n.flags&4){u=X;var Q=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&u.focus();break;case"img":Q.src&&(u.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var oe=n.alternate;if(oe!==null){var fe=oe.memoizedState;if(fe!==null){var pe=fe.dehydrated;pe!==null&&ho(pe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Gt||n.flags&512&&Ed(n)}catch(he){ut(n,n.return,he)}}if(n===r){we=null;break}if(u=n.sibling,u!==null){u.return=n.return,we=u;break}we=n.return}}function dv(r){for(;we!==null;){var n=we;if(n===r){we=null;break}var u=n.sibling;if(u!==null){u.return=n.return,we=u;break}we=n.return}}function hv(r){for(;we!==null;){var n=we;try{switch(n.tag){case 0:case 11:case 15:var u=n.return;try{_l(4,n)}catch(Q){ut(n,u,Q)}break;case 1:var w=n.stateNode;if(typeof w.componentDidMount=="function"){var N=n.return;try{w.componentDidMount()}catch(Q){ut(n,N,Q)}}var A=n.return;try{Ed(n)}catch(Q){ut(n,A,Q)}break;case 5:var I=n.return;try{Ed(n)}catch(Q){ut(n,I,Q)}}}catch(Q){ut(n,n.return,Q)}if(n===r){we=null;break}var X=n.sibling;if(X!==null){X.return=n.return,we=X;break}we=n.return}}var e2=Math.ceil,wl=k.ReactCurrentDispatcher,Pd=k.ReactCurrentOwner,Lr=k.ReactCurrentBatchConfig,Ke=0,Pt=null,xt=null,Ot=0,br=0,bi=Xs(0),St=0,Lo=null,Dn=0,bl=0,Rd=0,Oo=null,cr=null,Td=0,Si=1/0,js=null,Sl=!1,Ad=null,rn=null,Cl=!1,sn=null,kl=0,Io=0,Dd=null,El=-1,jl=0;function rr(){return(Ke&6)!==0?pt():El!==-1?El:El=pt()}function nn(r){return(r.mode&1)===0?1:(Ke&2)!==0&&Ot!==0?Ot&-Ot:Ik.transition!==null?(jl===0&&(jl=im()),jl):(r=Je,r!==0||(r=window.event,r=r===void 0?16:pm(r.type)),r)}function qr(r,n,u,w){if(50<Io)throw Io=0,Dd=null,Error(s(185));oo(r,u,w),((Ke&2)===0||r!==Pt)&&(r===Pt&&((Ke&2)===0&&(bl|=u),St===4&&on(r,Ot)),ur(r,w),u===1&&Ke===0&&(n.mode&1)===0&&(Si=pt()+500,tl&&Qs()))}function ur(r,n){var u=r.callbackNode;IC(r,n);var w=Oa(r,r===Pt?Ot:0);if(w===0)u!==null&&rm(u),r.callbackNode=null,r.callbackPriority=0;else if(n=w&-w,r.callbackPriority!==n){if(u!=null&&rm(u),n===1)r.tag===0?Ok(pv.bind(null,r)):Zm(pv.bind(null,r)),Ak(function(){(Ke&6)===0&&Qs()}),u=null;else{switch(om(w)){case 1:u=hu;break;case 4:u=sm;break;case 16:u=Aa;break;case 536870912:u=nm;break;default:u=Aa}u=bv(u,fv.bind(null,r))}r.callbackPriority=n,r.callbackNode=u}}function fv(r,n){if(El=-1,jl=0,(Ke&6)!==0)throw Error(s(327));var u=r.callbackNode;if(Ci()&&r.callbackNode!==u)return null;var w=Oa(r,r===Pt?Ot:0);if(w===0)return null;if((w&30)!==0||(w&r.expiredLanes)!==0||n)n=Nl(r,w);else{n=w;var N=Ke;Ke|=2;var A=gv();(Pt!==r||Ot!==n)&&(js=null,Si=pt()+500,Ln(r,n));do try{s2();break}catch(X){mv(r,X)}while(!0);Ju(),wl.current=A,Ke=N,xt!==null?n=0:(Pt=null,Ot=0,n=St)}if(n!==0){if(n===2&&(N=fu(r),N!==0&&(w=N,n=Md(r,N))),n===1)throw u=Lo,Ln(r,0),on(r,w),ur(r,pt()),u;if(n===6)on(r,w);else{if(N=r.current.alternate,(w&30)===0&&!t2(N)&&(n=Nl(r,w),n===2&&(A=fu(r),A!==0&&(w=A,n=Md(r,A))),n===1))throw u=Lo,Ln(r,0),on(r,w),ur(r,pt()),u;switch(r.finishedWork=N,r.finishedLanes=w,n){case 0:case 1:throw Error(s(345));case 2:On(r,cr,js);break;case 3:if(on(r,w),(w&130023424)===w&&(n=Td+500-pt(),10<n)){if(Oa(r,0)!==0)break;if(N=r.suspendedLanes,(N&w)!==w){rr(),r.pingedLanes|=r.suspendedLanes&N;break}r.timeoutHandle=$u(On.bind(null,r,cr,js),n);break}On(r,cr,js);break;case 4:if(on(r,w),(w&4194240)===w)break;for(n=r.eventTimes,N=-1;0<w;){var I=31-Vr(w);A=1<<I,I=n[I],I>N&&(N=I),w&=~A}if(w=N,w=pt()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*e2(w/1960))-w,10<w){r.timeoutHandle=$u(On.bind(null,r,cr,js),w);break}On(r,cr,js);break;case 5:On(r,cr,js);break;default:throw Error(s(329))}}}return ur(r,pt()),r.callbackNode===u?fv.bind(null,r):null}function Md(r,n){var u=Oo;return r.current.memoizedState.isDehydrated&&(Ln(r,n).flags|=256),r=Nl(r,n),r!==2&&(n=cr,cr=u,n!==null&&Ld(n)),r}function Ld(r){cr===null?cr=r:cr.push.apply(cr,r)}function t2(r){for(var n=r;;){if(n.flags&16384){var u=n.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var w=0;w<u.length;w++){var N=u[w],A=N.getSnapshot;N=N.value;try{if(!zr(A(),N))return!1}catch{return!1}}}if(u=n.child,n.subtreeFlags&16384&&u!==null)u.return=n,n=u;else{if(n===r)break;for(;n.sibling===null;){if(n.return===null||n.return===r)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function on(r,n){for(n&=~Rd,n&=~bl,r.suspendedLanes|=n,r.pingedLanes&=~n,r=r.expirationTimes;0<n;){var u=31-Vr(n),w=1<<u;r[u]=-1,n&=~w}}function pv(r){if((Ke&6)!==0)throw Error(s(327));Ci();var n=Oa(r,0);if((n&1)===0)return ur(r,pt()),null;var u=Nl(r,n);if(r.tag!==0&&u===2){var w=fu(r);w!==0&&(n=w,u=Md(r,w))}if(u===1)throw u=Lo,Ln(r,0),on(r,n),ur(r,pt()),u;if(u===6)throw Error(s(345));return r.finishedWork=r.current.alternate,r.finishedLanes=n,On(r,cr,js),ur(r,pt()),null}function Od(r,n){var u=Ke;Ke|=1;try{return r(n)}finally{Ke=u,Ke===0&&(Si=pt()+500,tl&&Qs())}}function Mn(r){sn!==null&&sn.tag===0&&(Ke&6)===0&&Ci();var n=Ke;Ke|=1;var u=Lr.transition,w=Je;try{if(Lr.transition=null,Je=1,r)return r()}finally{Je=w,Lr.transition=u,Ke=n,(Ke&6)===0&&Qs()}}function Id(){br=bi.current,rt(bi)}function Ln(r,n){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,Tk(u)),xt!==null)for(u=xt.return;u!==null;){var w=u;switch(Ku(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Za();break;case 3:xi(),rt(or),rt(Wt),id();break;case 5:sd(w);break;case 4:xi();break;case 13:rt(it);break;case 19:rt(it);break;case 10:Qu(w.type._context);break;case 22:case 23:Id()}u=u.return}if(Pt=r,xt=r=an(r.current,null),Ot=br=n,St=0,Lo=null,Rd=bl=Dn=0,cr=Oo=null,Rn!==null){for(n=0;n<Rn.length;n++)if(u=Rn[n],w=u.interleaved,w!==null){u.interleaved=null;var N=w.next,A=u.pending;if(A!==null){var I=A.next;A.next=N,w.next=I}u.pending=w}Rn=null}return r}function mv(r,n){do{var u=xt;try{if(Ju(),dl.current=ml,hl){for(var w=ot.memoizedState;w!==null;){var N=w.queue;N!==null&&(N.pending=null),w=w.next}hl=!1}if(An=0,Nt=bt=ot=null,Po=!1,Ro=0,Pd.current=null,u===null||u.return===null){St=1,Lo=n,xt=null;break}e:{var A=r,I=u.return,X=u,Q=n;if(n=Ot,X.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var oe=Q,fe=X,pe=fe.tag;if((fe.mode&1)===0&&(pe===0||pe===11||pe===15)){var he=fe.alternate;he?(fe.updateQueue=he.updateQueue,fe.memoizedState=he.memoizedState,fe.lanes=he.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var _e=$g(I);if(_e!==null){_e.flags&=-257,Hg(_e,I,X,A,n),_e.mode&1&&Fg(A,oe,n),n=_e,Q=oe;var Se=n.updateQueue;if(Se===null){var je=new Set;je.add(Q),n.updateQueue=je}else Se.add(Q);break e}else{if((n&1)===0){Fg(A,oe,n),Bd();break e}Q=Error(s(426))}}else if(nt&&X.mode&1){var mt=$g(I);if(mt!==null){(mt.flags&65536)===0&&(mt.flags|=256),Hg(mt,I,X,A,n),Yu(_i(Q,X));break e}}A=Q=_i(Q,X),St!==4&&(St=2),Oo===null?Oo=[A]:Oo.push(A),A=I;do{switch(A.tag){case 3:A.flags|=65536,n&=-n,A.lanes|=n;var se=Ig(A,Q,n);ug(A,se);break e;case 1:X=Q;var te=A.type,ne=A.stateNode;if((A.flags&128)===0&&(typeof te.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(rn===null||!rn.has(ne)))){A.flags|=65536,n&=-n,A.lanes|=n;var me=Bg(A,X,n);ug(A,me);break e}}A=A.return}while(A!==null)}yv(u)}catch(Ne){n=Ne,xt===u&&u!==null&&(xt=u=u.return);continue}break}while(!0)}function gv(){var r=wl.current;return wl.current=ml,r===null?ml:r}function Bd(){(St===0||St===3||St===2)&&(St=4),Pt===null||(Dn&268435455)===0&&(bl&268435455)===0||on(Pt,Ot)}function Nl(r,n){var u=Ke;Ke|=2;var w=gv();(Pt!==r||Ot!==n)&&(js=null,Ln(r,n));do try{r2();break}catch(N){mv(r,N)}while(!0);if(Ju(),Ke=u,wl.current=w,xt!==null)throw Error(s(261));return Pt=null,Ot=0,St}function r2(){for(;xt!==null;)vv(xt)}function s2(){for(;xt!==null&&!NC();)vv(xt)}function vv(r){var n=wv(r.alternate,r,br);r.memoizedProps=r.pendingProps,n===null?yv(r):xt=n,Pd.current=null}function yv(r){var n=r;do{var u=n.alternate;if(r=n.return,(n.flags&32768)===0){if(u=Yk(u,n,br),u!==null){xt=u;return}}else{if(u=Xk(u,n),u!==null){u.flags&=32767,xt=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{St=6,xt=null;return}}if(n=n.sibling,n!==null){xt=n;return}xt=n=r}while(n!==null);St===0&&(St=5)}function On(r,n,u){var w=Je,N=Lr.transition;try{Lr.transition=null,Je=1,n2(r,n,u,w)}finally{Lr.transition=N,Je=w}return null}function n2(r,n,u,w){do Ci();while(sn!==null);if((Ke&6)!==0)throw Error(s(327));u=r.finishedWork;var N=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(s(177));r.callbackNode=null,r.callbackPriority=0;var A=u.lanes|u.childLanes;if(BC(r,A),r===Pt&&(xt=Pt=null,Ot=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Cl||(Cl=!0,bv(Aa,function(){return Ci(),null})),A=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||A){A=Lr.transition,Lr.transition=null;var I=Je;Je=1;var X=Ke;Ke|=4,Pd.current=null,Qk(r,u),lv(u,r),Ck(Bu),Fa=!!Iu,Bu=Iu=null,r.current=u,Zk(u),PC(),Ke=X,Je=I,Lr.transition=A}else r.current=u;if(Cl&&(Cl=!1,sn=r,kl=N),A=r.pendingLanes,A===0&&(rn=null),AC(u.stateNode),ur(r,pt()),n!==null)for(w=r.onRecoverableError,u=0;u<n.length;u++)N=n[u],w(N.value,{componentStack:N.stack,digest:N.digest});if(Sl)throw Sl=!1,r=Ad,Ad=null,r;return(kl&1)!==0&&r.tag!==0&&Ci(),A=r.pendingLanes,(A&1)!==0?r===Dd?Io++:(Io=0,Dd=r):Io=0,Qs(),null}function Ci(){if(sn!==null){var r=om(kl),n=Lr.transition,u=Je;try{if(Lr.transition=null,Je=16>r?16:r,sn===null)var w=!1;else{if(r=sn,sn=null,kl=0,(Ke&6)!==0)throw Error(s(331));var N=Ke;for(Ke|=4,we=r.current;we!==null;){var A=we,I=A.child;if((we.flags&16)!==0){var X=A.deletions;if(X!==null){for(var Q=0;Q<X.length;Q++){var oe=X[Q];for(we=oe;we!==null;){var fe=we;switch(fe.tag){case 0:case 11:case 15:Mo(8,fe,A)}var pe=fe.child;if(pe!==null)pe.return=fe,we=pe;else for(;we!==null;){fe=we;var he=fe.sibling,_e=fe.return;if(sv(fe),fe===oe){we=null;break}if(he!==null){he.return=_e,we=he;break}we=_e}}}var Se=A.alternate;if(Se!==null){var je=Se.child;if(je!==null){Se.child=null;do{var mt=je.sibling;je.sibling=null,je=mt}while(je!==null)}}we=A}}if((A.subtreeFlags&2064)!==0&&I!==null)I.return=A,we=I;else e:for(;we!==null;){if(A=we,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:Mo(9,A,A.return)}var se=A.sibling;if(se!==null){se.return=A.return,we=se;break e}we=A.return}}var te=r.current;for(we=te;we!==null;){I=we;var ne=I.child;if((I.subtreeFlags&2064)!==0&&ne!==null)ne.return=I,we=ne;else e:for(I=te;we!==null;){if(X=we,(X.flags&2048)!==0)try{switch(X.tag){case 0:case 11:case 15:_l(9,X)}}catch(Ne){ut(X,X.return,Ne)}if(X===I){we=null;break e}var me=X.sibling;if(me!==null){me.return=X.return,we=me;break e}we=X.return}}if(Ke=N,Qs(),ss&&typeof ss.onPostCommitFiberRoot=="function")try{ss.onPostCommitFiberRoot(Da,r)}catch{}w=!0}return w}finally{Je=u,Lr.transition=n}}return!1}function xv(r,n,u){n=_i(u,n),n=Ig(r,n,1),r=en(r,n,1),n=rr(),r!==null&&(oo(r,1,n),ur(r,n))}function ut(r,n,u){if(r.tag===3)xv(r,r,u);else for(;n!==null;){if(n.tag===3){xv(n,r,u);break}else if(n.tag===1){var w=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(rn===null||!rn.has(w))){r=_i(u,r),r=Bg(n,r,1),n=en(n,r,1),r=rr(),n!==null&&(oo(n,1,r),ur(n,r));break}}n=n.return}}function i2(r,n,u){var w=r.pingCache;w!==null&&w.delete(n),n=rr(),r.pingedLanes|=r.suspendedLanes&u,Pt===r&&(Ot&u)===u&&(St===4||St===3&&(Ot&130023424)===Ot&&500>pt()-Td?Ln(r,0):Rd|=u),ur(r,n)}function _v(r,n){n===0&&((r.mode&1)===0?n=1:(n=La,La<<=1,(La&130023424)===0&&(La=4194304)));var u=rr();r=Cs(r,n),r!==null&&(oo(r,n,u),ur(r,u))}function o2(r){var n=r.memoizedState,u=0;n!==null&&(u=n.retryLane),_v(r,u)}function a2(r,n){var u=0;switch(r.tag){case 13:var w=r.stateNode,N=r.memoizedState;N!==null&&(u=N.retryLane);break;case 19:w=r.stateNode;break;default:throw Error(s(314))}w!==null&&w.delete(n),_v(r,u)}var wv;wv=function(r,n,u){if(r!==null)if(r.memoizedProps!==n.pendingProps||or.current)lr=!0;else{if((r.lanes&u)===0&&(n.flags&128)===0)return lr=!1,qk(r,n,u);lr=(r.flags&131072)!==0}else lr=!1,nt&&(n.flags&1048576)!==0&&eg(n,sl,n.index);switch(n.lanes=0,n.tag){case 2:var w=n.type;yl(r,n),r=n.pendingProps;var N=hi(n,Wt.current);yi(n,u),N=ld(null,n,w,r,N,u);var A=cd();return n.flags|=1,typeof N=="object"&&N!==null&&typeof N.render=="function"&&N.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,ar(w)?(A=!0,el(n)):A=!1,n.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,td(n),N.updater=gl,n.stateNode=N,N._reactInternals=n,md(n,w,r,u),n=xd(null,n,w,!0,A,u)):(n.tag=0,nt&&A&&Uu(n),tr(null,n,N,u),n=n.child),n;case 16:w=n.elementType;e:{switch(yl(r,n),r=n.pendingProps,N=w._init,w=N(w._payload),n.type=w,N=n.tag=c2(w),r=Ur(w,r),N){case 0:n=yd(null,n,w,r,u);break e;case 1:n=Gg(null,n,w,r,u);break e;case 11:n=Vg(null,n,w,r,u);break e;case 14:n=zg(null,n,w,Ur(w.type,r),u);break e}throw Error(s(306,w,""))}return n;case 0:return w=n.type,N=n.pendingProps,N=n.elementType===w?N:Ur(w,N),yd(r,n,w,N,u);case 1:return w=n.type,N=n.pendingProps,N=n.elementType===w?N:Ur(w,N),Gg(r,n,w,N,u);case 3:e:{if(qg(n),r===null)throw Error(s(387));w=n.pendingProps,A=n.memoizedState,N=A.element,cg(r,n),cl(n,w,null,u);var I=n.memoizedState;if(w=I.element,A.isDehydrated)if(A={element:w,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},n.updateQueue.baseState=A,n.memoizedState=A,n.flags&256){N=_i(Error(s(423)),n),n=Yg(r,n,w,u,N);break e}else if(w!==N){N=_i(Error(s(424)),n),n=Yg(r,n,w,u,N);break e}else for(wr=Ys(n.stateNode.containerInfo.firstChild),_r=n,nt=!0,Wr=null,u=ag(n,null,w,u),n.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(mi(),w===N){n=Es(r,n,u);break e}tr(r,n,w,u)}n=n.child}return n;case 5:return hg(n),r===null&&qu(n),w=n.type,N=n.pendingProps,A=r!==null?r.memoizedProps:null,I=N.children,Fu(w,N)?I=null:A!==null&&Fu(w,A)&&(n.flags|=32),Kg(r,n),tr(r,n,I,u),n.child;case 6:return r===null&&qu(n),null;case 13:return Xg(r,n,u);case 4:return rd(n,n.stateNode.containerInfo),w=n.pendingProps,r===null?n.child=gi(n,null,w,u):tr(r,n,w,u),n.child;case 11:return w=n.type,N=n.pendingProps,N=n.elementType===w?N:Ur(w,N),Vg(r,n,w,N,u);case 7:return tr(r,n,n.pendingProps,u),n.child;case 8:return tr(r,n,n.pendingProps.children,u),n.child;case 12:return tr(r,n,n.pendingProps.children,u),n.child;case 10:e:{if(w=n.type._context,N=n.pendingProps,A=n.memoizedProps,I=N.value,Qe(ol,w._currentValue),w._currentValue=I,A!==null)if(zr(A.value,I)){if(A.children===N.children&&!or.current){n=Es(r,n,u);break e}}else for(A=n.child,A!==null&&(A.return=n);A!==null;){var X=A.dependencies;if(X!==null){I=A.child;for(var Q=X.firstContext;Q!==null;){if(Q.context===w){if(A.tag===1){Q=ks(-1,u&-u),Q.tag=2;var oe=A.updateQueue;if(oe!==null){oe=oe.shared;var fe=oe.pending;fe===null?Q.next=Q:(Q.next=fe.next,fe.next=Q),oe.pending=Q}}A.lanes|=u,Q=A.alternate,Q!==null&&(Q.lanes|=u),Zu(A.return,u,n),X.lanes|=u;break}Q=Q.next}}else if(A.tag===10)I=A.type===n.type?null:A.child;else if(A.tag===18){if(I=A.return,I===null)throw Error(s(341));I.lanes|=u,X=I.alternate,X!==null&&(X.lanes|=u),Zu(I,u,n),I=A.sibling}else I=A.child;if(I!==null)I.return=A;else for(I=A;I!==null;){if(I===n){I=null;break}if(A=I.sibling,A!==null){A.return=I.return,I=A;break}I=I.return}A=I}tr(r,n,N.children,u),n=n.child}return n;case 9:return N=n.type,w=n.pendingProps.children,yi(n,u),N=Dr(N),w=w(N),n.flags|=1,tr(r,n,w,u),n.child;case 14:return w=n.type,N=Ur(w,n.pendingProps),N=Ur(w.type,N),zg(r,n,w,N,u);case 15:return Wg(r,n,n.type,n.pendingProps,u);case 17:return w=n.type,N=n.pendingProps,N=n.elementType===w?N:Ur(w,N),yl(r,n),n.tag=1,ar(w)?(r=!0,el(n)):r=!1,yi(n,u),Lg(n,w,N),md(n,w,N,u),xd(null,n,w,!0,r,u);case 19:return Qg(r,n,u);case 22:return Ug(r,n,u)}throw Error(s(156,n.tag))};function bv(r,n){return tm(r,n)}function l2(r,n,u,w){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Or(r,n,u,w){return new l2(r,n,u,w)}function Fd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function c2(r){if(typeof r=="function")return Fd(r)?1:0;if(r!=null){if(r=r.$$typeof,r===W)return 11;if(r===G)return 14}return 2}function an(r,n){var u=r.alternate;return u===null?(u=Or(r.tag,n,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=n,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,n=r.dependencies,u.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function Pl(r,n,u,w,N,A){var I=2;if(w=r,typeof r=="function")Fd(r)&&(I=1);else if(typeof r=="string")I=5;else e:switch(r){case R:return In(u.children,N,A,n);case j:I=8,N|=8;break;case L:return r=Or(12,u,n,N|2),r.elementType=L,r.lanes=A,r;case H:return r=Or(13,u,n,N),r.elementType=H,r.lanes=A,r;case J:return r=Or(19,u,n,N),r.elementType=J,r.lanes=A,r;case ee:return Rl(u,N,A,n);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case $:I=10;break e;case F:I=9;break e;case W:I=11;break e;case G:I=14;break e;case Y:I=16,w=null;break e}throw Error(s(130,r==null?r:typeof r,""))}return n=Or(I,u,n,N),n.elementType=r,n.type=w,n.lanes=A,n}function In(r,n,u,w){return r=Or(7,r,w,n),r.lanes=u,r}function Rl(r,n,u,w){return r=Or(22,r,w,n),r.elementType=ee,r.lanes=u,r.stateNode={isHidden:!1},r}function $d(r,n,u){return r=Or(6,r,null,n),r.lanes=u,r}function Hd(r,n,u){return n=Or(4,r.children!==null?r.children:[],r.key,n),n.lanes=u,n.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},n}function u2(r,n,u,w,N){this.tag=n,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pu(0),this.expirationTimes=pu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pu(0),this.identifierPrefix=w,this.onRecoverableError=N,this.mutableSourceEagerHydrationData=null}function Vd(r,n,u,w,N,A,I,X,Q){return r=new u2(r,n,u,X,Q),n===1?(n=1,A===!0&&(n|=8)):n=0,A=Or(3,null,null,n),r.current=A,A.stateNode=r,A.memoizedState={element:w,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},td(A),r}function d2(r,n,u){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:w==null?null:""+w,children:r,containerInfo:n,implementation:u}}function Sv(r){if(!r)return Js;r=r._reactInternals;e:{if(kn(r)!==r||r.tag!==1)throw Error(s(170));var n=r;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(ar(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(s(171))}if(r.tag===1){var u=r.type;if(ar(u))return Jm(r,u,n)}return n}function Cv(r,n,u,w,N,A,I,X,Q){return r=Vd(u,w,!0,r,N,A,I,X,Q),r.context=Sv(null),u=r.current,w=rr(),N=nn(u),A=ks(w,N),A.callback=n??null,en(u,A,N),r.current.lanes=N,oo(r,N,w),ur(r,w),r}function Tl(r,n,u,w){var N=n.current,A=rr(),I=nn(N);return u=Sv(u),n.context===null?n.context=u:n.pendingContext=u,n=ks(A,I),n.payload={element:r},w=w===void 0?null:w,w!==null&&(n.callback=w),r=en(N,n,I),r!==null&&(qr(r,N,I,A),ll(r,N,I)),I}function Al(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function kv(r,n){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<n?u:n}}function zd(r,n){kv(r,n),(r=r.alternate)&&kv(r,n)}function h2(){return null}var Ev=typeof reportError=="function"?reportError:function(r){console.error(r)};function Wd(r){this._internalRoot=r}Dl.prototype.render=Wd.prototype.render=function(r){var n=this._internalRoot;if(n===null)throw Error(s(409));Tl(r,n,null,null)},Dl.prototype.unmount=Wd.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var n=r.containerInfo;Mn(function(){Tl(null,r,null,null)}),n[_s]=null}};function Dl(r){this._internalRoot=r}Dl.prototype.unstable_scheduleHydration=function(r){if(r){var n=cm();r={blockedOn:null,target:r,priority:n};for(var u=0;u<Ks.length&&n!==0&&n<Ks[u].priority;u++);Ks.splice(u,0,r),u===0&&hm(r)}};function Ud(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function Ml(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function jv(){}function f2(r,n,u,w,N){if(N){if(typeof w=="function"){var A=w;w=function(){var oe=Al(I);A.call(oe)}}var I=Cv(n,w,r,0,null,!1,!1,"",jv);return r._reactRootContainer=I,r[_s]=I.current,wo(r.nodeType===8?r.parentNode:r),Mn(),I}for(;N=r.lastChild;)r.removeChild(N);if(typeof w=="function"){var X=w;w=function(){var oe=Al(Q);X.call(oe)}}var Q=Vd(r,0,!1,null,null,!1,!1,"",jv);return r._reactRootContainer=Q,r[_s]=Q.current,wo(r.nodeType===8?r.parentNode:r),Mn(function(){Tl(n,Q,u,w)}),Q}function Ll(r,n,u,w,N){var A=u._reactRootContainer;if(A){var I=A;if(typeof N=="function"){var X=N;N=function(){var Q=Al(I);X.call(Q)}}Tl(n,I,r,N)}else I=f2(u,n,r,N,w);return Al(I)}am=function(r){switch(r.tag){case 3:var n=r.stateNode;if(n.current.memoizedState.isDehydrated){var u=io(n.pendingLanes);u!==0&&(mu(n,u|1),ur(n,pt()),(Ke&6)===0&&(Si=pt()+500,Qs()))}break;case 13:Mn(function(){var w=Cs(r,1);if(w!==null){var N=rr();qr(w,r,1,N)}}),zd(r,1)}},gu=function(r){if(r.tag===13){var n=Cs(r,134217728);if(n!==null){var u=rr();qr(n,r,134217728,u)}zd(r,134217728)}},lm=function(r){if(r.tag===13){var n=nn(r),u=Cs(r,n);if(u!==null){var w=rr();qr(u,r,n,w)}zd(r,n)}},cm=function(){return Je},um=function(r,n){var u=Je;try{return Je=r,n()}finally{Je=u}},ro=function(r,n,u){switch(n){case"input":if(Ee(r,u),n=u.name,u.type==="radio"&&n!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<u.length;n++){var w=u[n];if(w!==r&&w.form===r.form){var N=Qa(w);if(!N)throw Error(s(90));ae(w),Ee(w,N)}}}break;case"textarea":Et(r,u);break;case"select":n=u.value,n!=null&&Ae(r,!!u.multiple,n,!1)}},wt=Od,zt=Mn;var p2={usingClientEntryPoint:!1,Events:[Co,ui,Qa,$e,ft,Od]},Bo={findFiberByHostInstance:En,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},m2={bundleType:Bo.bundleType,version:Bo.version,rendererPackageName:Bo.rendererPackageName,rendererConfig:Bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Zp(r),r===null?null:r.stateNode},findFiberByHostInstance:Bo.findFiberByHostInstance||h2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ol=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ol.isDisabled&&Ol.supportsFiber)try{Da=Ol.inject(m2),ss=Ol}catch{}}return dr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=p2,dr.createPortal=function(r,n){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ud(n))throw Error(s(200));return d2(r,n,null,u)},dr.createRoot=function(r,n){if(!Ud(r))throw Error(s(299));var u=!1,w="",N=Ev;return n!=null&&(n.unstable_strictMode===!0&&(u=!0),n.identifierPrefix!==void 0&&(w=n.identifierPrefix),n.onRecoverableError!==void 0&&(N=n.onRecoverableError)),n=Vd(r,1,!1,null,null,u,!1,w,N),r[_s]=n.current,wo(r.nodeType===8?r.parentNode:r),new Wd(n)},dr.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var n=r._reactInternals;if(n===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=Zp(n),r=r===null?null:r.stateNode,r},dr.flushSync=function(r){return Mn(r)},dr.hydrate=function(r,n,u){if(!Ml(n))throw Error(s(200));return Ll(null,r,n,!0,u)},dr.hydrateRoot=function(r,n,u){if(!Ud(r))throw Error(s(405));var w=u!=null&&u.hydratedSources||null,N=!1,A="",I=Ev;if(u!=null&&(u.unstable_strictMode===!0&&(N=!0),u.identifierPrefix!==void 0&&(A=u.identifierPrefix),u.onRecoverableError!==void 0&&(I=u.onRecoverableError)),n=Cv(n,null,r,1,u??null,N,!1,A,I),r[_s]=n.current,wo(r),w)for(r=0;r<w.length;r++)u=w[r],N=u._getVersion,N=N(u._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[u,N]:n.mutableSourceEagerHydrationData.push(u,N);return new Dl(n)},dr.render=function(r,n,u){if(!Ml(n))throw Error(s(200));return Ll(null,r,n,!1,u)},dr.unmountComponentAtNode=function(r){if(!Ml(r))throw Error(s(40));return r._reactRootContainer?(Mn(function(){Ll(null,null,r,!1,function(){r._reactRootContainer=null,r[_s]=null})}),!0):!1},dr.unstable_batchedUpdates=Od,dr.unstable_renderSubtreeIntoContainer=function(r,n,u,w){if(!Ml(u))throw Error(s(200));if(r==null||r._reactInternals===void 0)throw Error(s(38));return Ll(r,n,u,!1,w)},dr.version="18.3.1-next-f1338f8080-20240426",dr}var Lv;function zy(){if(Lv)return qd.exports;Lv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qd.exports=S2(),qd.exports}var Ov;function C2(){if(Ov)return Il;Ov=1;var e=zy();return Il.createRoot=e.createRoot,Il.hydrateRoot=e.hydrateRoot,Il}var k2=C2();const E2=ff(k2);var ha=zy();const Wy=ff(ha);function j2(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const N2=e=>{switch(e){case"success":return T2;case"info":return D2;case"warning":return A2;case"error":return M2;default:return null}},P2=Array(12).fill(0),R2=({visible:e,className:t})=>ge.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ge.createElement("div",{className:"sonner-spinner"},P2.map((s,i)=>ge.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),T2=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),A2=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),D2=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),M2=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),L2=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ge.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ge.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),O2=()=>{const[e,t]=ge.useState(document.hidden);return ge.useEffect(()=>{const s=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let Rh=1;class I2{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var s;const{message:i,...l}=t,m=typeof(t==null?void 0:t.id)=="number"||((s=t.id)==null?void 0:s.length)>0?t.id:Rh++,f=this.toasts.find(c=>c.id===m),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(m)&&this.dismissedToasts.delete(m),f?this.toasts=this.toasts.map(c=>c.id===m?(this.publish({...c,...t,id:m,title:i}),{...c,...t,id:m,dismissible:a,title:i}):c):this.addToast({title:i,...l,dismissible:a,id:m}),m},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:t,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(i=>i({id:s.id,dismiss:!0}))}),t),this.message=(t,s)=>this.create({...s,message:t}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const l=Promise.resolve(t instanceof Function?t():t);let m=i!==void 0,f;const a=l.then(async h=>{if(f=["resolve",h],ge.isValidElement(h))m=!1,this.create({id:i,type:"default",message:h});else if(F2(h)&&!h.ok){m=!1;const d=typeof s.error=="function"?await s.error(`HTTP error! status: ${h.status}`):s.error,_=typeof s.description=="function"?await s.description(`HTTP error! status: ${h.status}`):s.description,E=typeof d=="object"&&!ge.isValidElement(d)?d:{message:d};this.create({id:i,type:"error",description:_,...E})}else if(h instanceof Error){m=!1;const d=typeof s.error=="function"?await s.error(h):s.error,_=typeof s.description=="function"?await s.description(h):s.description,E=typeof d=="object"&&!ge.isValidElement(d)?d:{message:d};this.create({id:i,type:"error",description:_,...E})}else if(s.success!==void 0){m=!1;const d=typeof s.success=="function"?await s.success(h):s.success,_=typeof s.description=="function"?await s.description(h):s.description,E=typeof d=="object"&&!ge.isValidElement(d)?d:{message:d};this.create({id:i,type:"success",description:_,...E})}}).catch(async h=>{if(f=["reject",h],s.error!==void 0){m=!1;const g=typeof s.error=="function"?await s.error(h):s.error,d=typeof s.description=="function"?await s.description(h):s.description,S=typeof g=="object"&&!ge.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:d,...S})}}).finally(()=>{m&&(this.dismiss(i),i=void 0),s.finally==null||s.finally.call(s)}),c=()=>new Promise((h,g)=>a.then(()=>f[0]==="reject"?g(f[1]):h(f[1])).catch(g));return typeof i!="string"&&typeof i!="number"?{unwrap:c}:Object.assign(i,{unwrap:c})},this.custom=(t,s)=>{const i=(s==null?void 0:s.id)||Rh++;return this.create({jsx:t(i),id:i,...s}),i},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const hr=new I2,B2=(e,t)=>{const s=(t==null?void 0:t.id)||Rh++;return hr.addToast({title:e,...t,id:s}),s},F2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",$2=B2,H2=()=>hr.toasts,V2=()=>hr.getActiveToasts(),le=Object.assign($2,{success:hr.success,info:hr.info,warning:hr.warning,error:hr.error,custom:hr.custom,message:hr.message,promise:hr.promise,dismiss:hr.dismiss,loading:hr.loading},{getHistory:H2,getToasts:V2});j2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Bl(e){return e.label!==void 0}const z2=3,W2="24px",U2="16px",Iv=4e3,K2=356,G2=14,q2=45,Y2=200;function ls(...e){return e.filter(Boolean).join(" ")}function X2(e){const[t,s]=e.split("-"),i=[];return t&&i.push(t),s&&i.push(s),i}const J2=e=>{var t,s,i,l,m,f,a,c,h;const{invert:g,toast:d,unstyled:_,interacting:S,setHeights:E,visibleToasts:b,heights:v,index:y,toasts:p,expanded:x,removeToast:k,defaultRichColors:P,closeButton:T,style:R,cancelButtonStyle:j,actionButtonStyle:L,className:$="",descriptionClassName:F="",duration:W,position:H,gap:J,expandByDefault:G,classNames:Y,icons:ee,closeButtonAriaLabel:z="Close toast"}=e,[M,B]=ge.useState(null),[O,V]=ge.useState(null),[Z,re]=ge.useState(!1),[ce,ue]=ge.useState(!1),[U,D]=ge.useState(!1),[K,q]=ge.useState(!1),[ie,ae]=ge.useState(!1),[ve,He]=ge.useState(0),[Ue,Xe]=ge.useState(0),Ee=ge.useRef(d.duration||W||Iv),Ht=ge.useRef(null),et=ge.useRef(null),Pe=y===0,Ae=y+1<=b,Ie=d.type,Fe=d.dismissible!==!1,Et=d.className||"",ct=d.descriptionClassName||"",vr=ge.useMemo(()=>v.findIndex($e=>$e.toastId===d.id)||0,[v,d.id]),ys=ge.useMemo(()=>{var $e;return($e=d.closeButton)!=null?$e:T},[d.closeButton,T]),Vt=ge.useMemo(()=>d.duration||W||Iv,[d.duration,W]),Hr=ge.useRef(0),ht=ge.useRef(0),ir=ge.useRef(0),Ge=ge.useRef(null),[ti,Ra]=H.split("-"),Ta=ge.useMemo(()=>v.reduce(($e,ft,wt)=>wt>=vr?$e:$e+ft.height,0),[v,vr]),ri=O2(),to=d.invert||g,Cn=Ie==="loading";ht.current=ge.useMemo(()=>vr*J+Ta,[vr,Ta]),ge.useEffect(()=>{Ee.current=Vt},[Vt]),ge.useEffect(()=>{re(!0)},[]),ge.useEffect(()=>{const $e=et.current;if($e){const ft=$e.getBoundingClientRect().height;return Xe(ft),E(wt=>[{toastId:d.id,height:ft,position:d.position},...wt]),()=>E(wt=>wt.filter(zt=>zt.toastId!==d.id))}},[E,d.id]),ge.useLayoutEffect(()=>{if(!Z)return;const $e=et.current,ft=$e.style.height;$e.style.height="auto";const wt=$e.getBoundingClientRect().height;$e.style.height=ft,Xe(wt),E(zt=>zt.find(yt=>yt.toastId===d.id)?zt.map(yt=>yt.toastId===d.id?{...yt,height:wt}:yt):[{toastId:d.id,height:wt,position:d.position},...zt])},[Z,d.title,d.description,E,d.id,d.jsx,d.action,d.cancel]);const Pr=ge.useCallback(()=>{ue(!0),He(ht.current),E($e=>$e.filter(ft=>ft.toastId!==d.id)),setTimeout(()=>{k(d)},Y2)},[d,k,E,ht]);ge.useEffect(()=>{if(d.promise&&Ie==="loading"||d.duration===1/0||d.type==="loading")return;let $e;return x||S||ri?(()=>{if(ir.current<Hr.current){const zt=new Date().getTime()-Hr.current;Ee.current=Ee.current-zt}ir.current=new Date().getTime()})():(()=>{Ee.current!==1/0&&(Hr.current=new Date().getTime(),$e=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Pr()},Ee.current))})(),()=>clearTimeout($e)},[x,S,d,Ie,ri,Pr]),ge.useEffect(()=>{d.delete&&(Pr(),d.onDismiss==null||d.onDismiss.call(d,d))},[Pr,d.delete]);function ro(){var $e;if(ee!=null&&ee.loading){var ft;return ge.createElement("div",{className:ls(Y==null?void 0:Y.loader,d==null||(ft=d.classNames)==null?void 0:ft.loader,"sonner-loader"),"data-visible":Ie==="loading"},ee.loading)}return ge.createElement(R2,{className:ls(Y==null?void 0:Y.loader,d==null||($e=d.classNames)==null?void 0:$e.loader),visible:Ie==="loading"})}const Fs=d.icon||(ee==null?void 0:ee[Ie])||N2(Ie);var xs,so;return ge.createElement("li",{tabIndex:0,ref:et,className:ls($,Et,Y==null?void 0:Y.toast,d==null||(t=d.classNames)==null?void 0:t.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[Ie],d==null||(s=d.classNames)==null?void 0:s[Ie]),"data-sonner-toast":"","data-rich-colors":(xs=d.richColors)!=null?xs:P,"data-styled":!(d.jsx||d.unstyled||_),"data-mounted":Z,"data-promise":!!d.promise,"data-swiped":ie,"data-removed":ce,"data-visible":Ae,"data-y-position":ti,"data-x-position":Ra,"data-index":y,"data-front":Pe,"data-swiping":U,"data-dismissible":Fe,"data-type":Ie,"data-invert":to,"data-swipe-out":K,"data-swipe-direction":O,"data-expanded":!!(x||G&&Z),"data-testid":d.testId,style:{"--index":y,"--toasts-before":y,"--z-index":p.length-y,"--offset":`${ce?ve:ht.current}px`,"--initial-height":G?"auto":`${Ue}px`,...R,...d.style},onDragEnd:()=>{D(!1),B(null),Ge.current=null},onPointerDown:$e=>{$e.button!==2&&(Cn||!Fe||(Ht.current=new Date,He(ht.current),$e.target.setPointerCapture($e.pointerId),$e.target.tagName!=="BUTTON"&&(D(!0),Ge.current={x:$e.clientX,y:$e.clientY})))},onPointerUp:()=>{var $e,ft,wt;if(K||!Fe)return;Ge.current=null;const zt=Number((($e=et.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$s=Number(((ft=et.current)==null?void 0:ft.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yt=new Date().getTime()-((wt=Ht.current)==null?void 0:wt.getTime()),jt=M==="x"?zt:$s,Hs=Math.abs(jt)/yt;if(Math.abs(jt)>=q2||Hs>.11){He(ht.current),d.onDismiss==null||d.onDismiss.call(d,d),V(M==="x"?zt>0?"right":"left":$s>0?"down":"up"),Pr(),q(!0);return}else{var Mt,yr;(Mt=et.current)==null||Mt.style.setProperty("--swipe-amount-x","0px"),(yr=et.current)==null||yr.style.setProperty("--swipe-amount-y","0px")}ae(!1),D(!1),B(null)},onPointerMove:$e=>{var ft,wt,zt;if(!Ge.current||!Fe||((ft=window.getSelection())==null?void 0:ft.toString().length)>0)return;const yt=$e.clientY-Ge.current.y,jt=$e.clientX-Ge.current.x;var Hs;const Mt=(Hs=e.swipeDirections)!=null?Hs:X2(H);!M&&(Math.abs(jt)>1||Math.abs(yt)>1)&&B(Math.abs(jt)>Math.abs(yt)?"x":"y");let yr={x:0,y:0};const Vs=Rr=>1/(1.5+Math.abs(Rr)/20);if(M==="y"){if(Mt.includes("top")||Mt.includes("bottom"))if(Mt.includes("top")&&yt<0||Mt.includes("bottom")&&yt>0)yr.y=yt;else{const Rr=yt*Vs(yt);yr.y=Math.abs(Rr)<Math.abs(yt)?Rr:yt}}else if(M==="x"&&(Mt.includes("left")||Mt.includes("right")))if(Mt.includes("left")&&jt<0||Mt.includes("right")&&jt>0)yr.x=jt;else{const Rr=jt*Vs(jt);yr.x=Math.abs(Rr)<Math.abs(jt)?Rr:jt}(Math.abs(yr.x)>0||Math.abs(yr.y)>0)&&ae(!0),(wt=et.current)==null||wt.style.setProperty("--swipe-amount-x",`${yr.x}px`),(zt=et.current)==null||zt.style.setProperty("--swipe-amount-y",`${yr.y}px`)}},ys&&!d.jsx&&Ie!=="loading"?ge.createElement("button",{"aria-label":z,"data-disabled":Cn,"data-close-button":!0,onClick:Cn||!Fe?()=>{}:()=>{Pr(),d.onDismiss==null||d.onDismiss.call(d,d)},className:ls(Y==null?void 0:Y.closeButton,d==null||(i=d.classNames)==null?void 0:i.closeButton)},(so=ee==null?void 0:ee.close)!=null?so:L2):null,(Ie||d.icon||d.promise)&&d.icon!==null&&((ee==null?void 0:ee[Ie])!==null||d.icon)?ge.createElement("div",{"data-icon":"",className:ls(Y==null?void 0:Y.icon,d==null||(l=d.classNames)==null?void 0:l.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||ro():null,d.type!=="loading"?Fs:null):null,ge.createElement("div",{"data-content":"",className:ls(Y==null?void 0:Y.content,d==null||(m=d.classNames)==null?void 0:m.content)},ge.createElement("div",{"data-title":"",className:ls(Y==null?void 0:Y.title,d==null||(f=d.classNames)==null?void 0:f.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?ge.createElement("div",{"data-description":"",className:ls(F,ct,Y==null?void 0:Y.description,d==null||(a=d.classNames)==null?void 0:a.description)},typeof d.description=="function"?d.description():d.description):null),ge.isValidElement(d.cancel)?d.cancel:d.cancel&&Bl(d.cancel)?ge.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:$e=>{Bl(d.cancel)&&Fe&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,$e),Pr())},className:ls(Y==null?void 0:Y.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,ge.isValidElement(d.action)?d.action:d.action&&Bl(d.action)?ge.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||L,onClick:$e=>{Bl(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,$e),!$e.defaultPrevented&&Pr())},className:ls(Y==null?void 0:Y.actionButton,d==null||(h=d.classNames)==null?void 0:h.actionButton)},d.action.label):null)};function Bv(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Q2(e,t){const s={};return[e,t].forEach((i,l)=>{const m=l===1,f=m?"--mobile-offset":"--offset",a=m?U2:W2;function c(h){["top","right","bottom","left"].forEach(g=>{s[`${f}-${g}`]=typeof h=="number"?`${h}px`:h})}typeof i=="number"||typeof i=="string"?c(i):typeof i=="object"?["top","right","bottom","left"].forEach(h=>{i[h]===void 0?s[`${f}-${h}`]=a:s[`${f}-${h}`]=typeof i[h]=="number"?`${i[h]}px`:i[h]}):c(a)}),s}const Z2=ge.forwardRef(function(t,s){const{id:i,invert:l,position:m="bottom-right",hotkey:f=["altKey","KeyT"],expand:a,closeButton:c,className:h,offset:g,mobileOffset:d,theme:_="light",richColors:S,duration:E,style:b,visibleToasts:v=z2,toastOptions:y,dir:p=Bv(),gap:x=G2,icons:k,containerAriaLabel:P="Notifications"}=t,[T,R]=ge.useState([]),j=ge.useMemo(()=>i?T.filter(Z=>Z.toasterId===i):T.filter(Z=>!Z.toasterId),[T,i]),L=ge.useMemo(()=>Array.from(new Set([m].concat(j.filter(Z=>Z.position).map(Z=>Z.position)))),[j,m]),[$,F]=ge.useState([]),[W,H]=ge.useState(!1),[J,G]=ge.useState(!1),[Y,ee]=ge.useState(_!=="system"?_:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=ge.useRef(null),M=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=ge.useRef(null),O=ge.useRef(!1),V=ge.useCallback(Z=>{R(re=>{var ce;return(ce=re.find(ue=>ue.id===Z.id))!=null&&ce.delete||hr.dismiss(Z.id),re.filter(({id:ue})=>ue!==Z.id)})},[]);return ge.useEffect(()=>hr.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{R(re=>re.map(ce=>ce.id===Z.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{Wy.flushSync(()=>{R(re=>{const ce=re.findIndex(ue=>ue.id===Z.id);return ce!==-1?[...re.slice(0,ce),{...re[ce],...Z},...re.slice(ce+1)]:[Z,...re]})})})}),[T]),ge.useEffect(()=>{if(_!=="system"){ee(_);return}if(_==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ee("dark"):ee("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:re})=>{ee(re?"dark":"light")})}catch{Z.addListener(({matches:ce})=>{try{ee(ce?"dark":"light")}catch(ue){console.error(ue)}})}},[_]),ge.useEffect(()=>{T.length<=1&&H(!1)},[T]),ge.useEffect(()=>{const Z=re=>{var ce;if(f.every(D=>re[D]||re.code===D)){var U;H(!0),(U=z.current)==null||U.focus()}re.code==="Escape"&&(document.activeElement===z.current||(ce=z.current)!=null&&ce.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[f]),ge.useEffect(()=>{if(z.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,O.current=!1)}},[z.current]),ge.createElement("section",{ref:s,"aria-label":`${P} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((Z,re)=>{var ce;const[ue,U]=Z.split("-");return j.length?ge.createElement("ol",{key:Z,dir:p==="auto"?Bv():p,tabIndex:-1,ref:z,className:h,"data-sonner-toaster":!0,"data-sonner-theme":Y,"data-y-position":ue,"data-x-position":U,style:{"--front-toast-height":`${((ce=$[0])==null?void 0:ce.height)||0}px`,"--width":`${K2}px`,"--gap":`${x}px`,...b,...Q2(g,d)},onBlur:D=>{O.current&&!D.currentTarget.contains(D.relatedTarget)&&(O.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:D=>{D.target instanceof HTMLElement&&D.target.dataset.dismissible==="false"||O.current||(O.current=!0,B.current=D.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{J||H(!1)},onDragEnd:()=>H(!1),onPointerDown:D=>{D.target instanceof HTMLElement&&D.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},j.filter(D=>!D.position&&re===0||D.position===Z).map((D,K)=>{var q,ie;return ge.createElement(J2,{key:D.id,icons:k,index:K,toast:D,defaultRichColors:S,duration:(q=y==null?void 0:y.duration)!=null?q:E,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:l,visibleToasts:v,closeButton:(ie=y==null?void 0:y.closeButton)!=null?ie:c,interacting:J,position:Z,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,closeButtonAriaLabel:y==null?void 0:y.closeButtonAriaLabel,removeToast:V,toasts:j.filter(ae=>ae.position==D.position),heights:$.filter(ae=>ae.position==D.position),setHeights:F,expandByDefault:a,gap:x,expanded:W,swipeDirections:t.swipeDirections})})):null}))}),gf=C.createContext({});function vf(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const Pc=C.createContext(null),yf=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class eE extends C.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(s&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=s.offsetHeight||0,i.width=s.offsetWidth||0,i.top=s.offsetTop,i.left=s.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function tE({children:e,isPresent:t}){const s=C.useId(),i=C.useRef(null),l=C.useRef({width:0,height:0,top:0,left:0}),{nonce:m}=C.useContext(yf);return C.useInsertionEffect(()=>{const{width:f,height:a,top:c,left:h}=l.current;if(t||!i.current||!f||!a)return;i.current.dataset.motionPopId=s;const g=document.createElement("style");return m&&(g.nonce=m),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
41
- [data-motion-pop-id="${s}"] {
42
- position: absolute !important;
43
- width: ${f}px !important;
44
- height: ${a}px !important;
45
- top: ${c}px !important;
46
- left: ${h}px !important;
47
- }
48
- `),()=>{document.head.removeChild(g)}},[t]),o.jsx(eE,{isPresent:t,childRef:i,sizeRef:l,children:C.cloneElement(e,{ref:i})})}const rE=({children:e,initial:t,isPresent:s,onExitComplete:i,custom:l,presenceAffectsLayout:m,mode:f})=>{const a=vf(sE),c=C.useId(),h=C.useCallback(d=>{a.set(d,!0);for(const _ of a.values())if(!_)return;i&&i()},[a,i]),g=C.useMemo(()=>({id:c,initial:t,isPresent:s,custom:l,onExitComplete:h,register:d=>(a.set(d,!1),()=>a.delete(d))}),m?[Math.random(),h]:[s,h]);return C.useMemo(()=>{a.forEach((d,_)=>a.set(_,!1))},[s]),C.useEffect(()=>{!s&&!a.size&&i&&i()},[s]),f==="popLayout"&&(e=o.jsx(tE,{isPresent:s,children:e})),o.jsx(Pc.Provider,{value:g,children:e})};function sE(){return new Map}function Uy(e=!0){const t=C.useContext(Pc);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:i,register:l}=t,m=C.useId();C.useEffect(()=>{e&&l(m)},[e]);const f=C.useCallback(()=>e&&i&&i(m),[m,i,e]);return!s&&i?[!1,f]:[!0]}const Fl=e=>e.key||"";function Fv(e){const t=[];return C.Children.forEach(e,s=>{C.isValidElement(s)&&t.push(s)}),t}const xf=typeof window<"u",Ky=xf?C.useLayoutEffect:C.useEffect,Gy=({children:e,custom:t,initial:s=!0,onExitComplete:i,presenceAffectsLayout:l=!0,mode:m="sync",propagate:f=!1})=>{const[a,c]=Uy(f),h=C.useMemo(()=>Fv(e),[e]),g=f&&!a?[]:h.map(Fl),d=C.useRef(!0),_=C.useRef(h),S=vf(()=>new Map),[E,b]=C.useState(h),[v,y]=C.useState(h);Ky(()=>{d.current=!1,_.current=h;for(let k=0;k<v.length;k++){const P=Fl(v[k]);g.includes(P)?S.delete(P):S.get(P)!==!0&&S.set(P,!1)}},[v,g.length,g.join("-")]);const p=[];if(h!==E){let k=[...h];for(let P=0;P<v.length;P++){const T=v[P],R=Fl(T);g.includes(R)||(k.splice(P,0,T),p.push(T))}m==="wait"&&p.length&&(k=p),y(Fv(k)),b(h);return}const{forceRender:x}=C.useContext(gf);return o.jsx(o.Fragment,{children:v.map(k=>{const P=Fl(k),T=f&&!a?!1:h===v||g.includes(P),R=()=>{if(S.has(P))S.set(P,!0);else return;let j=!0;S.forEach(L=>{L||(j=!1)}),j&&(x==null||x(),y(_.current),f&&(c==null||c()),i&&i())};return o.jsx(rE,{isPresent:T,initial:!d.current||s?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:l,mode:m,onExitComplete:T?void 0:R,children:k},P)})})},Cr=e=>e;let qy=Cr;function _f(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ii=(e,t,s)=>{const i=t-e;return i===0?1:(s-e)/i},Ts=e=>e*1e3,As=e=>e/1e3,nE={useManualTiming:!1};function iE(e){let t=new Set,s=new Set,i=!1,l=!1;const m=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function a(h){m.has(h)&&(c.schedule(h),e()),h(f)}const c={schedule:(h,g=!1,d=!1)=>{const S=d&&i?t:s;return g&&m.add(h),S.has(h)||S.add(h),h},cancel:h=>{s.delete(h),m.delete(h)},process:h=>{if(f=h,i){l=!0;return}i=!0,[t,s]=[s,t],t.forEach(a),t.clear(),i=!1,l&&(l=!1,c.process(h))}};return c}const $l=["read","resolveKeyframes","update","preRender","render","postRender"],oE=40;function Yy(e,t){let s=!1,i=!0;const l={delta:0,timestamp:0,isProcessing:!1},m=()=>s=!0,f=$l.reduce((y,p)=>(y[p]=iE(m),y),{}),{read:a,resolveKeyframes:c,update:h,preRender:g,render:d,postRender:_}=f,S=()=>{const y=performance.now();s=!1,l.delta=i?1e3/60:Math.max(Math.min(y-l.timestamp,oE),1),l.timestamp=y,l.isProcessing=!0,a.process(l),c.process(l),h.process(l),g.process(l),d.process(l),_.process(l),l.isProcessing=!1,s&&t&&(i=!1,e(S))},E=()=>{s=!0,i=!0,l.isProcessing||e(S)};return{schedule:$l.reduce((y,p)=>{const x=f[p];return y[p]=(k,P=!1,T=!1)=>(s||E(),x.schedule(k,P,T)),y},{}),cancel:y=>{for(let p=0;p<$l.length;p++)f[$l[p]].cancel(y)},state:l,steps:f}}const{schedule:st,cancel:gn,state:It,steps:Jd}=Yy(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cr,!0),Xy=C.createContext({strict:!1}),$v={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Bi={};for(const e in $v)Bi[e]={isEnabled:t=>$v[e].some(s=>!!t[s])};function aE(e){for(const t in e)Bi[t]={...Bi[t],...e[t]}}const lE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function nc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||lE.has(e)}let Jy=e=>!nc(e);function cE(e){e&&(Jy=t=>t.startsWith("on")?!nc(t):e(t))}try{cE(require("@emotion/is-prop-valid").default)}catch{}function uE(e,t,s){const i={};for(const l in e)l==="values"&&typeof e.values=="object"||(Jy(l)||s===!0&&nc(l)||!t&&!nc(l)||e.draggable&&l.startsWith("onDrag"))&&(i[l]=e[l]);return i}function dE(e){if(typeof Proxy>"u")return e;const t=new Map,s=(...i)=>e(...i);return new Proxy(s,{get:(i,l)=>l==="create"?e:(t.has(l)||t.set(l,e(l)),t.get(l))})}const Rc=C.createContext({});function Jo(e){return typeof e=="string"||Array.isArray(e)}function Tc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const wf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bf=["initial",...wf];function Ac(e){return Tc(e.animate)||bf.some(t=>Jo(e[t]))}function Qy(e){return!!(Ac(e)||e.variants)}function hE(e,t){if(Ac(e)){const{initial:s,animate:i}=e;return{initial:s===!1||Jo(s)?s:void 0,animate:Jo(i)?i:void 0}}return e.inherit!==!1?t:{}}function fE(e){const{initial:t,animate:s}=hE(e,C.useContext(Rc));return C.useMemo(()=>({initial:t,animate:s}),[Hv(t),Hv(s)])}function Hv(e){return Array.isArray(e)?e.join(" "):e}const pE=Symbol.for("motionComponentSymbol");function Pi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function mE(e,t,s){return C.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),s&&(typeof s=="function"?s(i):Pi(s)&&(s.current=i))},[t])}const Sf=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),gE="framerAppearId",Zy="data-"+Sf(gE),{schedule:Cf}=Yy(queueMicrotask,!1),ex=C.createContext({});function vE(e,t,s,i,l){var m,f;const{visualElement:a}=C.useContext(Rc),c=C.useContext(Xy),h=C.useContext(Pc),g=C.useContext(yf).reducedMotion,d=C.useRef(null);i=i||c.renderer,!d.current&&i&&(d.current=i(e,{visualState:t,parent:a,props:s,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:g}));const _=d.current,S=C.useContext(ex);_&&!_.projection&&l&&(_.type==="html"||_.type==="svg")&&yE(d.current,s,l,S);const E=C.useRef(!1);C.useInsertionEffect(()=>{_&&E.current&&_.update(s,h)});const b=s[Zy],v=C.useRef(!!b&&!(!((m=window.MotionHandoffIsComplete)===null||m===void 0)&&m.call(window,b))&&((f=window.MotionHasOptimisedAnimation)===null||f===void 0?void 0:f.call(window,b)));return Ky(()=>{_&&(E.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),Cf.render(_.render),v.current&&_.animationState&&_.animationState.animateChanges())}),C.useEffect(()=>{_&&(!v.current&&_.animationState&&_.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),_}function yE(e,t,s,i){const{layoutId:l,layout:m,drag:f,dragConstraints:a,layoutScroll:c,layoutRoot:h}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:tx(e.parent)),e.projection.setOptions({layoutId:l,layout:m,alwaysMeasureLayout:!!f||a&&Pi(a),visualElement:e,animationType:typeof m=="string"?m:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:h})}function tx(e){if(e)return e.options.allowProjection!==!1?e.projection:tx(e.parent)}function xE({preloadedFeatures:e,createVisualElement:t,useRender:s,useVisualState:i,Component:l}){var m,f;e&&aE(e);function a(h,g){let d;const _={...C.useContext(yf),...h,layoutId:_E(h)},{isStatic:S}=_,E=fE(h),b=i(h,S);if(!S&&xf){wE();const v=bE(_);d=v.MeasureLayout,E.visualElement=vE(l,b,_,t,v.ProjectionNode)}return o.jsxs(Rc.Provider,{value:E,children:[d&&E.visualElement?o.jsx(d,{visualElement:E.visualElement,..._}):null,s(l,h,mE(b,E.visualElement,g),b,S,E.visualElement)]})}a.displayName=`motion.${typeof l=="string"?l:`create(${(f=(m=l.displayName)!==null&&m!==void 0?m:l.name)!==null&&f!==void 0?f:""})`}`;const c=C.forwardRef(a);return c[pE]=l,c}function _E({layoutId:e}){const t=C.useContext(gf).id;return t&&e!==void 0?t+"-"+e:e}function wE(e,t){C.useContext(Xy).strict}function bE(e){const{drag:t,layout:s}=Bi;if(!t&&!s)return{};const i={...t,...s};return{MeasureLayout:t!=null&&t.isEnabled(e)||s!=null&&s.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const SE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function kf(e){return typeof e!="string"||e.includes("-")?!1:!!(SE.indexOf(e)>-1||/[A-Z]/u.test(e))}function Vv(e){const t=[{},{}];return e==null||e.values.forEach((s,i)=>{t[0][i]=s.get(),t[1][i]=s.getVelocity()}),t}function Ef(e,t,s,i){if(typeof t=="function"){const[l,m]=Vv(i);t=t(s!==void 0?s:e.custom,l,m)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[l,m]=Vv(i);t=t(s!==void 0?s:e.custom,l,m)}return t}const Th=e=>Array.isArray(e),CE=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),kE=e=>Th(e)?e[e.length-1]||0:e,Yt=e=>!!(e&&e.getVelocity);function Jl(e){const t=Yt(e)?e.get():e;return CE(t)?t.toValue():t}function EE({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:s},i,l,m){const f={latestValues:jE(i,l,m,e),renderState:t()};return s&&(f.onMount=a=>s({props:i,current:a,...f}),f.onUpdate=a=>s(a)),f}const rx=e=>(t,s)=>{const i=C.useContext(Rc),l=C.useContext(Pc),m=()=>EE(e,t,i,l);return s?m():vf(m)};function jE(e,t,s,i){const l={},m=i(e,{});for(const _ in m)l[_]=Jl(m[_]);let{initial:f,animate:a}=e;const c=Ac(e),h=Qy(e);t&&h&&!c&&e.inherit!==!1&&(f===void 0&&(f=t.initial),a===void 0&&(a=t.animate));let g=s?s.initial===!1:!1;g=g||f===!1;const d=g?a:f;if(d&&typeof d!="boolean"&&!Tc(d)){const _=Array.isArray(d)?d:[d];for(let S=0;S<_.length;S++){const E=Ef(e,_[S]);if(E){const{transitionEnd:b,transition:v,...y}=E;for(const p in y){let x=y[p];if(Array.isArray(x)){const k=g?x.length-1:0;x=x[k]}x!==null&&(l[p]=x)}for(const p in b)l[p]=b[p]}}}return l}const Ui=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zn=new Set(Ui),sx=e=>t=>typeof t=="string"&&t.startsWith(e),nx=sx("--"),NE=sx("var(--"),jf=e=>NE(e)?PE.test(e.split("/*")[0].trim()):!1,PE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ix=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ms=(e,t,s)=>s>t?t:s<e?e:s,Ki={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Qo={...Ki,transform:e=>Ms(0,1,e)},Hl={...Ki,default:1},fa=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),un=fa("deg"),hs=fa("%"),Oe=fa("px"),RE=fa("vh"),TE=fa("vw"),zv={...hs,parse:e=>hs.parse(e)/100,transform:e=>hs.transform(e*100)},AE={borderWidth:Oe,borderTopWidth:Oe,borderRightWidth:Oe,borderBottomWidth:Oe,borderLeftWidth:Oe,borderRadius:Oe,radius:Oe,borderTopLeftRadius:Oe,borderTopRightRadius:Oe,borderBottomRightRadius:Oe,borderBottomLeftRadius:Oe,width:Oe,maxWidth:Oe,height:Oe,maxHeight:Oe,top:Oe,right:Oe,bottom:Oe,left:Oe,padding:Oe,paddingTop:Oe,paddingRight:Oe,paddingBottom:Oe,paddingLeft:Oe,margin:Oe,marginTop:Oe,marginRight:Oe,marginBottom:Oe,marginLeft:Oe,backgroundPositionX:Oe,backgroundPositionY:Oe},DE={rotate:un,rotateX:un,rotateY:un,rotateZ:un,scale:Hl,scaleX:Hl,scaleY:Hl,scaleZ:Hl,skew:un,skewX:un,skewY:un,distance:Oe,translateX:Oe,translateY:Oe,translateZ:Oe,x:Oe,y:Oe,z:Oe,perspective:Oe,transformPerspective:Oe,opacity:Qo,originX:zv,originY:zv,originZ:Oe},Wv={...Ki,transform:Math.round},Nf={...AE,...DE,zIndex:Wv,size:Oe,fillOpacity:Qo,strokeOpacity:Qo,numOctaves:Wv},ME={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},LE=Ui.length;function OE(e,t,s){let i="",l=!0;for(let m=0;m<LE;m++){const f=Ui[m],a=e[f];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(f.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||s){const h=ix(a,Nf[f]);if(!c){l=!1;const g=ME[f]||f;i+=`${g}(${h}) `}s&&(t[f]=h)}}return i=i.trim(),s?i=s(t,l?"":i):l&&(i="none"),i}function Pf(e,t,s){const{style:i,vars:l,transformOrigin:m}=e;let f=!1,a=!1;for(const c in t){const h=t[c];if(Zn.has(c)){f=!0;continue}else if(nx(c)){l[c]=h;continue}else{const g=ix(h,Nf[c]);c.startsWith("origin")?(a=!0,m[c]=g):i[c]=g}}if(t.transform||(f||s?i.transform=OE(t,e.transform,s):i.transform&&(i.transform="none")),a){const{originX:c="50%",originY:h="50%",originZ:g=0}=m;i.transformOrigin=`${c} ${h} ${g}`}}const IE={offset:"stroke-dashoffset",array:"stroke-dasharray"},BE={offset:"strokeDashoffset",array:"strokeDasharray"};function FE(e,t,s=1,i=0,l=!0){e.pathLength=1;const m=l?IE:BE;e[m.offset]=Oe.transform(-i);const f=Oe.transform(t),a=Oe.transform(s);e[m.array]=`${f} ${a}`}function Uv(e,t,s){return typeof e=="string"?e:Oe.transform(t+s*e)}function $E(e,t,s){const i=Uv(t,e.x,e.width),l=Uv(s,e.y,e.height);return`${i} ${l}`}function Rf(e,{attrX:t,attrY:s,attrScale:i,originX:l,originY:m,pathLength:f,pathSpacing:a=1,pathOffset:c=0,...h},g,d){if(Pf(e,h,d),g){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:_,style:S,dimensions:E}=e;_.transform&&(E&&(S.transform=_.transform),delete _.transform),E&&(l!==void 0||m!==void 0||S.transform)&&(S.transformOrigin=$E(E,l!==void 0?l:.5,m!==void 0?m:.5)),t!==void 0&&(_.x=t),s!==void 0&&(_.y=s),i!==void 0&&(_.scale=i),f!==void 0&&FE(_,f,a,c,!1)}const Tf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),ox=()=>({...Tf(),attrs:{}}),Af=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ax(e,{style:t,vars:s},i,l){Object.assign(e.style,t,l&&l.getProjectionStyles(i));for(const m in s)e.style.setProperty(m,s[m])}const lx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function cx(e,t,s,i){ax(e,t,void 0,i);for(const l in t.attrs)e.setAttribute(lx.has(l)?l:Sf(l),t.attrs[l])}const ic={};function HE(e){Object.assign(ic,e)}function ux(e,{layout:t,layoutId:s}){return Zn.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!ic[e]||e==="opacity")}function Df(e,t,s){var i;const{style:l}=e,m={};for(const f in l)(Yt(l[f])||t.style&&Yt(t.style[f])||ux(f,e)||((i=s==null?void 0:s.getValue(f))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(m[f]=l[f]);return m}function dx(e,t,s){const i=Df(e,t,s);for(const l in e)if(Yt(e[l])||Yt(t[l])){const m=Ui.indexOf(l)!==-1?"attr"+l.charAt(0).toUpperCase()+l.substring(1):l;i[m]=e[l]}return i}function VE(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Kv=["x","y","width","height","cx","cy","r"],zE={useVisualState:rx({scrapeMotionValuesFromProps:dx,createRenderState:ox,onUpdate:({props:e,prevProps:t,current:s,renderState:i,latestValues:l})=>{if(!s)return;let m=!!e.drag;if(!m){for(const a in l)if(Zn.has(a)){m=!0;break}}if(!m)return;let f=!t;if(t)for(let a=0;a<Kv.length;a++){const c=Kv[a];e[c]!==t[c]&&(f=!0)}f&&st.read(()=>{VE(s,i),st.render(()=>{Rf(i,l,Af(s.tagName),e.transformTemplate),cx(s,i)})})}})},WE={useVisualState:rx({scrapeMotionValuesFromProps:Df,createRenderState:Tf})};function hx(e,t,s){for(const i in t)!Yt(t[i])&&!ux(i,s)&&(e[i]=t[i])}function UE({transformTemplate:e},t){return C.useMemo(()=>{const s=Tf();return Pf(s,t,e),Object.assign({},s.vars,s.style)},[t])}function KE(e,t){const s=e.style||{},i={};return hx(i,s,e),Object.assign(i,UE(e,t)),i}function GE(e,t){const s={},i=KE(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=i,s}function qE(e,t,s,i){const l=C.useMemo(()=>{const m=ox();return Rf(m,t,Af(i),e.transformTemplate),{...m.attrs,style:{...m.style}}},[t]);if(e.style){const m={};hx(m,e.style,e),l.style={...m,...l.style}}return l}function YE(e=!1){return(s,i,l,{latestValues:m},f)=>{const c=(kf(s)?qE:GE)(i,m,f,s),h=uE(i,typeof s=="string",e),g=s!==C.Fragment?{...h,...c,ref:l}:{},{children:d}=i,_=C.useMemo(()=>Yt(d)?d.get():d,[d]);return C.createElement(s,{...g,children:_})}}function XE(e,t){return function(i,{forwardMotionProps:l}={forwardMotionProps:!1}){const f={...kf(i)?zE:WE,preloadedFeatures:e,useRender:YE(l),createVisualElement:t,Component:i};return xE(f)}}function fx(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let i=0;i<s;i++)if(t[i]!==e[i])return!1;return!0}function Dc(e,t,s){const i=e.getProps();return Ef(i,t,s!==void 0?s:i.custom,e)}const JE=_f(()=>window.ScrollTimeline!==void 0);class QE{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,s){for(let i=0;i<this.animations.length;i++)this.animations[i][t]=s}attachTimeline(t,s){const i=this.animations.map(l=>{if(JE()&&l.attachTimeline)return l.attachTimeline(t);if(typeof s=="function")return s(l)});return()=>{i.forEach((l,m)=>{l&&l(),this.animations[m].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let s=0;s<this.animations.length;s++)t=Math.max(t,this.animations[s].duration);return t}runAll(t){this.animations.forEach(s=>s[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ZE extends QE{then(t,s){return Promise.all(this.animations).then(t).catch(s)}}function Mf(e,t){return e?e[t]||e.default||e:void 0}const Ah=2e4;function px(e){let t=0;const s=50;let i=e.next(t);for(;!i.done&&t<Ah;)t+=s,i=e.next(t);return t>=Ah?1/0:t}function Lf(e){return typeof e=="function"}function Gv(e,t){e.timeline=t,e.onfinish=null}const Of=e=>Array.isArray(e)&&typeof e[0]=="number",ej={linearEasing:void 0};function tj(e,t){const s=_f(e);return()=>{var i;return(i=ej[t])!==null&&i!==void 0?i:s()}}const oc=tj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),mx=(e,t,s=10)=>{let i="";const l=Math.max(Math.round(t/s),2);for(let m=0;m<l;m++)i+=e(Ii(0,l-1,m))+", ";return`linear(${i.substring(0,i.length-2)})`};function gx(e){return!!(typeof e=="function"&&oc()||!e||typeof e=="string"&&(e in Dh||oc())||Of(e)||Array.isArray(e)&&e.every(gx))}const Vo=([e,t,s,i])=>`cubic-bezier(${e}, ${t}, ${s}, ${i})`,Dh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vo([0,.65,.55,1]),circOut:Vo([.55,0,1,.45]),backIn:Vo([.31,.01,.66,-.59]),backOut:Vo([.33,1.53,.69,.99])};function vx(e,t){if(e)return typeof e=="function"&&oc()?mx(e,t):Of(e)?Vo(e):Array.isArray(e)?e.map(s=>vx(s,t)||Dh.easeOut):Dh[e]}const Yr={x:!1,y:!1};function yx(){return Yr.x||Yr.y}function rj(e,t,s){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let l=document;const m=(i=void 0)!==null&&i!==void 0?i:l.querySelectorAll(e);return m?Array.from(m):[]}return Array.from(e)}function xx(e,t){const s=rj(e),i=new AbortController,l={passive:!0,...t,signal:i.signal};return[s,l,()=>i.abort()]}function qv(e){return t=>{t.pointerType==="touch"||yx()||e(t)}}function sj(e,t,s={}){const[i,l,m]=xx(e,s),f=qv(a=>{const{target:c}=a,h=t(a);if(typeof h!="function"||!c)return;const g=qv(d=>{h(d),c.removeEventListener("pointerleave",g)});c.addEventListener("pointerleave",g,l)});return i.forEach(a=>{a.addEventListener("pointerenter",f,l)}),m}const _x=(e,t)=>t?e===t?!0:_x(e,t.parentElement):!1,If=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,nj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ij(e){return nj.has(e.tagName)||e.tabIndex!==-1}const zo=new WeakSet;function Yv(e){return t=>{t.key==="Enter"&&e(t)}}function Qd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const oj=(e,t)=>{const s=e.currentTarget;if(!s)return;const i=Yv(()=>{if(zo.has(s))return;Qd(s,"down");const l=Yv(()=>{Qd(s,"up")}),m=()=>Qd(s,"cancel");s.addEventListener("keyup",l,t),s.addEventListener("blur",m,t)});s.addEventListener("keydown",i,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",i),t)};function Xv(e){return If(e)&&!yx()}function aj(e,t,s={}){const[i,l,m]=xx(e,s),f=a=>{const c=a.currentTarget;if(!Xv(a)||zo.has(c))return;zo.add(c);const h=t(a),g=(S,E)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",_),!(!Xv(S)||!zo.has(c))&&(zo.delete(c),typeof h=="function"&&h(S,{success:E}))},d=S=>{g(S,s.useGlobalTarget||_x(c,S.target))},_=S=>{g(S,!1)};window.addEventListener("pointerup",d,l),window.addEventListener("pointercancel",_,l)};return i.forEach(a=>{!ij(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(s.useGlobalTarget?window:a).addEventListener("pointerdown",f,l),a.addEventListener("focus",h=>oj(h,l),l)}),m}function lj(e){return e==="x"||e==="y"?Yr[e]?null:(Yr[e]=!0,()=>{Yr[e]=!1}):Yr.x||Yr.y?null:(Yr.x=Yr.y=!0,()=>{Yr.x=Yr.y=!1})}const wx=new Set(["width","height","top","left","right","bottom",...Ui]);let Ql;function cj(){Ql=void 0}const fs={now:()=>(Ql===void 0&&fs.set(It.isProcessing||nE.useManualTiming?It.timestamp:performance.now()),Ql),set:e=>{Ql=e,queueMicrotask(cj)}};function Bf(e,t){e.indexOf(t)===-1&&e.push(t)}function Ff(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}class $f{constructor(){this.subscriptions=[]}add(t){return Bf(this.subscriptions,t),()=>Ff(this.subscriptions,t)}notify(t,s,i){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](t,s,i);else for(let m=0;m<l;m++){const f=this.subscriptions[m];f&&f(t,s,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function bx(e,t){return t?e*(1e3/t):0}const Jv=30,uj=e=>!isNaN(parseFloat(e));class dj{constructor(t,s={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,l=!0)=>{const m=fs.now();this.updatedAt!==m&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),l&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=fs.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=uj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new $f);const i=this.events[t].add(s);return t==="change"?()=>{i(),st.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t,s=!0){!s||!this.passiveEffect?this.updateAndNotify(t,s):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,s,i){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=fs.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Jv)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Jv);return bx(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zo(e,t){return new dj(e,t)}function hj(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,Zo(s))}function fj(e,t){const s=Dc(e,t);let{transitionEnd:i={},transition:l={},...m}=s||{};m={...m,...i};for(const f in m){const a=kE(m[f]);hj(e,f,a)}}function pj(e){return!!(Yt(e)&&e.add)}function Mh(e,t){const s=e.getValue("willChange");if(pj(s))return s.add(t)}function Sx(e){return e.props[Zy]}const Cx=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,mj=1e-7,gj=12;function vj(e,t,s,i,l){let m,f,a=0;do f=t+(s-t)/2,m=Cx(f,i,l)-e,m>0?s=f:t=f;while(Math.abs(m)>mj&&++a<gj);return f}function pa(e,t,s,i){if(e===t&&s===i)return Cr;const l=m=>vj(m,0,1,e,s);return m=>m===0||m===1?m:Cx(l(m),t,i)}const kx=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ex=e=>t=>1-e(1-t),jx=pa(.33,1.53,.69,.99),Hf=Ex(jx),Nx=kx(Hf),Px=e=>(e*=2)<1?.5*Hf(e):.5*(2-Math.pow(2,-10*(e-1))),Vf=e=>1-Math.sin(Math.acos(e)),Rx=Ex(Vf),Tx=kx(Vf),Ax=e=>/^0[^.\s]+$/u.test(e);function yj(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Ax(e):!0}const Go=e=>Math.round(e*1e5)/1e5,zf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xj(e){return e==null}const _j=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wf=(e,t)=>s=>!!(typeof s=="string"&&_j.test(s)&&s.startsWith(e)||t&&!xj(s)&&Object.prototype.hasOwnProperty.call(s,t)),Dx=(e,t,s)=>i=>{if(typeof i!="string")return i;const[l,m,f,a]=i.match(zf);return{[e]:parseFloat(l),[t]:parseFloat(m),[s]:parseFloat(f),alpha:a!==void 0?parseFloat(a):1}},wj=e=>Ms(0,255,e),Zd={...Ki,transform:e=>Math.round(wj(e))},Vn={test:Wf("rgb","red"),parse:Dx("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:i=1})=>"rgba("+Zd.transform(e)+", "+Zd.transform(t)+", "+Zd.transform(s)+", "+Go(Qo.transform(i))+")"};function bj(e){let t="",s="",i="",l="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),i=e.substring(5,7),l=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),i=e.substring(3,4),l=e.substring(4,5),t+=t,s+=s,i+=i,l+=l),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(i,16),alpha:l?parseInt(l,16)/255:1}}const Lh={test:Wf("#"),parse:bj,transform:Vn.transform},Ri={test:Wf("hsl","hue"),parse:Dx("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:i=1})=>"hsla("+Math.round(e)+", "+hs.transform(Go(t))+", "+hs.transform(Go(s))+", "+Go(Qo.transform(i))+")"},qt={test:e=>Vn.test(e)||Lh.test(e)||Ri.test(e),parse:e=>Vn.test(e)?Vn.parse(e):Ri.test(e)?Ri.parse(e):Lh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Vn.transform(e):Ri.transform(e)},Sj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Cj(e){var t,s;return isNaN(e)&&typeof e=="string"&&(((t=e.match(zf))===null||t===void 0?void 0:t.length)||0)+(((s=e.match(Sj))===null||s===void 0?void 0:s.length)||0)>0}const Mx="number",Lx="color",kj="var",Ej="var(",Qv="${}",jj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ea(e){const t=e.toString(),s=[],i={color:[],number:[],var:[]},l=[];let m=0;const a=t.replace(jj,c=>(qt.test(c)?(i.color.push(m),l.push(Lx),s.push(qt.parse(c))):c.startsWith(Ej)?(i.var.push(m),l.push(kj),s.push(c)):(i.number.push(m),l.push(Mx),s.push(parseFloat(c))),++m,Qv)).split(Qv);return{values:s,split:a,indexes:i,types:l}}function Ox(e){return ea(e).values}function Ix(e){const{split:t,types:s}=ea(e),i=t.length;return l=>{let m="";for(let f=0;f<i;f++)if(m+=t[f],l[f]!==void 0){const a=s[f];a===Mx?m+=Go(l[f]):a===Lx?m+=qt.transform(l[f]):m+=l[f]}return m}}const Nj=e=>typeof e=="number"?0:e;function Pj(e){const t=Ox(e);return Ix(e)(t.map(Nj))}const vn={test:Cj,parse:Ox,createTransformer:Ix,getAnimatableNone:Pj},Rj=new Set(["brightness","contrast","saturate","opacity"]);function Tj(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=s.match(zf)||[];if(!i)return e;const l=s.replace(i,"");let m=Rj.has(t)?1:0;return i!==s&&(m*=100),t+"("+m+l+")"}const Aj=/\b([a-z-]*)\(.*?\)/gu,Oh={...vn,getAnimatableNone:e=>{const t=e.match(Aj);return t?t.map(Tj).join(" "):e}},Dj={...Nf,color:qt,backgroundColor:qt,outlineColor:qt,fill:qt,stroke:qt,borderColor:qt,borderTopColor:qt,borderRightColor:qt,borderBottomColor:qt,borderLeftColor:qt,filter:Oh,WebkitFilter:Oh},Uf=e=>Dj[e];function Bx(e,t){let s=Uf(e);return s!==Oh&&(s=vn),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const Mj=new Set(["auto","none","0"]);function Lj(e,t,s){let i=0,l;for(;i<e.length&&!l;){const m=e[i];typeof m=="string"&&!Mj.has(m)&&ea(m).values.length&&(l=e[i]),i++}if(l&&s)for(const m of t)e[m]=Bx(s,l)}const Zv=e=>e===Ki||e===Oe,e0=(e,t)=>parseFloat(e.split(", ")[t]),t0=(e,t)=>(s,{transform:i})=>{if(i==="none"||!i)return 0;const l=i.match(/^matrix3d\((.+)\)$/u);if(l)return e0(l[1],t);{const m=i.match(/^matrix\((.+)\)$/u);return m?e0(m[1],e):0}},Oj=new Set(["x","y","z"]),Ij=Ui.filter(e=>!Oj.has(e));function Bj(e){const t=[];return Ij.forEach(s=>{const i=e.getValue(s);i!==void 0&&(t.push([s,i.get()]),i.set(s.startsWith("scale")?1:0))}),t}const Fi={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:t0(4,13),y:t0(5,14)};Fi.translateX=Fi.x;Fi.translateY=Fi.y;const zn=new Set;let Ih=!1,Bh=!1;function Fx(){if(Bh){const e=Array.from(zn).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),s=new Map;t.forEach(i=>{const l=Bj(i);l.length&&(s.set(i,l),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const l=s.get(i);l&&l.forEach(([m,f])=>{var a;(a=i.getValue(m))===null||a===void 0||a.set(f)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Bh=!1,Ih=!1,zn.forEach(e=>e.complete()),zn.clear()}function $x(){zn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Bh=!0)})}function Fj(){$x(),Fx()}class Kf{constructor(t,s,i,l,m,f=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=i,this.motionValue=l,this.element=m,this.isAsync=f}scheduleResolve(){this.isScheduled=!0,this.isAsync?(zn.add(this),Ih||(Ih=!0,st.read($x),st.resolveKeyframes(Fx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:i,motionValue:l}=this;for(let m=0;m<t.length;m++)if(t[m]===null)if(m===0){const f=l==null?void 0:l.get(),a=t[t.length-1];if(f!==void 0)t[0]=f;else if(i&&s){const c=i.readValue(s,a);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=a),l&&f===void 0&&l.set(t[0])}else t[m]=t[m-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),zn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,zn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Hx=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),$j=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hj(e){const t=$j.exec(e);if(!t)return[,];const[,s,i,l]=t;return[`--${s??i}`,l]}function Vx(e,t,s=1){const[i,l]=Hj(e);if(!i)return;const m=window.getComputedStyle(t).getPropertyValue(i);if(m){const f=m.trim();return Hx(f)?parseFloat(f):f}return jf(l)?Vx(l,t,s+1):l}const zx=e=>t=>t.test(e),Vj={test:e=>e==="auto",parse:e=>e},Wx=[Ki,Oe,hs,un,TE,RE,Vj],r0=e=>Wx.find(zx(e));class Ux extends Kf{constructor(t,s,i,l,m){super(t,s,i,l,m,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:i}=this;if(!s||!s.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let h=t[c];if(typeof h=="string"&&(h=h.trim(),jf(h))){const g=Vx(h,s.current);g!==void 0&&(t[c]=g),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!wx.has(i)||t.length!==2)return;const[l,m]=t,f=r0(l),a=r0(m);if(f!==a)if(Zv(f)&&Zv(a))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,i=[];for(let l=0;l<t.length;l++)yj(t[l])&&i.push(l);i.length&&Lj(t,i,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:i}=this;if(!t||!t.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Fi[i](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const l=s[s.length-1];l!==void 0&&t.getValue(i,l).jump(l,!1)}measureEndState(){var t;const{element:s,name:i,unresolvedKeyframes:l}=this;if(!s||!s.current)return;const m=s.getValue(i);m&&m.jump(this.measuredOrigin,!1);const f=l.length-1,a=l[f];l[f]=Fi[i](s.measureViewportBox(),window.getComputedStyle(s.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,h])=>{s.getValue(c).set(h)}),this.resolveNoneKeyframes()}}const s0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(vn.test(e)||e==="0")&&!e.startsWith("url("));function zj(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function Wj(e,t,s,i){const l=e[0];if(l===null)return!1;if(t==="display"||t==="visibility")return!0;const m=e[e.length-1],f=s0(l,t),a=s0(m,t);return!f||!a?!1:zj(e)||(s==="spring"||Lf(s))&&i}const Uj=e=>e!==null;function Mc(e,{repeat:t,repeatType:s="loop"},i){const l=e.filter(Uj),m=t&&s!=="loop"&&t%2===1?0:l.length-1;return!m||i===void 0?l[m]:i}const Kj=40;class Kx{constructor({autoplay:t=!0,delay:s=0,type:i="keyframes",repeat:l=0,repeatDelay:m=0,repeatType:f="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=fs.now(),this.options={autoplay:t,delay:s,type:i,repeat:l,repeatDelay:m,repeatType:f,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Kj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Fj(),this._resolved}onKeyframesResolved(t,s){this.resolvedAt=fs.now(),this.hasAttemptedResolve=!0;const{name:i,type:l,velocity:m,delay:f,onComplete:a,onUpdate:c,isGenerator:h}=this.options;if(!h&&!Wj(t,i,l,m))if(f)this.options.duration=0;else{c&&c(Mc(t,this.options,s)),a&&a(),this.resolveFinishedPromise();return}const g=this.initPlayback(t,s);g!==!1&&(this._resolved={keyframes:t,finalKeyframe:s,...g},this.onPostResolved())}onPostResolved(){}then(t,s){return this.currentFinishedPromise.then(t,s)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const at=(e,t,s)=>e+(t-e)*s;function eh(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function Gj({hue:e,saturation:t,lightness:s,alpha:i}){e/=360,t/=100,s/=100;let l=0,m=0,f=0;if(!t)l=m=f=s;else{const a=s<.5?s*(1+t):s+t-s*t,c=2*s-a;l=eh(c,a,e+1/3),m=eh(c,a,e),f=eh(c,a,e-1/3)}return{red:Math.round(l*255),green:Math.round(m*255),blue:Math.round(f*255),alpha:i}}function ac(e,t){return s=>s>0?t:e}const th=(e,t,s)=>{const i=e*e,l=s*(t*t-i)+i;return l<0?0:Math.sqrt(l)},qj=[Lh,Vn,Ri],Yj=e=>qj.find(t=>t.test(e));function n0(e){const t=Yj(e);if(!t)return!1;let s=t.parse(e);return t===Ri&&(s=Gj(s)),s}const i0=(e,t)=>{const s=n0(e),i=n0(t);if(!s||!i)return ac(e,t);const l={...s};return m=>(l.red=th(s.red,i.red,m),l.green=th(s.green,i.green,m),l.blue=th(s.blue,i.blue,m),l.alpha=at(s.alpha,i.alpha,m),Vn.transform(l))},Xj=(e,t)=>s=>t(e(s)),ma=(...e)=>e.reduce(Xj),Fh=new Set(["none","hidden"]);function Jj(e,t){return Fh.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function Qj(e,t){return s=>at(e,t,s)}function Gf(e){return typeof e=="number"?Qj:typeof e=="string"?jf(e)?ac:qt.test(e)?i0:tN:Array.isArray(e)?Gx:typeof e=="object"?qt.test(e)?i0:Zj:ac}function Gx(e,t){const s=[...e],i=s.length,l=e.map((m,f)=>Gf(m)(m,t[f]));return m=>{for(let f=0;f<i;f++)s[f]=l[f](m);return s}}function Zj(e,t){const s={...e,...t},i={};for(const l in s)e[l]!==void 0&&t[l]!==void 0&&(i[l]=Gf(e[l])(e[l],t[l]));return l=>{for(const m in i)s[m]=i[m](l);return s}}function eN(e,t){var s;const i=[],l={color:0,var:0,number:0};for(let m=0;m<t.values.length;m++){const f=t.types[m],a=e.indexes[f][l[f]],c=(s=e.values[a])!==null&&s!==void 0?s:0;i[m]=c,l[f]++}return i}const tN=(e,t)=>{const s=vn.createTransformer(t),i=ea(e),l=ea(t);return i.indexes.var.length===l.indexes.var.length&&i.indexes.color.length===l.indexes.color.length&&i.indexes.number.length>=l.indexes.number.length?Fh.has(e)&&!l.values.length||Fh.has(t)&&!i.values.length?Jj(e,t):ma(Gx(eN(i,l),l.values),s):ac(e,t)};function qx(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?at(e,t,s):Gf(e)(e,t)}const rN=5;function Yx(e,t,s){const i=Math.max(t-rN,0);return bx(s-e(i),t-i)}const dt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},rh=.001;function sN({duration:e=dt.duration,bounce:t=dt.bounce,velocity:s=dt.velocity,mass:i=dt.mass}){let l,m,f=1-t;f=Ms(dt.minDamping,dt.maxDamping,f),e=Ms(dt.minDuration,dt.maxDuration,As(e)),f<1?(l=h=>{const g=h*f,d=g*e,_=g-s,S=$h(h,f),E=Math.exp(-d);return rh-_/S*E},m=h=>{const d=h*f*e,_=d*s+s,S=Math.pow(f,2)*Math.pow(h,2)*e,E=Math.exp(-d),b=$h(Math.pow(h,2),f);return(-l(h)+rh>0?-1:1)*((_-S)*E)/b}):(l=h=>{const g=Math.exp(-h*e),d=(h-s)*e+1;return-rh+g*d},m=h=>{const g=Math.exp(-h*e),d=(s-h)*(e*e);return g*d});const a=5/e,c=iN(l,m,a);if(e=Ts(e),isNaN(c))return{stiffness:dt.stiffness,damping:dt.damping,duration:e};{const h=Math.pow(c,2)*i;return{stiffness:h,damping:f*2*Math.sqrt(i*h),duration:e}}}const nN=12;function iN(e,t,s){let i=s;for(let l=1;l<nN;l++)i=i-e(i)/t(i);return i}function $h(e,t){return e*Math.sqrt(1-t*t)}const oN=["duration","bounce"],aN=["stiffness","damping","mass"];function o0(e,t){return t.some(s=>e[s]!==void 0)}function lN(e){let t={velocity:dt.velocity,stiffness:dt.stiffness,damping:dt.damping,mass:dt.mass,isResolvedFromDuration:!1,...e};if(!o0(e,aN)&&o0(e,oN))if(e.visualDuration){const s=e.visualDuration,i=2*Math.PI/(s*1.2),l=i*i,m=2*Ms(.05,1,1-(e.bounce||0))*Math.sqrt(l);t={...t,mass:dt.mass,stiffness:l,damping:m}}else{const s=sN(e);t={...t,...s,mass:dt.mass},t.isResolvedFromDuration=!0}return t}function Xx(e=dt.visualDuration,t=dt.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:l}=s;const m=s.keyframes[0],f=s.keyframes[s.keyframes.length-1],a={done:!1,value:m},{stiffness:c,damping:h,mass:g,duration:d,velocity:_,isResolvedFromDuration:S}=lN({...s,velocity:-As(s.velocity||0)}),E=_||0,b=h/(2*Math.sqrt(c*g)),v=f-m,y=As(Math.sqrt(c/g)),p=Math.abs(v)<5;i||(i=p?dt.restSpeed.granular:dt.restSpeed.default),l||(l=p?dt.restDelta.granular:dt.restDelta.default);let x;if(b<1){const P=$h(y,b);x=T=>{const R=Math.exp(-b*y*T);return f-R*((E+b*y*v)/P*Math.sin(P*T)+v*Math.cos(P*T))}}else if(b===1)x=P=>f-Math.exp(-y*P)*(v+(E+y*v)*P);else{const P=y*Math.sqrt(b*b-1);x=T=>{const R=Math.exp(-b*y*T),j=Math.min(P*T,300);return f-R*((E+b*y*v)*Math.sinh(j)+P*v*Math.cosh(j))/P}}const k={calculatedDuration:S&&d||null,next:P=>{const T=x(P);if(S)a.done=P>=d;else{let R=0;b<1&&(R=P===0?Ts(E):Yx(x,P,T));const j=Math.abs(R)<=i,L=Math.abs(f-T)<=l;a.done=j&&L}return a.value=a.done?f:T,a},toString:()=>{const P=Math.min(px(k),Ah),T=mx(R=>k.next(P*R).value,P,30);return P+"ms "+T}};return k}function a0({keyframes:e,velocity:t=0,power:s=.8,timeConstant:i=325,bounceDamping:l=10,bounceStiffness:m=500,modifyTarget:f,min:a,max:c,restDelta:h=.5,restSpeed:g}){const d=e[0],_={done:!1,value:d},S=j=>a!==void 0&&j<a||c!==void 0&&j>c,E=j=>a===void 0?c:c===void 0||Math.abs(a-j)<Math.abs(c-j)?a:c;let b=s*t;const v=d+b,y=f===void 0?v:f(v);y!==v&&(b=y-d);const p=j=>-b*Math.exp(-j/i),x=j=>y+p(j),k=j=>{const L=p(j),$=x(j);_.done=Math.abs(L)<=h,_.value=_.done?y:$};let P,T;const R=j=>{S(_.value)&&(P=j,T=Xx({keyframes:[_.value,E(_.value)],velocity:Yx(x,j,_.value),damping:l,stiffness:m,restDelta:h,restSpeed:g}))};return R(0),{calculatedDuration:null,next:j=>{let L=!1;return!T&&P===void 0&&(L=!0,k(j),R(j)),P!==void 0&&j>=P?T.next(j-P):(!L&&k(j),_)}}}const cN=pa(.42,0,1,1),uN=pa(0,0,.58,1),Jx=pa(.42,0,.58,1),dN=e=>Array.isArray(e)&&typeof e[0]!="number",hN={linear:Cr,easeIn:cN,easeInOut:Jx,easeOut:uN,circIn:Vf,circInOut:Tx,circOut:Rx,backIn:Hf,backInOut:Nx,backOut:jx,anticipate:Px},l0=e=>{if(Of(e)){qy(e.length===4);const[t,s,i,l]=e;return pa(t,s,i,l)}else if(typeof e=="string")return hN[e];return e};function fN(e,t,s){const i=[],l=s||qx,m=e.length-1;for(let f=0;f<m;f++){let a=l(e[f],e[f+1]);if(t){const c=Array.isArray(t)?t[f]||Cr:t;a=ma(c,a)}i.push(a)}return i}function pN(e,t,{clamp:s=!0,ease:i,mixer:l}={}){const m=e.length;if(qy(m===t.length),m===1)return()=>t[0];if(m===2&&t[0]===t[1])return()=>t[1];const f=e[0]===e[1];e[0]>e[m-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=fN(t,i,l),c=a.length,h=g=>{if(f&&g<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(g<e[d+1]);d++);const _=Ii(e[d],e[d+1],g);return a[d](_)};return s?g=>h(Ms(e[0],e[m-1],g)):h}function mN(e,t){const s=e[e.length-1];for(let i=1;i<=t;i++){const l=Ii(0,t,i);e.push(at(s,1,l))}}function gN(e){const t=[0];return mN(t,e.length-1),t}function vN(e,t){return e.map(s=>s*t)}function yN(e,t){return e.map(()=>t||Jx).splice(0,e.length-1)}function lc({duration:e=300,keyframes:t,times:s,ease:i="easeInOut"}){const l=dN(i)?i.map(l0):l0(i),m={done:!1,value:t[0]},f=vN(s&&s.length===t.length?s:gN(t),e),a=pN(f,t,{ease:Array.isArray(l)?l:yN(t,l)});return{calculatedDuration:e,next:c=>(m.value=a(c),m.done=c>=e,m)}}const xN=e=>{const t=({timestamp:s})=>e(s);return{start:()=>st.update(t,!0),stop:()=>gn(t),now:()=>It.isProcessing?It.timestamp:fs.now()}},_N={decay:a0,inertia:a0,tween:lc,keyframes:lc,spring:Xx},wN=e=>e/100;class qf extends Kx{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:s,motionValue:i,element:l,keyframes:m}=this.options,f=(l==null?void 0:l.KeyframeResolver)||Kf,a=(c,h)=>this.onKeyframesResolved(c,h);this.resolver=new f(m,a,s,i,l),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:s="keyframes",repeat:i=0,repeatDelay:l=0,repeatType:m,velocity:f=0}=this.options,a=Lf(s)?s:_N[s]||lc;let c,h;a!==lc&&typeof t[0]!="number"&&(c=ma(wN,qx(t[0],t[1])),t=[0,100]);const g=a({...this.options,keyframes:t});m==="mirror"&&(h=a({...this.options,keyframes:[...t].reverse(),velocity:-f})),g.calculatedDuration===null&&(g.calculatedDuration=px(g));const{calculatedDuration:d}=g,_=d+l,S=_*(i+1)-l;return{generator:g,mirroredGenerator:h,mapPercentToKeyframes:c,calculatedDuration:d,resolvedDuration:_,totalDuration:S}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,s=!1){const{resolved:i}=this;if(!i){const{keyframes:j}=this.options;return{done:!0,value:j[j.length-1]}}const{finalKeyframe:l,generator:m,mirroredGenerator:f,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:h,totalDuration:g,resolvedDuration:d}=i;if(this.startTime===null)return m.next(0);const{delay:_,repeat:S,repeatType:E,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-g/this.speed,this.startTime)),s?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-_*(this.speed>=0?1:-1),p=this.speed>=0?y<0:y>g;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let x=this.currentTime,k=m;if(S){const j=Math.min(this.currentTime,g)/d;let L=Math.floor(j),$=j%1;!$&&j>=1&&($=1),$===1&&L--,L=Math.min(L,S+1),!!(L%2)&&(E==="reverse"?($=1-$,b&&($-=b/d)):E==="mirror"&&(k=f)),x=Ms(0,1,$)*d}const P=p?{done:!1,value:c[0]}:k.next(x);a&&(P.value=a(P.value));let{done:T}=P;!p&&h!==null&&(T=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return R&&l!==void 0&&(P.value=Mc(c,this.options,l)),v&&v(P.value),R&&this.finish(),P}get duration(){const{resolved:t}=this;return t?As(t.calculatedDuration):0}get time(){return As(this.currentTime)}set time(t){t=Ts(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;this.playbackSpeed=t,s&&(this.time=As(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=xN,onPlay:s,startTime:i}=this.options;this.driver||(this.driver=t(m=>this.tick(m))),s&&s();const l=this.driver.now();this.holdTime!==null?this.startTime=l-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=l):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const bN=new Set(["opacity","clipPath","filter","transform"]);function SN(e,t,s,{delay:i=0,duration:l=300,repeat:m=0,repeatType:f="loop",ease:a="easeInOut",times:c}={}){const h={[t]:s};c&&(h.offset=c);const g=vx(a,l);return Array.isArray(g)&&(h.easing=g),e.animate(h,{delay:i,duration:l,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:m+1,direction:f==="reverse"?"alternate":"normal"})}const CN=_f(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),cc=10,kN=2e4;function EN(e){return Lf(e.type)||e.type==="spring"||!gx(e.ease)}function jN(e,t){const s=new qf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const l=[];let m=0;for(;!i.done&&m<kN;)i=s.sample(m),l.push(i.value),m+=cc;return{times:void 0,keyframes:l,duration:m-cc,ease:"linear"}}const Qx={anticipate:Px,backInOut:Nx,circInOut:Tx};function NN(e){return e in Qx}class c0 extends Kx{constructor(t){super(t);const{name:s,motionValue:i,element:l,keyframes:m}=this.options;this.resolver=new Ux(m,(f,a)=>this.onKeyframesResolved(f,a),s,i,l),this.resolver.scheduleResolve()}initPlayback(t,s){let{duration:i=300,times:l,ease:m,type:f,motionValue:a,name:c,startTime:h}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof m=="string"&&oc()&&NN(m)&&(m=Qx[m]),EN(this.options)){const{onComplete:d,onUpdate:_,motionValue:S,element:E,...b}=this.options,v=jN(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,l=v.times,m=v.ease,f="keyframes"}const g=SN(a.owner.current,c,t,{...this.options,duration:i,times:l,ease:m});return g.startTime=h??this.calcStartTime(),this.pendingTimeline?(Gv(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:d}=this.options;a.set(Mc(t,this.options,s)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:i,times:l,type:f,ease:m,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:s}=t;return As(s)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:s}=t;return As(s.currentTime||0)}set time(t){const{resolved:s}=this;if(!s)return;const{animation:i}=s;i.currentTime=Ts(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:s}=t;return s.playbackRate}set speed(t){const{resolved:s}=this;if(!s)return;const{animation:i}=s;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:s}=t;return s.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:s}=t;return s.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:s}=this;if(!s)return Cr;const{animation:i}=s;Gv(i,t)}return Cr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:s}=t;s.playState==="finished"&&this.updateFinishedPromise(),s.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:s}=t;s.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:s,keyframes:i,duration:l,type:m,ease:f,times:a}=t;if(s.playState==="idle"||s.playState==="finished")return;if(this.time){const{motionValue:h,onUpdate:g,onComplete:d,element:_,...S}=this.options,E=new qf({...S,keyframes:i,duration:l,type:m,ease:f,times:a,isGenerator:!0}),b=Ts(this.time);h.setWithVelocity(E.sample(b-cc).value,E.sample(b).value,cc)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:s,name:i,repeatDelay:l,repeatType:m,damping:f,type:a}=t;if(!s||!s.owner||!(s.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:h}=s.owner.getProps();return CN()&&i&&bN.has(i)&&!c&&!h&&!l&&m!=="mirror"&&f!==0&&a!=="inertia"}}const PN={type:"spring",stiffness:500,damping:25,restSpeed:10},RN=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),TN={type:"keyframes",duration:.8},AN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},DN=(e,{keyframes:t})=>t.length>2?TN:Zn.has(e)?e.startsWith("scale")?RN(t[1]):PN:AN;function MN({when:e,delay:t,delayChildren:s,staggerChildren:i,staggerDirection:l,repeat:m,repeatType:f,repeatDelay:a,from:c,elapsed:h,...g}){return!!Object.keys(g).length}const Yf=(e,t,s,i={},l,m)=>f=>{const a=Mf(i,e)||{},c=a.delay||i.delay||0;let{elapsed:h=0}=i;h=h-Ts(c);let g={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-h,onUpdate:_=>{t.set(_),a.onUpdate&&a.onUpdate(_)},onComplete:()=>{f(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:m?void 0:l};MN(a)||(g={...g,...DN(e,g)}),g.duration&&(g.duration=Ts(g.duration)),g.repeatDelay&&(g.repeatDelay=Ts(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let d=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(d=!0)),d&&!m&&t.get()!==void 0){const _=Mc(g.keyframes,a);if(_!==void 0)return st.update(()=>{g.onUpdate(_),g.onComplete()}),new ZE([])}return!m&&c0.supports(g)?new c0(g):new qf(g)};function LN({protectedKeys:e,needsAnimating:t},s){const i=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,i}function Zx(e,t,{delay:s=0,transitionOverride:i,type:l}={}){var m;let{transition:f=e.getDefaultTransition(),transitionEnd:a,...c}=t;i&&(f=i);const h=[],g=l&&e.animationState&&e.animationState.getState()[l];for(const d in c){const _=e.getValue(d,(m=e.latestValues[d])!==null&&m!==void 0?m:null),S=c[d];if(S===void 0||g&&LN(g,d))continue;const E={delay:s,...Mf(f||{},d)};let b=!1;if(window.MotionHandoffAnimation){const y=Sx(e);if(y){const p=window.MotionHandoffAnimation(y,d,st);p!==null&&(E.startTime=p,b=!0)}}Mh(e,d),_.start(Yf(d,_,S,e.shouldReduceMotion&&wx.has(d)?{type:!1}:E,e,b));const v=_.animation;v&&h.push(v)}return a&&Promise.all(h).then(()=>{st.update(()=>{a&&fj(e,a)})}),h}function Hh(e,t,s={}){var i;const l=Dc(e,t,s.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:m=e.getDefaultTransition()||{}}=l||{};s.transitionOverride&&(m=s.transitionOverride);const f=l?()=>Promise.all(Zx(e,l,s)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:g=0,staggerChildren:d,staggerDirection:_}=m;return ON(e,t,g+h,d,_,s)}:()=>Promise.resolve(),{when:c}=m;if(c){const[h,g]=c==="beforeChildren"?[f,a]:[a,f];return h().then(()=>g())}else return Promise.all([f(),a(s.delay)])}function ON(e,t,s=0,i=0,l=1,m){const f=[],a=(e.variantChildren.size-1)*i,c=l===1?(h=0)=>h*i:(h=0)=>a-h*i;return Array.from(e.variantChildren).sort(IN).forEach((h,g)=>{h.notify("AnimationStart",t),f.push(Hh(h,t,{...m,delay:s+c(g)}).then(()=>h.notify("AnimationComplete",t)))}),Promise.all(f)}function IN(e,t){return e.sortNodePosition(t)}function BN(e,t,s={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const l=t.map(m=>Hh(e,m,s));i=Promise.all(l)}else if(typeof t=="string")i=Hh(e,t,s);else{const l=typeof t=="function"?Dc(e,t,s.custom):t;i=Promise.all(Zx(e,l,s))}return i.then(()=>{e.notify("AnimationComplete",t)})}const FN=bf.length;function e_(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?e_(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<FN;s++){const i=bf[s],l=e.props[i];(Jo(l)||l===!1)&&(t[i]=l)}return t}const $N=[...wf].reverse(),HN=wf.length;function VN(e){return t=>Promise.all(t.map(({animation:s,options:i})=>BN(e,s,i)))}function zN(e){let t=VN(e),s=u0(),i=!0;const l=c=>(h,g)=>{var d;const _=Dc(e,g,c==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(_){const{transition:S,transitionEnd:E,...b}=_;h={...h,...b,...E}}return h};function m(c){t=c(e)}function f(c){const{props:h}=e,g=e_(e.parent)||{},d=[],_=new Set;let S={},E=1/0;for(let v=0;v<HN;v++){const y=$N[v],p=s[y],x=h[y]!==void 0?h[y]:g[y],k=Jo(x),P=y===c?p.isActive:null;P===!1&&(E=v);let T=x===g[y]&&x!==h[y]&&k;if(T&&i&&e.manuallyAnimateOnMount&&(T=!1),p.protectedKeys={...S},!p.isActive&&P===null||!x&&!p.prevProp||Tc(x)||typeof x=="boolean")continue;const R=WN(p.prevProp,x);let j=R||y===c&&p.isActive&&!T&&k||v>E&&k,L=!1;const $=Array.isArray(x)?x:[x];let F=$.reduce(l(y),{});P===!1&&(F={});const{prevResolvedValues:W={}}=p,H={...W,...F},J=ee=>{j=!0,_.has(ee)&&(L=!0,_.delete(ee)),p.needsAnimating[ee]=!0;const z=e.getValue(ee);z&&(z.liveStyle=!1)};for(const ee in H){const z=F[ee],M=W[ee];if(S.hasOwnProperty(ee))continue;let B=!1;Th(z)&&Th(M)?B=!fx(z,M):B=z!==M,B?z!=null?J(ee):_.add(ee):z!==void 0&&_.has(ee)?J(ee):p.protectedKeys[ee]=!0}p.prevProp=x,p.prevResolvedValues=F,p.isActive&&(S={...S,...F}),i&&e.blockInitialAnimation&&(j=!1),j&&(!(T&&R)||L)&&d.push(...$.map(ee=>({animation:ee,options:{type:y}})))}if(_.size){const v={};_.forEach(y=>{const p=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=p??null}),d.push({animation:v})}let b=!!d.length;return i&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?t(d):Promise.resolve()}function a(c,h){var g;if(s[c].isActive===h)return Promise.resolve();(g=e.variantChildren)===null||g===void 0||g.forEach(_=>{var S;return(S=_.animationState)===null||S===void 0?void 0:S.setActive(c,h)}),s[c].isActive=h;const d=f(c);for(const _ in s)s[_].protectedKeys={};return d}return{animateChanges:f,setActive:a,setAnimateFunction:m,getState:()=>s,reset:()=>{s=u0(),i=!0}}}function WN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!fx(t,e):!1}function Bn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function u0(){return{animate:Bn(!0),whileInView:Bn(),whileHover:Bn(),whileTap:Bn(),whileDrag:Bn(),whileFocus:Bn(),exit:Bn()}}class _n{constructor(t){this.isMounted=!1,this.node=t}update(){}}class UN extends _n{constructor(t){super(t),t.animationState||(t.animationState=zN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Tc(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let KN=0;class GN extends _n{constructor(){super(...arguments),this.id=KN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const l=this.node.animationState.setActive("exit",!t);s&&!t&&l.then(()=>s(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const qN={animation:{Feature:UN},exit:{Feature:GN}};function ta(e,t,s,i={passive:!0}){return e.addEventListener(t,s,i),()=>e.removeEventListener(t,s)}function ga(e){return{point:{x:e.pageX,y:e.pageY}}}const YN=e=>t=>If(t)&&e(t,ga(t));function qo(e,t,s,i){return ta(e,t,YN(s),i)}const d0=(e,t)=>Math.abs(e-t);function XN(e,t){const s=d0(e.x,t.x),i=d0(e.y,t.y);return Math.sqrt(s**2+i**2)}class t_{constructor(t,s,{transformPagePoint:i,contextWindow:l,dragSnapToOrigin:m=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=nh(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,S=XN(d.offset,{x:0,y:0})>=3;if(!_&&!S)return;const{point:E}=d,{timestamp:b}=It;this.history.push({...E,timestamp:b});const{onStart:v,onMove:y}=this.handlers;_||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,_)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=sh(_,this.transformPagePoint),st.update(this.updatePoint,!0)},this.handlePointerUp=(d,_)=>{this.end();const{onEnd:S,onSessionEnd:E,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=nh(d.type==="pointercancel"?this.lastMoveEventInfo:sh(_,this.transformPagePoint),this.history);this.startEvent&&S&&S(d,v),E&&E(d,v)},!If(t))return;this.dragSnapToOrigin=m,this.handlers=s,this.transformPagePoint=i,this.contextWindow=l||window;const f=ga(t),a=sh(f,this.transformPagePoint),{point:c}=a,{timestamp:h}=It;this.history=[{...c,timestamp:h}];const{onSessionStart:g}=s;g&&g(t,nh(a,this.history)),this.removeListeners=ma(qo(this.contextWindow,"pointermove",this.handlePointerMove),qo(this.contextWindow,"pointerup",this.handlePointerUp),qo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),gn(this.updatePoint)}}function sh(e,t){return t?{point:t(e.point)}:e}function h0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nh({point:e},t){return{point:e,delta:h0(e,r_(t)),offset:h0(e,JN(t)),velocity:QN(t,.1)}}function JN(e){return e[0]}function r_(e){return e[e.length-1]}function QN(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,i=null;const l=r_(e);for(;s>=0&&(i=e[s],!(l.timestamp-i.timestamp>Ts(t)));)s--;if(!i)return{x:0,y:0};const m=As(l.timestamp-i.timestamp);if(m===0)return{x:0,y:0};const f={x:(l.x-i.x)/m,y:(l.y-i.y)/m};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}const s_=1e-4,ZN=1-s_,eP=1+s_,n_=.01,tP=0-n_,rP=0+n_;function jr(e){return e.max-e.min}function sP(e,t,s){return Math.abs(e-t)<=s}function f0(e,t,s,i=.5){e.origin=i,e.originPoint=at(t.min,t.max,e.origin),e.scale=jr(s)/jr(t),e.translate=at(s.min,s.max,e.origin)-e.originPoint,(e.scale>=ZN&&e.scale<=eP||isNaN(e.scale))&&(e.scale=1),(e.translate>=tP&&e.translate<=rP||isNaN(e.translate))&&(e.translate=0)}function Yo(e,t,s,i){f0(e.x,t.x,s.x,i?i.originX:void 0),f0(e.y,t.y,s.y,i?i.originY:void 0)}function p0(e,t,s){e.min=s.min+t.min,e.max=e.min+jr(t)}function nP(e,t,s){p0(e.x,t.x,s.x),p0(e.y,t.y,s.y)}function m0(e,t,s){e.min=t.min-s.min,e.max=e.min+jr(t)}function Xo(e,t,s){m0(e.x,t.x,s.x),m0(e.y,t.y,s.y)}function iP(e,{min:t,max:s},i){return t!==void 0&&e<t?e=i?at(t,e,i.min):Math.max(e,t):s!==void 0&&e>s&&(e=i?at(s,e,i.max):Math.min(e,s)),e}function g0(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function oP(e,{top:t,left:s,bottom:i,right:l}){return{x:g0(e.x,s,l),y:g0(e.y,t,i)}}function v0(e,t){let s=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,i]=[i,s]),{min:s,max:i}}function aP(e,t){return{x:v0(e.x,t.x),y:v0(e.y,t.y)}}function lP(e,t){let s=.5;const i=jr(e),l=jr(t);return l>i?s=Ii(t.min,t.max-i,e.min):i>l&&(s=Ii(e.min,e.max-l,t.min)),Ms(0,1,s)}function cP(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const Vh=.35;function uP(e=Vh){return e===!1?e=0:e===!0&&(e=Vh),{x:y0(e,"left","right"),y:y0(e,"top","bottom")}}function y0(e,t,s){return{min:x0(e,t),max:x0(e,s)}}function x0(e,t){return typeof e=="number"?e:e[t]||0}const _0=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ti=()=>({x:_0(),y:_0()}),w0=()=>({min:0,max:0}),gt=()=>({x:w0(),y:w0()});function Br(e){return[e("x"),e("y")]}function i_({top:e,left:t,right:s,bottom:i}){return{x:{min:t,max:s},y:{min:e,max:i}}}function dP({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hP(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:i.y,right:i.x}}function ih(e){return e===void 0||e===1}function zh({scale:e,scaleX:t,scaleY:s}){return!ih(e)||!ih(t)||!ih(s)}function $n(e){return zh(e)||o_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function o_(e){return b0(e.x)||b0(e.y)}function b0(e){return e&&e!=="0%"}function uc(e,t,s){const i=e-s,l=t*i;return s+l}function S0(e,t,s,i,l){return l!==void 0&&(e=uc(e,l,i)),uc(e,s,i)+t}function Wh(e,t=0,s=1,i,l){e.min=S0(e.min,t,s,i,l),e.max=S0(e.max,t,s,i,l)}function a_(e,{x:t,y:s}){Wh(e.x,t.translate,t.scale,t.originPoint),Wh(e.y,s.translate,s.scale,s.originPoint)}const C0=.999999999999,k0=1.0000000000001;function fP(e,t,s,i=!1){const l=s.length;if(!l)return;t.x=t.y=1;let m,f;for(let a=0;a<l;a++){m=s[a],f=m.projectionDelta;const{visualElement:c}=m.options;c&&c.props.style&&c.props.style.display==="contents"||(i&&m.options.layoutScroll&&m.scroll&&m!==m.root&&Di(e,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),f&&(t.x*=f.x.scale,t.y*=f.y.scale,a_(e,f)),i&&$n(m.latestValues)&&Di(e,m.latestValues))}t.x<k0&&t.x>C0&&(t.x=1),t.y<k0&&t.y>C0&&(t.y=1)}function Ai(e,t){e.min=e.min+t,e.max=e.max+t}function E0(e,t,s,i,l=.5){const m=at(e.min,e.max,l);Wh(e,t,s,m,i)}function Di(e,t){E0(e.x,t.x,t.scaleX,t.scale,t.originX),E0(e.y,t.y,t.scaleY,t.scale,t.originY)}function l_(e,t){return i_(hP(e.getBoundingClientRect(),t))}function pP(e,t,s){const i=l_(e,s),{scroll:l}=t;return l&&(Ai(i.x,l.offset.x),Ai(i.y,l.offset.y)),i}const c_=({current:e})=>e?e.ownerDocument.defaultView:null,mP=new WeakMap;class gP{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=gt(),this.visualElement=t}start(t,{snapToCursor:s=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const l=g=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(ga(g).point)},m=(g,d)=>{const{drag:_,dragPropagation:S,onDragStart:E}=this.getProps();if(_&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=lj(_),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Br(v=>{let y=this.getAxisMotionValue(v).get()||0;if(hs.test(y)){const{projection:p}=this.visualElement;if(p&&p.layout){const x=p.layout.layoutBox[v];x&&(y=jr(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),E&&st.postRender(()=>E(g,d)),Mh(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},f=(g,d)=>{const{dragPropagation:_,dragDirectionLock:S,onDirectionLock:E,onDrag:b}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:v}=d;if(S&&this.currentDirection===null){this.currentDirection=vP(v),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),b&&b(g,d)},a=(g,d)=>this.stop(g,d),c=()=>Br(g=>{var d;return this.getAnimationState(g)==="paused"&&((d=this.getAxisMotionValue(g).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:h}=this.getProps();this.panSession=new t_(t,{onSessionStart:l,onStart:m,onMove:f,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,contextWindow:c_(this.visualElement)})}stop(t,s){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:m}=this.getProps();m&&st.postRender(()=>m(t,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(t,s,i){const{drag:l}=this.getProps();if(!i||!Vl(t,l,this.currentDirection))return;const m=this.getAxisMotionValue(t);let f=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(f=iP(f,this.constraints[t],this.elastic[t])),m.set(f)}resolveConstraints(){var t;const{dragConstraints:s,dragElastic:i}=this.getProps(),l=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,m=this.constraints;s&&Pi(s)?this.constraints||(this.constraints=this.resolveRefConstraints()):s&&l?this.constraints=oP(l.layoutBox,s):this.constraints=!1,this.elastic=uP(i),m!==this.constraints&&l&&this.constraints&&!this.hasMutatedConstraints&&Br(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=cP(l.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!Pi(t))return!1;const i=t.current,{projection:l}=this.visualElement;if(!l||!l.layout)return!1;const m=pP(i,l.root,this.visualElement.getTransformPagePoint());let f=aP(l.layout.layoutBox,m);if(s){const a=s(dP(f));this.hasMutatedConstraints=!!a,a&&(f=i_(a))}return f}startAnimation(t){const{drag:s,dragMomentum:i,dragElastic:l,dragTransition:m,dragSnapToOrigin:f,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},h=Br(g=>{if(!Vl(g,s,this.currentDirection))return;let d=c&&c[g]||{};f&&(d={min:0,max:0});const _=l?200:1e6,S=l?40:1e7,E={type:"inertia",velocity:i?t[g]:0,bounceStiffness:_,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...m,...d};return this.startAxisValueAnimation(g,E)});return Promise.all(h).then(a)}startAxisValueAnimation(t,s){const i=this.getAxisMotionValue(t);return Mh(this.visualElement,t),i.start(Yf(t,i,0,s,this.visualElement,!1))}stopAnimation(){Br(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Br(t=>{var s;return(s=this.getAxisMotionValue(t).animation)===null||s===void 0?void 0:s.pause()})}getAnimationState(t){var s;return(s=this.getAxisMotionValue(t).animation)===null||s===void 0?void 0:s.state}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),l=i[s];return l||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Br(s=>{const{drag:i}=this.getProps();if(!Vl(s,i,this.currentDirection))return;const{projection:l}=this.visualElement,m=this.getAxisMotionValue(s);if(l&&l.layout){const{min:f,max:a}=l.layout.layoutBox[s];m.set(t[s]-at(f,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:i}=this.visualElement;if(!Pi(s)||!i||!this.constraints)return;this.stopAnimation();const l={x:0,y:0};Br(f=>{const a=this.getAxisMotionValue(f);if(a&&this.constraints!==!1){const c=a.get();l[f]=lP({min:c,max:c},this.constraints[f])}});const{transformTemplate:m}=this.visualElement.getProps();this.visualElement.current.style.transform=m?m({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Br(f=>{if(!Vl(f,t,null))return;const a=this.getAxisMotionValue(f),{min:c,max:h}=this.constraints[f];a.set(at(c,h,l[f]))})}addListeners(){if(!this.visualElement.current)return;mP.set(this.visualElement,this);const t=this.visualElement.current,s=qo(t,"pointerdown",c=>{const{drag:h,dragListener:g=!0}=this.getProps();h&&g&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Pi(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:l}=this.visualElement,m=l.addEventListener("measure",i);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),st.read(i);const f=ta(window,"resize",()=>this.scalePositionWithinConstraints()),a=l.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:h})=>{this.isDragging&&h&&(Br(g=>{const d=this.getAxisMotionValue(g);d&&(this.originPoint[g]+=c[g].translate,d.set(d.get()+c[g].translate))}),this.visualElement.render())}));return()=>{f(),s(),m(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:i=!1,dragPropagation:l=!1,dragConstraints:m=!1,dragElastic:f=Vh,dragMomentum:a=!0}=t;return{...t,drag:s,dragDirectionLock:i,dragPropagation:l,dragConstraints:m,dragElastic:f,dragMomentum:a}}}function Vl(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function vP(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class yP extends _n{constructor(t){super(t),this.removeGroupControls=Cr,this.removeListeners=Cr,this.controls=new gP(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cr}unmount(){this.removeGroupControls(),this.removeListeners()}}const j0=e=>(t,s)=>{e&&st.postRender(()=>e(t,s))};class xP extends _n{constructor(){super(...arguments),this.removePointerDownListener=Cr}onPointerDown(t){this.session=new t_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:c_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:i,onPanEnd:l}=this.node.getProps();return{onSessionStart:j0(t),onStart:j0(s),onMove:i,onEnd:(m,f)=>{delete this.session,l&&st.postRender(()=>l(m,f))}}}mount(){this.removePointerDownListener=qo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Zl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function N0(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const $o={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Oe.test(e))e=parseFloat(e);else return e;const s=N0(e,t.target.x),i=N0(e,t.target.y);return`${s}% ${i}%`}},_P={correct:(e,{treeScale:t,projectionDelta:s})=>{const i=e,l=vn.parse(e);if(l.length>5)return i;const m=vn.createTransformer(e),f=typeof l[0]!="number"?1:0,a=s.x.scale*t.x,c=s.y.scale*t.y;l[0+f]/=a,l[1+f]/=c;const h=at(a,c,.5);return typeof l[2+f]=="number"&&(l[2+f]/=h),typeof l[3+f]=="number"&&(l[3+f]/=h),m(l)}};class wP extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:i,layoutId:l}=this.props,{projection:m}=t;HE(bP),m&&(s.group&&s.group.add(m),i&&i.register&&l&&i.register(m),m.root.didUpdate(),m.addEventListener("animationComplete",()=>{this.safeToRemove()}),m.setOptions({...m.options,onExitComplete:()=>this.safeToRemove()})),Zl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:i,drag:l,isPresent:m}=this.props,f=i.projection;return f&&(f.isPresent=m,l||t.layoutDependency!==s||s===void 0?f.willUpdate():this.safeToRemove(),t.isPresent!==m&&(m?f.promote():f.relegate()||st.postRender(()=>{const a=f.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Cf.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:i}=this.props,{projection:l}=t;l&&(l.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(l),i&&i.deregister&&i.deregister(l))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function u_(e){const[t,s]=Uy(),i=C.useContext(gf);return o.jsx(wP,{...e,layoutGroup:i,switchLayoutGroup:C.useContext(ex),isPresent:t,safeToRemove:s})}const bP={borderRadius:{...$o,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$o,borderTopRightRadius:$o,borderBottomLeftRadius:$o,borderBottomRightRadius:$o,boxShadow:_P};function SP(e,t,s){const i=Yt(e)?e:Zo(e);return i.start(Yf("",i,t,s)),i.animation}function CP(e){return e instanceof SVGElement&&e.tagName!=="svg"}const kP=(e,t)=>e.depth-t.depth;class EP{constructor(){this.children=[],this.isDirty=!1}add(t){Bf(this.children,t),this.isDirty=!0}remove(t){Ff(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(kP),this.isDirty=!1,this.children.forEach(t)}}function jP(e,t){const s=fs.now(),i=({timestamp:l})=>{const m=l-s;m>=t&&(gn(i),e(m-t))};return st.read(i,!0),()=>gn(i)}const d_=["TopLeft","TopRight","BottomLeft","BottomRight"],NP=d_.length,P0=e=>typeof e=="string"?parseFloat(e):e,R0=e=>typeof e=="number"||Oe.test(e);function PP(e,t,s,i,l,m){l?(e.opacity=at(0,s.opacity!==void 0?s.opacity:1,RP(i)),e.opacityExit=at(t.opacity!==void 0?t.opacity:1,0,TP(i))):m&&(e.opacity=at(t.opacity!==void 0?t.opacity:1,s.opacity!==void 0?s.opacity:1,i));for(let f=0;f<NP;f++){const a=`border${d_[f]}Radius`;let c=T0(t,a),h=T0(s,a);if(c===void 0&&h===void 0)continue;c||(c=0),h||(h=0),c===0||h===0||R0(c)===R0(h)?(e[a]=Math.max(at(P0(c),P0(h),i),0),(hs.test(h)||hs.test(c))&&(e[a]+="%")):e[a]=h}(t.rotate||s.rotate)&&(e.rotate=at(t.rotate||0,s.rotate||0,i))}function T0(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const RP=h_(0,.5,Rx),TP=h_(.5,.95,Cr);function h_(e,t,s){return i=>i<e?0:i>t?1:s(Ii(e,t,i))}function A0(e,t){e.min=t.min,e.max=t.max}function Ir(e,t){A0(e.x,t.x),A0(e.y,t.y)}function D0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function M0(e,t,s,i,l){return e-=t,e=uc(e,1/s,i),l!==void 0&&(e=uc(e,1/l,i)),e}function AP(e,t=0,s=1,i=.5,l,m=e,f=e){if(hs.test(t)&&(t=parseFloat(t),t=at(f.min,f.max,t/100)-f.min),typeof t!="number")return;let a=at(m.min,m.max,i);e===m&&(a-=t),e.min=M0(e.min,t,s,a,l),e.max=M0(e.max,t,s,a,l)}function L0(e,t,[s,i,l],m,f){AP(e,t[s],t[i],t[l],t.scale,m,f)}const DP=["x","scaleX","originX"],MP=["y","scaleY","originY"];function O0(e,t,s,i){L0(e.x,t,DP,s?s.x:void 0,i?i.x:void 0),L0(e.y,t,MP,s?s.y:void 0,i?i.y:void 0)}function I0(e){return e.translate===0&&e.scale===1}function f_(e){return I0(e.x)&&I0(e.y)}function B0(e,t){return e.min===t.min&&e.max===t.max}function LP(e,t){return B0(e.x,t.x)&&B0(e.y,t.y)}function F0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function p_(e,t){return F0(e.x,t.x)&&F0(e.y,t.y)}function $0(e){return jr(e.x)/jr(e.y)}function H0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class OP{constructor(){this.members=[]}add(t){Bf(this.members,t),t.scheduleRender()}remove(t){if(Ff(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){const s=this.members.findIndex(l=>t===l);if(s===0)return!1;let i;for(let l=s;l>=0;l--){const m=this.members[l];if(m.isPresent!==!1){i=m;break}}return i?(this.promote(i),!0):!1}promote(t,s){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,s&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:l}=t.options;l===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:s,resumingFrom:i}=t;s.onExitComplete&&s.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function IP(e,t,s){let i="";const l=e.x.translate/t.x,m=e.y.translate/t.y,f=(s==null?void 0:s.z)||0;if((l||m||f)&&(i=`translate3d(${l}px, ${m}px, ${f}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:h,rotate:g,rotateX:d,rotateY:_,skewX:S,skewY:E}=s;h&&(i=`perspective(${h}px) ${i}`),g&&(i+=`rotate(${g}deg) `),d&&(i+=`rotateX(${d}deg) `),_&&(i+=`rotateY(${_}deg) `),S&&(i+=`skewX(${S}deg) `),E&&(i+=`skewY(${E}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(i+=`scale(${a}, ${c})`),i||"none"}const Hn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Wo=typeof window<"u"&&window.MotionDebug!==void 0,oh=["","X","Y","Z"],BP={visibility:"hidden"},V0=1e3;let FP=0;function ah(e,t,s,i){const{latestValues:l}=t;l[e]&&(s[e]=l[e],t.setStaticValue(e,0),i&&(i[e]=0))}function m_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=Sx(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:l,layoutId:m}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",st,!(l||m))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&m_(i)}function g_({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:i,resetTransform:l}){return class{constructor(f={},a=t==null?void 0:t()){this.id=FP++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Wo&&(Hn.totalNodes=Hn.resolvedTargetDeltas=Hn.recalculatedProjection=0),this.nodes.forEach(VP),this.nodes.forEach(GP),this.nodes.forEach(qP),this.nodes.forEach(zP),Wo&&window.MotionDebug.record(Hn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new EP)}addEventListener(f,a){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new $f),this.eventHandlers.get(f).add(a)}notifyListeners(f,...a){const c=this.eventHandlers.get(f);c&&c.notify(...a)}hasListeners(f){return this.eventHandlers.has(f)}mount(f,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=CP(f),this.instance=f;const{layoutId:c,layout:h,visualElement:g}=this.options;if(g&&!g.current&&g.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(h||c)&&(this.isLayoutDirty=!0),e){let d;const _=()=>this.root.updateBlockedByResize=!1;e(f,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=jP(_,250),Zl.hasAnimatedSinceResize&&(Zl.hasAnimatedSinceResize=!1,this.nodes.forEach(W0))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&g&&(c||h)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:_,hasRelativeTargetChanged:S,layout:E})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||g.getDefaultTransition()||ZP,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=g.getProps(),p=!this.targetLayout||!p_(this.targetLayout,E)||S,x=!_&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||_&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const k={...Mf(b,"layout"),onPlay:v,onComplete:y};(g.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else _||W0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=E})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,gn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(YP),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&m_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const d=this.path[g];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(z0);return}this.isUpdating||this.nodes.forEach(UP),this.isUpdating=!1,this.nodes.forEach(KP),this.nodes.forEach($P),this.nodes.forEach(HP),this.clearAllSnapshots();const a=fs.now();It.delta=Ms(0,1e3/60,a-It.timestamp),It.timestamp=a,It.isProcessing=!0,Jd.update.process(It),Jd.preRender.process(It),Jd.render.process(It),It.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Cf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(WP),this.sharedNodes.forEach(XP)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,st.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){st.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=gt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(a=!1),a){const c=i(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:c,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!l)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!f_(this.projectionDelta),c=this.getTransformTemplate(),h=c?c(this.latestValues,""):void 0,g=h!==this.prevTransformTemplateValue;f&&(a||$n(this.latestValues)||g)&&(l(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return f&&(c=this.removeTransform(c)),eR(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:a}=this.options;if(!a)return gt();const c=a.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some(tR))){const{scroll:g}=this.root;g&&(Ai(c.x,g.offset.x),Ai(c.y,g.offset.y))}return c}removeElementScroll(f){var a;const c=gt();if(Ir(c,f),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return c;for(let h=0;h<this.path.length;h++){const g=this.path[h],{scroll:d,options:_}=g;g!==this.root&&d&&_.layoutScroll&&(d.wasRoot&&Ir(c,f),Ai(c.x,d.offset.x),Ai(c.y,d.offset.y))}return c}applyTransform(f,a=!1){const c=gt();Ir(c,f);for(let h=0;h<this.path.length;h++){const g=this.path[h];!a&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Di(c,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),$n(g.latestValues)&&Di(c,g.latestValues)}return $n(this.latestValues)&&Di(c,this.latestValues),c}removeTransform(f){const a=gt();Ir(a,f);for(let c=0;c<this.path.length;c++){const h=this.path[c];if(!h.instance||!$n(h.latestValues))continue;zh(h.latestValues)&&h.updateSnapshot();const g=gt(),d=h.measurePageBox();Ir(g,d),O0(a,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,g)}return $n(this.latestValues)&&O0(a,this.latestValues),a}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==It.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var a;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==c;if(!(f||h&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:_}=this.options;if(!(!this.layout||!(d||_))){if(this.resolvedRelativeTargetAt=It.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gt(),this.relativeTargetOrigin=gt(),Xo(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=gt(),this.targetWithTransforms=gt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ir(this.target,this.layout.layoutBox),a_(this.target,this.targetDelta)):Ir(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gt(),this.relativeTargetOrigin=gt(),Xo(this.relativeTargetOrigin,this.target,S.target),Ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Wo&&Hn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||zh(this.parent.latestValues)||o_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var f;const a=this.getLead(),c=!!this.resumingFrom||this!==a;let h=!0;if((this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty)&&(h=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===It.timestamp&&(h=!1),h)return;const{layout:g,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||d))return;Ir(this.layoutCorrected,this.layout.layoutBox);const _=this.treeScale.x,S=this.treeScale.y;fP(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=gt());const{target:E}=a;if(!E){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(D0(this.prevProjectionDelta.x,this.projectionDelta.x),D0(this.prevProjectionDelta.y,this.projectionDelta.y)),Yo(this.projectionDelta,this.layoutCorrected,E,this.latestValues),(this.treeScale.x!==_||this.treeScale.y!==S||!H0(this.projectionDelta.x,this.prevProjectionDelta.x)||!H0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",E)),Wo&&Hn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),f){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ti(),this.projectionDelta=Ti(),this.projectionDeltaWithTransform=Ti()}setAnimationOrigin(f,a=!1){const c=this.snapshot,h=c?c.latestValues:{},g={...this.latestValues},d=Ti();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const _=gt(),S=c?c.source:void 0,E=this.layout?this.layout.source:void 0,b=S!==E,v=this.getStack(),y=!v||v.members.length<=1,p=!!(b&&!y&&this.options.crossfade===!0&&!this.path.some(QP));this.animationProgress=0;let x;this.mixTargetDelta=k=>{const P=k/1e3;U0(d.x,f.x,P),U0(d.y,f.y,P),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xo(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox),JP(this.relativeTarget,this.relativeTargetOrigin,_,P),x&&LP(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=gt()),Ir(x,this.relativeTarget)),b&&(this.animationValues=g,PP(g,h,this.latestValues,P,p,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(gn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=st.update(()=>{Zl.hasAnimatedSinceResize=!0,this.currentAnimation=SP(0,V0,{...f,onUpdate:a=>{this.mixTargetDelta(a),f.onUpdate&&f.onUpdate(a)},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(V0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:a,target:c,layout:h,latestValues:g}=f;if(!(!a||!c||!h)){if(this!==f&&this.layout&&h&&v_(this.options.animationType,this.layout.layoutBox,h.layoutBox)){c=this.target||gt();const d=jr(this.layout.layoutBox.x);c.x.min=f.target.x.min,c.x.max=c.x.min+d;const _=jr(this.layout.layoutBox.y);c.y.min=f.target.y.min,c.y.max=c.y.min+_}Ir(a,c),Di(a,g),Yo(this.projectionDeltaWithTransform,this.layoutCorrected,a,g)}}registerSharedNode(f,a){this.sharedNodes.has(f)||this.sharedNodes.set(f,new OP),this.sharedNodes.get(f).add(a);const h=a.options.initialPromotionConfig;a.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(a):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var f;const{layoutId:a}=this.options;return a?((f=this.getStack())===null||f===void 0?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:a}=this.options;return a?(f=this.getStack())===null||f===void 0?void 0:f.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:a,preserveFollowOpacity:c}={}){const h=this.getStack();h&&h.promote(this,c),f&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let a=!1;const{latestValues:c}=f;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const h={};c.z&&ah("z",f,h,this.animationValues);for(let g=0;g<oh.length;g++)ah(`rotate${oh[g]}`,f,h,this.animationValues),ah(`skew${oh[g]}`,f,h,this.animationValues);f.render();for(const g in h)f.setStaticValue(g,h[g]),this.animationValues&&(this.animationValues[g]=h[g]);f.scheduleRender()}getProjectionStyles(f){var a,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return BP;const h={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,h.opacity="",h.pointerEvents=Jl(f==null?void 0:f.pointerEvents)||"",h.transform=g?g(this.latestValues,""):"none",h;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const b={};return this.options.layoutId&&(b.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,b.pointerEvents=Jl(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!$n(this.latestValues)&&(b.transform=g?g({},""):"none",this.hasProjected=!1),b}const _=d.animationValues||d.latestValues;this.applyTransformsToTarget(),h.transform=IP(this.projectionDeltaWithTransform,this.treeScale,_),g&&(h.transform=g(_,h.transform));const{x:S,y:E}=this.projectionDelta;h.transformOrigin=`${S.origin*100}% ${E.origin*100}% 0`,d.animationValues?h.opacity=d===this?(c=(a=_.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:_.opacityExit:h.opacity=d===this?_.opacity!==void 0?_.opacity:"":_.opacityExit!==void 0?_.opacityExit:0;for(const b in ic){if(_[b]===void 0)continue;const{correct:v,applyTo:y}=ic[b],p=h.transform==="none"?_[b]:v(_[b],d);if(y){const x=y.length;for(let k=0;k<x;k++)h[y[k]]=p}else h[b]=p}return this.options.layoutId&&(h.pointerEvents=d===this?Jl(f==null?void 0:f.pointerEvents)||"":"none"),h}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var a;return(a=f.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(z0),this.root.sharedNodes.clear()}}}function $P(e){e.updateLayout()}function HP(e){var t;const s=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&s&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:l}=e.layout,{animationType:m}=e.options,f=s.source!==e.layout.source;m==="size"?Br(d=>{const _=f?s.measuredBox[d]:s.layoutBox[d],S=jr(_);_.min=i[d].min,_.max=_.min+S}):v_(m,s.layoutBox,i)&&Br(d=>{const _=f?s.measuredBox[d]:s.layoutBox[d],S=jr(i[d]);_.max=_.min+S,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+S)});const a=Ti();Yo(a,i,s.layoutBox);const c=Ti();f?Yo(c,e.applyTransform(l,!0),s.measuredBox):Yo(c,i,s.layoutBox);const h=!f_(a);let g=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:_,layout:S}=d;if(_&&S){const E=gt();Xo(E,s.layoutBox,_.layoutBox);const b=gt();Xo(b,i,S.layoutBox),p_(E,b)||(g=!0),d.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=E,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:s,delta:c,layoutDelta:a,hasLayoutChanged:h,hasRelativeTargetChanged:g})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function VP(e){Wo&&Hn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function zP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function WP(e){e.clearSnapshot()}function z0(e){e.clearMeasurements()}function UP(e){e.isLayoutDirty=!1}function KP(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function W0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function GP(e){e.resolveTargetDelta()}function qP(e){e.calcProjection()}function YP(e){e.resetSkewAndRotation()}function XP(e){e.removeLeadSnapshot()}function U0(e,t,s){e.translate=at(t.translate,0,s),e.scale=at(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function K0(e,t,s,i){e.min=at(t.min,s.min,i),e.max=at(t.max,s.max,i)}function JP(e,t,s,i){K0(e.x,t.x,s.x,i),K0(e.y,t.y,s.y,i)}function QP(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ZP={duration:.45,ease:[.4,0,.1,1]},G0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),q0=G0("applewebkit/")&&!G0("chrome/")?Math.round:Cr;function Y0(e){e.min=q0(e.min),e.max=q0(e.max)}function eR(e){Y0(e.x),Y0(e.y)}function v_(e,t,s){return e==="position"||e==="preserve-aspect"&&!sP($0(t),$0(s),.2)}function tR(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const rR=g_({attachResizeListener:(e,t)=>ta(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lh={current:void 0},y_=g_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lh.current){const e=new rR({});e.mount(window),e.setOptions({layoutScroll:!0}),lh.current=e}return lh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),sR={pan:{Feature:xP},drag:{Feature:yP,ProjectionNode:y_,MeasureLayout:u_}};function X0(e,t,s){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",s==="Start");const l="onHover"+s,m=i[l];m&&st.postRender(()=>m(t,ga(t)))}class nR extends _n{mount(){const{current:t}=this.node;t&&(this.unmount=sj(t,s=>(X0(this.node,s,"Start"),i=>X0(this.node,i,"End"))))}unmount(){}}class iR extends _n{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ma(ta(this.node.current,"focus",()=>this.onFocus()),ta(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function J0(e,t,s){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",s==="Start");const l="onTap"+(s==="End"?"":s),m=i[l];m&&st.postRender(()=>m(t,ga(t)))}class oR extends _n{mount(){const{current:t}=this.node;t&&(this.unmount=aj(t,s=>(J0(this.node,s,"Start"),(i,{success:l})=>J0(this.node,i,l?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Uh=new WeakMap,ch=new WeakMap,aR=e=>{const t=Uh.get(e.target);t&&t(e)},lR=e=>{e.forEach(aR)};function cR({root:e,...t}){const s=e||document;ch.has(s)||ch.set(s,{});const i=ch.get(s),l=JSON.stringify(t);return i[l]||(i[l]=new IntersectionObserver(lR,{root:e,...t})),i[l]}function uR(e,t,s){const i=cR(t);return Uh.set(e,s),i.observe(e),()=>{Uh.delete(e),i.unobserve(e)}}const dR={some:0,all:1};class hR extends _n{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:s,margin:i,amount:l="some",once:m}=t,f={root:s?s.current:void 0,rootMargin:i,threshold:typeof l=="number"?l:dR[l]},a=c=>{const{isIntersecting:h}=c;if(this.isInView===h||(this.isInView=h,m&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:g,onViewportLeave:d}=this.node.getProps(),_=h?g:d;_&&_(c)};return uR(this.node.current,f,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(fR(t,s))&&this.startObserver()}unmount(){}}function fR({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const pR={inView:{Feature:hR},tap:{Feature:oR},focus:{Feature:iR},hover:{Feature:nR}},mR={layout:{ProjectionNode:y_,MeasureLayout:u_}},Kh={current:null},x_={current:!1};function gR(){if(x_.current=!0,!!xf)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Kh.current=e.matches;e.addListener(t),t()}else Kh.current=!1}const vR=[...Wx,qt,vn],yR=e=>vR.find(zx(e)),Q0=new WeakMap;function xR(e,t,s){for(const i in t){const l=t[i],m=s[i];if(Yt(l))e.addValue(i,l);else if(Yt(m))e.addValue(i,Zo(l,{owner:e}));else if(m!==l)if(e.hasValue(i)){const f=e.getValue(i);f.liveStyle===!0?f.jump(l):f.hasAnimated||f.set(l)}else{const f=e.getStaticValue(i);e.addValue(i,Zo(f!==void 0?f:l,{owner:e}))}}for(const i in s)t[i]===void 0&&e.removeValue(i);return t}const Z0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _R{scrapeMotionValuesFromProps(t,s,i){return{}}constructor({parent:t,props:s,presenceContext:i,reducedMotionConfig:l,blockInitialAnimation:m,visualState:f},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Kf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=fs.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,st.render(this.render,!1,!0))};const{latestValues:c,renderState:h,onUpdate:g}=f;this.onUpdate=g,this.latestValues=c,this.baseTarget={...c},this.initialValues=s.initial?{...c}:{},this.renderState=h,this.parent=t,this.props=s,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=l,this.options=a,this.blockInitialAnimation=!!m,this.isControllingVariants=Ac(s),this.isVariantNode=Qy(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,..._}=this.scrapeMotionValuesFromProps(s,{},this);for(const S in _){const E=_[S];c[S]!==void 0&&Yt(E)&&E.set(c[S],!1)}}mount(t){this.current=t,Q0.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),x_.current||gR(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Kh.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Q0.delete(this.current),this.projection&&this.projection.unmount(),gn(this.notifyUpdate),gn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}bindToMotionValue(t,s){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=Zn.has(t),l=s.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&st.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),m=s.on("renderRequest",this.scheduleRender);let f;window.MotionCheckAppearSync&&(f=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{l(),m(),f&&f(),s.owner&&s.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Bi){const s=Bi[t];if(!s)continue;const{isEnabled:i,Feature:l}=s;if(!this.features[t]&&l&&i(this.props)&&(this.features[t]=new l(this)),this.features[t]){const m=this.features[t];m.isMounted?m.update():(m.mount(),m.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let i=0;i<Z0.length;i++){const l=Z0[i];this.propEventSubscriptions[l]&&(this.propEventSubscriptions[l](),delete this.propEventSubscriptions[l]);const m="on"+l,f=t[m];f&&(this.propEventSubscriptions[l]=this.on(l,f))}this.prevMotionValues=xR(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const i=this.values.get(t);s!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&s!==void 0&&(i=Zo(s===null?void 0:s,{owner:this}),this.addValue(t,i)),i}readValue(t,s){var i;let l=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return l!=null&&(typeof l=="string"&&(Hx(l)||Ax(l))?l=parseFloat(l):!yR(l)&&vn.test(s)&&(l=Bx(t,s)),this.setBaseTarget(t,Yt(l)?l.get():l)),Yt(l)?l.get():l}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){var s;const{initial:i}=this.props;let l;if(typeof i=="string"||typeof i=="object"){const f=Ef(this.props,i,(s=this.presenceContext)===null||s===void 0?void 0:s.custom);f&&(l=f[t])}if(i&&l!==void 0)return l;const m=this.getBaseTargetFromProps(this.props,t);return m!==void 0&&!Yt(m)?m:this.initialValues[t]!==void 0&&l===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new $f),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}}class __ extends _R{constructor(){super(...arguments),this.KeyframeResolver=Ux}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){return t.style?t.style[s]:void 0}removeValueFromRenderState(t,{vars:s,style:i}){delete s[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Yt(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function wR(e){return window.getComputedStyle(e)}class bR extends __{constructor(){super(...arguments),this.type="html",this.renderInstance=ax}readValueFromInstance(t,s){if(Zn.has(s)){const i=Uf(s);return i&&i.default||0}else{const i=wR(t),l=(nx(s)?i.getPropertyValue(s):i[s])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(t,{transformPagePoint:s}){return l_(t,s)}build(t,s,i){Pf(t,s,i.transformTemplate)}scrapeMotionValuesFromProps(t,s,i){return Df(t,s,i)}}class SR extends __{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gt}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(Zn.has(s)){const i=Uf(s);return i&&i.default||0}return s=lx.has(s)?s:Sf(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,i){return dx(t,s,i)}build(t,s,i){Rf(t,s,this.isSVGTag,i.transformTemplate)}renderInstance(t,s,i,l){cx(t,s,i,l)}mount(t){this.isSVGTag=Af(t.tagName),super.mount(t)}}const CR=(e,t)=>kf(e)?new SR(t):new bR(t,{allowProjection:e!==C.Fragment}),kR=XE({...qN,...pR,...sR,...mR},CR),hn=dE(kR);/**
49
- * @license lucide-react v0.475.0 - ISC
50
- *
51
- * This source code is licensed under the ISC license.
52
- * See the LICENSE file in the root directory of this source tree.
53
- */const ER=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w_=(...e)=>e.filter((t,s,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===s).join(" ").trim();/**
54
- * @license lucide-react v0.475.0 - ISC
55
- *
56
- * This source code is licensed under the ISC license.
57
- * See the LICENSE file in the root directory of this source tree.
58
- */var jR={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"};/**
59
- * @license lucide-react v0.475.0 - ISC
60
- *
61
- * This source code is licensed under the ISC license.
62
- * See the LICENSE file in the root directory of this source tree.
63
- */const NR=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:l="",children:m,iconNode:f,...a},c)=>C.createElement("svg",{ref:c,...jR,width:t,height:t,stroke:e,strokeWidth:i?Number(s)*24/Number(t):s,className:w_("lucide",l),...a},[...f.map(([h,g])=>C.createElement(h,g)),...Array.isArray(m)?m:[m]]));/**
64
- * @license lucide-react v0.475.0 - ISC
65
- *
66
- * This source code is licensed under the ISC license.
67
- * See the LICENSE file in the root directory of this source tree.
68
- */const be=(e,t)=>{const s=C.forwardRef(({className:i,...l},m)=>C.createElement(NR,{ref:m,iconNode:t,className:w_(`lucide-${ER(e)}`,i),...l}));return s.displayName=`${e}`,s};/**
69
- * @license lucide-react v0.475.0 - ISC
70
- *
71
- * This source code is licensed under the ISC license.
72
- * See the LICENSE file in the root directory of this source tree.
73
- */const PR=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],RR=be("ArrowLeftRight",PR);/**
74
- * @license lucide-react v0.475.0 - ISC
75
- *
76
- * This source code is licensed under the ISC license.
77
- * See the LICENSE file in the root directory of this source tree.
78
- */const TR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],AR=be("ArrowLeft",TR);/**
79
- * @license lucide-react v0.475.0 - ISC
80
- *
81
- * This source code is licensed under the ISC license.
82
- * See the LICENSE file in the root directory of this source tree.
83
- */const DR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],b_=be("ArrowRight",DR);/**
84
- * @license lucide-react v0.475.0 - ISC
85
- *
86
- * This source code is licensed under the ISC license.
87
- * See the LICENSE file in the root directory of this source tree.
88
- */const MR=[["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"}]],Wn=be("BookOpen",MR);/**
89
- * @license lucide-react v0.475.0 - ISC
90
- *
91
- * This source code is licensed under the ISC license.
92
- * See the LICENSE file in the root directory of this source tree.
93
- */const LR=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],dc=be("Brain",LR);/**
94
- * @license lucide-react v0.475.0 - ISC
95
- *
96
- * This source code is licensed under the ISC license.
97
- * See the LICENSE file in the root directory of this source tree.
98
- */const OR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Nr=be("Check",OR);/**
99
- * @license lucide-react v0.475.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */const IR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],va=be("ChevronDown",IR);/**
104
- * @license lucide-react v0.475.0 - ISC
105
- *
106
- * This source code is licensed under the ISC license.
107
- * See the LICENSE file in the root directory of this source tree.
108
- */const BR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Lc=be("ChevronRight",BR);/**
109
- * @license lucide-react v0.475.0 - ISC
110
- *
111
- * This source code is licensed under the ISC license.
112
- * See the LICENSE file in the root directory of this source tree.
113
- */const FR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$R=be("ChevronUp",FR);/**
114
- * @license lucide-react v0.475.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */const HR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ra=be("CircleAlert",HR);/**
119
- * @license lucide-react v0.475.0 - ISC
120
- *
121
- * This source code is licensed under the ISC license.
122
- * See the LICENSE file in the root directory of this source tree.
123
- */const VR=[["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"}]],Xf=be("CircleHelp",VR);/**
124
- * @license lucide-react v0.475.0 - ISC
125
- *
126
- * This source code is licensed under the ISC license.
127
- * See the LICENSE file in the root directory of this source tree.
128
- */const zR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],WR=be("Circle",zR);/**
129
- * @license lucide-react v0.475.0 - ISC
130
- *
131
- * This source code is licensed under the ISC license.
132
- * See the LICENSE file in the root directory of this source tree.
133
- */const UR=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],KR=be("Clipboard",UR);/**
134
- * @license lucide-react v0.475.0 - ISC
135
- *
136
- * This source code is licensed under the ISC license.
137
- * See the LICENSE file in the root directory of this source tree.
138
- */const GR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],uh=be("Clock",GR);/**
139
- * @license lucide-react v0.475.0 - ISC
140
- *
141
- * This source code is licensed under the ISC license.
142
- * See the LICENSE file in the root directory of this source tree.
143
- */const qR=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],YR=be("Code",qR);/**
144
- * @license lucide-react v0.475.0 - ISC
145
- *
146
- * This source code is licensed under the ISC license.
147
- * See the LICENSE file in the root directory of this source tree.
148
- */const XR=[["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"}]],$i=be("Copy",XR);/**
149
- * @license lucide-react v0.475.0 - ISC
150
- *
151
- * This source code is licensed under the ISC license.
152
- * See the LICENSE file in the root directory of this source tree.
153
- */const JR=[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]],QR=be("Cpu",JR);/**
154
- * @license lucide-react v0.475.0 - ISC
155
- *
156
- * This source code is licensed under the ISC license.
157
- * See the LICENSE file in the root directory of this source tree.
158
- */const ZR=[["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"}]],Oc=be("Download",ZR);/**
159
- * @license lucide-react v0.475.0 - ISC
160
- *
161
- * This source code is licensed under the ISC license.
162
- * See the LICENSE file in the root directory of this source tree.
163
- */const eT=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],S_=be("EllipsisVertical",eT);/**
164
- * @license lucide-react v0.475.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */const tT=[["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"}]],dh=be("ExternalLink",tT);/**
169
- * @license lucide-react v0.475.0 - ISC
170
- *
171
- * This source code is licensed under the ISC license.
172
- * See the LICENSE file in the root directory of this source tree.
173
- */const rT=[["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"}]],C_=be("Eye",rT);/**
174
- * @license lucide-react v0.475.0 - ISC
175
- *
176
- * This source code is licensed under the ISC license.
177
- * See the LICENSE file in the root directory of this source tree.
178
- */const sT=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],k_=be("FileCode",sT);/**
179
- * @license lucide-react v0.475.0 - ISC
180
- *
181
- * This source code is licensed under the ISC license.
182
- * See the LICENSE file in the root directory of this source tree.
183
- */const nT=[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]],Jf=be("FilePen",nT);/**
184
- * @license lucide-react v0.475.0 - ISC
185
- *
186
- * This source code is licensed under the ISC license.
187
- * See the LICENSE file in the root directory of this source tree.
188
- */const iT=[["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"}]],fr=be("FileText",iT);/**
189
- * @license lucide-react v0.475.0 - ISC
190
- *
191
- * This source code is licensed under the ISC license.
192
- * See the LICENSE file in the root directory of this source tree.
193
- */const oT=[["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"}]],Gh=be("File",oT);/**
194
- * @license lucide-react v0.475.0 - ISC
195
- *
196
- * This source code is licensed under the ISC license.
197
- * See the LICENSE file in the root directory of this source tree.
198
- */const aT=[["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"}]],Un=be("FolderOpen",aT);/**
199
- * @license lucide-react v0.475.0 - ISC
200
- *
201
- * This source code is licensed under the ISC license.
202
- * See the LICENSE file in the root directory of this source tree.
203
- */const lT=[["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"}]],E_=be("FolderPlus",lT);/**
204
- * @license lucide-react v0.475.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */const cT=[["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"}]],kt=be("Folder",cT);/**
209
- * @license lucide-react v0.475.0 - ISC
210
- *
211
- * This source code is licensed under the ISC license.
212
- * See the LICENSE file in the root directory of this source tree.
213
- */const uT=[["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"}]],j_=be("GitBranch",uT);/**
214
- * @license lucide-react v0.475.0 - ISC
215
- *
216
- * This source code is licensed under the ISC license.
217
- * See the LICENSE file in the root directory of this source tree.
218
- */const dT=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],hT=be("Github",dT);/**
219
- * @license lucide-react v0.475.0 - ISC
220
- *
221
- * This source code is licensed under the ISC license.
222
- * See the LICENSE file in the root directory of this source tree.
223
- */const fT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],N_=be("Globe",fT);/**
224
- * @license lucide-react v0.475.0 - ISC
225
- *
226
- * This source code is licensed under the ISC license.
227
- * See the LICENSE file in the root directory of this source tree.
228
- */const pT=[["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"}]],Qf=be("House",pT);/**
229
- * @license lucide-react v0.475.0 - ISC
230
- *
231
- * This source code is licensed under the ISC license.
232
- * See the LICENSE file in the root directory of this source tree.
233
- */const mT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],gT=be("Info",mT);/**
234
- * @license lucide-react v0.475.0 - ISC
235
- *
236
- * This source code is licensed under the ISC license.
237
- * See the LICENSE file in the root directory of this source tree.
238
- */const vT=[["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"}]],yT=be("Keyboard",vT);/**
239
- * @license lucide-react v0.475.0 - ISC
240
- *
241
- * This source code is licensed under the ISC license.
242
- * See the LICENSE file in the root directory of this source tree.
243
- */const xT=[["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"}]],P_=be("Layers",xT);/**
244
- * @license lucide-react v0.475.0 - ISC
245
- *
246
- * This source code is licensed under the ISC license.
247
- * See the LICENSE file in the root directory of this source tree.
248
- */const _T=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],vt=be("LoaderCircle",_T);/**
249
- * @license lucide-react v0.475.0 - ISC
250
- *
251
- * This source code is licensed under the ISC license.
252
- * See the LICENSE file in the root directory of this source tree.
253
- */const wT=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],R_=be("Lock",wT);/**
254
- * @license lucide-react v0.475.0 - ISC
255
- *
256
- * This source code is licensed under the ISC license.
257
- * See the LICENSE file in the root directory of this source tree.
258
- */const bT=[["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"}]],ST=be("Monitor",bT);/**
259
- * @license lucide-react v0.475.0 - ISC
260
- *
261
- * This source code is licensed under the ISC license.
262
- * See the LICENSE file in the root directory of this source tree.
263
- */const CT=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],ey=be("Moon",CT);/**
264
- * @license lucide-react v0.475.0 - ISC
265
- *
266
- * This source code is licensed under the ISC license.
267
- * See the LICENSE file in the root directory of this source tree.
268
- */const kT=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]],T_=be("Move",kT);/**
269
- * @license lucide-react v0.475.0 - ISC
270
- *
271
- * This source code is licensed under the ISC license.
272
- * See the LICENSE file in the root directory of this source tree.
273
- */const ET=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],sa=be("Package",ET);/**
274
- * @license lucide-react v0.475.0 - ISC
275
- *
276
- * This source code is licensed under the ISC license.
277
- * See the LICENSE file in the root directory of this source tree.
278
- */const jT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],Ic=be("PanelsTopLeft",jT);/**
279
- * @license lucide-react v0.475.0 - ISC
280
- *
281
- * This source code is licensed under the ISC license.
282
- * See the LICENSE file in the root directory of this source tree.
283
- */const NT=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],Zf=be("PenLine",NT);/**
284
- * @license lucide-react v0.475.0 - ISC
285
- *
286
- * This source code is licensed under the ISC license.
287
- * See the LICENSE file in the root directory of this source tree.
288
- */const PT=[["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"}]],A_=be("Pencil",PT);/**
289
- * @license lucide-react v0.475.0 - ISC
290
- *
291
- * This source code is licensed under the ISC license.
292
- * See the LICENSE file in the root directory of this source tree.
293
- */const RT=[["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"}]],hc=be("Plug",RT);/**
294
- * @license lucide-react v0.475.0 - ISC
295
- *
296
- * This source code is licensed under the ISC license.
297
- * See the LICENSE file in the root directory of this source tree.
298
- */const TT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ft=be("Plus",TT);/**
299
- * @license lucide-react v0.475.0 - ISC
300
- *
301
- * This source code is licensed under the ISC license.
302
- * See the LICENSE file in the root directory of this source tree.
303
- */const AT=[["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"}]],pr=be("RefreshCw",AT);/**
304
- * @license lucide-react v0.475.0 - ISC
305
- *
306
- * This source code is licensed under the ISC license.
307
- * See the LICENSE file in the root directory of this source tree.
308
- */const DT=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],MT=be("Rocket",DT);/**
309
- * @license lucide-react v0.475.0 - ISC
310
- *
311
- * This source code is licensed under the ISC license.
312
- * See the LICENSE file in the root directory of this source tree.
313
- */const LT=[["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"}]],Gi=be("Save",LT);/**
314
- * @license lucide-react v0.475.0 - ISC
315
- *
316
- * This source code is licensed under the ISC license.
317
- * See the LICENSE file in the root directory of this source tree.
318
- */const OT=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],ep=be("Search",OT);/**
319
- * @license lucide-react v0.475.0 - ISC
320
- *
321
- * This source code is licensed under the ISC license.
322
- * See the LICENSE file in the root directory of this source tree.
323
- */const IT=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],tp=be("Server",IT);/**
324
- * @license lucide-react v0.475.0 - ISC
325
- *
326
- * This source code is licensed under the ISC license.
327
- * See the LICENSE file in the root directory of this source tree.
328
- */const BT=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],FT=be("Settings2",BT);/**
329
- * @license lucide-react v0.475.0 - ISC
330
- *
331
- * This source code is licensed under the ISC license.
332
- * See the LICENSE file in the root directory of this source tree.
333
- */const $T=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Kn=be("Settings",$T);/**
334
- * @license lucide-react v0.475.0 - ISC
335
- *
336
- * This source code is licensed under the ISC license.
337
- * See the LICENSE file in the root directory of this source tree.
338
- */const HT=[["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"}]],Bc=be("Shield",HT);/**
339
- * @license lucide-react v0.475.0 - ISC
340
- *
341
- * This source code is licensed under the ISC license.
342
- * See the LICENSE file in the root directory of this source tree.
343
- */const VT=[["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"}]],sr=be("Sparkles",VT);/**
344
- * @license lucide-react v0.475.0 - ISC
345
- *
346
- * This source code is licensed under the ISC license.
347
- * See the LICENSE file in the root directory of this source tree.
348
- */const zT=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],WT=be("Star",zT);/**
349
- * @license lucide-react v0.475.0 - ISC
350
- *
351
- * This source code is licensed under the ISC license.
352
- * See the LICENSE file in the root directory of this source tree.
353
- */const UT=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ty=be("Sun",UT);/**
354
- * @license lucide-react v0.475.0 - ISC
355
- *
356
- * This source code is licensed under the ISC license.
357
- * See the LICENSE file in the root directory of this source tree.
358
- */const KT=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],Bt=be("Terminal",KT);/**
359
- * @license lucide-react v0.475.0 - ISC
360
- *
361
- * This source code is licensed under the ISC license.
362
- * See the LICENSE file in the root directory of this source tree.
363
- */const GT=[["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"}]],Gn=be("Trash2",GT);/**
364
- * @license lucide-react v0.475.0 - ISC
365
- *
366
- * This source code is licensed under the ISC license.
367
- * See the LICENSE file in the root directory of this source tree.
368
- */const qT=[["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"}]],Fc=be("TriangleAlert",qT);/**
369
- * @license lucide-react v0.475.0 - ISC
370
- *
371
- * This source code is licensed under the ISC license.
372
- * See the LICENSE file in the root directory of this source tree.
373
- */const YT=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],qh=be("Upload",YT);/**
374
- * @license lucide-react v0.475.0 - ISC
375
- *
376
- * This source code is licensed under the ISC license.
377
- * See the LICENSE file in the root directory of this source tree.
378
- */const XT=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Ps=be("WandSparkles",XT);/**
379
- * @license lucide-react v0.475.0 - ISC
380
- *
381
- * This source code is licensed under the ISC license.
382
- * See the LICENSE file in the root directory of this source tree.
383
- */const JT=[["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"}]],D_=be("Wrench",JT);/**
384
- * @license lucide-react v0.475.0 - ISC
385
- *
386
- * This source code is licensed under the ISC license.
387
- * See the LICENSE file in the root directory of this source tree.
388
- */const QT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],M_=be("X",QT);/**
389
- * @license lucide-react v0.475.0 - ISC
390
- *
391
- * This source code is licensed under the ISC license.
392
- * See the LICENSE file in the root directory of this source tree.
393
- */const ZT=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],L_=be("Zap",ZT),eA="/api";async function Te(e,t={}){const s=`${eA}${e}`,i={headers:{"Content-Type":"application/json"},...t};t.body&&typeof t.body=="object"&&(i.body=JSON.stringify(t.body));const l=await fetch(s,i);if(!l.ok){const m=await l.json().catch(()=>({error:"Request failed"}));throw new Error(m.error||`HTTP ${l.status}`)}return l.json()}const Re={async getProject(){return Te("/project")},async getSubprojects(e){return Te(`/subprojects?dir=${encodeURIComponent(e)}`)},async switchProject(e){return Te("/switch-project",{method:"POST",body:{dir:e}})},async getProjects(){return Te("/projects")},async addProject(e,t=null){return Te("/projects",{method:"POST",body:{path:e,name:t}})},async removeProject(e){return Te(`/projects/${e}`,{method:"DELETE"})},async setActiveProject(e){return Te("/projects/active",{method:"PUT",body:{id:e}})},async getConfigs(){return Te("/configs")},async updateConfig(e,t){return Te("/config",{method:"PUT",body:{dir:e,config:t}})},async getRegistry(){return Te("/registry")},async updateRegistry(e){return Te("/registry",{method:"PUT",body:e})},async getRules(){return Te("/rules")},async getRule(e){return Te(`/rule?path=${encodeURIComponent(e)}`)},async saveRule(e,t){return Te("/rule",{method:"PUT",body:{path:e,content:t}})},async createRule(e,t,s=""){return Te("/rule",{method:"POST",body:{dir:e,name:t,content:s}})},async deleteRule(e){return Te(`/rule?path=${encodeURIComponent(e)}`,{method:"DELETE"})},async getCommands(){return Te("/commands")},async getCommand(e){return Te(`/command?path=${encodeURIComponent(e)}`)},async saveCommand(e,t){return Te("/command",{method:"PUT",body:{path:e,content:t}})},async createCommand(e,t,s=""){return Te("/command",{method:"POST",body:{dir:e,name:t,content:s}})},async deleteCommand(e){return Te(`/command?path=${encodeURIComponent(e)}`,{method:"DELETE"})},async getTemplates(){return Te("/templates")},async applyTemplate(e,t){return Te("/apply-template",{method:"POST",body:{template:e,dir:t}})},async applyConfig(e){return Te("/apply",{method:"POST",body:{dir:e}})},async getEnv(e){return Te(`/env?dir=${encodeURIComponent(e)}`)},async saveEnv(e,t){return Te("/env",{method:"PUT",body:{dir:e,content:t}})},async getFileHashes(){return Te("/file-hashes")},async checkVersion(){return Te("/version-check")},async performUpdate(e){return Te("/update",{method:"POST",body:e})},async reload(){return Te("/reload",{method:"POST"})},async searchGithub(e){return Te(`/search/github?q=${encodeURIComponent(e)}`)},async searchNpm(e){return Te(`/search/npm?q=${encodeURIComponent(e)}`)},async getMcpTools(e){const t=e?`?dir=${encodeURIComponent(e)}`:"";return Te(`/mcp-tools${t}`)},async getClaudeFolders(){return Te("/claude-folders")},async getIntermediatePaths(){return Te("/intermediate-paths")},async getClaudeFile(e){return Te(`/claude-file?path=${encodeURIComponent(e)}`)},async saveClaudeFile(e,t){return Te("/claude-file",{method:"PUT",body:{path:e,content:t}})},async deleteClaudeFile(e){return Te(`/claude-file?path=${encodeURIComponent(e)}`,{method:"DELETE"})},async createClaudeFile(e,t,s,i=""){return Te("/claude-file",{method:"POST",body:{dir:e,name:t,type:s,content:i}})},async initClaudeFolder(e){return Te("/init-claude-folder",{method:"POST",body:{dir:e}})},async deleteClaudeFolder(e){return Te("/delete-claude-folder",{method:"POST",body:{dir:e}})},async getSyncPreview(e,t="claude",s="antigravity"){return Te("/sync/preview",{method:"POST",body:{dir:e,source:t,target:s}})},async syncRules(e,t="claude",s="antigravity",i=null){return Te("/sync/rules",{method:"POST",body:{dir:e,source:t,target:s,files:i}})},async moveClaudeItem(e,t,s="copy",i=!1){return Te("/claude-move",{method:"POST",body:{sourcePath:e,targetDir:t,mode:s,merge:i}})},async renameClaudeFile(e,t){return Te("/claude-rename",{method:"POST",body:{oldPath:e,newName:t}})},async getMemory(){return Te("/memory")},async getMemoryFile(e){return Te(`/memory/file?path=${encodeURIComponent(e)}`)},async saveMemoryFile(e,t){return Te("/memory/file",{method:"PUT",body:{path:e,content:t}})},async addMemoryEntry(e,t,s="global"){return Te("/memory/entry",{method:"POST",body:{type:e,content:t,scope:s}})},async initProjectMemory(e){return Te("/memory/init",{method:"POST",body:{dir:e}})},async searchMemory(e){return Te(`/memory/search?q=${encodeURIComponent(e)}`)},async getSyncState(){return Te("/memory/sync")},async getClaudeSettings(){return Te("/claude-settings")},async saveClaudeSettings(e){return Te("/claude-settings",{method:"PUT",body:{settings:e}})},async getConfig(){return Te("/preferences")},async saveConfig(e){return Te("/preferences",{method:"PUT",body:e})},async browse(e,t="directory"){return Te("/browse",{method:"POST",body:{path:e,type:t}})}};function O_(e){var t,s,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(s=O_(e[t]))&&(i&&(i+=" "),i+=s)}else for(s in e)e[s]&&(i&&(i+=" "),i+=s);return i}function I_(){for(var e,t,s=0,i="",l=arguments.length;s<l;s++)(e=arguments[s])&&(t=O_(e))&&(i&&(i+=" "),i+=t);return i}const tA=(e,t)=>{const s=new Array(e.length+t.length);for(let i=0;i<e.length;i++)s[i]=e[i];for(let i=0;i<t.length;i++)s[e.length+i]=t[i];return s},rA=(e,t)=>({classGroupId:e,validator:t}),B_=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),fc="-",ry=[],sA="arbitrary..",nA=e=>{const t=oA(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return iA(f);const a=f.split(fc),c=a[0]===""&&a.length>1?1:0;return F_(a,c,t)},getConflictingClassGroupIds:(f,a)=>{if(a){const c=i[f],h=s[f];return c?h?tA(h,c):c:h||ry}return s[f]||ry}}},F_=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const l=e[t],m=s.nextPart.get(l);if(m){const h=F_(e,t+1,m);if(h)return h}const f=s.validators;if(f===null)return;const a=t===0?e.join(fc):e.slice(t).join(fc),c=f.length;for(let h=0;h<c;h++){const g=f[h];if(g.validator(a))return g.classGroupId}},iA=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),i=t.slice(0,s);return i?sA+i:void 0})(),oA=e=>{const{theme:t,classGroups:s}=e;return aA(s,t)},aA=(e,t)=>{const s=B_();for(const i in e){const l=e[i];rp(l,s,i,t)}return s},rp=(e,t,s,i)=>{const l=e.length;for(let m=0;m<l;m++){const f=e[m];lA(f,t,s,i)}},lA=(e,t,s,i)=>{if(typeof e=="string"){cA(e,t,s);return}if(typeof e=="function"){uA(e,t,s,i);return}dA(e,t,s,i)},cA=(e,t,s)=>{const i=e===""?t:$_(t,e);i.classGroupId=s},uA=(e,t,s,i)=>{if(hA(e)){rp(e(i),t,s,i);return}t.validators===null&&(t.validators=[]),t.validators.push(rA(s,e))},dA=(e,t,s,i)=>{const l=Object.entries(e),m=l.length;for(let f=0;f<m;f++){const[a,c]=l[f];rp(c,$_(t,a),s,i)}},$_=(e,t)=>{let s=e;const i=t.split(fc),l=i.length;for(let m=0;m<l;m++){const f=i[m];let a=s.nextPart.get(f);a||(a=B_(),s.nextPart.set(f,a)),s=a}return s},hA=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,fA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),i=Object.create(null);const l=(m,f)=>{s[m]=f,t++,t>e&&(t=0,i=s,s=Object.create(null))};return{get(m){let f=s[m];if(f!==void 0)return f;if((f=i[m])!==void 0)return l(m,f),f},set(m,f){m in s?s[m]=f:l(m,f)}}},Yh="!",sy=":",pA=[],ny=(e,t,s,i,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:i,isExternal:l}),mA=e=>{const{prefix:t,experimentalParseClassName:s}=e;let i=l=>{const m=[];let f=0,a=0,c=0,h;const g=l.length;for(let b=0;b<g;b++){const v=l[b];if(f===0&&a===0){if(v===sy){m.push(l.slice(c,b)),c=b+1;continue}if(v==="/"){h=b;continue}}v==="["?f++:v==="]"?f--:v==="("?a++:v===")"&&a--}const d=m.length===0?l:l.slice(c);let _=d,S=!1;d.endsWith(Yh)?(_=d.slice(0,-1),S=!0):d.startsWith(Yh)&&(_=d.slice(1),S=!0);const E=h&&h>c?h-c:void 0;return ny(m,S,_,E)};if(t){const l=t+sy,m=i;i=f=>f.startsWith(l)?m(f.slice(l.length)):ny(pA,!1,f,void 0,!0)}if(s){const l=i;i=m=>s({className:m,parseClassName:l})}return i},gA=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,i)=>{t.set(s,1e6+i)}),s=>{const i=[];let l=[];for(let m=0;m<s.length;m++){const f=s[m],a=f[0]==="[",c=t.has(f);a||c?(l.length>0&&(l.sort(),i.push(...l),l=[]),i.push(f)):l.push(f)}return l.length>0&&(l.sort(),i.push(...l)),i}},vA=e=>({cache:fA(e.cacheSize),parseClassName:mA(e),sortModifiers:gA(e),...nA(e)}),yA=/\s+/,xA=(e,t)=>{const{parseClassName:s,getClassGroupId:i,getConflictingClassGroupIds:l,sortModifiers:m}=t,f=[],a=e.trim().split(yA);let c="";for(let h=a.length-1;h>=0;h-=1){const g=a[h],{isExternal:d,modifiers:_,hasImportantModifier:S,baseClassName:E,maybePostfixModifierPosition:b}=s(g);if(d){c=g+(c.length>0?" "+c:c);continue}let v=!!b,y=i(v?E.substring(0,b):E);if(!y){if(!v){c=g+(c.length>0?" "+c:c);continue}if(y=i(E),!y){c=g+(c.length>0?" "+c:c);continue}v=!1}const p=_.length===0?"":_.length===1?_[0]:m(_).join(":"),x=S?p+Yh:p,k=x+y;if(f.indexOf(k)>-1)continue;f.push(k);const P=l(y,v);for(let T=0;T<P.length;++T){const R=P[T];f.push(x+R)}c=g+(c.length>0?" "+c:c)}return c},_A=(...e)=>{let t=0,s,i,l="";for(;t<e.length;)(s=e[t++])&&(i=H_(s))&&(l&&(l+=" "),l+=i);return l},H_=e=>{if(typeof e=="string")return e;let t,s="";for(let i=0;i<e.length;i++)e[i]&&(t=H_(e[i]))&&(s&&(s+=" "),s+=t);return s},wA=(e,...t)=>{let s,i,l,m;const f=c=>{const h=t.reduce((g,d)=>d(g),e());return s=vA(h),i=s.cache.get,l=s.cache.set,m=a,a(c)},a=c=>{const h=i(c);if(h)return h;const g=xA(c,s);return l(c,g),g};return m=f,(...c)=>m(_A(...c))},bA=[],Ct=e=>{const t=s=>s[e]||bA;return t.isThemeGetter=!0,t},V_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,z_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SA=/^\d+\/\d+$/,CA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kA=/\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$/,EA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ki=e=>SA.test(e),ze=e=>!!e&&!Number.isNaN(Number(e)),cn=e=>!!e&&Number.isInteger(Number(e)),hh=e=>e.endsWith("%")&&ze(e.slice(0,-1)),Ns=e=>CA.test(e),PA=()=>!0,RA=e=>kA.test(e)&&!EA.test(e),W_=()=>!1,TA=e=>jA.test(e),AA=e=>NA.test(e),DA=e=>!Ce(e)&&!ke(e),MA=e=>qi(e,G_,W_),Ce=e=>V_.test(e),Fn=e=>qi(e,q_,RA),fh=e=>qi(e,FA,ze),iy=e=>qi(e,U_,W_),LA=e=>qi(e,K_,AA),zl=e=>qi(e,Y_,TA),ke=e=>z_.test(e),Ho=e=>Yi(e,q_),OA=e=>Yi(e,$A),oy=e=>Yi(e,U_),IA=e=>Yi(e,G_),BA=e=>Yi(e,K_),Wl=e=>Yi(e,Y_,!0),qi=(e,t,s)=>{const i=V_.exec(e);return i?i[1]?t(i[1]):s(i[2]):!1},Yi=(e,t,s=!1)=>{const i=z_.exec(e);return i?i[1]?t(i[1]):s:!1},U_=e=>e==="position"||e==="percentage",K_=e=>e==="image"||e==="url",G_=e=>e==="length"||e==="size"||e==="bg-size",q_=e=>e==="length",FA=e=>e==="number",$A=e=>e==="family-name",Y_=e=>e==="shadow",HA=()=>{const e=Ct("color"),t=Ct("font"),s=Ct("text"),i=Ct("font-weight"),l=Ct("tracking"),m=Ct("leading"),f=Ct("breakpoint"),a=Ct("container"),c=Ct("spacing"),h=Ct("radius"),g=Ct("shadow"),d=Ct("inset-shadow"),_=Ct("text-shadow"),S=Ct("drop-shadow"),E=Ct("blur"),b=Ct("perspective"),v=Ct("aspect"),y=Ct("ease"),p=Ct("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...k(),ke,Ce],T=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],j=()=>[ke,Ce,c],L=()=>[ki,"full","auto",...j()],$=()=>[cn,"none","subgrid",ke,Ce],F=()=>["auto",{span:["full",cn,ke,Ce]},cn,ke,Ce],W=()=>[cn,"auto",ke,Ce],H=()=>["auto","min","max","fr",ke,Ce],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...j()],ee=()=>[ki,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],z=()=>[e,ke,Ce],M=()=>[...k(),oy,iy,{position:[ke,Ce]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",IA,MA,{size:[ke,Ce]}],V=()=>[hh,Ho,Fn],Z=()=>["","none","full",h,ke,Ce],re=()=>["",ze,Ho,Fn],ce=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[ze,hh,oy,iy],D=()=>["","none",E,ke,Ce],K=()=>["none",ze,ke,Ce],q=()=>["none",ze,ke,Ce],ie=()=>[ze,ke,Ce],ae=()=>[ki,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ns],breakpoint:[Ns],color:[PA],container:[Ns],"drop-shadow":[Ns],ease:["in","out","in-out"],font:[DA],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ns],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ns],shadow:[Ns],spacing:["px",ze],text:[Ns],"text-shadow":[Ns],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ki,Ce,ke,v]}],container:["container"],columns:[{columns:[ze,Ce,ke,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[cn,"auto",ke,Ce]}],basis:[{basis:[ki,"full","auto",a,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,ki,"auto","initial","none",Ce]}],grow:[{grow:["",ze,ke,Ce]}],shrink:[{shrink:["",ze,ke,Ce]}],order:[{order:[cn,"first","last","none",ke,Ce]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],w:[{w:[a,"screen",...ee()]}],"min-w":[{"min-w":[a,"screen","none",...ee()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[f]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",s,Ho,Fn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ke,fh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",hh,Ce]}],"font-family":[{font:[OA,Ce,t]}],"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:[l,ke,Ce]}],"line-clamp":[{"line-clamp":[ze,"none",ke,fh]}],leading:[{leading:[m,...j()]}],"list-image":[{"list-image":["none",ke,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",ke,Fn]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[ze,"auto",ke,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cn,ke,Ce],radial:["",ke,Ce],conic:[cn,ke,Ce]},BA,LA]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ze,ke,Ce]}],"outline-w":[{outline:["",ze,Ho,Fn]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",g,Wl,zl]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,Wl,zl]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[ze,Fn]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",_,Wl,zl]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[ze,ke,Ce]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[ke,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,Ce]}],filter:[{filter:["","none",ke,Ce]}],blur:[{blur:D()}],brightness:[{brightness:[ze,ke,Ce]}],contrast:[{contrast:[ze,ke,Ce]}],"drop-shadow":[{"drop-shadow":["","none",S,Wl,zl]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",ze,ke,Ce]}],"hue-rotate":[{"hue-rotate":[ze,ke,Ce]}],invert:[{invert:["",ze,ke,Ce]}],saturate:[{saturate:[ze,ke,Ce]}],sepia:[{sepia:["",ze,ke,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Ce]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[ze,ke,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[ze,ke,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,ke,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,ke,Ce]}],"backdrop-invert":[{"backdrop-invert":["",ze,ke,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[ze,ke,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[ze,ke,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,ke,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",ke,Ce]}],ease:[{ease:["linear","initial",y,ke,Ce]}],delay:[{delay:[ze,ke,Ce]}],animate:[{animate:["none",p,ke,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ke,Ce]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[ke,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",ke,Ce]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[ze,Ho,Fn,fh]}],stroke:[{stroke:["none",...z()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},VA=wA(HA);function xe(...e){return VA(I_(e))}function ay(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Is(...e){return t=>{let s=!1;const i=e.map(l=>{const m=ay(l,t);return!s&&typeof m=="function"&&(s=!0),m});if(s)return()=>{for(let l=0;l<i.length;l++){const m=i[l];typeof m=="function"?m():ay(e[l],null)}}}}function Ve(...e){return C.useCallback(Is(...e),e)}var zA=Symbol.for("react.lazy"),pc=mf[" use ".trim().toString()];function WA(e){return typeof e=="object"&&e!==null&&"then"in e}function X_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zA&&"_payload"in e&&WA(e._payload)}function sp(e){const t=KA(e),s=C.forwardRef((i,l)=>{let{children:m,...f}=i;X_(m)&&typeof pc=="function"&&(m=pc(m._payload));const a=C.Children.toArray(m),c=a.find(qA);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return o.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return o.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}var UA=sp("Slot");function KA(e){const t=C.forwardRef((s,i)=>{let{children:l,...m}=s;if(X_(l)&&typeof pc=="function"&&(l=pc(l._payload)),C.isValidElement(l)){const f=XA(l),a=YA(m,l.props);return l.type!==C.Fragment&&(a.ref=i?Is(i,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GA=Symbol("radix.slottable");function qA(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GA}function YA(e,t){const s={...t};for(const i in t){const l=e[i],m=t[i];/^on[A-Z]/.test(i)?l&&m?s[i]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[i]=l):i==="style"?s[i]={...l,...m}:i==="className"&&(s[i]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function XA(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}const ly=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cy=I_,$c=(e,t)=>s=>{var i;if((t==null?void 0:t.variants)==null)return cy(e,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:l,defaultVariants:m}=t,f=Object.keys(l).map(h=>{const g=s==null?void 0:s[h],d=m==null?void 0:m[h];if(g===null)return null;const _=ly(g)||ly(d);return l[h][_]}),a=s&&Object.entries(s).reduce((h,g)=>{let[d,_]=g;return _===void 0||(h[d]=_),h},{}),c=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((h,g)=>{let{class:d,className:_,...S}=g;return Object.entries(S).every(E=>{let[b,v]=E;return Array.isArray(v)?v.includes({...m,...a}[b]):{...m,...a}[b]===v})?[...h,d,_]:h},[]);return cy(e,f,c,s==null?void 0:s.class,s==null?void 0:s.className)},np=$c("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),de=C.forwardRef(({className:e,variant:t,size:s,asChild:i=!1,...l},m)=>{const f=i?UA:"button";return o.jsx(f,{className:xe(np({variant:t,size:s,className:e})),ref:m,...l})});de.displayName="Button";const Ye=C.forwardRef(({className:e,type:t,...s},i)=>o.jsx("input",{type:t,className:xe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:i,...s}));Ye.displayName="Input";const Ze=C.forwardRef(({className:e,...t},s)=>o.jsx("textarea",{className:xe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...t}));Ze.displayName="Textarea";var JA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],QA=JA.reduce((e,t)=>{const s=sp(`Primitive.${t}`),i=C.forwardRef((l,m)=>{const{asChild:f,...a}=l,c=f?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:m})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),ZA="Label",J_=C.forwardRef((e,t)=>o.jsx(QA.label,{...e,ref:t,onMouseDown:s=>{var l;s.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));J_.displayName=ZA;var Q_=J_;const eD=$c("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_t=C.forwardRef(({className:e,...t},s)=>o.jsx(Q_,{ref:s,className:xe(eD(),e),...t}));_t.displayName=Q_.displayName;const tD=$c("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function lt({className:e,variant:t,...s}){return o.jsx("div",{className:xe(tD({variant:t}),e),...s})}function ye(e,t,{checkForDefaultPrevented:s=!0}={}){return function(l){if(e==null||e(l),s===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function rD(e,t){const s=C.createContext(t),i=m=>{const{children:f,...a}=m,c=C.useMemo(()=>a,Object.values(a));return o.jsx(s.Provider,{value:c,children:f})};i.displayName=e+"Provider";function l(m){const f=C.useContext(s);if(f)return f;if(t!==void 0)return t;throw new Error(`\`${m}\` must be used within \`${e}\``)}return[i,l]}function gr(e,t=[]){let s=[];function i(m,f){const a=C.createContext(f),c=s.length;s=[...s,f];const h=d=>{var y;const{scope:_,children:S,...E}=d,b=((y=_==null?void 0:_[e])==null?void 0:y[c])||a,v=C.useMemo(()=>E,Object.values(E));return o.jsx(b.Provider,{value:v,children:S})};h.displayName=m+"Provider";function g(d,_){var b;const S=((b=_==null?void 0:_[e])==null?void 0:b[c])||a,E=C.useContext(S);if(E)return E;if(f!==void 0)return f;throw new Error(`\`${d}\` must be used within \`${m}\``)}return[h,g]}const l=()=>{const m=s.map(f=>C.createContext(f));return function(a){const c=(a==null?void 0:a[e])||m;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return l.scopeName=e,[i,sD(l,...t)]}function sD(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const i=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(m){const f=i.reduce((a,{useScope:c,scopeName:h})=>{const d=c(m)[`__scope${h}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:f}),[f])}};return s.scopeName=t.scopeName,s}var Dt=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},nD=mf[" useInsertionEffect ".trim().toString()]||Dt;function Zr({prop:e,defaultProp:t,onChange:s=()=>{},caller:i}){const[l,m,f]=iD({defaultProp:t,onChange:s}),a=e!==void 0,c=a?e:l;{const g=C.useRef(e!==void 0);C.useEffect(()=>{const d=g.current;d!==a&&console.warn(`${i} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=a},[a,i])}const h=C.useCallback(g=>{var d;if(a){const _=oD(g)?g(e):g;_!==e&&((d=f.current)==null||d.call(f,_))}else m(g)},[a,e,m,f]);return[c,h]}function iD({defaultProp:e,onChange:t}){const[s,i]=C.useState(e),l=C.useRef(s),m=C.useRef(t);return nD(()=>{m.current=t},[t]),C.useEffect(()=>{var f;l.current!==s&&((f=m.current)==null||f.call(m,s),l.current=s)},[s,l]),[s,i,m]}function oD(e){return typeof e=="function"}function ip(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function op(e){const[t,s]=C.useState(void 0);return Dt(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const m=l[0];let f,a;if("borderBoxSize"in m){const c=m.borderBoxSize,h=Array.isArray(c)?c[0]:c;f=h.inlineSize,a=h.blockSize}else f=e.offsetWidth,a=e.offsetHeight;s({width:f,height:a})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else s(void 0)},[e]),t}function aD(e){const t=lD(e),s=C.forwardRef((i,l)=>{const{children:m,...f}=i,a=C.Children.toArray(m),c=a.find(uD);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return o.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return o.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function lD(e){const t=C.forwardRef((s,i)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=hD(l),a=dD(m,l.props);return l.type!==C.Fragment&&(a.ref=i?Is(i,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cD=Symbol("radix.slottable");function uD(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cD}function dD(e,t){const s={...t};for(const i in t){const l=e[i],m=t[i];/^on[A-Z]/.test(i)?l&&m?s[i]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[i]=l):i==="style"?s[i]={...l,...m}:i==="className"&&(s[i]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function hD(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var fD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=fD.reduce((e,t)=>{const s=aD(`Primitive.${t}`),i=C.forwardRef((l,m)=>{const{asChild:f,...a}=l,c=f?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:m})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function Z_(e,t){e&&ha.flushSync(()=>e.dispatchEvent(t))}var Hc="Switch",[pD]=gr(Hc),[mD,gD]=pD(Hc),ew=C.forwardRef((e,t)=>{const{__scopeSwitch:s,name:i,checked:l,defaultChecked:m,required:f,disabled:a,value:c="on",onCheckedChange:h,form:g,...d}=e,[_,S]=C.useState(null),E=Ve(t,x=>S(x)),b=C.useRef(!1),v=_?g||!!_.closest("form"):!0,[y,p]=Zr({prop:l,defaultProp:m??!1,onChange:h,caller:Hc});return o.jsxs(mD,{scope:s,checked:y,disabled:a,children:[o.jsx(Le.button,{type:"button",role:"switch","aria-checked":y,"aria-required":f,"data-state":nw(y),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:E,onClick:ye(e.onClick,x=>{p(k=>!k),v&&(b.current=x.isPropagationStopped(),b.current||x.stopPropagation())})}),v&&o.jsx(sw,{control:_,bubbles:!b.current,name:i,value:c,checked:y,required:f,disabled:a,form:g,style:{transform:"translateX(-100%)"}})]})});ew.displayName=Hc;var tw="SwitchThumb",rw=C.forwardRef((e,t)=>{const{__scopeSwitch:s,...i}=e,l=gD(tw,s);return o.jsx(Le.span,{"data-state":nw(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t})});rw.displayName=tw;var vD="SwitchBubbleInput",sw=C.forwardRef(({__scopeSwitch:e,control:t,checked:s,bubbles:i=!0,...l},m)=>{const f=C.useRef(null),a=Ve(f,m),c=ip(s),h=op(t);return C.useEffect(()=>{const g=f.current;if(!g)return;const d=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==s&&S){const E=new Event("click",{bubbles:i});S.call(g,s),g.dispatchEvent(E)}},[c,s,i]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...l,tabIndex:-1,ref:a,style:{...l.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});sw.displayName=vD;function nw(e){return e?"checked":"unchecked"}var iw=ew,yD=rw;const us=C.forwardRef(({className:e,...t},s)=>o.jsx(iw,{className:xe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:s,children:o.jsx(yD,{className:xe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));us.displayName=iw.displayName;function uy(e){const t=xD(e),s=C.forwardRef((i,l)=>{const{children:m,...f}=i,a=C.Children.toArray(m),c=a.find(wD);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return o.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return o.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function xD(e){const t=C.forwardRef((s,i)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=SD(l),a=bD(m,l.props);return l.type!==C.Fragment&&(a.ref=i?Is(i,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _D=Symbol("radix.slottable");function wD(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_D}function bD(e,t){const s={...t};for(const i in t){const l=e[i],m=t[i];/^on[A-Z]/.test(i)?l&&m?s[i]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[i]=l):i==="style"?s[i]={...l,...m}:i==="className"&&(s[i]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function SD(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function ap(e){const t=e+"CollectionProvider",[s,i]=gr(t),[l,m]=s(t,{collectionRef:{current:null},itemMap:new Map}),f=b=>{const{scope:v,children:y}=b,p=ge.useRef(null),x=ge.useRef(new Map).current;return o.jsx(l,{scope:v,itemMap:x,collectionRef:p,children:y})};f.displayName=t;const a=e+"CollectionSlot",c=uy(a),h=ge.forwardRef((b,v)=>{const{scope:y,children:p}=b,x=m(a,y),k=Ve(v,x.collectionRef);return o.jsx(c,{ref:k,children:p})});h.displayName=a;const g=e+"CollectionItemSlot",d="data-radix-collection-item",_=uy(g),S=ge.forwardRef((b,v)=>{const{scope:y,children:p,...x}=b,k=ge.useRef(null),P=Ve(v,k),T=m(g,y);return ge.useEffect(()=>(T.itemMap.set(k,{ref:k,...x}),()=>void T.itemMap.delete(k))),o.jsx(_,{[d]:"",ref:P,children:p})});S.displayName=g;function E(b){const v=m(e+"CollectionConsumer",b);return ge.useCallback(()=>{const p=v.collectionRef.current;if(!p)return[];const x=Array.from(p.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((T,R)=>x.indexOf(T.ref.current)-x.indexOf(R.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:f,Slot:h,ItemSlot:S},E,i]}var CD=mf[" useId ".trim().toString()]||(()=>{}),kD=0;function mr(e){const[t,s]=C.useState(CD());return Dt(()=>{s(i=>i??String(kD++))},[e]),t?`radix-${t}`:""}function At(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...s)=>{var i;return(i=t.current)==null?void 0:i.call(t,...s)},[])}var ED=C.createContext(void 0);function ya(e){const t=C.useContext(ED);return e||t||"ltr"}var ph="rovingFocusGroup.onEntryFocus",jD={bubbles:!1,cancelable:!0},xa="RovingFocusGroup",[Xh,ow,ND]=ap(xa),[PD,Vc]=gr(xa,[ND]),[RD,TD]=PD(xa),aw=C.forwardRef((e,t)=>o.jsx(Xh.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Xh.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(AD,{...e,ref:t})})}));aw.displayName=xa;var AD=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,orientation:i,loop:l=!1,dir:m,currentTabStopId:f,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:h,preventScrollOnEntryFocus:g=!1,...d}=e,_=C.useRef(null),S=Ve(t,_),E=ya(m),[b,v]=Zr({prop:f,defaultProp:a??null,onChange:c,caller:xa}),[y,p]=C.useState(!1),x=At(h),k=ow(s),P=C.useRef(!1),[T,R]=C.useState(0);return C.useEffect(()=>{const j=_.current;if(j)return j.addEventListener(ph,x),()=>j.removeEventListener(ph,x)},[x]),o.jsx(RD,{scope:s,orientation:i,dir:E,loop:l,currentTabStopId:b,onItemFocus:C.useCallback(j=>v(j),[v]),onItemShiftTab:C.useCallback(()=>p(!0),[]),onFocusableItemAdd:C.useCallback(()=>R(j=>j+1),[]),onFocusableItemRemove:C.useCallback(()=>R(j=>j-1),[]),children:o.jsx(Le.div,{tabIndex:y||T===0?-1:0,"data-orientation":i,...d,ref:S,style:{outline:"none",...e.style},onMouseDown:ye(e.onMouseDown,()=>{P.current=!0}),onFocus:ye(e.onFocus,j=>{const L=!P.current;if(j.target===j.currentTarget&&L&&!y){const $=new CustomEvent(ph,jD);if(j.currentTarget.dispatchEvent($),!$.defaultPrevented){const F=k().filter(Y=>Y.focusable),W=F.find(Y=>Y.active),H=F.find(Y=>Y.id===b),G=[W,H,...F].filter(Boolean).map(Y=>Y.ref.current);uw(G,g)}}P.current=!1}),onBlur:ye(e.onBlur,()=>p(!1))})})}),lw="RovingFocusGroupItem",cw=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,focusable:i=!0,active:l=!1,tabStopId:m,children:f,...a}=e,c=mr(),h=m||c,g=TD(lw,s),d=g.currentTabStopId===h,_=ow(s),{onFocusableItemAdd:S,onFocusableItemRemove:E,currentTabStopId:b}=g;return C.useEffect(()=>{if(i)return S(),()=>E()},[i,S,E]),o.jsx(Xh.ItemSlot,{scope:s,id:h,focusable:i,active:l,children:o.jsx(Le.span,{tabIndex:d?0:-1,"data-orientation":g.orientation,...a,ref:t,onMouseDown:ye(e.onMouseDown,v=>{i?g.onItemFocus(h):v.preventDefault()}),onFocus:ye(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:ye(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){g.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=LD(v,g.orientation,g.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let x=_().filter(k=>k.focusable).map(k=>k.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const k=x.indexOf(v.currentTarget);x=g.loop?OD(x,k+1):x.slice(k+1)}setTimeout(()=>uw(x))}}),children:typeof f=="function"?f({isCurrentTabStop:d,hasTabStop:b!=null}):f})})});cw.displayName=lw;var DD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MD(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function LD(e,t,s){const i=MD(e.key,s);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return DD[i]}function uw(e,t=!1){const s=document.activeElement;for(const i of e)if(i===s||(i.focus({preventScroll:t}),document.activeElement!==s))return}function OD(e,t){return e.map((s,i)=>e[(t+i)%e.length])}var dw=aw,hw=cw;function ID(e,t){return C.useReducer((s,i)=>t[s][i]??s,e)}var $t=e=>{const{present:t,children:s}=e,i=BD(t),l=typeof s=="function"?s({present:i.isPresent}):C.Children.only(s),m=Ve(i.ref,FD(l));return typeof s=="function"||i.isPresent?C.cloneElement(l,{ref:m}):null};$t.displayName="Presence";function BD(e){const[t,s]=C.useState(),i=C.useRef(null),l=C.useRef(e),m=C.useRef("none"),f=e?"mounted":"unmounted",[a,c]=ID(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const h=Ul(i.current);m.current=a==="mounted"?h:"none"},[a]),Dt(()=>{const h=i.current,g=l.current;if(g!==e){const _=m.current,S=Ul(h);e?c("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?c("UNMOUNT"):c(g&&_!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,c]),Dt(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,d=S=>{const b=Ul(i.current).includes(CSS.escape(S.animationName));if(S.target===t&&b&&(c("ANIMATION_END"),!l.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},_=S=>{S.target===t&&(m.current=Ul(i.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(h=>{i.current=h?getComputedStyle(h):null,s(h)},[])}}function Ul(e){return(e==null?void 0:e.animationName)||"none"}function FD(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var zc="Tabs",[$D]=gr(zc,[Vc]),fw=Vc(),[HD,lp]=$D(zc),pw=C.forwardRef((e,t)=>{const{__scopeTabs:s,value:i,onValueChange:l,defaultValue:m,orientation:f="horizontal",dir:a,activationMode:c="automatic",...h}=e,g=ya(a),[d,_]=Zr({prop:i,onChange:l,defaultProp:m??"",caller:zc});return o.jsx(HD,{scope:s,baseId:mr(),value:d,onValueChange:_,orientation:f,dir:g,activationMode:c,children:o.jsx(Le.div,{dir:g,"data-orientation":f,...h,ref:t})})});pw.displayName=zc;var mw="TabsList",gw=C.forwardRef((e,t)=>{const{__scopeTabs:s,loop:i=!0,...l}=e,m=lp(mw,s),f=fw(s);return o.jsx(dw,{asChild:!0,...f,orientation:m.orientation,dir:m.dir,loop:i,children:o.jsx(Le.div,{role:"tablist","aria-orientation":m.orientation,...l,ref:t})})});gw.displayName=mw;var vw="TabsTrigger",yw=C.forwardRef((e,t)=>{const{__scopeTabs:s,value:i,disabled:l=!1,...m}=e,f=lp(vw,s),a=fw(s),c=ww(f.baseId,i),h=bw(f.baseId,i),g=i===f.value;return o.jsx(hw,{asChild:!0,...a,focusable:!l,active:g,children:o.jsx(Le.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":h,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...m,ref:t,onMouseDown:ye(e.onMouseDown,d=>{!l&&d.button===0&&d.ctrlKey===!1?f.onValueChange(i):d.preventDefault()}),onKeyDown:ye(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&f.onValueChange(i)}),onFocus:ye(e.onFocus,()=>{const d=f.activationMode!=="manual";!g&&!l&&d&&f.onValueChange(i)})})})});yw.displayName=vw;var xw="TabsContent",_w=C.forwardRef((e,t)=>{const{__scopeTabs:s,value:i,forceMount:l,children:m,...f}=e,a=lp(xw,s),c=ww(a.baseId,i),h=bw(a.baseId,i),g=i===a.value,d=C.useRef(g);return C.useEffect(()=>{const _=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(_)},[]),o.jsx($t,{present:l||g,children:({present:_})=>o.jsx(Le.div,{"data-state":g?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!_,id:h,tabIndex:0,...f,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:_&&m})})});_w.displayName=xw;function ww(e,t){return`${e}-trigger-${t}`}function bw(e,t){return`${e}-content-${t}`}var VD=pw,Sw=gw,Cw=yw,kw=_w;const Wc=VD,_a=C.forwardRef(({className:e,...t},s)=>o.jsx(Sw,{ref:s,className:xe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));_a.displayName=Sw.displayName;const Qr=C.forwardRef(({className:e,...t},s)=>o.jsx(Cw,{ref:s,className:xe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Qr.displayName=Cw.displayName;const Rs=C.forwardRef(({className:e,...t},s)=>o.jsx(kw,{ref:s,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Rs.displayName=kw.displayName;function Jh(e,[t,s]){return Math.min(s,Math.max(t,e))}function zD(e,t=globalThis==null?void 0:globalThis.document){const s=At(e);C.useEffect(()=>{const i=l=>{l.key==="Escape"&&s(l)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[s,t])}var WD="DismissableLayer",Qh="dismissableLayer.update",UD="dismissableLayer.pointerDownOutside",KD="dismissableLayer.focusOutside",dy,Ew=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wa=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:m,onInteractOutside:f,onDismiss:a,...c}=e,h=C.useContext(Ew),[g,d]=C.useState(null),_=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=C.useState({}),E=Ve(t,R=>d(R)),b=Array.from(h.layers),[v]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),p=g?b.indexOf(g):-1,x=h.layersWithOutsidePointerEventsDisabled.size>0,k=p>=y,P=YD(R=>{const j=R.target,L=[...h.branches].some($=>$.contains(j));!k||L||(l==null||l(R),f==null||f(R),R.defaultPrevented||a==null||a())},_),T=XD(R=>{const j=R.target;[...h.branches].some($=>$.contains(j))||(m==null||m(R),f==null||f(R),R.defaultPrevented||a==null||a())},_);return zD(R=>{p===h.layers.size-1&&(i==null||i(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},_),C.useEffect(()=>{if(g)return s&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(dy=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),hy(),()=>{s&&h.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=dy)}},[g,_,s,h]),C.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),hy())},[g,h]),C.useEffect(()=>{const R=()=>S({});return document.addEventListener(Qh,R),()=>document.removeEventListener(Qh,R)},[]),o.jsx(Le.div,{...c,ref:E,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,P.onPointerDownCapture)})});wa.displayName=WD;var GD="DismissableLayerBranch",qD=C.forwardRef((e,t)=>{const s=C.useContext(Ew),i=C.useRef(null),l=Ve(t,i);return C.useEffect(()=>{const m=i.current;if(m)return s.branches.add(m),()=>{s.branches.delete(m)}},[s.branches]),o.jsx(Le.div,{...e,ref:l})});qD.displayName=GD;function YD(e,t=globalThis==null?void 0:globalThis.document){const s=At(e),i=C.useRef(!1),l=C.useRef(()=>{});return C.useEffect(()=>{const m=a=>{if(a.target&&!i.current){let c=function(){jw(UD,s,h,{discrete:!0})};const h={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=c,t.addEventListener("click",l.current,{once:!0})):c()}else t.removeEventListener("click",l.current);i.current=!1},f=window.setTimeout(()=>{t.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(f),t.removeEventListener("pointerdown",m),t.removeEventListener("click",l.current)}},[t,s]),{onPointerDownCapture:()=>i.current=!0}}function XD(e,t=globalThis==null?void 0:globalThis.document){const s=At(e),i=C.useRef(!1);return C.useEffect(()=>{const l=m=>{m.target&&!i.current&&jw(KD,s,{originalEvent:m},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,s]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function hy(){const e=new CustomEvent(Qh);document.dispatchEvent(e)}function jw(e,t,s,{discrete:i}){const l=s.originalEvent.target,m=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&l.addEventListener(e,t,{once:!0}),i?Z_(l,m):l.dispatchEvent(m)}var mh=0;function cp(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fy()),document.body.insertAdjacentElement("beforeend",e[1]??fy()),mh++,()=>{mh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),mh--}},[])}function fy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gh="focusScope.autoFocusOnMount",vh="focusScope.autoFocusOnUnmount",py={bubbles:!1,cancelable:!0},JD="FocusScope",Uc=C.forwardRef((e,t)=>{const{loop:s=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:m,...f}=e,[a,c]=C.useState(null),h=At(l),g=At(m),d=C.useRef(null),_=Ve(t,b=>c(b)),S=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(i){let b=function(x){if(S.paused||!a)return;const k=x.target;a.contains(k)?d.current=k:dn(d.current,{select:!0})},v=function(x){if(S.paused||!a)return;const k=x.relatedTarget;k!==null&&(a.contains(k)||dn(d.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const P of x)P.removedNodes.length>0&&dn(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const p=new MutationObserver(y);return a&&p.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),p.disconnect()}}},[i,a,S.paused]),C.useEffect(()=>{if(a){gy.add(S);const b=document.activeElement;if(!a.contains(b)){const y=new CustomEvent(gh,py);a.addEventListener(gh,h),a.dispatchEvent(y),y.defaultPrevented||(QD(sM(Nw(a)),{select:!0}),document.activeElement===b&&dn(a))}return()=>{a.removeEventListener(gh,h),setTimeout(()=>{const y=new CustomEvent(vh,py);a.addEventListener(vh,g),a.dispatchEvent(y),y.defaultPrevented||dn(b??document.body,{select:!0}),a.removeEventListener(vh,g),gy.remove(S)},0)}}},[a,h,g,S]);const E=C.useCallback(b=>{if(!s&&!i||S.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,y=document.activeElement;if(v&&y){const p=b.currentTarget,[x,k]=ZD(p);x&&k?!b.shiftKey&&y===k?(b.preventDefault(),s&&dn(x,{select:!0})):b.shiftKey&&y===x&&(b.preventDefault(),s&&dn(k,{select:!0})):y===p&&b.preventDefault()}},[s,i,S.paused]);return o.jsx(Le.div,{tabIndex:-1,...f,ref:_,onKeyDown:E})});Uc.displayName=JD;function QD(e,{select:t=!1}={}){const s=document.activeElement;for(const i of e)if(dn(i,{select:t}),document.activeElement!==s)return}function ZD(e){const t=Nw(e),s=my(t,e),i=my(t.reverse(),e);return[s,i]}function Nw(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function my(e,t){for(const s of e)if(!eM(s,{upTo:t}))return s}function eM(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function tM(e){return e instanceof HTMLInputElement&&"select"in e}function dn(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&tM(e)&&t&&e.select()}}var gy=rM();function rM(){let e=[];return{add(t){const s=e[0];t!==s&&(s==null||s.pause()),e=vy(e,t),e.unshift(t)},remove(t){var s;e=vy(e,t),(s=e[0])==null||s.resume()}}}function vy(e,t){const s=[...e],i=s.indexOf(t);return i!==-1&&s.splice(i,1),s}function sM(e){return e.filter(t=>t.tagName!=="A")}const nM=["top","right","bottom","left"],yn=Math.min,Sr=Math.max,mc=Math.round,Kl=Math.floor,ps=e=>({x:e,y:e}),iM={left:"right",right:"left",bottom:"top",top:"bottom"},oM={start:"end",end:"start"};function Zh(e,t,s){return Sr(e,yn(t,s))}function Ls(e,t){return typeof e=="function"?e(t):e}function Os(e){return e.split("-")[0]}function Xi(e){return e.split("-")[1]}function up(e){return e==="x"?"y":"x"}function dp(e){return e==="y"?"height":"width"}const aM=new Set(["top","bottom"]);function ds(e){return aM.has(Os(e))?"y":"x"}function hp(e){return up(ds(e))}function lM(e,t,s){s===void 0&&(s=!1);const i=Xi(e),l=hp(e),m=dp(l);let f=l==="x"?i===(s?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[m]>t.floating[m]&&(f=gc(f)),[f,gc(f)]}function cM(e){const t=gc(e);return[ef(e),t,ef(t)]}function ef(e){return e.replace(/start|end/g,t=>oM[t])}const yy=["left","right"],xy=["right","left"],uM=["top","bottom"],dM=["bottom","top"];function hM(e,t,s){switch(e){case"top":case"bottom":return s?t?xy:yy:t?yy:xy;case"left":case"right":return t?uM:dM;default:return[]}}function fM(e,t,s,i){const l=Xi(e);let m=hM(Os(e),s==="start",i);return l&&(m=m.map(f=>f+"-"+l),t&&(m=m.concat(m.map(ef)))),m}function gc(e){return e.replace(/left|right|bottom|top/g,t=>iM[t])}function pM(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pw(e){return typeof e!="number"?pM(e):{top:e,right:e,bottom:e,left:e}}function vc(e){const{x:t,y:s,width:i,height:l}=e;return{width:i,height:l,top:s,left:t,right:t+i,bottom:s+l,x:t,y:s}}function _y(e,t,s){let{reference:i,floating:l}=e;const m=ds(t),f=hp(t),a=dp(f),c=Os(t),h=m==="y",g=i.x+i.width/2-l.width/2,d=i.y+i.height/2-l.height/2,_=i[a]/2-l[a]/2;let S;switch(c){case"top":S={x:g,y:i.y-l.height};break;case"bottom":S={x:g,y:i.y+i.height};break;case"right":S={x:i.x+i.width,y:d};break;case"left":S={x:i.x-l.width,y:d};break;default:S={x:i.x,y:i.y}}switch(Xi(t)){case"start":S[f]-=_*(s&&h?-1:1);break;case"end":S[f]+=_*(s&&h?-1:1);break}return S}const mM=async(e,t,s)=>{const{placement:i="bottom",strategy:l="absolute",middleware:m=[],platform:f}=s,a=m.filter(Boolean),c=await(f.isRTL==null?void 0:f.isRTL(t));let h=await f.getElementRects({reference:e,floating:t,strategy:l}),{x:g,y:d}=_y(h,i,c),_=i,S={},E=0;for(let b=0;b<a.length;b++){const{name:v,fn:y}=a[b],{x:p,y:x,data:k,reset:P}=await y({x:g,y:d,initialPlacement:i,placement:_,strategy:l,middlewareData:S,rects:h,platform:f,elements:{reference:e,floating:t}});g=p??g,d=x??d,S={...S,[v]:{...S[v],...k}},P&&E<=50&&(E++,typeof P=="object"&&(P.placement&&(_=P.placement),P.rects&&(h=P.rects===!0?await f.getElementRects({reference:e,floating:t,strategy:l}):P.rects),{x:g,y:d}=_y(h,_,c)),b=-1)}return{x:g,y:d,placement:_,strategy:l,middlewareData:S}};async function na(e,t){var s;t===void 0&&(t={});const{x:i,y:l,platform:m,rects:f,elements:a,strategy:c}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:d="floating",altBoundary:_=!1,padding:S=0}=Ls(t,e),E=Pw(S),v=a[_?d==="floating"?"reference":"floating":d],y=vc(await m.getClippingRect({element:(s=await(m.isElement==null?void 0:m.isElement(v)))==null||s?v:v.contextElement||await(m.getDocumentElement==null?void 0:m.getDocumentElement(a.floating)),boundary:h,rootBoundary:g,strategy:c})),p=d==="floating"?{x:i,y:l,width:f.floating.width,height:f.floating.height}:f.reference,x=await(m.getOffsetParent==null?void 0:m.getOffsetParent(a.floating)),k=await(m.isElement==null?void 0:m.isElement(x))?await(m.getScale==null?void 0:m.getScale(x))||{x:1,y:1}:{x:1,y:1},P=vc(m.convertOffsetParentRelativeRectToViewportRelativeRect?await m.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:x,strategy:c}):p);return{top:(y.top-P.top+E.top)/k.y,bottom:(P.bottom-y.bottom+E.bottom)/k.y,left:(y.left-P.left+E.left)/k.x,right:(P.right-y.right+E.right)/k.x}}const gM=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:i,placement:l,rects:m,platform:f,elements:a,middlewareData:c}=t,{element:h,padding:g=0}=Ls(e,t)||{};if(h==null)return{};const d=Pw(g),_={x:s,y:i},S=hp(l),E=dp(S),b=await f.getDimensions(h),v=S==="y",y=v?"top":"left",p=v?"bottom":"right",x=v?"clientHeight":"clientWidth",k=m.reference[E]+m.reference[S]-_[S]-m.floating[E],P=_[S]-m.reference[S],T=await(f.getOffsetParent==null?void 0:f.getOffsetParent(h));let R=T?T[x]:0;(!R||!await(f.isElement==null?void 0:f.isElement(T)))&&(R=a.floating[x]||m.floating[E]);const j=k/2-P/2,L=R/2-b[E]/2-1,$=yn(d[y],L),F=yn(d[p],L),W=$,H=R-b[E]-F,J=R/2-b[E]/2+j,G=Zh(W,J,H),Y=!c.arrow&&Xi(l)!=null&&J!==G&&m.reference[E]/2-(J<W?$:F)-b[E]/2<0,ee=Y?J<W?J-W:J-H:0;return{[S]:_[S]+ee,data:{[S]:G,centerOffset:J-G-ee,...Y&&{alignmentOffset:ee}},reset:Y}}}),vM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,i;const{placement:l,middlewareData:m,rects:f,initialPlacement:a,platform:c,elements:h}=t,{mainAxis:g=!0,crossAxis:d=!0,fallbackPlacements:_,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:b=!0,...v}=Ls(e,t);if((s=m.arrow)!=null&&s.alignmentOffset)return{};const y=Os(l),p=ds(a),x=Os(a)===a,k=await(c.isRTL==null?void 0:c.isRTL(h.floating)),P=_||(x||!b?[gc(a)]:cM(a)),T=E!=="none";!_&&T&&P.push(...fM(a,b,E,k));const R=[a,...P],j=await na(t,v),L=[];let $=((i=m.flip)==null?void 0:i.overflows)||[];if(g&&L.push(j[y]),d){const J=lM(l,f,k);L.push(j[J[0]],j[J[1]])}if($=[...$,{placement:l,overflows:L}],!L.every(J=>J<=0)){var F,W;const J=(((F=m.flip)==null?void 0:F.index)||0)+1,G=R[J];if(G&&(!(d==="alignment"?p!==ds(G):!1)||$.every(z=>ds(z.placement)===p?z.overflows[0]>0:!0)))return{data:{index:J,overflows:$},reset:{placement:G}};let Y=(W=$.filter(ee=>ee.overflows[0]<=0).sort((ee,z)=>ee.overflows[1]-z.overflows[1])[0])==null?void 0:W.placement;if(!Y)switch(S){case"bestFit":{var H;const ee=(H=$.filter(z=>{if(T){const M=ds(z.placement);return M===p||M==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((z,M)=>z[1]-M[1])[0])==null?void 0:H[0];ee&&(Y=ee);break}case"initialPlacement":Y=a;break}if(l!==Y)return{reset:{placement:Y}}}return{}}}};function wy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function by(e){return nM.some(t=>e[t]>=0)}const yM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:s}=t,{strategy:i="referenceHidden",...l}=Ls(e,t);switch(i){case"referenceHidden":{const m=await na(t,{...l,elementContext:"reference"}),f=wy(m,s.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:by(f)}}}case"escaped":{const m=await na(t,{...l,altBoundary:!0}),f=wy(m,s.floating);return{data:{escapedOffsets:f,escaped:by(f)}}}default:return{}}}}},Rw=new Set(["left","top"]);async function xM(e,t){const{placement:s,platform:i,elements:l}=e,m=await(i.isRTL==null?void 0:i.isRTL(l.floating)),f=Os(s),a=Xi(s),c=ds(s)==="y",h=Rw.has(f)?-1:1,g=m&&c?-1:1,d=Ls(t,e);let{mainAxis:_,crossAxis:S,alignmentAxis:E}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof E=="number"&&(S=a==="end"?E*-1:E),c?{x:S*g,y:_*h}:{x:_*h,y:S*g}}const _M=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,i;const{x:l,y:m,placement:f,middlewareData:a}=t,c=await xM(t,e);return f===((s=a.offset)==null?void 0:s.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:l+c.x,y:m+c.y,data:{...c,placement:f}}}}},wM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:i,placement:l}=t,{mainAxis:m=!0,crossAxis:f=!1,limiter:a={fn:v=>{let{x:y,y:p}=v;return{x:y,y:p}}},...c}=Ls(e,t),h={x:s,y:i},g=await na(t,c),d=ds(Os(l)),_=up(d);let S=h[_],E=h[d];if(m){const v=_==="y"?"top":"left",y=_==="y"?"bottom":"right",p=S+g[v],x=S-g[y];S=Zh(p,S,x)}if(f){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",p=E+g[v],x=E-g[y];E=Zh(p,E,x)}const b=a.fn({...t,[_]:S,[d]:E});return{...b,data:{x:b.x-s,y:b.y-i,enabled:{[_]:m,[d]:f}}}}}},bM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:s,y:i,placement:l,rects:m,middlewareData:f}=t,{offset:a=0,mainAxis:c=!0,crossAxis:h=!0}=Ls(e,t),g={x:s,y:i},d=ds(l),_=up(d);let S=g[_],E=g[d];const b=Ls(a,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const x=_==="y"?"height":"width",k=m.reference[_]-m.floating[x]+v.mainAxis,P=m.reference[_]+m.reference[x]-v.mainAxis;S<k?S=k:S>P&&(S=P)}if(h){var y,p;const x=_==="y"?"width":"height",k=Rw.has(Os(l)),P=m.reference[d]-m.floating[x]+(k&&((y=f.offset)==null?void 0:y[d])||0)+(k?0:v.crossAxis),T=m.reference[d]+m.reference[x]+(k?0:((p=f.offset)==null?void 0:p[d])||0)-(k?v.crossAxis:0);E<P?E=P:E>T&&(E=T)}return{[_]:S,[d]:E}}}},SM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var s,i;const{placement:l,rects:m,platform:f,elements:a}=t,{apply:c=()=>{},...h}=Ls(e,t),g=await na(t,h),d=Os(l),_=Xi(l),S=ds(l)==="y",{width:E,height:b}=m.floating;let v,y;d==="top"||d==="bottom"?(v=d,y=_===(await(f.isRTL==null?void 0:f.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,v=_==="end"?"top":"bottom");const p=b-g.top-g.bottom,x=E-g.left-g.right,k=yn(b-g[v],p),P=yn(E-g[y],x),T=!t.middlewareData.shift;let R=k,j=P;if((s=t.middlewareData.shift)!=null&&s.enabled.x&&(j=x),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(R=p),T&&!_){const $=Sr(g.left,0),F=Sr(g.right,0),W=Sr(g.top,0),H=Sr(g.bottom,0);S?j=E-2*($!==0||F!==0?$+F:Sr(g.left,g.right)):R=b-2*(W!==0||H!==0?W+H:Sr(g.top,g.bottom))}await c({...t,availableWidth:j,availableHeight:R});const L=await f.getDimensions(a.floating);return E!==L.width||b!==L.height?{reset:{rects:!0}}:{}}}};function Kc(){return typeof window<"u"}function Ji(e){return Tw(e)?(e.nodeName||"").toLowerCase():"#document"}function kr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gs(e){var t;return(t=(Tw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tw(e){return Kc()?e instanceof Node||e instanceof kr(e).Node:!1}function es(e){return Kc()?e instanceof Element||e instanceof kr(e).Element:!1}function ms(e){return Kc()?e instanceof HTMLElement||e instanceof kr(e).HTMLElement:!1}function Sy(e){return!Kc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kr(e).ShadowRoot}const CM=new Set(["inline","contents"]);function ba(e){const{overflow:t,overflowX:s,overflowY:i,display:l}=ts(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+s)&&!CM.has(l)}const kM=new Set(["table","td","th"]);function EM(e){return kM.has(Ji(e))}const jM=[":popover-open",":modal"];function Gc(e){return jM.some(t=>{try{return e.matches(t)}catch{return!1}})}const NM=["transform","translate","scale","rotate","perspective"],PM=["transform","translate","scale","rotate","perspective","filter"],RM=["paint","layout","strict","content"];function fp(e){const t=pp(),s=es(e)?ts(e):e;return NM.some(i=>s[i]?s[i]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!t&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!t&&(s.filter?s.filter!=="none":!1)||PM.some(i=>(s.willChange||"").includes(i))||RM.some(i=>(s.contain||"").includes(i))}function TM(e){let t=xn(e);for(;ms(t)&&!Hi(t);){if(fp(t))return t;if(Gc(t))return null;t=xn(t)}return null}function pp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const AM=new Set(["html","body","#document"]);function Hi(e){return AM.has(Ji(e))}function ts(e){return kr(e).getComputedStyle(e)}function qc(e){return es(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xn(e){if(Ji(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sy(e)&&e.host||gs(e);return Sy(t)?t.host:t}function Aw(e){const t=xn(e);return Hi(t)?e.ownerDocument?e.ownerDocument.body:e.body:ms(t)&&ba(t)?t:Aw(t)}function ia(e,t,s){var i;t===void 0&&(t=[]),s===void 0&&(s=!0);const l=Aw(e),m=l===((i=e.ownerDocument)==null?void 0:i.body),f=kr(l);if(m){const a=tf(f);return t.concat(f,f.visualViewport||[],ba(l)?l:[],a&&s?ia(a):[])}return t.concat(l,ia(l,[],s))}function tf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Dw(e){const t=ts(e);let s=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const l=ms(e),m=l?e.offsetWidth:s,f=l?e.offsetHeight:i,a=mc(s)!==m||mc(i)!==f;return a&&(s=m,i=f),{width:s,height:i,$:a}}function mp(e){return es(e)?e:e.contextElement}function Mi(e){const t=mp(e);if(!ms(t))return ps(1);const s=t.getBoundingClientRect(),{width:i,height:l,$:m}=Dw(t);let f=(m?mc(s.width):s.width)/i,a=(m?mc(s.height):s.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!a||!Number.isFinite(a))&&(a=1),{x:f,y:a}}const DM=ps(0);function Mw(e){const t=kr(e);return!pp()||!t.visualViewport?DM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MM(e,t,s){return t===void 0&&(t=!1),!s||t&&s!==kr(e)?!1:t}function qn(e,t,s,i){t===void 0&&(t=!1),s===void 0&&(s=!1);const l=e.getBoundingClientRect(),m=mp(e);let f=ps(1);t&&(i?es(i)&&(f=Mi(i)):f=Mi(e));const a=MM(m,s,i)?Mw(m):ps(0);let c=(l.left+a.x)/f.x,h=(l.top+a.y)/f.y,g=l.width/f.x,d=l.height/f.y;if(m){const _=kr(m),S=i&&es(i)?kr(i):i;let E=_,b=tf(E);for(;b&&i&&S!==E;){const v=Mi(b),y=b.getBoundingClientRect(),p=ts(b),x=y.left+(b.clientLeft+parseFloat(p.paddingLeft))*v.x,k=y.top+(b.clientTop+parseFloat(p.paddingTop))*v.y;c*=v.x,h*=v.y,g*=v.x,d*=v.y,c+=x,h+=k,E=kr(b),b=tf(E)}}return vc({width:g,height:d,x:c,y:h})}function Yc(e,t){const s=qc(e).scrollLeft;return t?t.left+s:qn(gs(e)).left+s}function Lw(e,t){const s=e.getBoundingClientRect(),i=s.left+t.scrollLeft-Yc(e,s),l=s.top+t.scrollTop;return{x:i,y:l}}function LM(e){let{elements:t,rect:s,offsetParent:i,strategy:l}=e;const m=l==="fixed",f=gs(i),a=t?Gc(t.floating):!1;if(i===f||a&&m)return s;let c={scrollLeft:0,scrollTop:0},h=ps(1);const g=ps(0),d=ms(i);if((d||!d&&!m)&&((Ji(i)!=="body"||ba(f))&&(c=qc(i)),ms(i))){const S=qn(i);h=Mi(i),g.x=S.x+i.clientLeft,g.y=S.y+i.clientTop}const _=f&&!d&&!m?Lw(f,c):ps(0);return{width:s.width*h.x,height:s.height*h.y,x:s.x*h.x-c.scrollLeft*h.x+g.x+_.x,y:s.y*h.y-c.scrollTop*h.y+g.y+_.y}}function OM(e){return Array.from(e.getClientRects())}function IM(e){const t=gs(e),s=qc(e),i=e.ownerDocument.body,l=Sr(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),m=Sr(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let f=-s.scrollLeft+Yc(e);const a=-s.scrollTop;return ts(i).direction==="rtl"&&(f+=Sr(t.clientWidth,i.clientWidth)-l),{width:l,height:m,x:f,y:a}}const Cy=25;function BM(e,t){const s=kr(e),i=gs(e),l=s.visualViewport;let m=i.clientWidth,f=i.clientHeight,a=0,c=0;if(l){m=l.width,f=l.height;const g=pp();(!g||g&&t==="fixed")&&(a=l.offsetLeft,c=l.offsetTop)}const h=Yc(i);if(h<=0){const g=i.ownerDocument,d=g.body,_=getComputedStyle(d),S=g.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,E=Math.abs(i.clientWidth-d.clientWidth-S);E<=Cy&&(m-=E)}else h<=Cy&&(m+=h);return{width:m,height:f,x:a,y:c}}const FM=new Set(["absolute","fixed"]);function $M(e,t){const s=qn(e,!0,t==="fixed"),i=s.top+e.clientTop,l=s.left+e.clientLeft,m=ms(e)?Mi(e):ps(1),f=e.clientWidth*m.x,a=e.clientHeight*m.y,c=l*m.x,h=i*m.y;return{width:f,height:a,x:c,y:h}}function ky(e,t,s){let i;if(t==="viewport")i=BM(e,s);else if(t==="document")i=IM(gs(e));else if(es(t))i=$M(t,s);else{const l=Mw(e);i={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return vc(i)}function Ow(e,t){const s=xn(e);return s===t||!es(s)||Hi(s)?!1:ts(s).position==="fixed"||Ow(s,t)}function HM(e,t){const s=t.get(e);if(s)return s;let i=ia(e,[],!1).filter(a=>es(a)&&Ji(a)!=="body"),l=null;const m=ts(e).position==="fixed";let f=m?xn(e):e;for(;es(f)&&!Hi(f);){const a=ts(f),c=fp(f);!c&&a.position==="fixed"&&(l=null),(m?!c&&!l:!c&&a.position==="static"&&!!l&&FM.has(l.position)||ba(f)&&!c&&Ow(e,f))?i=i.filter(g=>g!==f):l=a,f=xn(f)}return t.set(e,i),i}function VM(e){let{element:t,boundary:s,rootBoundary:i,strategy:l}=e;const f=[...s==="clippingAncestors"?Gc(t)?[]:HM(t,this._c):[].concat(s),i],a=f[0],c=f.reduce((h,g)=>{const d=ky(t,g,l);return h.top=Sr(d.top,h.top),h.right=yn(d.right,h.right),h.bottom=yn(d.bottom,h.bottom),h.left=Sr(d.left,h.left),h},ky(t,a,l));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function zM(e){const{width:t,height:s}=Dw(e);return{width:t,height:s}}function WM(e,t,s){const i=ms(t),l=gs(t),m=s==="fixed",f=qn(e,!0,m,t);let a={scrollLeft:0,scrollTop:0};const c=ps(0);function h(){c.x=Yc(l)}if(i||!i&&!m)if((Ji(t)!=="body"||ba(l))&&(a=qc(t)),i){const S=qn(t,!0,m,t);c.x=S.x+t.clientLeft,c.y=S.y+t.clientTop}else l&&h();m&&!i&&l&&h();const g=l&&!i&&!m?Lw(l,a):ps(0),d=f.left+a.scrollLeft-c.x-g.x,_=f.top+a.scrollTop-c.y-g.y;return{x:d,y:_,width:f.width,height:f.height}}function yh(e){return ts(e).position==="static"}function Ey(e,t){if(!ms(e)||ts(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return gs(e)===s&&(s=s.ownerDocument.body),s}function Iw(e,t){const s=kr(e);if(Gc(e))return s;if(!ms(e)){let l=xn(e);for(;l&&!Hi(l);){if(es(l)&&!yh(l))return l;l=xn(l)}return s}let i=Ey(e,t);for(;i&&EM(i)&&yh(i);)i=Ey(i,t);return i&&Hi(i)&&yh(i)&&!fp(i)?s:i||TM(e)||s}const UM=async function(e){const t=this.getOffsetParent||Iw,s=this.getDimensions,i=await s(e.floating);return{reference:WM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function KM(e){return ts(e).direction==="rtl"}const GM={convertOffsetParentRelativeRectToViewportRelativeRect:LM,getDocumentElement:gs,getClippingRect:VM,getOffsetParent:Iw,getElementRects:UM,getClientRects:OM,getDimensions:zM,getScale:Mi,isElement:es,isRTL:KM};function Bw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qM(e,t){let s=null,i;const l=gs(e);function m(){var a;clearTimeout(i),(a=s)==null||a.disconnect(),s=null}function f(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),m();const h=e.getBoundingClientRect(),{left:g,top:d,width:_,height:S}=h;if(a||t(),!_||!S)return;const E=Kl(d),b=Kl(l.clientWidth-(g+_)),v=Kl(l.clientHeight-(d+S)),y=Kl(g),x={rootMargin:-E+"px "+-b+"px "+-v+"px "+-y+"px",threshold:Sr(0,yn(1,c))||1};let k=!0;function P(T){const R=T[0].intersectionRatio;if(R!==c){if(!k)return f();R?f(!1,R):i=setTimeout(()=>{f(!1,1e-7)},1e3)}R===1&&!Bw(h,e.getBoundingClientRect())&&f(),k=!1}try{s=new IntersectionObserver(P,{...x,root:l.ownerDocument})}catch{s=new IntersectionObserver(P,x)}s.observe(e)}return f(!0),m}function YM(e,t,s,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:m=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,h=mp(e),g=l||m?[...h?ia(h):[],...ia(t)]:[];g.forEach(y=>{l&&y.addEventListener("scroll",s,{passive:!0}),m&&y.addEventListener("resize",s)});const d=h&&a?qM(h,s):null;let _=-1,S=null;f&&(S=new ResizeObserver(y=>{let[p]=y;p&&p.target===h&&S&&(S.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var x;(x=S)==null||x.observe(t)})),s()}),h&&!c&&S.observe(h),S.observe(t));let E,b=c?qn(e):null;c&&v();function v(){const y=qn(e);b&&!Bw(b,y)&&s(),b=y,E=requestAnimationFrame(v)}return s(),()=>{var y;g.forEach(p=>{l&&p.removeEventListener("scroll",s),m&&p.removeEventListener("resize",s)}),d==null||d(),(y=S)==null||y.disconnect(),S=null,c&&cancelAnimationFrame(E)}}const XM=_M,JM=wM,QM=vM,ZM=SM,e4=yM,jy=gM,t4=bM,r4=(e,t,s)=>{const i=new Map,l={platform:GM,...s},m={...l.platform,_c:i};return mM(e,t,{...l,platform:m})};var s4=typeof document<"u",n4=function(){},ec=s4?C.useLayoutEffect:n4;function yc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let s,i,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(i=s;i--!==0;)if(!yc(e[i],t[i]))return!1;return!0}if(l=Object.keys(e),s=l.length,s!==Object.keys(t).length)return!1;for(i=s;i--!==0;)if(!{}.hasOwnProperty.call(t,l[i]))return!1;for(i=s;i--!==0;){const m=l[i];if(!(m==="_owner"&&e.$$typeof)&&!yc(e[m],t[m]))return!1}return!0}return e!==e&&t!==t}function Fw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ny(e,t){const s=Fw(e);return Math.round(t*s)/s}function xh(e){const t=C.useRef(e);return ec(()=>{t.current=e}),t}function i4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:i=[],platform:l,elements:{reference:m,floating:f}={},transform:a=!0,whileElementsMounted:c,open:h}=e,[g,d]=C.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[_,S]=C.useState(i);yc(_,i)||S(i);const[E,b]=C.useState(null),[v,y]=C.useState(null),p=C.useCallback(z=>{z!==T.current&&(T.current=z,b(z))},[]),x=C.useCallback(z=>{z!==R.current&&(R.current=z,y(z))},[]),k=m||E,P=f||v,T=C.useRef(null),R=C.useRef(null),j=C.useRef(g),L=c!=null,$=xh(c),F=xh(l),W=xh(h),H=C.useCallback(()=>{if(!T.current||!R.current)return;const z={placement:t,strategy:s,middleware:_};F.current&&(z.platform=F.current),r4(T.current,R.current,z).then(M=>{const B={...M,isPositioned:W.current!==!1};J.current&&!yc(j.current,B)&&(j.current=B,ha.flushSync(()=>{d(B)}))})},[_,t,s,F,W]);ec(()=>{h===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,d(z=>({...z,isPositioned:!1})))},[h]);const J=C.useRef(!1);ec(()=>(J.current=!0,()=>{J.current=!1}),[]),ec(()=>{if(k&&(T.current=k),P&&(R.current=P),k&&P){if($.current)return $.current(k,P,H);H()}},[k,P,H,$,L]);const G=C.useMemo(()=>({reference:T,floating:R,setReference:p,setFloating:x}),[p,x]),Y=C.useMemo(()=>({reference:k,floating:P}),[k,P]),ee=C.useMemo(()=>{const z={position:s,left:0,top:0};if(!Y.floating)return z;const M=Ny(Y.floating,g.x),B=Ny(Y.floating,g.y);return a?{...z,transform:"translate("+M+"px, "+B+"px)",...Fw(Y.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:M,top:B}},[s,a,Y.floating,g.x,g.y]);return C.useMemo(()=>({...g,update:H,refs:G,elements:Y,floatingStyles:ee}),[g,H,G,Y,ee])}const o4=e=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:i,padding:l}=typeof e=="function"?e(s):e;return i&&t(i)?i.current!=null?jy({element:i.current,padding:l}).fn(s):{}:i?jy({element:i,padding:l}).fn(s):{}}}},a4=(e,t)=>({...XM(e),options:[e,t]}),l4=(e,t)=>({...JM(e),options:[e,t]}),c4=(e,t)=>({...t4(e),options:[e,t]}),u4=(e,t)=>({...QM(e),options:[e,t]}),d4=(e,t)=>({...ZM(e),options:[e,t]}),h4=(e,t)=>({...e4(e),options:[e,t]}),f4=(e,t)=>({...o4(e),options:[e,t]});var p4="Arrow",$w=C.forwardRef((e,t)=>{const{children:s,width:i=10,height:l=5,...m}=e;return o.jsx(Le.svg,{...m,ref:t,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});$w.displayName=p4;var m4=$w,gp="Popper",[Hw,Qi]=gr(gp),[g4,Vw]=Hw(gp),zw=e=>{const{__scopePopper:t,children:s}=e,[i,l]=C.useState(null);return o.jsx(g4,{scope:t,anchor:i,onAnchorChange:l,children:s})};zw.displayName=gp;var Ww="PopperAnchor",Uw=C.forwardRef((e,t)=>{const{__scopePopper:s,virtualRef:i,...l}=e,m=Vw(Ww,s),f=C.useRef(null),a=Ve(t,f),c=C.useRef(null);return C.useEffect(()=>{const h=c.current;c.current=(i==null?void 0:i.current)||f.current,h!==c.current&&m.onAnchorChange(c.current)}),i?null:o.jsx(Le.div,{...l,ref:a})});Uw.displayName=Ww;var vp="PopperContent",[v4,y4]=Hw(vp),Kw=C.forwardRef((e,t)=>{var U,D,K,q,ie,ae;const{__scopePopper:s,side:i="bottom",sideOffset:l=0,align:m="center",alignOffset:f=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:d="partial",hideWhenDetached:_=!1,updatePositionStrategy:S="optimized",onPlaced:E,...b}=e,v=Vw(vp,s),[y,p]=C.useState(null),x=Ve(t,ve=>p(ve)),[k,P]=C.useState(null),T=op(k),R=(T==null?void 0:T.width)??0,j=(T==null?void 0:T.height)??0,L=i+(m!=="center"?"-"+m:""),$=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},F=Array.isArray(h)?h:[h],W=F.length>0,H={padding:$,boundary:F.filter(_4),altBoundary:W},{refs:J,floatingStyles:G,placement:Y,isPositioned:ee,middlewareData:z}=i4({strategy:"fixed",placement:L,whileElementsMounted:(...ve)=>YM(...ve,{animationFrame:S==="always"}),elements:{reference:v.anchor},middleware:[a4({mainAxis:l+j,alignmentAxis:f}),c&&l4({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?c4():void 0,...H}),c&&u4({...H}),d4({...H,apply:({elements:ve,rects:He,availableWidth:Ue,availableHeight:Xe})=>{const{width:Ee,height:Ht}=He.reference,et=ve.floating.style;et.setProperty("--radix-popper-available-width",`${Ue}px`),et.setProperty("--radix-popper-available-height",`${Xe}px`),et.setProperty("--radix-popper-anchor-width",`${Ee}px`),et.setProperty("--radix-popper-anchor-height",`${Ht}px`)}}),k&&f4({element:k,padding:a}),w4({arrowWidth:R,arrowHeight:j}),_&&h4({strategy:"referenceHidden",...H})]}),[M,B]=Yw(Y),O=At(E);Dt(()=>{ee&&(O==null||O())},[ee,O]);const V=(U=z.arrow)==null?void 0:U.x,Z=(D=z.arrow)==null?void 0:D.y,re=((K=z.arrow)==null?void 0:K.centerOffset)!==0,[ce,ue]=C.useState();return Dt(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),o.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:ee?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(q=z.transformOrigin)==null?void 0:q.x,(ie=z.transformOrigin)==null?void 0:ie.y].join(" "),...((ae=z.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(v4,{scope:s,placedSide:M,onArrowChange:P,arrowX:V,arrowY:Z,shouldHideArrow:re,children:o.jsx(Le.div,{"data-side":M,"data-align":B,...b,ref:x,style:{...b.style,animation:ee?void 0:"none"}})})})});Kw.displayName=vp;var Gw="PopperArrow",x4={top:"bottom",right:"left",bottom:"top",left:"right"},qw=C.forwardRef(function(t,s){const{__scopePopper:i,...l}=t,m=y4(Gw,i),f=x4[m.placedSide];return o.jsx("span",{ref:m.onArrowChange,style:{position:"absolute",left:m.arrowX,top:m.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[m.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[m.placedSide],visibility:m.shouldHideArrow?"hidden":void 0},children:o.jsx(m4,{...l,ref:s,style:{...l.style,display:"block"}})})});qw.displayName=Gw;function _4(e){return e!==null}var w4=e=>({name:"transformOrigin",options:e,fn(t){var v,y,p;const{placement:s,rects:i,middlewareData:l}=t,f=((v=l.arrow)==null?void 0:v.centerOffset)!==0,a=f?0:e.arrowWidth,c=f?0:e.arrowHeight,[h,g]=Yw(s),d={start:"0%",center:"50%",end:"100%"}[g],_=(((y=l.arrow)==null?void 0:y.x)??0)+a/2,S=(((p=l.arrow)==null?void 0:p.y)??0)+c/2;let E="",b="";return h==="bottom"?(E=f?d:`${_}px`,b=`${-c}px`):h==="top"?(E=f?d:`${_}px`,b=`${i.floating.height+c}px`):h==="right"?(E=`${-c}px`,b=f?d:`${S}px`):h==="left"&&(E=`${i.floating.width+c}px`,b=f?d:`${S}px`),{data:{x:E,y:b}}}});function Yw(e){const[t,s="center"]=e.split("-");return[t,s]}var Xc=zw,yp=Uw,xp=Kw,_p=qw,b4="Portal",Sa=C.forwardRef((e,t)=>{var a;const{container:s,...i}=e,[l,m]=C.useState(!1);Dt(()=>m(!0),[]);const f=s||l&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return f?Wy.createPortal(o.jsx(Le.div,{...i,ref:t}),f):null});Sa.displayName=b4;function S4(e){const t=C4(e),s=C.forwardRef((i,l)=>{const{children:m,...f}=i,a=C.Children.toArray(m),c=a.find(E4);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return o.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return o.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function C4(e){const t=C.forwardRef((s,i)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=N4(l),a=j4(m,l.props);return l.type!==C.Fragment&&(a.ref=i?Is(i,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var k4=Symbol("radix.slottable");function E4(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k4}function j4(e,t){const s={...t};for(const i in t){const l=e[i],m=t[i];/^on[A-Z]/.test(i)?l&&m?s[i]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[i]=l):i==="style"?s[i]={...l,...m}:i==="className"&&(s[i]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function N4(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Xw=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"}),P4="VisuallyHidden",Jw=C.forwardRef((e,t)=>o.jsx(Le.span,{...e,ref:t,style:{...Xw,...e.style}}));Jw.displayName=P4;var R4=Jw,T4=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ei=new WeakMap,Gl=new WeakMap,ql={},_h=0,Qw=function(e){return e&&(e.host||Qw(e.parentNode))},A4=function(e,t){return t.map(function(s){if(e.contains(s))return s;var i=Qw(s);return i&&e.contains(i)?i:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},D4=function(e,t,s,i){var l=A4(t,Array.isArray(e)?e:[e]);ql[s]||(ql[s]=new WeakMap);var m=ql[s],f=[],a=new Set,c=new Set(l),h=function(d){!d||a.has(d)||(a.add(d),h(d.parentNode))};l.forEach(h);var g=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(_){if(a.has(_))g(_);else try{var S=_.getAttribute(i),E=S!==null&&S!=="false",b=(Ei.get(_)||0)+1,v=(m.get(_)||0)+1;Ei.set(_,b),m.set(_,v),f.push(_),b===1&&E&&Gl.set(_,!0),v===1&&_.setAttribute(s,"true"),E||_.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",_,y)}})};return g(t),a.clear(),_h++,function(){f.forEach(function(d){var _=Ei.get(d)-1,S=m.get(d)-1;Ei.set(d,_),m.set(d,S),_||(Gl.has(d)||d.removeAttribute(i),Gl.delete(d)),S||d.removeAttribute(s)}),_h--,_h||(Ei=new WeakMap,Ei=new WeakMap,Gl=new WeakMap,ql={})}},wp=function(e,t,s){s===void 0&&(s="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),l=T4(e);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),D4(i,l,s,"aria-hidden")):function(){return null}},cs=function(){return cs=Object.assign||function(t){for(var s,i=1,l=arguments.length;i<l;i++){s=arguments[i];for(var m in s)Object.prototype.hasOwnProperty.call(s,m)&&(t[m]=s[m])}return t},cs.apply(this,arguments)};function Zw(e,t){var s={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(s[i[l]]=e[i[l]]);return s}function M4(e,t,s){if(s||arguments.length===2)for(var i=0,l=t.length,m;i<l;i++)(m||!(i in t))&&(m||(m=Array.prototype.slice.call(t,0,i)),m[i]=t[i]);return e.concat(m||Array.prototype.slice.call(t))}var tc="right-scroll-bar-position",rc="width-before-scroll-bar",L4="with-scroll-bars-hidden",O4="--removed-body-scroll-bar-size";function wh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function I4(e,t){var s=C.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(i){var l=s.value;l!==i&&(s.value=i,s.callback(i,l))}}}})[0];return s.callback=t,s.facade}var B4=typeof window<"u"?C.useLayoutEffect:C.useEffect,Py=new WeakMap;function F4(e,t){var s=I4(null,function(i){return e.forEach(function(l){return wh(l,i)})});return B4(function(){var i=Py.get(s);if(i){var l=new Set(i),m=new Set(e),f=s.current;l.forEach(function(a){m.has(a)||wh(a,null)}),m.forEach(function(a){l.has(a)||wh(a,f)})}Py.set(s,e)},[e]),s}function $4(e){return e}function H4(e,t){t===void 0&&(t=$4);var s=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(m){var f=t(m,i);return s.push(f),function(){s=s.filter(function(a){return a!==f})}},assignSyncMedium:function(m){for(i=!0;s.length;){var f=s;s=[],f.forEach(m)}s={push:function(a){return m(a)},filter:function(){return s}}},assignMedium:function(m){i=!0;var f=[];if(s.length){var a=s;s=[],a.forEach(m),f=s}var c=function(){var g=f;f=[],g.forEach(m)},h=function(){return Promise.resolve().then(c)};h(),s={push:function(g){f.push(g),h()},filter:function(g){return f=f.filter(g),s}}}};return l}function V4(e){e===void 0&&(e={});var t=H4(null);return t.options=cs({async:!0,ssr:!1},e),t}var eb=function(e){var t=e.sideCar,s=Zw(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return C.createElement(i,cs({},s))};eb.isSideCarExport=!0;function z4(e,t){return e.useMedium(t),eb}var tb=V4(),bh=function(){},Jc=C.forwardRef(function(e,t){var s=C.useRef(null),i=C.useState({onScrollCapture:bh,onWheelCapture:bh,onTouchMoveCapture:bh}),l=i[0],m=i[1],f=e.forwardProps,a=e.children,c=e.className,h=e.removeScrollBar,g=e.enabled,d=e.shards,_=e.sideCar,S=e.noRelative,E=e.noIsolation,b=e.inert,v=e.allowPinchZoom,y=e.as,p=y===void 0?"div":y,x=e.gapMode,k=Zw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=_,T=F4([s,t]),R=cs(cs({},k),l);return C.createElement(C.Fragment,null,g&&C.createElement(P,{sideCar:tb,removeScrollBar:h,shards:d,noRelative:S,noIsolation:E,inert:b,setCallbacks:m,allowPinchZoom:!!v,lockRef:s,gapMode:x}),f?C.cloneElement(C.Children.only(a),cs(cs({},R),{ref:T})):C.createElement(p,cs({},R,{className:c,ref:T}),a))});Jc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jc.classNames={fullWidth:rc,zeroRight:tc};var W4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function U4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=W4();return t&&e.setAttribute("nonce",t),e}function K4(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function G4(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var q4=function(){var e=0,t=null;return{add:function(s){e==0&&(t=U4())&&(K4(t,s),G4(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Y4=function(){var e=q4();return function(t,s){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},rb=function(){var e=Y4(),t=function(s){var i=s.styles,l=s.dynamic;return e(i,l),null};return t},X4={left:0,top:0,right:0,gap:0},Sh=function(e){return parseInt(e||"",10)||0},J4=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[Sh(s),Sh(i),Sh(l)]},Q4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return X4;var t=J4(e),s=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-s+t[2]-t[0])}},Z4=rb(),Li="data-scroll-locked",e5=function(e,t,s,i){var l=e.left,m=e.top,f=e.right,a=e.gap;return s===void 0&&(s="margin"),`
394
- .`.concat(L4,` {
395
- overflow: hidden `).concat(i,`;
396
- padding-right: `).concat(a,"px ").concat(i,`;
397
- }
398
- body[`).concat(Li,`] {
399
- overflow: hidden `).concat(i,`;
400
- overscroll-behavior: contain;
401
- `).concat([t&&"position: relative ".concat(i,";"),s==="margin"&&`
402
- padding-left: `.concat(l,`px;
403
- padding-top: `).concat(m,`px;
404
- padding-right: `).concat(f,`px;
405
- margin-left:0;
406
- margin-top:0;
407
- margin-right: `).concat(a,"px ").concat(i,`;
408
- `),s==="padding"&&"padding-right: ".concat(a,"px ").concat(i,";")].filter(Boolean).join(""),`
409
- }
410
-
411
- .`).concat(tc,` {
412
- right: `).concat(a,"px ").concat(i,`;
413
- }
414
-
415
- .`).concat(rc,` {
416
- margin-right: `).concat(a,"px ").concat(i,`;
417
- }
418
-
419
- .`).concat(tc," .").concat(tc,` {
420
- right: 0 `).concat(i,`;
421
- }
422
-
423
- .`).concat(rc," .").concat(rc,` {
424
- margin-right: 0 `).concat(i,`;
425
- }
426
-
427
- body[`).concat(Li,`] {
428
- `).concat(O4,": ").concat(a,`px;
429
- }
430
- `)},Ry=function(){var e=parseInt(document.body.getAttribute(Li)||"0",10);return isFinite(e)?e:0},t5=function(){C.useEffect(function(){return document.body.setAttribute(Li,(Ry()+1).toString()),function(){var e=Ry()-1;e<=0?document.body.removeAttribute(Li):document.body.setAttribute(Li,e.toString())}},[])},r5=function(e){var t=e.noRelative,s=e.noImportant,i=e.gapMode,l=i===void 0?"margin":i;t5();var m=C.useMemo(function(){return Q4(l)},[l]);return C.createElement(Z4,{styles:e5(m,!t,l,s?"":"!important")})},rf=!1;if(typeof window<"u")try{var Yl=Object.defineProperty({},"passive",{get:function(){return rf=!0,!0}});window.addEventListener("test",Yl,Yl),window.removeEventListener("test",Yl,Yl)}catch{rf=!1}var ji=rf?{passive:!1}:!1,s5=function(e){return e.tagName==="TEXTAREA"},sb=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!s5(e)&&s[t]==="visible")},n5=function(e){return sb(e,"overflowY")},i5=function(e){return sb(e,"overflowX")},Ty=function(e,t){var s=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=nb(e,i);if(l){var m=ib(e,i),f=m[1],a=m[2];if(f>a)return!0}i=i.parentNode}while(i&&i!==s.body);return!1},o5=function(e){var t=e.scrollTop,s=e.scrollHeight,i=e.clientHeight;return[t,s,i]},a5=function(e){var t=e.scrollLeft,s=e.scrollWidth,i=e.clientWidth;return[t,s,i]},nb=function(e,t){return e==="v"?n5(t):i5(t)},ib=function(e,t){return e==="v"?o5(t):a5(t)},l5=function(e,t){return e==="h"&&t==="rtl"?-1:1},c5=function(e,t,s,i,l){var m=l5(e,window.getComputedStyle(t).direction),f=m*i,a=s.target,c=t.contains(a),h=!1,g=f>0,d=0,_=0;do{if(!a)break;var S=ib(e,a),E=S[0],b=S[1],v=S[2],y=b-v-m*E;(E||y)&&nb(e,a)&&(d+=y,_+=E);var p=a.parentNode;a=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(g&&Math.abs(d)<1||!g&&Math.abs(_)<1)&&(h=!0),h},Xl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ay=function(e){return[e.deltaX,e.deltaY]},Dy=function(e){return e&&"current"in e?e.current:e},u5=function(e,t){return e[0]===t[0]&&e[1]===t[1]},d5=function(e){return`
431
- .block-interactivity-`.concat(e,` {pointer-events: none;}
432
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
433
- `)},h5=0,Ni=[];function f5(e){var t=C.useRef([]),s=C.useRef([0,0]),i=C.useRef(),l=C.useState(h5++)[0],m=C.useState(rb)[0],f=C.useRef(e);C.useEffect(function(){f.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var b=M4([e.lockRef.current],(e.shards||[]).map(Dy),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!f.current.allowPinchZoom;var y=Xl(b),p=s.current,x="deltaX"in b?b.deltaX:p[0]-y[0],k="deltaY"in b?b.deltaY:p[1]-y[1],P,T=b.target,R=Math.abs(x)>Math.abs(k)?"h":"v";if("touches"in b&&R==="h"&&T.type==="range")return!1;var j=window.getSelection(),L=j&&j.anchorNode,$=L?L===T||L.contains(T):!1;if($)return!1;var F=Ty(R,T);if(!F)return!0;if(F?P=R:(P=R==="v"?"h":"v",F=Ty(R,T)),!F)return!1;if(!i.current&&"changedTouches"in b&&(x||k)&&(i.current=P),!P)return!0;var W=i.current||P;return c5(W,v,b,W==="h"?x:k)},[]),c=C.useCallback(function(b){var v=b;if(!(!Ni.length||Ni[Ni.length-1]!==m)){var y="deltaY"in v?Ay(v):Xl(v),p=t.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&u5(P.delta,y)})[0];if(p&&p.should){v.cancelable&&v.preventDefault();return}if(!p){var x=(f.current.shards||[]).map(Dy).filter(Boolean).filter(function(P){return P.contains(v.target)}),k=x.length>0?a(v,x[0]):!f.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),h=C.useCallback(function(b,v,y,p){var x={name:b,delta:v,target:y,should:p,shadowParent:p5(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(k){return k!==x})},1)},[]),g=C.useCallback(function(b){s.current=Xl(b),i.current=void 0},[]),d=C.useCallback(function(b){h(b.type,Ay(b),b.target,a(b,e.lockRef.current))},[]),_=C.useCallback(function(b){h(b.type,Xl(b),b.target,a(b,e.lockRef.current))},[]);C.useEffect(function(){return Ni.push(m),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:_}),document.addEventListener("wheel",c,ji),document.addEventListener("touchmove",c,ji),document.addEventListener("touchstart",g,ji),function(){Ni=Ni.filter(function(b){return b!==m}),document.removeEventListener("wheel",c,ji),document.removeEventListener("touchmove",c,ji),document.removeEventListener("touchstart",g,ji)}},[]);var S=e.removeScrollBar,E=e.inert;return C.createElement(C.Fragment,null,E?C.createElement(m,{styles:d5(l)}):null,S?C.createElement(r5,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function p5(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const m5=z4(tb,f5);var Qc=C.forwardRef(function(e,t){return C.createElement(Jc,cs({},e,{ref:t,sideCar:m5}))});Qc.classNames=Jc.classNames;var g5=[" ","Enter","ArrowUp","ArrowDown"],v5=[" ","Enter"],Yn="Select",[Zc,eu,y5]=ap(Yn),[Zi]=gr(Yn,[y5,Qi]),tu=Qi(),[x5,wn]=Zi(Yn),[_5,w5]=Zi(Yn),ob=e=>{const{__scopeSelect:t,children:s,open:i,defaultOpen:l,onOpenChange:m,value:f,defaultValue:a,onValueChange:c,dir:h,name:g,autoComplete:d,disabled:_,required:S,form:E}=e,b=tu(t),[v,y]=C.useState(null),[p,x]=C.useState(null),[k,P]=C.useState(!1),T=ya(h),[R,j]=Zr({prop:i,defaultProp:l??!1,onChange:m,caller:Yn}),[L,$]=Zr({prop:f,defaultProp:a,onChange:c,caller:Yn}),F=C.useRef(null),W=v?E||!!v.closest("form"):!0,[H,J]=C.useState(new Set),G=Array.from(H).map(Y=>Y.props.value).join(";");return o.jsx(Xc,{...b,children:o.jsxs(x5,{required:S,scope:t,trigger:v,onTriggerChange:y,valueNode:p,onValueNodeChange:x,valueNodeHasChildren:k,onValueNodeHasChildrenChange:P,contentId:mr(),value:L,onValueChange:$,open:R,onOpenChange:j,dir:T,triggerPointerDownPosRef:F,disabled:_,children:[o.jsx(Zc.Provider,{scope:t,children:o.jsx(_5,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(Y=>{J(ee=>new Set(ee).add(Y))},[]),onNativeOptionRemove:C.useCallback(Y=>{J(ee=>{const z=new Set(ee);return z.delete(Y),z})},[]),children:s})}),W?o.jsxs(Rb,{"aria-hidden":!0,required:S,tabIndex:-1,name:g,autoComplete:d,value:L,onChange:Y=>$(Y.target.value),disabled:_,form:E,children:[L===void 0?o.jsx("option",{value:""}):null,Array.from(H)]},G):null]})})};ob.displayName=Yn;var ab="SelectTrigger",lb=C.forwardRef((e,t)=>{const{__scopeSelect:s,disabled:i=!1,...l}=e,m=tu(s),f=wn(ab,s),a=f.disabled||i,c=Ve(t,f.onTriggerChange),h=eu(s),g=C.useRef("touch"),[d,_,S]=Ab(b=>{const v=h().filter(x=>!x.disabled),y=v.find(x=>x.value===f.value),p=Db(v,b,y);p!==void 0&&f.onValueChange(p.value)}),E=b=>{a||(f.onOpenChange(!0),S()),b&&(f.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return o.jsx(yp,{asChild:!0,...m,children:o.jsx(Le.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Tb(f.value)?"":void 0,...l,ref:c,onClick:ye(l.onClick,b=>{b.currentTarget.focus(),g.current!=="mouse"&&E(b)}),onPointerDown:ye(l.onPointerDown,b=>{g.current=b.pointerType;const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(E(b),b.preventDefault())}),onKeyDown:ye(l.onKeyDown,b=>{const v=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&_(b.key),!(v&&b.key===" ")&&g5.includes(b.key)&&(E(),b.preventDefault())})})})});lb.displayName=ab;var cb="SelectValue",ub=C.forwardRef((e,t)=>{const{__scopeSelect:s,className:i,style:l,children:m,placeholder:f="",...a}=e,c=wn(cb,s),{onValueNodeHasChildrenChange:h}=c,g=m!==void 0,d=Ve(t,c.onValueNodeChange);return Dt(()=>{h(g)},[h,g]),o.jsx(Le.span,{...a,ref:d,style:{pointerEvents:"none"},children:Tb(c.value)?o.jsx(o.Fragment,{children:f}):m})});ub.displayName=cb;var b5="SelectIcon",db=C.forwardRef((e,t)=>{const{__scopeSelect:s,children:i,...l}=e;return o.jsx(Le.span,{"aria-hidden":!0,...l,ref:t,children:i||"▼"})});db.displayName=b5;var S5="SelectPortal",hb=e=>o.jsx(Sa,{asChild:!0,...e});hb.displayName=S5;var Xn="SelectContent",fb=C.forwardRef((e,t)=>{const s=wn(Xn,e.__scopeSelect),[i,l]=C.useState();if(Dt(()=>{l(new DocumentFragment)},[]),!s.open){const m=i;return m?ha.createPortal(o.jsx(pb,{scope:e.__scopeSelect,children:o.jsx(Zc.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),m):null}return o.jsx(mb,{...e,ref:t})});fb.displayName=Xn;var Xr=10,[pb,bn]=Zi(Xn),C5="SelectContentImpl",k5=S4("SelectContent.RemoveScroll"),mb=C.forwardRef((e,t)=>{const{__scopeSelect:s,position:i="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:m,onPointerDownOutside:f,side:a,sideOffset:c,align:h,alignOffset:g,arrowPadding:d,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:b,avoidCollisions:v,...y}=e,p=wn(Xn,s),[x,k]=C.useState(null),[P,T]=C.useState(null),R=Ve(t,U=>k(U)),[j,L]=C.useState(null),[$,F]=C.useState(null),W=eu(s),[H,J]=C.useState(!1),G=C.useRef(!1);C.useEffect(()=>{if(x)return wp(x)},[x]),cp();const Y=C.useCallback(U=>{const[D,...K]=W().map(ae=>ae.ref.current),[q]=K.slice(-1),ie=document.activeElement;for(const ae of U)if(ae===ie||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===D&&P&&(P.scrollTop=0),ae===q&&P&&(P.scrollTop=P.scrollHeight),ae==null||ae.focus(),document.activeElement!==ie))return},[W,P]),ee=C.useCallback(()=>Y([j,x]),[Y,j,x]);C.useEffect(()=>{H&&ee()},[H,ee]);const{onOpenChange:z,triggerPointerDownPosRef:M}=p;C.useEffect(()=>{if(x){let U={x:0,y:0};const D=q=>{var ie,ae;U={x:Math.abs(Math.round(q.pageX)-(((ie=M.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round(q.pageY)-(((ae=M.current)==null?void 0:ae.y)??0))}},K=q=>{U.x<=10&&U.y<=10?q.preventDefault():x.contains(q.target)||z(!1),document.removeEventListener("pointermove",D),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",D),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",K,{capture:!0})}}},[x,z,M]),C.useEffect(()=>{const U=()=>z(!1);return window.addEventListener("blur",U),window.addEventListener("resize",U),()=>{window.removeEventListener("blur",U),window.removeEventListener("resize",U)}},[z]);const[B,O]=Ab(U=>{const D=W().filter(ie=>!ie.disabled),K=D.find(ie=>ie.ref.current===document.activeElement),q=Db(D,U,K);q&&setTimeout(()=>q.ref.current.focus())}),V=C.useCallback((U,D,K)=>{const q=!G.current&&!K;(p.value!==void 0&&p.value===D||q)&&(L(U),q&&(G.current=!0))},[p.value]),Z=C.useCallback(()=>x==null?void 0:x.focus(),[x]),re=C.useCallback((U,D,K)=>{const q=!G.current&&!K;(p.value!==void 0&&p.value===D||q)&&F(U)},[p.value]),ce=i==="popper"?sf:gb,ue=ce===sf?{side:a,sideOffset:c,align:h,alignOffset:g,arrowPadding:d,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:b,avoidCollisions:v}:{};return o.jsx(pb,{scope:s,content:x,viewport:P,onViewportChange:T,itemRefCallback:V,selectedItem:j,onItemLeave:Z,itemTextRefCallback:re,focusSelectedItem:ee,selectedItemText:$,position:i,isPositioned:H,searchRef:B,children:o.jsx(Qc,{as:k5,allowPinchZoom:!0,children:o.jsx(Uc,{asChild:!0,trapped:p.open,onMountAutoFocus:U=>{U.preventDefault()},onUnmountAutoFocus:ye(l,U=>{var D;(D=p.trigger)==null||D.focus({preventScroll:!0}),U.preventDefault()}),children:o.jsx(wa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:m,onPointerDownOutside:f,onFocusOutside:U=>U.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:o.jsx(ce,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:U=>U.preventDefault(),...y,...ue,onPlaced:()=>J(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ye(y.onKeyDown,U=>{const D=U.ctrlKey||U.altKey||U.metaKey;if(U.key==="Tab"&&U.preventDefault(),!D&&U.key.length===1&&O(U.key),["ArrowUp","ArrowDown","Home","End"].includes(U.key)){let q=W().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(U.key)&&(q=q.slice().reverse()),["ArrowUp","ArrowDown"].includes(U.key)){const ie=U.target,ae=q.indexOf(ie);q=q.slice(ae+1)}setTimeout(()=>Y(q)),U.preventDefault()}})})})})})})});mb.displayName=C5;var E5="SelectItemAlignedPosition",gb=C.forwardRef((e,t)=>{const{__scopeSelect:s,onPlaced:i,...l}=e,m=wn(Xn,s),f=bn(Xn,s),[a,c]=C.useState(null),[h,g]=C.useState(null),d=Ve(t,R=>g(R)),_=eu(s),S=C.useRef(!1),E=C.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:p}=f,x=C.useCallback(()=>{if(m.trigger&&m.valueNode&&a&&h&&b&&v&&y){const R=m.trigger.getBoundingClientRect(),j=h.getBoundingClientRect(),L=m.valueNode.getBoundingClientRect(),$=y.getBoundingClientRect();if(m.dir!=="rtl"){const ie=$.left-j.left,ae=L.left-ie,ve=R.left-ae,He=R.width+ve,Ue=Math.max(He,j.width),Xe=window.innerWidth-Xr,Ee=Jh(ae,[Xr,Math.max(Xr,Xe-Ue)]);a.style.minWidth=He+"px",a.style.left=Ee+"px"}else{const ie=j.right-$.right,ae=window.innerWidth-L.right-ie,ve=window.innerWidth-R.right-ae,He=R.width+ve,Ue=Math.max(He,j.width),Xe=window.innerWidth-Xr,Ee=Jh(ae,[Xr,Math.max(Xr,Xe-Ue)]);a.style.minWidth=He+"px",a.style.right=Ee+"px"}const F=_(),W=window.innerHeight-Xr*2,H=b.scrollHeight,J=window.getComputedStyle(h),G=parseInt(J.borderTopWidth,10),Y=parseInt(J.paddingTop,10),ee=parseInt(J.borderBottomWidth,10),z=parseInt(J.paddingBottom,10),M=G+Y+H+z+ee,B=Math.min(v.offsetHeight*5,M),O=window.getComputedStyle(b),V=parseInt(O.paddingTop,10),Z=parseInt(O.paddingBottom,10),re=R.top+R.height/2-Xr,ce=W-re,ue=v.offsetHeight/2,U=v.offsetTop+ue,D=G+Y+U,K=M-D;if(D<=re){const ie=F.length>0&&v===F[F.length-1].ref.current;a.style.bottom="0px";const ae=h.clientHeight-b.offsetTop-b.offsetHeight,ve=Math.max(ce,ue+(ie?Z:0)+ae+ee),He=D+ve;a.style.height=He+"px"}else{const ie=F.length>0&&v===F[0].ref.current;a.style.top="0px";const ve=Math.max(re,G+b.offsetTop+(ie?V:0)+ue)+K;a.style.height=ve+"px",b.scrollTop=D-re+b.offsetTop}a.style.margin=`${Xr}px 0`,a.style.minHeight=B+"px",a.style.maxHeight=W+"px",i==null||i(),requestAnimationFrame(()=>S.current=!0)}},[_,m.trigger,m.valueNode,a,h,b,v,y,m.dir,i]);Dt(()=>x(),[x]);const[k,P]=C.useState();Dt(()=>{h&&P(window.getComputedStyle(h).zIndex)},[h]);const T=C.useCallback(R=>{R&&E.current===!0&&(x(),p==null||p(),E.current=!1)},[x,p]);return o.jsx(N5,{scope:s,contentWrapper:a,shouldExpandOnScrollRef:S,onScrollButtonChange:T,children:o.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:o.jsx(Le.div,{...l,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});gb.displayName=E5;var j5="SelectPopperPosition",sf=C.forwardRef((e,t)=>{const{__scopeSelect:s,align:i="start",collisionPadding:l=Xr,...m}=e,f=tu(s);return o.jsx(xp,{...f,...m,ref:t,align:i,collisionPadding:l,style:{boxSizing:"border-box",...m.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)"}})});sf.displayName=j5;var[N5,bp]=Zi(Xn,{}),nf="SelectViewport",vb=C.forwardRef((e,t)=>{const{__scopeSelect:s,nonce:i,...l}=e,m=bn(nf,s),f=bp(nf,s),a=Ve(t,m.onViewportChange),c=C.useRef(0);return o.jsxs(o.Fragment,{children:[o.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:i}),o.jsx(Zc.Slot,{scope:s,children:o.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:ye(l.onScroll,h=>{const g=h.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:_}=f;if(_!=null&&_.current&&d){const S=Math.abs(c.current-g.scrollTop);if(S>0){const E=window.innerHeight-Xr*2,b=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),y=Math.max(b,v);if(y<E){const p=y+S,x=Math.min(E,p),k=p-x;d.style.height=x+"px",d.style.bottom==="0px"&&(g.scrollTop=k>0?k:0,d.style.justifyContent="flex-end")}}}c.current=g.scrollTop})})})]})});vb.displayName=nf;var yb="SelectGroup",[P5,R5]=Zi(yb),T5=C.forwardRef((e,t)=>{const{__scopeSelect:s,...i}=e,l=mr();return o.jsx(P5,{scope:s,id:l,children:o.jsx(Le.div,{role:"group","aria-labelledby":l,...i,ref:t})})});T5.displayName=yb;var xb="SelectLabel",_b=C.forwardRef((e,t)=>{const{__scopeSelect:s,...i}=e,l=R5(xb,s);return o.jsx(Le.div,{id:l.id,...i,ref:t})});_b.displayName=xb;var xc="SelectItem",[A5,wb]=Zi(xc),bb=C.forwardRef((e,t)=>{const{__scopeSelect:s,value:i,disabled:l=!1,textValue:m,...f}=e,a=wn(xc,s),c=bn(xc,s),h=a.value===i,[g,d]=C.useState(m??""),[_,S]=C.useState(!1),E=Ve(t,p=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,p,i,l)}),b=mr(),v=C.useRef("touch"),y=()=>{l||(a.onValueChange(i),a.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(A5,{scope:s,value:i,disabled:l,textId:b,isSelected:h,onItemTextChange:C.useCallback(p=>{d(x=>x||((p==null?void 0:p.textContent)??"").trim())},[]),children:o.jsx(Zc.ItemSlot,{scope:s,value:i,disabled:l,textValue:g,children:o.jsx(Le.div,{role:"option","aria-labelledby":b,"data-highlighted":_?"":void 0,"aria-selected":h&&_,"data-state":h?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...f,ref:E,onFocus:ye(f.onFocus,()=>S(!0)),onBlur:ye(f.onBlur,()=>S(!1)),onClick:ye(f.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:ye(f.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:ye(f.onPointerDown,p=>{v.current=p.pointerType}),onPointerMove:ye(f.onPointerMove,p=>{var x;v.current=p.pointerType,l?(x=c.onItemLeave)==null||x.call(c):v.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ye(f.onPointerLeave,p=>{var x;p.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:ye(f.onKeyDown,p=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&p.key===" "||(v5.includes(p.key)&&y(),p.key===" "&&p.preventDefault())})})})})});bb.displayName=xc;var Uo="SelectItemText",Sb=C.forwardRef((e,t)=>{const{__scopeSelect:s,className:i,style:l,...m}=e,f=wn(Uo,s),a=bn(Uo,s),c=wb(Uo,s),h=w5(Uo,s),[g,d]=C.useState(null),_=Ve(t,y=>d(y),c.onItemTextChange,y=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,y,c.value,c.disabled)}),S=g==null?void 0:g.textContent,E=C.useMemo(()=>o.jsx("option",{value:c.value,disabled:c.disabled,children:S},c.value),[c.disabled,c.value,S]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=h;return Dt(()=>(b(E),()=>v(E)),[b,v,E]),o.jsxs(o.Fragment,{children:[o.jsx(Le.span,{id:c.textId,...m,ref:_}),c.isSelected&&f.valueNode&&!f.valueNodeHasChildren?ha.createPortal(m.children,f.valueNode):null]})});Sb.displayName=Uo;var Cb="SelectItemIndicator",kb=C.forwardRef((e,t)=>{const{__scopeSelect:s,...i}=e;return wb(Cb,s).isSelected?o.jsx(Le.span,{"aria-hidden":!0,...i,ref:t}):null});kb.displayName=Cb;var of="SelectScrollUpButton",Eb=C.forwardRef((e,t)=>{const s=bn(of,e.__scopeSelect),i=bp(of,e.__scopeSelect),[l,m]=C.useState(!1),f=Ve(t,i.onScrollButtonChange);return Dt(()=>{if(s.viewport&&s.isPositioned){let a=function(){const h=c.scrollTop>0;m(h)};const c=s.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[s.viewport,s.isPositioned]),l?o.jsx(Nb,{...e,ref:f,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=s;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Eb.displayName=of;var af="SelectScrollDownButton",jb=C.forwardRef((e,t)=>{const s=bn(af,e.__scopeSelect),i=bp(af,e.__scopeSelect),[l,m]=C.useState(!1),f=Ve(t,i.onScrollButtonChange);return Dt(()=>{if(s.viewport&&s.isPositioned){let a=function(){const h=c.scrollHeight-c.clientHeight,g=Math.ceil(c.scrollTop)<h;m(g)};const c=s.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[s.viewport,s.isPositioned]),l?o.jsx(Nb,{...e,ref:f,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=s;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});jb.displayName=af;var Nb=C.forwardRef((e,t)=>{const{__scopeSelect:s,onAutoScroll:i,...l}=e,m=bn("SelectScrollButton",s),f=C.useRef(null),a=eu(s),c=C.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),Dt(()=>{var g;const h=a().find(d=>d.ref.current===document.activeElement);(g=h==null?void 0:h.ref.current)==null||g.scrollIntoView({block:"nearest"})},[a]),o.jsx(Le.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:ye(l.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(i,50))}),onPointerMove:ye(l.onPointerMove,()=>{var h;(h=m.onItemLeave)==null||h.call(m),f.current===null&&(f.current=window.setInterval(i,50))}),onPointerLeave:ye(l.onPointerLeave,()=>{c()})})}),D5="SelectSeparator",Pb=C.forwardRef((e,t)=>{const{__scopeSelect:s,...i}=e;return o.jsx(Le.div,{"aria-hidden":!0,...i,ref:t})});Pb.displayName=D5;var lf="SelectArrow",M5=C.forwardRef((e,t)=>{const{__scopeSelect:s,...i}=e,l=tu(s),m=wn(lf,s),f=bn(lf,s);return m.open&&f.position==="popper"?o.jsx(_p,{...l,...i,ref:t}):null});M5.displayName=lf;var L5="SelectBubbleInput",Rb=C.forwardRef(({__scopeSelect:e,value:t,...s},i)=>{const l=C.useRef(null),m=Ve(i,l),f=ip(t);return C.useEffect(()=>{const a=l.current;if(!a)return;const c=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(c,"value").set;if(f!==t&&g){const d=new Event("change",{bubbles:!0});g.call(a,t),a.dispatchEvent(d)}},[f,t]),o.jsx(Le.select,{...s,style:{...Xw,...s.style},ref:m,defaultValue:t})});Rb.displayName=L5;function Tb(e){return e===""||e===void 0}function Ab(e){const t=At(e),s=C.useRef(""),i=C.useRef(0),l=C.useCallback(f=>{const a=s.current+f;t(a),(function c(h){s.current=h,window.clearTimeout(i.current),h!==""&&(i.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),m=C.useCallback(()=>{s.current="",window.clearTimeout(i.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(i.current),[]),[s,l,m]}function Db(e,t,s){const l=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,m=s?e.indexOf(s):-1;let f=O5(e,Math.max(m,0));l.length===1&&(f=f.filter(h=>h!==s));const c=f.find(h=>h.textValue.toLowerCase().startsWith(l.toLowerCase()));return c!==s?c:void 0}function O5(e,t){return e.map((s,i)=>e[(t+i)%e.length])}var I5=ob,Mb=lb,B5=ub,F5=db,$5=hb,Lb=fb,H5=vb,Ob=_b,Ib=bb,V5=Sb,z5=kb,Bb=Eb,Fb=jb,$b=Pb;const _c=I5,wc=B5,oa=C.forwardRef(({className:e,children:t,...s},i)=>o.jsxs(Mb,{ref:i,className:xe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...s,children:[t,o.jsx(F5,{asChild:!0,children:o.jsx(va,{className:"h-4 w-4 opacity-50"})})]}));oa.displayName=Mb.displayName;const Hb=C.forwardRef(({className:e,...t},s)=>o.jsx(Bb,{ref:s,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx($R,{className:"h-4 w-4"})}));Hb.displayName=Bb.displayName;const Vb=C.forwardRef(({className:e,...t},s)=>o.jsx(Fb,{ref:s,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(va,{className:"h-4 w-4"})}));Vb.displayName=Fb.displayName;const aa=C.forwardRef(({className:e,children:t,position:s="popper",...i},l)=>o.jsx($5,{children:o.jsxs(Lb,{ref:l,className:xe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,...i,children:[o.jsx(Hb,{}),o.jsx(H5,{className:xe("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(Vb,{})]})}));aa.displayName=Lb.displayName;const W5=C.forwardRef(({className:e,...t},s)=>o.jsx(Ob,{ref:s,className:xe("px-2 py-1.5 text-sm font-semibold",e),...t}));W5.displayName=Ob.displayName;const Jr=C.forwardRef(({className:e,children:t,...s},i)=>o.jsxs(Ib,{ref:i,className:xe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(z5,{children:o.jsx(Nr,{className:"h-4 w-4"})})}),o.jsx(V5,{children:t})]}));Jr.displayName=Ib.displayName;const U5=C.forwardRef(({className:e,...t},s)=>o.jsx($b,{ref:s,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));U5.displayName=$b.displayName;var K5=Symbol("radix.slottable");function G5(e){const t=({children:s})=>o.jsx(o.Fragment,{children:s});return t.displayName=`${e}.Slottable`,t.__radixId=K5,t}var[ru]=gr("Tooltip",[Qi]),su=Qi(),zb="TooltipProvider",q5=700,cf="tooltip.open",[Y5,Sp]=ru(zb),Wb=e=>{const{__scopeTooltip:t,delayDuration:s=q5,skipDelayDuration:i=300,disableHoverableContent:l=!1,children:m}=e,f=C.useRef(!0),a=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const h=c.current;return()=>window.clearTimeout(h)},[]),o.jsx(Y5,{scope:t,isOpenDelayedRef:f,delayDuration:s,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),f.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>f.current=!0,i)},[i]),isPointerInTransitRef:a,onPointerInTransitChange:C.useCallback(h=>{a.current=h},[]),disableHoverableContent:l,children:m})};Wb.displayName=zb;var la="Tooltip",[X5,Ca]=ru(la),Ub=e=>{const{__scopeTooltip:t,children:s,open:i,defaultOpen:l,onOpenChange:m,disableHoverableContent:f,delayDuration:a}=e,c=Sp(la,e.__scopeTooltip),h=su(t),[g,d]=C.useState(null),_=mr(),S=C.useRef(0),E=f??c.disableHoverableContent,b=a??c.delayDuration,v=C.useRef(!1),[y,p]=Zr({prop:i,defaultProp:l??!1,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(cf))):c.onClose(),m==null||m(R)},caller:la}),x=C.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),k=C.useCallback(()=>{window.clearTimeout(S.current),S.current=0,v.current=!1,p(!0)},[p]),P=C.useCallback(()=>{window.clearTimeout(S.current),S.current=0,p(!1)},[p]),T=C.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{v.current=!0,p(!0),S.current=0},b)},[b,p]);return C.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),o.jsx(Xc,{...h,children:o.jsx(X5,{scope:t,contentId:_,open:y,stateAttribute:x,trigger:g,onTriggerChange:d,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayedRef.current?T():k()},[c.isOpenDelayedRef,T,k]),onTriggerLeave:C.useCallback(()=>{E?P():(window.clearTimeout(S.current),S.current=0)},[P,E]),onOpen:k,onClose:P,disableHoverableContent:E,children:s})})};Ub.displayName=la;var uf="TooltipTrigger",Kb=C.forwardRef((e,t)=>{const{__scopeTooltip:s,...i}=e,l=Ca(uf,s),m=Sp(uf,s),f=su(s),a=C.useRef(null),c=Ve(t,a,l.onTriggerChange),h=C.useRef(!1),g=C.useRef(!1),d=C.useCallback(()=>h.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),o.jsx(yp,{asChild:!0,...f,children:o.jsx(Le.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:c,onPointerMove:ye(e.onPointerMove,_=>{_.pointerType!=="touch"&&!g.current&&!m.isPointerInTransitRef.current&&(l.onTriggerEnter(),g.current=!0)}),onPointerLeave:ye(e.onPointerLeave,()=>{l.onTriggerLeave(),g.current=!1}),onPointerDown:ye(e.onPointerDown,()=>{l.open&&l.onClose(),h.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ye(e.onFocus,()=>{h.current||l.onOpen()}),onBlur:ye(e.onBlur,l.onClose),onClick:ye(e.onClick,l.onClose)})})});Kb.displayName=uf;var Cp="TooltipPortal",[J5,Q5]=ru(Cp,{forceMount:void 0}),Gb=e=>{const{__scopeTooltip:t,forceMount:s,children:i,container:l}=e,m=Ca(Cp,t);return o.jsx(J5,{scope:t,forceMount:s,children:o.jsx($t,{present:s||m.open,children:o.jsx(Sa,{asChild:!0,container:l,children:i})})})};Gb.displayName=Cp;var Vi="TooltipContent",qb=C.forwardRef((e,t)=>{const s=Q5(Vi,e.__scopeTooltip),{forceMount:i=s.forceMount,side:l="top",...m}=e,f=Ca(Vi,e.__scopeTooltip);return o.jsx($t,{present:i||f.open,children:f.disableHoverableContent?o.jsx(Yb,{side:l,...m,ref:t}):o.jsx(Z5,{side:l,...m,ref:t})})}),Z5=C.forwardRef((e,t)=>{const s=Ca(Vi,e.__scopeTooltip),i=Sp(Vi,e.__scopeTooltip),l=C.useRef(null),m=Ve(t,l),[f,a]=C.useState(null),{trigger:c,onClose:h}=s,g=l.current,{onPointerInTransitChange:d}=i,_=C.useCallback(()=>{a(null),d(!1)},[d]),S=C.useCallback((E,b)=>{const v=E.currentTarget,y={x:E.clientX,y:E.clientY},p=nL(y,v.getBoundingClientRect()),x=iL(y,p),k=oL(b.getBoundingClientRect()),P=lL([...x,...k]);a(P),d(!0)},[d]);return C.useEffect(()=>()=>_(),[_]),C.useEffect(()=>{if(c&&g){const E=v=>S(v,g),b=v=>S(v,c);return c.addEventListener("pointerleave",E),g.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",E),g.removeEventListener("pointerleave",b)}}},[c,g,S,_]),C.useEffect(()=>{if(f){const E=b=>{const v=b.target,y={x:b.clientX,y:b.clientY},p=(c==null?void 0:c.contains(v))||(g==null?void 0:g.contains(v)),x=!aL(y,f);p?_():x&&(_(),h())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[c,g,f,h,_]),o.jsx(Yb,{...e,ref:m})}),[eL,tL]=ru(la,{isInside:!1}),rL=G5("TooltipContent"),Yb=C.forwardRef((e,t)=>{const{__scopeTooltip:s,children:i,"aria-label":l,onEscapeKeyDown:m,onPointerDownOutside:f,...a}=e,c=Ca(Vi,s),h=su(s),{onClose:g}=c;return C.useEffect(()=>(document.addEventListener(cf,g),()=>document.removeEventListener(cf,g)),[g]),C.useEffect(()=>{if(c.trigger){const d=_=>{const S=_.target;S!=null&&S.contains(c.trigger)&&g()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,g]),o.jsx(wa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:m,onPointerDownOutside:f,onFocusOutside:d=>d.preventDefault(),onDismiss:g,children:o.jsxs(xp,{"data-state":c.stateAttribute,...h,...a,ref:t,style:{...a.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:[o.jsx(rL,{children:i}),o.jsx(eL,{scope:s,isInside:!0,children:o.jsx(R4,{id:c.contentId,role:"tooltip",children:l||i})})]})})});qb.displayName=Vi;var Xb="TooltipArrow",sL=C.forwardRef((e,t)=>{const{__scopeTooltip:s,...i}=e,l=su(s);return tL(Xb,s).isInside?null:o.jsx(_p,{...l,...i,ref:t})});sL.displayName=Xb;function nL(e,t){const s=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),l=Math.abs(t.right-e.x),m=Math.abs(t.left-e.x);switch(Math.min(s,i,l,m)){case m:return"left";case l:return"right";case s:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function iL(e,t,s=5){const i=[];switch(t){case"top":i.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":i.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":i.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":i.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return i}function oL(e){const{top:t,right:s,bottom:i,left:l}=e;return[{x:l,y:t},{x:s,y:t},{x:s,y:i},{x:l,y:i}]}function aL(e,t){const{x:s,y:i}=e;let l=!1;for(let m=0,f=t.length-1;m<t.length;f=m++){const a=t[m],c=t[f],h=a.x,g=a.y,d=c.x,_=c.y;g>i!=_>i&&s<(d-h)*(i-g)/(_-g)+h&&(l=!l)}return l}function lL(e){const t=e.slice();return t.sort((s,i)=>s.x<i.x?-1:s.x>i.x?1:s.y<i.y?-1:s.y>i.y?1:0),cL(t)}function cL(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i<e.length;i++){const l=e[i];for(;t.length>=2;){const m=t[t.length-1],f=t[t.length-2];if((m.x-f.x)*(l.y-f.y)>=(m.y-f.y)*(l.x-f.x))t.pop();else break}t.push(l)}t.pop();const s=[];for(let i=e.length-1;i>=0;i--){const l=e[i];for(;s.length>=2;){const m=s[s.length-1],f=s[s.length-2];if((m.x-f.x)*(l.y-f.y)>=(m.y-f.y)*(l.x-f.x))s.pop();else break}s.push(l)}return s.pop(),t.length===1&&s.length===1&&t[0].x===s[0].x&&t[0].y===s[0].y?t:t.concat(s)}var uL=Wb,dL=Ub,hL=Kb,fL=Gb,Jb=qb;const Qb=uL,fn=dL,pn=hL,Ds=C.forwardRef(({className:e,sideOffset:t=4,...s},i)=>o.jsx(fL,{children:o.jsx(Jb,{ref:i,sideOffset:t,className:xe("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));Ds.displayName=Jb.displayName;const pL=$c("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),bc=C.forwardRef(({className:e,variant:t,...s},i)=>o.jsx("div",{ref:i,role:"alert",className:xe(pL({variant:t}),e),...s}));bc.displayName="Alert";const mL=C.forwardRef(({className:e,...t},s)=>o.jsx("h5",{ref:s,className:xe("mb-1 font-medium leading-none tracking-tight",e),...t}));mL.displayName="AlertTitle";const Sc=C.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:xe("text-sm [&_p]:leading-relaxed",e),...t}));Sc.displayName="AlertDescription";var nu="Collapsible",[gL]=gr(nu),[vL,kp]=gL(nu),Zb=C.forwardRef((e,t)=>{const{__scopeCollapsible:s,open:i,defaultOpen:l,disabled:m,onOpenChange:f,...a}=e,[c,h]=Zr({prop:i,defaultProp:l??!1,onChange:f,caller:nu});return o.jsx(vL,{scope:s,disabled:m,contentId:mr(),open:c,onOpenToggle:C.useCallback(()=>h(g=>!g),[h]),children:o.jsx(Le.div,{"data-state":jp(c),"data-disabled":m?"":void 0,...a,ref:t})})});Zb.displayName=nu;var eS="CollapsibleTrigger",tS=C.forwardRef((e,t)=>{const{__scopeCollapsible:s,...i}=e,l=kp(eS,s);return o.jsx(Le.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":jp(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...i,ref:t,onClick:ye(e.onClick,l.onOpenToggle)})});tS.displayName=eS;var Ep="CollapsibleContent",rS=C.forwardRef((e,t)=>{const{forceMount:s,...i}=e,l=kp(Ep,e.__scopeCollapsible);return o.jsx($t,{present:s||l.open,children:({present:m})=>o.jsx(yL,{...i,ref:t,present:m})})});rS.displayName=Ep;var yL=C.forwardRef((e,t)=>{const{__scopeCollapsible:s,present:i,children:l,...m}=e,f=kp(Ep,s),[a,c]=C.useState(i),h=C.useRef(null),g=Ve(t,h),d=C.useRef(0),_=d.current,S=C.useRef(0),E=S.current,b=f.open||a,v=C.useRef(b),y=C.useRef(void 0);return C.useEffect(()=>{const p=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(p)},[]),Dt(()=>{const p=h.current;if(p){y.current=y.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const x=p.getBoundingClientRect();d.current=x.height,S.current=x.width,v.current||(p.style.transitionDuration=y.current.transitionDuration,p.style.animationName=y.current.animationName),c(i)}},[f.open,i]),o.jsx(Le.div,{"data-state":jp(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!b,...m,ref:g,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":E?`${E}px`:void 0,...e.style},children:b&&l})});function jp(e){return e?"open":"closed"}var xL=Zb;const _L=xL,wL=tS,bL=rS;function SL(e){const t=CL(e),s=C.forwardRef((i,l)=>{const{children:m,...f}=i,a=C.Children.toArray(m),c=a.find(EL);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return o.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return o.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function CL(e){const t=C.forwardRef((s,i)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=NL(l),a=jL(m,l.props);return l.type!==C.Fragment&&(a.ref=i?Is(i,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kL=Symbol("radix.slottable");function EL(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kL}function jL(e,t){const s={...t};for(const i in t){const l=e[i],m=t[i];/^on[A-Z]/.test(i)?l&&m?s[i]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[i]=l):i==="style"?s[i]={...l,...m}:i==="className"&&(s[i]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function NL(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var iu="Dialog",[sS,nS]=gr(iu),[PL,rs]=sS(iu),iS=e=>{const{__scopeDialog:t,children:s,open:i,defaultOpen:l,onOpenChange:m,modal:f=!0}=e,a=C.useRef(null),c=C.useRef(null),[h,g]=Zr({prop:i,defaultProp:l??!1,onChange:m,caller:iu});return o.jsx(PL,{scope:t,triggerRef:a,contentRef:c,contentId:mr(),titleId:mr(),descriptionId:mr(),open:h,onOpenChange:g,onOpenToggle:C.useCallback(()=>g(d=>!d),[g]),modal:f,children:s})};iS.displayName=iu;var oS="DialogTrigger",aS=C.forwardRef((e,t)=>{const{__scopeDialog:s,...i}=e,l=rs(oS,s),m=Ve(t,l.triggerRef);return o.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Rp(l.open),...i,ref:m,onClick:ye(e.onClick,l.onOpenToggle)})});aS.displayName=oS;var Np="DialogPortal",[RL,lS]=sS(Np,{forceMount:void 0}),cS=e=>{const{__scopeDialog:t,forceMount:s,children:i,container:l}=e,m=rs(Np,t);return o.jsx(RL,{scope:t,forceMount:s,children:C.Children.map(i,f=>o.jsx($t,{present:s||m.open,children:o.jsx(Sa,{asChild:!0,container:l,children:f})}))})};cS.displayName=Np;var Cc="DialogOverlay",uS=C.forwardRef((e,t)=>{const s=lS(Cc,e.__scopeDialog),{forceMount:i=s.forceMount,...l}=e,m=rs(Cc,e.__scopeDialog);return m.modal?o.jsx($t,{present:i||m.open,children:o.jsx(AL,{...l,ref:t})}):null});uS.displayName=Cc;var TL=SL("DialogOverlay.RemoveScroll"),AL=C.forwardRef((e,t)=>{const{__scopeDialog:s,...i}=e,l=rs(Cc,s);return o.jsx(Qc,{as:TL,allowPinchZoom:!0,shards:[l.contentRef],children:o.jsx(Le.div,{"data-state":Rp(l.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),Jn="DialogContent",dS=C.forwardRef((e,t)=>{const s=lS(Jn,e.__scopeDialog),{forceMount:i=s.forceMount,...l}=e,m=rs(Jn,e.__scopeDialog);return o.jsx($t,{present:i||m.open,children:m.modal?o.jsx(DL,{...l,ref:t}):o.jsx(ML,{...l,ref:t})})});dS.displayName=Jn;var DL=C.forwardRef((e,t)=>{const s=rs(Jn,e.__scopeDialog),i=C.useRef(null),l=Ve(t,s.contentRef,i);return C.useEffect(()=>{const m=i.current;if(m)return wp(m)},[]),o.jsx(hS,{...e,ref:l,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,m=>{var f;m.preventDefault(),(f=s.triggerRef.current)==null||f.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,m=>{const f=m.detail.originalEvent,a=f.button===0&&f.ctrlKey===!0;(f.button===2||a)&&m.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,m=>m.preventDefault())})}),ML=C.forwardRef((e,t)=>{const s=rs(Jn,e.__scopeDialog),i=C.useRef(!1),l=C.useRef(!1);return o.jsx(hS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:m=>{var f,a;(f=e.onCloseAutoFocus)==null||f.call(e,m),m.defaultPrevented||(i.current||(a=s.triggerRef.current)==null||a.focus(),m.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:m=>{var c,h;(c=e.onInteractOutside)==null||c.call(e,m),m.defaultPrevented||(i.current=!0,m.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=m.target;((h=s.triggerRef.current)==null?void 0:h.contains(f))&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&l.current&&m.preventDefault()}})}),hS=C.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:m,...f}=e,a=rs(Jn,s),c=C.useRef(null),h=Ve(t,c);return cp(),o.jsxs(o.Fragment,{children:[o.jsx(Uc,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:m,children:o.jsx(wa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Rp(a.open),...f,ref:h,onDismiss:()=>a.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(OL,{titleId:a.titleId}),o.jsx(BL,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Pp="DialogTitle",fS=C.forwardRef((e,t)=>{const{__scopeDialog:s,...i}=e,l=rs(Pp,s);return o.jsx(Le.h2,{id:l.titleId,...i,ref:t})});fS.displayName=Pp;var pS="DialogDescription",mS=C.forwardRef((e,t)=>{const{__scopeDialog:s,...i}=e,l=rs(pS,s);return o.jsx(Le.p,{id:l.descriptionId,...i,ref:t})});mS.displayName=pS;var gS="DialogClose",vS=C.forwardRef((e,t)=>{const{__scopeDialog:s,...i}=e,l=rs(gS,s);return o.jsx(Le.button,{type:"button",...i,ref:t,onClick:ye(e.onClick,()=>l.onOpenChange(!1))})});vS.displayName=gS;function Rp(e){return e?"open":"closed"}var yS="DialogTitleWarning",[LL,xS]=rD(yS,{contentName:Jn,titleName:Pp,docsSlug:"dialog"}),OL=({titleId:e})=>{const t=xS(yS),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
434
-
435
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
436
-
437
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},IL="DialogDescriptionWarning",BL=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xS(IL).contentName}}.`;return C.useEffect(()=>{var m;const l=(m=e.current)==null?void 0:m.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},_S=iS,FL=aS,wS=cS,Tp=uS,Ap=dS,Dp=fS,Mp=mS,Lp=vS;const nr=_S,$L=wS,bS=C.forwardRef(({className:e,...t},s)=>o.jsx(Tp,{ref:s,className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));bS.displayName=Tp.displayName;const Xt=C.forwardRef(({className:e,children:t,...s},i)=>o.jsxs($L,{children:[o.jsx(bS,{}),o.jsxs(Ap,{ref:i,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...s,children:[t,o.jsxs(Lp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsx(M_,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xt.displayName=Ap.displayName;const Jt=({className:e,...t})=>o.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Jt.displayName="DialogHeader";const Qt=({className:e,...t})=>o.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qt.displayName="DialogFooter";const Zt=C.forwardRef(({className:e,...t},s)=>o.jsx(Dp,{ref:s,className:xe("text-lg font-semibold leading-none tracking-tight",e),...t}));Zt.displayName=Dp.displayName;const Er=C.forwardRef(({className:e,...t},s)=>o.jsx(Mp,{ref:s,className:xe("text-sm text-muted-foreground",e),...t}));Er.displayName=Mp.displayName;function HL(e){const t=VL(e),s=C.forwardRef((i,l)=>{const{children:m,...f}=i,a=C.Children.toArray(m),c=a.find(WL);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return o.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return o.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function VL(e){const t=C.forwardRef((s,i)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=KL(l),a=UL(m,l.props);return l.type!==C.Fragment&&(a.ref=i?Is(i,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zL=Symbol("radix.slottable");function WL(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zL}function UL(e,t){const s={...t};for(const i in t){const l=e[i],m=t[i];/^on[A-Z]/.test(i)?l&&m?s[i]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[i]=l):i==="style"?s[i]={...l,...m}:i==="className"&&(s[i]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function KL(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var df=["Enter"," "],GL=["ArrowDown","PageUp","Home"],SS=["ArrowUp","PageDown","End"],qL=[...GL,...SS],YL={ltr:[...df,"ArrowRight"],rtl:[...df,"ArrowLeft"]},XL={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ka="Menu",[ca,JL,QL]=ap(ka),[ei,CS]=gr(ka,[QL,Qi,Vc]),Ea=Qi(),kS=Vc(),[ES,Sn]=ei(ka),[ZL,ja]=ei(ka),jS=e=>{const{__scopeMenu:t,open:s=!1,children:i,dir:l,onOpenChange:m,modal:f=!0}=e,a=Ea(t),[c,h]=C.useState(null),g=C.useRef(!1),d=At(m),_=ya(l);return C.useEffect(()=>{const S=()=>{g.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>g.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),o.jsx(Xc,{...a,children:o.jsx(ES,{scope:t,open:s,onOpenChange:d,content:c,onContentChange:h,children:o.jsx(ZL,{scope:t,onClose:C.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:g,dir:_,modal:f,children:i})})})};jS.displayName=ka;var e3="MenuAnchor",Op=C.forwardRef((e,t)=>{const{__scopeMenu:s,...i}=e,l=Ea(s);return o.jsx(yp,{...l,...i,ref:t})});Op.displayName=e3;var Ip="MenuPortal",[t3,NS]=ei(Ip,{forceMount:void 0}),PS=e=>{const{__scopeMenu:t,forceMount:s,children:i,container:l}=e,m=Sn(Ip,t);return o.jsx(t3,{scope:t,forceMount:s,children:o.jsx($t,{present:s||m.open,children:o.jsx(Sa,{asChild:!0,container:l,children:i})})})};PS.displayName=Ip;var Fr="MenuContent",[r3,Bp]=ei(Fr),RS=C.forwardRef((e,t)=>{const s=NS(Fr,e.__scopeMenu),{forceMount:i=s.forceMount,...l}=e,m=Sn(Fr,e.__scopeMenu),f=ja(Fr,e.__scopeMenu);return o.jsx(ca.Provider,{scope:e.__scopeMenu,children:o.jsx($t,{present:i||m.open,children:o.jsx(ca.Slot,{scope:e.__scopeMenu,children:f.modal?o.jsx(s3,{...l,ref:t}):o.jsx(n3,{...l,ref:t})})})})}),s3=C.forwardRef((e,t)=>{const s=Sn(Fr,e.__scopeMenu),i=C.useRef(null),l=Ve(t,i);return C.useEffect(()=>{const m=i.current;if(m)return wp(m)},[]),o.jsx(Fp,{...e,ref:l,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:ye(e.onFocusOutside,m=>m.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})}),n3=C.forwardRef((e,t)=>{const s=Sn(Fr,e.__scopeMenu);return o.jsx(Fp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})}),i3=HL("MenuContent.ScrollLock"),Fp=C.forwardRef((e,t)=>{const{__scopeMenu:s,loop:i=!1,trapFocus:l,onOpenAutoFocus:m,onCloseAutoFocus:f,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:_,onDismiss:S,disableOutsideScroll:E,...b}=e,v=Sn(Fr,s),y=ja(Fr,s),p=Ea(s),x=kS(s),k=JL(s),[P,T]=C.useState(null),R=C.useRef(null),j=Ve(t,R,v.onContentChange),L=C.useRef(0),$=C.useRef(""),F=C.useRef(0),W=C.useRef(null),H=C.useRef("right"),J=C.useRef(0),G=E?Qc:C.Fragment,Y=E?{as:i3,allowPinchZoom:!0}:void 0,ee=M=>{var U,D;const B=$.current+M,O=k().filter(K=>!K.disabled),V=document.activeElement,Z=(U=O.find(K=>K.ref.current===V))==null?void 0:U.textValue,re=O.map(K=>K.textValue),ce=v3(re,B,Z),ue=(D=O.find(K=>K.textValue===ce))==null?void 0:D.ref.current;(function K(q){$.current=q,window.clearTimeout(L.current),q!==""&&(L.current=window.setTimeout(()=>K(""),1e3))})(B),ue&&setTimeout(()=>ue.focus())};C.useEffect(()=>()=>window.clearTimeout(L.current),[]),cp();const z=C.useCallback(M=>{var O,V;return H.current===((O=W.current)==null?void 0:O.side)&&x3(M,(V=W.current)==null?void 0:V.area)},[]);return o.jsx(r3,{scope:s,searchRef:$,onItemEnter:C.useCallback(M=>{z(M)&&M.preventDefault()},[z]),onItemLeave:C.useCallback(M=>{var B;z(M)||((B=R.current)==null||B.focus(),T(null))},[z]),onTriggerLeave:C.useCallback(M=>{z(M)&&M.preventDefault()},[z]),pointerGraceTimerRef:F,onPointerGraceIntentChange:C.useCallback(M=>{W.current=M},[]),children:o.jsx(G,{...Y,children:o.jsx(Uc,{asChild:!0,trapped:l,onMountAutoFocus:ye(m,M=>{var B;M.preventDefault(),(B=R.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:o.jsx(wa,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:_,onDismiss:S,children:o.jsx(dw,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:i,currentTabStopId:P,onCurrentTabStopIdChange:T,onEntryFocus:ye(c,M=>{y.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(xp,{role:"menu","aria-orientation":"vertical","data-state":GS(v.open),"data-radix-menu-content":"",dir:y.dir,...p,...b,ref:j,style:{outline:"none",...b.style},onKeyDown:ye(b.onKeyDown,M=>{const O=M.target.closest("[data-radix-menu-content]")===M.currentTarget,V=M.ctrlKey||M.altKey||M.metaKey,Z=M.key.length===1;O&&(M.key==="Tab"&&M.preventDefault(),!V&&Z&&ee(M.key));const re=R.current;if(M.target!==re||!qL.includes(M.key))return;M.preventDefault();const ue=k().filter(U=>!U.disabled).map(U=>U.ref.current);SS.includes(M.key)&&ue.reverse(),m3(ue)}),onBlur:ye(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(L.current),$.current="")}),onPointerMove:ye(e.onPointerMove,ua(M=>{const B=M.target,O=J.current!==M.clientX;if(M.currentTarget.contains(B)&&O){const V=M.clientX>J.current?"right":"left";H.current=V,J.current=M.clientX}}))})})})})})})});RS.displayName=Fr;var o3="MenuGroup",$p=C.forwardRef((e,t)=>{const{__scopeMenu:s,...i}=e;return o.jsx(Le.div,{role:"group",...i,ref:t})});$p.displayName=o3;var a3="MenuLabel",TS=C.forwardRef((e,t)=>{const{__scopeMenu:s,...i}=e;return o.jsx(Le.div,{...i,ref:t})});TS.displayName=a3;var kc="MenuItem",My="menu.itemSelect",ou=C.forwardRef((e,t)=>{const{disabled:s=!1,onSelect:i,...l}=e,m=C.useRef(null),f=ja(kc,e.__scopeMenu),a=Bp(kc,e.__scopeMenu),c=Ve(t,m),h=C.useRef(!1),g=()=>{const d=m.current;if(!s&&d){const _=new CustomEvent(My,{bubbles:!0,cancelable:!0});d.addEventListener(My,S=>i==null?void 0:i(S),{once:!0}),Z_(d,_),_.defaultPrevented?h.current=!1:f.onClose()}};return o.jsx(AS,{...l,ref:c,disabled:s,onClick:ye(e.onClick,g),onPointerDown:d=>{var _;(_=e.onPointerDown)==null||_.call(e,d),h.current=!0},onPointerUp:ye(e.onPointerUp,d=>{var _;h.current||(_=d.currentTarget)==null||_.click()}),onKeyDown:ye(e.onKeyDown,d=>{const _=a.searchRef.current!=="";s||_&&d.key===" "||df.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ou.displayName=kc;var AS=C.forwardRef((e,t)=>{const{__scopeMenu:s,disabled:i=!1,textValue:l,...m}=e,f=Bp(kc,s),a=kS(s),c=C.useRef(null),h=Ve(t,c),[g,d]=C.useState(!1),[_,S]=C.useState("");return C.useEffect(()=>{const E=c.current;E&&S((E.textContent??"").trim())},[m.children]),o.jsx(ca.ItemSlot,{scope:s,disabled:i,textValue:l??_,children:o.jsx(hw,{asChild:!0,...a,focusable:!i,children:o.jsx(Le.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...m,ref:h,onPointerMove:ye(e.onPointerMove,ua(E=>{i?f.onItemLeave(E):(f.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ye(e.onPointerLeave,ua(E=>f.onItemLeave(E))),onFocus:ye(e.onFocus,()=>d(!0)),onBlur:ye(e.onBlur,()=>d(!1))})})})}),l3="MenuCheckboxItem",DS=C.forwardRef((e,t)=>{const{checked:s=!1,onCheckedChange:i,...l}=e;return o.jsx(BS,{scope:e.__scopeMenu,checked:s,children:o.jsx(ou,{role:"menuitemcheckbox","aria-checked":Ec(s)?"mixed":s,...l,ref:t,"data-state":zp(s),onSelect:ye(l.onSelect,()=>i==null?void 0:i(Ec(s)?!0:!s),{checkForDefaultPrevented:!1})})})});DS.displayName=l3;var MS="MenuRadioGroup",[c3,u3]=ei(MS,{value:void 0,onValueChange:()=>{}}),LS=C.forwardRef((e,t)=>{const{value:s,onValueChange:i,...l}=e,m=At(i);return o.jsx(c3,{scope:e.__scopeMenu,value:s,onValueChange:m,children:o.jsx($p,{...l,ref:t})})});LS.displayName=MS;var OS="MenuRadioItem",IS=C.forwardRef((e,t)=>{const{value:s,...i}=e,l=u3(OS,e.__scopeMenu),m=s===l.value;return o.jsx(BS,{scope:e.__scopeMenu,checked:m,children:o.jsx(ou,{role:"menuitemradio","aria-checked":m,...i,ref:t,"data-state":zp(m),onSelect:ye(i.onSelect,()=>{var f;return(f=l.onValueChange)==null?void 0:f.call(l,s)},{checkForDefaultPrevented:!1})})})});IS.displayName=OS;var Hp="MenuItemIndicator",[BS,d3]=ei(Hp,{checked:!1}),FS=C.forwardRef((e,t)=>{const{__scopeMenu:s,forceMount:i,...l}=e,m=d3(Hp,s);return o.jsx($t,{present:i||Ec(m.checked)||m.checked===!0,children:o.jsx(Le.span,{...l,ref:t,"data-state":zp(m.checked)})})});FS.displayName=Hp;var h3="MenuSeparator",$S=C.forwardRef((e,t)=>{const{__scopeMenu:s,...i}=e;return o.jsx(Le.div,{role:"separator","aria-orientation":"horizontal",...i,ref:t})});$S.displayName=h3;var f3="MenuArrow",HS=C.forwardRef((e,t)=>{const{__scopeMenu:s,...i}=e,l=Ea(s);return o.jsx(_p,{...l,...i,ref:t})});HS.displayName=f3;var Vp="MenuSub",[p3,VS]=ei(Vp),zS=e=>{const{__scopeMenu:t,children:s,open:i=!1,onOpenChange:l}=e,m=Sn(Vp,t),f=Ea(t),[a,c]=C.useState(null),[h,g]=C.useState(null),d=At(l);return C.useEffect(()=>(m.open===!1&&d(!1),()=>d(!1)),[m.open,d]),o.jsx(Xc,{...f,children:o.jsx(ES,{scope:t,open:i,onOpenChange:d,content:h,onContentChange:g,children:o.jsx(p3,{scope:t,contentId:mr(),triggerId:mr(),trigger:a,onTriggerChange:c,children:s})})})};zS.displayName=Vp;var Ko="MenuSubTrigger",WS=C.forwardRef((e,t)=>{const s=Sn(Ko,e.__scopeMenu),i=ja(Ko,e.__scopeMenu),l=VS(Ko,e.__scopeMenu),m=Bp(Ko,e.__scopeMenu),f=C.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=m,h={__scopeMenu:e.__scopeMenu},g=C.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);return C.useEffect(()=>g,[g]),C.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),o.jsx(Op,{asChild:!0,...h,children:o.jsx(AS,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":l.contentId,"data-state":GS(s.open),...e,ref:Is(t,l.onTriggerChange),onClick:d=>{var _;(_=e.onClick)==null||_.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),s.open||s.onOpenChange(!0))},onPointerMove:ye(e.onPointerMove,ua(d=>{m.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!s.open&&!f.current&&(m.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{s.onOpenChange(!0),g()},100))})),onPointerLeave:ye(e.onPointerLeave,ua(d=>{var S,E;g();const _=(S=s.content)==null?void 0:S.getBoundingClientRect();if(_){const b=(E=s.content)==null?void 0:E.dataset.side,v=b==="right",y=v?-5:5,p=_[v?"left":"right"],x=_[v?"right":"left"];m.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:p,y:_.top},{x,y:_.top},{x,y:_.bottom},{x:p,y:_.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>m.onPointerGraceIntentChange(null),300)}else{if(m.onTriggerLeave(d),d.defaultPrevented)return;m.onPointerGraceIntentChange(null)}})),onKeyDown:ye(e.onKeyDown,d=>{var S;const _=m.searchRef.current!=="";e.disabled||_&&d.key===" "||YL[i.dir].includes(d.key)&&(s.onOpenChange(!0),(S=s.content)==null||S.focus(),d.preventDefault())})})})});WS.displayName=Ko;var US="MenuSubContent",KS=C.forwardRef((e,t)=>{const s=NS(Fr,e.__scopeMenu),{forceMount:i=s.forceMount,...l}=e,m=Sn(Fr,e.__scopeMenu),f=ja(Fr,e.__scopeMenu),a=VS(US,e.__scopeMenu),c=C.useRef(null),h=Ve(t,c);return o.jsx(ca.Provider,{scope:e.__scopeMenu,children:o.jsx($t,{present:i||m.open,children:o.jsx(ca.Slot,{scope:e.__scopeMenu,children:o.jsx(Fp,{id:a.contentId,"aria-labelledby":a.triggerId,...l,ref:h,align:"start",side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var d;f.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:ye(e.onFocusOutside,g=>{g.target!==a.trigger&&m.onOpenChange(!1)}),onEscapeKeyDown:ye(e.onEscapeKeyDown,g=>{f.onClose(),g.preventDefault()}),onKeyDown:ye(e.onKeyDown,g=>{var S;const d=g.currentTarget.contains(g.target),_=XL[f.dir].includes(g.key);d&&_&&(m.onOpenChange(!1),(S=a.trigger)==null||S.focus(),g.preventDefault())})})})})})});KS.displayName=US;function GS(e){return e?"open":"closed"}function Ec(e){return e==="indeterminate"}function zp(e){return Ec(e)?"indeterminate":e?"checked":"unchecked"}function m3(e){const t=document.activeElement;for(const s of e)if(s===t||(s.focus(),document.activeElement!==t))return}function g3(e,t){return e.map((s,i)=>e[(t+i)%e.length])}function v3(e,t,s){const l=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,m=s?e.indexOf(s):-1;let f=g3(e,Math.max(m,0));l.length===1&&(f=f.filter(h=>h!==s));const c=f.find(h=>h.toLowerCase().startsWith(l.toLowerCase()));return c!==s?c:void 0}function y3(e,t){const{x:s,y:i}=e;let l=!1;for(let m=0,f=t.length-1;m<t.length;f=m++){const a=t[m],c=t[f],h=a.x,g=a.y,d=c.x,_=c.y;g>i!=_>i&&s<(d-h)*(i-g)/(_-g)+h&&(l=!l)}return l}function x3(e,t){if(!t)return!1;const s={x:e.clientX,y:e.clientY};return y3(s,t)}function ua(e){return t=>t.pointerType==="mouse"?e(t):void 0}var _3=jS,w3=Op,b3=PS,S3=RS,C3=$p,k3=TS,E3=ou,j3=DS,N3=LS,P3=IS,R3=FS,T3=$S,A3=HS,D3=zS,M3=WS,L3=KS,au="DropdownMenu",[O3]=gr(au,[CS]),er=CS(),[I3,qS]=O3(au),YS=e=>{const{__scopeDropdownMenu:t,children:s,dir:i,open:l,defaultOpen:m,onOpenChange:f,modal:a=!0}=e,c=er(t),h=C.useRef(null),[g,d]=Zr({prop:l,defaultProp:m??!1,onChange:f,caller:au});return o.jsx(I3,{scope:t,triggerId:mr(),triggerRef:h,contentId:mr(),open:g,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(_=>!_),[d]),modal:a,children:o.jsx(_3,{...c,open:g,onOpenChange:d,dir:i,modal:a,children:s})})};YS.displayName=au;var XS="DropdownMenuTrigger",JS=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,disabled:i=!1,...l}=e,m=qS(XS,s),f=er(s);return o.jsx(w3,{asChild:!0,...f,children:o.jsx(Le.button,{type:"button",id:m.triggerId,"aria-haspopup":"menu","aria-expanded":m.open,"aria-controls":m.open?m.contentId:void 0,"data-state":m.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...l,ref:Is(t,m.triggerRef),onPointerDown:ye(e.onPointerDown,a=>{!i&&a.button===0&&a.ctrlKey===!1&&(m.onOpenToggle(),m.open||a.preventDefault())}),onKeyDown:ye(e.onKeyDown,a=>{i||(["Enter"," "].includes(a.key)&&m.onOpenToggle(),a.key==="ArrowDown"&&m.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});JS.displayName=XS;var B3="DropdownMenuPortal",QS=e=>{const{__scopeDropdownMenu:t,...s}=e,i=er(t);return o.jsx(b3,{...i,...s})};QS.displayName=B3;var ZS="DropdownMenuContent",e1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=qS(ZS,s),m=er(s),f=C.useRef(!1);return o.jsx(S3,{id:l.contentId,"aria-labelledby":l.triggerId,...m,...i,ref:t,onCloseAutoFocus:ye(e.onCloseAutoFocus,a=>{var c;f.current||(c=l.triggerRef.current)==null||c.focus(),f.current=!1,a.preventDefault()}),onInteractOutside:ye(e.onInteractOutside,a=>{const c=a.detail.originalEvent,h=c.button===0&&c.ctrlKey===!0,g=c.button===2||h;(!l.modal||g)&&(f.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});e1.displayName=ZS;var F3="DropdownMenuGroup",$3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(C3,{...l,...i,ref:t})});$3.displayName=F3;var H3="DropdownMenuLabel",t1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(k3,{...l,...i,ref:t})});t1.displayName=H3;var V3="DropdownMenuItem",r1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(E3,{...l,...i,ref:t})});r1.displayName=V3;var z3="DropdownMenuCheckboxItem",s1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(j3,{...l,...i,ref:t})});s1.displayName=z3;var W3="DropdownMenuRadioGroup",U3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(N3,{...l,...i,ref:t})});U3.displayName=W3;var K3="DropdownMenuRadioItem",n1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(P3,{...l,...i,ref:t})});n1.displayName=K3;var G3="DropdownMenuItemIndicator",i1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(R3,{...l,...i,ref:t})});i1.displayName=G3;var q3="DropdownMenuSeparator",o1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(T3,{...l,...i,ref:t})});o1.displayName=q3;var Y3="DropdownMenuArrow",X3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(A3,{...l,...i,ref:t})});X3.displayName=Y3;var J3=e=>{const{__scopeDropdownMenu:t,children:s,open:i,onOpenChange:l,defaultOpen:m}=e,f=er(t),[a,c]=Zr({prop:i,defaultProp:m??!1,onChange:l,caller:"DropdownMenuSub"});return o.jsx(D3,{...f,open:a,onOpenChange:c,children:s})},Q3="DropdownMenuSubTrigger",a1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(M3,{...l,...i,ref:t})});a1.displayName=Q3;var Z3="DropdownMenuSubContent",l1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...i}=e,l=er(s);return o.jsx(L3,{...l,...i,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});l1.displayName=Z3;var eO=YS,tO=JS,rO=QS,c1=e1,u1=t1,d1=r1,h1=s1,f1=n1,p1=i1,m1=o1,sO=J3,g1=a1,v1=l1;const Na=eO,Pa=tO,nO=sO,y1=C.forwardRef(({className:e,inset:t,children:s,...i},l)=>o.jsxs(g1,{ref:l,className:xe("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...i,children:[s,o.jsx(Lc,{className:"ml-auto"})]}));y1.displayName=g1.displayName;const x1=C.forwardRef(({className:e,...t},s)=>o.jsx(v1,{ref:s,className:xe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));x1.displayName=v1.displayName;const eo=C.forwardRef(({className:e,sideOffset:t=4,...s},i)=>o.jsx(rO,{children:o.jsx(c1,{ref:i,sideOffset:t,className:xe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));eo.displayName=c1.displayName;const Tt=C.forwardRef(({className:e,inset:t,...s},i)=>o.jsx(d1,{ref:i,className:xe("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...s}));Tt.displayName=d1.displayName;const iO=C.forwardRef(({className:e,children:t,checked:s,...i},l)=>o.jsxs(h1,{ref:l,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...i,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(p1,{children:o.jsx(Nr,{className:"h-4 w-4"})})}),t]}));iO.displayName=h1.displayName;const oO=C.forwardRef(({className:e,children:t,...s},i)=>o.jsxs(f1,{ref:i,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(p1,{children:o.jsx(WR,{className:"h-2 w-2 fill-current"})})}),t]}));oO.displayName=f1.displayName;const _1=C.forwardRef(({className:e,inset:t,...s},i)=>o.jsx(u1,{ref:i,className:xe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));_1.displayName=u1.displayName;const zi=C.forwardRef(({className:e,...t},s)=>o.jsx(m1,{ref:s,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));zi.displayName=m1.displayName;const hf=[{name:"Bash",icon:Bt,description:"Shell commands",color:"text-purple-600",bgColor:"bg-purple-50",badgeClass:"bg-purple-100 text-purple-700 border-purple-200"},{name:"Read",icon:fr,description:"Read file contents",color:"text-blue-600",bgColor:"bg-blue-50",badgeClass:"bg-blue-100 text-blue-700 border-blue-200"},{name:"Edit",icon:Jf,description:"Edit existing files",color:"text-amber-600",bgColor:"bg-amber-50",badgeClass:"bg-amber-100 text-amber-700 border-amber-200"},{name:"Write",icon:A_,description:"Create/write files",color:"text-orange-600",bgColor:"bg-orange-50",badgeClass:"bg-orange-100 text-orange-700 border-orange-200"},{name:"WebFetch",icon:N_,description:"Fetch web content",color:"text-green-600",bgColor:"bg-green-50",badgeClass:"bg-green-100 text-green-700 border-green-200"},{name:"WebSearch",icon:ep,description:"Web search capability",color:"text-teal-600",bgColor:"bg-teal-50",badgeClass:"bg-teal-100 text-teal-700 border-teal-200"},{name:"mcp",icon:hc,description:"MCP server tools",color:"text-indigo-600",bgColor:"bg-indigo-50",badgeClass:"bg-indigo-100 text-indigo-700 border-indigo-200"}],Ch=[{category:"Git",name:"Git Status",pattern:"Bash(git status:*)",description:"Check repository status",icon:Bt},{category:"Git",name:"Git Add",pattern:"Bash(git add:*)",description:"Stage files for commit",icon:Bt},{category:"Git",name:"Git Commit",pattern:"Bash(git commit:*)",description:"Create commits",icon:Bt},{category:"Git",name:"Git Push",pattern:"Bash(git push:*)",description:"Push to remote repository",icon:Bt},{category:"Git",name:"Git Diff",pattern:"Bash(git diff:*)",description:"Show changes",icon:Bt},{category:"NPM",name:"NPM Install",pattern:"Bash(npm install:*)",description:"Install dependencies",icon:Bt},{category:"NPM",name:"NPM Run Scripts",pattern:"Bash(npm run:*)",description:"Run package scripts",icon:Bt},{category:"NPM",name:"NPM Test",pattern:"Bash(npm test:*)",description:"Run tests",icon:Bt},{category:"Files",name:"Read All Files",pattern:"Read(**)",description:"Read any file in the project",icon:fr},{category:"Files",name:"Edit All Files",pattern:"Edit(**)",description:"Edit any file in the project",icon:Jf},{category:"Security",name:"Deny .env Files",pattern:"Read(./.env)",description:"Block reading environment files",icon:fr,suggestedCategory:"deny"},{category:"Security",name:"Deny All .env",pattern:"Read(**/.env*)",description:"Block all environment files",icon:fr,suggestedCategory:"deny"},{category:"Commands",name:"List Files",pattern:"Bash(ls:*)",description:"List directory contents",icon:Bt},{category:"Commands",name:"Find Files",pattern:"Bash(find:*)",description:"Find files and directories",icon:Bt},{category:"MCP",name:"Filesystem Operations",pattern:"mcp__filesystem__*",description:"All filesystem MCP operations",icon:hc},{category:"MCP",name:"GitHub Operations",pattern:"mcp__github__*",description:"All GitHub MCP operations",icon:hc}];function w1(e){if(!e)return{type:"unknown",value:"",hasWildcard:!1,description:""};if(e.startsWith("mcp__")){const s=e.split("__");return{type:"mcp",value:e,server:s[1]||"",tool:s[2]||"",hasWildcard:e.includes("*"),description:`MCP tool: ${s.slice(1).join("/")}`}}if(e==="WebSearch")return{type:"WebSearch",value:"",hasWildcard:!1,description:"Web search capability"};const t=e.match(/^(\w+)\((.+)\)$/);if(t){const[,s,i]=t,l=i.includes("*");return{type:s,value:i,hasWildcard:l,description:cO(s,i)}}return{type:"unknown",value:e,hasWildcard:e.includes("*"),description:e}}function aO(e,t){return e==="WebSearch"?"WebSearch":e==="mcp"?t:t?`${e}(${t})`:""}function lO(e){if(!e)return"Rule cannot be empty";if(e==="WebSearch")return null;if(e.startsWith("mcp__"))return e.includes("*")||e.match(/^mcp__\w+__\w+$/)?null:"MCP pattern must be: mcp__server__tool";const t=e.match(/^(\w+)\((.+)\)$/);if(!t)return"Invalid pattern format. Expected: Type(value) or mcp__server__tool";const[,s]=t,i=["Bash","Read","Edit","Write","WebFetch"];return i.includes(s)?null:`Unknown permission type: ${s}. Valid types: ${i.join(", ")}`}function cO(e,t){switch(e){case"Bash":if(t.includes(":")){const[s,i]=t.split(":");return i==="*"?`Run "${s}" with any arguments`:`Run "${s} ${i}"`}return`Run "${t}"`;case"Read":return t==="**"?"Read all files":t.includes("**")?`Read files matching ${t}`:`Read ${t}`;case"Edit":return t==="**"?"Edit all files":t.includes("**")?`Edit files matching ${t}`:`Edit ${t}`;case"Write":return t==="**"?"Write to any file":t.includes("**")?`Write files matching ${t}`:`Write to ${t}`;case"WebFetch":return t==="*"?"Fetch any URL":`Fetch URLs matching ${t}`;default:return t}}function uO(e){return hf.find(s=>s.name===e)||hf[0]}function dO(e){return{allow:'Rules in "Allow" will execute automatically without prompting. Use wildcards (*) for flexible matching.',ask:'Rules in "Ask" will prompt for confirmation each time. Good for potentially destructive operations.',deny:'Rules in "Deny" are blocked entirely. Use this to prevent access to sensitive files or dangerous operations.'}[e]}function Ly(e){return{allow:{label:"Allow",color:"text-green-600",bgColor:"bg-green-50",borderColor:"border-green-200",badgeColor:"bg-green-100 text-green-700",description:"Operations that run without asking"},ask:{label:"Ask",color:"text-amber-600",bgColor:"bg-amber-50",borderColor:"border-amber-200",badgeColor:"bg-amber-100 text-amber-700",description:"Operations that require confirmation"},deny:{label:"Deny",color:"text-red-600",bgColor:"bg-red-50",borderColor:"border-red-200",badgeColor:"bg-red-100 text-red-700",description:"Operations that are blocked"}}[e]}function hO({rule:e,category:t,onEdit:s,onDelete:i,onMove:l,readOnly:m}){const[f,a]=C.useState(!1),c=w1(e),h=uO(c.type),g=h.icon,d=_=>{_.stopPropagation(),navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)};return o.jsxs(hn.div,{layout:!0,initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:xe("group flex items-center gap-3 p-3 rounded-lg bg-white dark:bg-slate-900 border border-gray-200 dark:border-slate-700","hover:border-gray-300 dark:hover:border-slate-600 hover:shadow-sm transition-all"),children:[o.jsx("div",{className:xe("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",h.bgColor),children:o.jsx(g,{className:xe("w-4 h-4",h.color)})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lt,{variant:"outline",className:xe("text-xs",h.badgeClass),children:c.type}),c.hasWildcard&&o.jsxs(fn,{children:[o.jsx(pn,{children:o.jsx(lt,{variant:"secondary",className:"text-xs",children:"Wildcard"})}),o.jsx(Ds,{children:"Pattern uses wildcard (*) matching"})]})]}),o.jsxs(fn,{children:[o.jsx(pn,{asChild:!0,children:o.jsx("code",{className:"block text-sm font-mono text-gray-700 dark:text-slate-300 truncate mt-1 cursor-default",children:e})}),o.jsx(Ds,{side:"bottom",className:"max-w-md",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("code",{className:"text-xs break-all",children:e}),o.jsx("p",{className:"text-xs text-gray-300",children:c.description})]})})]})]}),o.jsxs("div",{className:xe("flex items-center gap-1 transition-opacity",m?"opacity-50 pointer-events-none":"opacity-0 group-hover:opacity-100"),children:[o.jsxs(fn,{children:[o.jsx(pn,{asChild:!0,children:o.jsx(de,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:d,children:f?o.jsx(Nr,{className:"w-4 h-4 text-green-500"}):o.jsx($i,{className:"w-4 h-4"})})}),o.jsx(Ds,{children:"Copy rule"})]}),o.jsxs(Na,{children:[o.jsx(Pa,{asChild:!0,children:o.jsx(de,{variant:"ghost",size:"icon",className:"h-8 w-8",children:o.jsx(S_,{className:"w-4 h-4"})})}),o.jsxs(eo,{align:"end",children:[o.jsxs(Tt,{onClick:s,children:[o.jsx(Zf,{className:"w-4 h-4 mr-2"}),"Edit Rule"]}),o.jsxs(nO,{children:[o.jsxs(y1,{children:[o.jsx(b_,{className:"w-4 h-4 mr-2"}),"Move to..."]}),o.jsx(x1,{children:["allow","ask","deny"].filter(_=>_!==t).map(_=>o.jsxs(Tt,{onClick:()=>l(_),children:["Move to ",_]},_))})]}),o.jsx(zi,{}),o.jsxs(Tt,{onClick:i,className:"text-red-600",children:[o.jsx(Gn,{className:"w-4 h-4 mr-2"}),"Delete Rule"]})]})]})]})]})}function fO({open:e,onOpenChange:t,onSubmit:s,defaultCategory:i="allow",defaultRule:l="",isEditing:m=!1}){const[f,a]=C.useState("preset"),[c,h]=C.useState(i),[g,d]=C.useState("Bash"),[_,S]=C.useState(""),[E,b]=C.useState(l),[v,y]=C.useState(null),[p,x]=C.useState(""),[k,P]=C.useState(null);C.useEffect(()=>{if(e)if(h(i),l&&m){const F=w1(l);d(F.type==="unknown"?"Bash":F.type),S(F.value),b(l);const W=Ch.find(H=>H.pattern===l);W?(y(W),a("preset")):a("builder")}else d("Bash"),S(""),b(""),y(null),a("preset")},[e,l,i,m]);const T=C.useMemo(()=>f==="preset"&&v?v.pattern:f==="freeform"?E:aO(g,_),[f,v,g,_,E]);C.useEffect(()=>{const F=lO(T);P(F)},[T]);const R=C.useMemo(()=>{if(!p)return Ch;const F=p.toLowerCase();return Ch.filter(W=>W.name.toLowerCase().includes(F)||W.pattern.toLowerCase().includes(F)||W.description.toLowerCase().includes(F)||W.category.toLowerCase().includes(F))},[p]),j=C.useMemo(()=>{const F={};return R.forEach(W=>{F[W.category]||(F[W.category]=[]),F[W.category].push(W)}),F},[R]),L=()=>{k||(s(c,T),t(!1))},$=gO(g);return o.jsx(nr,{open:e,onOpenChange:t,children:o.jsxs(Xt,{className:"max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",children:[o.jsxs(Jt,{children:[o.jsx(Zt,{className:"flex items-center gap-2",children:m?o.jsxs(o.Fragment,{children:[o.jsx(A_,{className:"w-5 h-5 text-indigo-600"}),"Edit Permission Rule"]}):o.jsxs(o.Fragment,{children:[o.jsx(Ps,{className:"w-5 h-5 text-indigo-600"}),"Add Permission Rule"]})}),o.jsx(Er,{children:"Create a permission rule to control Claude Code's behavior."})]}),o.jsxs("div",{className:"flex-1 overflow-auto space-y-6 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{children:"Permission Category"}),o.jsxs(_c,{value:c,onValueChange:h,children:[o.jsx(oa,{children:o.jsx(wc,{})}),o.jsxs(aa,{children:[o.jsx(Jr,{value:"allow",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"}),"Allow - Execute without asking"]})}),o.jsx(Jr,{value:"ask",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-3 h-3 rounded-full bg-amber-500"}),"Ask - Require confirmation"]})}),o.jsx(Jr,{value:"deny",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),"Deny - Block entirely"]})})]})]})]}),o.jsxs(Wc,{value:f,onValueChange:a,children:[o.jsxs(_a,{className:"grid w-full grid-cols-3",children:[o.jsxs(Qr,{value:"preset",children:[o.jsx(Ps,{className:"w-4 h-4 mr-2"}),"Presets"]}),o.jsxs(Qr,{value:"builder",children:[o.jsx(Bt,{className:"w-4 h-4 mr-2"}),"Builder"]}),o.jsxs(Qr,{value:"freeform",children:[o.jsx(Jf,{className:"w-4 h-4 mr-2"}),"Freeform"]})]}),o.jsxs(Rs,{value:"preset",className:"space-y-4",children:[o.jsx(Ye,{placeholder:"Search presets...",value:p,onChange:F=>x(F.target.value)}),o.jsx("div",{className:"border border-gray-200 dark:border-slate-700 rounded-lg max-h-[250px] overflow-auto",children:Object.entries(j).map(([F,W])=>o.jsxs("div",{className:"border-b border-gray-200 dark:border-slate-700 last:border-b-0",children:[o.jsx("div",{className:"px-3 py-2 bg-gray-50 dark:bg-slate-800 font-medium text-sm text-gray-600 dark:text-slate-300",children:F}),W.map(H=>{const J=H.icon;return o.jsx("button",{onClick:()=>y(H),className:xe("w-full text-left px-3 py-2 hover:bg-gray-50 dark:hover:bg-slate-800 transition-colors",(v==null?void 0:v.pattern)===H.pattern&&"bg-indigo-50 dark:bg-indigo-950/50 border-l-2 border-indigo-500"),children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(J,{className:"w-4 h-4 mt-0.5 text-gray-400 dark:text-slate-500"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm",children:H.name}),o.jsx("code",{className:"text-xs text-gray-500 dark:text-slate-400 block truncate",children:H.pattern}),o.jsx("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:H.description})]})]})},H.pattern)})]},F))})]}),o.jsxs(Rs,{value:"builder",className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{children:"Permission Type"}),o.jsxs(_c,{value:g,onValueChange:d,children:[o.jsx(oa,{children:o.jsx(wc,{})}),o.jsx(aa,{children:hf.map(F=>{const W=F.icon;return o.jsx(Jr,{value:F.name,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(W,{className:"w-4 h-4"}),F.name,o.jsxs("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:["- ",F.description]})]})},F.name)})})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(_t,{children:pO(g)}),o.jsxs(fn,{children:[o.jsx(pn,{children:o.jsx(Xf,{className:"w-4 h-4 text-gray-400"})}),o.jsx(Ds,{className:"max-w-xs",children:mO(g)})]})]}),g==="WebSearch"?o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic",children:"WebSearch does not require a value pattern."}):o.jsx(Ye,{value:_,onChange:F=>S(F.target.value),placeholder:g==="Bash"?"command:arguments":"path/pattern",className:"font-mono"})]}),$.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{className:"text-xs text-gray-500 dark:text-slate-400",children:"Quick examples:"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:$.map(F=>o.jsx(de,{variant:"outline",size:"sm",className:"text-xs h-7",onClick:()=>S(F.value),children:F.label},F.value))})]})]}),o.jsx(Rs,{value:"freeform",className:"space-y-4",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{children:"Rule Pattern"}),o.jsx(Ze,{value:E,onChange:F=>b(F.target.value),placeholder:"e.g., Bash(npm run build), Read(**/*.ts)",className:"font-mono text-sm",rows:3}),o.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Enter the full permission pattern. Use * for wildcards and : for Bash argument separation."})]})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{children:"Generated Rule"}),o.jsx("div",{className:xe("p-3 rounded-lg border font-mono text-sm",k?"bg-red-50 dark:bg-red-950/50 border-red-200 dark:border-red-800 text-red-700 dark:text-red-400":"bg-gray-50 dark:bg-slate-800 border-gray-200 dark:border-slate-700 text-gray-700 dark:text-slate-300"),children:T||o.jsx("span",{className:"text-gray-400 dark:text-slate-500",children:"No rule configured"})}),k&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-red-600",children:[o.jsx(ra,{className:"w-4 h-4"}),k]})]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),o.jsx(de,{onClick:L,disabled:!T||!!k,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:m?"Update Rule":"Add Rule"})]})]})})}function pO(e){return{Bash:"Command Pattern",Read:"File Path Pattern",Edit:"File Path Pattern",Write:"File Path Pattern",WebFetch:"URL Pattern",WebSearch:"N/A",mcp:"Tool Name"}[e]||"Value"}function mO(e){return{Bash:"Format: command:arguments. Use * for wildcards. Example: npm run:* matches npm run build, npm run test, etc.",Read:"File path pattern. Use ** for recursive matching. Example: **/*.ts matches all TypeScript files.",Edit:"File path pattern. Use ** for recursive matching.",Write:"File path pattern. Use ** for recursive matching.",WebFetch:"URL pattern. Example: https://api.github.com/* matches all GitHub API calls.",WebSearch:"No value needed - this enables/disables web search entirely.",mcp:"MCP tool name in format: mcp__server__tool"}[e]||""}function gO(e){return{Bash:[{label:"npm run *",value:"npm run:*"},{label:"git add *",value:"git add:*"},{label:"git commit *",value:"git commit:*"},{label:"ls *",value:"ls:*"}],Read:[{label:"All files",value:"**"},{label:"TypeScript",value:"**/*.ts"},{label:"Source only",value:"./src/**"}],Edit:[{label:"All files",value:"**"},{label:"Source only",value:"./src/**"}],Write:[{label:"All files",value:"**"}],WebFetch:[{label:"Any URL",value:"*"},{label:"GitHub API",value:"https://api.github.com/*"}],mcp:[{label:"Filesystem read",value:"mcp__filesystem__read_file"},{label:"GitHub PR",value:"mcp__github__create_pull_request"}]}[e]||[]}function vO({open:e,onOpenChange:t,mode:s,permissions:i,onImport:l}){const[m,f]=C.useState(""),[a,c]=C.useState(null),[h,g]=C.useState(!1);C.useEffect(()=>{e&&s==="export"?(f(JSON.stringify({permissions:i},null,2)),c(null)):e&&s==="import"&&(f(""),c(null))},[e,s,i]);const d=()=>{navigator.clipboard.writeText(m),g(!0),setTimeout(()=>g(!1),2e3),le.success("Copied to clipboard")},_=()=>{try{const S=JSON.parse(m);if(!S.permissions){c('JSON must have a "permissions" key');return}const{allow:E=[],ask:b=[],deny:v=[]}=S.permissions;if(!Array.isArray(E)||!Array.isArray(b)||!Array.isArray(v)){c("allow, ask, and deny must be arrays");return}if([...E,...b,...v].some(p=>typeof p!="string")){c("All permission rules must be strings");return}l(S.permissions),t(!1)}catch(S){c("Invalid JSON: "+S.message)}};return o.jsx(nr,{open:e,onOpenChange:t,children:o.jsxs(Xt,{className:"max-w-lg",children:[o.jsxs(Jt,{children:[o.jsx(Zt,{className:"flex items-center gap-2",children:s==="export"?o.jsxs(o.Fragment,{children:[o.jsx(Oc,{className:"w-5 h-5 text-indigo-600"}),"Export Permissions"]}):o.jsxs(o.Fragment,{children:[o.jsx(qh,{className:"w-5 h-5 text-indigo-600"}),"Import Permissions"]})}),o.jsx(Er,{children:s==="export"?"Copy this JSON to save or share your permission configuration.":"Paste a JSON permission configuration to import."})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsx(Ze,{value:m,onChange:S=>{f(S.target.value),c(null)},placeholder:s==="import"?"Paste JSON here...":"",className:"font-mono text-sm min-h-[300px]",readOnly:s==="export"}),a&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-red-600",children:[o.jsx(ra,{className:"w-4 h-4"}),a]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),s==="export"?o.jsxs(de,{onClick:d,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[h?o.jsx(Nr,{className:"w-4 h-4 mr-2"}):o.jsx($i,{className:"w-4 h-4 mr-2"}),h?"Copied!":"Copy to Clipboard"]}):o.jsxs(de,{onClick:_,disabled:!m.trim(),className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[o.jsx(qh,{className:"w-4 h-4 mr-2"}),"Import"]})]})]})})}function yO({permissions:e,onSave:t,loading:s,readOnly:i=!1}){const[l,m]=C.useState({allow:[],ask:[],deny:[]}),[f,a]=C.useState("allow"),[c,h]=C.useState(!1),[g,d]=C.useState(!1),[_,S]=C.useState(!1),[E,b]=C.useState(!1),[v,y]=C.useState(null),[p,x]=C.useState(!1),[k,P]=C.useState("export");C.useEffect(()=>{e&&(m({allow:e.allow||[],ask:e.ask||[],deny:e.deny||[]}),h(!1))},[e]);const T=C.useCallback((Y,ee)=>{m(z=>[...z.allow,...z.ask,...z.deny].includes(ee)?(le.error("This rule already exists"),z):{...z,[Y]:[...z[Y],ee]}),h(!0),le.success(`Rule added to ${Y}`)},[]),R=C.useCallback((Y,ee,z,M)=>{m(B=>{const O={...B};return O[Y]=O[Y].filter(V=>V!==ee),O[z]=[...O[z],M],O}),h(!0),le.success("Rule updated")},[]),j=C.useCallback((Y,ee)=>{m(z=>({...z,[Y]:z[Y].filter(M=>M!==ee)})),h(!0),le.success("Rule deleted")},[]),L=C.useCallback((Y,ee,z)=>{m(M=>({...M,[Y]:M[Y].filter(B=>B!==ee),[z]:[...M[z],ee]})),h(!0),le.success(`Moved to ${z}`)},[]),$=C.useCallback(Y=>{m({allow:Y.allow||[],ask:Y.ask||[],deny:Y.deny||[]}),h(!0),le.success("Permissions imported")},[]),F=async()=>{if(t){d(!0);try{await t(l),h(!1),le.success("Permissions saved")}catch(Y){le.error("Failed to save: "+Y.message)}finally{d(!1)}}},W=()=>{e&&(m({allow:e.allow||[],ask:e.ask||[],deny:e.deny||[]}),h(!1),le.info("Changes reset"))},H=Y=>{y(null),a(Y),b(!0)},J=(Y,ee)=>{y({category:Y,rule:ee}),b(!0)},G=l.allow.length+l.ask.length+l.deny.length;return o.jsx(Qb,{children:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-950 flex items-center justify-center",children:o.jsx(Bc,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Claude Code Permissions"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Configure what Claude Code can do automatically"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[c&&o.jsx(lt,{variant:"outline",className:"bg-amber-50 dark:bg-amber-950/50 text-amber-700 dark:text-amber-400 border-amber-200 dark:border-amber-800",children:"Unsaved changes"}),o.jsxs(fn,{children:[o.jsx(pn,{asChild:!0,children:o.jsx(de,{variant:"outline",size:"sm",onClick:()=>{P("export"),x(!0)},children:o.jsx(Oc,{className:"w-4 h-4"})})}),o.jsx(Ds,{children:"Export permissions"})]}),o.jsxs(fn,{children:[o.jsx(pn,{asChild:!0,children:o.jsx(de,{variant:"outline",size:"sm",onClick:()=>{P("import"),x(!0)},disabled:i,children:o.jsx(qh,{className:"w-4 h-4"})})}),o.jsx(Ds,{children:"Import permissions"})]}),c&&o.jsxs(o.Fragment,{children:[o.jsxs(de,{variant:"outline",size:"sm",onClick:W,children:[o.jsx(pr,{className:"w-4 h-4 mr-1"}),"Reset"]}),o.jsxs(de,{size:"sm",onClick:F,disabled:g,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[g?o.jsx(pr,{className:"w-4 h-4 mr-1 animate-spin"}):o.jsx(Nr,{className:"w-4 h-4 mr-1"}),"Save"]})]})]})]}),o.jsxs(_L,{open:_,onOpenChange:S,children:[o.jsx(wL,{asChild:!0,children:o.jsxs(de,{variant:"ghost",size:"sm",className:"text-gray-500 dark:text-slate-400",children:[o.jsx(Xf,{className:"w-4 h-4 mr-2"}),"How permissions work",o.jsx(va,{className:xe("w-4 h-4 ml-2 transition-transform",_&&"rotate-180")})]})}),o.jsx(bL,{children:o.jsxs(bc,{className:"mt-2",children:[o.jsx(gT,{className:"w-4 h-4"}),o.jsxs(Sc,{className:"text-sm",children:[o.jsxs("p",{className:"mb-2",children:["Permissions control what Claude Code can do automatically vs. what requires your approval. These settings are stored in ",o.jsx("code",{className:"px-1 py-0.5 bg-gray-100 dark:bg-slate-700 rounded text-xs",children:"~/.claude/settings.json"}),"."]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-3",children:[o.jsxs("div",{children:[o.jsx(lt,{className:"bg-green-100 dark:bg-green-950 text-green-700 dark:text-green-400 mb-1",children:"Allow"}),o.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400",children:"Operations run without asking"})]}),o.jsxs("div",{children:[o.jsx(lt,{className:"bg-amber-100 dark:bg-amber-950 text-amber-700 dark:text-amber-400 mb-1",children:"Ask"}),o.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400",children:"Prompts for confirmation each time"})]}),o.jsxs("div",{children:[o.jsx(lt,{className:"bg-red-100 dark:bg-red-950 text-red-700 dark:text-red-400 mb-1",children:"Deny"}),o.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400",children:"Blocked entirely"})]})]}),o.jsxs("p",{className:"mt-3 text-xs text-gray-500 dark:text-slate-400",children:["Use wildcards: ",o.jsx("code",{className:"px-1 py-0.5 bg-gray-100 dark:bg-slate-700 rounded",children:"*"})," matches anything,"," ",o.jsx("code",{className:"px-1 py-0.5 bg-gray-100 dark:bg-slate-700 rounded",children:"**"})," matches recursively in paths."]})]})]})})]}),s&&o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(pr,{className:"w-6 h-6 animate-spin text-gray-400"})}),!s&&G===0&&o.jsxs(bc,{children:[o.jsx(Fc,{className:"w-4 h-4"}),o.jsxs(Sc,{children:["No permission rules configured. Claude Code will use default behavior and ask for permission on sensitive operations.",o.jsx(de,{variant:"link",size:"sm",className:"ml-2 p-0 h-auto",onClick:()=>H("allow"),children:"Add your first rule"})]})]}),!s&&o.jsxs(Wc,{value:f,onValueChange:a,children:[o.jsx(_a,{className:"grid w-full grid-cols-3",children:["allow","ask","deny"].map(Y=>{var M;const ee=Ly(Y),z=((M=l[Y])==null?void 0:M.length)||0;return o.jsxs(Qr,{value:Y,className:"flex items-center gap-2",children:[o.jsx("div",{className:xe("w-2 h-2 rounded-full",Y==="allow"&&"bg-green-500",Y==="ask"&&"bg-amber-500",Y==="deny"&&"bg-red-500")}),ee.label,z>0&&o.jsx(lt,{variant:"secondary",className:"ml-1 text-xs",children:z})]},Y)})}),["allow","ask","deny"].map(Y=>{const ee=Ly(Y),z=l[Y]||[];return o.jsxs(Rs,{value:Y,className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs(fn,{children:[o.jsx(pn,{asChild:!0,children:o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 cursor-help",children:ee.description})}),o.jsx(Ds,{className:"max-w-xs",children:dO(Y)})]}),o.jsxs(de,{size:"sm",variant:"outline",onClick:()=>H(Y),disabled:i,children:[o.jsx(Ft,{className:"w-4 h-4 mr-1"}),"Add Rule"]})]}),z.length===0?o.jsxs("div",{className:xe("text-center py-8 rounded-lg border-2 border-dashed",ee.borderColor),children:[o.jsxs("p",{className:"text-gray-500 dark:text-slate-400",children:["No rules in ",Y]}),o.jsx(de,{variant:"link",size:"sm",onClick:()=>H(Y),disabled:i,children:"Add a rule"})]}):o.jsx("div",{className:"space-y-2",children:o.jsx(Gy,{mode:"popLayout",children:z.map(M=>o.jsx(hO,{rule:M,category:Y,onEdit:()=>J(Y,M),onDelete:()=>j(Y,M),onMove:B=>L(Y,M,B),readOnly:i},M))})})]},Y)})]}),o.jsx(fO,{open:E,onOpenChange:b,onSubmit:(Y,ee)=>{v?R(v.category,v.rule,Y,ee):T(Y,ee)},defaultCategory:(v==null?void 0:v.category)||f,defaultRule:(v==null?void 0:v.rule)||"",isEditing:!!v}),o.jsx(vO,{open:p,onOpenChange:x,mode:k,permissions:l,onImport:$})]})})}const xO=[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",description:"Best balance of speed and capability",tier:"sonnet",recommended:!0},{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5",description:"Most capable, best for complex tasks",tier:"opus"},{id:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",description:"Fastest, best for simple tasks",tier:"haiku"}],_O=[{key:"ANTHROPIC_SMALL_FAST_MODEL",label:"Small/Fast Model",description:"Model for background tasks and quick operations",placeholder:"claude-haiku-4-5-20251001"},{key:"CLAUDE_CODE_SUBAGENT_MODEL",label:"Subagent Model",description:"Model used for subagent/background processing",placeholder:"claude-haiku-4-20241022"}];function b1({settings:e,onSave:t,loading:s,settingsPath:i="~/.claude/settings.json"}){const[l,m]=C.useState({}),[f,a]=C.useState("permissions"),[c,h]=C.useState(!1),[g,d]=C.useState(!1),[_,S]=C.useState(!1),[E,b]=C.useState(""),[v,y]=C.useState(null);C.useEffect(()=>{e&&(m(e),b(JSON.stringify(e,null,2)),h(!1))},[e]),C.useEffect(()=>{_||b(JSON.stringify(l,null,2))},[l,_]);const p=C.useCallback((R,j)=>{m(L=>{const $={...L,[R]:j};return(j===""||j===null||j===void 0)&&delete $[R],$}),h(!0)},[]),x=C.useCallback(R=>{m(j=>({...j,permissions:R})),h(!0)},[]),k=R=>{b(R);try{const j=JSON.parse(R);m(j),y(null),h(!0)}catch(j){y(j.message)}},P=async()=>{if(t){if(v){le.error("Fix JSON errors before saving");return}d(!0);try{await t(l),h(!1),le.success("Settings saved")}catch(R){le.error("Failed to save: "+R.message)}finally{d(!1)}}},T=()=>{e&&(m(e),b(JSON.stringify(e,null,2)),y(null),h(!1),le.info("Changes reset"))};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-950 flex items-center justify-center",children:o.jsx(Kn,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Claude Code Settings"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Configure Claude Code behavior globally"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[c&&o.jsx(lt,{variant:"outline",className:"bg-amber-50 dark:bg-amber-950/50 text-amber-700 dark:text-amber-400 border-amber-200 dark:border-amber-800",children:"Unsaved changes"}),o.jsx(Qb,{children:o.jsxs(fn,{children:[o.jsx(pn,{asChild:!0,children:o.jsx(de,{variant:"outline",size:"sm",onClick:()=>S(!_),children:_?o.jsx(C_,{className:"w-4 h-4"}):o.jsx(YR,{className:"w-4 h-4"})})}),o.jsx(Ds,{children:_?"Show UI":"Show JSON"})]})}),c&&o.jsxs(o.Fragment,{children:[o.jsxs(de,{variant:"outline",size:"sm",onClick:T,children:[o.jsx(pr,{className:"w-4 h-4 mr-1"}),"Reset"]}),o.jsxs(de,{size:"sm",onClick:P,disabled:g||!!v,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[g?o.jsx(pr,{className:"w-4 h-4 mr-1 animate-spin"}):o.jsx(Nr,{className:"w-4 h-4 mr-1"}),"Save"]})]})]})]}),o.jsxs("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:["Settings file: ",o.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-2 py-0.5 rounded text-xs",children:i})]}),s&&o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(pr,{className:"w-6 h-6 animate-spin text-gray-400"})}),!s&&_&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(_t,{children:"Raw JSON"}),v&&o.jsx(lt,{variant:"destructive",className:"text-xs",children:v})]}),o.jsx(Ze,{value:E,onChange:R=>k(R.target.value),className:xe("font-mono text-sm min-h-[400px]",v&&"border-red-300 focus:border-red-500")})]}),!s&&!_&&o.jsxs(Wc,{value:f,onValueChange:a,children:[o.jsxs(_a,{className:"grid w-full grid-cols-4",children:[o.jsxs(Qr,{value:"permissions",className:"flex items-center gap-2",children:[o.jsx(Bc,{className:"w-4 h-4"}),"Permissions"]}),o.jsxs(Qr,{value:"model",className:"flex items-center gap-2",children:[o.jsx(L_,{className:"w-4 h-4"}),"Model"]}),o.jsxs(Qr,{value:"behavior",className:"flex items-center gap-2",children:[o.jsx(Kn,{className:"w-4 h-4"}),"Behavior"]}),o.jsxs(Qr,{value:"advanced",className:"flex items-center gap-2",children:[o.jsx(Bt,{className:"w-4 h-4"}),"Advanced"]})]}),o.jsx(Rs,{value:"permissions",className:"pt-4",children:o.jsx(yO,{permissions:l.permissions,onSave:x,loading:!1})}),o.jsx(Rs,{value:"model",className:"space-y-6 pt-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(_t,{className:"text-base font-medium",children:"Default Model"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-3",children:"Select the default model for Claude Code sessions"}),o.jsx("div",{className:"grid gap-3",children:xO.map(R=>o.jsx("button",{onClick:()=>p("model",R.id),className:xe("w-full p-4 rounded-lg border text-left transition-all",l.model===R.id?"border-indigo-500 bg-indigo-50 dark:bg-indigo-950/50":"border-gray-200 dark:border-slate-700 hover:border-gray-300 dark:hover:border-slate-600"),children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-medium",children:R.name}),R.recommended&&o.jsx(lt,{variant:"secondary",className:"text-xs",children:"Recommended"}),o.jsx(lt,{variant:"outline",className:xe("text-xs",R.tier==="opus"&&"border-purple-300 text-purple-700",R.tier==="sonnet"&&"border-blue-300 text-blue-700",R.tier==="haiku"&&"border-green-300 text-green-700"),children:R.tier})]}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mt-1",children:R.description})]}),l.model===R.id&&o.jsx(Nr,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})]})},R.id))})]}),o.jsxs("div",{children:[o.jsx(_t,{children:"Custom Model ID"}),o.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mb-2",children:"Override with a specific model ID (for AWS Bedrock, etc.)"}),o.jsx(Ye,{value:l.model||"",onChange:R=>p("model",R.target.value),placeholder:"claude-sonnet-4-20250514",className:"font-mono"})]})]})}),o.jsx(Rs,{value:"behavior",className:"space-y-6 pt-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border border-gray-200 dark:border-slate-700",children:[o.jsxs("div",{children:[o.jsx(_t,{children:"Auto-accept Edits"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Automatically accept file edits without confirmation"})]}),o.jsx(us,{checked:l.autoAcceptEdits??!1,onCheckedChange:R=>p("autoAcceptEdits",R)})]}),o.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border border-gray-200 dark:border-slate-700",children:[o.jsxs("div",{children:[o.jsx(_t,{children:"Verbose Output"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Show detailed output for operations"})]}),o.jsx(us,{checked:l.verbose??!1,onCheckedChange:R=>p("verbose",R)})]}),o.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border border-gray-200 dark:border-slate-700",children:[o.jsxs("div",{children:[o.jsx(_t,{children:"Enable MCP Servers"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Allow Claude Code to use MCP server connections"})]}),o.jsx(us,{checked:l.enableMcp??!0,onCheckedChange:R=>p("enableMcp",R)})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{children:"API Base URL"}),o.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Custom API endpoint (for proxies or enterprise deployments)"}),o.jsx(Ye,{value:l.apiBaseUrl||"",onChange:R=>p("apiBaseUrl",R.target.value),placeholder:"https://api.anthropic.com",className:"font-mono"})]})]})}),o.jsxs(Rs,{value:"advanced",className:"space-y-6 pt-4",children:[o.jsxs(bc,{children:[o.jsx(Fc,{className:"w-4 h-4"}),o.jsx(Sc,{children:"Advanced settings for power users. Incorrect values may cause Claude Code to malfunction."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(_t,{className:"text-base font-medium",children:"Environment Variables"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-3",children:"Configure model-related environment variables"}),o.jsx("div",{className:"space-y-3",children:_O.map(R=>{var j;return o.jsxs("div",{className:"space-y-1",children:[o.jsx(_t,{className:"text-sm",children:R.label}),o.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:R.description}),o.jsx(Ye,{value:((j=l.env)==null?void 0:j[R.key])||"",onChange:L=>{const $={...l.env||{},[R.key]:L.target.value};L.target.value||delete $[R.key],p("env",Object.keys($).length?$:void 0)},placeholder:R.placeholder,className:"font-mono text-sm"})]},R.key)})})]}),o.jsxs("div",{children:[o.jsx(_t,{className:"text-base font-medium",children:"Hooks"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-3",children:"Scripts to run before/after tool executions (JSON format)"}),o.jsx(Ze,{value:l.hooks?JSON.stringify(l.hooks,null,2):"",onChange:R=>{try{const j=R.target.value?JSON.parse(R.target.value):void 0;p("hooks",j)}catch{}},placeholder:`{
438
- "preToolExecution": "~/.claude/hooks/pre.sh",
439
- "postToolExecution": "~/.claude/hooks/post.sh"
440
- }`,className:"font-mono text-sm min-h-[120px]"})]}),o.jsxs("div",{children:[o.jsx(_t,{className:"text-base font-medium",children:"Custom Settings"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-3",children:"Add any additional settings as JSON key-value pairs"}),o.jsx(Ze,{value:(()=>{const R=["permissions","model","autoAcceptEdits","verbose","enableMcp","apiBaseUrl","env","hooks"],j=Object.keys(l).filter(L=>!R.includes(L)).reduce((L,$)=>({...L,[$]:l[$]}),{});return Object.keys(j).length?JSON.stringify(j,null,2):""})(),onChange:R=>{try{const j=R.target.value?JSON.parse(R.target.value):{},$=["permissions","model","autoAcceptEdits","verbose","enableMcp","apiBaseUrl","env","hooks"].reduce((F,W)=>(l[W]!==void 0&&(F[W]=l[W]),F),{});m({...$,...j}),h(!0)}catch{}},placeholder:`{
441
- "customKey": "customValue"
442
- }`,className:"font-mono text-sm min-h-[100px]"})]})]})]})]})]})}var lu="Checkbox",[wO]=gr(lu),[bO,Wp]=wO(lu);function SO(e){const{__scopeCheckbox:t,checked:s,children:i,defaultChecked:l,disabled:m,form:f,name:a,onCheckedChange:c,required:h,value:g="on",internal_do_not_use_render:d}=e,[_,S]=Zr({prop:s,defaultProp:l??!1,onChange:c,caller:lu}),[E,b]=C.useState(null),[v,y]=C.useState(null),p=C.useRef(!1),x=E?!!f||!!E.closest("form"):!0,k={checked:_,disabled:m,setChecked:S,control:E,setControl:b,name:a,form:f,value:g,hasConsumerStoppedPropagationRef:p,required:h,defaultChecked:mn(l)?!1:l,isFormControl:x,bubbleInput:v,setBubbleInput:y};return o.jsx(bO,{scope:t,...k,children:CO(d)?d(k):i})}var S1="CheckboxTrigger",C1=C.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:s,...i},l)=>{const{control:m,value:f,disabled:a,checked:c,required:h,setControl:g,setChecked:d,hasConsumerStoppedPropagationRef:_,isFormControl:S,bubbleInput:E}=Wp(S1,e),b=Ve(l,g),v=C.useRef(c);return C.useEffect(()=>{const y=m==null?void 0:m.form;if(y){const p=()=>d(v.current);return y.addEventListener("reset",p),()=>y.removeEventListener("reset",p)}},[m,d]),o.jsx(Le.button,{type:"button",role:"checkbox","aria-checked":mn(c)?"mixed":c,"aria-required":h,"data-state":P1(c),"data-disabled":a?"":void 0,disabled:a,value:f,...i,ref:b,onKeyDown:ye(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:ye(s,y=>{d(p=>mn(p)?!0:!p),E&&S&&(_.current=y.isPropagationStopped(),_.current||y.stopPropagation())})})});C1.displayName=S1;var Up=C.forwardRef((e,t)=>{const{__scopeCheckbox:s,name:i,checked:l,defaultChecked:m,required:f,disabled:a,value:c,onCheckedChange:h,form:g,...d}=e;return o.jsx(SO,{__scopeCheckbox:s,checked:l,defaultChecked:m,disabled:a,required:f,onCheckedChange:h,name:i,form:g,value:c,internal_do_not_use_render:({isFormControl:_})=>o.jsxs(o.Fragment,{children:[o.jsx(C1,{...d,ref:t,__scopeCheckbox:s}),_&&o.jsx(N1,{__scopeCheckbox:s})]})})});Up.displayName=lu;var k1="CheckboxIndicator",E1=C.forwardRef((e,t)=>{const{__scopeCheckbox:s,forceMount:i,...l}=e,m=Wp(k1,s);return o.jsx($t,{present:i||mn(m.checked)||m.checked===!0,children:o.jsx(Le.span,{"data-state":P1(m.checked),"data-disabled":m.disabled?"":void 0,...l,ref:t,style:{pointerEvents:"none",...e.style}})})});E1.displayName=k1;var j1="CheckboxBubbleInput",N1=C.forwardRef(({__scopeCheckbox:e,...t},s)=>{const{control:i,hasConsumerStoppedPropagationRef:l,checked:m,defaultChecked:f,required:a,disabled:c,name:h,value:g,form:d,bubbleInput:_,setBubbleInput:S}=Wp(j1,e),E=Ve(s,S),b=ip(m),v=op(i);C.useEffect(()=>{const p=_;if(!p)return;const x=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(x,"checked").set,T=!l.current;if(b!==m&&P){const R=new Event("click",{bubbles:T});p.indeterminate=mn(m),P.call(p,mn(m)?!1:m),p.dispatchEvent(R)}},[_,b,m,l]);const y=C.useRef(mn(m)?!1:m);return o.jsx(Le.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??y.current,required:a,disabled:c,name:h,value:g,form:d,...t,tabIndex:-1,ref:E,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});N1.displayName=j1;function CO(e){return typeof e=="function"}function mn(e){return e==="indeterminate"}function P1(e){return mn(e)?"indeterminate":e?"checked":"unchecked"}const R1=C.forwardRef(({className:e,...t},s)=>o.jsx(Up,{ref:s,className:xe("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:o.jsx(E1,{className:xe("flex items-center justify-center text-current"),children:o.jsx(Nr,{className:"h-4 w-4"})})}));R1.displayName=Up.displayName;const kh={claude:{name:"Claude Code",folder:".claude",color:"text-orange-600",bg:"bg-orange-50",darkBg:"dark:bg-orange-950/30"},gemini:{name:"Gemini CLI",folder:".gemini",color:"text-blue-600",bg:"bg-blue-50",darkBg:"dark:bg-blue-950/30"},antigravity:{name:"Antigravity",folder:".agent",color:"text-purple-600",bg:"bg-purple-50",darkBg:"dark:bg-purple-950/30"}};function kO({open:e,onOpenChange:t,projectDir:s,onSynced:i}){var j,L,$;const[l,m]=C.useState("claude"),[f,a]=C.useState("antigravity"),[c,h]=C.useState(null),[g,d]=C.useState(!1),[_,S]=C.useState(!1),[E,b]=C.useState(new Set);C.useEffect(()=>{e&&s&&v()},[e,l,f,s]),C.useEffect(()=>{e&&b(new Set)},[e]);const v=async()=>{var F;d(!0);try{const W=await Re.getSyncPreview(s,l,f);h(W);const H=new Set(((F=W.files)==null?void 0:F.filter(J=>J.status==="new"||J.status==="different").map(J=>J.name))||[]);b(H)}catch(W){le.error("Failed to load sync preview: "+W.message),h(null)}finally{d(!1)}},y=()=>{m(f),a(l)},p=F=>{const W=new Set(E);W.has(F)?W.delete(F):W.add(F),b(W)},x=()=>{var F,W;E.size===((F=c==null?void 0:c.files)==null?void 0:F.length)?b(new Set):b(new Set(((W=c==null?void 0:c.files)==null?void 0:W.map(H=>H.name))||[]))},k=async()=>{if(E.size===0){le.error("Please select at least one file to sync");return}S(!0);try{const F=await Re.syncRules(s,l,f,Array.from(E));F.success?(le.success(`Synced ${F.synced.length} file(s) to ${kh[f].name}`),i==null||i(),t(!1)):le.error(F.error||"Sync failed")}catch(F){le.error("Sync failed: "+F.message)}finally{S(!1)}},P=F=>{switch(F){case"new":return o.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-100 text-green-700",children:"New"});case"different":return o.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-yellow-100 text-yellow-700",children:"Modified"});case"identical":return o.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 dark:bg-slate-700 text-gray-500 dark:text-slate-400",children:"Same"});default:return null}},T=kh[l],R=kh[f];return o.jsx(nr,{open:e,onOpenChange:t,children:o.jsxs(Xt,{className:"sm:max-w-lg",children:[o.jsxs(Jt,{children:[o.jsxs(Zt,{className:"flex items-center gap-2",children:[o.jsx(pr,{className:"w-5 h-5 text-indigo-500"}),"Sync Rules Between Tools"]}),o.jsx(Er,{children:"Copy rules from one AI tool's configuration to another."})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted/50 rounded-lg",children:[o.jsxs("div",{className:"flex-1",children:[o.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"From"}),o.jsxs(_c,{value:l,onValueChange:m,children:[o.jsx(oa,{className:"w-full",children:o.jsx(wc,{})}),o.jsxs(aa,{children:[o.jsx(Jr,{value:"claude",children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(sr,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),o.jsx(Jr,{value:"gemini",children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(sr,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),o.jsx(Jr,{value:"antigravity",children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(sr,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]}),o.jsx(de,{variant:"ghost",size:"icon",onClick:y,className:"mt-5",title:"Swap direction",children:o.jsx(b_,{className:"w-4 h-4"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"To"}),o.jsxs(_c,{value:f,onValueChange:a,children:[o.jsx(oa,{className:"w-full",children:o.jsx(wc,{})}),o.jsxs(aa,{children:[o.jsx(Jr,{value:"claude",children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(sr,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),o.jsx(Jr,{value:"gemini",children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(sr,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),o.jsx(Jr,{value:"antigravity",children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(sr,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]})]}),o.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[o.jsxs("div",{children:["Source: ",o.jsxs("code",{className:"bg-muted px-1 rounded",children:[T.folder,"/rules/"]})]}),o.jsxs("div",{children:["Target: ",o.jsxs("code",{className:"bg-muted px-1 rounded",children:[R.folder,"/rules/"]})]})]}),o.jsxs("div",{className:"border rounded-lg",children:[o.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[o.jsx("span",{className:"text-sm font-medium",children:"Rules to Sync"}),((j=c==null?void 0:c.files)==null?void 0:j.length)>0&&o.jsx(de,{variant:"ghost",size:"sm",onClick:x,className:"h-6 text-xs",children:E.size===c.files.length?"Deselect All":"Select All"})]}),o.jsx("div",{className:"max-h-64 overflow-auto",children:g?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(vt,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):c!=null&&c.error?o.jsxs("div",{className:"flex items-center gap-2 p-4 text-sm text-amber-600",children:[o.jsx(ra,{className:"w-4 h-4"}),c.error]}):((L=c==null?void 0:c.files)==null?void 0:L.length)===0?o.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:"No rules found in source folder"}):o.jsx("div",{className:"divide-y",children:($=c==null?void 0:c.files)==null?void 0:$.map(F=>o.jsxs("label",{className:xe("flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-muted/30",E.has(F.name)&&"bg-primary/5"),children:[o.jsx(R1,{checked:E.has(F.name),onCheckedChange:()=>p(F.name)}),o.jsx(fr,{className:"w-4 h-4 text-purple-500"}),o.jsx("span",{className:"flex-1 text-sm",children:F.name}),P(F.status)]},F.name))})})]}),(c==null?void 0:c.files)&&E.size>0&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:[E.size," file(s) selected for sync"]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),o.jsx(de,{onClick:k,disabled:_||g||E.size===0,children:_?o.jsxs(o.Fragment,{children:[o.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}),"Syncing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Nr,{className:"w-4 h-4 mr-2"}),"Sync ",E.size," File(s)"]})})]})]})})}function EO(e,t){return C.useReducer((s,i)=>t[s][i]??s,e)}var Kp="ScrollArea",[T1]=gr(Kp),[jO,$r]=T1(Kp),A1=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,type:i="hover",dir:l,scrollHideDelay:m=600,...f}=e,[a,c]=C.useState(null),[h,g]=C.useState(null),[d,_]=C.useState(null),[S,E]=C.useState(null),[b,v]=C.useState(null),[y,p]=C.useState(0),[x,k]=C.useState(0),[P,T]=C.useState(!1),[R,j]=C.useState(!1),L=Ve(t,F=>c(F)),$=ya(l);return o.jsx(jO,{scope:s,type:i,dir:$,scrollHideDelay:m,scrollArea:a,viewport:h,onViewportChange:g,content:d,onContentChange:_,scrollbarX:S,onScrollbarXChange:E,scrollbarXEnabled:P,onScrollbarXEnabledChange:T,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:R,onScrollbarYEnabledChange:j,onCornerWidthChange:p,onCornerHeightChange:k,children:o.jsx(Le.div,{dir:$,...f,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});A1.displayName=Kp;var D1="ScrollAreaViewport",M1=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,children:i,nonce:l,...m}=e,f=$r(D1,s),a=C.useRef(null),c=Ve(t,a,f.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),o.jsx(Le.div,{"data-radix-scroll-area-viewport":"",...m,ref:c,style:{overflowX:f.scrollbarXEnabled?"scroll":"hidden",overflowY:f.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:f.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});M1.displayName=D1;var vs="ScrollAreaScrollbar",Gp=C.forwardRef((e,t)=>{const{forceMount:s,...i}=e,l=$r(vs,e.__scopeScrollArea),{onScrollbarXEnabledChange:m,onScrollbarYEnabledChange:f}=l,a=e.orientation==="horizontal";return C.useEffect(()=>(a?m(!0):f(!0),()=>{a?m(!1):f(!1)}),[a,m,f]),l.type==="hover"?o.jsx(NO,{...i,ref:t,forceMount:s}):l.type==="scroll"?o.jsx(PO,{...i,ref:t,forceMount:s}):l.type==="auto"?o.jsx(L1,{...i,ref:t,forceMount:s}):l.type==="always"?o.jsx(qp,{...i,ref:t}):null});Gp.displayName=vs;var NO=C.forwardRef((e,t)=>{const{forceMount:s,...i}=e,l=$r(vs,e.__scopeScrollArea),[m,f]=C.useState(!1);return C.useEffect(()=>{const a=l.scrollArea;let c=0;if(a){const h=()=>{window.clearTimeout(c),f(!0)},g=()=>{c=window.setTimeout(()=>f(!1),l.scrollHideDelay)};return a.addEventListener("pointerenter",h),a.addEventListener("pointerleave",g),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",h),a.removeEventListener("pointerleave",g)}}},[l.scrollArea,l.scrollHideDelay]),o.jsx($t,{present:s||m,children:o.jsx(L1,{"data-state":m?"visible":"hidden",...i,ref:t})})}),PO=C.forwardRef((e,t)=>{const{forceMount:s,...i}=e,l=$r(vs,e.__scopeScrollArea),m=e.orientation==="horizontal",f=uu(()=>c("SCROLL_END"),100),[a,c]=EO("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return C.useEffect(()=>{if(a==="idle"){const h=window.setTimeout(()=>c("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(h)}},[a,l.scrollHideDelay,c]),C.useEffect(()=>{const h=l.viewport,g=m?"scrollLeft":"scrollTop";if(h){let d=h[g];const _=()=>{const S=h[g];d!==S&&(c("SCROLL"),f()),d=S};return h.addEventListener("scroll",_),()=>h.removeEventListener("scroll",_)}},[l.viewport,m,c,f]),o.jsx($t,{present:s||a!=="hidden",children:o.jsx(qp,{"data-state":a==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:ye(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ye(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),L1=C.forwardRef((e,t)=>{const s=$r(vs,e.__scopeScrollArea),{forceMount:i,...l}=e,[m,f]=C.useState(!1),a=e.orientation==="horizontal",c=uu(()=>{if(s.viewport){const h=s.viewport.offsetWidth<s.viewport.scrollWidth,g=s.viewport.offsetHeight<s.viewport.scrollHeight;f(a?h:g)}},10);return Wi(s.viewport,c),Wi(s.content,c),o.jsx($t,{present:i||m,children:o.jsx(qp,{"data-state":m?"visible":"hidden",...l,ref:t})})}),qp=C.forwardRef((e,t)=>{const{orientation:s="vertical",...i}=e,l=$r(vs,e.__scopeScrollArea),m=C.useRef(null),f=C.useRef(0),[a,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=$1(a.viewport,a.content),g={...i,sizes:a,onSizesChange:c,hasThumb:h>0&&h<1,onThumbChange:_=>m.current=_,onThumbPointerUp:()=>f.current=0,onThumbPointerDown:_=>f.current=_};function d(_,S){return LO(_,f.current,a,S)}return s==="horizontal"?o.jsx(RO,{...g,ref:t,onThumbPositionChange:()=>{if(l.viewport&&m.current){const _=l.viewport.scrollLeft,S=Oy(_,a,l.dir);m.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:_=>{l.viewport&&(l.viewport.scrollLeft=_)},onDragScroll:_=>{l.viewport&&(l.viewport.scrollLeft=d(_,l.dir))}}):s==="vertical"?o.jsx(TO,{...g,ref:t,onThumbPositionChange:()=>{if(l.viewport&&m.current){const _=l.viewport.scrollTop,S=Oy(_,a);m.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:_=>{l.viewport&&(l.viewport.scrollTop=_)},onDragScroll:_=>{l.viewport&&(l.viewport.scrollTop=d(_))}}):null}),RO=C.forwardRef((e,t)=>{const{sizes:s,onSizesChange:i,...l}=e,m=$r(vs,e.__scopeScrollArea),[f,a]=C.useState(),c=C.useRef(null),h=Ve(t,c,m.onScrollbarXChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(I1,{"data-orientation":"horizontal",...l,ref:h,sizes:s,style:{bottom:0,left:m.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:m.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":cu(s)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,d)=>{if(m.viewport){const _=m.viewport.scrollLeft+g.deltaX;e.onWheelScroll(_),V1(_,d)&&g.preventDefault()}},onResize:()=>{c.current&&m.viewport&&f&&i({content:m.viewport.scrollWidth,viewport:m.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Nc(f.paddingLeft),paddingEnd:Nc(f.paddingRight)}})}})}),TO=C.forwardRef((e,t)=>{const{sizes:s,onSizesChange:i,...l}=e,m=$r(vs,e.__scopeScrollArea),[f,a]=C.useState(),c=C.useRef(null),h=Ve(t,c,m.onScrollbarYChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(I1,{"data-orientation":"vertical",...l,ref:h,sizes:s,style:{top:0,right:m.dir==="ltr"?0:void 0,left:m.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":cu(s)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,d)=>{if(m.viewport){const _=m.viewport.scrollTop+g.deltaY;e.onWheelScroll(_),V1(_,d)&&g.preventDefault()}},onResize:()=>{c.current&&m.viewport&&f&&i({content:m.viewport.scrollHeight,viewport:m.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Nc(f.paddingTop),paddingEnd:Nc(f.paddingBottom)}})}})}),[AO,O1]=T1(vs),I1=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,sizes:i,hasThumb:l,onThumbChange:m,onThumbPointerUp:f,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:h,onWheelScroll:g,onResize:d,..._}=e,S=$r(vs,s),[E,b]=C.useState(null),v=Ve(t,L=>b(L)),y=C.useRef(null),p=C.useRef(""),x=S.viewport,k=i.content-i.viewport,P=At(g),T=At(c),R=uu(d,10);function j(L){if(y.current){const $=L.clientX-y.current.left,F=L.clientY-y.current.top;h({x:$,y:F})}}return C.useEffect(()=>{const L=$=>{const F=$.target;(E==null?void 0:E.contains(F))&&P($,k)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[x,E,k,P]),C.useEffect(T,[i,T]),Wi(E,R),Wi(S.content,R),o.jsx(AO,{scope:s,scrollbar:E,hasThumb:l,onThumbChange:At(m),onThumbPointerUp:At(f),onThumbPositionChange:T,onThumbPointerDown:At(a),children:o.jsx(Le.div,{..._,ref:v,style:{position:"absolute",..._.style},onPointerDown:ye(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),y.current=E.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),j(L))}),onPointerMove:ye(e.onPointerMove,j),onPointerUp:ye(e.onPointerUp,L=>{const $=L.target;$.hasPointerCapture(L.pointerId)&&$.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=p.current,S.viewport&&(S.viewport.style.scrollBehavior=""),y.current=null})})})}),jc="ScrollAreaThumb",B1=C.forwardRef((e,t)=>{const{forceMount:s,...i}=e,l=O1(jc,e.__scopeScrollArea);return o.jsx($t,{present:s||l.hasThumb,children:o.jsx(DO,{ref:t,...i})})}),DO=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,style:i,...l}=e,m=$r(jc,s),f=O1(jc,s),{onThumbPositionChange:a}=f,c=Ve(t,d=>f.onThumbChange(d)),h=C.useRef(void 0),g=uu(()=>{h.current&&(h.current(),h.current=void 0)},100);return C.useEffect(()=>{const d=m.viewport;if(d){const _=()=>{if(g(),!h.current){const S=OO(d,a);h.current=S,a()}};return a(),d.addEventListener("scroll",_),()=>d.removeEventListener("scroll",_)}},[m.viewport,g,a]),o.jsx(Le.div,{"data-state":f.hasThumb?"visible":"hidden",...l,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:ye(e.onPointerDownCapture,d=>{const S=d.target.getBoundingClientRect(),E=d.clientX-S.left,b=d.clientY-S.top;f.onThumbPointerDown({x:E,y:b})}),onPointerUp:ye(e.onPointerUp,f.onThumbPointerUp)})});B1.displayName=jc;var Yp="ScrollAreaCorner",F1=C.forwardRef((e,t)=>{const s=$r(Yp,e.__scopeScrollArea),i=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&i?o.jsx(MO,{...e,ref:t}):null});F1.displayName=Yp;var MO=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,...i}=e,l=$r(Yp,s),[m,f]=C.useState(0),[a,c]=C.useState(0),h=!!(m&&a);return Wi(l.scrollbarX,()=>{var d;const g=((d=l.scrollbarX)==null?void 0:d.offsetHeight)||0;l.onCornerHeightChange(g),c(g)}),Wi(l.scrollbarY,()=>{var d;const g=((d=l.scrollbarY)==null?void 0:d.offsetWidth)||0;l.onCornerWidthChange(g),f(g)}),h?o.jsx(Le.div,{...i,ref:t,style:{width:m,height:a,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Nc(e){return e?parseInt(e,10):0}function $1(e,t){const s=e/t;return isNaN(s)?0:s}function cu(e){const t=$1(e.viewport,e.content),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-s)*t;return Math.max(i,18)}function LO(e,t,s,i="ltr"){const l=cu(s),m=l/2,f=t||m,a=l-f,c=s.scrollbar.paddingStart+f,h=s.scrollbar.size-s.scrollbar.paddingEnd-a,g=s.content-s.viewport,d=i==="ltr"?[0,g]:[g*-1,0];return H1([c,h],d)(e)}function Oy(e,t,s="ltr"){const i=cu(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,m=t.scrollbar.size-l,f=t.content-t.viewport,a=m-i,c=s==="ltr"?[0,f]:[f*-1,0],h=Jh(e,c);return H1([0,f],[0,a])(h)}function H1(e,t){return s=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(s-e[0])}}function V1(e,t){return e>0&&e<t}var OO=(e,t=()=>{})=>{let s={left:e.scrollLeft,top:e.scrollTop},i=0;return(function l(){const m={left:e.scrollLeft,top:e.scrollTop},f=s.left!==m.left,a=s.top!==m.top;(f||a)&&t(),s=m,i=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(i)};function uu(e,t){const s=At(e),i=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(i.current),[]),C.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(s,t)},[s,t])}function Wi(e,t){const s=At(t);Dt(()=>{let i=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(s)});return l.observe(e),()=>{window.cancelAnimationFrame(i),l.unobserve(e)}}},[e,s])}var z1=A1,IO=M1,BO=F1;const Qn=C.forwardRef(({className:e,children:t,...s},i)=>o.jsxs(z1,{ref:i,className:xe("relative overflow-hidden",e),...s,children:[o.jsx(IO,{className:"h-full w-full rounded-[inherit]",children:t}),o.jsx(W1,{}),o.jsx(BO,{})]}));Qn.displayName=z1.displayName;const W1=C.forwardRef(({className:e,orientation:t="vertical",...s},i)=>o.jsx(Gp,{ref:i,orientation:t,className:xe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...s,children:o.jsx(B1,{className:"relative flex-1 rounded-full bg-border"})}));W1.displayName=Gp.displayName;const da={mcps:{icon:tp,color:"text-blue-600",bgColor:"bg-blue-50",label:"MCP Servers"},settings:{icon:Kn,color:"text-gray-600 dark:text-slate-400",bgColor:"bg-gray-50 dark:bg-slate-800",label:"Settings"},command:{icon:Bt,color:"text-green-600",bgColor:"bg-green-50",label:"Command"},rule:{icon:Wn,color:"text-purple-600",bgColor:"bg-purple-50",label:"Rule"},workflow:{icon:j_,color:"text-cyan-600",bgColor:"bg-cyan-50",label:"Workflow"},claudemd:{icon:fr,color:"text-orange-600",bgColor:"bg-orange-50",label:"CLAUDE.md"},geminimd:{icon:fr,color:"text-blue-600",bgColor:"bg-blue-50",label:"GEMINI.md"},folder:{icon:kt,color:"text-yellow-600",bgColor:"bg-yellow-50",label:"Folder"}},Eh={home:{bg:"bg-indigo-50",border:"border-indigo-200",text:"text-indigo-700"},intermediate:{bg:"bg-gray-50 dark:bg-slate-800",border:"border-gray-200 dark:border-slate-700",text:"text-gray-700 dark:text-slate-300"},project:{bg:"bg-green-50",border:"border-green-200",text:"text-green-700"}};function sc({item:e,level:t=0,selectedPath:s,onSelect:i,onContextMenu:l,expandedFolders:m,onToggleFolder:f}){const a=da[e.type]||da.folder,c=a.icon,h=s===e.path,g=e.type==="folder",d=m[e.path];return o.jsxs("div",{children:[o.jsxs("div",{className:xe("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 transition-colors",h&&"bg-blue-100 hover:bg-blue-100"),style:{paddingLeft:`${t*16+8}px`},onClick:()=>g?f(e.path):i(e),onContextMenu:_=>l(_,e),children:[g&&o.jsx("span",{className:"w-4 h-4 flex items-center justify-center",children:d?o.jsx(va,{className:"w-3 h-3"}):o.jsx(Lc,{className:"w-3 h-3"})}),!g&&o.jsx("span",{className:"w-4"}),o.jsx(c,{className:xe("w-4 h-4",a.color)}),o.jsx("span",{className:"flex-1 truncate",children:e.name}),e.mcpCount>0&&o.jsx(lt,{variant:"secondary",className:"text-xs px-1.5 py-0",children:e.mcpCount})]}),g&&d&&e.children&&o.jsx("div",{children:e.children.map(_=>o.jsx(sc,{item:_,level:t+1,selectedPath:s,onSelect:i,onContextMenu:l,expandedFolders:m,onToggleFolder:f},_.path))})]})}function FO({folder:e,isFirst:t,isLast:s,onCreateFile:i}){const l=t?Eh.home:s?Eh.project:Eh.intermediate;return o.jsxs("div",{className:xe("flex items-center justify-between px-3 py-2 border-b",l.bg,l.border),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[t?o.jsx(Qf,{className:"w-4 h-4"}):o.jsx(kt,{className:"w-4 h-4"}),o.jsx("span",{className:xe("font-medium text-sm",l.text),children:e.label}),!e.exists&&o.jsx(lt,{variant:"outline",className:"text-xs",children:"no .claude"})]}),o.jsxs(Na,{children:[o.jsx(Pa,{asChild:!0,children:o.jsx(de,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",children:o.jsx(Ft,{className:"w-4 h-4"})})}),o.jsxs(eo,{align:"end",children:[o.jsxs(Tt,{onClick:()=>i(e.dir,"mcps"),children:[o.jsx(tp,{className:"w-4 h-4 mr-2"}),"mcps.json"]}),o.jsxs(Tt,{onClick:()=>i(e.dir,"settings"),children:[o.jsx(Kn,{className:"w-4 h-4 mr-2"}),"settings.json"]}),o.jsx(zi,{}),o.jsxs(Tt,{onClick:()=>i(e.dir,"command"),children:[o.jsx(Bt,{className:"w-4 h-4 mr-2"}),"New Command"]}),o.jsxs(Tt,{onClick:()=>i(e.dir,"rule"),children:[o.jsx(Wn,{className:"w-4 h-4 mr-2"}),"New Rule"]}),o.jsxs(Tt,{onClick:()=>i(e.dir,"workflow"),children:[o.jsx(j_,{className:"w-4 h-4 mr-2"}),"New Workflow"]}),o.jsx(zi,{}),o.jsxs(Tt,{onClick:()=>i(e.dir,"claudemd"),children:[o.jsx(fr,{className:"w-4 h-4 mr-2"}),"CLAUDE.md"]})]})]})]})}function $O({content:e,parsed:t,onSave:s,registry:i}){const[l,m]=C.useState(t||{include:[],mcpServers:{}}),[f,a]=C.useState("rich"),[c,h]=C.useState(JSON.stringify(t||{},null,2)),[g,d]=C.useState(!1),[_,S]=C.useState({open:!1,json:""});C.useEffect(()=>{m(t||{include:[],mcpServers:{}}),h(JSON.stringify(t||{},null,2)),d(!1)},[t]);const E=p=>{var k;const x=(k=l.include)!=null&&k.includes(p)?l.include.filter(P=>P!==p):[...l.include||[],p];m({...l,include:x}),d(!0)},b=()=>{if(f==="json")try{const p=JSON.parse(c);s(JSON.stringify(p,null,2))}catch{le.error("Invalid JSON");return}else s(JSON.stringify(l,null,2));d(!1)},v=()=>{if(!_.json.trim()){le.error("Please paste the MCP JSON configuration");return}try{let p;try{p=JSON.parse(_.json)}catch{le.error("Invalid JSON format");return}let x={};if(p.mcpServers&&typeof p.mcpServers=="object")x=p.mcpServers;else if(typeof p=="object"&&!Array.isArray(p)){if(Object.keys(p).includes("command")){le.error('JSON is missing the MCP name. Expected: { "name": { "command": "...", "args": [...] } }');return}x=p}if(Object.keys(x).length===0){le.error("No MCP configurations found in the JSON");return}for(const[R,j]of Object.entries(x))if(!j.command){le.error(`MCP "${R}" is missing required "command" field`);return}const k={...l.mcpServers||{},...x},P={...l,mcpServers:k};m(P),h(JSON.stringify(P,null,2)),d(!0);const T=Object.keys(x).length;le.success(`Added ${T} MCP${T>1?"s":""} - click Save to apply`),S({open:!1,json:""})}catch(p){le.error("Failed to add: "+p.message)}},y=i!=null&&i.mcpServers?Object.keys(i.mcpServers):[];return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"flex items-center justify-between p-3 border-b bg-gray-50 dark:bg-slate-800",children:[o.jsx(Wc,{value:f,onValueChange:a,children:o.jsxs(_a,{className:"h-8",children:[o.jsx(Qr,{value:"rich",className:"text-xs px-3",children:"Rich Editor"}),o.jsx(Qr,{value:"json",className:"text-xs px-3",children:"JSON"})]})}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(de,{size:"sm",variant:"outline",onClick:()=>S({open:!0,json:""}),children:[o.jsx(Ft,{className:"w-4 h-4 mr-1"}),"Add MCP"]}),g&&o.jsxs(de,{size:"sm",onClick:b,children:[o.jsx(Gi,{className:"w-4 h-4 mr-1"}),"Save"]})]})]}),o.jsx(Qn,{className:"flex-1",children:f==="rich"?o.jsxs("div",{className:"p-4 space-y-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-medium mb-2",children:"Registry MCPs"}),o.jsx("div",{className:"space-y-2",children:y.length===0?o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"No MCPs in registry"}):y.map(p=>{var x;return o.jsxs("div",{className:"flex items-center justify-between p-2 rounded border bg-white dark:bg-slate-950",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(tp,{className:"w-4 h-4 text-blue-500"}),o.jsx("span",{className:"text-sm",children:p})]}),o.jsx(us,{checked:(x=l.include)==null?void 0:x.includes(p),onCheckedChange:()=>E(p)})]},p)})})]}),Object.keys(l.mcpServers||{}).length>0&&o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-medium mb-2",children:"Inline MCPs"}),o.jsx("div",{className:"space-y-2",children:Object.entries(l.mcpServers).map(([p,x])=>{var k;return o.jsxs("div",{className:"p-2 rounded border bg-white dark:bg-slate-950 group",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm font-medium",children:p}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lt,{variant:"outline",className:"text-xs",children:"inline"}),o.jsx(de,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100 text-red-500 hover:text-red-700 hover:bg-red-50",onClick:()=>{const{[p]:P,...T}=l.mcpServers,R={...l,mcpServers:T};m(R),h(JSON.stringify(R,null,2)),d(!0),le.success(`Removed ${p} - click Save to apply`)},children:o.jsx(Gn,{className:"w-3.5 h-3.5"})})]})]}),o.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 font-mono",children:[x.command," ",(k=x.args)==null?void 0:k.join(" ")]})]},p)})})]})]}):o.jsx(Ze,{className:"w-full h-full min-h-[400px] font-mono text-sm border-0 rounded-none resize-none",value:c,onChange:p=>{h(p.target.value),d(!0)}})}),o.jsx(nr,{open:_.open,onOpenChange:p=>S({..._,open:p}),children:o.jsxs(Xt,{className:"bg-white dark:bg-slate-950 max-w-2xl",children:[o.jsxs(Jt,{children:[o.jsx(Zt,{children:"Add MCP to Config"}),o.jsx(Er,{children:"Paste the MCP JSON configuration to add to this config file."})]}),o.jsxs("div",{className:"py-4",children:[o.jsx(Ze,{value:_.json,onChange:p=>S({..._,json:p.target.value}),placeholder:`{
443
- "my-mcp": {
444
- "command": "npx",
445
- "args": ["-y", "@example/mcp-server"],
446
- "env": {
447
- "API_KEY": "\${API_KEY}"
448
- }
449
- }
450
- }`,className:"font-mono text-sm bg-gray-50 dark:bg-slate-800",rows:12}),o.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:["Accepts formats: ",o.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:'{ "name": { "command": "...", "args": [...] } }'})," or ",o.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:'{ "mcpServers": { ... } }'})]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:()=>S({open:!1,json:""}),children:"Cancel"}),o.jsxs(de,{onClick:v,className:"bg-blue-600 hover:bg-blue-700 text-white",children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function HO({open:e,onClose:t,fileType:s,currentContent:i,onInsert:l}){const[m,f]=C.useState(""),[a,c]=C.useState(""),[h,g]=C.useState(!1),d={rule:[{label:"Code Style",prompt:"Create a rule for code formatting and style conventions"},{label:"Testing",prompt:"Create a rule for testing requirements and best practices"},{label:"Security",prompt:"Create a rule for security guidelines and vulnerability prevention"},{label:"Documentation",prompt:"Create a rule for documentation standards"}],command:[{label:"Build & Deploy",prompt:"Create a command for building and deploying the project"},{label:"Testing",prompt:"Create a command for running tests with coverage"},{label:"Database",prompt:"Create a command for database migrations"},{label:"Code Generation",prompt:"Create a command for generating boilerplate code"}],claudemd:[{label:"Project Overview",prompt:"Create a project overview section with tech stack and conventions"},{label:"API Documentation",prompt:"Create API documentation template"},{label:"Development Setup",prompt:"Create development environment setup instructions"},{label:"Architecture",prompt:"Create architecture documentation"}]},_=d[s]||d.claudemd,S=v=>{const y=v||m;if(!y.trim()){le.error("Please enter a prompt or select a template");return}g(!0),setTimeout(()=>{let p="";if(s==="rule")p=`# ${y.replace(/^Create a rule for\s*/i,"").replace(/\s+/g," ").trim()}
451
-
452
- `,p+=`## Guidelines
453
-
454
- `,p+=`- Follow consistent patterns throughout the codebase
455
- `,p+=`- Document any deviations from these guidelines
456
- `,p+=`- Review changes for compliance before merging
457
-
458
- `,p+=`## Examples
459
-
460
- `,p+="```\n// Good example\n// TODO: Add specific examples\n```\n\n",p+=`## Exceptions
461
-
462
- `,p+=`- None documented yet
463
- `;else if(s==="command"){const x=y.replace(/^Create a command for\s*/i,"").toLowerCase().replace(/\s+/g,"-");p=`---
464
- `,p+=`name: ${x}
465
- `,p+=`description: ${y}
466
- `,p+=`---
467
-
468
- `,p+=`# ${y}
469
-
470
- `,p+=`## Usage
471
-
472
- `,p+=`Run this command when you need to ${y.toLowerCase()}.
473
-
474
- `,p+=`## Steps
475
-
476
- `,p+=`1. First, verify prerequisites are met
477
- `,p+=`2. Execute the main operation
478
- `,p+=`3. Verify the results
479
-
480
- `,p+=`## Example Output
481
-
482
- `,p+="```\n// Expected output format\n```\n"}else p=`# ${y.replace(/^Create\s*/i,"")}
483
-
484
- `,p+=`## Overview
485
-
486
- `,p+=`TODO: Add overview here.
487
-
488
- `,p+=`## Details
489
-
490
- `,p+=`TODO: Add detailed information.
491
-
492
- `,p+=`## Related
493
-
494
- `,p+=`- See also: related documentation
495
- `;c(p),g(!1)},500)},E=v=>{if(!a){le.error("Generate content first");return}l(v==="replace"?a:i+`
496
-
497
- `+a),t(),le.success("Content inserted")},b=()=>{f(""),c(""),t()};return o.jsx(nr,{open:e,onOpenChange:b,children:o.jsxs(Xt,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[o.jsxs(Jt,{children:[o.jsxs(Zt,{className:"flex items-center gap-2",children:[o.jsx(sr,{className:"w-5 h-5 text-indigo-600"}),"AI Assist"]}),o.jsxs(Er,{children:["Generate content for your ",s||"file"," using templates or custom prompts"]})]}),o.jsxs("div",{className:"flex-1 overflow-auto space-y-4 py-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Quick Templates"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:_.map(v=>o.jsx(de,{variant:"outline",size:"sm",onClick:()=>{f(v.prompt),S(v.prompt)},disabled:h,children:v.label},v.label))})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Custom Prompt"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ye,{placeholder:"Describe what you want to generate...",value:m,onChange:v=>f(v.target.value),onKeyDown:v=>v.key==="Enter"&&S()}),o.jsx(de,{onClick:()=>S(),disabled:h||!m.trim(),children:h?o.jsx(pr,{className:"w-4 h-4 animate-spin"}):"Generate"})]})]}),a&&o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Generated Content"}),o.jsx(Ze,{value:a,onChange:v=>c(v.target.value),className:"font-mono text-sm min-h-[200px]"})]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:b,children:"Cancel"}),a&&o.jsxs(o.Fragment,{children:[o.jsx(de,{variant:"outline",onClick:()=>E("append"),children:"Append to File"}),o.jsx(de,{onClick:()=>E("replace"),className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:"Replace Content"})]})]})]})})}function Iy({content:e,onSave:t,fileType:s}){const[i,l]=C.useState(e||""),[m,f]=C.useState(!1),[a,c]=C.useState(!1);C.useEffect(()=>{l(e||""),f(!1)},[e]);const h=()=>{t(i),f(!1)},g=_=>{l(_),f(!0)},d=da[s]||da.claudemd;return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"flex items-center justify-between p-3 border-b bg-gray-50 dark:bg-slate-800",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(d.icon,{className:xe("w-4 h-4",d.color)}),o.jsx("span",{className:"text-sm font-medium",children:d.label})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>c(!0),children:[o.jsx(sr,{className:"w-4 h-4 mr-1"}),"AI Assist"]}),m&&o.jsxs(de,{size:"sm",onClick:h,children:[o.jsx(Gi,{className:"w-4 h-4 mr-1"}),"Save"]})]})]}),o.jsx(Ze,{className:"flex-1 w-full font-mono text-sm border-0 rounded-none resize-none p-4",value:i,onChange:_=>{l(_.target.value),f(!0)},placeholder:`Enter ${d.label.toLowerCase()} content...`}),o.jsx(HO,{open:a,onClose:()=>c(!1),fileType:s,currentContent:i,onInsert:g})]})}function VO({content:e,parsed:t,onSave:s,filePath:i}){const l=async m=>{const f=JSON.stringify(m,null,2);s(f)};return o.jsx("div",{className:"h-full overflow-auto p-4",children:o.jsx(b1,{settings:t||{},onSave:l,loading:!1,settingsPath:i||"~/.claude/settings.json"})})}function zO({open:e,onClose:t,item:s,intermediatePaths:i,onMove:l}){const[m,f]=C.useState("copy"),[a,c]=C.useState(null),[h,g]=C.useState(""),[d,_]=C.useState(!1),S=()=>{const E=h.trim()||a;if(!E){le.error("Please select or enter a target path");return}l(s.path,E,m,d)};return o.jsx(nr,{open:e,onOpenChange:t,children:o.jsxs(Xt,{className:"max-w-md",children:[o.jsxs(Jt,{children:[o.jsxs(Zt,{children:[m==="copy"?"Copy":"Move"," ",s==null?void 0:s.name]}),o.jsx(Er,{children:"Select a destination for this file"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(de,{variant:m==="copy"?"default":"outline",size:"sm",onClick:()=>f("copy"),children:[o.jsx($i,{className:"w-4 h-4 mr-1"}),"Copy"]}),o.jsxs(de,{variant:m==="move"?"default":"outline",size:"sm",onClick:()=>f("move"),children:[o.jsx(T_,{className:"w-4 h-4 mr-1"}),"Move"]})]}),o.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:i==null?void 0:i.map(E=>o.jsxs("div",{className:xe("flex items-center justify-between p-2 rounded border cursor-pointer",a===E.dir?"border-blue-500 bg-blue-50":"hover:bg-gray-50 dark:bg-slate-800"),onClick:()=>{c(E.dir),g("")},children:[o.jsxs("div",{className:"flex items-center gap-2",children:[E.isHome?o.jsx(Qf,{className:"w-4 h-4"}):o.jsx(kt,{className:"w-4 h-4"}),o.jsx("span",{className:"text-sm",children:E.label})]}),E.hasClaudeFolder?o.jsx(lt,{variant:"secondary",className:"text-xs",children:"exists"}):o.jsx(lt,{variant:"outline",className:"text-xs",children:"create"})]},E.dir))}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),o.jsx(Ye,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:h,onChange:E=>{g(E.target.value),c(null)}})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(us,{checked:d,onCheckedChange:_}),o.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:t,children:"Cancel"}),o.jsx(de,{onClick:S,children:m==="copy"?"Copy":"Move"})]})]})})}function WO({open:e,onClose:t,item:s,onRename:i}){const[l,m]=C.useState("");C.useEffect(()=>{s!=null&&s.name&&m(s.name.replace(/\.md$/,""))},[s,e]);const f=()=>{if(!l.trim()){le.error("Please enter a name");return}i(s,l.trim())};return o.jsx(nr,{open:e,onOpenChange:t,children:o.jsxs(Xt,{className:"sm:max-w-md",children:[o.jsx(Jt,{children:o.jsxs(Zt,{children:["Rename ",s==null?void 0:s.type]})}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium",children:"New name"}),o.jsx(Ye,{className:"mt-1",placeholder:"new-name",value:l,onChange:a=>m(a.target.value),onKeyDown:a=>a.key==="Enter"&&f()}),o.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:t,children:"Cancel"}),o.jsx(de,{onClick:f,children:"Rename"})]})]})})}function UO({open:e,onClose:t,dir:s,type:i,onCreate:l}){const[m,f]=C.useState("");C.useEffect(()=>{f("")},[e]);const a=()=>{if((i==="command"||i==="rule"||i==="workflow")&&!m.trim()){le.error("Please enter a name");return}const g=i==="command"||i==="rule"||i==="workflow"?m.endsWith(".md")?m:`${m}.md`:m;l(s,g,i)},c=da[i]||{},h=i==="command"||i==="rule"||i==="workflow";return o.jsx(nr,{open:e,onOpenChange:t,children:o.jsxs(Xt,{className:"max-w-sm",children:[o.jsx(Jt,{children:o.jsxs(Zt,{children:["Create ",c.label||i]})}),h&&o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium",children:"Name"}),o.jsx(Ye,{className:"mt-1",placeholder:i==="command"?"my-command.md":i==="workflow"?"my-workflow.md":"my-rule.md",value:m,onChange:g=>f(g.target.value),onKeyDown:g=>g.key==="Enter"&&a()})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:t,children:"Cancel"}),o.jsx(de,{onClick:a,children:"Create"})]})]})})}function KO({project:e,onRefresh:t}){var ue,U,D;const[s,i]=C.useState([]),[l,m]=C.useState([]),[f,a]=C.useState(null),[c,h]=C.useState(null),[g,d]=C.useState(null),[_,S]=C.useState({}),[E,b]=C.useState(!0),[v,y]=C.useState({open:!1,item:null}),[p,x]=C.useState({open:!1,dir:null,type:null}),[k,P]=C.useState({open:!1,item:null}),[T,R]=C.useState(!1),[j,L]=C.useState(!1),[$,F]=C.useState({x:0,y:0,item:null}),[W,H]=C.useState(["claude"]),J=C.useCallback(async()=>{var K;try{b(!0);const[q,ie,ae,ve]=await Promise.all([Re.getClaudeFolders(),Re.getIntermediatePaths(),Re.getRegistry(),Re.getConfig()]);i(q),m(ie),a(ae),H(((K=ve.config)==null?void 0:K.enabledTools)||["claude"])}catch(q){le.error("Failed to load data: "+q.message)}finally{b(!1)}},[]);C.useEffect(()=>{J(),h(null),d(null)},[J,e==null?void 0:e.dir]);const G=async K=>{h(K);try{const q=await Re.getClaudeFile(K.path);d(q)}catch(q){le.error("Failed to load file: "+q.message)}},Y=async K=>{if(c)try{await Re.saveClaudeFile(c.path,K),le.success("Saved");const q=await Re.getClaudeFile(c.path);d(q),J()}catch(q){le.error("Failed to save: "+q.message)}},ee=K=>{S(q=>({...q,[K]:!q[K]}))},z=(K,q)=>{K.preventDefault(),F({x:K.clientX,y:K.clientY,item:q})},M=(K,q)=>{q==="command"||q==="rule"||q==="workflow"?x({open:!0,dir:K,type:q}):B(K,q==="mcps"?"mcps.json":q==="settings"?"settings.json":"CLAUDE.md",q)},B=async(K,q,ie)=>{try{const ae=await Re.createClaudeFile(K,q,ie);if(le.success("Created"),x({open:!1,dir:null,type:null}),await J(),ae.path){const ve={path:ae.path,name:q,type:ie==="command"?"command":ie==="rule"?"rule":ie==="workflow"?"workflow":"file"};h(ve),d(ae.content||"")}}catch(ae){le.error("Failed to create: "+ae.message)}},O=async K=>{try{await Re.createClaudeFile(K,"mcps.json","mcps"),le.success(`Created .claude folder at ${K}`),R(!1),J()}catch(q){le.error("Failed to create: "+q.message)}},V=async(K,q)=>{try{const ie=await Re.renameClaudeFile(K.path,q);ie.success?(le.success("Renamed"),P({open:!1,item:null}),await J(),h({...K,path:ie.newPath,name:q.endsWith(".md")?q:`${q}.md`})):le.error(ie.error||"Failed to rename")}catch(ie){le.error("Failed to rename: "+ie.message)}},Z=async K=>{if(confirm(`Delete ${K.name}?`))try{await Re.deleteClaudeFile(K.path),le.success("Deleted"),(c==null?void 0:c.path)===K.path&&(h(null),d(null)),J()}catch(q){le.error("Failed to delete: "+q.message)}},re=async(K,q,ie,ae)=>{try{await Re.moveClaudeItem(K,q,ie,ae),le.success(ie==="copy"?"Copied":"Moved"),y({open:!1,item:null}),J()}catch(ve){le.error("Failed: "+ve.message)}},ce=()=>{if(!c||!g)return o.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Gh,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),o.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return o.jsx($O,{content:g.content,parsed:g.parsed,onSave:Y,registry:f});case"settings":return o.jsx(VO,{content:g.content,parsed:g.parsed,onSave:Y});case"command":case"rule":case"workflow":case"claudemd":return o.jsx(Iy,{content:g.content,onSave:Y,fileType:c.type});default:return o.jsx(Iy,{content:g.content,onSave:Y,fileType:"claudemd"})}};return E?o.jsx("div",{className:"h-full flex items-center justify-center",children:o.jsx(pr,{className:"w-6 h-6 animate-spin text-gray-400"})}):o.jsxs("div",{className:"h-full flex",children:[o.jsxs("div",{className:"w-72 border-r flex flex-col bg-white dark:bg-slate-950",children:[o.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[o.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),o.jsxs("div",{className:"flex gap-1",children:[W.includes("claude")&&W.includes("antigravity")&&o.jsxs(de,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>L(!0),title:"Sync rules between tools",children:[o.jsx(RR,{className:"w-4 h-4 mr-1"}),"Sync"]}),o.jsxs(de,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),children:[o.jsx(Ft,{className:"w-4 h-4 mr-1"}),"New"]}),o.jsx(de,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:J,children:o.jsx(pr,{className:"w-4 h-4"})})]})]}),o.jsx(Qn,{className:"flex-1",children:s.map((K,q)=>{var ie,ae;return o.jsxs("div",{children:[o.jsx(FO,{folder:K,isFirst:q===0,isLast:q===s.length-1,onCreateFile:M}),K.exists&&K.files.length>0?o.jsxs("div",{className:"py-1",children:[o.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-orange-600 uppercase tracking-wide flex items-center gap-1",children:[o.jsx(sr,{className:"w-3 h-3"}),"Claude Code"]}),K.files.map(ve=>o.jsx(sc,{item:ve,selectedPath:c==null?void 0:c.path,onSelect:G,onContextMenu:z,expandedFolders:_,onToggleFolder:ee},ve.path))]}):o.jsx("div",{className:"px-4 py-2 text-sm text-gray-400 italic",children:K.exists?"Empty .claude":"No .claude folder"}),K.geminiExists&&((ie=K.geminiFiles)==null?void 0:ie.length)>0&&o.jsxs("div",{className:"py-1 border-t border-dashed border-gray-200 dark:border-slate-700 mt-1",children:[o.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-blue-600 uppercase tracking-wide flex items-center gap-1",children:[o.jsx(sr,{className:"w-3 h-3"}),"Gemini CLI"]}),K.geminiFiles.map(ve=>o.jsx(sc,{item:ve,selectedPath:c==null?void 0:c.path,onSelect:G,onContextMenu:z,expandedFolders:_,onToggleFolder:ee},ve.path))]}),K.agentExists&&((ae=K.agentFiles)==null?void 0:ae.length)>0&&o.jsxs("div",{className:"py-1 border-t border-dashed border-gray-200 dark:border-slate-700 mt-1",children:[o.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-purple-600 uppercase tracking-wide flex items-center gap-1",children:[o.jsx(sr,{className:"w-3 h-3"}),"Antigravity"]}),K.agentFiles.map(ve=>o.jsx(sc,{item:ve,selectedPath:c==null?void 0:c.path,onSelect:G,onContextMenu:z,expandedFolders:_,onToggleFolder:ee},ve.path))]})]},K.dir)})})]}),o.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-800",children:[c&&o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[o.jsx("div",{className:"flex items-center gap-2 text-sm",children:o.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),o.jsxs("div",{className:"flex gap-1",children:[o.jsx(de,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:o.jsx($i,{className:"w-4 h-4"})}),o.jsx(de,{variant:"ghost",size:"sm",onClick:()=>Z(c),children:o.jsx(Gn,{className:"w-4 h-4"})})]})]}),o.jsx("div",{className:"flex-1",children:ce()})]}),$.item&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>F({x:0,y:0,item:null})}),o.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:$.x,top:$.y},children:[(((ue=$.item)==null?void 0:ue.type)==="rule"||((U=$.item)==null?void 0:U.type)==="command"||((D=$.item)==null?void 0:D.type)==="workflow")&&o.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{P({open:!0,item:$.item}),F({x:0,y:0,item:null})},children:[o.jsx(Zf,{className:"w-4 h-4 mr-2"}),"Rename"]}),o.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{y({open:!0,item:$.item}),F({x:0,y:0,item:null})},children:[o.jsx($i,{className:"w-4 h-4 mr-2"}),"Copy to..."]}),o.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{y({open:!0,item:$.item}),F({x:0,y:0,item:null})},children:[o.jsx(T_,{className:"w-4 h-4 mr-2"}),"Move to..."]}),o.jsx("div",{className:"border-t my-1"}),o.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center text-red-600",onClick:()=>{Z($.item),F({x:0,y:0,item:null})},children:[o.jsx(Gn,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]}),o.jsx(zO,{open:v.open,onClose:()=>y({open:!1,item:null}),item:v.item,intermediatePaths:l,onMove:re}),o.jsx(UO,{open:p.open,onClose:()=>x({open:!1,dir:null,type:null}),dir:p.dir,type:p.type,onCreate:B}),o.jsx(WO,{open:k.open,onClose:()=>P({open:!1,item:null}),item:k.item,onRename:V}),o.jsx(nr,{open:T,onOpenChange:R,children:o.jsxs(Xt,{className:"max-w-md",children:[o.jsxs(Jt,{children:[o.jsx(Zt,{children:"Create New .claude Folder"}),o.jsx(Er,{children:"Select a location to create a new .claude configuration folder"})]}),o.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[l.filter(K=>!s.some(q=>q.dir===K.dir)).map(K=>o.jsxs("div",{className:"flex items-center justify-between p-3 rounded border hover:bg-gray-50 dark:bg-slate-800 cursor-pointer",onClick:()=>O(K.dir),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(kt,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),o.jsx("span",{className:"text-sm font-mono",children:K.label})]}),o.jsx(lt,{variant:"outline",className:"text-xs",children:"create"})]},K.dir)),l.filter(K=>!s.some(q=>q.dir===K.dir)).length===0&&o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center py-4",children:"All intermediate directories already have .claude folders"})]}),o.jsx(Qt,{children:o.jsx(de,{variant:"ghost",onClick:()=>R(!1),children:"Cancel"})})]})}),o.jsx(kO,{open:j,onOpenChange:L,projectDir:e==null?void 0:e.dir,onSynced:J})]})}function GO({projects:e=[],activeProject:t=null,onSwitch:s,onAddClick:i,onManageClick:l,disabled:m=!1}){const f=(t==null?void 0:t.name)||"No Project";return o.jsxs(Na,{children:[o.jsx(Pa,{asChild:!0,children:o.jsxs(de,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:m,children:[o.jsx(Un,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),o.jsx("span",{className:"truncate font-medium",children:f}),o.jsx(va,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),o.jsxs(eo,{align:"start",className:"w-72",children:[o.jsx(_1,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),o.jsx(zi,{}),e.length===0?o.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[o.jsx(kt,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),o.jsx("p",{children:"No projects registered"}),o.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):o.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(a=>o.jsxs(Tt,{onClick:()=>!a.isActive&&s(a.id),className:`flex items-start gap-2 py-2 cursor-pointer ${a.isActive?"bg-indigo-50":""}`,disabled:a.isActive,children:[o.jsx("div",{className:"mt-0.5 flex-shrink-0",children:a.isActive?o.jsx(Nr,{className:"w-4 h-4 text-indigo-600"}):a.exists?o.jsx(kt,{className:"w-4 h-4 text-gray-400"}):o.jsx(Fc,{className:"w-4 h-4 text-amber-500"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:`truncate font-medium ${a.isActive?"text-indigo-700":""}`,children:a.name}),o.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:a.path.replace(/^\/Users\/[^/]+/,"~")}),!a.exists&&o.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),a.hasClaudeConfig&&o.jsx("div",{className:"flex-shrink-0",children:o.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},a.id))}),o.jsx(zi,{}),o.jsxs(Tt,{onClick:i,className:"gap-2 cursor-pointer",children:[o.jsx(Ft,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&o.jsxs(Tt,{onClick:l,className:"gap-2 cursor-pointer",children:[o.jsx(FT,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}function U1({open:e,onOpenChange:t,onSelect:s,type:i="directory",initialPath:l="~",title:m="Select Path"}){const[f,a]=C.useState(""),[c,h]=C.useState([]),[g,d]=C.useState(!1),[_,S]=C.useState(null),[E,b]=C.useState(""),[v,y]=C.useState("");C.useEffect(()=>{e&&p(l)},[e,l]);const p=async R=>{d(!0),S(null);try{const j=await Re.browse(R,i);j.error?(S(j.error),j.path&&(a(j.path),y(j.path))):(a(j.path),y(j.path),h(j.items||[]),j.home&&b(j.home))}catch(j){S(j.message)}finally{d(!1)}},x=R=>{R.type==="directory"?p(R.path):i==="file"&&(s(R.path),t(!1))},k=()=>{s(f),t(!1)},P=()=>{v&&p(v)},T=R=>{R.key==="Enter"&&P()};return o.jsx(nr,{open:e,onOpenChange:t,children:o.jsxs(Xt,{className:"max-w-lg",children:[o.jsx(Jt,{children:o.jsxs(Zt,{className:"flex items-center gap-2",children:[i==="directory"?o.jsx(kt,{className:"w-5 h-5"}):o.jsx(Gh,{className:"w-5 h-5"}),m]})}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ye,{value:v,onChange:R=>y(R.target.value),onKeyDown:T,placeholder:"Enter path...",className:"font-mono text-sm flex-1"}),o.jsx(de,{variant:"outline",size:"icon",onClick:()=>p(E||"~"),title:"Go to home",children:o.jsx(Qf,{className:"w-4 h-4"})}),o.jsx(de,{onClick:P,disabled:g,children:"Go"})]}),o.jsx("div",{className:"text-xs text-gray-500 font-mono truncate px-1",children:f}),_&&o.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-2 rounded",children:_}),o.jsx(Qn,{className:"h-64 border rounded-lg",children:g?o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(vt,{className:"w-6 h-6 animate-spin text-gray-400"})}):o.jsx("div",{className:"p-1",children:c.length===0?o.jsx("div",{className:"text-sm text-gray-500 p-4 text-center",children:i==="directory"?"No subdirectories":"No files found"}):c.map((R,j)=>o.jsxs("button",{onClick:()=>x(R),className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-gray-100 rounded transition-colors text-left",children:[R.type==="directory"?o.jsx(kt,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):o.jsx(Gh,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),o.jsx("span",{className:`flex-1 truncate ${R.isParent?"text-gray-500":""}`,children:R.name}),R.type==="directory"&&!R.isParent&&o.jsx(Lc,{className:"w-4 h-4 text-gray-400"})]},j))})})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),o.jsx(de,{onClick:k,disabled:!f,children:i==="directory"?"Select Folder":"Select"})]})]})})}function K1({open:e,onOpenChange:t,onAdded:s}){const[i,l]=C.useState(""),[m,f]=C.useState(""),[a,c]=C.useState(!1),[h,g]=C.useState(!1);C.useEffect(()=>{e&&(l(""),f(""))},[e]),C.useEffect(()=>{if(i&&!m){const S=i.split("/").pop();f(S||"")}},[i]);const d=S=>{l(S),c(!1)},_=async()=>{if(!i){le.error("Please select a project path");return}g(!0);try{const S=await Re.addProject(i,m||void 0);S.error?le.error(S.error):(le.success(`Added project: ${S.project.name}`),s==null||s(S.project),t(!1))}catch(S){le.error("Failed to add project: "+S.message)}finally{g(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(nr,{open:e,onOpenChange:t,children:o.jsxs(Xt,{className:"sm:max-w-md",children:[o.jsxs(Jt,{children:[o.jsxs(Zt,{className:"flex items-center gap-2",children:[o.jsx(Un,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),o.jsx(Er,{children:"Register a project folder to quickly switch between projects in the UI."})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{htmlFor:"path",children:"Project Path"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ye,{id:"path",value:i,onChange:S=>l(S.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),o.jsx(de,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:o.jsx(Un,{className:"w-4 h-4"})})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{htmlFor:"name",children:"Display Name"}),o.jsx(Ye,{id:"name",value:m,onChange:S=>f(S.target.value),placeholder:"Auto-filled from folder name"}),o.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),o.jsx(de,{onClick:_,disabled:h||!i,children:h?o.jsxs(o.Fragment,{children:[o.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),o.jsx(U1,{open:a,onOpenChange:c,onSelect:d,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const G1=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function qO({children:e}){const[t,s]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[i,l]=C.useState("light");C.useEffect(()=>{const f=window.document.documentElement,a=g=>{let d;g==="auto"?d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d=g,l(d),d==="dark"?f.classList.add("dark"):f.classList.remove("dark")};a(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{t==="auto"&&a("auto")};return c.addEventListener("change",h),()=>c.removeEventListener("change",h)},[t]);const m=f=>{s(f);try{localStorage.setItem("claude-config-theme",f)}catch{}};return o.jsx(G1.Provider,{value:{theme:t,setTheme:m,resolvedTheme:i},children:e})}function YO(){return C.useContext(G1)}function XO(){const{theme:e,setTheme:t,resolvedTheme:s}=YO(),i=s==="dark"?ey:ty;return o.jsxs(Na,{children:[o.jsx(Pa,{asChild:!0,children:o.jsxs(de,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[o.jsx(i,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),o.jsxs(eo,{align:"end",children:[o.jsxs(Tt,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[o.jsx(ty,{className:"mr-2 h-4 w-4"}),"Light"]}),o.jsxs(Tt,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[o.jsx(ey,{className:"mr-2 h-4 w-4"}),"Dark"]}),o.jsxs(Tt,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[o.jsx(ST,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var JO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],QO=JO.reduce((e,t)=>{const s=sp(`Primitive.${t}`),i=C.forwardRef((l,m)=>{const{asChild:f,...a}=l,c=f?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:m})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),ZO="Separator",By="horizontal",eI=["horizontal","vertical"],q1=C.forwardRef((e,t)=>{const{decorative:s,orientation:i=By,...l}=e,m=tI(i)?i:By,a=s?{role:"none"}:{"aria-orientation":m==="vertical"?m:void 0,role:"separator"};return o.jsx(QO.div,{"data-orientation":m,...a,...l,ref:t})});q1.displayName=ZO;function tI(e){return eI.includes(e)}var Y1=q1;const X1=C.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...i},l)=>o.jsx(Y1,{ref:l,decorative:s,orientation:t,className:xe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...i}));X1.displayName=Y1.displayName;function rI(){var P,T;const[e,t]=C.useState(null),[s,i]=C.useState(""),[l,m]=C.useState({open:!1,field:null,type:"directory"}),[f,a]=C.useState(!0),[c,h]=C.useState(!1),[g,d]=C.useState(null),[_,S]=C.useState(!1);C.useEffect(()=>{v(),E()},[]);const E=async()=>{try{const R=await Re.checkVersion();d(R)}catch(R){console.error("Failed to load version info:",R)}},b=async()=>{var R;if(!(g!=null&&g.updateAvailable)){le.error("No update available");return}S(!0);try{const j=await Re.performUpdate({updateMethod:g.updateMethod,sourcePath:g.sourcePath});j.success?(j.updateMethod==="npm"?le.success(j.message||"Updated via npm! Restart the server to apply."):le.success(`Updated! Files: ${((R=j.updated)==null?void 0:R.join(", "))||"all"}. Restart the server to apply.`),E()):le.error("Update failed: "+j.error)}catch(j){le.error("Update failed: "+j.message)}finally{S(!1)}},v=async()=>{try{a(!0);const R=await Re.getConfig();t(R.config),i(R.path)}catch{le.error("Failed to load settings")}finally{a(!1)}},y=async()=>{h(!0);try{await Re.saveConfig(e),le.success("Preferences saved!")}catch{le.error("Failed to save preferences")}finally{h(!1)}},p=(R,j)=>{t(L=>({...L,[R]:j}))},x=(R,j,L)=>{t($=>({...$,[R]:{...$[R],[j]:L}}))},k=R=>{const j=(e==null?void 0:e.enabledTools)||["claude"];j.includes(R)?j.length>1&&p("enabledTools",j.filter(L=>L!==R)):p("enabledTools",[...j,R])};return f?o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(vt,{className:"w-8 h-8 animate-spin text-primary"})}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center",children:o.jsx(D_,{className:"w-5 h-5 text-muted-foreground"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"claude-config Preferences"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Tool settings for this configuration manager"})]})]}),o.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 shadow-sm",children:[o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsx("div",{children:o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",o.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:s})]})}),o.jsxs(de,{onClick:y,disabled:c,children:[c?o.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}):o.jsx(Gi,{className:"w-4 h-4 mr-2"}),"Save"]})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"border-b border-border pb-6",children:[o.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[o.jsx(kt,{className:"w-4 h-4"}),"Directories"]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground",children:"MCP Tools Directories"}),o.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Folders containing local MCP tool repositories for discovery"}),o.jsxs("div",{className:"space-y-2",children:[((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).map((R,j)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ye,{value:R||"",onChange:L=>{const $=[...(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])];$[j]=L.target.value,p("toolsDirs",$),e!=null&&e.toolsDir&&t(F=>{const{toolsDir:W,...H}=F;return{...H,toolsDirs:$}})},placeholder:"~/mcp-tools",className:"font-mono flex-1"}),o.jsx(de,{variant:"outline",size:"icon",onClick:()=>m({open:!0,field:"toolsDirs",type:"directory",index:j}),title:"Browse...",children:o.jsx(Un,{className:"w-4 h-4"})}),o.jsx(de,{variant:"outline",size:"icon",onClick:()=>{const $=((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).filter((F,W)=>W!==j);t(F=>{const{toolsDir:W,...H}=F;return{...H,toolsDirs:$.length>0?$:void 0}})},title:"Remove",className:"text-destructive hover:text-destructive",children:o.jsx(M_,{className:"w-4 h-4"})})]},j)),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>m({open:!0,field:"toolsDirs",type:"directory",index:-1}),className:"mt-2",children:[o.jsx(E_,{className:"w-4 h-4 mr-2"}),"Add Tools Folder"]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground",children:"Global Registry Path"}),o.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Path to the global MCP registry file"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ye,{value:(e==null?void 0:e.registryPath)||"",onChange:R=>p("registryPath",R.target.value),placeholder:"~/.claude/registry.json",className:"font-mono flex-1"}),o.jsx(de,{variant:"outline",size:"icon",onClick:()=>m({open:!0,field:"registryPath",type:"file"}),title:"Browse...",children:o.jsx(Un,{className:"w-4 h-4"})})]})]})]})]}),o.jsxs("div",{className:"border-b border-border pb-6",children:[o.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[o.jsx(Ic,{className:"w-4 h-4"}),"User Interface"]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Port"}),o.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Port for the web UI server"}),o.jsx(Ye,{type:"number",value:((P=e==null?void 0:e.ui)==null?void 0:P.port)||3333,onChange:R=>x("ui","port",parseInt(R.target.value)||3333),placeholder:"3333",className:"w-32"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground",children:"Open Browser on Start"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically open browser when starting the UI"})]}),o.jsx(us,{checked:((T=e==null?void 0:e.ui)==null?void 0:T.openBrowser)??!0,onCheckedChange:R=>x("ui","openBrowser",R)})]})]})]}),o.jsxs("div",{className:"border-b border-border pb-6",children:[o.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[o.jsx(QR,{className:"w-4 h-4"}),"Enabled AI Tools"]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Select which AI coding tools to generate MCP configurations for. The Apply button will update all enabled tools."}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:o.jsx(sr,{className:"w-4 h-4 text-orange-500"})}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Output: ",o.jsx("code",{className:"text-xs",children:".mcp.json"})]})]})]}),o.jsx(us,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("claude"),onCheckedChange:()=>k("claude")})]}),o.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:o.jsx(sr,{className:"w-4 h-4 text-blue-500"})}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's terminal AI coding assistant • Output: ",o.jsx("code",{className:"text-xs",children:"~/.gemini/settings.json"})]})]})]}),o.jsx(us,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("gemini"),onCheckedChange:()=>k("gemini")})]}),o.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-8 h-8 rounded-md bg-purple-500/10 flex items-center justify-center",children:o.jsx(sr,{className:"w-4 h-4 text-purple-500"})}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground",children:"Antigravity"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI IDE • Output: ",o.jsx("code",{className:"text-xs",children:"~/.gemini/antigravity/mcp_config.json"})]})]})]}),o.jsx(us,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("antigravity"),onCheckedChange:()=>k("antigravity")})]}),o.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["Note: Antigravity does not support environment variable interpolation (",o.jsx("code",{children:"${VAR}"}),"). Variables are resolved to actual values when generating its config."]})]})]}),o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[o.jsx(fr,{className:"w-4 h-4"}),"About"]}),o.jsxs("div",{className:"bg-muted rounded-lg p-4 space-y-3",children:[o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{className:"text-muted-foreground",children:"Installed Version"}),o.jsx("span",{className:"font-medium font-mono text-foreground",children:(g==null?void 0:g.installedVersion)||"Loading..."})]}),(g==null?void 0:g.updateAvailable)&&o.jsx("div",{className:"p-3 bg-green-500/10 border border-green-500/20 rounded-lg",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Update Available!"}),o.jsxs("p",{className:"text-xs text-green-600/80 dark:text-green-400/80",children:["Version ",g.latestVersion," via ",g.updateMethod==="npm"?"npm":g.sourcePath]})]}),o.jsxs(de,{size:"sm",onClick:b,disabled:_,className:"bg-green-600 hover:bg-green-700 text-white",children:[_?o.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}):o.jsx(Oc,{className:"w-4 h-4 mr-2"}),"Update Now"]})]})}),!(g!=null&&g.updateAvailable)&&(g==null?void 0:g.latestVersion)&&o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{className:"text-muted-foreground",children:"Latest Version"}),o.jsxs("span",{className:"font-mono text-green-600 dark:text-green-400",children:[g.latestVersion," ✓"]})]}),(g==null?void 0:g.sourcePath)&&!(g!=null&&g.updateAvailable)&&o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsx("span",{className:"text-muted-foreground",children:"Dev Source"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("code",{className:"text-xs text-muted-foreground",children:g.sourcePath}),o.jsx(de,{size:"sm",variant:"outline",onClick:b,disabled:_,className:"h-7",children:_?o.jsx(vt,{className:"w-3 h-3 animate-spin"}):o.jsx(pr,{className:"w-3 h-3"})})]})]}),o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{className:"text-muted-foreground",children:"Install Location"}),o.jsx("code",{className:"text-xs text-muted-foreground",children:(g==null?void 0:g.installDir)||"~/.claude-config"})]}),o.jsxs("div",{className:"border-t border-border pt-3 mt-3",children:[o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{className:"text-muted-foreground",children:"Documentation"}),o.jsx("a",{href:"https://github.com/regression-io/claude-config",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"GitHub"})]}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["After updating, restart the server with ",o.jsx("code",{className:"bg-muted-foreground/10 px-1 rounded",children:"claude-config ui"})]})]})]})]})]})]}),o.jsx(U1,{open:l.open,onOpenChange:R=>m(j=>({...j,open:R})),onSelect:R=>{if(l.field==="toolsDirs"){const j=(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]);if(l.index===-1)t(L=>{const{toolsDir:$,...F}=L;return{...F,toolsDirs:[...j,R]}});else{const L=[...j];L[l.index]=R,t($=>{const{toolsDir:F,...W}=$;return{...W,toolsDirs:L}})}}else l.field&&p(l.field,R)},type:l.type,initialPath:l.field==="toolsDirs"&&l.index>=0?((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]))[l.index]||"~":(e==null?void 0:e[l.field])||"~",title:l.type==="directory"?"Select Directory":"Select File"})]})}function sI(){const[e,t]=C.useState(null),[s,i]=C.useState(!0);C.useEffect(()=>{l()},[]);const l=async()=>{try{i(!0);const f=await Re.getClaudeSettings();t(f.settings)}catch(f){console.error("Failed to load Claude settings:",f)}finally{i(!1)}},m=async f=>{try{await Re.saveClaudeSettings(f),t(f),le.success("Claude Code settings saved!")}catch(a){le.error("Failed to save settings: "+a.message)}};return s?o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(vt,{className:"w-8 h-8 animate-spin text-indigo-600"})}):o.jsx("div",{className:"space-y-6",children:o.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:o.jsx(b1,{settings:e,onSave:m,loading:s,settingsPath:"~/.claude/settings.json"})})})}var jh={exports:{}},Fy;function nI(){return Fy||(Fy=1,(function(e,t){(function(s,i){e.exports=i()})(globalThis,(()=>(()=>{var s={4567:function(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var L=p.length-1;L>=0;L--)(T=p[L])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const d=c(9042),_=c(9924),S=c(844),E=c(4725),b=c(2585),v=c(3656);let y=a.AccessibilityManager=class extends S.Disposable{constructor(p,x,k,P){super(),this._terminal=p,this._coreBrowserService=k,this._renderService=P,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 T=0;T<this._terminal.rows;T++)this._rowElements[T]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[T]);if(this._topBoundaryFocusListener=T=>this._handleBoundaryFocus(T,0),this._bottomBoundaryFocusListener=T=>this._handleBoundaryFocus(T,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((T=>this._handleResize(T.rows)))),this.register(this._terminal.onRender((T=>this._refreshRows(T.start,T.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((T=>this._handleChar(T)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
498
- `)))),this.register(this._terminal.onA11yTab((T=>this._handleTab(T)))),this.register(this._terminal.onKey((T=>this._handleKey(T.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(p){for(let x=0;x<p;x++)this._handleChar(" ")}_handleChar(p){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===`
499
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,x){this._liveRegionDebouncer.refresh(p,x,this._terminal.rows)}_renderRows(p,x){const k=this._terminal.buffer,P=k.lines.length.toString();for(let T=p;T<=x;T++){const R=k.lines.get(k.ydisp+T),j=[],L=(R==null?void 0:R.translateToString(!0,void 0,void 0,j))||"",$=(k.ydisp+T+1).toString(),F=this._rowElements[T];F&&(L.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=L,this._rowColumns.set(F,j)),F.setAttribute("aria-posinset",$),F.setAttribute("aria-setsize",P))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(p,x){const k=p.target,P=this._rowElements[x===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||p.relatedTarget!==P)return;let T,R;if(x===0?(T=k,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(T=this._rowElements.shift(),R=k,this._rowContainer.removeChild(T)),T.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(x===0?-1:1),this._rowElements[x===0?1:this._rowElements.length-2].focus(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){var L;if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let x={node:p.anchorNode,offset:p.anchorOffset},k={node:p.focusNode,offset:p.focusOffset};if((x.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===k.node&&x.offset>k.offset)&&([x,k]=[k,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const P=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(P)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:P,offset:((L=P.textContent)==null?void 0:L.length)??0}),!this._rowContainer.contains(k.node))return;const T=({node:$,offset:F})=>{const W=$ instanceof Text?$.parentNode:$;let H=parseInt(W==null?void 0:W.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const J=this._rowColumns.get(W);if(!J)return console.warn("columns is null. Race condition?"),null;let G=F<J.length?J[F]:J.slice(-1)[0]+1;return G>=this._terminal.cols&&(++H,G=0),{row:H,column:G}},R=T(x),j=T(k);if(R&&j){if(R.row>j.row||R.row===j.row&&R.column>=j.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(j.row-R.row)*this._terminal.cols-R.column+j.column)}}_handleResize(p){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let x=this._rowContainer.children.length;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);for(;this._rowElements.length>p;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_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 p=0;p<this._terminal.rows;p++)this._refreshRowDimensions(this._rowElements[p])}}_refreshRowDimensions(p){p.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=y=h([g(1,b.IInstantiationService),g(2,E.ICoreBrowserService),g(3,E.IRenderService)],y)},3614:(f,a)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function h(_,S){return S?"\x1B[200~"+_+"\x1B[201~":_}function g(_,S,E,b){_=h(_=c(_),E.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(_,!0),S.value=""}function d(_,S,E){const b=E.getBoundingClientRect(),v=_.clientX-b.left-10,y=_.clientY-b.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${v}px`,S.style.top=`${y}px`,S.style.zIndex="1000",S.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=c,a.bracketTextForPaste=h,a.copyHandler=function(_,S){_.clipboardData&&_.clipboardData.setData("text/plain",S.selectionText),_.preventDefault()},a.handlePasteEvent=function(_,S,E,b){_.stopPropagation(),_.clipboardData&&g(_.clipboardData.getData("text/plain"),S,E,b)},a.paste=g,a.moveTextAreaUnderMouseCursor=d,a.rightClickHandler=function(_,S,E,b,v){d(_,S,E),v&&b.rightClickSelect(_),S.value=b.selectionText,S.select()}},7239:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const h=c(1505);a.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(g,d,_){this._css.set(g,d,_)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,_){this._color.set(g,d,_)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,h,g,d){c.addEventListener(h,g,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(h,g,d))}}}},3551:function(f,a,c){var h=this&&this.__decorate||function(y,p,x,k){var P,T=arguments.length,R=T<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,p,x,k);else for(var j=y.length-1;j>=0;j--)(P=y[j])&&(R=(T<3?P(R):T>3?P(p,x,R):P(p,x))||R);return T>3&&R&&Object.defineProperty(p,x,R),R},g=this&&this.__param||function(y,p){return function(x,k){p(x,k,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const d=c(3656),_=c(8460),S=c(844),E=c(2585),b=c(4725);let v=a.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(y,p,x,k,P){super(),this._element=y,this._mouseService=p,this._renderService=x,this._bufferService=k,this._linkProviderService=P,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,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var T;this._lastMouseEvent=void 0,(T=this._activeProviderReplies)==null||T.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const p=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const x=y.composedPath();for(let k=0;k<x.length;k++){const P=x[k];if(P.classList.contains("xterm"))break;if(P.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,p){var k,P;this._activeProviderReplies&&p||((k=this._activeProviderReplies)==null||k.forEach((T=>{T==null||T.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let x=!1;for(const[T,R]of this._linkProviderService.linkProviders.entries())p?(P=this._activeProviderReplies)!=null&&P.get(T)&&(x=this._checkLinkProviderResult(T,y,x)):R.provideLinks(y.y,(j=>{var $,F;if(this._isMouseOut)return;const L=j==null?void 0:j.map((W=>({link:W})));($=this._activeProviderReplies)==null||$.set(T,L),x=this._checkLinkProviderResult(T,y,x),((F=this._activeProviderReplies)==null?void 0:F.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,p){const x=new Set;for(let k=0;k<p.size;k++){const P=p.get(k);if(P)for(let T=0;T<P.length;T++){const R=P[T],j=R.link.range.start.y<y?0:R.link.range.start.x,L=R.link.range.end.y>y?this._bufferService.cols:R.link.range.end.x;for(let $=j;$<=L;$++){if(x.has($)){P.splice(T--,1);break}x.add($)}}}}_checkLinkProviderResult(y,p,x){var T;if(!this._activeProviderReplies)return x;const k=this._activeProviderReplies.get(y);let P=!1;for(let R=0;R<y;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(P=!0);if(!P&&k){const R=k.find((j=>this._linkAtPosition(j.link,p)));R&&(x=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let R=0;R<this._activeProviderReplies.size;R++){const j=(T=this._activeProviderReplies.get(R))==null?void 0:T.find((L=>this._linkAtPosition(L.link,p)));if(j){x=!0,this._handleNewLink(j);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const p=this._positionFromMouseEvent(y,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,p){this._currentLink&&this._lastMouseEvent&&(!y||!p||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(y.link,p)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var x,k;return(k=(x=this._currentLink)==null?void 0:x.state)==null?void 0:k.decorations.pointerCursor},set:x=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>{var x,k;return(k=(x=this._currentLink)==null?void 0:x.state)==null?void 0:k.decorations.underline},set:x=>{var k,P,T;(k=this._currentLink)!=null&&k.state&&((T=(P=this._currentLink)==null?void 0:P.state)==null?void 0:T.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((x=>{if(!this._currentLink)return;const k=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,P=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=P&&(this._clearCurrentLink(k,P),this._lastMouseEvent)){const T=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);T&&this._askForLink(T,!1)}}))))}_linkHover(y,p,x){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(x,p.text)}_fireUnderlineEvent(y,p){const x=y.range,k=this._bufferService.buffer.ydisp,P=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-k-1,x.end.x,x.end.y-k-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(P)}_linkLeave(y,p,x){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(x,p.text)}_linkAtPosition(y,p){const x=y.range.start.y*this._bufferService.cols+y.range.start.x,k=y.range.end.y*this._bufferService.cols+y.range.end.x,P=p.y*this._bufferService.cols+p.x;return x<=P&&P<=k}_positionFromMouseEvent(y,p,x){const k=x.getCoords(y,p,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,p,x,k,P){return{x1:y,y1:p,x2:x,y2:k,cols:this._bufferService.cols,fg:P}}};a.Linkifier=v=h([g(1,b.IMouseService),g(2,b.IRenderService),g(3,E.IBufferService),g(4,b.ILinkProviderService)],v)},9042:(f,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(f,a,c){var h=this&&this.__decorate||function(b,v,y,p){var x,k=arguments.length,P=k<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,y):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(b,v,y,p);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(P=(k<3?x(P):k>3?x(v,y,P):x(v,y))||P);return k>3&&P&&Object.defineProperty(v,y,P),P},g=this&&this.__param||function(b,v){return function(y,p){v(y,p,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const d=c(511),_=c(2585);let S=a.OscLinkProvider=class{constructor(b,v,y){this._bufferService=b,this._optionsService=v,this._oscLinkService=y}provideLinks(b,v){var L;const y=this._bufferService.buffer.lines.get(b-1);if(!y)return void v(void 0);const p=[],x=this._optionsService.rawOptions.linkHandler,k=new d.CellData,P=y.getTrimmedLength();let T=-1,R=-1,j=!1;for(let $=0;$<P;$++)if(R!==-1||y.hasContent($)){if(y.loadCell($,k),k.hasExtendedAttrs()&&k.extended.urlId){if(R===-1){R=$,T=k.extended.urlId;continue}j=k.extended.urlId!==T}else R!==-1&&(j=!0);if(j||R!==-1&&$===P-1){const F=(L=this._oscLinkService.getLinkData(T))==null?void 0:L.uri;if(F){const W={start:{x:R+1,y:b},end:{x:$+(j||$!==P-1?0:1),y:b}};let H=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const J=new URL(F);["http:","https:"].includes(J.protocol)||(H=!0)}catch{H=!0}H||p.push({text:F,range:W,activate:(J,G)=>x?x.activate(J,G,W):E(0,G),hover:(J,G)=>{var Y;return(Y=x==null?void 0:x.hover)==null?void 0:Y.call(x,J,G,W)},leave:(J,G)=>{var Y;return(Y=x==null?void 0:x.leave)==null?void 0:Y.call(x,J,G,W)}})}j=!1,k.hasExtendedAttrs()&&k.extended.urlId?(R=$,T=k.extended.urlId):(R=-1,T=-1)}}v(p)}};function E(b,v){if(confirm(`Do you want to navigate to ${v}?
500
-
501
- WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=S=h([g(0,_.IBufferService),g(1,_.IOptionsService),g(2,_.IOscLinkService)],S)},6193:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,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 c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const h=c(3614),g=c(3656),d=c(3551),_=c(9042),S=c(3730),E=c(1680),b=c(3107),v=c(5744),y=c(2950),p=c(1296),x=c(428),k=c(4269),P=c(5114),T=c(8934),R=c(3230),j=c(9312),L=c(4725),$=c(6731),F=c(8055),W=c(8969),H=c(8460),J=c(844),G=c(6114),Y=c(8437),ee=c(2584),z=c(7399),M=c(5941),B=c(9074),O=c(2585),V=c(5435),Z=c(4567),re=c(779);class ce extends W.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(U={}){super(U),this.browser=G,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new J.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(B.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((D,K)=>this.refresh(D,K)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((D=>this._reportWindowsOptions(D)))),this.register(this._inputHandler.onColor((D=>this._handleColorEvent(D)))),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((D=>this._afterResize(D.cols,D.rows)))),this.register((0,J.toDisposable)((()=>{var D,K;this._customKeyEventHandler=void 0,(K=(D=this.element)==null?void 0:D.parentNode)==null||K.removeChild(this.element)})))}_handleColorEvent(U){if(this._themeService)for(const D of U){let K,q="";switch(D.index){case 256:K="foreground",q="10";break;case 257:K="background",q="11";break;case 258:K="cursor",q="12";break;default:K="ansi",q="4;"+D.index}switch(D.type){case 0:const ie=F.color.toColorRGB(K==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[K]);this.coreService.triggerDataEvent(`${ee.C0.ESC}]${q};${(0,M.toRgbString)(ie)}${ee.C1_ESCAPED.ST}`);break;case 1:if(K==="ansi")this._themeService.modifyColors((ae=>ae.ansi[D.index]=F.channels.toColor(...D.color)));else{const ae=K;this._themeService.modifyColors((ve=>ve[ae]=F.channels.toColor(...D.color)))}break;case 2:this._themeService.restoreColor(D.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(U){U?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(U){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ee.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var U;return(U=this.textarea)==null?void 0:U.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ee.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 U=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(U);if(!D)return;const K=Math.min(this.buffer.x,this.cols-1),q=this._renderService.dimensions.css.cell.height,ie=D.getWidth(K),ae=this._renderService.dimensions.css.cell.width*ie,ve=this.buffer.y*this._renderService.dimensions.css.cell.height,He=K*this._renderService.dimensions.css.cell.width;this.textarea.style.left=He+"px",this.textarea.style.top=ve+"px",this.textarea.style.width=ae+"px",this.textarea.style.height=q+"px",this.textarea.style.lineHeight=q+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(D=>{this.hasSelection()&&(0,h.copyHandler)(D,this._selectionService)})));const U=D=>(0,h.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",U)),this.register((0,g.addDisposableDomListener)(this.element,"paste",U)),G.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(D=>{D.button===2&&(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(D=>{(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),G.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(D=>{D.button===1&&(0,h.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(U=>this._keyUp(U)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(U=>this._keyDown(U)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(U=>this._keyPress(U)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(U=>this._compositionHelper.compositionupdate(U)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(U=>this._inputEvent(U)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(U){var K;if(!U)throw new Error("Terminal requires a parent element.");if(U.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((K=this.element)==null?void 0:K.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=U.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"),U.appendChild(this.element);const D=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),D.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",(q=>this.updateCursorStyle(q)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),D.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),G.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(P.CoreBrowserService,this.textarea,U.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(q=>this._handleTextAreaFocus(q)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((q=>this._onRender.fire(q)))),this.onResize((q=>this._renderService.resize(q.cols,q.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(T.MouseService),this._instantiationService.setService(L.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(D);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((q=>this.scrollLines(q.amount,q.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(j.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((q=>this.scrollLines(q.amount,q.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((q=>this._renderService.handleSelectionChanged(q.start,q.end,q.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((q=>{this.textarea.value=q,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((q=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(b.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(q=>this._selectionService.handleMouseDown(q)))),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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(q=>this._handleScreenReaderModeOptionChange(q)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(q=>{!this._overviewRulerRenderer&&q&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(p.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const U=this,D=this.element;function K(ae){const ve=U._mouseService.getMouseReportCoords(ae,U.screenElement);if(!ve)return!1;let He,Ue;switch(ae.overrideType||ae.type){case"mousemove":Ue=32,ae.buttons===void 0?(He=3,ae.button!==void 0&&(He=ae.button<3?ae.button:3)):He=1&ae.buttons?0:4&ae.buttons?1:2&ae.buttons?2:3;break;case"mouseup":Ue=0,He=ae.button<3?ae.button:3;break;case"mousedown":Ue=1,He=ae.button<3?ae.button:3;break;case"wheel":if(U._customWheelEventHandler&&U._customWheelEventHandler(ae)===!1||U.viewport.getLinesScrolled(ae)===0)return!1;Ue=ae.deltaY<0?0:1,He=4;break;default:return!1}return!(Ue===void 0||He===void 0||He>4)&&U.coreMouseService.triggerMouseEvent({col:ve.col,row:ve.row,x:ve.x,y:ve.y,button:He,action:Ue,ctrl:ae.ctrlKey,alt:ae.altKey,shift:ae.shiftKey})}const q={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ie={mouseup:ae=>(K(ae),ae.buttons||(this._document.removeEventListener("mouseup",q.mouseup),q.mousedrag&&this._document.removeEventListener("mousemove",q.mousedrag)),this.cancel(ae)),wheel:ae=>(K(ae),this.cancel(ae,!0)),mousedrag:ae=>{ae.buttons&&K(ae)},mousemove:ae=>{ae.buttons||K(ae)}};this.register(this.coreMouseService.onProtocolChange((ae=>{ae?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ae)),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&ae?q.mousemove||(D.addEventListener("mousemove",ie.mousemove),q.mousemove=ie.mousemove):(D.removeEventListener("mousemove",q.mousemove),q.mousemove=null),16&ae?q.wheel||(D.addEventListener("wheel",ie.wheel,{passive:!1}),q.wheel=ie.wheel):(D.removeEventListener("wheel",q.wheel),q.wheel=null),2&ae?q.mouseup||(q.mouseup=ie.mouseup):(this._document.removeEventListener("mouseup",q.mouseup),q.mouseup=null),4&ae?q.mousedrag||(q.mousedrag=ie.mousedrag):(this._document.removeEventListener("mousemove",q.mousedrag),q.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(D,"mousedown",(ae=>{if(ae.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ae))return K(ae),q.mouseup&&this._document.addEventListener("mouseup",q.mouseup),q.mousedrag&&this._document.addEventListener("mousemove",q.mousedrag),this.cancel(ae)}))),this.register((0,g.addDisposableDomListener)(D,"wheel",(ae=>{if(!q.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ae)===!1)return!1;if(!this.buffer.hasScrollback){const ve=this.viewport.getLinesScrolled(ae);if(ve===0)return;const He=ee.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ae.deltaY<0?"A":"B");let Ue="";for(let Xe=0;Xe<Math.abs(ve);Xe++)Ue+=He;return this.coreService.triggerDataEvent(Ue,!0),this.cancel(ae,!0)}return this.viewport.handleWheel(ae)?this.cancel(ae):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(D,"touchstart",(ae=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ae),this.cancel(ae)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(D,"touchmove",(ae=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ae)?void 0:this.cancel(ae)}),{passive:!1}))}refresh(U,D){var K;(K=this._renderService)==null||K.refreshRows(U,D)}updateCursorStyle(U){var D;(D=this._selectionService)!=null&&D.shouldColumnSelect(U)?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(U,D,K=0){var q;K===1?(super.scrollLines(U,D,K),this.refresh(0,this.rows-1)):(q=this.viewport)==null||q.scrollLines(U)}paste(U){(0,h.paste)(U,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(U){this._customKeyEventHandler=U}attachCustomWheelEventHandler(U){this._customWheelEventHandler=U}registerLinkProvider(U){return this._linkProviderService.registerLinkProvider(U)}registerCharacterJoiner(U){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(U);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(U){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(U)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(U){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+U)}registerDecoration(U){return this._decorationService.registerDecoration(U)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(U,D,K){this._selectionService.setSelection(U,D,K)}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 U;(U=this._selectionService)==null||U.clearSelection()}selectAll(){var U;(U=this._selectionService)==null||U.selectAll()}selectLines(U,D){var K;(K=this._selectionService)==null||K.selectLines(U,D)}_keyDown(U){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&U.altKey;if(!D&&!this._compositionHelper.keydown(U))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||U.key!=="Dead"&&U.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const K=(0,z.evaluateKeyboardEvent)(U,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(U),K.type===3||K.type===2){const q=this.rows-1;return this.scrollLines(K.type===2?-q:q),this.cancel(U,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,U)||(K.cancel&&this.cancel(U,!0),!K.key||!!(U.key&&!U.ctrlKey&&!U.altKey&&!U.metaKey&&U.key.length===1&&U.key.charCodeAt(0)>=65&&U.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(K.key!==ee.C0.ETX&&K.key!==ee.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:U}),this._showCursor(),this.coreService.triggerDataEvent(K.key,!0),!this.optionsService.rawOptions.screenReaderMode||U.altKey||U.ctrlKey?this.cancel(U,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(U,D){const K=U.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||U.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||U.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?K:K&&(!D.keyCode||D.keyCode>47)}_keyUp(U){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1||((function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18})(U)||this.focus(),this.updateCursorStyle(U),this._keyPressHandled=!1)}_keyPress(U){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1)return!1;if(this.cancel(U),U.charCode)D=U.charCode;else if(U.which===null||U.which===void 0)D=U.keyCode;else{if(U.which===0||U.charCode===0)return!1;D=U.which}return!(!D||(U.altKey||U.ctrlKey||U.metaKey)&&!this._isThirdLevelShift(this.browser,U)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:U}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(U){if(U.data&&U.inputType==="insertText"&&(!U.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=U.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(U),!0}return!1}resize(U,D){U!==this.cols||D!==this.rows?super.resize(U,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(U,D){var K,q;(K=this._charSizeService)==null||K.measure(),(q=this.viewport)==null||q.syncScrollArea(!0)}clear(){var U;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 D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(Y.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(U=this.viewport)==null||U.reset(),this.refresh(0,this.rows-1)}}reset(){var D,K;this.options.rows=this.rows,this.options.cols=this.cols;const U=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(K=this.viewport)==null||K.reset(),this._customKeyEventHandler=U,this.refresh(0,this.rows-1)}clearTextureAtlas(){var U;(U=this._renderService)==null||U.clearTextureAtlas()}_reportFocus(){var U;(U=this.element)!=null&&U.classList.contains("focus")?this.coreService.triggerDataEvent(ee.C0.ESC+"[I"):this.coreService.triggerDataEvent(ee.C0.ESC+"[O")}_reportWindowsOptions(U){if(this._renderService)switch(U){case V.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),K=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ee.C0.ESC}[4;${K};${D}t`);break;case V.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const q=this._renderService.dimensions.css.cell.width.toFixed(0),ie=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ee.C0.ESC}[6;${ie};${q}t`)}}cancel(U,D){if(this.options.cancelEvents||D)return U.preventDefault(),U.stopPropagation(),!1}}a.Terminal=ce},9924:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,S=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,a,c){var h=this&&this.__decorate||function(y,p,x,k){var P,T=arguments.length,R=T<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,p,x,k);else for(var j=y.length-1;j>=0;j--)(P=y[j])&&(R=(T<3?P(R):T>3?P(p,x,R):P(p,x))||R);return T>3&&R&&Object.defineProperty(p,x,R),R},g=this&&this.__param||function(y,p){return function(x,k){p(x,k,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const d=c(3656),_=c(4725),S=c(8460),E=c(844),b=c(2585);let v=a.Viewport=class extends E.Disposable{constructor(y,p,x,k,P,T,R,j){super(),this._viewportElement=y,this._scrollArea=p,this._bufferService=x,this._optionsService=k,this._charSizeService=P,this._renderService=T,this._coreBrowserService=R,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 S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.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(y){if(y)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 p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){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 p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<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(y,p){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&x<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const p=this._getPixelsScrolled(y);return p!==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+p:this._smoothScrollState.target+=p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=p,this._bubbleScroll(y,p))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const p=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let p=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?p*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._currentRowHeight*this._bufferService.rows),p}getBufferElements(y,p){var j;let x,k="";const P=[],T=p??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let L=y;L<T;L++){const $=R.get(L);if(!$)continue;const F=(j=R.get(L+1))==null?void 0:j.isWrapped;if(k+=$.translateToString(!F),!F||L===R.length-1){const W=document.createElement("div");W.textContent=k,P.push(W),k.length>0&&(x=W),k=""}}return{bufferElements:P,cursorElement:x}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let p=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(y,p){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&p.altKey||x==="ctrl"&&p.ctrlKey||x==="shift"&&p.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const p=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(y,p))}};a.Viewport=v=h([g(2,b.IBufferService),g(3,b.IOptionsService),g(4,_.ICharSizeService),g(5,_.IRenderService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],v)},3107:function(f,a,c){var h=this&&this.__decorate||function(b,v,y,p){var x,k=arguments.length,P=k<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,y):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(b,v,y,p);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(P=(k<3?x(P):k>3?x(v,y,P):x(v,y))||P);return k>3&&P&&Object.defineProperty(v,y,P),P},g=this&&this.__param||function(b,v){return function(y,p){v(y,p,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const d=c(4725),_=c(844),S=c(2585);let E=a.BufferDecorationRenderer=class extends _.Disposable{constructor(b,v,y,p,x){super(),this._screenElement=b,this._bufferService=v,this._coreBrowserService=y,this._decorationService=p,this._renderService=x,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((k=>this._removeDecoration(k)))),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 b of this._decorationService.decorations)this._renderDecoration(b);this._dimensionsChanged=!1}_renderDecoration(b){this._refreshStyle(b),this._dimensionsChanged&&this._refreshXPosition(b)}_createElement(b){var p;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((p=b==null?void 0:b.options)==null?void 0:p.layer)==="top"),v.style.width=`${Math.round((b.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(b.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(b.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=b.options.x??0;return y&&y>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(b,v),v}_refreshStyle(b){const v=b.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)b.element&&(b.element.style.display="none",b.onRenderEmitter.fire(b.element));else{let y=this._decorationElements.get(b);y||(y=this._createElement(b),b.element=y,this._decorationElements.set(b,y),this._container.appendChild(y),b.onDispose((()=>{this._decorationElements.delete(b),y.remove()}))),y.style.top=v*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",b.onRenderEmitter.fire(y)}}_refreshXPosition(b,v=b.element){if(!v)return;const y=b.options.x??0;(b.options.anchor||"left")==="right"?v.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(b){var v;(v=this._decorationElements.get(b))==null||v.remove(),this._decorationElements.delete(b),b.dispose()}};a.BufferDecorationRenderer=E=h([g(1,S.IBufferService),g(2,d.ICoreBrowserService),g(3,S.IDecorationService),g(4,d.IRenderService)],E)},5871:(f,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(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,g){return h>=c.startBufferLine-this._linePadding[g||"full"]&&h<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,a,c){var h=this&&this.__decorate||function(x,k,P,T){var R,j=arguments.length,L=j<3?k:T===null?T=Object.getOwnPropertyDescriptor(k,P):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,k,P,T);else for(var $=x.length-1;$>=0;$--)(R=x[$])&&(L=(j<3?R(L):j>3?R(k,P,L):R(k,P))||L);return j>3&&L&&Object.defineProperty(k,P,L),L},g=this&&this.__param||function(x,k){return function(P,T){k(P,T,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const d=c(5871),_=c(4725),S=c(844),E=c(2585),b={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let p=a.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(x,k,P,T,R,j,L){var F;super(),this._viewportElement=x,this._screenElement=k,this._bufferService=P,this._decorationService=T,this._renderService=R,this._optionsService=j,this._coreBrowserService=L,this._colorZoneStore=new d.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(),(F=this._viewportElement.parentElement)==null||F.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var W;(W=this._canvas)==null||W.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 x=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=x,v.center=k,v.right=x,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=v.left,y.right=v.left+v.center}_refreshDrawHeightConstants(){b.full=Math.round(2*this._coreBrowserService.dpr);const x=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(x,12),6)*this._coreBrowserService.dpr);b.left=k,b.center=k,b.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.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 k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const x=this._colorZoneStore.zones;for(const k of x)k.position!=="full"&&this._renderColorZone(k);for(const k of x)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(x){this._ctx.fillStyle=x.color,this._ctx.fillRect(y[x.position||"full"],Math.round((this._canvas.height-1)*(x.startBufferLine/this._bufferService.buffers.active.lines.length)-b[x.position||"full"]/2),v[x.position||"full"],Math.round((this._canvas.height-1)*((x.endBufferLine-x.startBufferLine)/this._bufferService.buffers.active.lines.length)+b[x.position||"full"]))}_queueRefresh(x,k){this._shouldUpdateDimensions=x||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=p=h([g(2,E.IBufferService),g(3,E.IDecorationService),g(4,_.IRenderService),g(5,E.IOptionsService),g(6,_.ICoreBrowserService)],p)},2950:function(f,a,c){var h=this&&this.__decorate||function(b,v,y,p){var x,k=arguments.length,P=k<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,y):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(b,v,y,p);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(P=(k<3?x(P):k>3?x(v,y,P):x(v,y))||P);return k>3&&P&&Object.defineProperty(v,y,P),P},g=this&&this.__param||function(b,v){return function(y,p){v(y,p,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const d=c(4725),_=c(2585),S=c(2584);let E=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,v,y,p,x,k){this._textarea=b,this._compositionView=v,this._bufferService=y,this._optionsService=p,this._coreService=x,this._renderService=k,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(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const b=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,y=v.replace(b,"");this._dataAlreadySent=y,v.length>b.length?this._coreService.triggerDataEvent(y,!0):v.length<b.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):v.length===b.length&&v!==b&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,p=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,x=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=x+"px",this._compositionView.style.top=p+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=x+"px",this._textarea.style.top=p+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}b||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=E=h([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,_.ICoreService),g(5,d.IRenderService)],E)},9806:(f,a)=>{function c(h,g,d){const _=d.getBoundingClientRect(),S=h.getComputedStyle(d),E=parseInt(S.getPropertyValue("padding-left")),b=parseInt(S.getPropertyValue("padding-top"));return[g.clientX-_.left-E,g.clientY-_.top-b]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(h,g,d,_,S,E,b,v,y){if(!E)return;const p=c(h,g,d);return p?(p[0]=Math.ceil((p[0]+(y?b/2:0))/b),p[1]=Math.ceil(p[1]/v),p[0]=Math.min(Math.max(p[0],1),_+(y?1:0)),p[1]=Math.min(Math.max(p[1],1),S),p):void 0}},9504:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const h=c(2584);function g(v,y,p,x){const k=v-d(v,p),P=y-d(y,p),T=Math.abs(k-P)-(function(R,j,L){let $=0;const F=R-d(R,L),W=j-d(j,L);for(let H=0;H<Math.abs(F-W);H++){const J=_(R,j)==="A"?-1:1,G=L.buffer.lines.get(F+J*H);G!=null&&G.isWrapped&&$++}return $})(v,y,p);return b(T,E(_(v,y),x))}function d(v,y){let p=0,x=y.buffer.lines.get(v),k=x==null?void 0:x.isWrapped;for(;k&&v>=0&&v<y.rows;)p++,x=y.buffer.lines.get(--v),k=x==null?void 0:x.isWrapped;return p}function _(v,y){return v>y?"A":"B"}function S(v,y,p,x,k,P){let T=v,R=y,j="";for(;T!==p||R!==x;)T+=k?1:-1,k&&T>P.cols-1?(j+=P.buffer.translateBufferLineToString(R,!1,v,T),T=0,v=0,R++):!k&&T<0&&(j+=P.buffer.translateBufferLineToString(R,!1,0,v+1),T=P.cols-1,v=T,R--);return j+P.buffer.translateBufferLineToString(R,!1,v,T)}function E(v,y){const p=y?"O":"[";return h.C0.ESC+p+v}function b(v,y){v=Math.floor(v);let p="";for(let x=0;x<v;x++)p+=y;return p}a.moveToCellSequence=function(v,y,p,x){const k=p.buffer.x,P=p.buffer.y;if(!p.buffer.hasScrollback)return(function(j,L,$,F,W,H){return g(L,F,W,H).length===0?"":b(S(j,L,j,L-d(L,W),!1,W).length,E("D",H))})(k,P,0,y,p,x)+g(P,y,p,x)+(function(j,L,$,F,W,H){let J;J=g(L,F,W,H).length>0?F-d(F,W):L;const G=F,Y=(function(ee,z,M,B,O,V){let Z;return Z=g(M,B,O,V).length>0?B-d(B,O):z,ee<M&&Z<=B||ee>=M&&Z<B?"C":"D"})(j,L,$,F,W,H);return b(S(j,J,$,G,Y==="C",W).length,E(Y,H))})(k,P,v,y,p,x);let T;if(P===y)return T=k>v?"D":"C",b(Math.abs(k-v),E(T,x));T=P>y?"D":"C";const R=Math.abs(P-y);return b((function(j,L){return L.cols-j})(P>y?v:k,p)+(R-1)*p.cols+1+((P>y?k:v)-1),E(T,x))}},1296:function(f,a,c){var h=this&&this.__decorate||function(H,J,G,Y){var ee,z=arguments.length,M=z<3?J:Y===null?Y=Object.getOwnPropertyDescriptor(J,G):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(H,J,G,Y);else for(var B=H.length-1;B>=0;B--)(ee=H[B])&&(M=(z<3?ee(M):z>3?ee(J,G,M):ee(J,G))||M);return z>3&&M&&Object.defineProperty(J,G,M),M},g=this&&this.__param||function(H,J){return function(G,Y){J(G,Y,H)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const d=c(3787),_=c(2550),S=c(2223),E=c(6171),b=c(6052),v=c(4725),y=c(8055),p=c(8460),x=c(844),k=c(2585),P="xterm-dom-renderer-owner-",T="xterm-rows",R="xterm-fg-",j="xterm-bg-",L="xterm-focus",$="xterm-selection";let F=1,W=a.DomRenderer=class extends x.Disposable{constructor(H,J,G,Y,ee,z,M,B,O,V,Z,re,ce){super(),this._terminal=H,this._document=J,this._element=G,this._screenElement=Y,this._viewportElement=ee,this._helperContainer=z,this._linkifier2=M,this._charSizeService=O,this._optionsService=V,this._bufferService=Z,this._coreBrowserService=re,this._themeService=ce,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,b.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(T),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($),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(P+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,x.toDisposable)((()=>{this._element.classList.remove(P+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 G of this._rowElements)G.style.width=`${this.dimensions.css.canvas.width}px`,G.style.height=`${this.dimensions.css.cell.height}px`,G.style.lineHeight=`${this.dimensions.css.cell.height}px`,G.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const J=`${this._terminalSelector} .${T} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=J,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 J=`${this._terminalSelector} .${T} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;J+=`${this._terminalSelector} .${T} .xterm-dim { color: ${y.color.multiplyOpacity(H.foreground,.5).css};}`,J+=`${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 G=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,ee=`blink_block_${this._terminalClass}`;J+=`@keyframes ${G} { 50% { border-bottom-style: hidden; }}`,J+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,J+=`@keyframes ${ee} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,J+=`${this._terminalSelector} .${T}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${T}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${T}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,J+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[z,M]of H.ansi.entries())J+=`${this._terminalSelector} .${R}${z} { color: ${M.css}; }${this._terminalSelector} .${R}${z}.xterm-dim { color: ${y.color.multiplyOpacity(M,.5).css}; }${this._terminalSelector} .${j}${z} { background-color: ${M.css}; }`;J+=`${this._terminalSelector} .${R}${S.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(H.background).css}; }${this._terminalSelector} .${R}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${j}${S.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=J}_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,J){for(let G=this._rowElements.length;G<=J;G++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>J;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,J){this._refreshRowElements(H,J),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(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,J,G){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,J,G),this.renderRows(0,this._bufferService.rows-1),!H||!J)return;this._selectionRenderModel.update(this._terminal,H,J,G);const Y=this._selectionRenderModel.viewportStartRow,ee=this._selectionRenderModel.viewportEndRow,z=this._selectionRenderModel.viewportCappedStartRow,M=this._selectionRenderModel.viewportCappedEndRow;if(z>=this._bufferService.rows||M<0)return;const B=this._document.createDocumentFragment();if(G){const O=H[0]>J[0];B.appendChild(this._createSelectionElement(z,O?J[0]:H[0],O?H[0]:J[0],M-z+1))}else{const O=Y===z?H[0]:0,V=z===ee?J[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(z,O,V));const Z=M-z-1;if(B.appendChild(this._createSelectionElement(z+1,0,this._bufferService.cols,Z)),z!==M){const re=ee===M?J[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(M,0,re))}}this._selectionContainer.appendChild(B)}_createSelectionElement(H,J,G,Y=1){const ee=this._document.createElement("div"),z=J*this.dimensions.css.cell.width;let M=this.dimensions.css.cell.width*(G-J);return z+M>this.dimensions.css.canvas.width&&(M=this.dimensions.css.canvas.width-z),ee.style.height=Y*this.dimensions.css.cell.height+"px",ee.style.top=H*this.dimensions.css.cell.height+"px",ee.style.left=`${z}px`,ee.style.width=`${M}px`,ee}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,J){const G=this._bufferService.buffer,Y=G.ybase+G.y,ee=Math.min(G.x,this._bufferService.cols-1),z=this._optionsService.rawOptions.cursorBlink,M=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=H;O<=J;O++){const V=O+G.ydisp,Z=this._rowElements[O],re=G.lines.get(V);if(!Z||!re)break;Z.replaceChildren(...this._rowFactory.createRow(re,V,V===Y,M,B,ee,z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${P}${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,J,G,Y,ee,z){G<0&&(H=0),Y<0&&(J=0);const M=this._bufferService.rows-1;G=Math.max(Math.min(G,M),0),Y=Math.max(Math.min(Y,M),0),ee=Math.min(ee,this._bufferService.cols);const B=this._bufferService.buffer,O=B.ybase+B.y,V=Math.min(B.x,ee-1),Z=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=G;ue<=Y;++ue){const U=ue+B.ydisp,D=this._rowElements[ue],K=B.lines.get(U);if(!D||!K)break;D.replaceChildren(...this._rowFactory.createRow(K,U,U===O,re,ce,V,Z,this.dimensions.css.cell.width,this._widthCache,z?ue===G?H:0:-1,z?(ue===Y?J:ee)-1:-1))}}};a.DomRenderer=W=h([g(7,k.IInstantiationService),g(8,v.ICharSizeService),g(9,k.IOptionsService),g(10,k.IBufferService),g(11,v.ICoreBrowserService),g(12,v.IThemeService)],W)},3787:function(f,a,c){var h=this&&this.__decorate||function(T,R,j,L){var $,F=arguments.length,W=F<3?R:L===null?L=Object.getOwnPropertyDescriptor(R,j):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(T,R,j,L);else for(var H=T.length-1;H>=0;H--)($=T[H])&&(W=(F<3?$(W):F>3?$(R,j,W):$(R,j))||W);return F>3&&W&&Object.defineProperty(R,j,W),W},g=this&&this.__param||function(T,R){return function(j,L){R(j,L,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),S=c(511),E=c(2585),b=c(8055),v=c(4725),y=c(4269),p=c(6171),x=c(3734);let k=a.DomRendererRowFactory=class{constructor(T,R,j,L,$,F,W){this._document=T,this._characterJoinerService=R,this._optionsService=j,this._coreBrowserService=L,this._coreService=$,this._decorationService=F,this._themeService=W,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(T,R,j){this._selectionStart=T,this._selectionEnd=R,this._columnSelectMode=j}createRow(T,R,j,L,$,F,W,H,J,G,Y){const ee=[],z=this._characterJoinerService.getJoinedCharacters(R),M=this._themeService.colors;let B,O=T.getNoBgTrimmedLength();j&&O<F+1&&(O=F+1);let V=0,Z="",re=0,ce=0,ue=0,U=!1,D=0,K=!1,q=0;const ie=[],ae=G!==-1&&Y!==-1;for(let ve=0;ve<O;ve++){T.loadCell(ve,this._workCell);let He=this._workCell.getWidth();if(He===0)continue;let Ue=!1,Xe=ve,Ee=this._workCell;if(z.length>0&&ve===z[0][0]){Ue=!0;const Ge=z.shift();Ee=new y.JoinedCellData(this._workCell,T.translateToString(!0,Ge[0],Ge[1]),Ge[1]-Ge[0]),Xe=Ge[1]-1,He=Ee.getWidth()}const Ht=this._isCellInSelection(ve,R),et=j&&ve===F,Pe=ae&&ve>=G&&ve<=Y;let Ae=!1;this._decorationService.forEachDecorationAtCell(ve,R,void 0,(Ge=>{Ae=!0}));let Ie=Ee.getChars()||_.WHITESPACE_CELL_CHAR;if(Ie===" "&&(Ee.isUnderline()||Ee.isOverline())&&(Ie=" "),q=He*H-J.get(Ie,Ee.isBold(),Ee.isItalic()),B){if(V&&(Ht&&K||!Ht&&!K&&Ee.bg===re)&&(Ht&&K&&M.selectionForeground||Ee.fg===ce)&&Ee.extended.ext===ue&&Pe===U&&q===D&&!et&&!Ue&&!Ae){Ee.isInvisible()?Z+=_.WHITESPACE_CELL_CHAR:Z+=Ie,V++;continue}V&&(B.textContent=Z),B=this._document.createElement("span"),V=0,Z=""}else B=this._document.createElement("span");if(re=Ee.bg,ce=Ee.fg,ue=Ee.extended.ext,U=Pe,D=q,K=Ht,Ue&&F>=ve&&F<=Xe&&(F=ve),!this._coreService.isCursorHidden&&et&&this._coreService.isCursorInitialized){if(ie.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&ie.push("xterm-cursor-blink"),ie.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":ie.push("xterm-cursor-outline");break;case"block":ie.push("xterm-cursor-block");break;case"bar":ie.push("xterm-cursor-bar");break;case"underline":ie.push("xterm-cursor-underline")}}if(Ee.isBold()&&ie.push("xterm-bold"),Ee.isItalic()&&ie.push("xterm-italic"),Ee.isDim()&&ie.push("xterm-dim"),Z=Ee.isInvisible()?_.WHITESPACE_CELL_CHAR:Ee.getChars()||_.WHITESPACE_CELL_CHAR,Ee.isUnderline()&&(ie.push(`xterm-underline-${Ee.extended.underlineStyle}`),Z===" "&&(Z=" "),!Ee.isUnderlineColorDefault()))if(Ee.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(Ee.getUnderlineColor()).join(",")})`;else{let Ge=Ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ee.isBold()&&Ge<8&&(Ge+=8),B.style.textDecorationColor=M.ansi[Ge].css}Ee.isOverline()&&(ie.push("xterm-overline"),Z===" "&&(Z=" ")),Ee.isStrikethrough()&&ie.push("xterm-strikethrough"),Pe&&(B.style.textDecoration="underline");let Fe=Ee.getFgColor(),Et=Ee.getFgColorMode(),ct=Ee.getBgColor(),vr=Ee.getBgColorMode();const ys=!!Ee.isInverse();if(ys){const Ge=Fe;Fe=ct,ct=Ge;const ti=Et;Et=vr,vr=ti}let Vt,Hr,ht,ir=!1;switch(this._decorationService.forEachDecorationAtCell(ve,R,void 0,(Ge=>{Ge.options.layer!=="top"&&ir||(Ge.backgroundColorRGB&&(vr=50331648,ct=Ge.backgroundColorRGB.rgba>>8&16777215,Vt=Ge.backgroundColorRGB),Ge.foregroundColorRGB&&(Et=50331648,Fe=Ge.foregroundColorRGB.rgba>>8&16777215,Hr=Ge.foregroundColorRGB),ir=Ge.options.layer==="top")})),!ir&&Ht&&(Vt=this._coreBrowserService.isFocused?M.selectionBackgroundOpaque:M.selectionInactiveBackgroundOpaque,ct=Vt.rgba>>8&16777215,vr=50331648,ir=!0,M.selectionForeground&&(Et=50331648,Fe=M.selectionForeground.rgba>>8&16777215,Hr=M.selectionForeground)),ir&&ie.push("xterm-decoration-top"),vr){case 16777216:case 33554432:ht=M.ansi[ct],ie.push(`xterm-bg-${ct}`);break;case 50331648:ht=b.channels.toColor(ct>>16,ct>>8&255,255&ct),this._addStyle(B,`background-color:#${P((ct>>>0).toString(16),"0",6)}`);break;default:ys?(ht=M.foreground,ie.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):ht=M.background}switch(Vt||Ee.isDim()&&(Vt=b.color.multiplyOpacity(ht,.5)),Et){case 16777216:case 33554432:Ee.isBold()&&Fe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Fe+=8),this._applyMinimumContrast(B,ht,M.ansi[Fe],Ee,Vt,void 0)||ie.push(`xterm-fg-${Fe}`);break;case 50331648:const Ge=b.channels.toColor(Fe>>16&255,Fe>>8&255,255&Fe);this._applyMinimumContrast(B,ht,Ge,Ee,Vt,Hr)||this._addStyle(B,`color:#${P(Fe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,ht,M.foreground,Ee,Vt,Hr)||ys&&ie.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ie.length&&(B.className=ie.join(" "),ie.length=0),et||Ue||Ae?B.textContent=Z:V++,q!==this.defaultSpacing&&(B.style.letterSpacing=`${q}px`),ee.push(B),ve=Xe}return B&&V&&(B.textContent=Z),ee}_applyMinimumContrast(T,R,j,L,$,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const W=this._getContrastCache(L);let H;if($||F||(H=W.getColor(R.rgba,j.rgba)),H===void 0){const J=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);H=b.color.ensureContrastRatio($||R,F||j,J),W.setColor(($||R).rgba,(F||j).rgba,H??null)}return!!H&&(this._addStyle(T,`color:${H.css}`),!0)}_getContrastCache(T){return T.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(T,R){T.setAttribute("style",`${T.getAttribute("style")||""}${R};`)}_isCellInSelection(T,R){const j=this._selectionStart,L=this._selectionEnd;return!(!j||!L)&&(this._columnSelectMode?j[0]<=L[0]?T>=j[0]&&R>=j[1]&&T<L[0]&&R<=L[1]:T<j[0]&&R>=j[1]&&T>=L[0]&&R<=L[1]:R>j[1]&&R<L[1]||j[1]===L[1]&&R===j[1]&&T>=j[0]&&T<L[0]||j[1]<L[1]&&R===L[1]&&T<L[0]||j[1]<L[1]&&R===j[1]&&T>=j[0])}};function P(T,R,j){for(;T.length<j;)T=R+T;return T}a.DomRendererRowFactory=k=h([g(1,v.ICharacterJoinerService),g(2,E.IOptionsService),g(3,v.ICoreBrowserService),g(4,E.ICoreService),g(5,E.IDecorationService),g(6,v.IThemeService)],k)},2550:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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=c.createElement("span");g.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[g,d,_,S],this._container.appendChild(g),this._container.appendChild(d),this._container.appendChild(_),this._container.appendChild(S),h.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(c,h,g,d){c===this._font&&h===this._fontSize&&g===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=h,this._weight=g,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,h,g){let d=0;if(!h&&!g&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const E=this._measure(c,0);return E>0&&(this._flat[d]=E),E}let _=c;h&&(_+="B"),g&&(_+="I");let S=this._holey.get(_);if(S===void 0){let E=0;h&&(E|=1),g&&(E|=2),S=this._measure(c,E),S>0&&this._holey.set(_,S)}return S}_measure(c,h){const g=this._measureElements[h];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,a)=>{function c(g){return 57508<=g&&g<=57558}function h(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=c,a.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},a.isEmoji=h,a.allowRescaling=function(g,d,_,S){return d===1&&_>Math.ceil(1.5*S)&&g!==void 0&&g>255&&!h(g)&&!c(g)&&!(function(E){return 57344<=E&&E<=63743})(g)},a.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(d){return 9472<=d&&d<=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,d,_=0){return(g-(2*Math.round(d)-_))%(2*Math.round(d))}},6052:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class c{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,d,_,S=!1){if(this.selectionStart=d,this.selectionEnd=_,!d||!_||d[0]===_[0]&&d[1]===_[1])return void this.clear();const E=g.buffers.active.ydisp,b=d[1]-E,v=_[1]-E,y=Math.max(b,0),p=Math.min(v,g.rows-1);y>=g.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=b,this.viewportEndRow=v,this.viewportCappedStartRow=y,this.viewportCappedEndRow=p,this.startCol=d[0],this.endCol=_[0])}isCellSelected(g,d,_){return!!this.hasSelection&&(_-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&_>=this.viewportCappedStartRow&&d<this.endCol&&_<=this.viewportCappedEndRow:d<this.startCol&&_>=this.viewportCappedStartRow&&d>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol)}}a.createSelectionRenderModel=function(){return new c}},456:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var L=p.length-1;L>=0;L--)(T=p[L])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const d=c(2585),_=c(8460),S=c(844);let E=a.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,x,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new v(p,x,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};a.CharSizeService=E=h([g(2,d.IOptionsService)],E);class b extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(x,k){x!==void 0&&x>0&&k!==void 0&&k>0&&(this._result.width=x,this._result.height=k)}}class v extends b{constructor(x,k,P){super(),this._document=x,this._parentElement=k,this._optionsService=P,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 y extends b{constructor(x){super(),this._optionsService=x,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const x=this._ctx.measureText("W");return this._validateAndSet(x.width,x.fontBoundingBoxAscent+x.fontBoundingBoxDescent),this._result}}},4269:function(f,a,c){var h=this&&this.__decorate||function(y,p,x,k){var P,T=arguments.length,R=T<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,p,x,k);else for(var j=y.length-1;j>=0;j--)(P=y[j])&&(R=(T<3?P(R):T>3?P(p,x,R):P(p,x))||R);return T>3&&R&&Object.defineProperty(p,x,R),R},g=this&&this.__param||function(y,p){return function(x,k){p(x,k,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const d=c(3734),_=c(643),S=c(511),E=c(2585);class b extends d.AttributeData{constructor(p,x,k){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=x,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=b;let v=a.CharacterJoinerService=class J1{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(p){const x={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(x),x.id}deregister(p){for(let x=0;x<this._characterJoiners.length;x++)if(this._characterJoiners[x].id===p)return this._characterJoiners.splice(x,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const x=this._bufferService.buffer.lines.get(p);if(!x||x.length===0)return[];const k=[],P=x.translateToString(!0);let T=0,R=0,j=0,L=x.getFg(0),$=x.getBg(0);for(let F=0;F<x.getTrimmedLength();F++)if(x.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==$){if(F-T>1){const W=this._getJoinedRanges(P,j,R,x,T);for(let H=0;H<W.length;H++)k.push(W[H])}T=F,j=R,L=this._workCell.fg,$=this._workCell.bg}R+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-T>1){const F=this._getJoinedRanges(P,j,R,x,T);for(let W=0;W<F.length;W++)k.push(F[W])}return k}_getJoinedRanges(p,x,k,P,T){const R=p.substring(x,k);let j=[];try{j=this._characterJoiners[0].handler(R)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const $=this._characterJoiners[L].handler(R);for(let F=0;F<$.length;F++)J1._mergeRanges(j,$[F])}catch($){console.error($)}return this._stringRangesToCellRanges(j,P,T),j}_stringRangesToCellRanges(p,x,k){let P=0,T=!1,R=0,j=p[P];if(j){for(let L=k;L<this._bufferService.cols;L++){const $=x.getWidth(L),F=x.getString(L).length||_.WHITESPACE_CELL_CHAR.length;if($!==0){if(!T&&j[0]<=R&&(j[0]=L,T=!0),j[1]<=R){if(j[1]=L,j=p[++P],!j)break;j[0]<=R?(j[0]=L,T=!0):T=!1}R+=F}}j&&(j[1]=this._bufferService.cols)}}static _mergeRanges(p,x){let k=!1;for(let P=0;P<p.length;P++){const T=p[P];if(k){if(x[1]<=T[0])return p[P-1][1]=x[1],p;if(x[1]<=T[1])return p[P-1][1]=Math.max(x[1],T[1]),p.splice(P,1),p;p.splice(P,1),P--}else{if(x[1]<=T[0])return p.splice(P,0,x),p;if(x[1]<=T[1])return T[0]=Math.min(x[0],T[0]),p;x[0]<T[1]&&(T[0]=Math.min(x[0],T[0]),k=!0)}}return k?p[p.length-1][1]=x[1]:p.push(x),p}};a.CharacterJoinerService=v=h([g(0,E.IBufferService)],v)},5114:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const h=c(844),g=c(8460),d=c(3656);class _ extends h.Disposable{constructor(b,v,y){super(),this._textarea=b,this._window=v,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(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((p=>this._screenDprMonitor.setWindow(p)))),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(b){this._window!==b&&(this._window=b,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 S extends h.Disposable{constructor(b){super(),this._parentWindow=b,this._windowResizeListener=this.register(new h.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,h.toDisposable)((()=>this.clearListener())))}setWindow(b){this._parentWindow=b,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var b;this._outerListener&&((b=this._resolutionMediaMatchList)==null||b.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:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const h=c(844);class g extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const S=this.linkProviders.indexOf(_);S!==-1&&this.linkProviders.splice(S,1)}}}}a.LinkProviderService=g},8934:function(f,a,c){var h=this&&this.__decorate||function(E,b,v,y){var p,x=arguments.length,k=x<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(E,b,v,y);else for(var P=E.length-1;P>=0;P--)(p=E[P])&&(k=(x<3?p(k):x>3?p(b,v,k):p(b,v))||k);return x>3&&k&&Object.defineProperty(b,v,k),k},g=this&&this.__param||function(E,b){return function(v,y){b(v,y,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const d=c(4725),_=c(9806);let S=a.MouseService=class{constructor(E,b){this._renderService=E,this._charSizeService=b}getCoords(E,b,v,y,p){return(0,_.getCoords)(window,E,b,v,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(E,b){const v=(0,_.getCoordsRelativeToElement)(window,E,b);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};a.MouseService=S=h([g(0,d.IRenderService),g(1,d.ICharSizeService)],S)},3230:function(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var L=p.length-1;L>=0;L--)(T=p[L])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const d=c(6193),_=c(4725),S=c(8460),E=c(844),b=c(7226),v=c(2585);let y=a.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,x,k,P,T,R,j,L){super(),this._rowCount=p,this._charSizeService=P,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new b.DebouncedIdleTask,this._observerDisposable=this.register(new E.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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer((($,F)=>this._renderRows($,F)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var $;return($=this._renderer.value)==null?void 0:$.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(T.onDecorationRegistered((()=>this._fullRefresh()))),this.register(T.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,x),this.register(j.onWindowChange(($=>this._registerIntersectionObserver($,x))))}_registerIntersectionObserver(p,x){if("IntersectionObserver"in p){const k=new p.IntersectionObserver((P=>this._handleIntersectionChange(P[P.length-1])),{threshold:0});k.observe(x),this._observerDisposable.value=(0,E.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,x,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,x,this._rowCount))}_renderRows(p,x){this._renderer.value&&(p=Math.min(p,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(p,x),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:x}),this._onRender.fire({start:p,end:x}),this._isNextRenderRedrawOnly=!0)}resize(p,x){this._rowCount=x,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(p){this._renderer.value=p,this._renderer.value&&(this._renderer.value.onRequestRedraw((x=>this.refreshRows(x.start,x.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,x;this._renderer.value&&((x=(p=this._renderer.value).clearTextureAtlas)==null||x.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(p,x)})):this._renderer.value.handleResize(p,x),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)==null||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)==null||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)==null||p.handleFocus()}handleSelectionChanged(p,x,k){var P;this._selectionState.start=p,this._selectionState.end=x,this._selectionState.columnSelectMode=k,(P=this._renderer.value)==null||P.handleSelectionChanged(p,x,k)}handleCursorMove(){var p;(p=this._renderer.value)==null||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)==null||p.clear()}};a.RenderService=y=h([g(2,v.IOptionsService),g(3,_.ICharSizeService),g(4,v.IDecorationService),g(5,v.IBufferService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],y)},9312:function(f,a,c){var h=this&&this.__decorate||function(j,L,$,F){var W,H=arguments.length,J=H<3?L:F===null?F=Object.getOwnPropertyDescriptor(L,$):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(j,L,$,F);else for(var G=j.length-1;G>=0;G--)(W=j[G])&&(J=(H<3?W(J):H>3?W(L,$,J):W(L,$))||J);return H>3&&J&&Object.defineProperty(L,$,J),J},g=this&&this.__param||function(j,L){return function($,F){L($,F,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const d=c(9806),_=c(9504),S=c(456),E=c(4725),b=c(8460),v=c(844),y=c(6114),p=c(4841),x=c(511),k=c(2585),P=" ",T=new RegExp(P,"g");let R=a.SelectionService=class extends v.Disposable{constructor(j,L,$,F,W,H,J,G,Y){super(),this._element=j,this._screenElement=L,this._linkifier=$,this._bufferService=F,this._coreService=W,this._mouseService=H,this._optionsService=J,this._renderService=G,this._coreBrowserService=Y,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new x.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ee=>this._handleMouseMove(ee),this._mouseUpListener=ee=>this._handleMouseUp(ee),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ee=>this._handleTrim(ee))),this.register(this._bufferService.buffers.onBufferActivate((ee=>this._handleBufferActivate(ee)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.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 j=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!j||!L||j[0]===L[0]&&j[1]===L[1])}get selectionText(){const j=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!j||!L)return"";const $=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(j[0]===L[0])return"";const W=j[0]<L[0]?j[0]:L[0],H=j[0]<L[0]?L[0]:j[0];for(let J=j[1];J<=L[1];J++){const G=$.translateBufferLineToString(J,!0,W,H);F.push(G)}}else{const W=j[1]===L[1]?L[0]:void 0;F.push($.translateBufferLineToString(j[1],!0,j[0],W));for(let H=j[1]+1;H<=L[1]-1;H++){const J=$.lines.get(H),G=$.translateBufferLineToString(H,!0);J!=null&&J.isWrapped?F[F.length-1]+=G:F.push(G)}if(j[1]!==L[1]){const H=$.lines.get(L[1]),J=$.translateBufferLineToString(L[1],!0,0,L[0]);H&&H.isWrapped?F[F.length-1]+=J:F.push(J)}}return F.map((W=>W.replace(T," "))).join(y.isWindows?`\r
502
- `:`
503
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&j&&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(j){const L=this._getMouseBufferCoords(j),$=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!($&&F&&L)&&this._areCoordsInSelection(L,$,F)}isCellInSelection(j,L){const $=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!$||!F)&&this._areCoordsInSelection([j,L],$,F)}_areCoordsInSelection(j,L,$){return j[1]>L[1]&&j[1]<$[1]||L[1]===$[1]&&j[1]===L[1]&&j[0]>=L[0]&&j[0]<$[0]||L[1]<$[1]&&j[1]===$[1]&&j[0]<$[0]||L[1]<$[1]&&j[1]===L[1]&&j[0]>=L[0]}_selectWordAtCursor(j,L){var W,H;const $=(H=(W=this._linkifier.currentLink)==null?void 0:W.link)==null?void 0:H.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,p.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(j);return!!F&&(this._selectWordAt(F,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,L){this._model.clearSelection(),j=Math.max(j,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const L=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(j){let L=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=$?0:(L>$&&(L-=$),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(j){return y.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),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(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const L=this._getMouseBufferCoords(j);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(j){return j.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!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(j),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const $=this._bufferService.buffer;if(this._model.selectionEnd[1]<$.lines.length){const F=$.lines.get(this._model.selectionEnd[1]);F&&F.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[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 j=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const L=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const F=(0,_.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,$=!(!j||!L||j[0]===L[0]&&j[1]===L[1]);$?j&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,L,$)):this._oldHasSelection&&this._fireOnSelectionChange(j,L,$)}_fireOnSelectionChange(j,L,$){this._oldSelectionStart=j,this._oldSelectionEnd=L,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(j,L){let $=L;for(let F=0;L>=F;F++){const W=j.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:W>1&&L!==F&&($+=W-1)}return $}setSelection(j,L,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,L],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,L,$=!0,F=!0){if(j[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,H=W.lines.get(j[1]);if(!H)return;const J=W.translateBufferLineToString(j[1],!1);let G=this._convertViewportColToCharacterIndex(H,j[0]),Y=G;const ee=j[0]-G;let z=0,M=0,B=0,O=0;if(J.charAt(G)===" "){for(;G>0&&J.charAt(G-1)===" ";)G--;for(;Y<J.length&&J.charAt(Y+1)===" ";)Y++}else{let re=j[0],ce=j[0];H.getWidth(re)===0&&(z++,re--),H.getWidth(ce)===2&&(M++,ce++);const ue=H.getString(ce).length;for(ue>1&&(O+=ue-1,Y+=ue-1);re>0&&G>0&&!this._isCharWordSeparator(H.loadCell(re-1,this._workCell));){H.loadCell(re-1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===0?(z++,re--):U>1&&(B+=U-1,G-=U-1),G--,re--}for(;ce<H.length&&Y+1<J.length&&!this._isCharWordSeparator(H.loadCell(ce+1,this._workCell));){H.loadCell(ce+1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===2?(M++,ce++):U>1&&(O+=U-1,Y+=U-1),Y++,ce++}}Y++;let V=G+ee-z+B,Z=Math.min(this._bufferService.cols,Y-G+z+M-B-O);if(L||J.slice(G,Y).trim()!==""){if($&&V===0&&H.getCodePoint(0)!==32){const re=W.lines.get(j[1]-1);if(re&&H.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(ce){const ue=this._bufferService.cols-ce.start;V-=ue,Z+=ue}}}if(F&&V+Z===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const re=W.lines.get(j[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ce=this._getWordAt([0,j[1]+1],!1,!1,!0);ce&&(Z+=ce.length)}}return{start:V,length:Z}}}_selectWordAt(j,L){const $=this._getWordAt(j,L);if($){for(;$.start<0;)$.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[$.start,j[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(j){const L=this._getWordAt(j,!0);if(L){let $=j[1];for(;L.start<0;)L.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,$]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const L=this._bufferService.buffer.getWrappedRangeForLine(j),$={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)($,this._bufferService.cols)}};a.SelectionService=R=h([g(3,k.IBufferService),g(4,k.ICoreService),g(5,E.IMouseService),g(6,k.IOptionsService),g(7,E.IRenderService),g(8,E.ICoreBrowserService)],R)},4725:(f,a,c)=>{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 h=c(8343);a.ICharSizeService=(0,h.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),a.IMouseService=(0,h.createDecorator)("MouseService"),a.IRenderService=(0,h.createDecorator)("RenderService"),a.ISelectionService=(0,h.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,h.createDecorator)("ThemeService"),a.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,a,c){var h=this&&this.__decorate||function(R,j,L,$){var F,W=arguments.length,H=W<3?j:$===null?$=Object.getOwnPropertyDescriptor(j,L):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(R,j,L,$);else for(var J=R.length-1;J>=0;J--)(F=R[J])&&(H=(W<3?F(H):W>3?F(j,L,H):F(j,L))||H);return W>3&&H&&Object.defineProperty(j,L,H),H},g=this&&this.__param||function(R,j){return function(L,$){j(L,$,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),S=c(8460),E=c(844),b=c(2585),v=_.css.toColor("#ffffff"),y=_.css.toColor("#000000"),p=_.css.toColor("#ffffff"),x=_.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[_.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")],j=[0,95,135,175,215,255];for(let L=0;L<216;L++){const $=j[L/36%6|0],F=j[L/6%6|0],W=j[L%6];R.push({css:_.channels.toCss($,F,W),rgba:_.channels.toRgba($,F,W)})}for(let L=0;L<24;L++){const $=8+10*L;R.push({css:_.channels.toCss($,$,$),rgba:_.channels.toRgba($,$,$)})}return R})());let P=a.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:y,cursor:p,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:_.color.blend(y,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:_.color.blend(y,k),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(R={}){const j=this._colors;if(j.foreground=T(R.foreground,v),j.background=T(R.background,y),j.cursor=T(R.cursor,p),j.cursorAccent=T(R.cursorAccent,x),j.selectionBackgroundTransparent=T(R.selectionBackground,k),j.selectionBackgroundOpaque=_.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=T(R.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=_.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=R.selectionForeground?T(R.selectionForeground,_.NULL_COLOR):void 0,j.selectionForeground===_.NULL_COLOR&&(j.selectionForeground=void 0),_.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=_.color.opacity(j.selectionBackgroundTransparent,.3)),_.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=_.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=a.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=T(R.black,a.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=T(R.red,a.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=T(R.green,a.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=T(R.yellow,a.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=T(R.blue,a.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=T(R.magenta,a.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=T(R.cyan,a.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=T(R.white,a.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=T(R.brightBlack,a.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=T(R.brightRed,a.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=T(R.brightGreen,a.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=T(R.brightYellow,a.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=T(R.brightBlue,a.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=T(R.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=T(R.brightCyan,a.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=T(R.brightWhite,a.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const L=Math.min(j.ansi.length-16,R.extendedAnsi.length);for(let $=0;$<L;$++)j.ansi[$+16]=T(R.extendedAnsi[$],a.DEFAULT_ANSI_COLORS[$+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let j=0;j<this._restoreColors.ansi.length;++j)this._colors.ansi[j]=this._restoreColors.ansi[j]}modifyColors(R){R(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 T(R,j){if(R!==void 0)try{return _.css.toColor(R)}catch{}return j}a.ThemeService=P=h([g(0,b.IOptionsService)],P)},6349:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const h=c(8460),g=c(844);class d extends g.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(S){if(this._maxLength===S)return;const E=new Array(S);for(let b=0;b<Math.min(S,this.length);b++)E[b]=this._array[this._getCyclicIndex(b)];this._array=E,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let E=this._length;E<S;E++)this._array[E]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,E){this._array[this._getCyclicIndex(S)]=E}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,E,...b){if(E){for(let v=S;v<this._length-E;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+E)];this._length-=E,this.onDeleteEmitter.fire({index:S,amount:E})}for(let v=this._length-1;v>=S;v--)this._array[this._getCyclicIndex(v+b.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<b.length;v++)this._array[this._getCyclicIndex(S+v)]=b[v];if(b.length&&this.onInsertEmitter.fire({index:S,amount:b.length}),this._length+b.length>this._maxLength){const v=this._length+b.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=b.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,E,b){if(!(E<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let y=E-1;y>=0;y--)this.set(S+y+b,this.get(S+y));const v=S+E+b-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<E;v++)this.set(S+v+b,this.get(S+v))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}a.CircularList=d},1439:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(h,g=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const _ in h)d[_]=g<=1?h[_]:h[_]&&c(h[_],g-1);return d}},8055:(f,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 c=0,h=0,g=0,d=0;var _,S,E,b,v;function y(x){const k=x.toString(16);return k.length<2?"0"+k:k}function p(x,k){return x<k?(k+.05)/(x+.05):(x+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(x){x.toCss=function(k,P,T,R){return R!==void 0?`#${y(k)}${y(P)}${y(T)}${y(R)}`:`#${y(k)}${y(P)}${y(T)}`},x.toRgba=function(k,P,T,R=255){return(k<<24|P<<16|T<<8|R)>>>0},x.toColor=function(k,P,T,R){return{css:x.toCss(k,P,T,R),rgba:x.toRgba(k,P,T,R)}}})(_||(a.channels=_={})),(function(x){function k(P,T){return d=Math.round(255*T),[c,h,g]=v.toChannels(P.rgba),{css:_.toCss(c,h,g,d),rgba:_.toRgba(c,h,g,d)}}x.blend=function(P,T){if(d=(255&T.rgba)/255,d===1)return{css:T.css,rgba:T.rgba};const R=T.rgba>>24&255,j=T.rgba>>16&255,L=T.rgba>>8&255,$=P.rgba>>24&255,F=P.rgba>>16&255,W=P.rgba>>8&255;return c=$+Math.round((R-$)*d),h=F+Math.round((j-F)*d),g=W+Math.round((L-W)*d),{css:_.toCss(c,h,g),rgba:_.toRgba(c,h,g)}},x.isOpaque=function(P){return(255&P.rgba)==255},x.ensureContrastRatio=function(P,T,R){const j=v.ensureContrastRatio(P.rgba,T.rgba,R);if(j)return _.toColor(j>>24&255,j>>16&255,j>>8&255)},x.opaque=function(P){const T=(255|P.rgba)>>>0;return[c,h,g]=v.toChannels(T),{css:_.toCss(c,h,g),rgba:T}},x.opacity=k,x.multiplyOpacity=function(P,T){return d=255&P.rgba,k(P,d*T/255)},x.toColorRGB=function(P){return[P.rgba>>24&255,P.rgba>>16&255,P.rgba>>8&255]}})(S||(a.color=S={})),(function(x){let k,P;try{const T=document.createElement("canvas");T.width=1,T.height=1;const R=T.getContext("2d",{willReadFrequently:!0});R&&(k=R,k.globalCompositeOperation="copy",P=k.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return c=parseInt(T.slice(1,2).repeat(2),16),h=parseInt(T.slice(2,3).repeat(2),16),g=parseInt(T.slice(3,4).repeat(2),16),_.toColor(c,h,g);case 5:return c=parseInt(T.slice(1,2).repeat(2),16),h=parseInt(T.slice(2,3).repeat(2),16),g=parseInt(T.slice(3,4).repeat(2),16),d=parseInt(T.slice(4,5).repeat(2),16),_.toColor(c,h,g,d);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}const R=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(R)return c=parseInt(R[1]),h=parseInt(R[2]),g=parseInt(R[3]),d=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),_.toColor(c,h,g,d);if(!k||!P)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=P,k.fillStyle=T,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[c,h,g,d]=k.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,h,g,d),css:T}}})(E||(a.css=E={})),(function(x){function k(P,T,R){const j=P/255,L=T/255,$=R/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))}x.relativeLuminance=function(P){return k(P>>16&255,P>>8&255,255&P)},x.relativeLuminance2=k})(b||(a.rgb=b={})),(function(x){function k(T,R,j){const L=T>>24&255,$=T>>16&255,F=T>>8&255;let W=R>>24&255,H=R>>16&255,J=R>>8&255,G=p(b.relativeLuminance2(W,H,J),b.relativeLuminance2(L,$,F));for(;G<j&&(W>0||H>0||J>0);)W-=Math.max(0,Math.ceil(.1*W)),H-=Math.max(0,Math.ceil(.1*H)),J-=Math.max(0,Math.ceil(.1*J)),G=p(b.relativeLuminance2(W,H,J),b.relativeLuminance2(L,$,F));return(W<<24|H<<16|J<<8|255)>>>0}function P(T,R,j){const L=T>>24&255,$=T>>16&255,F=T>>8&255;let W=R>>24&255,H=R>>16&255,J=R>>8&255,G=p(b.relativeLuminance2(W,H,J),b.relativeLuminance2(L,$,F));for(;G<j&&(W<255||H<255||J<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),H=Math.min(255,H+Math.ceil(.1*(255-H))),J=Math.min(255,J+Math.ceil(.1*(255-J))),G=p(b.relativeLuminance2(W,H,J),b.relativeLuminance2(L,$,F));return(W<<24|H<<16|J<<8|255)>>>0}x.blend=function(T,R){if(d=(255&R)/255,d===1)return R;const j=R>>24&255,L=R>>16&255,$=R>>8&255,F=T>>24&255,W=T>>16&255,H=T>>8&255;return c=F+Math.round((j-F)*d),h=W+Math.round((L-W)*d),g=H+Math.round(($-H)*d),_.toRgba(c,h,g)},x.ensureContrastRatio=function(T,R,j){const L=b.relativeLuminance(T>>8),$=b.relativeLuminance(R>>8);if(p(L,$)<j){if($<L){const H=k(T,R,j),J=p(L,b.relativeLuminance(H>>8));if(J<j){const G=P(T,R,j);return J>p(L,b.relativeLuminance(G>>8))?H:G}return H}const F=P(T,R,j),W=p(L,b.relativeLuminance(F>>8));if(W<j){const H=k(T,R,j);return W>p(L,b.relativeLuminance(H>>8))?F:H}return F}},x.reduceLuminance=k,x.increaseLuminance=P,x.toChannels=function(T){return[T>>24&255,T>>16&255,T>>8&255,255&T]}})(v||(a.rgba=v={})),a.toPaddedHex=y,a.contrastRatio=p},8969:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const h=c(844),g=c(2585),d=c(4348),_=c(7866),S=c(744),E=c(7302),b=c(6975),v=c(8460),y=c(1753),p=c(1480),x=c(7994),k=c(9282),P=c(5435),T=c(5981),R=c(2660);let j=!1;class L extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((F=>{var W;(W=this._onScrollApi)==null||W.fire(F.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(F){for(const W in F)this.optionsService.options[W]=F[W]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new E.OptionsService(F)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.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(b.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(p.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(x.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new P.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.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((W=>{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((W=>{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 T.WriteBuffer(((W,H)=>this._inputHandler.parse(W,H)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,W){this._writeBuffer.write(F,W)}writeSync(F,W){this._logService.logLevel<=g.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(F,W)}input(F,W=!0){this.coreService.triggerDataEvent(F,W)}resize(F,W){isNaN(F)||isNaN(W)||(F=Math.max(F,S.MINIMUM_COLS),W=Math.max(W,S.MINIMUM_ROWS),this._bufferService.resize(F,W))}scroll(F,W=!1){this._bufferService.scroll(F,W)}scrollLines(F,W,H){this._bufferService.scrollLines(F,W,H)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const W=F-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(F,W){return this._inputHandler.registerEscHandler(F,W)}registerDcsHandler(F,W){return this._inputHandler.registerDcsHandler(F,W)}registerCsiHandler(F,W){return this._inputHandler.registerCsiHandler(F,W)}registerOscHandler(F,W){return this._inputHandler.registerOscHandler(F,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?F=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const W of F)W.dispose()}))}}}a.CoreTerminal=L},8460:(f,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=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,h){return c((g=>h.fire(g)))},a.runAndSubscribe=function(c,h){return h(void 0),c((g=>h(g)))}},5435:function(f,a,c){var h=this&&this.__decorate||function(z,M,B,O){var V,Z=arguments.length,re=Z<3?M:O===null?O=Object.getOwnPropertyDescriptor(M,B):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(z,M,B,O);else for(var ce=z.length-1;ce>=0;ce--)(V=z[ce])&&(re=(Z<3?V(re):Z>3?V(M,B,re):V(M,B))||re);return Z>3&&re&&Object.defineProperty(M,B,re),re},g=this&&this.__param||function(z,M){return function(B,O){M(B,O,z)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),S=c(2015),E=c(844),b=c(482),v=c(8437),y=c(8460),p=c(643),x=c(511),k=c(3734),P=c(2585),T=c(1480),R=c(6242),j=c(6351),L=c(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function W(z,M){if(z>24)return M.setWinLines||!1;switch(z){case 1:return!!M.restoreWin;case 2:return!!M.minimizeWin;case 3:return!!M.setWinPosition;case 4:return!!M.setWinSizePixels;case 5:return!!M.raiseWin;case 6:return!!M.lowerWin;case 7:return!!M.refreshWin;case 8:return!!M.setWinSizeChars;case 9:return!!M.maximizeWin;case 10:return!!M.fullscreenWin;case 11:return!!M.getWinState;case 13:return!!M.getWinPosition;case 14:return!!M.getWinSizePixels;case 15:return!!M.getScreenSizePixels;case 16:return!!M.getCellSizePixels;case 18:return!!M.getWinSizeChars;case 19:return!!M.getScreenSizeChars;case 20:return!!M.getIconTitle;case 21:return!!M.getWinTitle;case 22:return!!M.pushTitle;case 23:return!!M.popTitle;case 24:return!!M.setWinLines}return!1}var H;(function(z){z[z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",z[z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(a.WindowsOptionsReportType=H={}));let J=0;class G extends E.Disposable{getAttrData(){return this._curAttrData}constructor(M,B,O,V,Z,re,ce,ue,U=new S.EscapeSequenceParser){super(),this._bufferService=M,this._charsetService=B,this._coreService=O,this._logService=V,this._optionsService=Z,this._oscLinkService=re,this._coreMouseService=ce,this._unicodeService=ue,this._parser=U,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new x.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.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 Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._parser.setCsiHandlerFallback(((D,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:K.toArray()})})),this._parser.setEscHandlerFallback((D=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(D)})})),this._parser.setExecuteHandlerFallback((D=>{this._logService.debug("Unknown EXECUTE code: ",{code:D})})),this._parser.setOscHandlerFallback(((D,K,q)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:K,data:q})})),this._parser.setDcsHandlerFallback(((D,K,q)=>{K==="HOOK"&&(q=q.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:K,payload:q})})),this._parser.setPrintHandler(((D,K,q)=>this.print(D,K,q))),this._parser.registerCsiHandler({final:"@"},(D=>this.insertChars(D))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(D=>this.scrollLeft(D))),this._parser.registerCsiHandler({final:"A"},(D=>this.cursorUp(D))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(D=>this.scrollRight(D))),this._parser.registerCsiHandler({final:"B"},(D=>this.cursorDown(D))),this._parser.registerCsiHandler({final:"C"},(D=>this.cursorForward(D))),this._parser.registerCsiHandler({final:"D"},(D=>this.cursorBackward(D))),this._parser.registerCsiHandler({final:"E"},(D=>this.cursorNextLine(D))),this._parser.registerCsiHandler({final:"F"},(D=>this.cursorPrecedingLine(D))),this._parser.registerCsiHandler({final:"G"},(D=>this.cursorCharAbsolute(D))),this._parser.registerCsiHandler({final:"H"},(D=>this.cursorPosition(D))),this._parser.registerCsiHandler({final:"I"},(D=>this.cursorForwardTab(D))),this._parser.registerCsiHandler({final:"J"},(D=>this.eraseInDisplay(D,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(D=>this.eraseInDisplay(D,!0))),this._parser.registerCsiHandler({final:"K"},(D=>this.eraseInLine(D,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(D=>this.eraseInLine(D,!0))),this._parser.registerCsiHandler({final:"L"},(D=>this.insertLines(D))),this._parser.registerCsiHandler({final:"M"},(D=>this.deleteLines(D))),this._parser.registerCsiHandler({final:"P"},(D=>this.deleteChars(D))),this._parser.registerCsiHandler({final:"S"},(D=>this.scrollUp(D))),this._parser.registerCsiHandler({final:"T"},(D=>this.scrollDown(D))),this._parser.registerCsiHandler({final:"X"},(D=>this.eraseChars(D))),this._parser.registerCsiHandler({final:"Z"},(D=>this.cursorBackwardTab(D))),this._parser.registerCsiHandler({final:"`"},(D=>this.charPosAbsolute(D))),this._parser.registerCsiHandler({final:"a"},(D=>this.hPositionRelative(D))),this._parser.registerCsiHandler({final:"b"},(D=>this.repeatPrecedingCharacter(D))),this._parser.registerCsiHandler({final:"c"},(D=>this.sendDeviceAttributesPrimary(D))),this._parser.registerCsiHandler({prefix:">",final:"c"},(D=>this.sendDeviceAttributesSecondary(D))),this._parser.registerCsiHandler({final:"d"},(D=>this.linePosAbsolute(D))),this._parser.registerCsiHandler({final:"e"},(D=>this.vPositionRelative(D))),this._parser.registerCsiHandler({final:"f"},(D=>this.hVPosition(D))),this._parser.registerCsiHandler({final:"g"},(D=>this.tabClear(D))),this._parser.registerCsiHandler({final:"h"},(D=>this.setMode(D))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(D=>this.setModePrivate(D))),this._parser.registerCsiHandler({final:"l"},(D=>this.resetMode(D))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(D=>this.resetModePrivate(D))),this._parser.registerCsiHandler({final:"m"},(D=>this.charAttributes(D))),this._parser.registerCsiHandler({final:"n"},(D=>this.deviceStatus(D))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(D=>this.deviceStatusPrivate(D))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(D=>this.softReset(D))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(D=>this.setCursorStyle(D))),this._parser.registerCsiHandler({final:"r"},(D=>this.setScrollRegion(D))),this._parser.registerCsiHandler({final:"s"},(D=>this.saveCursor(D))),this._parser.registerCsiHandler({final:"t"},(D=>this.windowOptions(D))),this._parser.registerCsiHandler({final:"u"},(D=>this.restoreCursor(D))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(D=>this.insertColumns(D))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(D=>this.deleteColumns(D))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(D=>this.selectProtected(D))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(D=>this.requestMode(D,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(D=>this.requestMode(D,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new R.OscHandler((D=>(this.setTitle(D),this.setIconName(D),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((D=>this.setIconName(D)))),this._parser.registerOscHandler(2,new R.OscHandler((D=>this.setTitle(D)))),this._parser.registerOscHandler(4,new R.OscHandler((D=>this.setOrReportIndexedColor(D)))),this._parser.registerOscHandler(8,new R.OscHandler((D=>this.setHyperlink(D)))),this._parser.registerOscHandler(10,new R.OscHandler((D=>this.setOrReportFgColor(D)))),this._parser.registerOscHandler(11,new R.OscHandler((D=>this.setOrReportBgColor(D)))),this._parser.registerOscHandler(12,new R.OscHandler((D=>this.setOrReportCursorColor(D)))),this._parser.registerOscHandler(104,new R.OscHandler((D=>this.restoreIndexedColor(D)))),this._parser.registerOscHandler(110,new R.OscHandler((D=>this.restoreFgColor(D)))),this._parser.registerOscHandler(111,new R.OscHandler((D=>this.restoreBgColor(D)))),this._parser.registerOscHandler(112,new R.OscHandler((D=>this.restoreCursorColor(D)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const D in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:D},(()=>this.selectCharset("("+D))),this._parser.registerEscHandler({intermediates:")",final:D},(()=>this.selectCharset(")"+D))),this._parser.registerEscHandler({intermediates:"*",final:D},(()=>this.selectCharset("*"+D))),this._parser.registerEscHandler({intermediates:"+",final:D},(()=>this.selectCharset("+"+D))),this._parser.registerEscHandler({intermediates:"-",final:D},(()=>this.selectCharset("-"+D))),this._parser.registerEscHandler({intermediates:".",final:D},(()=>this.selectCharset("."+D))),this._parser.registerEscHandler({intermediates:"/",final:D},(()=>this.selectCharset("/"+D)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((D=>(this._logService.error("Parsing error: ",D),D))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((D,K)=>this.requestStatusString(D,K))))}_preserveStack(M,B,O,V){this._parseStack.paused=!0,this._parseStack.cursorStartX=M,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=O,this._parseStack.position=V}_logSlowResolvingAsync(M){this._logService.logLevel<=P.LogLevelEnum.WARN&&Promise.race([M,new Promise(((B,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(M,B){let O,V=this._activeBuffer.x,Z=this._activeBuffer.y,re=0;const ce=this._parseStack.paused;if(ce){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(O),O;V=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,M.length>F&&(re=this._parseStack.position+F)}if(this._logService.logLevel<=P.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof M=="string"?` "${M}"`:` "${Array.prototype.map.call(M,(D=>String.fromCharCode(D))).join("")}"`),typeof M=="string"?M.split("").map((D=>D.charCodeAt(0))):M),this._parseBuffer.length<M.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(M.length,F))),ce||this._dirtyRowTracker.clearRange(),M.length>F)for(let D=re;D<M.length;D+=F){const K=D+F<M.length?D+F:M.length,q=typeof M=="string"?this._stringDecoder.decode(M.substring(D,K),this._parseBuffer):this._utf8Decoder.decode(M.subarray(D,K),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,q))return this._preserveStack(V,Z,q,D),this._logSlowResolvingAsync(O),O}else if(!ce){const D=typeof M=="string"?this._stringDecoder.decode(M,this._parseBuffer):this._utf8Decoder.decode(M,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,D))return this._preserveStack(V,Z,D,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===V&&this._activeBuffer.y===Z||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),U=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);U<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(U,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(M,B,O){let V,Z;const re=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,U=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,K=this._curAttrData;let q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-B>0&&q.getWidth(this._activeBuffer.x-1)===2&&q.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let ie=this._parser.precedingJoinState;for(let ae=B;ae<O;++ae){if(V=M[ae],V<127&&re){const Xe=re[String.fromCharCode(V)];Xe&&(V=Xe.charCodeAt(0))}const ve=this._unicodeService.charProperties(V,ie);Z=T.UnicodeService.extractWidth(ve);const He=T.UnicodeService.extractShouldJoin(ve),Ue=He?T.UnicodeService.extractWidth(ie):0;if(ie=ve,ce&&this._onA11yChar.fire((0,b.stringFromCodePoint)(V)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Ue>ue){if(U){const Xe=q;let Ee=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,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),q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ue>0&&q instanceof v.BufferLine&&q.copyCellsFrom(Xe,Ee,0,Ue,!1);Ee<ue;)Xe.setCellFromCodepoint(Ee++,0,1,K)}else if(this._activeBuffer.x=ue-1,Z===2)continue}if(He&&this._activeBuffer.x){const Xe=q.getWidth(this._activeBuffer.x-1)?1:2;q.addCodepointToCell(this._activeBuffer.x-Xe,V,Z);for(let Ee=Z-Ue;--Ee>=0;)q.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(D&&(q.insertCells(this._activeBuffer.x,Z-Ue,this._activeBuffer.getNullCell(K)),q.getWidth(ue-1)===2&&q.setCellFromCodepoint(ue-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,K)),q.setCellFromCodepoint(this._activeBuffer.x++,V,Z,K),Z>0)for(;--Z;)q.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=ie,this._activeBuffer.x<ue&&O-B>0&&q.getWidth(this._activeBuffer.x)===0&&!q.hasContent(this._activeBuffer.x)&&q.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(M,B){return M.final!=="t"||M.prefix||M.intermediates?this._parser.registerCsiHandler(M,B):this._parser.registerCsiHandler(M,(O=>!W(O.params[0],this._optionsService.rawOptions.windowOptions)||B(O)))}registerDcsHandler(M,B){return this._parser.registerDcsHandler(M,new j.DcsHandler(B))}registerEscHandler(M,B){return this._parser.registerEscHandler(M,B)}registerOscHandler(M,B){return this._parser.registerOscHandler(M,new R.OscHandler(B))}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 M;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&&((M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&M.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const M=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-M),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(M=this._bufferService.cols-1){this._activeBuffer.x=Math.min(M,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(M,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=M,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=M,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(M,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+M,this._activeBuffer.y+B)}cursorUp(M){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,M.params[0]||1)):this._moveCursor(0,-(M.params[0]||1)),!0}cursorDown(M){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,M.params[0]||1)):this._moveCursor(0,M.params[0]||1),!0}cursorForward(M){return this._moveCursor(M.params[0]||1,0),!0}cursorBackward(M){return this._moveCursor(-(M.params[0]||1),0),!0}cursorNextLine(M){return this.cursorDown(M),this._activeBuffer.x=0,!0}cursorPrecedingLine(M){return this.cursorUp(M),this._activeBuffer.x=0,!0}cursorCharAbsolute(M){return this._setCursor((M.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(M){return this._setCursor(M.length>=2?(M.params[1]||1)-1:0,(M.params[0]||1)-1),!0}charPosAbsolute(M){return this._setCursor((M.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(M){return this._moveCursor(M.params[0]||1,0),!0}linePosAbsolute(M){return this._setCursor(this._activeBuffer.x,(M.params[0]||1)-1),!0}vPositionRelative(M){return this._moveCursor(0,M.params[0]||1),!0}hVPosition(M){return this.cursorPosition(M),!0}tabClear(M){const B=M.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(M){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=M.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(M){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=M.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(M){const B=M.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(M,B,O,V=!1,Z=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);re.replaceCells(B,O,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),V&&(re.isWrapped=!1)}_resetBufferLine(M,B=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+M),O.isWrapped=!1)}eraseInDisplay(M,B=!1){let O;switch(this._restrictCursor(this._bufferService.cols),M.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);O<this._bufferService.rows;O++)this._resetBufferLine(O,B);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,B);this._dirtyRowTracker.markDirty(0);break;case 3:const V=this._activeBuffer.lines.length-this._bufferService.rows;V>0&&(this._activeBuffer.lines.trimStart(V),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-V,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-V,0),this._onScroll.fire(0))}return!0}eraseInLine(M,B=!1){switch(this._restrictCursor(this._bufferService.cols),M.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(M){this._restrictCursor();let B=M.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-V+1;for(;B--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(M){this._restrictCursor();let B=M.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let V;for(V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-V;B--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(V,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(M){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,M.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(M){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,M.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(M){let B=M.params[0]||1;for(;B--;)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(M){let B=M.params[0]||1;for(;B--;)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(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);V.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);V.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);V.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);V.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(M){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(M.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(M){const B=this._parser.precedingJoinState;if(!B)return!0;const O=M.params[0]||1,V=T.UnicodeService.extractWidth(B),Z=this._activeBuffer.x-V,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ce=new Uint32Array(re.length*O);let ue=0;for(let D=0;D<re.length;){const K=re.codePointAt(D)||0;ce[ue++]=K,D+=K>65535?2:1}let U=ue;for(let D=1;D<O;++D)ce.copyWithin(U,0,ue),U+=ue;return this.print(ce,0,U),!0}sendDeviceAttributesPrimary(M){return M.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(M){return M.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(M.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(M){return(this._optionsService.rawOptions.termName+"").indexOf(M)===0}setMode(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(M){for(let B=0;B<M.length;B++)switch(M.params[B]){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(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(M){for(let B=0;B<M.length;B++)switch(M.params[B]){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(),M.params[B]===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(M,B){const O=this._coreService.decPrivateModes,{activeProtocol:V,activeEncoding:Z}=this._coreMouseService,re=this._coreService,{buffers:ce,cols:ue}=this._bufferService,{active:U,alt:D}=ce,K=this._optionsService.rawOptions,q=He=>He?1:2,ie=M.params[0];return ae=ie,ve=B?ie===2?4:ie===4?q(re.modes.insertMode):ie===12?3:ie===20?q(K.convertEol):0:ie===1?q(O.applicationCursorKeys):ie===3?K.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:ie===6?q(O.origin):ie===7?q(O.wraparound):ie===8?3:ie===9?q(V==="X10"):ie===12?q(K.cursorBlink):ie===25?q(!re.isCursorHidden):ie===45?q(O.reverseWraparound):ie===66?q(O.applicationKeypad):ie===67?4:ie===1e3?q(V==="VT200"):ie===1002?q(V==="DRAG"):ie===1003?q(V==="ANY"):ie===1004?q(O.sendFocus):ie===1005?4:ie===1006?q(Z==="SGR"):ie===1015?4:ie===1016?q(Z==="SGR_PIXELS"):ie===1048?1:ie===47||ie===1047||ie===1049?q(U===D):ie===2004?q(O.bracketedPasteMode):0,re.triggerDataEvent(`${d.C0.ESC}[${B?"":"?"}${ae};${ve}$y`),!0;var ae,ve}_updateAttrColor(M,B,O,V,Z){return B===2?(M|=50331648,M&=-16777216,M|=k.AttributeData.fromColorRGB([O,V,Z])):B===5&&(M&=-50331904,M|=33554432|255&O),M}_extractColor(M,B,O){const V=[0,0,-1,0,0,0];let Z=0,re=0;do{if(V[re+Z]=M.params[B+re],M.hasSubParams(B+re)){const ce=M.getSubParams(B+re);let ue=0;do V[1]===5&&(Z=1),V[re+ue+1+Z]=ce[ue];while(++ue<ce.length&&ue+re+1+Z<V.length);break}if(V[1]===5&&re+Z>=2||V[1]===2&&re+Z>=5)break;V[1]&&(Z=1)}while(++re+B<M.length&&re+Z<V.length);for(let ce=2;ce<V.length;++ce)V[ce]===-1&&(V[ce]=0);switch(V[0]){case 38:O.fg=this._updateAttrColor(O.fg,V[1],V[3],V[4],V[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,V[1],V[3],V[4],V[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,V[1],V[3],V[4],V[5])}return re}_processUnderline(M,B){B.extended=B.extended.clone(),(!~M||M>5)&&(M=1),B.extended.underlineStyle=M,B.fg|=268435456,M===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(M){M.fg=v.DEFAULT_ATTR_DATA.fg,M.bg=v.DEFAULT_ATTR_DATA.bg,M.extended=M.extended.clone(),M.extended.underlineStyle=0,M.extended.underlineColor&=-67108864,M.updateExtended()}charAttributes(M){if(M.length===1&&M.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=M.length;let O;const V=this._curAttrData;for(let Z=0;Z<B;Z++)O=M.params[Z],O>=30&&O<=37?(V.fg&=-50331904,V.fg|=16777216|O-30):O>=40&&O<=47?(V.bg&=-50331904,V.bg|=16777216|O-40):O>=90&&O<=97?(V.fg&=-50331904,V.fg|=16777224|O-90):O>=100&&O<=107?(V.bg&=-50331904,V.bg|=16777224|O-100):O===0?this._processSGR0(V):O===1?V.fg|=134217728:O===3?V.bg|=67108864:O===4?(V.fg|=268435456,this._processUnderline(M.hasSubParams(Z)?M.getSubParams(Z)[0]:1,V)):O===5?V.fg|=536870912:O===7?V.fg|=67108864:O===8?V.fg|=1073741824:O===9?V.fg|=2147483648:O===2?V.bg|=134217728:O===21?this._processUnderline(2,V):O===22?(V.fg&=-134217729,V.bg&=-134217729):O===23?V.bg&=-67108865:O===24?(V.fg&=-268435457,this._processUnderline(0,V)):O===25?V.fg&=-536870913:O===27?V.fg&=-67108865:O===28?V.fg&=-1073741825:O===29?V.fg&=2147483647:O===39?(V.fg&=-67108864,V.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):O===49?(V.bg&=-67108864,V.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?Z+=this._extractColor(M,Z,V):O===53?V.bg|=1073741824:O===55?V.bg&=-1073741825:O===59?(V.extended=V.extended.clone(),V.extended.underlineColor=-1,V.updateExtended()):O===100?(V.fg&=-67108864,V.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,V.bg&=-67108864,V.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(M){switch(M.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${B};${O}R`)}return!0}deviceStatusPrivate(M){if(M.params[0]===6){const B=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${B};${O}R`)}return!0}softReset(M){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.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(M){const B=M.params[0]||1;switch(B){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 O=B%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(M){const B=M.params[0]||1;let O;return(M.length<2||(O=M.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(M){if(!W(M.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=M.length>1?M.params[1]:0;switch(M.params[0]){case 14:B!==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(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(M){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(M){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(M){return this._windowTitle=M,this._onTitleChange.fire(M),!0}setIconName(M){return this._iconName=M,!0}setOrReportIndexedColor(M){const B=[],O=M.split(";");for(;O.length>1;){const V=O.shift(),Z=O.shift();if(/^\d+$/.exec(V)){const re=parseInt(V);if(ee(re))if(Z==="?")B.push({type:0,index:re});else{const ce=(0,L.parseColor)(Z);ce&&B.push({type:1,index:re,color:ce})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(M){const B=M.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(M,B){this._getCurrentLinkId()&&this._finishHyperlink();const O=M.split(":");let V;const Z=O.findIndex((re=>re.startsWith("id=")));return Z!==-1&&(V=O[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:V,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(M,B){const O=M.split(";");for(let V=0;V<O.length&&!(B>=this._specialColors.length);++V,++B)if(O[V]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const Z=(0,L.parseColor)(O[V]);Z&&this._onColor.fire([{type:1,index:this._specialColors[B],color:Z}])}return!0}setOrReportFgColor(M){return this._setOrReportSpecialColor(M,0)}setOrReportBgColor(M){return this._setOrReportSpecialColor(M,1)}setOrReportCursorColor(M){return this._setOrReportSpecialColor(M,2)}restoreIndexedColor(M){if(!M)return this._onColor.fire([{type:2}]),!0;const B=[],O=M.split(";");for(let V=0;V<O.length;++V)if(/^\d+$/.exec(O[V])){const Z=parseInt(O[V]);ee(Z)&&B.push({type:2,index:Z})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(M){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(M){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(M){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(M){return M.length!==2?(this.selectDefaultCharset(),!0):(M[0]==="/"||this._charsetService.setgCharset($[M[0]],_.CHARSETS[M[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 M=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,M,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(M){return this._charsetService.setgLevel(M),!0}screenAlignmentPattern(){const M=new x.CellData;M.content=4194373,M.fg=this._curAttrData.fg,M.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const O=this._activeBuffer.ybase+this._activeBuffer.y+B,V=this._activeBuffer.lines.get(O);V&&(V.fill(M),V.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(M,B){const O=this._bufferService.buffer,V=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${Z}${d.C0.ESC}\\`),!0))(M==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:M==='"p'?'P1$r61;1"p':M==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:M==="m"?"P1$r0m":M===" q"?`P1$r${{block:2,underline:4,bar:6}[V.cursorStyle]-(V.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(M,B){this._dirtyRowTracker.markRangeDirty(M,B)}}a.InputHandler=G;let Y=class{constructor(z){this._bufferService=z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(z){z<this.start?this.start=z:z>this.end&&(this.end=z)}markRangeDirty(z,M){z>M&&(J=z,z=M,M=J),z<this.start&&(this.start=z),M>this.end&&(this.end=M)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ee(z){return 0<=z&&z<256}Y=h([g(0,P.IBufferService)],Y)},844:(f,a)=>{function c(h){for(const g of h)g.dispose();h.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 h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const g=this._disposables.indexOf(h);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(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},a.toDisposable=function(h){return{dispose:h}},a.disposeArray=c,a.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,d,_){this._data[g]||(this._data[g]={}),this._data[g][d]=_}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(h,g,d,_,S){this._data.get(h,g)||this._data.set(h,g,new c),this._data.get(h,g).set(d,_,S)}get(h,g,d,_){var S;return(S=this._data.get(h,g))==null?void 0:S.get(d,_)}clear(){this._data.clear()}}},6114:(f,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 c=a.isNode?"node":navigator.userAgent,h=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),a.isIpad=h==="iPad",a.isIphone=h==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),a.isLinux=h.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const g=this._getKey(h);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,g){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let g=0,d=this._array.length-1;for(;d>=g;){let _=g+d>>1;const S=this._getKey(this._array[_]);if(S>h)d=_-1;else{if(!(S<h)){for(;_>0&&this._getKey(this._array[_-1])===h;)_--;return _}g=_+1}}return g}}},7226:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const h=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let E=0,b=0,v=S.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),b=Math.max(E,b),y=S.timeRemaining(),1.5*b>y)return v-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-E))}ms`),void this._start();v=y}this.clear()}}class d extends g{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const E=Date.now()+S;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}a.PriorityTaskQueue=d,a.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const h=c(643);a.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),_=d==null?void 0:d.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&_&&(S.isWrapped=_[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&_[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=h},9092:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const h=c(6349),g=c(7226),d=c(3734),_=c(8437),S=c(4634),E=c(511),b=c(643),v=c(4863),y=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(p,x,k){this._hasScrollback=p,this._optionsService=x,this._bufferService=k,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=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.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 h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,x){return new _.BufferLine(this._bufferService.cols,this.getNullCell(p),x)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&p<this._rows}_getCorrectBufferLength(p){if(!this._hasScrollback)return p;const x=p+this._optionsService.rawOptions.scrollback;return x>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:x}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=_.DEFAULT_ATTR_DATA);let x=this._rows;for(;x--;)this.lines.push(this.getBlankLine(p))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(p,x){const k=this.getNullCell(_.DEFAULT_ATTR_DATA);let P=0;const T=this._getCorrectBufferLength(x);if(T>this.lines.maxLength&&(this.lines.maxLength=T),this.lines.length>0){if(this._cols<p)for(let j=0;j<this.lines.length;j++)P+=+this.lines.get(j).resize(p,k);let R=0;if(this._rows<x)for(let j=this._rows;j<x;j++)this.lines.length<x+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(p,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(p,k)));else for(let j=this._rows;j>x;j--)this.lines.length>x+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(T<this.lines.maxLength){const j=this.lines.length-T;j>0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=T}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,x-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(p,x),this._cols>p))for(let R=0;R<this.lines.length;R++)P+=+this.lines.get(R).resize(p,k);this._cols=p,this._rows=x,this._memoryCleanupQueue.clear(),P>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let x=0;for(;this._memoryCleanupPosition<this.lines.length;)if(x+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),x>100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,x){this._cols!==p&&(p>this._cols?this._reflowLarger(p,x):this._reflowSmaller(p,x))}_reflowLarger(p,x){const k=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(k.length>0){const P=(0,S.reflowLargerCreateNewLayout)(this.lines,k);(0,S.reflowLargerApplyNewLayout)(this.lines,P.layout),this._reflowLargerAdjustViewport(p,x,P.countRemoved)}}_reflowLargerAdjustViewport(p,x,k){const P=this.getNullCell(_.DEFAULT_ATTR_DATA);let T=k;for(;T-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<x&&this.lines.push(new _.BufferLine(p,P))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(p,x){const k=this.getNullCell(_.DEFAULT_ATTR_DATA),P=[];let T=0;for(let R=this.lines.length-1;R>=0;R--){let j=this.lines.get(R);if(!j||!j.isWrapped&&j.getTrimmedLength()<=p)continue;const L=[j];for(;j.isWrapped&&R>0;)j=this.lines.get(--R),L.unshift(j);const $=this.ybase+this.y;if($>=R&&$<R+L.length)continue;const F=L[L.length-1].getTrimmedLength(),W=(0,S.reflowSmallerGetNewLineLengths)(L,this._cols,p),H=W.length-L.length;let J;J=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 G=[];for(let O=0;O<H;O++){const V=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);G.push(V)}G.length>0&&(P.push({start:R+L.length+T,newLines:G}),T+=G.length),L.push(...G);let Y=W.length-1,ee=W[Y];ee===0&&(Y--,ee=W[Y]);let z=L.length-H-1,M=F;for(;z>=0;){const O=Math.min(M,ee);if(L[Y]===void 0)break;if(L[Y].copyCellsFrom(L[z],M-O,ee-O,O,!0),ee-=O,ee===0&&(Y--,ee=W[Y]),M-=O,M===0){z--;const V=Math.max(z,0);M=(0,S.getWrappedLineTrimmedLength)(L,V,this._cols)}}for(let O=0;O<L.length;O++)W[O]<p&&L[O].setCell(W[O],k);let B=H-J;for(;B-- >0;)this.ybase===0?this.y<x-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+T)-x&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+x-1)}if(P.length>0){const R=[],j=[];for(let Y=0;Y<this.lines.length;Y++)j.push(this.lines.get(Y));const L=this.lines.length;let $=L-1,F=0,W=P[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+T);let H=0;for(let Y=Math.min(this.lines.maxLength-1,L+T-1);Y>=0;Y--)if(W&&W.start>$+H){for(let ee=W.newLines.length-1;ee>=0;ee--)this.lines.set(Y--,W.newLines[ee]);Y++,R.push({index:$+1,amount:W.newLines.length}),H+=W.newLines.length,W=P[++F]}else this.lines.set(Y,j[$--]);let J=0;for(let Y=R.length-1;Y>=0;Y--)R[Y].index+=J,this.lines.onInsertEmitter.fire(R[Y]),J+=R[Y].amount;const G=Math.max(0,L+T-this.lines.maxLength);G>0&&this.lines.onTrimEmitter.fire(G)}}translateBufferLineToString(p,x,k=0,P){const T=this.lines.get(p);return T?T.translateToString(x,k,P):""}getWrappedRangeForLine(p){let x=p,k=p;for(;x>0&&this.lines.get(x).isWrapped;)x--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:x,last:k}}setupTabStops(p){for(p!=null?this.tabs[p]||(p=this.prevStop(p)):(this.tabs={},p=0);p<this._cols;p+=this._optionsService.rawOptions.tabStopWidth)this.tabs[p]=!0}prevStop(p){for(p==null&&(p=this.x);!this.tabs[--p]&&p>0;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p<this._cols;);return p>=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].line===p&&(this.markers[x].dispose(),this.markers.splice(x--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].dispose(),this.markers.splice(p--,1);this._isClearing=!1}addMarker(p){const x=new v.Marker(p);return this.markers.push(x),x.register(this.lines.onTrim((k=>{x.line-=k,x.line<0&&x.dispose()}))),x.register(this.lines.onInsert((k=>{x.line>=k.index&&(x.line+=k.amount)}))),x.register(this.lines.onDelete((k=>{x.line>=k.index&&x.line<k.index+k.amount&&x.dispose(),x.line>k.index&&(x.line-=k.amount)}))),x.register(x.onDispose((()=>this._removeMarker(x)))),x}_removeMarker(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const h=c(3734),g=c(511),d=c(643),_=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let S=0;class E{constructor(v,y,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const x=y||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let k=0;k<v;++k)this.setCell(k,x);this.length=v}get(v){const y=this._data[3*v+0],p=2097151&y;return[this._data[3*v+1],2097152&y?this._combined[v]:p?(0,_.stringFromCodePoint)(p):"",y>>22,2097152&y?this._combined[v].charCodeAt(this._combined[v].length-1):p]}set(v,y){this._data[3*v+1]=y[d.CHAR_DATA_ATTR_INDEX],y[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=y[1],this._data[3*v+0]=2097152|v|y[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=y[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const y=this._data[3*v+0];return 2097152&y?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&y}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const y=this._data[3*v+0];return 2097152&y?this._combined[v]:2097151&y?(0,_.stringFromCodePoint)(2097151&y):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,y){return S=3*v,y.content=this._data[S+0],y.fg=this._data[S+1],y.bg=this._data[S+2],2097152&y.content&&(y.combinedData=this._combined[v]),268435456&y.bg&&(y.extended=this._extendedAttrs[v]),y}setCell(v,y){2097152&y.content&&(this._combined[v]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=y.content,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}setCellFromCodepoint(v,y,p,x){268435456&x.bg&&(this._extendedAttrs[v]=x.extended),this._data[3*v+0]=y|p<<22,this._data[3*v+1]=x.fg,this._data[3*v+2]=x.bg}addCodepointToCell(v,y,p){let x=this._data[3*v+0];2097152&x?this._combined[v]+=(0,_.stringFromCodePoint)(y):2097151&x?(this._combined[v]=(0,_.stringFromCodePoint)(2097151&x)+(0,_.stringFromCodePoint)(y),x&=-2097152,x|=2097152):x=y|4194304,p&&(x&=-12582913,x|=p<<22),this._data[3*v+0]=x}insertCells(v,y,p){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),y<this.length-v){const x=new g.CellData;for(let k=this.length-v-y-1;k>=0;--k)this.setCell(v+y+k,this.loadCell(v+k,x));for(let k=0;k<y;++k)this.setCell(v+k,p)}else for(let x=v;x<this.length;++x)this.setCell(x,p);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,p)}deleteCells(v,y,p){if(v%=this.length,y<this.length-v){const x=new g.CellData;for(let k=0;k<this.length-v-y;++k)this.setCell(v+k,this.loadCell(v+y+k,x));for(let k=this.length-y;k<this.length;++k)this.setCell(k,p)}else for(let x=v;x<this.length;++x)this.setCell(x,p);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,p)}replaceCells(v,y,p,x=!1){if(x)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,p),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,p);v<y&&v<this.length;)this.isProtected(v)||this.setCell(v,p),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,p);v<y&&v<this.length;)this.setCell(v++,p)}resize(v,y){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const p=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const x=new Uint32Array(p);x.set(this._data),this._data=x}for(let x=this.length;x<v;++x)this.setCell(x,y)}else{this._data=this._data.subarray(0,p);const x=Object.keys(this._combined);for(let P=0;P<x.length;P++){const T=parseInt(x[P],10);T>=v&&delete this._combined[T]}const k=Object.keys(this._extendedAttrs);for(let P=0;P<k.length;P++){const T=parseInt(k[P],10);T>=v&&delete this._extendedAttrs[T]}}return this.length=v,4*p*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,y=!1){if(y)for(let p=0;p<this.length;++p)this.isProtected(p)||this.setCell(p,v);else{this._combined={},this._extendedAttrs={};for(let p=0;p<this.length;++p)this.setCell(p,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const y in v._combined)this._combined[y]=v._combined[y];this._extendedAttrs={};for(const y in v._extendedAttrs)this._extendedAttrs[y]=v._extendedAttrs[y];this.isWrapped=v.isWrapped}clone(){const v=new E(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const y in this._combined)v._combined[y]=this._combined[y];for(const y in this._extendedAttrs)v._extendedAttrs[y]=this._extendedAttrs[y];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,y,p,x,k){const P=v._data;if(k)for(let R=x-1;R>=0;R--){for(let j=0;j<3;j++)this._data[3*(p+R)+j]=P[3*(y+R)+j];268435456&P[3*(y+R)+2]&&(this._extendedAttrs[p+R]=v._extendedAttrs[y+R])}else for(let R=0;R<x;R++){for(let j=0;j<3;j++)this._data[3*(p+R)+j]=P[3*(y+R)+j];268435456&P[3*(y+R)+2]&&(this._extendedAttrs[p+R]=v._extendedAttrs[y+R])}const T=Object.keys(v._combined);for(let R=0;R<T.length;R++){const j=parseInt(T[R],10);j>=y&&(this._combined[j-y+p]=v._combined[j])}}translateToString(v,y,p,x){y=y??0,p=p??this.length,v&&(p=Math.min(p,this.getTrimmedLength())),x&&(x.length=0);let k="";for(;y<p;){const P=this._data[3*y+0],T=2097151&P,R=2097152&P?this._combined[y]:T?(0,_.stringFromCodePoint)(T):d.WHITESPACE_CELL_CHAR;if(k+=R,x)for(let j=0;j<R.length;++j)x.push(y);y+=P>>22||1}return x&&x.push(y),k}}a.BufferLine=E},4841:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,a)=>{function c(h,g,d){if(g===h.length-1)return h[g].getTrimmedLength();const _=!h[g].hasContent(d-1)&&h[g].getWidth(d-1)===1,S=h[g+1].getWidth(0)===2;return _&&S?d-1:d}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(h,g,d,_,S){const E=[];for(let b=0;b<h.length-1;b++){let v=b,y=h.get(++v);if(!y.isWrapped)continue;const p=[h.get(b)];for(;v<h.length&&y.isWrapped;)p.push(y),y=h.get(++v);if(_>=b&&_<v){b+=p.length-1;continue}let x=0,k=c(p,x,g),P=1,T=0;for(;P<p.length;){const j=c(p,P,g),L=j-T,$=d-k,F=Math.min(L,$);p[x].copyCellsFrom(p[P],T,k,F,!1),k+=F,k===d&&(x++,k=0),T+=F,T===j&&(P++,T=0),k===0&&x!==0&&p[x-1].getWidth(d-1)===2&&(p[x].copyCellsFrom(p[x-1],d-1,k++,1,!1),p[x-1].setCell(d-1,S))}p[x].replaceCells(k,d,S);let R=0;for(let j=p.length-1;j>0&&(j>x||p[j].getTrimmedLength()===0);j--)R++;R>0&&(E.push(b+p.length-R),E.push(R)),b+=p.length-1}return E},a.reflowLargerCreateNewLayout=function(h,g){const d=[];let _=0,S=g[_],E=0;for(let b=0;b<h.length;b++)if(S===b){const v=g[++_];h.onDeleteEmitter.fire({index:b-E,amount:v}),b+=v-1,E+=v,S=g[++_]}else d.push(b);return{layout:d,countRemoved:E}},a.reflowLargerApplyNewLayout=function(h,g){const d=[];for(let _=0;_<g.length;_++)d.push(h.get(g[_]));for(let _=0;_<d.length;_++)h.set(_,d[_]);h.length=g.length},a.reflowSmallerGetNewLineLengths=function(h,g,d){const _=[],S=h.map(((y,p)=>c(h,p,g))).reduce(((y,p)=>y+p));let E=0,b=0,v=0;for(;v<S;){if(S-v<d){_.push(S-v);break}E+=d;const y=c(h,b,g);E>y&&(E-=y,b++);const p=h[b].getWidth(E-1)===2;p&&E--;const x=p?d-1:d;_.push(x),v+=x}return _},a.getWrappedLineTrimmedLength=c},5295:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const h=c(8460),g=c(844),d=c(9092);class _ extends g.Disposable{constructor(E,b){super(),this._optionsService=E,this._bufferService=b,this._onBufferActivate=this.register(new h.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(E,b){this._normal.resize(E,b),this._alt.resize(E,b),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}a.BufferSet=_},511:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const h=c(482),g=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const b=new _;return b.setFromCharData(E),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(E[g.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(E[g.CHAR_DATA_CHAR_INDEX].length===2){const v=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const y=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(v-55296)+y-56320+65536|E[g.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[g.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=E[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=_},643:(f,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:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const h=c(8460),g=c(844);class d{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new h.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(S){return this._disposables.push(S),S}}a.Marker=d,d._nextId=1},7116:(f,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:(f,a)=>{var c,h,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
504
- `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(a.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(h||(a.C1=h={})),(function(d){d.ST=`${c.ESC}\\`})(g||(a.C1_ESCAPED=g={}))},7399:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const h=c(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(d,_,S,E){const b={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?b.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?b.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?b.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(b.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:b.key=d.ctrlKey?"\b":h.C0.DEL,d.altKey&&(b.key=h.C0.ESC+b.key);break;case 9:if(d.shiftKey){b.key=h.C0.ESC+"[Z";break}b.key=h.C0.HT,b.cancel=!0;break;case 13:b.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,b.cancel=!0;break;case 27:b.key=h.C0.ESC,d.altKey&&(b.key=h.C0.ESC+h.C0.ESC),b.cancel=!0;break;case 37:if(d.metaKey)break;v?(b.key=h.C0.ESC+"[1;"+(v+1)+"D",b.key===h.C0.ESC+"[1;3D"&&(b.key=h.C0.ESC+(S?"b":"[1;5D"))):b.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(b.key=h.C0.ESC+"[1;"+(v+1)+"C",b.key===h.C0.ESC+"[1;3C"&&(b.key=h.C0.ESC+(S?"f":"[1;5C"))):b.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(b.key=h.C0.ESC+"[1;"+(v+1)+"A",S||b.key!==h.C0.ESC+"[1;3A"||(b.key=h.C0.ESC+"[1;5A")):b.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(b.key=h.C0.ESC+"[1;"+(v+1)+"B",S||b.key!==h.C0.ESC+"[1;3B"||(b.key=h.C0.ESC+"[1;5B")):b.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(b.key=h.C0.ESC+"[2~");break;case 46:b.key=v?h.C0.ESC+"[3;"+(v+1)+"~":h.C0.ESC+"[3~";break;case 36:b.key=v?h.C0.ESC+"[1;"+(v+1)+"H":_?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:b.key=v?h.C0.ESC+"[1;"+(v+1)+"F":_?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?b.type=2:d.ctrlKey?b.key=h.C0.ESC+"[5;"+(v+1)+"~":b.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?b.type=3:d.ctrlKey?b.key=h.C0.ESC+"[6;"+(v+1)+"~":b.key=h.C0.ESC+"[6~";break;case 112:b.key=v?h.C0.ESC+"[1;"+(v+1)+"P":h.C0.ESC+"OP";break;case 113:b.key=v?h.C0.ESC+"[1;"+(v+1)+"Q":h.C0.ESC+"OQ";break;case 114:b.key=v?h.C0.ESC+"[1;"+(v+1)+"R":h.C0.ESC+"OR";break;case 115:b.key=v?h.C0.ESC+"[1;"+(v+1)+"S":h.C0.ESC+"OS";break;case 116:b.key=v?h.C0.ESC+"[15;"+(v+1)+"~":h.C0.ESC+"[15~";break;case 117:b.key=v?h.C0.ESC+"[17;"+(v+1)+"~":h.C0.ESC+"[17~";break;case 118:b.key=v?h.C0.ESC+"[18;"+(v+1)+"~":h.C0.ESC+"[18~";break;case 119:b.key=v?h.C0.ESC+"[19;"+(v+1)+"~":h.C0.ESC+"[19~";break;case 120:b.key=v?h.C0.ESC+"[20;"+(v+1)+"~":h.C0.ESC+"[20~";break;case 121:b.key=v?h.C0.ESC+"[21;"+(v+1)+"~":h.C0.ESC+"[21~";break;case 122:b.key=v?h.C0.ESC+"[23;"+(v+1)+"~":h.C0.ESC+"[23~";break;case 123:b.key=v?h.C0.ESC+"[24;"+(v+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(S&&!E||!d.altKey||d.metaKey)!S||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?b.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(b.key=h.C0.US),d.key==="@"&&(b.key=h.C0.NUL)):d.keyCode===65&&(b.type=1);else{const y=g[d.keyCode],p=y==null?void 0:y[d.shiftKey?1:0];if(p)b.key=h.C0.ESC+p;else if(d.keyCode>=65&&d.keyCode<=90){const x=d.ctrlKey?d.keyCode-64:d.keyCode+32;let k=String.fromCharCode(x);d.shiftKey&&(k=k.toUpperCase()),b.key=h.C0.ESC+k}else if(d.keyCode===32)b.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let x=d.code.slice(3,4);d.shiftKey||(x=x.toLowerCase()),b.key=h.C0.ESC+x,b.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?b.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?b.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?b.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?b.key=h.C0.DEL:d.keyCode===219?b.key=h.C0.ESC:d.keyCode===220?b.key=h.C0.FS:d.keyCode===221&&(b.key=h.C0.GS)}return b}},482:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,h=0,g=c.length){let d="";for(let _=h;_<g;++_){let S=c[_];S>65535?(S-=65536,d+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):d+=String.fromCharCode(S)}return d},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const g=c.length;if(!g)return 0;let d=0,_=0;if(this._interim){const S=c.charCodeAt(_++);56320<=S&&S<=57343?h[d++]=1024*(this._interim-55296)+S-56320+65536:(h[d++]=this._interim,h[d++]=S),this._interim=0}for(let S=_;S<g;++S){const E=c.charCodeAt(S);if(55296<=E&&E<=56319){if(++S>=g)return this._interim=E,d;const b=c.charCodeAt(S);56320<=b&&b<=57343?h[d++]=1024*(E-55296)+b-56320+65536:(h[d++]=E,h[d++]=b)}else E!==65279&&(h[d++]=E)}return d}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const g=c.length;if(!g)return 0;let d,_,S,E,b=0,v=0,y=0;if(this.interim[0]){let k=!1,P=this.interim[0];P&=(224&P)==192?31:(240&P)==224?15:7;let T,R=0;for(;(T=63&this.interim[++R])&&R<4;)P<<=6,P|=T;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=j-R;for(;y<L;){if(y>=g)return 0;if(T=c[y++],(192&T)!=128){y--,k=!0;break}this.interim[R++]=T,P<<=6,P|=63&T}k||(j===2?P<128?y--:h[b++]=P:j===3?P<2048||P>=55296&&P<=57343||P===65279||(h[b++]=P):P<65536||P>1114111||(h[b++]=P)),this.interim.fill(0)}const p=g-4;let x=y;for(;x<g;){for(;!(!(x<p)||128&(d=c[x])||128&(_=c[x+1])||128&(S=c[x+2])||128&(E=c[x+3]));)h[b++]=d,h[b++]=_,h[b++]=S,h[b++]=E,x+=4;if(d=c[x++],d<128)h[b++]=d;else if((224&d)==192){if(x>=g)return this.interim[0]=d,b;if(_=c[x++],(192&_)!=128){x--;continue}if(v=(31&d)<<6|63&_,v<128){x--;continue}h[b++]=v}else if((240&d)==224){if(x>=g)return this.interim[0]=d,b;if(_=c[x++],(192&_)!=128){x--;continue}if(x>=g)return this.interim[0]=d,this.interim[1]=_,b;if(S=c[x++],(192&S)!=128){x--;continue}if(v=(15&d)<<12|(63&_)<<6|63&S,v<2048||v>=55296&&v<=57343||v===65279)continue;h[b++]=v}else if((248&d)==240){if(x>=g)return this.interim[0]=d,b;if(_=c[x++],(192&_)!=128){x--;continue}if(x>=g)return this.interim[0]=d,this.interim[1]=_,b;if(S=c[x++],(192&S)!=128){x--;continue}if(x>=g)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=S,b;if(E=c[x++],(192&E)!=128){x--;continue}if(v=(7&d)<<18|(63&_)<<12|(63&S)<<6|63&E,v<65536||v>1114111)continue;h[b++]=v}}return b}}},225:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const h=c(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]],d=[[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 S=0;S<g.length;++S)_.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?_[S]:(function(E,b){let v,y=0,p=b.length-1;if(E<b[0][0]||E>b[p][1])return!1;for(;p>=y;)if(v=y+p>>1,E>b[v][1])y=v+1;else{if(!(E<b[v][0]))return!0;p=v-1}return!1})(S,d)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,E){let b=this.wcwidth(S),v=b===0&&E!==0;if(v){const y=h.UnicodeService.extractWidth(E);y===0?v=!1:y>b&&(b=y)}return h.UnicodeService.createPropertyValue(0,b,v)}}},5981:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const h=c(8460),g=c(844);class d extends g.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,E){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+=S.length,this._writeBuffer.push(S),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(E)}_innerWrite(S=0,E=!0){const b=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],y=this._action(v,E);if(y){const x=k=>Date.now()-b>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(b,k);return void y.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(x)}const p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-b>=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=d},5941:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\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})$/,h=/^[\da-f]+$/;function g(d,_){const S=d.toString(16),E=S.length<2?"0"+S:S;switch(_){case 4:return S[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}a.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const S=c.exec(_);if(S){const E=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/E*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/E*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/E*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),h.exec(_)&&[3,6,9,12].includes(_.length))){const S=_.length/3,E=[0,0,0];for(let b=0;b<3;++b){const v=parseInt(_.slice(S*b,S*b+S),16);E[b]=S===1?v<<4:S===2?v:S===3?v>>4:v>>8}return E}},a.toRgbString=function(d,_=16){const[S,E,b]=d;return`rgb:${g(S,_)}/${g(E,_)}/${g(b,_)}`}},5770:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const h=c(482),g=c(8742),d=c(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(E,b){this._handlers[E]===void 0&&(this._handlers[E]=[]);const v=this._handlers[E];return v.push(b),{dispose:()=>{const y=v.indexOf(b);y!==-1&&v.splice(y,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(E,b){if(this.reset(),this._ident=E,this._active=this._handlers[E]||_,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(E,b,v){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(E,b,v);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(E,b,v))}unhook(E,b=!0){if(this._active.length){let v=!1,y=this._active.length-1,p=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,v=b,p=this._stack.fallThrough,this._stack.paused=!1),!p&&v===!1){for(;y>=0&&(v=this._active[y].unhook(E),v!==!0);y--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,v;y--}for(;y>=0;y--)if(v=this._active[y].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",E);this._active=_,this._ident=0}};const S=new g.Params;S.addParam(0),a.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=S,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():S,this._data="",this._hitLimit=!1}put(E,b,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(E,b,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let b=!1;if(this._hitLimit)b=!1;else if(E&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then((v=>(this._params=S,this._data="",this._hitLimit=!1,v)));return this._params=S,this._data="",this._hitLimit=!1,b}}},2015:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const h=c(844),g=c(8742),d=c(6242),_=c(6351);class S{constructor(y){this.table=new Uint8Array(y)}setDefault(y,p){this.table.fill(y<<4|p)}add(y,p,x,k){this.table[p<<8|y]=x<<4|k}addMany(y,p,x,k){for(let P=0;P<y.length;P++)this.table[p<<8|y[P]]=x<<4|k}}a.TransitionTable=S;const E=160;a.VT500_TRANSITION_TABLE=(function(){const v=new S(4095),y=Array.apply(null,Array(256)).map(((R,j)=>j)),p=(R,j)=>y.slice(R,j),x=p(32,127),k=p(0,24);k.push(25),k.push.apply(k,p(28,32));const P=p(0,14);let T;for(T in v.setDefault(1,0),v.addMany(x,0,2,0),P)v.addMany([24,26,153,154],T,3,0),v.addMany(p(128,144),T,3,0),v.addMany(p(144,152),T,3,0),v.add(156,T,0,0),v.add(27,T,11,1),v.add(157,T,4,8),v.addMany([152,158,159],T,0,7),v.add(155,T,11,3),v.add(144,T,11,9);return v.addMany(k,0,3,0),v.addMany(k,1,3,1),v.add(127,1,0,1),v.addMany(k,8,0,8),v.addMany(k,3,3,3),v.add(127,3,0,3),v.addMany(k,4,3,4),v.add(127,4,0,4),v.addMany(k,6,3,6),v.addMany(k,5,3,5),v.add(127,5,0,5),v.addMany(k,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(x,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(p(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(x,7,0,7),v.addMany(k,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(p(64,127),3,7,0),v.addMany(p(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(p(48,60),4,8,4),v.addMany(p(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(p(32,64),6,0,6),v.add(127,6,0,6),v.addMany(p(64,127),6,0,0),v.addMany(p(32,48),3,9,5),v.addMany(p(32,48),5,9,5),v.addMany(p(48,64),5,0,6),v.addMany(p(64,127),5,7,0),v.addMany(p(32,48),4,9,5),v.addMany(p(32,48),1,9,2),v.addMany(p(32,48),2,9,2),v.addMany(p(48,127),2,10,0),v.addMany(p(48,80),1,10,0),v.addMany(p(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(p(96,127),1,10,0),v.add(80,1,11,9),v.addMany(k,9,0,9),v.add(127,9,0,9),v.addMany(p(28,32),9,0,9),v.addMany(p(32,48),9,9,12),v.addMany(p(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(k,11,0,11),v.addMany(p(32,128),11,0,11),v.addMany(p(28,32),11,0,11),v.addMany(k,10,0,10),v.add(127,10,0,10),v.addMany(p(28,32),10,0,10),v.addMany(p(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(p(32,48),10,9,12),v.addMany(k,12,0,12),v.add(127,12,0,12),v.addMany(p(28,32),12,0,12),v.addMany(p(32,48),12,9,12),v.addMany(p(48,64),12,0,11),v.addMany(p(64,127),12,12,13),v.addMany(p(64,127),10,12,13),v.addMany(p(64,127),9,12,13),v.addMany(k,13,13,13),v.addMany(x,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(E,0,2,0),v.add(E,8,5,8),v.add(E,6,0,6),v.add(E,11,0,11),v.add(E,13,13,13),v})();class b extends h.Disposable{constructor(y=a.VT500_TRANSITION_TABLE){super(),this._transitions=y,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=(p,x,k)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,x)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,p=[64,126]){let x=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=y.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let P=0;P<y.intermediates.length;++P){const T=y.intermediates.charCodeAt(P);if(32>T||T>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=T}}if(y.final.length!==1)throw new Error("final must be a single byte");const k=y.final.charCodeAt(0);if(p[0]>k||k>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return x<<=8,x|=k,x}identToString(y){const p=[];for(;y;)p.push(String.fromCharCode(255&y)),y>>=8;return p.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,p){const x=this._identifier(y,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const k=this._escHandlers[x];return k.push(p),{dispose:()=>{const P=k.indexOf(p);P!==-1&&k.splice(P,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,p){this._executeHandlers[y.charCodeAt(0)]=p}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,p){const x=this._identifier(y);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const k=this._csiHandlers[x];return k.push(p),{dispose:()=>{const P=k.indexOf(p);P!==-1&&k.splice(P,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,p){return this._dcsParser.registerHandler(this._identifier(y),p)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,p){return this._oscParser.registerHandler(y,p)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,p,x,k,P){this._parseStack.state=y,this._parseStack.handlers=p,this._parseStack.handlerPos=x,this._parseStack.transition=k,this._parseStack.chunkPos=P}parse(y,p,x){let k,P=0,T=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(x===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const j=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(x===!1&&L>-1){for(;L>=0&&(k=j[L](this._params),k!==!0);L--)if(k instanceof Promise)return this._parseStack.handlerPos=L,k}this._parseStack.handlers=[];break;case 4:if(x===!1&&L>-1){for(;L>=0&&(k=j[L](),k!==!0);L--)if(k instanceof Promise)return this._parseStack.handlerPos=L,k}this._parseStack.handlers=[];break;case 6:if(P=y[this._parseStack.chunkPos],k=this._dcsParser.unhook(P!==24&&P!==26,x),k)return k;P===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(P=y[this._parseStack.chunkPos],k=this._oscParser.end(P!==24&&P!==26,x),k)return k;P===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=R;j<p;++j){switch(P=y[j],T=this._transitions.table[this.currentState<<8|(P<160?P:E)],T>>4){case 2:for(let H=j+1;;++H){if(H>=p||(P=y[H])<32||P>126&&P<E){this._printHandler(y,j,H),j=H-1;break}if(++H>=p||(P=y[H])<32||P>126&&P<E){this._printHandler(y,j,H),j=H-1;break}if(++H>=p||(P=y[H])<32||P>126&&P<E){this._printHandler(y,j,H),j=H-1;break}if(++H>=p||(P=y[H])<32||P>126&&P<E){this._printHandler(y,j,H),j=H-1;break}}break;case 3:this._executeHandlers[P]?this._executeHandlers[P]():this._executeHandlerFb(P),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:j,code:P,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|P];let $=L?L.length-1:-1;for(;$>=0&&(k=L[$](this._params),k!==!0);$--)if(k instanceof Promise)return this._preserveStack(3,L,$,T,j),k;$<0&&this._csiHandlerFb(this._collect<<8|P,this._params),this.precedingJoinState=0;break;case 8:do switch(P){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(P-48)}while(++j<p&&(P=y[j])>47&&P<60);j--;break;case 9:this._collect<<=8,this._collect|=P;break;case 10:const F=this._escHandlers[this._collect<<8|P];let W=F?F.length-1:-1;for(;W>=0&&(k=F[W](),k!==!0);W--)if(k instanceof Promise)return this._preserveStack(4,F,W,T,j),k;W<0&&this._escHandlerFb(this._collect<<8|P),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|P,this._params);break;case 13:for(let H=j+1;;++H)if(H>=p||(P=y[H])===24||P===26||P===27||P>127&&P<E){this._dcsParser.put(y,j,H),j=H-1;break}break;case 14:if(k=this._dcsParser.unhook(P!==24&&P!==26),k)return this._preserveStack(6,[],0,T,j),k;P===27&&(T|=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=j+1;;H++)if(H>=p||(P=y[H])<32||P>127&&P<E){this._oscParser.put(y,j,H),j=H-1;break}break;case 6:if(k=this._oscParser.end(P!==24&&P!==26),k)return this._preserveStack(5,[],0,T,j),k;P===27&&(T|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&T}}}a.EscapeSequenceParser=b},6242:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const h=c(5770),g=c(482),d=[];a.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,S){this._handlers[_]===void 0&&(this._handlers[_]=[]);const E=this._handlers[_];return E.push(S),{dispose:()=>{const b=E.indexOf(S);b!==-1&&E.splice(b,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}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=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,S,E){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(_,S,E);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(_,S,E))}start(){this.reset(),this._state=1}put(_,S,E){if(this._state!==3){if(this._state===1)for(;S<E;){const b=_[S++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&E-S>0&&this._put(_,S,E)}}end(_,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,b=this._active.length-1,v=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,E=S,v=this._stack.fallThrough,this._stack.paused=!1),!v&&E===!1){for(;b>=0&&(E=this._active[b].end(_),E!==!0);b--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,E;b--}for(;b>=0;b--)if(E=this._active[b].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,S,E){this._hitLimit||(this._data+=(0,g.utf32ToString)(_,S,E),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let S=!1;if(this._hitLimit)S=!1;else if(_&&(S=this._handler(this._data),S instanceof Promise))return S.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,S}}},8742:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class h{static fromArray(d){const _=new h;if(!d.length)return _;for(let S=Array.isArray(d[0])?1:0;S<d.length;++S){const E=d[S];if(Array.isArray(E))for(let b=0;b<E.length;++b)_.addSubParam(E[b]);else _.addParam(E)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new h(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const S=this._subParamsIdx[_]>>8,E=255&this._subParamsIdx[_];E-S>0&&d.push(Array.prototype.slice.call(this._subParams,S,E))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,S=255&this._subParamsIdx[d];return S-_>0?this._subParams.subarray(_,S):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const S=this._subParamsIdx[_]>>8,E=255&this._subParamsIdx[_];E-S>0&&(d[_]=this._subParams.slice(S,E))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,E=S[_-1];S[_-1]=~E?Math.min(10*E+d,c):d}}a.Params=h},5741:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const g={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(g),h.dispose=()=>this._wrappedAddonDispose(g),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){h=g;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const h=c(3785),g=c(511);a.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,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(d){const _=this._buffer.lines.get(d);if(_)return new h.BufferLineApiView(_)}getNullCell(){return new g.CellData}}},3785:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const h=c(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new h.CellData)}translateToString(g,d,_){return this._line.translateToString(g,d,_)}}},8285:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const h=c(8771),g=c(8460),d=c(844);class _ extends d.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(g=>h(g.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((g,d)=>h(g,d.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(f,a,c){var h=this&&this.__decorate||function(v,y,p,x){var k,P=arguments.length,T=P<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(v,y,p,x);else for(var R=v.length-1;R>=0;R--)(k=v[R])&&(T=(P<3?k(T):P>3?k(y,p,T):k(y,p))||T);return P>3&&T&&Object.defineProperty(y,p,T),T},g=this&&this.__param||function(v,y){return function(p,x){y(p,x,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),S=c(5295),E=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let b=a.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(v,this))}resize(v,y){this.cols=v,this.rows=y,this.buffers.resize(v,y),this._onResize.fire({cols:v,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,y=!1){const p=this.buffer;let x;x=this._cachedBlankLine,x&&x.length===this.cols&&x.getFg(0)===v.fg&&x.getBg(0)===v.bg||(x=p.getBlankLine(v,y),this._cachedBlankLine=x),x.isWrapped=y;const k=p.ybase+p.scrollTop,P=p.ybase+p.scrollBottom;if(p.scrollTop===0){const T=p.lines.isFull;P===p.lines.length-1?T?p.lines.recycle().copyFrom(x):p.lines.push(x.clone()):p.lines.splice(P+1,0,x.clone()),T?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const T=P-k+1;p.lines.shiftElements(k+1,T-1,-1),p.lines.set(P,x.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(v,y,p){const x=this.buffer;if(v<0){if(x.ydisp===0)return;this.isUserScrolling=!0}else v+x.ydisp>=x.ybase&&(this.isUserScrolling=!1);const k=x.ydisp;x.ydisp=Math.max(Math.min(x.ydisp+v,x.ybase),0),k!==x.ydisp&&(y||this._onScroll.fire(x.ydisp))}};a.BufferService=b=h([g(0,E.IOptionsService)],b)},7994:(f,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(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,a,c){var h=this&&this.__decorate||function(x,k,P,T){var R,j=arguments.length,L=j<3?k:T===null?T=Object.getOwnPropertyDescriptor(k,P):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,k,P,T);else for(var $=x.length-1;$>=0;$--)(R=x[$])&&(L=(j<3?R(L):j>3?R(k,P,L):R(k,P))||L);return j>3&&L&&Object.defineProperty(k,P,L),L},g=this&&this.__param||function(x,k){return function(P,T){k(P,T,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const d=c(2585),_=c(8460),S=c(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:x=>x.button!==4&&x.action===1&&(x.ctrl=!1,x.alt=!1,x.shift=!1,!0)},VT200:{events:19,restrict:x=>x.action!==32},DRAG:{events:23,restrict:x=>x.action!==32||x.button!==3},ANY:{events:31,restrict:x=>!0}};function b(x,k){let P=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(P|=64,P|=x.action):(P|=3&x.button,4&x.button&&(P|=64),8&x.button&&(P|=128),x.action===32?P|=32:x.action!==0||k||(P|=3)),P}const v=String.fromCharCode,y={DEFAULT:x=>{const k=[b(x,!1)+32,x.col+32,x.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${v(k[0])}${v(k[1])}${v(k[2])}`},SGR:x=>{const k=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${b(x,!0)};${x.col};${x.row}${k}`},SGR_PIXELS:x=>{const k=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${b(x,!0)};${x.x};${x.y}${k}`}};let p=a.CoreMouseService=class extends S.Disposable{constructor(x,k){super(),this._bufferService=x,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const P of Object.keys(E))this.addProtocol(P,E[P]);for(const P of Object.keys(y))this.addEncoding(P,y[P]);this.reset()}addProtocol(x,k){this._protocols[x]=k}addEncoding(x,k){this._encodings[x]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(x){if(!this._protocols[x])throw new Error(`unknown protocol "${x}"`);this._activeProtocol=x,this._onProtocolChange.fire(this._protocols[x].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(x){if(!this._encodings[x])throw new Error(`unknown encoding "${x}"`);this._activeEncoding=x}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(x){if(x.col<0||x.col>=this._bufferService.cols||x.row<0||x.row>=this._bufferService.rows||x.button===4&&x.action===32||x.button===3&&x.action!==32||x.button!==4&&(x.action===2||x.action===3)||(x.col++,x.row++,x.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,x,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(x))return!1;const k=this._encodings[this._activeEncoding](x);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=x,!0}explainEvents(x){return{down:!!(1&x),up:!!(2&x),drag:!!(4&x),move:!!(8&x),wheel:!!(16&x)}}_equalEvents(x,k,P){if(P){if(x.x!==k.x||x.y!==k.y)return!1}else if(x.col!==k.col||x.row!==k.row)return!1;return x.button===k.button&&x.action===k.action&&x.ctrl===k.ctrl&&x.alt===k.alt&&x.shift===k.shift}};a.CoreMouseService=p=h([g(0,d.IBufferService),g(1,d.ICoreService)],p)},6975:function(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var L=p.length-1;L>=0;L--)(T=p[L])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const d=c(1439),_=c(8460),S=c(844),E=c(2585),b=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=a.CoreService=class extends S.Disposable{constructor(p,x,k){super(),this._bufferService=p,this._logService=x,this._optionsService=k,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,d.clone)(b),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(b),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(p,x=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;x&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),x&&this._onUserInput.fire(),this._logService.debug(`sending data "${p}"`,(()=>p.split("").map((P=>P.charCodeAt(0))))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,(()=>p.split("").map((x=>x.charCodeAt(0))))),this._onBinary.fire(p))}};a.CoreService=y=h([g(0,E.IBufferService),g(1,E.ILogService),g(2,E.IOptionsService)],y)},9074:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const h=c(8055),g=c(8460),d=c(844),_=c(6106);let S=0,E=0;class b extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((p=>p==null?void 0:p.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,d.toDisposable)((()=>this.reset())))}registerDecoration(p){if(p.marker.isDisposed)return;const x=new v(p);if(x){const k=x.marker.onDispose((()=>x.dispose()));x.onDispose((()=>{x&&(this._decorations.delete(x)&&this._onDecorationRemoved.fire(x),k.dispose())})),this._decorations.insert(x),this._onDecorationRegistered.fire(x)}return x}reset(){for(const p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,x,k){let P=0,T=0;for(const R of this._decorations.getKeyIterator(x))P=R.options.x??0,T=P+(R.options.width??1),p>=P&&p<T&&(!k||(R.options.layer??"bottom")===k)&&(yield R)}forEachDecorationAtCell(p,x,k,P){this._decorations.forEachByKey(x,(T=>{S=T.options.x??0,E=S+(T.options.width??1),p>=S&&p<E&&(!k||(T.options.layer??"bottom")===k)&&P(T)}))}}a.DecorationService=b;class v extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(p){super(),this.options=p,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=p.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const h=c(2585),g=c(8343);class d{constructor(...S){this._entries=new Map;for(const[E,b]of S)this.set(E,b)}set(S,E){const b=this._entries.get(S);return this._entries.set(S,E),b}forEach(S){for(const[E,b]of this._entries.entries())S(E,b)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}a.ServiceCollection=d,a.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(_,S){this._services.set(_,S)}getService(_){return this._services.get(_)}createInstance(_,...S){const E=(0,g.getServiceDependencies)(_).sort(((y,p)=>y.index-p.index)),b=[];for(const y of E){const p=this._services.get(y.id);if(!p)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${y.id}.`);b.push(p)}const v=E.length>0?E[0].index:S.length;if(S.length!==v)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${v+1} conflicts with ${S.length} static arguments`);return new _(...S,...b)}}},7866:function(f,a,c){var h=this&&this.__decorate||function(v,y,p,x){var k,P=arguments.length,T=P<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(v,y,p,x);else for(var R=v.length-1;R>=0;R--)(k=v[R])&&(T=(P<3?k(T):P>3?k(y,p,T):k(y,p))||T);return P>3&&T&&Object.defineProperty(y,p,T),T},g=this&&this.__param||function(v,y){return function(p,x){y(p,x,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const d=c(844),_=c(2585),S={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let E,b=a.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let y=0;y<v.length;y++)typeof v[y]=="function"&&(v[y]=v[y]())}_log(v,y,p){this._evalLazyOptionalParams(p),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...p)}trace(v,...y){var p;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.trace.bind(this._optionsService.options.logger))??console.log,v,y)}debug(v,...y){var p;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.debug.bind(this._optionsService.options.logger))??console.log,v,y)}info(v,...y){var p;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.info.bind(this._optionsService.options.logger))??console.info,v,y)}warn(v,...y){var p;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.warn.bind(this._optionsService.options.logger))??console.warn,v,y)}error(v,...y){var p;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.error.bind(this._optionsService.options.logger))??console.error,v,y)}};a.LogService=b=h([g(0,_.IOptionsService)],b),a.setTraceLogger=function(v){E=v},a.traceCall=function(v,y,p){if(typeof p.value!="function")throw new Error("not supported");const x=p.value;p.value=function(...k){if(E.logLevel!==_.LogLevelEnum.TRACE)return x.apply(this,k);E.trace(`GlyphRenderer#${x.name}(${k.map((T=>JSON.stringify(T))).join(", ")})`);const P=x.apply(this,k);return E.trace(`GlyphRenderer#${x.name} return`,P),P}}},7302:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const h=c(8460),g=c(844),d=c(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:d.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 S extends g.Disposable{constructor(b){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...a.DEFAULT_OPTIONS};for(const y in b)if(y in v)try{const p=b[y];v[y]=this._sanitizeAndValidateOption(y,p)}catch(p){console.error(p)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(b,v){return this.onOptionChange((y=>{y===b&&v(this.rawOptions[b])}))}onMultipleOptionChange(b,v){return this.onOptionChange((y=>{b.indexOf(y)!==-1&&v()}))}_setupOptions(){const b=y=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},v=(y,p)=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);p=this._sanitizeAndValidateOption(y,p),this.rawOptions[y]!==p&&(this.rawOptions[y]=p,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const p={get:b.bind(this,y),set:v.bind(this,y)};Object.defineProperty(this.options,y,p)}}_sanitizeAndValidateOption(b,v){switch(b){case"cursorStyle":if(v||(v=a.DEFAULT_OPTIONS[b]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${b}`);break;case"wordSeparator":v||(v=a.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=_.includes(v)?v:a.DEFAULT_OPTIONS[b];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${b} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${b} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${b} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}a.OptionsService=S},2660:function(f,a,c){var h=this&&this.__decorate||function(S,E,b,v){var y,p=arguments.length,x=p<3?E:v===null?v=Object.getOwnPropertyDescriptor(E,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(S,E,b,v);else for(var k=S.length-1;k>=0;k--)(y=S[k])&&(x=(p<3?y(x):p>3?y(E,b,x):y(E,b))||x);return p>3&&x&&Object.defineProperty(E,b,x),x},g=this&&this.__param||function(S,E){return function(b,v){E(b,v,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const d=c(2585);let _=a.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const E=this._bufferService.buffer;if(S.id===void 0){const k=E.addMarker(E.ybase+E.y),P={data:S,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(P,k))),this._dataByLinkId.set(P.id,P),P.id}const b=S,v=this._getEntryIdKey(b),y=this._entriesWithId.get(v);if(y)return this.addLineToLink(y.id,E.ybase+E.y),y.id;const p=E.addMarker(E.ybase+E.y),x={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(x,p))),this._entriesWithId.set(x.key,x),this._dataByLinkId.set(x.id,x),x.id}addLineToLink(S,E){const b=this._dataByLinkId.get(S);if(b&&b.lines.every((v=>v.line!==E))){const v=this._bufferService.buffer.addMarker(E);b.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(b,v)))}}getLinkData(S){var E;return(E=this._dataByLinkId.get(S))==null?void 0:E.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,E){const b=S.lines.indexOf(E);b!==-1&&(S.lines.splice(b,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};a.OscLinkService=_=h([g(0,d.IBufferService)],_)},8343:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",h="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[h]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const d=function(_,S,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,v,y){v[c]===v?v[h].push({id:b,index:y}):(v[h]=[{id:b,index:y}],v[c]=v)})(d,_,E)};return d.toString=()=>g,a.serviceRegistry.set(g,d),d}},2585:(f,a,c)=>{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 h=c(8343);var g;a.IBufferService=(0,h.createDecorator)("BufferService"),a.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),a.ICoreService=(0,h.createDecorator)("CoreService"),a.ICharsetService=(0,h.createDecorator)("CharsetService"),a.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(g||(a.LogLevelEnum=g={})),a.ILogService=(0,h.createDecorator)("LogService"),a.IOptionsService=(0,h.createDecorator)("OptionsService"),a.IOscLinkService=(0,h.createDecorator)("OscLinkService"),a.IUnicodeService=(0,h.createDecorator)("UnicodeService"),a.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const h=c(8460),g=c(225);class d{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,E,b=!1){return(16777215&S)<<3|(3&E)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const S=new g.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let E=0,b=0;const v=S.length;for(let y=0;y<v;++y){let p=S.charCodeAt(y);if(55296<=p&&p<=56319){if(++y>=v)return E+this.wcwidth(p);const P=S.charCodeAt(y);56320<=P&&P<=57343?p=1024*(p-55296)+P-56320+65536:E+=this.wcwidth(P)}const x=this.charProperties(p,b);let k=d.extractWidth(x);d.extractShouldJoin(x)&&(k-=d.extractWidth(b)),E+=k,b=x}return E}charProperties(S,E){return this._activeProvider.charProperties(S,E)}}a.UnicodeService=d}},i={};function l(f){var a=i[f];if(a!==void 0)return a.exports;var c=i[f]={exports:{}};return s[f].call(c.exports,c,c.exports,l),c.exports}var m={};return(()=>{var f=m;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const a=l(9042),c=l(3236),h=l(844),g=l(5741),d=l(8285),_=l(7975),S=l(7090),E=["cols","rows"];class b extends h.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const p=k=>this._core.options[k],x=(k,P)=>{this._checkReadonlyOptions(k),this._core.options[k]=P};for(const k in this._core.options){const P={get:p.bind(this,k),set:x.bind(this,k)};Object.defineProperty(this._publicOptions,k,P)}}_checkReadonlyOptions(y){if(E.includes(y))throw new Error(`Option "${y}" 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 S.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const p in y)this._publicOptions[p]=y[p]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,p=!0){this._core.input(y,p)}resize(y,p){this._verifyIntegers(y,p),this._core.resize(y,p)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,p,x){this._verifyIntegers(y,p,x),this._core.select(y,p,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,p){this._verifyIntegers(y,p),this._core.selectLines(y,p)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,p){this._core.write(y,p)}writeln(y,p){this._core.write(y),this._core.write(`\r
505
- `,p)}paste(y){this._core.paste(y)}refresh(y,p){this._verifyIntegers(y,p),this._core.refresh(y,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return a}_verifyIntegers(...y){for(const p of y)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const p of y)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}f.Terminal=b})(),m})()))})(jh)),jh.exports}var iI=nI(),Nh={exports:{}},$y;function oI(){return $y||($y=1,(function(e,t){(function(s,i){e.exports=i()})(self,(()=>(()=>{var s={};return(()=>{var i=s;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.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 m=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(m._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,m=l._renderService.dimensions;if(m.css.cell.width===0||m.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),h=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),_=h-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(_/m.css.cell.width)),rows:Math.max(1,Math.floor(d/m.css.cell.height))}}}})(),s})()))})(Nh)),Nh.exports}var aI=oI(),Ph={exports:{}},Hy;function lI(){return Hy||(Hy=1,(function(e,t){(function(s,i){e.exports=i()})(self,(()=>(()=>{var s={6:(f,a)=>{function c(g){try{const d=new URL(g),_=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.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,d,_,S={}){this._terminal=g,this._regex=d,this._handler=_,this._options=S}provideLinks(g,d){const _=h.computeLink(g,this._regex,this._terminal,this._handler);d(this._addCallbacks(_))}_addCallbacks(g){return g.map((d=>(d.leave=this._options.leave,d.hover=(_,S)=>{if(this._options.hover){const{range:E}=d;this._options.hover(_,S,E)}},d)))}};class h{static computeLink(d,_,S,E){const b=new RegExp(_.source,(_.flags||"")+"g"),[v,y]=h._getWindowedLineStrings(d-1,S),p=v.join("");let x;const k=[];for(;x=b.exec(p);){const P=x[0];if(!c(P))continue;const[T,R]=h._mapStrIdx(S,y,0,x.index),[j,L]=h._mapStrIdx(S,T,R,P.length);if(T===-1||R===-1||j===-1||L===-1)continue;const $={start:{x:R+1,y:T+1},end:{x:L,y:j+1}};k.push({range:$,text:P,activate:E})}return k}static _getWindowedLineStrings(d,_){let S,E=d,b=d,v=0,y="";const p=[];if(S=_.buffer.active.getLine(d)){const x=S.translateToString(!0);if(S.isWrapped&&x[0]!==" "){for(v=0;(S=_.buffer.active.getLine(--E))&&v<2048&&(y=S.translateToString(!0),v+=y.length,p.push(y),S.isWrapped&&y.indexOf(" ")===-1););p.reverse()}for(p.push(x),v=0;(S=_.buffer.active.getLine(++b))&&S.isWrapped&&v<2048&&(y=S.translateToString(!0),v+=y.length,p.push(y),y.indexOf(" ")===-1););}return[p,E]}static _mapStrIdx(d,_,S,E){const b=d.buffer.active,v=b.getNullCell();let y=S;for(;E;){const p=b.getLine(_);if(!p)return[-1,-1];for(let x=y;x<p.length;++x){p.getCell(x,v);const k=v.getChars();if(v.getWidth()&&(E-=k.length||1,x===p.length-1&&k==="")){const P=b.getLine(_+1);P&&P.isWrapped&&(P.getCell(0,v),v.getWidth()===2&&(E+=1))}if(E<0)return[_,x]}_++,y=0}return[_,y]}}a.LinkComputer=h}},i={};function l(f){var a=i[f];if(a!==void 0)return a.exports;var c=i[f]={exports:{}};return s[f](c,c.exports,l),c.exports}var m={};return(()=>{var f=m;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const a=l(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(g,d){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(g=h,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,_=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,_,this._handler,d))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),m})()))})(Ph)),Ph.exports}var cI=lI();function Xp({cwd:e,initialCommand:t,onExit:s,onReady:i,className:l="",height:m="400px"}){const f=C.useRef(null),a=C.useRef(null),c=C.useRef(null),h=C.useRef(null),[g,d]=C.useState(!1),[_,S]=C.useState(null);C.useEffect(()=>{if(!f.current||a.current)return;const y=new iI.Terminal({cursorBlink:!0,cursorStyle:"block",fontSize:13,fontFamily:"'JetBrains Mono', 'Fira Code', 'Consolas', monospace",theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",cursorAccent:"#1e1e1e",selectionBackground:"#264f78",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff"},allowProposedApi:!0}),p=new aI.FitAddon;y.loadAddon(p),c.current=p;const x=new cI.WebLinksAddon;return y.loadAddon(x),y.open(f.current),a.current=y,setTimeout(()=>{p.fit()},0),E(y),()=>{h.current&&h.current.close(),y.dispose(),a.current=null}},[]);const E=C.useCallback(y=>{const p=window.location.protocol==="https:"?"wss:":"ws:",x=window.location.hostname,k=3333,P=new URLSearchParams;e&&P.set("cwd",e),t&&P.set("cmd",t);const T=`${p}//${x}:${k}/ws/terminal?${P.toString()}`;console.log("Connecting to terminal WebSocket:",T);const R=new WebSocket(T);h.current=R,R.onopen=()=>{console.log("Terminal WebSocket connected"),d(!0)},R.onmessage=j=>{try{const L=JSON.parse(j.data);switch(L.type){case"session":S(L.sessionId),i&&i(L.sessionId);break;case"output":y.write(L.data);break;case"exit":y.write(`\r
506
- \x1B[33m[Process exited]\x1B[0m\r
507
- `),s&&s(L.exitCode,L.signal);break;case"error":y.write(`\r
508
- \x1B[31m[Error: ${L.message}]\x1B[0m\r
509
- `),y.write(`\x1B[33mTip: The terminal requires a working shell. Try running the command manually.\x1B[0m\r
510
- `);break}}catch{y.write(j.data)}},R.onclose=()=>{console.log("Terminal WebSocket closed"),d(!1),y.write(`\r
511
- \x1B[31m[Disconnected]\x1B[0m\r
512
- `)},R.onerror=j=>{console.error("Terminal WebSocket error:",j),y.write(`\r
513
- \x1B[31m[Connection error]\x1B[0m\r
514
- `)},y.onData(j=>{R.readyState===WebSocket.OPEN&&R.send(JSON.stringify({type:"input",data:j}))}),y.onResize(({cols:j,rows:L})=>{R.readyState===WebSocket.OPEN&&R.send(JSON.stringify({type:"resize",cols:j,rows:L}))})},[e,t,i,s]);C.useEffect(()=>{const y=()=>{c.current&&a.current&&c.current.fit()};window.addEventListener("resize",y);const p=new ResizeObserver(y);return f.current&&p.observe(f.current),()=>{window.removeEventListener("resize",y),p.disconnect()}},[]),C.useCallback(y=>{h.current&&h.current.readyState===WebSocket.OPEN&&h.current.send(JSON.stringify({type:"input",data:y+"\r"}))},[]),C.useCallback(()=>{h.current&&h.current.readyState===WebSocket.OPEN&&h.current.send(JSON.stringify({type:"kill"}))},[]);const b=C.useCallback(()=>{a.current&&a.current.focus()},[]);C.useCallback(()=>{a.current&&a.current.clear()},[]);const v=C.useCallback(()=>{if(a.current){const p=a.current.buffer.active;let x="";for(let k=0;k<p.length;k++){const P=p.getLine(k);P&&(x+=P.translateToString(!0)+`
515
- `)}navigator.clipboard.writeText(x.trim()).then(()=>{const k=document.getElementById("terminal-copy-btn");k&&(k.classList.add("bg-green-600"),setTimeout(()=>k.classList.remove("bg-green-600"),500))})}},[]);return o.jsxs("div",{className:`relative ${l}`,style:{height:m},children:[o.jsxs("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-2",children:[o.jsx("button",{id:"terminal-copy-btn",onClick:v,className:"px-2 py-1 text-xs bg-gray-700 hover:bg-gray-600 text-gray-300 rounded transition-colors",title:"Copy terminal output",children:"Copy"}),o.jsx("div",{className:`w-2 h-2 rounded-full ${g?"bg-green-500":"bg-red-500"}`}),o.jsx("span",{className:"text-xs text-gray-400",children:g?"Connected":"Disconnected"})]}),o.jsx("div",{ref:f,className:"w-full h-full rounded-lg overflow-hidden",style:{backgroundColor:"#1e1e1e"},onClick:b})]})}Xp.sendCommand=(e,t)=>{e&&e.sendCommand&&e.sendCommand(t)};const uI="~/reg/tools";function dI({project:e}){const[t,s]=C.useState(""),[i,l]=C.useState(""),[m,f]=C.useState(uI),[a,c]=C.useState(!1),[h,g]=C.useState(null),[d,_]=C.useState(!1),S=()=>{if(!t.trim()){le.error("Please enter an MCP name");return}const y=`Create a new MCP server project called "${t}" with the following:
516
- - Use Python with uv for package management
517
- - Use FastMCP framework
518
- - Description: ${i||"A custom MCP server"}
519
- - Create a single mcp_server.py file with basic structure
520
- - Include a pyproject.toml configured for uv
521
- - Add a README.md with usage instructions`;g(`cd "${m}" && claude "${y}"`),c(!0),_(!0)},E=y=>{console.log("Terminal session ready:",y)},b=(y,p)=>{console.log("Terminal exited:",y,p),_(!1),y===0&&le.success("MCP project created successfully!")},v=()=>{c(!1),g(null),_(!1),s(""),l("")};return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsx("div",{className:"flex-none p-6 border-b border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-950",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[o.jsx(Ps,{className:"w-7 h-7 text-purple-600"}),"Create MCP Server"]}),o.jsx("p",{className:"text-gray-500 dark:text-slate-400 mt-1",children:"Generate a new MCP server project with Claude Code assistance"})]}),a&&o.jsxs(de,{variant:"outline",onClick:v,className:"text-gray-600 dark:text-slate-300",children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"New Project"]})]})}),o.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[o.jsx("div",{className:`${a?"w-1/3 border-r border-gray-200 dark:border-slate-700":"w-full max-w-2xl mx-auto"} p-6 overflow-auto`,children:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"MCP Name *"}),o.jsx(Ye,{value:t,onChange:y=>s(y.target.value),placeholder:"my-awesome-mcp",disabled:d}),o.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:"This will be the project folder name"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Description"}),o.jsx(Ze,{value:i,onChange:y=>l(y.target.value),placeholder:"Describe what your MCP server will do...",className:"min-h-[100px]",disabled:d})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Output Directory"}),o.jsx(Ye,{value:m,onChange:y=>f(y.target.value),placeholder:"/path/to/projects",className:"font-mono text-sm",disabled:d}),o.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:"Where to create the new MCP project"})]}),o.jsxs("div",{className:"bg-purple-50 dark:bg-purple-950/30 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:[o.jsx("h3",{className:"text-sm font-medium text-purple-900 dark:text-purple-300 mb-2",children:"What will be created:"}),o.jsxs("ul",{className:"text-sm text-purple-700 dark:text-purple-400 space-y-1",children:[o.jsxs("li",{className:"flex items-center gap-2",children:[o.jsx(k_,{className:"w-4 h-4"}),"Python project with uv package manager"]}),o.jsxs("li",{className:"flex items-center gap-2",children:[o.jsx(hc,{className:"w-4 h-4"}),"FastMCP framework setup"]}),o.jsxs("li",{className:"flex items-center gap-2",children:[o.jsx(fr,{className:"w-4 h-4"}),"mcp_server.py with basic structure"]}),o.jsxs("li",{className:"flex items-center gap-2",children:[o.jsx(sa,{className:"w-4 h-4"}),"pyproject.toml configured for uv"]})]})]}),!a&&o.jsxs(de,{onClick:S,className:"w-full bg-purple-600 hover:bg-purple-700 text-white",disabled:!t.trim(),children:[o.jsx(Ps,{className:"w-4 h-4 mr-2"}),"Create & Launch Claude Code"]})]})}),a&&o.jsxs("div",{className:"flex-1 flex flex-col bg-gray-900",children:[o.jsxs("div",{className:"flex-none px-4 py-2 border-b border-gray-700 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Bt,{className:"w-4 h-4 text-gray-400"}),o.jsx("span",{className:"text-sm text-gray-300",children:"Claude Code Terminal"})]}),o.jsx("div",{className:"flex items-center gap-2",children:d&&o.jsxs(lt,{variant:"outline",className:"bg-green-900/50 text-green-400 border-green-700",children:[o.jsx(vt,{className:"w-3 h-3 mr-1 animate-spin"}),"Running"]})})]}),o.jsx("div",{className:"flex-1",children:o.jsx(Xp,{cwd:m,initialCommand:h,onReady:E,onExit:b,height:"100%"})})]})]})]})}function hI({project:e,configs:t}){const[s,i]=C.useState({}),[l,m]=C.useState(""),[f,a]=C.useState({}),[c,h]=C.useState(!1);C.useEffect(()=>{g()},[e.dir]);const g=async()=>{try{const E=await Re.getEnv(e.dir);m(E.content||"");const b={};(E.content||"").split(`
522
- `).forEach(v=>{const y=v.match(/^([^=]+)=(.*)$/);y&&(b[y[1]]=y[2])}),a(b)}catch{}},d=E=>{i(b=>({...b,[E]:!b[E]}))},_=async()=>{h(!0);try{await Re.saveEnv(e.dir,l),le.success("Environment saved!")}catch{le.error("Failed to save environment")}finally{h(!1)}},S=E=>{navigator.clipboard.writeText(E),le.success("Copied to clipboard!")};return o.jsx("div",{className:"space-y-6",children:o.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[o.jsx("div",{className:"p-5 border-b border-gray-200 dark:border-slate-800 flex items-center justify-between",children:o.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[o.jsx(R_,{className:"w-5 h-5 text-rose-600"}),"Environment Variables"]})}),o.jsxs("div",{className:"p-4",children:[o.jsxs("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:["Environment variables are stored in ",o.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded",children:".claude/.env"})," and used for MCP server configuration."]}),Object.keys(f).length>0?o.jsx("div",{className:"space-y-3 mb-4",children:Object.entries(f).map(([E,b],v)=>o.jsxs(hn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:v*.05},className:"bg-gray-50 dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-4 flex items-center gap-4",children:[o.jsx("code",{className:"text-indigo-600 dark:text-indigo-400 font-semibold min-w-[200px]",children:E}),o.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[o.jsx(Ye,{type:s[E]?"text":"password",value:b,className:"bg-white dark:bg-slate-950 border-gray-300 dark:border-slate-700 text-gray-900 dark:text-white font-mono",readOnly:!0}),o.jsx(de,{variant:"ghost",size:"sm",onClick:()=>d(E),className:"text-gray-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white",children:o.jsx(C_,{className:"w-4 h-4"})}),o.jsx(de,{variant:"ghost",size:"sm",onClick:()=>S(b),className:"text-gray-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white",children:o.jsx($i,{className:"w-4 h-4"})})]})]},E))}):o.jsx("div",{className:"text-center py-4 text-gray-500 dark:text-slate-400 mb-4",children:"No environment variables defined."}),o.jsxs("div",{className:"border-t border-gray-200 dark:border-slate-700 pt-4",children:[o.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Edit .env file"}),o.jsx(Ze,{value:l,onChange:E=>m(E.target.value),placeholder:`KEY=value
523
- ANOTHER_KEY=another_value`,className:"min-h-[200px] font-mono text-sm bg-gray-50 dark:bg-slate-900 border-gray-300 dark:border-slate-700 text-gray-900 dark:text-white mb-4"}),o.jsxs(de,{onClick:_,disabled:c,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[c?o.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}):o.jsx(Gi,{className:"w-4 h-4 mr-2"}),"Save Environment"]})]})]})]})})}function fI({templates:e,project:t,onApply:s}){const[i,l]=C.useState(null),m=async f=>{l(f);try{await Re.applyTemplate(f,t.dir),le.success(`Template "${f}" applied!`),s()}catch(a){le.error("Failed to apply template: "+a.message)}finally{l(null)}};return o.jsx("div",{className:"space-y-6",children:o.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[o.jsx("div",{className:"p-5 border-b border-gray-200 dark:border-slate-800 flex items-center justify-between",children:o.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[o.jsx(Ic,{className:"w-5 h-5 text-cyan-600"}),"Templates"]})}),o.jsxs("div",{className:"p-4",children:[o.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:"Apply a template to quickly set up rules, commands, and MCP configurations for your project."}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[e.map((f,a)=>{var c;return o.jsxs(hn.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:a*.05},className:"bg-white dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-5 hover:border-cyan-300 dark:hover:border-cyan-700 hover:shadow-lg transition-all group",children:[o.jsx(lt,{variant:"outline",className:"bg-cyan-50 dark:bg-cyan-950/30 text-cyan-700 dark:text-cyan-400 border-cyan-200 dark:border-cyan-800 mb-3 text-[10px] uppercase tracking-wider",children:f.category}),o.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white mb-2",children:f.name}),o.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:f.description||"Project template"}),((c=f.mcpDefaults)==null?void 0:c.length)>0&&o.jsxs("div",{className:"mb-4",children:[o.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-500",children:"MCPs: "}),o.jsx("span",{className:"text-xs text-gray-700 dark:text-slate-300",children:f.mcpDefaults.join(", ")})]}),o.jsxs(de,{size:"sm",onClick:()=>m(f.fullName||`${f.category}/${f.name}`),disabled:i===(f.fullName||f.name),className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white",children:[i===(f.fullName||f.name)?o.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}):null,"Apply Template"]})]},f.fullName||f.name)}),e.length===0&&o.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:"No templates available."})]})]})]})})}var pI=Symbol("radix.slottable");function mI(e){const t=({children:s})=>o.jsx(o.Fragment,{children:s});return t.displayName=`${e}.Slottable`,t.__radixId=pI,t}var Q1="AlertDialog",[gI]=gr(Q1,[nS]),Bs=nS(),Z1=e=>{const{__scopeAlertDialog:t,...s}=e,i=Bs(t);return o.jsx(_S,{...i,...s,modal:!0})};Z1.displayName=Q1;var vI="AlertDialogTrigger",yI=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...i}=e,l=Bs(s);return o.jsx(FL,{...l,...i,ref:t})});yI.displayName=vI;var xI="AlertDialogPortal",eC=e=>{const{__scopeAlertDialog:t,...s}=e,i=Bs(t);return o.jsx(wS,{...i,...s})};eC.displayName=xI;var _I="AlertDialogOverlay",tC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...i}=e,l=Bs(s);return o.jsx(Tp,{...l,...i,ref:t})});tC.displayName=_I;var Oi="AlertDialogContent",[wI,bI]=gI(Oi),SI=mI("AlertDialogContent"),rC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,children:i,...l}=e,m=Bs(s),f=C.useRef(null),a=Ve(t,f),c=C.useRef(null);return o.jsx(LL,{contentName:Oi,titleName:sC,docsSlug:"alert-dialog",children:o.jsx(wI,{scope:s,cancelRef:c,children:o.jsxs(Ap,{role:"alertdialog",...m,...l,ref:a,onOpenAutoFocus:ye(l.onOpenAutoFocus,h=>{var g;h.preventDefault(),(g=c.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[o.jsx(SI,{children:i}),o.jsx(kI,{contentRef:f})]})})})});rC.displayName=Oi;var sC="AlertDialogTitle",nC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...i}=e,l=Bs(s);return o.jsx(Dp,{...l,...i,ref:t})});nC.displayName=sC;var iC="AlertDialogDescription",oC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...i}=e,l=Bs(s);return o.jsx(Mp,{...l,...i,ref:t})});oC.displayName=iC;var CI="AlertDialogAction",aC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...i}=e,l=Bs(s);return o.jsx(Lp,{...l,...i,ref:t})});aC.displayName=CI;var lC="AlertDialogCancel",cC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...i}=e,{cancelRef:l}=bI(lC,s),m=Bs(s),f=Ve(t,l);return o.jsx(Lp,{...m,...i,ref:f})});cC.displayName=lC;var kI=({contentRef:e})=>{const t=`\`${Oi}\` requires a description for the component to be accessible for screen reader users.
524
-
525
- You can add a description to the \`${Oi}\` by passing a \`${iC}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
526
-
527
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Oi}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
528
-
529
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var i;document.getElementById((i=e.current)==null?void 0:i.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},EI=Z1,jI=eC,uC=tC,dC=rC,hC=aC,fC=cC,pC=nC,mC=oC;const NI=EI,PI=jI,gC=C.forwardRef(({className:e,...t},s)=>o.jsx(uC,{className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));gC.displayName=uC.displayName;const vC=C.forwardRef(({className:e,...t},s)=>o.jsxs(PI,{children:[o.jsx(gC,{}),o.jsx(dC,{ref:s,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));vC.displayName=dC.displayName;const yC=({className:e,...t})=>o.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});yC.displayName="AlertDialogHeader";const xC=({className:e,...t})=>o.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xC.displayName="AlertDialogFooter";const _C=C.forwardRef(({className:e,...t},s)=>o.jsx(pC,{ref:s,className:xe("text-lg font-semibold",e),...t}));_C.displayName=pC.displayName;const wC=C.forwardRef(({className:e,...t},s)=>o.jsx(mC,{ref:s,className:xe("text-sm text-muted-foreground",e),...t}));wC.displayName=mC.displayName;const bC=C.forwardRef(({className:e,...t},s)=>o.jsx(hC,{ref:s,className:xe(np(),e),...t}));bC.displayName=hC.displayName;const SC=C.forwardRef(({className:e,...t},s)=>o.jsx(fC,{ref:s,className:xe(np({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));SC.displayName=fC.displayName;function RI({project:e,rootProject:t,onRefresh:s}){var _;const[i,l]=C.useState({open:!1,proj:null}),m=(t==null?void 0:t.subprojects)||e.subprojects||[],f=t&&e.dir!==t.dir,a=async S=>{try{await Re.switchProject(S),window.location.reload()}catch(E){le.error("Failed to switch project: "+E.message)}},c=async()=>{t!=null&&t.dir&&await a(t.dir)},h=async(S,E)=>{E.stopPropagation();try{const b=await Re.initClaudeFolder(S.dir);b.success?(le.success(`Created .claude folder in ${S.name}`),s()):le.error(b.error||"Failed to create .claude folder")}catch(b){le.error("Failed to create .claude folder: "+b.message)}},g=async()=>{const S=i.proj;if(S){try{const E=await Re.deleteClaudeFolder(S.dir);E.success?(le.success(`Deleted .claude folder from ${S.name}`),s()):le.error(E.error||"Failed to delete .claude folder")}catch(E){le.error("Failed to delete .claude folder: "+E.message)}l({open:!1,proj:null})}},d=(S,E)=>{E.stopPropagation(),l({open:!0,proj:S})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"bg-card rounded-xl border border-border overflow-hidden shadow-sm",children:[o.jsxs("div",{className:"p-5 border-b border-border flex items-center justify-between",children:[o.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[o.jsx(kt,{className:"w-5 h-5 text-amber-500"}),"Sub-Projects"]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:s,children:[o.jsx(pr,{className:"w-4 h-4 mr-2"}),"Refresh"]})]}),o.jsxs("div",{className:`p-4 mx-4 mb-4 mt-4 rounded-lg border-l-4 ${f?"bg-blue-500/10 border-blue-500":"bg-amber-500/10 border-amber-500"}`,children:[f&&o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("p",{className:"text-sm font-medium text-blue-600 dark:text-blue-400",children:"Currently in sub-project"}),o.jsxs(de,{variant:"outline",size:"sm",onClick:c,className:"h-7",children:[o.jsx(AR,{className:"w-3 h-3 mr-1"}),"Back to Root"]})]}),o.jsxs("p",{className:"text-sm text-foreground",children:[o.jsx("span",{className:"font-semibold",children:"Current Directory:"})," ",o.jsx("code",{className:"text-muted-foreground bg-muted px-2 py-0.5 rounded",children:e.dir})]}),t&&t.dir!==e.dir&&o.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[o.jsx("span",{className:"font-semibold",children:"Root Project:"})," ",o.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:t.dir})]}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Found ",m.length," sub-project",m.length!==1?"s":""," with .git directories."]})]}),o.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[m.map((S,E)=>{var v,y,p,x;const b=S.dir===e.dir;return o.jsxs(hn.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:E*.05},className:`bg-card rounded-lg border p-4 transition-all group ${b?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border hover:border-primary/50 hover:shadow-md cursor-pointer"}`,onClick:()=>!b&&a(S.dir),children:[o.jsxs("div",{className:"flex items-start justify-between mb-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:S.name}),b&&o.jsx(lt,{variant:"default",className:"text-xs",children:"Current"})]}),o.jsxs("div",{className:"flex gap-1",children:[((v=S.markers)==null?void 0:v.git)&&o.jsx("span",{title:"Git",children:"🔀"}),((y=S.markers)==null?void 0:y.npm)&&o.jsx("span",{title:"NPM",children:"📦"}),((p=S.markers)==null?void 0:p.python)&&o.jsx("span",{title:"Python",children:"🐍"}),((x=S.markers)==null?void 0:x.claude)&&o.jsx("span",{title:"Claude Config",children:"⚙️"})]})]}),o.jsx("code",{className:"text-xs text-muted-foreground block mb-3",children:S.relativePath||S.name}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(lt,{variant:"outline",className:S.hasConfig?"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/30":"bg-muted text-muted-foreground border-border",children:S.hasConfig?`✓ ${S.mcpCount||0} MCPs`:"No config"}),o.jsx("div",{className:"flex gap-1",children:S.hasConfig?o.jsxs(o.Fragment,{children:[o.jsx(de,{size:"sm",variant:"ghost",className:"h-7 px-2 text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100",onClick:k=>{k.stopPropagation(),a(S.dir)},title:"Manage in Project Explorer",children:o.jsx(Kn,{className:"w-3.5 h-3.5"})}),o.jsx(de,{size:"sm",variant:"ghost",className:"h-7 px-2 text-destructive hover:text-destructive opacity-0 group-hover:opacity-100",onClick:k=>d(S,k),title:"Delete .claude folder",children:o.jsx(Gn,{className:"w-3.5 h-3.5"})})]}):o.jsx(de,{size:"sm",variant:"ghost",className:"h-7 px-2 text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100",onClick:k=>h(S,k),title:"Create .claude folder",children:o.jsx(E_,{className:"w-3.5 h-3.5"})})})]})]},S.name)}),m.length===0&&o.jsx("div",{className:"col-span-full text-center py-8 text-muted-foreground",children:"No sub-projects found in this directory."})]})]}),o.jsx(NI,{open:i.open,onOpenChange:S=>l({open:S,proj:i.proj}),children:o.jsxs(vC,{children:[o.jsxs(yC,{children:[o.jsx(_C,{children:"Delete .claude folder?"}),o.jsxs(wC,{children:["This will permanently delete the .claude folder from ",o.jsx("strong",{children:(_=i.proj)==null?void 0:_.name}),", including all rules, commands, and configuration. This action cannot be undone."]})]}),o.jsxs(xC,{children:[o.jsx(SC,{children:"Cancel"}),o.jsx(bC,{onClick:g,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}const TI=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},AI=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function DI({registry:e,searchQuery:t,setSearchQuery:s,onUpdate:i}){var U;const[l,m]=C.useState(()=>TI("registrySearchMode","local")),f=D=>{m(D),AI("registrySearchMode",D)},[a,c]=C.useState([]),[h,g]=C.useState(!1),[d,_]=C.useState({open:!1,name:"",mcp:null,isNew:!1}),[S,E]=C.useState({name:"",command:"npx",args:"",env:"",description:""}),[b,v]=C.useState(!1),[y,p]=C.useState([]),[x,k]=C.useState(""),[P,T]=C.useState({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),[R,j]=C.useState(""),L=Object.entries(e.mcpServers||{}),$=L.filter(([D])=>D.toLowerCase().includes(t.toLowerCase()));C.useEffect(()=>{(async()=>{try{const K=await Re.getMcpTools();p(K.tools||[]),k(K.dir||"")}catch(K){console.error("Failed to load MCP tools:",K)}})()},[]);const F=y.filter(D=>{var K;return!((K=e.mcpServers)!=null&&K[D.name])&&D.name.toLowerCase().includes(t.toLowerCase())}),W=(D,K)=>{E({name:D,command:K.command||"npx",args:JSON.stringify(K.args||[],null,2),env:JSON.stringify(K.env||{},null,2),description:K.description||""}),_({open:!0,name:D,mcp:K,isNew:!1})},[H,J]=C.useState({open:!1,json:""}),G=()=>{J({open:!0,json:""})},Y=async()=>{if(!H.json.trim()){le.error("Please paste the MCP JSON configuration");return}try{let D;try{D=JSON.parse(H.json)}catch{le.error("Invalid JSON format");return}let K={};if(D.mcpServers&&typeof D.mcpServers=="object")K=D.mcpServers;else if(typeof D=="object"&&!Array.isArray(D)){if(Object.keys(D).includes("command")){le.error('JSON is missing the MCP name. Expected: { "name": { "command": "...", "args": [...] } }');return}K=D}if(Object.keys(K).length===0){le.error("No MCP configurations found in the JSON");return}for(const[ae,ve]of Object.entries(K))if(!ve.command){le.error(`MCP "${ae}" is missing required "command" field`);return}const q={...e};q.mcpServers||(q.mcpServers={});for(const[ae,ve]of Object.entries(K))q.mcpServers[ae]=ve;await Re.updateRegistry(q);const ie=Object.keys(K).length;le.success(`Added ${ie} MCP${ie>1?"s":""} to registry!`),J({open:!1,json:""}),i()}catch(D){le.error("Failed to add: "+D.message)}},ee=D=>{const q={[D.name.replace("@modelcontextprotocol/server-","").replace("mcp-server-","").replace("mcp-","").replace(/-/g,"_")]:{command:D.suggestedCommand||"npx",args:D.suggestedArgs||["-y",D.name],...D.description&&{description:D.description}}};J({open:!0,json:JSON.stringify(q,null,2)})},z=D=>{let K,q;D.type==="python"?(K="uv",q=["run","--directory",D.path,"python",D.entryPoint||"mcp_server.py"]):(K="node",q=[D.path+"/index.js"]);const ie={[D.name]:{command:K,args:q,...D.description&&{description:D.description}}};J({open:!0,json:JSON.stringify(ie,null,2)})},M=()=>{if(!P.url.trim()){le.error("Please enter a URL");return}T(D=>({...D,showTerminal:!0}))},B=()=>{if(P.localTool){const q=P.localTool,ie=`Analyze the MCP server at ${q.path}. Read the README and source files to understand how to run it. Output a JSON config block with name, command, args array, and description for the MCP registry. Be specific about the exact command needed.`;return`cd '${q.path}' && claude '${ie}'`}return`cd ~/reg/tools && claude '${`Clone ${P.url.trim()} into ~/reg/tools. Read the README, determine if Python or Node MCP server, and output a JSON config block with name, command, args, and description.`}'`},O=D=>{T({open:!0,url:"",showTerminal:!0,localTool:D,pastedConfig:""})},V=D=>{D===0&&(le.success("Import completed! Paste the JSON config below to add it to the registry."),Re.getMcpTools().then(K=>{p(K.tools||[])}))},Z=async()=>{if(!P.pastedConfig.trim()){le.error("Please paste the JSON config first");return}try{let D;try{D=JSON.parse(P.pastedConfig)}catch{le.error("Invalid JSON format");return}let K={};if(D.mcpServers&&typeof D.mcpServers=="object")K=D.mcpServers;else if(typeof D=="object"&&!Array.isArray(D))if(Object.keys(D).includes("command")){le.error('JSON is missing the MCP name. Expected format: { "name": { "command": "...", "args": [...] } }');return}else K=D;if(Object.keys(K).length===0){le.error("No MCP configurations found in the pasted JSON");return}for(const[ae,ve]of Object.entries(K))if(!ve.command){le.error(`MCP "${ae}" is missing required "command" field`);return}const q={...e};q.mcpServers||(q.mcpServers={});for(const[ae,ve]of Object.entries(K))q.mcpServers[ae]=ve;await Re.updateRegistry(q);const ie=Object.keys(K).length;le.success(`Added ${ie} MCP${ie>1?"s":""} to registry!`),T({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),i()}catch(D){le.error("Failed to add config: "+D.message)}},re=async()=>{v(!0);try{let D,K;try{D=JSON.parse(S.args),K=JSON.parse(S.env)}catch{le.error("Invalid JSON in args or env"),v(!1);return}const q={...e};q.mcpServers||(q.mcpServers={});const ie={command:S.command,args:D,...Object.keys(K).length>0&&{env:K},...S.description&&{description:S.description}};q.mcpServers[d.name]=ie,await Re.updateRegistry(q),le.success("MCP updated"),_({open:!1,name:"",mcp:null,isNew:!1}),i()}catch(D){le.error("Failed to save: "+D.message)}finally{v(!1)}},ce=async D=>{try{const K={...e};delete K.mcpServers[D],await Re.updateRegistry(K),le.success(`Removed ${D} from registry`),i()}catch(K){le.error("Failed to delete: "+K.message)}},ue=async()=>{if(t.trim()){g(!0);try{const D=l==="github"?await Re.searchGithub(t):await Re.searchNpm(t);c(D.results||[])}catch(D){le.error("Search failed: "+D.message),c([])}finally{g(!1)}}};return C.useEffect(()=>{l!=="local"&&c([])},[l]),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[o.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white dark:text-white flex items-center gap-2",children:[o.jsx(sa,{className:"w-5 h-5 text-blue-600"}),"MCP Registry"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>T({open:!0,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"folder"}),className:"border-green-300 dark:border-green-700 text-green-700 dark:text-green-400 hover:bg-green-50 dark:hover:bg-green-950/30",children:[o.jsx(kt,{className:"w-4 h-4 mr-2"}),"Import Folder"]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>T({open:!0,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),className:"border-purple-300 dark:border-purple-700 text-purple-700 dark:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-950/30",children:[o.jsx(dh,{className:"w-4 h-4 mr-2"}),"Import URL"]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:G,className:"border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-950/30",children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]}),o.jsxs("div",{className:"flex gap-2 mb-4",children:[o.jsxs(de,{variant:l==="local"?"default":"outline",size:"sm",onClick:()=>f("local"),className:l==="local"?"bg-blue-600":"",children:[o.jsx(sa,{className:"w-4 h-4 mr-2"}),"Registry (",L.length,")"]}),o.jsxs(de,{variant:l==="tools"?"default":"outline",size:"sm",onClick:()=>f("tools"),className:l==="tools"?"bg-purple-600":"",children:[o.jsx(kt,{className:"w-4 h-4 mr-2"}),"Tools (",y.length,")"]}),o.jsxs(de,{variant:l==="github"?"default":"outline",size:"sm",onClick:()=>f("github"),className:l==="github"?"bg-gray-800":"",children:[o.jsx(hT,{className:"w-4 h-4 mr-2"}),"GitHub"]}),o.jsxs(de,{variant:l==="npm"?"default":"outline",size:"sm",onClick:()=>f("npm"),className:l==="npm"?"bg-red-600":"",children:[o.jsx(N_,{className:"w-4 h-4 mr-2"}),"npm"]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(ep,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),o.jsx(Ye,{value:t,onChange:D=>s(D.target.value),onKeyDown:D=>D.key==="Enter"&&!["local","tools"].includes(l)&&ue(),placeholder:l==="local"?"Filter registry...":l==="tools"?"Filter discovered tools...":`Search ${l} for MCPs...`,className:"pl-9 bg-white border-gray-300"})]}),!["local","tools"].includes(l)&&o.jsx(de,{onClick:ue,disabled:h,children:h?o.jsx(vt,{className:"w-4 h-4 animate-spin"}):"Search"})]})]}),l==="local"&&o.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[$.map(([D,K],q)=>{var ie;return o.jsxs(hn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:q*.03},className:"bg-white dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-4 hover:border-blue-300 hover:shadow-md transition-all group",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:D}),o.jsxs(Na,{children:[o.jsx(Pa,{asChild:!0,children:o.jsx(de,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:o.jsx(S_,{className:"w-4 h-4 text-gray-400"})})}),o.jsxs(eo,{children:[o.jsxs(Tt,{onClick:()=>W(D,K),children:[o.jsx(Zf,{className:"w-4 h-4 mr-2"}),"Edit"]}),o.jsxs(Tt,{className:"text-red-600",onClick:()=>ce(D),children:[o.jsx(Gn,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]}),o.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3",children:K.description||"MCP server"}),o.jsxs("code",{className:"text-xs text-gray-500 dark:text-slate-400 block truncate bg-gray-50 dark:bg-slate-800 px-2 py-1 rounded",children:[K.command," ",(ie=K.args)==null?void 0:ie.join(" ")]}),K.env&&Object.keys(K.env).length>0&&o.jsxs("div",{className:"mt-2 text-xs text-amber-600",children:["Requires: ",Object.keys(K.env).join(", ")]})]},D)}),$.length===0&&o.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:t?"No MCPs match your search.":"Registry is empty. Add MCPs or search online."})]}),l==="tools"&&o.jsxs("div",{className:"p-4",children:[x&&o.jsxs("div",{className:"mb-4 text-sm text-gray-500 dark:text-slate-400 flex items-center gap-2",children:[o.jsx(kt,{className:"w-4 h-4"}),"Scanning: ",x]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[F.map((D,K)=>o.jsxs(hn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:K*.03},className:"bg-purple-50 rounded-lg border border-purple-200 p-4 hover:border-purple-400 hover:shadow-md transition-all",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h3",{className:"font-semibold text-purple-900",children:D.name}),o.jsx(lt,{variant:"outline",className:"text-purple-600 border-purple-300",children:D.type==="python"?"Python":"Node"})]}),o.jsx("p",{className:"text-sm text-purple-700 mb-3",children:D.description||"MCP tool"}),o.jsx("code",{className:"text-xs text-purple-600 block truncate bg-purple-100 px-2 py-1 rounded mb-3",children:D.path}),D.framework&&o.jsxs("div",{className:"text-xs text-purple-500 mb-3",children:["Framework: ",D.framework]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(de,{size:"sm",variant:"outline",onClick:()=>z(D),className:"flex-1 border-purple-300 text-purple-700 hover:bg-purple-100",children:[o.jsx(Ft,{className:"w-4 h-4 mr-1"}),"Quick"]}),o.jsxs(de,{size:"sm",onClick:()=>O(D),className:"flex-1 bg-purple-600 hover:bg-purple-700 text-white",children:[o.jsx(Ps,{className:"w-4 h-4 mr-1"}),"Smart"]})]})]},D.name)),F.length===0&&y.length>0&&o.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:"All discovered tools are already in the registry."}),y.length===0&&o.jsxs("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:["No MCP tools found in ",x,". Create one using the Developer > Create MCP view."]})]})]}),!["local","tools"].includes(l)&&o.jsx("div",{className:"p-4",children:h?o.jsxs("div",{className:"text-center py-8",children:[o.jsx(vt,{className:"w-8 h-8 animate-spin mx-auto text-gray-400"}),o.jsxs("p",{className:"text-gray-500 dark:text-slate-400 mt-2",children:["Searching ",l,"..."]})]}):a.length>0?o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map((D,K)=>{var q;return o.jsxs(hn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:K*.03},className:"bg-white dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-4 hover:border-blue-300 hover:shadow-md transition-all",children:[o.jsxs("div",{className:"flex items-start justify-between mb-2",children:[o.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-sm",children:D.name}),D.stars!==void 0&&o.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600",children:[o.jsx(WT,{className:"w-3 h-3"}),D.stars]})]}),o.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:D.description||"No description"}),o.jsxs("code",{className:"text-xs text-gray-500 dark:text-slate-400 block truncate bg-gray-50 dark:bg-slate-800 px-2 py-1 rounded mb-3",children:[D.suggestedCommand," ",(q=D.suggestedArgs)==null?void 0:q.join(" ")]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(de,{size:"sm",onClick:()=>ee(D),className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white",children:[o.jsx(Ft,{className:"w-3 h-3 mr-1"}),"Add to Registry"]}),D.url&&o.jsx(de,{size:"sm",variant:"outline",onClick:()=>window.open(D.url,"_blank"),children:o.jsx(dh,{className:"w-3 h-3"})})]})]},D.name||K)})}):o.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:t?"No results found. Try a different search term.":`Enter a search term to find MCPs on ${l}.`})})]}),o.jsx(nr,{open:H.open,onOpenChange:D=>J({...H,open:D}),children:o.jsxs(Xt,{className:" max-w-2xl",children:[o.jsxs(Jt,{children:[o.jsx(Zt,{children:"Add MCP to Registry"}),o.jsx(Er,{children:"Paste the MCP JSON configuration block to add to your registry."})]}),o.jsxs("div",{className:"py-4",children:[o.jsx(Ze,{value:H.json,onChange:D=>J({...H,json:D.target.value}),placeholder:`{
530
- "my-mcp": {
531
- "command": "npx",
532
- "args": ["-y", "@example/mcp-server"],
533
- "env": {
534
- "API_KEY": "\${API_KEY}"
535
- }
536
- }
537
- }`,className:"font-mono text-sm bg-gray-50 dark:bg-slate-800",rows:12}),o.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:["Accepts formats: ",o.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:'{ "name": { "command": "...", "args": [...] } }'})," or ",o.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:'{ "mcpServers": { ... } }'})]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:()=>J({open:!1,json:""}),children:"Cancel"}),o.jsxs(de,{onClick:Y,className:"bg-blue-600 hover:bg-blue-700 text-white",children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Add to Registry"]})]})]})}),o.jsx(nr,{open:d.open,onOpenChange:D=>_({...d,open:D}),children:o.jsxs(Xt,{className:" max-w-2xl",children:[o.jsxs(Jt,{children:[o.jsxs(Zt,{children:["Edit MCP: ",d.name]}),o.jsx(Er,{children:"Edit the MCP server configuration."})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),o.jsx(Ye,{value:S.description,onChange:D=>E({...S,description:D.target.value}),placeholder:"What does this MCP do?",className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Command"}),o.jsx(Ye,{value:S.command,onChange:D=>E({...S,command:D.target.value}),placeholder:"npx",className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Args (JSON array)"}),o.jsx(Ze,{value:S.args,onChange:D=>E({...S,args:D.target.value}),placeholder:'["-y", "@modelcontextprotocol/server-xxx"]',className:"mt-1 font-mono text-sm",rows:3})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Environment Variables (JSON object)"}),o.jsx(Ze,{value:S.env,onChange:D=>E({...S,env:D.target.value}),placeholder:'{"API_KEY": "${API_KEY}"}',className:"mt-1 font-mono text-sm",rows:3}),o.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:["Use $","{VAR_NAME}"," syntax for variables from .env file"]})]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:()=>_({...d,open:!1}),children:"Cancel"}),o.jsxs(de,{onClick:re,disabled:b,className:"bg-blue-600 hover:bg-blue-700 text-white",children:[b?o.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}):o.jsx(Gi,{className:"w-4 h-4 mr-2"}),"Save Changes"]})]})]})}),o.jsx(nr,{open:P.open,onOpenChange:D=>T({open:D,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),children:o.jsxs(Xt,{className:`bg-white ${P.showTerminal?"max-w-4xl h-[80vh] max-h-[800px]":"max-w-lg"}`,children:[o.jsxs(Jt,{children:[o.jsx(Zt,{className:"flex items-center gap-2",children:P.localTool?o.jsxs(o.Fragment,{children:[o.jsx(Ps,{className:"w-5 h-5 text-purple-600"})," Configure ",P.localTool.name]}):P.mode==="folder"?o.jsxs(o.Fragment,{children:[o.jsx(kt,{className:"w-5 h-5 text-green-600"})," Import MCP from Folder"]}):o.jsxs(o.Fragment,{children:[o.jsx(dh,{className:"w-5 h-5 text-purple-600"})," Import MCP from URL"]})}),o.jsx(Er,{children:P.localTool?`Claude Code will analyze ${P.localTool.name} and generate the correct configuration.`:P.mode==="folder"?"Enter the path to a local MCP server folder. Claude Code will analyze it and generate the configuration.":"Enter a GitHub repository URL. Claude Code will clone it, read the README, and help configure it."})]}),!P.showTerminal&&!P.localTool?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"py-4",children:P.mode==="folder"?o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Folder Path"}),o.jsx(Ye,{value:R,onChange:D=>j(D.target.value),placeholder:"/path/to/mcp-server or ~/projects/my-mcp",className:"mt-1 font-mono",onKeyDown:D=>D.key==="Enter"&&R.trim()&&T({...P,showTerminal:!0,localTool:{name:R.split("/").pop(),path:R}})}),o.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:"Enter the full path to an existing MCP server project"})]}):o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Repository URL"}),o.jsx(Ye,{value:P.url,onChange:D=>T({...P,url:D.target.value}),placeholder:"https://github.com/user/mcp-server-example",className:"mt-1",onKeyDown:D=>D.key==="Enter"&&M()}),o.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:["The repository will be cloned to ",x||"~/mcp-tools"]})]})}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:()=>T({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),children:"Cancel"}),P.mode==="folder"?o.jsxs(de,{onClick:()=>R.trim()&&T({...P,showTerminal:!0,localTool:{name:R.split("/").pop(),path:R}}),disabled:!R.trim(),className:"bg-green-600 hover:bg-green-700 text-white",children:[o.jsx(Ps,{className:"w-4 h-4 mr-2"}),"Analyze with Claude"]}):o.jsxs(de,{onClick:M,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[o.jsx(Ps,{className:"w-4 h-4 mr-2"}),"Import with Claude"]})]})]}):o.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[P.localTool&&o.jsx("div",{className:"mb-3 p-3 bg-purple-50 rounded-lg border border-purple-200",children:o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[o.jsx(kt,{className:"w-4 h-4 text-purple-600"}),o.jsx("code",{className:"text-purple-700",children:P.localTool.path})]})}),o.jsx("div",{className:"flex-1 bg-gray-900 rounded-lg overflow-hidden",style:{minHeight:"200px"},children:o.jsx(Xp,{cwd:((U=P.localTool)==null?void 0:U.path)||x||"~/reg/tools",initialCommand:B(),onExit:V,height:"100%"})}),o.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-slate-800 rounded-lg border border-gray-200",children:[o.jsxs("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 flex items-center gap-2",children:[o.jsx(KR,{className:"w-4 h-4"}),"Paste MCP Config JSON"]}),o.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 mb-2",children:"Copy the JSON config from the terminal output above and paste it here to add to your registry."}),o.jsx(Ze,{value:P.pastedConfig,onChange:D=>T({...P,pastedConfig:D.target.value}),placeholder:`{
538
- "mcpServers": {
539
- "example": {
540
- "command": "npx",
541
- "args": ["-y", "@example/mcp-server"]
542
- }
543
- }
544
- }`,className:"font-mono text-sm bg-white",rows:6})]}),o.jsxs("div",{className:"mt-4 flex justify-between",children:[o.jsx(de,{variant:"outline",onClick:()=>T({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),children:"Close"}),o.jsxs(de,{onClick:Z,disabled:!P.pastedConfig.trim(),className:"bg-green-600 hover:bg-green-700 text-white",children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Add to Registry"]})]})]})]})})]})}function MI({project:e,onUpdate:t}){var F,W,H,J;const[s,i]=C.useState(null),[l,m]=C.useState(!0),[f,a]=C.useState(null),[c,h]=C.useState(""),[g,d]=C.useState(!1),[_,S]=C.useState("global"),[E,b]=C.useState(""),[v,y]=C.useState([]),[p,x]=C.useState({open:!1,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""});C.useEffect(()=>{k()},[]);const k=async()=>{try{m(!0);const G=await Re.getMemory();i(G)}catch{le.error("Failed to load memory")}finally{m(!1)}};C.useEffect(()=>{f&&P(f.path)},[f]);const P=async G=>{try{const Y=await Re.getMemoryFile(G);h(Y.content||"")}catch{le.error("Failed to load file")}},T=async()=>{if(f){d(!0);try{await Re.saveMemoryFile(f.path,c),le.success("Saved!"),k()}catch{le.error("Failed to save")}finally{d(!1)}}},R=async()=>{if(!E.trim()){y([]);return}try{const G=await Re.searchMemory(E);y(G.results||[])}catch{le.error("Search failed")}},j=async()=>{let G="";const{type:Y}=p;switch(Y){case"preference":if(!p.name.trim()){le.error("Name required");return}G=`**${p.name}**: ${p.description}`;break;case"correction":if(!p.wrong.trim()||!p.right.trim()){le.error('Both "wrong" and "right" are required');return}G=`**Wrong**: ${p.wrong}
545
- **Right**: ${p.right}`;break;case"fact":if(!p.category.trim()){le.error("Category required");return}G=`**${p.category}**: ${p.details}`;break;case"pattern":if(!p.name.trim()){le.error("Name required");return}G=`**${p.name}**
546
- ${p.description}`;break;case"decision":if(!p.title.trim()){le.error("Title required");return}G=`**${p.title}**
547
-
548
- **Context**: ${p.context}
549
-
550
- **Decision**: ${p.decision}
551
-
552
- **Rationale**: ${p.rationale}`;break;case"issue":if(!p.title.trim()){le.error("Title required");return}G=`**${p.title}**
553
-
554
- ${p.description}`;break;case"history":case"context":default:if(!p.content.trim()){le.error("Content required");return}G=p.content;break}try{const ee=["pattern","decision","issue","history","context"].includes(Y)?"project":"global";await Re.addMemoryEntry(Y,G,ee),le.success(`Added ${Y} entry`),x({open:!1,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""}),k()}catch{le.error("Failed to add entry")}},L=async()=>{try{await Re.initProjectMemory(e.dir),le.success("Project memory initialized!"),k()}catch(G){le.error(G.message||"Failed to initialize")}};if(l)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(vt,{className:"w-8 h-8 animate-spin text-indigo-600"})});const $={global:[{id:"preference",label:"Preference",icon:Kn,desc:"User preferences (tools, style, etc.)"},{id:"correction",label:"Correction",icon:ra,desc:"Mistakes to avoid"},{id:"fact",label:"Fact",icon:Wn,desc:"Facts about your environment"}],project:[{id:"context",label:"Context",icon:fr,desc:"Project overview and conventions"},{id:"pattern",label:"Pattern",icon:k_,desc:"Code patterns in this project"},{id:"decision",label:"Decision",icon:L_,desc:"Architecture decisions"},{id:"issue",label:"Issue",icon:ra,desc:"Known issues and workarounds"},{id:"history",label:"History",icon:uh,desc:"Session work log"}]};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-5 shadow-sm",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[o.jsx(dc,{className:"w-5 h-5 text-purple-600"}),"Memory System"]}),o.jsx("div",{className:"flex gap-2",children:o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>x({open:!0,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""}),children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Add Entry"]})})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ye,{placeholder:"Search memory...",value:E,onChange:G=>b(G.target.value),onKeyDown:G=>G.key==="Enter"&&R(),className:"flex-1"}),o.jsx(de,{variant:"outline",onClick:R,children:o.jsx(ep,{className:"w-4 h-4"})})]}),v.length>0&&o.jsxs("div",{className:"mt-4 p-3 bg-gray-50 dark:bg-slate-900 rounded-lg",children:[o.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Search Results"}),o.jsx("div",{className:"space-y-2",children:v.map((G,Y)=>o.jsxs("div",{className:"text-sm",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lt,{variant:G.scope==="global"?"default":"secondary",children:G.scope}),o.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:G.file})]}),G.matches.map((ee,z)=>o.jsxs("div",{className:"ml-4 text-gray-600 dark:text-slate-400 text-xs mt-1",children:["Line ",ee.line,": ",ee.text]},z))]},Y))})]})]}),o.jsx("div",{className:"flex gap-2 border-b border-gray-200 dark:border-slate-700 pb-2",children:["global","project","sync"].map(G=>o.jsxs("button",{onClick:()=>S(G),className:`px-4 py-2 text-sm font-medium rounded-t-lg transition-colors ${_===G?"bg-white dark:bg-slate-950 border border-b-white dark:border-b-slate-950 border-gray-200 dark:border-slate-700 -mb-[1px] text-indigo-600 dark:text-indigo-400":"text-gray-600 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white"}`,children:[G.charAt(0).toUpperCase()+G.slice(1)," Memory"]},G))}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[o.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:[o.jsxs("h3",{className:"font-medium text-gray-900 dark:text-white",children:[_==="global"&&"Global Memory Files",_==="project"&&"Project Memory Files",_==="sync"&&"Sync State"]}),o.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:[_==="global"&&"~/.claude/memory/",_==="project"&&`${e.dir}/.claude/memory/`,_==="sync"&&"~/.claude/sync/"]})]}),o.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:[_==="global"&&((F=s==null?void 0:s.global)==null?void 0:F.files.map(G=>o.jsxs("button",{onClick:()=>G.exists&&a(G),className:`w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-gray-50 dark:hover:bg-slate-900 transition-colors ${(f==null?void 0:f.path)===G.path?"bg-indigo-50 dark:bg-indigo-950/30":""} ${G.exists?"":"opacity-50"}`,children:[o.jsx(fr,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:G.name}),o.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:G.type})]}),G.exists?o.jsx(Nr,{className:"w-4 h-4 text-green-500"}):o.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:"Not created"})]},G.name))),_==="project"&&o.jsx(o.Fragment,{children:(W=s==null?void 0:s.project)!=null&&W.initialized?(H=s==null?void 0:s.project)==null?void 0:H.files.map(G=>o.jsxs("button",{onClick:()=>G.exists&&a(G),className:`w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-gray-50 dark:hover:bg-slate-900 transition-colors ${(f==null?void 0:f.path)===G.path?"bg-indigo-50 dark:bg-indigo-950/30":""} ${G.exists?"":"opacity-50"}`,children:[o.jsx(fr,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:G.name}),o.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:G.type})]}),G.exists?o.jsx(Nr,{className:"w-4 h-4 text-green-500"}):o.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:"Not created"})]},G.name)):o.jsxs("div",{className:"p-6 text-center",children:[o.jsx(dc,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),o.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:"Project memory not initialized"}),o.jsxs(de,{onClick:L,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Initialize Project Memory"]})]})}),_==="sync"&&o.jsx("div",{className:"p-4",children:(J=s==null?void 0:s.sync)!=null&&J.state?o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Current State"}),o.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-slate-900 p-3 rounded overflow-auto max-h-48 text-gray-800 dark:text-slate-300",children:JSON.stringify(s.sync.state,null,2)})]}),s.sync.history.length>0&&o.jsxs("div",{children:[o.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:["History (",s.sync.history.length,")"]}),o.jsx("div",{className:"space-y-1",children:s.sync.history.map((G,Y)=>o.jsxs("div",{className:"text-xs text-gray-600 dark:text-slate-400 flex items-center gap-2",children:[o.jsx(uh,{className:"w-3 h-3"}),G.name]},Y))})]})]}):o.jsxs("div",{className:"text-center py-6",children:[o.jsx(uh,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),o.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"No sync state"}),o.jsx("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:"State is created by session hooks"})]})})]})]}),o.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[o.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 flex items-center justify-between",children:[o.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:f?f.name:"Select a file"}),f&&o.jsxs(de,{size:"sm",onClick:T,disabled:g,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[g?o.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}):o.jsx(Gi,{className:"w-4 h-4 mr-2"}),"Save"]})]}),o.jsx("div",{className:"p-4",children:f?o.jsx(Ze,{value:c,onChange:G=>h(G.target.value),className:"font-mono text-sm min-h-[400px]",placeholder:"File content..."}):o.jsx("div",{className:"flex items-center justify-center h-[400px] text-gray-400 dark:text-slate-500",children:o.jsxs("div",{className:"text-center",children:[o.jsx(fr,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),o.jsx("p",{children:"Select a file to edit"})]})})})]})]}),o.jsx(nr,{open:p.open,onOpenChange:G=>x({...p,open:G}),children:o.jsxs(Xt,{className:"max-w-lg",children:[o.jsxs(Jt,{children:[o.jsx(Zt,{children:"Add Memory Entry"}),o.jsx(Er,{children:"Add a new entry to the appropriate memory file."})]}),o.jsxs("div",{className:"py-4 space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Entry Type"}),o.jsx("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[...$.global,...$.project].map(G=>{const Y=G.icon,ee=$.global.some(z=>z.id===G.id);return o.jsxs("button",{onClick:()=>x({...p,type:G.id}),className:`p-2 rounded-lg border text-left transition-colors ${p.type===G.id?"border-indigo-500 bg-indigo-50 dark:bg-indigo-950/30":"border-gray-200 dark:border-slate-700 hover:border-gray-300 dark:hover:border-slate-600"}`,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Y,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),o.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:G.label})]}),o.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:ee?"Global":"Project"})]},G.id)})})]}),p.type==="preference"&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Name"}),o.jsx(Ye,{value:p.name,onChange:G=>x({...p,name:G.target.value}),placeholder:"e.g., package-manager",className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),o.jsx(Ye,{value:p.description,onChange:G=>x({...p,description:G.target.value}),placeholder:"e.g., Always use pnpm instead of npm",className:"mt-1"})]})]}),p.type==="correction"&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Wrong (what to avoid)"}),o.jsx(Ze,{value:p.wrong,onChange:G=>x({...p,wrong:G.target.value}),placeholder:"e.g., Using npm install",className:"mt-1",rows:2})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Right (what to do instead)"}),o.jsx(Ze,{value:p.right,onChange:G=>x({...p,right:G.target.value}),placeholder:"e.g., Use pnpm install",className:"mt-1",rows:2})]})]}),p.type==="fact"&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Category"}),o.jsx(Ye,{value:p.category,onChange:G=>x({...p,category:G.target.value}),placeholder:"e.g., shell, editor, system",className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Details"}),o.jsx(Ze,{value:p.details,onChange:G=>x({...p,details:G.target.value}),placeholder:"e.g., Using zsh with oh-my-zsh",className:"mt-1",rows:2})]})]}),p.type==="pattern"&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Pattern Name"}),o.jsx(Ye,{value:p.name,onChange:G=>x({...p,name:G.target.value}),placeholder:"e.g., API Response Format",className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),o.jsx(Ze,{value:p.description,onChange:G=>x({...p,description:G.target.value}),placeholder:"Describe the pattern and when to use it...",className:"mt-1",rows:3})]})]}),p.type==="decision"&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Title"}),o.jsx(Ye,{value:p.title,onChange:G=>x({...p,title:G.target.value}),placeholder:"e.g., Use React Query for data fetching",className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Context"}),o.jsx(Ze,{value:p.context,onChange:G=>x({...p,context:G.target.value}),placeholder:"What problem were we solving?",className:"mt-1",rows:2})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Decision"}),o.jsx(Ze,{value:p.decision,onChange:G=>x({...p,decision:G.target.value}),placeholder:"What did we decide?",className:"mt-1",rows:2})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Rationale"}),o.jsx(Ze,{value:p.rationale,onChange:G=>x({...p,rationale:G.target.value}),placeholder:"Why this choice over alternatives?",className:"mt-1",rows:2})]})]}),p.type==="issue"&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Issue Title"}),o.jsx(Ye,{value:p.title,onChange:G=>x({...p,title:G.target.value}),placeholder:"e.g., Memory leak in useEffect",className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description / Workaround"}),o.jsx(Ze,{value:p.description,onChange:G=>x({...p,description:G.target.value}),placeholder:"Describe the issue and any workarounds...",className:"mt-1",rows:3})]})]}),(p.type==="history"||p.type==="context")&&o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Content"}),o.jsx(Ze,{value:p.content,onChange:G=>x({...p,content:G.target.value}),placeholder:p.type==="history"?"What work was done this session?":"Project context and overview...",className:"mt-1",rows:4})]})]}),o.jsxs(Qt,{children:[o.jsx(de,{variant:"ghost",onClick:()=>x({...p,open:!1}),children:"Cancel"}),o.jsxs(de,{onClick:j,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Add Entry"]})]})]})})]})}function LI({onProjectSwitch:e}){const[t,s]=C.useState([]),[i,l]=C.useState(null),[m,f]=C.useState(!0),[a,c]=C.useState(null),[h,g]=C.useState(!1);C.useEffect(()=>{d()},[]);const d=async()=>{try{f(!0);const b=await Re.getProjects();s(b.projects||[]),l(b.activeProjectId)}catch{le.error("Failed to load projects")}finally{f(!1)}},_=async b=>{c(b);try{const v=await Re.setActiveProject(b);v.success?(l(b),s(y=>y.map(p=>({...p,isActive:p.id===b}))),le.success(`Switched to ${v.project.name}`),e==null||e(v)):le.error(v.error||"Failed to switch project")}catch(v){le.error("Failed to switch project: "+v.message)}finally{c(null)}},S=async b=>{if(confirm(`Remove "${b.name}" from the registry?
555
-
556
- This won't delete any files.`))try{const v=await Re.removeProject(b.id);v.success?(s(y=>y.filter(p=>p.id!==b.id)),le.success(`Removed project: ${b.name}`)):le.error(v.error||"Failed to remove project")}catch(v){le.error("Failed to remove project: "+v.message)}},E=b=>{s(v=>[...v,{...b,exists:!0,hasClaudeConfig:!1}])};return m?o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(vt,{className:"w-8 h-8 animate-spin text-indigo-600"})}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-900/30 flex items-center justify-center",children:o.jsx(Un,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Projects"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Registered projects for quick switching"})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(de,{variant:"outline",onClick:d,size:"sm",children:[o.jsx(pr,{className:"w-4 h-4 mr-2"}),"Refresh"]}),o.jsxs(de,{onClick:()=>g(!0),className:"bg-indigo-600 hover:bg-indigo-700",children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Add Project"]})]})]}),o.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded-lg p-4 text-sm text-blue-700 dark:text-blue-400",children:o.jsx("p",{children:"Projects registered here can be quickly switched in the header dropdown. The UI will update to show the selected project's configuration."})}),o.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 shadow-sm overflow-hidden",children:t.length===0?o.jsxs("div",{className:"p-12 text-center",children:[o.jsx(kt,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-slate-600"}),o.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"No Projects Yet"}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-4",children:"Add your first project to get started with quick switching."}),o.jsxs(de,{onClick:()=>g(!0),children:[o.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Add Your First Project"]})]}):o.jsx("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:t.map(b=>o.jsxs("div",{className:`p-4 flex items-center gap-4 transition-colors ${b.isActive?"bg-indigo-50 dark:bg-indigo-950/30":"hover:bg-gray-50 dark:hover:bg-slate-900"}`,children:[o.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${b.isActive?"bg-indigo-100 dark:bg-indigo-900/50":b.exists?"bg-gray-100 dark:bg-slate-800":"bg-amber-100 dark:bg-amber-900/30"}`,children:b.isActive?o.jsx(Nr,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"}):b.exists?o.jsx(kt,{className:"w-5 h-5 text-gray-500 dark:text-slate-400"}):o.jsx(Fc,{className:"w-5 h-5 text-amber-600 dark:text-amber-400"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:`font-medium truncate ${b.isActive?"text-indigo-700 dark:text-indigo-400":"text-gray-900 dark:text-white"}`,children:b.name}),b.hasClaudeConfig&&o.jsx("span",{className:"text-xs bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 px-1.5 py-0.5 rounded",children:".claude"}),b.isActive&&o.jsx("span",{className:"text-xs bg-indigo-100 dark:bg-indigo-900/50 text-indigo-700 dark:text-indigo-400 px-1.5 py-0.5 rounded",children:"Active"})]}),o.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 font-mono truncate",children:b.path.replace(/^\/Users\/[^/]+/,"~")}),!b.exists&&o.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-1",children:"Path not found - the directory may have been moved or deleted"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[!b.isActive&&b.exists&&o.jsx(de,{size:"sm",onClick:()=>_(b.id),disabled:a===b.id,children:a===b.id?o.jsx(vt,{className:"w-4 h-4 animate-spin"}):"Switch"}),o.jsx(de,{size:"sm",variant:"ghost",onClick:()=>S(b),className:"text-gray-500 dark:text-slate-400 hover:text-red-600 dark:hover:text-red-400",title:"Remove from registry",children:o.jsx(Gn,{className:"w-4 h-4"})})]})]},b.id))})}),o.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[o.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),o.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[o.jsx("p",{children:"claude-config project add [path] # Add project"}),o.jsx("p",{children:"claude-config project remove <name> # Remove project"}),o.jsx("p",{children:"claude-config project # List projects"})]})]}),o.jsx(K1,{open:h,onOpenChange:g,onAdded:E})]})}const OI=[{id:"getting-started",title:"Getting Started",icon:Wn,subsections:[{id:"installation",title:"Installation"},{id:"quick-start",title:"Quick Start"},{id:"updating",title:"Updating"}]},{id:"projects",title:"Project Management",icon:P_,subsections:[{id:"project-registry",title:"Project Registry"},{id:"project-switching",title:"Switching Projects"},{id:"project-structure",title:"Project Structure"}]},{id:"file-explorer",title:"Project Explorer",icon:kt,subsections:[{id:"claude-folders",title:".claude Folders"},{id:"rules",title:"Rules"},{id:"commands",title:"Commands"},{id:"workflows",title:"Workflows"},{id:"hierarchy",title:"Configuration Hierarchy"},{id:"subprojects",title:"Sub-Projects"}]},{id:"mcp-registry",title:"MCP Registry",icon:sa,subsections:[{id:"mcp-overview",title:"Overview"},{id:"adding-mcps",title:"Adding MCPs"},{id:"configuring-mcps",title:"Configuring MCPs"},{id:"environment-vars",title:"Environment Variables"}]},{id:"memory",title:"Memory System",icon:dc,subsections:[{id:"memory-overview",title:"Overview"},{id:"global-memory",title:"Global Memory"},{id:"project-memory",title:"Project Memory"},{id:"memory-entries",title:"Memory Entry Types"}]},{id:"claude-settings",title:"Claude Code Settings",icon:Bc,subsections:[{id:"permissions",title:"Permissions"},{id:"model-selection",title:"Model Selection"},{id:"behavior",title:"Behavior Settings"},{id:"hooks",title:"Hooks"}]},{id:"templates",title:"Templates",icon:Ic,subsections:[{id:"using-templates",title:"Using Templates"},{id:"available-templates",title:"Available Templates"},{id:"custom-templates",title:"Custom Templates"}]},{id:"cli",title:"CLI Reference",icon:Bt,subsections:[{id:"cli-overview",title:"Overview"},{id:"cli-commands",title:"All Commands"},{id:"daemon-mode",title:"Daemon Mode"}]},{id:"multi-tool",title:"Multi-Tool Support",icon:sr,subsections:[{id:"antigravity",title:"Antigravity Support"},{id:"tool-differences",title:"Tool Differences"},{id:"enabling-tools",title:"Enabling Tools"},{id:"syncing-rules",title:"Syncing Rules"}]},{id:"keyboard",title:"Keyboard Shortcuts",icon:yT,subsections:[]},{id:"troubleshooting",title:"Troubleshooting",icon:Xf,subsections:[{id:"common-issues",title:"Common Issues"},{id:"getting-help",title:"Getting Help"}]}],II={installation:{title:"Installation",content:`
557
- ## Installation
558
-
559
- Install claude-config globally via npm:
560
-
561
- \`\`\`bash
562
- npm install -g @regression-io/claude-config
563
- \`\`\`
564
-
565
- Or install from GitHub directly:
566
-
567
- \`\`\`bash
568
- npm install -g github:regression-io/claude-config
569
- \`\`\`
570
-
571
- ### Requirements
572
-
573
- - **Node.js 18+** is required
574
- - Works on macOS, Linux, and Windows (with some limitations)
575
-
576
- ### Verify Installation
577
-
578
- After installation, verify it's working:
579
-
580
- \`\`\`bash
581
- claude-config --version
582
- \`\`\`
583
-
584
- This should display the version number and installation paths.
585
- `},"quick-start":{title:"Quick Start",content:`
586
- ## Quick Start
587
-
588
- ### 1. Start the UI
589
-
590
- \`\`\`bash
591
- claude-config ui
592
- \`\`\`
593
-
594
- This starts the web UI as a background daemon on port 3333.
595
-
596
- ### 2. Open in Browser
597
-
598
- Navigate to **http://localhost:3333**
599
-
600
- ### 3. Add a Project
601
-
602
- Click "Add Project" in the header or go to All Projects view to register your project directories.
603
-
604
- ### 4. Initialize Configuration
605
-
606
- For each project, you can:
607
- - Create a \`.claude\` folder with configuration
608
- - Add rules (guidelines for Claude)
609
- - Add commands (reusable prompts)
610
- - Configure MCPs (Model Context Protocol servers)
611
-
612
- ### 5. Apply Templates
613
-
614
- Use pre-built templates to quickly set up rules for your project type:
615
- - **fastapi** - Python FastAPI projects
616
- - **react-ts** - React with TypeScript
617
- - **python-cli** - Python CLI tools
618
- - And more...
619
-
620
- ### 6. Install as App (Optional)
621
-
622
- Claude Config is a PWA (Progressive Web App). Install it to your taskbar:
623
-
624
- **Chrome/Edge:** Click the install icon in the address bar
625
- **Safari:** Share → Add to Dock
626
-
627
- ### 7. Theme
628
-
629
- Use the theme toggle in the header to switch between:
630
- - **Light** - Light mode
631
- - **Dark** - Dark mode
632
- - **Auto** - Follow system preference
633
- `},updating:{title:"Updating",content:`
634
- ## Updating
635
-
636
- ### Automatic Update Detection
637
-
638
- The UI automatically checks npm for new versions. When an update is available, you'll see a notification in the Preferences page.
639
-
640
- ### Manual Update
641
-
642
- \`\`\`bash
643
- npm update -g @regression-io/claude-config
644
- \`\`\`
645
-
646
- Or for a clean reinstall:
647
-
648
- \`\`\`bash
649
- npm uninstall -g @regression-io/claude-config
650
- npm install -g @regression-io/claude-config
651
- \`\`\`
652
-
653
- ### After Updating
654
-
655
- If you have the UI running as a daemon, restart it:
656
-
657
- \`\`\`bash
658
- claude-config ui stop
659
- claude-config ui
660
- \`\`\`
661
- `},"project-registry":{title:"Project Registry",content:`
662
- ## Project Registry
663
-
664
- The project registry keeps track of all your Claude-enabled projects. It's stored in \`~/.claude-config/projects.json\`.
665
-
666
- ### Adding Projects
667
-
668
- **Via UI:**
669
- 1. Click "Add Project" in the header
670
- 2. Select a directory
671
-
672
- **Via CLI:**
673
- \`\`\`bash
674
- claude-config project add /path/to/project
675
- claude-config project add /path/to/project --name "My Project"
676
- \`\`\`
677
-
678
- ### Listing Projects
679
-
680
- \`\`\`bash
681
- claude-config project
682
- \`\`\`
683
-
684
- ### Removing Projects
685
-
686
- \`\`\`bash
687
- claude-config project remove "My Project"
688
- claude-config project remove /path/to/project
689
- \`\`\`
690
-
691
- Note: Removing a project from the registry does not delete the project files.
692
- `},"project-switching":{title:"Switching Projects",content:`
693
- ## Switching Projects
694
-
695
- ### Via UI
696
-
697
- Use the project dropdown in the header to quickly switch between registered projects. The UI will reload to show the new project's configuration.
698
-
699
- ### Via CLI
700
-
701
- \`\`\`bash
702
- claude-config ui --dir /path/to/project
703
- \`\`\`
704
-
705
- ### Active Project
706
-
707
- The active project is remembered between sessions. When you start the UI, it automatically loads the last active project.
708
- `},"project-structure":{title:"Project Structure",content:`
709
- ## Project Structure
710
-
711
- A Claude-enabled project has a \`.claude\` folder with this structure:
712
-
713
- \`\`\`
714
- your-project/
715
- ├── .claude/
716
- │ ├── mcps.json # MCP configuration
717
- │ ├── settings.json # Project-specific settings
718
- │ ├── CLAUDE.md # Project instructions
719
- │ ├── rules/ # Rule files (*.md)
720
- │ │ ├── style.md
721
- │ │ └── patterns.md
722
- │ ├── commands/ # Command files (*.md)
723
- │ │ ├── review.md
724
- │ │ └── test.md
725
- │ ├── workflows/ # Workflow files (*.md)
726
- │ │ └── deploy.md
727
- │ └── memory/ # Project memory (optional)
728
- │ ├── context.md
729
- │ └── patterns.md
730
- └── .mcp.json # Generated - Claude Code reads this
731
- \`\`\`
732
-
733
- ### Generated Files
734
-
735
- The \`.mcp.json\` file in your project root is generated by running \`claude-config apply\`. Claude Code reads this file to configure MCPs.
736
- `},"claude-folders":{title:".claude Folders",content:`
737
- ## .claude Folders
738
-
739
- The \`.claude\` folder contains all Claude Code configuration for a directory.
740
-
741
- ### Creating .claude Folders
742
-
743
- In the Project Explorer, click "+ .claude" on any directory in the hierarchy to create a new configuration folder.
744
-
745
- ### Hierarchy
746
-
747
- Configuration is inherited from parent directories:
748
-
749
- \`\`\`
750
- ~/.claude/ # Global - applies everywhere
751
- ~/projects/.claude/ # Workspace - applies to all projects here
752
- ~/projects/my-app/ # Project - specific to this project
753
- \`\`\`
754
-
755
- Settings merge from global to project, with more specific settings taking precedence.
756
- `},rules:{title:"Rules",content:`
757
- ## Rules
758
-
759
- Rules are markdown files that provide guidelines and instructions for Claude.
760
-
761
- ### Creating Rules
762
-
763
- 1. Navigate to a \`.claude\` folder in the Project Explorer
764
- 2. Click the "+" button next to "rules"
765
- 3. Enter a name (e.g., "coding-style")
766
-
767
- ### Rule Content
768
-
769
- Rules should be written in markdown and contain:
770
- - Guidelines for code style
771
- - Project-specific patterns
772
- - Do's and don'ts
773
- - Architecture decisions
774
-
775
- ### Example Rule
776
-
777
- \`\`\`markdown
778
- # Coding Style
779
-
780
- ## TypeScript
781
- - Use strict mode
782
- - Prefer interfaces over types
783
- - Use named exports
784
-
785
- ## React
786
- - Use functional components
787
- - Prefer hooks over HOCs
788
- - Keep components small and focused
789
- \`\`\`
790
-
791
- ### Rule Priority
792
-
793
- Rules are loaded in order from global to project. Project rules can override global rules.
794
- `},commands:{title:"Commands",content:`
795
- ## Commands
796
-
797
- Commands are reusable prompts that can be invoked in Claude Code.
798
-
799
- ### Creating Commands
800
-
801
- 1. Navigate to a \`.claude\` folder in the Project Explorer
802
- 2. Click the "+" button next to "commands"
803
- 3. Enter a name (e.g., "review")
804
-
805
- ### Command Content
806
-
807
- Commands are markdown files containing a prompt template. They can include:
808
- - Instructions for Claude
809
- - Templates with placeholders
810
- - Multi-step workflows
811
-
812
- ### Example Command
813
-
814
- \`\`\`markdown
815
- # Code Review
816
-
817
- Review the selected code for:
818
-
819
- 1. **Bugs** - Logic errors, edge cases
820
- 2. **Security** - Vulnerabilities, input validation
821
- 3. **Performance** - Inefficiencies, memory leaks
822
- 4. **Style** - Consistency, readability
823
-
824
- Provide specific suggestions with code examples.
825
- \`\`\`
826
-
827
- ### Using Commands
828
-
829
- In Claude Code, use \`/command-name\` to invoke a command.
830
- `},workflows:{title:"Workflows",content:`
831
- ## Workflows
832
-
833
- Workflows are markdown files that define multi-step processes or cross-repository operations.
834
-
835
- ### Location
836
-
837
- Workflows are stored in \`.claude/workflows/\` in your project root.
838
-
839
- ### Creating Workflows
840
-
841
- 1. Navigate to a \`.claude\` folder in the Project Explorer
842
- 2. Click the "+" button and select "New Workflow"
843
- 3. Enter a name (e.g., "deploy-all")
844
-
845
- ### Workflow Content
846
-
847
- Workflows typically include:
848
- - Step-by-step instructions
849
- - Cross-repository coordination
850
- - Environment setup
851
- - Deployment processes
852
-
853
- ### Example Workflow
854
-
855
- \`\`\`markdown
856
- # Deploy All Services
857
-
858
- ## Steps
859
-
860
- 1. Build auth-service first
861
- 2. Then build api-gateway
862
- 3. Run integration tests
863
- 4. Deploy to staging
864
- 5. Deploy to production
865
- \`\`\`
866
-
867
- ### Use Cases
868
-
869
- - Multi-repo deployments
870
- - Complex build processes
871
- - Onboarding procedures
872
- - Release workflows
873
- `},subprojects:{title:"Sub-Projects",content:`
874
- ## Sub-Projects
875
-
876
- Sub-projects are nested git repositories within your main project (monorepos, workspaces).
877
-
878
- ### Detection
879
-
880
- Sub-projects are automatically detected by scanning for \`.git\` directories within your project.
881
-
882
- ### Sub-Projects View
883
-
884
- Access via **Sub-Projects** in the sidebar (only appears if sub-projects exist).
885
-
886
- The view shows:
887
- - All detected sub-projects
888
- - Which have \`.claude\` folders configured
889
- - MCP count per sub-project
890
-
891
- ### Managing Sub-Projects
892
-
893
- **Initialize .claude folder:**
894
- Click the folder+ icon on a sub-project without configuration.
895
-
896
- **Delete .claude folder:**
897
- Click the trash icon (with confirmation) to remove configuration.
898
-
899
- **Switch to sub-project:**
900
- Click a sub-project card to switch context and manage it in Project Explorer.
901
-
902
- ### Sticky Navigation
903
-
904
- When inside a sub-project, the Sub-Projects menu remains visible showing all sub-projects from the root project. Use "Back to Root" to return.
905
-
906
- ### Configuration Inheritance
907
-
908
- Sub-projects inherit configuration from parent directories. Each sub-project can have its own \`.claude\` folder that extends the parent configuration.
909
- `},hierarchy:{title:"Configuration Hierarchy",content:`
910
- ## Configuration Hierarchy
911
-
912
- Claude Config uses a hierarchical configuration system where settings cascade from global to local.
913
-
914
- ### Levels
915
-
916
- 1. **Global** (\`~/.claude/\`) - Applies to all projects
917
- 2. **Workspace** (intermediate directories) - Applies to projects in that directory
918
- 3. **Project** (your project's \`.claude/\`) - Specific to one project
919
-
920
- ### Merging Behavior
921
-
922
- - **MCPs**: Merged, with local configs overriding global
923
- - **Rules**: All rules are loaded, local rules can override
924
- - **Commands**: All commands are available, local takes precedence
925
- - **Settings**: Deep merged, local values override
926
-
927
- ### Viewing the Hierarchy
928
-
929
- In the Project Explorer, you'll see all \`.claude\` folders in the hierarchy from your project up to home. You can manage configuration at each level.
930
- `},"mcp-overview":{title:"MCP Overview",content:`
931
- ## MCP Overview
932
-
933
- MCPs (Model Context Protocol servers) extend Claude's capabilities by providing additional tools and context.
934
-
935
- ### What are MCPs?
936
-
937
- MCPs are servers that implement the Model Context Protocol, providing:
938
- - **Tools** - Additional commands Claude can execute
939
- - **Resources** - Data and context Claude can access
940
- - **Prompts** - Pre-defined prompt templates
941
-
942
- ### Common MCPs
943
-
944
- - **filesystem** - File system access
945
- - **github** - GitHub integration
946
- - **postgres** - PostgreSQL database access
947
- - **memory** - Persistent memory storage
948
-
949
- ### Configuration
950
-
951
- MCPs are configured in \`.claude/mcps.json\`:
952
-
953
- \`\`\`json
954
- {
955
- "mcpServers": {
956
- "filesystem": {
957
- "command": "npx",
958
- "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
959
- }
960
- }
961
- }
962
- \`\`\`
963
- `},"adding-mcps":{title:"Adding MCPs",content:`
964
- ## Adding MCPs
965
-
966
- ### Via UI - Registry
967
-
968
- 1. Go to **MCP Registry** in the sidebar
969
- 2. Click **Add MCP** button
970
- 3. Paste JSON configuration:
971
-
972
- \`\`\`json
973
- {
974
- "my-mcp": {
975
- "command": "npx",
976
- "args": ["-y", "@example/mcp-server"],
977
- "env": {
978
- "API_KEY": "\${API_KEY}"
979
- }
980
- }
981
- }
982
- \`\`\`
983
-
984
- 4. Click "Add to Registry"
985
-
986
- ### Via UI - Config Editor
987
-
988
- 1. Go to **Project Explorer**
989
- 2. Select an \`mcps.json\` file
990
- 3. Click **Add MCP** in the editor header
991
- 4. Paste JSON to add inline MCP to that config level
992
-
993
- ### Accepted JSON Formats
994
-
995
- Both formats work:
996
-
997
- **Simple format:**
998
- \`\`\`json
999
- { "name": { "command": "...", "args": [...] } }
1000
- \`\`\`
1001
-
1002
- **Full format:**
1003
- \`\`\`json
1004
- { "mcpServers": { "name": { "command": "...", "args": [...] } } }
1005
- \`\`\`
1006
-
1007
- ### Via CLI
1008
-
1009
- \`\`\`bash
1010
- claude-config add filesystem github postgres
1011
- \`\`\`
1012
-
1013
- ### From Search Results
1014
-
1015
- Search GitHub or npm in the Registry view. Click "Add" to pre-fill the JSON with suggested configuration.
1016
- `},"configuring-mcps":{title:"Configuring MCPs",content:`
1017
- ## Configuring MCPs
1018
-
1019
- ### Required Fields
1020
-
1021
- - **command** - The executable to run (e.g., "npx", "node", "python")
1022
- - **args** - Array of command-line arguments
1023
-
1024
- ### Optional Fields
1025
-
1026
- - **env** - Environment variables for the MCP
1027
- - **cwd** - Working directory
1028
-
1029
- ### Example Configuration
1030
-
1031
- \`\`\`json
1032
- {
1033
- "mcpServers": {
1034
- "github": {
1035
- "command": "npx",
1036
- "args": ["-y", "@modelcontextprotocol/server-github"],
1037
- "env": {
1038
- "GITHUB_TOKEN": "\${GITHUB_TOKEN}"
1039
- }
1040
- },
1041
- "postgres": {
1042
- "command": "npx",
1043
- "args": ["-y", "@modelcontextprotocol/server-postgres"],
1044
- "env": {
1045
- "DATABASE_URL": "\${DATABASE_URL}"
1046
- }
1047
- }
1048
- }
1049
- }
1050
- \`\`\`
1051
-
1052
- ### Per-Level Configuration
1053
-
1054
- You can enable/disable MCPs at different hierarchy levels. An MCP enabled globally can be disabled for a specific project.
1055
- `},"environment-vars":{title:"Environment Variables",content:`
1056
- ## Environment Variables
1057
-
1058
- ### Syntax
1059
-
1060
- Use \`\${VAR_NAME}\` syntax in your MCP configuration:
1061
-
1062
- \`\`\`json
1063
- {
1064
- "env": {
1065
- "API_KEY": "\${MY_API_KEY}"
1066
- }
1067
- }
1068
- \`\`\`
1069
-
1070
- ### .env Files
1071
-
1072
- Create a \`.claude/.env\` file in your project:
1073
-
1074
- \`\`\`
1075
- GITHUB_TOKEN=ghp_xxxxx
1076
- DATABASE_URL=postgresql://localhost/mydb
1077
- \`\`\`
1078
-
1079
- ### Environment View
1080
-
1081
- Use the **Environment** view in the sidebar to manage environment variables for your project.
1082
-
1083
- ### Security
1084
-
1085
- - Never commit \`.claude/.env\` to version control
1086
- - Add it to your \`.gitignore\`
1087
- - Use different values for development and production
1088
- `},"memory-overview":{title:"Memory Overview",content:`
1089
- ## Memory System
1090
-
1091
- The memory system allows Claude to retain knowledge across sessions.
1092
-
1093
- ### Types of Memory
1094
-
1095
- 1. **Global Memory** (\`~/.claude/memory/\`)
1096
- - Preferences - Your personal preferences
1097
- - Corrections - Mistakes to avoid
1098
- - Facts - Facts about your environment
1099
-
1100
- 2. **Project Memory** (\`project/.claude/memory/\`)
1101
- - Context - Project overview
1102
- - Patterns - Code patterns
1103
- - Decisions - Architecture decisions
1104
- - Issues - Known issues
1105
- - History - Session history
1106
-
1107
- ### How It Works
1108
-
1109
- Memory files are markdown documents that Claude reads at the start of each session, providing context and learned knowledge.
1110
- `},"global-memory":{title:"Global Memory",content:`
1111
- ## Global Memory
1112
-
1113
- Global memory applies to all your Claude interactions.
1114
-
1115
- ### Location
1116
-
1117
- \`~/.claude/memory/\`
1118
-
1119
- ### Files
1120
-
1121
- - **preferences.md** - Your coding preferences, tool choices, style preferences
1122
- - **corrections.md** - Things Claude got wrong that it should remember
1123
- - **facts.md** - Facts about your environment, setup, tools
1124
-
1125
- ### Example: preferences.md
1126
-
1127
- \`\`\`markdown
1128
- # Preferences
1129
-
1130
- ## Code Style
1131
- - Use 2 spaces for indentation
1132
- - Prefer functional programming patterns
1133
- - Always add TypeScript types
1134
-
1135
- ## Tools
1136
- - Use pnpm instead of npm
1137
- - Prefer Vite over webpack
1138
- \`\`\`
1139
- `},"project-memory":{title:"Project Memory",content:`
1140
- ## Project Memory
1141
-
1142
- Project memory is specific to a single project.
1143
-
1144
- ### Location
1145
-
1146
- \`project/.claude/memory/\`
1147
-
1148
- ### Files
1149
-
1150
- - **context.md** - Project overview, tech stack, architecture
1151
- - **patterns.md** - Code patterns specific to this project
1152
- - **decisions.md** - Architectural decisions and rationale
1153
- - **issues.md** - Known issues and workarounds
1154
- - **history.md** - Log of work done in sessions
1155
-
1156
- ### Initializing Project Memory
1157
-
1158
- In the Memory view, click "Initialize" to create memory files from templates.
1159
-
1160
- ### Example: context.md
1161
-
1162
- \`\`\`markdown
1163
- # Project Context
1164
-
1165
- ## Overview
1166
- E-commerce platform built with Next.js and Prisma.
1167
-
1168
- ## Tech Stack
1169
- - Frontend: Next.js 14, React 18, Tailwind CSS
1170
- - Backend: Next.js API routes, Prisma ORM
1171
- - Database: PostgreSQL
1172
- - Auth: NextAuth.js
1173
-
1174
- ## Key Directories
1175
- - /app - Next.js app router pages
1176
- - /components - React components
1177
- - /lib - Utilities and helpers
1178
- \`\`\`
1179
- `},"memory-entries":{title:"Memory Entry Types",content:`
1180
- ## Memory Entry Types
1181
-
1182
- ### Preference
1183
-
1184
- User preferences for tools, style, and workflow.
1185
-
1186
- \`\`\`markdown
1187
- ## [Category]
1188
- - Preference description
1189
- - Another preference
1190
- \`\`\`
1191
-
1192
- ### Correction
1193
-
1194
- Something Claude got wrong that should be remembered.
1195
-
1196
- \`\`\`markdown
1197
- ## [Topic]
1198
- - **Wrong**: What Claude did wrong
1199
- - **Right**: What to do instead
1200
- \`\`\`
1201
-
1202
- ### Pattern
1203
-
1204
- A code pattern specific to the project.
1205
-
1206
- \`\`\`markdown
1207
- ## Pattern Name
1208
- Description of when to use this pattern.
1209
-
1210
- \\\`\\\`\\\`typescript
1211
- // Code example
1212
- \\\`\\\`\\\`
1213
- \`\`\`
1214
-
1215
- ### Decision
1216
-
1217
- An architectural decision with context.
1218
-
1219
- \`\`\`markdown
1220
- ## Decision Title
1221
- **Context**: Why this decision was needed
1222
- **Decision**: What was decided
1223
- **Rationale**: Why this was chosen
1224
- \`\`\`
1225
-
1226
- ### Issue
1227
-
1228
- A known issue with workaround.
1229
-
1230
- \`\`\`markdown
1231
- ## Issue Title
1232
- **Problem**: Description of the issue
1233
- **Workaround**: How to work around it
1234
- \`\`\`
1235
- `},permissions:{title:"Permissions",content:`
1236
- ## Permissions
1237
-
1238
- Control what Claude Code can do automatically.
1239
-
1240
- ### Permission Levels
1241
-
1242
- - **Allow** - Tools that run without asking
1243
- - **Ask** - Tools that require confirmation
1244
- - **Deny** - Tools that are blocked
1245
-
1246
- ### Pattern Syntax
1247
-
1248
- \`\`\`
1249
- Tool(pattern)
1250
- \`\`\`
1251
-
1252
- Examples:
1253
- - \`Bash(npm run build)\` - Specific command
1254
- - \`Bash(npm:*)\` - Prefix match (npm anything)
1255
- - \`Read(**)\` - All file reads
1256
- - \`Edit(src/**)\` - Edit files in src/
1257
- - \`mcp__github__*\` - All GitHub MCP tools
1258
-
1259
- ### Managing Permissions
1260
-
1261
- In the **Claude Code** settings view:
1262
- 1. Navigate to the Permissions tab
1263
- 2. Add patterns to Allow, Ask, or Deny lists
1264
- 3. Click Save to apply
1265
-
1266
- ### Best Practices
1267
-
1268
- - Start restrictive, allow more as needed
1269
- - Use specific patterns over wildcards
1270
- - Review deny list for security-sensitive operations
1271
- `},"model-selection":{title:"Model Selection",content:`
1272
- ## Model Selection
1273
-
1274
- Choose which Claude model to use.
1275
-
1276
- ### Available Models
1277
-
1278
- - **Claude Sonnet 4** - Fast, capable, good for most tasks
1279
- - **Claude Opus 4** - Most capable, best for complex tasks
1280
- - **Claude Haiku** - Fastest, good for simple tasks
1281
-
1282
- ### Setting the Model
1283
-
1284
- In **Claude Code** settings, use the Model dropdown to select your preferred model.
1285
-
1286
- ### Per-Task Model
1287
-
1288
- Some tasks may benefit from different models:
1289
- - Use Haiku for quick edits
1290
- - Use Opus for complex refactoring
1291
- - Use Sonnet as a balanced default
1292
- `},behavior:{title:"Behavior Settings",content:`
1293
- ## Behavior Settings
1294
-
1295
- Configure how Claude Code behaves.
1296
-
1297
- ### Available Settings
1298
-
1299
- - **Auto-accept edits** - Automatically accept file changes
1300
- - **Verbose mode** - Show more detailed output
1301
- - **Enable MCPs** - Toggle MCP servers on/off
1302
-
1303
- ### Configuration
1304
-
1305
- These settings are stored in \`~/.claude/settings.json\` and can be edited in the Claude Code settings view.
1306
- `},hooks:{title:"Hooks",content:`
1307
- ## Hooks
1308
-
1309
- Hooks allow you to run custom commands at specific points.
1310
-
1311
- ### Available Hooks
1312
-
1313
- - **preToolUse** - Before a tool is used
1314
- - **postToolUse** - After a tool is used
1315
- - **notification** - When Claude sends a notification
1316
-
1317
- ### Configuration
1318
-
1319
- \`\`\`json
1320
- {
1321
- "hooks": {
1322
- "postToolUse": "echo 'Tool used'"
1323
- }
1324
- }
1325
- \`\`\`
1326
-
1327
- ### Use Cases
1328
-
1329
- - Run linters after file edits
1330
- - Log tool usage
1331
- - Custom notifications
1332
- `},"using-templates":{title:"Using Templates",content:`
1333
- ## Using Templates
1334
-
1335
- Templates provide pre-configured rules and settings for different project types.
1336
-
1337
- ### Applying Templates
1338
-
1339
- **Via UI:**
1340
- 1. Go to **Templates** in the sidebar
1341
- 2. Select a template
1342
- 3. Click "Apply to Project"
1343
-
1344
- **Via CLI:**
1345
- \`\`\`bash
1346
- claude-config init --template fastapi
1347
- claude-config apply-template react-ts
1348
- \`\`\`
1349
-
1350
- ### What Templates Include
1351
-
1352
- - Rules for the technology/framework
1353
- - Best practices
1354
- - Common patterns
1355
- - Style guidelines
1356
- `},"available-templates":{title:"Available Templates",content:`
1357
- ## Available Templates
1358
-
1359
- ### Languages
1360
-
1361
- - **python** - Python general
1362
- - **typescript** - TypeScript general
1363
- - **javascript** - JavaScript general
1364
-
1365
- ### Frameworks
1366
-
1367
- - **fastapi** - Python FastAPI
1368
- - **react-ts** - React with TypeScript
1369
- - **react-js** - React with JavaScript
1370
- - **python-cli** - Python CLI apps
1371
- - **mcp-python** - MCP server in Python
1372
-
1373
- ### Composites
1374
-
1375
- - **fastapi-react-ts** - Full-stack FastAPI + React TypeScript
1376
- - **fastapi-react-js** - Full-stack FastAPI + React JavaScript
1377
-
1378
- ### Universal
1379
-
1380
- - **universal** - Common rules for any project
1381
- `},"custom-templates":{title:"Custom Templates",content:`
1382
- ## Custom Templates
1383
-
1384
- ### Creating Custom Templates
1385
-
1386
- Templates are stored in the templates directory. To create a custom template:
1387
-
1388
- 1. Create a directory in \`~/.claude-config/templates/\`
1389
- 2. Add a \`template.json\` manifest
1390
- 3. Add rules in a \`rules/\` subdirectory
1391
-
1392
- ### Template Structure
1393
-
1394
- \`\`\`
1395
- my-template/
1396
- ├── template.json
1397
- └── rules/
1398
- ├── style.md
1399
- └── patterns.md
1400
- \`\`\`
1401
-
1402
- ### template.json
1403
-
1404
- \`\`\`json
1405
- {
1406
- "name": "My Template",
1407
- "description": "Custom template for my projects",
1408
- "category": "custom"
1409
- }
1410
- \`\`\`
1411
- `},"cli-overview":{title:"CLI Overview",content:`
1412
- ## CLI Overview
1413
-
1414
- The \`claude-config\` CLI provides command-line access to all features.
1415
-
1416
- ### Basic Usage
1417
-
1418
- \`\`\`bash
1419
- claude-config [command] [options]
1420
- \`\`\`
1421
-
1422
- ### Getting Help
1423
-
1424
- \`\`\`bash
1425
- claude-config --help
1426
- claude-config <command> --help
1427
- \`\`\`
1428
-
1429
- ### Global Options
1430
-
1431
- - \`--version, -v\` - Show version
1432
- - \`--help, -h\` - Show help
1433
- `},"cli-commands":{title:"All Commands",content:`
1434
- ## All CLI Commands
1435
-
1436
- ### UI Commands
1437
-
1438
- \`\`\`bash
1439
- claude-config ui # Start UI (daemon mode)
1440
- claude-config ui --foreground # Run in foreground
1441
- claude-config ui --port 8080 # Custom port
1442
- claude-config ui status # Check daemon status
1443
- claude-config ui stop # Stop daemon
1444
- \`\`\`
1445
-
1446
- ### Project Commands
1447
-
1448
- \`\`\`bash
1449
- claude-config init # Initialize project
1450
- claude-config init --template X # Initialize with template
1451
- claude-config apply # Generate .mcp.json
1452
- claude-config show # Show configuration
1453
- \`\`\`
1454
-
1455
- ### MCP Commands
1456
-
1457
- \`\`\`bash
1458
- claude-config list # List available MCPs
1459
- claude-config add <mcp> # Add MCP to project
1460
- claude-config remove <mcp> # Remove MCP
1461
- claude-config registry-add # Add to registry
1462
- claude-config registry-remove # Remove from registry
1463
- \`\`\`
1464
-
1465
- ### Project Registry
1466
-
1467
- \`\`\`bash
1468
- claude-config project # List projects
1469
- claude-config project add # Add project
1470
- claude-config project remove # Remove project
1471
- \`\`\`
1472
-
1473
- ### Memory Commands
1474
-
1475
- \`\`\`bash
1476
- claude-config memory # Show memory status
1477
- claude-config memory init # Initialize memory
1478
- claude-config memory add # Add entry
1479
- claude-config memory search # Search memory
1480
- \`\`\`
1481
-
1482
- ### Environment
1483
-
1484
- \`\`\`bash
1485
- claude-config env # List variables
1486
- claude-config env set KEY value # Set variable
1487
- claude-config env unset KEY # Remove variable
1488
- \`\`\`
1489
-
1490
- ### Templates
1491
-
1492
- \`\`\`bash
1493
- claude-config templates # List templates
1494
- claude-config apply-template X # Apply template
1495
- \`\`\`
1496
- `},"daemon-mode":{title:"Daemon Mode",content:`
1497
- ## Daemon Mode
1498
-
1499
- By default, \`claude-config ui\` runs as a background daemon.
1500
-
1501
- ### Starting the Daemon
1502
-
1503
- \`\`\`bash
1504
- claude-config ui
1505
- \`\`\`
1506
-
1507
- The UI starts in the background and you can continue using your terminal.
1508
-
1509
- ### Checking Status
1510
-
1511
- \`\`\`bash
1512
- claude-config ui status
1513
- \`\`\`
1514
-
1515
- ### Stopping the Daemon
1516
-
1517
- \`\`\`bash
1518
- claude-config ui stop
1519
- \`\`\`
1520
-
1521
- ### Foreground Mode
1522
-
1523
- To run in the foreground (blocking):
1524
-
1525
- \`\`\`bash
1526
- claude-config ui --foreground
1527
- # or
1528
- claude-config ui -f
1529
- \`\`\`
1530
-
1531
- ### Logs
1532
-
1533
- Daemon logs are stored in \`~/.claude-config/ui.log\`
1534
- `},antigravity:{title:"Antigravity Support",content:`
1535
- ## Antigravity Support
1536
-
1537
- claude-config now supports **Antigravity** (Google's AI coding assistant) in addition to Claude Code.
1538
-
1539
- ### How It Works
1540
-
1541
- Both tools use the **MCP (Model Context Protocol)** for server configurations. claude-config manages a shared registry and generates tool-specific output files:
1542
-
1543
- | Tool | Output Location |
1544
- |------|-----------------|
1545
- | Claude Code | \`.mcp.json\` (project root) |
1546
- | Antigravity | \`~/.gemini/antigravity/mcp_config.json\` |
1547
-
1548
- ### Key Difference
1549
-
1550
- **Environment Variables:**
1551
- - **Claude Code** supports \`\${VAR}\` interpolation in configs
1552
- - **Antigravity** requires resolved paths (no \`\${VAR}\` syntax)
1553
-
1554
- When generating Antigravity configs, claude-config automatically resolves all environment variables to their actual values.
1555
-
1556
- ### Project Files
1557
-
1558
- | Purpose | Claude Code | Antigravity |
1559
- |---------|-------------|-------------|
1560
- | Config folder | \`.claude/\` | \`.agent/\` |
1561
- | Rules | \`.claude/rules/*.md\` | \`.agent/rules/*.md\` |
1562
- | Instructions | \`CLAUDE.md\` | \`GEMINI.md\` |
1563
- `},"tool-differences":{title:"Tool Differences",content:`
1564
- ## Tool Differences
1565
-
1566
- ### Configuration Formats
1567
-
1568
- Both tools use identical JSON format for MCP server definitions:
1569
-
1570
- \`\`\`json
1571
- {
1572
- "mcpServers": {
1573
- "server-name": {
1574
- "command": "npx",
1575
- "args": ["-y", "@some/server"],
1576
- "env": { "API_KEY": "..." }
1577
- }
1578
- }
1579
- }
1580
- \`\`\`
1581
-
1582
- ### Feature Comparison
1583
-
1584
- | Feature | Claude Code | Antigravity |
1585
- |---------|-------------|-------------|
1586
- | MCP Config | \`.mcp.json\` | Global config |
1587
- | Env Interpolation | Yes (\`\${VAR}\`) | No |
1588
- | Commands | \`.claude/commands/\` | Not supported |
1589
- | Workflows | \`.claude/workflows/\` | Not supported |
1590
- | Rules | \`.claude/rules/\` | \`.agent/rules/\` |
1591
-
1592
- ### What This Means
1593
-
1594
- - Your MCP registry is shared between tools
1595
- - When you click "Apply Config", both tools get updated
1596
- - Rules need to be managed separately (sync feature coming soon)
1597
- `},"enabling-tools":{title:"Enabling Tools",content:`
1598
- ## Enabling Tools
1599
-
1600
- Control which tools receive configuration updates.
1601
-
1602
- ### Via Preferences UI
1603
-
1604
- 1. Go to **Preferences** in the sidebar
1605
- 2. Find the **Enabled AI Tools** section
1606
- 3. Toggle tools on/off:
1607
- - **Claude Code** - Writes to \`.mcp.json\`
1608
- - **Antigravity** - Writes to \`~/.gemini/antigravity/mcp_config.json\`
1609
-
1610
- ### Apply Behavior
1611
-
1612
- When you click **Apply Config**:
1613
- - Config is generated for ALL enabled tools
1614
- - Toast notification shows which tools were updated
1615
- - Each tool receives its format-specific output
1616
-
1617
- ### Config File
1618
-
1619
- Tool preferences are stored in \`~/.claude/config.json\`:
1620
-
1621
- \`\`\`json
1622
- {
1623
- "enabledTools": ["claude", "antigravity"]
1624
- }
1625
- \`\`\`
1626
- `},"syncing-rules":{title:"Syncing Rules",content:`
1627
- ## Syncing Rules Between Tools
1628
-
1629
- When both Claude Code and Antigravity are enabled, you can sync rules between them.
1630
-
1631
- ### Accessing Sync
1632
-
1633
- 1. Enable **both tools** in Preferences
1634
- 2. Go to **Project Explorer**
1635
- 3. Click the **Sync** button in the toolbar
1636
-
1637
- ### Sync Dialog
1638
-
1639
- The sync dialog allows you to:
1640
-
1641
- - **Choose direction**: Claude Code → Antigravity or vice versa
1642
- - **Preview changes**: See which files will be copied
1643
- - **Selective sync**: Choose specific files to sync
1644
- - **Status indicators**:
1645
- - **New**: File doesn't exist in target
1646
- - **Modified**: File differs from target
1647
- - **Same**: Files are identical
1648
-
1649
- ### What Gets Synced
1650
-
1651
- | From | To |
1652
- |------|-----|
1653
- | \`.claude/rules/*.md\` | \`.agent/rules/*.md\` |
1654
- | \`.agent/rules/*.md\` | \`.claude/rules/*.md\` |
1655
-
1656
- ### Notes
1657
-
1658
- - Syncing **copies** files (doesn't move them)
1659
- - Target files are **overwritten** if they exist
1660
- - Instructions files (CLAUDE.md / GEMINI.md) are not synced
1661
- - Commands and workflows are Claude-specific (not synced)
1662
- `},keyboard:{title:"Keyboard Shortcuts",content:`
1663
- ## Keyboard Shortcuts
1664
-
1665
- ### File Explorer
1666
-
1667
- | Shortcut | Action |
1668
- |----------|--------|
1669
- | \`Ctrl/Cmd + S\` | Save current file |
1670
- | \`Delete\` | Delete selected item |
1671
- | \`Enter\` | Open selected item |
1672
-
1673
- ### Editor
1674
-
1675
- | Shortcut | Action |
1676
- |----------|--------|
1677
- | \`Ctrl/Cmd + S\` | Save file |
1678
- | \`Ctrl/Cmd + Z\` | Undo |
1679
- | \`Ctrl/Cmd + Shift + Z\` | Redo |
1680
-
1681
- ### Navigation
1682
-
1683
- | Shortcut | Action |
1684
- |----------|--------|
1685
- | \`Ctrl/Cmd + 1-9\` | Switch sidebar sections |
1686
- `},"common-issues":{title:"Common Issues",content:`
1687
- ## Common Issues
1688
-
1689
- ### UI won't start
1690
-
1691
- **Symptom**: \`claude-config ui\` shows "Started daemon" but the UI doesn't open.
1692
-
1693
- **Solution**:
1694
- \`\`\`bash
1695
- claude-config ui stop
1696
- claude-config ui --foreground
1697
- \`\`\`
1698
-
1699
- Check for errors in the output.
1700
-
1701
- ### Port already in use
1702
-
1703
- **Symptom**: Error about port 3333 being in use.
1704
-
1705
- **Solution**:
1706
- \`\`\`bash
1707
- claude-config ui --port 3334
1708
- \`\`\`
1709
-
1710
- Or find and stop the process using port 3333.
1711
-
1712
- ### MCPs not loading
1713
-
1714
- **Symptom**: MCPs show in config but aren't available in Claude Code.
1715
-
1716
- **Solution**:
1717
- 1. Run \`claude-config apply\` to regenerate .mcp.json
1718
- 2. Restart Claude Code
1719
- 3. Check environment variables are set
1720
-
1721
- ### npm install fails
1722
-
1723
- **Symptom**: Errors during \`npm install -g\`
1724
-
1725
- **Solution**:
1726
- \`\`\`bash
1727
- npm cache clean --force
1728
- npm install -g @regression-io/claude-config
1729
- \`\`\`
1730
- `},"getting-help":{title:"Getting Help",content:`
1731
- ## Getting Help
1732
-
1733
- ### Documentation
1734
-
1735
- This documentation is available in the app under **Docs & Help**.
1736
-
1737
- ### GitHub Issues
1738
-
1739
- Report bugs and request features:
1740
- https://github.com/regression-io/claude-config/issues
1741
-
1742
- ### Version Info
1743
-
1744
- \`\`\`bash
1745
- claude-config --version
1746
- \`\`\`
1747
-
1748
- ### Debug Info
1749
-
1750
- When reporting issues, include:
1751
- - claude-config version
1752
- - Node.js version (\`node --version\`)
1753
- - Operating system
1754
- - Error messages or logs
1755
- `}};function BI(){const[e,t]=C.useState("installation"),[s,i]=C.useState({"getting-started":!0}),l=f=>{i(a=>({...a,[f]:!a[f]}))},m=II[e];return o.jsxs("div",{className:"flex h-full",children:[o.jsxs("div",{className:"w-64 border-r border-border bg-muted/50 flex flex-col",children:[o.jsx("div",{className:"p-4 border-b border-border",children:o.jsxs("h2",{className:"font-semibold flex items-center gap-2 text-foreground",children:[o.jsx(Wn,{className:"w-5 h-5"}),"Documentation"]})}),o.jsx(Qn,{className:"flex-1",children:o.jsx("div",{className:"p-2",children:OI.map(f=>o.jsxs("div",{className:"mb-1",children:[o.jsxs("button",{className:xe("w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md hover:bg-accent text-left",(e===f.id||f.subsections.some(a=>a.id===e))&&"bg-accent"),onClick:()=>{f.subsections.length>0?(l(f.id),s[f.id]||t(f.subsections[0].id)):t(f.id)},children:[o.jsx(f.icon,{className:"w-4 h-4 text-muted-foreground"}),o.jsx("span",{className:"flex-1",children:f.title}),f.subsections.length>0&&o.jsx(Lc,{className:xe("w-4 h-4 text-muted-foreground transition-transform",s[f.id]&&"rotate-90")})]}),f.subsections.length>0&&s[f.id]&&o.jsx("div",{className:"ml-6 mt-1 space-y-1",children:f.subsections.map(a=>o.jsx("button",{className:xe("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground",e===a.id&&"bg-accent text-primary font-medium"),onClick:()=>t(a.id),children:a.title},a.id))})]},f.id))})})]}),o.jsx("div",{className:"flex-1 overflow-hidden",children:o.jsx(Qn,{className:"h-full",children:o.jsx("div",{className:"max-w-3xl mx-auto p-8",children:m?o.jsx("div",{className:"prose prose-sm max-w-none",children:o.jsx("div",{dangerouslySetInnerHTML:{__html:FI(m.content)}})}):o.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[o.jsx(Wn,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),o.jsx("p",{children:"Select a topic from the sidebar"})]})})})})]})}function FI(e){let t=e.replace(/```(\w*)\n([\s\S]*?)```/g,(s,i,l)=>`<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-lg overflow-x-auto my-4"><code class="text-sm">${l.replace(/</g,"&lt;").replace(/>/g,"&gt;").trim()}</code></pre>`);return t=t.replace(/(\|[^\n]+\|\n\|[-| :]+\|\n(?:\|[^\n]+\|\n?)+)/g,s=>{const i=s.trim().split(`
1756
- `);if(i.length<2)return s;const l=i[0].split("|").filter(f=>f.trim()).map(f=>`<th class="border border-border px-3 py-2 bg-muted font-semibold text-left">${f.trim()}</th>`).join(""),m=i.slice(2).map(f=>`<tr>${f.split("|").filter(c=>c.trim()).map(c=>`<td class="border border-border px-3 py-2">${c.trim()}</td>`).join("")}</tr>`).join("");return`<table class="w-full border-collapse border border-border my-4"><thead><tr>${l}</tr></thead><tbody>${m}</tbody></table>`}),t.replace(/^### (.*$)/gim,'<h3 class="text-lg font-semibold mt-6 mb-2 text-foreground">$1</h3>').replace(/^## (.*$)/gim,'<h2 class="text-xl font-semibold mt-8 mb-4 text-foreground">$1</h2>').replace(/^# (.*$)/gim,'<h1 class="text-2xl font-bold mb-6 text-foreground">$1</h1>').replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code class="bg-muted px-1.5 py-0.5 rounded text-sm font-mono">$1</code>').replace(/^- (.*$)/gim,'<li class="ml-4">$1</li>').replace(/(<li.*<\/li>\n?)+/g,'<ul class="list-disc my-2">$&</ul>').replace(/^\d+\. (.*$)/gim,'<li class="ml-4">$1</li>').replace(/\n\n/g,'</p><p class="my-3 text-foreground">').replace(/\n/g,"<br/>")}const $I=[{id:"projects",label:"All Projects",icon:P_,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:Un,section:"Projects"},{id:"subprojects",label:"Sub-Projects",icon:kt,section:"Projects",badge:"subprojects"},{id:"registry",label:"MCP Registry",icon:sa,section:"Configuration"},{id:"memory",label:"Memory",icon:dc,section:"Configuration"},{id:"claude-settings",label:"Claude Code",icon:Bc,section:"Configuration"},{id:"templates",label:"Templates",icon:Ic,section:"Tools"},{id:"env",label:"Environment",icon:R_,section:"Tools"},{id:"create-mcp",label:"Create MCP",icon:Ps,section:"Developer"},{id:"preferences",label:"Preferences",icon:D_,section:"System"},{id:"docs",label:"Docs & Help",icon:Wn,section:"Help"}],Vy=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},HI=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function VI(){var Ht,et;const[e,t]=C.useState(()=>Vy("currentView","explorer")),[s,i]=C.useState(!0),[l,m]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[f,a]=C.useState([]),[c,h]=C.useState({mcpServers:{}}),[g,d]=C.useState([]),[_,S]=C.useState([]),[E,b]=C.useState([]),[v,y]=C.useState(null),[p,x]=C.useState(null),[k,P]=C.useState(!1),[T,R]=C.useState({title:"",type:""}),[j,L]=C.useState(""),[$,F]=C.useState(""),[W,H]=C.useState({}),[J,G]=C.useState(null),[Y,ee]=C.useState(null),[z,M]=C.useState(!1),[B,O]=C.useState([]),[V,Z]=C.useState(null),[re,ce]=C.useState(!1),[ue,U]=C.useState(null);C.useEffect(()=>{HI("currentView",e)},[e]);const D=C.useCallback(async()=>{try{const[Pe,Ae,Ie,Fe,Et,ct]=await Promise.all([Re.getProject(),Re.getConfigs(),Re.getRegistry(),Re.getRules(),Re.getCommands(),Re.getTemplates()]);m(Pe),a(Ae),h(Ie),d(Fe),S(Et),b(ct),Ae.length>0&&!v&&y(Ae[Ae.length-1])}catch(Pe){le.error("Failed to load data: "+Pe.message)}finally{i(!1)}},[v]),K=C.useCallback(async(Pe=!1)=>{var Ae;try{const Ie=await Re.getProjects();O(Ie.projects||[]);const Fe=(Ae=Ie.projects)==null?void 0:Ae.find(Et=>Et.isActive);if(Z(Fe||null),Pe&&Fe){const Et=await Re.getSubprojects(Fe.path);U({dir:Fe.path,subprojects:Et.subprojects||[]})}Pe&&!Fe&&(Vy("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),q=async Pe=>{try{const Ae=await Re.setActiveProject(Pe);Ae.success?(m({dir:Ae.dir,hierarchy:Ae.hierarchy,subprojects:Ae.subprojects}),U({dir:Ae.dir,subprojects:Ae.subprojects}),Z(Ae.project),O(Ie=>Ie.map(Fe=>({...Fe,isActive:Fe.id===Pe}))),await D(),le.success(`Switched to ${Ae.project.name}`)):le.error(Ae.error||"Failed to switch project")}catch(Ae){le.error("Failed to switch project: "+Ae.message)}},ie=Pe=>{O(Ae=>[...Ae,{...Pe,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{D(),K(!0),Re.checkVersion().then(Pe=>{G(Pe==null?void 0:Pe.installedVersion),Pe!=null&&Pe.updateAvailable&&ee(Pe)}).catch(()=>{})},[]);const ae=async()=>{if(Y!=null&&Y.updateAvailable){M(!0);try{const Pe=await Re.performUpdate({updateMethod:Y.updateMethod,sourcePath:Y.sourcePath});Pe.success?(le.success(`Updated to v${Pe.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(le.error("Update failed: "+Pe.error),M(!1))}catch(Pe){le.error("Update failed: "+Pe.message),M(!1)}}};C.useEffect(()=>{const Pe=async()=>{try{const{hashes:Ie}=await Re.getFileHashes(),Fe=W;(Object.keys(Ie).some(ct=>Fe[ct]!==Ie[ct])||Object.keys(Fe).some(ct=>!Ie[ct]))&&Object.keys(Fe).length>0&&(le.info("Files changed externally, reloading..."),await D()),H(Ie)}catch{}},Ae=setInterval(Pe,2e3);return Pe(),()=>clearInterval(Ae)},[W,D]);const ve=new Set;f.forEach(Pe=>{var Ae,Ie;(((Ae=Pe.config)==null?void 0:Ae.include)||[]).forEach(Fe=>ve.add(Fe)),Object.keys(((Ie=Pe.config)==null?void 0:Ie.mcpServers)||{}).forEach(Fe=>ve.add(Fe))});const He={subprojects:((Ht=ue==null?void 0:ue.subprojects)==null?void 0:Ht.length)||((et=l.subprojects)==null?void 0:et.length)||0,mcps:ve.size,rules:g.length,commands:_.length},Ue=async()=>{try{const Pe=await Re.applyConfig(l.dir);if(Pe.tools){const Ae=Object.entries(Pe.tools).filter(([,Ie])=>Ie).map(([Ie])=>Ie==="claude"?"Claude Code":"Antigravity");Ae.length>0?le.success(`Config applied to: ${Ae.join(", ")}`):le.warning("No tools were updated")}else le.success("Configuration applied successfully!")}catch(Pe){le.error("Failed to apply config: "+Pe.message)}},Xe=async()=>{i(!0),await D(),le.success("Data refreshed")};if(s)return o.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4",children:[o.jsx(vt,{className:"w-8 h-8 animate-spin text-primary"}),o.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ee=()=>{switch(e){case"explorer":return o.jsx(KO,{project:l,onRefresh:D});case"subprojects":return o.jsx(RI,{project:l,rootProject:ue,onRefresh:Xe});case"registry":return o.jsx(DI,{registry:c,searchQuery:j,setSearchQuery:L,onUpdate:D});case"memory":return o.jsx(MI,{project:l,onUpdate:D});case"templates":return o.jsx(fI,{templates:E,project:l,onApply:D});case"env":return o.jsx(hI,{project:l,configs:f});case"create-mcp":return o.jsx(dI,{project:l});case"claude-settings":return o.jsx(sI,{});case"preferences":return o.jsx(rI,{});case"projects":return o.jsx(LI,{onProjectSwitch:Pe=>{m({dir:Pe.dir,hierarchy:Pe.hierarchy,subprojects:Pe.subprojects}),U({dir:Pe.dir,subprojects:Pe.subprojects}),D(),K()}});case"docs":return o.jsx(BI,{});default:return null}};return o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:o.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:o.jsx(Kn,{className:"w-5 h-5 text-white"})}),o.jsx("div",{children:o.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Claude ",o.jsx("span",{className:"text-primary",children:"Config"}),J&&o.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-2",children:["v",J]})]})}),Y&&o.jsxs("button",{onClick:ae,disabled:z,className:"ml-3 px-2.5 py-1 text-xs font-medium bg-green-100 text-green-700 hover:bg-green-200 rounded-full flex items-center gap-1.5 transition-colors disabled:opacity-50",children:[z?o.jsx(vt,{className:"w-3 h-3 animate-spin"}):o.jsx(Oc,{className:"w-3 h-3"}),z?"Updating...":`Update to v${Y.sourceVersion}`]})]}),o.jsx(X1,{orientation:"vertical",className:"h-6"}),o.jsx(GO,{projects:B,activeProject:V,onSwitch:q,onAddClick:()=>ce(!0),onManageClick:()=>t("projects")})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(XO,{}),o.jsx(de,{variant:"ghost",size:"sm",onClick:Xe,children:o.jsx(pr,{className:"w-4 h-4"})}),o.jsxs(de,{onClick:Ue,className:"bg-indigo-600 hover:bg-indigo-700 text-white gap-2 shadow-md",children:[o.jsx(MT,{className:"w-4 h-4"}),"Apply Config"]})]})]})}),o.jsxs("div",{className:"flex",children:[o.jsx("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16",children:o.jsx(Qn,{className:"h-full py-4",children:["Projects","Configuration","Tools","Developer","System","Help"].map(Pe=>o.jsxs("div",{className:"mb-6",children:[o.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:Pe}),o.jsx("div",{className:"space-y-0.5",children:$I.filter(Ae=>Ae.section===Pe).filter(Ae=>{const Ie=(ue==null?void 0:ue.subprojects)||l.subprojects;return!(Ae.id==="subprojects"&&(!Ie||Ie.length===0))}).map(Ae=>{const Ie=Ae.icon,Fe=e===Ae.id;return o.jsxs("button",{onClick:()=>t(Ae.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${Fe?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[o.jsx(Ie,{className:"w-4 h-4"}),o.jsx("span",{className:"flex-1 text-left",children:Ae.label}),Ae.badge&&o.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${Fe?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:He[Ae.badge]})]},Ae.id)})})]},Pe))})}),o.jsx("main",{className:xe("flex-1 overflow-auto",e==="explorer"||e==="docs"?"h-[calc(100vh-64px)]":"p-6"),children:o.jsx(Gy,{mode:"wait",children:o.jsx(hn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:e==="explorer"||e==="docs"?"h-full":"",children:Ee()},e)})})]}),o.jsx(K1,{open:re,onOpenChange:ce,onAdded:ie})]})}function zI(){return o.jsx(qO,{children:o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(VI,{}),o.jsx(Z2,{position:"bottom-right",richColors:!0})]})})}E2.createRoot(document.getElementById("root")).render(o.jsx(zI,{}));