vibora 1.9.1 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,45 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
2
+ function sA(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(s,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>s[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const h of u.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function n(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=n(o);fetch(o.href,u)}})();function qw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ug={exports:{}},hu={};var Gx;function iA(){if(Gx)return hu;Gx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,o,u){var h=null;if(u!==void 0&&(h=""+u),o.key!==void 0&&(h=""+o.key),"key"in o){u={};for(var a in o)a!=="key"&&(u[a]=o[a])}else u=o;return o=u.ref,{$$typeof:e,type:s,key:h,ref:o!==void 0?o:null,props:u}}return hu.Fragment=t,hu.jsx=n,hu.jsxs=n,hu}var $x;function oA(){return $x||($x=1,Ug.exports=iA()),Ug.exports}var _=oA(),Wg={exports:{}},pt={};var Kx;function aA(){if(Kx)return pt;Kx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),h=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function S(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,y={};function x(I,W,Y){this.props=I,this.context=W,this.refs=y,this.updater=Y||C}x.prototype.isReactComponent={},x.prototype.setState=function(I,W){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,W,"setState")},x.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function v(){}v.prototype=x.prototype;function b(I,W,Y){this.props=I,this.context=W,this.refs=y,this.updater=Y||C}var E=b.prototype=new v;E.constructor=b,w(E,x.prototype),E.isPureReactComponent=!0;var T=Array.isArray;function A(){}var M={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function D(I,W,Y){var J=Y.ref;return{$$typeof:e,type:I,key:W,ref:J!==void 0?J:null,props:Y}}function H(I,W){return D(I.type,W,I.props)}function z(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function q(I){var W={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Y){return W[Y]})}var j=/\/+/g;function K(I,W){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):W.toString(36)}function $(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(A,A):(I.status="pending",I.then(function(W){I.status==="pending"&&(I.status="fulfilled",I.value=W)},function(W){I.status==="pending"&&(I.status="rejected",I.reason=W)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function F(I,W,Y,J,Z){var ee=typeof I;(ee==="undefined"||ee==="boolean")&&(I=null);var X=!1;if(I===null)X=!0;else switch(ee){case"bigint":case"string":case"number":X=!0;break;case"object":switch(I.$$typeof){case e:case t:X=!0;break;case p:return X=I._init,F(X(I._payload),W,Y,J,Z)}}if(X)return Z=Z(I),X=J===""?"."+K(I,0):J,T(Z)?(Y="",X!=null&&(Y=X.replace(j,"$&/")+"/"),F(Z,W,Y,"",function(ne){return ne})):Z!=null&&(z(Z)&&(Z=H(Z,Y+(Z.key==null||I&&I.key===Z.key?"":(""+Z.key).replace(j,"$&/")+"/")+X)),W.push(Z)),1;X=0;var V=J===""?".":J+":";if(T(I))for(var se=0;se<I.length;se++)J=I[se],ee=V+K(J,se),X+=F(J,W,Y,ee,Z);else if(se=S(I),typeof se=="function")for(I=se.call(I),se=0;!(J=I.next()).done;)J=J.value,ee=V+K(J,se++),X+=F(J,W,Y,ee,Z);else if(ee==="object"){if(typeof I.then=="function")return F($(I),W,Y,J,Z);throw W=String(I),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return X}function G(I,W,Y){if(I==null)return I;var J=[],Z=0;return F(I,J,"","",function(ee){return W.call(Y,ee,Z++)}),J}function U(I){if(I._status===-1){var W=I._result;W=W(),W.then(function(Y){(I._status===0||I._status===-1)&&(I._status=1,I._result=Y)},function(Y){(I._status===0||I._status===-1)&&(I._status=2,I._result=Y)}),I._status===-1&&(I._status=0,I._result=W)}if(I._status===1)return I._result.default;throw I._result}var P=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},B={map:G,forEach:function(I,W,Y){G(I,function(){W.apply(this,arguments)},Y)},count:function(I){var W=0;return G(I,function(){W++}),W},toArray:function(I){return G(I,function(W){return W})||[]},only:function(I){if(!z(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return pt.Activity=f,pt.Children=B,pt.Component=x,pt.Fragment=n,pt.Profiler=o,pt.PureComponent=b,pt.StrictMode=s,pt.Suspense=l,pt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,pt.__COMPILER_RUNTIME={__proto__:null,c:function(I){return M.H.useMemoCache(I)}},pt.cache=function(I){return function(){return I.apply(null,arguments)}},pt.cacheSignal=function(){return null},pt.cloneElement=function(I,W,Y){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var J=w({},I.props),Z=I.key;if(W!=null)for(ee in W.key!==void 0&&(Z=""+W.key),W)!L.call(W,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&W.ref===void 0||(J[ee]=W[ee]);var ee=arguments.length-2;if(ee===1)J.children=Y;else if(1<ee){for(var X=Array(ee),V=0;V<ee;V++)X[V]=arguments[V+2];J.children=X}return D(I.type,Z,J)},pt.createContext=function(I){return I={$$typeof:h,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:u,_context:I},I},pt.createElement=function(I,W,Y){var J,Z={},ee=null;if(W!=null)for(J in W.key!==void 0&&(ee=""+W.key),W)L.call(W,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(Z[J]=W[J]);var X=arguments.length-2;if(X===1)Z.children=Y;else if(1<X){for(var V=Array(X),se=0;se<X;se++)V[se]=arguments[se+2];Z.children=V}if(I&&I.defaultProps)for(J in X=I.defaultProps,X)Z[J]===void 0&&(Z[J]=X[J]);return D(I,ee,Z)},pt.createRef=function(){return{current:null}},pt.forwardRef=function(I){return{$$typeof:a,render:I}},pt.isValidElement=z,pt.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:U}},pt.memo=function(I,W){return{$$typeof:d,type:I,compare:W===void 0?null:W}},pt.startTransition=function(I){var W=M.T,Y={};M.T=Y;try{var J=I(),Z=M.S;Z!==null&&Z(Y,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(A,P)}catch(ee){P(ee)}finally{W!==null&&Y.types!==null&&(W.types=Y.types),M.T=W}},pt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},pt.use=function(I){return M.H.use(I)},pt.useActionState=function(I,W,Y){return M.H.useActionState(I,W,Y)},pt.useCallback=function(I,W){return M.H.useCallback(I,W)},pt.useContext=function(I){return M.H.useContext(I)},pt.useDebugValue=function(){},pt.useDeferredValue=function(I,W){return M.H.useDeferredValue(I,W)},pt.useEffect=function(I,W){return M.H.useEffect(I,W)},pt.useEffectEvent=function(I){return M.H.useEffectEvent(I)},pt.useId=function(){return M.H.useId()},pt.useImperativeHandle=function(I,W,Y){return M.H.useImperativeHandle(I,W,Y)},pt.useInsertionEffect=function(I,W){return M.H.useInsertionEffect(I,W)},pt.useLayoutEffect=function(I,W){return M.H.useLayoutEffect(I,W)},pt.useMemo=function(I,W){return M.H.useMemo(I,W)},pt.useOptimistic=function(I,W){return M.H.useOptimistic(I,W)},pt.useReducer=function(I,W,Y){return M.H.useReducer(I,W,Y)},pt.useRef=function(I){return M.H.useRef(I)},pt.useState=function(I){return M.H.useState(I)},pt.useSyncExternalStore=function(I,W,Y){return M.H.useSyncExternalStore(I,W,Y)},pt.useTransition=function(){return M.H.useTransition()},pt.version="19.2.3",pt}var Yx;function Ju(){return Yx||(Yx=1,Wg.exports=aA()),Wg.exports}var R=Ju();const ze=qw(R),Gw=sA({__proto__:null,default:ze},[R]);var qg={exports:{}},pu={},Gg={exports:{}},$g={};var Xx;function lA(){return Xx||(Xx=1,(function(e){function t(F,G){var U=F.length;F.push(G);e:for(;0<U;){var P=U-1>>>1,B=F[P];if(0<o(B,G))F[P]=G,F[U]=B,U=P;else break e}}function n(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var G=F[0],U=F.pop();if(U!==G){F[0]=U;e:for(var P=0,B=F.length,I=B>>>1;P<I;){var W=2*(P+1)-1,Y=F[W],J=W+1,Z=F[J];if(0>o(Y,U))J<B&&0>o(Z,Y)?(F[P]=Z,F[J]=U,P=J):(F[P]=Y,F[W]=U,P=W);else if(J<B&&0>o(Z,U))F[P]=Z,F[J]=U,P=J;else break e}}return G}function o(F,G){var U=F.sortIndex-G.sortIndex;return U!==0?U:F.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var h=Date,a=h.now();e.unstable_now=function(){return h.now()-a}}var l=[],d=[],p=1,f=null,g=3,S=!1,C=!1,w=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function E(F){for(var G=n(d);G!==null;){if(G.callback===null)s(d);else if(G.startTime<=F)s(d),G.sortIndex=G.expirationTime,t(l,G);else break;G=n(d)}}function T(F){if(w=!1,E(F),!C)if(n(l)!==null)C=!0,A||(A=!0,q());else{var G=n(d);G!==null&&$(T,G.startTime-F)}}var A=!1,M=-1,L=5,D=-1;function H(){return y?!0:!(e.unstable_now()-D<L)}function z(){if(y=!1,A){var F=e.unstable_now();D=F;var G=!0;try{e:{C=!1,w&&(w=!1,v(M),M=-1),S=!0;var U=g;try{t:{for(E(F),f=n(l);f!==null&&!(f.expirationTime>F&&H());){var P=f.callback;if(typeof P=="function"){f.callback=null,g=f.priorityLevel;var B=P(f.expirationTime<=F);if(F=e.unstable_now(),typeof B=="function"){f.callback=B,E(F),G=!0;break t}f===n(l)&&s(l),E(F)}else s(l);f=n(l)}if(f!==null)G=!0;else{var I=n(d);I!==null&&$(T,I.startTime-F),G=!1}}break e}finally{f=null,g=U,S=!1}G=void 0}}finally{G?q():A=!1}}}var q;if(typeof b=="function")q=function(){b(z)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,K=j.port2;j.port1.onmessage=z,q=function(){K.postMessage(null)}}else q=function(){x(z,0)};function $(F,G){M=x(function(){F(e.unstable_now())},G)}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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(F){switch(g){case 1:case 2:case 3:var G=3;break;default:G=g}var U=g;g=G;try{return F()}finally{g=U}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(F,G){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var U=g;g=F;try{return G()}finally{g=U}},e.unstable_scheduleCallback=function(F,G,U){var P=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?P+U:P):U=P,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=U+B,F={id:p++,callback:G,priorityLevel:F,startTime:U,expirationTime:B,sortIndex:-1},U>P?(F.sortIndex=U,t(d,F),n(l)===null&&F===n(d)&&(w?(v(M),M=-1):w=!0,$(T,U-P))):(F.sortIndex=B,t(l,F),C||S||(C=!0,A||(A=!0,q()))),F},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(F){var G=g;return function(){var U=g;g=G;try{return F.apply(this,arguments)}finally{g=U}}}})($g)),$g}var Qx;function cA(){return Qx||(Qx=1,Gg.exports=lA()),Gg.exports}var Kg={exports:{}},Xn={};var Zx;function uA(){if(Zx)return Xn;Zx=1;var e=Ju();function t(l){var d="https://react.dev/errors/"+l;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(l,d,p){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:f==null?null:""+f,children:l,containerInfo:d,implementation:p}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,d){if(l==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Xn.createPortal=function(l,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return u(l,d,null,p)},Xn.flushSync=function(l){var d=h.T,p=s.p;try{if(h.T=null,s.p=2,l)return l()}finally{h.T=d,s.p=p,s.d.f()}},Xn.preconnect=function(l,d){typeof l=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(l,d))},Xn.prefetchDNS=function(l){typeof l=="string"&&s.d.D(l)},Xn.preinit=function(l,d){if(typeof l=="string"&&d&&typeof d.as=="string"){var p=d.as,f=a(p,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,S=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?s.d.S(l,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:f,integrity:g,fetchPriority:S}):p==="script"&&s.d.X(l,{crossOrigin:f,integrity:g,fetchPriority:S,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Xn.preinitModule=function(l,d){if(typeof l=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=a(d.as,d.crossOrigin);s.d.M(l,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&s.d.M(l)},Xn.preload=function(l,d){if(typeof l=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,f=a(p,d.crossOrigin);s.d.L(l,p,{crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Xn.preloadModule=function(l,d){if(typeof l=="string")if(d){var p=a(d.as,d.crossOrigin);s.d.m(l,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else s.d.m(l)},Xn.requestFormReset=function(l){s.d.r(l)},Xn.unstable_batchedUpdates=function(l,d){return l(d)},Xn.useFormState=function(l,d,p){return h.H.useFormState(l,d,p)},Xn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Xn.version="19.2.3",Xn}var Jx;function $w(){if(Jx)return Kg.exports;Jx=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(),Kg.exports=uA(),Kg.exports}var eS;function dA(){if(eS)return pu;eS=1;var e=cA(),t=Ju(),n=$w();function s(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,c=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(c=i.return),r=i.return;while(r)}return i.tag===3?c:null}function h(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function a(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function l(r){if(u(r)!==r)throw Error(s(188))}function d(r){var i=r.alternate;if(!i){if(i=u(r),i===null)throw Error(s(188));return i!==r?null:r}for(var c=r,m=i;;){var k=c.return;if(k===null)break;var O=k.alternate;if(O===null){if(m=k.return,m!==null){c=m;continue}break}if(k.child===O.child){for(O=k.child;O;){if(O===c)return l(k),r;if(O===m)return l(k),i;O=O.sibling}throw Error(s(188))}if(c.return!==m.return)c=k,m=O;else{for(var N=!1,Q=k.child;Q;){if(Q===c){N=!0,c=k,m=O;break}if(Q===m){N=!0,m=k,c=O;break}Q=Q.sibling}if(!N){for(Q=O.child;Q;){if(Q===c){N=!0,c=O,m=k;break}if(Q===m){N=!0,m=O,c=k;break}Q=Q.sibling}if(!N)throw Error(s(189))}}if(c.alternate!==m)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?r:i}function p(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=p(r),i!==null)return i;r=r.sibling}return null}var f=Object.assign,g=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),b=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function q(r){return r===null||typeof r!="object"?null:(r=z&&r[z]||r["@@iterator"],typeof r=="function"?r:null)}var j=Symbol.for("react.client.reference");function K(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===j?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case x:return"Profiler";case y:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case D:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case C:return"Portal";case b:return r.displayName||"Context";case v:return(r._context.displayName||"Context")+".Consumer";case E:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case M:return i=r.displayName||null,i!==null?i:K(r.type)||"Memo";case L:i=r._payload,r=r._init;try{return K(r(i))}catch{}}return null}var $=Array.isArray,F=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},P=[],B=-1;function I(r){return{current:r}}function W(r){0>B||(r.current=P[B],P[B]=null,B--)}function Y(r,i){B++,P[B]=r.current,r.current=i}var J=I(null),Z=I(null),ee=I(null),X=I(null);function V(r,i){switch(Y(ee,i),Y(Z,r),Y(J,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?mx(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=mx(i),r=gx(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}W(J),Y(J,r)}function se(){W(J),W(Z),W(ee)}function ne(r){r.memoizedState!==null&&Y(X,r);var i=J.current,c=gx(i,r.type);i!==c&&(Y(Z,r),Y(J,c))}function re(r){Z.current===r&&(W(J),W(Z)),X.current===r&&(W(X),cu._currentValue=U)}var oe,le;function ve(r){if(oe===void 0)try{throw Error()}catch(c){var i=c.stack.trim().match(/\n( *(at )?)/);oe=i&&i[1]||"",le=-1<c.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+oe+r+le}var ue=!1;function he(r,i){if(!r||ue)return"";ue=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(i){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(ye){var ge=ye}Reflect.construct(r,[],Te)}else{try{Te.call()}catch(ye){ge=ye}r.call(Te.prototype)}}else{try{throw Error()}catch(ye){ge=ye}(Te=r())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(ye){if(ye&&ge&&typeof ye.stack=="string")return[ye.stack,ge.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=m.DetermineComponentFrameRoot(),N=O[0],Q=O[1];if(N&&Q){var ie=N.split(`
5
+ `),pe=Q.split(`
6
+ `);for(k=m=0;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;for(;k<pe.length&&!pe[k].includes("DetermineComponentFrameRoot");)k++;if(m===ie.length||k===pe.length)for(m=ie.length-1,k=pe.length-1;1<=m&&0<=k&&ie[m]!==pe[k];)k--;for(;1<=m&&0<=k;m--,k--)if(ie[m]!==pe[k]){if(m!==1||k!==1)do if(m--,k--,0>k||ie[m]!==pe[k]){var Se=`
7
+ `+ie[m].replace(" at new "," at ");return r.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",r.displayName)),Se}while(1<=m&&0<=k);break}}}finally{ue=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?ve(c):""}function de(r,i){switch(r.tag){case 26:case 27:case 5:return ve(r.type);case 16:return ve("Lazy");case 13:return r.child!==i&&i!==null?ve("Suspense Fallback"):ve("Suspense");case 19:return ve("SuspenseList");case 0:case 15:return he(r.type,!1);case 11:return he(r.type.render,!1);case 1:return he(r.type,!0);case 31:return ve("Activity");default:return""}}function Ne(r){try{var i="",c=null;do i+=de(r,c),c=r,r=r.return;while(r);return i}catch(m){return`
8
+ Error generating stack: `+m.message+`
9
+ `+m.stack}}var Me=Object.prototype.hasOwnProperty,Ae=e.unstable_scheduleCallback,be=e.unstable_cancelCallback,Oe=e.unstable_shouldYield,me=e.unstable_requestPaint,ke=e.unstable_now,Ce=e.unstable_getCurrentPriorityLevel,qe=e.unstable_ImmediatePriority,De=e.unstable_UserBlockingPriority,Ie=e.unstable_NormalPriority,rt=e.unstable_LowPriority,et=e.unstable_IdlePriority,dt=e.log,xe=e.unstable_setDisableYieldValue,Ve=null,Ee=null;function tt(r){if(typeof dt=="function"&&xe(r),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(Ve,r)}catch{}}var lt=Math.clz32?Math.clz32:Ct,Xe=Math.log,st=Math.LN2;function Ct(r){return r>>>=0,r===0?32:31-(Xe(r)/st|0)|0}var ct=256,nn=262144,Rt=4194304;function vt(r){var i=r&42;if(i!==0)return i;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Je(r,i,c){var m=r.pendingLanes;if(m===0)return 0;var k=0,O=r.suspendedLanes,N=r.pingedLanes;r=r.warmLanes;var Q=m&134217727;return Q!==0?(m=Q&~O,m!==0?k=vt(m):(N&=Q,N!==0?k=vt(N):c||(c=Q&~r,c!==0&&(k=vt(c))))):(Q=m&~O,Q!==0?k=vt(Q):N!==0?k=vt(N):c||(c=m&~r,c!==0&&(k=vt(c)))),k===0?0:i!==0&&i!==k&&(i&O)===0&&(O=k&-k,c=i&-i,O>=c||O===32&&(c&4194048)!==0)?i:k}function Ot(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function jt(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ot(){var r=Rt;return Rt<<=1,(Rt&62914560)===0&&(Rt=4194304),r}function wt(r){for(var i=[],c=0;31>c;c++)i.push(r);return i}function bt(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function xt(r,i,c,m,k,O){var N=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var Q=r.entanglements,ie=r.expirationTimes,pe=r.hiddenUpdates;for(c=N&~c;0<c;){var Se=31-lt(c),Te=1<<Se;Q[Se]=0,ie[Se]=-1;var ge=pe[Se];if(ge!==null)for(pe[Se]=null,Se=0;Se<ge.length;Se++){var ye=ge[Se];ye!==null&&(ye.lane&=-536870913)}c&=~Te}m!==0&&Qe(r,m,0),O!==0&&k===0&&r.tag!==0&&(r.suspendedLanes|=O&~(N&~i))}function Qe(r,i,c){r.pendingLanes|=i,r.suspendedLanes&=~i;var m=31-lt(i);r.entangledLanes|=i,r.entanglements[m]=r.entanglements[m]|1073741824|c&261930}function Ht(r,i){var c=r.entangledLanes|=i;for(r=r.entanglements;c;){var m=31-lt(c),k=1<<m;k&i|r[m]&i&&(r[m]|=i),c&=~k}}function Rn(r,i){var c=i&-i;return c=(c&42)!==0?1:Yn(c),(c&(r.suspendedLanes|i))!==0?0:c}function Yn(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function zn(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Es(){var r=G.p;return r!==0?r:(r=window.event,r===void 0?32:zx(r.type))}function Fa(r,i){var c=G.p;try{return G.p=r,i()}finally{G.p=c}}var Cr=Math.random().toString(36).slice(2),pn="__reactFiber$"+Cr,mn="__reactProps$"+Cr,ks="__reactContainer$"+Cr,wr="__reactEvents$"+Cr,Xs="__reactListeners$"+Cr,Np="__reactHandles$"+Cr,xc="__reactResources$"+Cr,Ro="__reactMarker$"+Cr;function To(r){delete r[pn],delete r[mn],delete r[wr],delete r[Xs],delete r[Np]}function Qs(r){var i=r[pn];if(i)return i;for(var c=r.parentNode;c;){if(i=c[ks]||c[pn]){if(c=i.alternate,i.child!==null||c!==null&&c.child!==null)for(r=Cx(r);r!==null;){if(c=r[pn])return c;r=Cx(r)}return i}r=c,c=r.parentNode}return null}function Rs(r){if(r=r[pn]||r[ks]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Lo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(s(33))}function ds(r){var i=r[xc];return i||(i=r[xc]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function gn(r){r[Ro]=!0}var tr=new Set,nr={};function Er(r,i){fs(r,i),fs(r+"Capture",i)}function fs(r,i){for(nr[r]=i,r=0;r<i.length;r++)tr.add(i[r])}var Bp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ua={},Wa={};function zp(r){return Me.call(Wa,r)?!0:Me.call(Ua,r)?!1:Bp.test(r)?Wa[r]=!0:(Ua[r]=!0,!1)}function Zs(r,i,c){if(zp(i))if(c===null)r.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var m=i.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+c)}}function Ti(r,i,c){if(c===null)r.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+c)}}function kr(r,i,c,m){if(m===null)r.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(i,c,""+m)}}function lr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function _d(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Hp(r,i,c){var m=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var k=m.get,O=m.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return k.call(this)},set:function(N){c=""+N,O.call(this,N)}}),Object.defineProperty(r,i,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(N){c=""+N},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Sc(r){if(!r._valueTracker){var i=_d(r)?"checked":"value";r._valueTracker=Hp(r,i,""+r[i])}}function qa(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var c=i.getValue(),m="";return r&&(m=_d(r)?r.checked?"true":"false":r.value),r=m,r!==c?(i.setValue(r),!0):!1}function Li(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}}var Cc=/[\n"\\]/g;function cr(r){return r.replace(Cc,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function wc(r,i,c,m,k,O,N,Q){r.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.type=N:r.removeAttribute("type"),i!=null?N==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+lr(i)):r.value!==""+lr(i)&&(r.value=""+lr(i)):N!=="submit"&&N!=="reset"||r.removeAttribute("value"),i!=null?Ec(r,N,lr(i)):c!=null?Ec(r,N,lr(c)):m!=null&&r.removeAttribute("value"),k==null&&O!=null&&(r.defaultChecked=!!O),k!=null&&(r.checked=k&&typeof k!="function"&&typeof k!="symbol"),Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?r.name=""+lr(Q):r.removeAttribute("name")}function yd(r,i,c,m,k,O,N,Q){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(r.type=O),i!=null||c!=null){if(!(O!=="submit"&&O!=="reset"||i!=null)){Sc(r);return}c=c!=null?""+lr(c):"",i=i!=null?""+lr(i):c,Q||i===r.value||(r.value=i),r.defaultValue=i}m=m??k,m=typeof m!="function"&&typeof m!="symbol"&&!!m,r.checked=Q?r.checked:!!m,r.defaultChecked=!!m,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(r.name=N),Sc(r)}function Ec(r,i,c){i==="number"&&Li(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Ai(r,i,c,m){if(r=r.options,i){i={};for(var k=0;k<c.length;k++)i["$"+c[k]]=!0;for(c=0;c<r.length;c++)k=i.hasOwnProperty("$"+r[c].value),r[c].selected!==k&&(r[c].selected=k),k&&m&&(r[c].defaultSelected=!0)}else{for(c=""+lr(c),i=null,k=0;k<r.length;k++){if(r[k].value===c){r[k].selected=!0,m&&(r[k].defaultSelected=!0);return}i!==null||r[k].disabled||(i=r[k])}i!==null&&(i.selected=!0)}}function bd(r,i,c){if(i!=null&&(i=""+lr(i),i!==r.value&&(r.value=i),c==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=c!=null?""+lr(c):""}function Ue(r,i,c,m){if(i==null){if(m!=null){if(c!=null)throw Error(s(92));if($(m)){if(1<m.length)throw Error(s(93));m=m[0]}c=m}c==null&&(c=""),i=c}c=lr(i),r.defaultValue=c,m=r.textContent,m===c&&m!==""&&m!==null&&(r.value=m),Sc(r)}function nt(r,i){if(i){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=i;return}}r.textContent=i}var mt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function $t(r,i,c){var m=i.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":m?r.setProperty(i,c):typeof c!="number"||c===0||mt.has(i)?i==="float"?r.cssFloat=c:r[i]=(""+c).trim():r[i]=c+"px"}function rn(r,i,c){if(i!=null&&typeof i!="object")throw Error(s(62));if(r=r.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||i!=null&&i.hasOwnProperty(m)||(m.indexOf("--")===0?r.setProperty(m,""):m==="float"?r.cssFloat="":r[m]="");for(var k in i)m=i[k],i.hasOwnProperty(k)&&c[k]!==m&&$t(r,k,m)}else for(var O in i)i.hasOwnProperty(O)&&$t(r,O,i[O])}function vn(r){if(r.indexOf("-")===-1)return!1;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 Js=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ei=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ti(r){return ei.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function hs(){}var xd=null;function Vp(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ga=null,$a=null;function py(r){var i=Rs(r);if(i&&(r=i.stateNode)){var c=r[mn]||null;e:switch(r=i.stateNode,i.type){case"input":if(wc(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),i=c.name,c.type==="radio"&&i!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+cr(""+i)+'"][type="radio"]'),i=0;i<c.length;i++){var m=c[i];if(m!==r&&m.form===r.form){var k=m[mn]||null;if(!k)throw Error(s(90));wc(m,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(i=0;i<c.length;i++)m=c[i],m.form===r.form&&qa(m)}break e;case"textarea":bd(r,c.value,c.defaultValue);break e;case"select":i=c.value,i!=null&&Ai(r,!!c.multiple,i,!1)}}}var Fp=!1;function my(r,i,c){if(Fp)return r(i,c);Fp=!0;try{var m=r(i);return m}finally{if(Fp=!1,(Ga!==null||$a!==null)&&(cf(),Ga&&(i=Ga,r=$a,$a=Ga=null,py(i),r)))for(i=0;i<r.length;i++)py(r[i])}}function kc(r,i){var c=r.stateNode;if(c===null)return null;var m=c[mn]||null;if(m===null)return null;c=m[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(r=r.type,m=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!m;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(s(231,i,typeof c));return c}var ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Up=!1;if(ni)try{var Rc={};Object.defineProperty(Rc,"passive",{get:function(){Up=!0}}),window.addEventListener("test",Rc,Rc),window.removeEventListener("test",Rc,Rc)}catch{Up=!1}var Oi=null,Wp=null,Sd=null;function gy(){if(Sd)return Sd;var r,i=Wp,c=i.length,m,k="value"in Oi?Oi.value:Oi.textContent,O=k.length;for(r=0;r<c&&i[r]===k[r];r++);var N=c-r;for(m=1;m<=N&&i[c-m]===k[O-m];m++);return Sd=k.slice(r,1<m?1-m:void 0)}function Cd(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function wd(){return!0}function vy(){return!1}function ur(r){function i(c,m,k,O,N){this._reactName=c,this._targetInst=k,this.type=m,this.nativeEvent=O,this.target=N,this.currentTarget=null;for(var Q in r)r.hasOwnProperty(Q)&&(c=r[Q],this[Q]=c?c(O):O[Q]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?wd:vy,this.isPropagationStopped=vy,this}return f(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=wd)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=wd)},persist:function(){},isPersistent:wd}),i}var Ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ed=ur(Ao),Tc=f({},Ao,{view:0,detail:0}),n5=ur(Tc),qp,Gp,Lc,kd=f({},Tc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kp,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!==Lc&&(Lc&&r.type==="mousemove"?(qp=r.screenX-Lc.screenX,Gp=r.screenY-Lc.screenY):Gp=qp=0,Lc=r),qp)},movementY:function(r){return"movementY"in r?r.movementY:Gp}}),_y=ur(kd),r5=f({},kd,{dataTransfer:0}),s5=ur(r5),i5=f({},Tc,{relatedTarget:0}),$p=ur(i5),o5=f({},Ao,{animationName:0,elapsedTime:0,pseudoElement:0}),a5=ur(o5),l5=f({},Ao,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),c5=ur(l5),u5=f({},Ao,{data:0}),yy=ur(u5),d5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f5={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"},h5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p5(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=h5[r])?!!i[r]:!1}function Kp(){return p5}var m5=f({},Tc,{key:function(r){if(r.key){var i=d5[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Cd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?f5[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kp,charCode:function(r){return r.type==="keypress"?Cd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Cd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),g5=ur(m5),v5=f({},kd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),by=ur(v5),_5=f({},Tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kp}),y5=ur(_5),b5=f({},Ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),x5=ur(b5),S5=f({},kd,{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}),C5=ur(S5),w5=f({},Ao,{newState:0,oldState:0}),E5=ur(w5),k5=[9,13,27,32],Yp=ni&&"CompositionEvent"in window,Ac=null;ni&&"documentMode"in document&&(Ac=document.documentMode);var R5=ni&&"TextEvent"in window&&!Ac,xy=ni&&(!Yp||Ac&&8<Ac&&11>=Ac),Sy=" ",Cy=!1;function wy(r,i){switch(r){case"keyup":return k5.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ey(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ka=!1;function T5(r,i){switch(r){case"compositionend":return Ey(i);case"keypress":return i.which!==32?null:(Cy=!0,Sy);case"textInput":return r=i.data,r===Sy&&Cy?null:r;default:return null}}function L5(r,i){if(Ka)return r==="compositionend"||!Yp&&wy(r,i)?(r=gy(),Sd=Wp=Oi=null,Ka=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return xy&&i.locale!=="ko"?null:i.data;default:return null}}var A5={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 ky(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!A5[r.type]:i==="textarea"}function Ry(r,i,c,m){Ga?$a?$a.push(m):$a=[m]:Ga=m,i=gf(i,"onChange"),0<i.length&&(c=new Ed("onChange","change",null,c,m),r.push({event:c,listeners:i}))}var Oc=null,Mc=null;function O5(r){cx(r,0)}function Rd(r){var i=Lo(r);if(qa(i))return r}function Ty(r,i){if(r==="change")return i}var Ly=!1;if(ni){var Xp;if(ni){var Qp="oninput"in document;if(!Qp){var Ay=document.createElement("div");Ay.setAttribute("oninput","return;"),Qp=typeof Ay.oninput=="function"}Xp=Qp}else Xp=!1;Ly=Xp&&(!document.documentMode||9<document.documentMode)}function Oy(){Oc&&(Oc.detachEvent("onpropertychange",My),Mc=Oc=null)}function My(r){if(r.propertyName==="value"&&Rd(Mc)){var i=[];Ry(i,Mc,r,Vp(r)),my(O5,i)}}function M5(r,i,c){r==="focusin"?(Oy(),Oc=i,Mc=c,Oc.attachEvent("onpropertychange",My)):r==="focusout"&&Oy()}function D5(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Rd(Mc)}function P5(r,i){if(r==="click")return Rd(i)}function I5(r,i){if(r==="input"||r==="change")return Rd(i)}function j5(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Rr=typeof Object.is=="function"?Object.is:j5;function Dc(r,i){if(Rr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var c=Object.keys(r),m=Object.keys(i);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var k=c[m];if(!Me.call(i,k)||!Rr(r[k],i[k]))return!1}return!0}function Dy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Py(r,i){var c=Dy(r);r=0;for(var m;c;){if(c.nodeType===3){if(m=r+c.textContent.length,r<=i&&m>=i)return{node:c,offset:i-r};r=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Dy(c)}}function Iy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Iy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function jy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Li(r.document);i instanceof r.HTMLIFrameElement;){try{var c=typeof i.contentWindow.location.href=="string"}catch{c=!1}if(c)r=i.contentWindow;else break;i=Li(r.document)}return i}function Zp(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var N5=ni&&"documentMode"in document&&11>=document.documentMode,Ya=null,Jp=null,Pc=null,em=!1;function Ny(r,i,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;em||Ya==null||Ya!==Li(m)||(m=Ya,"selectionStart"in m&&Zp(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Pc&&Dc(Pc,m)||(Pc=m,m=gf(Jp,"onSelect"),0<m.length&&(i=new Ed("onSelect","select",null,i,c),r.push({event:i,listeners:m}),i.target=Ya)))}function Oo(r,i){var c={};return c[r.toLowerCase()]=i.toLowerCase(),c["Webkit"+r]="webkit"+i,c["Moz"+r]="moz"+i,c}var Xa={animationend:Oo("Animation","AnimationEnd"),animationiteration:Oo("Animation","AnimationIteration"),animationstart:Oo("Animation","AnimationStart"),transitionrun:Oo("Transition","TransitionRun"),transitionstart:Oo("Transition","TransitionStart"),transitioncancel:Oo("Transition","TransitionCancel"),transitionend:Oo("Transition","TransitionEnd")},tm={},By={};ni&&(By=document.createElement("div").style,"AnimationEvent"in window||(delete Xa.animationend.animation,delete Xa.animationiteration.animation,delete Xa.animationstart.animation),"TransitionEvent"in window||delete Xa.transitionend.transition);function Mo(r){if(tm[r])return tm[r];if(!Xa[r])return r;var i=Xa[r],c;for(c in i)if(i.hasOwnProperty(c)&&c in By)return tm[r]=i[c];return r}var zy=Mo("animationend"),Hy=Mo("animationiteration"),Vy=Mo("animationstart"),B5=Mo("transitionrun"),z5=Mo("transitionstart"),H5=Mo("transitioncancel"),Fy=Mo("transitionend"),Uy=new Map,nm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");nm.push("scrollEnd");function ps(r,i){Uy.set(r,i),Er(i,[r])}var Td=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Wr=[],Qa=0,rm=0;function Ld(){for(var r=Qa,i=rm=Qa=0;i<r;){var c=Wr[i];Wr[i++]=null;var m=Wr[i];Wr[i++]=null;var k=Wr[i];Wr[i++]=null;var O=Wr[i];if(Wr[i++]=null,m!==null&&k!==null){var N=m.pending;N===null?k.next=k:(k.next=N.next,N.next=k),m.pending=k}O!==0&&Wy(c,k,O)}}function Ad(r,i,c,m){Wr[Qa++]=r,Wr[Qa++]=i,Wr[Qa++]=c,Wr[Qa++]=m,rm|=m,r.lanes|=m,r=r.alternate,r!==null&&(r.lanes|=m)}function sm(r,i,c,m){return Ad(r,i,c,m),Od(r)}function Do(r,i){return Ad(r,null,null,i),Od(r)}function Wy(r,i,c){r.lanes|=c;var m=r.alternate;m!==null&&(m.lanes|=c);for(var k=!1,O=r.return;O!==null;)O.childLanes|=c,m=O.alternate,m!==null&&(m.childLanes|=c),O.tag===22&&(r=O.stateNode,r===null||r._visibility&1||(k=!0)),r=O,O=O.return;return r.tag===3?(O=r.stateNode,k&&i!==null&&(k=31-lt(c),r=O.hiddenUpdates,m=r[k],m===null?r[k]=[i]:m.push(i),i.lane=c|536870912),O):null}function Od(r){if(50<nu)throw nu=0,hg=null,Error(s(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Za={};function V5(r,i,c,m){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(r,i,c,m){return new V5(r,i,c,m)}function im(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ri(r,i){var c=r.alternate;return c===null?(c=Tr(r.tag,i,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=i,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,i=r.dependencies,c.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function qy(r,i){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,i=c.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Md(r,i,c,m,k,O){var N=0;if(m=r,typeof r=="function")im(r)&&(N=1);else if(typeof r=="string")N=GL(r,c,J.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case D:return r=Tr(31,c,i,k),r.elementType=D,r.lanes=O,r;case w:return Po(c.children,k,O,i);case y:N=8,k|=24;break;case x:return r=Tr(12,c,i,k|2),r.elementType=x,r.lanes=O,r;case T:return r=Tr(13,c,i,k),r.elementType=T,r.lanes=O,r;case A:return r=Tr(19,c,i,k),r.elementType=A,r.lanes=O,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case b:N=10;break e;case v:N=9;break e;case E:N=11;break e;case M:N=14;break e;case L:N=16,m=null;break e}N=29,c=Error(s(130,r===null?"null":typeof r,"")),m=null}return i=Tr(N,c,i,k),i.elementType=r,i.type=m,i.lanes=O,i}function Po(r,i,c,m){return r=Tr(7,r,m,i),r.lanes=c,r}function om(r,i,c){return r=Tr(6,r,null,i),r.lanes=c,r}function Gy(r){var i=Tr(18,null,null,0);return i.stateNode=r,i}function am(r,i,c){return i=Tr(4,r.children!==null?r.children:[],r.key,i),i.lanes=c,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var $y=new WeakMap;function qr(r,i){if(typeof r=="object"&&r!==null){var c=$y.get(r);return c!==void 0?c:(i={value:r,source:i,stack:Ne(i)},$y.set(r,i),i)}return{value:r,source:i,stack:Ne(i)}}var Ja=[],el=0,Dd=null,Ic=0,Gr=[],$r=0,Mi=null,Ts=1,Ls="";function si(r,i){Ja[el++]=Ic,Ja[el++]=Dd,Dd=r,Ic=i}function Ky(r,i,c){Gr[$r++]=Ts,Gr[$r++]=Ls,Gr[$r++]=Mi,Mi=r;var m=Ts;r=Ls;var k=32-lt(m)-1;m&=~(1<<k),c+=1;var O=32-lt(i)+k;if(30<O){var N=k-k%5;O=(m&(1<<N)-1).toString(32),m>>=N,k-=N,Ts=1<<32-lt(i)+k|c<<k|m,Ls=O+r}else Ts=1<<O|c<<k|m,Ls=r}function lm(r){r.return!==null&&(si(r,1),Ky(r,1,0))}function cm(r){for(;r===Dd;)Dd=Ja[--el],Ja[el]=null,Ic=Ja[--el],Ja[el]=null;for(;r===Mi;)Mi=Gr[--$r],Gr[$r]=null,Ls=Gr[--$r],Gr[$r]=null,Ts=Gr[--$r],Gr[$r]=null}function Yy(r,i){Gr[$r++]=Ts,Gr[$r++]=Ls,Gr[$r++]=Mi,Ts=i.id,Ls=i.overflow,Mi=r}var Hn=null,Yt=null,At=!1,Di=null,Kr=!1,um=Error(s(519));function Pi(r){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jc(qr(i,r)),um}function Xy(r){var i=r.stateNode,c=r.type,m=r.memoizedProps;switch(i[pn]=r,i[mn]=m,c){case"dialog":kt("cancel",i),kt("close",i);break;case"iframe":case"object":case"embed":kt("load",i);break;case"video":case"audio":for(c=0;c<su.length;c++)kt(su[c],i);break;case"source":kt("error",i);break;case"img":case"image":case"link":kt("error",i),kt("load",i);break;case"details":kt("toggle",i);break;case"input":kt("invalid",i),yd(i,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":kt("invalid",i);break;case"textarea":kt("invalid",i),Ue(i,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||i.textContent===""+c||m.suppressHydrationWarning===!0||hx(i.textContent,c)?(m.popover!=null&&(kt("beforetoggle",i),kt("toggle",i)),m.onScroll!=null&&kt("scroll",i),m.onScrollEnd!=null&&kt("scrollend",i),m.onClick!=null&&(i.onclick=hs),i=!0):i=!1,i||Pi(r,!0)}function Qy(r){for(Hn=r.return;Hn;)switch(Hn.tag){case 5:case 31:case 13:Kr=!1;return;case 27:case 3:Kr=!0;return;default:Hn=Hn.return}}function tl(r){if(r!==Hn)return!1;if(!At)return Qy(r),At=!0,!1;var i=r.tag,c;if((c=i!==3&&i!==27)&&((c=i===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||Tg(r.type,r.memoizedProps)),c=!c),c&&Yt&&Pi(r),Qy(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=Sx(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=Sx(r)}else i===27?(i=Yt,Ki(r.type)?(r=Dg,Dg=null,Yt=r):Yt=i):Yt=Hn?Xr(r.stateNode.nextSibling):null;return!0}function Io(){Yt=Hn=null,At=!1}function dm(){var r=Di;return r!==null&&(pr===null?pr=r:pr.push.apply(pr,r),Di=null),r}function jc(r){Di===null?Di=[r]:Di.push(r)}var fm=I(null),jo=null,ii=null;function Ii(r,i,c){Y(fm,i._currentValue),i._currentValue=c}function oi(r){r._currentValue=fm.current,W(fm)}function hm(r,i,c){for(;r!==null;){var m=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,m!==null&&(m.childLanes|=i)):m!==null&&(m.childLanes&i)!==i&&(m.childLanes|=i),r===c)break;r=r.return}}function pm(r,i,c,m){var k=r.child;for(k!==null&&(k.return=r);k!==null;){var O=k.dependencies;if(O!==null){var N=k.child;O=O.firstContext;e:for(;O!==null;){var Q=O;O=k;for(var ie=0;ie<i.length;ie++)if(Q.context===i[ie]){O.lanes|=c,Q=O.alternate,Q!==null&&(Q.lanes|=c),hm(O.return,c,r),m||(N=null);break e}O=Q.next}}else if(k.tag===18){if(N=k.return,N===null)throw Error(s(341));N.lanes|=c,O=N.alternate,O!==null&&(O.lanes|=c),hm(N,c,r),N=null}else N=k.child;if(N!==null)N.return=k;else for(N=k;N!==null;){if(N===r){N=null;break}if(k=N.sibling,k!==null){k.return=N.return,N=k;break}N=N.return}k=N}}function nl(r,i,c,m){r=null;for(var k=i,O=!1;k!==null;){if(!O){if((k.flags&524288)!==0)O=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var N=k.alternate;if(N===null)throw Error(s(387));if(N=N.memoizedProps,N!==null){var Q=k.type;Rr(k.pendingProps.value,N.value)||(r!==null?r.push(Q):r=[Q])}}else if(k===X.current){if(N=k.alternate,N===null)throw Error(s(387));N.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(r!==null?r.push(cu):r=[cu])}k=k.return}r!==null&&pm(i,r,c,m),i.flags|=262144}function Pd(r){for(r=r.firstContext;r!==null;){if(!Rr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function No(r){jo=r,ii=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Vn(r){return Zy(jo,r)}function Id(r,i){return jo===null&&No(r),Zy(r,i)}function Zy(r,i){var c=i._currentValue;if(i={context:i,memoizedValue:c,next:null},ii===null){if(r===null)throw Error(s(308));ii=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ii=ii.next=i;return c}var F5=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(c,m){r.push(m)}};this.abort=function(){i.aborted=!0,r.forEach(function(c){return c()})}},U5=e.unstable_scheduleCallback,W5=e.unstable_NormalPriority,_n={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mm(){return{controller:new F5,data:new Map,refCount:0}}function Nc(r){r.refCount--,r.refCount===0&&U5(W5,function(){r.controller.abort()})}var Bc=null,gm=0,rl=0,sl=null;function q5(r,i){if(Bc===null){var c=Bc=[];gm=0,rl=yg(),sl={status:"pending",value:void 0,then:function(m){c.push(m)}}}return gm++,i.then(Jy,Jy),i}function Jy(){if(--gm===0&&Bc!==null){sl!==null&&(sl.status="fulfilled");var r=Bc;Bc=null,rl=0,sl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function G5(r,i){var c=[],m={status:"pending",value:null,reason:null,then:function(k){c.push(k)}};return r.then(function(){m.status="fulfilled",m.value=i;for(var k=0;k<c.length;k++)(0,c[k])(i)},function(k){for(m.status="rejected",m.reason=k,k=0;k<c.length;k++)(0,c[k])(void 0)}),m}var e1=F.S;F.S=function(r,i){Nb=ke(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&q5(r,i),e1!==null&&e1(r,i)};var Bo=I(null);function vm(){var r=Bo.current;return r!==null?r:qt.pooledCache}function jd(r,i){i===null?Y(Bo,Bo.current):Y(Bo,i.pool)}function t1(){var r=vm();return r===null?null:{parent:_n._currentValue,pool:r}}var il=Error(s(460)),_m=Error(s(474)),Nd=Error(s(542)),Bd={then:function(){}};function n1(r){return r=r.status,r==="fulfilled"||r==="rejected"}function r1(r,i,c){switch(c=r[c],c===void 0?r.push(i):c!==i&&(i.then(hs,hs),i=c),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,i1(r),r;default:if(typeof i.status=="string")i.then(hs,hs);else{if(r=qt,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=i,r.status="pending",r.then(function(m){if(i.status==="pending"){var k=i;k.status="fulfilled",k.value=m}},function(m){if(i.status==="pending"){var k=i;k.status="rejected",k.reason=m}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,i1(r),r}throw Ho=i,il}}function zo(r){try{var i=r._init;return i(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ho=c,il):c}}var Ho=null;function s1(){if(Ho===null)throw Error(s(459));var r=Ho;return Ho=null,r}function i1(r){if(r===il||r===Nd)throw Error(s(483))}var ol=null,zc=0;function zd(r){var i=zc;return zc+=1,ol===null&&(ol=[]),r1(ol,r,i)}function Hc(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Hd(r,i){throw i.$$typeof===g?Error(s(525)):(r=Object.prototype.toString.call(i),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function o1(r){function i(ce,ae){if(r){var fe=ce.deletions;fe===null?(ce.deletions=[ae],ce.flags|=16):fe.push(ae)}}function c(ce,ae){if(!r)return null;for(;ae!==null;)i(ce,ae),ae=ae.sibling;return null}function m(ce){for(var ae=new Map;ce!==null;)ce.key!==null?ae.set(ce.key,ce):ae.set(ce.index,ce),ce=ce.sibling;return ae}function k(ce,ae){return ce=ri(ce,ae),ce.index=0,ce.sibling=null,ce}function O(ce,ae,fe){return ce.index=fe,r?(fe=ce.alternate,fe!==null?(fe=fe.index,fe<ae?(ce.flags|=67108866,ae):fe):(ce.flags|=67108866,ae)):(ce.flags|=1048576,ae)}function N(ce){return r&&ce.alternate===null&&(ce.flags|=67108866),ce}function Q(ce,ae,fe,Re){return ae===null||ae.tag!==6?(ae=om(fe,ce.mode,Re),ae.return=ce,ae):(ae=k(ae,fe),ae.return=ce,ae)}function ie(ce,ae,fe,Re){var it=fe.type;return it===w?Se(ce,ae,fe.props.children,Re,fe.key):ae!==null&&(ae.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===L&&zo(it)===ae.type)?(ae=k(ae,fe.props),Hc(ae,fe),ae.return=ce,ae):(ae=Md(fe.type,fe.key,fe.props,null,ce.mode,Re),Hc(ae,fe),ae.return=ce,ae)}function pe(ce,ae,fe,Re){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==fe.containerInfo||ae.stateNode.implementation!==fe.implementation?(ae=am(fe,ce.mode,Re),ae.return=ce,ae):(ae=k(ae,fe.children||[]),ae.return=ce,ae)}function Se(ce,ae,fe,Re,it){return ae===null||ae.tag!==7?(ae=Po(fe,ce.mode,Re,it),ae.return=ce,ae):(ae=k(ae,fe),ae.return=ce,ae)}function Te(ce,ae,fe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=om(""+ae,ce.mode,fe),ae.return=ce,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case S:return fe=Md(ae.type,ae.key,ae.props,null,ce.mode,fe),Hc(fe,ae),fe.return=ce,fe;case C:return ae=am(ae,ce.mode,fe),ae.return=ce,ae;case L:return ae=zo(ae),Te(ce,ae,fe)}if($(ae)||q(ae))return ae=Po(ae,ce.mode,fe,null),ae.return=ce,ae;if(typeof ae.then=="function")return Te(ce,zd(ae),fe);if(ae.$$typeof===b)return Te(ce,Id(ce,ae),fe);Hd(ce,ae)}return null}function ge(ce,ae,fe,Re){var it=ae!==null?ae.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return it!==null?null:Q(ce,ae,""+fe,Re);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case S:return fe.key===it?ie(ce,ae,fe,Re):null;case C:return fe.key===it?pe(ce,ae,fe,Re):null;case L:return fe=zo(fe),ge(ce,ae,fe,Re)}if($(fe)||q(fe))return it!==null?null:Se(ce,ae,fe,Re,null);if(typeof fe.then=="function")return ge(ce,ae,zd(fe),Re);if(fe.$$typeof===b)return ge(ce,ae,Id(ce,fe),Re);Hd(ce,fe)}return null}function ye(ce,ae,fe,Re,it){if(typeof Re=="string"&&Re!==""||typeof Re=="number"||typeof Re=="bigint")return ce=ce.get(fe)||null,Q(ae,ce,""+Re,it);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case S:return ce=ce.get(Re.key===null?fe:Re.key)||null,ie(ae,ce,Re,it);case C:return ce=ce.get(Re.key===null?fe:Re.key)||null,pe(ae,ce,Re,it);case L:return Re=zo(Re),ye(ce,ae,fe,Re,it)}if($(Re)||q(Re))return ce=ce.get(fe)||null,Se(ae,ce,Re,it,null);if(typeof Re.then=="function")return ye(ce,ae,fe,zd(Re),it);if(Re.$$typeof===b)return ye(ce,ae,fe,Id(ae,Re),it);Hd(ae,Re)}return null}function $e(ce,ae,fe,Re){for(var it=null,Mt=null,Ze=ae,_t=ae=0,Lt=null;Ze!==null&&_t<fe.length;_t++){Ze.index>_t?(Lt=Ze,Ze=null):Lt=Ze.sibling;var Dt=ge(ce,Ze,fe[_t],Re);if(Dt===null){Ze===null&&(Ze=Lt);break}r&&Ze&&Dt.alternate===null&&i(ce,Ze),ae=O(Dt,ae,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt,Ze=Lt}if(_t===fe.length)return c(ce,Ze),At&&si(ce,_t),it;if(Ze===null){for(;_t<fe.length;_t++)Ze=Te(ce,fe[_t],Re),Ze!==null&&(ae=O(Ze,ae,_t),Mt===null?it=Ze:Mt.sibling=Ze,Mt=Ze);return At&&si(ce,_t),it}for(Ze=m(Ze);_t<fe.length;_t++)Lt=ye(Ze,ce,_t,fe[_t],Re),Lt!==null&&(r&&Lt.alternate!==null&&Ze.delete(Lt.key===null?_t:Lt.key),ae=O(Lt,ae,_t),Mt===null?it=Lt:Mt.sibling=Lt,Mt=Lt);return r&&Ze.forEach(function(Ji){return i(ce,Ji)}),At&&si(ce,_t),it}function ut(ce,ae,fe,Re){if(fe==null)throw Error(s(151));for(var it=null,Mt=null,Ze=ae,_t=ae=0,Lt=null,Dt=fe.next();Ze!==null&&!Dt.done;_t++,Dt=fe.next()){Ze.index>_t?(Lt=Ze,Ze=null):Lt=Ze.sibling;var Ji=ge(ce,Ze,Dt.value,Re);if(Ji===null){Ze===null&&(Ze=Lt);break}r&&Ze&&Ji.alternate===null&&i(ce,Ze),ae=O(Ji,ae,_t),Mt===null?it=Ji:Mt.sibling=Ji,Mt=Ji,Ze=Lt}if(Dt.done)return c(ce,Ze),At&&si(ce,_t),it;if(Ze===null){for(;!Dt.done;_t++,Dt=fe.next())Dt=Te(ce,Dt.value,Re),Dt!==null&&(ae=O(Dt,ae,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt);return At&&si(ce,_t),it}for(Ze=m(Ze);!Dt.done;_t++,Dt=fe.next())Dt=ye(Ze,ce,_t,Dt.value,Re),Dt!==null&&(r&&Dt.alternate!==null&&Ze.delete(Dt.key===null?_t:Dt.key),ae=O(Dt,ae,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt);return r&&Ze.forEach(function(rA){return i(ce,rA)}),At&&si(ce,_t),it}function Ut(ce,ae,fe,Re){if(typeof fe=="object"&&fe!==null&&fe.type===w&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case S:e:{for(var it=fe.key;ae!==null;){if(ae.key===it){if(it=fe.type,it===w){if(ae.tag===7){c(ce,ae.sibling),Re=k(ae,fe.props.children),Re.return=ce,ce=Re;break e}}else if(ae.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===L&&zo(it)===ae.type){c(ce,ae.sibling),Re=k(ae,fe.props),Hc(Re,fe),Re.return=ce,ce=Re;break e}c(ce,ae);break}else i(ce,ae);ae=ae.sibling}fe.type===w?(Re=Po(fe.props.children,ce.mode,Re,fe.key),Re.return=ce,ce=Re):(Re=Md(fe.type,fe.key,fe.props,null,ce.mode,Re),Hc(Re,fe),Re.return=ce,ce=Re)}return N(ce);case C:e:{for(it=fe.key;ae!==null;){if(ae.key===it)if(ae.tag===4&&ae.stateNode.containerInfo===fe.containerInfo&&ae.stateNode.implementation===fe.implementation){c(ce,ae.sibling),Re=k(ae,fe.children||[]),Re.return=ce,ce=Re;break e}else{c(ce,ae);break}else i(ce,ae);ae=ae.sibling}Re=am(fe,ce.mode,Re),Re.return=ce,ce=Re}return N(ce);case L:return fe=zo(fe),Ut(ce,ae,fe,Re)}if($(fe))return $e(ce,ae,fe,Re);if(q(fe)){if(it=q(fe),typeof it!="function")throw Error(s(150));return fe=it.call(fe),ut(ce,ae,fe,Re)}if(typeof fe.then=="function")return Ut(ce,ae,zd(fe),Re);if(fe.$$typeof===b)return Ut(ce,ae,Id(ce,fe),Re);Hd(ce,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,ae!==null&&ae.tag===6?(c(ce,ae.sibling),Re=k(ae,fe),Re.return=ce,ce=Re):(c(ce,ae),Re=om(fe,ce.mode,Re),Re.return=ce,ce=Re),N(ce)):c(ce,ae)}return function(ce,ae,fe,Re){try{zc=0;var it=Ut(ce,ae,fe,Re);return ol=null,it}catch(Ze){if(Ze===il||Ze===Nd)throw Ze;var Mt=Tr(29,Ze,null,ce.mode);return Mt.lanes=Re,Mt.return=ce,Mt}}}var Vo=o1(!0),a1=o1(!1),ji=!1;function ym(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bm(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ni(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Bi(r,i,c){var m=r.updateQueue;if(m===null)return null;if(m=m.shared,(It&2)!==0){var k=m.pending;return k===null?i.next=i:(i.next=k.next,k.next=i),m.pending=i,i=Od(r),Wy(r,null,c),i}return Ad(r,m,i,c),Od(r)}function Vc(r,i,c){if(i=i.updateQueue,i!==null&&(i=i.shared,(c&4194048)!==0)){var m=i.lanes;m&=r.pendingLanes,c|=m,i.lanes=c,Ht(r,c)}}function xm(r,i){var c=r.updateQueue,m=r.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var k=null,O=null;if(c=c.firstBaseUpdate,c!==null){do{var N={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};O===null?k=O=N:O=O.next=N,c=c.next}while(c!==null);O===null?k=O=i:O=O.next=i}else k=O=i;c={baseState:m.baseState,firstBaseUpdate:k,lastBaseUpdate:O,shared:m.shared,callbacks:m.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=i:r.next=i,c.lastBaseUpdate=i}var Sm=!1;function Fc(){if(Sm){var r=sl;if(r!==null)throw r}}function Uc(r,i,c,m){Sm=!1;var k=r.updateQueue;ji=!1;var O=k.firstBaseUpdate,N=k.lastBaseUpdate,Q=k.shared.pending;if(Q!==null){k.shared.pending=null;var ie=Q,pe=ie.next;ie.next=null,N===null?O=pe:N.next=pe,N=ie;var Se=r.alternate;Se!==null&&(Se=Se.updateQueue,Q=Se.lastBaseUpdate,Q!==N&&(Q===null?Se.firstBaseUpdate=pe:Q.next=pe,Se.lastBaseUpdate=ie))}if(O!==null){var Te=k.baseState;N=0,Se=pe=ie=null,Q=O;do{var ge=Q.lane&-536870913,ye=ge!==Q.lane;if(ye?(Tt&ge)===ge:(m&ge)===ge){ge!==0&&ge===rl&&(Sm=!0),Se!==null&&(Se=Se.next={lane:0,tag:Q.tag,payload:Q.payload,callback:null,next:null});e:{var $e=r,ut=Q;ge=i;var Ut=c;switch(ut.tag){case 1:if($e=ut.payload,typeof $e=="function"){Te=$e.call(Ut,Te,ge);break e}Te=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=ut.payload,ge=typeof $e=="function"?$e.call(Ut,Te,ge):$e,ge==null)break e;Te=f({},Te,ge);break e;case 2:ji=!0}}ge=Q.callback,ge!==null&&(r.flags|=64,ye&&(r.flags|=8192),ye=k.callbacks,ye===null?k.callbacks=[ge]:ye.push(ge))}else ye={lane:ge,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},Se===null?(pe=Se=ye,ie=Te):Se=Se.next=ye,N|=ge;if(Q=Q.next,Q===null){if(Q=k.shared.pending,Q===null)break;ye=Q,Q=ye.next,ye.next=null,k.lastBaseUpdate=ye,k.shared.pending=null}}while(!0);Se===null&&(ie=Te),k.baseState=ie,k.firstBaseUpdate=pe,k.lastBaseUpdate=Se,O===null&&(k.shared.lanes=0),Ui|=N,r.lanes=N,r.memoizedState=Te}}function l1(r,i){if(typeof r!="function")throw Error(s(191,r));r.call(i)}function c1(r,i){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)l1(c[r],i)}var al=I(null),Vd=I(0);function u1(r,i){r=mi,Y(Vd,r),Y(al,i),mi=r|i.baseLanes}function Cm(){Y(Vd,mi),Y(al,al.current)}function wm(){mi=Vd.current,W(al),W(Vd)}var Lr=I(null),Yr=null;function zi(r){var i=r.alternate;Y(cn,cn.current&1),Y(Lr,r),Yr===null&&(i===null||al.current!==null||i.memoizedState!==null)&&(Yr=r)}function Em(r){Y(cn,cn.current),Y(Lr,r),Yr===null&&(Yr=r)}function d1(r){r.tag===22?(Y(cn,cn.current),Y(Lr,r),Yr===null&&(Yr=r)):Hi()}function Hi(){Y(cn,cn.current),Y(Lr,Lr.current)}function Ar(r){W(Lr),Yr===r&&(Yr=null),W(cn)}var cn=I(0);function Fd(r){for(var i=r;i!==null;){if(i.tag===13){var c=i.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Og(c)||Mg(c)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ai=0,gt=null,Vt=null,yn=null,Ud=!1,ll=!1,Fo=!1,Wd=0,Wc=0,cl=null,$5=0;function an(){throw Error(s(321))}function km(r,i){if(i===null)return!1;for(var c=0;c<i.length&&c<r.length;c++)if(!Rr(r[c],i[c]))return!1;return!0}function Rm(r,i,c,m,k,O){return ai=O,gt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,F.H=r===null||r.memoizedState===null?K1:Fm,Fo=!1,O=c(m,k),Fo=!1,ll&&(O=h1(i,c,m,k)),f1(r),O}function f1(r){F.H=$c;var i=Vt!==null&&Vt.next!==null;if(ai=0,yn=Vt=gt=null,Ud=!1,Wc=0,cl=null,i)throw Error(s(300));r===null||bn||(r=r.dependencies,r!==null&&Pd(r)&&(bn=!0))}function h1(r,i,c,m){gt=r;var k=0;do{if(ll&&(cl=null),Wc=0,ll=!1,25<=k)throw Error(s(301));if(k+=1,yn=Vt=null,r.updateQueue!=null){var O=r.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}F.H=Y1,O=i(c,m)}while(ll);return O}function K5(){var r=F.H,i=r.useState()[0];return i=typeof i.then=="function"?qc(i):i,r=r.useState()[0],(Vt!==null?Vt.memoizedState:null)!==r&&(gt.flags|=1024),i}function Tm(){var r=Wd!==0;return Wd=0,r}function Lm(r,i,c){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~c}function Am(r){if(Ud){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ud=!1}ai=0,yn=Vt=gt=null,ll=!1,Wc=Wd=0,cl=null}function rr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yn===null?gt.memoizedState=yn=r:yn=yn.next=r,yn}function un(){if(Vt===null){var r=gt.alternate;r=r!==null?r.memoizedState:null}else r=Vt.next;var i=yn===null?gt.memoizedState:yn.next;if(i!==null)yn=i,Vt=r;else{if(r===null)throw gt.alternate===null?Error(s(467)):Error(s(310));Vt=r,r={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},yn===null?gt.memoizedState=yn=r:yn=yn.next=r}return yn}function qd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qc(r){var i=Wc;return Wc+=1,cl===null&&(cl=[]),r=r1(cl,r,i),i=gt,(yn===null?i.memoizedState:yn.next)===null&&(i=i.alternate,F.H=i===null||i.memoizedState===null?K1:Fm),r}function Gd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return qc(r);if(r.$$typeof===b)return Vn(r)}throw Error(s(438,String(r)))}function Om(r){var i=null,c=gt.updateQueue;if(c!==null&&(i=c.memoCache),i==null){var m=gt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(i={data:m.data.map(function(k){return k.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),c===null&&(c=qd(),gt.updateQueue=c),c.memoCache=i,c=i.data[i.index],c===void 0)for(c=i.data[i.index]=Array(r),m=0;m<r;m++)c[m]=H;return i.index++,c}function li(r,i){return typeof i=="function"?i(r):i}function $d(r){var i=un();return Mm(i,Vt,r)}function Mm(r,i,c){var m=r.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=c;var k=r.baseQueue,O=m.pending;if(O!==null){if(k!==null){var N=k.next;k.next=O.next,O.next=N}i.baseQueue=k=O,m.pending=null}if(O=r.baseState,k===null)r.memoizedState=O;else{i=k.next;var Q=N=null,ie=null,pe=i,Se=!1;do{var Te=pe.lane&-536870913;if(Te!==pe.lane?(Tt&Te)===Te:(ai&Te)===Te){var ge=pe.revertLane;if(ge===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null}),Te===rl&&(Se=!0);else if((ai&ge)===ge){pe=pe.next,ge===rl&&(Se=!0);continue}else Te={lane:0,revertLane:pe.revertLane,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ie===null?(Q=ie=Te,N=O):ie=ie.next=Te,gt.lanes|=ge,Ui|=ge;Te=pe.action,Fo&&c(O,Te),O=pe.hasEagerState?pe.eagerState:c(O,Te)}else ge={lane:Te,revertLane:pe.revertLane,gesture:pe.gesture,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ie===null?(Q=ie=ge,N=O):ie=ie.next=ge,gt.lanes|=Te,Ui|=Te;pe=pe.next}while(pe!==null&&pe!==i);if(ie===null?N=O:ie.next=Q,!Rr(O,r.memoizedState)&&(bn=!0,Se&&(c=sl,c!==null)))throw c;r.memoizedState=O,r.baseState=N,r.baseQueue=ie,m.lastRenderedState=O}return k===null&&(m.lanes=0),[r.memoizedState,m.dispatch]}function Dm(r){var i=un(),c=i.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var m=c.dispatch,k=c.pending,O=i.memoizedState;if(k!==null){c.pending=null;var N=k=k.next;do O=r(O,N.action),N=N.next;while(N!==k);Rr(O,i.memoizedState)||(bn=!0),i.memoizedState=O,i.baseQueue===null&&(i.baseState=O),c.lastRenderedState=O}return[O,m]}function p1(r,i,c){var m=gt,k=un(),O=At;if(O){if(c===void 0)throw Error(s(407));c=c()}else c=i();var N=!Rr((Vt||k).memoizedState,c);if(N&&(k.memoizedState=c,bn=!0),k=k.queue,jm(v1.bind(null,m,k,r),[r]),k.getSnapshot!==i||N||yn!==null&&yn.memoizedState.tag&1){if(m.flags|=2048,ul(9,{destroy:void 0},g1.bind(null,m,k,c,i),null),qt===null)throw Error(s(349));O||(ai&127)!==0||m1(m,i,c)}return c}function m1(r,i,c){r.flags|=16384,r={getSnapshot:i,value:c},i=gt.updateQueue,i===null?(i=qd(),gt.updateQueue=i,i.stores=[r]):(c=i.stores,c===null?i.stores=[r]:c.push(r))}function g1(r,i,c,m){i.value=c,i.getSnapshot=m,_1(i)&&y1(r)}function v1(r,i,c){return c(function(){_1(i)&&y1(r)})}function _1(r){var i=r.getSnapshot;r=r.value;try{var c=i();return!Rr(r,c)}catch{return!0}}function y1(r){var i=Do(r,2);i!==null&&mr(i,r,2)}function Pm(r){var i=rr();if(typeof r=="function"){var c=r;if(r=c(),Fo){tt(!0);try{c()}finally{tt(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:r},i}function b1(r,i,c,m){return r.baseState=c,Mm(r,Vt,typeof m=="function"?m:li)}function Y5(r,i,c,m,k){if(Xd(r))throw Error(s(485));if(r=i.action,r!==null){var O={payload:k,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){O.listeners.push(N)}};F.T!==null?c(!0):O.isTransition=!1,m(O),c=i.pending,c===null?(O.next=i.pending=O,x1(i,O)):(O.next=c.next,i.pending=c.next=O)}}function x1(r,i){var c=i.action,m=i.payload,k=r.state;if(i.isTransition){var O=F.T,N={};F.T=N;try{var Q=c(k,m),ie=F.S;ie!==null&&ie(N,Q),S1(r,i,Q)}catch(pe){Im(r,i,pe)}finally{O!==null&&N.types!==null&&(O.types=N.types),F.T=O}}else try{O=c(k,m),S1(r,i,O)}catch(pe){Im(r,i,pe)}}function S1(r,i,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){C1(r,i,m)},function(m){return Im(r,i,m)}):C1(r,i,c)}function C1(r,i,c){i.status="fulfilled",i.value=c,w1(i),r.state=c,i=r.pending,i!==null&&(c=i.next,c===i?r.pending=null:(c=c.next,i.next=c,x1(r,c)))}function Im(r,i,c){var m=r.pending;if(r.pending=null,m!==null){m=m.next;do i.status="rejected",i.reason=c,w1(i),i=i.next;while(i!==m)}r.action=null}function w1(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function E1(r,i){return i}function k1(r,i){if(At){var c=qt.formState;if(c!==null){e:{var m=gt;if(At){if(Yt){t:{for(var k=Yt,O=Kr;k.nodeType!==8;){if(!O){k=null;break t}if(k=Xr(k.nextSibling),k===null){k=null;break t}}O=k.data,k=O==="F!"||O==="F"?k:null}if(k){Yt=Xr(k.nextSibling),m=k.data==="F!";break e}}Pi(m)}m=!1}m&&(i=c[0])}}return c=rr(),c.memoizedState=c.baseState=i,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:E1,lastRenderedState:i},c.queue=m,c=q1.bind(null,gt,m),m.dispatch=c,m=Pm(!1),O=Vm.bind(null,gt,!1,m.queue),m=rr(),k={state:i,dispatch:null,action:r,pending:null},m.queue=k,c=Y5.bind(null,gt,k,O,c),k.dispatch=c,m.memoizedState=r,[i,c,!1]}function R1(r){var i=un();return T1(i,Vt,r)}function T1(r,i,c){if(i=Mm(r,i,E1)[0],r=$d(li)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=qc(i)}catch(N){throw N===il?Nd:N}else m=i;i=un();var k=i.queue,O=k.dispatch;return c!==i.memoizedState&&(gt.flags|=2048,ul(9,{destroy:void 0},X5.bind(null,k,c),null)),[m,O,r]}function X5(r,i){r.action=i}function L1(r){var i=un(),c=Vt;if(c!==null)return T1(i,c,r);un(),i=i.memoizedState,c=un();var m=c.queue.dispatch;return c.memoizedState=r,[i,m,!1]}function ul(r,i,c,m){return r={tag:r,create:c,deps:m,inst:i,next:null},i=gt.updateQueue,i===null&&(i=qd(),gt.updateQueue=i),c=i.lastEffect,c===null?i.lastEffect=r.next=r:(m=c.next,c.next=r,r.next=m,i.lastEffect=r),r}function A1(){return un().memoizedState}function Kd(r,i,c,m){var k=rr();gt.flags|=r,k.memoizedState=ul(1|i,{destroy:void 0},c,m===void 0?null:m)}function Yd(r,i,c,m){var k=un();m=m===void 0?null:m;var O=k.memoizedState.inst;Vt!==null&&m!==null&&km(m,Vt.memoizedState.deps)?k.memoizedState=ul(i,O,c,m):(gt.flags|=r,k.memoizedState=ul(1|i,O,c,m))}function O1(r,i){Kd(8390656,8,r,i)}function jm(r,i){Yd(2048,8,r,i)}function Q5(r){gt.flags|=4;var i=gt.updateQueue;if(i===null)i=qd(),gt.updateQueue=i,i.events=[r];else{var c=i.events;c===null?i.events=[r]:c.push(r)}}function M1(r){var i=un().memoizedState;return Q5({ref:i,nextImpl:r}),function(){if((It&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function D1(r,i){return Yd(4,2,r,i)}function P1(r,i){return Yd(4,4,r,i)}function I1(r,i){if(typeof i=="function"){r=r();var c=i(r);return function(){typeof c=="function"?c():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function j1(r,i,c){c=c!=null?c.concat([r]):null,Yd(4,4,I1.bind(null,i,r),c)}function Nm(){}function N1(r,i){var c=un();i=i===void 0?null:i;var m=c.memoizedState;return i!==null&&km(i,m[1])?m[0]:(c.memoizedState=[r,i],r)}function B1(r,i){var c=un();i=i===void 0?null:i;var m=c.memoizedState;if(i!==null&&km(i,m[1]))return m[0];if(m=r(),Fo){tt(!0);try{r()}finally{tt(!1)}}return c.memoizedState=[m,i],m}function Bm(r,i,c){return c===void 0||(ai&1073741824)!==0&&(Tt&261930)===0?r.memoizedState=i:(r.memoizedState=c,r=zb(),gt.lanes|=r,Ui|=r,c)}function z1(r,i,c,m){return Rr(c,i)?c:al.current!==null?(r=Bm(r,c,m),Rr(r,i)||(bn=!0),r):(ai&42)===0||(ai&1073741824)!==0&&(Tt&261930)===0?(bn=!0,r.memoizedState=c):(r=zb(),gt.lanes|=r,Ui|=r,i)}function H1(r,i,c,m,k){var O=G.p;G.p=O!==0&&8>O?O:8;var N=F.T,Q={};F.T=Q,Vm(r,!1,i,c);try{var ie=k(),pe=F.S;if(pe!==null&&pe(Q,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Se=G5(ie,m);Gc(r,i,Se,Dr(r))}else Gc(r,i,m,Dr(r))}catch(Te){Gc(r,i,{then:function(){},status:"rejected",reason:Te},Dr())}finally{G.p=O,N!==null&&Q.types!==null&&(N.types=Q.types),F.T=N}}function Z5(){}function zm(r,i,c,m){if(r.tag!==5)throw Error(s(476));var k=V1(r).queue;H1(r,k,i,U,c===null?Z5:function(){return F1(r),c(m)})}function V1(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:U},next:null};var c={};return i.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:c},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function F1(r){var i=V1(r);i.next===null&&(i=r.alternate.memoizedState),Gc(r,i.next.queue,{},Dr())}function Hm(){return Vn(cu)}function U1(){return un().memoizedState}function W1(){return un().memoizedState}function J5(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var c=Dr();r=Ni(c);var m=Bi(i,r,c);m!==null&&(mr(m,i,c),Vc(m,i,c)),i={cache:mm()},r.payload=i;return}i=i.return}}function eL(r,i,c){var m=Dr();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Xd(r)?G1(i,c):(c=sm(r,i,c,m),c!==null&&(mr(c,r,m),$1(c,i,m)))}function q1(r,i,c){var m=Dr();Gc(r,i,c,m)}function Gc(r,i,c,m){var k={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Xd(r))G1(i,k);else{var O=r.alternate;if(r.lanes===0&&(O===null||O.lanes===0)&&(O=i.lastRenderedReducer,O!==null))try{var N=i.lastRenderedState,Q=O(N,c);if(k.hasEagerState=!0,k.eagerState=Q,Rr(Q,N))return Ad(r,i,k,0),qt===null&&Ld(),!1}catch{}if(c=sm(r,i,k,m),c!==null)return mr(c,r,m),$1(c,i,m),!0}return!1}function Vm(r,i,c,m){if(m={lane:2,revertLane:yg(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Xd(r)){if(i)throw Error(s(479))}else i=sm(r,c,m,2),i!==null&&mr(i,r,2)}function Xd(r){var i=r.alternate;return r===gt||i!==null&&i===gt}function G1(r,i){ll=Ud=!0;var c=r.pending;c===null?i.next=i:(i.next=c.next,c.next=i),r.pending=i}function $1(r,i,c){if((c&4194048)!==0){var m=i.lanes;m&=r.pendingLanes,c|=m,i.lanes=c,Ht(r,c)}}var $c={readContext:Vn,use:Gd,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useLayoutEffect:an,useInsertionEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useSyncExternalStore:an,useId:an,useHostTransitionStatus:an,useFormState:an,useActionState:an,useOptimistic:an,useMemoCache:an,useCacheRefresh:an};$c.useEffectEvent=an;var K1={readContext:Vn,use:Gd,useCallback:function(r,i){return rr().memoizedState=[r,i===void 0?null:i],r},useContext:Vn,useEffect:O1,useImperativeHandle:function(r,i,c){c=c!=null?c.concat([r]):null,Kd(4194308,4,I1.bind(null,i,r),c)},useLayoutEffect:function(r,i){return Kd(4194308,4,r,i)},useInsertionEffect:function(r,i){Kd(4,2,r,i)},useMemo:function(r,i){var c=rr();i=i===void 0?null:i;var m=r();if(Fo){tt(!0);try{r()}finally{tt(!1)}}return c.memoizedState=[m,i],m},useReducer:function(r,i,c){var m=rr();if(c!==void 0){var k=c(i);if(Fo){tt(!0);try{c(i)}finally{tt(!1)}}}else k=i;return m.memoizedState=m.baseState=k,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:k},m.queue=r,r=r.dispatch=eL.bind(null,gt,r),[m.memoizedState,r]},useRef:function(r){var i=rr();return r={current:r},i.memoizedState=r},useState:function(r){r=Pm(r);var i=r.queue,c=q1.bind(null,gt,i);return i.dispatch=c,[r.memoizedState,c]},useDebugValue:Nm,useDeferredValue:function(r,i){var c=rr();return Bm(c,r,i)},useTransition:function(){var r=Pm(!1);return r=H1.bind(null,gt,r.queue,!0,!1),rr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,c){var m=gt,k=rr();if(At){if(c===void 0)throw Error(s(407));c=c()}else{if(c=i(),qt===null)throw Error(s(349));(Tt&127)!==0||m1(m,i,c)}k.memoizedState=c;var O={value:c,getSnapshot:i};return k.queue=O,O1(v1.bind(null,m,O,r),[r]),m.flags|=2048,ul(9,{destroy:void 0},g1.bind(null,m,O,c,i),null),c},useId:function(){var r=rr(),i=qt.identifierPrefix;if(At){var c=Ls,m=Ts;c=(m&~(1<<32-lt(m)-1)).toString(32)+c,i="_"+i+"R_"+c,c=Wd++,0<c&&(i+="H"+c.toString(32)),i+="_"}else c=$5++,i="_"+i+"r_"+c.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Hm,useFormState:k1,useActionState:k1,useOptimistic:function(r){var i=rr();i.memoizedState=i.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=c,i=Vm.bind(null,gt,!0,c),c.dispatch=i,[r,i]},useMemoCache:Om,useCacheRefresh:function(){return rr().memoizedState=J5.bind(null,gt)},useEffectEvent:function(r){var i=rr(),c={impl:r};return i.memoizedState=c,function(){if((It&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Fm={readContext:Vn,use:Gd,useCallback:N1,useContext:Vn,useEffect:jm,useImperativeHandle:j1,useInsertionEffect:D1,useLayoutEffect:P1,useMemo:B1,useReducer:$d,useRef:A1,useState:function(){return $d(li)},useDebugValue:Nm,useDeferredValue:function(r,i){var c=un();return z1(c,Vt.memoizedState,r,i)},useTransition:function(){var r=$d(li)[0],i=un().memoizedState;return[typeof r=="boolean"?r:qc(r),i]},useSyncExternalStore:p1,useId:U1,useHostTransitionStatus:Hm,useFormState:R1,useActionState:R1,useOptimistic:function(r,i){var c=un();return b1(c,Vt,r,i)},useMemoCache:Om,useCacheRefresh:W1};Fm.useEffectEvent=M1;var Y1={readContext:Vn,use:Gd,useCallback:N1,useContext:Vn,useEffect:jm,useImperativeHandle:j1,useInsertionEffect:D1,useLayoutEffect:P1,useMemo:B1,useReducer:Dm,useRef:A1,useState:function(){return Dm(li)},useDebugValue:Nm,useDeferredValue:function(r,i){var c=un();return Vt===null?Bm(c,r,i):z1(c,Vt.memoizedState,r,i)},useTransition:function(){var r=Dm(li)[0],i=un().memoizedState;return[typeof r=="boolean"?r:qc(r),i]},useSyncExternalStore:p1,useId:U1,useHostTransitionStatus:Hm,useFormState:L1,useActionState:L1,useOptimistic:function(r,i){var c=un();return Vt!==null?b1(c,Vt,r,i):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:Om,useCacheRefresh:W1};Y1.useEffectEvent=M1;function Um(r,i,c,m){i=r.memoizedState,c=c(m,i),c=c==null?i:f({},i,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Wm={enqueueSetState:function(r,i,c){r=r._reactInternals;var m=Dr(),k=Ni(m);k.payload=i,c!=null&&(k.callback=c),i=Bi(r,k,m),i!==null&&(mr(i,r,m),Vc(i,r,m))},enqueueReplaceState:function(r,i,c){r=r._reactInternals;var m=Dr(),k=Ni(m);k.tag=1,k.payload=i,c!=null&&(k.callback=c),i=Bi(r,k,m),i!==null&&(mr(i,r,m),Vc(i,r,m))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var c=Dr(),m=Ni(c);m.tag=2,i!=null&&(m.callback=i),i=Bi(r,m,c),i!==null&&(mr(i,r,c),Vc(i,r,c))}};function X1(r,i,c,m,k,O,N){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,O,N):i.prototype&&i.prototype.isPureReactComponent?!Dc(c,m)||!Dc(k,O):!0}function Q1(r,i,c,m){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(c,m),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(c,m),i.state!==r&&Wm.enqueueReplaceState(i,i.state,null)}function Uo(r,i){var c=i;if("ref"in i){c={};for(var m in i)m!=="ref"&&(c[m]=i[m])}if(r=r.defaultProps){c===i&&(c=f({},c));for(var k in r)c[k]===void 0&&(c[k]=r[k])}return c}function Z1(r){Td(r)}function J1(r){console.error(r)}function eb(r){Td(r)}function Qd(r,i){try{var c=r.onUncaughtError;c(i.value,{componentStack:i.stack})}catch(m){setTimeout(function(){throw m})}}function tb(r,i,c){try{var m=r.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function qm(r,i,c){return c=Ni(c),c.tag=3,c.payload={element:null},c.callback=function(){Qd(r,i)},c}function nb(r){return r=Ni(r),r.tag=3,r}function rb(r,i,c,m){var k=c.type.getDerivedStateFromError;if(typeof k=="function"){var O=m.value;r.payload=function(){return k(O)},r.callback=function(){tb(i,c,m)}}var N=c.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(r.callback=function(){tb(i,c,m),typeof k!="function"&&(Wi===null?Wi=new Set([this]):Wi.add(this));var Q=m.stack;this.componentDidCatch(m.value,{componentStack:Q!==null?Q:""})})}function tL(r,i,c,m,k){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(i=c.alternate,i!==null&&nl(i,c,k,!0),c=Lr.current,c!==null){switch(c.tag){case 31:case 13:return Yr===null?uf():c.alternate===null&&ln===0&&(ln=3),c.flags&=-257,c.flags|=65536,c.lanes=k,m===Bd?c.flags|=16384:(i=c.updateQueue,i===null?c.updateQueue=new Set([m]):i.add(m),gg(r,m,k)),!1;case 22:return c.flags|=65536,m===Bd?c.flags|=16384:(i=c.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=i):(c=i.retryQueue,c===null?i.retryQueue=new Set([m]):c.add(m)),gg(r,m,k)),!1}throw Error(s(435,c.tag))}return gg(r,m,k),uf(),!1}if(At)return i=Lr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=k,m!==um&&(r=Error(s(422),{cause:m}),jc(qr(r,c)))):(m!==um&&(i=Error(s(423),{cause:m}),jc(qr(i,c))),r=r.current.alternate,r.flags|=65536,k&=-k,r.lanes|=k,m=qr(m,c),k=qm(r.stateNode,m,k),xm(r,k),ln!==4&&(ln=2)),!1;var O=Error(s(520),{cause:m});if(O=qr(O,c),tu===null?tu=[O]:tu.push(O),ln!==4&&(ln=2),i===null)return!0;m=qr(m,c),c=i;do{switch(c.tag){case 3:return c.flags|=65536,r=k&-k,c.lanes|=r,r=qm(c.stateNode,m,r),xm(c,r),!1;case 1:if(i=c.type,O=c.stateNode,(c.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Wi===null||!Wi.has(O))))return c.flags|=65536,k&=-k,c.lanes|=k,k=nb(k),rb(k,r,c,m),xm(c,k),!1}c=c.return}while(c!==null);return!1}var Gm=Error(s(461)),bn=!1;function Fn(r,i,c,m){i.child=r===null?a1(i,null,c,m):Vo(i,r.child,c,m)}function sb(r,i,c,m,k){c=c.render;var O=i.ref;if("ref"in m){var N={};for(var Q in m)Q!=="ref"&&(N[Q]=m[Q])}else N=m;return No(i),m=Rm(r,i,c,N,O,k),Q=Tm(),r!==null&&!bn?(Lm(r,i,k),ci(r,i,k)):(At&&Q&&lm(i),i.flags|=1,Fn(r,i,m,k),i.child)}function ib(r,i,c,m,k){if(r===null){var O=c.type;return typeof O=="function"&&!im(O)&&O.defaultProps===void 0&&c.compare===null?(i.tag=15,i.type=O,ob(r,i,O,m,k)):(r=Md(c.type,null,m,i,i.mode,k),r.ref=i.ref,r.return=i,i.child=r)}if(O=r.child,!eg(r,k)){var N=O.memoizedProps;if(c=c.compare,c=c!==null?c:Dc,c(N,m)&&r.ref===i.ref)return ci(r,i,k)}return i.flags|=1,r=ri(O,m),r.ref=i.ref,r.return=i,i.child=r}function ob(r,i,c,m,k){if(r!==null){var O=r.memoizedProps;if(Dc(O,m)&&r.ref===i.ref)if(bn=!1,i.pendingProps=m=O,eg(r,k))(r.flags&131072)!==0&&(bn=!0);else return i.lanes=r.lanes,ci(r,i,k)}return $m(r,i,c,m,k)}function ab(r,i,c,m){var k=m.children,O=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((i.flags&128)!==0){if(O=O!==null?O.baseLanes|c:c,r!==null){for(m=i.child=r.child,k=0;m!==null;)k=k|m.lanes|m.childLanes,m=m.sibling;m=k&~O}else m=0,i.child=null;return lb(r,i,O,c,m)}if((c&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&jd(i,O!==null?O.cachePool:null),O!==null?u1(i,O):Cm(),d1(i);else return m=i.lanes=536870912,lb(r,i,O!==null?O.baseLanes|c:c,c,m)}else O!==null?(jd(i,O.cachePool),u1(i,O),Hi(),i.memoizedState=null):(r!==null&&jd(i,null),Cm(),Hi());return Fn(r,i,k,c),i.child}function Kc(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function lb(r,i,c,m,k){var O=vm();return O=O===null?null:{parent:_n._currentValue,pool:O},i.memoizedState={baseLanes:c,cachePool:O},r!==null&&jd(i,null),Cm(),d1(i),r!==null&&nl(r,i,m,!0),i.childLanes=k,null}function Zd(r,i){return i=ef({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function cb(r,i,c){return Vo(i,r.child,null,c),r=Zd(i,i.pendingProps),r.flags|=2,Ar(i),i.memoizedState=null,r}function nL(r,i,c){var m=i.pendingProps,k=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(At){if(m.mode==="hidden")return r=Zd(i,m),i.lanes=536870912,Kc(null,r);if(Em(i),(r=Yt)?(r=xx(r,Kr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Mi!==null?{id:Ts,overflow:Ls}:null,retryLane:536870912,hydrationErrors:null},c=Gy(r),c.return=i,i.child=c,Hn=i,Yt=null)):r=null,r===null)throw Pi(i);return i.lanes=536870912,null}return Zd(i,m)}var O=r.memoizedState;if(O!==null){var N=O.dehydrated;if(Em(i),k)if(i.flags&256)i.flags&=-257,i=cb(r,i,c);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(s(558));else if(bn||nl(r,i,c,!1),k=(c&r.childLanes)!==0,bn||k){if(m=qt,m!==null&&(N=Rn(m,c),N!==0&&N!==O.retryLane))throw O.retryLane=N,Do(r,N),mr(m,r,N),Gm;uf(),i=cb(r,i,c)}else r=O.treeContext,Yt=Xr(N.nextSibling),Hn=i,At=!0,Di=null,Kr=!1,r!==null&&Yy(i,r),i=Zd(i,m),i.flags|=4096;return i}return r=ri(r.child,{mode:m.mode,children:m.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Jd(r,i){var c=i.ref;if(c===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(r===null||r.ref!==c)&&(i.flags|=4194816)}}function $m(r,i,c,m,k){return No(i),c=Rm(r,i,c,m,void 0,k),m=Tm(),r!==null&&!bn?(Lm(r,i,k),ci(r,i,k)):(At&&m&&lm(i),i.flags|=1,Fn(r,i,c,k),i.child)}function ub(r,i,c,m,k,O){return No(i),i.updateQueue=null,c=h1(i,m,c,k),f1(r),m=Tm(),r!==null&&!bn?(Lm(r,i,O),ci(r,i,O)):(At&&m&&lm(i),i.flags|=1,Fn(r,i,c,O),i.child)}function db(r,i,c,m,k){if(No(i),i.stateNode===null){var O=Za,N=c.contextType;typeof N=="object"&&N!==null&&(O=Vn(N)),O=new c(m,O),i.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=Wm,i.stateNode=O,O._reactInternals=i,O=i.stateNode,O.props=m,O.state=i.memoizedState,O.refs={},ym(i),N=c.contextType,O.context=typeof N=="object"&&N!==null?Vn(N):Za,O.state=i.memoizedState,N=c.getDerivedStateFromProps,typeof N=="function"&&(Um(i,c,N,m),O.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(N=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),N!==O.state&&Wm.enqueueReplaceState(O,O.state,null),Uc(i,m,O,k),Fc(),O.state=i.memoizedState),typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!0}else if(r===null){O=i.stateNode;var Q=i.memoizedProps,ie=Uo(c,Q);O.props=ie;var pe=O.context,Se=c.contextType;N=Za,typeof Se=="object"&&Se!==null&&(N=Vn(Se));var Te=c.getDerivedStateFromProps;Se=typeof Te=="function"||typeof O.getSnapshotBeforeUpdate=="function",Q=i.pendingProps!==Q,Se||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Q||pe!==N)&&Q1(i,O,m,N),ji=!1;var ge=i.memoizedState;O.state=ge,Uc(i,m,O,k),Fc(),pe=i.memoizedState,Q||ge!==pe||ji?(typeof Te=="function"&&(Um(i,c,Te,m),pe=i.memoizedState),(ie=ji||X1(i,c,ie,m,ge,pe,N))?(Se||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(i.flags|=4194308)):(typeof O.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=m,i.memoizedState=pe),O.props=m,O.state=pe,O.context=N,m=ie):(typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{O=i.stateNode,bm(r,i),N=i.memoizedProps,Se=Uo(c,N),O.props=Se,Te=i.pendingProps,ge=O.context,pe=c.contextType,ie=Za,typeof pe=="object"&&pe!==null&&(ie=Vn(pe)),Q=c.getDerivedStateFromProps,(pe=typeof Q=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(N!==Te||ge!==ie)&&Q1(i,O,m,ie),ji=!1,ge=i.memoizedState,O.state=ge,Uc(i,m,O,k),Fc();var ye=i.memoizedState;N!==Te||ge!==ye||ji||r!==null&&r.dependencies!==null&&Pd(r.dependencies)?(typeof Q=="function"&&(Um(i,c,Q,m),ye=i.memoizedState),(Se=ji||X1(i,c,Se,m,ge,ye,ie)||r!==null&&r.dependencies!==null&&Pd(r.dependencies))?(pe||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(m,ye,ie),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(m,ye,ie)),typeof O.componentDidUpdate=="function"&&(i.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof O.componentDidUpdate!="function"||N===r.memoizedProps&&ge===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&ge===r.memoizedState||(i.flags|=1024),i.memoizedProps=m,i.memoizedState=ye),O.props=m,O.state=ye,O.context=ie,m=Se):(typeof O.componentDidUpdate!="function"||N===r.memoizedProps&&ge===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&ge===r.memoizedState||(i.flags|=1024),m=!1)}return O=m,Jd(r,i),m=(i.flags&128)!==0,O||m?(O=i.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:O.render(),i.flags|=1,r!==null&&m?(i.child=Vo(i,r.child,null,k),i.child=Vo(i,null,c,k)):Fn(r,i,c,k),i.memoizedState=O.state,r=i.child):r=ci(r,i,k),r}function fb(r,i,c,m){return Io(),i.flags|=256,Fn(r,i,c,m),i.child}var Km={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ym(r){return{baseLanes:r,cachePool:t1()}}function Xm(r,i,c){return r=r!==null?r.childLanes&~c:0,i&&(r|=Mr),r}function hb(r,i,c){var m=i.pendingProps,k=!1,O=(i.flags&128)!==0,N;if((N=O)||(N=r!==null&&r.memoizedState===null?!1:(cn.current&2)!==0),N&&(k=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,r===null){if(At){if(k?zi(i):Hi(),(r=Yt)?(r=xx(r,Kr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Mi!==null?{id:Ts,overflow:Ls}:null,retryLane:536870912,hydrationErrors:null},c=Gy(r),c.return=i,i.child=c,Hn=i,Yt=null)):r=null,r===null)throw Pi(i);return Mg(r)?i.lanes=32:i.lanes=536870912,null}var Q=m.children;return m=m.fallback,k?(Hi(),k=i.mode,Q=ef({mode:"hidden",children:Q},k),m=Po(m,k,c,null),Q.return=i,m.return=i,Q.sibling=m,i.child=Q,m=i.child,m.memoizedState=Ym(c),m.childLanes=Xm(r,N,c),i.memoizedState=Km,Kc(null,m)):(zi(i),Qm(i,Q))}var ie=r.memoizedState;if(ie!==null&&(Q=ie.dehydrated,Q!==null)){if(O)i.flags&256?(zi(i),i.flags&=-257,i=Zm(r,i,c)):i.memoizedState!==null?(Hi(),i.child=r.child,i.flags|=128,i=null):(Hi(),Q=m.fallback,k=i.mode,m=ef({mode:"visible",children:m.children},k),Q=Po(Q,k,c,null),Q.flags|=2,m.return=i,Q.return=i,m.sibling=Q,i.child=m,Vo(i,r.child,null,c),m=i.child,m.memoizedState=Ym(c),m.childLanes=Xm(r,N,c),i.memoizedState=Km,i=Kc(null,m));else if(zi(i),Mg(Q)){if(N=Q.nextSibling&&Q.nextSibling.dataset,N)var pe=N.dgst;N=pe,m=Error(s(419)),m.stack="",m.digest=N,jc({value:m,source:null,stack:null}),i=Zm(r,i,c)}else if(bn||nl(r,i,c,!1),N=(c&r.childLanes)!==0,bn||N){if(N=qt,N!==null&&(m=Rn(N,c),m!==0&&m!==ie.retryLane))throw ie.retryLane=m,Do(r,m),mr(N,r,m),Gm;Og(Q)||uf(),i=Zm(r,i,c)}else Og(Q)?(i.flags|=192,i.child=r.child,i=null):(r=ie.treeContext,Yt=Xr(Q.nextSibling),Hn=i,At=!0,Di=null,Kr=!1,r!==null&&Yy(i,r),i=Qm(i,m.children),i.flags|=4096);return i}return k?(Hi(),Q=m.fallback,k=i.mode,ie=r.child,pe=ie.sibling,m=ri(ie,{mode:"hidden",children:m.children}),m.subtreeFlags=ie.subtreeFlags&65011712,pe!==null?Q=ri(pe,Q):(Q=Po(Q,k,c,null),Q.flags|=2),Q.return=i,m.return=i,m.sibling=Q,i.child=m,Kc(null,m),m=i.child,Q=r.child.memoizedState,Q===null?Q=Ym(c):(k=Q.cachePool,k!==null?(ie=_n._currentValue,k=k.parent!==ie?{parent:ie,pool:ie}:k):k=t1(),Q={baseLanes:Q.baseLanes|c,cachePool:k}),m.memoizedState=Q,m.childLanes=Xm(r,N,c),i.memoizedState=Km,Kc(r.child,m)):(zi(i),c=r.child,r=c.sibling,c=ri(c,{mode:"visible",children:m.children}),c.return=i,c.sibling=null,r!==null&&(N=i.deletions,N===null?(i.deletions=[r],i.flags|=16):N.push(r)),i.child=c,i.memoizedState=null,c)}function Qm(r,i){return i=ef({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function ef(r,i){return r=Tr(22,r,null,i),r.lanes=0,r}function Zm(r,i,c){return Vo(i,r.child,null,c),r=Qm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function pb(r,i,c){r.lanes|=i;var m=r.alternate;m!==null&&(m.lanes|=i),hm(r.return,i,c)}function Jm(r,i,c,m,k,O){var N=r.memoizedState;N===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:k,treeForkCount:O}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=m,N.tail=c,N.tailMode=k,N.treeForkCount=O)}function mb(r,i,c){var m=i.pendingProps,k=m.revealOrder,O=m.tail;m=m.children;var N=cn.current,Q=(N&2)!==0;if(Q?(N=N&1|2,i.flags|=128):N&=1,Y(cn,N),Fn(r,i,m,c),m=At?Ic:0,!Q&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&pb(r,c,i);else if(r.tag===19)pb(r,c,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(k){case"forwards":for(c=i.child,k=null;c!==null;)r=c.alternate,r!==null&&Fd(r)===null&&(k=c),c=c.sibling;c=k,c===null?(k=i.child,i.child=null):(k=c.sibling,c.sibling=null),Jm(i,!1,k,c,O,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,k=i.child,i.child=null;k!==null;){if(r=k.alternate,r!==null&&Fd(r)===null){i.child=k;break}r=k.sibling,k.sibling=c,c=k,k=r}Jm(i,!0,c,null,O,m);break;case"together":Jm(i,!1,null,null,void 0,m);break;default:i.memoizedState=null}return i.child}function ci(r,i,c){if(r!==null&&(i.dependencies=r.dependencies),Ui|=i.lanes,(c&i.childLanes)===0)if(r!==null){if(nl(r,i,c,!1),(c&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(s(153));if(i.child!==null){for(r=i.child,c=ri(r,r.pendingProps),i.child=c,c.return=i;r.sibling!==null;)r=r.sibling,c=c.sibling=ri(r,r.pendingProps),c.return=i;c.sibling=null}return i.child}function eg(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Pd(r)))}function rL(r,i,c){switch(i.tag){case 3:V(i,i.stateNode.containerInfo),Ii(i,_n,r.memoizedState.cache),Io();break;case 27:case 5:ne(i);break;case 4:V(i,i.stateNode.containerInfo);break;case 10:Ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Em(i),null;break;case 13:var m=i.memoizedState;if(m!==null)return m.dehydrated!==null?(zi(i),i.flags|=128,null):(c&i.child.childLanes)!==0?hb(r,i,c):(zi(i),r=ci(r,i,c),r!==null?r.sibling:null);zi(i);break;case 19:var k=(r.flags&128)!==0;if(m=(c&i.childLanes)!==0,m||(nl(r,i,c,!1),m=(c&i.childLanes)!==0),k){if(m)return mb(r,i,c);i.flags|=128}if(k=i.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Y(cn,cn.current),m)break;return null;case 22:return i.lanes=0,ab(r,i,c,i.pendingProps);case 24:Ii(i,_n,r.memoizedState.cache)}return ci(r,i,c)}function gb(r,i,c){if(r!==null)if(r.memoizedProps!==i.pendingProps)bn=!0;else{if(!eg(r,c)&&(i.flags&128)===0)return bn=!1,rL(r,i,c);bn=(r.flags&131072)!==0}else bn=!1,At&&(i.flags&1048576)!==0&&Ky(i,Ic,i.index);switch(i.lanes=0,i.tag){case 16:e:{var m=i.pendingProps;if(r=zo(i.elementType),i.type=r,typeof r=="function")im(r)?(m=Uo(r,m),i.tag=1,i=db(null,i,r,m,c)):(i.tag=0,i=$m(null,i,r,m,c));else{if(r!=null){var k=r.$$typeof;if(k===E){i.tag=11,i=sb(null,i,r,m,c);break e}else if(k===M){i.tag=14,i=ib(null,i,r,m,c);break e}}throw i=K(r)||r,Error(s(306,i,""))}}return i;case 0:return $m(r,i,i.type,i.pendingProps,c);case 1:return m=i.type,k=Uo(m,i.pendingProps),db(r,i,m,k,c);case 3:e:{if(V(i,i.stateNode.containerInfo),r===null)throw Error(s(387));m=i.pendingProps;var O=i.memoizedState;k=O.element,bm(r,i),Uc(i,m,null,c);var N=i.memoizedState;if(m=N.cache,Ii(i,_n,m),m!==O.cache&&pm(i,[_n],c,!0),Fc(),m=N.element,O.isDehydrated)if(O={element:m,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=O,i.memoizedState=O,i.flags&256){i=fb(r,i,m,c);break e}else if(m!==k){k=qr(Error(s(424)),i),jc(k),i=fb(r,i,m,c);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Yt=Xr(r.firstChild),Hn=i,At=!0,Di=null,Kr=!0,c=a1(i,null,m,c),i.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Io(),m===k){i=ci(r,i,c);break e}Fn(r,i,m,c)}i=i.child}return i;case 26:return Jd(r,i),r===null?(c=Rx(i.type,null,i.pendingProps,null))?i.memoizedState=c:At||(c=i.type,r=i.pendingProps,m=vf(ee.current).createElement(c),m[pn]=i,m[mn]=r,Un(m,c,r),gn(m),i.stateNode=m):i.memoizedState=Rx(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return ne(i),r===null&&At&&(m=i.stateNode=wx(i.type,i.pendingProps,ee.current),Hn=i,Kr=!0,k=Yt,Ki(i.type)?(Dg=k,Yt=Xr(m.firstChild)):Yt=k),Fn(r,i,i.pendingProps.children,c),Jd(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&At&&((k=m=Yt)&&(m=DL(m,i.type,i.pendingProps,Kr),m!==null?(i.stateNode=m,Hn=i,Yt=Xr(m.firstChild),Kr=!1,k=!0):k=!1),k||Pi(i)),ne(i),k=i.type,O=i.pendingProps,N=r!==null?r.memoizedProps:null,m=O.children,Tg(k,O)?m=null:N!==null&&Tg(k,N)&&(i.flags|=32),i.memoizedState!==null&&(k=Rm(r,i,K5,null,null,c),cu._currentValue=k),Jd(r,i),Fn(r,i,m,c),i.child;case 6:return r===null&&At&&((r=c=Yt)&&(c=PL(c,i.pendingProps,Kr),c!==null?(i.stateNode=c,Hn=i,Yt=null,r=!0):r=!1),r||Pi(i)),null;case 13:return hb(r,i,c);case 4:return V(i,i.stateNode.containerInfo),m=i.pendingProps,r===null?i.child=Vo(i,null,m,c):Fn(r,i,m,c),i.child;case 11:return sb(r,i,i.type,i.pendingProps,c);case 7:return Fn(r,i,i.pendingProps,c),i.child;case 8:return Fn(r,i,i.pendingProps.children,c),i.child;case 12:return Fn(r,i,i.pendingProps.children,c),i.child;case 10:return m=i.pendingProps,Ii(i,i.type,m.value),Fn(r,i,m.children,c),i.child;case 9:return k=i.type._context,m=i.pendingProps.children,No(i),k=Vn(k),m=m(k),i.flags|=1,Fn(r,i,m,c),i.child;case 14:return ib(r,i,i.type,i.pendingProps,c);case 15:return ob(r,i,i.type,i.pendingProps,c);case 19:return mb(r,i,c);case 31:return nL(r,i,c);case 22:return ab(r,i,c,i.pendingProps);case 24:return No(i),m=Vn(_n),r===null?(k=vm(),k===null&&(k=qt,O=mm(),k.pooledCache=O,O.refCount++,O!==null&&(k.pooledCacheLanes|=c),k=O),i.memoizedState={parent:m,cache:k},ym(i),Ii(i,_n,k)):((r.lanes&c)!==0&&(bm(r,i),Uc(i,null,null,c),Fc()),k=r.memoizedState,O=i.memoizedState,k.parent!==m?(k={parent:m,cache:m},i.memoizedState=k,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=k),Ii(i,_n,m)):(m=O.cache,Ii(i,_n,m),m!==k.cache&&pm(i,[_n],c,!0))),Fn(r,i,i.pendingProps.children,c),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function ui(r){r.flags|=4}function tg(r,i,c,m,k){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(k&335544128)===k)if(r.stateNode.complete)r.flags|=8192;else if(Ub())r.flags|=8192;else throw Ho=Bd,_m}else r.flags&=-16777217}function vb(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Mx(i))if(Ub())r.flags|=8192;else throw Ho=Bd,_m}function tf(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ot():536870912,r.lanes|=i,pl|=i)}function Yc(r,i){if(!At)switch(r.tailMode){case"hidden":i=r.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:m.sibling=null}}function Xt(r){var i=r.alternate!==null&&r.alternate.child===r.child,c=0,m=0;if(i)for(var k=r.child;k!==null;)c|=k.lanes|k.childLanes,m|=k.subtreeFlags&65011712,m|=k.flags&65011712,k.return=r,k=k.sibling;else for(k=r.child;k!==null;)c|=k.lanes|k.childLanes,m|=k.subtreeFlags,m|=k.flags,k.return=r,k=k.sibling;return r.subtreeFlags|=m,r.childLanes=c,i}function sL(r,i,c){var m=i.pendingProps;switch(cm(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(i),null;case 1:return Xt(i),null;case 3:return c=i.stateNode,m=null,r!==null&&(m=r.memoizedState.cache),i.memoizedState.cache!==m&&(i.flags|=2048),oi(_n),se(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(tl(i)?ui(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,dm())),Xt(i),null;case 26:var k=i.type,O=i.memoizedState;return r===null?(ui(i),O!==null?(Xt(i),vb(i,O)):(Xt(i),tg(i,k,null,m,c))):O?O!==r.memoizedState?(ui(i),Xt(i),vb(i,O)):(Xt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==m&&ui(i),Xt(i),tg(i,k,r,m,c)),null;case 27:if(re(i),c=ee.current,k=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&ui(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}r=J.current,tl(i)?Xy(i):(r=wx(k,m,c),i.stateNode=r,ui(i))}return Xt(i),null;case 5:if(re(i),k=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&ui(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}if(O=J.current,tl(i))Xy(i);else{var N=vf(ee.current);switch(O){case 1:O=N.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:O=N.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":O=N.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":O=N.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":O=N.createElement("div"),O.innerHTML="<script><\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof m.is=="string"?N.createElement("select",{is:m.is}):N.createElement("select"),m.multiple?O.multiple=!0:m.size&&(O.size=m.size);break;default:O=typeof m.is=="string"?N.createElement(k,{is:m.is}):N.createElement(k)}}O[pn]=i,O[mn]=m;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)O.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.stateNode=O;e:switch(Un(O,k,m),k){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&ui(i)}}return Xt(i),tg(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,c),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==m&&ui(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(s(166));if(r=ee.current,tl(i)){if(r=i.stateNode,c=i.memoizedProps,m=null,k=Hn,k!==null)switch(k.tag){case 27:case 5:m=k.memoizedProps}r[pn]=i,r=!!(r.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||hx(r.nodeValue,c)),r||Pi(i,!0)}else r=vf(r).createTextNode(m),r[pn]=i,i.stateNode=r}return Xt(i),null;case 31:if(c=i.memoizedState,r===null||r.memoizedState!==null){if(m=tl(i),c!==null){if(r===null){if(!m)throw Error(s(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));r[pn]=i}else Io(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),r=!1}else c=dm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return i.flags&256?(Ar(i),i):(Ar(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Xt(i),null;case 13:if(m=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(k=tl(i),m!==null&&m.dehydrated!==null){if(r===null){if(!k)throw Error(s(318));if(k=i.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(s(317));k[pn]=i}else Io(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),k=!1}else k=dm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=k),k=!0;if(!k)return i.flags&256?(Ar(i),i):(Ar(i),null)}return Ar(i),(i.flags&128)!==0?(i.lanes=c,i):(c=m!==null,r=r!==null&&r.memoizedState!==null,c&&(m=i.child,k=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(k=m.alternate.memoizedState.cachePool.pool),O=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(O=m.memoizedState.cachePool.pool),O!==k&&(m.flags|=2048)),c!==r&&c&&(i.child.flags|=8192),tf(i,i.updateQueue),Xt(i),null);case 4:return se(),r===null&&Cg(i.stateNode.containerInfo),Xt(i),null;case 10:return oi(i.type),Xt(i),null;case 19:if(W(cn),m=i.memoizedState,m===null)return Xt(i),null;if(k=(i.flags&128)!==0,O=m.rendering,O===null)if(k)Yc(m,!1);else{if(ln!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(O=Fd(r),O!==null){for(i.flags|=128,Yc(m,!1),r=O.updateQueue,i.updateQueue=r,tf(i,r),i.subtreeFlags=0,r=c,c=i.child;c!==null;)qy(c,r),c=c.sibling;return Y(cn,cn.current&1|2),At&&si(i,m.treeForkCount),i.child}r=r.sibling}m.tail!==null&&ke()>af&&(i.flags|=128,k=!0,Yc(m,!1),i.lanes=4194304)}else{if(!k)if(r=Fd(O),r!==null){if(i.flags|=128,k=!0,r=r.updateQueue,i.updateQueue=r,tf(i,r),Yc(m,!0),m.tail===null&&m.tailMode==="hidden"&&!O.alternate&&!At)return Xt(i),null}else 2*ke()-m.renderingStartTime>af&&c!==536870912&&(i.flags|=128,k=!0,Yc(m,!1),i.lanes=4194304);m.isBackwards?(O.sibling=i.child,i.child=O):(r=m.last,r!==null?r.sibling=O:i.child=O,m.last=O)}return m.tail!==null?(r=m.tail,m.rendering=r,m.tail=r.sibling,m.renderingStartTime=ke(),r.sibling=null,c=cn.current,Y(cn,k?c&1|2:c&1),At&&si(i,m.treeForkCount),r):(Xt(i),null);case 22:case 23:return Ar(i),wm(),m=i.memoizedState!==null,r!==null?r.memoizedState!==null!==m&&(i.flags|=8192):m&&(i.flags|=8192),m?(c&536870912)!==0&&(i.flags&128)===0&&(Xt(i),i.subtreeFlags&6&&(i.flags|=8192)):Xt(i),c=i.updateQueue,c!==null&&tf(i,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==c&&(i.flags|=2048),r!==null&&W(Bo),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),oi(_n),Xt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function iL(r,i){switch(cm(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return oi(_n),se(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return re(i),null;case 31:if(i.memoizedState!==null){if(Ar(i),i.alternate===null)throw Error(s(340));Io()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Ar(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(s(340));Io()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return W(cn),null;case 4:return se(),null;case 10:return oi(i.type),null;case 22:case 23:return Ar(i),wm(),r!==null&&W(Bo),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return oi(_n),null;case 25:return null;default:return null}}function _b(r,i){switch(cm(i),i.tag){case 3:oi(_n),se();break;case 26:case 27:case 5:re(i);break;case 4:se();break;case 31:i.memoizedState!==null&&Ar(i);break;case 13:Ar(i);break;case 19:W(cn);break;case 10:oi(i.type);break;case 22:case 23:Ar(i),wm(),r!==null&&W(Bo);break;case 24:oi(_n)}}function Xc(r,i){try{var c=i.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var k=m.next;c=k;do{if((c.tag&r)===r){m=void 0;var O=c.create,N=c.inst;m=O(),N.destroy=m}c=c.next}while(c!==k)}}catch(Q){zt(i,i.return,Q)}}function Vi(r,i,c){try{var m=i.updateQueue,k=m!==null?m.lastEffect:null;if(k!==null){var O=k.next;m=O;do{if((m.tag&r)===r){var N=m.inst,Q=N.destroy;if(Q!==void 0){N.destroy=void 0,k=i;var ie=c,pe=Q;try{pe()}catch(Se){zt(k,ie,Se)}}}m=m.next}while(m!==O)}}catch(Se){zt(i,i.return,Se)}}function yb(r){var i=r.updateQueue;if(i!==null){var c=r.stateNode;try{c1(i,c)}catch(m){zt(r,r.return,m)}}}function bb(r,i,c){c.props=Uo(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(m){zt(r,i,m)}}function Qc(r,i){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var m=r.stateNode;break;case 30:m=r.stateNode;break;default:m=r.stateNode}typeof c=="function"?r.refCleanup=c(m):c.current=m}}catch(k){zt(r,i,k)}}function As(r,i){var c=r.ref,m=r.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(k){zt(r,i,k)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(k){zt(r,i,k)}else c.current=null}function xb(r){var i=r.type,c=r.memoizedProps,m=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(k){zt(r,r.return,k)}}function ng(r,i,c){try{var m=r.stateNode;RL(m,r.type,c,i),m[mn]=i}catch(k){zt(r,r.return,k)}}function Sb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ki(r.type)||r.tag===4}function rg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Sb(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.tag===27&&Ki(r.type)||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 sg(r,i,c){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,i):(i=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,i.appendChild(r),c=c._reactRootContainer,c!=null||i.onclick!==null||(i.onclick=hs));else if(m!==4&&(m===27&&Ki(r.type)&&(c=r.stateNode,i=null),r=r.child,r!==null))for(sg(r,i,c),r=r.sibling;r!==null;)sg(r,i,c),r=r.sibling}function nf(r,i,c){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?c.insertBefore(r,i):c.appendChild(r);else if(m!==4&&(m===27&&Ki(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(nf(r,i,c),r=r.sibling;r!==null;)nf(r,i,c),r=r.sibling}function Cb(r){var i=r.stateNode,c=r.memoizedProps;try{for(var m=r.type,k=i.attributes;k.length;)i.removeAttributeNode(k[0]);Un(i,m,c),i[pn]=r,i[mn]=c}catch(O){zt(r,r.return,O)}}var di=!1,xn=!1,ig=!1,wb=typeof WeakSet=="function"?WeakSet:Set,jn=null;function oL(r,i){if(r=r.containerInfo,kg=wf,r=jy(r),Zp(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var k=m.anchorOffset,O=m.focusNode;m=m.focusOffset;try{c.nodeType,O.nodeType}catch{c=null;break e}var N=0,Q=-1,ie=-1,pe=0,Se=0,Te=r,ge=null;t:for(;;){for(var ye;Te!==c||k!==0&&Te.nodeType!==3||(Q=N+k),Te!==O||m!==0&&Te.nodeType!==3||(ie=N+m),Te.nodeType===3&&(N+=Te.nodeValue.length),(ye=Te.firstChild)!==null;)ge=Te,Te=ye;for(;;){if(Te===r)break t;if(ge===c&&++pe===k&&(Q=N),ge===O&&++Se===m&&(ie=N),(ye=Te.nextSibling)!==null)break;Te=ge,ge=Te.parentNode}Te=ye}c=Q===-1||ie===-1?null:{start:Q,end:ie}}else c=null}c=c||{start:0,end:0}}else c=null;for(Rg={focusedElem:r,selectionRange:c},wf=!1,jn=i;jn!==null;)if(i=jn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,jn=r;else for(;jn!==null;){switch(i=jn,O=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)k=r[c],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&O!==null){r=void 0,c=i,k=O.memoizedProps,O=O.memoizedState,m=c.stateNode;try{var $e=Uo(c.type,k);r=m.getSnapshotBeforeUpdate($e,O),m.__reactInternalSnapshotBeforeUpdate=r}catch(ut){zt(c,c.return,ut)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,c=r.nodeType,c===9)Ag(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Ag(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(s(163))}if(r=i.sibling,r!==null){r.return=i.return,jn=r;break}jn=i.return}}function Eb(r,i,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:hi(r,c),m&4&&Xc(5,c);break;case 1:if(hi(r,c),m&4)if(r=c.stateNode,i===null)try{r.componentDidMount()}catch(N){zt(c,c.return,N)}else{var k=Uo(c.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(k,i,r.__reactInternalSnapshotBeforeUpdate)}catch(N){zt(c,c.return,N)}}m&64&&yb(c),m&512&&Qc(c,c.return);break;case 3:if(hi(r,c),m&64&&(r=c.updateQueue,r!==null)){if(i=null,c.child!==null)switch(c.child.tag){case 27:case 5:i=c.child.stateNode;break;case 1:i=c.child.stateNode}try{c1(r,i)}catch(N){zt(c,c.return,N)}}break;case 27:i===null&&m&4&&Cb(c);case 26:case 5:hi(r,c),i===null&&m&4&&xb(c),m&512&&Qc(c,c.return);break;case 12:hi(r,c);break;case 31:hi(r,c),m&4&&Tb(r,c);break;case 13:hi(r,c),m&4&&Lb(r,c),m&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=mL.bind(null,c),IL(r,c))));break;case 22:if(m=c.memoizedState!==null||di,!m){i=i!==null&&i.memoizedState!==null||xn,k=di;var O=xn;di=m,(xn=i)&&!O?pi(r,c,(c.subtreeFlags&8772)!==0):hi(r,c),di=k,xn=O}break;case 30:break;default:hi(r,c)}}function kb(r){var i=r.alternate;i!==null&&(r.alternate=null,kb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&To(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Jt=null,dr=!1;function fi(r,i,c){for(c=c.child;c!==null;)Rb(r,i,c),c=c.sibling}function Rb(r,i,c){if(Ee&&typeof Ee.onCommitFiberUnmount=="function")try{Ee.onCommitFiberUnmount(Ve,c)}catch{}switch(c.tag){case 26:xn||As(c,i),fi(r,i,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:xn||As(c,i);var m=Jt,k=dr;Ki(c.type)&&(Jt=c.stateNode,dr=!1),fi(r,i,c),ou(c.stateNode),Jt=m,dr=k;break;case 5:xn||As(c,i);case 6:if(m=Jt,k=dr,Jt=null,fi(r,i,c),Jt=m,dr=k,Jt!==null)if(dr)try{(Jt.nodeType===9?Jt.body:Jt.nodeName==="HTML"?Jt.ownerDocument.body:Jt).removeChild(c.stateNode)}catch(O){zt(c,i,O)}else try{Jt.removeChild(c.stateNode)}catch(O){zt(c,i,O)}break;case 18:Jt!==null&&(dr?(r=Jt,yx(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),Sl(r)):yx(Jt,c.stateNode));break;case 4:m=Jt,k=dr,Jt=c.stateNode.containerInfo,dr=!0,fi(r,i,c),Jt=m,dr=k;break;case 0:case 11:case 14:case 15:Vi(2,c,i),xn||Vi(4,c,i),fi(r,i,c);break;case 1:xn||(As(c,i),m=c.stateNode,typeof m.componentWillUnmount=="function"&&bb(c,i,m)),fi(r,i,c);break;case 21:fi(r,i,c);break;case 22:xn=(m=xn)||c.memoizedState!==null,fi(r,i,c),xn=m;break;default:fi(r,i,c)}}function Tb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Sl(r)}catch(c){zt(i,i.return,c)}}}function Lb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Sl(r)}catch(c){zt(i,i.return,c)}}function aL(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new wb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new wb),i;default:throw Error(s(435,r.tag))}}function rf(r,i){var c=aL(r);i.forEach(function(m){if(!c.has(m)){c.add(m);var k=gL.bind(null,r,m);m.then(k,k)}})}function fr(r,i){var c=i.deletions;if(c!==null)for(var m=0;m<c.length;m++){var k=c[m],O=r,N=i,Q=N;e:for(;Q!==null;){switch(Q.tag){case 27:if(Ki(Q.type)){Jt=Q.stateNode,dr=!1;break e}break;case 5:Jt=Q.stateNode,dr=!1;break e;case 3:case 4:Jt=Q.stateNode.containerInfo,dr=!0;break e}Q=Q.return}if(Jt===null)throw Error(s(160));Rb(O,N,k),Jt=null,dr=!1,O=k.alternate,O!==null&&(O.return=null),k.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Ab(i,r),i=i.sibling}var ms=null;function Ab(r,i){var c=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:fr(i,r),hr(r),m&4&&(Vi(3,r,r.return),Xc(3,r),Vi(5,r,r.return));break;case 1:fr(i,r),hr(r),m&512&&(xn||c===null||As(c,c.return)),m&64&&di&&(r=r.updateQueue,r!==null&&(m=r.callbacks,m!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var k=ms;if(fr(i,r),hr(r),m&512&&(xn||c===null||As(c,c.return)),m&4){var O=c!==null?c.memoizedState:null;if(m=r.memoizedState,c===null)if(m===null)if(r.stateNode===null){e:{m=r.type,c=r.memoizedProps,k=k.ownerDocument||k;t:switch(m){case"title":O=k.getElementsByTagName("title")[0],(!O||O[Ro]||O[pn]||O.namespaceURI==="http://www.w3.org/2000/svg"||O.hasAttribute("itemprop"))&&(O=k.createElement(m),k.head.insertBefore(O,k.querySelector("head > title"))),Un(O,m,c),O[pn]=r,gn(O),m=O;break e;case"link":var N=Ax("link","href",k).get(m+(c.href||""));if(N){for(var Q=0;Q<N.length;Q++)if(O=N[Q],O.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&O.getAttribute("rel")===(c.rel==null?null:c.rel)&&O.getAttribute("title")===(c.title==null?null:c.title)&&O.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){N.splice(Q,1);break t}}O=k.createElement(m),Un(O,m,c),k.head.appendChild(O);break;case"meta":if(N=Ax("meta","content",k).get(m+(c.content||""))){for(Q=0;Q<N.length;Q++)if(O=N[Q],O.getAttribute("content")===(c.content==null?null:""+c.content)&&O.getAttribute("name")===(c.name==null?null:c.name)&&O.getAttribute("property")===(c.property==null?null:c.property)&&O.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&O.getAttribute("charset")===(c.charSet==null?null:c.charSet)){N.splice(Q,1);break t}}O=k.createElement(m),Un(O,m,c),k.head.appendChild(O);break;default:throw Error(s(468,m))}O[pn]=r,gn(O),m=O}r.stateNode=m}else Ox(k,r.type,r.stateNode);else r.stateNode=Lx(k,m,r.memoizedProps);else O!==m?(O===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):O.count--,m===null?Ox(k,r.type,r.stateNode):Lx(k,m,r.memoizedProps)):m===null&&r.stateNode!==null&&ng(r,r.memoizedProps,c.memoizedProps)}break;case 27:fr(i,r),hr(r),m&512&&(xn||c===null||As(c,c.return)),c!==null&&m&4&&ng(r,r.memoizedProps,c.memoizedProps);break;case 5:if(fr(i,r),hr(r),m&512&&(xn||c===null||As(c,c.return)),r.flags&32){k=r.stateNode;try{nt(k,"")}catch($e){zt(r,r.return,$e)}}m&4&&r.stateNode!=null&&(k=r.memoizedProps,ng(r,k,c!==null?c.memoizedProps:k)),m&1024&&(ig=!0);break;case 6:if(fr(i,r),hr(r),m&4){if(r.stateNode===null)throw Error(s(162));m=r.memoizedProps,c=r.stateNode;try{c.nodeValue=m}catch($e){zt(r,r.return,$e)}}break;case 3:if(bf=null,k=ms,ms=_f(i.containerInfo),fr(i,r),ms=k,hr(r),m&4&&c!==null&&c.memoizedState.isDehydrated)try{Sl(i.containerInfo)}catch($e){zt(r,r.return,$e)}ig&&(ig=!1,Ob(r));break;case 4:m=ms,ms=_f(r.stateNode.containerInfo),fr(i,r),hr(r),ms=m;break;case 12:fr(i,r),hr(r);break;case 31:fr(i,r),hr(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,rf(r,m)));break;case 13:fr(i,r),hr(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(of=ke()),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,rf(r,m)));break;case 22:k=r.memoizedState!==null;var ie=c!==null&&c.memoizedState!==null,pe=di,Se=xn;if(di=pe||k,xn=Se||ie,fr(i,r),xn=Se,di=pe,hr(r),m&8192)e:for(i=r.stateNode,i._visibility=k?i._visibility&-2:i._visibility|1,k&&(c===null||ie||di||xn||Wo(r)),c=null,i=r;;){if(i.tag===5||i.tag===26){if(c===null){ie=c=i;try{if(O=ie.stateNode,k)N=O.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{Q=ie.stateNode;var Te=ie.memoizedProps.style,ge=Te!=null&&Te.hasOwnProperty("display")?Te.display:null;Q.style.display=ge==null||typeof ge=="boolean"?"":(""+ge).trim()}}catch($e){zt(ie,ie.return,$e)}}}else if(i.tag===6){if(c===null){ie=i;try{ie.stateNode.nodeValue=k?"":ie.memoizedProps}catch($e){zt(ie,ie.return,$e)}}}else if(i.tag===18){if(c===null){ie=i;try{var ye=ie.stateNode;k?bx(ye,!0):bx(ie.stateNode,!1)}catch($e){zt(ie,ie.return,$e)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;c===i&&(c=null),i=i.return}c===i&&(c=null),i.sibling.return=i.return,i=i.sibling}m&4&&(m=r.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,rf(r,c))));break;case 19:fr(i,r),hr(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,rf(r,m)));break;case 30:break;case 21:break;default:fr(i,r),hr(r)}}function hr(r){var i=r.flags;if(i&2){try{for(var c,m=r.return;m!==null;){if(Sb(m)){c=m;break}m=m.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var k=c.stateNode,O=rg(r);nf(r,O,k);break;case 5:var N=c.stateNode;c.flags&32&&(nt(N,""),c.flags&=-33);var Q=rg(r);nf(r,Q,N);break;case 3:case 4:var ie=c.stateNode.containerInfo,pe=rg(r);sg(r,pe,ie);break;default:throw Error(s(161))}}catch(Se){zt(r,r.return,Se)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Ob(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Ob(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function hi(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Eb(r,i.alternate,i),i=i.sibling}function Wo(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Vi(4,i,i.return),Wo(i);break;case 1:As(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&bb(i,i.return,c),Wo(i);break;case 27:ou(i.stateNode);case 26:case 5:As(i,i.return),Wo(i);break;case 22:i.memoizedState===null&&Wo(i);break;case 30:Wo(i);break;default:Wo(i)}r=r.sibling}}function pi(r,i,c){for(c=c&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var m=i.alternate,k=r,O=i,N=O.flags;switch(O.tag){case 0:case 11:case 15:pi(k,O,c),Xc(4,O);break;case 1:if(pi(k,O,c),m=O,k=m.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(pe){zt(m,m.return,pe)}if(m=O,k=m.updateQueue,k!==null){var Q=m.stateNode;try{var ie=k.shared.hiddenCallbacks;if(ie!==null)for(k.shared.hiddenCallbacks=null,k=0;k<ie.length;k++)l1(ie[k],Q)}catch(pe){zt(m,m.return,pe)}}c&&N&64&&yb(O),Qc(O,O.return);break;case 27:Cb(O);case 26:case 5:pi(k,O,c),c&&m===null&&N&4&&xb(O),Qc(O,O.return);break;case 12:pi(k,O,c);break;case 31:pi(k,O,c),c&&N&4&&Tb(k,O);break;case 13:pi(k,O,c),c&&N&4&&Lb(k,O);break;case 22:O.memoizedState===null&&pi(k,O,c),Qc(O,O.return);break;case 30:break;default:pi(k,O,c)}i=i.sibling}}function og(r,i){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&Nc(c))}function ag(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Nc(r))}function gs(r,i,c,m){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Mb(r,i,c,m),i=i.sibling}function Mb(r,i,c,m){var k=i.flags;switch(i.tag){case 0:case 11:case 15:gs(r,i,c,m),k&2048&&Xc(9,i);break;case 1:gs(r,i,c,m);break;case 3:gs(r,i,c,m),k&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Nc(r)));break;case 12:if(k&2048){gs(r,i,c,m),r=i.stateNode;try{var O=i.memoizedProps,N=O.id,Q=O.onPostCommit;typeof Q=="function"&&Q(N,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ie){zt(i,i.return,ie)}}else gs(r,i,c,m);break;case 31:gs(r,i,c,m);break;case 13:gs(r,i,c,m);break;case 23:break;case 22:O=i.stateNode,N=i.alternate,i.memoizedState!==null?O._visibility&2?gs(r,i,c,m):Zc(r,i):O._visibility&2?gs(r,i,c,m):(O._visibility|=2,dl(r,i,c,m,(i.subtreeFlags&10256)!==0||!1)),k&2048&&og(N,i);break;case 24:gs(r,i,c,m),k&2048&&ag(i.alternate,i);break;default:gs(r,i,c,m)}}function dl(r,i,c,m,k){for(k=k&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var O=r,N=i,Q=c,ie=m,pe=N.flags;switch(N.tag){case 0:case 11:case 15:dl(O,N,Q,ie,k),Xc(8,N);break;case 23:break;case 22:var Se=N.stateNode;N.memoizedState!==null?Se._visibility&2?dl(O,N,Q,ie,k):Zc(O,N):(Se._visibility|=2,dl(O,N,Q,ie,k)),k&&pe&2048&&og(N.alternate,N);break;case 24:dl(O,N,Q,ie,k),k&&pe&2048&&ag(N.alternate,N);break;default:dl(O,N,Q,ie,k)}i=i.sibling}}function Zc(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var c=r,m=i,k=m.flags;switch(m.tag){case 22:Zc(c,m),k&2048&&og(m.alternate,m);break;case 24:Zc(c,m),k&2048&&ag(m.alternate,m);break;default:Zc(c,m)}i=i.sibling}}var Jc=8192;function fl(r,i,c){if(r.subtreeFlags&Jc)for(r=r.child;r!==null;)Db(r,i,c),r=r.sibling}function Db(r,i,c){switch(r.tag){case 26:fl(r,i,c),r.flags&Jc&&r.memoizedState!==null&&$L(c,ms,r.memoizedState,r.memoizedProps);break;case 5:fl(r,i,c);break;case 3:case 4:var m=ms;ms=_f(r.stateNode.containerInfo),fl(r,i,c),ms=m;break;case 22:r.memoizedState===null&&(m=r.alternate,m!==null&&m.memoizedState!==null?(m=Jc,Jc=16777216,fl(r,i,c),Jc=m):fl(r,i,c));break;default:fl(r,i,c)}}function Pb(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function eu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var m=i[c];jn=m,jb(m,r)}Pb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ib(r),r=r.sibling}function Ib(r){switch(r.tag){case 0:case 11:case 15:eu(r),r.flags&2048&&Vi(9,r,r.return);break;case 3:eu(r);break;case 12:eu(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,sf(r)):eu(r);break;default:eu(r)}}function sf(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var m=i[c];jn=m,jb(m,r)}Pb(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Vi(8,i,i.return),sf(i);break;case 22:c=i.stateNode,c._visibility&2&&(c._visibility&=-3,sf(i));break;default:sf(i)}r=r.sibling}}function jb(r,i){for(;jn!==null;){var c=jn;switch(c.tag){case 0:case 11:case 15:Vi(8,c,i);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Nc(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,jn=m;else e:for(c=r;jn!==null;){m=jn;var k=m.sibling,O=m.return;if(kb(m),m===c){jn=null;break e}if(k!==null){k.return=O,jn=k;break e}jn=O}}}var lL={getCacheForType:function(r){var i=Vn(_n),c=i.data.get(r);return c===void 0&&(c=r(),i.data.set(r,c)),c},cacheSignal:function(){return Vn(_n).controller.signal}},cL=typeof WeakMap=="function"?WeakMap:Map,It=0,qt=null,Et=null,Tt=0,Bt=0,Or=null,Fi=!1,hl=!1,lg=!1,mi=0,ln=0,Ui=0,qo=0,cg=0,Mr=0,pl=0,tu=null,pr=null,ug=!1,of=0,Nb=0,af=1/0,lf=null,Wi=null,Tn=0,qi=null,ml=null,gi=0,dg=0,fg=null,Bb=null,nu=0,hg=null;function Dr(){return(It&2)!==0&&Tt!==0?Tt&-Tt:F.T!==null?yg():Es()}function zb(){if(Mr===0)if((Tt&536870912)===0||At){var r=nn;nn<<=1,(nn&3932160)===0&&(nn=262144),Mr=r}else Mr=536870912;return r=Lr.current,r!==null&&(r.flags|=32),Mr}function mr(r,i,c){(r===qt&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)&&(gl(r,0),Gi(r,Tt,Mr,!1)),bt(r,c),((It&2)===0||r!==qt)&&(r===qt&&((It&2)===0&&(qo|=c),ln===4&&Gi(r,Tt,Mr,!1)),Os(r))}function Hb(r,i,c){if((It&6)!==0)throw Error(s(327));var m=!c&&(i&127)===0&&(i&r.expiredLanes)===0||Ot(r,i),k=m?fL(r,i):mg(r,i,!0),O=m;do{if(k===0){hl&&!m&&Gi(r,i,0,!1);break}else{if(c=r.current.alternate,O&&!uL(c)){k=mg(r,i,!1),O=!1;continue}if(k===2){if(O=i,r.errorRecoveryDisabledLanes&O)var N=0;else N=r.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var Q=r;k=tu;var ie=Q.current.memoizedState.isDehydrated;if(ie&&(gl(Q,N).flags|=256),N=mg(Q,N,!1),N!==2){if(lg&&!ie){Q.errorRecoveryDisabledLanes|=O,qo|=O,k=4;break e}O=pr,pr=k,O!==null&&(pr===null?pr=O:pr.push.apply(pr,O))}k=N}if(O=!1,k!==2)continue}}if(k===1){gl(r,0),Gi(r,i,0,!0);break}e:{switch(m=r,O=k,O){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Gi(m,i,Mr,!Fi);break e;case 2:pr=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(k=of+300-ke(),10<k)){if(Gi(m,i,Mr,!Fi),Je(m,0,!0)!==0)break e;gi=i,m.timeoutHandle=vx(Vb.bind(null,m,c,pr,lf,ug,i,Mr,qo,pl,Fi,O,"Throttled",-0,0),k);break e}Vb(m,c,pr,lf,ug,i,Mr,qo,pl,Fi,O,null,-0,0)}}break}while(!0);Os(r)}function Vb(r,i,c,m,k,O,N,Q,ie,pe,Se,Te,ge,ye){if(r.timeoutHandle=-1,Te=i.subtreeFlags,Te&8192||(Te&16785408)===16785408){Te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hs},Db(i,O,Te);var $e=(O&62914560)===O?of-ke():(O&4194048)===O?Nb-ke():0;if($e=KL(Te,$e),$e!==null){gi=O,r.cancelPendingCommit=$e(Yb.bind(null,r,i,O,c,m,k,N,Q,ie,Se,Te,null,ge,ye)),Gi(r,O,N,!pe);return}}Yb(r,i,O,c,m,k,N,Q,ie)}function uL(r){for(var i=r;;){var c=i.tag;if((c===0||c===11||c===15)&&i.flags&16384&&(c=i.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var k=c[m],O=k.getSnapshot;k=k.value;try{if(!Rr(O(),k))return!1}catch{return!1}}if(c=i.child,i.subtreeFlags&16384&&c!==null)c.return=i,i=c;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Gi(r,i,c,m){i&=~cg,i&=~qo,r.suspendedLanes|=i,r.pingedLanes&=~i,m&&(r.warmLanes|=i),m=r.expirationTimes;for(var k=i;0<k;){var O=31-lt(k),N=1<<O;m[O]=-1,k&=~N}c!==0&&Qe(r,c,i)}function cf(){return(It&6)===0?(ru(0),!1):!0}function pg(){if(Et!==null){if(Bt===0)var r=Et.return;else r=Et,ii=jo=null,Am(r),ol=null,zc=0,r=Et;for(;r!==null;)_b(r.alternate,r),r=r.return;Et=null}}function gl(r,i){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,AL(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),gi=0,pg(),qt=r,Et=c=ri(r.current,null),Tt=i,Bt=0,Or=null,Fi=!1,hl=Ot(r,i),lg=!1,pl=Mr=cg=qo=Ui=ln=0,pr=tu=null,ug=!1,(i&8)!==0&&(i|=i&32);var m=r.entangledLanes;if(m!==0)for(r=r.entanglements,m&=i;0<m;){var k=31-lt(m),O=1<<k;i|=r[k],m&=~O}return mi=i,Ld(),c}function Fb(r,i){gt=null,F.H=$c,i===il||i===Nd?(i=s1(),Bt=3):i===_m?(i=s1(),Bt=4):Bt=i===Gm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Or=i,Et===null&&(ln=1,Qd(r,qr(i,r.current)))}function Ub(){var r=Lr.current;return r===null?!0:(Tt&4194048)===Tt?Yr===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?r===Yr:!1}function Wb(){var r=F.H;return F.H=$c,r===null?$c:r}function qb(){var r=F.A;return F.A=lL,r}function uf(){ln=4,Fi||(Tt&4194048)!==Tt&&Lr.current!==null||(hl=!0),(Ui&134217727)===0&&(qo&134217727)===0||qt===null||Gi(qt,Tt,Mr,!1)}function mg(r,i,c){var m=It;It|=2;var k=Wb(),O=qb();(qt!==r||Tt!==i)&&(lf=null,gl(r,i)),i=!1;var N=ln;e:do try{if(Bt!==0&&Et!==null){var Q=Et,ie=Or;switch(Bt){case 8:pg(),N=6;break e;case 3:case 2:case 9:case 6:Lr.current===null&&(i=!0);var pe=Bt;if(Bt=0,Or=null,vl(r,Q,ie,pe),c&&hl){N=0;break e}break;default:pe=Bt,Bt=0,Or=null,vl(r,Q,ie,pe)}}dL(),N=ln;break}catch(Se){Fb(r,Se)}while(!0);return i&&r.shellSuspendCounter++,ii=jo=null,It=m,F.H=k,F.A=O,Et===null&&(qt=null,Tt=0,Ld()),N}function dL(){for(;Et!==null;)Gb(Et)}function fL(r,i){var c=It;It|=2;var m=Wb(),k=qb();qt!==r||Tt!==i?(lf=null,af=ke()+500,gl(r,i)):hl=Ot(r,i);e:do try{if(Bt!==0&&Et!==null){i=Et;var O=Or;t:switch(Bt){case 1:Bt=0,Or=null,vl(r,i,O,1);break;case 2:case 9:if(n1(O)){Bt=0,Or=null,$b(i);break}i=function(){Bt!==2&&Bt!==9||qt!==r||(Bt=7),Os(r)},O.then(i,i);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:n1(O)?(Bt=0,Or=null,$b(i)):(Bt=0,Or=null,vl(r,i,O,7));break;case 5:var N=null;switch(Et.tag){case 26:N=Et.memoizedState;case 5:case 27:var Q=Et;if(N?Mx(N):Q.stateNode.complete){Bt=0,Or=null;var ie=Q.sibling;if(ie!==null)Et=ie;else{var pe=Q.return;pe!==null?(Et=pe,df(pe)):Et=null}break t}}Bt=0,Or=null,vl(r,i,O,5);break;case 6:Bt=0,Or=null,vl(r,i,O,6);break;case 8:pg(),ln=6;break e;default:throw Error(s(462))}}hL();break}catch(Se){Fb(r,Se)}while(!0);return ii=jo=null,F.H=m,F.A=k,It=c,Et!==null?0:(qt=null,Tt=0,Ld(),ln)}function hL(){for(;Et!==null&&!Oe();)Gb(Et)}function Gb(r){var i=gb(r.alternate,r,mi);r.memoizedProps=r.pendingProps,i===null?df(r):Et=i}function $b(r){var i=r,c=i.alternate;switch(i.tag){case 15:case 0:i=ub(c,i,i.pendingProps,i.type,void 0,Tt);break;case 11:i=ub(c,i,i.pendingProps,i.type.render,i.ref,Tt);break;case 5:Am(i);default:_b(c,i),i=Et=qy(i,mi),i=gb(c,i,mi)}r.memoizedProps=r.pendingProps,i===null?df(r):Et=i}function vl(r,i,c,m){ii=jo=null,Am(i),ol=null,zc=0;var k=i.return;try{if(tL(r,k,i,c,Tt)){ln=1,Qd(r,qr(c,r.current)),Et=null;return}}catch(O){if(k!==null)throw Et=k,O;ln=1,Qd(r,qr(c,r.current)),Et=null;return}i.flags&32768?(At||m===1?r=!0:hl||(Tt&536870912)!==0?r=!1:(Fi=r=!0,(m===2||m===9||m===3||m===6)&&(m=Lr.current,m!==null&&m.tag===13&&(m.flags|=16384))),Kb(i,r)):df(i)}function df(r){var i=r;do{if((i.flags&32768)!==0){Kb(i,Fi);return}r=i.return;var c=sL(i.alternate,i,mi);if(c!==null){Et=c;return}if(i=i.sibling,i!==null){Et=i;return}Et=i=r}while(i!==null);ln===0&&(ln=5)}function Kb(r,i){do{var c=iL(r.alternate,r);if(c!==null){c.flags&=32767,Et=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!i&&(r=r.sibling,r!==null)){Et=r;return}Et=r=c}while(r!==null);ln=6,Et=null}function Yb(r,i,c,m,k,O,N,Q,ie){r.cancelPendingCommit=null;do ff();while(Tn!==0);if((It&6)!==0)throw Error(s(327));if(i!==null){if(i===r.current)throw Error(s(177));if(O=i.lanes|i.childLanes,O|=rm,xt(r,c,O,N,Q,ie),r===qt&&(Et=qt=null,Tt=0),ml=i,qi=r,gi=c,dg=O,fg=k,Bb=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,vL(Ie,function(){return ex(),null})):(r.callbackNode=null,r.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=F.T,F.T=null,k=G.p,G.p=2,N=It,It|=4;try{oL(r,i,c)}finally{It=N,G.p=k,F.T=m}}Tn=1,Xb(),Qb(),Zb()}}function Xb(){if(Tn===1){Tn=0;var r=qi,i=ml,c=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||c){c=F.T,F.T=null;var m=G.p;G.p=2;var k=It;It|=4;try{Ab(i,r);var O=Rg,N=jy(r.containerInfo),Q=O.focusedElem,ie=O.selectionRange;if(N!==Q&&Q&&Q.ownerDocument&&Iy(Q.ownerDocument.documentElement,Q)){if(ie!==null&&Zp(Q)){var pe=ie.start,Se=ie.end;if(Se===void 0&&(Se=pe),"selectionStart"in Q)Q.selectionStart=pe,Q.selectionEnd=Math.min(Se,Q.value.length);else{var Te=Q.ownerDocument||document,ge=Te&&Te.defaultView||window;if(ge.getSelection){var ye=ge.getSelection(),$e=Q.textContent.length,ut=Math.min(ie.start,$e),Ut=ie.end===void 0?ut:Math.min(ie.end,$e);!ye.extend&&ut>Ut&&(N=Ut,Ut=ut,ut=N);var ce=Py(Q,ut),ae=Py(Q,Ut);if(ce&&ae&&(ye.rangeCount!==1||ye.anchorNode!==ce.node||ye.anchorOffset!==ce.offset||ye.focusNode!==ae.node||ye.focusOffset!==ae.offset)){var fe=Te.createRange();fe.setStart(ce.node,ce.offset),ye.removeAllRanges(),ut>Ut?(ye.addRange(fe),ye.extend(ae.node,ae.offset)):(fe.setEnd(ae.node,ae.offset),ye.addRange(fe))}}}}for(Te=[],ye=Q;ye=ye.parentNode;)ye.nodeType===1&&Te.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof Q.focus=="function"&&Q.focus(),Q=0;Q<Te.length;Q++){var Re=Te[Q];Re.element.scrollLeft=Re.left,Re.element.scrollTop=Re.top}}wf=!!kg,Rg=kg=null}finally{It=k,G.p=m,F.T=c}}r.current=i,Tn=2}}function Qb(){if(Tn===2){Tn=0;var r=qi,i=ml,c=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||c){c=F.T,F.T=null;var m=G.p;G.p=2;var k=It;It|=4;try{Eb(r,i.alternate,i)}finally{It=k,G.p=m,F.T=c}}Tn=3}}function Zb(){if(Tn===4||Tn===3){Tn=0,me();var r=qi,i=ml,c=gi,m=Bb;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Tn=5:(Tn=0,ml=qi=null,Jb(r,r.pendingLanes));var k=r.pendingLanes;if(k===0&&(Wi=null),zn(c),i=i.stateNode,Ee&&typeof Ee.onCommitFiberRoot=="function")try{Ee.onCommitFiberRoot(Ve,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=F.T,k=G.p,G.p=2,F.T=null;try{for(var O=r.onRecoverableError,N=0;N<m.length;N++){var Q=m[N];O(Q.value,{componentStack:Q.stack})}}finally{F.T=i,G.p=k}}(gi&3)!==0&&ff(),Os(r),k=r.pendingLanes,(c&261930)!==0&&(k&42)!==0?r===hg?nu++:(nu=0,hg=r):nu=0,ru(0)}}function Jb(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Nc(i)))}function ff(){return Xb(),Qb(),Zb(),ex()}function ex(){if(Tn!==5)return!1;var r=qi,i=dg;dg=0;var c=zn(gi),m=F.T,k=G.p;try{G.p=32>c?32:c,F.T=null,c=fg,fg=null;var O=qi,N=gi;if(Tn=0,ml=qi=null,gi=0,(It&6)!==0)throw Error(s(331));var Q=It;if(It|=4,Ib(O.current),Mb(O,O.current,N,c),It=Q,ru(0,!1),Ee&&typeof Ee.onPostCommitFiberRoot=="function")try{Ee.onPostCommitFiberRoot(Ve,O)}catch{}return!0}finally{G.p=k,F.T=m,Jb(r,i)}}function tx(r,i,c){i=qr(c,i),i=qm(r.stateNode,i,2),r=Bi(r,i,2),r!==null&&(bt(r,2),Os(r))}function zt(r,i,c){if(r.tag===3)tx(r,r,c);else for(;i!==null;){if(i.tag===3){tx(i,r,c);break}else if(i.tag===1){var m=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Wi===null||!Wi.has(m))){r=qr(c,r),c=nb(2),m=Bi(i,c,2),m!==null&&(rb(c,m,i,r),bt(m,2),Os(m));break}}i=i.return}}function gg(r,i,c){var m=r.pingCache;if(m===null){m=r.pingCache=new cL;var k=new Set;m.set(i,k)}else k=m.get(i),k===void 0&&(k=new Set,m.set(i,k));k.has(c)||(lg=!0,k.add(c),r=pL.bind(null,r,i,c),i.then(r,r))}function pL(r,i,c){var m=r.pingCache;m!==null&&m.delete(i),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,qt===r&&(Tt&c)===c&&(ln===4||ln===3&&(Tt&62914560)===Tt&&300>ke()-of?(It&2)===0&&gl(r,0):cg|=c,pl===Tt&&(pl=0)),Os(r)}function nx(r,i){i===0&&(i=ot()),r=Do(r,i),r!==null&&(bt(r,i),Os(r))}function mL(r){var i=r.memoizedState,c=0;i!==null&&(c=i.retryLane),nx(r,c)}function gL(r,i){var c=0;switch(r.tag){case 31:case 13:var m=r.stateNode,k=r.memoizedState;k!==null&&(c=k.retryLane);break;case 19:m=r.stateNode;break;case 22:m=r.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(i),nx(r,c)}function vL(r,i){return Ae(r,i)}var hf=null,_l=null,vg=!1,pf=!1,_g=!1,$i=0;function Os(r){r!==_l&&r.next===null&&(_l===null?hf=_l=r:_l=_l.next=r),pf=!0,vg||(vg=!0,yL())}function ru(r,i){if(!_g&&pf){_g=!0;do for(var c=!1,m=hf;m!==null;){if(r!==0){var k=m.pendingLanes;if(k===0)var O=0;else{var N=m.suspendedLanes,Q=m.pingedLanes;O=(1<<31-lt(42|r)+1)-1,O&=k&~(N&~Q),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(c=!0,ox(m,O))}else O=Tt,O=Je(m,m===qt?O:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(O&3)===0||Ot(m,O)||(c=!0,ox(m,O));m=m.next}while(c);_g=!1}}function _L(){rx()}function rx(){pf=vg=!1;var r=0;$i!==0&&LL()&&(r=$i);for(var i=ke(),c=null,m=hf;m!==null;){var k=m.next,O=sx(m,i);O===0?(m.next=null,c===null?hf=k:c.next=k,k===null&&(_l=c)):(c=m,(r!==0||(O&3)!==0)&&(pf=!0)),m=k}Tn!==0&&Tn!==5||ru(r),$i!==0&&($i=0)}function sx(r,i){for(var c=r.suspendedLanes,m=r.pingedLanes,k=r.expirationTimes,O=r.pendingLanes&-62914561;0<O;){var N=31-lt(O),Q=1<<N,ie=k[N];ie===-1?((Q&c)===0||(Q&m)!==0)&&(k[N]=jt(Q,i)):ie<=i&&(r.expiredLanes|=Q),O&=~Q}if(i=qt,c=Tt,c=Je(r,r===i?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m=r.callbackNode,c===0||r===i&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)return m!==null&&m!==null&&be(m),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||Ot(r,c)){if(i=c&-c,i===r.callbackPriority)return i;switch(m!==null&&be(m),zn(c)){case 2:case 8:c=De;break;case 32:c=Ie;break;case 268435456:c=et;break;default:c=Ie}return m=ix.bind(null,r),c=Ae(c,m),r.callbackPriority=i,r.callbackNode=c,i}return m!==null&&m!==null&&be(m),r.callbackPriority=2,r.callbackNode=null,2}function ix(r,i){if(Tn!==0&&Tn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(ff()&&r.callbackNode!==c)return null;var m=Tt;return m=Je(r,r===qt?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m===0?null:(Hb(r,m,i),sx(r,ke()),r.callbackNode!=null&&r.callbackNode===c?ix.bind(null,r):null)}function ox(r,i){if(ff())return null;Hb(r,i,!0)}function yL(){OL(function(){(It&6)!==0?Ae(qe,_L):rx()})}function yg(){if($i===0){var r=rl;r===0&&(r=ct,ct<<=1,(ct&261888)===0&&(ct=256)),$i=r}return $i}function ax(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ti(""+r)}function lx(r,i){var c=i.ownerDocument.createElement("input");return c.name=i.name,c.value=i.value,r.id&&c.setAttribute("form",r.id),i.parentNode.insertBefore(c,i),r=new FormData(r),c.parentNode.removeChild(c),r}function bL(r,i,c,m,k){if(i==="submit"&&c&&c.stateNode===k){var O=ax((k[mn]||null).action),N=m.submitter;N&&(i=(i=N[mn]||null)?ax(i.formAction):N.getAttribute("formAction"),i!==null&&(O=i,N=null));var Q=new Ed("action","action",null,m,k);r.push({event:Q,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if($i!==0){var ie=N?lx(k,N):new FormData(k);zm(c,{pending:!0,data:ie,method:k.method,action:O},null,ie)}}else typeof O=="function"&&(Q.preventDefault(),ie=N?lx(k,N):new FormData(k),zm(c,{pending:!0,data:ie,method:k.method,action:O},O,ie))},currentTarget:k}]})}}for(var bg=0;bg<nm.length;bg++){var xg=nm[bg],xL=xg.toLowerCase(),SL=xg[0].toUpperCase()+xg.slice(1);ps(xL,"on"+SL)}ps(zy,"onAnimationEnd"),ps(Hy,"onAnimationIteration"),ps(Vy,"onAnimationStart"),ps("dblclick","onDoubleClick"),ps("focusin","onFocus"),ps("focusout","onBlur"),ps(B5,"onTransitionRun"),ps(z5,"onTransitionStart"),ps(H5,"onTransitionCancel"),ps(Fy,"onTransitionEnd"),fs("onMouseEnter",["mouseout","mouseover"]),fs("onMouseLeave",["mouseout","mouseover"]),fs("onPointerEnter",["pointerout","pointerover"]),fs("onPointerLeave",["pointerout","pointerover"]),Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Er("onBeforeInput",["compositionend","keypress","textInput","paste"]),Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var su="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(" "),CL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(su));function cx(r,i){i=(i&4)!==0;for(var c=0;c<r.length;c++){var m=r[c],k=m.event;m=m.listeners;e:{var O=void 0;if(i)for(var N=m.length-1;0<=N;N--){var Q=m[N],ie=Q.instance,pe=Q.currentTarget;if(Q=Q.listener,ie!==O&&k.isPropagationStopped())break e;O=Q,k.currentTarget=pe;try{O(k)}catch(Se){Td(Se)}k.currentTarget=null,O=ie}else for(N=0;N<m.length;N++){if(Q=m[N],ie=Q.instance,pe=Q.currentTarget,Q=Q.listener,ie!==O&&k.isPropagationStopped())break e;O=Q,k.currentTarget=pe;try{O(k)}catch(Se){Td(Se)}k.currentTarget=null,O=ie}}}}function kt(r,i){var c=i[wr];c===void 0&&(c=i[wr]=new Set);var m=r+"__bubble";c.has(m)||(ux(i,r,2,!1),c.add(m))}function Sg(r,i,c){var m=0;i&&(m|=4),ux(c,r,m,i)}var mf="_reactListening"+Math.random().toString(36).slice(2);function Cg(r){if(!r[mf]){r[mf]=!0,tr.forEach(function(c){c!=="selectionchange"&&(CL.has(c)||Sg(c,!1,r),Sg(c,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[mf]||(i[mf]=!0,Sg("selectionchange",!1,i))}}function ux(r,i,c,m){switch(zx(i)){case 2:var k=QL;break;case 8:k=ZL;break;default:k=Bg}c=k.bind(null,i,c,r),k=void 0,!Up||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(k=!0),m?k!==void 0?r.addEventListener(i,c,{capture:!0,passive:k}):r.addEventListener(i,c,!0):k!==void 0?r.addEventListener(i,c,{passive:k}):r.addEventListener(i,c,!1)}function wg(r,i,c,m,k){var O=m;if((i&1)===0&&(i&2)===0&&m!==null)e:for(;;){if(m===null)return;var N=m.tag;if(N===3||N===4){var Q=m.stateNode.containerInfo;if(Q===k)break;if(N===4)for(N=m.return;N!==null;){var ie=N.tag;if((ie===3||ie===4)&&N.stateNode.containerInfo===k)return;N=N.return}for(;Q!==null;){if(N=Qs(Q),N===null)return;if(ie=N.tag,ie===5||ie===6||ie===26||ie===27){m=O=N;continue e}Q=Q.parentNode}}m=m.return}my(function(){var pe=O,Se=Vp(c),Te=[];e:{var ge=Uy.get(r);if(ge!==void 0){var ye=Ed,$e=r;switch(r){case"keypress":if(Cd(c)===0)break e;case"keydown":case"keyup":ye=g5;break;case"focusin":$e="focus",ye=$p;break;case"focusout":$e="blur",ye=$p;break;case"beforeblur":case"afterblur":ye=$p;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=_y;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=s5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=y5;break;case zy:case Hy:case Vy:ye=a5;break;case Fy:ye=x5;break;case"scroll":case"scrollend":ye=n5;break;case"wheel":ye=C5;break;case"copy":case"cut":case"paste":ye=c5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=by;break;case"toggle":case"beforetoggle":ye=E5}var ut=(i&4)!==0,Ut=!ut&&(r==="scroll"||r==="scrollend"),ce=ut?ge!==null?ge+"Capture":null:ge;ut=[];for(var ae=pe,fe;ae!==null;){var Re=ae;if(fe=Re.stateNode,Re=Re.tag,Re!==5&&Re!==26&&Re!==27||fe===null||ce===null||(Re=kc(ae,ce),Re!=null&&ut.push(iu(ae,Re,fe))),Ut)break;ae=ae.return}0<ut.length&&(ge=new ye(ge,$e,null,c,Se),Te.push({event:ge,listeners:ut}))}}if((i&7)===0){e:{if(ge=r==="mouseover"||r==="pointerover",ye=r==="mouseout"||r==="pointerout",ge&&c!==xd&&($e=c.relatedTarget||c.fromElement)&&(Qs($e)||$e[ks]))break e;if((ye||ge)&&(ge=Se.window===Se?Se:(ge=Se.ownerDocument)?ge.defaultView||ge.parentWindow:window,ye?($e=c.relatedTarget||c.toElement,ye=pe,$e=$e?Qs($e):null,$e!==null&&(Ut=u($e),ut=$e.tag,$e!==Ut||ut!==5&&ut!==27&&ut!==6)&&($e=null)):(ye=null,$e=pe),ye!==$e)){if(ut=_y,Re="onMouseLeave",ce="onMouseEnter",ae="mouse",(r==="pointerout"||r==="pointerover")&&(ut=by,Re="onPointerLeave",ce="onPointerEnter",ae="pointer"),Ut=ye==null?ge:Lo(ye),fe=$e==null?ge:Lo($e),ge=new ut(Re,ae+"leave",ye,c,Se),ge.target=Ut,ge.relatedTarget=fe,Re=null,Qs(Se)===pe&&(ut=new ut(ce,ae+"enter",$e,c,Se),ut.target=fe,ut.relatedTarget=Ut,Re=ut),Ut=Re,ye&&$e)t:{for(ut=wL,ce=ye,ae=$e,fe=0,Re=ce;Re;Re=ut(Re))fe++;Re=0;for(var it=ae;it;it=ut(it))Re++;for(;0<fe-Re;)ce=ut(ce),fe--;for(;0<Re-fe;)ae=ut(ae),Re--;for(;fe--;){if(ce===ae||ae!==null&&ce===ae.alternate){ut=ce;break t}ce=ut(ce),ae=ut(ae)}ut=null}else ut=null;ye!==null&&dx(Te,ge,ye,ut,!1),$e!==null&&Ut!==null&&dx(Te,Ut,$e,ut,!0)}}e:{if(ge=pe?Lo(pe):window,ye=ge.nodeName&&ge.nodeName.toLowerCase(),ye==="select"||ye==="input"&&ge.type==="file")var Mt=Ty;else if(ky(ge))if(Ly)Mt=I5;else{Mt=D5;var Ze=M5}else ye=ge.nodeName,!ye||ye.toLowerCase()!=="input"||ge.type!=="checkbox"&&ge.type!=="radio"?pe&&vn(pe.elementType)&&(Mt=Ty):Mt=P5;if(Mt&&(Mt=Mt(r,pe))){Ry(Te,Mt,c,Se);break e}Ze&&Ze(r,ge,pe),r==="focusout"&&pe&&ge.type==="number"&&pe.memoizedProps.value!=null&&Ec(ge,"number",ge.value)}switch(Ze=pe?Lo(pe):window,r){case"focusin":(ky(Ze)||Ze.contentEditable==="true")&&(Ya=Ze,Jp=pe,Pc=null);break;case"focusout":Pc=Jp=Ya=null;break;case"mousedown":em=!0;break;case"contextmenu":case"mouseup":case"dragend":em=!1,Ny(Te,c,Se);break;case"selectionchange":if(N5)break;case"keydown":case"keyup":Ny(Te,c,Se)}var _t;if(Yp)e:{switch(r){case"compositionstart":var Lt="onCompositionStart";break e;case"compositionend":Lt="onCompositionEnd";break e;case"compositionupdate":Lt="onCompositionUpdate";break e}Lt=void 0}else Ka?wy(r,c)&&(Lt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(Lt="onCompositionStart");Lt&&(xy&&c.locale!=="ko"&&(Ka||Lt!=="onCompositionStart"?Lt==="onCompositionEnd"&&Ka&&(_t=gy()):(Oi=Se,Wp="value"in Oi?Oi.value:Oi.textContent,Ka=!0)),Ze=gf(pe,Lt),0<Ze.length&&(Lt=new yy(Lt,r,null,c,Se),Te.push({event:Lt,listeners:Ze}),_t?Lt.data=_t:(_t=Ey(c),_t!==null&&(Lt.data=_t)))),(_t=R5?T5(r,c):L5(r,c))&&(Lt=gf(pe,"onBeforeInput"),0<Lt.length&&(Ze=new yy("onBeforeInput","beforeinput",null,c,Se),Te.push({event:Ze,listeners:Lt}),Ze.data=_t)),bL(Te,r,pe,c,Se)}cx(Te,i)})}function iu(r,i,c){return{instance:r,listener:i,currentTarget:c}}function gf(r,i){for(var c=i+"Capture",m=[];r!==null;){var k=r,O=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||O===null||(k=kc(r,c),k!=null&&m.unshift(iu(r,k,O)),k=kc(r,i),k!=null&&m.push(iu(r,k,O))),r.tag===3)return m;r=r.return}return[]}function wL(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function dx(r,i,c,m,k){for(var O=i._reactName,N=[];c!==null&&c!==m;){var Q=c,ie=Q.alternate,pe=Q.stateNode;if(Q=Q.tag,ie!==null&&ie===m)break;Q!==5&&Q!==26&&Q!==27||pe===null||(ie=pe,k?(pe=kc(c,O),pe!=null&&N.unshift(iu(c,pe,ie))):k||(pe=kc(c,O),pe!=null&&N.push(iu(c,pe,ie)))),c=c.return}N.length!==0&&r.push({event:i,listeners:N})}var EL=/\r\n?/g,kL=/\u0000|\uFFFD/g;function fx(r){return(typeof r=="string"?r:""+r).replace(EL,`
10
+ `).replace(kL,"")}function hx(r,i){return i=fx(i),fx(r)===i}function Ft(r,i,c,m,k,O){switch(c){case"children":typeof m=="string"?i==="body"||i==="textarea"&&m===""||nt(r,m):(typeof m=="number"||typeof m=="bigint")&&i!=="body"&&nt(r,""+m);break;case"className":Ti(r,"class",m);break;case"tabIndex":Ti(r,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Ti(r,c,m);break;case"style":rn(r,m,O);break;case"data":if(i!=="object"){Ti(r,"data",m);break}case"src":case"href":if(m===""&&(i!=="a"||c!=="href")){r.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(c);break}m=ti(""+m),r.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){r.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof O=="function"&&(c==="formAction"?(i!=="input"&&Ft(r,i,"name",k.name,k,null),Ft(r,i,"formEncType",k.formEncType,k,null),Ft(r,i,"formMethod",k.formMethod,k,null),Ft(r,i,"formTarget",k.formTarget,k,null)):(Ft(r,i,"encType",k.encType,k,null),Ft(r,i,"method",k.method,k,null),Ft(r,i,"target",k.target,k,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(c);break}m=ti(""+m),r.setAttribute(c,m);break;case"onClick":m!=null&&(r.onclick=hs);break;case"onScroll":m!=null&&kt("scroll",r);break;case"onScrollEnd":m!=null&&kt("scrollend",r);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(k.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"multiple":r.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":r.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){r.removeAttribute("xlink:href");break}c=ti(""+m),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,""+m):r.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":m===!0?r.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,m):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?r.setAttribute(c,m):r.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?r.removeAttribute(c):r.setAttribute(c,m);break;case"popover":kt("beforetoggle",r),kt("toggle",r),Zs(r,"popover",m);break;case"xlinkActuate":kr(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":kr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":kr(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":kr(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":kr(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":kr(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":kr(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":kr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":kr(r,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Zs(r,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Js.get(c)||c,Zs(r,c,m))}}function Eg(r,i,c,m,k,O){switch(c){case"style":rn(r,m,O);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(k.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"children":typeof m=="string"?nt(r,m):(typeof m=="number"||typeof m=="bigint")&&nt(r,""+m);break;case"onScroll":m!=null&&kt("scroll",r);break;case"onScrollEnd":m!=null&&kt("scrollend",r);break;case"onClick":m!=null&&(r.onclick=hs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!nr.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(k=c.endsWith("Capture"),i=c.slice(2,k?c.length-7:void 0),O=r[mn]||null,O=O!=null?O[c]:null,typeof O=="function"&&r.removeEventListener(i,O,k),typeof m=="function")){typeof O!="function"&&O!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(i,m,k);break e}c in r?r[c]=m:m===!0?r.setAttribute(c,""):Zs(r,c,m)}}}function Un(r,i,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":kt("error",r),kt("load",r);var m=!1,k=!1,O;for(O in c)if(c.hasOwnProperty(O)){var N=c[O];if(N!=null)switch(O){case"src":m=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ft(r,i,O,N,c,null)}}k&&Ft(r,i,"srcSet",c.srcSet,c,null),m&&Ft(r,i,"src",c.src,c,null);return;case"input":kt("invalid",r);var Q=O=N=k=null,ie=null,pe=null;for(m in c)if(c.hasOwnProperty(m)){var Se=c[m];if(Se!=null)switch(m){case"name":k=Se;break;case"type":N=Se;break;case"checked":ie=Se;break;case"defaultChecked":pe=Se;break;case"value":O=Se;break;case"defaultValue":Q=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(s(137,i));break;default:Ft(r,i,m,Se,c,null)}}yd(r,O,Q,ie,pe,N,k,!1);return;case"select":kt("invalid",r),m=N=O=null;for(k in c)if(c.hasOwnProperty(k)&&(Q=c[k],Q!=null))switch(k){case"value":O=Q;break;case"defaultValue":N=Q;break;case"multiple":m=Q;default:Ft(r,i,k,Q,c,null)}i=O,c=N,r.multiple=!!m,i!=null?Ai(r,!!m,i,!1):c!=null&&Ai(r,!!m,c,!0);return;case"textarea":kt("invalid",r),O=k=m=null;for(N in c)if(c.hasOwnProperty(N)&&(Q=c[N],Q!=null))switch(N){case"value":m=Q;break;case"defaultValue":k=Q;break;case"children":O=Q;break;case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(91));break;default:Ft(r,i,N,Q,c,null)}Ue(r,m,k,O);return;case"option":for(ie in c)c.hasOwnProperty(ie)&&(m=c[ie],m!=null)&&(ie==="selected"?r.selected=m&&typeof m!="function"&&typeof m!="symbol":Ft(r,i,ie,m,c,null));return;case"dialog":kt("beforetoggle",r),kt("toggle",r),kt("cancel",r),kt("close",r);break;case"iframe":case"object":kt("load",r);break;case"video":case"audio":for(m=0;m<su.length;m++)kt(su[m],r);break;case"image":kt("error",r),kt("load",r);break;case"details":kt("toggle",r);break;case"embed":case"source":case"link":kt("error",r),kt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(pe in c)if(c.hasOwnProperty(pe)&&(m=c[pe],m!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ft(r,i,pe,m,c,null)}return;default:if(vn(i)){for(Se in c)c.hasOwnProperty(Se)&&(m=c[Se],m!==void 0&&Eg(r,i,Se,m,c,void 0));return}}for(Q in c)c.hasOwnProperty(Q)&&(m=c[Q],m!=null&&Ft(r,i,Q,m,c,null))}function RL(r,i,c,m){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,O=null,N=null,Q=null,ie=null,pe=null,Se=null;for(ye in c){var Te=c[ye];if(c.hasOwnProperty(ye)&&Te!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":ie=Te;default:m.hasOwnProperty(ye)||Ft(r,i,ye,null,m,Te)}}for(var ge in m){var ye=m[ge];if(Te=c[ge],m.hasOwnProperty(ge)&&(ye!=null||Te!=null))switch(ge){case"type":O=ye;break;case"name":k=ye;break;case"checked":pe=ye;break;case"defaultChecked":Se=ye;break;case"value":N=ye;break;case"defaultValue":Q=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,i));break;default:ye!==Te&&Ft(r,i,ge,ye,m,Te)}}wc(r,N,Q,ie,pe,Se,O,k);return;case"select":ye=N=Q=ge=null;for(O in c)if(ie=c[O],c.hasOwnProperty(O)&&ie!=null)switch(O){case"value":break;case"multiple":ye=ie;default:m.hasOwnProperty(O)||Ft(r,i,O,null,m,ie)}for(k in m)if(O=m[k],ie=c[k],m.hasOwnProperty(k)&&(O!=null||ie!=null))switch(k){case"value":ge=O;break;case"defaultValue":Q=O;break;case"multiple":N=O;default:O!==ie&&Ft(r,i,k,O,m,ie)}i=Q,c=N,m=ye,ge!=null?Ai(r,!!c,ge,!1):!!m!=!!c&&(i!=null?Ai(r,!!c,i,!0):Ai(r,!!c,c?[]:"",!1));return;case"textarea":ye=ge=null;for(Q in c)if(k=c[Q],c.hasOwnProperty(Q)&&k!=null&&!m.hasOwnProperty(Q))switch(Q){case"value":break;case"children":break;default:Ft(r,i,Q,null,m,k)}for(N in m)if(k=m[N],O=c[N],m.hasOwnProperty(N)&&(k!=null||O!=null))switch(N){case"value":ge=k;break;case"defaultValue":ye=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(s(91));break;default:k!==O&&Ft(r,i,N,k,m,O)}bd(r,ge,ye);return;case"option":for(var $e in c)ge=c[$e],c.hasOwnProperty($e)&&ge!=null&&!m.hasOwnProperty($e)&&($e==="selected"?r.selected=!1:Ft(r,i,$e,null,m,ge));for(ie in m)ge=m[ie],ye=c[ie],m.hasOwnProperty(ie)&&ge!==ye&&(ge!=null||ye!=null)&&(ie==="selected"?r.selected=ge&&typeof ge!="function"&&typeof ge!="symbol":Ft(r,i,ie,ge,m,ye));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ut in c)ge=c[ut],c.hasOwnProperty(ut)&&ge!=null&&!m.hasOwnProperty(ut)&&Ft(r,i,ut,null,m,ge);for(pe in m)if(ge=m[pe],ye=c[pe],m.hasOwnProperty(pe)&&ge!==ye&&(ge!=null||ye!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(s(137,i));break;default:Ft(r,i,pe,ge,m,ye)}return;default:if(vn(i)){for(var Ut in c)ge=c[Ut],c.hasOwnProperty(Ut)&&ge!==void 0&&!m.hasOwnProperty(Ut)&&Eg(r,i,Ut,void 0,m,ge);for(Se in m)ge=m[Se],ye=c[Se],!m.hasOwnProperty(Se)||ge===ye||ge===void 0&&ye===void 0||Eg(r,i,Se,ge,m,ye);return}}for(var ce in c)ge=c[ce],c.hasOwnProperty(ce)&&ge!=null&&!m.hasOwnProperty(ce)&&Ft(r,i,ce,null,m,ge);for(Te in m)ge=m[Te],ye=c[Te],!m.hasOwnProperty(Te)||ge===ye||ge==null&&ye==null||Ft(r,i,Te,ge,m,ye)}function px(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TL(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var k=c[m],O=k.transferSize,N=k.initiatorType,Q=k.duration;if(O&&Q&&px(N)){for(N=0,Q=k.responseEnd,m+=1;m<c.length;m++){var ie=c[m],pe=ie.startTime;if(pe>Q)break;var Se=ie.transferSize,Te=ie.initiatorType;Se&&px(Te)&&(ie=ie.responseEnd,N+=Se*(ie<Q?1:(Q-pe)/(ie-pe)))}if(--m,i+=8*(O+N)/(k.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var kg=null,Rg=null;function vf(r){return r.nodeType===9?r:r.ownerDocument}function mx(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gx(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function Tg(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Lg=null;function LL(){var r=window.event;return r&&r.type==="popstate"?r===Lg?!1:(Lg=r,!0):(Lg=null,!1)}var vx=typeof setTimeout=="function"?setTimeout:void 0,AL=typeof clearTimeout=="function"?clearTimeout:void 0,_x=typeof Promise=="function"?Promise:void 0,OL=typeof queueMicrotask=="function"?queueMicrotask:typeof _x<"u"?function(r){return _x.resolve(null).then(r).catch(ML)}:vx;function ML(r){setTimeout(function(){throw r})}function Ki(r){return r==="head"}function yx(r,i){var c=i,m=0;do{var k=c.nextSibling;if(r.removeChild(c),k&&k.nodeType===8)if(c=k.data,c==="/$"||c==="/&"){if(m===0){r.removeChild(k),Sl(i);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")ou(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,ou(c);for(var O=c.firstChild;O;){var N=O.nextSibling,Q=O.nodeName;O[Ro]||Q==="SCRIPT"||Q==="STYLE"||Q==="LINK"&&O.rel.toLowerCase()==="stylesheet"||c.removeChild(O),O=N}}else c==="body"&&ou(r.ownerDocument.body);c=k}while(c);Sl(i)}function bx(r,i){var c=r;r=0;do{var m=c.nextSibling;if(c.nodeType===1?i?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(i?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=m}while(c)}function Ag(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var c=i;switch(i=i.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Ag(c),To(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function DL(r,i,c,m){for(;r.nodeType===1;){var k=c;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!m&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(m){if(!r[Ro])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(O=r.getAttribute("rel"),O==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(O!==k.rel||r.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||r.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||r.getAttribute("title")!==(k.title==null?null:k.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(O=r.getAttribute("src"),(O!==(k.src==null?null:k.src)||r.getAttribute("type")!==(k.type==null?null:k.type)||r.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&O&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var O=k.name==null?null:""+k.name;if(k.type==="hidden"&&r.getAttribute("name")===O)return r}else return r;if(r=Xr(r.nextSibling),r===null)break}return null}function PL(r,i,c){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Xr(r.nextSibling),r===null))return null;return r}function xx(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=Xr(r.nextSibling),r===null))return null;return r}function Og(r){return r.data==="$?"||r.data==="$~"}function Mg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function IL(r,i){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||c.readyState!=="loading")i();else{var m=function(){i(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),r._reactRetry=m}}function Xr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var Dg=null;function Sx(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(i===0)return Xr(r.nextSibling);i--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||i++}r=r.nextSibling}return null}function Cx(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(i===0)return r;i--}else c!=="/$"&&c!=="/&"||i++}r=r.previousSibling}return null}function wx(r,i,c){switch(i=vf(c),r){case"html":if(r=i.documentElement,!r)throw Error(s(452));return r;case"head":if(r=i.head,!r)throw Error(s(453));return r;case"body":if(r=i.body,!r)throw Error(s(454));return r;default:throw Error(s(451))}}function ou(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);To(r)}var Qr=new Map,Ex=new Set;function _f(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var vi=G.d;G.d={f:jL,r:NL,D:BL,C:zL,L:HL,m:VL,X:UL,S:FL,M:WL};function jL(){var r=vi.f(),i=cf();return r||i}function NL(r){var i=Rs(r);i!==null&&i.tag===5&&i.type==="form"?F1(i):vi.r(r)}var yl=typeof document>"u"?null:document;function kx(r,i,c){var m=yl;if(m&&typeof i=="string"&&i){var k=cr(i);k='link[rel="'+r+'"][href="'+k+'"]',typeof c=="string"&&(k+='[crossorigin="'+c+'"]'),Ex.has(k)||(Ex.add(k),r={rel:r,crossOrigin:c,href:i},m.querySelector(k)===null&&(i=m.createElement("link"),Un(i,"link",r),gn(i),m.head.appendChild(i)))}}function BL(r){vi.D(r),kx("dns-prefetch",r,null)}function zL(r,i){vi.C(r,i),kx("preconnect",r,i)}function HL(r,i,c){vi.L(r,i,c);var m=yl;if(m&&r&&i){var k='link[rel="preload"][as="'+cr(i)+'"]';i==="image"&&c&&c.imageSrcSet?(k+='[imagesrcset="'+cr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(k+='[imagesizes="'+cr(c.imageSizes)+'"]')):k+='[href="'+cr(r)+'"]';var O=k;switch(i){case"style":O=bl(r);break;case"script":O=xl(r)}Qr.has(O)||(r=f({rel:"preload",href:i==="image"&&c&&c.imageSrcSet?void 0:r,as:i},c),Qr.set(O,r),m.querySelector(k)!==null||i==="style"&&m.querySelector(au(O))||i==="script"&&m.querySelector(lu(O))||(i=m.createElement("link"),Un(i,"link",r),gn(i),m.head.appendChild(i)))}}function VL(r,i){vi.m(r,i);var c=yl;if(c&&r){var m=i&&typeof i.as=="string"?i.as:"script",k='link[rel="modulepreload"][as="'+cr(m)+'"][href="'+cr(r)+'"]',O=k;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=xl(r)}if(!Qr.has(O)&&(r=f({rel:"modulepreload",href:r},i),Qr.set(O,r),c.querySelector(k)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(lu(O)))return}m=c.createElement("link"),Un(m,"link",r),gn(m),c.head.appendChild(m)}}}function FL(r,i,c){vi.S(r,i,c);var m=yl;if(m&&r){var k=ds(m).hoistableStyles,O=bl(r);i=i||"default";var N=k.get(O);if(!N){var Q={loading:0,preload:null};if(N=m.querySelector(au(O)))Q.loading=5;else{r=f({rel:"stylesheet",href:r,"data-precedence":i},c),(c=Qr.get(O))&&Pg(r,c);var ie=N=m.createElement("link");gn(ie),Un(ie,"link",r),ie._p=new Promise(function(pe,Se){ie.onload=pe,ie.onerror=Se}),ie.addEventListener("load",function(){Q.loading|=1}),ie.addEventListener("error",function(){Q.loading|=2}),Q.loading|=4,yf(N,i,m)}N={type:"stylesheet",instance:N,count:1,state:Q},k.set(O,N)}}}function UL(r,i){vi.X(r,i);var c=yl;if(c&&r){var m=ds(c).hoistableScripts,k=xl(r),O=m.get(k);O||(O=c.querySelector(lu(k)),O||(r=f({src:r,async:!0},i),(i=Qr.get(k))&&Ig(r,i),O=c.createElement("script"),gn(O),Un(O,"link",r),c.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},m.set(k,O))}}function WL(r,i){vi.M(r,i);var c=yl;if(c&&r){var m=ds(c).hoistableScripts,k=xl(r),O=m.get(k);O||(O=c.querySelector(lu(k)),O||(r=f({src:r,async:!0,type:"module"},i),(i=Qr.get(k))&&Ig(r,i),O=c.createElement("script"),gn(O),Un(O,"link",r),c.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},m.set(k,O))}}function Rx(r,i,c,m){var k=(k=ee.current)?_f(k):null;if(!k)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(i=bl(c.href),c=ds(k).hoistableStyles,m=c.get(i),m||(m={type:"style",instance:null,count:0,state:null},c.set(i,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=bl(c.href);var O=ds(k).hoistableStyles,N=O.get(r);if(N||(k=k.ownerDocument||k,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(r,N),(O=k.querySelector(au(r)))&&!O._p&&(N.instance=O,N.state.loading=5),Qr.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Qr.set(r,c),O||qL(k,r,c,N.state))),i&&m===null)throw Error(s(528,""));return N}if(i&&m!==null)throw Error(s(529,""));return null;case"script":return i=c.async,c=c.src,typeof c=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=xl(c),c=ds(k).hoistableScripts,m=c.get(i),m||(m={type:"script",instance:null,count:0,state:null},c.set(i,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function bl(r){return'href="'+cr(r)+'"'}function au(r){return'link[rel="stylesheet"]['+r+"]"}function Tx(r){return f({},r,{"data-precedence":r.precedence,precedence:null})}function qL(r,i,c,m){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?m.loading=1:(i=r.createElement("link"),m.preload=i,i.addEventListener("load",function(){return m.loading|=1}),i.addEventListener("error",function(){return m.loading|=2}),Un(i,"link",c),gn(i),r.head.appendChild(i))}function xl(r){return'[src="'+cr(r)+'"]'}function lu(r){return"script[async]"+r}function Lx(r,i,c){if(i.count++,i.instance===null)switch(i.type){case"style":var m=r.querySelector('style[data-href~="'+cr(c.href)+'"]');if(m)return i.instance=m,gn(m),m;var k=f({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(r.ownerDocument||r).createElement("style"),gn(m),Un(m,"style",k),yf(m,c.precedence,r),i.instance=m;case"stylesheet":k=bl(c.href);var O=r.querySelector(au(k));if(O)return i.state.loading|=4,i.instance=O,gn(O),O;m=Tx(c),(k=Qr.get(k))&&Pg(m,k),O=(r.ownerDocument||r).createElement("link"),gn(O);var N=O;return N._p=new Promise(function(Q,ie){N.onload=Q,N.onerror=ie}),Un(O,"link",m),i.state.loading|=4,yf(O,c.precedence,r),i.instance=O;case"script":return O=xl(c.src),(k=r.querySelector(lu(O)))?(i.instance=k,gn(k),k):(m=c,(k=Qr.get(O))&&(m=f({},c),Ig(m,k)),r=r.ownerDocument||r,k=r.createElement("script"),gn(k),Un(k,"link",m),r.head.appendChild(k),i.instance=k);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(m=i.instance,i.state.loading|=4,yf(m,c.precedence,r));return i.instance}function yf(r,i,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=m.length?m[m.length-1]:null,O=k,N=0;N<m.length;N++){var Q=m[N];if(Q.dataset.precedence===i)O=Q;else if(O!==k)break}O?O.parentNode.insertBefore(r,O.nextSibling):(i=c.nodeType===9?c.head:c,i.insertBefore(r,i.firstChild))}function Pg(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Ig(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var bf=null;function Ax(r,i,c){if(bf===null){var m=new Map,k=bf=new Map;k.set(c,m)}else k=bf,m=k.get(c),m||(m=new Map,k.set(c,m));if(m.has(r))return m;for(m.set(r,null),c=c.getElementsByTagName(r),k=0;k<c.length;k++){var O=c[k];if(!(O[Ro]||O[pn]||r==="link"&&O.getAttribute("rel")==="stylesheet")&&O.namespaceURI!=="http://www.w3.org/2000/svg"){var N=O.getAttribute(i)||"";N=r+N;var Q=m.get(N);Q?Q.push(O):m.set(N,[O])}}return m}function Ox(r,i,c){r=r.ownerDocument||r,r.head.insertBefore(c,i==="title"?r.querySelector("head > title"):null)}function GL(r,i,c){if(c===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Mx(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function $L(r,i,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var k=bl(m.href),O=i.querySelector(au(k));if(O){i=O._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=xf.bind(r),i.then(r,r)),c.state.loading|=4,c.instance=O,gn(O);return}O=i.ownerDocument||i,m=Tx(m),(k=Qr.get(k))&&Pg(m,k),O=O.createElement("link"),gn(O);var N=O;N._p=new Promise(function(Q,ie){N.onload=Q,N.onerror=ie}),Un(O,"link",m),c.instance=O}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,i),(i=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=xf.bind(r),i.addEventListener("load",c),i.addEventListener("error",c))}}var jg=0;function KL(r,i){return r.stylesheets&&r.count===0&&Cf(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var m=setTimeout(function(){if(r.stylesheets&&Cf(r,r.stylesheets),r.unsuspend){var O=r.unsuspend;r.unsuspend=null,O()}},6e4+i);0<r.imgBytes&&jg===0&&(jg=62500*TL());var k=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Cf(r,r.stylesheets),r.unsuspend)){var O=r.unsuspend;r.unsuspend=null,O()}},(r.imgBytes>jg?50:800)+i);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(m),clearTimeout(k)}}:null}function xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Sf=null;function Cf(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Sf=new Map,i.forEach(YL,r),Sf=null,xf.call(r))}function YL(r,i){if(!(i.state.loading&4)){var c=Sf.get(r);if(c)var m=c.get(null);else{c=new Map,Sf.set(r,c);for(var k=r.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O<k.length;O++){var N=k[O];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(c.set(N.dataset.precedence,N),m=N)}m&&c.set(null,m)}k=i.instance,N=k.getAttribute("data-precedence"),O=c.get(N)||m,O===m&&c.set(null,k),c.set(N,k),this.count++,m=xf.bind(this),k.addEventListener("load",m),k.addEventListener("error",m),O?O.parentNode.insertBefore(k,O.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(k,r.firstChild)),i.state.loading|=4}}var cu={$$typeof:b,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function XL(r,i,c,m,k,O,N,Q,ie){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=m,this.onUncaughtError=k,this.onCaughtError=O,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function Dx(r,i,c,m,k,O,N,Q,ie,pe,Se,Te){return r=new XL(r,i,c,N,ie,pe,Se,Te,Q),i=1,O===!0&&(i|=24),O=Tr(3,null,null,i),r.current=O,O.stateNode=r,i=mm(),i.refCount++,r.pooledCache=i,i.refCount++,O.memoizedState={element:m,isDehydrated:c,cache:i},ym(O),r}function Px(r){return r?(r=Za,r):Za}function Ix(r,i,c,m,k,O){k=Px(k),m.context===null?m.context=k:m.pendingContext=k,m=Ni(i),m.payload={element:c},O=O===void 0?null:O,O!==null&&(m.callback=O),c=Bi(r,m,i),c!==null&&(mr(c,r,i),Vc(c,r,i))}function jx(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<i?c:i}}function Ng(r,i){jx(r,i),(r=r.alternate)&&jx(r,i)}function Nx(r){if(r.tag===13||r.tag===31){var i=Do(r,67108864);i!==null&&mr(i,r,67108864),Ng(r,67108864)}}function Bx(r){if(r.tag===13||r.tag===31){var i=Dr();i=Yn(i);var c=Do(r,i);c!==null&&mr(c,r,i),Ng(r,i)}}var wf=!0;function QL(r,i,c,m){var k=F.T;F.T=null;var O=G.p;try{G.p=2,Bg(r,i,c,m)}finally{G.p=O,F.T=k}}function ZL(r,i,c,m){var k=F.T;F.T=null;var O=G.p;try{G.p=8,Bg(r,i,c,m)}finally{G.p=O,F.T=k}}function Bg(r,i,c,m){if(wf){var k=zg(m);if(k===null)wg(r,i,m,Ef,c),Hx(r,m);else if(eA(k,r,i,c,m))m.stopPropagation();else if(Hx(r,m),i&4&&-1<JL.indexOf(r)){for(;k!==null;){var O=Rs(k);if(O!==null)switch(O.tag){case 3:if(O=O.stateNode,O.current.memoizedState.isDehydrated){var N=vt(O.pendingLanes);if(N!==0){var Q=O;for(Q.pendingLanes|=2,Q.entangledLanes|=2;N;){var ie=1<<31-lt(N);Q.entanglements[1]|=ie,N&=~ie}Os(O),(It&6)===0&&(af=ke()+500,ru(0))}}break;case 31:case 13:Q=Do(O,2),Q!==null&&mr(Q,O,2),cf(),Ng(O,2)}if(O=zg(m),O===null&&wg(r,i,m,Ef,c),O===k)break;k=O}k!==null&&m.stopPropagation()}else wg(r,i,m,null,c)}}function zg(r){return r=Vp(r),Hg(r)}var Ef=null;function Hg(r){if(Ef=null,r=Qs(r),r!==null){var i=u(r);if(i===null)r=null;else{var c=i.tag;if(c===13){if(r=h(i),r!==null)return r;r=null}else if(c===31){if(r=a(i),r!==null)return r;r=null}else if(c===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Ef=r,null}function zx(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ce()){case qe:return 2;case De:return 8;case Ie:case rt:return 32;case et:return 268435456;default:return 32}default:return 32}}var Vg=!1,Yi=null,Xi=null,Qi=null,uu=new Map,du=new Map,Zi=[],JL="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Hx(r,i){switch(r){case"focusin":case"focusout":Yi=null;break;case"dragenter":case"dragleave":Xi=null;break;case"mouseover":case"mouseout":Qi=null;break;case"pointerover":case"pointerout":uu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":du.delete(i.pointerId)}}function fu(r,i,c,m,k,O){return r===null||r.nativeEvent!==O?(r={blockedOn:i,domEventName:c,eventSystemFlags:m,nativeEvent:O,targetContainers:[k]},i!==null&&(i=Rs(i),i!==null&&Nx(i)),r):(r.eventSystemFlags|=m,i=r.targetContainers,k!==null&&i.indexOf(k)===-1&&i.push(k),r)}function eA(r,i,c,m,k){switch(i){case"focusin":return Yi=fu(Yi,r,i,c,m,k),!0;case"dragenter":return Xi=fu(Xi,r,i,c,m,k),!0;case"mouseover":return Qi=fu(Qi,r,i,c,m,k),!0;case"pointerover":var O=k.pointerId;return uu.set(O,fu(uu.get(O)||null,r,i,c,m,k)),!0;case"gotpointercapture":return O=k.pointerId,du.set(O,fu(du.get(O)||null,r,i,c,m,k)),!0}return!1}function Vx(r){var i=Qs(r.target);if(i!==null){var c=u(i);if(c!==null){if(i=c.tag,i===13){if(i=h(c),i!==null){r.blockedOn=i,Fa(r.priority,function(){Bx(c)});return}}else if(i===31){if(i=a(c),i!==null){r.blockedOn=i,Fa(r.priority,function(){Bx(c)});return}}else if(i===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function kf(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var c=zg(r.nativeEvent);if(c===null){c=r.nativeEvent;var m=new c.constructor(c.type,c);xd=m,c.target.dispatchEvent(m),xd=null}else return i=Rs(c),i!==null&&Nx(i),r.blockedOn=c,!1;i.shift()}return!0}function Fx(r,i,c){kf(r)&&c.delete(i)}function tA(){Vg=!1,Yi!==null&&kf(Yi)&&(Yi=null),Xi!==null&&kf(Xi)&&(Xi=null),Qi!==null&&kf(Qi)&&(Qi=null),uu.forEach(Fx),du.forEach(Fx)}function Rf(r,i){r.blockedOn===i&&(r.blockedOn=null,Vg||(Vg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,tA)))}var Tf=null;function Ux(r){Tf!==r&&(Tf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tf===r&&(Tf=null);for(var i=0;i<r.length;i+=3){var c=r[i],m=r[i+1],k=r[i+2];if(typeof m!="function"){if(Hg(m||c)===null)continue;break}var O=Rs(c);O!==null&&(r.splice(i,3),i-=3,zm(O,{pending:!0,data:k,method:c.method,action:m},m,k))}}))}function Sl(r){function i(ie){return Rf(ie,r)}Yi!==null&&Rf(Yi,r),Xi!==null&&Rf(Xi,r),Qi!==null&&Rf(Qi,r),uu.forEach(i),du.forEach(i);for(var c=0;c<Zi.length;c++){var m=Zi[c];m.blockedOn===r&&(m.blockedOn=null)}for(;0<Zi.length&&(c=Zi[0],c.blockedOn===null);)Vx(c),c.blockedOn===null&&Zi.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var k=c[m],O=c[m+1],N=k[mn]||null;if(typeof O=="function")N||Ux(c);else if(N){var Q=null;if(O&&O.hasAttribute("formAction")){if(k=O,N=O[mn]||null)Q=N.formAction;else if(Hg(k)!==null)continue}else Q=N.action;typeof Q=="function"?c[m+1]=Q:(c.splice(m,3),m-=3),Ux(c)}}}function Wx(){function r(O){O.canIntercept&&O.info==="react-transition"&&O.intercept({handler:function(){return new Promise(function(N){return k=N})},focusReset:"manual",scroll:"manual"})}function i(){k!==null&&(k(),k=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var O=navigation.currentEntry;O&&O.url!=null&&navigation.navigate(O.url,{state:O.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,k=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),k!==null&&(k(),k=null)}}}function Fg(r){this._internalRoot=r}Lf.prototype.render=Fg.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(s(409));var c=i.current,m=Dr();Ix(c,m,r,i,null,null)},Lf.prototype.unmount=Fg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Ix(r.current,2,null,r,null,null),cf(),i[ks]=null}};function Lf(r){this._internalRoot=r}Lf.prototype.unstable_scheduleHydration=function(r){if(r){var i=Es();r={blockedOn:null,target:r,priority:i};for(var c=0;c<Zi.length&&i!==0&&i<Zi[c].priority;c++);Zi.splice(c,0,r),c===0&&Vx(r)}};var qx=t.version;if(qx!=="19.2.3")throw Error(s(527,qx,"19.2.3"));G.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=d(i),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var nA={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Af=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Af.isDisabled&&Af.supportsFiber)try{Ve=Af.inject(nA),Ee=Af}catch{}}return pu.createRoot=function(r,i){if(!o(r))throw Error(s(299));var c=!1,m="",k=Z1,O=J1,N=eb;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(k=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=Dx(r,1,!1,null,null,c,m,null,k,O,N,Wx),r[ks]=i.current,Cg(r),new Fg(i)},pu.hydrateRoot=function(r,i,c){if(!o(r))throw Error(s(299));var m=!1,k="",O=Z1,N=J1,Q=eb,ie=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(k=c.identifierPrefix),c.onUncaughtError!==void 0&&(O=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(Q=c.onRecoverableError),c.formState!==void 0&&(ie=c.formState)),i=Dx(r,1,!0,i,c??null,m,k,ie,O,N,Q,Wx),i.context=Px(null),c=i.current,m=Dr(),m=Yn(m),k=Ni(m),k.callback=null,Bi(c,k,m),c=m,i.current.lanes=c,bt(i,c),Os(i),r[ks]=i.current,Cg(r),new Lf(i)},pu.version="19.2.3",pu}var tS;function fA(){if(tS)return qg.exports;tS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qg.exports=dA(),qg.exports}var hA=fA();const Vv=new WeakMap,pA=new WeakMap,_h={current:[]};let Yg=!1,Lu=0;const Eu=new Set,Of=new Map;function Kw(e){for(const t of e){if(_h.current.includes(t))continue;_h.current.push(t),t.recompute();const n=pA.get(t);if(n)for(const s of n){const o=Vv.get(s);o?.length&&Kw(o)}}}function mA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function gA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Yw(e){if(Lu>0&&!Of.has(e)&&Of.set(e,e.prevState),Eu.add(e),!(Lu>0)&&!Yg)try{for(Yg=!0;Eu.size>0;){const t=Array.from(Eu);Eu.clear();for(const n of t){const s=Of.get(n)??n.prevState;n.prevState=s,mA(n)}for(const n of t){const s=Vv.get(n);s&&(_h.current.push(n),Kw(s))}for(const n of t){const s=Vv.get(n);if(s)for(const o of s)gA(o)}}}finally{Yg=!1,_h.current=[],Of.clear()}}function Au(e){Lu++;try{e()}finally{if(Lu--,Lu===0){const t=Eu.values().next().value;t&&Yw(t)}}}function vA(e){return typeof e=="function"}let _A=class{constructor(t,n){this.listeners=new Set,this.subscribe=s=>{var o,u;this.listeners.add(s);const h=(u=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:u.call(o,s,this);return()=>{this.listeners.delete(s),h?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,s,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):vA(t)?this.state=t(this.prevState):this.state=t,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),Yw(this)}};const lo="__TSR_index",nS="popstate",rS="beforeunload";function yA(e){let t=e.getLocation();const n=new Set,s=h=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:h}))},o=h=>{e.notifyOnIndexChange??!0?s(h):t=e.getLocation()},u=async({task:h,navigateOpts:a,...l})=>{if(a?.ignoreBlocker??!1){h();return}const p=e.getBlockers?.()??[],f=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&p.length&&f)for(const g of p){const S=yh(l.path,l.state);if(await g.blockerFn({currentLocation:t,nextLocation:S,action:l.type})){e.onBlocked?.();return}}h()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:h=>(n.add(h),()=>{n.delete(h)}),push:(h,a,l)=>{const d=t.state[lo];a=sS(d+1,a),u({task:()=>{e.pushState(h,a),s({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:h,state:a})},replace:(h,a,l)=>{const d=t.state[lo];a=sS(d,a),u({task:()=>{e.replaceState(h,a),s({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:h,state:a})},go:(h,a)=>{u({task:()=>{e.go(h),o({type:"GO",index:h})},navigateOpts:a,type:"GO"})},back:h=>{u({task:()=>{e.back(h?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:h,type:"BACK"})},forward:h=>{u({task:()=>{e.forward(h?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:h,type:"FORWARD"})},canGoBack:()=>t.state[lo]!==0,createHref:h=>e.createHref(h),block:h=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,h]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(d=>d!==h))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function sS(e,t){t||(t={});const n=B_();return{...t,key:n,__TSR_key:n,[lo]:e}}function bA(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let o=[];const u=()=>o,h=L=>o=L,a=(L=>L),l=(()=>yh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const L=B_();t.history.replaceState({[lo]:0,key:L,__TSR_key:L},"")}let d=l(),p,f=!1,g=!1,S=!1,C=!1;const w=()=>d;let y,x;const v=()=>{y&&(M._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),M._ignoreSubscribers=!1,y=void 0,x=void 0,p=void 0)},b=(L,D,H)=>{const z=a(D);x||(p=d),d=yh(D,H),y={href:z,state:H,isPush:y?.isPush||L==="push"},x||(x=Promise.resolve().then(()=>v()))},E=L=>{d=l(),M.notify({type:L})},T=async()=>{if(g){g=!1;return}const L=l(),D=L.state[lo]-d.state[lo],H=D===1,z=D===-1,q=!H&&!z||f;f=!1;const j=q?"GO":z?"BACK":"FORWARD",K=q?{type:"GO",index:D}:{type:z?"BACK":"FORWARD"};if(S)S=!1;else{const $=u();if(typeof document<"u"&&$.length){for(const F of $)if(await F.blockerFn({currentLocation:d,nextLocation:L,action:j})){g=!0,t.history.go(1),M.notify(K);return}}}d=l(),M.notify(K)},A=L=>{if(C){C=!1;return}let D=!1;const H=u();if(typeof document<"u"&&H.length)for(const z of H){const q=z.enableBeforeUnload??!0;if(q===!0){D=!0;break}if(typeof q=="function"&&q()===!0){D=!0;break}}if(D)return L.preventDefault(),L.returnValue=""},M=yA({getLocation:w,getLength:()=>t.history.length,pushState:(L,D)=>b("push",L,D),replaceState:(L,D)=>b("replace",L,D),back:L=>(L&&(S=!0),C=!0,t.history.back()),forward:L=>{L&&(S=!0),C=!0,t.history.forward()},go:L=>{f=!0,t.history.go(L)},createHref:L=>a(L),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(rS,A,{capture:!0}),t.removeEventListener(nS,T)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:u,setBlockers:h,notifyOnIndexChange:!1});return t.addEventListener(rS,A,{capture:!0}),t.addEventListener(nS,T),t.history.pushState=function(...L){const D=n.apply(t.history,L);return M._ignoreSubscribers||E("PUSH"),D},t.history.replaceState=function(...L){const D=s.apply(t.history,L);return M._ignoreSubscribers||E("REPLACE"),D},M}function yh(e,t){const n=e.indexOf("#"),s=e.indexOf("?"),o=B_();return{href:e,pathname:e.substring(0,n>0?s>0?Math.min(n,s):n:s>0?s:e.length),hash:n>-1?e.substring(n):"",search:s>-1?e.slice(s,n===-1?void 0:n):"",state:t||{[lo]:0,key:o,__TSR_key:o}}}function B_(){return(Math.random()+1).toString(36).substring(7)}function bh(e){return e[e.length-1]}function xA(e){return typeof e=="function"}function ro(e,t){return xA(e)?e(t):e}const SA=Object.prototype.hasOwnProperty;function es(e,t){if(e===t)return e;const n=t,s=aS(e)&&aS(n);if(!s&&!(xh(e)&&xh(n)))return n;const o=s?e:iS(e);if(!o)return n;const u=s?n:iS(n);if(!u)return n;const h=o.length,a=u.length,l=s?new Array(a):{};let d=0;for(let p=0;p<a;p++){const f=s?p:u[p],g=e[f],S=n[f];if(g===S){l[f]=g,(s?p<h:SA.call(e,f))&&d++;continue}if(g===null||S===null||typeof g!="object"||typeof S!="object"){l[f]=S;continue}const C=es(g,S);l[f]=C,C===g&&d++}return h===a&&d===h?e:l}function iS(e){const t=[],n=Object.getOwnPropertyNames(e);for(const o of n){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;t.push(o)}const s=Object.getOwnPropertySymbols(e);for(const o of s){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;t.push(o)}return t}function xh(e){if(!oS(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!oS(n)||!n.hasOwnProperty("isPrototypeOf"))}function oS(e){return Object.prototype.toString.call(e)==="[object Object]"}function aS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function da(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,o=e.length;s<o;s++)if(!da(e[s],t[s],n))return!1;return!0}if(xh(e)&&xh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const h in t)if((!s||t[h]!==void 0)&&!da(e[h],t[h],n))return!1;return!0}let o=0;if(!s)o=Object.keys(e).length;else for(const h in e)e[h]!==void 0&&o++;let u=0;for(const h in t)if((!s||t[h]!==void 0)&&(u++,u>o||!da(e[h],t[h],n)))return!1;return o===u}return!1}function Vl(e){let t,n;const s=new Promise((o,u)=>{t=o,n=u});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,t(o),e?.(o)},s.reject=o=>{s.status="rejected",n(o)},s}function co(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function lS(e){try{return decodeURI(e)}catch{return e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}}function cS(e,t){if(!e)return e;const n=/%25|%5C/gi;let s=0,o="",u;for(;(u=n.exec(e))!==null;)o+=lS(e.slice(s,u.index))+u[0],s=n.lastIndex;return o+lS(s?e.slice(s):e)}var CA="Invariant failed";function xi(e,t){if(!e)throw new Error(CA)}function Sh(e){const t=new Map;let n,s;const o=u=>{u.next&&(u.prev?(u.prev.next=u.next,u.next.prev=u.prev,u.next=void 0,s&&(s.next=u,u.prev=s)):(u.next.prev=void 0,n=u.next,u.next=void 0,s&&(u.prev=s,s.next=u)),s=u)};return{get(u){const h=t.get(u);if(h)return o(h),h.value},set(u,h){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===s&&(s=void 0)}const a=t.get(u);if(a)a.value=h,o(a);else{const l={key:u,value:h,prev:s};s&&(s.next=l),s=l,n||(n=l),t.set(u,l)}},clear(){t.clear(),n=void 0,s=void 0}}}const Fl=0,Sa=1,Ca=2,ju=3,wA=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,EA=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,kA=/^([^{]*)\{\$\}([^}]*)$/;function z_(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),o=s===-1?e.length:s,u=e.substring(t,o);if(!u||!u.includes("$"))return n[0]=Fl,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(u==="$"){const d=e.length;return n[0]=Ca,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(u.charCodeAt(0)===36)return n[0]=Sa,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const h=u.match(kA);if(h){const p=h[1].length;return n[0]=Ca,n[1]=t+p,n[2]=t+p+1,n[3]=t+p+2,n[4]=t+p+3,n[5]=e.length,n}const a=u.match(EA);if(a){const d=a[1],p=a[2],f=a[3],g=d.length;return n[0]=ju,n[1]=t+g,n[2]=t+g+3,n[3]=t+g+3+p.length,n[4]=o-f.length,n[5]=o,n}const l=u.match(wA);if(l){const d=l[1],p=l[2],f=l[3],g=d.length;return n[0]=Sa,n[1]=t+g,n[2]=t+g+2,n[3]=t+g+2+p.length,n[4]=o-f.length,n[5]=o,n}return n[0]=Fl,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function rp(e,t,n,s,o,u,h){h?.(n);let a=s;{const l=n.fullPath??n.from,d=l.length,p=n.options?.caseSensitive??e;for(;a<d;){const f=z_(l,a,t);let g;const S=a,C=f[5];switch(a=C+1,u++,f[0]){case Fl:{const y=l.substring(f[2],f[3]);if(p){const x=o.static?.get(y);if(x)g=x;else{o.static??=new Map;const v=Nu(n.fullPath??n.from);v.parent=o,v.depth=u,g=v,o.static.set(y,v)}}else{const x=y.toLowerCase(),v=o.staticInsensitive?.get(x);if(v)g=v;else{o.staticInsensitive??=new Map;const b=Nu(n.fullPath??n.from);b.parent=o,b.depth=u,g=b,o.staticInsensitive.set(x,b)}}break}case Sa:{const y=l.substring(S,f[1]),x=l.substring(f[4],C),v=p&&!!(y||x),b=y?v?y:y.toLowerCase():void 0,E=x?v?x:x.toLowerCase():void 0,T=o.dynamic?.find(A=>A.caseSensitive===v&&A.prefix===b&&A.suffix===E);if(T)g=T;else{const A=Qg(Sa,n.fullPath??n.from,v,b,E);g=A,A.depth=u,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case ju:{const y=l.substring(S,f[1]),x=l.substring(f[4],C),v=p&&!!(y||x),b=y?v?y:y.toLowerCase():void 0,E=x?v?x:x.toLowerCase():void 0,T=o.optional?.find(A=>A.caseSensitive===v&&A.prefix===b&&A.suffix===E);if(T)g=T;else{const A=Qg(ju,n.fullPath??n.from,v,b,E);g=A,A.parent=o,A.depth=u,o.optional??=[],o.optional.push(A)}break}case Ca:{const y=l.substring(S,f[1]),x=l.substring(f[4],C),v=p&&!!(y||x),b=y?v?y:y.toLowerCase():void 0,E=x?v?x:x.toLowerCase():void 0,T=Qg(Ca,n.fullPath??n.from,v,b,E);g=T,T.parent=o,T.depth=u,o.wildcard??=[],o.wildcard.push(T)}}o=g}if((n.path||!n.children)&&!n.isRoot){const f=l.endsWith("/");f||(o.notFound=n),(!o.route||!o.isIndex&&f)&&(o.route=n,o.fullPath=n.fullPath??n.from),o.isIndex||=f}}if(n.children)for(const l of n.children)rp(e,t,l,a,o,u,h)}function Xg(e,t){if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Jo(e){if(e.static)for(const t of e.static.values())Jo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Jo(t);if(e.dynamic?.length){e.dynamic.sort(Xg);for(const t of e.dynamic)Jo(t)}if(e.optional?.length){e.optional.sort(Xg);for(const t of e.optional)Jo(t)}if(e.wildcard?.length){e.wildcard.sort(Xg);for(const t of e.wildcard)Jo(t)}}function Nu(e){return{kind:Fl,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,isIndex:!1,notFound:null}}function Qg(e,t,n,s,o){return{kind:e,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,isIndex:!1,notFound:null,caseSensitive:n,prefix:s,suffix:o}}function RA(e,t){const n=Nu("/"),s=new Uint16Array(6);for(const o of e)rp(!1,s,o,1,n,0);Jo(n),t.masksTree=n,t.flatCache=Sh(1e3)}function TA(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=H_(e,t.masksTree);return t.flatCache.set(e,s),s}function LA(e,t,n,s,o){e||="/",s||="/";const u=t?`case\0${e}`:e;let h=o.singleCache.get(u);if(!h){h=Nu("/");const a=new Uint16Array(6);rp(t,a,{from:e},1,h,0),o.singleCache.set(u,h)}return H_(s,h,n)}function AA(e,t,n=!1){const s=n?e:`nofuzz\0${e}`,o=t.matchCache.get(s);if(o!==void 0)return o;e||="/";const u=H_(e,t.segmentTree,n);return u&&(u.branch=PA(u.route)),t.matchCache.set(s,u),u}function OA(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function MA(e,t=!1,n){const s=Nu(e.fullPath),o=new Uint16Array(6),u={},h={};let a=0;return rp(t,o,e,1,s,0,d=>{if(n?.(d,a),xi(!(d.id in u),`Duplicate routes found with id: ${String(d.id)}`),u[d.id]=d,a!==0&&d.path){const p=OA(d.fullPath);(!h[p]||d.fullPath.endsWith("/"))&&(h[p]=d)}a++}),Jo(s),{processedTree:{segmentTree:s,singleCache:Sh(1e3),matchCache:Sh(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:h}}function H_(e,t,n=!1){const s=e.split("/"),o=jA(e,s,t,n);if(!o)return null;const u=DA(e,s,o),h="**"in o;return h&&(u["**"]=o["**"]),{route:h?o.node.notFound??o.node.route:o.node.route,params:u}}function DA(e,t,n){const s=IA(n.node);let o=null;const u={};for(let h=0,a=0,l=0;a<s.length;h++,a++,l++){const d=s[a],p=t[h],f=l;if(p&&(l+=p.length),d.kind===Sa){o??=n.node.fullPath.split("/");const g=o[a],S=d.prefix?.length??0;if(g.charCodeAt(S)===123){const w=d.suffix?.length??0,y=g.substring(S+2,g.length-w-1),x=p.substring(S,p.length-w);u[y]=decodeURIComponent(x)}else{const w=g.substring(1);u[w]=decodeURIComponent(p)}}else if(d.kind===ju){if(n.skipped&1<<a){h--;continue}o??=n.node.fullPath.split("/");const g=o[a],S=d.prefix?.length??0,C=d.suffix?.length??0,w=g.substring(S+3,g.length-C-1),y=d.suffix||d.prefix?p.substring(S,p.length-C):p;y&&(u[w]=decodeURIComponent(y))}else if(d.kind===Ca){const g=d,S=e.substring(f+(g.prefix?.length??0),e.length-(g.suffix?.length??0)),C=decodeURIComponent(S);u["*"]=C,u._splat=C;break}}return u}function PA(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function IA(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function jA(e,t,n,s){const o=!bh(t),u=o&&e!=="/",h=t.length-(o?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let l=null,d=null,p=null;for(;a.length;){const f=a.pop();let{node:g,index:S,skipped:C,depth:w,statics:y,dynamics:x,optionals:v}=f;s&&g.notFound&&Mf(d,f)&&(d=f);const b=S===h;if(b){if(g.route&&(!u||g.isIndex)&&(Mf(p,f)&&(p=f),y===h&&g.isIndex))return p;if(!g.optional&&!g.wildcard)continue}const E=b?void 0:t[S];let T;if(g.wildcard&&Mf(l,f))for(const A of g.wildcard){const{prefix:M,suffix:L}=A;if(!(M&&(b||!(A.caseSensitive?E:T??=E.toLowerCase()).startsWith(M)))){if(L){if(b)continue;const D=t.slice(S).join("/").slice(-L.length);if((A.caseSensitive?D:D.toLowerCase())!==L)continue}l={node:A,index:S,skipped:C,depth:w,statics:y,dynamics:x,optionals:v};break}}if(g.optional){const A=C|1<<w,M=w+1;for(let L=g.optional.length-1;L>=0;L--){const D=g.optional[L];a.push({node:D,index:S,skipped:A,depth:M,statics:y,dynamics:x,optionals:v})}if(!b)for(let L=g.optional.length-1;L>=0;L--){const D=g.optional[L],{prefix:H,suffix:z}=D;if(H||z){const q=D.caseSensitive?E:T??=E.toLowerCase();if(H&&!q.startsWith(H)||z&&!q.endsWith(z))continue}a.push({node:D,index:S+1,skipped:C,depth:M,statics:y,dynamics:x,optionals:v+1})}}if(!b&&g.dynamic&&E)for(let A=g.dynamic.length-1;A>=0;A--){const M=g.dynamic[A],{prefix:L,suffix:D}=M;if(L||D){const H=M.caseSensitive?E:T??=E.toLowerCase();if(L&&!H.startsWith(L)||D&&!H.endsWith(D))continue}a.push({node:M,index:S+1,skipped:C,depth:w+1,statics:y,dynamics:x+1,optionals:v})}if(!b&&g.staticInsensitive){const A=g.staticInsensitive.get(T??=E.toLowerCase());A&&a.push({node:A,index:S+1,skipped:C,depth:w+1,statics:y+1,dynamics:x,optionals:v})}if(!b&&g.static){const A=g.static.get(E);A&&a.push({node:A,index:S+1,skipped:C,depth:w+1,statics:y+1,dynamics:x,optionals:v})}}if(p&&l)return Mf(l,p)?p:l;if(p)return p;if(l)return l;if(s&&d){let f=d.index;for(let S=0;S<d.index;S++)f+=t[S].length;const g=f===e.length?"/":e.slice(f);return{node:d.node,skipped:d.skipped,"**":decodeURIComponent(g)}}return null}function Mf(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&(t.node.isIndex>e.node.isIndex||t.node.isIndex===e.node.isIndex&&t.depth>e.depth))):!0}function uh(e){return V_(e.filter(t=>t!==void 0).join("/"))}function V_(e){return e.replace(/\/{2,}/g,"/")}function Xw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function fa(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Qw(e){return fa(Xw(e))}function Ch(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function NA(e,t,n){return Ch(e,n)===Ch(t,n)}function BA({base:e,to:t,trailingSlash:n="never",cache:s}){const o=t.startsWith("/"),u=!o&&t===".";let h;if(s){h=o?t:u?e:e+"\0"+t;const f=s.get(h);if(f)return f}let a;if(u)a=e.split("/");else if(o)a=t.split("/");else{for(a=e.split("/");a.length>1&&bh(a)==="";)a.pop();const f=t.split("/");for(let g=0,S=f.length;g<S;g++){const C=f[g];C===""?g?g===S-1&&a.push(C):a=[C]:C===".."?a.pop():C==="."||a.push(C)}}a.length>1&&(bh(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,d="";for(let f=0;f<a.length;f++){f>0&&(d+="/");const g=a[f];if(!g)continue;l=z_(g,0,l);const S=l[0];if(S===Fl){d+=g;continue}const C=l[5],w=g.substring(0,l[1]),y=g.substring(l[4],C),x=g.substring(l[2],l[3]);S===Sa?d+=w||y?`${w}{$${x}}${y}`:`$${x}`:S===Ca?d+=w||y?`${w}{$}${y}`:"$":d+=`${w}{-$${x}}${y}`}d=V_(d);const p=d||"/";return h&&s&&s.set(h,p),p}function Zg(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?encodeURI(s):zA(s,n)}function Jg({path:e,params:t,decodeCharMap:n}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const u=e.length;let h=0,a,l="";for(;h<u;){const p=h;a=z_(e,p,a);const f=a[5];if(h=f+1,p===f)continue;const g=a[0];if(g===Fl){l+="/"+e.substring(p,f);continue}if(g===Ca){const S=t._splat;o._splat=S,o["*"]=S;const C=e.substring(p,a[1]),w=e.substring(a[4],f);if(!S){s=!0,(C||w)&&(l+="/"+C+w);continue}const y=Zg("_splat",t,n);l+="/"+C+y+w;continue}if(g===Sa){const S=e.substring(a[2],a[3]);!s&&!(S in t)&&(s=!0),o[S]=t[S];const C=e.substring(p,a[1]),w=e.substring(a[4],f),y=Zg(S,t,n)??"undefined";l+="/"+C+y+w;continue}if(g===ju){const S=e.substring(a[2],a[3]),C=t[S];if(C==null)continue;o[S]=C;const w=e.substring(p,a[1]),y=e.substring(a[4],f),x=Zg(S,t,n)??"";l+="/"+w+x+y;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:o,interpolatedPath:l||"/",isMissingParams:s}}function zA(e,t){let n=encodeURIComponent(e);if(t)for(const[s,o]of t)n=n.replaceAll(s,o);return n}function is(e){return!!e?.isNotFound}function HA(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const wh="tsr-scroll-restoration-v1_3",VA=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function FA(){const e=HA();if(!e)return null;const t=e.getItem(wh);let n=t?JSON.parse(t):{};return{state:n,set:s=>(n=ro(s,n)||n,e.setItem(wh,JSON.stringify(n)))}}const Df=FA(),Fv=e=>e.state.__TSR_key||e.href;function UA(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Eh=!1;function Zw({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:o,location:u}){let h;try{h=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(d){console.error(d);return}const a=t||window.history.state?.__TSR_key,l=h[a];Eh=!0;e:{if(s&&l&&Object.keys(l).length>0){for(const f in l){const g=l[f];if(f==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(f){const S=document.querySelector(f);S&&(S.scrollLeft=g.scrollX,S.scrollTop=g.scrollY)}}break e}const d=(u??window.location).hash.split("#",2)[1];if(d){const f=window.history.state?.__hashScrollIntoViewOptions??!0;if(f){const g=document.getElementById(d);g&&g.scrollIntoView(f)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),o)for(const f of o){if(f==="window")continue;const g=typeof f=="function"?f():document.querySelector(f);g&&g.scrollTo(p)}}Eh=!1}function WA(e,t){if(!Df&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!Df))return;e.isScrollRestorationSetup=!0,Eh=!1;const s=e.options.getScrollRestorationKey||Fv;window.history.scrollRestoration="manual";const o=u=>{if(Eh||!e.isScrollRestoring)return;let h="";if(u.target===document||u.target===window)h="window";else{const l=u.target.getAttribute("data-scroll-restoration-id");l?h=`[data-scroll-restoration-id="${l}"]`:h=UA(u.target)}const a=s(e.state.location);Df.set(l=>{const d=l[a]||={},p=d[h]||={};if(h==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(h){const f=document.querySelector(h);f&&(p.scrollX=f.scrollLeft||0,p.scrollY=f.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",VA(o,100),!0),e.subscribe("onRendered",u=>{const h=s(u.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(Zw({storageKey:wh,key:h,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Df.set(a=>(a[h]||={},a)))})}function qA(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function GA(e,t=String){const n=new URLSearchParams;for(const s in e){const o=e[s];o!==void 0&&n.set(s,t(o))}return n.toString()}function ev(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function $A(e){const t=new URLSearchParams(e),n={};for(const[s,o]of t.entries()){const u=n[s];u==null?n[s]=ev(o):Array.isArray(u)?u.push(ev(o)):n[s]=[u,ev(o)]}return n}const KA=XA(JSON.parse),YA=QA(JSON.stringify,JSON.parse);function XA(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=$A(t);for(const s in n){const o=n[s];if(typeof o=="string")try{n[s]=e(o)}catch{}}return n}}function QA(e,t){const n=typeof t=="function";function s(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const u=GA(o,s);return u?`?${u}`:""}}const Ir="__root__";function Jw(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function bs(e){return e instanceof Response&&!!e.options}const dh=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},sp=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),F_=(e,t,n=!0)=>{const s={...e.router.options.context??{}},o=n?t:t-1;for(let u=0;u<=o;u++){const h=e.matches[u];if(!h)continue;const a=e.router.getMatch(h.id);a&&Object.assign(s,a.__routeContext,a.__beforeLoadContext)}return s},e2=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),xi(n.options.notFoundComponent);const s=e.matches.find(o=>o.routeId===n.id);xi(s,"Could not find match for route: "+n.id),e.updateMatch(s.id,o=>({...o,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,e2(e,t))},so=(e,t,n)=>{if(!(!bs(n)&&!is(n))){if(bs(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const s=bs(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:s,isFetching:!1,error:n})),is(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw bs(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(e2(e,n),n)}},t2=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},mu=(e,t,n,s)=>{const{id:o,routeId:u}=e.matches[t],h=e.router.looseRoutesById[u];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,so(e,e.router.getMatch(o),n);try{h.options.onError?.(n)}catch(a){n=a,so(e,e.router.getMatch(o),n)}e.updateMatch(o,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},ZA=(e,t,n,s)=>{const o=e.router.getMatch(t),u=e.matches[n-1]?.id,h=u?e.router.getMatch(u):void 0;if(e.router.isShell()){o.ssr=s.id===Ir;return}if(h?.ssr===!1){o.ssr=!1;return}const a=S=>S===!0&&h?.ssr==="data-only"?"data-only":S,l=e.router.options.defaultSsr??!0;if(s.options.ssr===void 0){o.ssr=a(l);return}if(typeof s.options.ssr!="function"){o.ssr=a(s.options.ssr);return}const{search:d,params:p}=o,f={search:Pf(d,o.searchError),params:Pf(p,o.paramsError),location:e.location,matches:e.matches.map(S=>({index:S.index,pathname:S.pathname,fullPath:S.fullPath,staticData:S.staticData,id:S.id,routeId:S.routeId,search:Pf(S.search,S.searchError),params:Pf(S.params,S.paramsError),ssr:S.ssr}))},g=s.options.ssr(f);if(co(g))return g.then(S=>{o.ssr=a(S??l)});o.ssr=a(g??l)},n2=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!sp(e,t)&&(n.options.loader||n.options.beforeLoad||i2(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const h=setTimeout(()=>{dh(e)},o);s._nonReactive.pendingTimeout=h}},JA=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;n2(e,t,n,s);const o=()=>{const u=e.router.getMatch(t);u.preload&&(u.status==="redirected"||u.status==="notFound")&&so(e,u,u.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},e3=(e,t,n,s)=>{const o=e.router.getMatch(t),u=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Vl(()=>{u?.resolve()});const{paramsError:h,searchError:a}=o;h&&mu(e,n,h,"PARSE_PARAMS"),a&&mu(e,n,a,"VALIDATE_SEARCH"),n2(e,t,s,o);const l=new AbortController,d=e.matches[n-1]?.id;(d?e.router.getMatch(d):void 0)?.context??e.router.options.context;let f=!1;const g=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:l})))},S=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!s.options.beforeLoad){Au(()=>{g(),S()});return}o._nonReactive.beforeLoadPromise=Vl();const C={...F_(e,n,!1),...o.__routeContext},{search:w,params:y,cause:x}=o,v=sp(e,t),b={search:w,abortController:l,params:y,preload:v,context:C,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":x,matches:e.matches,...e.router.options.additionalContext},E=A=>{if(A===void 0){Au(()=>{g(),S()});return}(bs(A)||is(A))&&(g(),mu(e,n,A,"BEFORE_LOAD")),Au(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:A})),S()})};let T;try{if(T=s.options.beforeLoad(b),co(T))return g(),T.catch(A=>{mu(e,n,A,"BEFORE_LOAD")}).then(E)}catch(A){g(),mu(e,n,A,"BEFORE_LOAD")}E(T)},t3=(e,t)=>{const{id:n,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s],u=()=>{if(e.router.isServer){const l=ZA(e,n,t,o);if(co(l))return l.then(a)}return a()},h=()=>e3(e,n,t,o),a=()=>{if(t2(e,n))return;const l=JA(e,n,o);return co(l)?l.then(h):h()};return u()},Ou=(e,t,n)=>{const s=e.router.getMatch(t);if(!s||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([u,h,a])=>{const l=u?.meta,d=u?.links,p=u?.scripts,f=u?.styles;return{meta:l,links:d,headScripts:p,headers:a,scripts:h,styles:f}})},r2=(e,t,n,s)=>{const o=e.matchPromises[n-1],{params:u,loaderDeps:h,abortController:a,cause:l}=e.router.getMatch(t),d=F_(e,n),p=sp(e,t);return{params:u,deps:h,preload:!!p,parentMatchPromise:o,abortController:a,context:d,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:p?"preload":l,route:s,...e.router.options.additionalContext}},uS=async(e,t,n,s)=>{try{const o=e.router.getMatch(t);try{(!e.router.isServer||o.ssr===!0)&&s2(s);const u=s.options.loader?.(r2(e,t,n,s)),h=s.options.loader&&co(u);if((h||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(t,f=>({...f,isFetching:"loader"})),s.options.loader){const f=h?await u:u;so(e,e.router.getMatch(t),f),f!==void 0&&e.updateMatch(t,g=>({...g,loaderData:f}))}s._lazyPromise&&await s._lazyPromise;const l=Ou(e,t,s),d=l?await l:void 0,p=o._nonReactive.minPendingPromise;p&&await p,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,f=>({...f,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...d}))}catch(u){let h=u;const a=o._nonReactive.minPendingPromise;a&&await a,is(u)&&await s.options.notFoundComponent?.preload?.(),so(e,e.router.getMatch(t),u);try{s.options.onError?.(u)}catch(p){h=p,so(e,e.router.getMatch(t),p)}const l=Ou(e,t,s),d=l?await l:void 0;e.updateMatch(t,p=>({...p,error:h,status:"error",isFetching:!1,...d}))}}catch(o){const u=e.router.getMatch(t);if(u){const h=Ou(e,t,s);if(h){const a=await h;e.updateMatch(t,l=>({...l,...a}))}u._nonReactive.loaderPromise=void 0}so(e,u,o)}},n3=async(e,t)=>{const{id:n,routeId:s}=e.matches[t];let o=!1,u=!1;const h=e.router.looseRoutesById[s],a=()=>{e.updateMatch(n,p=>({...p,context:F_(e,t)}))};if(t2(e,n)){if(e.router.isServer){const p=Ou(e,n,h);if(p){const f=await p;e.updateMatch(n,g=>({...g,...f}))}return e.router.getMatch(n)}}else{const p=e.router.getMatch(n);if(p._nonReactive.loaderPromise){if(p.status==="success"&&!e.sync&&!p.preload)return p;await p._nonReactive.loaderPromise;const f=e.router.getMatch(n),g=f._nonReactive.error||f.error;g&&so(e,f,g)}else{const f=Date.now()-p.updatedAt,g=sp(e,n),S=g?h.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:h.options.staleTime??e.router.options.defaultStaleTime??0,C=h.options.shouldReload,w=typeof C=="function"?C(r2(e,n,t,h)):C,y=!!g&&!e.router.state.matches.some(E=>E.id===n),x=e.router.getMatch(n);x._nonReactive.loaderPromise=Vl(),y!==x.preload&&e.updateMatch(n,E=>({...E,preload:y}));const{status:v,invalid:b}=x;if(o=v==="success"&&(b||(w??f>S)),!(g&&h.options.preload===!1))if(o&&!e.sync)u=!0,(async()=>{try{await uS(e,n,t,h),a();const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0}catch(E){bs(E)&&await e.router.navigate(E.options)}})();else if(v!=="success"||o&&e.sync)await uS(e,n,t,h);else{const E=Ou(e,n,h);if(E){const T=await E;e.updateMatch(n,A=>({...A,...T}))}}}}const l=e.router.getMatch(n);u||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,u||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0,u||a();const d=u?l.isFetching:!1;return d!==l.isFetching||l.invalid!==!1?(e.updateMatch(n,p=>({...p,isFetching:d,invalid:!1})),e.router.getMatch(n)):l};async function dS(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&dh(t);try{for(let o=0;o<t.matches.length;o++){const u=t3(t,o);co(u)&&await u}const n=t.firstBadMatchIndex??t.matches.length;for(let o=0;o<n;o++)t.matchPromises.push(n3(t,o));await Promise.all(t.matchPromises);const s=dh(t);co(s)&&await s}catch(n){if(is(n)&&!t.preload){const s=dh(t);throw co(s)&&await s,n}if(bs(n))throw n}return t.matches}async function s2(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const s of o2){const o=e.options[s]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Pf(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function i2(e){for(const t of o2)if(e.options[t]?.preload)return!0;return!1}const o2=["component","errorComponent","pendingComponent","notFoundComponent"];function r3(e){return{input:({url:t})=>{for(const n of e)t=a2(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=l2(e[n],t);return t}}}function s3(e){const t=Qw(e.basepath),n=`/${t}`,s=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),u=e.caseSensitive?s:s.toLowerCase();return{input:({url:h})=>{const a=e.caseSensitive?h.pathname:h.pathname.toLowerCase();return a===o?h.pathname="/":a.startsWith(u)&&(h.pathname=h.pathname.slice(n.length)),h},output:({url:h})=>(h.pathname=uh(["/",t,h.pathname]),h)}}function a2(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function l2(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function ha(e){const t=e.resolvedLocation,n=e.location,s=t?.pathname!==n.pathname,o=t?.href!==n.href,u=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:s,hrefChanged:o,hashChanged:u}}class i3{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,o=this.basepath??s?.basepath??"/",u=this.basepath===void 0,h=s?.rewrite;this.options={...s,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=bA())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new _A(a3(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),WA(this));let a=!1;const l=this.options.basepath??"/",d=this.options.rewrite;if(u||o!==l||h!==d){this.basepath=l;const g=[];Qw(l)!==""&&g.push(s3({basepath:l})),d&&g.push(d),this.rewrite=g.length===0?void 0:g.length===1?g[0]:r3(g),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:s,processedTree:o}=MA(this.routeTree,this.options.caseSensitive,(h,a)=>{h.init({originalIndex:a})});this.options.routeMasks&&RA(this.options.routeMasks,o),this.routesById=n,this.routesByPath=s,this.processedTree=o;const u=this.options.notFoundRoute;u&&(u.init({originalIndex:99999999999}),this.routesById[u.id]=u)},this.subscribe=(n,s)=>{const o={eventType:n,fn:s};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(s=>{s.eventType===n.type&&s.fn(n)})},this.parseLocation=(n,s)=>{const o=({href:l,state:d})=>{const p=new URL(l,this.origin),f=a2(this.rewrite,p),g=this.options.parseSearch(f.search),S=this.options.stringifySearch(g);return f.search=S,{href:f.href.replace(f.origin,""),publicHref:l,url:f,pathname:cS(f.pathname),searchStr:S,search:es(s?.search,g),hash:f.hash.split("#").reverse()[0]??"",state:es(s?.state,d)}},u=o(n),{__tempLocation:h,__tempKey:a}=u.state;if(h&&(!a||a===this.tempLocationKey)){const l=o(h);return l.state.key=u.state.key,l.state.__TSR_key=u.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:u}}return u},this.resolvePathCache=Sh(1e3),this.resolvePathWithBase=(n,s)=>BA({base:n,to:V_(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,s,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:s},o):this.matchRoutesInternal(n,s),this.getMatchedRoutes=n=>l3({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const s=this.getMatch(n);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(u=>u.status==="pending"),s=this.state.matches.filter(u=>u.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...s]).forEach(u=>{this.cancelMatch(u.id)})},this.buildLocation=n=>{const s=(u={})=>{const h=u._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutes(h,{_buildLocation:!0}),l=bh(a);u.from;const d=u.unsafeRelative==="path"?h.pathname:u.from??l.fullPath,p=this.resolvePathWithBase(d,"."),f=l.search,g={...l.params},S=u.to?this.resolvePathWithBase(p,`${u.to}`):this.resolvePathWithBase(p,"."),C=u.params===!1||u.params===null?{}:(u.params??!0)===!0?g:Object.assign(g,ro(u.params,g)),w=Jg({path:S,params:C}).interpolatedPath,y=this.matchRoutes(w,void 0,{_buildLocation:!0}).map(H=>this.looseRoutesById[H.routeId]);if(Object.keys(C).length>0)for(const H of y){const z=H.options.params?.stringify??H.options.stringifyParams;z&&Object.assign(C,z(C))}const x=n.leaveParams?S:cS(Jg({path:S,params:C,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let v=f;if(n._includeValidateSearch&&this.options.search?.strict){const H={};y.forEach(z=>{if(z.options.validateSearch)try{Object.assign(H,Uv(z.options.validateSearch,{...H,...v}))}catch{}}),v=H}v=c3({search:v,dest:u,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),v=es(f,v);const b=this.options.stringifySearch(v),E=u.hash===!0?h.hash:u.hash?ro(u.hash,h.hash):void 0,T=E?`#${E}`:"";let A=u.state===!0?h.state:u.state?ro(u.state,h.state):{};A=es(h.state,A);const M=`${x}${b}${T}`,L=new URL(M,this.origin),D=l2(this.rewrite,L);return{publicHref:D.pathname+D.search+D.hash,href:M,url:D,pathname:x,search:v,searchStr:b,state:A,hash:E??"",unmaskOnReload:u.unmaskOnReload}},o=(u={},h)=>{const a=s(u);let l=h?s(h):void 0;if(!l){const d={};if(this.options.routeMasks){const p=TA(a.pathname,this.processedTree);if(p){Object.assign(d,p.params);const{from:f,params:g,...S}=p.route,C=g===!1||g===null?{}:(g??!0)===!0?d:Object.assign(d,ro(g,d));h={from:n.from,...S,params:C},l=s(h)}}}return l&&(a.maskedLocation=l),a};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:s,...o})=>{const u=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(p=>{o.state[p]=this.latestLocation.state[p]});const d=da(o.state,this.latestLocation.state);return l.forEach(p=>{delete o.state[p]}),d},h=fa(this.latestLocation.href)===fa(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Vl(()=>{a?.resolve()}),h&&u())this.load();else{let{maskedLocation:l,hashScrollIntoView:d,url:p,...f}=o;l&&(f={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:s})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:s,hashScrollIntoView:o,viewTransition:u,ignoreBlocker:h,href:a,...l}={})=>{if(a){const f=this.history.location.state.__TSR_index,g=yh(a,{__TSR_index:n?f:f+1});l.to=g.pathname,l.search=this.options.parseSearch(g.search),l.hash=g.hash.slice(1)}const d=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const p=this.commitLocation({...d,viewTransition:u,replace:n,resetScroll:s,hashScrollIntoView:o,ignoreBlocker:h});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:n,reloadDocument:s,href:o,...u})=>{if(!s&&o)try{new URL(`${o}`),s=!0}catch{}if(s){if(o||(o=this.buildLocation({to:n,...u}).url.href),!u.ignoreBlocker){const a=this.history.getBlockers?.()??[];for(const l of a)if(l?.blockerFn&&await l.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(o):window.location.href=o,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==s.publicHref||s.url.origin!==this.origin){const o=this.getParsedLocationHref(s);throw Jw({href:o})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:s.cachedMatches.filter(o=>!n.some(u=>u.id===o.id))}))},this.load=async n=>{let s,o,u;for(u=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ha({resolvedLocation:d,location:l})}),this.emit({type:"onBeforeLoad",...ha({resolvedLocation:d,location:l})}),await dS({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],f=[],g=[];Au(()=>{this.__store.setState(S=>{const C=S.matches,w=S.pendingMatches||S.matches;return p=C.filter(y=>!w.some(x=>x.id===y.id)),f=w.filter(y=>!C.some(x=>x.id===y.id)),g=w.filter(y=>C.some(x=>x.id===y.id)),{...S,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...p.filter(y=>y.status!=="error"&&y.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[f,"onEnter"],[g,"onStay"]].forEach(([S,C])=>{S.forEach(w=>{this.looseRoutesById[w.routeId].options[C]?.(w)})})})})}})}catch(l){bs(l)?(s=l,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):is(l)&&(o=l),this.__store.setState(d=>({...d,statusCode:s?s.status:o?404:d.matches.some(p=>p.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===u&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=u,await u;this.latestLoadPromise&&u!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.__store.state.matches.some(a=>a.status==="error")&&(h=500),h!==void 0&&this.__store.setState(a=>({...a,statusCode:h}))},this.startViewTransition=n=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const u=this.latestLocation,h=this.state.resolvedLocation,a=typeof s.types=="function"?s.types(ha({resolvedLocation:h,location:u})):s.types;if(a===!1){n();return}o={update:n,types:a}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,s)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(u=>u.id===n)?"pendingMatches":this.state.matches.some(u=>u.id===n)?"matches":this.state.cachedMatches.some(u=>u.id===n)?"cachedMatches":"";o&&this.__store.setState(u=>({...u,[o]:u[o]?.map(h=>h.id===n?s(h):h)}))})},this.getMatch=n=>{const s=o=>o.id===n;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=n=>{const s=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(s),cachedMatches:o.cachedMatches.map(s),pendingMatches:o.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>{let s=n.url.href;return this.origin&&n.url.origin===this.origin&&(s=s.replace(this.origin,"")||"/"),s},this.resolveRedirect=n=>{if(!n.options.href){const s=this.buildLocation(n.options),o=this.getParsedLocationHref(s);n.options.href=s.href,n.headers.set("Location",o)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const s=n?.filter;s!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(u=>!s(u))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=s=>{const o=this.looseRoutesById[s.routeId];if(!o.options.loader)return!0;const u=(s.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=u};this.clearCache({filter:n})},this.loadRouteChunk=s2,this.preloadRoute=async n=>{const s=this.buildLocation(n);let o=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:n});const u=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),h=new Set([...u,...this.state.cachedMatches.map(a=>a.id)]);Au(()=>{o.forEach(a=>{h.has(a.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,a]}))})});try{return o=await dS({router:this,matches:o,location:s,preload:!0,updateMatch:(a,l)=>{u.has(a)?o=o.map(d=>d.id===a?l(d):d):this.updateMatch(a,l)}}),o}catch(a){if(bs(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});is(a)||console.error(a);return}},this.matchRoute=(n,s)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},u=this.buildLocation(o);if(s?.pending&&this.state.status!=="pending")return!1;const a=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=LA(u.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!l||n.params&&!da(l.params,n.params,{partial:!0})?!1:s?.includeSearch??!0?da(a.search,u.search,{partial:!0})?l.params:!1:l.params},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??YA,parseSearch:t.parseSearch??KA}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const s=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:u}=s;let{matchedRoutes:h}=s,a=!1;(o?o.path!=="/"&&u["**"]:fa(t.pathname))&&(this.options.notFoundRoute?h=[...h,this.options.notFoundRoute]:a=!0);const l=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let f=h.length-1;f>=0;f--){const g=h[f];if(g.children)return g.id}return Ir}})(),d=[],p=f=>f?.id?f.context??this.options.context??void 0:this.options.context??void 0;return h.forEach((f,g)=>{const S=d[g-1],[C,w,y]=(()=>{const j=S?.search??t.search,K=S?._strictSearch??void 0;try{const $=Uv(f.options.validateSearch,{...j})??void 0;return[{...j,...$},{...K,...$},void 0]}catch($){let F=$;if($ instanceof kh||(F=new kh($.message,{cause:$})),n?.throwOnError)throw F;return[j,{},F]}})(),x=f.options.loaderDeps?.({search:C})??"",v=x?JSON.stringify(x):"",{interpolatedPath:b,usedParams:E}=Jg({path:f.fullPath,params:u,decodeCharMap:this.pathParamsDecodeCharMap}),T=f.id+b+v,A=this.getMatch(T),M=this.state.matches.find(j=>j.routeId===f.id),L=A?._strictParams??E;let D;if(!A){const j=f.options.params?.parse??f.options.parseParams;if(j)try{Object.assign(L,j(L))}catch(K){if(is(K)||bs(K)?D=K:D=new o3(K.message,{cause:K}),n?.throwOnError)throw D}}Object.assign(u,L);const H=M?"stay":"enter";let z;if(A)z={...A,cause:H,params:M?es(M.params,u):u,_strictParams:L,search:es(M?M.search:A.search,C),_strictSearch:w};else{const j=f.options.loader||f.options.beforeLoad||f.lazyFn||i2(f)?"pending":"success";z={id:T,ssr:this.isServer?void 0:f.options.ssr,index:g,routeId:f.id,params:M?es(M.params,u):u,_strictParams:L,pathname:b,updatedAt:Date.now(),search:M?es(M.search,C):C,_strictSearch:w,searchError:void 0,status:j,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:Vl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:H,loaderDeps:M?es(M.loaderDeps,x):x,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:f.options.staticData||{},fullPath:f.fullPath}}n?.preload||(z.globalNotFound=l===f.id),z.searchError=y;const q=p(S);z.context={...q,...z.__routeContext,...z.__beforeLoadContext},d.push(z)}),d.forEach((f,g)=>{const S=this.looseRoutesById[f.routeId];if(!this.getMatch(f.id)&&n?._buildLocation!==!0){const w=d[g-1],y=p(w);if(S.options.context){const x={deps:f.loaderDeps,params:f.params,context:y??{},location:t,navigate:v=>this.navigate({...v,_fromLocation:t}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:d};f.__routeContext=S.options.context(x)??void 0}f.context={...y,...f.__routeContext,...f.__beforeLoadContext}}}),d}}class kh extends Error{}class o3 extends Error{}function a3(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Uv(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new kh("Async validation not supported");if(n.issues)throw new kh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function l3({pathname:e,routesById:t,processedTree:n}){const s={},o=fa(e);let u;const h=AA(o,n,!0);return h&&(u=h.route,Object.assign(s,h.params)),{matchedRoutes:h?.branch||[t[Ir]],routeParams:s,foundRoute:u}}function c3({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){const o=n.reduce((a,l)=>{const d=[];if("search"in l.options)l.options.search?.middlewares&&d.push(...l.options.search.middlewares);else if(l.options.preSearchFilters||l.options.postSearchFilters){const p=({search:f,next:g})=>{let S=f;"preSearchFilters"in l.options&&l.options.preSearchFilters&&(S=l.options.preSearchFilters.reduce((w,y)=>y(w),f));const C=g(S);return"postSearchFilters"in l.options&&l.options.postSearchFilters?l.options.postSearchFilters.reduce((w,y)=>y(w),C):C};d.push(p)}if(s&&l.options.validateSearch){const p=({search:f,next:g})=>{const S=g(f);try{return{...S,...Uv(l.options.validateSearch,S)??void 0}}catch{return S}};d.push(p)}return a.concat(d)},[])??[],u=({search:a})=>t.search?t.search===!0?a:ro(t.search,a):{};o.push(u);const h=(a,l)=>{if(a>=o.length)return l;const d=o[a];return d({search:l,next:f=>h(a+1,f)})};return h(0,e)}const u3="Error preloading route! ☝️";class c2{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,o=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=Ir:this.parentRoute||xi(!1);let u=o?Ir:s?.path;u&&u!=="/"&&(u=Xw(u));const h=s?.id||u;let a=o?Ir:uh([this.parentRoute.id===Ir?"":this.parentRoute.id,h]);u===Ir&&(u="/"),a!==Ir&&(a=uh(["/",a]));const l=a===Ir?"/":uh([this.parentRoute.fullPath,u]);this._path=u,this._id=a,this._fullPath=l,this._to=l},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class d3 extends c2{constructor(t){super(t)}}function U_(e){const t=e.errorComponent??ip;return _.jsx(f3,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?R.createElement(t,{error:n,reset:s}):e.children})}class f3 extends R.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function ip({error:e}){const[t,n]=R.useState(!1);return _.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[_.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),_.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),_.jsx("div",{style:{height:".25rem"}}),t?_.jsx("div",{children:_.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?_.jsx("code",{children:e.message}):null})}):null]})}function h3({children:e,fallback:t=null}){return p3()?_.jsx(ze.Fragment,{children:e}):_.jsx(ze.Fragment,{children:t})}function p3(){return ze.useSyncExternalStore(m3,()=>!0,()=>!1)}function m3(){return()=>{}}var tv={exports:{}},nv={},rv={exports:{}},sv={};var fS;function g3(){if(fS)return sv;fS=1;var e=Ju();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,u=e.useLayoutEffect,h=e.useDebugValue;function a(f,g){var S=g(),C=s({inst:{value:S,getSnapshot:g}}),w=C[0].inst,y=C[1];return u(function(){w.value=S,w.getSnapshot=g,l(w)&&y({inst:w})},[f,S,g]),o(function(){return l(w)&&y({inst:w}),f(function(){l(w)&&y({inst:w})})},[f]),h(S),S}function l(f){var g=f.getSnapshot;f=f.value;try{var S=g();return!n(f,S)}catch{return!0}}function d(f,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return sv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,sv}var hS;function u2(){return hS||(hS=1,rv.exports=g3()),rv.exports}var pS;function v3(){if(pS)return nv;pS=1;var e=Ju(),t=u2();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,u=e.useRef,h=e.useEffect,a=e.useMemo,l=e.useDebugValue;return nv.useSyncExternalStoreWithSelector=function(d,p,f,g,S){var C=u(null);if(C.current===null){var w={hasValue:!1,value:null};C.current=w}else w=C.current;C=a(function(){function x(A){if(!v){if(v=!0,b=A,A=g(A),S!==void 0&&w.hasValue){var M=w.value;if(S(M,A))return E=M}return E=A}if(M=E,s(b,A))return M;var L=g(A);return S!==void 0&&S(M,L)?(b=A,M):(b=A,E=L)}var v=!1,b,E,T=f===void 0?null:f;return[function(){return x(p())},T===null?void 0:function(){return x(T())}]},[p,f,g,S]);var y=o(d,C[0],C[1]);return h(function(){w.hasValue=!0,w.value=y},[y]),l(y),y},nv}var mS;function _3(){return mS||(mS=1,tv.exports=v3()),tv.exports}var d2=_3();function y3(e,t=s=>s,n={}){const s=n.equal??b3;return d2.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function b3(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!t.has(s)||!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=gS(e);if(n.length!==gS(t).length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Object.is(e[n[s]],t[n[s]]))return!1;return!0}function gS(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const iv=R.createContext(null);function f2(){return typeof document>"u"?iv:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=iv,iv)}function Fr(e){const t=R.useContext(f2());return e?.warn,t}function Jn(e){const t=Fr({warn:e?.router===void 0}),n=e?.router||t,s=R.useRef(void 0);return y3(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const u=es(s.current,e.select(o));return s.current=u,u}return e.select(o)}return o})}const op=R.createContext(void 0),x3=R.createContext(void 0);function Fs(e){const t=R.useContext(e.from?x3:op);return Jn({select:s=>{const o=s.matches.find(u=>e.from?e.from===u.routeId:u.id===t);if(xi(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function W_(e){return Fs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function q_(e){const{select:t,...n}=e;return Fs({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function G_(e){return Fs({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function $_(e){return Fs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}const If=typeof window<"u"?R.useLayoutEffect:R.useEffect;function ov(e){const t=R.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function S3(e,t,n={},s={}){R.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([u])=>{t(u)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,s.disabled,e])}function C3(e){const t=R.useRef(null);return R.useImperativeHandle(e,()=>t.current,[]),t}function yo(e){const t=Fr();return R.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var er=$w();const w3=qw(er);function E3(e,t){const n=Fr(),[s,o]=R.useState(!1),u=R.useRef(!1),h=C3(t),{activeProps:a,inactiveProps:l,activeOptions:d,to:p,preload:f,preloadDelay:g,hashScrollIntoView:S,replace:C,startTransition:w,resetScroll:y,viewTransition:x,children:v,target:b,disabled:E,style:T,className:A,onClick:M,onFocus:L,onMouseEnter:D,onMouseLeave:H,onTouchStart:z,ignoreBlocker:q,params:j,search:K,hash:$,state:F,mask:G,reloadDocument:U,unsafeRelative:P,from:B,_fromLocation:I,...W}=e,Y=Jn({select:me=>me.location.search,structuralSharing:!0}),J=e.from,Z=R.useMemo(()=>({...e,from:J}),[n,Y,J,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ee=R.useMemo(()=>n.buildLocation({...Z}),[n,Z]),X=R.useMemo(()=>{if(E)return;let me=ee.maskedLocation?ee.maskedLocation.url.href:ee.url.href,ke=!1;return n.origin&&(me.startsWith(n.origin)?me=n.history.createHref(me.replace(n.origin,""))||"/":ke=!0),{href:me,external:ke}},[E,ee.maskedLocation,ee.url,n.origin,n.history]),V=R.useMemo(()=>{if(X?.external)return X.href;try{return new URL(p),p}catch{}},[p,X]),se=e.reloadDocument||V?!1:f??n.options.defaultPreload,ne=g??n.options.defaultPreloadDelay??0,re=Jn({select:me=>{if(V)return!1;if(d?.exact){if(!NA(me.location.pathname,ee.pathname,n.basepath))return!1}else{const ke=Ch(me.location.pathname,n.basepath),Ce=Ch(ee.pathname,n.basepath);if(!(ke.startsWith(Ce)&&(ke.length===Ce.length||ke[Ce.length]==="/")))return!1}return(d?.includeSearch??!0)&&!da(me.location.search,ee.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?me.location.hash===ee.hash:!0}}),oe=R.useCallback(()=>{n.preloadRoute({...Z}).catch(me=>{console.warn(me),console.warn(u3)})},[n,Z]),le=R.useCallback(me=>{me?.isIntersecting&&oe()},[oe]);S3(h,le,A3,{disabled:!!E||se!=="viewport"}),R.useEffect(()=>{u.current||!E&&se==="render"&&(oe(),u.current=!0)},[E,oe,se]);const ve=me=>{const ke=me.currentTarget.getAttribute("target"),Ce=b!==void 0?b:ke;if(!E&&!O3(me)&&!me.defaultPrevented&&(!Ce||Ce==="_self")&&me.button===0){me.preventDefault(),er.flushSync(()=>{o(!0)});const qe=n.subscribe("onResolved",()=>{qe(),o(!1)});n.navigate({...Z,replace:C,resetScroll:y,hashScrollIntoView:S,startTransition:w,viewTransition:x,ignoreBlocker:q})}};if(V)return{...W,ref:h,href:V,...v&&{children:v},...b&&{target:b},...E&&{disabled:E},...T&&{style:T},...A&&{className:A},...M&&{onClick:M},...L&&{onFocus:L},...D&&{onMouseEnter:D},...H&&{onMouseLeave:H},...z&&{onTouchStart:z}};const ue=me=>{E||se&&oe()},he=ue,de=me=>{if(!(E||!se))if(!ne)oe();else{const ke=me.target;if(gu.has(ke))return;const Ce=setTimeout(()=>{gu.delete(ke),oe()},ne);gu.set(ke,Ce)}},Ne=me=>{if(E||!se||!ne)return;const ke=me.target,Ce=gu.get(ke);Ce&&(clearTimeout(Ce),gu.delete(ke))},Me=re?ro(a,{})??k3:av,Ae=re?av:ro(l,{})??av,be=[A,Me.className,Ae.className].filter(Boolean).join(" "),Oe=(T||Me.style||Ae.style)&&{...T,...Me.style,...Ae.style};return{...W,...Me,...Ae,href:X?.href,ref:h,onClick:vu([M,ve]),onFocus:vu([L,ue]),onMouseEnter:vu([D,de]),onMouseLeave:vu([H,Ne]),onTouchStart:vu([z,he]),disabled:!!E,target:b,...Oe&&{style:Oe},...be&&{className:be},...E&&R3,...re&&T3,...s&&L3}}const av={},k3={className:"active"},R3={role:"link","aria-disabled":!0},T3={"data-status":"active","aria-current":"page"},L3={"data-transitioning":"transitioning"},gu=new WeakMap,A3={rootMargin:"100px"},vu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},qn=R.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:o,ref:u,...h}=E3(s,t),a=typeof s.children=="function"?s.children({isActive:h["data-status"]==="active"}):s.children;return n===void 0&&delete h.disabled,R.createElement(n||"a",{...h,ref:u},a)});function O3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let M3=class extends c2{constructor(t){super(t),this.useMatch=n=>Fs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Fs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>$_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>G_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>q_({...n,from:this.id}),this.useLoaderData=n=>W_({...n,from:this.id}),this.useNavigate=()=>yo({from:this.fullPath}),this.Link=ze.forwardRef((n,s)=>_.jsx(qn,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function D3(e){return new M3(e)}class P3 extends d3{constructor(t){super(t),this.useMatch=n=>Fs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Fs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>$_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>G_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>q_({...n,from:this.id}),this.useLoaderData=n=>W_({...n,from:this.id}),this.useNavigate=()=>yo({from:this.fullPath}),this.Link=ze.forwardRef((n,s)=>_.jsx(qn,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function I3(e){return new P3(e)}function ws(e){return typeof e=="object"?new vS(e,{silent:!0}).createRoute(e):new vS(e,{silent:!0}).createRoute}class vS{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const o=D3(s);return o.isRoot=!1,o},this.silent=n?.silent}}class _S{constructor(t){this.useMatch=n=>Fs({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Fs({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>$_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>G_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>q_({...n,from:this.options.id}),this.useLoaderData=n=>W_({...n,from:this.options.id}),this.useNavigate=()=>{const n=Fr();return yo({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function yS(e){return typeof e=="object"?new _S(e):t=>new _S({id:e,...t})}function j3(){const e=Fr(),t=R.useRef({router:e,mounted:!1}),[n,s]=R.useState(!1),{hasPendingMatches:o,isLoading:u}=Jn({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),h=ov(u),a=u||n||o,l=ov(a),d=u||o,p=ov(d);return e.startTransition=f=>{s(!0),R.startTransition(()=>{f(),s(!1)})},R.useEffect(()=>{const f=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return fa(e.latestLocation.href)!==fa(g.href)&&e.commitLocation({...g,replace:!0}),()=>{f()}},[e,e.history]),If(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),If(()=>{h&&!u&&e.emit({type:"onLoad",...ha(e.state)})},[h,e,u]),If(()=>{p&&!d&&e.emit({type:"onBeforeRouteMount",...ha(e.state)})},[d,p,e]),If(()=>{if(l&&!a){const f=ha(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),f.hrefChanged&&qA(e)}},[a,l,e]),null}function N3(e){const t=Jn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return _.jsx(U_,{getResetKey:()=>t,onCatch:(n,s)=>{if(is(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(is(n))return e.fallback?.(n);throw n},children:e.children})}function B3(){return _.jsx("p",{children:"Not Found"})}function El(e){return _.jsx(_.Fragment,{children:e.children})}function h2(e,t,n){return t.options.notFoundComponent?_.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?_.jsx(e.options.defaultNotFoundComponent,{...n}):_.jsx(B3,{})}function z3({children:e}){const t=Fr();return t.isServer?_.jsx("script",{nonce:t.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function H3(){const e=Fr();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||Fv)(e.latestLocation),s=n!==Fv(e.latestLocation)?n:void 0,o={storageKey:wh,shouldScrollRestoration:!0};return s&&(o.key=s),_.jsx(z3,{children:`(${Zw.toString()})(${JSON.stringify(o)})`})}const p2=R.memo(function({matchId:t}){const n=Fr(),s=Jn({select:x=>{const v=x.matches.find(b=>b.id===t);return xi(v),{routeId:v.routeId,ssr:v.ssr,_displayPending:v._displayPending}},structuralSharing:!0}),o=n.routesById[s.routeId],u=o.options.pendingComponent??n.options.defaultPendingComponent,h=u?_.jsx(u,{}):null,a=o.options.errorComponent??n.options.defaultErrorComponent,l=o.options.onCatch??n.options.defaultOnCatch,d=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,p=s.ssr===!1||s.ssr==="data-only",f=(!o.isRoot||o.options.wrapInSuspense||p)&&(o.options.wrapInSuspense??u??(o.options.errorComponent?.preload||p))?R.Suspense:El,g=a?U_:El,S=d?N3:El,C=Jn({select:x=>x.loadedAt}),w=Jn({select:x=>{const v=x.matches.findIndex(b=>b.id===t);return x.matches[v-1]?.routeId}}),y=o.isRoot?o.options.shellComponent??El:El;return _.jsxs(y,{children:[_.jsx(op.Provider,{value:t,children:_.jsx(f,{fallback:h,children:_.jsx(g,{getResetKey:()=>C,errorComponent:a||ip,onCatch:(x,v)=>{if(is(x))throw x;l?.(x,v)},children:_.jsx(S,{fallback:x=>{if(!d||x.routeId&&x.routeId!==s.routeId||!x.routeId&&!o.isRoot)throw x;return R.createElement(d,x)},children:p||s._displayPending?_.jsx(h3,{fallback:h,children:_.jsx(bS,{matchId:t})}):_.jsx(bS,{matchId:t})})})})}),w===Ir&&n.options.scrollRestoration?_.jsxs(_.Fragment,{children:[_.jsx(V3,{}),_.jsx(H3,{})]}):null]})});function V3(){const e=Fr(),t=R.useRef(void 0);return _.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ha(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const bS=R.memo(function({matchId:t}){const n=Fr(),{match:s,key:o,routeId:u}=Jn({select:l=>{const d=l.matches.find(C=>C.id===t),p=d.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:d.id,status:d.status,error:d.error,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),h=n.routesById[u],a=R.useMemo(()=>{const l=h.options.component??n.options.defaultComponent;return l?_.jsx(l,{},o):_.jsx(m2,{})},[o,h.options.component,n.options.defaultComponent]);if(s._displayPending)throw n.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw n.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const l=h.options.pendingMinMs??n.options.defaultPendingMinMs;if(l){const d=n.getMatch(s.id);if(d&&!d._nonReactive.minPendingPromise&&!n.isServer){const p=Vl();d._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),d._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return xi(is(s.error)),h2(n,h,s.error);if(s.status==="redirected")throw xi(bs(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(n.isServer){const l=(h.options.errorComponent??n.options.defaultErrorComponent)||ip;return _.jsx(l,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return a}),m2=R.memo(function(){const t=Fr(),n=R.useContext(op),s=Jn({select:d=>d.matches.find(p=>p.id===n)?.routeId}),o=t.routesById[s],u=Jn({select:d=>{const f=d.matches.find(g=>g.id===n);return xi(f),f.globalNotFound}}),h=Jn({select:d=>{const p=d.matches,f=p.findIndex(g=>g.id===n);return p[f+1]?.id}}),a=t.options.defaultPendingComponent?_.jsx(t.options.defaultPendingComponent,{}):null;if(u)return h2(t,o,void 0);if(!h)return null;const l=_.jsx(p2,{matchId:h});return s===Ir?_.jsx(R.Suspense,{fallback:a,children:l}):l});function F3(){const e=Fr(),n=e.routesById[Ir].options.pendingComponent??e.options.defaultPendingComponent,s=n?_.jsx(n,{}):null,o=e.isServer||typeof document<"u"&&e.ssr?El:R.Suspense,u=_.jsxs(o,{fallback:s,children:[!e.isServer&&_.jsx(j3,{}),_.jsx(U3,{})]});return e.options.InnerWrap?_.jsx(e.options.InnerWrap,{children:u}):u}function U3(){const e=Fr(),t=Jn({select:o=>o.matches[0]?.id}),n=Jn({select:o=>o.loadedAt}),s=t?_.jsx(p2,{matchId:t}):null;return _.jsx(op.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:_.jsx(U_,{getResetKey:()=>n,errorComponent:ip,onCatch:o=>{o.message||o.toString()},children:s})})}const W3=e=>new q3(e);class q3 extends i3{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=ws,globalThis.createLazyFileRoute=yS):typeof window<"u"&&(window.createFileRoute=ws,window.createLazyFileRoute=yS);function G3({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=f2(),o=_.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?_.jsx(e.options.Wrap,{children:o}):o}function $3({router:e,...t}){return _.jsx(G3,{router:e,...t,children:_.jsx(F3,{})})}function K3(e){return Jn({select:t=>t.location})}var Jl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Y3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},X3=class{#e=Y3;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},ra=new X3;function Q3(e){setTimeout(e,0)}var wa=typeof window>"u"||"Deno"in globalThis;function sr(){}function Z3(e,t){return typeof e=="function"?e(t):e}function Wv(e){return typeof e=="number"&&e>=0&&e!==1/0}function g2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function uo(e,t){return typeof e=="function"?e(t):e}function ns(e,t){return typeof e=="function"?e(t):e}function xS(e,t){const{type:n="all",exact:s,fetchStatus:o,predicate:u,queryKey:h,stale:a}=e;if(h){if(s){if(t.queryHash!==K_(h,t.options))return!1}else if(!Bu(t.queryKey,h))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||u&&!u(t))}function SS(e,t){const{exact:n,status:s,predicate:o,mutationKey:u}=e;if(u){if(!t.options.mutationKey)return!1;if(n){if(Ea(t.options.mutationKey)!==Ea(u))return!1}else if(!Bu(t.options.mutationKey,u))return!1}return!(s&&t.state.status!==s||o&&!o(t))}function K_(e,t){return(t?.queryKeyHashFn||Ea)(e)}function Ea(e){return JSON.stringify(e,(t,n)=>qv(n)?Object.keys(n).sort().reduce((s,o)=>(s[o]=n[o],s),{}):n)}function Bu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Bu(e[n],t[n])):!1}var J3=Object.prototype.hasOwnProperty;function v2(e,t){if(e===t)return e;const n=CS(e)&&CS(t);if(!n&&!(qv(e)&&qv(t)))return t;const o=(n?e:Object.keys(e)).length,u=n?t:Object.keys(t),h=u.length,a=n?new Array(h):{};let l=0;for(let d=0;d<h;d++){const p=n?d:u[d],f=e[p],g=t[p];if(f===g){a[p]=f,(n?d<o:J3.call(e,p))&&l++;continue}if(f===null||g===null||typeof f!="object"||typeof g!="object"){a[p]=g;continue}const S=v2(f,g);a[p]=S,S===f&&l++}return o===h&&l===o?e:a}function Rh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function CS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qv(e){if(!wS(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wS(e){return Object.prototype.toString.call(e)==="[object Object]"}function eO(e){return new Promise(t=>{ra.setTimeout(t,e)})}function Gv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?v2(e,t):t}function tO(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function nO(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Y_=Symbol();function _2(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Y_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function y2(e,t){return typeof e=="function"?e(...t):!!e}var rO=class extends Jl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!wa&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},X_=new rO;function $v(){let e,t;const n=new Promise((o,u)=>{e=o,t=u});n.status="pending",n.catch(()=>{});function s(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{s({status:"fulfilled",value:o}),e(o)},n.reject=o=>{s({status:"rejected",reason:o}),t(o)},n}var sO=Q3;function iO(){let e=[],t=0,n=a=>{a()},s=a=>{a()},o=sO;const u=a=>{t?e.push(a):o(()=>{n(a)})},h=()=>{const a=e;e=[],a.length&&o(()=>{s(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||h()}return l},batchCalls:a=>(...l)=>{u(()=>{a(...l)})},schedule:u,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{o=a}}}var Dn=iO(),oO=class extends Jl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!wa&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Th=new oO;function aO(e){return Math.min(1e3*2**e,3e4)}function b2(e){return(e??"online")==="online"?Th.isOnline():!0}var Kv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function x2(e){let t=!1,n=0,s;const o=$v(),u=()=>o.status!=="pending",h=w=>{if(!u()){const y=new Kv(w);g(y),e.onCancel?.(y)}},a=()=>{t=!0},l=()=>{t=!1},d=()=>X_.isFocused()&&(e.networkMode==="always"||Th.isOnline())&&e.canRun(),p=()=>b2(e.networkMode)&&e.canRun(),f=w=>{u()||(s?.(),o.resolve(w))},g=w=>{u()||(s?.(),o.reject(w))},S=()=>new Promise(w=>{s=y=>{(u()||d())&&w(y)},e.onPause?.()}).then(()=>{s=void 0,u()||e.onContinue?.()}),C=()=>{if(u())return;let w;const y=n===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(x){w=Promise.reject(x)}Promise.resolve(w).then(f).catch(x=>{if(u())return;const v=e.retry??(wa?0:3),b=e.retryDelay??aO,E=typeof b=="function"?b(n,x):b,T=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,x);if(t||!T){g(x);return}n++,e.onFail?.(n,x),eO(E).then(()=>d()?void 0:S()).then(()=>{t?g(x):C()})})};return{promise:o,status:()=>o.status,cancel:h,continue:()=>(s?.(),o),cancelRetry:a,continueRetry:l,canStart:p,start:()=>(p()?C():S().then(C),o)}}var S2=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wv(this.gcTime)&&(this.#e=ra.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wa?1/0:300*1e3))}clearGcTimeout(){this.#e&&(ra.clearTimeout(this.#e),this.#e=void 0)}},lO=class extends S2{#e;#t;#n;#s;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=kS(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=kS(this.options);t.data!==void 0&&(this.setState(ES(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Gv(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(sr).catch(sr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ns(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Y_||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>uo(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!g2(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(l=>l.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,s=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const a=_2(this.options,t),d=(()=>{const p={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(p),p})();return this.#a=!1,this.options.persister?this.options.persister(a,d,this):a(d)},h=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:o};return s(a),a})();this.options.behavior?.onFetch(h,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==h.fetchOptions?.meta)&&this.#i({type:"fetch",meta:h.fetchOptions?.meta}),this.#r=x2({initialPromise:t?.initialPromise,fn:h.fetchFn,onCancel:a=>{a instanceof Kv&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,l)=>{this.#i({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Kv){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#i({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...C2(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...ES(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Dn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function C2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:b2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ES(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function kS(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var cO=class extends Jl{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=$v(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#o;#a;#i;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),RS(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yv(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ns(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Rh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&TS(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),s&&(this.#t!==n||ns(this.options.enabled,this.#t)!==ns(t.enabled,this.#t)||uo(this.options.staleTime,this.#t)!==uo(t.staleTime,this.#t))&&this.#g();const o=this.#v();s&&(this.#t!==n||ns(this.options.enabled,this.#t)!==ns(t.enabled,this.#t)||o!==this.#l)&&this.#_(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return dO(this,n)&&(this.#s=n,this.#o=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(sr)),t}#g(){this.#b();const e=uo(this.options.staleTime,this.#t);if(wa||this.#s.isStale||!Wv(e))return;const n=g2(this.#s.dataUpdatedAt,e)+1;this.#c=ra.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#_(e){this.#x(),this.#l=e,!(wa||ns(this.options.enabled,this.#t)===!1||!Wv(this.#l)||this.#l===0)&&(this.#u=ra.setInterval(()=>{(this.options.refetchIntervalInBackground||X_.isFocused())&&this.#d()},this.#l))}#y(){this.#g(),this.#_(this.#v())}#b(){this.#c&&(ra.clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(ra.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,o=this.#s,u=this.#r,h=this.#o,l=e!==n?e.state:this.#n,{state:d}=e;let p={...d},f=!1,g;if(t._optimisticResults){const L=this.hasListeners(),D=!L&&RS(e,t),H=L&&TS(e,n,t,s);(D||H)&&(p={...p,...C2(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:S,errorUpdatedAt:C,status:w}=p;g=p.data;let y=!1;if(t.placeholderData!==void 0&&g===void 0&&w==="pending"){let L;o?.isPlaceholderData&&t.placeholderData===h?.placeholderData?(L=o.data,y=!0):L=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,L!==void 0&&(w="success",g=Gv(o?.data,L,t),f=!0)}if(t.select&&g!==void 0&&!y)if(o&&g===u?.data&&t.select===this.#m)g=this.#f;else try{this.#m=t.select,g=t.select(g),g=Gv(o?.data,g,t),this.#f=g,this.#i=null}catch(L){this.#i=L}this.#i&&(S=this.#i,g=this.#f,C=Date.now(),w="error");const x=p.fetchStatus==="fetching",v=w==="pending",b=w==="error",E=v&&x,T=g!==void 0,M={status:w,fetchStatus:p.fetchStatus,isPending:v,isSuccess:w==="success",isError:b,isInitialLoading:E,isLoading:E,data:g,dataUpdatedAt:p.dataUpdatedAt,error:S,errorUpdatedAt:C,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>l.dataUpdateCount||p.errorUpdateCount>l.errorUpdateCount,isFetching:x,isRefetching:x&&!v,isLoadingError:b&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&T,isStale:Q_(e,t),refetch:this.refetch,promise:this.#a,isEnabled:ns(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=z=>{M.status==="error"?z.reject(M.error):M.data!==void 0&&z.resolve(M.data)},D=()=>{const z=this.#a=M.promise=$v();L(z)},H=this.#a;switch(H.status){case"pending":e.queryHash===n.queryHash&&L(H);break;case"fulfilled":(M.status==="error"||M.data!==H.value)&&D();break;case"rejected":(M.status!=="error"||M.error!==H.reason)&&D();break}}return M}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Rh(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#p.size)return!0;const u=new Set(o??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#s).some(h=>{const a=h;return this.#s[a]!==e[a]&&u.has(a)})};this.#C({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Dn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function uO(e,t){return ns(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function RS(e,t){return uO(e,t)||e.state.data!==void 0&&Yv(e,t,t.refetchOnMount)}function Yv(e,t,n){if(ns(t.enabled,e)!==!1&&uo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Q_(e,t)}return!1}function TS(e,t,n,s){return(e!==t||ns(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Q_(e,n)}function Q_(e,t){return ns(t.enabled,e)!==!1&&e.isStaleByTime(uo(t.staleTime,e))}function dO(e,t){return!Rh(e.getCurrentResult(),t)}function LS(e){return{onFetch:(t,n)=>{const s=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],h=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const d=async()=>{let p=!1;const f=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},g=_2(t.options,t.fetchOptions),S=async(C,w,y)=>{if(p)return Promise.reject();if(w==null&&C.pages.length)return Promise.resolve(C);const v=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:w,direction:y?"backward":"forward",meta:t.options.meta};return f(A),A})(),b=await g(v),{maxPages:E}=t.options,T=y?nO:tO;return{pages:T(C.pages,b,E),pageParams:T(C.pageParams,w,E)}};if(o&&u.length){const C=o==="backward",w=C?fO:AS,y={pages:u,pageParams:h},x=w(s,y);a=await S(y,x,C)}else{const C=e??u.length;do{const w=l===0?h[0]??s.initialPageParam:AS(s,a);if(l>0&&w==null)break;a=await S(a,w),l++}while(l<C)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function AS(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function fO(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var hO=class extends S2{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||w2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=x2({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(u,h)=>{this.#r({type:"failed",failureCount:u,error:h})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",o=!this.#s.canStart();try{if(s)t();else{this.#r({type:"pending",variables:e,isPaused:o}),await this.#n.config.onMutate?.(e,this,n);const h=await this.options.onMutate?.(e,n);h!==this.state.context&&this.#r({type:"pending",context:h,variables:e,isPaused:o})}const u=await this.#s.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,n),await this.options.onSuccess?.(u,e,this.state.context,n),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(u,null,e,this.state.context,n),this.#r({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,n),await this.options.onError?.(u,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,u,e,this.state.context,n),u}finally{this.#r({type:"error",error:u})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Dn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function w2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pO=class extends Jl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new hO({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=jf(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=jf(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=jf(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=jf(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Dn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>SS(t,n))}findAll(e={}){return this.getAll().filter(t=>SS(e,t))}notify(e){Dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Dn.batch(()=>Promise.all(e.map(t=>t.continue().catch(sr))))}};function jf(e){return e.options.scope?.id}var mO=class extends Jl{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Rh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ea(n.mutationKey)!==Ea(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#o()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??w2();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Dn.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,s=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#s.onSuccess?.(t.data,n,s,o),this.#s.onSettled?.(t.data,null,n,s,o)):t?.type==="error"&&(this.#s.onError?.(t.error,n,s,o),this.#s.onSettled?.(void 0,t.error,n,s,o))}this.listeners.forEach(n=>{n(this.#t)})})}},gO=class extends Jl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,o=t.queryHash??K_(s,t);let u=this.get(o);return u||(u=new lO({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Dn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>xS(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>xS(e,n)):t}notify(e){Dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Dn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Dn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},vO=class{#e;#t;#n;#s;#r;#o;#a;#i;constructor(e={}){this.#e=e.queryCache||new gO,this.#t=e.mutationCache||new pO,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=X_.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Th.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(uo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(s.queryHash)?.state.data,h=Z3(t,u);if(h!==void 0)return this.#e.build(this,s).setData(h,{...n,manual:!0})}setQueriesData(e,t,n){return Dn.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Dn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Dn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=Dn.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(s).then(sr).catch(sr)}invalidateQueries(e,t={}){return Dn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=Dn.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let u=o.fetch(void 0,n);return n.throwOnError||(u=u.catch(sr)),o.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(s).then(sr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(uo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(sr).catch(sr)}fetchInfiniteQuery(e){return e.behavior=LS(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sr).catch(sr)}ensureInfiniteQueryData(e){return e.behavior=LS(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Th.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Ea(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Bu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ea(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Bu(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=K_(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Y_&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},E2=R.createContext(void 0),$n=e=>{const t=R.useContext(E2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_O=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(E2.Provider,{value:e,children:t})),k2=R.createContext(!1),yO=()=>R.useContext(k2);k2.Provider;function bO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xO=R.createContext(bO()),SO=()=>R.useContext(xO),CO=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},wO=e=>{R.useEffect(()=>{e.clearReset()},[e])},EO=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||y2(n,[e.error,s])),kO=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...o)=>n(s(...o)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},RO=(e,t)=>e.isLoading&&e.isFetching&&!t,TO=(e,t)=>e?.suspense&&t.isPending,OS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function LO(e,t,n){const s=yO(),o=SO(),u=$n(),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h),h._optimisticResults=s?"isRestoring":"optimistic",kO(h),CO(h,o),wO(o);const a=!u.getQueryCache().get(h.queryHash),[l]=R.useState(()=>new t(u,h)),d=l.getOptimisticResult(h),p=!s&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(f=>{const g=p?l.subscribe(Dn.batchCalls(f)):sr;return l.updateResult(),g},[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setOptions(h)},[h,l]),TO(h,d))throw OS(h,l,o);if(EO({result:d,errorResetBoundary:o,throwOnError:h.throwOnError,query:u.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw d.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,d),h.experimental_prefetchInRender&&!wa&&RO(d,s)&&(a?OS(h,l,o):u.getQueryCache().get(h.queryHash)?.promise)?.catch(sr).finally(()=>{l.updateResult()}),h.notifyOnChangeProps?d:l.trackResult(d)}function Kn(e,t){return LO(e,cO)}function Bn(e,t){const n=$n(),[s]=R.useState(()=>new mO(n,e));R.useEffect(()=>{s.setOptions(e)},[s,e]);const o=R.useSyncExternalStore(R.useCallback(h=>s.subscribe(Dn.batchCalls(h)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=R.useCallback((h,a)=>{s.mutate(h,a).catch(sr)},[s]);if(o.error&&y2(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}function ap(){return typeof window<"u"}function bo(e){return Z_(e)?(e.nodeName||"").toLowerCase():"#document"}function kn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qs(e){var t;return(t=(Z_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Z_(e){return ap()?e instanceof Node||e instanceof kn(e).Node:!1}function Nt(e){return ap()?e instanceof Element||e instanceof kn(e).Element:!1}function en(e){return ap()?e instanceof HTMLElement||e instanceof kn(e).HTMLElement:!1}function Xv(e){return!ap()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kn(e).ShadowRoot}const AO=new Set(["inline","contents"]);function Aa(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=Vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!AO.has(o)}const OO=new Set(["table","td","th"]);function MO(e){return OO.has(bo(e))}const DO=[":popover-open",":modal"];function lp(e){return DO.some(t=>{try{return e.matches(t)}catch{return!1}})}const PO=["transform","translate","scale","rotate","perspective"],IO=["transform","translate","scale","rotate","perspective","filter"],jO=["paint","layout","strict","content"];function J_(e){const t=cp(),n=Nt(e)?Vr(e):e;return PO.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||IO.some(s=>(n.willChange||"").includes(s))||jO.some(s=>(n.contain||"").includes(s))}function NO(e){let t=Us(e);for(;en(t)&&!Hs(t);){if(J_(t))return t;if(lp(t))return null;t=Us(t)}return null}function cp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const BO=new Set(["html","body","#document"]);function Hs(e){return BO.has(bo(e))}function Vr(e){return kn(e).getComputedStyle(e)}function up(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Us(e){if(bo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xv(e)&&e.host||qs(e);return Xv(t)?t.host:t}function R2(e){const t=Us(e);return Hs(t)?e.ownerDocument?e.ownerDocument.body:e.body:en(t)&&Aa(t)?t:R2(t)}function fo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=R2(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),h=kn(o);if(u){const a=Qv(h);return t.concat(h,h.visualViewport||[],Aa(o)?o:[],a&&n?fo(a):[])}return t.concat(o,fo(o,[],n))}function Qv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const MS={};function Gn(e,t){const n=R.useRef(MS);return n.current===MS&&(n.current=e(t)),n}const lv=Gw[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],zO=lv&&lv!==R.useLayoutEffect?lv:e=>e();function Pe(e){const t=Gn(HO).current;return t.next=e,zO(t.effect),t.trampoline}function HO(){const e={next:void 0,callback:VO,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function VO(){}const FO=()=>{},Fe=typeof document<"u"?R.useLayoutEffect:FO;function Zv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Mu={};function Ws(e,t,n,s,o){let u={...Jv(e,Mu)};return t&&(u=ku(u,t)),n&&(u=ku(u,n)),s&&(u=ku(u,s)),o&&(u=ku(u,o)),u}function UO(e){if(e.length===0)return Mu;if(e.length===1)return Jv(e[0],Mu);let t={...Jv(e[0],Mu)};for(let n=1;n<e.length;n+=1)t=ku(t,e[n]);return t}function ku(e,t){return T2(t)?t(e):WO(e,t)}function WO(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Zv(e.style,s);break}case"className":{e[n]=L2(e.className,s);break}default:qO(n,s)?e[n]=GO(e[n],s):e[n]=s}}return e}function qO(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&s===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function T2(e){return typeof e=="function"}function Jv(e,t){return T2(e)?e(t):e??Mu}function GO(e,t){return t?e?n=>{if($O(n)){const o=n;e_(o);const u=t(o);return o.baseUIHandlerPrevented||e?.(o),u}const s=t(n);return e?.(n),s}:t:e}function e_(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function L2(e,t){return t?e?t+" "+e:t:e}function $O(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Pt(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}const A2=R.createContext(void 0);function e0(e=!1){const t=R.useContext(A2);if(t===void 0&&!e)throw new Error(Pt(16));return t}function KO(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:o=0,isNativeButton:u}=e,h=s&&t!==!1,a=s&&t===!1;return{props:R.useMemo(()=>{const d={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return s||(d.tabIndex=o,!u&&n&&(d.tabIndex=t?o:-1)),(u&&(t||h)||!u&&n)&&(d["aria-disabled"]=n),u&&(!t||a)&&(d.disabled=n),d},[s,n,t,h,a,u,o])}}function xr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:o=!0}=e,u=R.useRef(null),h=e0(!0)!==void 0,a=Pe(()=>{const g=u.current;return!!(g?.tagName==="A"&&g?.href)}),{props:l}=KO({focusableWhenDisabled:n,disabled:t,composite:h,tabIndex:s,isNativeButton:o}),d=R.useCallback(()=>{const g=u.current;YO(g)&&h&&t&&l.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,l.disabled,h]);Fe(d,[d]);const p=R.useCallback((g={})=>{const{onClick:S,onMouseDown:C,onKeyUp:w,onKeyDown:y,onPointerDown:x,...v}=g;return Ws({type:o?"button":void 0,onClick(E){if(t){E.preventDefault();return}S?.(E)},onMouseDown(E){t||C?.(E)},onKeyDown(E){if(t||(e_(E),y?.(E)),E.baseUIHandlerPrevented)return;const T=E.target===E.currentTarget&&!o&&!a()&&!t,A=E.key==="Enter",M=E.key===" ";T&&((M||A)&&E.preventDefault(),A&&S?.(E))},onKeyUp(E){t||(e_(E),w?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!o&&!t&&E.key===" "&&S?.(E)},onPointerDown(E){if(t){E.preventDefault();return}x?.(E)}},o?void 0:{role:"button"},l,v)},[t,l,o,a]),f=Pe(g=>{u.current=g,d()});return{getButtonProps:p,buttonRef:f}}function YO(e){return en(e)&&e.tagName==="BUTTON"}function cs(e,t,n,s){const o=Gn(O2).current;return QO(o,e,t,n,s)&&M2(o,[e,t,n,s]),o.callback}function XO(e){const t=Gn(O2).current;return ZO(t,e)&&M2(t,e),t.callback}function O2(){return{callback:null,cleanup:null,refs:[]}}function QO(e,t,n,s,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==o}function ZO(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function M2(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const s=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const u=t[o];if(u!=null)switch(typeof u){case"function":{const h=u(n);typeof h=="function"&&(s[o]=h);break}case"object":{u.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const u=t[o];if(u!=null)switch(typeof u){case"function":{const h=s[o];typeof h=="function"?h():u(null);break}case"object":{u.current=null;break}}}}}}}const JO=parseInt(R.version,10);function t0(e){return JO>=e}function DS(e){if(!R.isValidElement(e))return null;const t=e,n=t.props;return(t0(19)?n?.ref:t.ref)??null}function eM(e,t){const n={};for(const s in e){const o=e[s];if(t?.hasOwnProperty(s)){const u=t[s](o);u!=null&&Object.assign(n,u);continue}o===!0?n[`data-${s.toLowerCase()}`]="":o&&(n[`data-${s.toLowerCase()}`]=o.toString())}return n}function tM(e,t){return typeof e=="function"?e(t):e}function nM(e,t){return typeof e=="function"?e(t):e}function on(){}const yr=Object.freeze([]),tn=Object.freeze({}),rM=500,sM=500,iM={style:{transition:"none"}},D2="data-base-ui-click-trigger",n0={fallbackAxisSide:"none"},oM={fallbackAxisSide:"end"},aM={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function at(e,t,n={}){const s=t.render,o=lM(t,n);if(n.enabled===!1)return null;const u=n.state??tn;return cM(e,s,o,u)}function lM(e,t={}){const{className:n,style:s,render:o}=e,{state:u=tn,ref:h,props:a,stateAttributesMapping:l,enabled:d=!0}=t,p=d?tM(n,u):void 0,f=d?nM(s,u):void 0,g=d?eM(u,l):tn,S=d?Zv(g,Array.isArray(a)?UO(a):a)??tn:tn;return typeof document<"u"&&(d?Array.isArray(h)?S.ref=XO([S.ref,DS(o),...h]):S.ref=cs(S.ref,DS(o),h):cs(null,null)),d?(p!==void 0&&(S.className=L2(S.className,p)),f!==void 0&&(S.style=Zv(S.style,f)),S):tn}function cM(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const o=Ws(n,t.props);return o.ref=n.ref,R.cloneElement(t,o)}if(e&&typeof e=="string")return uM(e,n);throw new Error(Pt(8))}function uM(e,t){return e==="button"?R.createElement("button",{type:"button",...t,key:t.key}):e==="img"?R.createElement("img",{alt:"",...t,key:t.key}):R.createElement(e,t)}const dM=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,focusableWhenDisabled:h=!1,nativeButton:a=!0,...l}=t,d=!!u,{getButtonProps:p,buttonRef:f}=xr({disabled:d,focusableWhenDisabled:h,native:a}),g=R.useMemo(()=>({disabled:d}),[d]);return at("button",t,{state:g,ref:[n,f],props:[l,p]})});function P2(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=P2(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function I2(){for(var e,t,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=P2(e))&&(s&&(s+=" "),s+=t);return s}const PS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,IS=I2,Oa=(e,t)=>n=>{var s;if(t?.variants==null)return IS(e,n?.class,n?.className);const{variants:o,defaultVariants:u}=t,h=Object.keys(o).map(d=>{const p=n?.[d],f=u?.[d];if(p===null)return null;const g=PS(p)||PS(f);return o[d][g]}),a=n&&Object.entries(n).reduce((d,p)=>{let[f,g]=p;return g===void 0||(d[f]=g),d},{}),l=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,p)=>{let{class:f,className:g,...S}=p;return Object.entries(S).every(C=>{let[w,y]=C;return Array.isArray(y)?y.includes({...u,...a}[w]):{...u,...a}[w]===y})?[...d,f,g]:d},[]);return IS(e,h,l,n?.class,n?.className)},fM=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},hM=(e,t)=>({classGroupId:e,validator:t}),j2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lh="-",jS=[],pM="arbitrary..",mM=e=>{const t=vM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return gM(h);const a=h.split(Lh),l=a[0]===""&&a.length>1?1:0;return N2(a,l,t)},getConflictingClassGroupIds:(h,a)=>{if(a){const l=s[h],d=n[h];return l?d?fM(d,l):l:d||jS}return n[h]||jS}}},N2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],u=n.nextPart.get(o);if(u){const d=N2(e,t+1,u);if(d)return d}const h=n.validators;if(h===null)return;const a=t===0?e.join(Lh):e.slice(t).join(Lh),l=h.length;for(let d=0;d<l;d++){const p=h[d];if(p.validator(a))return p.classGroupId}},gM=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?pM+s:void 0})(),vM=e=>{const{theme:t,classGroups:n}=e;return _M(n,t)},_M=(e,t)=>{const n=j2();for(const s in e){const o=e[s];r0(o,n,s,t)}return n},r0=(e,t,n,s)=>{const o=e.length;for(let u=0;u<o;u++){const h=e[u];yM(h,t,n,s)}},yM=(e,t,n,s)=>{if(typeof e=="string"){bM(e,t,n);return}if(typeof e=="function"){xM(e,t,n,s);return}SM(e,t,n,s)},bM=(e,t,n)=>{const s=e===""?t:B2(t,e);s.classGroupId=n},xM=(e,t,n,s)=>{if(CM(e)){r0(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(hM(n,e))},SM=(e,t,n,s)=>{const o=Object.entries(e),u=o.length;for(let h=0;h<u;h++){const[a,l]=o[h];r0(l,B2(t,a),n,s)}},B2=(e,t)=>{let n=e;const s=t.split(Lh),o=s.length;for(let u=0;u<o;u++){const h=s[u];let a=n.nextPart.get(h);a||(a=j2(),n.nextPart.set(h,a)),n=a}return n},CM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,wM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const o=(u,h)=>{n[u]=h,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(u){let h=n[u];if(h!==void 0)return h;if((h=s[u])!==void 0)return o(u,h),h},set(u,h){u in n?n[u]=h:o(u,h)}}},t_="!",NS=":",EM=[],BS=(e,t,n,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:o}),kM=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=o=>{const u=[];let h=0,a=0,l=0,d;const p=o.length;for(let w=0;w<p;w++){const y=o[w];if(h===0&&a===0){if(y===NS){u.push(o.slice(l,w)),l=w+1;continue}if(y==="/"){d=w;continue}}y==="["?h++:y==="]"?h--:y==="("?a++:y===")"&&a--}const f=u.length===0?o:o.slice(l);let g=f,S=!1;f.endsWith(t_)?(g=f.slice(0,-1),S=!0):f.startsWith(t_)&&(g=f.slice(1),S=!0);const C=d&&d>l?d-l:void 0;return BS(u,S,g,C)};if(t){const o=t+NS,u=s;s=h=>h.startsWith(o)?u(h.slice(o.length)):BS(EM,!1,h,void 0,!0)}if(n){const o=s;s=u=>n({className:u,parseClassName:o})}return s},RM=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let o=[];for(let u=0;u<n.length;u++){const h=n[u],a=h[0]==="[",l=t.has(h);a||l?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(h)):o.push(h)}return o.length>0&&(o.sort(),s.push(...o)),s}},TM=e=>({cache:wM(e.cacheSize),parseClassName:kM(e),sortModifiers:RM(e),...mM(e)}),LM=/\s+/,AM=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:u}=t,h=[],a=e.trim().split(LM);let l="";for(let d=a.length-1;d>=0;d-=1){const p=a[d],{isExternal:f,modifiers:g,hasImportantModifier:S,baseClassName:C,maybePostfixModifierPosition:w}=n(p);if(f){l=p+(l.length>0?" "+l:l);continue}let y=!!w,x=s(y?C.substring(0,w):C);if(!x){if(!y){l=p+(l.length>0?" "+l:l);continue}if(x=s(C),!x){l=p+(l.length>0?" "+l:l);continue}y=!1}const v=g.length===0?"":g.length===1?g[0]:u(g).join(":"),b=S?v+t_:v,E=b+x;if(h.indexOf(E)>-1)continue;h.push(E);const T=o(x,y);for(let A=0;A<T.length;++A){const M=T[A];h.push(b+M)}l=p+(l.length>0?" "+l:l)}return l},OM=(...e)=>{let t=0,n,s,o="";for(;t<e.length;)(n=e[t++])&&(s=z2(n))&&(o&&(o+=" "),o+=s);return o},z2=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=z2(e[s]))&&(n&&(n+=" "),n+=t);return n},MM=(e,...t)=>{let n,s,o,u;const h=l=>{const d=t.reduce((p,f)=>f(p),e());return n=TM(d),s=n.cache.get,o=n.cache.set,u=a,a(l)},a=l=>{const d=s(l);if(d)return d;const p=AM(l,n);return o(l,p),p};return u=h,(...l)=>u(OM(...l))},DM=[],Ln=e=>{const t=n=>n[e]||DM;return t.isThemeGetter=!0,t},H2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,V2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PM=/^\d+\/\d+$/,IM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jM=/\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$/,NM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,BM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cl=e=>PM.test(e),St=e=>!!e&&!Number.isNaN(Number(e)),eo=e=>!!e&&Number.isInteger(Number(e)),cv=e=>e.endsWith("%")&&St(e.slice(0,-1)),_i=e=>IM.test(e),HM=()=>!0,VM=e=>jM.test(e)&&!NM.test(e),F2=()=>!1,FM=e=>BM.test(e),UM=e=>zM.test(e),WM=e=>!Ke(e)&&!Ye(e),qM=e=>ec(e,q2,F2),Ke=e=>H2.test(e),Go=e=>ec(e,G2,VM),uv=e=>ec(e,XM,St),zS=e=>ec(e,U2,F2),GM=e=>ec(e,W2,UM),Nf=e=>ec(e,$2,FM),Ye=e=>V2.test(e),_u=e=>tc(e,G2),$M=e=>tc(e,QM),HS=e=>tc(e,U2),KM=e=>tc(e,q2),YM=e=>tc(e,W2),Bf=e=>tc(e,$2,!0),ec=(e,t,n)=>{const s=H2.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},tc=(e,t,n=!1)=>{const s=V2.exec(e);return s?s[1]?t(s[1]):n:!1},U2=e=>e==="position"||e==="percentage",W2=e=>e==="image"||e==="url",q2=e=>e==="length"||e==="size"||e==="bg-size",G2=e=>e==="length",XM=e=>e==="number",QM=e=>e==="family-name",$2=e=>e==="shadow",ZM=()=>{const e=Ln("color"),t=Ln("font"),n=Ln("text"),s=Ln("font-weight"),o=Ln("tracking"),u=Ln("leading"),h=Ln("breakpoint"),a=Ln("container"),l=Ln("spacing"),d=Ln("radius"),p=Ln("shadow"),f=Ln("inset-shadow"),g=Ln("text-shadow"),S=Ln("drop-shadow"),C=Ln("blur"),w=Ln("perspective"),y=Ln("aspect"),x=Ln("ease"),v=Ln("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...E(),Ye,Ke],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],L=()=>[Ye,Ke,l],D=()=>[Cl,"full","auto",...L()],H=()=>[eo,"none","subgrid",Ye,Ke],z=()=>["auto",{span:["full",eo,Ye,Ke]},eo,Ye,Ke],q=()=>[eo,"auto",Ye,Ke],j=()=>["auto","min","max","fr",Ye,Ke],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...L()],G=()=>[Cl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],U=()=>[e,Ye,Ke],P=()=>[...E(),HS,zS,{position:[Ye,Ke]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",KM,qM,{size:[Ye,Ke]}],W=()=>[cv,_u,Go],Y=()=>["","none","full",d,Ye,Ke],J=()=>["",St,_u,Go],Z=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[St,cv,HS,zS],V=()=>["","none",C,Ye,Ke],se=()=>["none",St,Ye,Ke],ne=()=>["none",St,Ye,Ke],re=()=>[St,Ye,Ke],oe=()=>[Cl,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_i],breakpoint:[_i],color:[HM],container:[_i],"drop-shadow":[_i],ease:["in","out","in-out"],font:[WM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_i],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_i],shadow:[_i],spacing:["px",St],text:[_i],"text-shadow":[_i],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Cl,Ke,Ye,y]}],container:["container"],columns:[{columns:[St,Ke,Ye,a]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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:T()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[eo,"auto",Ye,Ke]}],basis:[{basis:[Cl,"full","auto",a,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[St,Cl,"auto","initial","none",Ke]}],grow:[{grow:["",St,Ye,Ke]}],shrink:[{shrink:["",St,Ye,Ke]}],order:[{order:[eo,"first","last","none",Ye,Ke]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[a,"screen",...G()]}],"min-w":[{"min-w":[a,"screen","none",...G()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[h]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,_u,Go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ye,uv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cv,Ke]}],"font-family":[{font:[$M,Ke,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:[o,Ye,Ke]}],"line-clamp":[{"line-clamp":[St,"none",Ye,uv]}],leading:[{leading:[u,...L()]}],"list-image":[{"list-image":["none",Ye,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[St,"from-font","auto",Ye,Go]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[St,"auto",Ye,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ke]}],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",Ye,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eo,Ye,Ke],radial:["",Ye,Ke],conic:[eo,Ye,Ke]},YM,GM]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[St,Ye,Ke]}],"outline-w":[{outline:["",St,_u,Go]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",p,Bf,Nf]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",f,Bf,Nf]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[St,Go]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",g,Bf,Nf]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[St,Ye,Ke]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":[St]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ye,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"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":E()}],"mask-image-conic-pos":[{"mask-conic":[St]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ke]}],filter:[{filter:["","none",Ye,Ke]}],blur:[{blur:V()}],brightness:[{brightness:[St,Ye,Ke]}],contrast:[{contrast:[St,Ye,Ke]}],"drop-shadow":[{"drop-shadow":["","none",S,Bf,Nf]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",St,Ye,Ke]}],"hue-rotate":[{"hue-rotate":[St,Ye,Ke]}],invert:[{invert:["",St,Ye,Ke]}],saturate:[{saturate:[St,Ye,Ke]}],sepia:[{sepia:["",St,Ye,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ke]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[St,Ye,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[St,Ye,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",St,Ye,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[St,Ye,Ke]}],"backdrop-invert":[{"backdrop-invert":["",St,Ye,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[St,Ye,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[St,Ye,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",St,Ye,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[St,"initial",Ye,Ke]}],ease:[{ease:["linear","initial",x,Ye,Ke]}],delay:[{delay:[St,Ye,Ke]}],animate:[{animate:["none",v,Ye,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ye,Ke]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[Ye,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"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",Ye,Ke]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,Ke]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[St,_u,Go,uv]}],stroke:[{stroke:["none",...U()]}],"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"]}},JM=MM(ZM);function He(...e){return JM(I2(e))}const e4=Oa("cursor-pointer focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border dark:bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function Be({className:e,variant:t="default",size:n="default",...s}){return _.jsx(dM,{"data-slot":"button",className:He(e4({variant:t,size:n,className:e})),...s})}const t4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},_e=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n,absoluteStrokeWidth:s=!1,className:o="",altIcon:u,showAlt:h=!1,icon:a,primaryColor:l,secondaryColor:d,disableSecondaryOpacity:p=!1,...f},g)=>{const S=n!==void 0?s?Number(n)*24/Number(t):n:void 0,C=S!==void 0?{strokeWidth:S,stroke:"currentColor"}:{},w={ref:g,...t4,width:t,height:t,color:l||e,className:o,...C,...f},x=[...h&&u?u:a].sort(([,v],[,b])=>{const E=v.opacity!==void 0;return b.opacity!==void 0?1:E?-1:0}).map(([v,b])=>{const E=b.opacity!==void 0,T=E&&!p?b.opacity:void 0,A=d?{...b.stroke!==void 0?{stroke:E?d:l||e}:{fill:E?d:l||e}}:{};return R.createElement(v,{...b,...C,...A,opacity:T,key:b.key})});return R.createElement("svg",w,x)});_e.displayName="HugeiconsIcon";const nc=[["path",{d:"M13.9248 21H10.0752C5.44476 21 3.12955 21 2.27636 19.4939C1.42317 17.9879 2.60736 15.9914 4.97574 11.9985L6.90057 8.75333C9.17559 4.91778 10.3131 3 12 3C13.6869 3 14.8244 4.91777 17.0994 8.75332L19.0243 11.9985C21.3926 15.9914 22.5768 17.9879 21.7236 19.4939C20.8704 21 18.5552 21 13.9248 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 9V13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 16.9922V17.0022",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",key:"2"}]],K2=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],n_=[["path",{d:"M6 20L18 20",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M16 12C16 12 13.054 16 12 16C10.9459 16 8 12 8 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Y2=[["path",{d:"M17.9997 12.5C17.9997 12.5 13.5807 18.5 11.9996 18.5C10.4185 18.5 5.99966 12.5 5.99966 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.9997 5.50005C17.9997 5.50005 13.5807 11.5 11.9996 11.5C10.4185 11.5 5.99966 5.5 5.99966 5.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],n4=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],VS=[["path",{d:"M5.5 12.002H19",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],X2=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Q2=[["path",{d:"M17.9998 15C17.9998 15 13.5809 9.00001 11.9998 9C10.4187 8.99999 5.99985 15 5.99985 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],r_=[["path",{d:"M18 4L5.99997 4",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.9999 12C15.9999 12 13.054 8.00001 11.9999 8C10.9458 7.99999 7.99994 12 7.99994 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],s_=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 9H21.5",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6.99981 6H7.00879",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}],["path",{d:"M10.9998 6H11.0088",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"3"}]],r4=[["path",{d:"M16 2V6M8 2V6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 4H11C7.22876 4 5.34315 4 4.17157 5.17157C3 6.34315 3 8.22876 3 12V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V12C21 8.22876 21 6.34315 19.8284 5.17157C18.6569 4 16.7712 4 13 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 10H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M11.9955 14H12.0045M11.9955 18H12.0045M15.991 14H16M8 14H8.00897M8 18H8.00897",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"3"}]],_o=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],s4=[["path",{d:"M11 6L21 6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11 12L21 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 18L21 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M3 7.39286C3 7.39286 4 8.04466 4.5 9C4.5 9 6 5.25 8 4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M3 18.3929C3 18.3929 4 19.0447 4.5 20C4.5 20 6 16.25 8 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],i4=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12.5L10.5 15L16 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],o4=[["path",{d:"M21 3L13 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.44573 11.0854C6.96539 12.0368 4.98269 11.8736 3 11.0885C3.50059 17.531 6.50414 20.0089 10.5089 21C10.5089 21 13.5261 18.8664 13.961 13.8074C14.0081 13.2595 14.0317 12.9856 13.9178 12.6769C13.8038 12.3682 13.5802 12.1468 13.1329 11.704C12.3973 10.9757 12.0295 10.6116 11.5929 10.5204C11.1564 10.4293 10.5862 10.648 9.44573 11.0854Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M4.5 16.4464C4.5 16.4464 7 16.9286 9.5 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M8.5 7.25C8.5 7.94036 7.94036 8.5 7.25 8.5C6.55964 8.5 6 7.94036 6 7.25C6 6.55964 6.55964 6 7.25 6C7.94036 6 8.5 6.55964 8.5 7.25Z",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["path",{d:"M11 4V4.1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"4"}]],FS=[["path",{d:"M7.99994 12H8.00891M11.9955 12H12.0044M15.991 12H15.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"0"}],["path",{d:"M18 21C19.2322 21 20.231 19.8487 20.231 18.4286C20.231 16.1808 20.1312 14.6864 21.6733 12.9091C22.1089 12.407 22.1089 11.5929 21.6733 11.0908C20.1312 9.31353 20.231 7.81914 20.231 5.57141C20.231 4.15125 19.2322 2.99998 18 2.99998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6 21C4.76784 21 3.76897 19.8487 3.76897 18.4286C3.76897 16.1808 3.86877 14.6864 2.32673 12.9091C1.89109 12.407 1.89109 11.5929 2.32673 11.0908C3.83496 9.35249 3.76897 7.8399 3.76897 5.57141C3.76897 4.15125 4.76784 2.99998 6 2.99998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],s0=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 9H21.5",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6.99981 6H7.00879",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}],["path",{d:"M10.9998 6H11.0088",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"3"}],["path",{d:"M16 13L17.2265 14.0572C17.7422 14.5016 18 14.7239 18 15C18 15.2761 17.7422 15.4984 17.2265 15.9428L16 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M8 13L6.77346 14.0572C6.25782 14.5016 6 14.7239 6 15C6 15.2761 6.25782 15.4984 6.77346 15.9428L8 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M13 12L11 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]],a4=[["path",{d:"M9 15C9 12.1716 9 10.7574 9.87868 9.87868C10.7574 9 12.1716 9 15 9L16 9C18.8284 9 20.2426 9 21.1213 9.87868C22 10.7574 22 12.1716 22 15V16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15C12.1716 22 10.7574 22 9.87868 21.1213C9 20.2426 9 18.8284 9 16L9 15Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.9999 9C16.9975 6.04291 16.9528 4.51121 16.092 3.46243C15.9258 3.25989 15.7401 3.07418 15.5376 2.90796C14.4312 2 12.7875 2 9.5 2C6.21252 2 4.56878 2 3.46243 2.90796C3.25989 3.07417 3.07418 3.25989 2.90796 3.46243C2 4.56878 2 6.21252 2 9.5C2 12.7875 2 14.4312 2.90796 15.5376C3.07417 15.7401 3.25989 15.9258 3.46243 16.092C4.51121 16.9528 6.04291 16.9975 9 16.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Z2=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12H21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 7L17 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["circle",{cx:"8.25",cy:"7",r:"1.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["circle",{cx:"8.25",cy:"17",r:"1.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M13 17L17 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],ed=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],l4=[["path",{d:"M18 16L19.8398 17.5858C20.6133 18.2525 21 18.5858 21 19C21 19.4142 20.6133 19.7475 19.8398 20.4142L18 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 16L12.1602 17.5858C11.3867 18.2525 11 18.5858 11 19C11 19.4142 11.3867 19.7475 12.1602 20.4142L14 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20 13.0032L20 7.8199C20 6.12616 20 5.27929 19.732 4.60291C19.3013 3.51555 18.3902 2.65784 17.2352 2.25228C16.5168 2 15.6173 2 13.8182 2C10.6698 2 9.09563 2 7.83836 2.44148C5.81714 3.15122 4.22281 4.6522 3.46894 6.55509C3 7.73875 3 9.22077 3 12.1848L3 14.731C3 17.8013 3 19.3364 3.8477 20.4025C4.09058 20.708 4.37862 20.9792 4.70307 21.2078C5.61506 21.8506 6.85019 21.9757 9 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M3 12C3 10.159 4.49238 8.66667 6.33333 8.66667C6.99912 8.66667 7.78404 8.78333 8.43137 8.60988C9.00652 8.45576 9.45576 8.00652 9.60988 7.43136C9.78333 6.78404 9.66667 5.99912 9.66667 5.33333C9.66667 3.49238 11.1591 2 13 2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],c4=[["path",{d:"M8 7L16 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 11L12 11",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],J2=[["path",{d:"M8.85746 12.5061C6.36901 10.6456 4.59564 8.59915 3.62734 7.44867C3.3276 7.09253 3.22938 6.8319 3.17033 6.3728C2.96811 4.8008 2.86701 4.0148 3.32795 3.5074C3.7889 3 4.60404 3 6.23433 3H17.7657C19.396 3 20.2111 3 20.672 3.5074C21.133 4.0148 21.0319 4.8008 20.8297 6.37281C20.7706 6.83191 20.6724 7.09254 20.3726 7.44867C19.403 8.60062 17.6261 10.6507 15.1326 12.5135C14.907 12.6821 14.7583 12.9567 14.7307 13.2614C14.4837 15.992 14.2559 17.4876 14.1141 18.2442C13.8853 19.4657 12.1532 20.2006 11.226 20.8563C10.6741 21.2466 10.0043 20.782 9.93278 20.1778C9.79643 19.0261 9.53961 16.6864 9.25927 13.2614C9.23409 12.9539 9.08486 12.6761 8.85746 12.5061Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],os=[["path",{d:"M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}]],i_=[["path",{d:"M2.5 20V8.87695C2.5 7.58945 2.5 6.9457 2.78533 6.47048C2.9541 6.18939 3.18939 5.9541 3.47048 5.78533C3.9457 5.5 4.59449 5.5 5.89206 5.5C6.52339 5.5 6.83906 5.5 7.12612 5.58819C7.31759 5.64702 7.49914 5.73428 7.66469 5.84705C7.91289 6.01611 8.10859 6.26074 8.5 6.75C8.89141 7.23926 9.08711 7.48389 9.33531 7.65295C9.50086 7.76572 9.68241 7.85298 9.87388 7.91181C10.1609 8 10.4742 8 11.1008 8H15C16.4045 8 17.1067 8 17.6111 8.33706C17.8295 8.48298 18.017 8.67048 18.1629 8.88886C18.5 9.39331 18.5 10.0955 18.5 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4.42028 14.0144L3.63368 16.0144C2.65618 18.4998 2.16743 19.7425 2.7524 20.6213C3.33737 21.5 4.65337 21.5 7.28537 21.5H15.1903C16.4249 21.5 17.0422 21.5 17.5295 21.1795C18.0169 20.859 18.2702 20.2865 18.7769 19.1415L19.6618 17.1415C20.7866 14.5992 21.349 13.3281 20.7679 12.4141C20.1868 11.5 18.8163 11.5 16.0752 11.5H8.07196C6.78232 11.5 6.1375 11.5 5.63811 11.8439C5.13872 12.1877 4.89924 12.7966 4.42028 14.0144Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M11.5 4.51456C12.4151 3.28409 13.6662 2.55594 15.5125 2.50161C16.1155 2.48386 16.7152 2.61395 17.2682 2.85544C18.5748 3.42601 19.4185 4.15644 20 5.5L21.5 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],eE=[["path",{d:"M12 21C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 15L14 17C14.2426 15.3039 15.7368 14 17.5 14C18.6894 14 19.7402 14.5933 20.3726 15.5M22 20L21 18C20.7574 19.6961 19.2632 21 17.5 21C16.3106 21 15.2598 20.4067 14.6273 19.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],o_=[["path",{d:"M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M5 7L5 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"5",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"19",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"5",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],i0=[["path",{d:"M6 8L6 16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 16V12C18 9.17156 18 7.75735 17.1213 6.87867C16.2426 5.99999 14.8284 5.99999 12 5.99999L11 5.99999M11 5.99999C11 5.29976 12.9943 3.99152 13.5 3.49999M11 5.99999C11 6.70022 12.9943 8.00846 13.5 8.49999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"6",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"18",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],Ah=[["path",{d:"M3.88884 9.66294C4.39329 10 5.09552 10 6.49998 10C7.90445 10 8.60668 10 9.11113 9.66294C9.32951 9.51702 9.51701 9.32952 9.66292 9.11114C9.99998 8.60669 9.99998 7.90446 9.99998 6.5C9.99998 5.09554 9.99998 4.39331 9.66292 3.88886C9.51701 3.67048 9.32951 3.48298 9.11113 3.33706C8.60668 3 7.90445 3 6.49998 3C5.09552 3 4.39329 3 3.88884 3.33706C3.67046 3.48298 3.48296 3.67048 3.33705 3.88886C2.99998 4.39331 2.99998 5.09554 2.99998 6.5C2.99998 7.90446 2.99998 8.60669 3.33705 9.11114C3.48296 9.32952 3.67046 9.51702 3.88884 9.66294Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.8888 9.66294C15.3933 10 16.0955 10 17.5 10C18.9044 10 19.6067 10 20.1111 9.66294C20.3295 9.51702 20.517 9.32952 20.6629 9.11114C21 8.60669 21 7.90446 21 6.5C21 5.09554 21 4.39331 20.6629 3.88886C20.517 3.67048 20.3295 3.48298 20.1111 3.33706C19.6067 3 18.9044 3 17.5 3C16.0955 3 15.3933 3 14.8888 3.33706C14.6705 3.48298 14.483 3.67048 14.337 3.88886C14 4.39331 14 5.09554 14 6.5C14 7.90446 14 8.60669 14.337 9.11114C14.483 9.32952 14.6705 9.51702 14.8888 9.66294Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3.88884 20.6629C4.39329 21 5.09552 21 6.49998 21C7.90445 21 8.60668 21 9.11113 20.6629C9.32951 20.517 9.51701 20.3295 9.66292 20.1111C9.99998 19.6067 9.99998 18.9045 9.99998 17.5C9.99998 16.0955 9.99998 15.3933 9.66292 14.8889C9.51701 14.6705 9.32951 14.483 9.11113 14.3371C8.60668 14 7.90445 14 6.49998 14C5.09552 14 4.39329 14 3.88884 14.3371C3.67046 14.483 3.48296 14.6705 3.33705 14.8889C2.99998 15.3933 2.99998 16.0955 2.99998 17.5C2.99998 18.9045 2.99998 19.6067 3.33705 20.1111C3.48296 20.3295 3.67046 20.517 3.88884 20.6629Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.8888 20.6629C15.3933 21 16.0955 21 17.5 21C18.9044 21 19.6067 21 20.1111 20.6629C20.3295 20.517 20.517 20.3295 20.6629 20.1111C21 19.6067 21 18.9045 21 17.5C21 16.0955 21 15.3933 20.6629 14.8889C20.517 14.6705 20.3295 14.483 20.1111 14.3371C19.6067 14 18.9044 14 17.5 14C16.0955 14 15.3933 14 14.8888 14.3371C14.6705 14.483 14.483 14.6705 14.337 14.8889C14 15.3933 14 16.0955 14 17.5C14 18.9045 14 19.6067 14.337 20.1111C14.483 20.3295 14.6705 20.517 14.8888 20.6629Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],u4=[["path",{d:"M20.7104 8.70122L21.9186 12.7288C21.9578 12.8592 21.9773 12.9244 21.9879 12.9914L21.9908 13.0118C22 13.079 22 13.147 22 13.2831C22 16.7797 22 18.528 20.9812 19.6669C20.8824 19.7774 20.7774 19.8824 20.6669 19.9812C19.528 21 17.7797 21 14.2831 21H9.71685C6.22026 21 4.47197 21 3.33311 19.9812C3.22259 19.8824 3.11765 19.7774 3.01877 19.6669C2 18.528 2 16.7797 2 13.2831C2 13.147 2 13.079 2.00915 13.0118L2.01215 12.9914C2.02269 12.9244 2.04225 12.8592 2.08136 12.7288L3.28963 8.70122C4.11355 5.95484 4.5255 4.58166 5.5884 3.79083C6.6513 3 8.08495 3 10.9522 3H13.0478C15.9151 3 17.3487 3 18.4116 3.79083C19.4745 4.58166 19.8865 5.95484 20.7104 8.70122Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2 13H22",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M17.9888 17H18M13 17H13.0112",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}]],d4=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 9.5C9.5 8.11929 10.6193 7 12 7C13.3807 7 14.5 8.11929 14.5 9.5C14.5 10.3569 14.0689 11.1131 13.4117 11.5636C12.7283 12.0319 12 12.6716 12 13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.0001 17H12.009",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",key:"2"}]],f4=[["path",{d:"M3 11.9896V14.5C3 17.7998 3 19.4497 4.02513 20.4749C5.05025 21.5 6.70017 21.5 10 21.5H14C17.2998 21.5 18.9497 21.5 19.9749 20.4749C21 19.4497 21 17.7998 21 14.5V11.9896C21 10.3083 21 9.46773 20.6441 8.74005C20.2882 8.01237 19.6247 7.49628 18.2976 6.46411L16.2976 4.90855C14.2331 3.30285 13.2009 2.5 12 2.5C10.7991 2.5 9.76689 3.30285 7.70242 4.90855L5.70241 6.46411C4.37533 7.49628 3.71179 8.01237 3.3559 8.74005C3 9.46773 3 10.3083 3 11.9896Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.0002 17C14.2007 17.6224 13.1504 18 12.0002 18C10.8499 18 9.79971 17.6224 9.00018 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],h4=[["circle",{cx:"7.5",cy:"7.5",r:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 21C9.37246 15.775 14.2741 8.88406 21.4975 13.5424",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],p4=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 8.01172V8.00172",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",key:"2"}]],m4=[["path",{d:"M15.5 14.5C18.8137 14.5 21.5 11.8137 21.5 8.5C21.5 5.18629 18.8137 2.5 15.5 2.5C12.1863 2.5 9.5 5.18629 9.5 8.5C9.5 9.38041 9.68962 10.2165 10.0303 10.9697L2.5 18.5V21.5H5.5V19.5H7.5V17.5H9.5L13.0303 13.9697C13.7835 14.3104 14.6196 14.5 15.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.5 6.5L16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],g4=[["path",{d:"M11.0991 3.00012C7.45013 3.00669 5.53932 3.09629 4.31817 4.31764C3.00034 5.63568 3.00034 7.75704 3.00034 11.9997C3.00034 16.2424 3.00034 18.3638 4.31817 19.6818C5.63599 20.9999 7.75701 20.9999 11.9991 20.9999C16.241 20.9999 18.3621 20.9999 19.6799 19.6818C20.901 18.4605 20.9906 16.5493 20.9972 12.8998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M20.556 3.49612L11.0487 13.0586M20.556 3.49612C20.062 3.00151 16.7343 3.04761 16.0308 3.05762M20.556 3.49612C21.05 3.99074 21.0039 7.32273 20.9939 8.02714",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],zr=[["path",{d:"M12 3V6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 18V21",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 12L18 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6 12L3 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M18.3635 5.63672L16.2422 7.75804",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.75804 16.2422L5.63672 18.3635",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M18.3635 18.3635L16.2422 16.2422",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M7.75804 7.75804L5.63672 5.63672",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]],v4=[["path",{d:"M4 5L20 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4 12L20 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M4 19L20 19",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],_4=[["path",{d:"M3 6H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 12H13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 18H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M21 8L19.8462 8.87652C17.9487 10.318 17 11.0388 17 12C17 12.9612 17.9487 13.682 19.8462 15.1235L21 16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],y4=[["path",{d:"M15.5 8.5L12 12M12 12L8.5 15.5M12 12L15.5 15.5M12 12L8.5 8.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],a_=[["path",{d:"M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18.6461 4.52795C18.2489 4.89346 18 5.41766 18 6C18 7.10457 18.8954 8 20 8C20.3793 8 20.7339 7.89441 21.0361 7.71103C21.6139 7.36038 22 6.72527 22 6C22 4.89543 21.1046 4 20 4C19.4778 4 19.0023 4.20016 18.6461 4.52795ZM18.6461 4.52795C16.8794 2.95541 14.5513 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 11.6625 21.9833 11.3289 21.9506 11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],rc=[["path",{d:"M12 4V20M20 12H4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],b4=[["path",{d:"M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],$o=[["path",{d:"M20.0071 14.5662L19.3587 14.1731C18.7986 13.8508 18.3579 13.3564 18.102 12.7634L15.68 7.15102C15.5927 6.94865 15.4729 6.77988 15.328 6.64097C14.6876 6.02689 13.5808 6.28697 13.0432 6.99226C12.0506 8.29448 13.3839 9.52751 13.1022 10.6133L5.35908 6.26089C3.55799 5.28913 2.0024 7.87074 3.79277 9.06333L8.37607 11.6124C7.4934 12.765 5.25512 18.3551 8.12341 20.0599C8.28646 20.1568 8.4672 20.2213 8.64852 20.2773C8.76516 20.3134 8.88186 20.3496 8.99761 20.3857C9.8979 20.6667 11.6003 21.02 12.7668 20.9182C13.9811 20.8123 14.7421 21.4597 15.68 21.9995",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.36184 4.96447C9.75873 5.36011 11.4854 5.24597 12.1223 5.16653M9.36184 4.96447C8.96494 4.56883 8.95358 2.63679 9.03328 2.0019M9.36184 4.96447C10.3829 3.19624 14.4425 0.375691 18.4708 3.19624C20.4175 4.55924 20.6922 5.4182 21 5.99362",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],x4=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],tE=[["path",{d:"M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],nE=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.5 10C7.67157 10 7 9.32843 7 8.5C7 7.67157 7.67157 7 8.5 7C9.32843 7 10 7.67157 10 8.5C10 9.32843 9.32843 10 8.5 10Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.5 17C16.3284 17 17 16.3284 17 15.5C17 14.6716 16.3284 14 15.5 14C14.6716 14 14 14.6716 14 15.5C14 16.3284 14.6716 17 15.5 17Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M10 8.5L17 8.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14 15.5L7 15.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}]],o0=[["path",{d:"M14.4961 2.00027H9.49609C8.66767 2.00027 7.99609 2.67185 7.99609 3.50027C7.99609 4.3287 8.66767 5.00027 9.49609 5.00027H14.4961C15.3245 5.00027 15.9961 4.3287 15.9961 3.50027C15.9961 2.67185 15.3245 2.00027 14.4961 2.00027Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.99609 15.0003H11.4247M7.99609 11.0003H15.9961",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.9961 3.50027C17.5496 3.54709 18.4761 3.72035 19.1174 4.36164C19.9961 5.24032 19.9961 6.65451 19.9961 9.4829L19.9961 15.9997C19.9961 18.8282 19.9961 20.2424 19.1174 21.1211C18.2387 21.9997 16.8245 21.9997 13.9961 21.9997L9.99609 21.9997C7.16767 21.9997 5.75346 21.9997 4.87478 21.1211C3.9961 20.2424 3.9961 18.8282 3.99609 15.9998L3.99611 9.48296C3.9961 6.65453 3.9961 5.24031 4.87478 4.36163C5.51606 3.72034 6.44261 3.54708 7.99599 3.50027",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],zf=[["path",{d:"M14.5405 2V4.48622C14.5405 6.23417 14.5405 7.10814 14.7545 7.94715C14.9685 8.78616 15.3879 9.55654 16.2267 11.0973L17.3633 13.1852C19.5008 17.1115 20.5696 19.0747 19.6928 20.53L19.6792 20.5522C18.7896 22 16.5264 22 12 22C7.47357 22 5.21036 22 4.3208 20.5522L4.30725 20.53C3.43045 19.0747 4.49918 17.1115 6.63666 13.1852L7.7733 11.0973C8.61209 9.55654 9.03149 8.78616 9.24548 7.94715C9.45947 7.10814 9.45947 6.23417 9.45947 4.48622V2",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M9 16.002L9.00868 15.9996",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"1"}],["path",{d:"M15 18.002L15.0087 17.9996",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}],["path",{d:"M8 2L16 2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M7.5 11.5563C8.5 10.4029 10.0994 11.2343 12 12.3182C14.5 13.7439 16 12.65 16.5 11.6152",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}]],S4=[["path",{d:"M5 14.5C5 14.5 6.5 14.5 8.5 18C8.5 18 14.0588 8.83333 19 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Ma=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],C4=[["path",{d:"M18 14C18 14 13.5811 19 12 19C10.4188 19 6 14 6 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 9.99996C18 9.99996 13.5811 5.00001 12 5C10.4188 4.99999 6 10 6 10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],a0=[["path",{d:"M17.0158 16.5V21.282C17.0158 21.6025 16.8064 21.874 16.5174 21.9663M17.0158 16.5L10.8772 12M17.0158 16.5V7.5M7.74691 9.7053L4.25118 7.03035C3.85429 6.72665 3.29466 6.76425 2.94169 7.11833L2.2921 7.76997C1.89399 8.16933 1.90433 8.81995 2.31494 9.20638L5.28343 12M7.74691 9.7053L10.8772 12M7.74691 9.7053L15.8129 2.19186C15.9453 2.06854 16.1193 2 16.3 2C16.3758 2 16.4488 2.01181 16.5174 2.0337M10.8772 12L17.0158 7.5M17.0158 7.5V2.71803C17.0158 2.39749 16.8064 2.126 16.5174 2.0337M7.74691 14.2947L4.25118 16.9696C3.85429 17.2733 3.29466 17.2357 2.94169 16.8817L2.2921 16.23C1.89399 15.8307 1.90433 15.18 2.31494 14.7936L5.28343 12M7.74691 14.2947L15.8129 21.8081C15.9453 21.9315 16.1193 22 16.3 22C16.3758 22 16.4488 21.9882 16.5174 21.9663M7.74691 14.2947L5.28343 12M16.5174 2.0337L21.4111 4.23506C21.7695 4.39626 22.0001 4.75353 22.0001 5.14752V18.8525C22.0001 19.2465 21.7695 19.6037 21.4111 19.7649L16.5174 21.9663",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],l0=R.createContext(void 0);function wi(e){const t=R.useContext(l0);if(e===!1&&t===void 0)throw new Error(Pt(27));return t}let Oh=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const w4={[Oh.startingStyle]:""},E4={[Oh.endingStyle]:""},Gs={transitionStatus(e){return e==="starting"?w4:e==="ending"?E4:null}};let sa=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Oh.startingStyle]="startingStyle",e[e.endingStyle=Oh.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),l_=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const k4={[l_.popupOpen]:""},R4={[l_.popupOpen]:"",[l_.pressed]:""},T4={[sa.open]:""},L4={[sa.closed]:""},A4={[sa.anchorHidden]:""},c0={open(e){return e?k4:null}},zu={open(e){return e?R4:null}},xo={open(e){return e?T4:L4},anchorHidden(e){return e?A4:null}},O4={...xo,...Gs},rE=R.forwardRef(function(t,n){const{render:s,className:o,forceRender:u=!1,...h}=t,{store:a}=wi(),l=a.useState("open"),d=a.useState("nested"),p=a.useState("mounted"),f=a.useState("transitionStatus"),g=R.useMemo(()=>({open:l,transitionStatus:f}),[l,f]);return at("div",t,{state:g,ref:[a.context.backdropRef,n],stateAttributesMapping:O4,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},h],enabled:u||!d})}),Mn="none",pa="trigger-press",Br="trigger-hover",Mh="trigger-focus",u0="outside-press",ma="item-press",M4="close-press",US="clear-press",ia="input-change",no="input-clear",ka="focus-out",dp="escape-key",Du="list-navigation",sE="cancel-open",Ru="sibling-open",iE="imperative-action",D4="window-resize";function We(e,t,n,s){let o=!1,u=!1;const h=s??tn;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){u=!0},get isCanceled(){return o},get isPropagationAllowed(){return u},trigger:n,...h}}function yu(e,t,n){const s=n??tn;return{reason:e,event:t??new Event("base-ui"),...s}}const fp=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,...a}=t,{store:l}=wi(),d=l.useState("open");function p(C){d&&l.setOpen(!1,We(M4,C.nativeEvent))}const{getButtonProps:f,buttonRef:g}=xr({disabled:u,native:h}),S=R.useMemo(()=>({disabled:u}),[u]);return at("button",t,{state:S,ref:[n,g],props:[{onClick:p},a,f]})}),P4={...Gw};let WS=0;function I4(e,t="mui"){const[n,s]=R.useState(e),o=e||n;return R.useEffect(()=>{n==null&&(WS+=1,s(`${t}-${WS}`))},[n,t]),o}const qS=P4.useId;function Da(e,t){if(qS!==void 0){const n=qS();return e??(t?`${t}-${n}`:n)}return I4(e,t)}function ar(e){return Da(e,"base-ui")}const oE=R.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=wi(),l=ar(u);return a.useSyncedValueWithCleanup("descriptionElementId",l),at("p",t,{ref:n,props:[{id:l},h]})}),j4=[];function aE(e){R.useEffect(e,j4)}const bu=0;class Ra{static create(){return new Ra}currentId=bu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=bu,n()},t)}isStarted(){return this.currentId!==bu}clear=()=>{this.currentId!==bu&&(clearTimeout(this.currentId),this.currentId=bu)};disposeEffect=()=>this.clear}function Qt(){const e=Gn(Ra.create).current;return aE(e.disposeEffect),e}function hn(e){const t=Gn(N4,e).current;return t.next=e,Fe(t.effect),t}function N4(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Pa=typeof navigator<"u",dv=H4(),lE=F4(),d0=V4(),f0=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),B4=dv.platform==="MacIntel"&&dv.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(dv.platform),GS=Pa&&/firefox/i.test(d0),cE=Pa&&/apple/i.test(navigator.vendor),Dh=Pa&&/android/i.test(lE)||/android/i.test(d0),z4=Pa&&lE.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,uE=d0.includes("jsdom/");function H4(){if(!Pa)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function V4(){if(!Pa)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function F4(){if(!Pa)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const c_="data-base-ui-focusable",dE="active",fE="selected",hE="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ho="ArrowLeft",po="ArrowRight",h0="ArrowUp",td="ArrowDown";function _s(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ft(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Xv(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Pn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function vs(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function U4(e){return e.matches("html,body")}function dn(e){return e?.ownerDocument||document}function p0(e){return en(e)&&e.matches(hE)}function u_(e){return e?e.getAttribute("role")==="combobox"&&p0(e):!1}function W4(e){if(!e||uE)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Hu(e){return e?e.hasAttribute(c_)?e:e.querySelector(`[${c_}]`)||e:null}function ga(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...ga(e,o.id,n)])}function $S(e,t){let n=[],s=e.find(o=>o.id===t)?.parentId;for(;s;){const o=e.find(u=>u.id===s);s=o?.parentId,o&&(n=n.concat(o))}return n}function fn(e){e.preventDefault(),e.stopPropagation()}function q4(e){return"nativeEvent"in e}function pE(e){return e.mozInputSource===0&&e.isTrusted?!0:Dh&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function mE(e){return uE?!1:!Dh&&e.width===0&&e.height===0||Dh&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Ul(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function gE(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const G4=["top","right","bottom","left"],Wl=Math.min,jr=Math.max,Ph=Math.round,kl=Math.floor,Vs=e=>({x:e,y:e}),$4={left:"right",right:"left",bottom:"top",top:"bottom"},K4={start:"end",end:"start"};function d_(e,t,n){return jr(e,Wl(t,n))}function Si(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function So(e){return e.split("-")[1]}function m0(e){return e==="x"?"y":"x"}function g0(e){return e==="y"?"height":"width"}const Y4=new Set(["top","bottom"]);function rs(e){return Y4.has(Hr(e))?"y":"x"}function v0(e){return m0(rs(e))}function X4(e,t,n){n===void 0&&(n=!1);const s=So(e),o=v0(e),u=g0(o);let h=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(h=Ih(h)),[h,Ih(h)]}function Q4(e){const t=Ih(e);return[f_(e),t,f_(t)]}function f_(e){return e.replace(/start|end/g,t=>K4[t])}const KS=["left","right"],YS=["right","left"],Z4=["top","bottom"],J4=["bottom","top"];function eD(e,t,n){switch(e){case"top":case"bottom":return n?t?YS:KS:t?KS:YS;case"left":case"right":return t?Z4:J4;default:return[]}}function tD(e,t,n,s){const o=So(e);let u=eD(Hr(e),n==="start",s);return o&&(u=u.map(h=>h+"-"+o),t&&(u=u.concat(u.map(f_)))),u}function Ih(e){return e.replace(/left|right|bottom|top/g,t=>$4[t])}function nD(e){return{top:0,right:0,bottom:0,left:0,...e}}function vE(e){return typeof e!="number"?nD(e):{top:e,right:e,bottom:e,left:e}}function jh(e){const{x:t,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:t,right:t+s,bottom:n+o,x:t,y:n}}function Hf(e,t,n){return Math.floor(e/t)!==n}function Ll(e,t){return t<0||t>=e.current.length}function fh(e,t){return Wn(e,{disabledIndices:t})}function h_(e,t){return Wn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Wn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:s,amount:o=1}={}){let u=t;do u+=n?-o:o;while(u>=0&&u<=e.current.length-1&&mo(e,u,s));return u}function _E(e,{event:t,orientation:n,loopFocus:s,rtl:o,cols:u,disabledIndices:h,minIndex:a,maxIndex:l,prevIndex:d,stopEvent:p=!1}){let f=d;const g=[],S={};let C=!1;{let x=null,v=-1;e.current.forEach((b,E)=>{if(b==null)return;const T=b.closest('[role="row"]');T&&(C=!0),(T!==x||v===-1)&&(x=T,v+=1,g[v]=[]),g[v].push(E),S[E]=v})}const w=C&&g.length>0&&g.some(x=>x.length!==u);function y(x){if(!w||d===-1)return;const v=S[d];if(v==null)return;const b=g[v].indexOf(d);let E=x==="up"?v-1:v+1;s&&(E<0?E=g.length-1:E>=g.length&&(E=0));const T=new Set;for(;E>=0&&E<g.length&&!T.has(E);){T.add(E);const A=g[E];if(A.length===0){E=x==="up"?E-1:E+1;continue}const M=Math.min(b,A.length-1);for(let L=M;L>=0;L-=1){const D=A[L];if(!mo(e,D,h))return D}E=x==="up"?E-1:E+1,s&&(E<0?E=g.length-1:E>=g.length&&(E=0))}}if(t.key===h0){const x=y("up");if(x!==void 0)p&&fn(t),f=x;else{if(p&&fn(t),d===-1)f=l;else if(f=Wn(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:h}),s&&(d-u<a||f<0)){const v=d%u,b=l%u,E=l-(b-v);b===v?f=l:f=b>v?E:E-u}Ll(e,f)&&(f=d)}}if(t.key===td){const x=y("down");x!==void 0?(p&&fn(t),f=x):(p&&fn(t),d===-1?f=a:(f=Wn(e,{startingIndex:d,amount:u,disabledIndices:h}),s&&d+u>l&&(f=Wn(e,{startingIndex:d%u-u,amount:u,disabledIndices:h}))),Ll(e,f)&&(f=d))}if(n==="both"){const x=kl(d/u);t.key===(o?ho:po)&&(p&&fn(t),d%u!==u-1?(f=Wn(e,{startingIndex:d,disabledIndices:h}),s&&Hf(f,u,x)&&(f=Wn(e,{startingIndex:d-d%u-1,disabledIndices:h}))):s&&(f=Wn(e,{startingIndex:d-d%u-1,disabledIndices:h})),Hf(f,u,x)&&(f=d)),t.key===(o?po:ho)&&(p&&fn(t),d%u!==0?(f=Wn(e,{startingIndex:d,decrement:!0,disabledIndices:h}),s&&Hf(f,u,x)&&(f=Wn(e,{startingIndex:d+(u-d%u),decrement:!0,disabledIndices:h}))):s&&(f=Wn(e,{startingIndex:d+(u-d%u),decrement:!0,disabledIndices:h})),Hf(f,u,x)&&(f=d));const v=kl(l/u)===x;Ll(e,f)&&(s&&v?f=t.key===(o?po:ho)?l:Wn(e,{startingIndex:d-d%u-1,disabledIndices:h}):f=d)}return f}function yE(e,t,n){const s=[];let o=0;return e.forEach(({width:u,height:h},a)=>{let l=!1;for(n&&(o=0);!l;){const d=[];for(let p=0;p<u;p+=1)for(let f=0;f<h;f+=1)d.push(o+p+f*t);o%t+u<=t&&d.every(p=>s[p]==null)?(d.forEach(p=>{s[p]=a}),l=!0):o+=1}}),[...s]}function bE(e,t,n,s,o){if(e===-1)return-1;const u=n.indexOf(e),h=t[e];switch(o){case"tl":return u;case"tr":return h?u+h.width-1:u;case"bl":return h?u+(h.height-1)*s:u;case"br":return n.lastIndexOf(e);default:return-1}}function xE(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function mo(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}var rD=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Nh=rD.join(","),SE=typeof Element>"u",ql=SE?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Bh=!SE&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Vu=function(t,n){var s;n===void 0&&(n=!0);var o=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),u=o===""||o==="true",h=u||n&&t&&Vu(t.parentNode);return h},sD=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},CE=function(t,n,s){if(Vu(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Nh));return n&&ql.call(t,Nh)&&o.unshift(t),o=o.filter(s),o},zh=function(t,n,s){for(var o=[],u=Array.from(t);u.length;){var h=u.shift();if(!Vu(h,!1))if(h.tagName==="SLOT"){var a=h.assignedElements(),l=a.length?a:h.children,d=zh(l,!0,s);s.flatten?o.push.apply(o,d):o.push({scopeParent:h,candidates:d})}else{var p=ql.call(h,Nh);p&&s.filter(h)&&(n||!t.includes(h))&&o.push(h);var f=h.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(h),g=!Vu(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(h));if(f&&g){var S=zh(f===!0?h.children:f.children,!0,s);s.flatten?o.push.apply(o,S):o.push({scopeParent:h,candidates:S})}else u.unshift.apply(u,h.children)}}return o},wE=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},EE=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||sD(t))&&!wE(t)?0:t.tabIndex},iD=function(t,n){var s=EE(t);return s<0&&n&&!wE(t)?0:s},oD=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},kE=function(t){return t.tagName==="INPUT"},aD=function(t){return kE(t)&&t.type==="hidden"},lD=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},cD=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},uD=function(t){if(!t.name)return!0;var n=t.form||Bh(t),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=s(window.CSS.escape(t.name));else try{o=s(t.name)}catch(h){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",h.message),!1}var u=cD(o,t.form);return!u||u===t},dD=function(t){return kE(t)&&t.type==="radio"},fD=function(t){return dD(t)&&!uD(t)},hD=function(t){var n,s=t&&Bh(t),o=(n=s)===null||n===void 0?void 0:n.host,u=!1;if(s&&s!==t){var h,a,l;for(u=!!((h=o)!==null&&h!==void 0&&(a=h.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!u&&o;){var d,p,f;s=Bh(o),o=(d=s)===null||d===void 0?void 0:d.host,u=!!((p=o)!==null&&p!==void 0&&(f=p.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return u},XS=function(t){var n=t.getBoundingClientRect(),s=n.width,o=n.height;return s===0&&o===0},pD=function(t,n){var s=n.displayCheck,o=n.getShadowRoot;if(s==="full-native"&&"checkVisibility"in t){var u=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!u}if(getComputedStyle(t).visibility==="hidden")return!0;var h=ql.call(t,"details>summary:first-of-type"),a=h?t.parentElement:t;if(ql.call(a,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var d=t.parentElement,p=Bh(t);if(d&&!d.shadowRoot&&o(d)===!0)return XS(t);t.assignedSlot?t=t.assignedSlot:!d&&p!==t.ownerDocument?t=p.host:t=d}t=l}if(hD(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return XS(t);return!1},mD=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var o=n.children.item(s);if(o.tagName==="LEGEND")return ql.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},p_=function(t,n){return!(n.disabled||Vu(n)||aD(n)||pD(n,t)||lD(n)||mD(n))},m_=function(t,n){return!(fD(n)||EE(n)<0||!p_(t,n))},gD=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},RE=function(t){var n=[],s=[];return t.forEach(function(o,u){var h=!!o.scopeParent,a=h?o.scopeParent:o,l=iD(a,h),d=h?RE(o.candidates):a;l===0?h?n.push.apply(n,d):n.push(a):s.push({documentOrder:u,tabIndex:l,item:o,isScope:h,content:d})}),s.sort(oD).reduce(function(o,u){return u.isScope?o.push.apply(o,u.content):o.push(u.content),o},[]).concat(n)},nd=function(t,n){n=n||{};var s;return n.getShadowRoot?s=zh([t],n.includeContainer,{filter:m_.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:gD}):s=CE(t,n.includeContainer,m_.bind(null,n)),RE(s)},vD=function(t,n){n=n||{};var s;return n.getShadowRoot?s=zh([t],n.includeContainer,{filter:p_.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=CE(t,n.includeContainer,p_.bind(null,n)),s},TE=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ql.call(t,Nh)===!1?!1:m_(n,t)};const sc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function LE(e,t){const n=nd(e,sc()),s=n.length;if(s===0)return;const o=_s(dn(e)),u=n.indexOf(o),h=u===-1?t===1?0:s-1:u+t;return n[h]}function _0(e){return LE(dn(e).body,1)||e}function AE(e){return LE(dn(e).body,-1)||e}function OE(e,t){if(!e)return null;const n=nd(dn(e).body,sc()),s=n.length;if(s===0)return null;const o=n.indexOf(e);if(o===-1)return null;const u=(o+t+s)%s;return n[u]}function _D(e){return OE(e,1)}function yD(e){return OE(e,-1)}function Al(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!ft(n,s)}function bD(e){nd(e,sc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function QS(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function ME(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class y0{nodesRef={current:[]};events=ME();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(s=>s===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const DE=R.createContext(null),PE=R.createContext(null),Ei=()=>R.useContext(DE)?.id||null,Co=e=>{const t=R.useContext(PE);return e??t};function IE(e){const t=Da(),n=Co(e),s=Ei();return Fe(()=>{if(!t)return;const o={id:t,parentId:s};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,s]),t}function xD(e){const{children:t,id:n}=e,s=Ei();return _.jsx(DE.Provider,{value:R.useMemo(()=>({id:n,parentId:s}),[n,s]),children:t})}function SD(e){const{children:t,externalTree:n}=e,s=Gn(()=>n??new y0).current;return _.jsx(PE.Provider,{value:s,children:t})}function Gl(e){return`data-base-ui-${e}`}function fv(e,t,n){if(n&&!Ul(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const s=e();return typeof s=="number"?s:s?.[t]}return e?.[t]}const ic={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Vf=null;class CD{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ff=new CD;class Ns{static create(){return new Ns}static request(t){return Ff.request(t)}static cancel(t){return Ff.cancel(t)}currentId=Vf;request(t){this.cancel(),this.currentId=Ff.request(()=>{this.currentId=Vf,t()})}cancel=()=>{this.currentId!==Vf&&(Ff.cancel(this.currentId),this.currentId=Vf)};disposeEffect=()=>this.cancel}function rd(){const e=Gn(Ns.create).current;return aE(e.disposeEffect),e}function br(e){return e?.ownerDocument||document}const $l=R.forwardRef(function(t,n){const[s,o]=R.useState();Fe(()=>{cE&&o("button")},[]);const u={tabIndex:0,role:s};return _.jsx("span",{...t,ref:n,style:ic,"aria-hidden":s?void 0:!0,...u,"data-base-ui-focus-guard":""})});let ZS=0;function hh(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:o=!1}=t;s&&cancelAnimationFrame(ZS);const u=()=>e?.focus({preventScroll:n});o?u():ZS=requestAnimationFrame(u)}const Ol={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function JS(e){return e==="inert"?Ol.inert:e==="aria-hidden"?Ol["aria-hidden"]:Ol.none}let Uf=new WeakSet,Wf={},hv=0;const jE=e=>e&&(e.host||jE(e.parentNode)),wD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=jE(n);return e.contains(s)?s:null}).filter(n=>n!=null);function ED(e,t,n,s){const o="data-base-ui-inert",u=s?"inert":n?"aria-hidden":null,h=wD(t,e),a=new Set,l=new Set(h),d=[];Wf[o]||(Wf[o]=new WeakMap);const p=Wf[o];h.forEach(f),g(t),a.clear();function f(S){!S||a.has(S)||(a.add(S),S.parentNode&&f(S.parentNode))}function g(S){!S||l.has(S)||[].forEach.call(S.children,C=>{if(bo(C)!=="script")if(a.has(C))g(C);else{const w=u?C.getAttribute(u):null,y=w!==null&&w!=="false",x=JS(u),v=(x.get(C)||0)+1,b=(p.get(C)||0)+1;x.set(C,v),p.set(C,b),d.push(C),v===1&&y&&Uf.add(C),b===1&&C.setAttribute(o,""),!y&&u&&C.setAttribute(u,u==="inert"?"":"true")}})}return hv+=1,()=>{d.forEach(S=>{const C=JS(u),y=(C.get(S)||0)-1,x=(p.get(S)||0)-1;C.set(S,y),p.set(S,x),y||(!Uf.has(S)&&u&&S.removeAttribute(u),Uf.delete(S)),x||S.removeAttribute(o)}),hv-=1,hv||(Ol.inert=new WeakMap,Ol["aria-hidden"]=new WeakMap,Ol.none=new WeakMap,Uf=new WeakSet,Wf={})}}function kD(e,t=!1,n=!1){const s=dn(e[0]).body;return ED(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const NE=R.createContext(null),BE=()=>R.useContext(NE),RD=Gl("portal");function TD(e={}){const{ref:t,container:n,componentProps:s=tn,elementProps:o,elementState:u}=e,h=Da(),l=BE()?.portalNode,[d,p]=R.useState(null),[f,g]=R.useState(null),S=R.useRef(null);Fe(()=>{if(n===null){S.current&&(S.current=null,g(null),p(null));return}if(h==null)return;const y=(n&&(Z_(n)?n:n.current))??l??document.body;if(y==null){S.current&&(S.current=null,g(null),p(null));return}S.current!==y&&(S.current=y,g(null),p(y))},[n,l,h]);const C=at("div",s,{ref:[t,g],state:u,props:[{id:h,[RD]:""},o]});return{portalNode:f,portalSubtree:d&&C?er.createPortal(C,d):null}}const hp=R.forwardRef(function(t,n){const{children:s,container:o,className:u,render:h,renderGuards:a,...l}=t,{portalNode:d,portalSubtree:p}=TD({container:o,ref:n,componentProps:t,elementProps:l}),f=R.useRef(null),g=R.useRef(null),S=R.useRef(null),C=R.useRef(null),[w,y]=R.useState(null),x=w?.modal,v=w?.open,b=typeof a=="boolean"?a:!!w&&!w.modal&&w.open&&!!d;R.useEffect(()=>{if(!d||x)return;function T(A){d&&Al(A)&&(A.type==="focusin"?QS:bD)(d)}return d.addEventListener("focusin",T,!0),d.addEventListener("focusout",T,!0),()=>{d.removeEventListener("focusin",T,!0),d.removeEventListener("focusout",T,!0)}},[d,x]),R.useEffect(()=>{!d||v||QS(d)},[v,d]);const E=R.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:S,afterInsideRef:C,portalNode:d,setFocusManagerState:y}),[d]);return _.jsxs(R.Fragment,{children:[p,_.jsxs(NE.Provider,{value:E,children:[b&&d&&_.jsx($l,{"data-type":"outside",ref:f,onFocus:T=>{if(Al(T,d))S.current?.focus();else{const A=w?w.domReference:null;AE(A)?.focus()}}}),b&&d&&_.jsx("span",{"aria-owns":d.id,style:aM}),d&&er.createPortal(s,d),b&&d&&_.jsx($l,{"data-type":"outside",ref:g,onFocus:T=>{if(Al(T,d))C.current?.focus();else{const A=w?w.domReference:null;_0(A)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,We(ka,T.nativeEvent))}}})]})]})});function Qo(e){return e==null?e:"current"in e?e.current:e}function LD(e,t){const n=kn(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const eC=20;let io=[];function b0(){io=io.filter(e=>e.isConnected)}function AD(e){b0(),e&&bo(e)!=="body"&&(io.push(e),io.length>eC&&(io=io.slice(-eC)))}function pv(){return b0(),io[io.length-1]}function OD(e){if(!e)return null;const t=sc();return TE(e,t)?e:nd(e,t)[0]||e}function MD(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Vr(e).display!=="none"}function tC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=sc(),o=vD(e,n).filter(h=>{const a=h.getAttribute("data-tabindex")||"";return TE(h,n)||h.hasAttribute("data-tabindex")&&!a.startsWith("-")}),u=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?u!=="0"&&e.setAttribute("tabindex","0"):(u!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function pp(e){const{context:t,children:n,disabled:s=!1,order:o=["content"],initialFocus:u=!0,returnFocus:h=!0,restoreFocus:a=!1,modal:l=!0,closeOnFocusOut:d=!0,openInteractionType:p="",getInsideElements:f=()=>[],nextFocusableElement:g,previousFocusableElement:S,beforeContentFocusGuardRef:C,externalTree:w}=e,y="rootStore"in t?t.rootStore:t,x=y.useState("open"),v=y.useState("domReferenceElement"),b=y.useState("floatingElement"),{events:E,dataRef:T}=y.context,A=Pe(()=>T.current.floatingContext?.nodeId),M=Pe(f),L=u===!1,D=u_(v)&&L,H=hn(o),z=hn(u),q=hn(h),j=hn(p),K=Co(w),$=BE(),F=R.useRef(null),G=R.useRef(null),U=R.useRef(!1),P=R.useRef(!1),B=R.useRef(!1),I=R.useRef(-1),W=R.useRef(""),Y=R.useRef(""),J=Qt(),Z=Qt(),ee=rd(),X=$!=null,V=Hu(b),se=Pe((he=V)=>he?nd(he,sc()):[]),ne=Pe(he=>{const de=se(he);return H.current.map(()=>de).filter(Boolean).flat()});R.useEffect(()=>{if(s||!l)return;function he(Ne){Ne.key==="Tab"&&ft(V,_s(dn(V)))&&se().length===0&&!D&&fn(Ne)}const de=dn(V);return de.addEventListener("keydown",he),()=>{de.removeEventListener("keydown",he)}},[s,v,V,l,H,D,se,ne]),R.useEffect(()=>{if(s||!b)return;function he(de){const Ne=Pn(de),Ae=se().indexOf(Ne);Ae!==-1&&(I.current=Ae)}return b.addEventListener("focusin",he),()=>{b.removeEventListener("focusin",he)}},[s,b,se]),R.useEffect(()=>{if(s||!x)return;const he=dn(V);function de(){B.current=!1}function Ne(Ae){const be=Pn(Ae),Oe=ft(b,be)||ft(v,be)||ft($?.portalNode,be);B.current=!Oe,Y.current=Ae.pointerType||"keyboard"}function Me(){Y.current="keyboard"}return he.addEventListener("pointerdown",Ne,!0),he.addEventListener("pointerup",de,!0),he.addEventListener("pointercancel",de,!0),he.addEventListener("keydown",Me,!0),()=>{he.removeEventListener("pointerdown",Ne,!0),he.removeEventListener("pointerup",de,!0),he.removeEventListener("pointercancel",de,!0),he.removeEventListener("keydown",Me,!0)}},[s,b,v,V,x,$]),R.useEffect(()=>{if(s||!d)return;function he(){P.current=!0,Z.start(0,()=>{P.current=!1})}function de(be){const Oe=be.relatedTarget,me=be.currentTarget,ke=Pn(be);queueMicrotask(()=>{const Ce=A(),qe=y.context.triggerElements,De=!(ft(v,Oe)||ft(b,Oe)||ft(Oe,b)||ft($?.portalNode,Oe)||Oe!=null&&qe.hasElement(Oe)||qe.hasMatchingElement(Ie=>ft(Ie,Oe))||Oe?.hasAttribute(Gl("focus-guard"))||K&&(ga(K.nodesRef.current,Ce).find(Ie=>ft(Ie.context?.elements.floating,Oe)||ft(Ie.context?.elements.domReference,Oe))||$S(K.nodesRef.current,Ce).find(Ie=>[Ie.context?.elements.floating,Hu(Ie.context?.elements.floating)].includes(Oe)||Ie.context?.elements.domReference===Oe)));if(me===v&&V&&tC(V,H),a&&me!==v&&!MD(ke)&&_s(dn(V))===dn(V).body){if(en(V)&&(V.focus(),a==="popup")){ee.request(()=>{V.focus()});return}const Ie=I.current,rt=se(),et=rt[Ie]||rt[rt.length-1]||V;en(et)&&et.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(D||!l)&&Oe&&De&&!P.current&&(D||Oe!==pv())&&(U.current=!0,y.setOpen(!1,We(ka,be)))})}function Ne(){B.current||(T.current.insideReactTree=!0,J.start(0,()=>{T.current.insideReactTree=!1}))}const Me=en(v)?v:null,Ae=[];if(!(!b&&!Me))return Me&&(Me.addEventListener("focusout",de),Me.addEventListener("pointerdown",he),Ae.push(()=>{Me.removeEventListener("focusout",de),Me.removeEventListener("pointerdown",he)})),b&&(b.addEventListener("focusout",de),$&&(b.addEventListener("focusout",Ne,!0),Ae.push(()=>{b.removeEventListener("focusout",Ne,!0)})),Ae.push(()=>{b.removeEventListener("focusout",de)})),()=>{Ae.forEach(be=>{be()})}},[s,v,b,V,l,K,$,y,d,a,se,D,A,H,T,J,Z,ee]);const re=R.useRef(null),oe=R.useRef(null),le=cs(re,C,$?.beforeInsideRef),ve=cs(oe,$?.afterInsideRef);R.useEffect(()=>{if(s||!b||!x)return;const he=Array.from($?.portalNode?.querySelectorAll(`[${Gl("portal")}]`)||[]),Ne=(K?$S(K.nodesRef.current,A()):[]).find(be=>u_(be.context?.elements.domReference||null))?.context?.elements.domReference,Me=[b,Ne,...he,...M(),F.current,G.current,re.current,oe.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,Qo(S),Qo(g),D?v:null].filter(be=>be!=null),Ae=kD(Me,l||D);return()=>{Ae()}},[x,s,v,b,l,H,$,D,K,A,M,g,S]),Fe(()=>{if(!x||s||!en(V))return;const he=dn(V),de=_s(he);queueMicrotask(()=>{const Ne=ne(V),Me=z.current,Ae=typeof Me=="function"?Me(j.current||""):Me;if(Ae===void 0||Ae===!1)return;let be;Ae===!0||Ae===null?be=Ne[0]||V:be=Qo(Ae),be=be||Ne[0]||V,!ft(V,de)&&hh(be,{preventScroll:be===V})})},[s,x,V,L,ne,z,j]),Fe(()=>{if(s||!V)return;const he=dn(V),de=_s(he);AD(de);function Ne(be){if(be.open||(W.current=LD(be.nativeEvent,Y.current)),be.reason===Br&&be.nativeEvent.type==="mouseleave"&&(U.current=!0),be.reason===u0)if(be.nested)U.current=!1;else if(pE(be.nativeEvent)||mE(be.nativeEvent))U.current=!1;else{let Oe=!1;document.createElement("div").focus({get preventScroll(){return Oe=!0,!1}}),Oe?U.current=!1:U.current=!0}}E.on("openchange",Ne);const Me=he.createElement("span");Me.setAttribute("tabindex","-1"),Me.setAttribute("aria-hidden","true"),Object.assign(Me.style,ic),X&&v&&v.insertAdjacentElement("afterend",Me);function Ae(){const be=q.current;let Oe=typeof be=="function"?be(W.current):be;if(Oe===void 0||Oe===!1)return null;if(Oe===null&&(Oe=!0),typeof Oe=="boolean"){const ke=v||pv();return ke&&ke.isConnected?ke:Me}const me=v||pv()||Me;return Qo(Oe)||me}return()=>{E.off("openchange",Ne);const be=_s(he),Oe=ft(b,be)||K&&ga(K.nodesRef.current,A(),!1).some(ke=>ft(ke.context?.elements.floating,be)),me=Ae();queueMicrotask(()=>{const ke=OD(me),Ce=typeof q.current!="boolean";q.current&&!U.current&&en(ke)&&(!(!Ce&&ke!==be&&be!==he.body)||Oe)&&ke.focus({preventScroll:!0}),Me.remove()})}},[s,b,V,q,T,E,K,X,v,A]),R.useEffect(()=>{queueMicrotask(()=>{U.current=!1})},[s]),R.useEffect(()=>{if(s||!x)return;function he(Ne){Pn(Ne)?.closest(`[${D2}]`)&&(P.current=!0)}const de=dn(V);return de.addEventListener("pointerdown",he,!0),()=>{de.removeEventListener("pointerdown",he,!0)}},[s,x,V]),Fe(()=>{if(!s&&$)return $.setFocusManagerState({modal:l,closeOnFocusOut:d,open:x,onOpenChange:y.setOpen,domReference:v}),()=>{$.setFocusManagerState(null)}},[s,$,l,x,y,d,v]),Fe(()=>{if(!(s||!V))return tC(V,H),()=>{queueMicrotask(b0)}},[s,V,H]);const ue=!s&&(l?!D:!0)&&(X||l);return _.jsxs(R.Fragment,{children:[ue&&_.jsx($l,{"data-type":"inside",ref:le,onFocus:he=>{if(l){const de=ne();hh(de[de.length-1])}else $?.portalNode&&(U.current=!1,Al(he,$.portalNode)?_0(v)?.focus():Qo(S??$.beforeOutsideRef)?.focus())}}),n,ue&&_.jsx($l,{"data-type":"inside",ref:ve,onFocus:he=>{l?hh(ne()[0]):$?.portalNode&&(d&&(U.current=!0),Al(he,$.portalNode)?AE(v)?.focus():Qo(g??$.afterOutsideRef)?.focus())}})]})}function sd(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.context.dataRef,{enabled:o=!0,event:u="click",toggle:h=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:d=0}=t,p=R.useRef(void 0),f=rd(),g=Qt(),S=R.useMemo(()=>({onPointerDown(C){p.current=C.pointerType},onMouseDown(C){const w=p.current,y=C.nativeEvent,x=n.select("open");if(C.button!==0||u==="click"||Ul(w,!0)&&a)return;const v=s.current.openEvent,b=v?.type,E=n.select("domReferenceElement")!==C.currentTarget,T=x&&E||!(x&&h&&(!(v&&l)||b==="click"||b==="mousedown"));if(p0(y.target)){const M=We(pa,y,y.target);T&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,M)}):n.setOpen(T,M);return}const A=C.currentTarget;f.request(()=>{const M=We(pa,y,A);T&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,M)}):n.setOpen(T,M)})},onClick(C){if(u==="mousedown-only")return;const w=p.current;if(u==="mousedown"&&w){p.current=void 0;return}if(Ul(w,!0)&&a)return;const y=n.select("open"),x=s.current.openEvent,v=n.select("domReferenceElement")!==C.currentTarget,b=y&&v||!(y&&h&&(!(x&&l)||gE(x))),E=We(pa,C.nativeEvent,C.currentTarget);b&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,E)}):n.setOpen(b,E)},onKeyDown(){p.current=void 0}}),[s,u,a,n,l,h,f,g,d]);return R.useMemo(()=>o?{reference:S}:tn,[o,S])}function nC(e,t,n){let{reference:s,floating:o}=e;const u=rs(t),h=v0(t),a=g0(h),l=Hr(t),d=u==="y",p=s.x+s.width/2-o.width/2,f=s.y+s.height/2-o.height/2,g=s[a]/2-o[a]/2;let S;switch(l){case"top":S={x:p,y:s.y-o.height};break;case"bottom":S={x:p,y:s.y+s.height};break;case"right":S={x:s.x+s.width,y:f};break;case"left":S={x:s.x-o.width,y:f};break;default:S={x:s.x,y:s.y}}switch(So(t)){case"start":S[h]-=g*(n&&d?-1:1);break;case"end":S[h]+=g*(n&&d?-1:1);break}return S}const DD=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:h}=n,a=u.filter(Boolean),l=await(h.isRTL==null?void 0:h.isRTL(t));let d=await h.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=nC(d,s,l),g=s,S={},C=0;for(let w=0;w<a.length;w++){const{name:y,fn:x}=a[w],{x:v,y:b,data:E,reset:T}=await x({x:p,y:f,initialPlacement:s,placement:g,strategy:o,middlewareData:S,rects:d,platform:h,elements:{reference:e,floating:t}});p=v??p,f=b??f,S={...S,[y]:{...S[y],...E}},T&&C<=50&&(C++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(d=T.rects===!0?await h.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:p,y:f}=nC(d,g,l)),w=-1)}return{x:p,y:f,placement:g,strategy:o,middlewareData:S}};async function Fu(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:u,rects:h,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:g=!1,padding:S=0}=Si(t,e),C=vE(S),y=a[g?f==="floating"?"reference":"floating":f],x=jh(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(y)))==null||n?y:y.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(a.floating)),boundary:d,rootBoundary:p,strategy:l})),v=f==="floating"?{x:s,y:o,width:h.floating.width,height:h.floating.height}:h.reference,b=await(u.getOffsetParent==null?void 0:u.getOffsetParent(a.floating)),E=await(u.isElement==null?void 0:u.isElement(b))?await(u.getScale==null?void 0:u.getScale(b))||{x:1,y:1}:{x:1,y:1},T=jh(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(x.top-T.top+C.top)/E.y,bottom:(T.bottom-x.bottom+C.bottom)/E.y,left:(x.left-T.left+C.left)/E.x,right:(T.right-x.right+C.right)/E.x}}const PD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:o,middlewareData:u,rects:h,initialPlacement:a,platform:l,elements:d}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:w=!0,...y}=Si(e,t);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const x=Hr(o),v=rs(a),b=Hr(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(d.floating)),T=g||(b||!w?[Ih(a)]:Q4(a)),A=C!=="none";!g&&A&&T.push(...tD(a,w,C,E));const M=[a,...T],L=await Fu(t,y),D=[];let H=((s=u.flip)==null?void 0:s.overflows)||[];if(p&&D.push(L[x]),f){const K=X4(o,h,E);D.push(L[K[0]],L[K[1]])}if(H=[...H,{placement:o,overflows:D}],!D.every(K=>K<=0)){var z,q;const K=(((z=u.flip)==null?void 0:z.index)||0)+1,$=M[K];if($&&(!(f==="alignment"?v!==rs($):!1)||H.every(U=>rs(U.placement)===v?U.overflows[0]>0:!0)))return{data:{index:K,overflows:H},reset:{placement:$}};let F=(q=H.filter(G=>G.overflows[0]<=0).sort((G,U)=>G.overflows[1]-U.overflows[1])[0])==null?void 0:q.placement;if(!F)switch(S){case"bestFit":{var j;const G=(j=H.filter(U=>{if(A){const P=rs(U.placement);return P===v||P==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(P=>P>0).reduce((P,B)=>P+B,0)]).sort((U,P)=>U[1]-P[1])[0])==null?void 0:j[0];G&&(F=G);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function rC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sC(e){return G4.some(t=>e[t]>=0)}const ID=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...o}=Si(e,t);switch(s){case"referenceHidden":{const u=await Fu(t,{...o,elementContext:"reference"}),h=rC(u,n.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:sC(h)}}}case"escaped":{const u=await Fu(t,{...o,altBoundary:!0}),h=rC(u,n.floating);return{data:{escapedOffsets:h,escaped:sC(h)}}}default:return{}}}}},zE=new Set(["left","top"]);async function jD(e,t){const{placement:n,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),h=Hr(n),a=So(n),l=rs(n)==="y",d=zE.has(h)?-1:1,p=u&&l?-1:1,f=Si(t,e);let{mainAxis:g,crossAxis:S,alignmentAxis:C}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof C=="number"&&(S=a==="end"?C*-1:C),l?{x:S*p,y:g*d}:{x:g*d,y:S*p}}const ND=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:o,y:u,placement:h,middlewareData:a}=t,l=await jD(t,e);return h===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:o+l.x,y:u+l.y,data:{...l,placement:h}}}}},BD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:o}=t,{mainAxis:u=!0,crossAxis:h=!1,limiter:a={fn:y=>{let{x,y:v}=y;return{x,y:v}}},...l}=Si(e,t),d={x:n,y:s},p=await Fu(t,l),f=rs(Hr(o)),g=m0(f);let S=d[g],C=d[f];if(u){const y=g==="y"?"top":"left",x=g==="y"?"bottom":"right",v=S+p[y],b=S-p[x];S=d_(v,S,b)}if(h){const y=f==="y"?"top":"left",x=f==="y"?"bottom":"right",v=C+p[y],b=C-p[x];C=d_(v,C,b)}const w=a.fn({...t,[g]:S,[f]:C});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[g]:u,[f]:h}}}}}},zD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:o,rects:u,middlewareData:h}=t,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=Si(e,t),p={x:n,y:s},f=rs(o),g=m0(f);let S=p[g],C=p[f];const w=Si(a,t),y=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const b=g==="y"?"height":"width",E=u.reference[g]-u.floating[b]+y.mainAxis,T=u.reference[g]+u.reference[b]-y.mainAxis;S<E?S=E:S>T&&(S=T)}if(d){var x,v;const b=g==="y"?"width":"height",E=zE.has(Hr(o)),T=u.reference[f]-u.floating[b]+(E&&((x=h.offset)==null?void 0:x[f])||0)+(E?0:y.crossAxis),A=u.reference[f]+u.reference[b]+(E?0:((v=h.offset)==null?void 0:v[f])||0)-(E?y.crossAxis:0);C<T?C=T:C>A&&(C=A)}return{[g]:S,[f]:C}}}},HD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:o,rects:u,platform:h,elements:a}=t,{apply:l=()=>{},...d}=Si(e,t),p=await Fu(t,d),f=Hr(o),g=So(o),S=rs(o)==="y",{width:C,height:w}=u.floating;let y,x;f==="top"||f==="bottom"?(y=f,x=g===(await(h.isRTL==null?void 0:h.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,y=g==="end"?"top":"bottom");const v=w-p.top-p.bottom,b=C-p.left-p.right,E=Wl(w-p[y],v),T=Wl(C-p[x],b),A=!t.middlewareData.shift;let M=E,L=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=b),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(M=v),A&&!g){const H=jr(p.left,0),z=jr(p.right,0),q=jr(p.top,0),j=jr(p.bottom,0);S?L=C-2*(H!==0||z!==0?H+z:jr(p.left,p.right)):M=w-2*(q!==0||j!==0?q+j:jr(p.top,p.bottom))}await l({...t,availableWidth:L,availableHeight:M});const D=await h.getDimensions(a.floating);return C!==D.width||w!==D.height?{reset:{rects:!0}}:{}}}};function HE(e){const t=Vr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=en(e),u=o?e.offsetWidth:n,h=o?e.offsetHeight:s,a=Ph(n)!==u||Ph(s)!==h;return a&&(n=u,s=h),{width:n,height:s,$:a}}function x0(e){return Nt(e)?e:e.contextElement}function Ml(e){const t=x0(e);if(!en(t))return Vs(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:u}=HE(t);let h=(u?Ph(n.width):n.width)/s,a=(u?Ph(n.height):n.height)/o;return(!h||!Number.isFinite(h))&&(h=1),(!a||!Number.isFinite(a))&&(a=1),{x:h,y:a}}const VD=Vs(0);function VE(e){const t=kn(e);return!cp()||!t.visualViewport?VD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==kn(e)?!1:t}function Ta(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),u=x0(e);let h=Vs(1);t&&(s?Nt(s)&&(h=Ml(s)):h=Ml(e));const a=FD(u,n,s)?VE(u):Vs(0);let l=(o.left+a.x)/h.x,d=(o.top+a.y)/h.y,p=o.width/h.x,f=o.height/h.y;if(u){const g=kn(u),S=s&&Nt(s)?kn(s):s;let C=g,w=Qv(C);for(;w&&s&&S!==C;){const y=Ml(w),x=w.getBoundingClientRect(),v=Vr(w),b=x.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,E=x.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,d*=y.y,p*=y.x,f*=y.y,l+=b,d+=E,C=kn(w),w=Qv(C)}}return jh({width:p,height:f,x:l,y:d})}function mp(e,t){const n=up(e).scrollLeft;return t?t.left+n:Ta(qs(e)).left+n}function FE(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-mp(e,n),o=n.top+t.scrollTop;return{x:s,y:o}}function UD(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const u=o==="fixed",h=qs(s),a=t?lp(t.floating):!1;if(s===h||a&&u)return n;let l={scrollLeft:0,scrollTop:0},d=Vs(1);const p=Vs(0),f=en(s);if((f||!f&&!u)&&((bo(s)!=="body"||Aa(h))&&(l=up(s)),en(s))){const S=Ta(s);d=Ml(s),p.x=S.x+s.clientLeft,p.y=S.y+s.clientTop}const g=h&&!f&&!u?FE(h,l):Vs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+p.x+g.x,y:n.y*d.y-l.scrollTop*d.y+p.y+g.y}}function WD(e){return Array.from(e.getClientRects())}function qD(e){const t=qs(e),n=up(e),s=e.ownerDocument.body,o=jr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=jr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let h=-n.scrollLeft+mp(e);const a=-n.scrollTop;return Vr(s).direction==="rtl"&&(h+=jr(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:h,y:a}}const iC=25;function GD(e,t){const n=kn(e),s=qs(e),o=n.visualViewport;let u=s.clientWidth,h=s.clientHeight,a=0,l=0;if(o){u=o.width,h=o.height;const p=cp();(!p||p&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const d=mp(s);if(d<=0){const p=s.ownerDocument,f=p.body,g=getComputedStyle(f),S=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,C=Math.abs(s.clientWidth-f.clientWidth-S);C<=iC&&(u-=C)}else d<=iC&&(u+=d);return{width:u,height:h,x:a,y:l}}const $D=new Set(["absolute","fixed"]);function KD(e,t){const n=Ta(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,u=en(e)?Ml(e):Vs(1),h=e.clientWidth*u.x,a=e.clientHeight*u.y,l=o*u.x,d=s*u.y;return{width:h,height:a,x:l,y:d}}function oC(e,t,n){let s;if(t==="viewport")s=GD(e,n);else if(t==="document")s=qD(qs(e));else if(Nt(t))s=KD(t,n);else{const o=VE(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return jh(s)}function UE(e,t){const n=Us(e);return n===t||!Nt(n)||Hs(n)?!1:Vr(n).position==="fixed"||UE(n,t)}function YD(e,t){const n=t.get(e);if(n)return n;let s=fo(e,[],!1).filter(a=>Nt(a)&&bo(a)!=="body"),o=null;const u=Vr(e).position==="fixed";let h=u?Us(e):e;for(;Nt(h)&&!Hs(h);){const a=Vr(h),l=J_(h);!l&&a.position==="fixed"&&(o=null),(u?!l&&!o:!l&&a.position==="static"&&!!o&&$D.has(o.position)||Aa(h)&&!l&&UE(e,h))?s=s.filter(p=>p!==h):o=a,h=Us(h)}return t.set(e,s),s}function XD(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const h=[...n==="clippingAncestors"?lp(t)?[]:YD(t,this._c):[].concat(n),s],a=h[0],l=h.reduce((d,p)=>{const f=oC(t,p,o);return d.top=jr(f.top,d.top),d.right=Wl(f.right,d.right),d.bottom=Wl(f.bottom,d.bottom),d.left=jr(f.left,d.left),d},oC(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function QD(e){const{width:t,height:n}=HE(e);return{width:t,height:n}}function ZD(e,t,n){const s=en(t),o=qs(t),u=n==="fixed",h=Ta(e,!0,u,t);let a={scrollLeft:0,scrollTop:0};const l=Vs(0);function d(){l.x=mp(o)}if(s||!s&&!u)if((bo(t)!=="body"||Aa(o))&&(a=up(t)),s){const S=Ta(t,!0,u,t);l.x=S.x+t.clientLeft,l.y=S.y+t.clientTop}else o&&d();u&&!s&&o&&d();const p=o&&!s&&!u?FE(o,a):Vs(0),f=h.left+a.scrollLeft-l.x-p.x,g=h.top+a.scrollTop-l.y-p.y;return{x:f,y:g,width:h.width,height:h.height}}function mv(e){return Vr(e).position==="static"}function aC(e,t){if(!en(e)||Vr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qs(e)===n&&(n=n.ownerDocument.body),n}function WE(e,t){const n=kn(e);if(lp(e))return n;if(!en(e)){let o=Us(e);for(;o&&!Hs(o);){if(Nt(o)&&!mv(o))return o;o=Us(o)}return n}let s=aC(e,t);for(;s&&MO(s)&&mv(s);)s=aC(s,t);return s&&Hs(s)&&mv(s)&&!J_(s)?n:s||NO(e)||n}const JD=async function(e){const t=this.getOffsetParent||WE,n=this.getDimensions,s=await n(e.floating);return{reference:ZD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function e6(e){return Vr(e).direction==="rtl"}const t6={convertOffsetParentRelativeRectToViewportRelativeRect:UD,getDocumentElement:qs,getClippingRect:XD,getOffsetParent:WE,getElementRects:JD,getClientRects:WD,getDimensions:QD,getScale:Ml,isElement:Nt,isRTL:e6};function qE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function n6(e,t){let n=null,s;const o=qs(e);function u(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function h(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),u();const d=e.getBoundingClientRect(),{left:p,top:f,width:g,height:S}=d;if(a||t(),!g||!S)return;const C=kl(f),w=kl(o.clientWidth-(p+g)),y=kl(o.clientHeight-(f+S)),x=kl(p),b={rootMargin:-C+"px "+-w+"px "+-y+"px "+-x+"px",threshold:jr(0,Wl(1,l))||1};let E=!0;function T(A){const M=A[0].intersectionRatio;if(M!==l){if(!E)return h();M?h(!1,M):s=setTimeout(()=>{h(!1,1e-7)},1e3)}M===1&&!qE(d,e.getBoundingClientRect())&&h(),E=!1}try{n=new IntersectionObserver(T,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return h(!0),u}function lC(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,d=x0(e),p=o||u?[...d?fo(d):[],...fo(t)]:[];p.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),u&&x.addEventListener("resize",n)});const f=d&&a?n6(d,n):null;let g=-1,S=null;h&&(S=new ResizeObserver(x=>{let[v]=x;v&&v.target===d&&S&&(S.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var b;(b=S)==null||b.observe(t)})),n()}),d&&!l&&S.observe(d),S.observe(t));let C,w=l?Ta(e):null;l&&y();function y(){const x=Ta(e);w&&!qE(w,x)&&n(),w=x,C=requestAnimationFrame(y)}return n(),()=>{var x;p.forEach(v=>{o&&v.removeEventListener("scroll",n),u&&v.removeEventListener("resize",n)}),f?.(),(x=S)==null||x.disconnect(),S=null,l&&cancelAnimationFrame(C)}}const r6=ND,s6=BD,i6=PD,o6=HD,a6=ID,l6=zD,c6=(e,t,n)=>{const s=new Map,o={platform:t6,...n},u={...o.platform,_c:s};return DD(e,t,{...o,platform:u})};var u6=typeof document<"u",d6=function(){},ph=u6?R.useLayoutEffect:d6;function Hh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Hh(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!Hh(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function GE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cC(e,t){const n=GE(e);return Math.round(t*n)/n}function gv(e){const t=R.useRef(e);return ph(()=>{t.current=e}),t}function f6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:h}={},transform:a=!0,whileElementsMounted:l,open:d}=e,[p,f]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,S]=R.useState(s);Hh(g,s)||S(s);const[C,w]=R.useState(null),[y,x]=R.useState(null),v=R.useCallback(U=>{U!==A.current&&(A.current=U,w(U))},[]),b=R.useCallback(U=>{U!==M.current&&(M.current=U,x(U))},[]),E=u||C,T=h||y,A=R.useRef(null),M=R.useRef(null),L=R.useRef(p),D=l!=null,H=gv(l),z=gv(o),q=gv(d),j=R.useCallback(()=>{if(!A.current||!M.current)return;const U={placement:t,strategy:n,middleware:g};z.current&&(U.platform=z.current),c6(A.current,M.current,U).then(P=>{const B={...P,isPositioned:q.current!==!1};K.current&&!Hh(L.current,B)&&(L.current=B,er.flushSync(()=>{f(B)}))})},[g,t,n,z,q]);ph(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(U=>({...U,isPositioned:!1})))},[d]);const K=R.useRef(!1);ph(()=>(K.current=!0,()=>{K.current=!1}),[]),ph(()=>{if(E&&(A.current=E),T&&(M.current=T),E&&T){if(H.current)return H.current(E,T,j);j()}},[E,T,j,H,D]);const $=R.useMemo(()=>({reference:A,floating:M,setReference:v,setFloating:b}),[v,b]),F=R.useMemo(()=>({reference:E,floating:T}),[E,T]),G=R.useMemo(()=>{const U={position:n,left:0,top:0};if(!F.floating)return U;const P=cC(F.floating,p.x),B=cC(F.floating,p.y);return a?{...U,transform:"translate("+P+"px, "+B+"px)",...GE(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:B}},[n,a,F.floating,p.x,p.y]);return R.useMemo(()=>({...p,update:j,refs:$,elements:F,floatingStyles:G}),[p,j,$,F,G])}const h6=(e,t)=>({...r6(e),options:[e,t]}),p6=(e,t)=>({...s6(e),options:[e,t]}),m6=(e,t)=>({...l6(e),options:[e,t]}),g6=(e,t)=>({...i6(e),options:[e,t]}),v6=(e,t)=>({...o6(e),options:[e,t]}),_6=(e,t)=>({...a6(e),options:[e,t]}),y6={intentional:"onClick",sloppy:"onPointerDown"};function b6(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function gp(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingElement"),u=n.useState("referenceElement"),h=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:l}=n.context,{enabled:d=!0,escapeKey:p=!0,outsidePress:f=!0,outsidePressEvent:g="sloppy",referencePress:S=!1,referencePressEvent:C="sloppy",ancestorScroll:w=!1,bubbles:y,externalTree:x}=t,v=Co(x),b=Pe(typeof f=="function"?f:()=>!1),E=typeof f=="function"?b:f,T=R.useRef(!1),{escapeKey:A,outsidePress:M}=b6(y),L=R.useRef(null),D=Qt(),H=Qt(),z=Pe(()=>{H.clear(),l.current.insideReactTree=!1}),q=R.useRef(!1),j=R.useRef(""),K=Pe(re=>{j.current=re.pointerType}),$=Pe(()=>{const re=j.current,oe=re==="pen"||!re?"mouse":re,le=typeof g=="function"?g():g;return typeof le=="string"?le:le[oe]}),F=Pe(re=>{if(!s||!d||!p||re.key!=="Escape"||q.current)return;const oe=l.current.floatingContext?.nodeId,le=v?ga(v.nodesRef.current,oe):[];if(!A&&le.length>0){let he=!0;if(le.forEach(de=>{de.context?.open&&!de.context.dataRef.current.__escapeKeyBubbles&&(he=!1)}),!he)return}const ve=q4(re)?re.nativeEvent:re,ue=We(dp,ve);n.setOpen(!1,ue),!A&&!ue.isPropagationAllowed&&re.stopPropagation()}),G=Pe(re=>{const oe=$();return oe==="intentional"&&re.type!=="click"||oe==="sloppy"&&re.type==="click"}),U=Pe(()=>{l.current.insideReactTree=!0,H.start(0,z)}),P=Pe((re,oe=!1)=>{if(G(re)){z();return}if(l.current.insideReactTree){z();return}if($()==="intentional"&&oe||typeof E=="function"&&!E(re))return;const le=Pn(re),ve=`[${Gl("inert")}]`,ue=dn(n.select("floatingElement")).querySelectorAll(ve),he=n.context.triggerElements;if(le&&(he.hasElement(le)||he.hasMatchingElement(be=>ft(be,le))))return;let de=Nt(le)?le:null;for(;de&&!Hs(de);){const be=Us(de);if(Hs(be)||!Nt(be))break;de=be}if(ue.length&&Nt(le)&&!U4(le)&&!ft(le,n.select("floatingElement"))&&Array.from(ue).every(be=>!ft(de,be)))return;if(en(le)&&!("touches"in re)){const be=Hs(le),Oe=Vr(le),me=/auto|scroll/,ke=be||me.test(Oe.overflowX),Ce=be||me.test(Oe.overflowY),qe=ke&&le.clientWidth>0&&le.scrollWidth>le.clientWidth,De=Ce&&le.clientHeight>0&&le.scrollHeight>le.clientHeight,Ie=Oe.direction==="rtl",rt=De&&(Ie?re.offsetX<=le.offsetWidth-le.clientWidth:re.offsetX>le.clientWidth),et=qe&&re.offsetY>le.clientHeight;if(rt||et)return}const Ne=l.current.floatingContext?.nodeId,Me=v&&ga(v.nodesRef.current,Ne).some(be=>vs(re,be.context?.elements.floating));if(vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement"))||Me)return;const Ae=v?ga(v.nodesRef.current,Ne):[];if(Ae.length>0){let be=!0;if(Ae.forEach(Oe=>{Oe.context?.open&&!Oe.context.dataRef.current.__outsidePressBubbles&&(be=!1)}),!be)return}n.setOpen(!1,We(u0,re)),z()}),B=Pe(re=>{$()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!d||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement"))||P(re)}),I=Pe(re=>{if($()!=="sloppy"||!n.select("open")||!d||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement")))return;const oe=re.touches[0];oe&&(L.current={startTime:Date.now(),startX:oe.clientX,startY:oe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),W=Pe(re=>{const oe=Pn(re);function le(){I(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)}),Y=Pe(re=>{const oe=T.current;if(T.current=!1,D.clear(),re.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const le=Pn(re);function ve(){re.type==="pointerdown"?B(re):P(re,oe),le?.removeEventListener(re.type,ve)}le?.addEventListener(re.type,ve)}),J=Pe(re=>{if($()!=="sloppy"||!L.current||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement")))return;const oe=re.touches[0];if(!oe)return;const le=Math.abs(oe.clientX-L.current.startX),ve=Math.abs(oe.clientY-L.current.startY),ue=Math.sqrt(le*le+ve*ve);ue>5&&(L.current.dismissOnTouchEnd=!0),ue>10&&(P(re),D.clear(),L.current=null)}),Z=Pe(re=>{const oe=Pn(re);function le(){J(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)}),ee=Pe(re=>{$()!=="sloppy"||!L.current||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&P(re),D.clear(),L.current=null)}),X=Pe(re=>{const oe=Pn(re);function le(){ee(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)});R.useEffect(()=>{if(!s||!d)return;l.current.__escapeKeyBubbles=A,l.current.__outsidePressBubbles=M;const re=new Ra;function oe(de){n.setOpen(!1,We(Mn,de))}function le(){re.clear(),q.current=!0}function ve(){re.start(cp()?5:0,()=>{q.current=!1})}const ue=dn(o);ue.addEventListener("pointerdown",K,!0),p&&(ue.addEventListener("keydown",F),ue.addEventListener("compositionstart",le),ue.addEventListener("compositionend",ve)),E&&(ue.addEventListener("click",Y,!0),ue.addEventListener("pointerdown",Y,!0),ue.addEventListener("touchstart",W,!0),ue.addEventListener("touchmove",Z,!0),ue.addEventListener("touchend",X,!0),ue.addEventListener("mousedown",Y,!0));let he=[];return w&&(Nt(h)&&(he=fo(h)),Nt(o)&&(he=he.concat(fo(o))),!Nt(u)&&u&&u.contextElement&&(he=he.concat(fo(u.contextElement)))),he=he.filter(de=>de!==ue.defaultView?.visualViewport),he.forEach(de=>{de.addEventListener("scroll",oe,{passive:!0})}),()=>{ue.removeEventListener("pointerdown",K,!0),p&&(ue.removeEventListener("keydown",F),ue.removeEventListener("compositionstart",le),ue.removeEventListener("compositionend",ve)),E&&(ue.removeEventListener("click",Y,!0),ue.removeEventListener("pointerdown",Y,!0),ue.removeEventListener("touchstart",W,!0),ue.removeEventListener("touchmove",Z,!0),ue.removeEventListener("touchend",X,!0),ue.removeEventListener("mousedown",Y,!0)),he.forEach(de=>{de.removeEventListener("scroll",oe)}),re.clear()}},[l,o,u,h,p,E,s,a,w,d,A,M,F,P,Y,B,W,Z,X,K,n]),R.useEffect(z,[E,z]);const V=R.useMemo(()=>({onKeyDown:F,...S&&{[y6[C]]:re=>{n.setOpen(!1,We(pa,re.nativeEvent))},...C!=="intentional"&&{onClick(re){n.setOpen(!1,We(pa,re.nativeEvent))}}}}),[F,n,S,C]),se=Pe(re=>{const oe=Pn(re.nativeEvent);!ft(n.select("floatingElement"),oe)||re.button!==0||(T.current=!0)}),ne=R.useMemo(()=>({onKeyDown:F,onPointerDown:se,onMouseDown:se,onMouseUp:se,onClickCapture:U,onMouseDownCapture:U,onPointerDownCapture:U,onMouseUpCapture:U,onTouchEndCapture:U,onTouchMoveCapture:U}),[F,se,U]);return R.useMemo(()=>d?{reference:V,floating:ne,trigger:V}:{},[d,V,ne])}var Vh=Symbol("NOT_FOUND");function x6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function S6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function C6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${t}[${n}]`)}}var uC=e=>Array.isArray(e)?e:[e];function w6(e){const t=Array.isArray(e[0])?e[0]:e;return C6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function E6(e,t){const n=[],{length:s}=e;for(let o=0;o<s;o++)n.push(e[o].apply(null,t));return n}function k6(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Vh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function R6(e,t){let n=[];function s(a){const l=n.findIndex(d=>t(a,d.key));if(l>-1){const d=n[l];return l>0&&(n.splice(l,1),n.unshift(d)),d.value}return Vh}function o(a,l){s(a)===Vh&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function u(){return n}function h(){n=[]}return{get:s,put:o,getEntries:u,clear:h}}var T6=(e,t)=>e===t;function L6(e){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:o}=n;for(let u=0;u<o;u++)if(!e(n[u],s[u]))return!1;return!0}}function A6(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=T6,maxSize:o=1,resultEqualityCheck:u}=n,h=L6(s);let a=0;const l=o<=1?k6(h):R6(o,h);function d(){let p=l.get(arguments);if(p===Vh){if(p=e.apply(null,arguments),a++,u){const g=l.getEntries().find(S=>u(S.value,p));g&&(p=g.value,a!==0&&a--)}l.put(arguments,p)}return p}return d.clearCache=()=>{l.clear(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}var O6=class{constructor(e){this.value=e}deref(){return this.value}},M6=typeof WeakRef<"u"?WeakRef:O6,D6=0,dC=1;function qf(){return{s:D6,v:void 0,o:null,p:null}}function $E(e,t={}){let n=qf();const{resultEqualityCheck:s}=t;let o,u=0;function h(){let a=n;const{length:l}=arguments;for(let f=0,g=l;f<g;f++){const S=arguments[f];if(typeof S=="function"||typeof S=="object"&&S!==null){let C=a.o;C===null&&(a.o=C=new WeakMap);const w=C.get(S);w===void 0?(a=qf(),C.set(S,a)):a=w}else{let C=a.p;C===null&&(a.p=C=new Map);const w=C.get(S);w===void 0?(a=qf(),C.set(S,a)):a=w}}const d=a;let p;if(a.s===dC)p=a.v;else if(p=e.apply(null,arguments),u++,s){const f=o?.deref?.()??o;f!=null&&s(f,p)&&(p=f,u!==0&&u--),o=typeof p=="object"&&p!==null||typeof p=="function"?new M6(p):p}return d.s=dC,d.v=p,p}return h.clearCache=()=>{n=qf(),h.resetResultsCount()},h.resultsCount=()=>u,h.resetResultsCount=()=>{u=0},h}function KE(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...o)=>{let u=0,h=0,a,l={},d=o.pop();typeof d=="object"&&(l=d,d=o.pop()),x6(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const p={...n,...l},{memoize:f,memoizeOptions:g=[],argsMemoize:S=$E,argsMemoizeOptions:C=[]}=p,w=uC(g),y=uC(C),x=w6(o),v=f(function(){return u++,d.apply(null,arguments)},...w),b=S(function(){h++;const T=E6(x,arguments);return a=v.apply(null,T),a},...y);return Object.assign(b,{resultFunc:d,memoizedResultFunc:v,dependencies:x,dependencyRecomputations:()=>h,resetDependencyRecomputations:()=>{h=0},lastResult:()=>a,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:f,argsMemoize:S})};return Object.assign(s,{withTypes:()=>s}),s}var P6=KE($E),I6=Object.assign((e,t=P6)=>{S6(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(u=>e[u]);return t(s,(...u)=>u.reduce((h,a,l)=>(h[n[l]]=a,h),{}))},{withTypes:()=>I6});KE({memoize:A6,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const we=(e,t,n,s,o,u,...h)=>{if(h.length>0)throw new Error(Pt(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var j6=u2();const N6=t0(19),B6=N6?z6:H6;function Le(e,t,n,s,o){return B6(e,t,n,s,o)}function z6(e,t,n,s,o){const u=R.useCallback(()=>t(e.getSnapshot(),n,s,o),[e,t,n,s,o]);return j6.useSyncExternalStore(e.subscribe,u,u)}function H6(e,t,n,s,o){return d2.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,u=>t(u,n,s,o))}class va{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const s of this.listeners){if(n!==this.updateTick)return;s(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){va.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||va.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};va.prototype.setState.call(this,t)}}class S0 extends va{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}controlledValues=new Map;useSyncedValue(t,n){R.useDebugValue(t),Fe(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){Fe(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){const n=Object.values(t);Fe(()=>{this.update(t)},n)}useControlledProp(t,n,s){R.useDebugValue(t);const o=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,o),!o&&!Object.is(this.state[t],s)&&super.setState({...this.state,[t]:s})),Fe(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,s,o])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.update(n)}setState(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.setState({...this.state,...n})}select=(t,n,s,o)=>{const u=this.selectors[t];return u(this.state,n,s,o)};useState=(t,n,s,o)=>{R.useDebugValue(t);const u=this.selectors[t];return Le(this,u,n,s,o)};useContextCallback(t,n){R.useDebugValue(t);const s=Pe(n??on);this.context[t]=s}useStateSetter(t){const n=R.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(t,s)}),n.current}observe(t,n){let s;typeof t=="function"?s=t:s=this.selectors[t];let o=s(this.state);return n(o,o,this),this.subscribe(u=>{const h=s(u);if(!Object.is(o,h)){const a=o;o=h,n(h,a,this)}})}}const V6={open:we(e=>e.open),domReferenceElement:we(e=>e.domReferenceElement),referenceElement:we(e=>e.positionReference??e.referenceElement),floatingElement:we(e=>e.floatingElement),floatingId:we(e=>e.floatingId)};class C0 extends S0{constructor(t){const{nested:n,noEmit:s,onOpenChange:o,triggerElements:u,...h}=t;super({...h,positionReference:h.referenceElement,domReferenceElement:h.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:ME(),nested:n,noEmit:s,triggerElements:u},V6)}setOpen=(t,n)=>{if((!t||!this.state.open||gE(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const s={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",s)}this.context.onOpenChange?.(t,n)}}function ki(e,t=!1,n=!1){const[s,o]=R.useState(e&&t?"idle":void 0),[u,h]=R.useState(e);return e&&!u&&(h(!0),o("starting")),!e&&u&&s!=="ending"&&!n&&o("ending"),!e&&!u&&s==="ending"&&o(void 0),Fe(()=>{if(!e&&u&&s!=="ending"&&n){const a=Ns.request(()=>{o("ending")});return()=>{Ns.cancel(a)}}},[e,u,s,n]),Fe(()=>{if(!e||t)return;const a=Ns.request(()=>{o(void 0)});return()=>{Ns.cancel(a)}},[t,e]),Fe(()=>{if(!e||!t)return;e&&u&&s!=="idle"&&o("starting");const a=Ns.request(()=>{o("idle")});return()=>{Ns.cancel(a)}},[t,e,u,o,s]),R.useMemo(()=>({mounted:u,setMounted:h,transitionStatus:s}),[u,s])}function F6(e,t=!1,n=!0){const s=rd();return Pe((o,u=null)=>{s.cancel();const h=Qo(e);h!=null&&(typeof h.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?o():s.request(()=>{function a(){h&&Promise.all(h.getAnimations().map(l=>l.finished)).then(()=>{u!=null&&u.aborted||er.flushSync(o)}).catch(()=>{if(n){if(u!=null&&u.aborted)return;er.flushSync(o)}else h.getAnimations().length>0&&h.getAnimations().some(l=>l.pending||l.playState!=="finished")&&a()})}t?s.request(a):a()}))})}function Ur(e){const{enabled:t=!0,open:n,ref:s,onComplete:o}=e,u=hn(n),h=Pe(o),a=F6(s,n);R.useEffect(()=>{t&&a(()=>{n===u.current&&h()})},[t,n,h,a,u])}function U6(e,t){const n=R.useRef(null);return R.useCallback(s=>{e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),s!==null&&(n.current=e,t.context.triggerElements.add(e,s)))},[t,e])}function YE(e,t,n,s){const o=n.useState("isMountedByTrigger",e),u=U6(e,n),h=Pe(a=>{u(a),a!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...s})});return Fe(()=>{o&&n.update({activeTriggerElement:t.current,...s})},[o,n,t,...Object.values(s)]),{registerTrigger:h,isMountedByThisTrigger:o}}function XE(e){const t=e.useState("open");Fe(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[s,o]=n.value;e.update({activeTriggerId:s,activeTriggerElement:o})}}},[t,e])}function QE(e,t,n){const{mounted:s,setMounted:o,transitionStatus:u}=ki(e);t.useSyncedValues({mounted:s,transitionStatus:u});const h=Pe(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Ur({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||h()}}),{forceUnmount:h,transitionStatus:u}}class vp{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const s=this.idMap.get(t);s!==n&&(s!==void 0&&this.elements.delete(s),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function W6(){return new C0({open:!1,floatingElement:null,referenceElement:null,triggerElements:new vp,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function ZE(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:W6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:tn,inactiveTriggerProps:tn,popupProps:tn}}const JE={open:we(e=>e.open),mounted:we(e=>e.mounted),transitionStatus:we(e=>e.transitionStatus),floatingRootContext:we(e=>e.floatingRootContext),preventUnmountingOnClose:we(e=>e.preventUnmountingOnClose),payload:we(e=>e.payload),activeTriggerId:we(e=>e.activeTriggerId),activeTriggerElement:we(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:we((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:we((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:we((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:we((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:we(e=>e.popupProps),popupElement:we(e=>e.popupElement),positionerElement:we(e=>e.positionerElement)};function w0(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,o=Da(),u=Ei()!=null,h=Gn(()=>new C0({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:s.triggers??new vp,floatingId:o,nested:u,noEmit:e.noEmit||!1})).current;return Fe(()=>{const a={open:t,floatingId:o};s.reference!==void 0&&(a.referenceElement=s.reference,a.domReferenceElement=Nt(s.reference)?s.reference:null),s.floating!==void 0&&(a.floatingElement=s.floating),h.update(a)},[t,o,s.reference,s.floating,h]),h.context.onOpenChange=n,h.context.nested=u,h.context.noEmit=e.noEmit||!1,h}function q6(e={}){const{nodeId:t,externalTree:n}=e,s=w0(e),o=e.rootContext||s,u={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[h,a]=R.useState(null),l=R.useRef(null),d=Co(n);Fe(()=>{u.domReference&&(l.current=u.domReference)},[u.domReference]);const p=f6({...e,elements:{...u,...h&&{reference:h}}}),f=R.useCallback(M=>{const L=Nt(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;a(L),p.refs.setReference(L)},[p.refs]),[g,S]=R.useState(null),[C,w]=R.useState(null);o.useSyncedValue("referenceElement",g),o.useSyncedValue("domReferenceElement",Nt(g)?g:null),o.useSyncedValue("floatingElement",C);const y=R.useCallback(M=>{(Nt(M)||M===null)&&(l.current=M,S(M)),(Nt(p.refs.reference.current)||p.refs.reference.current===null||M!==null&&!Nt(M))&&p.refs.setReference(M)},[p.refs,S]),x=R.useCallback(M=>{w(M),p.refs.setFloating(M)},[p.refs]),v=R.useMemo(()=>({...p.refs,setReference:y,setFloating:x,setPositionReference:f,domReference:l}),[p.refs,y,x,f]),b=R.useMemo(()=>({...p.elements,domReference:u.domReference}),[p.elements,u.domReference]),E=o.useState("open"),T=o.useState("floatingId"),A=R.useMemo(()=>({...p,dataRef:o.context.dataRef,open:E,onOpenChange:o.setOpen,events:o.context.events,floatingId:T,refs:v,elements:b,nodeId:t,rootStore:o}),[p,v,b,t,o,E,T]);return Fe(()=>{o.context.dataRef.current.floatingContext=A;const M=d?.nodesRef.current.find(L=>L.id===t);M&&(M.context=A)}),R.useMemo(()=>({...p,context:A,refs:v,elements:b,rootStore:o}),[p,v,b,A,o])}function ek(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:o}=e,u=Da(),h=Ei()!=null,a=t.useState("open"),l=t.useState("activeTriggerElement"),d=t.useState(s?"popupElement":"positionerElement"),p=t.context.triggerElements,f=Gn(()=>new C0({open:a,referenceElement:l,floatingElement:d,triggerElements:p,onOpenChange:o,floatingId:u,nested:h,noEmit:n})).current;return Fe(()=>{const g={open:a,floatingId:u,referenceElement:l,floatingElement:d};Nt(l)&&(g.domReferenceElement=l),f.update(g)},[a,u,l,d,f]),f.context.onOpenChange=o,f.context.nested=h,f.context.noEmit=n,f}const vv=z4&&cE;function G6(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:s,dataRef:o}=n.context,{enabled:u=!0,visibleOnly:h=!0}=t,a=R.useRef(!1),l=Qt(),d=R.useRef(!0);R.useEffect(()=>{const f=n.select("domReferenceElement");if(!u)return;const g=kn(f);function S(){!n.select("open")&&en(f)&&f===_s(dn(f))&&(a.current=!0)}function C(){d.current=!0}function w(){d.current=!1}return g.addEventListener("blur",S),vv&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",w,!0)),()=>{g.removeEventListener("blur",S),vv&&(g.removeEventListener("keydown",C,!0),g.removeEventListener("pointerdown",w,!0))}},[n,u]),R.useEffect(()=>{if(!u)return;function f(g){(g.reason===pa||g.reason===dp)&&(a.current=!0)}return s.on("openchange",f),()=>{s.off("openchange",f)}},[s,u]);const p=R.useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(f){if(a.current)return;const g=Pn(f.nativeEvent);if(h&&Nt(g)){if(vv&&!f.relatedTarget){if(!d.current&&!p0(g))return}else if(!W4(g))return}n.setOpen(!0,We(Mh,f.nativeEvent,f.currentTarget))},onBlur(f){a.current=!1;const g=f.relatedTarget,S=f.nativeEvent,C=Nt(g)&&g.hasAttribute(Gl("focus-guard"))&&g.getAttribute("data-type")==="outside";l.start(0,()=>{const w=n.select("domReferenceElement"),y=_s(w?w.ownerDocument:document);!g&&y===w||ft(o.current.floatingContext?.refs.floating.current,y)||ft(w,y)||C||n.context.triggerElements.hasElement(f.relatedTarget)||n.setOpen(!1,We(Mh,S))})}}),[o,n,h,l]);return R.useMemo(()=>u?{reference:p,trigger:p}:{},[u,p])}const g_=Gl("safe-polygon"),$6=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${hE}`;function K6(e){return e?!!e.closest($6):!1}function tk(e){const t=R.useRef(void 0),n=R.useRef(!1),s=R.useRef(void 0),o=R.useRef(!0),u=R.useRef(!1),h=R.useRef(()=>{}),a=R.useRef(!1),l=Qt(),d=Qt(),p=R.useRef(void 0);return R.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:s,blockMouseMoveRef:o,performedPointerEventsMutationRef:u,unbindMouseMoveRef:h,restTimeoutPendingRef:a,openChangeTimeout:l,restTimeout:d,handleCloseOptionsRef:p}),f.hoverInteractionState},[e,t,n,s,o,u,h,a,l,d,p])}const Y6=new Set(["click","mousedown"]);function X6(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingElement"),u=n.useState("domReferenceElement"),{dataRef:h}=n.context,{enabled:a=!0,closeDelay:l=0,externalTree:d}=t,{pointerTypeRef:p,interactedInsideRef:f,handlerRef:g,performedPointerEventsMutationRef:S,unbindMouseMoveRef:C,restTimeoutPendingRef:w,openChangeTimeout:y,handleCloseOptionsRef:x}=tk(n),v=Co(d),b=Ei(),E=Pe(()=>f.current?!0:h.current.openEvent?Y6.has(h.current.openEvent.type):!1),T=Pe(()=>{const H=h.current.openEvent?.type;return H?.includes("mouse")&&H!=="mousedown"}),A=R.useCallback((H,z=!0)=>{const q=Q6(l,p.current);q&&!g.current?y.start(q,()=>n.setOpen(!1,We(Br,H))):z&&(y.clear(),n.setOpen(!1,We(Br,H)))},[l,g,n,p,y]),M=Pe(()=>{C.current(),g.current=void 0}),L=Pe(()=>{if(S.current){const H=dn(o).body;H.style.pointerEvents="",H.removeAttribute(g_),S.current=!1}}),D=Pe(H=>{const z=Pn(H);if(!K6(z)){f.current=!1;return}f.current=!0});Fe(()=>{s||(p.current=void 0,w.current=!1,f.current=!1,M(),L())},[s,p,w,f,M,L]),R.useEffect(()=>()=>{M()},[M]),R.useEffect(()=>L,[L]),Fe(()=>{if(a&&s&&x.current?.blockPointerEvents&&T()&&Nt(u)&&o){S.current=!0;const H=dn(o).body;H.setAttribute(g_,"");const z=u,q=o,j=v?.nodesRef.current.find(K=>K.id===b)?.context?.elements.floating;return j&&(j.style.pointerEvents=""),H.style.pointerEvents="none",z.style.pointerEvents="auto",q.style.pointerEvents="auto",()=>{H.style.pointerEvents="",z.style.pointerEvents="",q.style.pointerEvents=""}}},[a,s,u,o,x,T,v,b,S]),R.useEffect(()=>{if(!a)return;function H(K){if(E()||!h.current.floatingContext||!n.select("open"))return;const $=n.context.triggerElements;K.relatedTarget&&$.hasElement(K.relatedTarget)||(L(),M(),E()||A(K))}function z(K){y.clear(),L(),g.current?.(K),M()}function q(K){E()||A(K,!1)}const j=o;return j&&(j.addEventListener("mouseleave",H),j.addEventListener("mouseenter",z),j.addEventListener("mouseleave",q),j.addEventListener("pointerdown",D,!0)),()=>{j&&(j.removeEventListener("mouseleave",H),j.removeEventListener("mouseenter",z),j.removeEventListener("mouseleave",q),j.removeEventListener("pointerdown",D,!0))}})}function Q6(e,t){return t&&!Ul(t)?0:typeof e=="function"?e():e}function _v(e){return typeof e=="function"?e():e}const Z6={current:null};function J6(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:s,events:o}=n.context,{enabled:u=!0,delay:h=0,handleClose:a=null,mouseOnly:l=!1,restMs:d=0,move:p=!0,triggerElementRef:f=Z6,externalTree:g,isActiveTrigger:S=!0}=t,C=Co(g),{pointerTypeRef:w,interactedInsideRef:y,handlerRef:x,blockMouseMoveRef:v,performedPointerEventsMutationRef:b,unbindMouseMoveRef:E,restTimeoutPendingRef:T,openChangeTimeout:A,restTimeout:M,handleCloseOptionsRef:L}=tk(n),D=hn(a),H=hn(h),z=hn(d);S&&(L.current=D.current?.__options);const q=Pe(()=>y.current?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),j=R.useCallback((G,U=!0)=>{const P=fv(H.current,"close",w.current);P&&!x.current?A.start(P,()=>n.setOpen(!1,We(Br,G))):U&&(A.clear(),n.setOpen(!1,We(Br,G)))},[H,x,n,w,A]),K=Pe(()=>{E.current(),x.current=void 0}),$=Pe(()=>{if(b.current){const G=dn(n.select("domReferenceElement")).body;G.style.pointerEvents="",G.removeAttribute(g_),b.current=!1}});R.useEffect(()=>{if(!u)return;function G(U){U.open||(A.clear(),M.clear(),v.current=!0,T.current=!1)}return o.on("openchange",G),()=>{o.off("openchange",G)}},[u,o,A,M,v,T]);const F=Pe(G=>{if(q()||!s.current.floatingContext)return;const U=n.context.triggerElements;if(G.relatedTarget&&U.hasElement(G.relatedTarget))return;const P=f.current;D.current?.({...s.current.floatingContext,tree:C,x:G.clientX,y:G.clientY,onClose(){$(),K(),!q()&&P===n.select("domReferenceElement")&&j(G)}})(G)});return R.useEffect(()=>{if(!u)return;const G=f.current??(S?n.select("domReferenceElement"):null);if(!Nt(G))return;function U(I){if(A.clear(),v.current=!1,l&&!Ul(w.current)||_v(z.current)>0&&!fv(H.current,"open"))return;const W=fv(H.current,"open",w.current),Y=n.select("domReferenceElement"),J=n.context.triggerElements,Z=(J.hasElement(I.target)||J.hasMatchingElement(V=>ft(V,I.target)))&&(!Y||!ft(Y,I.target)),ee=I.currentTarget??null,X=!n.select("open")||Z;W?A.start(W,()=>{X&&n.setOpen(!0,We(Br,I,ee))}):X&&n.setOpen(!0,We(Br,I,ee))}function P(I){if(q()){$();return}E.current();const W=n.select("domReferenceElement"),Y=dn(W);M.clear(),T.current=!1;const J=n.context.triggerElements;if(I.relatedTarget&&J.hasElement(I.relatedTarget))return;if(D.current&&s.current.floatingContext){n.select("open")||A.clear();const ee=f.current;x.current=D.current({...s.current.floatingContext,tree:C,x:I.clientX,y:I.clientY,onClose(){$(),K(),!q()&&ee===n.select("domReferenceElement")&&j(I,!0)}});const X=x.current;X(I),Y.addEventListener("mousemove",X),E.current=()=>{Y.removeEventListener("mousemove",X)};return}(w.current!=="touch"||!ft(n.select("floatingElement"),I.relatedTarget))&&j(I)}function B(I){F(I)}return n.select("open")&&G.addEventListener("mouseleave",B),p&&G.addEventListener("mousemove",U,{once:!0}),G.addEventListener("mouseenter",U),G.addEventListener("mouseleave",P),()=>{G.removeEventListener("mouseleave",B),p&&G.removeEventListener("mousemove",U),G.removeEventListener("mouseenter",U),G.removeEventListener("mouseleave",P)}},[K,$,v,s,H,j,n,u,D,F,S,q,l,p,w,z,M,T,A,f,C,E,x]),R.useMemo(()=>{function G(U){w.current=U.pointerType}return{onPointerDown:G,onPointerEnter:G,onMouseMove(U){const{nativeEvent:P}=U,B=U.currentTarget,I=n.select("domReferenceElement"),W=n.context.triggerElements,Y=n.select("open"),J=(W.hasElement(U.target)||W.hasMatchingElement(ee=>ft(ee,U.target)))&&(!I||!ft(I,U.target));if(l&&!Ul(w.current)||Y&&!J||_v(z.current)===0||!J&&T.current&&U.movementX**2+U.movementY**2<2)return;M.clear();function Z(){!v.current&&(!Y||J)&&n.setOpen(!0,We(Br,P,B))}w.current==="touch"?er.flushSync(()=>{Z()}):J&&Y?Z():(T.current=!0,M.start(_v(z.current),Z))}}},[v,l,n,w,z,M,T])}function oc(e=[]){const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),s=e.map(d=>d?.item),o=e.map(d=>d?.trigger),u=R.useCallback(d=>Gf(d,e,"reference"),t),h=R.useCallback(d=>Gf(d,e,"floating"),n),a=R.useCallback(d=>Gf(d,e,"item"),s),l=R.useCallback(d=>Gf(d,e,"trigger"),o);return R.useMemo(()=>({getReferenceProps:u,getFloatingProps:h,getItemProps:a,getTriggerProps:l}),[u,h,a,l])}function Gf(e,t,n){const s=new Map,o=n==="item",u={};n==="floating"&&(u.tabIndex=-1,u[c_]="");for(const h in e)o&&e&&(h===dE||h===fE)||(u[h]=e[h]);for(let h=0;h<t.length;h+=1){let a;const l=t[h]?.[n];typeof l=="function"?a=e?l(e):null:a=l,a&&fC(u,a,o,s)}return fC(u,e,o,s),u}function fC(e,t,n,s){for(const o in t){const u=t[o];n&&(o===dE||o===fE)||(o.startsWith("on")?(s.has(o)||s.set(o,[]),typeof u=="function"&&(s.get(o)?.push(u),e[o]=(...h)=>s.get(o)?.map(a=>a(...h)).find(a=>a!==void 0))):e[o]=u)}}const e8="Escape";function _p(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function $f(e,t){return _p(t,e===h0||e===td,e===ho||e===po)}function yv(e,t,n){return _p(t,e===td,n?e===ho:e===po)||e==="Enter"||e===" "||e===""}function t8(e,t,n){return _p(t,n?e===ho:e===po,e===td)}function n8(e,t,n,s){const o=n?e===po:e===ho,u=e===h0;return t==="both"||t==="horizontal"&&s&&s>1?e===e8:_p(t,o,u)}function E0(e,t){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingElement"),u=n.useState("domReferenceElement"),h=n.context.dataRef,{listRef:a,activeIndex:l,onNavigate:d=()=>{},enabled:p=!0,selectedIndex:f=null,allowEscape:g=!1,loopFocus:S=!1,nested:C=!1,rtl:w=!1,virtual:y=!1,focusItemOnOpen:x="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:E=void 0,orientation:T="vertical",parentOrientation:A,cols:M=1,scrollItemIntoView:L=!0,itemSizes:D,dense:H=!1,id:z,resetOnPointerLeave:q=!0,externalTree:j}=t,K=Hu(o),$=hn(K),F=Ei(),G=Co(j);Fe(()=>{h.current.orientation=T},[h,T]);const U=u_(u),P=R.useRef(x),B=R.useRef(f??-1),I=R.useRef(null),W=R.useRef(!0),Y=Pe(me=>{d(B.current===-1?null:B.current,me)}),J=R.useRef(Y),Z=R.useRef(!!o),ee=R.useRef(s),X=R.useRef(!1),V=R.useRef(!1),se=hn(E),ne=hn(s),re=hn(L),oe=hn(f),le=hn(q),ve=Pe(()=>{function me(De){y?G?.events.emit("virtualfocus",De):hh(De,{sync:X.current,preventScroll:!0})}const ke=a.current[B.current],Ce=V.current;ke&&me(ke),(X.current?De=>De():requestAnimationFrame)(()=>{const De=a.current[B.current]||ke;if(!De)return;ke||me(De);const Ie=re.current;Ie&&he&&(Ce||!W.current)&&De.scrollIntoView?.(typeof Ie=="boolean"?{block:"nearest",inline:"nearest"}:Ie)})});Fe(()=>{p&&(s&&o?(B.current=f??-1,P.current&&f!=null&&(V.current=!0,Y())):Z.current&&(B.current=-1,J.current()))},[p,s,o,f,Y]),Fe(()=>{if(p){if(!s){X.current=!1;return}if(o)if(l==null){if(X.current=!1,oe.current!=null)return;if(Z.current&&(B.current=-1,ve()),(!ee.current||!Z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let me=0;const ke=()=>{a.current[0]==null?(me<2&&(me?requestAnimationFrame:queueMicrotask)(ke),me+=1):(B.current=I.current==null||yv(I.current,T,w)||C?fh(a):h_(a),I.current=null,Y())};ke()}}else Ll(a,l)||(B.current=l,ve(),V.current=!1)}},[p,s,o,l,oe,C,a,T,w,Y,ve,se]),Fe(()=>{if(!p||o||!G||y||!Z.current)return;const me=G.nodesRef.current,ke=me.find(De=>De.id===F)?.context?.elements.floating,Ce=_s(dn(o)),qe=me.some(De=>De.context&&ft(De.context.elements.floating,Ce));ke&&!qe&&W.current&&ke.focus({preventScroll:!0})},[p,o,G,F,y]),Fe(()=>{J.current=Y,ee.current=s,Z.current=!!o}),Fe(()=>{s||(I.current=null,P.current=x)},[s,x]);const ue=l!=null,he=R.useMemo(()=>{function me(Ce){if(!ne.current)return;const qe=a.current.indexOf(Ce.currentTarget);qe!==-1&&B.current!==qe&&(B.current=qe,Y(Ce))}return{onFocus(Ce){X.current=!0,me(Ce)},onClick:({currentTarget:Ce})=>Ce.focus({preventScroll:!0}),onMouseMove(Ce){X.current=!0,V.current=!1,v&&me(Ce)},onPointerLeave(Ce){if(!ne.current||!W.current||Ce.pointerType==="touch")return;X.current=!0;const qe=Ce.relatedTarget;!v||a.current.includes(qe)||le.current&&(B.current=-1,Y(Ce),y||$.current?.focus({preventScroll:!0}))}}},[ne,$,v,a,Y,le,y]),de=R.useCallback(()=>A??G?.nodesRef.current.find(me=>me.id===F)?.context?.dataRef?.current.orientation,[F,G,A]),Ne=Pe(me=>{if(W.current=!1,X.current=!0,me.which===229||!ne.current&&me.currentTarget===$.current)return;if(C&&n8(me.key,T,w,M)){$f(me.key,de())||fn(me),n.setOpen(!1,We(Du,me.nativeEvent)),en(u)&&(y?G?.events.emit("virtualfocus",u):u.focus());return}const ke=B.current,Ce=fh(a,E),qe=h_(a,E);if(U||(me.key==="Home"&&(fn(me),B.current=Ce,Y(me)),me.key==="End"&&(fn(me),B.current=qe,Y(me))),M>1){const De=D||Array.from({length:a.current.length},()=>({width:1,height:1})),Ie=yE(De,M,H),rt=Ie.findIndex(xe=>xe!=null&&!mo(a,xe,E)),et=Ie.reduce((xe,Ve,Ee)=>Ve!=null&&!mo(a,Ve,E)?Ee:xe,-1),dt=Ie[_E({current:Ie.map(xe=>xe!=null?a.current[xe]:null)},{event:me,orientation:T,loopFocus:S,rtl:w,cols:M,disabledIndices:xE([...(typeof E!="function"?E:null)||a.current.map((xe,Ve)=>mo(a,Ve,E)?Ve:void 0),void 0],Ie),minIndex:rt,maxIndex:et,prevIndex:bE(B.current>qe?Ce:B.current,De,Ie,M,me.key===td?"bl":me.key===(w?ho:po)?"tr":"tl"),stopEvent:!0})];if(dt!=null&&(B.current=dt,Y(me)),T==="both")return}if($f(me.key,T)){if(fn(me),s&&!y&&_s(me.currentTarget.ownerDocument)===me.currentTarget){B.current=yv(me.key,T,w)?Ce:qe,Y(me);return}yv(me.key,T,w)?S?ke>=qe?g&&ke!==a.current.length?B.current=-1:(X.current=!1,B.current=Ce):B.current=Wn(a,{startingIndex:ke,disabledIndices:E}):B.current=Math.min(qe,Wn(a,{startingIndex:ke,disabledIndices:E})):S?ke<=Ce?g&&ke!==-1?B.current=a.current.length:(X.current=!1,B.current=qe):B.current=Wn(a,{startingIndex:ke,decrement:!0,disabledIndices:E}):B.current=Math.max(Ce,Wn(a,{startingIndex:ke,decrement:!0,disabledIndices:E})),Ll(a,B.current)&&(B.current=-1),Y(me)}}),Me=R.useMemo(()=>y&&s&&ue&&{"aria-activedescendant":`${z}-${l}`},[y,s,ue,z,l]),Ae=R.useMemo(()=>({"aria-orientation":T==="both"?void 0:T,...U?{}:Me,onKeyDown(me){if(me.key==="Tab"&&me.shiftKey&&s&&!y){const ke=Pn(me.nativeEvent);if(ke&&!ft($.current,ke))return;fn(me),n.setOpen(!1,We(ka,me.nativeEvent)),en(u)&&u.focus();return}Ne(me)},onPointerMove(){W.current=!0}}),[Me,Ne,$,T,U,n,s,y,u]),be=R.useMemo(()=>{function me(Ce){x==="auto"&&pE(Ce.nativeEvent)&&(P.current=!y)}function ke(Ce){P.current=x,x==="auto"&&mE(Ce.nativeEvent)&&(P.current=!0)}return{onKeyDown(Ce){const qe=n.select("open");W.current=!1;const De=Ce.key.startsWith("Arrow"),Ie=t8(Ce.key,de(),w),rt=$f(Ce.key,T),et=(C?Ie:rt)||Ce.key==="Enter"||Ce.key.trim()==="";if(y&&qe)return Ne(Ce);if(!(!qe&&!b&&De)){if(et){const dt=$f(Ce.key,de());I.current=C&&dt?null:Ce.key}if(C){Ie&&(fn(Ce),qe?(B.current=fh(a,se.current),Y(Ce)):n.setOpen(!0,We(Du,Ce.nativeEvent,Ce.currentTarget)));return}rt&&(oe.current!=null&&(B.current=oe.current),fn(Ce),!qe&&b?n.setOpen(!0,We(Du,Ce.nativeEvent,Ce.currentTarget)):Ne(Ce),qe&&Y(Ce))}},onFocus(Ce){n.select("open")&&!y&&(B.current=-1,Y(Ce))},onPointerDown:ke,onPointerEnter:ke,onMouseDown:me,onClick:me}},[Ne,se,x,a,C,Y,n,b,T,de,w,oe,y]),Oe=R.useMemo(()=>({...Me,...be}),[Me,be]);return R.useMemo(()=>p?{reference:Oe,floating:Ae,item:he,trigger:be}:{},[p,Oe,Ae,be,he])}const r8=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function nk(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingId"),u=n.useState("domReferenceElement"),h=n.useState("floatingElement"),{enabled:a=!0,role:l="dialog"}=t,d=Da(),p=u?.id||d,f=R.useMemo(()=>Hu(h)?.id||o,[h,o]),g=r8.get(l)??l,C=Ei()!=null,w=R.useMemo(()=>g==="tooltip"||l==="label"?tn:{"aria-haspopup":g==="alertdialog"?"dialog":g,"aria-expanded":"false",...g==="listbox"&&{role:"combobox"},...g==="menu"&&C&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[g,C,l]),y=R.useMemo(()=>g==="tooltip"||l==="label"?{[`aria-${l==="label"?"labelledby":"describedby"}`]:s?f:void 0}:{...w,"aria-expanded":s?"true":"false","aria-controls":s?f:void 0,...g==="menu"&&{id:p}},[g,f,s,p,l,w]),x=R.useMemo(()=>{const b={id:f,...g&&{role:g}};return g==="tooltip"||l==="label"?b:{...b,...g==="menu"&&{"aria-labelledby":p}}},[g,f,p,l]),v=R.useCallback(({active:b,selected:E})=>{const T={role:"option",...b&&{id:`${f}-fui-option`}};switch(l){case"select":case"combobox":return{...T,"aria-selected":E}}return{}},[f,l]);return R.useMemo(()=>a?{reference:y,floating:x,item:v,trigger:w}:{},[a,y,x,w,v])}function k0(e,t){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.context.dataRef,{listRef:u,activeIndex:h,onMatch:a,onTypingChange:l,enabled:d=!0,findMatch:p=null,resetMs:f=750,ignoreKeys:g=yr,selectedIndex:S=null}=t,C=Qt(),w=R.useRef(""),y=R.useRef(S??h??-1),x=R.useRef(null);Fe(()=>{s&&(C.clear(),x.current=null,w.current="")},[s,C]),Fe(()=>{s&&w.current===""&&(y.current=S??h??-1)},[s,S,h]);const v=Pe(A=>{A?o.current.typing||(o.current.typing=A,l?.(A)):o.current.typing&&(o.current.typing=A,l?.(A))}),b=Pe(A=>{function M(q,j,K){const $=p?p(j,K):j.find(F=>F?.toLocaleLowerCase().indexOf(K.toLocaleLowerCase())===0);return $?q.indexOf($):-1}const L=u.current;if(w.current.length>0&&w.current[0]!==" "&&(M(L,L,w.current)===-1?v(!1):A.key===" "&&fn(A)),L==null||g.includes(A.key)||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;s&&A.key!==" "&&(fn(A),v(!0)),L.every(q=>q?q[0]?.toLocaleLowerCase()!==q[1]?.toLocaleLowerCase():!0)&&w.current===A.key&&(w.current="",y.current=x.current),w.current+=A.key,C.start(f,()=>{w.current="",y.current=x.current,v(!1)});const H=y.current,z=M(L,[...L.slice((H||0)+1),...L.slice(0,(H||0)+1)],w.current);z!==-1?(a?.(z),x.current=z):A.key!==" "&&(w.current="",v(!1))}),E=R.useMemo(()=>({onKeyDown:b}),[b]),T=R.useMemo(()=>({onKeyDown:b,onKeyUp(A){A.key===" "&&v(!1)}}),[b,v]);return R.useMemo(()=>d?{reference:E,floating:T}:{},[d,E,T])}function hC(e,t){const[n,s]=e;let o=!1;const u=t.length;for(let h=0,a=u-1;h<u;a=h++){const[l,d]=t[h]||[0,0],[p,f]=t[a]||[0,0];d>=s!=f>=s&&n<=(p-l)*(s-d)/(f-d)+l&&(o=!o)}return o}function s8(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function i8(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:s=!0}=e,o=new Ra;let u=!1,h=null,a=null,l=typeof performance<"u"?performance.now():0;function d(f,g){const S=performance.now(),C=S-l;if(h===null||a===null||C===0)return h=f,a=g,l=S,null;const w=f-h,y=g-a,v=Math.sqrt(w*w+y*y)/C;return h=f,a=g,l=S,v}const p=({x:f,y:g,placement:S,elements:C,onClose:w,nodeId:y,tree:x})=>function(b){function E(){o.clear(),w()}if(o.clear(),!C.domReference||!C.floating||S==null||f==null||g==null)return;const{clientX:T,clientY:A}=b,M=[T,A],L=Pn(b),D=b.type==="mouseleave",H=ft(C.floating,L),z=ft(C.domReference,L),q=C.domReference.getBoundingClientRect(),j=C.floating.getBoundingClientRect(),K=S.split("-")[0],$=f>j.right-j.width/2,F=g>j.bottom-j.height/2,G=s8(M,q),U=j.width>q.width,P=j.height>q.height,B=(U?q:j).left,I=(U?q:j).right,W=(P?q:j).top,Y=(P?q:j).bottom;if(H&&(u=!0,!D))return;if(z&&(u=!1),z&&!D){u=!0;return}if(D&&Nt(b.relatedTarget)&&ft(C.floating,b.relatedTarget)||x&&ga(x.nodesRef.current,y).some(({context:ee})=>ee?.open))return;if(K==="top"&&g>=q.bottom-1||K==="bottom"&&g<=q.top+1||K==="left"&&f>=q.right-1||K==="right"&&f<=q.left+1)return E();let J=[];switch(K){case"top":J=[[B,q.top+1],[B,j.bottom-1],[I,j.bottom-1],[I,q.top+1]];break;case"bottom":J=[[B,j.top+1],[B,q.bottom-1],[I,q.bottom-1],[I,j.top+1]];break;case"left":J=[[j.right-1,Y],[j.right-1,W],[q.left+1,W],[q.left+1,Y]];break;case"right":J=[[q.right-1,Y],[q.right-1,W],[j.left+1,W],[j.left+1,Y]];break}function Z([ee,X]){switch(K){case"top":{const V=[U?ee+t/2:$?ee+t*4:ee-t*4,X+t+1],se=[U?ee-t/2:$?ee+t*4:ee-t*4,X+t+1],ne=[[j.left,$||U?j.bottom-t:j.top],[j.right,$?U?j.bottom-t:j.top:j.bottom-t]];return[V,se,...ne]}case"bottom":{const V=[U?ee+t/2:$?ee+t*4:ee-t*4,X-t],se=[U?ee-t/2:$?ee+t*4:ee-t*4,X-t],ne=[[j.left,$||U?j.top+t:j.bottom],[j.right,$?U?j.top+t:j.bottom:j.top+t]];return[V,se,...ne]}case"left":{const V=[ee+t+1,P?X+t/2:F?X+t*4:X-t*4],se=[ee+t+1,P?X-t/2:F?X+t*4:X-t*4];return[...[[F||P?j.right-t:j.left,j.top],[F?P?j.right-t:j.left:j.right-t,j.bottom]],V,se]}case"right":{const V=[ee-t,P?X+t/2:F?X+t*4:X-t*4],se=[ee-t,P?X-t/2:F?X+t*4:X-t*4],ne=[[F||P?j.left+t:j.right,j.top],[F?P?j.left+t:j.right:j.left+t,j.bottom]];return[V,se,...ne]}default:return[]}}if(!hC([T,A],J)){if(u&&!G)return E();if(!D&&s){const ee=d(b.clientX,b.clientY);if(ee!==null&&ee<.1)return E()}hC([T,A],Z([f,g]))?!u&&s&&o.start(40,E):E()}};return p.__options={blockPointerEvents:n},p}let o8=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),a8=(function(e){return e[e.open=sa.open]="open",e[e.closed=sa.closed]="closed",e[e.startingStyle=sa.startingStyle]="startingStyle",e[e.endingStyle=sa.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const rk=R.createContext(void 0);function l8(){const e=R.useContext(rk);if(e===void 0)throw new Error(Pt(26));return e}const Dl="ArrowUp",oa="ArrowDown",Uu="ArrowLeft",Pl="ArrowRight",id="Home",od="End",sk=new Set([Uu,Pl]),c8=new Set([Uu,Pl,id,od]),ik=new Set([Dl,oa]),u8=new Set([Dl,oa,id,od]),ok=new Set([...sk,...ik]),d8=new Set([...ok,id,od]),R0=new Set([Dl,oa,Uu,Pl,id,od]),f8="Shift",h8="Control",p8="Alt",m8="Meta",g8=new Set([f8,h8,p8,m8]);function v8(e){return en(e)&&e.tagName==="INPUT"}function pC(e){return!!(v8(e)&&e.selectionStart!=null||en(e)&&e.tagName==="TEXTAREA")}function mC(e,t,n,s){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,u=e.scrollTop;const h=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(h&&s!=="vertical"){const l=gC(e,t,"left"),d=Kf(e),p=Kf(t);n==="ltr"&&(l+t.offsetWidth+p.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?o=l+t.offsetWidth+p.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:l-p.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(o=l-p.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(l-p.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?o=l-p.scrollMarginLeft-d.scrollPaddingLeft:l+t.offsetWidth+p.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(o=l+t.offsetWidth+p.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(a&&s!=="horizontal"){const l=gC(e,t,"top"),d=Kf(e),p=Kf(t);l-p.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?u=l-p.scrollMarginTop-d.scrollPaddingTop:l+t.offsetHeight+p.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(u=l+t.offsetHeight+p.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:o,top:u,behavior:"auto"})}function gC(e,t,n){const s=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[s],t.offsetParent!==e);)t=t.offsetParent;return o}function Kf(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const _8={...xo,...Gs,nestedDialogOpen(e){return e?{[a8.nestedDialogOpen]:""}:null}},ak=R.forwardRef(function(t,n){const{className:s,finalFocus:o,initialFocus:u,render:h,...a}=t,{store:l}=wi(),d=l.useState("descriptionElementId"),p=l.useState("disablePointerDismissal"),f=l.useState("floatingRootContext"),g=l.useState("popupProps"),S=l.useState("modal"),C=l.useState("mounted"),w=l.useState("nested"),y=l.useState("nestedOpenDialogCount"),x=l.useState("open"),v=l.useState("openMethod"),b=l.useState("titleElementId"),E=l.useState("transitionStatus"),T=l.useState("role");l8(),Ur({open:x,ref:l.context.popupRef,onComplete(){x&&l.context.onOpenChangeComplete?.(!0)}});function A(z){return z==="touch"?l.context.popupRef.current:!0}const M=u===void 0?A:u,L=y>0,D=R.useMemo(()=>({open:x,nested:w,transitionStatus:E,nestedDialogOpen:L}),[x,w,E,L]),H=at("div",t,{state:D,props:[g,{"aria-labelledby":b??void 0,"aria-describedby":d??void 0,role:T,tabIndex:-1,hidden:!C,onKeyDown(z){R0.has(z.key)&&z.stopPropagation()},style:{[o8.nestedDialogs]:y}},a],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:_8});return _.jsx(pp,{context:f,openInteractionType:v,disabled:!C,closeOnFocusOut:!p,initialFocus:M,returnFocus:o,modal:S!==!1,restoreFocus:"popup",children:H})});function yp(e){return t0(19)?e:e?"true":void 0}const bp=R.forwardRef(function(t,n){const{cutout:s,...o}=t;let u;if(s){const h=s?.getBoundingClientRect();u=`polygon(
11
+ 0% 0%,
12
+ 100% 0%,
13
+ 100% 100%,
14
+ 0% 100%,
15
+ 0% 0%,
16
+ ${h.left}px ${h.top}px,
17
+ ${h.left}px ${h.bottom}px,
18
+ ${h.right}px ${h.bottom}px,
19
+ ${h.right}px ${h.top}px,
20
+ ${h.left}px ${h.top}px
21
+ )`}return _.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:u}})}),lk=R.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=wi(),h=u.useState("mounted"),a=u.useState("modal");return h||s?_.jsx(rk.Provider,{value:s,children:_.jsxs(hp,{ref:n,...o,children:[h&&a===!0&&_.jsx(bp,{ref:u.context.internalBackdropRef,inert:yp(!open)}),t.children]})}):null});let vC={},_C={},yC="";function y8(e){if(typeof document>"u")return!1;const t=br(e);return kn(t).innerWidth-t.documentElement.clientWidth>0}function b8(e){const t=br(e),n=t.documentElement,s=t.body,o=Aa(n)?n:s,u=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=u}}function x8(e){const t=br(e),n=t.documentElement,s=t.body,o=kn(n);let u=0,h=0;const a=Ns.create(),l=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(f0&&(o.visualViewport?.scale??1)!==1)return()=>{};function d(){const g=o.getComputedStyle(n),S=o.getComputedStyle(s),y=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";u=n.scrollTop,h=n.scrollLeft,vC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},yC=n.style.scrollBehavior,_C={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,v=n.scrollWidth>n.clientWidth,b=g.overflowY==="scroll"||S.overflowY==="scroll",E=g.overflowX==="scroll"||S.overflowX==="scroll",T=Math.max(0,o.innerWidth-n.clientWidth),A=Math.max(0,o.innerHeight-n.clientHeight),M=parseFloat(S.marginTop)+parseFloat(S.marginBottom),L=parseFloat(S.marginLeft)+parseFloat(S.marginRight),D=Aa(n)?n:s;if(l){n.style.scrollbarGutter=y,D.style.overflowY="hidden",D.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(x||b)&&(n.style.overflowY="scroll"),(v||E)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:M||A?`calc(100dvh - ${M+A}px)`:"100dvh",width:L||T?`calc(100vw - ${L+T}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=u,s.scrollLeft=h,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function p(){Object.assign(n.style,vC),Object.assign(s.style,_C),l||(n.scrollTop=u,n.scrollLeft=h,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=yC)}function f(){p(),a.request(d)}return d(),o.addEventListener("resize",f),()=>{a.cancel(),p(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",f)}}class S8{lockCount=0;restore=null;timeoutLock=Ra.create();timeoutUnlock=Ra.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const s=br(t).documentElement,o=kn(s).getComputedStyle(s).overflowY;if(o==="hidden"||o==="clip"){this.restore=on;return}const u=B4||!y8(t);this.restore=u?b8(t):x8(t)}}const C8=new S8;function xp(e=!0,t=null){Fe(()=>{if(e)return C8.acquire(t)},[e,t])}function w8(e){const t=R.useRef(""),n=R.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:R.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function Sp(e){const[t,n]=R.useState(null),s=Pe((a,l)=>{e||n(l)}),o=R.useCallback(()=>{n(null)},[]),{onClick:u,onPointerDown:h}=w8(s);return R.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:u,onPointerDown:h}}),[t,o,u,h])}function ck(e){const{store:t,parentContext:n,actionsRef:s}=e,o=t.useState("open"),u=t.useState("disablePointerDismissal"),h=t.useState("modal"),a=t.useState("popupElement"),{openMethod:l,triggerProps:d,reset:p}=Sp(o);XE(t);const{forceUnmount:f}=QE(o,t,()=>{p()}),g=Pe(H=>{const z=We(H);return z.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},z}),S=R.useCallback(()=>{t.setOpen(!1,g(iE))},[t,g]);R.useImperativeHandle(s,()=>({unmount:f,close:S}),[f,S]);const C=ek({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,y]=R.useState(0),x=w===0,v=nk(C),b=gp(C,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:h==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(H){if("button"in H&&H.button!==0||"touches"in H&&H.touches.length!==1)return!1;const z=Pn(H);if(x&&!u){const q=z;return h&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===q||t.context.backdropRef.current===q||ft(q,a)&&!q?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:x});xp(o&&h===!0,a);const{getReferenceProps:E,getFloatingProps:T,getTriggerProps:A}=oc([v,b]);t.useContextCallback("onNestedDialogOpen",H=>{y(H+1)}),t.useContextCallback("onNestedDialogClose",()=>{y(0)}),R.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(w),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,w]);const M=R.useMemo(()=>E(d),[E,d]),L=R.useMemo(()=>A(d),[A,d]),D=R.useMemo(()=>T(),[T]);t.useSyncedValues({openMethod:l,activeTriggerProps:M,inactiveTriggerProps:L,popupProps:D,floatingRootContext:C,nestedOpenDialogCount:w})}const E8={...JE,modal:we(e=>e.modal),nested:we(e=>e.nested),nestedOpenDialogCount:we(e=>e.nestedOpenDialogCount),disablePointerDismissal:we(e=>e.disablePointerDismissal),openMethod:we(e=>e.openMethod),descriptionElementId:we(e=>e.descriptionElementId),titleElementId:we(e=>e.titleElementId),viewportElement:we(e=>e.viewportElement),role:we(e=>e.role)};class uk extends S0{constructor(t){super(k8(t),{popupRef:R.createRef(),backdropRef:R.createRef(),internalBackdropRef:R.createRef(),triggerElements:new vp,onOpenChange:void 0,onOpenChangeComplete:void 0},E8)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const s={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",s);const o={open:t},u=n.trigger?.id??null;(u||t)&&(o.activeTriggerId=u,o.activeTriggerElement=n.trigger??null),this.update(o)}}function k8(e={}){return{...ZE(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function R8(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:u,disablePointerDismissal:h=!1,modal:a=!0,actionsRef:l,handle:d,triggerId:p,defaultTriggerId:f=null}=e,g=wi(!0),S=!!g,C=Gn(()=>d?.store??new uk({open:n??s,activeTriggerId:p!==void 0?p:f,modal:a,disablePointerDismissal:h,nested:S})).current;C.useControlledProp("open",n,s),C.useControlledProp("activeTriggerId",p,f),C.useSyncedValues({disablePointerDismissal:h,nested:S,modal:a}),C.useContextCallback("onOpenChange",o),C.useContextCallback("onOpenChangeComplete",u);const w=C.useState("payload");ck({store:C,actionsRef:l,parentContext:g?.store.context});const y=R.useMemo(()=>({store:C}),[C]);return _.jsx(l0.Provider,{value:y,children:typeof t=="function"?t({payload:w}):t})}const dk=R.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=wi(),l=ar(u);return a.useSyncedValueWithCleanup("titleElementId",l),at("h2",t,{ref:n,props:[{id:l},h]})}),fk=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,id:a,payload:l,handle:d,...p}=t,f=wi(!0),g=d?.store??f?.store;if(!g)throw new Error(Pt(79));const S=ar(a),C=g.useState("floatingRootContext"),w=g.useState("isOpenedByTrigger",S),y=R.useRef(null),{registerTrigger:x,isMountedByThisTrigger:v}=YE(S,y,g,{payload:l}),{getButtonProps:b,buttonRef:E}=xr({disabled:u,native:h}),T=sd(C,{enabled:C!=null}),A=oc([T]),M=R.useMemo(()=>({disabled:u,open:w}),[u,w]),L=g.useState("triggerProps",v);return at("button",t,{state:M,ref:[E,n,x,y],props:[A.getReferenceProps(),L,{[D2]:"",id:S},p,b],stateAttributesMapping:c0})});function xs({...e}){return _.jsx(R8,{"data-slot":"dialog",...e})}function hk({...e}){return _.jsx(fk,{"data-slot":"dialog-trigger",...e})}function T8({...e}){return _.jsx(lk,{"data-slot":"dialog-portal",...e})}function T0({...e}){return _.jsx(fp,{"data-slot":"dialog-close",...e})}function L8({className:e,...t}){return _.jsx(rE,{"data-slot":"dialog-overlay",className:He("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function Ss({className:e,children:t,showCloseButton:n=!0,...s}){return _.jsxs(T8,{children:[_.jsx(L8,{}),_.jsxs(ak,{"data-slot":"dialog-content",className:He("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...s,children:[t,n&&_.jsxs(fp,{"data-slot":"dialog-close",render:_.jsx(Be,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[_.jsx(_e,{icon:_o,strokeWidth:2}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Bs({className:e,...t}){return _.jsx("div",{"data-slot":"dialog-header",className:He("gap-1 flex flex-col",e),...t})}function go({className:e,showCloseButton:t=!1,children:n,...s}){return _.jsxs("div",{"data-slot":"dialog-footer",className:He("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...s,children:[n,t&&_.jsx(fp,{render:_.jsx(Be,{variant:"outline"}),children:"Close"})]})}function zs({className:e,...t}){return _.jsx(dk,{"data-slot":"dialog-title",className:He("text-sm font-medium",e),...t})}function aa({className:e,...t}){return _.jsx(oE,{"data-slot":"dialog-description",className:He("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3",e),...t})}let bC=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const A8={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Ia={valid(e){return e===null?null:e?{[bC.valid]:""}:{[bC.invalid]:""}}},O8=R.createContext({invalid:void 0,name:void 0,validityData:{state:A8,errors:[],error:"",value:"",initialValue:null},setValidityData:on,disabled:void 0,touched:!1,setTouched:on,dirty:!1,setDirty:on,filled:!1,setFilled:on,focused:!1,setFocused:on,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=tn)=>e,getInputValidationProps:(e=tn)=>e,inputRef:{current:null},commit:async()=>{}}});function us(e=!0){const t=R.useContext(O8);if(t.setValidityData===on&&!e)throw new Error(Pt(28));return t}const M8=R.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:on,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function ad(){return R.useContext(M8)}const D8=R.createContext({controlId:void 0,setControlId:on,labelId:void 0,setLabelId:on,messageIds:[],setMessageIds:on,getDescriptionProps:e=>e});function wo(){return R.useContext(D8)}function P8(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function as({controlled:e,default:t,name:n,state:s="value"}){const{current:o}=R.useRef(e!==void 0),[u,h]=R.useState(t),a=o?e:u,l=R.useCallback(d=>{o||h(d)},[]);return[a,l]}function Cp(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:o,setControlId:u}=wo(),h=ar(t);return Fe(()=>{if(!(!n&&!t||u===on)){if(n){const a=s?.current;Nt(a)&&a.closest("label")!=null?u(t??null):u(o??h)}else t&&u(t);return()=>{t&&u(void 0)}}},[t,s,o,u,n,h]),o??h}function ld(e){const{enabled:t=!0,value:n,id:s,name:o,controlRef:u,commit:h}=e,{formRef:a}=ad(),{invalid:l,markedDirtyRef:d,validityData:p,setValidityData:f}=us(),g=Pe(e.getValue);Fe(()=>{if(!t)return;let S=n;S===void 0&&(S=g()),p.initialValue===null&&S!==null&&f(C=>({...C,initialValue:S}))},[t,f,n,p.initialValue,g]),Fe(()=>{!t||!s||a.current.fields.set(s,{getValue:g,name:o,controlRef:u,validityData:P8(p,l),validate(){let S=n;S===void 0&&(S=g()),d.current=!0,er.flushSync(()=>h(S))}})},[h,u,t,a,g,s,l,d,o,p,n]),Fe(()=>{const S=a.current.fields;return()=>{s&&S.delete(s)}},[a,s])}const I8=R.forwardRef(function(t,n){const{render:s,className:o,id:u,name:h,value:a,disabled:l=!1,onValueChange:d,defaultValue:p,...f}=t,{state:g,name:S,disabled:C}=us(),w=C||l,y=S??h,x=R.useMemo(()=>({...g,disabled:w}),[g,w]),{setTouched:v,setDirty:b,validityData:E,setFocused:T,setFilled:A,validationMode:M,validation:L}=us(),{labelId:D}=wo(),H=Cp({id:u});Fe(()=>{const F=a!=null;L.inputRef.current?.value||F&&a!==""?A(!0):F&&a===""&&A(!1)},[L.inputRef,A,a]);const[z,q]=as({controlled:a,default:p,name:"FieldControl",state:"value"}),j=a!==void 0,K=Pe((F,G)=>{d?.(F,G),!G.isCanceled&&q(F)});return ld({id:H,name:y,commit:L.commit,value:z,getValue:()=>L.inputRef.current?.value,controlRef:L.inputRef}),at("input",t,{ref:n,state:x,props:[{id:H,disabled:w,name:y,ref:L.inputRef,"aria-labelledby":D,...j?{value:z}:{defaultValue:p},onChange(F){const G=F.currentTarget.value;K(G,We(Mn,F.nativeEvent)),b(G!==E.initialValue),A(G!=="")},onFocus(){T(!0)},onBlur(F){v(!0),T(!1),M==="onBlur"&&L.commit(F.currentTarget.value)},onKeyDown(F){F.currentTarget.tagName==="INPUT"&&F.key==="Enter"&&(v(!0),L.commit(F.currentTarget.value))}},L.getInputValidationProps(),f],stateAttributesMapping:Ia})}),j8=R.createContext({disabled:!1});function N8(){return R.useContext(j8)}const B8=R.createContext(void 0);function z8(e=!0){const t=R.useContext(B8);if(t===void 0&&!e)throw new Error(Pt(3));return t}const H8=R.forwardRef(function(t,n){return _.jsx(I8,{ref:n,...t})});function Wt({className:e,type:t,...n}){return _.jsx(H8,{type:t,"data-slot":"input",className:He("bg-input/20 dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-7 rounded-md border px-2 py-0.5 text-sm transition-colors file:h-6 file:text-xs/relaxed file:font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})}function wp({className:e,...t}){return _.jsx("textarea",{"data-slot":"textarea",className:He("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-md border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function V8({className:e,...t}){return _.jsx("label",{"data-slot":"label",className:He("gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",e),...t})}const F8=R.forwardRef(function(t,n){const{className:s,render:o,orientation:u="horizontal",...h}=t,a=R.useMemo(()=>({orientation:u}),[u]);return at("div",t,{state:a,ref:n,props:[{role:"separator","aria-orientation":u},h]})});function U8({className:e,orientation:t="horizontal",...n}){return _.jsx(F8,{"data-slot":"separator",orientation:t,className:He("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",e),...n})}function cd({className:e,...t}){return _.jsx("div",{"data-slot":"field-group",className:He("gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",e),...t})}const W8=Oa("data-[invalid=true]:text-destructive gap-2 group/field flex w-full",{variants:{orientation:{vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function Cn({className:e,orientation:t="vertical",...n}){return _.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:He(W8({orientation:t}),e),...n})}function wn({className:e,...t}){return _.jsx(V8,{"data-slot":"field-label",className:He("has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function oo({className:e,...t}){return _.jsx("p",{"data-slot":"field-description",className:He("text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function pk(e){const t=R.useRef(!0);t.current&&(t.current=!1,e())}const mk=R.createContext(null),gk=R.createContext(null);function $s(){const e=R.useContext(mk);if(e===null)throw new Error(Pt(60));return e}function vk(){const e=R.useContext(gk);if(e===null)throw new Error(Pt(61));return e}const _k=(e,t)=>Object.is(e,t);function Ci(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function la(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:Ci(s,t,n))}function Kl(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:Ci(s,t,n))}function yk(e,t,n){return e.filter(s=>!Ci(s,t,n))}function v_(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function bk(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function An(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return v_(e)}function ys(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?v_(e.value):v_(e)}function q8(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??An(e,n);if(Array.isArray(t)){const s=bk(t)?t.flatMap(o=>o.items):t;if(e==null){const o=s.find(u=>u.value==null);return o&&o.label!=null?o.label:An(e,n)}if(typeof e!="object"){const o=s.find(u=>u&&u.value===e);return o&&o.label!=null?o.label:An(e,n)}if("value"in e){const o=s.find(u=>u&&u.value===e.value);if(o&&o.label!=null)return o.label}}return An(e,n)}function G8(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>An(n,t)).join(", ")}const ht={id:we(e=>e.id),modal:we(e=>e.modal),multiple:we(e=>e.multiple),items:we(e=>e.items),itemToStringLabel:we(e=>e.itemToStringLabel),itemToStringValue:we(e=>e.itemToStringValue),isItemEqualToValue:we(e=>e.isItemEqualToValue),value:we(e=>e.value),open:we(e=>e.open),mounted:we(e=>e.mounted),forceMount:we(e=>e.forceMount),transitionStatus:we(e=>e.transitionStatus),openMethod:we(e=>e.openMethod),activeIndex:we(e=>e.activeIndex),selectedIndex:we(e=>e.selectedIndex),isActive:we((e,t)=>e.activeIndex===t),isSelected:we((e,t,n)=>{const s=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(u=>Ci(u,n,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Ci(o,n,s)}),isSelectedByFocus:we((e,t)=>e.selectedIndex===t),popupProps:we(e=>e.popupProps),triggerProps:we(e=>e.triggerProps),triggerElement:we(e=>e.triggerElement),positionerElement:we(e=>e.positionerElement),listElement:we(e=>e.listElement),scrollUpArrowVisible:we(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:we(e=>e.scrollDownArrowVisible),hasScrollArrows:we(e=>e.hasScrollArrows),serializedValue:we(e=>{const{multiple:t,value:n,itemToStringValue:s}=e;return t&&Array.isArray(n)&&n.length===0?"":ys(n,s)})};function ca(e,t){const n=R.useRef(e),s=Pe(t);Fe(()=>{n.current!==e&&s(n.current)},[e,s]),Fe(()=>{n.current=e},[e])}function $8(e){const{id:t,value:n,defaultValue:s=null,onValueChange:o,open:u,defaultOpen:h=!1,onOpenChange:a,name:l,disabled:d=!1,readOnly:p=!1,required:f=!1,modal:g=!0,actionsRef:S,inputRef:C,onOpenChangeComplete:w,items:y,multiple:x=!1,itemToStringLabel:v,itemToStringValue:b,isItemEqualToValue:E=_k,highlightItemOnHover:T=!0,children:A}=e,{clearErrors:M}=ad(),{setDirty:L,shouldValidateOnChange:D,validityData:H,setFilled:z,name:q,disabled:j,validation:K}=us(),{controlId:$}=wo(),F=Cp({id:t}),G=j||d,U=q??l,[P,B]=as({controlled:n,default:x?s??yr:s,name:"Select",state:"value"}),[I,W]=as({controlled:u,default:h,name:"Select",state:"open"}),Y=R.useRef([]),J=R.useRef([]),Z=R.useRef(null),ee=R.useRef(null),X=R.useRef(0),V=R.useRef(null),se=R.useRef([]),ne=R.useRef(!1),re=R.useRef(!1),oe=R.useRef(null),le=R.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ve=R.useRef(!1),{mounted:ue,setMounted:he,transitionStatus:de}=ki(I),{openMethod:Ne,triggerProps:Me,reset:Ae}=Sp(I),be=Gn(()=>new va({id:F,modal:g,multiple:x,itemToStringLabel:v,itemToStringValue:b,isItemEqualToValue:E,value:P,open:I,mounted:ue,transitionStatus:de,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Oe=Le(be,ht.activeIndex),me=Le(be,ht.selectedIndex),ke=Le(be,ht.triggerElement),Ce=Le(be,ht.positionerElement),qe=R.useMemo(()=>x&&Array.isArray(P)&&P.length===0?"":ys(P,b),[x,P,b]),De=R.useMemo(()=>x&&Array.isArray(P)?P.map(ot=>ys(ot,b)):ys(P,b),[x,P,b]),Ie=hn(be.state.triggerElement);ld({id:F,commit:K.commit,value:P,controlRef:Ie,name:U,getValue:()=>De});const rt=R.useRef(P);Fe(()=>{P!==rt.current&&be.set("forceMount",!0)},[be,P]),Fe(()=>{z(P!==null)},[P,z]),Fe(function(){if(I)return;const wt=se.current;if(x){const xt=Array.isArray(P)?P:[];if(xt.length===0){be.set("selectedIndex",null);return}const Qe=xt[xt.length-1],Ht=Kl(wt,Qe,E);be.set("selectedIndex",Ht===-1?null:Ht);return}const bt=Kl(wt,P,E);be.set("selectedIndex",bt===-1?null:bt)},[x,I,P,se,E,be]),ca(P,()=>{M(U),L(P!==H.initialValue),D()?K.commit(P):K.commit(P,!0)});const et=Pe((ot,wt)=>{if(a?.(ot,wt),!wt.isCanceled&&(W(ot),!ot&&be.state.activeIndex!==null)){const bt=Y.current[be.state.activeIndex];queueMicrotask(()=>{bt?.setAttribute("tabindex","-1")})}}),dt=Pe(()=>{he(!1),be.set("activeIndex",null),Ae(),w?.(!1)});Ur({enabled:!S,open:I,ref:Z,onComplete(){I||dt()}}),R.useImperativeHandle(S,()=>({unmount:dt}),[dt]);const xe=Pe((ot,wt)=>{o?.(ot,wt),!wt.isCanceled&&B(ot)}),Ve=Pe(()=>{const ot=be.state.listElement||Z.current;if(!ot)return;const wt=ot.scrollTop,bt=ot.scrollTop+ot.clientHeight,xt=wt>1,Qe=bt<ot.scrollHeight-1;be.state.scrollUpArrowVisible!==xt&&be.set("scrollUpArrowVisible",xt),be.state.scrollDownArrowVisible!==Qe&&be.set("scrollDownArrowVisible",Qe)}),Ee=w0({open:I,onOpenChange:et,elements:{reference:ke,floating:Ce}}),tt=sd(Ee,{enabled:!p&&!G,event:"mousedown"}),lt=gp(Ee,{bubbles:!1}),Xe=E0(Ee,{enabled:!p&&!G,listRef:Y,activeIndex:Oe,selectedIndex:me,disabledIndices:yr,onNavigate(ot){ot===null&&!I||be.set("activeIndex",ot)},focusItemOnHover:!1}),st=k0(Ee,{enabled:!p&&!G&&(I||!x),listRef:J,activeIndex:Oe,selectedIndex:me,onMatch(ot){I?be.set("activeIndex",ot):xe(se.current[ot],We("none"))},onTypingChange(ot){ne.current=ot}}),{getReferenceProps:Ct,getFloatingProps:ct,getItemProps:nn}=oc([tt,lt,Xe,st]),Rt=R.useMemo(()=>Ws(Ct(),Me),[Ct,Me]);pk(()=>{be.update({popupProps:ct(),triggerProps:Rt})}),Fe(()=>{be.update({id:F,modal:g,multiple:x,value:P,open:I,mounted:ue,transitionStatus:de,popupProps:ct(),triggerProps:Rt,items:y,itemToStringLabel:v,itemToStringValue:b,isItemEqualToValue:E,openMethod:Ne})},[be,F,g,x,P,I,ue,de,ct,Rt,y,v,b,E,Ne]);const vt=R.useMemo(()=>({store:be,name:U,required:f,disabled:G,readOnly:p,multiple:x,itemToStringLabel:v,itemToStringValue:b,highlightItemOnHover:T,setValue:xe,setOpen:et,listRef:Y,popupRef:Z,scrollHandlerRef:ee,handleScrollArrowVisibility:Ve,scrollArrowsMountedCountRef:X,getItemProps:nn,events:Ee.context.events,valueRef:V,valuesRef:se,labelsRef:J,typingRef:ne,selectionRef:le,selectedItemTextRef:oe,validation:K,onOpenChangeComplete:w,keyboardActiveRef:re,alignItemWithTriggerActiveRef:ve,initialValueRef:rt}),[be,U,f,G,p,x,v,b,T,xe,et,nn,Ee.context.events,K,w,Ve]),Je=cs(C,K.inputRef),Ot=x&&Array.isArray(P)&&P.length>0,jt=R.useMemo(()=>!x||!Array.isArray(P)||!U?null:P.map(ot=>{const wt=ys(ot,b);return _.jsx("input",{type:"hidden",name:U,value:wt},wt)}),[x,P,U,b]);return _.jsx(mk.Provider,{value:vt,children:_.jsxs(gk.Provider,{value:Ee,children:[A,_.jsx("input",{...K.getInputValidationProps({onFocus(){be.state.triggerElement?.focus()},onChange(ot){if(ot.nativeEvent.defaultPrevented)return;const wt=ot.target.value,bt=We(Mn,ot.nativeEvent);function xt(){if(x)return;const Qe=se.current.find(Ht=>ys(Ht,b).toLowerCase()===wt.toLowerCase());Qe!=null&&(L(Qe!==H.initialValue),xe(Qe,bt),D()&&K.commit(Qe))}be.set("forceMount",!0),queueMicrotask(xt)}}),id:t||$||void 0,name:x?void 0:U,value:qe,disabled:G,required:f&&!Ot,readOnly:p,ref:Je,style:ic,tabIndex:-1,"aria-hidden":!0}),jt]})})}function L0(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),s=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||s.content!=="none"))return t;const u=parseFloat(n.width)||0,h=parseFloat(n.height)||0,a=parseFloat(s.width)||0,l=parseFloat(s.height)||0,d=Math.max(t.width,u,a),p=Math.max(t.height,h,l),f=d-t.width,g=p-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-g/2,bottom:t.bottom+g/2}}const Yf=2,K8={...zu,...Ia,value:()=>null},Y8=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,...a}=t,{setTouched:l,setFocused:d,validationMode:p,state:f,disabled:g}=us(),{labelId:S}=wo(),{store:C,setOpen:w,selectionRef:y,validation:x,readOnly:v,alignItemWithTriggerActiveRef:b,disabled:E,keyboardActiveRef:T}=$s(),A=g||E||u,M=Le(C,ht.open),L=Le(C,ht.value),D=Le(C,ht.triggerProps),H=Le(C,ht.positionerElement),z=Le(C,ht.listElement),q=Le(C,ht.serializedValue),j=hn(H),K=R.useRef(null),$=Qt(),F=Qt(),{getButtonProps:G,buttonRef:U}=xr({disabled:A,native:h}),P=Pe(ee=>{C.set("triggerElement",ee)}),B=cs(n,K,U,P),I=Qt(),W=Qt();R.useEffect(()=>{if(M)return W.start(200,()=>{y.current.allowUnselectedMouseUp=!0,I.start(200,()=>{y.current.allowSelectedMouseUp=!0})}),()=>{I.clear(),W.clear()};y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},F.clear()},[M,y,F,I,W]);const Y=R.useMemo(()=>z?.id??Hu(H)?.id,[z,H]),J=Ws(D,{role:"combobox","aria-expanded":M?"true":"false","aria-haspopup":"listbox","aria-controls":M?Y:void 0,"aria-labelledby":S,"aria-readonly":v||void 0,tabIndex:A?-1:0,ref:B,onFocus(ee){d(!0),M&&b.current&&w(!1,We(ka,ee.nativeEvent)),$.start(0,()=>{C.set("forceMount",!0)})},onBlur(){l(!0),d(!1),p==="onBlur"&&x.commit(L)},onPointerMove(){T.current=!1},onKeyDown(){T.current=!0},onMouseDown(ee){if(M)return;const X=br(ee.currentTarget);function V(se){if(!K.current)return;const ne=se.target;if(ft(K.current,ne)||ft(j.current,ne)||ne===K.current)return;const re=L0(K.current);se.clientX>=re.left-Yf&&se.clientX<=re.right+Yf&&se.clientY>=re.top-Yf&&se.clientY<=re.bottom+Yf||w(!1,We(sE,se))}F.start(0,()=>{X.addEventListener("mouseup",V,{once:!0})})}},x.getValidationProps,a,G);J.role="combobox";const Z=R.useMemo(()=>({...f,open:M,disabled:A,value:L,readOnly:v,placeholder:!q}),[f,M,A,L,v,q]);return at("button",t,{ref:[n,K],state:Z,stateAttributesMapping:K8,props:J})}),X8={value:()=>null},Q8=R.forwardRef(function(t,n){const{className:s,render:o,children:u,...h}=t,{store:a,valueRef:l}=$s(),d=Le(a,ht.value),p=Le(a,ht.items),f=Le(a,ht.itemToStringLabel),g=Le(a,ht.serializedValue),S=R.useMemo(()=>({value:d,placeholder:!g}),[d,g]),C=typeof u=="function"?u(d):u??(Array.isArray(d)?G8(d,f):q8(d,p,f));return at("span",t,{state:S,ref:[n,l],props:[{children:C},h],stateAttributesMapping:X8})}),Z8=R.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h}=$s(),a=Le(h,ht.open),l=R.useMemo(()=>({open:a}),[a]);return at("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:c0})}),J8=R.createContext(void 0),eP=R.forwardRef(function(t,n){const{store:s}=$s(),o=Le(s,ht.mounted),u=Le(s,ht.forceMount);return o||u?_.jsx(J8.Provider,{value:!0,children:_.jsx(hp,{ref:n,...t})}):null}),xk=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function tP(){return R.useContext(xk)}function ud(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:o}=e,u=Pe(o),h=R.useRef(0),a=Gn(rP).current,l=Gn(nP).current,[d,p]=R.useState(0),f=R.useRef(d),g=Pe((x,v)=>{l.set(x,v??null),f.current+=1,p(f.current)}),S=Pe(x=>{l.delete(x),f.current+=1,p(f.current)}),C=R.useMemo(()=>{const x=new Map;return Array.from(l.keys()).filter(b=>b.isConnected).sort(sP).forEach((b,E)=>{const T=l.get(b)??{};x.set(b,{...T,index:E})}),x},[l,d]);Fe(()=>{if(typeof MutationObserver!="function"||C.size===0)return;const x=new MutationObserver(v=>{const b=new Set,E=T=>b.has(T)?b.delete(T):b.add(T);v.forEach(T=>{T.removedNodes.forEach(E),T.addedNodes.forEach(E)}),b.size===0&&(f.current+=1,p(f.current))});return C.forEach((v,b)=>{b.parentElement&&x.observe(b.parentElement,{childList:!0})}),()=>{x.disconnect()}},[C]),Fe(()=>{f.current===d&&(n.current.length!==C.size&&(n.current.length=C.size),s&&s.current.length!==C.size&&(s.current.length=C.size),h.current=C.size),u(C)},[u,C,n,s,d]),Fe(()=>()=>{n.current=[]},[n]),Fe(()=>()=>{s&&(s.current=[])},[s]);const w=Pe(x=>(a.add(x),()=>{a.delete(x)}));Fe(()=>{a.forEach(x=>x(C))},[a,C]);const y=R.useMemo(()=>({register:g,unregister:S,subscribeMapChange:w,elementsRef:n,labelsRef:s,nextIndexRef:h}),[g,S,w,n,s,h]);return _.jsx(xk.Provider,{value:y,children:t})}function nP(){return new Map}function rP(){return new Set}function sP(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const iP=R.createContext(void 0);function ja(){return R.useContext(iP)?.direction??"ltr"}const oP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:u,platform:h,elements:a,middlewareData:l}=t,{element:d,padding:p=0,offsetParent:f="real"}=Si(e,t)||{};if(d==null)return{};const g=vE(p),S={x:n,y:s},C=v0(o),w=g0(C),y=await h.getDimensions(d),x=C==="y",v=x?"top":"left",b=x?"bottom":"right",E=x?"clientHeight":"clientWidth",T=u.reference[w]+u.reference[C]-S[C]-u.floating[w],A=S[C]-u.reference[C],M=f==="real"?await h.getOffsetParent?.(d):a.floating;let L=a.floating[E]||u.floating[w];(!L||!await h.isElement?.(M))&&(L=a.floating[E]||u.floating[w]);const D=T/2-A/2,H=L/2-y[w]/2-1,z=Math.min(g[v],H),q=Math.min(g[b],H),j=z,K=L-y[w]-q,$=L/2-y[w]/2+D,F=d_(j,$,K),G=!l.arrow&&So(o)!=null&&$!==F&&u.reference[w]/2-($<j?z:q)-y[w]/2<0,U=G?$<j?$-j:$-K:0;return{[C]:S[C]+U,data:{[C]:F,centerOffset:$-F-U,...G&&{alignmentOffset:U}},reset:G}}}),aP=(e,t)=>({...oP(e),options:[e,t]}),lP={name:"hide",async fn(e){const{width:t,height:n,x:s,y:o}=e.rects.reference,u=t===0&&n===0&&s===0&&o===0;return{data:{referenceHidden:(await _6().fn(e)).data?.referenceHidden||u}}}},cP={sideX:"left",sideY:"top"};function Sk(e,t,n){const s=e==="inline-start"||e==="inline-end";return{top:"top",right:s?n?"inline-start":"inline-end":"right",bottom:"bottom",left:s?n?"inline-end":"inline-start":"left"}[t]}function xC(e,t,n){const{rects:s,placement:o}=e;return{side:Sk(t,Hr(o),n),align:So(o)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function A0(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:h=0,collisionBoundary:a,collisionPadding:l=5,sticky:d=!1,arrowPadding:p=5,disableAnchorTracking:f=!1,keepMounted:g=!1,floatingRootContext:S,mounted:C,collisionAvoidance:w,shiftCrossAxis:y=!1,nodeId:x,adaptiveOrigin:v,lazyFlip:b=!1,externalTree:E}=e,[T,A]=R.useState(null);!C&&T!==null&&A(null);const M=w.side||"flip",L=w.align||"flip",D=w.fallbackAxisSide||"end",H=typeof t=="function"?t:void 0,z=Pe(H),q=H?z:t,j=hn(t),$=ja()==="rtl",F=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":$?"left":"right","inline-start":$?"right":"left"}[s],G=u==="center"?F:`${F}-${u}`;let U=l;const P=1,B=s==="bottom"?P:0,I=s==="top"?P:0,W=s==="right"?P:0,Y=s==="left"?P:0;typeof U=="number"?U={top:U+B,right:U+Y,bottom:U+I,left:U+W}:U&&(U={top:(U.top||0)+B,right:(U.right||0)+Y,bottom:(U.bottom||0)+I,left:(U.left||0)+W});const J={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:U},Z=R.useRef(null),ee=hn(o),X=hn(h),ne=[h6(Xe=>{const st=xC(Xe,s,$),Ct=typeof ee.current=="function"?ee.current(st):ee.current,ct=typeof X.current=="function"?X.current(st):X.current;return{mainAxis:Ct,crossAxis:ct,alignmentAxis:ct}},[typeof o!="function"?o:0,typeof h!="function"?h:0,$,s])],re=L==="none"&&M!=="shift",oe=!re&&(d||y||M==="shift"),le=M==="none"?null:g6({...J,padding:{top:U.top+P,right:U.right+P,bottom:U.bottom+P,left:U.left+P},mainAxis:!y&&M==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),ve=re?null:p6(Xe=>{const st=br(Xe.elements.floating).documentElement;return{...J,rootBoundary:y?{x:0,y:0,width:st.clientWidth,height:st.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:oe,limiter:d||y?void 0:m6(Ct=>{if(!Z.current)return{};const{width:ct,height:nn}=Z.current.getBoundingClientRect(),Rt=rs(Hr(Ct.placement)),vt=Rt==="y"?ct:nn,Je=Rt==="y"?U.left+U.right:U.top+U.bottom;return{offset:vt/2+Je/2}})}},[J,d,y,U,L]);M==="shift"||L==="shift"||u==="center"?ne.push(ve,le):ne.push(le,ve),ne.push(v6({...J,apply({elements:{floating:Xe},rects:{reference:st},availableWidth:Ct,availableHeight:ct}){Object.entries({"--available-width":`${Ct}px`,"--available-height":`${ct}px`,"--anchor-width":`${st.width}px`,"--anchor-height":`${st.height}px`}).forEach(([nn,Rt])=>{Xe.style.setProperty(nn,Rt)})}}),aP(()=>({element:Z.current||document.createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(Xe){const{elements:st,middlewareData:Ct,placement:ct,rects:nn,y:Rt}=Xe,vt=Hr(ct),Je=rs(vt),Ot=Z.current,jt=Ct.arrow?.x||0,ot=Ct.arrow?.y||0,wt=Ot?.clientWidth||0,bt=Ot?.clientHeight||0,xt=jt+wt/2,Qe=ot+bt/2,Ht=Math.abs(Ct.shift?.y||0),Rn=nn.reference.height/2,Yn=typeof o=="function"?o(xC(Xe,s,$)):o,zn=Ht>Yn,Es={top:`${xt}px calc(100% + ${Yn}px)`,bottom:`${xt}px ${-Yn}px`,left:`calc(100% + ${Yn}px) ${Qe}px`,right:`${-Yn}px ${Qe}px`}[vt],Fa=`${xt}px ${nn.reference.y+Rn-Rt}px`;return st.floating.style.setProperty("--transform-origin",oe&&Je==="y"&&zn?Fa:Es),{}}},lP,v),Fe(()=>{!C&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[C,S]);const ue=R.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:he,elements:de,x:Ne,y:Me,middlewareData:Ae,update:be,placement:Oe,context:me,isPositioned:ke,floatingStyles:Ce}=q6({rootContext:S,placement:G,middleware:ne,strategy:n,whileElementsMounted:g?void 0:(...Xe)=>lC(...Xe,ue),nodeId:x,externalTree:E}),{sideX:qe,sideY:De}=Ae.adaptiveOrigin||cP,Ie=ke?n:"fixed",rt=R.useMemo(()=>v?{position:Ie,[qe]:Ne,[De]:Me}:{position:Ie,...Ce},[v,Ie,qe,Ne,De,Me,Ce]),et=R.useRef(null);Fe(()=>{if(!C)return;const Xe=j.current,st=typeof Xe=="function"?Xe():Xe,ct=(SC(st)?st.current:st)||null||null;ct!==et.current&&(he.setPositionReference(ct),et.current=ct)},[C,he,q,j]),R.useEffect(()=>{if(!C)return;const Xe=j.current;typeof Xe!="function"&&SC(Xe)&&Xe.current!==et.current&&(he.setPositionReference(Xe.current),et.current=Xe.current)},[C,he,q,j]),R.useEffect(()=>{if(g&&C&&de.domReference&&de.floating)return lC(de.domReference,de.floating,be,ue)},[g,C,de,be,ue]);const dt=Hr(Oe),xe=Sk(s,dt,$),Ve=So(Oe)||"center",Ee=!!Ae.hide?.referenceHidden;Fe(()=>{b&&C&&ke&&A(dt)},[b,C,ke,dt]);const tt=R.useMemo(()=>({position:"absolute",top:Ae.arrow?.y,left:Ae.arrow?.x}),[Ae.arrow]),lt=Ae.arrow?.centerOffset!==0;return R.useMemo(()=>({positionerStyles:rt,arrowStyles:tt,arrowRef:Z,arrowUncentered:lt,side:xe,align:Ve,physicalSide:dt,anchorHidden:Ee,refs:he,context:me,isPositioned:ke,update:be}),[rt,tt,Z,lt,xe,Ve,dt,Ee,he,me,ke,be])}function SC(e){return e!=null&&"current"in e}const Ck=R.createContext(void 0);function O0(){const e=R.useContext(Ck);if(!e)throw new Error(Pt(59));return e}function Fh(e,t){e&&Object.assign(e.style,t)}const wk={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},uP={position:"fixed"},dP=R.forwardRef(function(t,n){const{anchor:s,positionMethod:o="absolute",className:u,render:h,side:a="bottom",align:l="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g,arrowPadding:S=5,sticky:C=!1,disableAnchorTracking:w,alignItemWithTrigger:y=!0,collisionAvoidance:x=n0,...v}=t,{store:b,listRef:E,labelsRef:T,alignItemWithTriggerActiveRef:A,selectedItemTextRef:M,valuesRef:L,initialValueRef:D,popupRef:H,setValue:z}=$s(),q=vk(),j=Le(b,ht.open),K=Le(b,ht.mounted),$=Le(b,ht.modal),F=Le(b,ht.value),G=Le(b,ht.openMethod),U=Le(b,ht.positionerElement),P=Le(b,ht.triggerElement),B=Le(b,ht.isItemEqualToValue),I=R.useRef(null),W=R.useRef(null),[Y,J]=R.useState(y),Z=K&&Y&&G!=="touch";!K&&Y!==y&&J(y),Fe(()=>{K||(ht.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),ht.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,K]),R.useImperativeHandle(A,()=>Z),xp((Z||$)&&j&&G!=="touch",P);const ee=A0({anchor:s,floatingRootContext:q,positionMethod:o,mounted:K,side:a,sideOffset:d,align:l,alignOffset:p,arrowPadding:S,collisionBoundary:f,collisionPadding:g,sticky:C,disableAnchorTracking:w??Z,collisionAvoidance:x,keepMounted:!0}),X=Z?"none":ee.side,V=Z?uP:ee.positionerStyles,se=R.useMemo(()=>{const he={};return j||(he.pointerEvents="none"),{role:"presentation",hidden:!K,style:{...V,...he}}},[j,K,V]),ne=R.useMemo(()=>({open:j,side:X,align:ee.align,anchorHidden:ee.anchorHidden}),[j,X,ee.align,ee.anchorHidden]),re=Pe(he=>{b.set("positionerElement",he)}),oe=at("div",t,{ref:[n,re],state:ne,stateAttributesMapping:xo,props:[se,v]}),le=R.useRef(0),ve=Pe(he=>{if(he.size===0&&le.current===0||L.current.length===0)return;const de=le.current;if(le.current=he.size,he.size===de)return;const Ne=We(Mn);if(de!==0&&!b.state.multiple&&F!==null&&Kl(L.current,F,B)===-1){const Ae=D.current,Oe=Ae!=null&&la(L.current,Ae,B)?Ae:null;z(Oe,Ne),Oe===null&&(b.set("selectedIndex",null),M.current=null)}if(de!==0&&b.state.multiple&&Array.isArray(F)){const Me=F.filter(Ae=>la(L.current,Ae,B));(Me.length!==F.length||Me.some(Ae=>!la(F,Ae,B)))&&(z(Me,Ne),Me.length===0&&(b.set("selectedIndex",null),M.current=null))}if(j&&Z){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Me={height:""};Fh(U,Me),Fh(H.current,Me)}}),ue=R.useMemo(()=>({...ee,side:X,alignItemWithTriggerActive:Z,setControlledAlignItemWithTrigger:J,scrollUpArrowRef:I,scrollDownArrowRef:W}),[ee,X,Z,J]);return _.jsx(ud,{elementsRef:E,labelsRef:T,onMapChange:ve,children:_.jsxs(Ck.Provider,{value:ue,children:[K&&$&&_.jsx(bp,{inert:yp(!j),cutout:P}),oe]})})});function Ek(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Xf="base-ui-disable-scrollbar",Wu={className:Xf,element:_.jsx("style",{href:Xf,precedence:"base-ui:low",children:`.${Xf}{scrollbar-width:none}.${Xf}::-webkit-scrollbar{display:none}`})},fP=R.createContext(void 0);function M0(e){return R.useContext(fP)}function D0(e){return e==="starting"?iM:tn}const hP={...xo,...Gs},pP=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{store:h,popupRef:a,onOpenChangeComplete:l,setOpen:d,valueRef:p,selectedItemTextRef:f,keyboardActiveRef:g,multiple:S,handleScrollArrowVisibility:C,scrollHandlerRef:w}=$s(),{side:y,align:x,alignItemWithTriggerActive:v,setControlledAlignItemWithTrigger:b,scrollDownArrowRef:E,scrollUpArrowRef:T}=O0(),A=M0()!=null,M=vk(),L=Qt(),D=Le(h,ht.id),H=Le(h,ht.open),z=Le(h,ht.mounted),q=Le(h,ht.popupProps),j=Le(h,ht.transitionStatus),K=Le(h,ht.triggerElement),$=Le(h,ht.positionerElement),F=Le(h,ht.listElement),G=R.useRef(0),U=R.useRef(!1),P=R.useRef(0),B=R.useRef(!1),I=R.useRef({}),W=rd(),Y=Pe(X=>{if(!$||!a.current||!B.current)return;if(U.current||!v){C();return}const V=$.style.top==="0px",se=$.style.bottom==="0px",ne=$.getBoundingClientRect().height,re=br($),oe=getComputedStyle($),le=parseFloat(oe.marginTop),ve=parseFloat(oe.marginBottom),ue=re.documentElement.clientHeight-le-ve,he=X.scrollTop,de=X.scrollHeight,Ne=X.clientHeight,Me=de-Ne;let Ae=null,be=null,Oe=!1;if(V){const me=Me-he,ke=ne+me,Ce=Math.min(ke,ue);Ae=Ce,Ce!==ue?be=Me:Oe=!0}else if(se){const me=he-0,ke=ne+me,Ce=Math.min(ke,ue),qe=ke-ue;Ae=Ce,Ce!==ue?be=0:(Oe=!0,he<Me&&(be=he-(me-qe)))}Ae!=null&&($.style.height=`${Ae}px`),be!=null&&(X.scrollTop=be),Oe&&(U.current=!0),C()});R.useImperativeHandle(w,()=>Y,[Y]),Ur({open:H,ref:a,onComplete(){H&&l?.(!0)}});const J=R.useMemo(()=>({open:H,transitionStatus:j,side:y,align:x}),[H,j,y,x]);Fe(()=>{!$||!a.current||Object.keys(I.current).length||(I.current={top:$.style.top||"0",left:$.style.left||"0",right:$.style.right,height:$.style.height,bottom:$.style.bottom,minHeight:$.style.minHeight,maxHeight:$.style.maxHeight,marginTop:$.style.marginTop,marginBottom:$.style.marginBottom})},[a,$]),Fe(()=>{z||v||(B.current=!1,U.current=!1,G.current=0,P.current=0,Fh($,I.current))},[z,v,$,a]),Fe(()=>{const X=a.current;if(!(!z||!K||!$||!X)){if(!v){B.current=!0,W.request(C);return}queueMicrotask(()=>{const V=getComputedStyle($),se=getComputedStyle(X),ne=br(K),re=kn($),oe=K.getBoundingClientRect(),le=$.getBoundingClientRect(),ve=oe.left,ue=oe.height,he=F||X,de=he.scrollHeight,Ne=parseFloat(se.borderBottomWidth),Me=parseFloat(V.marginTop)||10,Ae=parseFloat(V.marginBottom)||10,be=parseFloat(V.minHeight)||100,Oe=5,me=5,ke=20,Ce=ne.documentElement.clientHeight-Me-Ae,qe=ne.documentElement.clientWidth,De=Ce-oe.bottom+ue,Ie=f.current,rt=p.current;let et=0,dt=0;if(Ie&&rt){const vt=rt.getBoundingClientRect(),Je=Ie.getBoundingClientRect(),Ot=vt.left-ve,jt=Je.left-le.left,ot=vt.top-oe.top+vt.height/2,wt=Je.top-le.top+Je.height/2;et=Ot-jt,dt=wt-ot}const xe=De+dt+Ae+Ne;let Ve=Math.min(Ce,xe);const Ee=Ce-Me-Ae,tt=xe-Ve,lt=Math.max(Oe,ve+et),Xe=qe-me,st=Math.max(0,lt+le.width-Xe);$.style.left=`${lt-st}px`,$.style.height=`${Ve}px`,$.style.maxHeight="auto",$.style.marginTop=`${Me}px`,$.style.marginBottom=`${Ae}px`,X.style.height="100%";const Ct=he.scrollHeight-he.clientHeight,ct=tt>=Ct;ct&&(Ve=Math.min(Ce,le.height)-(tt-Ct));const nn=oe.top<ke||oe.bottom>Ce-ke||Ve<Math.min(de,be),Rt=(re.visualViewport?.scale??1)!==1&&f0;if(nn||Rt){B.current=!0,Fh($,I.current),er.flushSync(()=>b(!1));return}if(ct){const vt=Math.max(0,Ce-xe);$.style.top=le.height>=Ee?"0":`${vt}px`,$.style.height=`${Ve}px`,he.scrollTop=he.scrollHeight-he.clientHeight,G.current=Math.max(be,Ve)}else $.style.bottom="0",G.current=Math.max(be,Ve),he.scrollTop=tt;G.current===Ce&&(U.current=!0),C(),setTimeout(()=>{B.current=!0})})}},[h,z,$,K,p,f,a,C,v,b,W,E,T,F]),R.useEffect(()=>{if(!v||!$||!z)return;const X=kn($);function V(se){d(!1,We(D4,se))}return X.addEventListener("resize",V),()=>{X.removeEventListener("resize",V)}},[d,v,$,z]);const Z={...F?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${D}-list`},onKeyDown(X){g.current=!0,A&&R0.has(X.key)&&X.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(X){if(Ek(X)||X.pointerType==="touch")return;const V=X.currentTarget;L.start(0,()=>{h.set("activeIndex",null),V.focus({preventScroll:!0})})},onScroll(X){F||w.current?.(X.currentTarget)},...v&&{style:F?{height:"100%"}:wk}},ee=at("div",t,{ref:[n,a],state:J,stateAttributesMapping:hP,props:[q,Z,D0(j),{className:!F&&v?Wu.className:void 0},u]});return _.jsxs(R.Fragment,{children:[Wu.element,_.jsx(pp,{context:M,modal:!1,disabled:!z,restoreFocus:!0,children:ee})]})}),mP=R.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h,scrollHandlerRef:a}=$s(),{alignItemWithTriggerActive:l}=O0(),d=Le(h,ht.hasScrollArrows),p=Le(h,ht.openMethod),f=Le(h,ht.multiple),S={id:`${Le(h,ht.id)}-list`,role:"listbox","aria-multiselectable":f||void 0,onScroll(w){a.current?.(w.currentTarget)},...l&&{style:wk},className:d&&p!=="touch"?Wu.className:void 0},C=Pe(w=>{h.set("listElement",w)});return at("div",t,{ref:[n,C],props:[S,u]})});let P0=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function ac(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:o,index:u}=e,{register:h,unregister:a,subscribeMapChange:l,elementsRef:d,labelsRef:p,nextIndexRef:f}=tP(),g=R.useRef(-1),[S,C]=R.useState(u??(o===P0.GuessFromOrder?()=>{if(g.current===-1){const x=f.current;f.current+=1,g.current=x}return g.current}:-1)),w=R.useRef(null),y=R.useCallback(x=>{if(w.current=x,S!==-1&&x!==null&&(d.current[S]=x,p)){const v=t!==void 0;p.current[S]=v?t:s?.current?.textContent??x.textContent}},[S,d,p,t,s]);return Fe(()=>{if(u!=null)return;const x=w.current;if(x)return h(x,n),()=>{a(x)}},[u,h,a,n]),Fe(()=>{if(u==null)return l(x=>{const v=w.current?x.get(w.current)?.index:null;v!=null&&C(v)})},[u,l,C]),R.useMemo(()=>({ref:y,index:S}),[S,y])}const kk=R.createContext(void 0);function I0(){const e=R.useContext(kk);if(!e)throw new Error(Pt(57));return e}const gP=R.memo(R.forwardRef(function(t,n){const{render:s,className:o,value:u=null,label:h,disabled:a=!1,nativeButton:l=!1,...d}=t,p=R.useRef(null),f=ac({label:h,textRef:p,indexGuessBehavior:P0.GuessFromOrder}),{store:g,getItemProps:S,setOpen:C,setValue:w,selectionRef:y,typingRef:x,valuesRef:v,keyboardActiveRef:b,multiple:E,highlightItemOnHover:T}=$s(),A=Qt(),M=Le(g,ht.isActive,f.index),L=Le(g,ht.isSelected,f.index,u),D=Le(g,ht.isSelectedByFocus,f.index),H=Le(g,ht.isItemEqualToValue),z=f.index,q=z!==-1,j=R.useRef(null),K=hn(z);Fe(()=>{if(!q)return;const ee=v.current;return ee[z]=u,()=>{delete ee[z]}},[q,z,u,v]),Fe(()=>{if(!q)return;const ee=g.state.value;let X=ee;E&&Array.isArray(ee)&&ee.length>0&&(X=ee[ee.length-1]),X!==void 0&&Ci(X,u,H)&&g.set("selectedIndex",z)},[q,z,E,H,g,u]);const $=R.useMemo(()=>({disabled:a,selected:L,highlighted:M}),[a,L,M]),F=S({active:M,selected:L});F.onFocus=void 0,F.id=void 0;const G=R.useRef(null),U=R.useRef("mouse"),P=R.useRef(!1),{getButtonProps:B,buttonRef:I}=xr({disabled:a,focusableWhenDisabled:!0,native:l});function W(ee){const X=g.state.value;if(E){const V=Array.isArray(X)?X:[],se=L?yk(V,u,H):[...V,u];w(se,We(ma,ee))}else w(u,We(ma,ee)),C(!1,We(ma,ee))}const Y={role:"option","aria-selected":L,"aria-disabled":a||void 0,tabIndex:M?0:-1,onFocus(){g.set("activeIndex",z)},onMouseEnter(){!b.current&&g.state.selectedIndex===null&&g.set("activeIndex",z)},onMouseMove(){T&&g.set("activeIndex",z)},onMouseLeave(ee){!T||b.current||Ek(ee)||A.start(0,()=>{g.state.activeIndex===z&&g.set("activeIndex",null)})},onTouchStart(){y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ee){G.current=ee.key,g.set("activeIndex",z)},onClick(ee){P.current=!1,!(ee.type==="keydown"&&G.current===null)&&(a||G.current===" "&&x.current||U.current!=="touch"&&!M||(G.current=null,W(ee.nativeEvent)))},onPointerEnter(ee){U.current=ee.pointerType},onPointerDown(ee){U.current=ee.pointerType,P.current=!0},onMouseUp(ee){if(a)return;if(P.current){P.current=!1;return}const X=!y.current.allowSelectedMouseUp&&L,V=!y.current.allowUnselectedMouseUp&&!L;X||V||U.current!=="touch"&&!M||W(ee.nativeEvent)}},J=at("div",t,{ref:[I,n,f.ref,j],state:$,props:[F,Y,d,B]}),Z=R.useMemo(()=>({selected:L,indexRef:K,textRef:p,selectedByFocus:D,hasRegistered:q}),[L,K,p,D,q]);return _.jsx(kk.Provider,{value:Z,children:J})})),vP=R.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=I0();return s||o?_.jsx(_P,{...t,ref:n}):null}),_P=R.memo(R.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=I0(),a=R.useRef(null),{transitionStatus:l,setMounted:d}=ki(h),p=R.useMemo(()=>({selected:h,transitionStatus:l}),[h,l]),f=at("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Gs});return Ur({open:h,ref:a,onComplete(){h||d(!1)}}),f})),yP=R.memo(R.forwardRef(function(t,n){const{indexRef:s,textRef:o,selectedByFocus:u,hasRegistered:h}=I0(),{selectedItemTextRef:a}=$s(),{className:l,render:d,...p}=t,f=R.useCallback(S=>{if(!S||!h)return;const C=a.current===null||!a.current.isConnected;(u||C&&s.current===0)&&(a.current=S)},[a,s,u,h]);return at("div",t,{ref:[f,n,o],props:p})})),Rk=R.forwardRef(function(t,n){const{render:s,className:o,direction:u,keepMounted:h=!1,...a}=t,{store:l,popupRef:d,listRef:p,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:g}=$s(),{side:S,scrollDownArrowRef:C,scrollUpArrowRef:w}=O0(),y=u==="up"?ht.scrollUpArrowVisible:ht.scrollDownArrowVisible,x=Le(l,y),v=Le(l,ht.openMethod),b=x&&v!=="touch",E=Qt(),T=u==="up"?w:C,{transitionStatus:A,setMounted:M}=ki(b);Fe(()=>(g.current+=1,l.state.hasScrollArrows||l.set("hasScrollArrows",!0),()=>{g.current=Math.max(0,g.current-1),g.current===0&&l.state.hasScrollArrows&&l.set("hasScrollArrows",!1)}),[l,g]),Ur({open:b,ref:T,onComplete(){b||M(!1)}});const L=R.useMemo(()=>({direction:u,visible:b,side:S,transitionStatus:A}),[u,b,S,A]),H=at("div",t,{ref:[n,T],state:L,props:[{"aria-hidden":!0,children:u==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(q){if(q.movementX===0&&q.movementY===0||E.isStarted())return;l.set("activeIndex",null);function j(){const K=l.state.listElement??d.current;if(!K)return;l.set("activeIndex",null),f();const $=K.scrollTop===0,F=Math.round(K.scrollTop+K.clientHeight)>=K.scrollHeight;if(p.current.length===0&&(u==="up"?l.set("scrollUpArrowVisible",!$):l.set("scrollDownArrowVisible",!F)),u==="up"&&$||u==="down"&&F){E.clear();return}if((l.state.listElement||d.current)&&p.current&&p.current.length>0){const U=p.current,P=T.current?.offsetHeight||0;if(u==="up"){let B=0;const I=K.scrollTop+P;for(let Y=0;Y<U.length;Y+=1){const J=U[Y];if(J&&J.offsetTop>=I){B=Y;break}}const W=Math.max(0,B-1);if(W<B){const Y=U[W];Y&&(K.scrollTop=Math.max(0,Y.offsetTop-P))}else K.scrollTop=0}else{let B=U.length-1;const I=K.scrollTop+K.clientHeight-P;for(let Y=0;Y<U.length;Y+=1){const J=U[Y];if(J&&J.offsetTop+J.offsetHeight>I){B=Math.max(0,Y-1);break}}const W=Math.min(U.length-1,B+1);if(W>B){const Y=U[W];Y&&(K.scrollTop=Y.offsetTop+Y.offsetHeight-K.clientHeight+P)}else K.scrollTop=K.scrollHeight-K.clientHeight}}E.start(40,j)}E.start(40,j)},onMouseLeave(){E.clear()}},a]});return b||h?H:null}),bP=R.forwardRef(function(t,n){return _.jsx(Rk,{...t,ref:n,direction:"down"})}),xP=R.forwardRef(function(t,n){return _.jsx(Rk,{...t,ref:n,direction:"up"})}),Il=$8;function jl({className:e,...t}){return _.jsx(Q8,{"data-slot":"select-value",className:He("flex flex-1 text-left",e),...t})}function Nl({className:e,size:t="default",children:n,...s}){return _.jsxs(Y8,{"data-slot":"select-trigger","data-size":t,className:He("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...s,children:[n,_.jsx(Z8,{render:_.jsx(_e,{icon:C4,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Bl({className:e,children:t,side:n="bottom",sideOffset:s=4,align:o="center",alignOffset:u=0,alignItemWithTrigger:h=!0,...a}){return _.jsx(eP,{children:_.jsx(dP,{side:n,sideOffset:s,align:o,alignOffset:u,alignItemWithTrigger:h,className:"isolate z-50",children:_.jsxs(pP,{"data-slot":"select-content",className:He("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto",e),...a,children:[_.jsx(SP,{}),_.jsx(mP,{children:t}),_.jsx(CP,{})]})})})}function gr({className:e,children:t,...n}){return _.jsxs(gP,{"data-slot":"select-item",className:He("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[_.jsx(yP,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),_.jsx(vP,{render:_.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:_.jsx(_e,{icon:Ma,strokeWidth:2,className:"pointer-events-none"})})]})}function SP({className:e,...t}){return _.jsx(xP,{"data-slot":"select-scroll-up-button",className:He("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 top-0 w-full",e),...t,children:_.jsx(_e,{icon:Q2,strokeWidth:2})})}function CP({className:e,...t}){return _.jsx(bP,{"data-slot":"select-scroll-down-button",className:He("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 bottom-0 w-full",e),...t,children:_.jsx(_e,{icon:K2,strokeWidth:2})})}const Tk=R.createContext(void 0);function j0(){const e=R.useContext(Tk);if(e===void 0)throw new Error(Pt(64));return e}let wP=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const N0={tabActivationDirection:e=>({[wP.activationDirection]:e})},EP=R.forwardRef(function(t,n){const{className:s,defaultValue:o=0,onValueChange:u,orientation:h="horizontal",render:a,value:l,...d}=t,p=ja(),f=Object.hasOwn(t,"defaultValue"),g=R.useRef([]),[S,C]=R.useState(()=>new Map),[w,y]=as({controlled:l,default:o,name:"Tabs",state:"value"}),x=l!==void 0,[v,b]=R.useState(()=>new Map),[E,T]=R.useState("none"),A=Pe((G,U)=>{u?.(G,U),!U.isCanceled&&(y(G),T(U.activationDirection))}),M=Pe((G,U)=>{C(P=>{if(P.get(G)===U)return P;const B=new Map(P);return B.set(G,U),B})}),L=Pe((G,U)=>{C(P=>{if(!P.has(G)||P.get(G)!==U)return P;const B=new Map(P);return B.delete(G),B})}),D=R.useCallback(G=>S.get(G),[S]),H=R.useCallback(G=>{for(const U of v.values())if(G===U?.value)return U?.id},[v]),z=R.useCallback(G=>{if(G===void 0)return null;for(const[U,P]of v.entries())if(P!=null&&G===(P.value??P.index))return U;return null},[v]),q=R.useMemo(()=>({direction:p,getTabElementBySelectedValue:z,getTabIdByPanelValue:H,getTabPanelIdByValue:D,onValueChange:A,orientation:h,registerMountedTabPanel:M,setTabMap:b,unregisterMountedTabPanel:L,tabActivationDirection:E,value:w}),[p,z,H,D,A,h,M,b,L,E,w]),j=R.useMemo(()=>{for(const G of v.values())if(G!=null&&G.value===w)return G},[v,w]),K=R.useMemo(()=>{for(const G of v.values())if(G!=null&&!G.disabled)return G.value},[v]);Fe(()=>{if(x||v.size===0)return;const G=j?.disabled,U=j==null&&w!==null;if(f&&G&&w===o||!G&&!U)return;const B=K??null;w!==B&&(y(B),T("none"))},[o,K,f,x,j,T,y,v,w]);const F=at("div",t,{state:{orientation:h,tabActivationDirection:E},ref:n,props:d,stateAttributesMapping:N0});return _.jsx(Tk.Provider,{value:q,children:_.jsx(ud,{elementsRef:g,children:F})})}),Lk="data-composite-item-active";function Ak(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=e0(),{ref:o,index:u}=ac(e),h=n===u,a=R.useRef(null),l=cs(o,a);return{compositeProps:R.useMemo(()=>({tabIndex:h?0:-1,onFocus(){s(u)},onMouseMove(){const p=a.current;if(!t||!p)return;const f=p.hasAttribute("disabled")||p.ariaDisabled==="true";!h&&!f&&p.focus()}}),[h,s,u,t]),compositeRef:l,index:u}}const Ok=R.createContext(void 0);function kP(){const e=R.useContext(Ok);if(e===void 0)throw new Error(Pt(65));return e}const RP=R.forwardRef(function(t,n){const{className:s,disabled:o=!1,render:u,value:h,id:a,nativeButton:l=!0,...d}=t,{value:p,getTabPanelIdByValue:f,orientation:g}=j0(),{activateOnFocus:S,highlightedTabIndex:C,onTabActivation:w,setHighlightedTabIndex:y,tabsListElement:x}=kP(),v=ar(a),b=R.useMemo(()=>({disabled:o,id:v,value:h}),[o,v,h]),{compositeProps:E,compositeRef:T,index:A}=Ak({metadata:b}),M=h===p,L=R.useRef(!1);Fe(()=>{if(L.current){L.current=!1;return}if(!(M&&A>-1&&C!==A))return;const P=x;if(P!=null){const B=_s(br(P));if(B&&ft(P,B))return}o||y(A)},[M,A,C,y,o,x]);const{getButtonProps:D,buttonRef:H}=xr({disabled:o,native:l,focusableWhenDisabled:!0}),z=f(h),q=R.useRef(!1),j=R.useRef(!1);function K(P){M||o||w(h,We(Mn,P.nativeEvent,void 0,{activationDirection:"none"}))}function $(P){M||(A>-1&&!o&&y(A),!o&&S&&(!q.current||q.current&&j.current)&&w(h,We(Mn,P.nativeEvent,void 0,{activationDirection:"none"})))}function F(P){if(M||o)return;q.current=!0;function B(){q.current=!1,j.current=!1}(!P.button||P.button===0)&&(j.current=!0,br(P.currentTarget).addEventListener("pointerup",B,{once:!0}))}const G=R.useMemo(()=>({disabled:o,active:M,orientation:g}),[o,M,g]);return at("button",t,{state:G,ref:[n,H,T],props:[E,{role:"tab","aria-controls":z,"aria-selected":M,id:v,onClick:K,onFocus:$,onPointerDown:F,[Lk]:M?"":void 0,onKeyDownCapture(){L.current=!0}},d,D]})});let TP=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const LP=R.forwardRef(function(t,n){const{className:s,value:o,render:u,keepMounted:h=!1,...a}=t,{value:l,getTabIdByPanelValue:d,orientation:p,tabActivationDirection:f,registerMountedTabPanel:g,unregisterMountedTabPanel:S}=j0(),C=ar(),w=R.useMemo(()=>({id:C,value:o}),[C,o]),{ref:y,index:x}=ac({metadata:w}),v=o!==l,b=d(o),E=R.useMemo(()=>({hidden:v,orientation:p,tabActivationDirection:f}),[v,p,f]),T=at("div",t,{state:E,ref:[n,y],props:[{"aria-labelledby":b,hidden:v,id:C??void 0,role:"tabpanel",tabIndex:v?-1:0,[TP.index]:x},a],stateAttributesMapping:N0});return Fe(()=>{if(!(v&&!h)&&C!=null)return g(o,C),()=>{S(o,C)}},[v,h,o,C,g,S]),!v||h?T:null});function AP(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const OP=[];function MP(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:o=!1,orientation:u="both",direction:h,highlightedIndex:a,onHighlightedIndexChange:l,rootRef:d,enableHomeAndEndKeys:p=!1,stopEventPropagation:f=!1,disabledIndices:g,modifierKeys:S=OP}=e,[C,w]=R.useState(0),y=n>1,x=R.useRef(null),v=cs(x,d),b=R.useRef([]),E=R.useRef(!1),T=a??C,A=Pe((D,H=!1)=>{if((l??w)(D),H){const z=b.current[D];mC(x.current,z,h,u)}}),M=Pe(D=>{if(D.size===0||E.current)return;E.current=!0;const H=Array.from(D.keys()),z=H.find(j=>j?.hasAttribute(Lk))??null,q=z?H.indexOf(z):-1;q!==-1&&A(q),mC(x.current,z,h,u)}),L=R.useMemo(()=>({"aria-orientation":u==="both"?void 0:u,ref:v,onFocus(D){!x.current||!pC(D.target)||D.target.setSelectionRange(0,D.target.value.length??0)},onKeyDown(D){const H=p?d8:ok;if(!H.has(D.key)||DP(D,S)||!x.current)return;const q=h==="rtl",j=q?Uu:Pl,K={horizontal:j,vertical:oa,both:j}[u],$=q?Pl:Uu,F={horizontal:$,vertical:Dl,both:$}[u];if(pC(D.target)&&!AP(D.target)){const Y=D.target.selectionStart,J=D.target.selectionEnd,Z=D.target.value??"";if(Y==null||D.shiftKey||Y!==J||D.key!==F&&Y<Z.length||D.key!==K&&Y>0)return}let G=T;const U=fh(b,g),P=h_(b,g);if(y){const Y=t||Array.from({length:b.current.length},()=>({width:1,height:1})),J=yE(Y,n,o),Z=J.findIndex(X=>X!=null&&!mo(b,X,g)),ee=J.reduce((X,V,se)=>V!=null&&!mo(b,V,g)?se:X,-1);G=J[_E({current:J.map(X=>X?b.current[X]:null)},{event:D,orientation:u,loopFocus:s,cols:n,disabledIndices:xE([...g||b.current.map((X,V)=>mo(b,V)?V:void 0),void 0],J),minIndex:Z,maxIndex:ee,prevIndex:bE(T>P?U:T,Y,J,n,D.key===oa?"bl":D.key===Pl?"tr":"tl"),rtl:q})]}const B={horizontal:[j],vertical:[oa],both:[j,oa]}[u],I={horizontal:[$],vertical:[Dl],both:[$,Dl]}[u],W=y?H:{horizontal:p?c8:sk,vertical:p?u8:ik,both:H}[u];p&&(D.key===id?G=U:D.key===od&&(G=P)),G===T&&(B.includes(D.key)||I.includes(D.key))&&(s&&G===P&&B.includes(D.key)?G=U:s&&G===U&&I.includes(D.key)?G=P:G=Wn(b,{startingIndex:G,decrement:I.includes(D.key),disabledIndices:g})),G!==T&&!Ll(b,G)&&(f&&D.stopPropagation(),W.has(D.key)&&D.preventDefault(),A(G,!0),queueMicrotask(()=>{b.current[G]?.focus()}))}}),[n,o,h,g,b,p,T,y,t,s,v,S,A,u,f]);return R.useMemo(()=>({props:L,highlightedIndex:T,onHighlightedIndexChange:A,elementsRef:b,disabledIndices:g,onMapChange:M,relayKeyboardEvent:L.onKeyDown}),[L,T,A,b,g,M])}function DP(e,t){for(const n of g8.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Mk(e){const{render:t,className:n,refs:s=yr,props:o=yr,state:u=tn,stateAttributesMapping:h,highlightedIndex:a,onHighlightedIndexChange:l,orientation:d,dense:p,itemSizes:f,loopFocus:g,cols:S,enableHomeAndEndKeys:C,onMapChange:w,stopEventPropagation:y=!0,rootRef:x,disabledIndices:v,modifierKeys:b,highlightItemOnHover:E=!1,tag:T="div",...A}=e,M=ja(),{props:L,highlightedIndex:D,onHighlightedIndexChange:H,elementsRef:z,onMapChange:q,relayKeyboardEvent:j}=MP({itemSizes:f,cols:S,loopFocus:g,dense:p,orientation:d,highlightedIndex:a,onHighlightedIndexChange:l,rootRef:x,stopEventPropagation:y,enableHomeAndEndKeys:C,direction:M,disabledIndices:v,modifierKeys:b}),K=at(T,e,{state:u,ref:s,props:[L,...o,A],stateAttributesMapping:h}),$=R.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:H,highlightItemOnHover:E,relayKeyboardEvent:j}),[D,H,E,j]);return _.jsx(A2.Provider,{value:$,children:_.jsx(ud,{elementsRef:z,onMapChange:F=>{w?.(F),q(F)},children:K})})}const PP=R.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:o,loopFocus:u=!0,render:h,...a}=t,{getTabElementBySelectedValue:l,onValueChange:d,orientation:p,value:f,setTabMap:g,tabActivationDirection:S}=j0(),[C,w]=R.useState(0),[y,x]=R.useState(null),v=IP(f,p,y,l),b=Pe((M,L)=>{if(M!==f){const D=v(M);L.activationDirection=D,d(M,L)}}),E=R.useMemo(()=>({orientation:p,tabActivationDirection:S}),[p,S]),T={"aria-orientation":p==="vertical"?"vertical":void 0,role:"tablist"},A=R.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:C,onTabActivation:b,setHighlightedTabIndex:w,tabsListElement:y,value:f}),[s,C,b,w,y,f]);return _.jsx(Ok.Provider,{value:A,children:_.jsx(Mk,{render:h,className:o,state:E,refs:[n,x],props:[T,a],stateAttributesMapping:N0,highlightedIndex:C,enableHomeAndEndKeys:!0,loopFocus:u,orientation:p,onHighlightedIndexChange:w,onMapChange:g,disabledIndices:yr})})});function CC(e,t){const{left:n,top:s}=e.getBoundingClientRect(),{left:o,top:u}=t.getBoundingClientRect(),h=n-o,a=s-u;return{left:h,top:a}}function IP(e,t,n,s){const[o,u]=R.useState(null);return Fe(()=>{if(e==null||n==null){u(null);return}const h=s(e);if(h==null){u(null);return}const{left:a,top:l}=CC(h,n);u(t==="horizontal"?a:l)},[t,s,n,e]),R.useCallback(h=>{if(h===e)return"none";if(h==null)return u(null),"none";if(h!=null&&n!=null){const a=s(h);if(a!=null){const{left:l,top:d}=CC(a,n);if(o==null)return u(t==="horizontal"?l:d),"none";if(t==="horizontal"){if(l<o)return u(l),"left";if(l>o)return u(l),"right"}else{if(d<o)return u(d),"up";if(d>o)return u(d),"down"}}}return"none"},[s,t,o,n,e])}function _a({className:e,orientation:t="horizontal",...n}){return _.jsx(EP,{"data-slot":"tabs","data-orientation":t,className:He("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const jP=Oa("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function ya({className:e,variant:t="default",...n}){return _.jsx(PP,{"data-slot":"tabs-list","data-variant":t,className:He(jP({variant:t}),e),...n})}function ir({className:e,...t}){return _.jsx(RP,{"data-slot":"tabs-trigger",className:He("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function _r({className:e,...t}){return _.jsx(LP,{"data-slot":"tabs-content",className:He("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function NP(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:u,actionsRef:h,handle:a,triggerId:l,defaultTriggerId:d=null}=e,p=wi(),f=!!p,g=Gn(()=>a?.store??new uk({open:n??s,activeTriggerId:l!==void 0?l:d,modal:!0,disablePointerDismissal:!0,nested:f,role:"alertdialog"})).current;g.useControlledProp("open",n,s),g.useControlledProp("activeTriggerId",l,d),g.useSyncedValue("nested",f),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",u);const S=g.useState("payload");ck({store:g,actionsRef:h,parentContext:p?.store.context});const C=R.useMemo(()=>({store:g}),[g]);return _.jsx(l0.Provider,{value:C,children:typeof t=="function"?t({payload:S}):t})}const Dk=R.createContext(void 0),Pk=R.createContext(void 0),Ik=R.createContext(void 0),jk=R.createContext("");function Ri(){const e=R.useContext(Dk);if(!e)throw new Error(Pt(22));return e}function Ep(){const e=R.useContext(Pk);if(!e)throw new Error(Pt(23));return e}function Na(){const e=R.useContext(Ik);if(!e)throw new Error(Pt(24));return e}function B0(){return R.useContext(jk)}const Ge={id:we(e=>e.id),query:we(e=>e.query),items:we(e=>e.items),selectedValue:we(e=>e.selectedValue),open:we(e=>e.open),mounted:we(e=>e.mounted),forceMounted:we(e=>e.forceMounted),inline:we(e=>e.inline),activeIndex:we(e=>e.activeIndex),selectedIndex:we(e=>e.selectedIndex),isActive:we((e,t)=>e.activeIndex===t),isSelected:we((e,t)=>{const n=e.isItemEqualToValue,s=e.selectedValue;return Array.isArray(s)?s.some(o=>Ci(o,t,n)):Ci(s,t,n)}),transitionStatus:we(e=>e.transitionStatus),popupProps:we(e=>e.popupProps),inputProps:we(e=>e.inputProps),triggerProps:we(e=>e.triggerProps),getItemProps:we(e=>e.getItemProps),positionerElement:we(e=>e.positionerElement),listElement:we(e=>e.listElement),triggerElement:we(e=>e.triggerElement),inputElement:we(e=>e.inputElement),popupSide:we(e=>e.popupSide),openMethod:we(e=>e.openMethod),inputInsidePopup:we(e=>e.inputInsidePopup),selectionMode:we(e=>e.selectionMode),listRef:we(e=>e.listRef),labelsRef:we(e=>e.labelsRef),popupRef:we(e=>e.popupRef),emptyRef:we(e=>e.emptyRef),inputRef:we(e=>e.inputRef),keyboardActiveRef:we(e=>e.keyboardActiveRef),chipsContainerRef:we(e=>e.chipsContainerRef),clearRef:we(e=>e.clearRef),valuesRef:we(e=>e.valuesRef),allValuesRef:we(e=>e.allValuesRef),name:we(e=>e.name),disabled:we(e=>e.disabled),readOnly:we(e=>e.readOnly),required:we(e=>e.required),grid:we(e=>e.grid),isGrouped:we(e=>e.isGrouped),virtualized:we(e=>e.virtualized),onOpenChangeComplete:we(e=>e.onOpenChangeComplete),openOnInputClick:we(e=>e.openOnInputClick),itemToStringLabel:we(e=>e.itemToStringLabel),isItemEqualToValue:we(e=>e.isItemEqualToValue),modal:we(e=>e.modal),autoHighlight:we(e=>e.autoHighlight),submitOnItemClick:we(e=>e.submitOnItemClick)};function BP(e,t){return(n,s)=>{if(n==null)return!1;const o=An(n,t);return e.contains(o,s)}}function zP(e,t,n){return(s,o)=>{if(s==null)return!1;if(!o)return!0;const u=An(s,t),h=n!=null?An(n,t):"";return h&&e.contains(h,o)&&h.length===o.length?!0:e.contains(u,o)}}const wC=new Map;function Nk(e){return Array.isArray(e)?e.map(t=>Nk(t)).join(","):e==null?"":String(e)}function HP(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Nk(e.locale)}|${JSON.stringify(t)}`,s=wC.get(n);if(s)return s;const o=new Intl.Collator(e.locale,t),u={contains(h,a,l){if(!a)return!0;const d=An(h,l);for(let p=0;p<=d.length-a.length;p+=1)if(o.compare(d.slice(p,p+a.length),a)===0)return!0;return!1},startsWith(h,a,l){if(!a)return!0;const d=An(h,l);return o.compare(d.slice(0,a.length),a)===0},endsWith(h,a,l){if(!a)return!0;const d=An(h,l),p=a.length;return d.length>=p&&o.compare(d.slice(d.length-p),a)===0}};return wC.set(n,u),u}const VP=HP,Bk=Symbol("none"),Ko={value:Bk,index:-1};function FP(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:s=null,selectedValue:o,onSelectedValueChange:u,defaultInputValue:h,inputValue:a,selectionMode:l="none",onItemHighlighted:d,name:p,disabled:f=!1,readOnly:g=!1,required:S=!1,inputRef:C,grid:w=!1,items:y,filteredItems:x,filter:v,openOnInputClick:b=!0,autoHighlight:E=!1,keepHighlight:T=!1,highlightItemOnHover:A=!0,itemToStringLabel:M,itemToStringValue:L,isItemEqualToValue:D=_k,virtualized:H=!1,inline:z=!1,fillInputOnItemPress:q=!0,modal:j=!1,limit:K=-1,autoComplete:$="list",locale:F,submitOnItemClick:G=!1}=e,{clearErrors:U}=ad(),{setDirty:P,validityData:B,shouldValidateOnChange:I,setFilled:W,name:Y,disabled:J,validation:Z}=us(),ee=Cp({id:t}),X=VP({locale:F}),[V,se]=R.useState(!1),[ne,re]=R.useState(null),oe=R.useRef([]),le=R.useRef([]),ve=R.useRef(null),ue=R.useRef(null),he=R.useRef(null),de=R.useRef(!0),Ne=R.useRef(!1),Me=R.useRef(null),Ae=R.useRef(null),be=R.useRef(null),Oe=R.useRef(Ko),me=R.useRef(null),ke=R.useRef([]),Ce=R.useRef([]),qe=J||f,De=Y??p,Ie=l==="multiple",rt=l==="single",et=a!==void 0||h!==void 0,dt=y!==void 0,xe=x!==void 0;let Ve;E==="always"?Ve="always":Ve=E?"input-change":!1;const[Ee,tt]=as({controlled:o,default:Ie?s??yr:s,name:"Combobox",state:"selectedValue"}),lt=R.useMemo(()=>v===null?()=>!0:v!==void 0?v:rt&&!V?zP(X,M,Ee):BP(X,M),[v,rt,Ee,V,X,M]),Xe=Gn(()=>et?h??"":rt?An(Ee,M):"").current,[st,Ct]=as({controlled:a,default:Xe,name:"Combobox",state:"inputValue"}),[ct,nn]=as({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),Rt=bk(y),vt=ne??(st===""?"":String(st).trim()),Je=rt?An(Ee,M):"",Ot=rt&&!V&&vt!==""&&Je!==""&&Je.length===vt.length&&X.contains(Je,vt),jt=Ot?"":vt,ot=dt&&xe&&Ot,wt=R.useMemo(()=>y?Rt?y.flatMap(Ue=>Ue.items):y:yr,[y,Rt]),bt=R.useMemo(()=>{if(x&&!ot)return x;if(!y)return yr;if(Rt){const nt=y,mt=[];let $t=0;for(const rn of nt){if(K>-1&&$t>=K)break;const vn=jt===""?rn.items:rn.items.filter(ti=>lt(ti,jt,M));if(vn.length===0)continue;const Js=K>-1?K-$t:1/0,ei=vn.slice(0,Js);if(ei.length>0){const ti={...rn,items:ei};mt.push(ti),$t+=ei.length}}return mt}if(jt==="")return K>-1?wt.slice(0,K):wt;const Ue=[];for(const nt of wt){if(K>-1&&Ue.length>=K)break;lt(nt,jt,M)&&Ue.push(nt)}return Ue},[x,ot,y,Rt,jt,K,lt,M,wt]),xt=R.useMemo(()=>Rt?bt.flatMap(nt=>nt.items):bt,[bt,Rt]),Qe=Gn(()=>new va({id:ee,selectedValue:Ee,open:ct,filter:lt,query:vt,items:y,selectionMode:l,listRef:oe,labelsRef:le,popupRef:ve,emptyRef:he,inputRef:ue,keyboardActiveRef:de,chipsContainerRef:Me,clearRef:Ae,valuesRef:ke,allValuesRef:Ce,selectionEventRef:be,name:De,disabled:qe,readOnly:g,required:S,grid:w,isGrouped:Rt,virtualized:H,openOnInputClick:b,itemToStringLabel:M,isItemEqualToValue:D,modal:j,autoHighlight:Ve,submitOnItemClick:G,hasInputValue:et,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:z,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||on,setOpen:on,setInputValue:on,setSelectedValue:on,setIndices:on,onItemHighlighted:on,handleSelection:on,getItemProps:()=>tn,forceMount:on,requestSubmit:on})).current,Ht=l==="none"?st:Ee,Rn=R.useMemo(()=>l==="none"?Ht:Array.isArray(Ee)?Ee.map(Ue=>ys(Ue,L)):ys(Ee,L),[Ht,L,l,Ee]),Yn=Pe(d),zn=Pe(n),Es=Le(Qe,Ge.activeIndex),Fa=Le(Qe,Ge.selectedIndex),Cr=Le(Qe,Ge.positionerElement),pn=Le(Qe,Ge.listElement),mn=Le(Qe,Ge.triggerElement),ks=Le(Qe,Ge.inputElement),wr=Le(Qe,Ge.inline),Xs=Le(Qe,Ge.inputInsidePopup),Np=hn(mn),{mounted:xc,setMounted:Ro,transitionStatus:To}=ki(ct),{openMethod:Qs,triggerProps:Rs,reset:Lo}=Sp(ct);ld({id:ee,name:De,commit:Z.commit,value:Ht,controlRef:Xs?Np:ue,getValue:()=>Rn});const ds=Pe(()=>{y?le.current=xt.map(Ue=>An(Ue,M)):Qe.set("forceMounted",!0)}),gn=R.useRef(Ee);Fe(()=>{Ee!==gn.current&&ds()},[ds,Ee]);const tr=Pe(Ue=>{Qe.update(Ue);const nt=Ue.type||"none";if(Ue.activeIndex!==void 0)if(Ue.activeIndex===null)Oe.current!==Ko&&(Oe.current=Ko,Yn(void 0,yu(nt,void 0,{index:-1})));else{const mt=ke.current[Ue.activeIndex];Oe.current={value:mt,index:Ue.activeIndex},Yn(mt,yu(nt,void 0,{index:Ue.activeIndex}))}}),nr=Pe((Ue,nt)=>{if(Ne.current=nt.reason===no,e.onInputValueChange?.(Ue,nt),!nt.isCanceled){if(nt.reason===ia){const mt=Ue.trim()!=="";mt&&se(!0),me.current={hasQuery:mt},mt&&Ve&&Qe.state.activeIndex==null&&Qe.set("activeIndex",0)}Ct(Ue)}}),Er=Pe((Ue,nt)=>{ct!==Ue&&(nt.reason==="escape-key"&&dt&&xt.length===0&&!Qe.state.emptyRef.current&&nt.allowPropagation(),e.onOpenChange?.(Ue,nt),!nt.isCanceled&&(!Ue&&V&&(rt?(re(vt),vt===""&&se(!1)):Ie&&(wr||Xs?tr({activeIndex:null}):re(vt),nr("",We(no,nt.event)))),nn(Ue)))}),fs=Pe((Ue,nt)=>{if(u?.(Ue,nt),nt.isCanceled)return;tt(Ue),(l==="none"&&ve.current&&q||rt&&!Qe.state.inputInsidePopup)&&nr(An(Ue,M),We(nt.reason,nt.event)),rt&&Ue!=null&&nt.reason!==ia&&V&&re(vt)}),Bp=Pe((Ue,nt)=>{let mt=nt;if(mt===void 0){if(Es===null)return;mt=ke.current[Es]}const $t=Pn(Ue),rn=be.current??Ue;be.current=null;const vn=We(ma,rn),Js=$t?.closest("a")?.getAttribute("href");if(Js){Js.startsWith("#")&&Er(!1,vn);return}if(Ie){const ei=Array.isArray(Ee)?Ee:[],hs=la(ei,mt,Qe.state.isItemEqualToValue)?yk(ei,mt,Qe.state.isItemEqualToValue):[...ei,mt];if(fs(hs,vn),!(ue.current?ue.current.value.trim()!=="":!1))return;Qe.state.inputInsidePopup?nr("",We(no,vn.event)):Er(!1,vn)}else fs(mt,vn),Er(!1,vn)}),Ua=Pe(()=>{if(!Qe.state.submitOnItemClick)return;const Ue=Qe.state.inputElement?.form;Ue&&typeof Ue.requestSubmit=="function"&&Ue.requestSubmit()}),Wa=Pe(()=>{if(Ro(!1),zn?.(!1),se(!1),Lo(),re(null),tr(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Ie&&ue.current&&ue.current.value!==""&&!Ne.current&&nr("",We(no)),rt)if(Qe.state.inputInsidePopup)ue.current&&ue.current.value!==""&&nr("",We(no));else{const Ue=An(Ee,M);ue.current&&ue.current.value!==Ue&&nr(Ue,We(Ue===""?no:Mn))}}),zp=R.useMemo(()=>wr&&Cr?{current:Cr.closest('[role="dialog"]')}:ve,[wr,Cr]);Ur({enabled:!e.actionsRef,open:ct,ref:zp,onComplete(){ct||Wa()}}),R.useImperativeHandle(e.actionsRef,()=>({unmount:Wa}),[Wa]),Fe(function(){if(ct||l==="none")return;const nt=y?wt:Ce.current;if(Ie){const mt=Array.isArray(Ee)?Ee:[],$t=mt[mt.length-1],rn=Kl(nt,$t,D);tr({selectedIndex:rn===-1?null:rn})}else{const mt=Kl(nt,Ee,D);tr({selectedIndex:mt===-1?null:mt})}},[ct,Ee,y,l,wt,Ie,D,tr]),Fe(()=>{y&&(ke.current=xt,oe.current.length=xt.length)},[y,xt]),Fe(()=>{const Ue=me.current;if(Ue&&(Ue.hasQuery?Ve&&Qe.set("activeIndex",0):Ve==="always"&&Qe.set("activeIndex",0),me.current=null),!ct&&!wr)return;const mt=dt||xe?xt:ke.current,$t=Qe.state.activeIndex;if($t==null){if(Ve==="always"&&mt.length>0){Qe.set("activeIndex",0);return}Oe.current!==Ko&&(Oe.current=Ko,Qe.state.onItemHighlighted(void 0,yu(Mn,void 0,{index:-1})));return}if($t>=mt.length){Oe.current!==Ko&&(Oe.current=Ko,Qe.state.onItemHighlighted(void 0,yu(Mn,void 0,{index:-1}))),Qe.set("activeIndex",null);return}const rn=mt[$t],vn=Oe.current.value,Js=vn!==Bk&&Qe.state.isItemEqualToValue(rn,vn);(Oe.current.index!==$t||!Js)&&(Oe.current={value:rn,index:$t},Qe.state.onItemHighlighted(rn,yu(Mn,void 0,{index:$t})))},[Es,Ve,xe,dt,xt,wr,ct,Qe]),Fe(()=>{if(!y||l==="none")return;const Ue=wt;if(Ie){const $t=Array.isArray(Ee)?Ee:yr,rn=$t.filter(vn=>la(Ue,vn,Qe.state.isItemEqualToValue));rn.length!==$t.length&&tt(rn);return}if(Ee==null?!0:la(Ue,Ee,Qe.state.isItemEqualToValue))return;let mt=null;if(s!=null&&la(Ue,s,Qe.state.isItemEqualToValue)&&(mt=s),tt(mt),!Qe.state.inputInsidePopup){const $t=An(mt,M);ue.current&&ue.current.value!==$t&&nr($t,We(Mn))}},[y,wt,Ie,l,Ee,s,tt,M,Qe,nr]),Fe(()=>{if(l==="none"){W(String(st)!=="");return}W(Ie?Array.isArray(Ee)&&Ee.length>0:Ee!=null)},[W,l,st,Ee,Ie]),R.useEffect(()=>{dt&&Ve&&xt.length===0&&tr({activeIndex:null})},[dt,Ve,xt.length,tr]),ca(vt,()=>{!ct||vt===""||vt===String(Xe)||se(!0)}),ca(Ee,()=>{if(l!=="none"&&(U(De),P(Ee!==B.initialValue),I()?Z.commit(Ee):Z.commit(Ee,!0),Ie&&Qe.state.selectedIndex!==null&&(!Array.isArray(Ee)||Ee.length===0)&&tr({activeIndex:null,selectedIndex:null}),rt&&!et&&!Xs)){const Ue=An(Ee,M);st!==Ue&&nr(Ue,We(Mn))}}),ca(st,()=>{l==="none"&&(U(De),P(st!==B.initialValue),I()?Z.commit(st):Z.commit(st,!0))}),ca(y,()=>{if(!rt||et||Xs||V)return;const Ue=An(Ee,M);st!==Ue&&nr(Ue,We(Mn))});const Zs=w0({open:wr?!0:ct,onOpenChange:Er,elements:{reference:Xs?mn:ks,floating:Cr}});let Ti,kr;wr||(Ti=w?"grid":"listbox",kr=ct?"true":"false");const lr=R.useMemo(()=>{const Ue=ks?.tagName==="INPUT",nt=Ue||ct,mt=Ue?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return nt&&(mt.role="combobox",mt["aria-expanded"]=kr,mt["aria-haspopup"]=Ti,mt["aria-controls"]=ct?pn?.id:void 0,mt["aria-autocomplete"]=$),{reference:mt,floating:{role:"presentation"}}},[ks,ct,kr,Ti,pn?.id,$]),_d=sd(Zs,{enabled:!g&&!qe&&b,event:"mousedown-only",toggle:!1,touchOpenDelay:Xs?0:50}),Hp=gp(Zs,{enabled:!g&&!qe&&!wr,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:wr?!0:void 0,outsidePress(Ue){const nt=Pn(Ue);return!ft(mn,nt)&&!ft(Ae.current,nt)&&!ft(Me.current,nt)}}),Sc=E0(Zs,{enabled:!g&&!qe,id:ee,listRef:oe,activeIndex:Es,selectedIndex:Fa,virtual:!0,loopFocus:!0,allowEscape:!Ve,focusItemOnOpen:V||l==="none"&&!Ve?!1:"auto",focusItemOnHover:A,resetOnPointerLeave:!T,cols:w?2:1,orientation:w?"horizontal":void 0,disabledIndices:yr,onNavigate(Ue,nt){!nt&&!ct||To==="ending"||tr(nt?{activeIndex:Ue,type:de.current?"keyboard":"pointer"}:{activeIndex:Ue})}}),{getReferenceProps:qa,getFloatingProps:Li,getItemProps:Cc}=oc([lr,_d,Hp,Sc]);pk(()=>{Qe.update({inline:z,popupProps:Li(),inputProps:qa(),triggerProps:Rs,getItemProps:Cc,setOpen:Er,setInputValue:nr,setSelectedValue:fs,setIndices:tr,onItemHighlighted:Yn,handleSelection:Bp,forceMount:ds,requestSubmit:Ua})}),Fe(()=>{Qe.update({id:ee,selectedValue:Ee,open:ct,mounted:xc,transitionStatus:To,items:y,inline:z,popupProps:Li(),inputProps:qa(),triggerProps:Rs,openMethod:Qs,getItemProps:Cc,selectionMode:l,name:De,disabled:qe,readOnly:g,required:S,grid:w,isGrouped:Rt,virtualized:H,onOpenChangeComplete:zn,openOnInputClick:b,itemToStringLabel:M,modal:j,autoHighlight:Ve,isItemEqualToValue:D,submitOnItemClick:G,hasInputValue:et,requestSubmit:Ua})},[Qe,ee,Ee,ct,xc,To,y,Li,qa,Cc,Qs,Rs,l,De,qe,g,S,Z,w,Rt,H,zn,b,M,j,D,G,et,z,Ua,Ve]);const cr=cs(C,Z.inputRef),wc=R.useMemo(()=>({query:vt,filteredItems:bt,flatFilteredItems:xt}),[vt,bt,xt]),yd=R.useMemo(()=>Array.isArray(Ht)?"":ys(Ht,L),[Ht,L]),Ec=Ie&&Array.isArray(Ee)&&Ee.length>0,Ai=R.useMemo(()=>!Ie||!Array.isArray(Ee)||!De?null:Ee.map(Ue=>{const nt=ys(Ue,L);return _.jsx("input",{type:"hidden",name:De,value:nt},nt)}),[Ie,Ee,De,L]),bd=_.jsxs(R.Fragment,{children:[e.children,_.jsx("input",{...Z.getInputValidationProps({onFocus(){if(Xs){mn?.focus();return}(ue.current||mn)?.focus()},onChange(Ue){if(Ue.nativeEvent.defaultPrevented)return;const nt=Ue.target.value,mt=We(ia,Ue.nativeEvent);function $t(){if(Ie)return;if(l==="none"){P(nt!==B.initialValue),nr(nt,mt),I()&&Z.commit(nt);return}const rn=ke.current.find(vn=>ys(vn,L).toLowerCase()===nt.toLowerCase());rn!=null&&(P(rn!==B.initialValue),fs?.(rn,mt),I()&&Z.commit(rn))}y?$t():(ds(),queueMicrotask($t))}}),id:ee,name:Ie||l==="none"?void 0:De,disabled:qe,required:S&&!Ec,readOnly:g,value:yd,ref:cr,style:ic,tabIndex:-1,"aria-hidden":!0}),Ai]});return _.jsx(Dk.Provider,{value:Qe,children:_.jsx(Pk.Provider,{value:Zs,children:_.jsx(Ik.Provider,{value:wc,children:_.jsx(jk.Provider,{value:st,children:bd})})})})}const Qf=2,UP={...zu,...Ia},WP=R.forwardRef(function(t,n){const{render:s,className:o,nativeButton:u=!0,disabled:h=!1,...a}=t,{state:l,disabled:d,setTouched:p,setFocused:f,validationMode:g,validation:S}=us(),{labelId:C}=wo(),w=Ri(),y=Le(w,Ge.selectionMode),x=Le(w,Ge.disabled),v=Le(w,Ge.readOnly),b=Le(w,Ge.listElement),E=Le(w,Ge.triggerProps),T=Le(w,Ge.triggerElement),A=Le(w,Ge.inputInsidePopup),M=Le(w,Ge.open),L=Le(w,Ge.selectedValue),D=Le(w,Ge.activeIndex),H=Le(w,Ge.selectedIndex),z=Ep(),q=B0(),j=Qt(),K=d||x||h,$=R.useRef("");function F(Z){$.current=Z.pointerType}const G=z.select("domReferenceElement");R.useEffect(()=>{A&&T&&T!==G&&z.set("domReferenceElement",T)},[T,G,z,A]);const{reference:U}=k0(z,{enabled:!M&&!v&&!x&&y==="single",listRef:w.state.labelsRef,activeIndex:D,selectedIndex:H,onMatch(Z){const ee=w.state.valuesRef.current[Z];ee!==void 0&&w.state.setSelectedValue(ee,We("none"))}}),{reference:P}=sd(z,{enabled:!v&&!x,event:"mousedown"}),{buttonRef:B,getButtonProps:I}=xr({native:u,disabled:K}),W=R.useMemo(()=>({...l,open:M,disabled:K}),[l,M,K]),Y=Pe(Z=>{w.set("triggerElement",Z)});return at("button",t,{ref:[n,B,Y],state:W,props:[E,P,U,{tabIndex:A?0:-1,disabled:K,role:A?"combobox":void 0,"aria-expanded":M?"true":"false","aria-haspopup":A?"dialog":"listbox","aria-controls":M?b?.id:void 0,"aria-readonly":v||void 0,"aria-labelledby":C,onPointerDown:F,onPointerEnter:F,onFocus(){f(!0),!(K||v)&&j.start(0,w.state.forceMount)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const Z=y==="none"?q:L;S.commit(Z)}},onMouseDown(Z){if(K||v||(A||z.set("domReferenceElement",Z.currentTarget),w.state.forceMount(),$.current!=="touch"&&(w.state.inputRef.current?.focus(),A||Z.preventDefault()),M))return;const ee=br(Z.currentTarget);function X(V){if(!T)return;const se=Pn(V),ne=w.state.positionerElement,re=w.state.listElement;if(ft(T,se)||ft(ne,se)||ft(re,se)||se===T)return;const oe=L0(T),le=V.clientX>=oe.left-Qf&&V.clientX<=oe.right+Qf,ve=V.clientY>=oe.top-Qf&&V.clientY<=oe.bottom+Qf;le&&ve||w.state.setOpen(!1,We("cancel-open",V))}A&&ee.addEventListener("mouseup",X,{once:!0})},onKeyDown(Z){K||v||(Z.key==="ArrowDown"||Z.key==="ArrowUp")&&(fn(Z),w.state.setOpen(!0,We(Du,Z.nativeEvent)),w.state.inputRef.current?.focus())}},S?S.getValidationProps(a):a,I],stateAttributesMapping:UP})}),qP=R.createContext(void 0);function GP(){return R.useContext(qP)}const zk=R.createContext(void 0);function z0(e){const t=R.useContext(zk);if(t===void 0&&!e)throw new Error(Pt(21));return t}const $P={...zu,...Ia,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},KP=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,id:h,...a}=t,{state:l,disabled:d,setTouched:p,setFocused:f,validationMode:g,validation:S}=us(),{labelId:C}=wo(),w=GP(),x=!!z0(!0),v=Ri(),{filteredItems:b}=Na(),E=B0(),T=ar(h),A=ja(),M=Le(v,Ge.disabled),L=Le(v,Ge.readOnly),D=Le(v,Ge.name),H=Le(v,Ge.selectionMode),z=Le(v,Ge.autoHighlight),q=Le(v,Ge.inputProps),j=Le(v,Ge.triggerProps),K=Le(v,Ge.open),$=Le(v,Ge.mounted),F=Le(v,Ge.selectedValue),G=Le(v,Ge.popupSide),U=Le(v,Ge.positionerElement),P=!!z,B=$&&U?G:null,I=d||M||u,W=b.length===0,[Y,J]=R.useState(null),Z=R.useRef(!1),ee=Pe(ne=>{const re=x||v.state.inline;re&&!v.state.hasInputValue&&v.state.setInputValue("",We(Mn)),v.update({inputElement:ne,inputInsidePopup:re})}),X=R.useMemo(()=>({...l,open:K,disabled:I,readOnly:L,popupSide:B,listEmpty:W}),[l,K,I,L,B,W]);function V(ne){if(!w)return;let re;const{highlightedChipIndex:oe}=w;if(oe!==void 0){if(ne.key==="ArrowLeft")ne.preventDefault(),oe>0?re=oe-1:re=void 0;else if(ne.key==="ArrowRight")ne.preventDefault(),oe<F.length-1?re=oe+1:re=void 0;else if(ne.key==="Backspace"||ne.key==="Delete"){ne.preventDefault();const le=oe>=F.length-1?F.length-2:oe;re=le>=0?le:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return re}return ne.key==="ArrowLeft"&&(ne.currentTarget.selectionStart??0)===0&&F.length>0?(ne.preventDefault(),re=Math.max(F.length-1,0)):ne.key==="Backspace"&&ne.currentTarget.value===""&&F.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),ne.preventDefault()),re}return at("input",t,{state:X,ref:[n,v.state.inputRef,ee],props:[q,j,{type:"text",value:t.value??Y??E,"aria-readonly":L||void 0,"aria-labelledby":C,disabled:I,readOnly:L,...H==="none"&&D&&{name:D},id:T,onFocus(){f(!0)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const ne=H==="none"?E:F;S.commit(ne)}},onCompositionStart(ne){Dh||(Z.current=!0,J(ne.currentTarget.value))},onCompositionEnd(ne){Z.current=!1;const re=ne.currentTarget.value;J(null),v.state.setInputValue(re,We(ia,ne.nativeEvent))},onChange(ne){if(Z.current){const ve=ne.currentTarget.value;J(ve),ve===""&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,We(no,ne.nativeEvent));const ue=ve.trim(),he=P&&ue!=="";!L&&!I&&ue!==""&&(v.state.setOpen(!0,We(ia,ne.nativeEvent)),P||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&v.state.activeIndex!==null&&!he&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"});return}v.state.setInputValue(ne.currentTarget.value,We(ia,ne.nativeEvent));const re=ne.currentTarget.value==="",oe=We(no,ne.nativeEvent);re&&!v.state.inputInsidePopup&&(H==="single"&&v.state.setSelectedValue(null,oe),v.state.openOnInputClick||v.state.setOpen(!1,oe));const le=ne.currentTarget.value.trim();!L&&!I&&le!==""&&(v.state.setOpen(!0,We(ia,ne.nativeEvent)),P||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&v.state.activeIndex!==null&&!P&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(ne){if(I||L||ne.ctrlKey||ne.shiftKey||ne.altKey||ne.metaKey)return;v.state.keyboardActiveRef.current=!0;const re=ne.currentTarget,oe=re.scrollWidth-re.clientWidth,le=A==="rtl";if(ne.key==="Home"){fn(ne);const ue=GS&&le?re.value.length:0;re.setSelectionRange(ue,ue),re.scrollLeft=0;return}if(ne.key==="End"){fn(ne);const ue=GS&&le?0:re.value.length;re.setSelectionRange(ue,ue),re.scrollLeft=le?-oe:oe;return}if(!$&&ne.key==="Escape"){const ue=H==="multiple"&&Array.isArray(F)?F.length===0:F===null,he=We(dp,ne.nativeEvent),de=H==="multiple"?[]:null;v.state.setInputValue("",he),v.state.setSelectedValue(de,he),!ue&&!v.state.inline&&!he.isPropagationAllowed&&ne.stopPropagation();return}if(w&&ne.key==="Backspace"&&re.value===""&&w.highlightedChipIndex===void 0&&Array.isArray(F)&&F.length>0){const ue=F.slice(0,-1);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"}),v.state.setSelectedValue(ue,We(Mn,ne.nativeEvent));return}const ve=V(ne);if(w?.setHighlightedChipIndex(ve),ve!==void 0?w?.chipsRef.current[ve]?.focus():v.state.inputRef.current?.focus(),ne.which!==229&&ne.key==="Enter"&&K){const ue=v.state.activeIndex,he=ne.nativeEvent;if(ue===null){v.state.setOpen(!1,We(Mn,he));return}fn(ne);const de=v.state.listRef.current[ue];de&&(v.state.selectionEventRef.current=he,de.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},S?S.getValidationProps(a):a],stateAttributesMapping:$P})}),YP={...Gs,...c0},XP=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,keepMounted:a=!1,...l}=t,{disabled:d}=us(),p=Ri(),f=Le(p,Ge.selectionMode),g=Le(p,Ge.disabled),S=Le(p,Ge.readOnly),C=Le(p,Ge.open),w=Le(p,Ge.selectedValue),y=B0();let x=!1;f==="none"?x=y!=="":f==="single"?x=w!=null:x=Array.isArray(w)&&w.length>0;const v=d||g||u,{buttonRef:b,getButtonProps:E}=xr({native:h,disabled:v}),{mounted:T,transitionStatus:A,setMounted:M}=ki(x),L=R.useMemo(()=>({disabled:v,open:C,transitionStatus:A}),[v,C,A]);Ur({open:x,ref:p.state.clearRef,onComplete(){x||M(!1)}});const D=at("button",t,{state:L,ref:[n,b,p.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:v,"aria-readonly":S||void 0,onMouseDown(z){z.preventDefault()},onClick(z){if(v||S)return;const q=p.state.keyboardActiveRef;p.state.setInputValue("",We(US,z.nativeEvent)),f!=="none"?(p.state.setSelectedValue(Array.isArray(w)?[]:null,We(US,z.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:q.current?"keyboard":"pointer"})):p.state.setIndices({activeIndex:null,type:q.current?"keyboard":"pointer"}),p.state.inputRef.current?.focus()}},l,E],stateAttributesMapping:YP});return a||T?D:null}),QP=R.createContext(null);function ZP(){return R.useContext(QP)}function JP(e){const{children:t}=e,{filteredItems:n}=Na(),s=ZP(),o=s?s.items:n;return o?_.jsx(R.Fragment,{children:o.map(t)}):null}const e9=R.forwardRef(function(t,n){var s;const{render:o,className:u,children:h,...a}=t,l=Ri(),d=Ep(),p=!!z0(!0),{filteredItems:f}=Na(),g=Le(l,Ge.items),S=Le(l,Ge.labelsRef),C=Le(l,Ge.listRef),w=Le(l,Ge.selectionMode),y=Le(l,Ge.grid),x=Le(l,Ge.popupProps),v=Le(l,Ge.disabled),b=Le(l,Ge.readOnly),E=Le(l,Ge.virtualized),T=w==="multiple",A=f.length===0,M=Pe(j=>{l.set("positionerElement",j)}),L=Pe(j=>{l.set("listElement",j)}),D=R.useMemo(()=>typeof h=="function"?s||(s=_.jsx(JP,{children:h})):h,[h]),H=R.useMemo(()=>({empty:A}),[A]),z=d.useState("floatingId"),q=at("div",t,{state:H,ref:[n,L,p?null:M],props:[x,{children:D,tabIndex:-1,id:z,role:y?"grid":"listbox","aria-multiselectable":T?"true":void 0,onKeyDown(j){if(!(v||b)&&j.key==="Enter"){const K=l.state.activeIndex;if(K==null)return;fn(j);const $=j.nativeEvent,F=l.state.listRef.current[K];F&&(l.state.selectionEventRef.current=$,F.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return E?q:_.jsx(ud,{elementsRef:C,labelsRef:g?void 0:S,children:q})}),Hk=R.createContext(void 0);function t9(){const e=R.useContext(Hk);if(e===void 0)throw new Error(Pt(20));return e}const n9=R.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,u=Ri(),h=Le(u,Ge.mounted),a=Le(u,Ge.forceMounted);return h||s||a?_.jsx(Hk.Provider,{value:s,children:_.jsx(hp,{ref:n,...o})}):null}),r9=R.forwardRef(function(t,n){const{render:s,className:o,anchor:u,positionMethod:h="absolute",side:a="bottom",align:l="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:S=5,sticky:C=!1,disableAnchorTracking:w=!1,collisionAvoidance:y=n0,...x}=t,v=Ri(),{filteredItems:b}=Na(),E=Ep(),T=t9(),A=Le(v,Ge.modal),M=Le(v,Ge.open),L=Le(v,Ge.mounted),D=Le(v,Ge.openMethod),H=Le(v,Ge.triggerElement),z=Le(v,Ge.inputElement),q=Le(v,Ge.inputInsidePopup),j=b.length===0,$=A0({anchor:u??(q?H:z),floatingRootContext:E,positionMethod:h,mounted:L,side:a,sideOffset:d,align:l,alignOffset:p,arrowPadding:S,collisionBoundary:f,collisionPadding:g,sticky:C,disableAnchorTracking:w,keepMounted:T,collisionAvoidance:y,lazyFlip:!0});xp(M&&A&&D!=="touch",H);const F=R.useMemo(()=>{const I={...$.positionerStyles};return M||(I.pointerEvents="none"),{role:"presentation",hidden:!L,style:I}},[M,L,$.positionerStyles]),G=R.useMemo(()=>({open:M,side:$.side,align:$.align,anchorHidden:$.anchorHidden,empty:j}),[M,$.side,$.align,$.anchorHidden,j]);Fe(()=>{v.set("popupSide",$.side)},[v,$.side]);const U=R.useMemo(()=>({side:$.side,align:$.align,arrowRef:$.arrowRef,arrowUncentered:$.arrowUncentered,arrowStyles:$.arrowStyles,anchorHidden:$.anchorHidden,isPositioned:$.isPositioned}),[$.side,$.align,$.arrowRef,$.arrowUncentered,$.arrowStyles,$.anchorHidden,$.isPositioned]),P=Pe(I=>{v.set("positionerElement",I)}),B=at("div",t,{state:G,ref:[n,P],props:[F,x],stateAttributesMapping:xo});return _.jsxs(zk.Provider,{value:U,children:[L&&A&&_.jsx(bp,{inert:yp(!M),cutout:z??H}),B]})}),s9={...xo,...Gs},i9=R.forwardRef(function(t,n){const{render:s,className:o,initialFocus:u,finalFocus:h,...a}=t,l=Ri(),d=z0(),p=Ep(),{filteredItems:f}=Na(),g=Le(l,Ge.mounted),S=Le(l,Ge.open),C=Le(l,Ge.openMethod),w=Le(l,Ge.transitionStatus),y=Le(l,Ge.inputInsidePopup),x=Le(l,Ge.inputElement),v=f.length===0;Ur({open:S,ref:l.state.popupRef,onComplete(){S&&l.state.onOpenChangeComplete(!0)}});const b=R.useMemo(()=>({open:S,side:d.side,align:d.align,anchorHidden:d.anchorHidden,transitionStatus:w,empty:v}),[S,d.side,d.align,d.anchorHidden,w,v]),E=at("div",t,{state:b,ref:[n,l.state.popupRef],props:[{role:y?"dialog":"presentation",tabIndex:-1,onFocus(L){const D=Pn(L.nativeEvent);C!=="touch"&&(ft(l.state.listElement,D)||D===L.currentTarget)&&l.state.inputRef.current?.focus()}},D0(w),a],stateAttributesMapping:s9}),A=u===void 0?y?L=>L==="touch"?l.state.popupRef.current:x:!1:u;let M;return h!=null?M=h:M=y?void 0:!1,_.jsx(pp,{context:p,disabled:!g,modal:!y,openInteractionType:C,initialFocus:A,returnFocus:M,children:E})}),Vk=R.createContext(void 0);function Fk(){const e=R.useContext(Vk);if(!e)throw new Error(Pt(19));return e}const o9=R.createContext(!1);function a9(){return R.useContext(o9)}const l9=R.memo(R.forwardRef(function(t,n){const{render:s,className:o,value:u=null,index:h,disabled:a=!1,nativeButton:l=!1,...d}=t,p=R.useRef(!1),f=R.useRef(null),g=ac({index:h,textRef:f,indexGuessBehavior:P0.GuessFromOrder}),S=Ri(),C=a9(),{flatFilteredItems:w}=Na(),y=Le(S,Ge.open),x=Le(S,Ge.selectionMode),v=Le(S,Ge.readOnly),b=Le(S,Ge.virtualized),E=Le(S,Ge.isItemEqualToValue),T=x!=="none",A=h??(b?Kl(w,u,E):g.index),M=g.index!==-1,L=Le(S,Ge.id),D=Le(S,Ge.isActive,A),H=Le(S,Ge.isSelected,u),z=Le(S,Ge.items),q=Le(S,Ge.getItemProps),j=R.useRef(null),K=L!=null&&M?`${L}-${A}`:void 0,$=H&&T;Fe(()=>{if(!(M&&(b||h!=null)))return;const Z=S.state.listRef.current;return Z[A]=j.current,()=>{delete Z[A]}},[M,b,A,h,S]),Fe(()=>{if(!M||z)return;const J=S.state.valuesRef.current;return J[A]=u,x!=="none"&&S.state.allValuesRef.current.push(u),()=>{delete J[A]}},[M,z,A,u,S,x]),Fe(()=>{if(!y){p.current=!1;return}if(!M||z)return;const J=S.state.selectedValue,Z=Array.isArray(J)?J[J.length-1]:J;Ci(Z,u,E)&&S.set("selectedIndex",A)},[M,z,y,S,A,u,E]);const F=R.useMemo(()=>({disabled:a,selected:$,highlighted:D}),[a,$,D]),G=q({active:D,selected:$});G.id=void 0,G.onFocus=void 0;const{getButtonProps:U,buttonRef:P}=xr({disabled:a,focusableWhenDisabled:!0,native:l});function B(J){function Z(){S.state.handleSelection(J,u)}S.state.submitOnItemClick?(er.flushSync(Z),S.state.requestSubmit()):Z()}const I={id:K,role:C?"gridcell":"option","aria-disabled":a||void 0,"aria-selected":T?$:void 0,tabIndex:void 0,onPointerDownCapture(J){p.current=!0,J.preventDefault()},onClick(J){a||v||B(J.nativeEvent)},onMouseUp(J){const Z=p.current;p.current=!1,!(a||v||J.button!==0||Z||!D)&&B(J.nativeEvent)}},W=at("div",t,{ref:[P,n,g.ref,j],state:F,props:[G,I,d,U]}),Y=R.useMemo(()=>({selected:$,textRef:f}),[$,f]);return _.jsx(Vk.Provider,{value:Y,children:W})})),c9=R.forwardRef(function(t,n){const{render:s,className:o,children:u,...h}=t,{filteredItems:a}=Na(),l=Ri(),d=a.length===0?u:null;return at("div",t,{ref:[n,l.state.emptyRef],props:[{children:d,role:"status","aria-live":"polite","aria-atomic":!0},h]})});let EC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function Uk(e){return R.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[EC.checked]:""}:{[EC.unchecked]:""}},...Ia}),[e.indeterminate])}const Wk=R.createContext(void 0);function u9(){const e=R.useContext(Wk);if(e===void 0)throw new Error(Pt(14));return e}const d9="data-parent",f9=R.forwardRef(function(t,n){const{checked:s,className:o,defaultChecked:u=!1,disabled:h=!1,id:a,indeterminate:l=!1,inputRef:d,name:p,onCheckedChange:f,parent:g=!1,readOnly:S=!1,render:C,required:w=!1,uncheckedValue:y,value:x,nativeButton:v=!1,...b}=t,{clearErrors:E}=ad(),{disabled:T,name:A,setDirty:M,setFilled:L,setFocused:D,setTouched:H,state:z,validationMode:q,validityData:j,shouldValidateOnChange:K,validation:$}=us(),F=N8(),{labelId:G,controlId:U,setControlId:P,getDescriptionProps:B}=wo(),I=z8(),W=I?.parent,Y=W&&I.allValues,J=T||F.disabled||I?.disabled||h,Z=A??p,ee=x??Z,X=ar(),V=ar();let se=U;Y?se=g?V:`${W.id}-${ee}`:a&&(se=a);let ne={};Y&&(g?ne=I.parent.getParentProps():ee&&(ne=I.parent.getChildProps(ee)));const re=Pe(f),{checked:oe=s,indeterminate:le=l,onCheckedChange:ve,...ue}=ne,he=I?.value,de=I?.setValue,Ne=I?.defaultValue,Me=R.useRef(null),{getButtonProps:Ae,buttonRef:be}=xr({disabled:J,native:v}),Oe=I?.validation??$,[me,ke]=as({controlled:ee&&he&&!g?he.includes(ee):oe,default:ee&&Ne&&!g?Ne.includes(ee):u,name:"Checkbox",state:"checked"});Fe(()=>{if(P!==on)return P(se),()=>{P(void 0)}},[se,I,P,g]),ld({enabled:!I,id:X,commit:Oe.commit,value:me,controlRef:Me,name:Z,getValue:()=>me});const Ce=R.useRef(null),qe=cs(d,Ce,Oe.inputRef);Fe(()=>{Ce.current&&(Ce.current.indeterminate=le,me&&L(!0))},[me,le,L]),ca(me,()=>{I&&!g||(E(Z),L(me),M(me!==j.initialValue),K()?Oe.commit(me):Oe.commit(me,!0))});const De=Ws({checked:me,disabled:J,name:g?void 0:Z,id:se??void 0,required:w,ref:qe,style:ic,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Ve){if(Ve.nativeEvent.defaultPrevented)return;const Ee=Ve.target.checked,tt=We(Mn,Ve.nativeEvent);if(ve?.(Ee,tt),re(Ee,tt),!tt.isCanceled&&(ke(Ee),ee&&he&&de&&!g)){const lt=Ee?[...he,ee]:he.filter(Xe=>Xe!==ee);de(lt,tt)}},onFocus(){Me.current?.focus()}},x!==void 0?{value:(I?me&&x:x)||""}:tn,B,I?Oe.getValidationProps:Oe.getInputValidationProps),Ie=Y?!!oe:me,rt=Y&&le||l;R.useEffect(()=>{W&&ee&&W.disabledStatesRef.current.set(ee,J)},[W,J,ee]);const et=R.useMemo(()=>({...z,checked:Ie,disabled:J,readOnly:S,required:w,indeterminate:rt}),[z,Ie,J,S,w,rt]),dt=Uk(et),xe=at("span",t,{state:et,ref:[be,Me,n,I?.registerControlRef],props:[{id:X,role:"checkbox","aria-checked":le?"mixed":me,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":G,[d9]:g?"":void 0,onFocus(){D(!0)},onBlur(){const Ve=Ce.current;Ve&&(H(!0),D(!1),q==="onBlur"&&Oe.commit(I?he:Ve.checked))},onClick(Ve){S||J||(Ve.preventDefault(),Ce.current?.click())}},B,Oe.getValidationProps,b,ue,Ae],stateAttributesMapping:dt});return _.jsxs(Wk.Provider,{value:et,children:[xe,!me&&!I&&Z&&!g&&y!==void 0&&_.jsx("input",{type:"hidden",name:Z,value:y}),_.jsx("input",{...De})]})}),h9=R.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=u9(),l=a.checked||a.indeterminate,{transitionStatus:d,setMounted:p}=ki(l),f=R.useRef(null),g=R.useMemo(()=>({...a,transitionStatus:d}),[a,d]);Ur({open:l,ref:f,onComplete(){l||p(!1)}});const S=Uk(a),C=R.useMemo(()=>({...S,...Gs,...Ia}),[S]),w=u||l,y=at("span",t,{enabled:w,ref:[n,f],state:g,stateAttributesMapping:C,props:h});return w?y:null});function p9(e){const{multiple:t=!1,defaultValue:n,value:s,onValueChange:o,...u}=e;return _.jsx(FP,{...u,selectionMode:t?"multiple":"single",selectedValue:s,defaultSelectedValue:n,onSelectedValueChange:o})}const m9=R.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=Fk();return s||o?_.jsx(g9,{...t,ref:n}):null}),g9=R.memo(R.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=Fk(),a=R.useRef(null),{transitionStatus:l,setMounted:d}=ki(h),p=R.useMemo(()=>({selected:h,transitionStatus:l}),[h,l]),f=at("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Gs});return Ur({open:h,ref:a,onComplete(){h||d(!1)}}),f})),v9=R.createContext(void 0);function kp(e=!0){const t=R.useContext(v9);if(t===void 0&&!e)throw new Error(Pt(25));return t}const qk=R.createContext(void 0);function H0(e){const t=R.useContext(qk);if(t===void 0&&!e)throw new Error(Pt(33));return t}const Gk=R.createContext(void 0);function Eo(e){const t=R.useContext(Gk);if(t===void 0&&!e)throw new Error(Pt(36));return t}const $k={type:"regular-item"};function Kk(e){const{closeOnClick:t,disabled:n=!1,highlighted:s,id:o,store:u,nativeButton:h,itemMetadata:a,nodeId:l}=e,d=R.useRef(null),p=kp(!0),f=p!==void 0,{events:g}=u.useState("floatingTreeRoot"),{getButtonProps:S,buttonRef:C}=xr({disabled:n,focusableWhenDisabled:!0,native:h}),w=R.useCallback(x=>Ws({id:o,role:"menuitem",tabIndex:s?0:-1,onMouseMove(v){l&&g.emit("itemhover",{nodeId:l,target:v.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(v){v.key===" "&&u.context.typingRef.current&&v.preventBaseUIHandler()},onClick(v){t&&g.emit("close",{domEvent:v,reason:ma})},onMouseUp(v){if(p){const b=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,f&&b&&Math.abs(v.clientX-b.x)<=1&&Math.abs(v.clientY-b.y)<=1)return}d.current&&u.context.allowMouseUpTriggerRef.current&&(!f||v.button===2)&&a.type==="regular-item"&&d.current.click()}},x,S),[o,s,S,t,g,u,f,p,a,l]),y=cs(d,C);return R.useMemo(()=>({getItemProps:w,itemRef:y}),[w,y])}let kC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const Yk={checked(e){return e?{[kC.checked]:""}:{[kC.unchecked]:""}},...Gs},_9=R.forwardRef(function(t,n){const{render:s,className:o,id:u,label:h,nativeButton:a=!1,disabled:l=!1,closeOnClick:d=!0,...p}=t,f=ac({label:h}),g=H0(!0),S=ar(u),{store:C}=Eo(),w=C.useState("isActive",f.index),y=C.useState("itemProps"),{getItemProps:x,itemRef:v}=Kk({closeOnClick:d,disabled:l,highlighted:w,id:S,store:C,nativeButton:a,nodeId:g?.nodeId,itemMetadata:$k}),b=R.useMemo(()=>({disabled:l,highlighted:w}),[l,w]);return at("div",t,{state:b,props:[y,p,x],ref:[v,n,f.ref]})}),y9={...xo,...Gs},b9=R.forwardRef(function(t,n){const{render:s,className:o,finalFocus:u,...h}=t,{store:a}=Eo(),{side:l,align:d}=H0(),p=M0()!=null,f=a.useState("open"),g=a.useState("transitionStatus"),S=a.useState("popupProps"),C=a.useState("mounted"),w=a.useState("instantType"),y=a.useState("activeTriggerElement"),x=a.useState("parent"),v=a.useState("lastOpenChangeReason"),b=a.useState("rootId"),E=a.useState("floatingRootContext"),T=a.useState("floatingTreeRoot"),A=a.useState("closeDelay"),M=a.useState("activeTriggerElement");Ur({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),R.useEffect(()=>{function j(K){a.setOpen(!1,We(K.reason,K.domEvent))}return T.events.on("close",j),()=>{T.events.off("close",j)}},[T.events,a]);const L=a.useState("hoverEnabled"),D=a.useState("disabled");X6(E,{enabled:L&&!D&&x.type!=="context-menu"&&x.type!=="menubar",closeDelay:A});const H=R.useMemo(()=>({transitionStatus:g,side:l,align:d,open:f,nested:x.type==="menu",instant:w}),[g,l,d,f,x.type,w]),z=at("div",t,{state:H,ref:[n,a.context.popupRef],stateAttributesMapping:y9,props:[S,{onKeyDown(j){p&&R0.has(j.key)&&j.stopPropagation()}},D0(g),h,{"data-rootownerid":b}]});let q=x.type===void 0||x.type==="context-menu";return(y||x.type==="menubar"&&v!==u0)&&(q=!0),_.jsx(pp,{context:E,modal:!1,disabled:!C,returnFocus:u===void 0?q:u,initialFocus:x.type!=="menu",restoreFocus:!0,externalTree:x.type!=="menubar"?T:void 0,previousFocusableElement:M,nextFocusableElement:x.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:x.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:z})}),Xk=R.createContext(void 0);function x9(){const e=R.useContext(Xk);if(e===void 0)throw new Error(Pt(32));return e}const S9=R.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=Eo();return u.useState("mounted")||s?_.jsx(Xk.Provider,{value:s,children:_.jsx(hp,{ref:n,...o})}):null}),C9=R.forwardRef(function(t,n){const{anchor:s,positionMethod:o="absolute",className:u,render:h,side:a,align:l,sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:S=5,sticky:C=!1,disableAnchorTracking:w=!1,collisionAvoidance:y=n0,...x}=t,{store:v}=Eo(),b=x9(),E=kp(!0),T=v.useState("parent"),A=v.useState("floatingRootContext"),M=v.useState("floatingTreeRoot"),L=v.useState("mounted"),D=v.useState("open"),H=v.useState("modal"),z=v.useState("activeTriggerElement"),q=v.useState("lastOpenChangeReason"),j=v.useState("floatingNodeId"),K=v.useState("floatingParentNodeId");let $=s,F=d,G=p,U=l,P=y;T.type==="context-menu"&&($=s??T.context?.anchor,U=U??"start",!a&&U!=="center"&&(G=t.alignOffset??2,F=t.sideOffset??-5));let B=a,I=U;T.type==="menu"?(B=B??"inline-end",I=I??"start",P=t.collisionAvoidance??oM):T.type==="menubar"&&(B=B??"bottom",I=I??"start");const W=T.type==="context-menu",Y=A0({anchor:$,floatingRootContext:A,positionMethod:E?"fixed":o,mounted:L,side:B,sideOffset:F,align:I,alignOffset:G,arrowPadding:W?0:S,collisionBoundary:f,collisionPadding:g,sticky:C,nodeId:j,keepMounted:b,disableAnchorTracking:w,collisionAvoidance:P,shiftCrossAxis:W,externalTree:M}),J=R.useMemo(()=>{const ne={};return D||(ne.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...Y.positionerStyles,...ne}}},[D,L,Y.positionerStyles]);R.useEffect(()=>{function ne(re){re.open?(re.parentNodeId===j&&v.set("hoverEnabled",!1),re.nodeId!==j&&re.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,We(Ru))):re.parentNodeId===j&&re.reason!==Ru&&v.set("hoverEnabled",!0)}return M.events.on("menuopenchange",ne),()=>{M.events.off("menuopenchange",ne)}},[v,M.events,j]),R.useEffect(()=>{if(v.select("floatingParentNodeId")==null)return;function ne(re){if(re.open||re.nodeId!==v.select("floatingParentNodeId"))return;const oe=re.reason??Ru;v.setOpen(!1,We(oe))}return M.events.on("menuopenchange",ne),()=>{M.events.off("menuopenchange",ne)}},[M.events,v]),R.useEffect(()=>{function ne(re){!D||re.nodeId!==v.select("floatingParentNodeId")||re.target&&z&&z!==re.target&&v.setOpen(!1,We(Ru))}return M.events.on("itemhover",ne),()=>{M.events.off("itemhover",ne)}},[M.events,D,z,v]),R.useEffect(()=>{const ne={open:D,nodeId:j,parentNodeId:K,reason:v.select("lastOpenChangeReason")};M.events.emit("menuopenchange",ne)},[M.events,D,v,j,K]);const Z=R.useMemo(()=>({open:D,side:Y.side,align:Y.align,anchorHidden:Y.anchorHidden,nested:T.type==="menu"}),[D,Y.side,Y.align,Y.anchorHidden,T.type]),ee=R.useMemo(()=>({side:Y.side,align:Y.align,arrowRef:Y.arrowRef,arrowUncentered:Y.arrowUncentered,arrowStyles:Y.arrowStyles,nodeId:Y.context.nodeId}),[Y.side,Y.align,Y.arrowRef,Y.arrowUncentered,Y.arrowStyles,Y.context.nodeId]),X=at("div",t,{state:Z,stateAttributesMapping:xo,ref:[n,v.useStateSetter("positionerElement")],props:[J,x]}),V=L&&T.type!=="menu"&&(T.type!=="menubar"&&H&&q!==Br||T.type==="menubar"&&T.context.modal);let se=null;return T.type==="menubar"?se=T.context.contentElement:T.type===void 0&&(se=z),_.jsxs(qk.Provider,{value:ee,children:[V&&_.jsx(bp,{ref:T.type==="context-menu"||T.type==="nested-context-menu"?T.context.internalBackdropRef:null,inert:yp(!D),cutout:se}),_.jsx(xD,{id:j,children:_.jsx(ud,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:X})})]})}),Qk=R.createContext(void 0);function w9(){const e=R.useContext(Qk);if(e===void 0)throw new Error(Pt(34));return e}const E9=R.memo(R.forwardRef(function(t,n){const{render:s,className:o,value:u,defaultValue:h,onValueChange:a,disabled:l=!1,...d}=t,[p,f]=as({controlled:u,default:h,name:"MenuRadioGroup"}),g=Pe(a),S=Pe((x,v)=>{g?.(x,v),!v.isCanceled&&f(x)}),C=R.useMemo(()=>({disabled:l}),[l]),w=at("div",t,{state:C,ref:n,props:{role:"group","aria-disabled":l||void 0,...d}}),y=R.useMemo(()=>({value:p,setValue:S,disabled:l}),[p,S,l]);return _.jsx(Qk.Provider,{value:y,children:w})})),Zk=R.createContext(void 0);function k9(){const e=R.useContext(Zk);if(e===void 0)throw new Error(Pt(35));return e}const R9=R.forwardRef(function(t,n){const{render:s,className:o,id:u,label:h,nativeButton:a=!1,disabled:l=!1,closeOnClick:d=!1,value:p,...f}=t,g=ac({label:h}),S=H0(!0),C=ar(u),{store:w}=Eo(),y=w.useState("isActive",g.index),x=w.useState("itemProps"),{value:v,setValue:b,disabled:E}=w9(),T=E||l,A=v===p,{getItemProps:M,itemRef:L}=Kk({closeOnClick:d,disabled:T,highlighted:y,id:C,store:w,nativeButton:a,nodeId:S?.nodeId,itemMetadata:$k}),D=R.useMemo(()=>({disabled:T,highlighted:y,checked:A}),[T,y,A]),H=Pe(q=>{const j={...We(ma,q.nativeEvent),preventUnmountOnClose:()=>{}};b(p,j)}),z=at("div",t,{state:D,stateAttributesMapping:Yk,props:[x,{role:"menuitemradio","aria-checked":A,onClick:H},f,M],ref:[L,n,g.ref]});return _.jsx(Zk.Provider,{value:D,children:z})}),T9=R.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=k9(),l=R.useRef(null),{transitionStatus:d,setMounted:p}=ki(a.checked);Ur({open:a.checked,ref:l,onComplete(){a.checked||p(!1)}});const f=R.useMemo(()=>({checked:a.checked,disabled:a.disabled,highlighted:a.highlighted,transitionStatus:d}),[a.checked,a.disabled,a.highlighted,d]);return at("span",t,{state:f,stateAttributesMapping:Yk,ref:[n,l],props:{"aria-hidden":!0,...h},enabled:u||a.checked})}),L9=R.createContext(null);function Jk(e){return R.useContext(L9)}const A9={...JE,disabled:we(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:we(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:we(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:we(e=>e.stickIfOpen),parent:we(e=>e.parent),rootId:we(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:we(e=>e.activeIndex),isActive:we((e,t)=>e.activeIndex===t),hoverEnabled:we(e=>e.hoverEnabled),instantType:we(e=>e.instantType),lastOpenChangeReason:we(e=>e.openChangeReason),floatingTreeRoot:we(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:we(e=>e.floatingNodeId),floatingParentNodeId:we(e=>e.floatingParentNodeId),itemProps:we(e=>e.itemProps),closeDelay:we(e=>e.closeDelay),keyboardEventRelay:we(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class V0 extends S0{constructor(t){super({...O9(),...t},{positionerRef:R.createRef(),popupRef:R.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:R.createRef(),beforeContentFocusGuardRef:R.createRef(),onOpenChangeComplete:void 0,triggerElements:new vp},A9),this.observe(we(n=>n.allowMouseEnter),(n,s)=>{this.state.parent.type==="menu"&&n!==s&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){return Gn(()=>t??new V0(n)).current}unsubscribeParentListener=null}function O9(){return{...ZE(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new y0,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:tn,keyboardEventRelay:void 0,closeDelay:0}}const M9=R.createContext(void 0);function D9(){return R.useContext(M9)}function P9(e){const{children:t,open:n,onOpenChange:s,onOpenChangeComplete:o,defaultOpen:u=!1,disabled:h=!1,modal:a,loopFocus:l=!0,orientation:d="vertical",actionsRef:p,closeParentOnEsc:f=!1,handle:g,triggerId:S,defaultTriggerId:C=null,highlightItemOnHover:w=!0}=e,y=kp(!0),x=Eo(!0),v=Jk(),b=D9(),E=R.useMemo(()=>b&&x?{type:"menu",store:x.store}:v?{type:"menubar",context:v}:y&&!x?{type:"context-menu",context:y}:{type:void 0},[y,x,v,b]),T=V0.useStore(g?.store,{parent:E}),A=T.useState("floatingTreeRoot"),M=IE(A),L=Ei();Fe(()=>{y&&!x?T.update({parent:{type:"context-menu",context:y},floatingNodeId:M,floatingParentNodeId:L}):x&&T.update({floatingNodeId:M,floatingParentNodeId:L})},[y,x,M,L,T]),T.useControlledProp("open",n,u),T.useControlledProp("activeTriggerId",S,C),T.useContextCallback("onOpenChangeComplete",o);const D=T.useState("open"),H=T.useState("activeTriggerElement"),z=T.useState("positionerElement"),q=T.useState("hoverEnabled"),j=T.useState("modal"),K=T.useState("disabled"),$=T.useState("lastOpenChangeReason"),F=T.useState("parent"),G=T.useState("activeIndex"),U=T.useState("payload"),P=T.useState("floatingParentNodeId"),B=R.useRef(null),I=P!=null;let W;T.useSyncedValues({disabled:h,modal:F.type===void 0?a:void 0,rootId:Da()});const{openMethod:Y,triggerProps:J,reset:Z}=Sp(D);XE(T);const{forceUnmount:ee}=QE(D,T,()=>{T.update({allowMouseEnter:!1,stickIfOpen:!0}),Z()}),X=R.useRef(F.type!=="context-menu"),V=Qt();R.useEffect(()=>{if(D||(B.current=null),F.type==="context-menu"){if(!D){V.clear(),X.current=!1;return}V.start(500,()=>{X.current=!0})}},[V,D,F.type]),xp(D&&j&&$!==Br&&Y!=="touch",z),Fe(()=>{!D&&!q&&T.set("hoverEnabled",!0)},[D,q,T]);const se=R.useRef(!0),ne=Qt(),re=Pe((Ee,tt)=>{const lt=tt.reason;if(D===Ee&&tt.trigger===H||(tt.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},!Ee&&tt.trigger==null&&(tt.trigger=H??void 0),s?.(Ee,tt),tt.isCanceled))return;const Xe={open:Ee,nativeEvent:tt.event,reason:tt.reason,nested:I};W?.emit("openchange",Xe);const st=tt.event;if(Ee===!1&&st?.type==="click"&&st.pointerType==="touch"&&!se.current)return;if(!Ee&&G!==null){const Rt=T.context.itemDomElements.current[G];queueMicrotask(()=>{Rt?.setAttribute("tabindex","-1")})}Ee&&lt===Mh?(se.current=!1,ne.start(300,()=>{se.current=!0})):(se.current=!0,ne.clear());const Ct=(lt===pa||lt===ma)&&st.detail===0&&st?.isTrusted,ct=!Ee&&(lt===dp||lt==null);function nn(){const Rt={open:Ee,openChangeReason:lt};B.current=tt.event??null;const vt=tt.trigger?.id??null;(vt||Ee)&&(Rt.activeTriggerId=vt,Rt.activeTriggerElement=tt.trigger??null),T.update(Rt)}lt===Br?er.flushSync(nn):nn(),F.type==="menubar"&&(lt===Mh||lt===ka||lt===Br||lt===Du||lt===Ru)?T.set("instantType","group"):Ct||ct?T.set("instantType",Ct?"click":"dismiss"):T.set("instantType",void 0)}),oe=R.useCallback(Ee=>{const tt=We(Ee);return tt.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},tt},[T]),le=R.useCallback(()=>{T.setOpen(!1,oe(iE))},[T,oe]);R.useImperativeHandle(p,()=>({unmount:ee,close:le}),[ee,le]);let ve;F.type==="context-menu"&&(ve=F.context),R.useImperativeHandle(ve?.positionerRef,()=>z,[z]),R.useImperativeHandle(ve?.actionsRef,()=>({setOpen:re}),[re]);const ue=ek({popupStore:T,onOpenChange:re});W=ue.context.events,R.useEffect(()=>{const Ee=({open:tt,eventDetails:lt})=>re(tt,lt);return W.on("setOpen",Ee),()=>{W?.off("setOpen",Ee)}},[W,re]);const he=gp(ue,{enabled:!K,bubbles:f&&F.type==="menu",outsidePress(){return F.type!=="context-menu"||B.current?.type==="contextmenu"?!0:X.current},externalTree:I?A:void 0}),de=nk(ue,{role:"menu"}),Ne=ja(),Me=R.useCallback(Ee=>{T.select("activeIndex")!==Ee&&T.set("activeIndex",Ee)},[T]),Ae=E0(ue,{enabled:!K,listRef:T.context.itemDomElements,activeIndex:G,nested:F.type!==void 0,loopFocus:l,orientation:d,parentOrientation:F.type==="menubar"?F.context.orientation:void 0,rtl:Ne==="rtl",disabledIndices:yr,onNavigate:Me,openOnArrowKeyDown:F.type!=="context-menu",externalTree:I?A:void 0,focusItemOnHover:w}),be=R.useCallback(Ee=>{T.context.typingRef.current=Ee},[T]),Oe=k0(ue,{listRef:T.context.itemLabels,activeIndex:G,resetMs:rM,onMatch:Ee=>{D&&Ee!==G&&T.set("activeIndex",Ee)},onTypingChange:be}),{getReferenceProps:me,getFloatingProps:ke,getItemProps:Ce,getTriggerProps:qe}=oc([he,de,Ae,Oe]),De=R.useMemo(()=>{const Ee=Ws(me(),{onMouseEnter(){T.set("hoverEnabled",!0)},onMouseMove(){T.set("allowMouseEnter",!0)}},J);return delete Ee.role,Ee},[me,T,J]),Ie=R.useMemo(()=>{const Ee=qe();if(!Ee)return Ee;const tt=Ws(Ee,J);return delete tt.role,delete tt["aria-controls"],tt},[qe,J]),rt=rd(),et=R.useMemo(()=>ke({onMouseEnter(){F.type==="menu"&&rt.request(()=>T.set("hoverEnabled",!1))},onMouseMove(){T.set("allowMouseEnter",!0)},onClick(){T.select("hoverEnabled")&&T.set("hoverEnabled",!1)},onKeyDown(Ee){const tt=T.select("keyboardEventRelay");tt&&!Ee.isPropagationStopped()&&tt(Ee)}}),[ke,F.type,rt,T]),dt=R.useMemo(()=>Ce(),[Ce]);T.useSyncedValues({floatingRootContext:ue,activeTriggerProps:De,inactiveTriggerProps:Ie,popupProps:et,itemProps:dt});const xe=R.useMemo(()=>({store:T,parent:E}),[T,E]),Ve=_.jsx(Gk.Provider,{value:xe,children:typeof t=="function"?t({payload:U}):t});return F.type===void 0||F.type==="context-menu"?_.jsx(SD,{externalTree:A,children:Ve}):Ve}function eR(e){const{render:t,className:n,state:s=tn,props:o=yr,refs:u=yr,metadata:h,stateAttributesMapping:a,tag:l="div",...d}=e,{compositeProps:p,compositeRef:f}=Ak({metadata:h});return at(l,e,{state:s,ref:[...u,f],props:[p,...o,d],stateAttributesMapping:a})}function tR(e){if(en(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Hs(e))return tR(Us(e))}function I9(e){const{enabled:t=!0,mouseDownAction:n,open:s}=e,o=R.useRef(!1);return R.useMemo(()=>t?{onMouseDown:u=>{(n==="open"&&!s||n==="close"&&s)&&(o.current=!0,br(u.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:u=>{o.current&&(o.current=!1,u.preventBaseUIHandler())}}:tn,[t,n,s])}const Zf=2,j9=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,id:a,openOnHover:l,delay:d=100,closeDelay:p=0,handle:f,payload:g,...S}=t,C=Eo(!0),w=f?.store??C?.store;if(!w)throw new Error(Pt(85));const y=ar(a),x=w.useState("isTriggerActive",y),v=w.useState("floatingRootContext"),b=w.useState("isOpenedByTrigger",y),E=R.useRef(null),T=B9(),A=e0(!0),M=Co(),L=R.useMemo(()=>M??new y0,[M]),D=IE(L),H=Ei(),{registerTrigger:z,isMountedByThisTrigger:q}=YE(y,E,w,{payload:g,closeDelay:p,parent:T,floatingTreeRoot:L,floatingNodeId:D,floatingParentNodeId:H,keyboardEventRelay:A?.relayKeyboardEvent}),j=w.useState("disabled"),K=u||j||T.type==="menubar"&&T.context.disabled,{getButtonProps:$,buttonRef:F}=xr({disabled:K,native:h});R.useEffect(()=>{!b&&T.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,b,T.type]);const G=R.useRef(null),U=Qt(),P=Pe(de=>{if(!G.current)return;U.clear(),w.context.allowMouseUpTriggerRef.current=!1;const Ne=de.target;if(ft(G.current,Ne)||ft(w.select("positionerElement"),Ne)||Ne===G.current||Ne!=null&&tR(Ne)===w.select("rootId"))return;const Me=L0(G.current);de.clientX>=Me.left-Zf&&de.clientX<=Me.right+Zf&&de.clientY>=Me.top-Zf&&de.clientY<=Me.bottom+Zf||L.events.emit("close",{domEvent:de,reason:sE})});R.useEffect(()=>{b&&w.select("lastOpenChangeReason")===Br&&br(G.current).addEventListener("mouseup",P,{once:!0})},[b,P,w]);const B=T.type==="menubar"&&T.context.hasSubmenuOpen,W=J6(v,{enabled:(l??B??!1)&&!K&&T.type!=="context-menu"&&(T.type!=="menubar"||B&&!q),handleClose:i8({blockPointerEvents:T.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:T.type===void 0?d:void 0,delay:{close:p},triggerElementRef:E,externalTree:L,isActiveTrigger:x}),Y=N9(b,w.select("lastOpenChangeReason")),J=sd(v,{enabled:!K&&T.type!=="context-menu",event:b&&T.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0?Y:!1}),Z=G6(v,{enabled:!K&&(T.type!=="menubar"&&b||B)}),ee=I9({open:b,enabled:T.type==="menubar",mouseDownAction:"open"}),X=oc([J,Z]),V=T.type==="menubar",se=R.useMemo(()=>({disabled:K,open:b}),[K,b]),ne=w.useState("triggerProps",q),re=[G,n,F,z,E],oe=[X.getReferenceProps(),W??tn,ne,{"aria-haspopup":"menu",id:y,onMouseDown:de=>{if(w.select("open"))return;U.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),br(de.currentTarget).addEventListener("mouseup",P,{once:!0})}},V?{role:"menuitem"}:{},ee,S,$],le=R.useRef(null),ve=Pe(de=>{er.flushSync(()=>{w.setOpen(!1,We(ka,de.nativeEvent,de.currentTarget))}),yD(le.current)?.focus()}),ue=Pe(de=>{const Ne=w.select("positionerElement");if(Ne&&Al(de,Ne))w.context.beforeContentFocusGuardRef.current?.focus();else{er.flushSync(()=>{w.setOpen(!1,We(ka,de.nativeEvent,de.currentTarget))});let Me=_D(E.current);for(;Me!==null&&ft(Ne,Me)||Me?.hasAttribute("aria-hidden");){const Ae=Me;if(Me=_0(Me),Me===Ae)break}Me?.focus()}}),he=at("button",t,{enabled:!V,stateAttributesMapping:zu,state:se,ref:re,props:oe});return V?_.jsx(eR,{tag:"button",render:s,className:o,state:se,refs:re,props:oe,stateAttributesMapping:zu}):b?_.jsxs(R.Fragment,{children:[_.jsx($l,{ref:le,onFocus:ve},`${y}-pre-focus-guard`),_.jsx(R.Fragment,{children:he},y),_.jsx($l,{ref:w.context.triggerFocusTargetRef,onFocus:ue},`${y}-post-focus-guard`)]}):_.jsx(R.Fragment,{children:he},y)});function N9(e,t){const n=Qt(),[s,o]=R.useState(!1);return Fe(()=>{e&&t==="trigger-hover"?(o(!0),n.start(sM,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),s}function B9(){const e=kp(!0),t=Eo(!0),n=Jk();return R.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function yi(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const nR=R.createContext(void 0);function Rp(){const e=R.useContext(nR);if(e===void 0)throw new Error(Pt(53));return e}let Uh=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Jf=500,RC=16;function ss(e,t,n){if(!e)return 0;const s=getComputedStyle(e),o=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(s[`${t}InlineStart`])*2:parseFloat(s[`${t}${o}Start`])+parseFloat(s[`${t}${o}End`])}let z9=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),wl=(function(e){return e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const F0={hasOverflowX:e=>e?{[wl.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[wl.hasOverflowY]:""}:null,overflowXStart:e=>e?{[wl.overflowXStart]:""}:null,overflowXEnd:e=>e?{[wl.overflowXEnd]:""}:null,overflowYStart:e=>e?{[wl.overflowYStart]:""}:null,overflowYEnd:e=>e?{[wl.overflowYEnd]:""}:null,cornerHidden:()=>null},TC={width:0,height:0},H9={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},V9=R.forwardRef(function(t,n){const{render:s,className:o,overflowEdgeThreshold:u,...h}=t,[a,l]=R.useState(!1),[d,p]=R.useState(!1),[f,g]=R.useState(!1),[S,C]=R.useState(TC),[w,y]=R.useState(TC),[x,v]=R.useState(!1),[b,E]=R.useState(H9),T=ar(),A=R.useRef(null),M=R.useRef(null),L=R.useRef(null),D=R.useRef(null),H=R.useRef(null),z=R.useRef(null),q=R.useRef(null),j=R.useRef(!1),K=R.useRef(0),$=R.useRef(0),F=R.useRef(0),G=R.useRef(0),U=R.useRef("vertical"),P=Qt(),B=Qt(),I=R.useRef({x:0,y:0}),[W,Y]=R.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),J=F9(u),Z=Pe(ve=>{const ue=ve.x-I.current.x,he=ve.y-I.current.y;I.current=ve,he!==0&&(g(!0),P.start(Jf,()=>{g(!1)})),ue!==0&&(p(!0),B.start(Jf,()=>{p(!1)}))}),ee=Pe(ve=>{ve.button===0&&(j.current=!0,K.current=ve.clientY,$.current=ve.clientX,U.current=ve.currentTarget.getAttribute(z9.orientation),M.current&&(F.current=M.current.scrollTop,G.current=M.current.scrollLeft),H.current&&U.current==="vertical"&&H.current.setPointerCapture(ve.pointerId),z.current&&U.current==="horizontal"&&z.current.setPointerCapture(ve.pointerId))}),X=Pe(ve=>{if(!j.current)return;const ue=ve.clientY-K.current,he=ve.clientX-$.current;if(M.current){const de=M.current.scrollHeight,Ne=M.current.clientHeight,Me=M.current.scrollWidth,Ae=M.current.clientWidth;if(H.current&&L.current&&U.current==="vertical"){const be=ss(L.current,"padding","y"),Oe=ss(H.current,"margin","y"),me=H.current.offsetHeight,ke=L.current.offsetHeight-me-be-Oe,Ce=ue/ke;M.current.scrollTop=F.current+Ce*(de-Ne),ve.preventDefault(),g(!0),P.start(Jf,()=>{g(!1)})}if(z.current&&D.current&&U.current==="horizontal"){const be=ss(D.current,"padding","x"),Oe=ss(z.current,"margin","x"),me=z.current.offsetWidth,ke=D.current.offsetWidth-me-be-Oe,Ce=he/ke;M.current.scrollLeft=G.current+Ce*(Me-Ae),ve.preventDefault(),p(!0),B.start(Jf,()=>{p(!1)})}}}),V=Pe(ve=>{j.current=!1,H.current&&U.current==="vertical"&&H.current.releasePointerCapture(ve.pointerId),z.current&&U.current==="horizontal"&&z.current.releasePointerCapture(ve.pointerId)});function se(ve){const ue=ve.pointerType==="touch";if(v(ue),!ue){const he=ft(A.current,ve.target);l(he)}}const ne=R.useMemo(()=>({hasOverflowX:!W.scrollbarXHidden,hasOverflowY:!W.scrollbarYHidden,overflowXStart:b.xStart,overflowXEnd:b.xEnd,overflowYStart:b.yStart,overflowYEnd:b.yEnd,cornerHidden:W.cornerHidden}),[W.scrollbarXHidden,W.scrollbarYHidden,W.cornerHidden,b]),re={role:"presentation",onPointerEnter:se,onPointerMove:se,onPointerDown({pointerType:ve}){v(ve==="touch")},onPointerLeave(){l(!1)},style:{position:"relative",[Uh.scrollAreaCornerHeight]:`${S.height}px`,[Uh.scrollAreaCornerWidth]:`${S.width}px`}},oe=at("div",t,{state:ne,ref:[n,A],props:[re,h],stateAttributesMapping:F0}),le=R.useMemo(()=>({handlePointerDown:ee,handlePointerMove:X,handlePointerUp:V,handleScroll:Z,cornerSize:S,setCornerSize:C,thumbSize:w,setThumbSize:y,touchModality:x,cornerRef:q,scrollingX:d,setScrollingX:p,scrollingY:f,setScrollingY:g,hovering:a,setHovering:l,viewportRef:M,rootRef:A,scrollbarYRef:L,scrollbarXRef:D,thumbYRef:H,thumbXRef:z,rootId:T,hiddenState:W,setHiddenState:Y,overflowEdges:b,setOverflowEdges:E,viewportState:ne,overflowEdgeThreshold:J}),[ee,X,V,Z,S,w,x,q,d,p,f,g,a,l,M,A,L,D,H,z,T,W,b,ne,J]);return _.jsxs(nR.Provider,{value:le,children:[Wu.element,oe]})});function F9(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}const U9=R.createContext(void 0);function W9(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(s=>{s.forEach(o=>{o.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let ao=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({}),LC=!1;function q9(){LC||f0||(typeof CSS<"u"&&"registerProperty"in CSS&&[ao.scrollAreaOverflowXStart,ao.scrollAreaOverflowXEnd,ao.scrollAreaOverflowYStart,ao.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),LC=!0)}const G9=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{viewportRef:h,scrollbarYRef:a,scrollbarXRef:l,thumbYRef:d,thumbXRef:p,cornerRef:f,setCornerSize:g,setThumbSize:S,rootId:C,setHiddenState:w,hiddenState:y,handleScroll:x,setHovering:v,setOverflowEdges:b,overflowEdges:E,overflowEdgeThreshold:T}=Rp(),A=ja(),M=R.useRef(!0),L=Qt(),D=Qt();function H(){const G=h.current,U=a.current,P=l.current,B=d.current,I=p.current,W=f.current;if(!G)return;const Y=G.scrollHeight,J=G.scrollWidth,Z=G.clientHeight,ee=G.clientWidth,X=G.scrollTop,V=G.scrollLeft;if(Y===0||J===0)return;const se=Z>=Y,ne=ee>=J,re=ee/J,oe=Z/Y,le=Math.max(0,J-ee),ve=Math.max(0,Y-Z);let ue=0,he=0;ne||(A==="rtl"?ue=yi(-V,0,le):ue=yi(V,0,le),he=le-ue);const de=se?0:yi(X,0,ve),Ne=se?0:ve-de,Me=ne?0:ee,Ae=se?0:Z,be=ss(P,"padding","x"),Oe=ss(U,"padding","y"),me=ss(I,"margin","x"),ke=ss(B,"margin","y"),Ce=Me-be-me,qe=Ae-Oe-ke,De=P?Math.min(P.offsetWidth,Ce):Ce,Ie=U?Math.min(U.offsetHeight,qe):qe,rt=Math.max(RC,De*re),et=Math.max(RC,Ie*oe);if(S(Xe=>Xe.height===et&&Xe.width===rt?Xe:{width:rt,height:et}),U&&B){const Xe=U.offsetHeight-et-Oe-ke,st=Y-Z,Ct=st===0?0:X/st,ct=Math.min(Xe,Math.max(0,Ct*Xe));B.style.transform=`translate3d(0,${ct}px,0)`}if(P&&I){const Xe=P.offsetWidth-rt-be-me,st=J-ee,Ct=st===0?0:V/st,ct=A==="rtl"?yi(Ct*Xe,-Xe,0):yi(Ct*Xe,0,Xe);I.style.transform=`translate3d(${ct}px,0,0)`}const dt=yi(ue,0,le),xe=yi(he,0,le),Ve=yi(de,0,ve),Ee=yi(Ne,0,ve),tt=[[ao.scrollAreaOverflowXStart,dt],[ao.scrollAreaOverflowXEnd,xe],[ao.scrollAreaOverflowYStart,Ve],[ao.scrollAreaOverflowYEnd,Ee]];for(const[Xe,st]of tt)G.style.setProperty(Xe,`${st}px`);if(W){if(ne||se)g({width:0,height:0});else if(!ne&&!se){const Xe=U?.offsetWidth||0,st=P?.offsetHeight||0;g({width:Xe,height:st})}}w(Xe=>{const st=se||ne;return Xe.scrollbarYHidden===se&&Xe.scrollbarXHidden===ne&&Xe.cornerHidden===st?Xe:{scrollbarYHidden:se,scrollbarXHidden:ne,cornerHidden:st}});const lt={xStart:!ne&&dt>T.xStart,xEnd:!ne&&xe>T.xEnd,yStart:!se&&Ve>T.yStart,yEnd:!se&&Ee>T.yEnd};b(Xe=>Xe.xStart===lt.xStart&&Xe.xEnd===lt.xEnd&&Xe.yStart===lt.yStart&&Xe.yEnd===lt.yEnd?Xe:lt)}const z=Pe(()=>{er.flushSync(H)});Fe(()=>h.current?(q9(),W9(h.current,z)):void 0,[z,h]),Fe(()=>{queueMicrotask(z)},[z,y,A]),Fe(()=>{h.current?.matches(":hover")&&v(!0)},[h,v]),R.useEffect(()=>{const G=h.current;if(typeof ResizeObserver>"u"||!G)return;const U=new ResizeObserver(z);return U.observe(G),D.start(0,()=>{Promise.all(G.getAnimations({subtree:!0}).map(P=>P.finished)).then(z).catch(()=>{})}),()=>{U.disconnect(),D.clear()}},[z,h,D]);function q(){M.current=!1}const j={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!y.scrollbarXHidden||!y.scrollbarYHidden)&&{tabIndex:0},className:Wu.className,style:{overflow:"scroll"},onScroll(){h.current&&(z(),M.current||x({x:h.current.scrollLeft,y:h.current.scrollTop}),L.start(100,()=>{M.current=!0}))},onWheel:q,onTouchMove:q,onPointerMove:q,onPointerEnter:q,onKeyDown:q},K=R.useMemo(()=>({hasOverflowX:!y.scrollbarXHidden,hasOverflowY:!y.scrollbarYHidden,overflowXStart:E.xStart,overflowXEnd:E.xEnd,overflowYStart:E.yStart,overflowYEnd:E.yEnd,cornerHidden:y.cornerHidden}),[y.scrollbarXHidden,y.scrollbarYHidden,y.cornerHidden,E]),$=at("div",t,{ref:[n,h],state:K,props:[j,u],stateAttributesMapping:F0}),F=R.useMemo(()=>({computeThumbPosition:z}),[z]);return _.jsx(U9.Provider,{value:F,children:$})}),rR=R.createContext(void 0);function $9(){const e=R.useContext(rR);if(e===void 0)throw new Error(Pt(54));return e}let Wh=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const K9=R.forwardRef(function(t,n){const{render:s,className:o,orientation:u="vertical",keepMounted:h=!1,...a}=t,{hovering:l,scrollingX:d,scrollingY:p,hiddenState:f,overflowEdges:g,scrollbarYRef:S,scrollbarXRef:C,viewportRef:w,thumbYRef:y,thumbXRef:x,handlePointerDown:v,handlePointerUp:b,rootId:E,thumbSize:T}=Rp(),A=R.useMemo(()=>({hovering:l,scrolling:{horizontal:d,vertical:p}[u],orientation:u,hasOverflowX:!f.scrollbarXHidden,hasOverflowY:!f.scrollbarYHidden,overflowXStart:g.xStart,overflowXEnd:g.xEnd,overflowYStart:g.yStart,overflowYEnd:g.yEnd,cornerHidden:f.cornerHidden}),[l,d,p,u,f,g]),M=ja();R.useEffect(()=>{const j=w.current,K=u==="vertical"?S.current:C.current;if(!K)return;function $(F){if(!(!j||!K||F.ctrlKey)){if(F.preventDefault(),u==="vertical"){if(j.scrollTop===0&&F.deltaY<0)return}else if(j.scrollLeft===0&&F.deltaX<0)return;if(u==="vertical"){if(j.scrollTop===j.scrollHeight-j.clientHeight&&F.deltaY>0)return}else if(j.scrollLeft===j.scrollWidth-j.clientWidth&&F.deltaX>0)return;u==="vertical"?j.scrollTop+=F.deltaY:j.scrollLeft+=F.deltaX}}return K.addEventListener("wheel",$,{passive:!1}),()=>{K.removeEventListener("wheel",$)}},[u,C,S,w]);const L={...E&&{"data-id":`${E}-scrollbar`},onPointerDown(j){if(j.button===0&&j.currentTarget===j.target&&w.current){if(y.current&&S.current&&u==="vertical"){const K=ss(y.current,"margin","y"),$=ss(S.current,"padding","y"),F=y.current.offsetHeight,G=S.current.getBoundingClientRect(),U=j.clientY-G.top-F/2-$+K/2,P=w.current.scrollHeight,B=w.current.clientHeight,I=S.current.offsetHeight-F-$-K,Y=U/I*(P-B);w.current.scrollTop=Y}if(x.current&&C.current&&u==="horizontal"){const K=ss(x.current,"margin","x"),$=ss(C.current,"padding","x"),F=x.current.offsetWidth,G=C.current.getBoundingClientRect(),U=j.clientX-G.left-F/2-$+K/2,P=w.current.scrollWidth,B=w.current.clientWidth,I=C.current.offsetWidth-F-$-K,W=U/I;let Y;M==="rtl"?(Y=(1-W)*(P-B),w.current.scrollLeft<=0&&(Y=-Y)):Y=W*(P-B),w.current.scrollLeft=Y}v(j)}},onPointerUp:b,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...u==="vertical"&&{top:0,bottom:`var(${Uh.scrollAreaCornerHeight})`,insetInlineEnd:0,[Wh.scrollAreaThumbHeight]:`${T.height}px`},...u==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Uh.scrollAreaCornerWidth})`,bottom:0,[Wh.scrollAreaThumbWidth]:`${T.width}px`}}},D=at("div",t,{ref:[n,u==="vertical"?S:C],state:A,props:[L,a],stateAttributesMapping:F0}),H=R.useMemo(()=>({orientation:u}),[u]),z=u==="vertical"?f.scrollbarYHidden:f.scrollbarXHidden;return h||!z?_.jsx(rR.Provider,{value:H,children:D}):null}),Y9=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{thumbYRef:h,thumbXRef:a,handlePointerDown:l,handlePointerMove:d,handlePointerUp:p,setScrollingX:f,setScrollingY:g}=Rp(),{orientation:S}=$9(),C=R.useMemo(()=>({orientation:S}),[S]);return at("div",t,{ref:[n,S==="vertical"?h:a],state:C,props:[{onPointerDown:l,onPointerMove:d,onPointerUp(y){S==="vertical"&&g(!1),S==="horizontal"&&f(!1),p(y)},style:{...S==="vertical"&&{height:`var(${Wh.scrollAreaThumbHeight})`},...S==="horizontal"&&{width:`var(${Wh.scrollAreaThumbWidth})`}}},u]})}),X9=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{cornerRef:h,cornerSize:a,hiddenState:l}=Rp(),d=at("div",t,{ref:[n,h],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:a.width,height:a.height}},u]});return l.cornerHidden?null:d}),sR=R.createContext(void 0);function Q9(){const e=R.useContext(sR);if(e===void 0)throw new Error(Pt(63));return e}let AC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const iR={...Ia,checked(e){return e?{[AC.checked]:""}:{[AC.unchecked]:""}}},Z9=R.forwardRef(function(t,n){const{checked:s,className:o,defaultChecked:u,id:h,inputRef:a,name:l,nativeButton:d=!1,onCheckedChange:p,readOnly:f=!1,required:g=!1,disabled:S=!1,render:C,uncheckedValue:w,...y}=t,{clearErrors:x}=ad(),{state:v,setTouched:b,setDirty:E,validityData:T,setFilled:A,setFocused:M,shouldValidateOnChange:L,validationMode:D,disabled:H,name:z,validation:q}=us(),{labelId:j}=wo(),K=H||S,$=z??l,F=Pe(p),G=R.useRef(null),U=cs(G,a,q.inputRef),P=R.useRef(null),B=ar(),I=Cp({id:h,implicit:!1,controlRef:P}),[W,Y]=as({controlled:s,default:!!u,name:"Switch",state:"checked"});ld({id:B,commit:q.commit,value:W,controlRef:P,name:$,getValue:()=>W}),Fe(()=>{G.current&&A(G.current.checked)},[G,A]),ca(W,()=>{x($),E(W!==T.initialValue),A(W),L()?q.commit(W):q.commit(W,!0)});const{getButtonProps:J,buttonRef:Z}=xr({disabled:K,native:d}),ee={id:B,role:"switch","aria-checked":W,"aria-readonly":f||void 0,"aria-labelledby":j,onFocus(){K||M(!0)},onBlur(){const ne=G.current;!ne||K||(b(!0),M(!1),D==="onBlur"&&q.commit(ne.checked))},onClick(ne){f||K||(ne.preventDefault(),G?.current?.click())}},X=R.useMemo(()=>Ws({checked:W,disabled:K,id:I,name:$,required:g,style:ic,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:U,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const re=ne.target.checked,oe=We(Mn,ne.nativeEvent);F?.(re,oe),!oe.isCanceled&&Y(re)},onFocus(){P.current?.focus()}},q.getInputValidationProps),[W,K,U,I,$,F,g,Y,q]),V=R.useMemo(()=>({...v,checked:W,disabled:K,readOnly:f,required:g}),[v,W,K,f,g]),se=at("span",t,{state:V,ref:[n,P,Z],props:[ee,q.getValidationProps,y,J],stateAttributesMapping:iR});return _.jsxs(sR.Provider,{value:V,children:[se,!W&&$&&w!==void 0&&_.jsx("input",{type:"hidden",name:$,value:w}),_.jsx("input",{...X})]})}),J9=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{state:h}=us(),a=Q9(),l={...h,...a};return at("span",t,{state:l,ref:n,stateAttributesMapping:iR,props:u})}),oR=R.createContext(void 0);function eI(e=!0){const t=R.useContext(oR);if(t===void 0&&!e)throw new Error(Pt(7));return t}const tI=R.forwardRef(function(t,n){const{className:s,defaultPressed:o=!1,disabled:u=!1,form:h,onPressedChange:a,pressed:l,render:d,type:p,value:f,nativeButton:g=!0,...S}=t,C=ar(f||void 0),w=eI(),y=w?.value??[],x=w?void 0:o,v=(u||w?.disabled)??!1,[b,E]=as({controlled:w?y?.indexOf(C)>-1:l,default:x,name:"Toggle",state:"pressed"}),T=Pe((q,j)=>{C&&w?.setGroupValue?.(C,q,j),a?.(q,j)}),{getButtonProps:A,buttonRef:M}=xr({disabled:v,native:g}),L=R.useMemo(()=>({disabled:v,pressed:b}),[v,b]),D=[M,n],H=[{"aria-pressed":b,onClick(q){const j=!b,K=We(Mn,q.nativeEvent);T(j,K),!K.isCanceled&&E(j)}},S,A],z=at("button",t,{enabled:!w,state:L,ref:D,props:H});return w?_.jsx(eR,{tag:"button",render:d,className:s,state:L,refs:D,props:H}):z});let nI=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const OC={multiple(e){return e?{[nI.multiple]:""}:null}},rI=R.forwardRef(function(t,n){const{defaultValue:s,disabled:o=!1,loopFocus:u=!0,onValueChange:h,orientation:a="horizontal",multiple:l=!1,value:d,className:p,render:f,...g}=t,S=M0(),C=R.useMemo(()=>{if(d===void 0)return s??[]},[d,s]),w=(S?.disabled??!1)||o,[y,x]=as({controlled:d,default:C,name:"ToggleGroup",state:"value"}),v=Pe((M,L,D)=>{let H;if(l?(H=y.slice(),L?H.push(M):H.splice(y.indexOf(M),1)):H=L?[M]:[],Array.isArray(H)){if(h?.(H,D),D.isCanceled)return;x(H)}}),b=R.useMemo(()=>({disabled:w,multiple:l,orientation:a}),[w,a,l]),E=R.useMemo(()=>({disabled:w,orientation:a,setGroupValue:v,value:y}),[w,a,v,y]),T={role:"group"},A=at("div",t,{enabled:!!S,state:b,ref:n,props:[T,g],stateAttributesMapping:OC});return _.jsx(oR.Provider,{value:E,children:S?A:_.jsx(Mk,{render:f,className:p,state:b,refs:[n],props:[T,g],stateAttributesMapping:OC,loopFocus:u})})});function sI(e){return at(e.defaultTagName??"div",e,e)}function iI({className:e,...t}){return _.jsx("div",{"data-slot":"input-group",role:"group",className:He("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",e),...t})}const oI=Oa("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function aI({className:e,align:t="inline-start",...n}){return _.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:He(oI({align:t}),e),onClick:s=>{s.target.closest("button")||s.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const lI=Oa("gap-2 rounded-md text-xs/relaxed shadow-none flex items-center",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function aR({className:e,type:t="button",variant:n="ghost",size:s="xs",...o}){return _.jsx(Be,{type:t,"data-size":s,variant:n,className:He(lI({size:s}),e),...o})}function cI({className:e,...t}){return _.jsx(Wt,{"data-slot":"input-group-control",className:He("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1",e),...t})}const uI=p9;function dI({className:e,children:t,...n}){return _.jsxs(WP,{"data-slot":"combobox-trigger",className:He("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,_.jsx(_e,{icon:K2,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function fI({className:e,...t}){return _.jsx(XP,{"data-slot":"combobox-clear",render:_.jsx(aR,{variant:"ghost",size:"icon-xs"}),className:He(e),...t,children:_.jsx(_e,{icon:_o,strokeWidth:2,className:"pointer-events-none"})})}function hI({className:e,children:t,disabled:n=!1,showTrigger:s=!0,showClear:o=!1,...u}){return _.jsxs(iI,{className:He("w-auto",e),children:[_.jsx(KP,{render:_.jsx(cI,{disabled:n}),...u}),_.jsxs(aI,{align:"inline-end",children:[s&&_.jsx(aR,{size:"icon-xs",variant:"ghost",render:_.jsx(dI,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),o&&_.jsx(fI,{disabled:n})]}),t]})}function pI({className:e,side:t="bottom",sideOffset:n=6,align:s="start",alignOffset:o=0,anchor:u,...h}){return _.jsx(n9,{children:_.jsx(r9,{side:t,sideOffset:n,align:s,alignOffset:o,anchor:u,className:"isolate z-50",children:_.jsx(i9,{"data-slot":"combobox-content","data-chips":!!u,className:He("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",e),...h})})})}function mI({className:e,...t}){return _.jsx(e9,{"data-slot":"combobox-list",className:He("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",e),...t})}function gI({className:e,children:t,...n}){return _.jsxs(l9,{"data-slot":"combobox-item",className:He("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,_.jsx(m9,{render:_.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:_.jsx(_e,{icon:Ma,strokeWidth:2,className:"pointer-events-none"})})]})}function vI({className:e,...t}){return _.jsx(c9,{"data-slot":"combobox-empty",className:He("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}const _I=Oa("hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-md text-xs font-medium transition-all [&_svg:not([class*='size-'])]:size-3.5 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border-input hover:bg-muted border bg-transparent"},size:{default:"h-7 min-w-7 px-2",sm:"h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-1.5 text-[0.625rem] [&_svg:not([class*='size-'])]:size-3",lg:"h-8 min-w-8 px-2"}},defaultVariants:{variant:"default",size:"default"}}),lR=R.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function yI({className:e,variant:t,size:n,spacing:s=0,orientation:o="horizontal",children:u,...h}){return _.jsx(rI,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":s,"data-orientation":o,style:{"--gap":s},className:He("rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",e),...h,children:_.jsx(lR.Provider,{value:{variant:t,size:n,spacing:s,orientation:o},children:u})})}function bv({className:e,children:t,variant:n="default",size:s="default",...o}){const u=R.useContext(lR);return _.jsx(tI,{"data-slot":"toggle-group-item","data-variant":u.variant||n,"data-size":u.size||s,"data-spacing":u.spacing,className:He("group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",_I({variant:u.variant||n,size:u.size||s}),e),...o,children:t})}function ea({className:e,size:t="default",...n}){return _.jsx(Z9,{"data-slot":"switch","data-size":t,className:He("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:_.jsx(J9,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}async function Zt(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(n.status===401)throw window.dispatchEvent(new CustomEvent("vibora:auth-required")),new Error("Authentication required");if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}const Ba="";function U0(){return Kn({queryKey:["tasks"],queryFn:()=>Zt(`${Ba}/api/tasks`)})}function cR(e){return Kn({queryKey:["tasks",e],queryFn:()=>Zt(`${Ba}/api/tasks/${e}`),enabled:!!e})}function bI(){const e=$n();return Bn({mutationFn:t=>Zt(`${Ba}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function xI(){const e=$n();return Bn({mutationFn:({taskId:t,status:n,position:s})=>Zt(`${Ba}/api/tasks/${t}/status`,{method:"PATCH",body:JSON.stringify({status:n,position:s})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function W0(){const e=$n();return Bn({mutationFn:({taskId:t,updates:n})=>Zt(`${Ba}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]})}})}function SI(){const e=$n();return Bn({mutationFn:t=>Zt(`${Ba}/api/tasks/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function CI(){const e=$n();return Bn({mutationFn:t=>Zt(`${Ba}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}const lc="";function wI(e){return Kn({queryKey:["fs","list",e],queryFn:()=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Zt(`${lc}/api/fs/list${t}`)},enabled:e!==null})}function EI(e){return Kn({queryKey:["git","branches",e],queryFn:()=>Zt(`${lc}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function kI(e,t={}){const{staged:n=!1,ignoreWhitespace:s=!1,includeUntracked:o=!1}=t;return Kn({queryKey:["git","diff",e,n,s,o],queryFn:()=>{const u=new URLSearchParams({path:e,...n&&{staged:"true"},...s&&{ignoreWhitespace:"true"},...o&&{includeUntracked:"true"}});return Zt(`${lc}/api/git/diff?${u}`)},enabled:!!e,refetchInterval:5e3})}function RI(e){return Kn({queryKey:["fs","tree",e],queryFn:()=>Zt(`${lc}/api/fs/tree?root=${encodeURIComponent(e)}`),enabled:!!e,staleTime:1e4})}function TI(e,t,n){return Kn({queryKey:["fs","read",e,t,n?.maxLines],queryFn:()=>{const s=new URLSearchParams({path:t,root:e,...n?.maxLines});return Zt(`${lc}/api/fs/read?${s}`)},enabled:!!e&&!!t})}async function LI(e){return Zt(`${lc}/api/fs/is-git-repo?path=${encodeURIComponent(e)}`)}const cc="",sn={PORT:"port",WORKTREE_BASE_PATH:"worktree_base_path",DEFAULT_GIT_REPOS_DIR:"default_git_repos_dir",TASK_CREATION_COMMAND:"task_creation_command",HOSTNAME:"hostname",SSH_PORT:"ssh_port",LINEAR_API_KEY:"linear_api_key",GITHUB_PAT:"github_pat"},AI=3333,OI="claude --dangerously-skip-permissions";function ko(e){return Kn({queryKey:["config",e],queryFn:()=>Zt(`${cc}/api/config/${e}`)})}function MI(){const e=ko(sn.PORT);return{...e,data:e.data?.value??AI,isDefault:e.data?.isDefault??!0}}function uR(){const e=ko(sn.WORKTREE_BASE_PATH);return{...e,data:e.data?.value??""}}function q0(){const e=ko(sn.DEFAULT_GIT_REPOS_DIR);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function dR(){const e=ko(sn.TASK_CREATION_COMMAND);return{...e,data:e.data?.value??OI,isDefault:e.data?.isDefault??!0}}function Tp(){const e=ko(sn.HOSTNAME);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function Lp(){const e=ko(sn.SSH_PORT);return{...e,data:e.data?.value??22,isDefault:e.data?.isDefault??!0}}function DI(){const e=ko(sn.LINEAR_API_KEY);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function PI(){const e=ko(sn.GITHUB_PAT);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function II(){const e=$n();return Bn({mutationFn:({key:t,value:n})=>Zt(`${cc}/api/config/${t}`,{method:"PUT",body:JSON.stringify({value:n})}),onSuccess:(t,{key:n})=>{e.invalidateQueries({queryKey:["config",n]}),n===sn.GITHUB_PAT&&(e.invalidateQueries({queryKey:["github-user"]}),e.invalidateQueries({queryKey:["github-prs"]}),e.invalidateQueries({queryKey:["github-issues"]}),e.invalidateQueries({queryKey:["github-orgs"]}))}})}function jI(){const e=$n();return Bn({mutationFn:t=>Zt(`${cc}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function NI(){return Kn({queryKey:["config","notifications"],queryFn:()=>Zt(`${cc}/api/config/notifications`)})}function BI(){const e=$n();return Bn({mutationFn:t=>Zt(`${cc}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function zI(){return Bn({mutationFn:e=>Zt(`${cc}/api/config/notifications/test/${e}`,{method:"POST"})})}const dd="";function G0(){return Kn({queryKey:["repositories"],queryFn:()=>Zt(`${dd}/api/repositories`)})}function HI(e){return Kn({queryKey:["repositories",e],queryFn:()=>Zt(`${dd}/api/repositories/${e}`),enabled:!!e})}function fR(){const e=$n();return Bn({mutationFn:t=>Zt(`${dd}/api/repositories`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function VI(){const e=$n();return Bn({mutationFn:({id:t,updates:n})=>Zt(`${dd}/api/repositories/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["repositories",n]})}})}function hR(){const e=$n();return Bn({mutationFn:t=>Zt(`${dd}/api/repositories/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function Yl({className:e,children:t,...n}){return _.jsxs(V9,{"data-slot":"scroll-area",className:He("relative",e),...n,children:[_.jsx(G9,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),_.jsx(FI,{}),_.jsx(X9,{})]})}function FI({className:e,orientation:t="vertical",...n}){return _.jsx(K9,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:He("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",e),...n,children:_.jsx(Y9,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function $0({open:e,onOpenChange:t,onSelect:n,initialPath:s}){const[o,u]=R.useState(s||null),[h,a]=R.useState(""),[l,d]=R.useState("");R.useEffect(()=>{e&&(u(s||null),a(""),d(""))},[e,s]);const{data:p,isLoading:f,error:g}=wI(e?o??"":null),S=b=>{p&&(u(p.path+"/"+b),d(""))},C=()=>{p?.parent&&p.parent!==p.path&&(u(p.parent),d(""))},w=()=>{u(null),d("")},y=()=>{h.trim()&&(u(h.trim()),d(""))},x=b=>{n(b),t(!1)},v=p?.entries.filter(b=>b.name.toLowerCase().includes(l.toLowerCase()));return _.jsx(xs,{open:e,onOpenChange:t,children:_.jsxs(Ss,{className:"sm:max-w-lg",children:[_.jsxs(Bs,{children:[_.jsx(zs,{children:"Select Git Repository"}),_.jsx(aa,{children:"Choose an existing git repository"})]}),_.jsx("p",{className:"text-xs text-muted-foreground",children:"Click folder names to navigate • Use action buttons to select"}),_.jsx(U8,{}),_.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"text-xs font-medium",children:"Enter path manually:"}),_.jsxs("div",{className:"flex gap-2",children:[_.jsx(Wt,{value:h,onChange:b=>a(b.target.value),placeholder:"/path/to/your/project",onKeyDown:b=>b.key==="Enter"&&y(),className:"flex-1"}),_.jsx(Be,{variant:"outline",size:"sm",onClick:y,children:"Go"})]})]}),_.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"text-xs font-medium",children:"Search current directory:"}),_.jsxs("div",{className:"relative",children:[_.jsx(_e,{icon:x4,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),_.jsx(Wt,{value:l,onChange:b=>d(b.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Be,{variant:"outline",size:"icon-sm",onClick:w,title:"Home",children:_.jsx(_e,{icon:f4,size:14,strokeWidth:2})}),_.jsx(Be,{variant:"outline",size:"icon-sm",onClick:C,disabled:!p||p.parent===p.path,title:"Parent directory",children:_.jsx(_e,{icon:Q2,size:14,strokeWidth:2})}),_.jsx("code",{className:"min-w-0 flex-1 text-xs bg-muted/50 px-2 py-1 rounded truncate",children:p?.path||"~"}),_.jsxs(Be,{variant:"outline",size:"sm",onClick:()=>p&&x(p.path),disabled:!p,className:"max-sm:px-2",title:"Select current directory",children:[_.jsx(_e,{icon:i_,size:14,strokeWidth:2,className:"sm:hidden"}),_.jsx("span",{className:"max-sm:hidden",children:"Select Current"})]})]}),_.jsx(Yl,{className:"h-64 border rounded-md",children:_.jsxs("div",{className:"p-1",children:[f&&_.jsx("div",{className:"text-muted-foreground text-xs p-3",children:"Loading..."}),g&&_.jsx("div",{className:"text-destructive text-xs p-3",children:g.message}),p&&v&&_.jsxs(_.Fragment,{children:[v.length===0&&_.jsx("div",{className:"text-muted-foreground text-xs p-3",children:l?"No matches found":"Empty directory"}),v.map(b=>_.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group",children:b.type==="directory"?_.jsxs(_.Fragment,{children:[_.jsx(_e,{icon:b.isGitRepo?i_:os,size:16,strokeWidth:2,className:b.isGitRepo?"text-emerald-500":"text-blue-500"}),_.jsx("button",{onClick:()=>S(b.name),className:"flex-1 text-left text-xs truncate hover:underline",children:b.name}),b.isGitRepo&&_.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded border border-emerald-500/50 text-emerald-500 font-medium shrink-0",children:[_.jsx("span",{className:"max-sm:hidden",children:"git repo"}),_.jsx("span",{className:"sm:hidden",children:"git"})]})]}):_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"w-4"}),_.jsx("span",{className:"flex-1 text-xs text-muted-foreground truncate",children:b.name})]})},b.name))]})]})}),_.jsxs(go,{children:[_.jsx(T0,{render:_.jsx(Be,{variant:"outline"}),children:"Cancel"}),_.jsx(Be,{onClick:()=>p&&x(p.path),disabled:!p,children:"Select Path"})]})]})})}function UI(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function WI(e){const t=UI(e);if(!t)return"";const n=Math.random().toString(36).substring(2,6);return`${t}-${n}`}function qI({open:e,onOpenChange:t}={}){const[n,s]=R.useState(!1),o=e??n,u=t??s,[h,a]=R.useState(!1),[l,d]=R.useState(""),[p,f]=R.useState(""),[g,S]=R.useState(""),[C,w]=R.useState(""),[y,x]=R.useState(""),[v,b]=R.useState(""),[E,T]=R.useState(!0),[A,M]=R.useState("none"),[L,D]=R.useState(null),[H,z]=R.useState("browse"),[q,j]=R.useState(""),[K,$]=R.useState(null),[F,G]=R.useState(!1),U=yo(),P=bI(),B=fR(),{data:I}=uR(),{data:W}=q0(),{data:Y}=G0(),{data:J,isLoading:Z}=EI(g||null),ee=L?Y?.find(le=>le.id===L):null,X=R.useMemo(()=>{if(!Y)return[];if(!q.trim())return Y;const le=q.toLowerCase();return Y.filter(ve=>ve.displayName.toLowerCase().includes(le)||ve.path.toLowerCase().includes(le))},[Y,q]);R.useEffect(()=>{Y&&Y.length>0?z("saved"):z("browse")},[Y]),R.useEffect(()=>{w(J?J.current||J.branches[0]||"main":"")},[J,g]),R.useEffect(()=>{p.trim()&&A==="none"&&M("plan")},[p,A]);const V=le=>{d(le),b(WI(le))},se=async le=>{$(null),G(!0);try{if(!(await LI(le)).isGitRepo){$("Selected folder is not a git repository"),G(!1);return}if(S(le),D(null),!Y?.find(he=>he.path===le)){const he=le.split("/").pop()||"Unknown";B.mutate({path:le,displayName:he})}}catch(ve){$(ve instanceof Error?ve.message:"Failed to validate repository")}finally{G(!1)}},ne=le=>{if(le.preventDefault(),!l.trim()||!g)return;const ve=g.split("/").pop()||"repo",ue=y.trim()||v,he=`${I}/${ue}`;P.mutate({title:l.trim(),description:p.trim(),repoPath:g,repoName:ve,baseBranch:C||"main",branch:ue,worktreePath:he,initializeVibora:E,copyFiles:ee?.copyFiles||void 0,startupScript:ee?.startupScript||void 0},{onSuccess:de=>{const Ne=A!=="none"&&p.trim()?{aiMode:A,description:p.trim()}:void 0;u(!1),d(""),f(""),S(""),w(""),x(""),b(""),T(!0),M("none"),D(null),j(""),$(null),z(Y&&Y.length>0?"saved":"browse"),U({to:"/tasks/$taskId",params:{taskId:de.id},state:Ne})}})},re=y.trim()||v,oe=re?`${I}/${re}`:"";return _.jsxs(_.Fragment,{children:[_.jsxs(xs,{open:o,onOpenChange:u,children:[_.jsxs(hk,{render:_.jsx(Be,{size:"sm"}),children:[_.jsx(_e,{icon:rc,size:16,strokeWidth:2,"data-slot":"icon"}),"New Task"]}),_.jsx(Ss,{className:"sm:max-w-md max-h-[80dvh] flex flex-col overflow-hidden",children:_.jsxs("form",{onSubmit:ne,className:"flex flex-col min-h-0 flex-1",children:[_.jsxs(Bs,{className:"shrink-0",children:[_.jsx(zs,{children:"Create New Task"}),_.jsx(aa,{children:"Create a new task with a git worktree for isolated development."})]}),_.jsxs(cd,{className:"mt-4 pb-4 overflow-y-auto min-h-0 flex-1",children:[_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"title",children:"Title"}),_.jsx(Wt,{id:"title",value:l,onChange:le=>V(le.target.value),placeholder:"Add user authentication",required:!0})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"description",children:"Description"}),_.jsx(wp,{id:"description",value:p,onChange:le=>f(le.target.value),placeholder:"Implement OAuth2 login flow...",rows:2})]}),_.jsxs(Cn,{children:[_.jsx(wn,{children:"AI Mode"}),_.jsxs(yI,{value:[A],onValueChange:le=>{const ve=Array.isArray(le)?le[0]:le;ve&&M(ve)},className:"w-full",variant:"outline",children:[_.jsx(bv,{value:"none",className:"flex-1",children:"None"}),_.jsx(bv,{value:"plan",className:"flex-1",children:"Plan"}),_.jsx(bv,{value:"default",className:"flex-1",children:"Default"})]})]}),_.jsxs(Cn,{children:[_.jsx(wn,{children:"Repository"}),_.jsxs(_a,{value:H,onValueChange:le=>{z(le),$(null)},children:[_.jsxs(ya,{children:[_.jsx(ir,{value:"saved",disabled:!Y?.length,children:"Saved"}),_.jsx(ir,{value:"browse",children:"Browse"})]}),_.jsx(_r,{value:"saved",className:"mt-2",children:_.jsxs(uI,{value:L||"",onValueChange:le=>{const ve=Y?.find(ue=>ue.id===le);ve&&(D(le),S(ve.path),j(ve.displayName),$(null))},inputValue:q,onInputValueChange:le=>{j(le),ee&&le!==ee.displayName&&D(null)},itemToStringLabel:le=>Y?.find(ve=>ve.id===le)?.displayName||"",children:[_.jsx(hI,{placeholder:"Search repositories...",className:"w-full"}),_.jsx(pI,{children:_.jsxs(mI,{children:[_.jsx(vI,{children:"No repositories found"}),X.map(le=>_.jsx(gI,{value:le.id,children:le.displayName},le.id))]})})]})}),_.jsx(_r,{value:"browse",className:"mt-2",children:_.jsxs(Be,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>a(!0),disabled:F,children:[_.jsx(_e,{icon:os,size:14,strokeWidth:2,className:"mr-2"}),F?_.jsx("span",{className:"text-muted-foreground",children:"Validating..."}):g&&!L?_.jsx("span",{className:"truncate",children:g}):_.jsx("span",{className:"text-muted-foreground",children:"Select folder..."})]})})]}),K&&_.jsx("p",{className:"text-sm text-destructive",children:K}),g&&!K&&_.jsx(oo,{className:"font-mono text-xs truncate",children:g})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"baseBranch",children:"Base Branch"}),_.jsxs(Il,{value:C,onValueChange:le=>w(le??""),disabled:!g||Z,children:[_.jsx(Nl,{className:"w-full",children:_.jsx(jl,{children:C||_.jsx("span",{className:"text-muted-foreground",children:g?Z?"Loading branches...":"Select branch":"Select repository first"})})}),_.jsx(Bl,{children:J?.branches.map(le=>_.jsxs(gr,{value:le,children:[le,le===J.current&&_.jsx("span",{className:"text-muted-foreground ml-2",children:"(current)"})]},le))})]})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"branch",children:"Branch Name"}),_.jsx(Wt,{id:"branch",value:y,onChange:le=>x(le.target.value),placeholder:v||"auto-generated-from-title"}),oe&&_.jsxs(oo,{children:["Worktree: ",oe]}),!y.trim()&&v&&_.jsxs(oo,{children:['Will use "',v,'" if left empty.']})]}),_.jsxs(Cn,{className:"flex flex-row items-center justify-between",children:[_.jsxs("div",{children:[_.jsx(wn,{htmlFor:"initializeVibora",className:"mb-0 cursor-pointer",children:"Initialize Vibora"}),_.jsx(oo,{children:"Create or update CLAUDE.local.md with CLI instructions"})]}),_.jsx(ea,{id:"initializeVibora",checked:E,onCheckedChange:le=>T(le)})]})]}),_.jsxs(go,{className:"mt-4 shrink-0",children:[_.jsx(T0,{render:_.jsx(Be,{variant:"outline",type:"button"}),children:"Cancel"}),_.jsx(Be,{type:"submit",disabled:P.isPending||!l.trim()||!g,children:P.isPending?"Creating...":"Create Task"})]})]})})]}),_.jsx($0,{open:h,onOpenChange:a,onSelect:se,initialPath:W||void 0})]})}function GI({onNewTaskRef:e,onOpenCommandPalette:t}){const{location:n}=Jn(),s=n.pathname,[o,u]=R.useState(!1);return R.useEffect(()=>{e?.(()=>u(!0))},[e]),_.jsxs("header",{className:"sticky top-0 z-10 flex h-12 shrink-0 items-center justify-between border-b border-border bg-black px-4 max-sm:px-2",children:[_.jsxs("div",{className:"flex min-w-0 items-center gap-4 max-sm:gap-1",children:[_.jsx(qn,{to:"/tasks",className:"hidden items-center sm:flex",children:_.jsx("img",{src:"/vibora-logo.jpeg",alt:"Vibora",className:"h-7"})}),_.jsxs("nav",{className:"flex items-center gap-1 max-sm:gap-0",children:[_.jsx(qn,{to:"/tasks",children:_.jsxs(Be,{variant:s.startsWith("/tasks")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[_.jsx(_e,{icon:Ah,size:16,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Tasks"})]})}),_.jsx(qn,{to:"/terminals",children:_.jsxs(Be,{variant:s==="/terminals"?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[_.jsx(_e,{icon:s0,size:16,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Terminals"})]})}),_.jsx(qn,{to:"/worktrees",children:_.jsxs(Be,{variant:s.startsWith("/worktrees")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[_.jsx(_e,{icon:eE,size:16,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Worktrees"})]})}),_.jsx(qn,{to:"/repositories",children:_.jsxs(Be,{variant:s.startsWith("/repositories")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[_.jsx(_e,{icon:Z2,size:16,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Repositories"})]})}),_.jsx(qn,{to:"/review",children:_.jsxs(Be,{variant:s.startsWith("/review")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[_.jsx(_e,{icon:i0,size:16,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Review"})]})})]})]}),_.jsxs("div",{className:"flex shrink-0 items-center gap-2 max-sm:gap-1",children:[_.jsx(qI,{open:o,onOpenChange:u}),_.jsx(Be,{variant:"ghost",size:"icon-sm",onClick:t,title:"Command Palette (⌘K)",children:_.jsx(_e,{icon:s_,size:16,strokeWidth:2})}),_.jsx(qn,{to:"/settings",children:_.jsx(Be,{variant:s==="/settings"?"secondary":"ghost",size:"icon-sm",children:_.jsx(_e,{icon:tE,size:16,strokeWidth:2})})})]})]})}function $I(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const KI=e=>{switch(e){case"success":return QI;case"info":return JI;case"warning":return ZI;case"error":return ej;default:return null}},YI=Array(12).fill(0),XI=({visible:e,className:t})=>ze.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ze.createElement("div",{className:"sonner-spinner"},YI.map((n,s)=>ze.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),QI=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ze.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"})),ZI=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ze.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"})),JI=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ze.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"})),ej=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ze.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"})),tj=ze.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"},ze.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ze.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),nj=()=>{const[e,t]=ze.useState(document.hidden);return ze.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let __=1;class rj{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:s,...o}=t,u=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:__++,h=this.toasts.find(l=>l.id===u),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),h?this.toasts=this.toasts.map(l=>l.id===u?(this.publish({...l,...t,id:u,title:s}),{...l,...t,id:u,dismissible:a,title:s}):l):this.addToast({title:s,...o,dismissible:a,id:u}),u},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let u=s!==void 0,h;const a=o.then(async d=>{if(h=["resolve",d],ze.isValidElement(d))u=!1,this.create({id:s,type:"default",message:d});else if(ij(d)&&!d.ok){u=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,C=typeof f=="object"&&!ze.isValidElement(f)?f:{message:f};this.create({id:s,type:"error",description:g,...C})}else if(d instanceof Error){u=!1;const f=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,C=typeof f=="object"&&!ze.isValidElement(f)?f:{message:f};this.create({id:s,type:"error",description:g,...C})}else if(n.success!==void 0){u=!1;const f=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,C=typeof f=="object"&&!ze.isValidElement(f)?f:{message:f};this.create({id:s,type:"success",description:g,...C})}}).catch(async d=>{if(h=["reject",d],n.error!==void 0){u=!1;const p=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,S=typeof p=="object"&&!ze.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:f,...S})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((d,p)=>a.then(()=>h[0]==="reject"?p(h[1]):d(h[1])).catch(p));return typeof s!="string"&&typeof s!="number"?{unwrap:l}:Object.assign(s,{unwrap:l})},this.custom=(t,n)=>{const s=n?.id||__++;return this.create({jsx:t(s),id:s,...n}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const vr=new rj,sj=(e,t)=>{const n=t?.id||__++;return vr.addToast({title:e,...t,id:n}),n},ij=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",oj=sj,aj=()=>vr.toasts,lj=()=>vr.getActiveToasts(),Nr=Object.assign(oj,{success:vr.success,info:vr.info,warning:vr.warning,error:vr.error,custom:vr.custom,message:vr.message,promise:vr.promise,dismiss:vr.dismiss,loading:vr.loading},{getHistory:aj,getToasts:lj});$I("[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 eh(e){return e.label!==void 0}const cj=3,uj="24px",dj="16px",MC=4e3,fj=356,hj=14,pj=45,mj=200;function Ms(...e){return e.filter(Boolean).join(" ")}function gj(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const vj=e=>{var t,n,s,o,u,h,a,l,d;const{invert:p,toast:f,unstyled:g,interacting:S,setHeights:C,visibleToasts:w,heights:y,index:x,toasts:v,expanded:b,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:L,actionButtonStyle:D,className:H="",descriptionClassName:z="",duration:q,position:j,gap:K,expandByDefault:$,classNames:F,icons:G,closeButtonAriaLabel:U="Close toast"}=e,[P,B]=ze.useState(null),[I,W]=ze.useState(null),[Y,J]=ze.useState(!1),[Z,ee]=ze.useState(!1),[X,V]=ze.useState(!1),[se,ne]=ze.useState(!1),[re,oe]=ze.useState(!1),[le,ve]=ze.useState(0),[ue,he]=ze.useState(0),de=ze.useRef(f.duration||q||MC),Ne=ze.useRef(null),Me=ze.useRef(null),Ae=x===0,be=x+1<=w,Oe=f.type,me=f.dismissible!==!1,ke=f.className||"",Ce=f.descriptionClassName||"",qe=ze.useMemo(()=>y.findIndex(Je=>Je.toastId===f.id)||0,[y,f.id]),De=ze.useMemo(()=>{var Je;return(Je=f.closeButton)!=null?Je:A},[f.closeButton,A]),Ie=ze.useMemo(()=>f.duration||q||MC,[f.duration,q]),rt=ze.useRef(0),et=ze.useRef(0),dt=ze.useRef(0),xe=ze.useRef(null),[Ve,Ee]=j.split("-"),tt=ze.useMemo(()=>y.reduce((Je,Ot,jt)=>jt>=qe?Je:Je+Ot.height,0),[y,qe]),lt=nj(),Xe=f.invert||p,st=Oe==="loading";et.current=ze.useMemo(()=>qe*K+tt,[qe,tt]),ze.useEffect(()=>{de.current=Ie},[Ie]),ze.useEffect(()=>{J(!0)},[]),ze.useEffect(()=>{const Je=Me.current;if(Je){const Ot=Je.getBoundingClientRect().height;return he(Ot),C(jt=>[{toastId:f.id,height:Ot,position:f.position},...jt]),()=>C(jt=>jt.filter(ot=>ot.toastId!==f.id))}},[C,f.id]),ze.useLayoutEffect(()=>{if(!Y)return;const Je=Me.current,Ot=Je.style.height;Je.style.height="auto";const jt=Je.getBoundingClientRect().height;Je.style.height=Ot,he(jt),C(ot=>ot.find(bt=>bt.toastId===f.id)?ot.map(bt=>bt.toastId===f.id?{...bt,height:jt}:bt):[{toastId:f.id,height:jt,position:f.position},...ot])},[Y,f.title,f.description,C,f.id,f.jsx,f.action,f.cancel]);const Ct=ze.useCallback(()=>{ee(!0),ve(et.current),C(Je=>Je.filter(Ot=>Ot.toastId!==f.id)),setTimeout(()=>{E(f)},mj)},[f,E,C,et]);ze.useEffect(()=>{if(f.promise&&Oe==="loading"||f.duration===1/0||f.type==="loading")return;let Je;return b||S||lt?(()=>{if(dt.current<rt.current){const ot=new Date().getTime()-rt.current;de.current=de.current-ot}dt.current=new Date().getTime()})():de.current!==1/0&&(rt.current=new Date().getTime(),Je=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Ct()},de.current)),()=>clearTimeout(Je)},[b,S,f,Oe,lt,Ct]),ze.useEffect(()=>{f.delete&&(Ct(),f.onDismiss==null||f.onDismiss.call(f,f))},[Ct,f.delete]);function ct(){var Je;if(G?.loading){var Ot;return ze.createElement("div",{className:Ms(F?.loader,f==null||(Ot=f.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":Oe==="loading"},G.loading)}return ze.createElement(XI,{className:Ms(F?.loader,f==null||(Je=f.classNames)==null?void 0:Je.loader),visible:Oe==="loading"})}const nn=f.icon||G?.[Oe]||KI(Oe);var Rt,vt;return ze.createElement("li",{tabIndex:0,ref:Me,className:Ms(H,ke,F?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,F?.default,F?.[Oe],f==null||(n=f.classNames)==null?void 0:n[Oe]),"data-sonner-toast":"","data-rich-colors":(Rt=f.richColors)!=null?Rt:T,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":Y,"data-promise":!!f.promise,"data-swiped":re,"data-removed":Z,"data-visible":be,"data-y-position":Ve,"data-x-position":Ee,"data-index":x,"data-front":Ae,"data-swiping":X,"data-dismissible":me,"data-type":Oe,"data-invert":Xe,"data-swipe-out":se,"data-swipe-direction":I,"data-expanded":!!(b||$&&Y),"data-testid":f.testId,style:{"--index":x,"--toasts-before":x,"--z-index":v.length-x,"--offset":`${Z?le:et.current}px`,"--initial-height":$?"auto":`${ue}px`,...M,...f.style},onDragEnd:()=>{V(!1),B(null),xe.current=null},onPointerDown:Je=>{Je.button!==2&&(st||!me||(Ne.current=new Date,ve(et.current),Je.target.setPointerCapture(Je.pointerId),Je.target.tagName!=="BUTTON"&&(V(!0),xe.current={x:Je.clientX,y:Je.clientY})))},onPointerUp:()=>{var Je,Ot,jt;if(se||!me)return;xe.current=null;const ot=Number(((Je=Me.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wt=Number(((Ot=Me.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((jt=Ne.current)==null?void 0:jt.getTime()),xt=P==="x"?ot:wt,Qe=Math.abs(xt)/bt;if(Math.abs(xt)>=pj||Qe>.11){ve(et.current),f.onDismiss==null||f.onDismiss.call(f,f),W(P==="x"?ot>0?"right":"left":wt>0?"down":"up"),Ct(),ne(!0);return}else{var Ht,Rn;(Ht=Me.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(Rn=Me.current)==null||Rn.style.setProperty("--swipe-amount-y","0px")}oe(!1),V(!1),B(null)},onPointerMove:Je=>{var Ot,jt,ot;if(!xe.current||!me||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const bt=Je.clientY-xe.current.y,xt=Je.clientX-xe.current.x;var Qe;const Ht=(Qe=e.swipeDirections)!=null?Qe:gj(j);!P&&(Math.abs(xt)>1||Math.abs(bt)>1)&&B(Math.abs(xt)>Math.abs(bt)?"x":"y");let Rn={x:0,y:0};const Yn=zn=>1/(1.5+Math.abs(zn)/20);if(P==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&bt<0||Ht.includes("bottom")&&bt>0)Rn.y=bt;else{const zn=bt*Yn(bt);Rn.y=Math.abs(zn)<Math.abs(bt)?zn:bt}}else if(P==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&xt<0||Ht.includes("right")&&xt>0)Rn.x=xt;else{const zn=xt*Yn(xt);Rn.x=Math.abs(zn)<Math.abs(xt)?zn:xt}(Math.abs(Rn.x)>0||Math.abs(Rn.y)>0)&&oe(!0),(jt=Me.current)==null||jt.style.setProperty("--swipe-amount-x",`${Rn.x}px`),(ot=Me.current)==null||ot.style.setProperty("--swipe-amount-y",`${Rn.y}px`)}},De&&!f.jsx&&Oe!=="loading"?ze.createElement("button",{"aria-label":U,"data-disabled":st,"data-close-button":!0,onClick:st||!me?()=>{}:()=>{Ct(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Ms(F?.closeButton,f==null||(s=f.classNames)==null?void 0:s.closeButton)},(vt=G?.close)!=null?vt:tj):null,(Oe||f.icon||f.promise)&&f.icon!==null&&(G?.[Oe]!==null||f.icon)?ze.createElement("div",{"data-icon":"",className:Ms(F?.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ct():null,f.type!=="loading"?nn:null):null,ze.createElement("div",{"data-content":"",className:Ms(F?.content,f==null||(u=f.classNames)==null?void 0:u.content)},ze.createElement("div",{"data-title":"",className:Ms(F?.title,f==null||(h=f.classNames)==null?void 0:h.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?ze.createElement("div",{"data-description":"",className:Ms(z,Ce,F?.description,f==null||(a=f.classNames)==null?void 0:a.description)},typeof f.description=="function"?f.description():f.description):null),ze.isValidElement(f.cancel)?f.cancel:f.cancel&&eh(f.cancel)?ze.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Je=>{eh(f.cancel)&&me&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Je),Ct())},className:Ms(F?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,ze.isValidElement(f.action)?f.action:f.action&&eh(f.action)?ze.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||D,onClick:Je=>{eh(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Je),!Je.defaultPrevented&&Ct())},className:Ms(F?.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function DC(){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 _j(e,t){const n={};return[e,t].forEach((s,o)=>{const u=o===1,h=u?"--mobile-offset":"--offset",a=u?dj:uj;function l(d){["top","right","bottom","left"].forEach(p=>{n[`${h}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof s=="number"||typeof s=="string"?l(s):typeof s=="object"?["top","right","bottom","left"].forEach(d=>{s[d]===void 0?n[`${h}-${d}`]=a:n[`${h}-${d}`]=typeof s[d]=="number"?`${s[d]}px`:s[d]}):l(a)}),n}const yj=ze.forwardRef(function(t,n){const{id:s,invert:o,position:u="bottom-right",hotkey:h=["altKey","KeyT"],expand:a,closeButton:l,className:d,offset:p,mobileOffset:f,theme:g="light",richColors:S,duration:C,style:w,visibleToasts:y=cj,toastOptions:x,dir:v=DC(),gap:b=hj,icons:E,containerAriaLabel:T="Notifications"}=t,[A,M]=ze.useState([]),L=ze.useMemo(()=>s?A.filter(Y=>Y.toasterId===s):A.filter(Y=>!Y.toasterId),[A,s]),D=ze.useMemo(()=>Array.from(new Set([u].concat(L.filter(Y=>Y.position).map(Y=>Y.position)))),[L,u]),[H,z]=ze.useState([]),[q,j]=ze.useState(!1),[K,$]=ze.useState(!1),[F,G]=ze.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=ze.useRef(null),P=h.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=ze.useRef(null),I=ze.useRef(!1),W=ze.useCallback(Y=>{M(J=>{var Z;return(Z=J.find(ee=>ee.id===Y.id))!=null&&Z.delete||vr.dismiss(Y.id),J.filter(({id:ee})=>ee!==Y.id)})},[]);return ze.useEffect(()=>vr.subscribe(Y=>{if(Y.dismiss){requestAnimationFrame(()=>{M(J=>J.map(Z=>Z.id===Y.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{w3.flushSync(()=>{M(J=>{const Z=J.findIndex(ee=>ee.id===Y.id);return Z!==-1?[...J.slice(0,Z),{...J[Z],...Y},...J.slice(Z+1)]:[Y,...J]})})})}),[A]),ze.useEffect(()=>{if(g!=="system"){G(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:J})=>{G(J?"dark":"light")})}catch{Y.addListener(({matches:Z})=>{try{G(Z?"dark":"light")}catch(ee){console.error(ee)}})}},[g]),ze.useEffect(()=>{A.length<=1&&j(!1)},[A]),ze.useEffect(()=>{const Y=J=>{var Z;if(h.every(V=>J[V]||J.code===V)){var X;j(!0),(X=U.current)==null||X.focus()}J.code==="Escape"&&(document.activeElement===U.current||(Z=U.current)!=null&&Z.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[h]),ze.useEffect(()=>{if(U.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,I.current=!1)}},[U.current]),ze.createElement("section",{ref:n,"aria-label":`${T} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((Y,J)=>{var Z;const[ee,X]=Y.split("-");return L.length?ze.createElement("ol",{key:Y,dir:v==="auto"?DC():v,tabIndex:-1,ref:U,className:d,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":ee,"data-x-position":X,style:{"--front-toast-height":`${((Z=H[0])==null?void 0:Z.height)||0}px`,"--width":`${fj}px`,"--gap":`${b}px`,...w,..._j(p,f)},onBlur:V=>{I.current&&!V.currentTarget.contains(V.relatedTarget)&&(I.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||I.current||(I.current=!0,B.current=V.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{K||j(!1)},onDragEnd:()=>j(!1),onPointerDown:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},L.filter(V=>!V.position&&J===0||V.position===Y).map((V,se)=>{var ne,re;return ze.createElement(vj,{key:V.id,icons:E,index:se,toast:V,defaultRichColors:S,duration:(ne=x?.duration)!=null?ne:C,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:o,visibleToasts:y,closeButton:(re=x?.closeButton)!=null?re:l,interacting:K,position:Y,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:W,toasts:L.filter(oe=>oe.position==V.position),heights:H.filter(oe=>oe.position==V.position),setHeights:z,expandByDefault:a,gap:b,expanded:q,swipeDirections:t.swipeDirections})})):null}))});function bj(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const xj=10,Sj=2e3;function Cj(){const e=$n(),t=R.useRef(null),n=R.useRef(void 0),s=R.useRef(0),o=R.useRef(void 0),u=R.useCallback(a=>{try{const l=JSON.parse(a.data);if(l.type==="task:updated")e.invalidateQueries({queryKey:["tasks"]});else if(l.type==="notification"&&"payload"in l){const{title:d,message:p,notificationType:f}=l.payload;switch(f){case"success":Nr.success(d,{description:p});break;case"error":Nr.error(d,{description:p});break;case"warning":Nr.warning(d,{description:p});break;default:Nr.info(d,{description:p});break}}}catch{}},[e]),h=R.useCallback(()=>{const a=t.current;if(a&&(a.readyState===WebSocket.CONNECTING||a.readyState===WebSocket.OPEN))return;const l=bj(),d=new WebSocket(l);t.current=d,d.onopen=()=>{s.current=0},d.onmessage=u,d.onclose=()=>{t.current===d&&(t.current=null),s.current<xj&&(s.current++,n.current=setTimeout(()=>{o.current?.()},Sj))},d.onerror=()=>{}},[u]);o.current=h,R.useEffect(()=>(h(),()=>{n.current&&clearTimeout(n.current),t.current&&(t.current.close(),t.current=null)}),[h])}const pR=R.createContext(null);function wj({children:e}){const[t,n]=R.useState(!1),[s,o]=R.useState(!1),u=R.useCallback(d=>{n(d)},[]),h=R.useCallback(d=>{o(d)},[]),a=R.useMemo(()=>!t,[t]),l=R.useMemo(()=>({terminalFocused:t,setTerminalFocused:u,modalOpen:s,setModalOpen:h,shortcutsEnabled:a}),[t,u,s,h,a]);return _.jsx(pR.Provider,{value:l,children:e})}function K0(){const e=R.useContext(pR);if(!e)throw new Error("useKeyboardContext must be used within a KeyboardProvider");return e}function Ej(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function mR(e){const t=e.toLowerCase().split("+"),n=t.pop()||"";return{meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl"),alt:t.includes("alt")||t.includes("option"),shift:t.includes("shift"),key:n}}function kj(e,t){const n=mR(t);if(n.meta!==e.metaKey||n.ctrl!==e.ctrlKey||n.alt!==e.altKey||n.shift!==e.shiftKey)return!1;const s=e.key.toLowerCase(),o=n.key.toLowerCase();return o==="escape"?s==="escape":o==="enter"?s==="enter":o==="space"?s===" ":o==="backspace"?s==="backspace":o==="delete"?s==="delete":o==="tab"?s==="tab":o==="arrowup"?s==="arrowup":o==="arrowdown"?s==="arrowdown":o==="arrowleft"?s==="arrowleft":o==="arrowright"?s==="arrowright":/^[0-9]$/.test(o)?s===o:o==="/"&&!n.shift?s==="/":o==="/"&&n.shift||o==="?"?s==="?":o===","?s===",":o==="\\"?s==="\\":s===o}function gR(e){const t=mR(e),n=[],s=Ej();t.ctrl&&n.push("Ctrl"),t.alt&&n.push(s?"Option":"Alt"),t.shift&&n.push("Shift"),t.meta&&n.push(s?"Cmd":"Ctrl");let o=t.key.toUpperCase();return o==="ESCAPE"&&(o="Esc"),o==="ENTER"&&(o="Enter"),o==="SPACE"&&(o="Space"),o==="BACKSPACE"&&(o="Backspace"),o==="DELETE"&&(o="Delete"),o==="ARROWUP"&&(o="↑"),o==="ARROWDOWN"&&(o="↓"),o==="ARROWLEFT"&&(o="←"),o==="ARROWRIGHT"&&(o="→"),o===","&&(o=","),o==="/"&&(o="/"),o==="?"&&(o="?"),o==="\\"&&(o="\\"),n.push(o),n.join("+")}function Rj(e){if(!e||!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return!!(t==="input"||t==="textarea"||e.isContentEditable)}function bi(e,t,n={}){const{shortcutsEnabled:s}=K0(),{ignoreContext:o=!1,allowInInput:u=!1,deps:h=[],enabled:a=!0}=n,l=R.useRef(t);l.current=t;const d=Array.isArray(e)?e:[e],p=R.useCallback(f=>{!o&&!s||!a||!u&&Rj(f.target)&&!d.some(C=>C.toLowerCase()==="escape")||!d.some(S=>kj(f,S))||(f.preventDefault(),f.stopPropagation(),l.current(f))},[s,o,u,a,...d,...h]);R.useEffect(()=>(document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}),[p])}function PC(e,t){const n=e.toLowerCase(),s=t.toLowerCase();if(n===s)return 100;if(n.startsWith(s))return 80;if(n.includes(s))return 60;let o=0,u=0,h=0;for(;o<n.length&&u<s.length;)n[o]===s[u]&&(h+=1,u++),o++;return u===s.length?h:0}function Tj(e,t){return t.trim()?e.map(s=>{let o=PC(s.label,t);if(s.keywords)for(const u of s.keywords){const h=PC(u,t);h>o&&(o=h)}return{command:s,score:o}}).filter(({score:s})=>s>0).sort((s,o)=>o.score-s.score).map(({command:s})=>s):e}function Lj(e){const t=new Map;for(const n of e){const s=t.get(n.category)||[];s.push(n),t.set(n.category,s)}return t}const Aj={navigation:"Navigation",actions:"Actions"},Oj={activeTabId:null,focusedTerminals:{}};function vR(){const e=$n(),t=R.useRef(void 0),n=R.useRef({}),{data:s=Oj,isLoading:o}=Kn({queryKey:["terminal-view-state"],queryFn:async()=>{const p=await fetch("/api/terminal-view-state");if(!p.ok)throw new Error("Failed to fetch terminal view state");return p.json()}}),u=Bn({mutationFn:async p=>{const f=await fetch("/api/terminal-view-state",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(!f.ok)throw new Error("Failed to update terminal view state");return f.json()},onSuccess:p=>{e.setQueryData(["terminal-view-state"],p)}}),h=R.useCallback(p=>{const f=n.current;n.current={...f,...p,focusedTerminals:p.focusedTerminals||f.focusedTerminals?{...f.focusedTerminals,...p.focusedTerminals}:void 0};const g=n.current,S={activeTabId:g.activeTabId!==void 0?g.activeTabId:s.activeTabId,focusedTerminals:{...s.focusedTerminals,...g.focusedTerminals}};e.setQueryData(["terminal-view-state"],S),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{u.mutate(n.current),n.current={}},500)},[e,s,u]),a=R.useCallback(p=>{h({activeTabId:p})},[h]),l=R.useCallback((p,f)=>{if(f===null){const{[p]:g,...S}=s.focusedTerminals;h({focusedTerminals:S})}else h({focusedTerminals:{[p]:f}})},[h,s.focusedTerminals]),d=R.useCallback(p=>s.focusedTerminals[p]??null,[s.focusedTerminals]);return{viewState:s,isLoading:o,activeTabId:s.activeTabId,setActiveTab:a,getFocusedTerminal:d,setFocusedTerminal:l}}function Mj({open:e,onOpenChange:t,onNewTask:n,onShowShortcuts:s}){const[o,u]=R.useState(!1),h=e??o,a=t??u,[l,d]=R.useState(""),[p,f]=R.useState(0),g=R.useRef(null),S=R.useRef(null),C=yo(),{setActiveTab:w}=vR(),y=R.useMemo(()=>[{id:"goto-tasks",label:"Go to Tasks",shortcut:"meta+1",keywords:["kanban","board","home"],category:"navigation",icon:_.jsx(_e,{icon:Ah,size:16,strokeWidth:2}),action:()=>{C({to:"/tasks"}),a(!1)}},{id:"goto-terminals",label:"Go to Terminals",shortcut:"meta+2",keywords:["shell","console","cli"],category:"navigation",icon:_.jsx(_e,{icon:s0,size:16,strokeWidth:2}),action:()=>{C({to:"/terminals"}),a(!1)}},{id:"goto-task-terminals",label:"Go to Task Terminals",shortcut:"meta+i",keywords:["tasks","shell","console","cli"],category:"navigation",icon:_.jsx(_e,{icon:Ah,size:16,strokeWidth:2}),action:()=>{w("all-tasks"),C({to:"/terminals"}),a(!1)}},{id:"goto-worktrees",label:"Go to Worktrees",shortcut:"meta+3",keywords:["git","branches"],category:"navigation",icon:_.jsx(_e,{icon:eE,size:16,strokeWidth:2}),action:()=>{C({to:"/worktrees"}),a(!1)}},{id:"goto-repositories",label:"Go to Repositories",shortcut:"meta+4",keywords:["repos","git","projects"],category:"navigation",icon:_.jsx(_e,{icon:Z2,size:16,strokeWidth:2}),action:()=>{C({to:"/repositories"}),a(!1)}},{id:"goto-settings",label:"Go to Settings",shortcut:"meta+,",keywords:["preferences","config","configuration"],category:"navigation",icon:_.jsx(_e,{icon:tE,size:16,strokeWidth:2}),action:()=>{C({to:"/settings"}),a(!1)}},{id:"new-task",label:"New Task",shortcut:"meta+j",keywords:["create","add"],category:"actions",icon:_.jsx(_e,{icon:rc,size:16,strokeWidth:2}),action:()=>{a(!1),n?.()}},{id:"show-shortcuts",label:"Keyboard Shortcuts",shortcut:"meta+/",keywords:["help","hotkeys","keys"],category:"actions",icon:_.jsx(_e,{icon:d4,size:16,strokeWidth:2}),action:()=>{a(!1),s?.()}}],[C,n,s,w]),x=R.useMemo(()=>Tj(y,l),[y,l]),v=R.useMemo(()=>Lj(x),[x]),b=R.useMemo(()=>{const A=[],M=["navigation","actions"];for(const L of M){const D=v.get(L);D&&A.push(...D)}return A},[v]);R.useEffect(()=>{f(0)},[l]),R.useEffect(()=>{if(!S.current)return;const A=S.current.querySelector('[data-selected="true"]');A&&A.scrollIntoView({block:"nearest"})},[p]),bi("meta+k",()=>a(!0),{allowInInput:!0}),bi("meta+1",()=>C({to:"/tasks"}),{allowInInput:!0}),bi("meta+2",()=>C({to:"/terminals"}),{allowInInput:!0}),bi("meta+i",()=>{w("all-tasks"),C({to:"/terminals"})},{allowInInput:!0}),bi("meta+3",()=>C({to:"/worktrees"}),{allowInInput:!0}),bi("meta+4",()=>C({to:"/repositories"}),{allowInInput:!0}),bi("meta+,",()=>C({to:"/settings"}),{allowInInput:!0}),bi("meta+j",()=>{n?.()},{allowInInput:!1,deps:[n]}),bi("meta+/",()=>{s?.()},{allowInInput:!0,deps:[s]});const E=R.useCallback(A=>{switch(A.key){case"ArrowDown":A.preventDefault(),f(M=>Math.min(M+1,b.length-1));break;case"ArrowUp":A.preventDefault(),f(M=>Math.max(M-1,0));break;case"Enter":A.preventDefault(),b[p]&&b[p].action();break;case"Escape":A.preventDefault(),a(!1);break}},[b,p]);R.useEffect(()=>{h&&(d(""),f(0),setTimeout(()=>g.current?.focus(),50))},[h]);let T=0;return _.jsx(xs,{open:h,onOpenChange:a,children:_.jsxs(Ss,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden",showCloseButton:!1,onKeyDown:E,children:[_.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[_.jsx("span",{className:"text-muted-foreground mr-2",children:">"}),_.jsx(Wt,{ref:g,value:l,onChange:A=>d(A.target.value),placeholder:"Type a command or search...",className:"border-0 ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 px-0 h-12"}),_.jsx("kbd",{className:"pointer-events-none ml-2 inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"Esc"})]}),_.jsx("div",{ref:S,className:"max-h-80 overflow-y-auto p-2",children:x.length===0?_.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No commands found."}):_.jsx(_.Fragment,{children:["navigation","actions"].map(A=>{const M=v.get(A);return!M||M.length===0?null:_.jsxs("div",{className:"mb-2 last:mb-0",children:[_.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:Aj[A]}),M.map(L=>{const D=T++,H=D===p;return _.jsxs("button",{"data-selected":H,onClick:()=>L.action(),onMouseEnter:()=>f(D),className:He("flex w-full items-center gap-3 rounded-md px-2 py-2 text-sm",H?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[L.icon&&_.jsx("span",{className:"text-muted-foreground",children:L.icon}),_.jsx("span",{className:"flex-1 text-left",children:L.label}),L.shortcut&&_.jsx("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:gR(L.shortcut)})]},L.id)})]},A)})})})]})})}const Dj=[{title:"Navigation",items:[{label:"Go to Tasks",shortcut:"meta+1"},{label:"Go to Terminals",shortcut:"meta+2"},{label:"Go to Task Terminals",shortcut:"meta+i"},{label:"Go to Worktrees",shortcut:"meta+3"},{label:"Go to Repositories",shortcut:"meta+4"},{label:"Go to Settings",shortcut:"meta+,"}]},{title:"Actions",items:[{label:"Command Palette",shortcut:"meta+k"},{label:"New Task",shortcut:"meta+j"},{label:"Keyboard Shortcuts",shortcut:"meta+/"}]},{title:"General",items:[{label:"Close Modal",shortcut:"escape"}]}];function Pj({open:e,onOpenChange:t}){return _.jsx(xs,{open:e,onOpenChange:t,children:_.jsxs(Ss,{className:"sm:max-w-md",children:[_.jsx(Bs,{children:_.jsx(zs,{children:"Keyboard Shortcuts"})}),_.jsx("div",{className:"space-y-4 mt-2",children:Dj.map(n=>_.jsxs("div",{children:[_.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:n.title}),_.jsx("div",{className:"space-y-1",children:n.items.map(s=>_.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[_.jsx("span",{className:"text-sm",children:s.label}),_.jsx("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:gR(s.shortcut)})]},s.shortcut))})]},n.title))})]})})}const Ij=({...e})=>_.jsx(yj,{theme:"dark",className:"toaster group",icons:{success:_.jsx(_e,{icon:i4,strokeWidth:2,className:"size-4"}),info:_.jsx(_e,{icon:p4,strokeWidth:2,className:"size-4"}),warning:_.jsx(_e,{icon:nc,strokeWidth:2,className:"size-4"}),error:_.jsx(_e,{icon:y4,strokeWidth:2,className:"size-4"}),loading:_.jsx(_e,{icon:zr,strokeWidth:2,className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e}),Ks=I3({component:Nj});function jj(){return Cj(),null}function Nj(){const[e,t]=R.useState(null),[n,s]=R.useState(!1),[o,u]=R.useState(!1),h=R.useCallback(p=>{t(()=>p)},[]),a=R.useCallback(()=>{e?.()},[e]),l=R.useCallback(()=>{s(!0)},[]),d=R.useCallback(()=>{u(!0)},[]);return _.jsx(wj,{children:_.jsxs("div",{className:"flex h-screen flex-col overflow-x-hidden bg-background text-foreground",children:[_.jsx(jj,{}),_.jsx(GI,{onNewTaskRef:h,onOpenCommandPalette:d}),_.jsx("main",{className:"isolate flex-1 overflow-hidden",children:_.jsx(m2,{})}),_.jsx(Mj,{open:o,onOpenChange:u,onNewTask:a,onShowShortcuts:l}),_.jsx(Pj,{open:n,onOpenChange:s}),_.jsx(Ij,{position:"bottom-right"})]})})}const Bj=ws("/")({beforeLoad:()=>{throw Jw({to:"/tasks"})}}),_R="";function zj(){const[e,t]=R.useState(new Map),[n,s]=R.useState(null),[o,u]=R.useState(!0),[h,a]=R.useState(!1),[l,d]=R.useState(null),p=R.useRef(null),f=R.useRef(0),g=R.useCallback(()=>{p.current?.close(),u(!0),a(!1),d(null),t(new Map),s(null);const C=new EventSource(`${_R}/api/worktrees`);p.current=C,C.addEventListener("worktree:basic",w=>{const y=JSON.parse(w.data);f.current=y.length,t(new Map(y.map(x=>[x.path,{...x,size:0,sizeFormatted:"...",branch:"..."}]))),u(!1),a(y.length>0)}),C.addEventListener("worktree:details",w=>{const y=JSON.parse(w.data);t(x=>{const v=new Map(x),b=v.get(y.path);return b&&v.set(y.path,{...b,size:y.size,sizeFormatted:y.sizeFormatted,branch:y.branch}),v}),f.current--,f.current<=0&&a(!1)}),C.addEventListener("worktree:complete",w=>{const y=JSON.parse(w.data);s(y),a(!1),C.close()}),C.addEventListener("worktree:error",w=>{const{path:y}=JSON.parse(w.data);console.error(`Error loading worktree details for ${y}`),f.current--,f.current<=0&&a(!1)}),C.onerror=()=>{d(new Error("Connection lost")),u(!1),a(!1),C.close()}},[]);return R.useEffect(()=>(g(),()=>{p.current?.close()}),[g]),{worktrees:R.useMemo(()=>Array.from(e.values()).sort((w,y)=>w.isOrphaned!==y.isOrphaned?w.isOrphaned?-1:1:new Date(y.lastModified).getTime()-new Date(w.lastModified).getTime()),[e]),summary:n,isLoading:o,isLoadingDetails:h,error:l,refetch:g}}function Hj(){const e=$n();return Bn({mutationFn:({worktreePath:t,repoPath:n})=>Zt(`${_R}/api/worktrees`,{method:"DELETE",body:JSON.stringify({worktreePath:t,repoPath:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worktrees"]}),e.invalidateQueries({queryKey:["tasks"]})}})}const Vj=Oa("h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function ba({className:e,variant:t="default",render:n,...s}){return sI({defaultTagName:"span",props:Ws({className:He(Vj({className:e,variant:t}))},s),render:n,state:{slot:"badge",variant:t}})}function fd({className:e,size:t="default",...n}){return _.jsx("div",{"data-slot":"card","data-size":t,className:He("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-xs/relaxed ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col",e),...n})}function Fj({className:e,...t}){return _.jsx("div",{"data-slot":"card-header",className:He("gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...t})}function Uj({className:e,...t}){return _.jsx("div",{"data-slot":"card-title",className:He("text-sm font-medium",e),...t})}function hd({className:e,...t}){return _.jsx("div",{"data-slot":"card-content",className:He("px-4 group-data-[size=sm]/card:px-3",e),...t})}function uc({...e}){return _.jsx(NP,{"data-slot":"alert-dialog",...e})}function dc({...e}){return _.jsx(fk,{"data-slot":"alert-dialog-trigger",...e})}function Wj({...e}){return _.jsx(lk,{"data-slot":"alert-dialog-portal",...e})}function qj({className:e,...t}){return _.jsx(rE,{"data-slot":"alert-dialog-overlay",className:He("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function fc({className:e,size:t="default",...n}){return _.jsxs(Wj,{children:[_.jsx(qj,{}),_.jsx(ak,{"data-slot":"alert-dialog-content","data-size":t,className:He("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-3 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...n})]})}function hc({className:e,...t}){return _.jsx("div",{"data-slot":"alert-dialog-header",className:He("grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function pc({className:e,...t}){return _.jsx("div",{"data-slot":"alert-dialog-footer",className:He("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function mc({className:e,...t}){return _.jsx(dk,{"data-slot":"alert-dialog-title",className:He("text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function gc({className:e,...t}){return _.jsx(oE,{"data-slot":"alert-dialog-description",className:He("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function yR({className:e,...t}){return _.jsx(Be,{"data-slot":"alert-dialog-action",className:He(e),...t})}function vc({className:e,variant:t="outline",size:n="default",...s}){return _.jsx(fp,{"data-slot":"alert-dialog-cancel",className:He(e),render:_.jsx(Be,{variant:t,size:n}),...s})}const bR={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},y_={IN_PROGRESS:"bg-slate-400/20 text-slate-600 dark:text-slate-400",IN_REVIEW:"bg-violet-400/20 text-violet-600 dark:text-violet-400",DONE:"bg-emerald-400/20 text-emerald-600 dark:text-emerald-400",CANCELED:"bg-rose-400/20 text-rose-600 dark:text-rose-400",ORPHANED:"bg-destructive/20 text-destructive"},Gj=ws("/worktrees/")({component:Xj});function $j(e){const t=new Date(e),s=new Date().getTime()-t.getTime(),o=Math.floor(s/1e3),u=Math.floor(o/60),h=Math.floor(u/60),a=Math.floor(h/24);return a>0?a===1?"1 day ago":`${a} days ago`:h>0?h===1?"1 hour ago":`${h} hours ago`:u>0?u===1?"1 minute ago":`${u} minutes ago`:"just now"}function IC({className:e}){return _.jsx("span",{className:`inline-block animate-pulse rounded bg-muted ${e}`})}function Kj({worktree:e,onDelete:t}){const[n,s]=R.useState(!1),[o,u]=R.useState(!1),h=e.sizeFormatted==="..."||e.branch==="...",a=async()=>{u(!0);try{await t(e),s(!1)}catch{}finally{u(!1)}};return _.jsx(fd,{className:"transition-colors hover:border-border/80",children:_.jsxs(hd,{className:"flex items-start justify-between gap-4 py-4",children:[_.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"truncate font-medium",children:e.name}),e.isOrphaned?_.jsx(ba,{className:He("shrink-0",y_.ORPHANED),children:"Orphaned"}):e.taskStatus?_.jsx(ba,{className:He("shrink-0",y_[e.taskStatus]),children:bR[e.taskStatus]}):null]}),_.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(_e,{icon:os,size:12,strokeWidth:2,className:"shrink-0"}),_.jsx("span",{className:"truncate font-mono",children:e.path})]}),_.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(_e,{icon:o_,size:12,strokeWidth:2,className:"shrink-0"}),e.branch==="..."?_.jsx(IC,{className:"h-3 w-16"}):_.jsx("span",{className:"font-mono",children:e.branch})]}),_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(_e,{icon:u4,size:12,strokeWidth:2,className:"shrink-0"}),e.sizeFormatted==="..."?_.jsx(IC,{className:"h-3 w-12"}):_.jsx("span",{children:e.sizeFormatted})]}),_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(_e,{icon:r4,size:12,strokeWidth:2,className:"shrink-0"}),_.jsx("span",{children:$j(e.lastModified)})]})]}),e.taskId&&e.taskTitle&&_.jsx("div",{className:"flex items-center gap-1.5 pt-1",children:_.jsxs(qn,{to:"/tasks/$taskId",params:{taskId:e.taskId},className:"inline-flex items-center gap-1 text-foreground hover:underline",children:[_.jsx("span",{className:"truncate",children:e.taskTitle}),_.jsx(_e,{icon:X2,size:12,strokeWidth:2,className:"shrink-0"})]})})]})]}),_.jsxs(uc,{open:n,onOpenChange:s,children:[_.jsx(dc,{render:_.jsx(Be,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:h}),children:_.jsx(_e,{icon:ed,size:14,strokeWidth:2})}),_.jsxs(fc,{children:[_.jsxs(hc,{children:[_.jsx(mc,{children:"Delete Worktree"}),_.jsxs(gc,{children:["This will permanently delete the worktree directory at"," ",_.jsx("span",{className:"font-mono",children:e.name}),".",!e.isOrphaned&&_.jsxs(_.Fragment,{children:[" ","The linked task ",_.jsxs("span",{className:"font-medium",children:['"',e.taskTitle,'"']})," will also be deleted."]})," ","This action cannot be undone."]})]}),_.jsxs(pc,{children:[_.jsx(vc,{disabled:o,children:"Cancel"}),_.jsxs(Be,{variant:"destructive",onClick:a,disabled:o,className:"gap-2",children:[o&&_.jsx(_e,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})]})})}const Yj=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED","ORPHANED"];function Xj(){const{worktrees:e,summary:t,isLoading:n,isLoadingDetails:s,error:o,refetch:u}=zj(),h=Hj(),[a,l]=R.useState(new Set),[d,p]=R.useState(!1),[f,g]=R.useState(!1),S=b=>{l(E=>{const T=new Set(E);return T.has(b)?T.delete(b):T.add(b),T})},C=()=>{l(new Set)},w=R.useMemo(()=>a.size===0?e:e.filter(b=>!!(b.isOrphaned&&a.has("ORPHANED")||b.taskStatus&&a.has(b.taskStatus))),[e,a]),y=R.useMemo(()=>e.filter(b=>b.taskStatus==="DONE"||b.taskStatus==="CANCELED"),[e]),x=async()=>{if(y.length!==0){g(!0);try{for(const b of y)await h.mutateAsync({worktreePath:b.path,repoPath:b.repoPath});p(!1),u()}catch{}finally{g(!1)}}},v=async b=>{await h.mutateAsync({worktreePath:b.path,repoPath:b.repoPath}),u()};return _.jsxs("div",{className:"flex h-full flex-col",children:[_.jsxs("div",{className:"flex shrink-0 flex-col gap-2 border-b border-border px-4 py-2",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{className:"flex items-center gap-4",children:[_.jsx("h1",{className:"text-sm font-medium",children:"Worktrees"}),(t||e.length>0)&&_.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[_.jsxs("span",{children:[t?.total??e.length," total"]}),(t?.orphaned??e.filter(b=>b.isOrphaned).length)>0&&_.jsxs("span",{className:"text-destructive",children:[t?.orphaned??e.filter(b=>b.isOrphaned).length," orphaned"]}),s?_.jsx("span",{className:"animate-pulse",children:"calculating..."}):t?_.jsx("span",{children:t.totalSizeFormatted}):null]})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[y.length>0&&_.jsxs(uc,{open:d,onOpenChange:p,children:[_.jsxs(dc,{render:_.jsx(Be,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground hover:text-destructive",disabled:s}),children:[_.jsx(_e,{icon:o4,size:12,strokeWidth:2}),"Clean up (",y.length,")"]}),_.jsxs(fc,{children:[_.jsxs(hc,{children:[_.jsx(mc,{children:"Delete Completed Worktrees"}),_.jsxs(gc,{className:"space-y-2",children:[_.jsxs("span",{className:"block",children:["This will permanently delete ",y.length," worktree",y.length!==1?"s":""," and their linked tasks:"]}),_.jsxs("span",{className:"block text-sm",children:[y.filter(b=>b.taskStatus==="DONE").length>0&&_.jsxs("span",{className:"mr-3",children:[_.jsx("span",{className:"font-medium text-emerald-600",children:y.filter(b=>b.taskStatus==="DONE").length})," ","Done"]}),y.filter(b=>b.taskStatus==="CANCELED").length>0&&_.jsxs("span",{children:[_.jsx("span",{className:"font-medium text-rose-600",children:y.filter(b=>b.taskStatus==="CANCELED").length})," ","Canceled"]})]}),_.jsx("span",{className:"block font-medium text-destructive",children:"This action cannot be undone."})]})]}),_.jsxs(pc,{children:[_.jsx(vc,{disabled:f,children:"Cancel"}),_.jsxs(Be,{variant:"destructive",onClick:x,disabled:f,className:"gap-2",children:[f&&_.jsx(_e,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}),f?"Deleting...":`Delete ${y.length}`]})]})]})]}),a.size>0&&_.jsxs(Be,{variant:"ghost",size:"sm",onClick:C,className:"gap-1.5 text-xs",children:[_.jsx(_e,{icon:_o,size:12,strokeWidth:2}),"Clear filters"]})]})]}),_.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:Yj.map(b=>{const E=a.has(b);return _.jsx("button",{onClick:()=>S(b),className:He("rounded-full px-2.5 py-1 text-xs font-medium transition-colors",E?y_[b]:"bg-muted text-muted-foreground hover:bg-muted/80"),children:bR[b]},b)})})]}),_.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[n&&_.jsx("div",{className:"flex items-center justify-center py-12",children:_.jsx(_e,{icon:zr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),o&&_.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[_.jsx(_e,{icon:nc,size:20,strokeWidth:2}),_.jsxs("span",{className:"text-sm",children:["Failed to load worktrees: ",o.message]})]}),!n&&!o&&w.length===0&&_.jsx("div",{className:"py-12 text-muted-foreground",children:_.jsx("p",{className:"text-sm",children:a.size>0?"No worktrees match the selected filters.":"No worktrees found. Worktrees are created when you create tasks."})}),!n&&_.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:w.map(b=>_.jsx(Kj,{worktree:b,onDelete:v},b.path))})]})]})}function Gt(e,t="Assertion error"){if(!e)throw Error(t)}function Xl({group:e}){const{orientation:t,panels:n}=e;return n.reduce((s,o)=>(s+=t==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,s),0)}function b_(e,t){return t.sort(e==="horizontal"?Qj:Zj)}function Qj(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function Zj(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function xR(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Jj({orientation:e,rects:t,targetRect:n}){const s={x:n.x+n.width/2,y:n.y+n.height/2};let o,u=Number.MAX_VALUE;for(const h of t){const{x:a,y:l}=xR(s,h),d=e==="horizontal"?a:l;d<u&&(u=d,o=h)}return Gt(o,"No rect found"),o}function SR(e){const{element:t,orientation:n,panels:s,separators:o}=e,u=b_(n,Array.from(t.children).filter(p=>p instanceof HTMLElement).map(p=>({element:p}))).map(({element:p})=>p),h=[];let a=!1,l,d=[];for(const p of u)if(p.hasAttribute("data-panel")){const f=s.find(g=>g.element===p);if(f){if(l){const g=l.element.getBoundingClientRect(),S=p.getBoundingClientRect();let C;if(a){const w=n==="horizontal"?new DOMRect(g.right,g.top,0,g.height):new DOMRect(g.left,g.bottom,g.width,0),y=n==="horizontal"?new DOMRect(S.left,S.top,0,S.height):new DOMRect(S.left,S.top,S.width,0);switch(d.length){case 0:{C=[w,y];break}case 1:{const x=d[0],v=Jj({orientation:n,rects:[g,S],targetRect:x.element.getBoundingClientRect()});C=[x,v===g?y:w];break}default:{C=d;break}}}else d.length?C=d:C=[n==="horizontal"?new DOMRect(g.right,S.top,S.left-g.right,S.height):new DOMRect(S.left,g.bottom,S.width,S.top-g.bottom)];for(const w of C)h.push({group:e,groupSize:Xl({group:e}),panels:[l,f],separator:"width"in w?void 0:w,rect:"width"in w?w:w.element.getBoundingClientRect()})}a=!1,l=f,d=[]}}else if(p.hasAttribute("data-separator")){const f=o.find(g=>g.element===p);f?d.push(f):(l=void 0,d=[])}else a=!0;return h}function eN(e,t){const n=getComputedStyle(e),s=parseFloat(n.fontSize);return t*s}function tN(e,t){const n=getComputedStyle(e.ownerDocument.body),s=parseFloat(n.fontSize);return t*s}function nN(e){return e/100*window.innerHeight}function rN(e){return e/100*window.innerWidth}function sN(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function th({groupSize:e,panelElement:t,styleProp:n}){let s;const[o,u]=sN(n);switch(u){case"%":{s=o/100*e;break}case"px":{s=o;break}case"rem":{s=tN(t,o);break}case"em":{s=eN(t,o);break}case"vh":{s=nN(o);break}case"vw":{s=rN(o);break}}return s}function Cs(e){return parseFloat(e.toFixed(3))}function jC(e){const{panels:t}=e,n=Xl({group:e});return n===0?t.map(s=>({collapsedSize:0,collapsible:s.panelConstraints.collapsible===!0,defaultSize:void 0,minSize:0,maxSize:100,panelId:s.id})):t.map(s=>{const{element:o,panelConstraints:u}=s;let h=0;if(u.collapsedSize){const p=th({groupSize:n,panelElement:o,styleProp:u.collapsedSize});h=Cs(p/n*100)}let a;if(u.defaultSize){const p=th({groupSize:n,panelElement:o,styleProp:u.defaultSize});a=Cs(p/n*100)}let l=0;if(u.minSize){const p=th({groupSize:n,panelElement:o,styleProp:u.minSize});l=Cs(p/n*100)}let d=100;if(u.maxSize){const p=th({groupSize:n,panelElement:o,styleProp:u.maxSize});d=Cs(p/n*100)}return{collapsedSize:h,collapsible:u.collapsible===!0,defaultSize:a,minSize:l,maxSize:d,panelId:s.id}})}class iN{#e={};addListener(t,n){const s=this.#e[t];return s===void 0?this.#e[t]=[n]:s.includes(n)||s.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const s=this.#e[t];if(s!==void 0)if(s.length===1)s[0].call(null,n);else{let o=!1,u=null;const h=Array.from(s);for(let a=0;a<h.length;a++){const l=h[a];try{l.call(null,n)}catch(d){u===null&&(o=!0,u=d)}}if(o)throw u}}removeAllListeners(){this.#e={}}removeListener(t,n){const s=this.#e[t];if(s!==void 0){const o=s.indexOf(n);o>=0&&s.splice(o,1)}}}function or(e,t,n=0){return Math.abs(Cs(e)-Cs(t))<=n}let Zr={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const xa=new iN;function Ys(){return Zr}function ls(e){const t=typeof e=="function"?e(Zr):e;if(Zr===t)return Zr;const n=Zr;return Zr={...Zr,...t},t.cursorFlags!==void 0&&xa.emit("cursorFlagsChange",Zr.cursorFlags),t.interactionState!==void 0&&xa.emit("interactionStateChange",Zr.interactionState),t.mountedGroups!==void 0&&(Zr.mountedGroups.forEach((s,o)=>{s.derivedPanelConstraints.forEach(u=>{if(u.collapsible){const{layout:h}=n.mountedGroups.get(o)??{};if(h){const a=or(u.collapsedSize,s.layout[u.panelId]),l=or(u.collapsedSize,h[u.panelId]);a&&!l&&(o.inMemoryLastExpandedPanelSizes[u.panelId]=h[u.panelId])}}})}),xa.emit("mountedGroupsChange",Zr.mountedGroups)),Zr}const oN=e=>e,xv=()=>{},CR=1,wR=2,ER=4,kR=8,NC={coarse:10,precise:5};function aN({cursorFlags:e,groups:t,state:n}){let s=0,o=0;switch(n){case"active":case"hover":t.forEach(u=>{if(!u.disableCursor)switch(u.orientation){case"horizontal":{s++;break}case"vertical":{o++;break}}})}if(s===0&&o===0)return null;switch(n){case"active":{const u=(e&CR)!==0,h=(e&wR)!==0,a=(e&ER)!==0,l=(e&kR)!==0;if(e){if(u)return a?"se-resize":l?"ne-resize":"e-resize";if(h)return a?"sw-resize":l?"nw-resize":"w-resize";if(a)return"s-resize";if(l)return"n-resize"}break}}return s>0&&o>0?"move":s>0?"ew-resize":"ns-resize"}let Sv,Ds;function Y0(){Ds===void 0&&(Ds=new CSSStyleSheet,document.adoptedStyleSheets=[Ds]);const{cursorFlags:e,interactionState:t}=Ys();switch(t.state){case"active":case"hover":{const n=aN({cursorFlags:e,groups:t.hitRegions.map(o=>o.group),state:t.state}),s=`*{cursor: ${n} !important; ${t.state==="active"?"touch-action: none;":""} }`;if(Sv===s)return;Sv=s,n?Ds.cssRules.length===0?Ds.insertRule(s):Ds.replaceSync(s):Ds.cssRules.length===1&&Ds.deleteRule(0);break}case"inactive":{Sv=void 0,Ds.cssRules.length===1&&Ds.deleteRule(0);break}}}function lN(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function qu(e,t){return or(e,t)?0:e>t?1:-1}function Rl({panelConstraints:e,size:t}){const{collapsedSize:n=0,collapsible:s,maxSize:o=100,minSize:u=0}=e;if(qu(t,u)<0)if(s){const h=(n+u)/2;qu(t,h)<0?t=n:t=u}else t=u;return t=Math.min(o,t),t=Cs(t),t}function Gu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:s,prevLayout:o,trigger:u}){if(or(e,0))return t;const h=Object.values(t),a=Object.values(o),l=[...h],[d,p]=s;Gt(d!=null,"Invalid first pivot index"),Gt(p!=null,"Invalid second pivot index");let f=0;if(u==="keyboard"){{const C=e<0?p:d,w=n[C];Gt(w,`Panel constraints not found for index ${C}`);const{collapsedSize:y=0,collapsible:x,minSize:v=0}=w;if(x){const b=h[C];if(Gt(b!=null,`Previous layout not found for panel index ${C}`),or(b,y)){const E=v-b;qu(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}{const C=e<0?d:p,w=n[C];Gt(w,`No panel constraints found for index ${C}`);const{collapsedSize:y=0,collapsible:x,minSize:v=0}=w;if(x){const b=h[C];if(Gt(b!=null,`Previous layout not found for panel index ${C}`),or(b,v)){const E=b-y;qu(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}}{const C=e<0?1:-1;let w=e<0?p:d,y=0;for(;;){const v=h[w];Gt(v!=null,`Previous layout not found for panel index ${w}`);const b=Rl({panelConstraints:n[w],size:100})-v;if(y+=b,w+=C,w<0||w>=n.length)break}const x=Math.min(Math.abs(e),Math.abs(y));e=e<0?0-x:x}{let C=e<0?d:p;for(;C>=0&&C<n.length;){const w=Math.abs(e)-Math.abs(f),y=h[C];Gt(y!=null,`Previous layout not found for panel index ${C}`);const x=y-w,v=Rl({panelConstraints:n[C],size:x});if(!or(y,v)&&(f+=y-v,l[C]=v,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?C--:C++}}if(lN(a,l))return o;{const C=e<0?p:d,w=h[C];Gt(w!=null,`Previous layout not found for panel index ${C}`);const y=w+f,x=Rl({panelConstraints:n[C],size:y});if(l[C]=x,!or(x,y)){let v=y-x,b=e<0?p:d;for(;b>=0&&b<n.length;){const E=l[b];Gt(E!=null,`Previous layout not found for panel index ${b}`);const T=E+v,A=Rl({panelConstraints:n[b],size:T});if(or(E,A)||(v-=A-E,l[b]=A),or(v,0))break;e>0?b--:b++}}}const g=Object.values(l).reduce((C,w)=>w+C,0);if(!or(g,100,.1))return o;const S=Object.keys(o);return l.reduce((C,w,y)=>(C[S[y]]=w,C),{})}function _c(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||qu(e[n],t[n])!==0)return!1;return!0}function RR({event:e,hitRegions:t,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:o}){let u=0;const h=new Map(s);t.forEach(a=>{const{group:l,groupSize:d}=a,{disableCursor:p,orientation:f,panels:g}=l;let S=0;o?f==="horizontal"?S=(e.clientX-o.x)/d*100:S=(e.clientY-o.y)/d*100:f==="horizontal"?S=e.clientX<0?-100:100:S=e.clientY<0?-100:100;const C=n.get(l),{defaultLayoutDeferred:w,derivedPanelConstraints:y,layout:x,separatorToPanels:v}=s.get(l)??{defaultLayoutDeferred:!1};if(y&&C&&x&&v){const b=Gu({delta:S,initialLayout:C,panelConstraints:y,pivotIndices:a.panels.map(E=>g.indexOf(E)),prevLayout:x,trigger:"mouse-or-touch"});if(_c(b,x)){if(S!==0&&!p)switch(f){case"horizontal":{u|=S<0?CR:wR;break}case"vertical":{u|=S<0?ER:kR;break}}}else{h.set(a.group,{defaultLayoutDeferred:w,derivedPanelConstraints:y,layout:b,separatorToPanels:v});const E=a.group.panels.map(({id:T})=>T).join(",");a.group.inMemoryLayouts[E]=b}}}),ls({cursorFlags:u,mountedGroups:h}),Y0()}function BC(e){if(e.defaultPrevented||e.relatedTarget!==null||e.clientX===0&&e.clientY===0)return;const{interactionState:t,mountedGroups:n}=Ys();t.state==="active"&&t.hitRegions.forEach(s=>{e.currentTarget===s.group.element&&RR({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n})})}function mh(e){const t=e.parentElement;Gt(t,"Parent group element not found");const{mountedGroups:n}=Ys();for(const[s]of n)if(s.element===t)return s;throw Error("Could not find parent Group for separator element")}function La({layout:e,panelConstraints:t}){const n=[...Object.values(e)],s=n.reduce((h,a)=>h+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(h=>`${h}%`).join(", ")}`);if(!or(s,100)&&n.length>0)for(let h=0;h<t.length;h++){const a=n[h];Gt(a!=null,`No layout data found for index ${h}`);const l=100/s*a;n[h]=l}let o=0;for(let h=0;h<t.length;h++){const a=n[h];Gt(a!=null,`No layout data found for index ${h}`);const l=Rl({panelConstraints:t[h],size:a});a!=l&&(o+=a-l,n[h]=l)}if(!or(o,0))for(let h=0;h<t.length;h++){const a=n[h];Gt(a!=null,`No layout data found for index ${h}`);const l=a+o,d=Rl({panelConstraints:t[h],size:l});if(a!==d&&(o-=d-a,n[h]=d,or(o,0)))break}const u=Object.keys(e);return n.reduce((h,a,l)=>(h[u[l]]=a,h),{})}function TR({groupId:e}){const t=()=>{const{mountedGroups:n}=Ys();for(const[s,o]of n)if(s.id===e)return{group:s,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:s}=t();return n?{}:s},setLayout(n){const{defaultLayoutDeferred:s,derivedPanelConstraints:o,group:u,layout:h,separatorToPanels:a}=t(),l=La({layout:n,panelConstraints:o});return s?h:(_c(h,l)||ls(d=>({mountedGroups:new Map(d.mountedGroups).set(u,{defaultLayoutDeferred:s,derivedPanelConstraints:o,layout:l,separatorToPanels:a})})),l)}}}function LR(e){const{mountedGroups:t}=Ys(),n=t.get(e);return Gt(n,`Mounted Group ${e.id} not found`),n}function Yo(e,t){const n=mh(e),s=LR(n),o=n.separators.find(p=>p.element===e);Gt(o,"Matching separator not found");const u=s.separatorToPanels.get(o);Gt(u,"Matching panels not found");const h=u.map(p=>n.panels.indexOf(p)),a=TR({groupId:n.id}).getLayout(),l=Gu({delta:t,initialLayout:a,panelConstraints:s.derivedPanelConstraints,pivotIndices:h,prevLayout:a,trigger:"keyboard"}),d=La({layout:l,panelConstraints:s.derivedPanelConstraints});_c(a,d)||ls(p=>({mountedGroups:new Map(p.mountedGroups).set(n,{defaultLayoutDeferred:s.defaultLayoutDeferred,derivedPanelConstraints:s.derivedPanelConstraints,layout:d,separatorToPanels:s.separatorToPanels})}))}function zC(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=mh(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Yo(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Yo(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Yo(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Yo(t,-5);break}case"End":{e.preventDefault(),Yo(t,100);break}case"Enter":{e.preventDefault();const s=mh(t),{derivedPanelConstraints:o,layout:u,separatorToPanels:h}=LR(s),a=s.separators.find(f=>f.element===t);Gt(a,"Matching separator not found");const l=h.get(a);Gt(l,"Matching panels not found");const d=l[0],p=o.find(f=>f.panelId===d.id);if(Gt(p,"Panel metadata not found"),p.collapsible){const f=u[d.id],g=p.collapsedSize===f?s.inMemoryLastExpandedPanelSizes[d.id]??p.minSize:p.collapsedSize;Yo(t,g-f)}break}case"F6":{e.preventDefault();const s=mh(t).separators.map(h=>h.element),o=Array.from(s).findIndex(h=>h===e.currentTarget);Gt(o!==null,"Index not found");const u=e.shiftKey?o>0?o-1:s.length-1:o+1<s.length?o+1:0;s[u].focus();break}case"Home":{e.preventDefault(),Yo(t,-100);break}}}function cN(e,t,n){let s,o={x:1/0,y:1/0};for(const u of t){const h=xR(n,u.rect);switch(e){case"horizontal":{h.x<=o.x&&(s=u,o=h);break}case"vertical":{h.y<=o.y&&(s=u,o=h);break}}}return s?{distance:o,hitRegion:s}:void 0}let nh;function uN(){return nh===void 0&&(typeof matchMedia=="function"?nh=!!matchMedia("(pointer:coarse)").matches:nh=!1),nh}function dN(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:FC(e),b:FC(t)};let s;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),s=e;Gt(s,"Stacking order can only be calculated for elements with a common ancestor");const o={a:VC(HC(n.a)),b:VC(HC(n.b))};if(o.a===o.b){const u=s.childNodes,h={a:n.a.at(-1),b:n.b.at(-1)};let a=u.length;for(;a--;){const l=u[a];if(l===h.a)return 1;if(l===h.b)return-1}}return Math.sign(o.a-o.b)}const fN=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function hN(e){const t=getComputedStyle(AR(e)??e).display;return t==="flex"||t==="inline-flex"}function pN(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||hN(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||fN.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function HC(e){let t=e.length;for(;t--;){const n=e[t];if(Gt(n,"Missing node"),pN(n))return n}return null}function VC(e){return e&&Number(getComputedStyle(e).zIndex)||0}function FC(e){const t=[];for(;e;)t.push(e),e=AR(e);return t}function AR(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}function mN(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function gN({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!(n instanceof HTMLElement)||n.contains(e)||e.contains(n))return!0;if(dN(n,e)>0){let s=n;for(;s;){if(s.contains(e))return!0;if(mN(s.getBoundingClientRect(),t))return!1;s=s.parentElement}}return!0}function OR(e,t){const n=[];return t.forEach((s,o)=>{if(o.disabled)return;const u=uN()?NC.coarse:NC.precise,h=SR(o),a=cN(o.orientation,h,{x:e.clientX,y:e.clientY});a&&a.distance.x<=u&&a.distance.y<=u&&gN({groupElement:o.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function UC(e){if(e.defaultPrevented)return;const{mountedGroups:t}=Ys(),n=OR(e,t),s=new Set,o=new Set,u=new Set,h=new Map;let a=!1;n.forEach(l=>{s.add(l.group),l.panels.forEach(p=>{o.add(p)}),l.separator&&(u.add(l.separator),a||(a=!0,l.separator.element.focus()));const d=t.get(l.group);d&&h.set(l.group,d.layout)}),ls({interactionState:{hitRegions:n,initialLayoutMap:h,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),n.length&&e.preventDefault()}function WC(e){if(e.defaultPrevented)return;const{interactionState:t,mountedGroups:n}=Ys();switch(t.state){case"active":{if(e.type!=="pointerleave"&&e.buttons===0){ls(s=>s.interactionState.state==="inactive"?s:{cursorFlags:0,interactionState:{state:"inactive"}});return}RR({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break}default:{const s=OR(e,n);s.length===0?t.state!=="inactive"&&ls({interactionState:{state:"inactive"}}):ls({interactionState:{hitRegions:s,state:"hover"}}),Y0();break}}}function qC(e){if(e.defaultPrevented)return;e.preventDefault();const{interactionState:t}=Ys();t.state==="active"&&(ls({cursorFlags:0,interactionState:{state:"inactive"}}),Y0())}function GC(e){let t=0,n=0;const s={};for(const u of e)if(u.defaultSize!==void 0){t++;const h=Cs(u.defaultSize);n+=h,s[u.panelId]=h}else s[u.panelId]=void 0;const o=e.length-t;if(o!==0){const u=Cs((100-n)/o);for(const h of e)h.defaultSize===void 0&&(s[h.panelId]=u)}return s}function vN(e,t,n){const s=n[0];if(!s)return;const o=e.panels.find(h=>h.element===t);if(!o||!o.onResize)return;const u=Xl({group:e});o.onResize({asPercentage:Cs(s.inlineSize/u*100),inPixels:s.inlineSize},o.id)}function _N(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function yN(e){let t=!0;const n=new Set,s=new Set,o=new ResizeObserver(S=>{for(const C of S){const{borderBoxSize:w,target:y}=C;if(y===e.element){if(t){if(Xl({group:e})===0)return;ls(x=>{const v=x.mountedGroups.get(e);if(v){const b=jC(e),E=v.defaultLayoutDeferred?GC(b):v.layout,T=La({layout:E,panelConstraints:b});return!v.defaultLayoutDeferred&&_c(E,T)&&_N(v.derivedPanelConstraints,b)?x:{mountedGroups:new Map(x.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:b,layout:T,separatorToPanels:v.separatorToPanels})}}return x})}}else vN(e,y,w)}});o.observe(e.element),e.panels.forEach(S=>{Gt(!n.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),n.add(S.id),S.onResize&&o.observe(S.element)});const u=Xl({group:e}),h=jC(e),a=e.panels.map(({id:S})=>S).join(",");let l=e.defaultLayout;l&&e.panels.length!==Object.keys(l).length&&(l=void 0);const d=e.inMemoryLayouts[a]??l??GC(h),p=La({layout:d,panelConstraints:h}),f=SR(e),g=ls(S=>{const C=new Map;return f.forEach(w=>{w.separator&&C.set(w.separator,w.panels)}),{mountedGroups:new Map(S.mountedGroups).set(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:h,layout:p,separatorToPanels:C})}});return e.element.addEventListener("pointerleave",BC),e.separators.forEach(S=>{Gt(!s.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),s.add(S.id),S.element.addEventListener("keydown",zC)}),g.mountedGroups.size===1&&(window.addEventListener("pointerdown",UC),window.addEventListener("pointermove",WC),window.addEventListener("pointerup",qC)),function(){t=!1;const S=ls(C=>{const w=new Map(C.mountedGroups);return w.delete(e),{mountedGroups:w}});e.element.removeEventListener("pointerleave",BC),e.separators.forEach(C=>{C.element.removeEventListener("keydown",zC)}),S.mountedGroups.size===0&&(window.removeEventListener("pointerdown",UC),window.removeEventListener("pointermove",WC),window.removeEventListener("pointerup",qC)),o.disconnect()}}function X0(e){const t=R.useId();return`${e??t}`}const za=typeof window<"u"?R.useLayoutEffect:R.useEffect;function Q0(e){const t=R.useRef(e);return za(()=>{t.current=e},[e]),R.useCallback(n=>t.current?.(n),[t])}function Z0(...e){return Q0(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function bN(e){const t=R.useRef({...e});return za(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const MR="--react-resizable-panels--panel--pointer-events";function DR(e,t){const n=e.replace(/[^a-zA-Z0-9\-_]/g,""),s=t.replace(/[^a-zA-Z0-9\-_]/g,"");return`--react-resizable-panels--${n}--${s}`}const PR=R.createContext(null);function xN(e,t){const n=R.useRef({getLayout:()=>({}),setLayout:oN});R.useImperativeHandle(t,()=>n.current,[]),za(()=>{Object.assign(n.current,TR({groupId:e}))})}function SN({children:e,className:t,defaultLayout:n,disableCursor:s,disabled:o,elementRef:u,groupRef:h,id:a,onLayoutChange:l,orientation:d="horizontal",style:p,...f}){const g=R.useRef({}),S=Q0($=>{_c(g.current,$)||(g.current=$,l?.($))}),C=X0(a),[w,y]=R.useState(!1),[x,v]=R.useState(null),[b,E]=R.useState(n??{}),[T,A]=R.useState([]),[M,L]=R.useState([]),D=R.useRef({lastExpandedPanelSizes:{},layouts:{}}),H=Z0(v,u);xN(C,h);const z=R.useMemo(()=>({id:C,orientation:d,registerPanel:$=>(A(F=>b_(d,[...F,$])),()=>{A(F=>F.filter(G=>G!==$))}),registerSeparator:$=>(L(F=>b_(d,[...F,$])),()=>{L(F=>F.filter(G=>G!==$))})}),[C,d]),q=bN({defaultLayout:n,disableCursor:s}),j=R.useRef(null);za(()=>{if(x===null)return;const $={defaultLayout:q.defaultLayout,disableCursor:!!q.disableCursor,disabled:!!o,element:x,id:C,inMemoryLastExpandedPanelSizes:D.current.lastExpandedPanelSizes,inMemoryLayouts:D.current.layouts,orientation:d,panels:T,separators:M};j.current=$;const F=yN($),G=Ys().mountedGroups.get($);if(G){const{defaultLayoutDeferred:B,derivedPanelConstraints:I,layout:W}=G;!B&&I.length>0&&(E(W),S?.(W))}const U=xa.addListener("interactionStateChange",B=>{B.state==="active"?y(B.hitRegions.some(I=>I.group===$)):y(!1)}),P=xa.addListener("mountedGroupsChange",B=>{const I=B.get($);if(I){const{defaultLayoutDeferred:W,derivedPanelConstraints:Y,layout:J}=I;if(W||Y.length===0)return;E(J),S?.(J)}});return()=>{j.current=null,F(),U(),P()}},[o,x,C,S,d,T,M,q]),R.useEffect(()=>{const $=j.current;$&&($.defaultLayout=n,$.disableCursor=!!s)});const K={[MR]:w?"none":void 0};for(const $ in b){const F=DR(C,$),G=b[$];K[F]=G}return _.jsx(PR.Provider,{value:z,children:_.jsx("div",{...f,"aria-orientation":d,className:t,"data-group":!0,"data-testid":C,id:C,ref:H,style:{...p,...K,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}function J0(){const e=R.useContext(PR);return Gt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function CN({groupId:e,panelId:t}){const n=()=>{const{mountedGroups:a}=Ys();for(const[l,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:f,separatorToPanels:g}]of a)if(l.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:l,layout:f,separatorToPanels:g};throw Error(`Group ${e} not found`)},s=()=>{const a=n().derivedPanelConstraints.find(l=>l.panelId===t);if(a!==void 0)return a;throw Error(`Panel constraints not found for Panel ${t}`)},o=()=>{const a=n().group.panels.find(l=>l.id===t);if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},u=()=>{const a=n().layout[t];if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},h=a=>{const l=u();if(a===l)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:f,layout:g,separatorToPanels:S}=n(),C=f.panels.findIndex(v=>v.id===t),w=C===f.panels.length-1,y=Gu({delta:w?l-a:a-l,initialLayout:g,panelConstraints:p,pivotIndices:w?[C-1,C]:[C,C+1],prevLayout:g,trigger:"imperative-api"}),x=La({layout:y,panelConstraints:p});_c(g,x)||ls(v=>({mountedGroups:new Map(v.mountedGroups).set(f,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:x,separatorToPanels:S})}))};return{collapse:()=>{const{collapsible:a,collapsedSize:l}=s(),d=u();a&&d!==l&&h(l)},expand:()=>{const{collapsible:a,collapsedSize:l,minSize:d}=s(),p=u();a&&p===l&&h(d)},getSize:()=>{const{group:a}=n(),l=u(),{element:d}=o(),p=a.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:l,inPixels:p}},isCollapsed:()=>{const{collapsible:a,collapsedSize:l}=s(),d=u();return a&&or(l,d)},resize:a=>{if(u()!==a){let l;switch(typeof a){case"number":{const{group:d}=n(),p=Xl({group:d});l=Cs(a/p*100);break}case"string":{l=parseFloat(a);break}}h(l)}}}}function wN(e,t){const{id:n}=J0(),s=R.useRef({collapse:xv,expand:xv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:xv});R.useImperativeHandle(t,()=>s.current,[]),za(()=>{Object.assign(s.current,CN({groupId:n,panelId:e}))})}function EN({children:e,className:t,collapsedSize:n="0%",collapsible:s=!1,defaultSize:o,elementRef:u,id:h,maxSize:a="100%",minSize:l="0%",onResize:d,panelRef:p,style:f,...g}){const S=!!h,C=X0(h),[w,y]=R.useState(null),x=Z0(y,u),{id:v,registerPanel:b}=J0(),E=d!==null,T=Q0(M=>{d?.(M,h)});za(()=>{if(w!==null)return b({element:w,id:C,idIsStable:S,onResize:E?T:void 0,panelConstraints:{collapsedSize:n,collapsible:s,defaultSize:o,maxSize:a,minSize:l}})},[n,s,o,w,E,C,S,a,l,T,b]),wN(C,p);const A=DR(v,C);return _.jsx("div",{...g,"data-panel":!0,"data-testid":C,id:C,ref:x,style:{...kN,flexBasis:0,flexGrow:`var(${A}, 1)`,flexShrink:1,overflow:"hidden",pointerEvents:`var(${MR})`},children:_.jsx("div",{className:t,style:{width:"100%",height:"100%",...f},children:e})})}const kN={minHeight:"unset",maxHeight:"unset",height:"unset",minWidth:"unset",maxWidth:"unset",width:"unset",flex:"unset",flexBasis:"unset",flexShrink:"unset",flexGrow:"unset",border:"unset",borderWidth:"unset",padding:"unset",margin:"unset"};function RN({layout:e,panelConstraints:t,panelId:n,panelIndex:s}){let o,u;const h=e[n],a=t.find(l=>l.panelId===n);if(a){const l=a.maxSize,d=u=a.collapsible?a.collapsedSize:a.minSize,p=[s,s+1];u=La({layout:Gu({delta:d-h,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n],o=La({layout:Gu({delta:l-h,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n]}return{valueControls:n,valueMax:o,valueMin:u,valueNow:h}}function TN({children:e,className:t,elementRef:n,id:s,style:o,...u}){const h=X0(s),[a,l]=R.useState({}),[d,p]=R.useState("inactive"),[f,g]=R.useState(null),S=Z0(g,n),{id:C,orientation:w,registerSeparator:y}=J0(),x=w==="horizontal"?"vertical":"horizontal";return za(()=>{if(f!==null){const v={element:f,id:h},b=y(v),E=xa.addListener("interactionStateChange",A=>{p(A.state!=="inactive"&&A.hitRegions.some(M=>M.separator===v)?A.state:"inactive")}),T=xa.addListener("mountedGroupsChange",A=>{A.forEach(({derivedPanelConstraints:M,layout:L,separatorToPanels:D},H)=>{if(H.id===C){const z=D.get(v);if(z){const q=z[0],j=H.panels.indexOf(q);l(RN({layout:L,panelConstraints:M,panelId:q.id,panelIndex:j}))}}})});return()=>{E(),T(),b()}}},[f,C,h,y]),_.jsx("div",{...u,"aria-controls":a.valueControls,"aria-orientation":x,"aria-valuemax":a.valueMax,"aria-valuemin":a.valueMin,"aria-valuenow":a.valueNow,children:e,className:t,"data-separator":d,"data-testid":h,id:h,ref:S,role:"separator",style:{flexBasis:"auto",...o,flexGrow:0,flexShrink:0},tabIndex:0})}function ta({className:e,direction:t,...n}){return _.jsx(SN,{"data-slot":"resizable-panel-group",orientation:t,className:He("flex h-full w-full data-[orientation=vertical]:flex-col",e),...n})}function ts({...e}){return _.jsx(EN,{"data-slot":"resizable-panel",...e})}function na({withHandle:e,className:t,...n}){return _.jsx(TN,{"data-slot":"resizable-handle",className:He("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:translate-x-0 data-[orientation=vertical]:after:-translate-y-1/2 [&[data-orientation=vertical]>div]:rotate-90",t),...n,children:e&&_.jsx("div",{className:"bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"})})}var Cv={exports:{}},$C;function LN(){return $C||($C=1,(function(e,t){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(h,a,l){var d=this&&this.__decorate||function(v,b,E,T){var A,M=arguments.length,L=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,b,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(b,E,L):A(b,E))||L);return M>3&&L&&Object.defineProperty(b,E,L),L},p=this&&this.__param||function(v,b){return function(E,T){b(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const f=l(9042),g=l(9924),S=l(844),C=l(4725),w=l(2585),y=l(3656);let x=a.AccessibilityManager=class extends S.Disposable{constructor(v,b,E,T){super(),this._terminal=v,this._coreBrowserService=E,this._renderService=T,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 A=0;A<this._terminal.rows;A++)this._rowElements[A]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[A]);if(this._topBoundaryFocusListener=A=>this._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._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 g.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((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
22
+ `)))),this.register(this._terminal.onA11yTab((A=>this._handleTab(A)))),this.register(this._terminal.onKey((A=>this._handleKey(A.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,y.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(v){for(let b=0;b<v;b++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
23
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(v){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(v)||this._charsToConsume.push(v)}_refreshRows(v,b){this._liveRegionDebouncer.refresh(v,b,this._terminal.rows)}_renderRows(v,b){const E=this._terminal.buffer,T=E.lines.length.toString();for(let A=v;A<=b;A++){const M=E.lines.get(E.ydisp+A),L=[],D=M?.translateToString(!0,void 0,void 0,L)||"",H=(E.ydisp+A+1).toString(),z=this._rowElements[A];z&&(D.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=D,this._rowColumns.set(z,L)),z.setAttribute("aria-posinset",H),z.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,b){const E=v.target,T=this._rowElements[b===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==T)return;let A,M;if(b===0?(A=E,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(A=this._rowElements.shift(),M=E,this._rowContainer.removeChild(A)),A.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const L=this._createAccessibilityTreeNode();this._rowElements.unshift(L),this._rowContainer.insertAdjacentElement("afterbegin",L)}else{const L=this._createAccessibilityTreeNode();this._rowElements.push(L),this._rowContainer.appendChild(L)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const v=document.getSelection();if(!v)return;if(v.isCollapsed)return void(this._rowContainer.contains(v.anchorNode)&&this._terminal.clearSelection());if(!v.anchorNode||!v.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:v.anchorNode,offset:v.anchorOffset},E={node:v.focusNode,offset:v.focusOffset};if((b.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===E.node&&b.offset>E.offset)&&([b,E]=[E,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const T=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(T)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:T,offset:T.textContent?.length??0}),!this._rowContainer.contains(E.node))return;const A=({node:D,offset:H})=>{const z=D instanceof Text?D.parentNode:D;let q=parseInt(z?.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const j=this._rowColumns.get(z);if(!j)return console.warn("columns is null. Race condition?"),null;let K=H<j.length?j[H]:j.slice(-1)[0]+1;return K>=this._terminal.cols&&(++q,K=0),{row:q,column:K}},M=A(b),L=A(E);if(M&&L){if(M.row>L.row||M.row===L.row&&M.column>=L.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(L.row-M.row)*this._terminal.cols-M.column+L.column)}}_handleResize(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const v=this._coreBrowserService.mainDocument.createElement("div");return v.setAttribute("role","listitem"),v.tabIndex=-1,this._refreshRowDimensions(v),v}_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 v=0;v<this._terminal.rows;v++)this._refreshRowDimensions(this._rowElements[v])}}_refreshRowDimensions(v){v.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=x=d([p(1,w.IInstantiationService),p(2,C.ICoreBrowserService),p(3,C.IRenderService)],x)},3614:(h,a)=>{function l(g){return g.replace(/\r?\n/g,"\r")}function d(g,S){return S?"\x1B[200~"+g+"\x1B[201~":g}function p(g,S,C,w){g=d(g=l(g),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(g,!0),S.value=""}function f(g,S,C){const w=C.getBoundingClientRect(),y=g.clientX-w.left-10,x=g.clientY-w.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${y}px`,S.style.top=`${x}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=l,a.bracketTextForPaste=d,a.copyHandler=function(g,S){g.clipboardData&&g.clipboardData.setData("text/plain",S.selectionText),g.preventDefault()},a.handlePasteEvent=function(g,S,C,w){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),S,C,w)},a.paste=p,a.moveTextAreaUnderMouseCursor=f,a.rightClickHandler=function(g,S,C,w,y){f(g,S,C),y&&w.rightClickSelect(g),S.value=w.selectionText,S.select()}},7239:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const d=l(1505);a.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(p,f,g){this._css.set(p,f,g)}getCss(p,f){return this._css.get(p,f)}setColor(p,f,g){this._color.set(p,f,g)}getColor(p,f){return this._color.get(p,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(l,d,p,f){l.addEventListener(d,p,f);let g=!1;return{dispose:()=>{g||(g=!0,l.removeEventListener(d,p,f))}}}},3551:function(h,a,l){var d=this&&this.__decorate||function(x,v,b,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,v,b,E);else for(var L=x.length-1;L>=0;L--)(T=x[L])&&(M=(A<3?T(M):A>3?T(v,b,M):T(v,b))||M);return A>3&&M&&Object.defineProperty(v,b,M),M},p=this&&this.__param||function(x,v){return function(b,E){v(b,E,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const f=l(3656),g=l(8460),S=l(844),C=l(2585),w=l(4725);let y=a.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(x,v,b,E,T){super(),this._element=x,this._mouseService=v,this._renderService=b,this._bufferService=E,this._linkProviderService=T,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(x){this._lastMouseEvent=x;const v=this._positionFromMouseEvent(x,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const b=x.composedPath();for(let E=0;E<b.length;E++){const T=b[E];if(T.classList.contains("xterm"))break;if(T.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_handleHover(x){if(this._activeLine!==x.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(x,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,x)||(this._clearCurrentLink(),this._askForLink(x,!0))}_askForLink(x,v){this._activeProviderReplies&&v||(this._activeProviderReplies?.forEach((E=>{E?.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=x.y);let b=!1;for(const[E,T]of this._linkProviderService.linkProviders.entries())v?this._activeProviderReplies?.get(E)&&(b=this._checkLinkProviderResult(E,x,b)):T.provideLinks(x.y,(A=>{if(this._isMouseOut)return;const M=A?.map((L=>({link:L})));this._activeProviderReplies?.set(E,M),b=this._checkLinkProviderResult(E,x,b),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(x.y,this._activeProviderReplies)}))}_removeIntersectingLinks(x,v){const b=new Set;for(let E=0;E<v.size;E++){const T=v.get(E);if(T)for(let A=0;A<T.length;A++){const M=T[A],L=M.link.range.start.y<x?0:M.link.range.start.x,D=M.link.range.end.y>x?this._bufferService.cols:M.link.range.end.x;for(let H=L;H<=D;H++){if(b.has(H)){T.splice(A--,1);break}b.add(H)}}}}_checkLinkProviderResult(x,v,b){if(!this._activeProviderReplies)return b;const E=this._activeProviderReplies.get(x);let T=!1;for(let A=0;A<x;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(T=!0);if(!T&&E){const A=E.find((M=>this._linkAtPosition(M.link,v)));A&&(b=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let A=0;A<this._activeProviderReplies.size;A++){const M=this._activeProviderReplies.get(A)?.find((L=>this._linkAtPosition(L.link,v)));if(M){b=!0,this._handleNewLink(M);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(x){if(!this._currentLink)return;const v=this._positionFromMouseEvent(x,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(x,this._currentLink.link.text)}_clearCurrentLink(x,v){this._currentLink&&this._lastMouseEvent&&(!x||!v||this._currentLink.link.range.start.y>=x&&this._currentLink.link.range.end.y<=v)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(x){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(x.link,v)&&(this._currentLink=x,this._currentLink.state={decorations:{underline:x.link.decorations===void 0||x.link.decorations.underline,pointerCursor:x.link.decorations===void 0||x.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,x.link,this._lastMouseEvent),x.link.decorations={},Object.defineProperties(x.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:b=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:b=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(x.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const E=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(E,T),this._lastMouseEvent)){const A=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);A&&this._askForLink(A,!1)}}))))}_linkHover(x,v,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&x.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(b,v.text)}_fireUnderlineEvent(x,v){const b=x.range,E=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-E-1,b.end.x,b.end.y-E-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(x,v,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&x.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(b,v.text)}_linkAtPosition(x,v){const b=x.range.start.y*this._bufferService.cols+x.range.start.x,E=x.range.end.y*this._bufferService.cols+x.range.end.x,T=v.y*this._bufferService.cols+v.x;return b<=T&&T<=E}_positionFromMouseEvent(x,v,b){const E=b.getCoords(x,v,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(x,v,b,E,T){return{x1:x,y1:v,x2:b,y2:E,cols:this._bufferService.cols,fg:T}}};a.Linkifier=y=d([p(1,w.IMouseService),p(2,w.IRenderService),p(3,C.IBufferService),p(4,w.ILinkProviderService)],y)},9042:(h,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(h,a,l){var d=this&&this.__decorate||function(w,y,x,v){var b,E=arguments.length,T=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,x,v);else for(var A=w.length-1;A>=0;A--)(b=w[A])&&(T=(E<3?b(T):E>3?b(y,x,T):b(y,x))||T);return E>3&&T&&Object.defineProperty(y,x,T),T},p=this&&this.__param||function(w,y){return function(x,v){y(x,v,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const f=l(511),g=l(2585);let S=a.OscLinkProvider=class{constructor(w,y,x){this._bufferService=w,this._optionsService=y,this._oscLinkService=x}provideLinks(w,y){const x=this._bufferService.buffer.lines.get(w-1);if(!x)return void y(void 0);const v=[],b=this._optionsService.rawOptions.linkHandler,E=new f.CellData,T=x.getTrimmedLength();let A=-1,M=-1,L=!1;for(let D=0;D<T;D++)if(M!==-1||x.hasContent(D)){if(x.loadCell(D,E),E.hasExtendedAttrs()&&E.extended.urlId){if(M===-1){M=D,A=E.extended.urlId;continue}L=E.extended.urlId!==A}else M!==-1&&(L=!0);if(L||M!==-1&&D===T-1){const H=this._oscLinkService.getLinkData(A)?.uri;if(H){const z={start:{x:M+1,y:w},end:{x:D+(L||D!==T-1?0:1),y:w}};let q=!1;if(!b?.allowNonHttpProtocols)try{const j=new URL(H);["http:","https:"].includes(j.protocol)||(q=!0)}catch{q=!0}q||v.push({text:H,range:z,activate:(j,K)=>b?b.activate(j,K,z):C(0,K),hover:(j,K)=>b?.hover?.(j,K,z),leave:(j,K)=>b?.leave?.(j,K,z)})}L=!1,E.hasExtendedAttrs()&&E.extended.urlId?(M=D,A=E.extended.urlId):(M=-1,A=-1)}}y(v)}};function C(w,y){if(confirm(`Do you want to navigate to ${y}?
24
+
25
+ WARNING: This link could potentially be dangerous`)){const x=window.open();if(x){try{x.opener=null}catch{}x.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=S=d([p(0,g.IBufferService),p(1,g.IOptionsService),p(2,g.IOscLinkService)],S)},6193:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(l,d){this._renderCallback=l,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,d,p){this._rowCount=p,l=l!==void 0?l:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 l=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const d=l(3614),p=l(3656),f=l(3551),g=l(9042),S=l(3730),C=l(1680),w=l(3107),y=l(5744),x=l(2950),v=l(1296),b=l(428),E=l(4269),T=l(5114),A=l(8934),M=l(3230),L=l(9312),D=l(4725),H=l(6731),z=l(8055),q=l(8969),j=l(8460),K=l(844),$=l(6114),F=l(8437),G=l(2584),U=l(7399),P=l(5941),B=l(9074),I=l(2585),W=l(5435),Y=l(4567),J=l(779);class Z extends q.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(X={}){super(X),this.browser=$,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new j.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new j.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new j.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new j.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new j.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new j.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new j.EventEmitter),this._onBlur=this.register(new j.EventEmitter),this._onA11yCharEmitter=this.register(new j.EventEmitter),this._onA11yTabEmitter=this.register(new j.EventEmitter),this._onWillOpen=this.register(new j.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(J.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((V,se)=>this.refresh(V,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((V=>this._reportWindowsOptions(V)))),this.register(this._inputHandler.onColor((V=>this._handleColorEvent(V)))),this.register((0,j.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,j.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((V=>this._afterResize(V.cols,V.rows)))),this.register((0,K.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const V of X){let se,ne="";switch(V.index){case 256:se="foreground",ne="10";break;case 257:se="background",ne="11";break;case 258:se="cursor",ne="12";break;default:se="ansi",ne="4;"+V.index}switch(V.type){case 0:const re=z.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[V.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${ne};${(0,P.toRgbString)(re)}${G.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((oe=>oe.ansi[V.index]=z.channels.toColor(...V.color)));else{const oe=se;this._themeService.modifyColors((le=>le[oe]=z.channels.toColor(...V.color)))}break;case 2:this._themeService.restoreColor(V.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Y.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.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 X=this.buffer.ybase+this.buffer.y,V=this.buffer.lines.get(X);if(!V)return;const se=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,re=V.getWidth(se),oe=this._renderService.dimensions.css.cell.width*re,le=this.buffer.y*this._renderService.dimensions.css.cell.height,ve=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ve+"px",this.textarea.style.top=le+"px",this.textarea.style.width=oe+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(V=>{this.hasSelection()&&(0,d.copyHandler)(V,this._selectionService)})));const X=V=>(0,d.handlePasteEvent)(V,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,p.addDisposableDomListener)(this.element,"paste",X)),$.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(V=>{V.button===2&&(0,d.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(V=>{(0,d.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),$.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(V=>{V.button===1&&(0,d.moveTextAreaUnderMouseCursor)(V,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.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"),X.appendChild(this.element);const V=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),V.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,p.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),V.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),$.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(T.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(H.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(x.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(V);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.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(L.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),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(Y.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(v.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,V=this.element;function se(oe){const le=X._mouseService.getMouseReportCoords(oe,X.screenElement);if(!le)return!1;let ve,ue;switch(oe.overrideType||oe.type){case"mousemove":ue=32,oe.buttons===void 0?(ve=3,oe.button!==void 0&&(ve=oe.button<3?oe.button:3)):ve=1&oe.buttons?0:4&oe.buttons?1:2&oe.buttons?2:3;break;case"mouseup":ue=0,ve=oe.button<3?oe.button:3;break;case"mousedown":ue=1,ve=oe.button<3?oe.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(oe)===!1||X.viewport.getLinesScrolled(oe)===0)return!1;ue=oe.deltaY<0?0:1,ve=4;break;default:return!1}return!(ue===void 0||ve===void 0||ve>4)&&X.coreMouseService.triggerMouseEvent({col:le.col,row:le.row,x:le.x,y:le.y,button:ve,action:ue,ctrl:oe.ctrlKey,alt:oe.altKey,shift:oe.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},re={mouseup:oe=>(se(oe),oe.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(oe)),wheel:oe=>(se(oe),this.cancel(oe,!0)),mousedrag:oe=>{oe.buttons&&se(oe)},mousemove:oe=>{oe.buttons||se(oe)}};this.register(this.coreMouseService.onProtocolChange((oe=>{oe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(oe)),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&oe?ne.mousemove||(V.addEventListener("mousemove",re.mousemove),ne.mousemove=re.mousemove):(V.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&oe?ne.wheel||(V.addEventListener("wheel",re.wheel,{passive:!1}),ne.wheel=re.wheel):(V.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&oe?ne.mouseup||(ne.mouseup=re.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&oe?ne.mousedrag||(ne.mousedrag=re.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(V,"mousedown",(oe=>{if(oe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(oe))return se(oe),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(oe)}))),this.register((0,p.addDisposableDomListener)(V,"wheel",(oe=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(oe)===!1)return!1;if(!this.buffer.hasScrollback){const le=this.viewport.getLinesScrolled(oe);if(le===0)return;const ve=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(oe.deltaY<0?"A":"B");let ue="";for(let he=0;he<Math.abs(le);he++)ue+=ve;return this.coreService.triggerDataEvent(ue,!0),this.cancel(oe,!0)}return this.viewport.handleWheel(oe)?this.cancel(oe):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(V,"touchstart",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(oe),this.cancel(oe)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(V,"touchmove",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(oe)?void 0:this.cancel(oe)}),{passive:!1}))}refresh(X,V){this._renderService?.refreshRows(X,V)}updateCursorStyle(X){this._selectionService?.shouldColumnSelect(X)?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(X,V,se=0){se===1?(super.scrollLines(X,V,se),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(X)}paste(X){(0,d.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const V=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),V}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,V,se){this._selectionService.setSelection(X,V,se)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(X,V){this._selectionService?.selectLines(X,V)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const V=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!V&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;V||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,U.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),se.type===3||se.type===2){const ne=this.rows-1;return this.scrollLines(se.type===2?-ne:ne),this.cancel(X,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(se.cancel&&this.cancel(X,!0),!se.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==G.C0.ETX&&se.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,V){const se=X.isMac&&!this.options.macOptionIsMeta&&V.altKey&&!V.ctrlKey&&!V.metaKey||X.isWindows&&V.altKey&&V.ctrlKey&&!V.metaKey||X.isWindows&&V.getModifierState("AltGraph");return V.type==="keypress"?se:se&&(!V.keyCode||V.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(V){return V.keyCode===16||V.keyCode===17||V.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let V;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)V=X.charCode;else if(X.which===null||X.which===void 0)V=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;V=X.which}return!(!V||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(V=String.fromCharCode(V),this._onKey.fire({key:V,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(V,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const V=X.data;return this.coreService.triggerDataEvent(V,!0),this.cancel(X),!0}return!1}resize(X,V){X!==this.cols||V!==this.rows?super.resize(X,V):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,V){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let X=1;X<this.rows;X++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case W.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const V=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${se};${V}t`);break;case W.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),re=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${re};${ne}t`)}}cancel(X,V){if(this.options.cancelEvents||V)return X.preventDefault(),X.stopPropagation(),!1}}a.Terminal=Z},9924:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(l,d=1e3){this._renderCallback=l,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,d,p){this._rowCount=p,l=l!==void 0?l:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=f-this._lastRefreshMs,S=this._debounceThresholdMS-g;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 l=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,d)}}},1680:function(h,a,l){var d=this&&this.__decorate||function(x,v,b,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,v,b,E);else for(var L=x.length-1;L>=0;L--)(T=x[L])&&(M=(A<3?T(M):A>3?T(v,b,M):T(v,b))||M);return A>3&&M&&Object.defineProperty(v,b,M),M},p=this&&this.__param||function(x,v){return function(b,E){v(b,E,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const f=l(3656),g=l(4725),S=l(8460),C=l(844),w=l(2585);let y=a.Viewport=class extends C.Disposable{constructor(x,v,b,E,T,A,M,L){super(),this._viewportElement=x,this._scrollArea=v,this._bufferService=b,this._optionsService=E,this._charSizeService=T,this._renderService=A,this._coreBrowserService=M,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,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(L.colors),this.register(L.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(x){this._viewportElement.style.backgroundColor=x.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(x){if(x)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 v=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==v&&(this._lastRecordedBufferHeight=v,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const x=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==x&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=x),this._refreshAnimationFrame=null}syncScrollArea(x=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(x);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(x)}_handleScroll(x){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 v=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const x=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(x*(this._smoothScrollState.target-this._smoothScrollState.origin)),x<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(x,v){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(v<0&&this._viewportElement.scrollTop!==0||v>0&&b<this._lastRecordedBufferHeight)||(x.cancelable&&x.preventDefault(),!1)}handleWheel(x){const v=this._getPixelsScrolled(x);return v!==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+v:this._smoothScrollState.target+=v,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=v,this._bubbleScroll(x,v))}scrollLines(x){if(x!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const v=x*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+v,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!1})}_getPixelsScrolled(x){if(x.deltaY===0||x.shiftKey)return 0;let v=this._applyScrollModifier(x.deltaY,x);return x.deltaMode===WheelEvent.DOM_DELTA_LINE?v*=this._currentRowHeight:x.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._currentRowHeight*this._bufferService.rows),v}getBufferElements(x,v){let b,E="";const T=[],A=v??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let L=x;L<A;L++){const D=M.get(L);if(!D)continue;const H=M.get(L+1)?.isWrapped;if(E+=D.translateToString(!H),!H||L===M.length-1){const z=document.createElement("div");z.textContent=E,T.push(z),E.length>0&&(b=z),E=""}}return{bufferElements:T,cursorElement:b}}getLinesScrolled(x){if(x.deltaY===0||x.shiftKey)return 0;let v=this._applyScrollModifier(x.deltaY,x);return x.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(v/=this._currentRowHeight+0,this._wheelPartialScroll+=v,v=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):x.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._bufferService.rows),v}_applyScrollModifier(x,v){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&v.altKey||b==="ctrl"&&v.ctrlKey||b==="shift"&&v.shiftKey?x*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:x*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(x){this._lastTouchY=x.touches[0].pageY}handleTouchMove(x){const v=this._lastTouchY-x.touches[0].pageY;return this._lastTouchY=x.touches[0].pageY,v!==0&&(this._viewportElement.scrollTop+=v,this._bubbleScroll(x,v))}};a.Viewport=y=d([p(2,w.IBufferService),p(3,w.IOptionsService),p(4,g.ICharSizeService),p(5,g.IRenderService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],y)},3107:function(h,a,l){var d=this&&this.__decorate||function(w,y,x,v){var b,E=arguments.length,T=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,x,v);else for(var A=w.length-1;A>=0;A--)(b=w[A])&&(T=(E<3?b(T):E>3?b(y,x,T):b(y,x))||T);return E>3&&T&&Object.defineProperty(y,x,T),T},p=this&&this.__param||function(w,y){return function(x,v){y(x,v,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const f=l(4725),g=l(844),S=l(2585);let C=a.BufferDecorationRenderer=class extends g.Disposable{constructor(w,y,x,v,b){super(),this._screenElement=w,this._bufferService=y,this._coreBrowserService=x,this._decorationService=v,this._renderService=b,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((E=>this._removeDecoration(E)))),this.register((0,g.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 w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",w?.options?.layer==="top"),y.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const x=w.options.x??0;return x&&x>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(w,y),y}_refreshStyle(w){const y=w.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let x=this._decorationElements.get(w);x||(x=this._createElement(w),w.element=x,this._decorationElements.set(w,x),this._container.appendChild(x),w.onDispose((()=>{this._decorationElements.delete(w),x.remove()}))),x.style.top=y*this._renderService.dimensions.css.cell.height+"px",x.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(x)}}_refreshXPosition(w,y=w.element){if(!y)return;const x=w.options.x??0;(w.options.anchor||"left")==="right"?y.style.right=x?x*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=x?x*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){this._decorationElements.get(w)?.remove(),this._decorationElements.delete(w),w.dispose()}};a.BufferDecorationRenderer=C=d([p(1,S.IBufferService),p(2,f.ICoreBrowserService),p(3,S.IDecorationService),p(4,f.IRenderService)],C)},5871:(h,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(l){if(l.options.overviewRulerOptions){for(const d of this._zones)if(d.color===l.options.overviewRulerOptions.color&&d.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,l.marker.line))return;if(this._lineAdjacentToZone(d,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(d,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,d){return d>=l.startBufferLine&&d<=l.endBufferLine}_lineAdjacentToZone(l,d,p){return d>=l.startBufferLine-this._linePadding[p||"full"]&&d<=l.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(l,d){l.startBufferLine=Math.min(l.startBufferLine,d),l.endBufferLine=Math.max(l.endBufferLine,d)}}},5744:function(h,a,l){var d=this&&this.__decorate||function(b,E,T,A){var M,L=arguments.length,D=L<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,E,T,A);else for(var H=b.length-1;H>=0;H--)(M=b[H])&&(D=(L<3?M(D):L>3?M(E,T,D):M(E,T))||D);return L>3&&D&&Object.defineProperty(E,T,D),D},p=this&&this.__param||function(b,E){return function(T,A){E(T,A,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const f=l(5871),g=l(4725),S=l(844),C=l(2585),w={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0};let v=a.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,E,T,A,M,L,D){super(),this._viewportElement=b,this._screenElement=E,this._bufferService=T,this._decorationService=A,this._renderService=M,this._optionsService=L,this._coreBrowserService=D,this._colorZoneStore=new f.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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const H=this._canvas.getContext("2d");if(!H)throw new Error("Ctx cannot be null");this._ctx=H,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{this._canvas?.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 b=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=b,y.center=E,y.right=b,this._refreshDrawHeightConstants(),x.full=0,x.left=0,x.center=y.left,x.right=y.left+y.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);w.left=E,w.center=E,w.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.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 E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const E of b)E.position!=="full"&&this._renderColorZone(E);for(const E of b)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(x[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-w[b.position||"full"]/2),y[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[b.position||"full"]))}_queueRefresh(b,E){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=v=d([p(2,C.IBufferService),p(3,C.IDecorationService),p(4,g.IRenderService),p(5,C.IOptionsService),p(6,g.ICoreBrowserService)],v)},2950:function(h,a,l){var d=this&&this.__decorate||function(w,y,x,v){var b,E=arguments.length,T=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,x,v);else for(var A=w.length-1;A>=0;A--)(b=w[A])&&(T=(E<3?b(T):E>3?b(y,x,T):b(y,x))||T);return E>3&&T&&Object.defineProperty(y,x,T),T},p=this&&this.__param||function(w,y){return function(x,v){y(x,v,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const f=l(4725),g=l(2585),S=l(2584);let C=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,y,x,v,b,E){this._textarea=w,this._compositionView=y,this._bufferService=x,this._optionsService=v,this._coreService=b,this._renderService=E,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(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let x;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,x=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),x.length>0&&this._coreService.triggerDataEvent(x,!0)}}),0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,x=y.replace(w,"");this._dataAlreadySent=x,y.length>w.length?this._coreService.triggerDataEvent(x,!0):y.length<w.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):y.length===w.length&&y!==w&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),x=this._renderService.dimensions.css.cell.height,v=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=v+"px",this._compositionView.style.height=x+"px",this._compositionView.style.lineHeight=x+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px",this._textarea.style.top=v+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=C=d([p(2,g.IBufferService),p(3,g.IOptionsService),p(4,g.ICoreService),p(5,f.IRenderService)],C)},9806:(h,a)=>{function l(d,p,f){const g=f.getBoundingClientRect(),S=d.getComputedStyle(f),C=parseInt(S.getPropertyValue("padding-left")),w=parseInt(S.getPropertyValue("padding-top"));return[p.clientX-g.left-C,p.clientY-g.top-w]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=l,a.getCoords=function(d,p,f,g,S,C,w,y,x){if(!C)return;const v=l(d,p,f);return v?(v[0]=Math.ceil((v[0]+(x?w/2:0))/w),v[1]=Math.ceil(v[1]/y),v[0]=Math.min(Math.max(v[0],1),g+(x?1:0)),v[1]=Math.min(Math.max(v[1],1),S),v):void 0}},9504:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const d=l(2584);function p(y,x,v,b){const E=y-f(y,v),T=x-f(x,v),A=Math.abs(E-T)-(function(M,L,D){let H=0;const z=M-f(M,D),q=L-f(L,D);for(let j=0;j<Math.abs(z-q);j++){const K=g(M,L)==="A"?-1:1;D.buffer.lines.get(z+K*j)?.isWrapped&&H++}return H})(y,x,v);return w(A,C(g(y,x),b))}function f(y,x){let v=0,b=x.buffer.lines.get(y),E=b?.isWrapped;for(;E&&y>=0&&y<x.rows;)v++,b=x.buffer.lines.get(--y),E=b?.isWrapped;return v}function g(y,x){return y>x?"A":"B"}function S(y,x,v,b,E,T){let A=y,M=x,L="";for(;A!==v||M!==b;)A+=E?1:-1,E&&A>T.cols-1?(L+=T.buffer.translateBufferLineToString(M,!1,y,A),A=0,y=0,M++):!E&&A<0&&(L+=T.buffer.translateBufferLineToString(M,!1,0,y+1),A=T.cols-1,y=A,M--);return L+T.buffer.translateBufferLineToString(M,!1,y,A)}function C(y,x){const v=x?"O":"[";return d.C0.ESC+v+y}function w(y,x){y=Math.floor(y);let v="";for(let b=0;b<y;b++)v+=x;return v}a.moveToCellSequence=function(y,x,v,b){const E=v.buffer.x,T=v.buffer.y;if(!v.buffer.hasScrollback)return(function(L,D,H,z,q,j){return p(D,z,q,j).length===0?"":w(S(L,D,L,D-f(D,q),!1,q).length,C("D",j))})(E,T,0,x,v,b)+p(T,x,v,b)+(function(L,D,H,z,q,j){let K;K=p(D,z,q,j).length>0?z-f(z,q):D;const $=z,F=(function(G,U,P,B,I,W){let Y;return Y=p(P,B,I,W).length>0?B-f(B,I):U,G<P&&Y<=B||G>=P&&Y<B?"C":"D"})(L,D,H,z,q,j);return w(S(L,K,H,$,F==="C",q).length,C(F,j))})(E,T,y,x,v,b);let A;if(T===x)return A=E>y?"D":"C",w(Math.abs(E-y),C(A,b));A=T>x?"D":"C";const M=Math.abs(T-x);return w((function(L,D){return D.cols-L})(T>x?y:E,v)+(M-1)*v.cols+1+((T>x?E:y)-1),C(A,b))}},1296:function(h,a,l){var d=this&&this.__decorate||function(j,K,$,F){var G,U=arguments.length,P=U<3?K:F===null?F=Object.getOwnPropertyDescriptor(K,$):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(j,K,$,F);else for(var B=j.length-1;B>=0;B--)(G=j[B])&&(P=(U<3?G(P):U>3?G(K,$,P):G(K,$))||P);return U>3&&P&&Object.defineProperty(K,$,P),P},p=this&&this.__param||function(j,K){return function($,F){K($,F,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const f=l(3787),g=l(2550),S=l(2223),C=l(6171),w=l(6052),y=l(4725),x=l(8055),v=l(8460),b=l(844),E=l(2585),T="xterm-dom-renderer-owner-",A="xterm-rows",M="xterm-fg-",L="xterm-bg-",D="xterm-focus",H="xterm-selection";let z=1,q=a.DomRenderer=class extends b.Disposable{constructor(j,K,$,F,G,U,P,B,I,W,Y,J,Z){super(),this._terminal=j,this._document=K,this._element=$,this._screenElement=F,this._viewportElement=G,this._helperContainer=U,this._linkifier2=P,this._charSizeService=I,this._optionsService=W,this._bufferService=Y,this._coreBrowserService=J,this._themeService=Z,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new v.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(A),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(H),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ee=>this._injectCss(ee)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(T+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ee=>this._handleLinkHover(ee)))),this.register(this._linkifier2.onHideLinkUnderline((ee=>this._handleLinkLeave(ee)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(T+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 j=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*j,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*j),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/j),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/j),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 $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${A} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,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(j){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${A} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${A} .xterm-dim { color: ${x.color.multiplyOpacity(j.foreground,.5).css};}`,K+=`${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 $=`blink_underline_${this._terminalClass}`,F=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;K+=`@keyframes ${$} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${F} { 50% { box-shadow: none; }}`,K+=`@keyframes ${G} { 0% { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,K+=`${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${j.cursor.css} !important; color: ${j.cursorAccent.css} !important;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${H} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${H} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${H} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[U,P]of j.ansi.entries())K+=`${this._terminalSelector} .${M}${U} { color: ${P.css}; }${this._terminalSelector} .${M}${U}.xterm-dim { color: ${x.color.multiplyOpacity(P,.5).css}; }${this._terminalSelector} .${L}${U} { background-color: ${P.css}; }`;K+=`${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR} { color: ${x.color.opaque(j.background).css}; }${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${x.color.multiplyOpacity(x.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${L}${S.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const j=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${j}px`,this._rowFactory.defaultSpacing=j}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(j,K){for(let $=this._rowElements.length;$<=K;$++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,K){this._refreshRowElements(j,K),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(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(j,K,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,K,$),this.renderRows(0,this._bufferService.rows-1),!j||!K)return;this._selectionRenderModel.update(this._terminal,j,K,$);const F=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,P=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||P<0)return;const B=this._document.createDocumentFragment();if($){const I=j[0]>K[0];B.appendChild(this._createSelectionElement(U,I?K[0]:j[0],I?j[0]:K[0],P-U+1))}else{const I=F===U?j[0]:0,W=U===G?K[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(U,I,W));const Y=P-U-1;if(B.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,Y)),U!==P){const J=G===P?K[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(P,0,J))}}this._selectionContainer.appendChild(B)}_createSelectionElement(j,K,$,F=1){const G=this._document.createElement("div"),U=K*this.dimensions.css.cell.width;let P=this.dimensions.css.cell.width*($-K);return U+P>this.dimensions.css.canvas.width&&(P=this.dimensions.css.canvas.width-U),G.style.height=F*this.dimensions.css.cell.height+"px",G.style.top=j*this.dimensions.css.cell.height+"px",G.style.left=`${U}px`,G.style.width=`${P}px`,G}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 j of this._rowElements)j.replaceChildren()}renderRows(j,K){const $=this._bufferService.buffer,F=$.ybase+$.y,G=Math.min($.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,P=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=j;I<=K;I++){const W=I+$.ydisp,Y=this._rowElements[I],J=$.lines.get(W);if(!Y||!J)break;Y.replaceChildren(...this._rowFactory.createRow(J,W,W===F,P,B,G,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${this._terminalClass}`}_handleLinkHover(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!0)}_handleLinkLeave(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!1)}_setCellUnderline(j,K,$,F,G,U){$<0&&(j=0),F<0&&(K=0);const P=this._bufferService.rows-1;$=Math.max(Math.min($,P),0),F=Math.max(Math.min(F,P),0),G=Math.min(G,this._bufferService.cols);const B=this._bufferService.buffer,I=B.ybase+B.y,W=Math.min(B.x,G-1),Y=this._optionsService.rawOptions.cursorBlink,J=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=$;ee<=F;++ee){const X=ee+B.ydisp,V=this._rowElements[ee],se=B.lines.get(X);if(!V||!se)break;V.replaceChildren(...this._rowFactory.createRow(se,X,X===I,J,Z,W,Y,this.dimensions.css.cell.width,this._widthCache,U?ee===$?j:0:-1,U?(ee===F?K:G)-1:-1))}}};a.DomRenderer=q=d([p(7,E.IInstantiationService),p(8,y.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,y.ICoreBrowserService),p(12,y.IThemeService)],q)},3787:function(h,a,l){var d=this&&this.__decorate||function(A,M,L,D){var H,z=arguments.length,q=z<3?M:D===null?D=Object.getOwnPropertyDescriptor(M,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(A,M,L,D);else for(var j=A.length-1;j>=0;j--)(H=A[j])&&(q=(z<3?H(q):z>3?H(M,L,q):H(M,L))||q);return z>3&&q&&Object.defineProperty(M,L,q),q},p=this&&this.__param||function(A,M){return function(L,D){M(L,D,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const f=l(2223),g=l(643),S=l(511),C=l(2585),w=l(8055),y=l(4725),x=l(4269),v=l(6171),b=l(3734);let E=a.DomRendererRowFactory=class{constructor(A,M,L,D,H,z,q){this._document=A,this._characterJoinerService=M,this._optionsService=L,this._coreBrowserService=D,this._coreService=H,this._decorationService=z,this._themeService=q,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(A,M,L){this._selectionStart=A,this._selectionEnd=M,this._columnSelectMode=L}createRow(A,M,L,D,H,z,q,j,K,$,F){const G=[],U=this._characterJoinerService.getJoinedCharacters(M),P=this._themeService.colors;let B,I=A.getNoBgTrimmedLength();L&&I<z+1&&(I=z+1);let W=0,Y="",J=0,Z=0,ee=0,X=!1,V=0,se=!1,ne=0;const re=[],oe=$!==-1&&F!==-1;for(let le=0;le<I;le++){A.loadCell(le,this._workCell);let ve=this._workCell.getWidth();if(ve===0)continue;let ue=!1,he=le,de=this._workCell;if(U.length>0&&le===U[0][0]){ue=!0;const xe=U.shift();de=new x.JoinedCellData(this._workCell,A.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),he=xe[1]-1,ve=de.getWidth()}const Ne=this._isCellInSelection(le,M),Me=L&&le===z,Ae=oe&&le>=$&&le<=F;let be=!1;this._decorationService.forEachDecorationAtCell(le,M,void 0,(xe=>{be=!0}));let Oe=de.getChars()||g.WHITESPACE_CELL_CHAR;if(Oe===" "&&(de.isUnderline()||de.isOverline())&&(Oe=" "),ne=ve*j-K.get(Oe,de.isBold(),de.isItalic()),B){if(W&&(Ne&&se||!Ne&&!se&&de.bg===J)&&(Ne&&se&&P.selectionForeground||de.fg===Z)&&de.extended.ext===ee&&Ae===X&&ne===V&&!Me&&!ue&&!be){de.isInvisible()?Y+=g.WHITESPACE_CELL_CHAR:Y+=Oe,W++;continue}W&&(B.textContent=Y),B=this._document.createElement("span"),W=0,Y=""}else B=this._document.createElement("span");if(J=de.bg,Z=de.fg,ee=de.extended.ext,X=Ae,V=ne,se=Ne,ue&&z>=le&&z<=he&&(z=le),!this._coreService.isCursorHidden&&Me&&this._coreService.isCursorInitialized){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&re.push("xterm-cursor-blink"),re.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(H)switch(H){case"outline":re.push("xterm-cursor-outline");break;case"block":re.push("xterm-cursor-block");break;case"bar":re.push("xterm-cursor-bar");break;case"underline":re.push("xterm-cursor-underline")}}if(de.isBold()&&re.push("xterm-bold"),de.isItalic()&&re.push("xterm-italic"),de.isDim()&&re.push("xterm-dim"),Y=de.isInvisible()?g.WHITESPACE_CELL_CHAR:de.getChars()||g.WHITESPACE_CELL_CHAR,de.isUnderline()&&(re.push(`xterm-underline-${de.extended.underlineStyle}`),Y===" "&&(Y=" "),!de.isUnderlineColorDefault()))if(de.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(de.getUnderlineColor()).join(",")})`;else{let xe=de.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&de.isBold()&&xe<8&&(xe+=8),B.style.textDecorationColor=P.ansi[xe].css}de.isOverline()&&(re.push("xterm-overline"),Y===" "&&(Y=" ")),de.isStrikethrough()&&re.push("xterm-strikethrough"),Ae&&(B.style.textDecoration="underline");let me=de.getFgColor(),ke=de.getFgColorMode(),Ce=de.getBgColor(),qe=de.getBgColorMode();const De=!!de.isInverse();if(De){const xe=me;me=Ce,Ce=xe;const Ve=ke;ke=qe,qe=Ve}let Ie,rt,et,dt=!1;switch(this._decorationService.forEachDecorationAtCell(le,M,void 0,(xe=>{xe.options.layer!=="top"&&dt||(xe.backgroundColorRGB&&(qe=50331648,Ce=xe.backgroundColorRGB.rgba>>8&16777215,Ie=xe.backgroundColorRGB),xe.foregroundColorRGB&&(ke=50331648,me=xe.foregroundColorRGB.rgba>>8&16777215,rt=xe.foregroundColorRGB),dt=xe.options.layer==="top")})),!dt&&Ne&&(Ie=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,Ce=Ie.rgba>>8&16777215,qe=50331648,dt=!0,P.selectionForeground&&(ke=50331648,me=P.selectionForeground.rgba>>8&16777215,rt=P.selectionForeground)),dt&&re.push("xterm-decoration-top"),qe){case 16777216:case 33554432:et=P.ansi[Ce],re.push(`xterm-bg-${Ce}`);break;case 50331648:et=w.channels.toColor(Ce>>16,Ce>>8&255,255&Ce),this._addStyle(B,`background-color:#${T((Ce>>>0).toString(16),"0",6)}`);break;default:De?(et=P.foreground,re.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):et=P.background}switch(Ie||de.isDim()&&(Ie=w.color.multiplyOpacity(et,.5)),ke){case 16777216:case 33554432:de.isBold()&&me<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(me+=8),this._applyMinimumContrast(B,et,P.ansi[me],de,Ie,void 0)||re.push(`xterm-fg-${me}`);break;case 50331648:const xe=w.channels.toColor(me>>16&255,me>>8&255,255&me);this._applyMinimumContrast(B,et,xe,de,Ie,rt)||this._addStyle(B,`color:#${T(me.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,et,P.foreground,de,Ie,rt)||De&&re.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}re.length&&(B.className=re.join(" "),re.length=0),Me||ue||be?B.textContent=Y:W++,ne!==this.defaultSpacing&&(B.style.letterSpacing=`${ne}px`),G.push(B),le=he}return B&&W&&(B.textContent=Y),G}_applyMinimumContrast(A,M,L,D,H,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,v.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const q=this._getContrastCache(D);let j;if(H||z||(j=q.getColor(M.rgba,L.rgba)),j===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);j=w.color.ensureContrastRatio(H||M,z||L,K),q.setColor((H||M).rgba,(z||L).rgba,j??null)}return!!j&&(this._addStyle(A,`color:${j.css}`),!0)}_getContrastCache(A){return A.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(A,M){A.setAttribute("style",`${A.getAttribute("style")||""}${M};`)}_isCellInSelection(A,M){const L=this._selectionStart,D=this._selectionEnd;return!(!L||!D)&&(this._columnSelectMode?L[0]<=D[0]?A>=L[0]&&M>=L[1]&&A<D[0]&&M<=D[1]:A<L[0]&&M>=L[1]&&A>=D[0]&&M<=D[1]:M>L[1]&&M<D[1]||L[1]===D[1]&&M===L[1]&&A>=L[0]&&A<D[0]||L[1]<D[1]&&M===D[1]&&A<D[0]||L[1]<D[1]&&M===L[1]&&A>=L[0])}};function T(A,M,L){for(;A.length<L;)A=M+A;return A}a.DomRendererRowFactory=E=d([p(1,y.ICharacterJoinerService),p(2,C.IOptionsService),p(3,y.ICoreBrowserService),p(4,C.ICoreService),p(5,C.IDecorationService),p(6,y.IThemeService)],E)},2550:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(l,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.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 p=l.createElement("span");p.classList.add("xterm-char-measure-element");const f=l.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=l.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const S=l.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[p,f,g,S],this._container.appendChild(p),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(S),d.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(l,d,p,f){l===this._font&&d===this._fontSize&&p===this._weight&&f===this._weightBold||(this._font=l,this._fontSize=d,this._weight=p,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(l,d,p){let f=0;if(!d&&!p&&l.length===1&&(f=l.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const C=this._measure(l,0);return C>0&&(this._flat[f]=C),C}let g=l;d&&(g+="B"),p&&(g+="I");let S=this._holey.get(g);if(S===void 0){let C=0;d&&(C|=1),p&&(C|=2),S=this._measure(l,C),S>0&&this._holey.set(g,S)}return S}_measure(l,d){const p=this._measureElements[d];return p.textContent=l.repeat(32),p.offsetWidth/32}}},2223:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=l(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(h,a)=>{function l(p){return 57508<=p&&p<=57558}function d(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=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(p){if(!p)throw new Error("value must not be falsy");return p},a.isPowerlineGlyph=l,a.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},a.isEmoji=d,a.allowRescaling=function(p,f,g,S){return f===1&&g>Math.ceil(1.5*S)&&p!==void 0&&p>255&&!d(p)&&!l(p)&&!(function(C){return 57344<=C&&C<=63743})(p)},a.treatGlyphAsBackgroundColor=function(p){return l(p)||(function(f){return 9472<=f&&f<=9631})(p)},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(p,f,g=0){return(p-(2*Math.round(f)-g))%(2*Math.round(f))}},6052:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class l{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(p,f,g,S=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const C=p.buffers.active.ydisp,w=f[1]-C,y=g[1]-C,x=Math.max(w,0),v=Math.min(y,p.rows-1);x>=p.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=w,this.viewportEndRow=y,this.viewportCappedStartRow=x,this.viewportCappedEndRow=v,this.startCol=f[0],this.endCol=g[0])}isCellSelected(p,f,g){return!!this.hasSelection&&(g-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&g>=this.viewportCappedStartRow&&f<this.endCol&&g<=this.viewportCappedEndRow:f<this.startCol&&g>=this.viewportCappedStartRow&&f>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&f>=this.startCol)}}a.createSelectionRenderModel=function(){return new l}},456:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(l){this._bufferService=l,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 l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,d=this.selectionEnd;return!(!l||!d)&&(l[1]>d[1]||l[1]===d[1]&&l[0]>d[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(h,a,l){var d=this&&this.__decorate||function(v,b,E,T){var A,M=arguments.length,L=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,b,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(b,E,L):A(b,E))||L);return M>3&&L&&Object.defineProperty(b,E,L),L},p=this&&this.__param||function(v,b){return function(E,T){b(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const f=l(2585),g=l(8460),S=l(844);let C=a.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(v,b,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new x(this._optionsService))}catch{this._measureStrategy=this.register(new y(v,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const v=this._measureStrategy.measure();v.width===this.width&&v.height===this.height||(this.width=v.width,this.height=v.height,this._onCharSizeChange.fire())}};a.CharSizeService=C=d([p(2,f.IOptionsService)],C);class w extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,E){b!==void 0&&b>0&&E!==void 0&&E>0&&(this._result.width=b,this._result.height=E)}}class y extends w{constructor(b,E,T){super(),this._document=b,this._parentElement=E,this._optionsService=T,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 x extends w{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(h,a,l){var d=this&&this.__decorate||function(x,v,b,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,v,b,E);else for(var L=x.length-1;L>=0;L--)(T=x[L])&&(M=(A<3?T(M):A>3?T(v,b,M):T(v,b))||M);return A>3&&M&&Object.defineProperty(v,b,M),M},p=this&&this.__param||function(x,v){return function(b,E){v(b,E,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const f=l(3734),g=l(643),S=l(511),C=l(2585);class w extends f.AttributeData{constructor(v,b,E){super(),this.content=0,this.combinedData="",this.fg=v.fg,this.bg=v.bg,this.combinedData=b,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(v){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=w;let y=a.CharacterJoinerService=class IR{constructor(v){this._bufferService=v,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(v){const b={id:this._nextCharacterJoinerId++,handler:v};return this._characterJoiners.push(b),b.id}deregister(v){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===v)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(v){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(v);if(!b||b.length===0)return[];const E=[],T=b.translateToString(!0);let A=0,M=0,L=0,D=b.getFg(0),H=b.getBg(0);for(let z=0;z<b.getTrimmedLength();z++)if(b.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==D||this._workCell.bg!==H){if(z-A>1){const q=this._getJoinedRanges(T,L,M,b,A);for(let j=0;j<q.length;j++)E.push(q[j])}A=z,L=M,D=this._workCell.fg,H=this._workCell.bg}M+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-A>1){const z=this._getJoinedRanges(T,L,M,b,A);for(let q=0;q<z.length;q++)E.push(z[q])}return E}_getJoinedRanges(v,b,E,T,A){const M=v.substring(b,E);let L=[];try{L=this._characterJoiners[0].handler(M)}catch(D){console.error(D)}for(let D=1;D<this._characterJoiners.length;D++)try{const H=this._characterJoiners[D].handler(M);for(let z=0;z<H.length;z++)IR._mergeRanges(L,H[z])}catch(H){console.error(H)}return this._stringRangesToCellRanges(L,T,A),L}_stringRangesToCellRanges(v,b,E){let T=0,A=!1,M=0,L=v[T];if(L){for(let D=E;D<this._bufferService.cols;D++){const H=b.getWidth(D),z=b.getString(D).length||g.WHITESPACE_CELL_CHAR.length;if(H!==0){if(!A&&L[0]<=M&&(L[0]=D,A=!0),L[1]<=M){if(L[1]=D,L=v[++T],!L)break;L[0]<=M?(L[0]=D,A=!0):A=!1}M+=z}}L&&(L[1]=this._bufferService.cols)}}static _mergeRanges(v,b){let E=!1;for(let T=0;T<v.length;T++){const A=v[T];if(E){if(b[1]<=A[0])return v[T-1][1]=b[1],v;if(b[1]<=A[1])return v[T-1][1]=Math.max(b[1],A[1]),v.splice(T,1),v;v.splice(T,1),T--}else{if(b[1]<=A[0])return v.splice(T,0,b),v;if(b[1]<=A[1])return A[0]=Math.min(b[0],A[0]),v;b[0]<A[1]&&(A[0]=Math.min(b[0],A[0]),E=!0)}}return E?v[v.length-1][1]=b[1]:v.push(b),v}};a.CharacterJoinerService=y=d([p(0,C.IBufferService)],y)},5114:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const d=l(844),p=l(8460),f=l(3656);class g extends d.Disposable{constructor(w,y,x){super(),this._textarea=w,this._window=y,this.mainDocument=x,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((v=>this._screenDprMonitor.setWindow(v)))),this.register((0,p.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(w){this._window!==w&&(this._window=w,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=g;class S extends d.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const d=l(844);class p extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const S=this.linkProviders.indexOf(g);S!==-1&&this.linkProviders.splice(S,1)}}}}a.LinkProviderService=p},8934:function(h,a,l){var d=this&&this.__decorate||function(C,w,y,x){var v,b=arguments.length,E=b<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,w,y,x);else for(var T=C.length-1;T>=0;T--)(v=C[T])&&(E=(b<3?v(E):b>3?v(w,y,E):v(w,y))||E);return b>3&&E&&Object.defineProperty(w,y,E),E},p=this&&this.__param||function(C,w){return function(y,x){w(y,x,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const f=l(4725),g=l(9806);let S=a.MouseService=class{constructor(C,w){this._renderService=C,this._charSizeService=w}getCoords(C,w,y,x,v){return(0,g.getCoords)(window,C,w,y,x,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,v)}getMouseReportCoords(C,w){const y=(0,g.getCoordsRelativeToElement)(window,C,w);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};a.MouseService=S=d([p(0,f.IRenderService),p(1,f.ICharSizeService)],S)},3230:function(h,a,l){var d=this&&this.__decorate||function(v,b,E,T){var A,M=arguments.length,L=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,b,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(b,E,L):A(b,E))||L);return M>3&&L&&Object.defineProperty(b,E,L),L},p=this&&this.__param||function(v,b){return function(E,T){b(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const f=l(6193),g=l(4725),S=l(8460),C=l(844),w=l(7226),y=l(2585);let x=a.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,b,E,T,A,M,L,D){super(),this._rowCount=v,this._charSizeService=T,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new 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 f.RenderDebouncer(((H,z)=>this._renderRows(H,z)),L),this.register(this._renderDebouncer),this.register(L.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(A.onDecorationRegistered((()=>this._fullRefresh()))),this.register(A.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(L.window,b),this.register(L.onWindowChange((H=>this._registerIntersectionObserver(H,b))))}_registerIntersectionObserver(v,b){if("IntersectionObserver"in v){const E=new v.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});E.observe(b),this._observerDisposable.value=(0,C.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(v){this._isPaused=v.isIntersecting===void 0?v.intersectionRatio===0:!v.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(v,b,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,b,this._rowCount))}_renderRows(v,b){this._renderer.value&&(v=Math.min(v,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(v,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:v,end:b}),this._onRender.fire({start:v,end:b}),this._isNextRenderRedrawOnly=!0)}resize(v,b){this._rowCount=b,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(v){this._renderer.value=v,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(v){return this._renderDebouncer.addRefreshCallback(v)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(v,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(v,b))):this._renderer.value.handleResize(v,b),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(v,b,E){this._selectionState.start=v,this._selectionState.end=b,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(v,b,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};a.RenderService=x=d([p(2,y.IOptionsService),p(3,g.ICharSizeService),p(4,y.IDecorationService),p(5,y.IBufferService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],x)},9312:function(h,a,l){var d=this&&this.__decorate||function(L,D,H,z){var q,j=arguments.length,K=j<3?D:z===null?z=Object.getOwnPropertyDescriptor(D,H):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(L,D,H,z);else for(var $=L.length-1;$>=0;$--)(q=L[$])&&(K=(j<3?q(K):j>3?q(D,H,K):q(D,H))||K);return j>3&&K&&Object.defineProperty(D,H,K),K},p=this&&this.__param||function(L,D){return function(H,z){D(H,z,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const f=l(9806),g=l(9504),S=l(456),C=l(4725),w=l(8460),y=l(844),x=l(6114),v=l(4841),b=l(511),E=l(2585),T=" ",A=new RegExp(T,"g");let M=a.SelectionService=class extends y.Disposable{constructor(L,D,H,z,q,j,K,$,F){super(),this._element=L,this._screenElement=D,this._linkifier=H,this._bufferService=z,this._coreService=q,this._mouseService=j,this._optionsService=K,this._renderService=$,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((G=>this._handleTrim(G))),this.register(this._bufferService.buffers.onBufferActivate((G=>this._handleBufferActivate(G)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,y.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 L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!L||!D||L[0]===D[0]&&L[1]===D[1])}get selectionText(){const L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!L||!D)return"";const H=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(L[0]===D[0])return"";const q=L[0]<D[0]?L[0]:D[0],j=L[0]<D[0]?D[0]:L[0];for(let K=L[1];K<=D[1];K++){const $=H.translateBufferLineToString(K,!0,q,j);z.push($)}}else{const q=L[1]===D[1]?D[0]:void 0;z.push(H.translateBufferLineToString(L[1],!0,L[0],q));for(let j=L[1]+1;j<=D[1]-1;j++){const K=H.lines.get(j),$=H.translateBufferLineToString(j,!0);K?.isWrapped?z[z.length-1]+=$:z.push($)}if(L[1]!==D[1]){const j=H.lines.get(D[1]),K=H.translateBufferLineToString(D[1],!0,0,D[0]);j&&j.isWrapped?z[z.length-1]+=K:z.push(K)}}return z.map((q=>q.replace(A," "))).join(x.isWindows?`\r
26
+ `:`
27
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(L){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),x.isLinux&&L&&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(L){const D=this._getMouseBufferCoords(L),H=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(H&&z&&D)&&this._areCoordsInSelection(D,H,z)}isCellInSelection(L,D){const H=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!H||!z)&&this._areCoordsInSelection([L,D],H,z)}_areCoordsInSelection(L,D,H){return L[1]>D[1]&&L[1]<H[1]||D[1]===H[1]&&L[1]===D[1]&&L[0]>=D[0]&&L[0]<H[0]||D[1]<H[1]&&L[1]===H[1]&&L[0]<H[0]||D[1]<H[1]&&L[1]===D[1]&&L[0]>=D[0]}_selectWordAtCursor(L,D){const H=this._linkifier.currentLink?.link?.range;if(H)return this._model.selectionStart=[H.start.x-1,H.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(H,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(L);return!!z&&(this._selectWordAt(z,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(L,D){this._model.clearSelection(),L=Math.max(L,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,L],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(L){this._model.handleTrim(L)&&this.refresh()}_getMouseBufferCoords(L){const D=this._mouseService.getCoords(L,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(L){let D=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,L,this._screenElement)[1];const H=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=H?0:(D>H&&(D-=H),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(L){return x.isMac?L.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:L.shiftKey}handleMouseDown(L){if(this._mouseDownTimeStamp=L.timeStamp,(L.button!==2||!this.hasSelection)&&L.button===0){if(!this._enabled){if(!this.shouldForceSelection(L))return;L.stopPropagation()}L.preventDefault(),this._dragScrollAmount=0,this._enabled&&L.shiftKey?this._handleIncrementalClick(L):L.detail===1?this._handleSingleClick(L):L.detail===2?this._handleDoubleClick(L):L.detail===3&&this._handleTripleClick(L),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(L){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(L))}_handleSingleClick(L){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(L)?3:0,this._model.selectionStart=this._getMouseBufferCoords(L),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(L){this._selectWordAtCursor(L,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(L){const D=this._getMouseBufferCoords(L);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(L){return L.altKey&&!(x.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(L){if(L.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(L),!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(L),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const H=this._bufferService.buffer;if(this._model.selectionEnd[1]<H.lines.length){const z=H.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}D&&D[0]===this._model.selectionEnd[0]&&D[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 L=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(L.ydisp+this._bufferService.rows,L.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=L.ydisp),this.refresh()}}_handleMouseUp(L){const D=L.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&L.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const H=this._mouseService.getCoords(L,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(H&&H[0]!==void 0&&H[1]!==void 0){const z=(0,g.moveToCellSequence)(H[0]-1,H[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,H=!(!L||!D||L[0]===D[0]&&L[1]===D[1]);H?L&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&L[0]===this._oldSelectionStart[0]&&L[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(L,D,H)):this._oldHasSelection&&this._fireOnSelectionChange(L,D,H)}_fireOnSelectionChange(L,D,H){this._oldSelectionStart=L,this._oldSelectionEnd=D,this._oldHasSelection=H,this._onSelectionChange.fire()}_handleBufferActivate(L){this.clearSelection(),this._trimListener.dispose(),this._trimListener=L.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(L,D){let H=D;for(let z=0;D>=z;z++){const q=L.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?H--:q>1&&D!==z&&(H+=q-1)}return H}setSelection(L,D,H){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[L,D],this._model.selectionStartLength=H,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(L){this._isClickInSelection(L)||(this._selectWordAtCursor(L,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(L,D,H=!0,z=!0){if(L[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,j=q.lines.get(L[1]);if(!j)return;const K=q.translateBufferLineToString(L[1],!1);let $=this._convertViewportColToCharacterIndex(j,L[0]),F=$;const G=L[0]-$;let U=0,P=0,B=0,I=0;if(K.charAt($)===" "){for(;$>0&&K.charAt($-1)===" ";)$--;for(;F<K.length&&K.charAt(F+1)===" ";)F++}else{let J=L[0],Z=L[0];j.getWidth(J)===0&&(U++,J--),j.getWidth(Z)===2&&(P++,Z++);const ee=j.getString(Z).length;for(ee>1&&(I+=ee-1,F+=ee-1);J>0&&$>0&&!this._isCharWordSeparator(j.loadCell(J-1,this._workCell));){j.loadCell(J-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,J--):X>1&&(B+=X-1,$-=X-1),$--,J--}for(;Z<j.length&&F+1<K.length&&!this._isCharWordSeparator(j.loadCell(Z+1,this._workCell));){j.loadCell(Z+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(P++,Z++):X>1&&(I+=X-1,F+=X-1),F++,Z++}}F++;let W=$+G-U+B,Y=Math.min(this._bufferService.cols,F-$+U+P-B-I);if(D||K.slice($,F).trim()!==""){if(H&&W===0&&j.getCodePoint(0)!==32){const J=q.lines.get(L[1]-1);if(J&&j.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,L[1]-1],!1,!0,!1);if(Z){const ee=this._bufferService.cols-Z.start;W-=ee,Y+=ee}}}if(z&&W+Y===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const J=q.lines.get(L[1]+1);if(J?.isWrapped&&J.getCodePoint(0)!==32){const Z=this._getWordAt([0,L[1]+1],!1,!1,!0);Z&&(Y+=Z.length)}}return{start:W,length:Y}}}_selectWordAt(L,D){const H=this._getWordAt(L,D);if(H){for(;H.start<0;)H.start+=this._bufferService.cols,L[1]--;this._model.selectionStart=[H.start,L[1]],this._model.selectionStartLength=H.length}}_selectToWordAt(L){const D=this._getWordAt(L,!0);if(D){let H=L[1];for(;D.start<0;)D.start+=this._bufferService.cols,H--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,H++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,H]}}_isCharWordSeparator(L){return L.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(L.getChars())>=0}_selectLineAt(L){const D=this._bufferService.buffer.getWrappedRangeForLine(L),H={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,v.getRangeLength)(H,this._bufferService.cols)}};a.SelectionService=M=d([p(3,E.IBufferService),p(4,E.ICoreService),p(5,C.IMouseService),p(6,E.IOptionsService),p(7,C.IRenderService),p(8,C.ICoreBrowserService)],M)},4725:(h,a,l)=>{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 d=l(8343);a.ICharSizeService=(0,d.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),a.IMouseService=(0,d.createDecorator)("MouseService"),a.IRenderService=(0,d.createDecorator)("RenderService"),a.ISelectionService=(0,d.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,d.createDecorator)("ThemeService"),a.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(h,a,l){var d=this&&this.__decorate||function(M,L,D,H){var z,q=arguments.length,j=q<3?L:H===null?H=Object.getOwnPropertyDescriptor(L,D):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(M,L,D,H);else for(var K=M.length-1;K>=0;K--)(z=M[K])&&(j=(q<3?z(j):q>3?z(L,D,j):z(L,D))||j);return q>3&&j&&Object.defineProperty(L,D,j),j},p=this&&this.__param||function(M,L){return function(D,H){L(D,H,M)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const f=l(7239),g=l(8055),S=l(8460),C=l(844),w=l(2585),y=g.css.toColor("#ffffff"),x=g.css.toColor("#000000"),v=g.css.toColor("#ffffff"),b=g.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],L=[0,95,135,175,215,255];for(let D=0;D<216;D++){const H=L[D/36%6|0],z=L[D/6%6|0],q=L[D%6];M.push({css:g.channels.toCss(H,z,q),rgba:g.channels.toRgba(H,z,q)})}for(let D=0;D<24;D++){const H=8+10*D;M.push({css:g.channels.toCss(H,H,H),rgba:g.channels.toRgba(H,H,H)})}return M})());let T=a.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:x,cursor:v,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:g.color.blend(x,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:g.color.blend(x,E),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(M={}){const L=this._colors;if(L.foreground=A(M.foreground,y),L.background=A(M.background,x),L.cursor=A(M.cursor,v),L.cursorAccent=A(M.cursorAccent,b),L.selectionBackgroundTransparent=A(M.selectionBackground,E),L.selectionBackgroundOpaque=g.color.blend(L.background,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundTransparent=A(M.selectionInactiveBackground,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundOpaque=g.color.blend(L.background,L.selectionInactiveBackgroundTransparent),L.selectionForeground=M.selectionForeground?A(M.selectionForeground,g.NULL_COLOR):void 0,L.selectionForeground===g.NULL_COLOR&&(L.selectionForeground=void 0),g.color.isOpaque(L.selectionBackgroundTransparent)&&(L.selectionBackgroundTransparent=g.color.opacity(L.selectionBackgroundTransparent,.3)),g.color.isOpaque(L.selectionInactiveBackgroundTransparent)&&(L.selectionInactiveBackgroundTransparent=g.color.opacity(L.selectionInactiveBackgroundTransparent,.3)),L.ansi=a.DEFAULT_ANSI_COLORS.slice(),L.ansi[0]=A(M.black,a.DEFAULT_ANSI_COLORS[0]),L.ansi[1]=A(M.red,a.DEFAULT_ANSI_COLORS[1]),L.ansi[2]=A(M.green,a.DEFAULT_ANSI_COLORS[2]),L.ansi[3]=A(M.yellow,a.DEFAULT_ANSI_COLORS[3]),L.ansi[4]=A(M.blue,a.DEFAULT_ANSI_COLORS[4]),L.ansi[5]=A(M.magenta,a.DEFAULT_ANSI_COLORS[5]),L.ansi[6]=A(M.cyan,a.DEFAULT_ANSI_COLORS[6]),L.ansi[7]=A(M.white,a.DEFAULT_ANSI_COLORS[7]),L.ansi[8]=A(M.brightBlack,a.DEFAULT_ANSI_COLORS[8]),L.ansi[9]=A(M.brightRed,a.DEFAULT_ANSI_COLORS[9]),L.ansi[10]=A(M.brightGreen,a.DEFAULT_ANSI_COLORS[10]),L.ansi[11]=A(M.brightYellow,a.DEFAULT_ANSI_COLORS[11]),L.ansi[12]=A(M.brightBlue,a.DEFAULT_ANSI_COLORS[12]),L.ansi[13]=A(M.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),L.ansi[14]=A(M.brightCyan,a.DEFAULT_ANSI_COLORS[14]),L.ansi[15]=A(M.brightWhite,a.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const D=Math.min(L.ansi.length-16,M.extendedAnsi.length);for(let H=0;H<D;H++)L.ansi[H+16]=A(M.extendedAnsi[H],a.DEFAULT_ANSI_COLORS[H+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let L=0;L<this._restoreColors.ansi.length;++L)this._colors.ansi[L]=this._restoreColors.ansi[L]}modifyColors(M){M(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 A(M,L){if(M!==void 0)try{return g.css.toColor(M)}catch{}return L}a.ThemeService=T=d([p(0,w.IOptionsService)],T)},6349:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const d=l(8460),p=l(844);class f extends p.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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 C=new Array(S);for(let w=0;w<Math.min(S,this.length);w++)C[w]=this._array[this._getCyclicIndex(w)];this._array=C,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let C=this._length;C<S;C++)this._array[C]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,C){this._array[this._getCyclicIndex(S)]=C}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,C,...w){if(C){for(let y=S;y<this._length-C;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+C)];this._length-=C,this.onDeleteEmitter.fire({index:S,amount:C})}for(let y=this._length-1;y>=S;y--)this._array[this._getCyclicIndex(y+w.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<w.length;y++)this._array[this._getCyclicIndex(S+y)]=w[y];if(w.length&&this.onInsertEmitter.fire({index:S,amount:w.length}),this._length+w.length>this._maxLength){const y=this._length+w.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=w.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,C,w){if(!(C<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let x=C-1;x>=0;x--)this.set(S+x+w,this.get(S+x));const y=S+C+w-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<C;y++)this.set(S+y+w,this.get(S+y))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}a.CircularList=f},1439:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function l(d,p=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const g in d)f[g]=p<=1?d[g]:d[g]&&l(d[g],p-1);return f}},8055:(h,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 l=0,d=0,p=0,f=0;var g,S,C,w,y;function x(b){const E=b.toString(16);return E.length<2?"0"+E:E}function v(b,E){return b<E?(E+.05)/(b+.05):(b+.05)/(E+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(E,T,A,M){return M!==void 0?`#${x(E)}${x(T)}${x(A)}${x(M)}`:`#${x(E)}${x(T)}${x(A)}`},b.toRgba=function(E,T,A,M=255){return(E<<24|T<<16|A<<8|M)>>>0},b.toColor=function(E,T,A,M){return{css:b.toCss(E,T,A,M),rgba:b.toRgba(E,T,A,M)}}})(g||(a.channels=g={})),(function(b){function E(T,A){return f=Math.round(255*A),[l,d,p]=y.toChannels(T.rgba),{css:g.toCss(l,d,p,f),rgba:g.toRgba(l,d,p,f)}}b.blend=function(T,A){if(f=(255&A.rgba)/255,f===1)return{css:A.css,rgba:A.rgba};const M=A.rgba>>24&255,L=A.rgba>>16&255,D=A.rgba>>8&255,H=T.rgba>>24&255,z=T.rgba>>16&255,q=T.rgba>>8&255;return l=H+Math.round((M-H)*f),d=z+Math.round((L-z)*f),p=q+Math.round((D-q)*f),{css:g.toCss(l,d,p),rgba:g.toRgba(l,d,p)}},b.isOpaque=function(T){return(255&T.rgba)==255},b.ensureContrastRatio=function(T,A,M){const L=y.ensureContrastRatio(T.rgba,A.rgba,M);if(L)return g.toColor(L>>24&255,L>>16&255,L>>8&255)},b.opaque=function(T){const A=(255|T.rgba)>>>0;return[l,d,p]=y.toChannels(A),{css:g.toCss(l,d,p),rgba:A}},b.opacity=E,b.multiplyOpacity=function(T,A){return f=255&T.rgba,E(T,f*A/255)},b.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(S||(a.color=S={})),(function(b){let E,T;try{const A=document.createElement("canvas");A.width=1,A.height=1;const M=A.getContext("2d",{willReadFrequently:!0});M&&(E=M,E.globalCompositeOperation="copy",T=E.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return l=parseInt(A.slice(1,2).repeat(2),16),d=parseInt(A.slice(2,3).repeat(2),16),p=parseInt(A.slice(3,4).repeat(2),16),g.toColor(l,d,p);case 5:return l=parseInt(A.slice(1,2).repeat(2),16),d=parseInt(A.slice(2,3).repeat(2),16),p=parseInt(A.slice(3,4).repeat(2),16),f=parseInt(A.slice(4,5).repeat(2),16),g.toColor(l,d,p,f);case 7:return{css:A,rgba:(parseInt(A.slice(1),16)<<8|255)>>>0};case 9:return{css:A,rgba:parseInt(A.slice(1),16)>>>0}}const M=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return l=parseInt(M[1]),d=parseInt(M[2]),p=parseInt(M[3]),f=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),g.toColor(l,d,p,f);if(!E||!T)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=T,E.fillStyle=A,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[l,d,p,f]=E.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(l,d,p,f),css:A}}})(C||(a.css=C={})),(function(b){function E(T,A,M){const L=T/255,D=A/255,H=M/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(H<=.03928?H/12.92:Math.pow((H+.055)/1.055,2.4))}b.relativeLuminance=function(T){return E(T>>16&255,T>>8&255,255&T)},b.relativeLuminance2=E})(w||(a.rgb=w={})),(function(b){function E(A,M,L){const D=A>>24&255,H=A>>16&255,z=A>>8&255;let q=M>>24&255,j=M>>16&255,K=M>>8&255,$=v(w.relativeLuminance2(q,j,K),w.relativeLuminance2(D,H,z));for(;$<L&&(q>0||j>0||K>0);)q-=Math.max(0,Math.ceil(.1*q)),j-=Math.max(0,Math.ceil(.1*j)),K-=Math.max(0,Math.ceil(.1*K)),$=v(w.relativeLuminance2(q,j,K),w.relativeLuminance2(D,H,z));return(q<<24|j<<16|K<<8|255)>>>0}function T(A,M,L){const D=A>>24&255,H=A>>16&255,z=A>>8&255;let q=M>>24&255,j=M>>16&255,K=M>>8&255,$=v(w.relativeLuminance2(q,j,K),w.relativeLuminance2(D,H,z));for(;$<L&&(q<255||j<255||K<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),j=Math.min(255,j+Math.ceil(.1*(255-j))),K=Math.min(255,K+Math.ceil(.1*(255-K))),$=v(w.relativeLuminance2(q,j,K),w.relativeLuminance2(D,H,z));return(q<<24|j<<16|K<<8|255)>>>0}b.blend=function(A,M){if(f=(255&M)/255,f===1)return M;const L=M>>24&255,D=M>>16&255,H=M>>8&255,z=A>>24&255,q=A>>16&255,j=A>>8&255;return l=z+Math.round((L-z)*f),d=q+Math.round((D-q)*f),p=j+Math.round((H-j)*f),g.toRgba(l,d,p)},b.ensureContrastRatio=function(A,M,L){const D=w.relativeLuminance(A>>8),H=w.relativeLuminance(M>>8);if(v(D,H)<L){if(H<D){const j=E(A,M,L),K=v(D,w.relativeLuminance(j>>8));if(K<L){const $=T(A,M,L);return K>v(D,w.relativeLuminance($>>8))?j:$}return j}const z=T(A,M,L),q=v(D,w.relativeLuminance(z>>8));if(q<L){const j=E(A,M,L);return q>v(D,w.relativeLuminance(j>>8))?z:j}return z}},b.reduceLuminance=E,b.increaseLuminance=T,b.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]}})(y||(a.rgba=y={})),a.toPaddedHex=x,a.contrastRatio=v},8969:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const d=l(844),p=l(2585),f=l(4348),g=l(7866),S=l(744),C=l(7302),w=l(6975),y=l(8460),x=l(1753),v=l(1480),b=l(7994),E=l(9282),T=l(5435),A=l(5981),M=l(2660);let L=!1;class D extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((z=>{this._onScrollApi?.fire(z.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(z){for(const q in z)this.optionsService.options[q]=z[q]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new C.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(x.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(v.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.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((q=>{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((q=>{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 A.WriteBuffer(((q,j)=>this._inputHandler.parse(q,j)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,q){this._writeBuffer.write(z,q)}writeSync(z,q){this._logService.logLevel<=p.LogLevelEnum.WARN&&!L&&(this._logService.warn("writeSync is unreliable and will be removed soon."),L=!0),this._writeBuffer.writeSync(z,q)}input(z,q=!0){this.coreService.triggerDataEvent(z,q)}resize(z,q){isNaN(z)||isNaN(q)||(z=Math.max(z,S.MINIMUM_COLS),q=Math.max(q,S.MINIMUM_ROWS),this._bufferService.resize(z,q))}scroll(z,q=!1){this._bufferService.scroll(z,q)}scrollLines(z,q,j){this._bufferService.scrollLines(z,q,j)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const q=z-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler(z,q){return this._inputHandler.registerEscHandler(z,q)}registerDcsHandler(z,q){return this._inputHandler.registerDcsHandler(z,q)}registerCsiHandler(z,q){return this._inputHandler.registerCsiHandler(z,q)}registerOscHandler(z,q){return this._inputHandler.registerOscHandler(z,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?z=q.backend==="conpty"&&q.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const q of z)q.dispose()}))}}}a.CoreTerminal=D},8460:(h,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=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===l)return void this._listeners.splice(d,1)}}})),this._event}fire(l,d){const p=[];for(let f=0;f<this._listeners.length;f++)p.push(this._listeners[f]);for(let f=0;f<p.length;f++)p[f].call(void 0,l,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,d){return l((p=>d.fire(p)))},a.runAndSubscribe=function(l,d){return d(void 0),l((p=>d(p)))}},5435:function(h,a,l){var d=this&&this.__decorate||function(U,P,B,I){var W,Y=arguments.length,J=Y<3?P:I===null?I=Object.getOwnPropertyDescriptor(P,B):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(U,P,B,I);else for(var Z=U.length-1;Z>=0;Z--)(W=U[Z])&&(J=(Y<3?W(J):Y>3?W(P,B,J):W(P,B))||J);return Y>3&&J&&Object.defineProperty(P,B,J),J},p=this&&this.__param||function(U,P){return function(B,I){P(B,I,U)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const f=l(2584),g=l(7116),S=l(2015),C=l(844),w=l(482),y=l(8437),x=l(8460),v=l(643),b=l(511),E=l(3734),T=l(2585),A=l(1480),M=l(6242),L=l(6351),D=l(5941),H={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function q(U,P){if(U>24)return P.setWinLines||!1;switch(U){case 1:return!!P.restoreWin;case 2:return!!P.minimizeWin;case 3:return!!P.setWinPosition;case 4:return!!P.setWinSizePixels;case 5:return!!P.raiseWin;case 6:return!!P.lowerWin;case 7:return!!P.refreshWin;case 8:return!!P.setWinSizeChars;case 9:return!!P.maximizeWin;case 10:return!!P.fullscreenWin;case 11:return!!P.getWinState;case 13:return!!P.getWinPosition;case 14:return!!P.getWinSizePixels;case 15:return!!P.getScreenSizePixels;case 16:return!!P.getCellSizePixels;case 18:return!!P.getWinSizeChars;case 19:return!!P.getScreenSizeChars;case 20:return!!P.getIconTitle;case 21:return!!P.getWinTitle;case 22:return!!P.pushTitle;case 23:return!!P.popTitle;case 24:return!!P.setWinLines}return!1}var j;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(a.WindowsOptionsReportType=j={}));let K=0;class $ extends C.Disposable{getAttrData(){return this._curAttrData}constructor(P,B,I,W,Y,J,Z,ee,X=new S.EscapeSequenceParser){super(),this._bufferService=P,this._charsetService=B,this._coreService=I,this._logService=W,this._optionsService=Y,this._oscLinkService=J,this._coreMouseService=Z,this._unicodeService=ee,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new x.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new x.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new x.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new x.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new x.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new x.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new x.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new x.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new x.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new x.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new x.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new x.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 F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((V=>this._activeBuffer=V.activeBuffer))),this._parser.setCsiHandlerFallback(((V,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(V),params:se.toArray()})})),this._parser.setEscHandlerFallback((V=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(V)})})),this._parser.setExecuteHandlerFallback((V=>{this._logService.debug("Unknown EXECUTE code: ",{code:V})})),this._parser.setOscHandlerFallback(((V,se,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:V,action:se,data:ne})})),this._parser.setDcsHandlerFallback(((V,se,ne)=>{se==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(V),action:se,payload:ne})})),this._parser.setPrintHandler(((V,se,ne)=>this.print(V,se,ne))),this._parser.registerCsiHandler({final:"@"},(V=>this.insertChars(V))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(V=>this.scrollLeft(V))),this._parser.registerCsiHandler({final:"A"},(V=>this.cursorUp(V))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(V=>this.scrollRight(V))),this._parser.registerCsiHandler({final:"B"},(V=>this.cursorDown(V))),this._parser.registerCsiHandler({final:"C"},(V=>this.cursorForward(V))),this._parser.registerCsiHandler({final:"D"},(V=>this.cursorBackward(V))),this._parser.registerCsiHandler({final:"E"},(V=>this.cursorNextLine(V))),this._parser.registerCsiHandler({final:"F"},(V=>this.cursorPrecedingLine(V))),this._parser.registerCsiHandler({final:"G"},(V=>this.cursorCharAbsolute(V))),this._parser.registerCsiHandler({final:"H"},(V=>this.cursorPosition(V))),this._parser.registerCsiHandler({final:"I"},(V=>this.cursorForwardTab(V))),this._parser.registerCsiHandler({final:"J"},(V=>this.eraseInDisplay(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(V=>this.eraseInDisplay(V,!0))),this._parser.registerCsiHandler({final:"K"},(V=>this.eraseInLine(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(V=>this.eraseInLine(V,!0))),this._parser.registerCsiHandler({final:"L"},(V=>this.insertLines(V))),this._parser.registerCsiHandler({final:"M"},(V=>this.deleteLines(V))),this._parser.registerCsiHandler({final:"P"},(V=>this.deleteChars(V))),this._parser.registerCsiHandler({final:"S"},(V=>this.scrollUp(V))),this._parser.registerCsiHandler({final:"T"},(V=>this.scrollDown(V))),this._parser.registerCsiHandler({final:"X"},(V=>this.eraseChars(V))),this._parser.registerCsiHandler({final:"Z"},(V=>this.cursorBackwardTab(V))),this._parser.registerCsiHandler({final:"`"},(V=>this.charPosAbsolute(V))),this._parser.registerCsiHandler({final:"a"},(V=>this.hPositionRelative(V))),this._parser.registerCsiHandler({final:"b"},(V=>this.repeatPrecedingCharacter(V))),this._parser.registerCsiHandler({final:"c"},(V=>this.sendDeviceAttributesPrimary(V))),this._parser.registerCsiHandler({prefix:">",final:"c"},(V=>this.sendDeviceAttributesSecondary(V))),this._parser.registerCsiHandler({final:"d"},(V=>this.linePosAbsolute(V))),this._parser.registerCsiHandler({final:"e"},(V=>this.vPositionRelative(V))),this._parser.registerCsiHandler({final:"f"},(V=>this.hVPosition(V))),this._parser.registerCsiHandler({final:"g"},(V=>this.tabClear(V))),this._parser.registerCsiHandler({final:"h"},(V=>this.setMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(V=>this.setModePrivate(V))),this._parser.registerCsiHandler({final:"l"},(V=>this.resetMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(V=>this.resetModePrivate(V))),this._parser.registerCsiHandler({final:"m"},(V=>this.charAttributes(V))),this._parser.registerCsiHandler({final:"n"},(V=>this.deviceStatus(V))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(V=>this.deviceStatusPrivate(V))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(V=>this.softReset(V))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(V=>this.setCursorStyle(V))),this._parser.registerCsiHandler({final:"r"},(V=>this.setScrollRegion(V))),this._parser.registerCsiHandler({final:"s"},(V=>this.saveCursor(V))),this._parser.registerCsiHandler({final:"t"},(V=>this.windowOptions(V))),this._parser.registerCsiHandler({final:"u"},(V=>this.restoreCursor(V))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(V=>this.insertColumns(V))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(V=>this.deleteColumns(V))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(V=>this.selectProtected(V))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(V=>this.requestMode(V,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(V=>this.requestMode(V,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((V=>(this.setTitle(V),this.setIconName(V),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((V=>this.setIconName(V)))),this._parser.registerOscHandler(2,new M.OscHandler((V=>this.setTitle(V)))),this._parser.registerOscHandler(4,new M.OscHandler((V=>this.setOrReportIndexedColor(V)))),this._parser.registerOscHandler(8,new M.OscHandler((V=>this.setHyperlink(V)))),this._parser.registerOscHandler(10,new M.OscHandler((V=>this.setOrReportFgColor(V)))),this._parser.registerOscHandler(11,new M.OscHandler((V=>this.setOrReportBgColor(V)))),this._parser.registerOscHandler(12,new M.OscHandler((V=>this.setOrReportCursorColor(V)))),this._parser.registerOscHandler(104,new M.OscHandler((V=>this.restoreIndexedColor(V)))),this._parser.registerOscHandler(110,new M.OscHandler((V=>this.restoreFgColor(V)))),this._parser.registerOscHandler(111,new M.OscHandler((V=>this.restoreBgColor(V)))),this._parser.registerOscHandler(112,new M.OscHandler((V=>this.restoreCursorColor(V)))),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 V in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:V},(()=>this.selectCharset("("+V))),this._parser.registerEscHandler({intermediates:")",final:V},(()=>this.selectCharset(")"+V))),this._parser.registerEscHandler({intermediates:"*",final:V},(()=>this.selectCharset("*"+V))),this._parser.registerEscHandler({intermediates:"+",final:V},(()=>this.selectCharset("+"+V))),this._parser.registerEscHandler({intermediates:"-",final:V},(()=>this.selectCharset("-"+V))),this._parser.registerEscHandler({intermediates:".",final:V},(()=>this.selectCharset("."+V))),this._parser.registerEscHandler({intermediates:"/",final:V},(()=>this.selectCharset("/"+V)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((V=>(this._logService.error("Parsing error: ",V),V))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new L.DcsHandler(((V,se)=>this.requestStatusString(V,se))))}_preserveStack(P,B,I,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=P,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=I,this._parseStack.position=W}_logSlowResolvingAsync(P){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([P,new Promise(((B,I)=>setTimeout((()=>I("#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(P,B){let I,W=this._activeBuffer.x,Y=this._activeBuffer.y,J=0;const Z=this._parseStack.paused;if(Z){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(I),I;W=this._parseStack.cursorStartX,Y=this._parseStack.cursorStartY,this._parseStack.paused=!1,P.length>z&&(J=this._parseStack.position+z)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof P=="string"?` "${P}"`:` "${Array.prototype.map.call(P,(V=>String.fromCharCode(V))).join("")}"`),typeof P=="string"?P.split("").map((V=>V.charCodeAt(0))):P),this._parseBuffer.length<P.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(P.length,z))),Z||this._dirtyRowTracker.clearRange(),P.length>z)for(let V=J;V<P.length;V+=z){const se=V+z<P.length?V+z:P.length,ne=typeof P=="string"?this._stringDecoder.decode(P.substring(V,se),this._parseBuffer):this._utf8Decoder.decode(P.subarray(V,se),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(W,Y,ne,V),this._logSlowResolvingAsync(I),I}else if(!Z){const V=typeof P=="string"?this._stringDecoder.decode(P,this._parseBuffer):this._utf8Decoder.decode(P,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,V))return this._preserveStack(W,Y,V,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===W&&this._activeBuffer.y===Y||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(P,B,I){let W,Y;const J=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,V=this._coreService.modes.insertMode,se=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-B>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let re=this._parser.precedingJoinState;for(let oe=B;oe<I;++oe){if(W=P[oe],W<127&&J){const he=J[String.fromCharCode(W)];he&&(W=he.charCodeAt(0))}const le=this._unicodeService.charProperties(W,re);Y=A.UnicodeService.extractWidth(le);const ve=A.UnicodeService.extractShouldJoin(le),ue=ve?A.UnicodeService.extractWidth(re):0;if(re=le,Z&&this._onA11yChar.fire((0,w.stringFromCodePoint)(W)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Y-ue>ee){if(X){const he=ne;let de=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),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ue>0&&ne instanceof y.BufferLine&&ne.copyCellsFrom(he,de,0,ue,!1);de<ee;)he.setCellFromCodepoint(de++,0,1,se)}else if(this._activeBuffer.x=ee-1,Y===2)continue}if(ve&&this._activeBuffer.x){const he=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-he,W,Y);for(let de=Y-ue;--de>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(V&&(ne.insertCells(this._activeBuffer.x,Y-ue,this._activeBuffer.getNullCell(se)),ne.getWidth(ee-1)===2&&ne.setCellFromCodepoint(ee-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,se)),ne.setCellFromCodepoint(this._activeBuffer.x++,W,Y,se),Y>0)for(;--Y;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=re,this._activeBuffer.x<ee&&I-B>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(P,B){return P.final!=="t"||P.prefix||P.intermediates?this._parser.registerCsiHandler(P,B):this._parser.registerCsiHandler(P,(I=>!q(I.params[0],this._optionsService.rawOptions.windowOptions)||B(I)))}registerDcsHandler(P,B){return this._parser.registerDcsHandler(P,new L.DcsHandler(B))}registerEscHandler(P,B){return this._parser.registerEscHandler(P,B)}registerOscHandler(P,B){return this._parser.registerOscHandler(P,new M.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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const P=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-P),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(P=this._bufferService.cols-1){this._activeBuffer.x=Math.min(P,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(P,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=P,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=P,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(P,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+P,this._activeBuffer.y+B)}cursorUp(P){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,P.params[0]||1)):this._moveCursor(0,-(P.params[0]||1)),!0}cursorDown(P){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,P.params[0]||1)):this._moveCursor(0,P.params[0]||1),!0}cursorForward(P){return this._moveCursor(P.params[0]||1,0),!0}cursorBackward(P){return this._moveCursor(-(P.params[0]||1),0),!0}cursorNextLine(P){return this.cursorDown(P),this._activeBuffer.x=0,!0}cursorPrecedingLine(P){return this.cursorUp(P),this._activeBuffer.x=0,!0}cursorCharAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(P){return this._setCursor(P.length>=2?(P.params[1]||1)-1:0,(P.params[0]||1)-1),!0}charPosAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(P){return this._moveCursor(P.params[0]||1,0),!0}linePosAbsolute(P){return this._setCursor(this._activeBuffer.x,(P.params[0]||1)-1),!0}vPositionRelative(P){return this._moveCursor(0,P.params[0]||1),!0}hVPosition(P){return this.cursorPosition(P),!0}tabClear(P){const B=P.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=P.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=P.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(P){const B=P.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(P,B,I,W=!1,Y=!1){const J=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);J.replaceCells(B,I,this._activeBuffer.getNullCell(this._eraseAttrData()),Y),W&&(J.isWrapped=!1)}_resetBufferLine(P,B=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+P),I.isWrapped=!1)}eraseInDisplay(P,B=!1){let I;switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);I<this._bufferService.rows;I++)this._resetBufferLine(I,B);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,B);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(P,B=!1){switch(this._restrictCursor(this._bufferService.cols),P.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(P){this._restrictCursor();let B=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,W=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Y=this._bufferService.rows-1+this._activeBuffer.ybase-W+1;for(;B--;)this._activeBuffer.lines.splice(Y-1,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(P){this._restrictCursor();let B=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let W;for(W=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-W;B--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(W,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(P){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(P){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(P){let B=P.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(P){let B=P.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(y.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);W.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);W.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);W.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);W.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(P){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(P.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(P){const B=this._parser.precedingJoinState;if(!B)return!0;const I=P.params[0]||1,W=A.UnicodeService.extractWidth(B),Y=this._activeBuffer.x-W,J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Y),Z=new Uint32Array(J.length*I);let ee=0;for(let V=0;V<J.length;){const se=J.codePointAt(V)||0;Z[ee++]=se,V+=se>65535?2:1}let X=ee;for(let V=1;V<I;++V)Z.copyWithin(X,0,ee),X+=ee;return this.print(Z,0,X),!0}sendDeviceAttributesPrimary(P){return P.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(P){return P.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(P.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(P){return(this._optionsService.rawOptions.termName+"").indexOf(P)===0}setMode(P){for(let B=0;B<P.length;B++)switch(P.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(P){for(let B=0;B<P.length;B++)switch(P.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(P){for(let B=0;B<P.length;B++)switch(P.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(P){for(let B=0;B<P.length;B++)switch(P.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(),P.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(P,B){const I=this._coreService.decPrivateModes,{activeProtocol:W,activeEncoding:Y}=this._coreMouseService,J=this._coreService,{buffers:Z,cols:ee}=this._bufferService,{active:X,alt:V}=Z,se=this._optionsService.rawOptions,ne=ve=>ve?1:2,re=P.params[0];return oe=re,le=B?re===2?4:re===4?ne(J.modes.insertMode):re===12?3:re===20?ne(se.convertEol):0:re===1?ne(I.applicationCursorKeys):re===3?se.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:re===6?ne(I.origin):re===7?ne(I.wraparound):re===8?3:re===9?ne(W==="X10"):re===12?ne(se.cursorBlink):re===25?ne(!J.isCursorHidden):re===45?ne(I.reverseWraparound):re===66?ne(I.applicationKeypad):re===67?4:re===1e3?ne(W==="VT200"):re===1002?ne(W==="DRAG"):re===1003?ne(W==="ANY"):re===1004?ne(I.sendFocus):re===1005?4:re===1006?ne(Y==="SGR"):re===1015?4:re===1016?ne(Y==="SGR_PIXELS"):re===1048?1:re===47||re===1047||re===1049?ne(X===V):re===2004?ne(I.bracketedPasteMode):0,J.triggerDataEvent(`${f.C0.ESC}[${B?"":"?"}${oe};${le}$y`),!0;var oe,le}_updateAttrColor(P,B,I,W,Y){return B===2?(P|=50331648,P&=-16777216,P|=E.AttributeData.fromColorRGB([I,W,Y])):B===5&&(P&=-50331904,P|=33554432|255&I),P}_extractColor(P,B,I){const W=[0,0,-1,0,0,0];let Y=0,J=0;do{if(W[J+Y]=P.params[B+J],P.hasSubParams(B+J)){const Z=P.getSubParams(B+J);let ee=0;do W[1]===5&&(Y=1),W[J+ee+1+Y]=Z[ee];while(++ee<Z.length&&ee+J+1+Y<W.length);break}if(W[1]===5&&J+Y>=2||W[1]===2&&J+Y>=5)break;W[1]&&(Y=1)}while(++J+B<P.length&&J+Y<W.length);for(let Z=2;Z<W.length;++Z)W[Z]===-1&&(W[Z]=0);switch(W[0]){case 38:I.fg=this._updateAttrColor(I.fg,W[1],W[3],W[4],W[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,W[1],W[3],W[4],W[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,W[1],W[3],W[4],W[5])}return J}_processUnderline(P,B){B.extended=B.extended.clone(),(!~P||P>5)&&(P=1),B.extended.underlineStyle=P,B.fg|=268435456,P===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(P){P.fg=y.DEFAULT_ATTR_DATA.fg,P.bg=y.DEFAULT_ATTR_DATA.bg,P.extended=P.extended.clone(),P.extended.underlineStyle=0,P.extended.underlineColor&=-67108864,P.updateExtended()}charAttributes(P){if(P.length===1&&P.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=P.length;let I;const W=this._curAttrData;for(let Y=0;Y<B;Y++)I=P.params[Y],I>=30&&I<=37?(W.fg&=-50331904,W.fg|=16777216|I-30):I>=40&&I<=47?(W.bg&=-50331904,W.bg|=16777216|I-40):I>=90&&I<=97?(W.fg&=-50331904,W.fg|=16777224|I-90):I>=100&&I<=107?(W.bg&=-50331904,W.bg|=16777224|I-100):I===0?this._processSGR0(W):I===1?W.fg|=134217728:I===3?W.bg|=67108864:I===4?(W.fg|=268435456,this._processUnderline(P.hasSubParams(Y)?P.getSubParams(Y)[0]:1,W)):I===5?W.fg|=536870912:I===7?W.fg|=67108864:I===8?W.fg|=1073741824:I===9?W.fg|=2147483648:I===2?W.bg|=134217728:I===21?this._processUnderline(2,W):I===22?(W.fg&=-134217729,W.bg&=-134217729):I===23?W.bg&=-67108865:I===24?(W.fg&=-268435457,this._processUnderline(0,W)):I===25?W.fg&=-536870913:I===27?W.fg&=-67108865:I===28?W.fg&=-1073741825:I===29?W.fg&=2147483647:I===39?(W.fg&=-67108864,W.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):I===49?(W.bg&=-67108864,W.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?Y+=this._extractColor(P,Y,W):I===53?W.bg|=1073741824:I===55?W.bg&=-1073741825:I===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):I===100?(W.fg&=-67108864,W.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(P){switch(P.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${B};${I}R`)}return!0}deviceStatusPrivate(P){if(P.params[0]===6){const B=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${B};${I}R`)}return!0}softReset(P){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.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(P){const B=P.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 I=B%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(P){const B=P.params[0]||1;let I;return(P.length<2||(I=P.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(P){if(!q(P.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=P.length>1?P.params[1]:0;switch(P.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(j.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(j.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.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(P){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(P){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(P){return this._windowTitle=P,this._onTitleChange.fire(P),!0}setIconName(P){return this._iconName=P,!0}setOrReportIndexedColor(P){const B=[],I=P.split(";");for(;I.length>1;){const W=I.shift(),Y=I.shift();if(/^\d+$/.exec(W)){const J=parseInt(W);if(G(J))if(Y==="?")B.push({type:0,index:J});else{const Z=(0,D.parseColor)(Y);Z&&B.push({type:1,index:J,color:Z})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(P){const B=P.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(P,B){this._getCurrentLinkId()&&this._finishHyperlink();const I=P.split(":");let W;const Y=I.findIndex((J=>J.startsWith("id=")));return Y!==-1&&(W=I[Y].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,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(P,B){const I=P.split(";");for(let W=0;W<I.length&&!(B>=this._specialColors.length);++W,++B)if(I[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const Y=(0,D.parseColor)(I[W]);Y&&this._onColor.fire([{type:1,index:this._specialColors[B],color:Y}])}return!0}setOrReportFgColor(P){return this._setOrReportSpecialColor(P,0)}setOrReportBgColor(P){return this._setOrReportSpecialColor(P,1)}setOrReportCursorColor(P){return this._setOrReportSpecialColor(P,2)}restoreIndexedColor(P){if(!P)return this._onColor.fire([{type:2}]),!0;const B=[],I=P.split(";");for(let W=0;W<I.length;++W)if(/^\d+$/.exec(I[W])){const Y=parseInt(I[W]);G(Y)&&B.push({type:2,index:Y})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(P){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(P){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(P){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,g.DEFAULT_CHARSET),!0}selectCharset(P){return P.length!==2?(this.selectDefaultCharset(),!0):(P[0]==="/"||this._charsetService.setgCharset(H[P[0]],g.CHARSETS[P[1]]||g.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 P=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,P,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=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(P){return this._charsetService.setgLevel(P),!0}screenAlignmentPattern(){const P=new b.CellData;P.content=4194373,P.fg=this._curAttrData.fg,P.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const I=this._activeBuffer.ybase+this._activeBuffer.y+B,W=this._activeBuffer.lines.get(I);W&&(W.fill(P),W.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(P,B){const I=this._bufferService.buffer,W=this._optionsService.rawOptions;return(Y=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${Y}${f.C0.ESC}\\`),!0))(P==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:P==='"p'?'P1$r61;1"p':P==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:P==="m"?"P1$r0m":P===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(P,B){this._dirtyRowTracker.markRangeDirty(P,B)}}a.InputHandler=$;let F=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,P){U>P&&(K=U,U=P,P=K),U<this.start&&(this.start=U),P>this.end&&(this.end=P)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(U){return 0<=U&&U<256}F=d([p(0,T.IBufferService)],F)},844:(h,a)=>{function l(d){for(const p of d)p.dispose();d.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 d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const p=this._disposables.indexOf(d);p!==-1&&this._disposables.splice(p,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){this._isDisposed||d===this._value||(this._value?.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},a.toDisposable=function(d){return{dispose:d}},a.disposeArray=l,a.getDisposeArrayDisposable=function(d){return{dispose:()=>l(d)}}},1505:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(p,f,g){this._data[p]||(this._data[p]={}),this._data[p][f]=g}get(p,f){return this._data[p]?this._data[p][f]:void 0}clear(){this._data={}}}a.TwoKeyMap=l,a.FourKeyMap=class{constructor(){this._data=new l}set(d,p,f,g,S){this._data.get(d,p)||this._data.set(d,p,new l),this._data.get(d,p).set(f,g,S)}get(d,p,f,g){return this._data.get(d,p)?.get(f,g)}clear(){this._data.clear()}}},6114:(h,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 l=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=l.includes("Firefox"),a.isLegacyEdge=l.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(l),a.getSafariVersion=function(){if(!a.isSafari)return 0;const p=l.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(l)},6106:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let l=0;a.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(l=this._search(this._getKey(d)),this._array.splice(l,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const p=this._getKey(d);if(p===void 0||(l=this._search(p),l===-1)||this._getKey(this._array[l])!==p)return!1;do if(this._array[l]===d)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===p);return!1}*getKeyIterator(d){if(this._array.length!==0&&(l=this._search(d),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===d))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===d)}forEachByKey(d,p){if(this._array.length!==0&&(l=this._search(d),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===d))do p(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===d)}values(){return[...this._array].values()}_search(d){let p=0,f=this._array.length-1;for(;f>=p;){let g=p+f>>1;const S=this._getKey(this._array[g]);if(S>d)f=g-1;else{if(!(S<d)){for(;g>0&&this._getKey(this._array[g-1])===d;)g--;return g}p=g+1}}return p}}},7226:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=l(6114);class p{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 C=0,w=0,y=S.timeRemaining(),x=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),w=Math.max(C,w),x=S.timeRemaining(),1.5*w>x)return y-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-C))}ms`),void this._start();y=x}this.clear()}}class f extends p{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const C=Date.now()+S;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}a.PriorityTaskQueue=f,a.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:f,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const d=l(643);a.updateWindowsModeWrappedState=function(p){const f=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),g=f?.get(p.cols-1),S=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);S&&g&&(S.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new l;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}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=l;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,g=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=d},9092:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const d=l(6349),p=l(7226),f=l(3734),g=l(8437),S=l(4634),C=l(511),w=l(643),y=l(4863),x=l(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(v,b,E){this._hasScrollback=v,this._optionsService=b,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=x.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(v){return v?(this._nullCell.fg=v.fg,this._nullCell.bg=v.bg,this._nullCell.extended=v.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(v){return v?(this._whitespaceCell.fg=v.fg,this._whitespaceCell.bg=v.bg,this._whitespaceCell.extended=v.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(v,b){return new g.BufferLine(this._bufferService.cols,this.getNullCell(v),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const v=this.ybase+this.y-this.ydisp;return v>=0&&v<this._rows}_getCorrectBufferLength(v){if(!this._hasScrollback)return v;const b=v+this._optionsService.rawOptions.scrollback;return b>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:b}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=g.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(v))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(v,b){const E=this.getNullCell(g.DEFAULT_ATTR_DATA);let T=0;const A=this._getCorrectBufferLength(b);if(A>this.lines.maxLength&&(this.lines.maxLength=A),this.lines.length>0){if(this._cols<v)for(let L=0;L<this.lines.length;L++)T+=+this.lines.get(L).resize(v,E);let M=0;if(this._rows<b)for(let L=this._rows;L<b;L++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(v,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(v,E)));else for(let L=this._rows;L>b;L--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(A<this.lines.maxLength){const L=this.lines.length-A;L>0&&(this.lines.trimStart(L),this.ybase=Math.max(this.ybase-L,0),this.ydisp=Math.max(this.ydisp-L,0),this.savedY=Math.max(this.savedY-L,0)),this.lines.maxLength=A}this.x=Math.min(this.x,v-1),this.y=Math.min(this.y,b-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(v,b),this._cols>v))for(let M=0;M<this.lines.length;M++)T+=+this.lines.get(M).resize(v,E);this._cols=v,this._rows=b,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let v=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,v=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return v}get _isReflowEnabled(){const v=this._optionsService.rawOptions.windowsPty;return v&&v.buildNumber?this._hasScrollback&&v.backend==="conpty"&&v.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(v,b){this._cols!==v&&(v>this._cols?this._reflowLarger(v,b):this._reflowSmaller(v,b))}_reflowLarger(v,b){const E=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,v,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(E.length>0){const T=(0,S.reflowLargerCreateNewLayout)(this.lines,E);(0,S.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(v,b,T.countRemoved)}}_reflowLargerAdjustViewport(v,b,E){const T=this.getNullCell(g.DEFAULT_ATTR_DATA);let A=E;for(;A-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new g.BufferLine(v,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(v,b){const E=this.getNullCell(g.DEFAULT_ATTR_DATA),T=[];let A=0;for(let M=this.lines.length-1;M>=0;M--){let L=this.lines.get(M);if(!L||!L.isWrapped&&L.getTrimmedLength()<=v)continue;const D=[L];for(;L.isWrapped&&M>0;)L=this.lines.get(--M),D.unshift(L);const H=this.ybase+this.y;if(H>=M&&H<M+D.length)continue;const z=D[D.length-1].getTrimmedLength(),q=(0,S.reflowSmallerGetNewLineLengths)(D,this._cols,v),j=q.length-D.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+j):Math.max(0,this.lines.length-this.lines.maxLength+j);const $=[];for(let I=0;I<j;I++){const W=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);$.push(W)}$.length>0&&(T.push({start:M+D.length+A,newLines:$}),A+=$.length),D.push(...$);let F=q.length-1,G=q[F];G===0&&(F--,G=q[F]);let U=D.length-j-1,P=z;for(;U>=0;){const I=Math.min(P,G);if(D[F]===void 0)break;if(D[F].copyCellsFrom(D[U],P-I,G-I,I,!0),G-=I,G===0&&(F--,G=q[F]),P-=I,P===0){U--;const W=Math.max(U,0);P=(0,S.getWrappedLineTrimmedLength)(D,W,this._cols)}}for(let I=0;I<D.length;I++)q[I]<v&&D[I].setCell(q[I],E);let B=j-K;for(;B-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+A)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+b-1)}if(T.length>0){const M=[],L=[];for(let F=0;F<this.lines.length;F++)L.push(this.lines.get(F));const D=this.lines.length;let H=D-1,z=0,q=T[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let j=0;for(let F=Math.min(this.lines.maxLength-1,D+A-1);F>=0;F--)if(q&&q.start>H+j){for(let G=q.newLines.length-1;G>=0;G--)this.lines.set(F--,q.newLines[G]);F++,M.push({index:H+1,amount:q.newLines.length}),j+=q.newLines.length,q=T[++z]}else this.lines.set(F,L[H--]);let K=0;for(let F=M.length-1;F>=0;F--)M[F].index+=K,this.lines.onInsertEmitter.fire(M[F]),K+=M[F].amount;const $=Math.max(0,D+A-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(v,b,E=0,T){const A=this.lines.get(v);return A?A.translateToString(b,E,T):""}getWrappedRangeForLine(v){let b=v,E=v;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:b,last:E}}setupTabStops(v){for(v!=null?this.tabs[v]||(v=this.prevStop(v)):(this.tabs={},v=0);v<this._cols;v+=this._optionsService.rawOptions.tabStopWidth)this.tabs[v]=!0}prevStop(v){for(v==null&&(v=this.x);!this.tabs[--v]&&v>0;);return v>=this._cols?this._cols-1:v<0?0:v}nextStop(v){for(v==null&&(v=this.x);!this.tabs[++v]&&v<this._cols;);return v>=this._cols?this._cols-1:v<0?0:v}clearMarkers(v){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===v&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].dispose(),this.markers.splice(v--,1);this._isClearing=!1}addMarker(v){const b=new y.Marker(v);return this.markers.push(b),b.register(this.lines.onTrim((E=>{b.line-=E,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((E=>{b.line>=E.index&&(b.line+=E.amount)}))),b.register(this.lines.onDelete((E=>{b.line>=E.index&&b.line<E.index+E.amount&&b.dispose(),b.line>E.index&&(b.line-=E.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(v){this._isClearing||this.markers.splice(this.markers.indexOf(v),1)}}},8437:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const d=l(3734),p=l(511),f=l(643),g=l(482);a.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let S=0;class C{constructor(y,x,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const b=x||p.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let E=0;E<y;++E)this.setCell(E,b);this.length=y}get(y){const x=this._data[3*y+0],v=2097151&x;return[this._data[3*y+1],2097152&x?this._combined[y]:v?(0,g.stringFromCodePoint)(v):"",x>>22,2097152&x?this._combined[y].charCodeAt(this._combined[y].length-1):v]}set(y,x){this._data[3*y+1]=x[f.CHAR_DATA_ATTR_INDEX],x[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=x[1],this._data[3*y+0]=2097152|y|x[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const x=this._data[3*y+0];return 2097152&x?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&x}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const x=this._data[3*y+0];return 2097152&x?this._combined[y]:2097151&x?(0,g.stringFromCodePoint)(2097151&x):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,x){return S=3*y,x.content=this._data[S+0],x.fg=this._data[S+1],x.bg=this._data[S+2],2097152&x.content&&(x.combinedData=this._combined[y]),268435456&x.bg&&(x.extended=this._extendedAttrs[y]),x}setCell(y,x){2097152&x.content&&(this._combined[y]=x.combinedData),268435456&x.bg&&(this._extendedAttrs[y]=x.extended),this._data[3*y+0]=x.content,this._data[3*y+1]=x.fg,this._data[3*y+2]=x.bg}setCellFromCodepoint(y,x,v,b){268435456&b.bg&&(this._extendedAttrs[y]=b.extended),this._data[3*y+0]=x|v<<22,this._data[3*y+1]=b.fg,this._data[3*y+2]=b.bg}addCodepointToCell(y,x,v){let b=this._data[3*y+0];2097152&b?this._combined[y]+=(0,g.stringFromCodePoint)(x):2097151&b?(this._combined[y]=(0,g.stringFromCodePoint)(2097151&b)+(0,g.stringFromCodePoint)(x),b&=-2097152,b|=2097152):b=x|4194304,v&&(b&=-12582913,b|=v<<22),this._data[3*y+0]=b}insertCells(y,x,v){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),x<this.length-y){const b=new p.CellData;for(let E=this.length-y-x-1;E>=0;--E)this.setCell(y+x+E,this.loadCell(y+E,b));for(let E=0;E<x;++E)this.setCell(y+E,v)}else for(let b=y;b<this.length;++b)this.setCell(b,v);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,v)}deleteCells(y,x,v){if(y%=this.length,x<this.length-y){const b=new p.CellData;for(let E=0;E<this.length-y-x;++E)this.setCell(y+E,this.loadCell(y+x+E,b));for(let E=this.length-x;E<this.length;++E)this.setCell(E,v)}else for(let b=y;b<this.length;++b)this.setCell(b,v);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,v)}replaceCells(y,x,v,b=!1){if(b)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,v),x<this.length&&this.getWidth(x-1)===2&&!this.isProtected(x)&&this.setCellFromCodepoint(x,0,1,v);y<x&&y<this.length;)this.isProtected(y)||this.setCell(y,v),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),x<this.length&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x,0,1,v);y<x&&y<this.length;)this.setCell(y++,v)}resize(y,x){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const v=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*v)this._data=new Uint32Array(this._data.buffer,0,v);else{const b=new Uint32Array(v);b.set(this._data),this._data=b}for(let b=this.length;b<y;++b)this.setCell(b,x)}else{this._data=this._data.subarray(0,v);const b=Object.keys(this._combined);for(let T=0;T<b.length;T++){const A=parseInt(b[T],10);A>=y&&delete this._combined[A]}const E=Object.keys(this._extendedAttrs);for(let T=0;T<E.length;T++){const A=parseInt(E[T],10);A>=y&&delete this._extendedAttrs[A]}}return this.length=y,4*v*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const y=new Uint32Array(this._data.length);return y.set(this._data),this._data=y,1}return 0}fill(y,x=!1){if(x)for(let v=0;v<this.length;++v)this.isProtected(v)||this.setCell(v,y);else{this._combined={},this._extendedAttrs={};for(let v=0;v<this.length;++v)this.setCell(v,y)}}copyFrom(y){this.length!==y.length?this._data=new Uint32Array(y._data):this._data.set(y._data),this.length=y.length,this._combined={};for(const x in y._combined)this._combined[x]=y._combined[x];this._extendedAttrs={};for(const x in y._extendedAttrs)this._extendedAttrs[x]=y._extendedAttrs[x];this.isWrapped=y.isWrapped}clone(){const y=new C(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const x in this._combined)y._combined[x]=this._combined[x];for(const x in this._extendedAttrs)y._extendedAttrs[x]=this._extendedAttrs[x];return y.isWrapped=this.isWrapped,y}getTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,x,v,b,E){const T=y._data;if(E)for(let M=b-1;M>=0;M--){for(let L=0;L<3;L++)this._data[3*(v+M)+L]=T[3*(x+M)+L];268435456&T[3*(x+M)+2]&&(this._extendedAttrs[v+M]=y._extendedAttrs[x+M])}else for(let M=0;M<b;M++){for(let L=0;L<3;L++)this._data[3*(v+M)+L]=T[3*(x+M)+L];268435456&T[3*(x+M)+2]&&(this._extendedAttrs[v+M]=y._extendedAttrs[x+M])}const A=Object.keys(y._combined);for(let M=0;M<A.length;M++){const L=parseInt(A[M],10);L>=x&&(this._combined[L-x+v]=y._combined[L])}}translateToString(y,x,v,b){x=x??0,v=v??this.length,y&&(v=Math.min(v,this.getTrimmedLength())),b&&(b.length=0);let E="";for(;x<v;){const T=this._data[3*x+0],A=2097151&T,M=2097152&T?this._combined[x]:A?(0,g.stringFromCodePoint)(A):f.WHITESPACE_CELL_CHAR;if(E+=M,b)for(let L=0;L<M.length;++L)b.push(x);x+=T>>22||1}return b&&b.push(x),E}}a.BufferLine=C},4841:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(l,d){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return d*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(h,a)=>{function l(d,p,f){if(p===d.length-1)return d[p].getTrimmedLength();const g=!d[p].hasContent(f-1)&&d[p].getWidth(f-1)===1,S=d[p+1].getWidth(0)===2;return g&&S?f-1:f}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(d,p,f,g,S){const C=[];for(let w=0;w<d.length-1;w++){let y=w,x=d.get(++y);if(!x.isWrapped)continue;const v=[d.get(w)];for(;y<d.length&&x.isWrapped;)v.push(x),x=d.get(++y);if(g>=w&&g<y){w+=v.length-1;continue}let b=0,E=l(v,b,p),T=1,A=0;for(;T<v.length;){const L=l(v,T,p),D=L-A,H=f-E,z=Math.min(D,H);v[b].copyCellsFrom(v[T],A,E,z,!1),E+=z,E===f&&(b++,E=0),A+=z,A===L&&(T++,A=0),E===0&&b!==0&&v[b-1].getWidth(f-1)===2&&(v[b].copyCellsFrom(v[b-1],f-1,E++,1,!1),v[b-1].setCell(f-1,S))}v[b].replaceCells(E,f,S);let M=0;for(let L=v.length-1;L>0&&(L>b||v[L].getTrimmedLength()===0);L--)M++;M>0&&(C.push(w+v.length-M),C.push(M)),w+=v.length-1}return C},a.reflowLargerCreateNewLayout=function(d,p){const f=[];let g=0,S=p[g],C=0;for(let w=0;w<d.length;w++)if(S===w){const y=p[++g];d.onDeleteEmitter.fire({index:w-C,amount:y}),w+=y-1,C+=y,S=p[++g]}else f.push(w);return{layout:f,countRemoved:C}},a.reflowLargerApplyNewLayout=function(d,p){const f=[];for(let g=0;g<p.length;g++)f.push(d.get(p[g]));for(let g=0;g<f.length;g++)d.set(g,f[g]);d.length=p.length},a.reflowSmallerGetNewLineLengths=function(d,p,f){const g=[],S=d.map(((x,v)=>l(d,v,p))).reduce(((x,v)=>x+v));let C=0,w=0,y=0;for(;y<S;){if(S-y<f){g.push(S-y);break}C+=f;const x=l(d,w,p);C>x&&(C-=x,w++);const v=d[w].getWidth(C-1)===2;v&&C--;const b=v?f-1:f;g.push(b),y+=b}return g},a.getWrappedLineTrimmedLength=l},5295:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const d=l(8460),p=l(844),f=l(9092);class g extends p.Disposable{constructor(C,w){super(),this._optionsService=C,this._bufferService=w,this._onBufferActivate=this.register(new d.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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,w){this._normal.resize(C,w),this._alt.resize(C,w),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}a.BufferSet=g},511:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=l(482),p=l(643),f=l(3734);class g extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const w=new g;return w.setFromCharData(C),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(C[p.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(C[p.CHAR_DATA_CHAR_INDEX].length===2){const y=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const x=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=x&&x<=57343?this.content=1024*(y-55296)+x-56320+65536|C[p.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[p.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=C[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=g},643:(h,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:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const d=l(8460),p=l(844);class f{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}a.Marker=f,f._nextId=1},7116:(h,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:(h,a)=>{var l,d,p;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
28
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(l||(a.C0=l={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(d||(a.C1=d={})),(function(f){f.ST=`${l.ESC}\\`})(p||(a.C1_ESCAPED=p={}))},7399:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const d=l(2584),p={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(f,g,S,C){const w={type:0,cancel:!1,key:void 0},y=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?w.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(w.key=d.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=d.C0.ESC+"[Z";break}w.key=d.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,w.cancel=!0;break;case 27:w.key=d.C0.ESC,f.altKey&&(w.key=d.C0.ESC+d.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"D",w.key===d.C0.ESC+"[1;3D"&&(w.key=d.C0.ESC+(S?"b":"[1;5D"))):w.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"C",w.key===d.C0.ESC+"[1;3C"&&(w.key=d.C0.ESC+(S?"f":"[1;5C"))):w.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"A",S||w.key!==d.C0.ESC+"[1;3A"||(w.key=d.C0.ESC+"[1;5A")):w.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"B",S||w.key!==d.C0.ESC+"[1;3B"||(w.key=d.C0.ESC+"[1;5B")):w.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=d.C0.ESC+"[2~");break;case 46:w.key=y?d.C0.ESC+"[3;"+(y+1)+"~":d.C0.ESC+"[3~";break;case 36:w.key=y?d.C0.ESC+"[1;"+(y+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:w.key=y?d.C0.ESC+"[1;"+(y+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=d.C0.ESC+"[5;"+(y+1)+"~":w.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=d.C0.ESC+"[6;"+(y+1)+"~":w.key=d.C0.ESC+"[6~";break;case 112:w.key=y?d.C0.ESC+"[1;"+(y+1)+"P":d.C0.ESC+"OP";break;case 113:w.key=y?d.C0.ESC+"[1;"+(y+1)+"Q":d.C0.ESC+"OQ";break;case 114:w.key=y?d.C0.ESC+"[1;"+(y+1)+"R":d.C0.ESC+"OR";break;case 115:w.key=y?d.C0.ESC+"[1;"+(y+1)+"S":d.C0.ESC+"OS";break;case 116:w.key=y?d.C0.ESC+"[15;"+(y+1)+"~":d.C0.ESC+"[15~";break;case 117:w.key=y?d.C0.ESC+"[17;"+(y+1)+"~":d.C0.ESC+"[17~";break;case 118:w.key=y?d.C0.ESC+"[18;"+(y+1)+"~":d.C0.ESC+"[18~";break;case 119:w.key=y?d.C0.ESC+"[19;"+(y+1)+"~":d.C0.ESC+"[19~";break;case 120:w.key=y?d.C0.ESC+"[20;"+(y+1)+"~":d.C0.ESC+"[20~";break;case 121:w.key=y?d.C0.ESC+"[21;"+(y+1)+"~":d.C0.ESC+"[21~";break;case 122:w.key=y?d.C0.ESC+"[23;"+(y+1)+"~":d.C0.ESC+"[23~";break;case 123:w.key=y?d.C0.ESC+"[24;"+(y+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(S&&!C||!f.altKey||f.metaKey)!S||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?w.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(w.key=d.C0.US),f.key==="@"&&(w.key=d.C0.NUL)):f.keyCode===65&&(w.type=1);else{const x=p[f.keyCode],v=x?.[f.shiftKey?1:0];if(v)w.key=d.C0.ESC+v;else if(f.keyCode>=65&&f.keyCode<=90){const b=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(b);f.shiftKey&&(E=E.toUpperCase()),w.key=d.C0.ESC+E}else if(f.keyCode===32)w.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let b=f.code.slice(3,4);f.shiftKey||(b=b.toLowerCase()),w.key=d.C0.ESC+b,w.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?w.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?w.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=d.C0.DEL:f.keyCode===219?w.key=d.C0.ESC:f.keyCode===220?w.key=d.C0.FS:f.keyCode===221&&(w.key=d.C0.GS)}return w}},482:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},a.utf32ToString=function(l,d=0,p=l.length){let f="";for(let g=d;g<p;++g){let S=l[g];S>65535?(S-=65536,f+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):f+=String.fromCharCode(S)}return f},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,d){const p=l.length;if(!p)return 0;let f=0,g=0;if(this._interim){const S=l.charCodeAt(g++);56320<=S&&S<=57343?d[f++]=1024*(this._interim-55296)+S-56320+65536:(d[f++]=this._interim,d[f++]=S),this._interim=0}for(let S=g;S<p;++S){const C=l.charCodeAt(S);if(55296<=C&&C<=56319){if(++S>=p)return this._interim=C,f;const w=l.charCodeAt(S);56320<=w&&w<=57343?d[f++]=1024*(C-55296)+w-56320+65536:(d[f++]=C,d[f++]=w)}else C!==65279&&(d[f++]=C)}return f}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,d){const p=l.length;if(!p)return 0;let f,g,S,C,w=0,y=0,x=0;if(this.interim[0]){let E=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let A,M=0;for(;(A=63&this.interim[++M])&&M<4;)T<<=6,T|=A;const L=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=L-M;for(;x<D;){if(x>=p)return 0;if(A=l[x++],(192&A)!=128){x--,E=!0;break}this.interim[M++]=A,T<<=6,T|=63&A}E||(L===2?T<128?x--:d[w++]=T:L===3?T<2048||T>=55296&&T<=57343||T===65279||(d[w++]=T):T<65536||T>1114111||(d[w++]=T)),this.interim.fill(0)}const v=p-4;let b=x;for(;b<p;){for(;!(!(b<v)||128&(f=l[b])||128&(g=l[b+1])||128&(S=l[b+2])||128&(C=l[b+3]));)d[w++]=f,d[w++]=g,d[w++]=S,d[w++]=C,b+=4;if(f=l[b++],f<128)d[w++]=f;else if((224&f)==192){if(b>=p)return this.interim[0]=f,w;if(g=l[b++],(192&g)!=128){b--;continue}if(y=(31&f)<<6|63&g,y<128){b--;continue}d[w++]=y}else if((240&f)==224){if(b>=p)return this.interim[0]=f,w;if(g=l[b++],(192&g)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=g,w;if(S=l[b++],(192&S)!=128){b--;continue}if(y=(15&f)<<12|(63&g)<<6|63&S,y<2048||y>=55296&&y<=57343||y===65279)continue;d[w++]=y}else if((248&f)==240){if(b>=p)return this.interim[0]=f,w;if(g=l[b++],(192&g)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=g,w;if(S=l[b++],(192&S)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=S,w;if(C=l[b++],(192&C)!=128){b--;continue}if(y=(7&f)<<18|(63&g)<<12|(63&S)<<6|63&C,y<65536||y>1114111)continue;d[w++]=y}}return w}}},225:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=l(1480),p=[[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]],f=[[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 g;a.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let S=0;S<p.length;++S)g.fill(0,p[S][0],p[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?g[S]:(function(C,w){let y,x=0,v=w.length-1;if(C<w[0][0]||C>w[v][1])return!1;for(;v>=x;)if(y=x+v>>1,C>w[y][1])x=y+1;else{if(!(C<w[y][0]))return!0;v=y-1}return!1})(S,f)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,C){let w=this.wcwidth(S),y=w===0&&C!==0;if(y){const x=d.UnicodeService.extractWidth(C);x===0?y=!1:x>w&&(w=x)}return d.UnicodeService.createPropertyValue(0,w,y)}}},5981:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const d=l(8460),p=l(844);class f extends p.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 d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,C){if(C!==void 0&&this._syncCalls>C)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 w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(C)}_innerWrite(S=0,C=!0){const w=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],x=this._action(y,C);if(x){const b=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void x.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(b)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=y.length,Date.now()-w>=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=f},5941:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const l=/^([\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})$/,d=/^[\da-f]+$/;function p(f,g){const S=f.toString(16),C=S.length<2?"0"+S:S;switch(g){case 4:return S[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}a.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const S=l.exec(g);if(S){const C=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/C*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/C*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/C*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const S=g.length/3,C=[0,0,0];for(let w=0;w<3;++w){const y=parseInt(g.slice(S*w,S*w+S),16);C[w]=S===1?y<<4:S===2?y:S===3?y>>4:y>>8}return C}},a.toRgbString=function(f,g=16){const[S,C,w]=f;return`rgb:${p(S,g)}/${p(C,g)}/${p(w,g)}`}},5770:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const d=l(482),p=l(8742),f=l(5770),g=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const y=this._handlers[C];return y.push(w),{dispose:()=>{const x=y.indexOf(w);x!==-1&&y.splice(x,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(C,w){if(this.reset(),this._ident=C,this._active=this._handlers[C]||g,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,y){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(C,w,y);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,w,y))}unhook(C,w=!0){if(this._active.length){let y=!1,x=this._active.length-1,v=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,y=w,v=this._stack.fallThrough,this._stack.paused=!1),!v&&y===!1){for(;x>=0&&(y=this._active[x].unhook(C),y!==!0);x--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,y;x--}for(;x>=0;x--)if(y=this._active[x].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",C);this._active=g,this._ident=0}};const S=new p.Params;S.addParam(0),a.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=S,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():S,this._data="",this._hitLimit=!1}put(C,w,y){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,w,y),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((y=>(this._params=S,this._data="",this._hitLimit=!1,y)));return this._params=S,this._data="",this._hitLimit=!1,w}}},2015:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const d=l(844),p=l(8742),f=l(6242),g=l(6351);class S{constructor(x){this.table=new Uint8Array(x)}setDefault(x,v){this.table.fill(x<<4|v)}add(x,v,b,E){this.table[v<<8|x]=b<<4|E}addMany(x,v,b,E){for(let T=0;T<x.length;T++)this.table[v<<8|x[T]]=b<<4|E}}a.TransitionTable=S;const C=160;a.VT500_TRANSITION_TABLE=(function(){const y=new S(4095),x=Array.apply(null,Array(256)).map(((M,L)=>L)),v=(M,L)=>x.slice(M,L),b=v(32,127),E=v(0,24);E.push(25),E.push.apply(E,v(28,32));const T=v(0,14);let A;for(A in y.setDefault(1,0),y.addMany(b,0,2,0),T)y.addMany([24,26,153,154],A,3,0),y.addMany(v(128,144),A,3,0),y.addMany(v(144,152),A,3,0),y.add(156,A,0,0),y.add(27,A,11,1),y.add(157,A,4,8),y.addMany([152,158,159],A,0,7),y.add(155,A,11,3),y.add(144,A,11,9);return y.addMany(E,0,3,0),y.addMany(E,1,3,1),y.add(127,1,0,1),y.addMany(E,8,0,8),y.addMany(E,3,3,3),y.add(127,3,0,3),y.addMany(E,4,3,4),y.add(127,4,0,4),y.addMany(E,6,3,6),y.addMany(E,5,3,5),y.add(127,5,0,5),y.addMany(E,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(b,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(v(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(b,7,0,7),y.addMany(E,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(v(64,127),3,7,0),y.addMany(v(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(v(48,60),4,8,4),y.addMany(v(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(v(32,64),6,0,6),y.add(127,6,0,6),y.addMany(v(64,127),6,0,0),y.addMany(v(32,48),3,9,5),y.addMany(v(32,48),5,9,5),y.addMany(v(48,64),5,0,6),y.addMany(v(64,127),5,7,0),y.addMany(v(32,48),4,9,5),y.addMany(v(32,48),1,9,2),y.addMany(v(32,48),2,9,2),y.addMany(v(48,127),2,10,0),y.addMany(v(48,80),1,10,0),y.addMany(v(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(v(96,127),1,10,0),y.add(80,1,11,9),y.addMany(E,9,0,9),y.add(127,9,0,9),y.addMany(v(28,32),9,0,9),y.addMany(v(32,48),9,9,12),y.addMany(v(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(E,11,0,11),y.addMany(v(32,128),11,0,11),y.addMany(v(28,32),11,0,11),y.addMany(E,10,0,10),y.add(127,10,0,10),y.addMany(v(28,32),10,0,10),y.addMany(v(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(v(32,48),10,9,12),y.addMany(E,12,0,12),y.add(127,12,0,12),y.addMany(v(28,32),12,0,12),y.addMany(v(32,48),12,9,12),y.addMany(v(48,64),12,0,11),y.addMany(v(64,127),12,12,13),y.addMany(v(64,127),10,12,13),y.addMany(v(64,127),9,12,13),y.addMany(E,13,13,13),y.addMany(b,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(C,0,2,0),y.add(C,8,5,8),y.add(C,6,0,6),y.add(C,11,0,11),y.add(C,13,13,13),y})();class w extends d.Disposable{constructor(x=a.VT500_TRANSITION_TABLE){super(),this._transitions=x,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(v,b,E)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,b)=>{},this._escHandlerFb=v=>{},this._errorHandlerFb=v=>v,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(x,v=[64,126]){let b=0;if(x.prefix){if(x.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=x.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(x.intermediates){if(x.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<x.intermediates.length;++T){const A=x.intermediates.charCodeAt(T);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=A}}if(x.final.length!==1)throw new Error("final must be a single byte");const E=x.final.charCodeAt(0);if(v[0]>E||E>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return b<<=8,b|=E,b}identToString(x){const v=[];for(;x;)v.push(String.fromCharCode(255&x)),x>>=8;return v.reverse().join("")}setPrintHandler(x){this._printHandler=x}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(x,v){const b=this._identifier(x,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const E=this._escHandlers[b];return E.push(v),{dispose:()=>{const T=E.indexOf(v);T!==-1&&E.splice(T,1)}}}clearEscHandler(x){this._escHandlers[this._identifier(x,[48,126])]&&delete this._escHandlers[this._identifier(x,[48,126])]}setEscHandlerFallback(x){this._escHandlerFb=x}setExecuteHandler(x,v){this._executeHandlers[x.charCodeAt(0)]=v}clearExecuteHandler(x){this._executeHandlers[x.charCodeAt(0)]&&delete this._executeHandlers[x.charCodeAt(0)]}setExecuteHandlerFallback(x){this._executeHandlerFb=x}registerCsiHandler(x,v){const b=this._identifier(x);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const E=this._csiHandlers[b];return E.push(v),{dispose:()=>{const T=E.indexOf(v);T!==-1&&E.splice(T,1)}}}clearCsiHandler(x){this._csiHandlers[this._identifier(x)]&&delete this._csiHandlers[this._identifier(x)]}setCsiHandlerFallback(x){this._csiHandlerFb=x}registerDcsHandler(x,v){return this._dcsParser.registerHandler(this._identifier(x),v)}clearDcsHandler(x){this._dcsParser.clearHandler(this._identifier(x))}setDcsHandlerFallback(x){this._dcsParser.setHandlerFallback(x)}registerOscHandler(x,v){return this._oscParser.registerHandler(x,v)}clearOscHandler(x){this._oscParser.clearHandler(x)}setOscHandlerFallback(x){this._oscParser.setHandlerFallback(x)}setErrorHandler(x){this._errorHandler=x}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(x,v,b,E,T){this._parseStack.state=x,this._parseStack.handlers=v,this._parseStack.handlerPos=b,this._parseStack.transition=E,this._parseStack.chunkPos=T}parse(x,v,b){let E,T=0,A=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const L=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&D>-1){for(;D>=0&&(E=L[D](this._params),E!==!0);D--)if(E instanceof Promise)return this._parseStack.handlerPos=D,E}this._parseStack.handlers=[];break;case 4:if(b===!1&&D>-1){for(;D>=0&&(E=L[D](),E!==!0);D--)if(E instanceof Promise)return this._parseStack.handlerPos=D,E}this._parseStack.handlers=[];break;case 6:if(T=x[this._parseStack.chunkPos],E=this._dcsParser.unhook(T!==24&&T!==26,b),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=x[this._parseStack.chunkPos],E=this._oscParser.end(T!==24&&T!==26,b),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let L=M;L<v;++L){switch(T=x[L],A=this._transitions.table[this.currentState<<8|(T<160?T:C)],A>>4){case 2:for(let j=L+1;;++j){if(j>=v||(T=x[j])<32||T>126&&T<C){this._printHandler(x,L,j),L=j-1;break}if(++j>=v||(T=x[j])<32||T>126&&T<C){this._printHandler(x,L,j),L=j-1;break}if(++j>=v||(T=x[j])<32||T>126&&T<C){this._printHandler(x,L,j),L=j-1;break}if(++j>=v||(T=x[j])<32||T>126&&T<C){this._printHandler(x,L,j),L=j-1;break}}break;case 3:this._executeHandlers[T]?this._executeHandlers[T]():this._executeHandlerFb(T),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:L,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const D=this._csiHandlers[this._collect<<8|T];let H=D?D.length-1:-1;for(;H>=0&&(E=D[H](this._params),E!==!0);H--)if(E instanceof Promise)return this._preserveStack(3,D,H,A,L),E;H<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++L<v&&(T=x[L])>47&&T<60);L--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const z=this._escHandlers[this._collect<<8|T];let q=z?z.length-1:-1;for(;q>=0&&(E=z[q](),E!==!0);q--)if(E instanceof Promise)return this._preserveStack(4,z,q,A,L),E;q<0&&this._escHandlerFb(this._collect<<8|T),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|T,this._params);break;case 13:for(let j=L+1;;++j)if(j>=v||(T=x[j])===24||T===26||T===27||T>127&&T<C){this._dcsParser.put(x,L,j),L=j-1;break}break;case 14:if(E=this._dcsParser.unhook(T!==24&&T!==26),E)return this._preserveStack(6,[],0,A,L),E;T===27&&(A|=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 j=L+1;;j++)if(j>=v||(T=x[j])<32||T>127&&T<C){this._oscParser.put(x,L,j),L=j-1;break}break;case 6:if(E=this._oscParser.end(T!==24&&T!==26),E)return this._preserveStack(5,[],0,A,L),E;T===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&A}}}a.EscapeSequenceParser=w},6242:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const d=l(5770),p=l(482),f=[];a.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,S){this._handlers[g]===void 0&&(this._handlers[g]=[]);const C=this._handlers[g];return C.push(S),{dispose:()=>{const w=C.indexOf(S);w!==-1&&C.splice(w,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,S,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(g,S,C);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,S,C))}start(){this.reset(),this._state=1}put(g,S,C){if(this._state!==3){if(this._state===1)for(;S<C;){const w=g[S++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&C-S>0&&this._put(g,S,C)}}end(g,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,y=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=S,y=this._stack.fallThrough,this._stack.paused=!1),!y&&C===!1){for(;w>=0&&(C=this._active[w].end(g),C!==!0);w--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,C;w--}for(;w>=0;w--)if(C=this._active[w].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,S,C){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,S,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let S=!1;if(this._hitLimit)S=!1;else if(g&&(S=this._handler(this._data),S instanceof Promise))return S.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,S}}},8742:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const l=2147483647;class d{static fromArray(f){const g=new d;if(!f.length)return g;for(let S=Array.isArray(f[0])?1:0;S<f.length;++S){const C=f[S];if(Array.isArray(C))for(let w=0;w<C.length;++w)g.addSubParam(C[w]);else g.addParam(C)}return g}constructor(f=32,g=32){if(this.maxLength=f,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let g=0;g<this.length;++g){f.push(this.params[g]);const S=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-S>0&&f.push(Array.prototype.slice.call(this._subParams,S,C))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>l?l:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>l?l:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];return S-g>0?this._subParams.subarray(g,S):null}getSubParamsAll(){const f={};for(let g=0;g<this.length;++g){const S=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-S>0&&(f[g]=this._subParams.slice(S,C))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,C=S[g-1];S[g-1]=~C?Math.min(10*C+f,l):f}}a.Params=d},5741:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,d){const p={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(p),d.dispose=()=>this._wrappedAddonDispose(p),d.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let d=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===l){d=p;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(d,1)}}},8771:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const d=l(3785),p=l(511);a.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}init(f){return this._buffer=f,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(f){const g=this._buffer.lines.get(f);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new p.CellData}}},3785:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const d=l(511);a.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,f){if(!(p<0||p>=this._line.length))return f?(this._line.loadCell(p,f),f):this._line.loadCell(p,new d.CellData)}translateToString(p,f,g){return this._line.translateToString(p,f,g)}}},8285:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const d=l(8771),p=l(8460),f=l(844);class g extends f.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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=g},7975:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,d){return this._core.registerCsiHandler(l,(p=>d(p.toArray())))}addCsiHandler(l,d){return this.registerCsiHandler(l,d)}registerDcsHandler(l,d){return this._core.registerDcsHandler(l,((p,f)=>d(p,f.toArray())))}addDcsHandler(l,d){return this.registerDcsHandler(l,d)}registerEscHandler(l,d){return this._core.registerEscHandler(l,d)}addEscHandler(l,d){return this.registerEscHandler(l,d)}registerOscHandler(l,d){return this._core.registerOscHandler(l,d)}addOscHandler(l,d){return this.registerOscHandler(l,d)}}},7090:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(h,a,l){var d=this&&this.__decorate||function(y,x,v,b){var E,T=arguments.length,A=T<3?x:b===null?b=Object.getOwnPropertyDescriptor(x,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,x,v,b);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(A=(T<3?E(A):T>3?E(x,v,A):E(x,v))||A);return T>3&&A&&Object.defineProperty(x,v,A),A},p=this&&this.__param||function(y,x){return function(v,b){x(v,b,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const f=l(8460),g=l(844),S=l(5295),C=l(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let w=a.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(y,this))}resize(y,x){this.cols=y,this.rows=x,this.buffers.resize(y,x),this._onResize.fire({cols:y,rows:x})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,x=!1){const v=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===y.fg&&b.getBg(0)===y.bg||(b=v.getBlankLine(y,x),this._cachedBlankLine=b),b.isWrapped=x;const E=v.ybase+v.scrollTop,T=v.ybase+v.scrollBottom;if(v.scrollTop===0){const A=v.lines.isFull;T===v.lines.length-1?A?v.lines.recycle().copyFrom(b):v.lines.push(b.clone()):v.lines.splice(T+1,0,b.clone()),A?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const A=T-E+1;v.lines.shiftElements(E+1,A-1,-1),v.lines.set(T,b.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(y,x,v){const b=this.buffer;if(y<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else y+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const E=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+y,b.ybase),0),E!==b.ydisp&&(x||this._onScroll.fire(b.ydisp))}};a.BufferService=w=d([p(0,C.IOptionsService)],w)},7994:(h,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(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,d){this._charsets[l]=d,this.glevel===l&&(this.charset=d)}}},1753:function(h,a,l){var d=this&&this.__decorate||function(b,E,T,A){var M,L=arguments.length,D=L<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,E,T,A);else for(var H=b.length-1;H>=0;H--)(M=b[H])&&(D=(L<3?M(D):L>3?M(E,T,D):M(E,T))||D);return L>3&&D&&Object.defineProperty(E,T,D),D},p=this&&this.__param||function(b,E){return function(T,A){E(T,A,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const f=l(2585),g=l(8460),S=l(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function w(b,E){let T=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(T|=64,T|=b.action):(T|=3&b.button,4&b.button&&(T|=64),8&b.button&&(T|=128),b.action===32?T|=32:b.action!==0||E||(T|=3)),T}const y=String.fromCharCode,x={DEFAULT:b=>{const E=[w(b,!1)+32,b.col+32,b.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${y(E[0])}${y(E[1])}${y(E[2])}`},SGR:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.col};${b.row}${E}`},SGR_PIXELS:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.x};${b.y}${E}`}};let v=a.CoreMouseService=class extends S.Disposable{constructor(b,E){super(),this._bufferService=b,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(C))this.addProtocol(T,C[T]);for(const T of Object.keys(x))this.addEncoding(T,x[T]);this.reset()}addProtocol(b,E){this._protocols[b]=E}addEncoding(b,E){this._encodings[b]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const E=this._encodings[this._activeEncoding](b);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,E,T){if(T){if(b.x!==E.x||b.y!==E.y)return!1}else if(b.col!==E.col||b.row!==E.row)return!1;return b.button===E.button&&b.action===E.action&&b.ctrl===E.ctrl&&b.alt===E.alt&&b.shift===E.shift}};a.CoreMouseService=v=d([p(0,f.IBufferService),p(1,f.ICoreService)],v)},6975:function(h,a,l){var d=this&&this.__decorate||function(v,b,E,T){var A,M=arguments.length,L=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,b,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(b,E,L):A(b,E))||L);return M>3&&L&&Object.defineProperty(b,E,L),L},p=this&&this.__param||function(v,b){return function(E,T){b(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const f=l(1439),g=l(8460),S=l(844),C=l(2585),w=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let x=a.CoreService=class extends S.Disposable{constructor(v,b,E){super(),this._bufferService=v,this._logService=b,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(y)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(y)}triggerDataEvent(v,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${v}"`,(()=>v.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(v)}triggerBinaryEvent(v){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${v}"`,(()=>v.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(v))}};a.CoreService=x=d([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],x)},9074:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const d=l(8055),p=l(8460),f=l(844),g=l(6106);let S=0,C=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((v=>v?.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(v){if(v.marker.isDisposed)return;const b=new y(v);if(b){const E=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),E.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,b,E){let T=0,A=0;for(const M of this._decorations.getKeyIterator(b))T=M.options.x??0,A=T+(M.options.width??1),v>=T&&v<A&&(!E||(M.options.layer??"bottom")===E)&&(yield M)}forEachDecorationAtCell(v,b,E,T){this._decorations.forEachByKey(b,(A=>{S=A.options.x??0,C=S+(A.options.width??1),v>=S&&v<C&&(!E||(A.options.layer??"bottom")===E)&&T(A)}))}}a.DecorationService=w;class y extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(v){super(),this.options=v,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=v.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const d=l(2585),p=l(8343);class f{constructor(...S){this._entries=new Map;for(const[C,w]of S)this.set(C,w)}set(S,C){const w=this._entries.get(S);return this._entries.set(S,C),w}forEach(S){for(const[C,w]of this._entries.entries())S(C,w)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}a.ServiceCollection=f,a.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(g,S){this._services.set(g,S)}getService(g){return this._services.get(g)}createInstance(g,...S){const C=(0,p.getServiceDependencies)(g).sort(((x,v)=>x.index-v.index)),w=[];for(const x of C){const v=this._services.get(x.id);if(!v)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${x.id}.`);w.push(v)}const y=C.length>0?C[0].index:S.length;if(S.length!==y)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${y+1} conflicts with ${S.length} static arguments`);return new g(...S,...w)}}},7866:function(h,a,l){var d=this&&this.__decorate||function(y,x,v,b){var E,T=arguments.length,A=T<3?x:b===null?b=Object.getOwnPropertyDescriptor(x,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,x,v,b);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(A=(T<3?E(A):T>3?E(x,v,A):E(x,v))||A);return T>3&&A&&Object.defineProperty(x,v,A),A},p=this&&this.__param||function(y,x){return function(v,b){x(v,b,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const f=l(844),g=l(2585),S={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let C,w=a.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let x=0;x<y.length;x++)typeof y[x]=="function"&&(y[x]=y[x]())}_log(y,x,v){this._evalLazyOptionalParams(v),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+x,...v)}trace(y,...x){this._logLevel<=g.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,y,x)}debug(y,...x){this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,y,x)}info(y,...x){this._logLevel<=g.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,y,x)}warn(y,...x){this._logLevel<=g.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,y,x)}error(y,...x){this._logLevel<=g.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,y,x)}};a.LogService=w=d([p(0,g.IOptionsService)],w),a.setTraceLogger=function(y){C=y},a.traceCall=function(y,x,v){if(typeof v.value!="function")throw new Error("not supported");const b=v.value;v.value=function(...E){if(C.logLevel!==g.LogLevelEnum.TRACE)return b.apply(this,E);C.trace(`GlyphRenderer#${b.name}(${E.map((A=>JSON.stringify(A))).join(", ")})`);const T=b.apply(this,E);return C.trace(`GlyphRenderer#${b.name} return`,T),T}}},7302:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const d=l(8460),p=l(844),f=l(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:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...a.DEFAULT_OPTIONS};for(const x in w)if(x in y)try{const v=w[x];y[x]=this._sanitizeAndValidateOption(x,v)}catch(v){console.error(v)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,y){return this.onOptionChange((x=>{x===w&&y(this.rawOptions[w])}))}onMultipleOptionChange(w,y){return this.onOptionChange((x=>{w.indexOf(x)!==-1&&y()}))}_setupOptions(){const w=x=>{if(!(x in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${x}"`);return this.rawOptions[x]},y=(x,v)=>{if(!(x in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${x}"`);v=this._sanitizeAndValidateOption(x,v),this.rawOptions[x]!==v&&(this.rawOptions[x]=v,this._onOptionChange.fire(x))};for(const x in this.rawOptions){const v={get:w.bind(this,x),set:y.bind(this,x)};Object.defineProperty(this.options,x,v)}}_sanitizeAndValidateOption(w,y){switch(w){case"cursorStyle":if(y||(y=a.DEFAULT_OPTIONS[w]),!(function(x){return x==="block"||x==="underline"||x==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${w}`);break;case"wordSeparator":y||(y=a.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=g.includes(y)?y:a.DEFAULT_OPTIONS[w];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${w} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${w} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}a.OptionsService=S},2660:function(h,a,l){var d=this&&this.__decorate||function(S,C,w,y){var x,v=arguments.length,b=v<3?C:y===null?y=Object.getOwnPropertyDescriptor(C,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(S,C,w,y);else for(var E=S.length-1;E>=0;E--)(x=S[E])&&(b=(v<3?x(b):v>3?x(C,w,b):x(C,w))||b);return v>3&&b&&Object.defineProperty(C,w,b),b},p=this&&this.__param||function(S,C){return function(w,y){C(w,y,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const f=l(2585);let g=a.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const C=this._bufferService.buffer;if(S.id===void 0){const E=C.addMarker(C.ybase+C.y),T={data:S,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(T,E))),this._dataByLinkId.set(T.id,T),T.id}const w=S,y=this._getEntryIdKey(w),x=this._entriesWithId.get(y);if(x)return this.addLineToLink(x.id,C.ybase+C.y),x.id;const v=C.addMarker(C.ybase+C.y),b={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(b,v))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(S,C){const w=this._dataByLinkId.get(S);if(w&&w.lines.every((y=>y.line!==C))){const y=this._bufferService.buffer.addMarker(C);w.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(w,y)))}}getLinkData(S){return this._dataByLinkId.get(S)?.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,C){const w=S.lines.indexOf(C);w!==-1&&(S.lines.splice(w,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};a.OscLinkService=g=d([p(0,f.IBufferService)],g)},8343:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const l="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(p){return p[d]||[]},a.createDecorator=function(p){if(a.serviceRegistry.has(p))return a.serviceRegistry.get(p);const f=function(g,S,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,y,x){y[l]===y?y[d].push({id:w,index:x}):(y[d]=[{id:w,index:x}],y[l]=y)})(f,g,C)};return f.toString=()=>p,a.serviceRegistry.set(p,f),f}},2585:(h,a,l)=>{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 d=l(8343);var p;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(p||(a.LogLevelEnum=p={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=l(8460),p=l(225);class f{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,C,w=!1){return(16777215&S)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const S=new p.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 C=0,w=0;const y=S.length;for(let x=0;x<y;++x){let v=S.charCodeAt(x);if(55296<=v&&v<=56319){if(++x>=y)return C+this.wcwidth(v);const T=S.charCodeAt(x);56320<=T&&T<=57343?v=1024*(v-55296)+T-56320+65536:C+=this.wcwidth(T)}const b=this.charProperties(v,w);let E=f.extractWidth(b);f.extractShouldJoin(b)&&(E-=f.extractWidth(w)),C+=E,w=b}return C}charProperties(S,C){return this._activeProvider.charProperties(S,C)}}a.UnicodeService=f}},s={};function o(h){var a=s[h];if(a!==void 0)return a.exports;var l=s[h]={exports:{}};return n[h].call(l.exports,l,l.exports,o),l.exports}var u={};return(()=>{var h=u;Object.defineProperty(h,"__esModule",{value:!0}),h.Terminal=void 0;const a=o(9042),l=o(3236),d=o(844),p=o(5741),f=o(8285),g=o(7975),S=o(7090),C=["cols","rows"];class w extends d.Disposable{constructor(x){super(),this._core=this.register(new l.Terminal(x)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const v=E=>this._core.options[E],b=(E,T)=>{this._checkReadonlyOptions(E),this._core.options[E]=T};for(const E in this._core.options){const T={get:v.bind(this,E),set:b.bind(this,E)};Object.defineProperty(this._publicOptions,E,T)}}_checkReadonlyOptions(x){if(C.includes(x))throw new Error(`Option "${x}" 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 g.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const x=this._core.coreService.decPrivateModes;let v="none";switch(this._core.coreMouseService.activeProtocol){case"X10":v="x10";break;case"VT200":v="vt200";break;case"DRAG":v="drag";break;case"ANY":v="any"}return{applicationCursorKeysMode:x.applicationCursorKeys,applicationKeypadMode:x.applicationKeypad,bracketedPasteMode:x.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:x.origin,reverseWraparoundMode:x.reverseWraparound,sendFocusMode:x.sendFocus,wraparoundMode:x.wraparound}}get options(){return this._publicOptions}set options(x){for(const v in x)this._publicOptions[v]=x[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(x,v=!0){this._core.input(x,v)}resize(x,v){this._verifyIntegers(x,v),this._core.resize(x,v)}open(x){this._core.open(x)}attachCustomKeyEventHandler(x){this._core.attachCustomKeyEventHandler(x)}attachCustomWheelEventHandler(x){this._core.attachCustomWheelEventHandler(x)}registerLinkProvider(x){return this._core.registerLinkProvider(x)}registerCharacterJoiner(x){return this._checkProposedApi(),this._core.registerCharacterJoiner(x)}deregisterCharacterJoiner(x){this._checkProposedApi(),this._core.deregisterCharacterJoiner(x)}registerMarker(x=0){return this._verifyIntegers(x),this._core.registerMarker(x)}registerDecoration(x){return this._checkProposedApi(),this._verifyPositiveIntegers(x.x??0,x.width??0,x.height??0),this._core.registerDecoration(x)}hasSelection(){return this._core.hasSelection()}select(x,v,b){this._verifyIntegers(x,v,b),this._core.select(x,v,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(x,v){this._verifyIntegers(x,v),this._core.selectLines(x,v)}dispose(){super.dispose()}scrollLines(x){this._verifyIntegers(x),this._core.scrollLines(x)}scrollPages(x){this._verifyIntegers(x),this._core.scrollPages(x)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(x){this._verifyIntegers(x),this._core.scrollToLine(x)}clear(){this._core.clear()}write(x,v){this._core.write(x,v)}writeln(x,v){this._core.write(x),this._core.write(`\r
29
+ `,v)}paste(x){this._core.paste(x)}refresh(x,v){this._verifyIntegers(x,v),this._core.refresh(x,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(x){this._addonManager.loadAddon(this,x)}static get strings(){return a}_verifyIntegers(...x){for(const v of x)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...x){for(const v of x)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}h.Terminal=w})(),u})()))})(Cv)),Cv.exports}var jR=LN(),wv={exports:{}},KC;function AN(){return KC||(KC=1,(function(e,t){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={};return(()=>{var s=n;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const u=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(u._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,u=o._renderService.dimensions;if(u.css.cell.width===0||u.css.cell.height===0)return;const h=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),f=l-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),g=d-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-h;return{cols:Math.max(2,Math.floor(g/u.css.cell.width)),rows:Math.max(1,Math.floor(f/u.css.cell.height))}}}})(),n})()))})(wv)),wv.exports}var NR=AN(),Ev={exports:{}},YC;function ON(){return YC||(YC=1,(function(e,t){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={6:(h,a)=>{function l(p){try{const f=new URL(p),g=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return p.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(p,f,g,S={}){this._terminal=p,this._regex=f,this._handler=g,this._options=S}provideLinks(p,f){const g=d.computeLink(p,this._regex,this._terminal,this._handler);f(this._addCallbacks(g))}_addCallbacks(p){return p.map((f=>(f.leave=this._options.leave,f.hover=(g,S)=>{if(this._options.hover){const{range:C}=f;this._options.hover(g,S,C)}},f)))}};class d{static computeLink(f,g,S,C){const w=new RegExp(g.source,(g.flags||"")+"g"),[y,x]=d._getWindowedLineStrings(f-1,S),v=y.join("");let b;const E=[];for(;b=w.exec(v);){const T=b[0];if(!l(T))continue;const[A,M]=d._mapStrIdx(S,x,0,b.index),[L,D]=d._mapStrIdx(S,A,M,T.length);if(A===-1||M===-1||L===-1||D===-1)continue;const H={start:{x:M+1,y:A+1},end:{x:D,y:L+1}};E.push({range:H,text:T,activate:C})}return E}static _getWindowedLineStrings(f,g){let S,C=f,w=f,y=0,x="";const v=[];if(S=g.buffer.active.getLine(f)){const b=S.translateToString(!0);if(S.isWrapped&&b[0]!==" "){for(y=0;(S=g.buffer.active.getLine(--C))&&y<2048&&(x=S.translateToString(!0),y+=x.length,v.push(x),S.isWrapped&&x.indexOf(" ")===-1););v.reverse()}for(v.push(b),y=0;(S=g.buffer.active.getLine(++w))&&S.isWrapped&&y<2048&&(x=S.translateToString(!0),y+=x.length,v.push(x),x.indexOf(" ")===-1););}return[v,C]}static _mapStrIdx(f,g,S,C){const w=f.buffer.active,y=w.getNullCell();let x=S;for(;C;){const v=w.getLine(g);if(!v)return[-1,-1];for(let b=x;b<v.length;++b){v.getCell(b,y);const E=y.getChars();if(y.getWidth()&&(C-=E.length||1,b===v.length-1&&E==="")){const T=w.getLine(g+1);T&&T.isWrapped&&(T.getCell(0,y),y.getWidth()===2&&(C+=1))}if(C<0)return[g,b]}g++,x=0}return[g,x]}}a.LinkComputer=d}},s={};function o(h){var a=s[h];if(a!==void 0)return a.exports;var l=s[h]={exports:{}};return n[h](l,l.exports,o),l.exports}var u={};return(()=>{var h=u;Object.defineProperty(h,"__esModule",{value:!0}),h.WebLinksAddon=void 0;const a=o(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(p,f){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}h.WebLinksAddon=class{constructor(p=d,f={}){this._handler=p,this._options=f}activate(p){this._terminal=p;const f=this._options,g=f.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,g,this._handler,f))}dispose(){this._linkProvider?.dispose()}}})(),u})()))})(Ev)),Ev.exports}var BR=ON();function MN({className:e,onReady:t,onResize:n,onContainerReady:s}){const o=R.useRef(null),u=R.useRef(null),h=R.useRef(null),a=R.useRef(n),{setTerminalFocused:l}=K0();R.useEffect(()=>{a.current=n},[n]);const d=R.useCallback(()=>{if(!h.current||!u.current)return;h.current.fit();const{cols:f,rows:g}=u.current;a.current?.(f,g)},[]);R.useEffect(()=>{if(!o.current||u.current)return;const f=new jR.Terminal({cursorBlink:!0,fontSize:13,fontFamily:"JetBrains Mono Variable, Menlo, Monaco, monospace",lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}}),g=new NR.FitAddon,S=new BR.WebLinksAddon;f.loadAddon(g),f.loadAddon(S),f.open(o.current),u.current=f,h.current=g,requestAnimationFrame(()=>{d(),t?.(f),o.current&&s?.(o.current)});const C=()=>l(!0),w=()=>l(!1);f.textarea&&(f.textarea.addEventListener("focus",C),f.textarea.addEventListener("blur",w));const y=setTimeout(()=>{d(),f.refresh(0,f.rows-1)},100),x=()=>{requestAnimationFrame(d)};window.addEventListener("resize",x);const v=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{d(),f.refresh(0,f.rows-1)})};document.addEventListener("visibilitychange",v);const b=new ResizeObserver(x);b.observe(o.current);const E=new IntersectionObserver(T=>{T[0]?.isIntersecting&&requestAnimationFrame(()=>{d(),f.refresh(0,f.rows-1)})},{threshold:.1});return E.observe(o.current),()=>{clearTimeout(y),window.removeEventListener("resize",x),document.removeEventListener("visibilitychange",v),b.disconnect(),E.disconnect(),f.textarea&&(f.textarea.removeEventListener("focus",C),f.textarea.removeEventListener("blur",w)),l(!1),f.dispose(),u.current=null,h.current=null}},[d,t,s,l]);const p=R.useCallback(()=>{u.current?.scrollToBottom()},[]);return _.jsxs("div",{className:"relative h-full w-full max-w-full",children:[_.jsx("div",{ref:o,className:He("h-full w-full max-w-full overflow-hidden bg-[#0a0a0a] p-2",e)}),_.jsx("button",{onClick:p,className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:_.jsx(_e,{icon:Y2,size:20,strokeWidth:2})})]})}function DN({name:e,status:t,exitCode:n,className:s,onRename:o}){const[u,h]=R.useState(!1),[a,l]=R.useState(e),d=R.useRef(null);R.useEffect(()=>{u&&d.current&&(d.current.focus(),d.current.select())},[u]);const p=()=>{o&&(l(e),h(!0))},f=()=>{const S=a.trim();S&&S!==e&&o&&o(S),h(!1)},g=S=>{S.key==="Enter"?f():S.key==="Escape"&&h(!1)};return _.jsxs("div",{className:He("flex h-6 items-center gap-2 border-b border-border bg-card px-2 text-xs",s),children:[_.jsx("span",{className:He("h-2 w-2 shrink-0 rounded-full",{"bg-green-500":t==="running","bg-zinc-500":t==="exited"&&n===0,"bg-red-500":t==="exited"&&n!==0,"bg-yellow-500":t==="error"})}),u?_.jsx("input",{ref:d,type:"text",value:a,onChange:S=>l(S.target.value),onBlur:f,onKeyDown:g,className:"h-4 w-24 rounded border border-border bg-background px-1 text-xs font-medium text-foreground outline-none focus:border-primary"}):_.jsx("span",{className:He("font-medium text-foreground",o&&"cursor-pointer hover:text-primary"),onDoubleClick:p,title:o?"Double-click to rename":void 0,children:e}),t==="exited"&&n!==void 0&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"ml-auto text-muted-foreground",children:"·"}),_.jsxs("span",{className:He({"text-muted-foreground":n===0,"text-red-400":n!==0}),children:["exit ",n]})]})]})}function zR({...e}){return _.jsx(P9,{"data-slot":"dropdown-menu",...e})}function HR({...e}){return _.jsx(j9,{"data-slot":"dropdown-menu-trigger",...e})}function VR({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:s=4,className:o,...u}){return _.jsx(S9,{children:_.jsx(C9,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:s,children:_.jsx(b9,{"data-slot":"dropdown-menu-content",className:He("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",o),...u})})})}function kv({className:e,inset:t,variant:n="default",...s}){return _.jsx(_9,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:He("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...s})}function PN({...e}){return _.jsx(E9,{"data-slot":"dropdown-menu-radio-group",...e})}function IN({className:e,children:t,...n}){return _.jsxs(R9,{"data-slot":"dropdown-menu-radio-item",className:He("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[_.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none","data-slot":"dropdown-menu-radio-item-indicator",children:_.jsx(T9,{children:_.jsx(_e,{icon:Ma,strokeWidth:2})})}),t]})}const jN="";function FR(){return Bn({mutationFn:async e=>{const t=await fetch(`${jN}/api/git/sync`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Sync failed")}return t.json()}})}const NN="";function UR(){return Bn({mutationFn:async e=>{const t=await fetch(`${NN}/api/git/merge-to-main`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Merge failed")}return t.json()}})}const BN="";function WR(){return Bn({mutationFn:async e=>{const t=await fetch(`${BN}/api/git/sync-parent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Sync parent failed")}return t.json()}})}function zN({repoPath:e,worktreePath:t,baseBranch:n,taskId:s,isMobile:o}){const u=FR(),h=UR(),a=WR(),l=W0(),d=async()=>{try{await u.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),Nr.success("Synced from main")}catch(S){const C=S instanceof Error?S.message:"Sync failed";Nr.error(C)}},p=async()=>{try{await h.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),Nr.success("Merged to main"),l.mutate({taskId:s,updates:{status:"DONE"}})}catch(S){const C=S instanceof Error?S.message:"Merge failed";Nr.error(C)}},f=async()=>{try{await a.mutateAsync({repoPath:e,baseBranch:n}),Nr.success("Parent synced with origin")}catch(S){const C=S instanceof Error?S.message:"Sync parent failed";Nr.error(C)}},g=u.isPending||h.isPending||a.isPending;return o?_.jsxs(zR,{children:[_.jsx(HR,{className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground",children:_.jsx(_e,{icon:v4,size:12,strokeWidth:2,className:g?"animate-pulse":""})}),_.jsxs(VR,{align:"end",children:[_.jsxs(kv,{onClick:d,disabled:u.isPending,children:[_.jsx(_e,{icon:n_,size:12,strokeWidth:2,className:u.isPending?"animate-spin":""}),"Pull from main"]}),_.jsxs(kv,{onClick:p,disabled:h.isPending,children:[_.jsx(_e,{icon:r_,size:12,strokeWidth:2,className:h.isPending?"animate-pulse":""}),"Merge to main"]}),_.jsxs(kv,{onClick:f,disabled:a.isPending,children:[_.jsx(_e,{icon:a_,size:12,strokeWidth:2,className:a.isPending?"animate-spin":""}),"Sync parent with origin"]})]})]}):_.jsxs(_.Fragment,{children:[_.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:d,disabled:u.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Pull from main",children:_.jsx(_e,{icon:n_,size:12,strokeWidth:2,className:u.isPending?"animate-spin":""})}),_.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:p,disabled:h.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Merge to main",children:_.jsx(_e,{icon:r_,size:12,strokeWidth:2,className:h.isPending?"animate-pulse":""})}),_.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:f,disabled:a.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:_.jsx(_e,{icon:a_,size:12,strokeWidth:2,className:a.isPending?"animate-spin":""})})]})}function HN({terminal:e,taskInfo:t,isMobile:n,onClose:s,onReady:o,onResize:u,onRename:h,onContainerReady:a}){return _.jsxs("div",{className:"flex h-full min-w-0 flex-col overflow-hidden",children:[_.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:t?_.jsxs("div",{className:"flex flex-1 items-center gap-2 px-2 py-1",children:[_.jsxs(qn,{to:"/tasks/$taskId",params:{taskId:t.taskId},className:"flex items-center gap-1.5 rounded px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 truncate",children:[_.jsx(_e,{icon:o0,size:14,strokeWidth:2,className:"shrink-0"}),_.jsx("span",{className:"truncate",children:t.title})]}),!n&&_.jsxs(_.Fragment,{children:[_.jsx(qn,{to:t.repoId?"/repositories/$repoId":"/repositories",params:t.repoId?{repoId:t.repoId}:void 0,className:"text-xs font-medium text-foreground shrink-0 cursor-pointer hover:underline",children:t.repoName}),e.cwd&&_.jsx("span",{className:"text-xs text-muted-foreground truncate",children:e.cwd.split("/").pop()})]}),_.jsx("div",{className:"ml-auto flex items-center gap-0.5",children:_.jsx(zN,{repoPath:t.repoPath,worktreePath:t.worktreePath,baseBranch:t.baseBranch,taskId:t.taskId,isMobile:n})})]}):_.jsxs(_.Fragment,{children:[_.jsx(DN,{name:e.name,status:e.status,exitCode:e.exitCode,className:"flex-1 border-b-0",onRename:h}),s&&_.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:s,className:"mr-1 h-5 w-5 text-muted-foreground hover:text-foreground",children:_.jsx(_e,{icon:_o,size:12,strokeWidth:2})})]})}),_.jsx("div",{className:"min-h-0 min-w-0 flex-1",children:_.jsx(MN,{onReady:o,onResize:u,onContainerReady:a})})]})}function VN({onAdd:e}){return _.jsx("div",{className:"flex h-full items-center justify-center bg-[#0a0a0a]",children:e?_.jsxs(Be,{variant:"outline",size:"sm",onClick:e,className:"gap-2",children:[_.jsx(_e,{icon:rc,size:14,strokeWidth:2}),"New Terminal"]}):_.jsx("p",{className:"text-xs text-muted-foreground",children:"No terminals"})})}function FN(e){return e<=1?{rows:1,cols:1}:e<=2?{rows:1,cols:2}:e<=4?{rows:2,cols:2}:e<=6?{rows:2,cols:3}:e<=9?{rows:3,cols:3}:{rows:3,cols:4}}function UN(){const[e,t]=R.useState(!1);return R.useEffect(()=>{const n=window.matchMedia("(max-width: 639px)");t(n.matches);const s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}function WN({terminals:e,onTerminalClose:t,onTerminalAdd:n,onTerminalReady:s,onTerminalResize:o,onTerminalRename:u,onTerminalContainerReady:h,taskInfoByCwd:a}){const l=UN();if(e.length===0)return _.jsx(VN,{onAdd:n});const{rows:d,cols:p}=FN(e.length),f=[];for(let S=0;S<d;S++){const C=S*p,w=Math.min(C+p,e.length);C<e.length&&f.push(e.slice(C,w))}const g=S=>_.jsx(HN,{terminal:S,taskInfo:S.cwd?a?.get(S.cwd):void 0,isMobile:l,onClose:t?()=>t(S.id):void 0,onReady:s?C=>s(S.id,C):void 0,onResize:o?(C,w)=>o(S.id,C,w):void 0,onRename:u?C=>u(S.id,C):void 0,onContainerReady:h?C=>h(S.id,C):void 0});return e.length===1?_.jsx("div",{className:"h-full w-full max-w-full min-w-0 overflow-hidden",children:g(e[0])}):e.length===2?_.jsxs(ta,{direction:l?"vertical":"horizontal",className:"h-full max-w-full",children:[_.jsx(ts,{defaultSize:50,minSize:15,children:g(e[0])},e[0].id),_.jsx(na,{}),_.jsx(ts,{defaultSize:50,minSize:15,children:g(e[1])},e[1].id)]}):e.length===3?_.jsxs(ta,{direction:"horizontal",className:"h-full max-w-full",children:[_.jsx(ts,{defaultSize:50,minSize:15,children:g(e[0])},e[0].id),_.jsx(na,{}),_.jsx(ts,{defaultSize:50,minSize:15,children:_.jsxs(ta,{direction:"vertical",className:"h-full max-w-full",children:[_.jsx(ts,{defaultSize:50,minSize:15,children:g(e[1])},e[1].id),_.jsx(na,{}),_.jsx(ts,{defaultSize:50,minSize:15,children:g(e[2])},e[2].id)]})})]}):_.jsx(ta,{direction:"vertical",className:"h-full max-w-full",children:f.map((S,C)=>_.jsxs(R.Fragment,{children:[C>0&&_.jsx(na,{}),_.jsx(ts,{defaultSize:100/f.length,minSize:15,children:S.length===1?g(S[0]):_.jsx(ta,{direction:"horizontal",className:"h-full max-w-full",children:S.map((w,y)=>_.jsxs(R.Fragment,{children:[y>0&&_.jsx(na,{}),_.jsx(ts,{defaultSize:100/p,minSize:15,children:g(w)})]},w.id))})})]},`row-${C}`))})}function qN({tabs:e,activeTabId:t,onTabSelect:n,onTabClose:s,onTabCreate:o,onTabRename:u}){const[h,a]=R.useState(null),[l,d]=R.useState(""),p=R.useRef(null);R.useEffect(()=>{h&&p.current&&(p.current.focus(),p.current.select())},[h]);const f=C=>{a(C.id),d(C.name)},g=()=>{h&&l.trim()&&u(h,l.trim()),a(null)},S=C=>{C.key==="Enter"?g():C.key==="Escape"&&a(null)};return _.jsxs("div",{className:"flex items-center gap-1",children:[e.map(C=>_.jsx("button",{onClick:()=>n(C.id),onDoubleClick:()=>f(C),className:He("group relative flex items-center gap-1.5 rounded-t-md border-x border-t px-3 py-1.5 text-xs transition-colors max-sm:px-2 max-sm:py-1",C.id===t?"border-border bg-background text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:h===C.id?_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(Wt,{ref:p,value:l,onChange:w=>d(w.target.value),onBlur:g,onKeyDown:S,className:"h-5 w-20 px-1 text-xs"}),_.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:g,className:"h-4 w-4",children:_.jsx(_e,{icon:S4,size:12,strokeWidth:2})})]}):_.jsxs(_.Fragment,{children:[C.name,e.length>1&&_.jsx("button",{onClick:w=>{w.stopPropagation(),s(C.id)},className:"ml-1 rounded opacity-0 hover:bg-muted group-hover:opacity-100",children:_.jsx(_e,{icon:_o,size:12,strokeWidth:2})})]})},C.id)),_.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:o,className:"ml-1",children:_.jsx(_e,{icon:rc,size:14,strokeWidth:2})})]})}async function GN(e){const t=new FormData;t.append("file",e);const n=await fetch("/api/uploads",{method:"POST",body:t});if(!n.ok)throw new Error("Failed to upload image");return(await n.json()).path}function $N(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}function ey(e={}){const{url:t=$N(),reconnectInterval:n=2e3,maxReconnectAttempts:s=10}=e,[o,u]=R.useState([]),[h,a]=R.useState(!1),[l,d]=R.useState([]),[p,f]=R.useState(!1),g=R.useRef(null),S=R.useRef(0),C=R.useRef(void 0),w=R.useRef(new Map),y=R.useRef(new Set),x=R.useRef(new Map),v=R.useRef(()=>{}),b=R.useCallback(U=>{g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify(U))},[]),E=R.useCallback(U=>{try{const P=JSON.parse(U.data);switch(P.type){case"terminals:list":u(P.payload.terminals),a(!0);break;case"terminal:created":u(B=>[...B,P.payload.terminal]),P.payload.isNew&&y.current.add(P.payload.terminal.id);break;case"terminal:output":{const B=w.current.get(P.payload.terminalId);B&&B.write(P.payload.data);break}case"terminal:attached":{const B=w.current.get(P.payload.terminalId);B&&P.payload.buffer&&B.write(P.payload.buffer);const I=x.current.get(P.payload.terminalId);I&&(x.current.delete(P.payload.terminalId),I());break}case"terminal:exit":u(B=>B.map(I=>I.id===P.payload.terminalId?{...I,status:"exited",exitCode:P.payload.exitCode}:I));break;case"terminal:error":console.error("Terminal error:",P.payload.error);break;case"terminal:renamed":u(B=>B.map(I=>I.id===P.payload.terminalId?{...I,name:P.payload.name}:I));break;case"terminal:destroyed":w.current.delete(P.payload.terminalId),u(B=>B.filter(I=>I.id!==P.payload.terminalId));break;case"terminal:tabAssigned":u(B=>B.map(I=>I.id===P.payload.terminalId?{...I,tabId:P.payload.tabId??void 0,positionInTab:P.payload.positionInTab}:I));break;case"tabs:list":d(P.payload.tabs);break;case"tab:created":d(B=>[...B,P.payload.tab].sort((I,W)=>I.position-W.position));break;case"tab:renamed":d(B=>B.map(I=>I.id===P.payload.tabId?{...I,name:P.payload.name}:I));break;case"tab:deleted":d(B=>B.filter(I=>I.id!==P.payload.tabId));break;case"tab:reordered":d(B=>B.map(I=>I.id===P.payload.tabId?{...I,position:P.payload.position}:I).sort((I,W)=>I.position-W.position));break}}catch(P){console.error("Failed to parse WebSocket message:",P)}},[]),T=R.useCallback(()=>{const U=g.current;if(U&&(U.readyState===WebSocket.CONNECTING||U.readyState===WebSocket.OPEN))return;const P=new WebSocket(t);g.current=P,P.onopen=()=>{f(!0),S.current=0},P.onmessage=E,P.onclose=()=>{f(!1),a(!1),g.current===P&&(g.current=null),S.current<s&&(S.current++,C.current=setTimeout(()=>v.current(),n))},P.onerror=()=>{}},[t,n,s,E]);v.current=T,R.useEffect(()=>(T(),()=>{C.current&&clearTimeout(C.current),g.current&&(g.current.close(),g.current=null)}),[T]);const A=R.useCallback(U=>{b({type:"terminal:create",payload:U})},[b]),M=R.useCallback(U=>{b({type:"terminal:destroy",payload:{terminalId:U}}),w.current.delete(U),u(P=>P.filter(B=>B.id!==U))},[b]),L=R.useCallback((U,P)=>{b({type:"terminal:input",payload:{terminalId:U,data:P}})},[b]),D=R.useCallback((U,P,B)=>{b({type:"terminal:resize",payload:{terminalId:U,cols:P,rows:B}})},[b]),H=R.useCallback((U,P)=>{b({type:"terminal:rename",payload:{terminalId:U,name:P}})},[b]),z=R.useCallback((U,P,B)=>{b({type:"terminal:assignTab",payload:{terminalId:U,tabId:P,positionInTab:B}})},[b]),q=R.useCallback((U,P)=>{b({type:"tab:create",payload:{name:U,position:P}})},[b]),j=R.useCallback((U,P)=>{b({type:"tab:rename",payload:{tabId:U,name:P}})},[b]),K=R.useCallback(U=>{b({type:"tab:delete",payload:{tabId:U}})},[b]),$=R.useCallback((U,P)=>{b({type:"tab:reorder",payload:{tabId:U,position:P}})},[b]),F=R.useCallback((U,P,B)=>{w.current.set(U,P);const I=P.onData(W=>{L(U,W)});return B?.onAttached&&x.current.set(U,B.onAttached),b({type:"terminal:attach",payload:{terminalId:U}}),()=>{I.dispose(),w.current.delete(U),x.current.delete(U)}},[b,L]),G=R.useCallback((U,P)=>{const B=async I=>{const W=I.clipboardData?.items;if(W){for(const Y of W)if(Y.type.startsWith("image/")){I.preventDefault(),I.stopPropagation();const J=Y.getAsFile();if(!J)return;try{const Z=await GN(J);L(P,Z)}catch(Z){console.error("Failed to upload image:",Z)}return}}};return U.addEventListener("paste",B,!0),()=>{U.removeEventListener("paste",B,!0)}},[L]);return{terminals:o,terminalsLoaded:h,tabs:l,connected:p,newTerminalIds:y.current,createTerminal:A,destroyTerminal:M,writeToTerminal:L,resizeTerminal:D,renameTerminal:H,assignTerminalToTab:z,createTab:q,renameTab:j,deleteTab:K,reorderTab:$,attachXterm:F,setupImagePaste:G}}const Ps="all-tasks",XC=["IN_PROGRESS","IN_REVIEW"],KN=ws("/terminals/")({component:YN});function YN(){const{terminals:e,tabs:t,connected:n,createTerminal:s,destroyTerminal:o,renameTerminal:u,assignTerminalToTab:h,createTab:a,renameTab:l,deleteTab:d,attachXterm:p,resizeTerminal:f,setupImagePaste:g}=ey(),{activeTabId:S,setActiveTab:C,isLoading:w}=vR();R.useEffect(()=>{if(t.length>0&&!w){const Z=t.map(ee=>ee.id);(!S||!Z.includes(S)&&S!==Ps)&&C(t[0].id)}},[t,S,w,C]);const{data:y=[]}=U0(),{data:x=[]}=G0(),{data:v}=uR(),[b,E]=R.useState(null),T=R.useMemo(()=>{const Z=new Map;for(const ee of x)Z.set(ee.path,ee.id);return Z},[x]),A=R.useMemo(()=>new Set(y.filter(Z=>XC.includes(Z.status)&&Z.worktreePath).map(Z=>Z.worktreePath)),[y]),M=R.useMemo(()=>new Set(y.filter(Z=>Z.worktreePath).map(Z=>Z.worktreePath)),[y]),L=R.useMemo(()=>{const Z=new Map;for(const ee of y)ee.worktreePath&&Z.set(ee.worktreePath,{taskId:ee.id,repoId:T.get(ee.repoPath),repoName:ee.repoName,title:ee.title,repoPath:ee.repoPath,worktreePath:ee.worktreePath,baseBranch:ee.baseBranch,branch:ee.branch});return Z},[y,T]),D=R.useMemo(()=>{const Z=new Set(y.filter(ee=>XC.includes(ee.status)).map(ee=>ee.repoName));return Array.from(Z).sort()},[y]),H=R.useRef(new Map),z=R.useRef(new Map),q=R.useRef(new Map),j=R.useRef(0);R.useEffect(()=>{if(v)for(const Z of e){const ee=Z.cwd?.startsWith(v),X=Z.cwd&&M.has(Z.cwd);ee&&!X&&o(Z.id)}},[e,M,v,o]);const K=R.useMemo(()=>S===Ps?e.filter(Z=>Z.cwd&&A.has(Z.cwd)).filter(Z=>b?y.find(X=>X.worktreePath===Z.cwd)?.repoName===b:!0).sort((Z,ee)=>{const X=y.find(se=>se.worktreePath===Z.cwd),V=y.find(se=>se.worktreePath===ee.cwd);return!X||!V?0:new Date(V.createdAt).getTime()-new Date(X.createdAt).getTime()}):e.filter(Z=>Z.tabId===S).sort((Z,ee)=>(Z.positionInTab??0)-(ee.positionInTab??0)),[S,e,A,b,y]),$=R.useCallback(()=>{j.current++;const ee=e.filter(X=>X.tabId===S).length;s({name:`Terminal ${j.current}`,cols:80,rows:24,tabId:S??void 0,positionInTab:ee})},[s,S,e]);R.useEffect(()=>{for(const Z of e)Z.cwd&&M.has(Z.cwd)&&Z.tabId&&h(Z.id,null)},[e,M,h]);const F=R.useCallback(Z=>{const ee=q.current.get(Z);if(!ee||z.current.has(Z))return;const X=g(ee,Z);z.current.set(Z,X)},[g]),G=R.useCallback(Z=>{const ee=H.current.get(Z);ee&&(ee(),H.current.delete(Z));const X=z.current.get(Z);X&&(X(),z.current.delete(Z)),q.current.delete(Z),o(Z)},[o]),U=R.useCallback((Z,ee)=>{const X=p(Z,ee);H.current.set(Z,X)},[p]),P=R.useCallback((Z,ee)=>{q.current.set(Z,ee),F(Z)},[F]),B=R.useCallback((Z,ee,X)=>{f(Z,ee,X)},[f]),I=R.useCallback((Z,ee)=>{u(Z,ee)},[u]),W=R.useCallback(()=>{const Z=t.length;a(`Tab ${Z+1}`)},[a,t.length]),Y=R.useCallback(Z=>{const ee=e.filter(X=>X.tabId===Z);for(const X of ee)G(X.id);d(Z)},[e,d,G]),J=t.map((Z,ee)=>({id:Z.id,name:Z.name,layout:"single",position:ee}));return _.jsxs("div",{className:"flex h-full max-w-full flex-col overflow-hidden",children:[_.jsxs("div",{className:"sticky top-0 z-10 flex shrink-0 items-center justify-between border-b border-border bg-muted/30 px-2 py-1",children:[_.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto",children:_.jsx(qN,{tabs:J,activeTabId:S??"",onTabSelect:C,onTabClose:Y,onTabCreate:W,onTabRename:l})}),_.jsxs("div",{className:"flex shrink-0 items-center gap-3 max-sm:gap-1",children:[S===Ps&&D.length>1&&_.jsxs(Il,{value:b??"",onValueChange:Z=>E(Z||null),children:[_.jsxs(Nl,{size:"sm",className:"max-sm:w-auto",children:[_.jsx(_e,{icon:J2,size:12,strokeWidth:2,className:"text-muted-foreground"}),_.jsx(jl,{children:b||"All Repos"})]}),_.jsxs(Bl,{children:[_.jsx(gr,{value:"",children:"All Repos"}),D.map(Z=>_.jsx(gr,{value:Z,children:Z},Z))]})]}),_.jsxs("button",{onClick:()=>C(Ps),className:He("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors max-sm:px-2",S===Ps?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[_.jsx(_e,{icon:Ah,size:12,strokeWidth:2}),_.jsx("span",{className:"max-sm:hidden",children:"Task Terminals"})]}),_.jsxs(Be,{variant:"outline",size:"sm",onClick:$,disabled:!n||e.length>=12||S===Ps,className:"max-sm:px-2",children:[_.jsx(_e,{icon:rc,size:14,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"New Terminal"})]})]})]}),_.jsx("div",{className:"pixel-grid min-w-0 flex-1 overflow-hidden",children:_.jsx(WN,{terminals:K,onTerminalClose:S===Ps?void 0:G,onTerminalAdd:n&&S!==Ps?$:void 0,onTerminalReady:U,onTerminalResize:B,onTerminalRename:S===Ps?void 0:I,onTerminalContainerReady:P,taskInfoByCwd:S===Ps?L:void 0})})]})}function XN(e){if(Array.isArray(e))return e}function QN(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,o,u,h,a=[],l=!0,d=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(l=(s=u.call(n)).done)&&(a.push(s.value),a.length!==t);l=!0);}catch(p){d=!0,o=p}finally{try{if(!l&&n.return!=null&&(h=n.return(),Object(h)!==h))return}finally{if(d)throw o}}return a}}function x_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function qR(e,t){if(e){if(typeof e=="string")return x_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x_(e,t):void 0}}function ZN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GR(e,t){return XN(e)||QN(e,t)||qR(e,t)||ZN()}var Rv={},xu={},QC;function $R(){if(QC)return xu;QC=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.bind=void 0;function e(t,n){var s=n.type,o=n.listener,u=n.options;return t.addEventListener(s,o,u),function(){t.removeEventListener(s,o,u)}}return xu.bind=e,xu}var Xo={},ZC;function JN(){if(ZC)return Xo;ZC=1;var e=Xo&&Xo.__assign||function(){return e=Object.assign||function(u){for(var h,a=1,l=arguments.length;a<l;a++){h=arguments[a];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(u[d]=h[d])}return u},e.apply(this,arguments)};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.bindAll=void 0;var t=$R();function n(u){if(!(typeof u>"u"))return typeof u=="boolean"?{capture:u}:u}function s(u,h){if(h==null)return u;var a=e(e({},u),{options:e(e({},n(h)),n(u.options))});return a}function o(u,h,a){var l=h.map(function(d){var p=s(d,a);return(0,t.bind)(u,p)});return function(){l.forEach(function(p){return p()})}}return Xo.bindAll=o,Xo}var JC;function e7(){return JC||(JC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=$R();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=JN();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})})(Rv)),Rv}var Ql=e7(),KR="data-pdnd-honey-pot";function YR(e){return e instanceof Element&&e.hasAttribute(KR)}function XR(e){var t=document.elementsFromPoint(e.x,e.y),n=GR(t,2),s=n[0],o=n[1];return s?YR(s)?o??null:s:null}function $u(e){"@babel/helpers - typeof";return $u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$u(e)}function t7(e,t){if($u(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if($u(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n7(e){var t=t7(e,"string");return $u(t)=="symbol"?t:t+""}function pd(e,t,n){return(t=n7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var QR=2147483647;function ew(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function tw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ew(Object(n),!0).forEach(function(s){pd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ew(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var Ku=2,nw=Ku/2;function r7(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function s7(e){return{x:e.x-nw,y:e.y-nw}}function i7(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function o7(e){return{x:Math.min(e.x,window.innerWidth-Ku),y:Math.min(e.y,window.innerHeight-Ku)}}function rw(e){var t=e.client,n=o7(i7(s7(r7(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:Ku,height:Ku})}function sw(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function a7(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function l7(e){var t=e.initial,n=document.createElement("div");n.setAttribute(KR,"true");var s=rw({client:t});Object.assign(n.style,tw(tw({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},sw({clientRect:s})),{},{pointerEvents:"auto",zIndex:QR})),document.body.appendChild(n);var o=Ql.bind(window,{type:"pointermove",listener:function(h){var a={x:h.clientX,y:h.clientY};s=rw({client:a}),Object.assign(n.style,sw({clientRect:s}))},options:{capture:!0}});return function(h){var a=h.current;if(o(),a7({client:a,clientRect:s})){n.remove();return}function l(){d(),n.remove()}var d=Ql.bindAll(window,[{type:"pointerdown",listener:l},{type:"pointermove",listener:l},{type:"focusin",listener:l},{type:"focusout",listener:l},{type:"dragstart",listener:l},{type:"dragenter",listener:l},{type:"dragover",listener:l}],{capture:!0})}}function c7(){var e=null;function t(){return e=null,Ql.bind(window,{type:"pointermove",listener:function(o){e={x:o.clientX,y:o.clientY}},options:{capture:!0}})}function n(){var s=null;return function(u){var h=u.eventName,a=u.payload;if(h==="onDragStart"){var l=a.location.initial.input,d=e??{x:l.clientX,y:l.clientY};s=l7({initial:d})}if(h==="onDrop"){var p,f=a.location.current.input;(p=s)===null||p===void 0||p({current:{x:f.clientX,y:f.clientY}}),s=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function u7(e){if(Array.isArray(e))return x_(e)}function d7(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function f7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZR(e){return u7(e)||d7(e)||qR(e)||f7()}function Ha(e){var t=null;return function(){if(!t){for(var s=arguments.length,o=new Array(s),u=0;u<s;u++)o[u]=arguments[u];var h=e.apply(this,o);t={result:h}}return t.result}}var h7=Ha(function(){return navigator.userAgent.includes("Firefox")}),md=Ha(function(){var t=navigator,n=t.userAgent;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),S_={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function p7(e){var t=e.dragLeave;return md()?t.hasOwnProperty(S_.isLeavingWindow):!1}(function(){if(typeof window>"u"||!md())return;function t(){return{enterCount:0,isOverWindow:!1}}var n=t();function s(){n=t()}Ql.bindAll(window,[{type:"dragstart",listener:function(){n.enterCount=0,n.isOverWindow=!0}},{type:"drop",listener:s},{type:"dragend",listener:s},{type:"dragenter",listener:function(u){!n.isOverWindow&&n.enterCount===0&&(u[S_.isEnteringWindow]=!0),n.isOverWindow=!0,n.enterCount++}},{type:"dragleave",listener:function(u){n.enterCount--,n.isOverWindow&&n.enterCount===0&&(u[S_.isLeavingWindow]=!0,n.isOverWindow=!1)}}],{capture:!0})})();function m7(e){return"nodeName"in e}function g7(e){return m7(e)&&e.ownerDocument!==document}function v7(e){var t=e.dragLeave,n=t.type,s=t.relatedTarget;return n!=="dragleave"?!1:md()?p7({dragLeave:t}):s==null?!0:h7()?g7(s):s instanceof HTMLIFrameElement}function _7(e){var t=e.onDragEnd;return[{type:"pointermove",listener:(function(){var n=0;return function(){if(n<20){n++;return}t()}})()},{type:"pointerdown",listener:t}]}function Pu(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var y7=function(t){var n=[],s=null,o=function(){for(var h=arguments.length,a=new Array(h),l=0;l<h;l++)a[l]=arguments[l];n=a,!s&&(s=requestAnimationFrame(function(){s=null,t.apply(void 0,n)}))};return o.cancel=function(){s&&(cancelAnimationFrame(s),s=null)},o},Tv=y7(function(e){return e()}),rh=(function(){var e=null;function t(s){var o=requestAnimationFrame(function(){e=null,s()});e={frameId:o,fn:s}}function n(){e&&(cancelAnimationFrame(e.frameId),e.fn(),e=null)}return{schedule:t,flush:n}})();function b7(e){var t=e.source,n=e.initial,s=e.dispatchEvent,o={dropTargets:[]};function u(a){s(a),o={dropTargets:a.payload.location.current.dropTargets}}var h={start:function(l){var d=l.nativeSetDragImage,p={current:n,previous:o,initial:n};u({eventName:"onGenerateDragPreview",payload:{source:t,location:p,nativeSetDragImage:d}}),rh.schedule(function(){u({eventName:"onDragStart",payload:{source:t,location:p}})})},dragUpdate:function(l){var d=l.current;rh.flush(),Tv.cancel(),u({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:o,current:d}}})},drag:function(l){var d=l.current;Tv(function(){rh.flush();var p={initial:n,previous:o,current:d};u({eventName:"onDrag",payload:{source:t,location:p}})})},drop:function(l){var d=l.current,p=l.updatedSourcePayload;rh.flush(),Tv.cancel(),u({eventName:"onDrop",payload:{source:p??t,location:{current:d,previous:o,initial:n}}})}};return h}var C_={isActive:!1};function JR(){return!C_.isActive}function x7(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function S7(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var s=0;s<t.length;s++)if(t[s].element!==n[s].element)return!0;return!1}function C7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=e.dispatchEvent;if(!JR())return;var u=w7({event:t,dragType:n,getDropTargetsOver:s});C_.isActive=!0;var h={current:u};Lv({event:t,current:u.dropTargets});var a=b7({source:n.payload,dispatchEvent:o,initial:u});function l(S){var C=S7({current:h.current.dropTargets,next:S.dropTargets});h.current=S,C&&a.dragUpdate({current:h.current})}function d(S){var C=Pu(S),w=YR(S.target)?XR({x:C.clientX,y:C.clientY}):S.target,y=s({target:w,input:C,source:n.payload,current:h.current.dropTargets});y.length&&(S.preventDefault(),Lv({event:S,current:y})),l({dropTargets:y,input:C})}function p(){h.current.dropTargets.length&&l({dropTargets:[],input:h.current.input}),a.drop({current:h.current,updatedSourcePayload:null}),f()}function f(){C_.isActive=!1,g()}var g=Ql.bindAll(window,[{type:"dragover",listener:function(C){d(C),a.drag({current:h.current})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(C){v7({dragLeave:C})&&(l({input:h.current.input,dropTargets:[]}),n.startedFrom==="external"&&p())}},{type:"drop",listener:function(C){if(h.current={dropTargets:h.current.dropTargets,input:Pu(C)},!h.current.dropTargets.length){p();return}C.preventDefault(),Lv({event:C,current:h.current.dropTargets}),a.drop({current:h.current,updatedSourcePayload:n.type==="external"?n.getDropPayload(C):null}),f()}},{type:"dragend",listener:function(C){h.current={dropTargets:h.current.dropTargets,input:Pu(C)},p()}}].concat(ZR(_7({onDragEnd:p}))),{capture:!0});a.start({nativeSetDragImage:x7(t)})}function Lv(e){var t,n=e.event,s=e.current,o=(t=s[0])===null||t===void 0?void 0:t.dropEffect;o!=null&&n.dataTransfer&&(n.dataTransfer.dropEffect=o)}function w7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=Pu(t);if(n.startedFrom==="external")return{input:o,dropTargets:[]};var u=s({input:o,source:n.payload,target:t.target,current:[]});return{input:o,dropTargets:u}}var iw={canStart:JR,start:C7},w_=new Map;function E7(e){var t=e.typeKey,n=e.mount,s=w_.get(t);if(s)return s.usageCount++,s;var o={typeKey:t,unmount:n(),usageCount:1};return w_.set(t,o),o}function k7(e){var t=E7(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),w_.delete(e.typeKey))}}function Ap(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(o){return o()})}}function eT(e,t){var n=t.attribute,s=t.value;return e.setAttribute(n,s),function(){return e.removeAttribute(n)}}function ow(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function to(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ow(Object(n),!0).forEach(function(s){pd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ow(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Av(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=R7(e))||t){n&&(e=n);var s=0,o=function(){};return{s:o,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,h=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var d=n.next();return h=d.done,d},e:function(d){a=!0,u=d},f:function(){try{h||n.return==null||n.return()}finally{if(a)throw u}}}}function R7(e,t){if(e){if(typeof e=="string")return aw(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aw(e,t):void 0}}function aw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function Ov(e){return e.slice(0).reverse()}function T7(e){var t=e.typeKey,n=e.defaultDropEffect,s=new WeakMap,o="data-drop-target-for-".concat(t),u="[".concat(o,"]");function h(S){return s.set(S.element,S),function(){return s.delete(S.element)}}function a(S){var C=Ap(eT(S.element,{attribute:o,value:"true"}),h(S));return Ha(C)}function l(S){var C,w,y,x,v=S.source,b=S.target,E=S.input,T=S.result,A=T===void 0?[]:T;if(b==null)return A;if(!(b instanceof Element))return b instanceof Node?l({source:v,target:b.parentElement,input:E,result:A}):A;var M=b.closest(u);if(M==null)return A;var L=s.get(M);if(L==null)return A;var D={input:E,source:v,element:L.element};if(L.canDrop&&!L.canDrop(D))return l({source:v,target:L.element.parentElement,input:E,result:A});var H=(C=(w=L.getData)===null||w===void 0?void 0:w.call(L,D))!==null&&C!==void 0?C:{},z=(y=(x=L.getDropEffect)===null||x===void 0?void 0:x.call(L,D))!==null&&y!==void 0?y:n,q={data:H,element:L.element,dropEffect:z,isActiveDueToStickiness:!1};return l({source:v,target:L.element.parentElement,input:E,result:[].concat(ZR(A),[q])})}function d(S){var C=S.eventName,w=S.payload,y=Av(w.location.current.dropTargets),x;try{for(y.s();!(x=y.n()).done;){var v,b=x.value,E=s.get(b.element),T=to(to({},w),{},{self:b});E==null||(v=E[C])===null||v===void 0||v.call(E,T)}}catch(A){y.e(A)}finally{y.f()}}var p={onGenerateDragPreview:d,onDrag:d,onDragStart:d,onDrop:d,onDropTargetChange:function(C){var w=C.payload,y=new Set(w.location.current.dropTargets.map(function(G){return G.element})),x=new Set,v=Av(w.location.previous.dropTargets),b;try{for(v.s();!(b=v.n()).done;){var E,T=b.value;x.add(T.element);var A=s.get(T.element),M=y.has(T.element),L=to(to({},w),{},{self:T});if(A==null||(E=A.onDropTargetChange)===null||E===void 0||E.call(A,L),!M){var D;A==null||(D=A.onDragLeave)===null||D===void 0||D.call(A,L)}}}catch(G){v.e(G)}finally{v.f()}var H=Av(w.location.current.dropTargets),z;try{for(H.s();!(z=H.n()).done;){var q,j,K=z.value;if(!x.has(K.element)){var $=to(to({},w),{},{self:K}),F=s.get(K.element);F==null||(q=F.onDropTargetChange)===null||q===void 0||q.call(F,$),F==null||(j=F.onDragEnter)===null||j===void 0||j.call(F,$)}}}catch(G){H.e(G)}finally{H.f()}}};function f(S){p[S.eventName](S)}function g(S){var C=S.source,w=S.target,y=S.input,x=S.current,v=l({source:C,target:w,input:y});if(v.length>=x.length)return v;for(var b=Ov(x),E=Ov(v),T=[],A=0;A<b.length;A++){var M,L=b[A],D=E[A];if(D!=null){T.push(D);continue}var H=T[A-1],z=b[A-1];if(H?.element!==z?.element)break;var q=s.get(L.element);if(!q)break;var j={input:y,source:C,element:q.element};if(q.canDrop&&!q.canDrop(j)||!((M=q.getIsSticky)!==null&&M!==void 0&&M.call(q,j)))break;T.push(to(to({},L),{},{isActiveDueToStickiness:!0}))}return Ov(T)}return{dropTargetForConsumers:a,getIsOver:g,dispatchEvent:f}}function L7(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=A7(e))||t){n&&(e=n);var s=0,o=function(){};return{s:o,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,h=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var d=n.next();return h=d.done,d},e:function(d){a=!0,u=d},f:function(){try{h||n.return==null||n.return()}finally{if(a)throw u}}}}function A7(e,t){if(e){if(typeof e=="string")return lw(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lw(e,t):void 0}}function lw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function cw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function O7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cw(Object(n),!0).forEach(function(s){pd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function M7(){var e=new Set,t=null;function n(u){t&&(!u.canMonitor||u.canMonitor(t.canMonitorArgs))&&t.active.add(u)}function s(u){var h=O7({},u);e.add(h),n(h);function a(){e.delete(h),t&&t.active.delete(h)}return Ha(a)}function o(u){var h=u.eventName,a=u.payload;if(h==="onGenerateDragPreview"){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var l=L7(e),d;try{for(l.s();!(d=l.n()).done;){var p=d.value;n(p)}}catch(y){l.e(y)}finally{l.f()}}if(t){for(var f=Array.from(t.active),g=0,S=f;g<S.length;g++){var C=S[g];if(t.active.has(C)){var w;(w=C[h])===null||w===void 0||w.call(C,a)}}h==="onDrop"&&(t.active.clear(),t=null)}}return{dispatchEvent:o,monitorForConsumers:s}}function D7(e){var t=e.typeKey,n=e.mount,s=e.dispatchEventToSource,o=e.onPostDispatch,u=e.defaultDropEffect,h=M7(),a=T7({typeKey:t,defaultDropEffect:u});function l(f){s?.(f),a.dispatchEvent(f),h.dispatchEvent(f),o?.(f)}function d(f){var g=f.event,S=f.dragType;iw.start({event:g,dragType:S,getDropTargetsOver:a.getIsOver,dispatchEvent:l})}function p(){function f(){var g={canStart:iw.canStart,start:d};return n(g)}return k7({typeKey:t,mount:f})}return{registerUsage:p,dropTarget:a.dropTargetForConsumers,monitor:h.monitorForConsumers}}var tT=Ha(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),P7="pdnd:android-fallback",uw="text/plain",I7="text/uri-list",j7="application/vnd.pdnd",qh=new WeakMap;function N7(e){return qh.set(e.element,e),function(){qh.delete(e.element)}}var dw=c7(),ty=D7({typeKey:"element",defaultDropEffect:"move",mount:function(t){return Ap(dw.bindEvents(),Ql.bind(document,{type:"dragstart",listener:function(s){var o,u,h,a,l,d;if(t.canStart(s)&&!s.defaultPrevented&&s.dataTransfer){var p=s.target;if(p instanceof HTMLElement){var f=qh.get(p);if(f){var g=Pu(s),S={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:g};if(f.canDrag&&!f.canDrag(S)){s.preventDefault();return}if(f.dragHandle){var C=XR({x:g.clientX,y:g.clientY});if(!f.dragHandle.contains(C)){s.preventDefault();return}}var w=(u=(h=f.getInitialDataForExternal)===null||h===void 0?void 0:h.call(f,S))!==null&&u!==void 0?u:null;if(w)for(var y=0,x=Object.entries(w);y<x.length;y++){var v=GR(x[y],2),b=v[0],E=v[1];s.dataTransfer.setData(b,E??"")}tT()&&!s.dataTransfer.types.includes(uw)&&!s.dataTransfer.types.includes(I7)&&s.dataTransfer.setData(uw,P7),s.dataTransfer.setData(j7,"");var T={element:f.element,dragHandle:(a=f.dragHandle)!==null&&a!==void 0?a:null,data:(l=(d=f.getInitialData)===null||d===void 0?void 0:d.call(f,S))!==null&&l!==void 0?l:{}},A={type:"element",payload:T,startedFrom:"internal"};t.start({event:s,dragType:A})}}}}}))},dispatchEventToSource:function(t){var n,s,o=t.eventName,u=t.payload;(n=qh.get(u.source.element))===null||n===void 0||(s=n[o])===null||s===void 0||s.call(n,u)},onPostDispatch:dw.getOnPostDispatch()}),ny=ty.dropTarget,nT=ty.monitor;function B7(e){var t=Ap(ty.registerUsage(),N7(e),eT(e.element,{attribute:"draggable",value:"true"}));return Ha(t)}function fw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function hw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fw(Object(n),!0).forEach(function(s){pd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var z7={top:function(t,n){return Math.abs(n.y-t.top)},right:function(t,n){return Math.abs(t.right-n.x)},bottom:function(t,n){return Math.abs(t.bottom-n.y)},left:function(t,n){return Math.abs(n.x-t.left)}},rT=Symbol("closestEdge");function H7(e,t){var n,s,o=t.element,u=t.input,h=t.allowedEdges,a={x:u.clientX,y:u.clientY},l=o.getBoundingClientRect(),d=h.map(function(f){return{edge:f,value:z7[f](l,a)}}),p=(n=(s=d.sort(function(f,g){return f.value-g.value})[0])===null||s===void 0?void 0:s.edge)!==null&&n!==void 0?n:null;return hw(hw({},e),{},pd({},rT,p))}function E_(e){var t;return(t=e[rT])!==null&&t!==void 0?t:null}function V7(){return{x:0,y:0}}function F7(e){var t=e.render,n=e.nativeSetDragImage,s=e.getOffset,o=s===void 0?V7:s,u=document.createElement("div");Object.assign(u.style,{position:"fixed",top:0,left:0,zIndex:QR,pointerEvents:"none"}),document.body.append(u);var h=t({container:u});queueMicrotask(function(){var d=o({container:u});if(md()){var p=u.getBoundingClientRect();if(p.width===0)return;u.style.left="-".concat(p.width-1e-4,"px")}n?.(u,d.x,d.y)});function a(){l(),h?.(),document.body.removeChild(u)}var l=nT({onDragStart:a,onDrop:a})}var U7=Ha(function(){return md()&&"ontouchend"in document}),W7=function(t){var n=t.container,s=n.getBoundingClientRect();return{x:s.width/2,y:s.height/2}};function q7(e){return function(n){var s=n.container;if(U7()||tT())return W7({container:s});Object.assign(s.style,{borderInlineStart:"".concat(e.x," solid transparent"),borderTop:"".concat(e.y," solid transparent")});var o=window.getComputedStyle(s);if(o.direction==="rtl"){var u=s.getBoundingClientRect();return{x:u.width,y:0}}return{x:0,y:0}}}const sT=R.forwardRef(({className:e,...t},n)=>_.jsx(f9,{ref:n,className:He("peer size-4 shrink-0 rounded border border-input ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-checked:bg-primary data-checked:border-primary data-checked:text-primary-foreground","flex items-center justify-center transition-colors",e),...t,children:_.jsx(h9,{className:"flex items-center justify-center",children:_.jsx(_e,{icon:Ma,size:12,strokeWidth:3})})}));sT.displayName="Checkbox";const iT=R.createContext(null);function G7({children:e}){const[t,n]=R.useState(!1),[s,o]=R.useState(new Set),u=R.useCallback(p=>{o(f=>{const g=new Set(f);return g.has(p)?g.delete(p):g.add(p),g})},[]),h=R.useCallback(p=>{o(new Set(p))},[]),a=R.useCallback(()=>{o(new Set)},[]),l=R.useCallback(()=>{n(!1),o(new Set)},[]),d=R.useCallback(p=>s.has(p),[s]);return _.jsx(iT.Provider,{value:{selectMode:t,setSelectMode:n,selectedIds:s,isSelected:d,toggle:u,selectAll:h,clearSelection:a,exitSelectMode:l,selectedCount:s.size},children:e})}function oT(){const e=R.useContext(iT);if(!e)throw new Error("useSelection must be used within a SelectionProvider");return e}const aT=R.createContext(null);function $7({children:e}){const[t,n]=R.useState(null);return _.jsx(aT.Provider,{value:{activeTask:t,setActiveTask:n},children:e})}function lT(){const e=R.useContext(aT);if(!e)throw new Error("useDrag must be used within DragProvider");return e}function K7(e){return e.match(/\/issue\/([A-Z]+-\d+)/i)?.[1]??null}function cT({task:e,open:t,onOpenChange:n}){const s=W0(),[o,u]=R.useState(e.title),[h,a]=R.useState(e.description||""),[l,d]=R.useState(e.prUrl||""),[p,f]=R.useState(e.linearTicketUrl||"");R.useEffect(()=>{t&&(u(e.title),a(e.description||""),d(e.prUrl||""),f(e.linearTicketUrl||""))},[t,e]);const g=()=>{const C={},w=o.trim();if(!w)return;w!==e.title&&(C.title=w);const y=h.trim();y!==(e.description||"")&&(C.description=y);const x=l.trim();x!==(e.prUrl||"")&&(C.prUrl=x||null);const v=p.trim();v!==(e.linearTicketUrl||"")&&(C.linearTicketUrl=v||null,C.linearTicketId=v?K7(v):null),Object.keys(C).length>0&&s.mutate({taskId:e.id,updates:C}),n(!1)},S=C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),g())};return _.jsx(xs,{open:t,onOpenChange:n,children:_.jsxs(Ss,{className:"sm:max-w-md",onKeyDown:S,children:[_.jsx(Bs,{children:_.jsx(zs,{children:"Task Settings"})}),_.jsxs(cd,{className:"mt-4",children:[_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"config-title",children:"Title"}),_.jsx(Wt,{id:"config-title",value:o,onChange:C=>u(C.target.value),autoFocus:!0})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"config-description",children:"Description"}),_.jsx(wp,{id:"config-description",value:h,onChange:C=>a(C.target.value),rows:3})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"config-pr-url",children:"GitHub PR URL"}),_.jsx(Wt,{id:"config-pr-url",value:l,onChange:C=>d(C.target.value),placeholder:"https://github.com/owner/repo/pull/123"})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"config-linear-url",children:"Linear Ticket URL"}),_.jsx(Wt,{id:"config-linear-url",value:p,onChange:C=>f(C.target.value),placeholder:"https://linear.app/team/issue/TEAM-123"})]})]}),_.jsxs(go,{className:"mt-4",children:[_.jsx(Be,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),_.jsx(Be,{onClick:g,disabled:!o.trim(),children:"Save"})]})]})})}function uT({task:e,isDragPreview:t}){const{selectMode:n,isSelected:s,toggle:o}=oT(),{setActiveTask:u}=lT(),h=s(e.id),a=yo(),l=R.useRef(null),[d,p]=R.useState(!1),[f,g]=R.useState(null),[S,C]=R.useState(null),[w,y]=R.useState(!1),x=R.useRef(!1);R.useEffect(()=>{const T=l.current;if(!(!T||n||t))return Ap(B7({element:T,getInitialData:()=>({type:"task",taskId:e.id,status:e.status}),onGenerateDragPreview:({nativeSetDragImage:A})=>{F7({nativeSetDragImage:A,getOffset:q7({x:"16px",y:"8px"}),render:({container:M})=>{C(M)}})},onDragStart:()=>{p(!0),u(e),x.current=!0},onDrop:()=>{p(!1),u(null),C(null)}}),ny({element:T,getData:({input:A,element:M})=>{const L={type:"task",taskId:e.id,status:e.status};return H7(L,{input:A,element:M,allowedEdges:["top","bottom"]})},canDrop:({source:A})=>A.data.taskId!==e.id,onDragEnter:({self:A})=>{g(E_(A.data))},onDrag:({self:A})=>{g(E_(A.data))},onDragLeave:()=>{g(null)},onDrop:()=>{g(null)}}))},[e,n,t,u]);const v=()=>{x.current=!1},b=T=>{if(n){T.preventDefault(),o(e.id);return}x.current||a({to:"/tasks/$taskId",params:{taskId:e.id}}),x.current=!1},E=_.jsxs(fd,{ref:t?void 0:l,onPointerDown:v,onClick:b,className:He("transition-shadow hover:shadow-md relative",n?"cursor-pointer":"cursor-grab active:cursor-grabbing",d&&"opacity-50",h&&"ring-2 ring-primary"),children:[f&&_.jsx("div",{className:He("absolute left-0 right-0 h-0.5 bg-primary z-10",f==="top"&&"-top-1",f==="bottom"&&"-bottom-1")}),n&&_.jsx("div",{className:"absolute right-2 top-2 z-10 cursor-pointer",onClick:T=>{T.stopPropagation(),o(e.id)},children:_.jsx(sT,{checked:h,className:"cursor-pointer pointer-events-none"})}),_.jsxs(Fj,{className:He("p-3 pb-1 flex flex-row items-start justify-between gap-2",n&&"pr-8"),children:[_.jsx(Uj,{className:"text-sm font-medium leading-tight flex-1",children:e.title}),!n&&!t&&_.jsx("button",{type:"button",className:"shrink-0 p-0.5 -m-0.5 rounded hover:bg-muted transition-colors cursor-pointer",onClick:T=>{T.stopPropagation(),y(!0)},onPointerDown:T=>T.stopPropagation(),children:_.jsx(_e,{icon:nE,size:14,strokeWidth:2,className:"text-muted-foreground"})})]}),_.jsxs(hd,{className:"p-3 pt-1",children:[e.description&&_.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:e.description}),_.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-muted-foreground/70",children:[_.jsx(_e,{icon:os,size:12,strokeWidth:2}),_.jsx("span",{children:e.repoName}),e.prUrl&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-muted-foreground/30",children:"•"}),_.jsx(_e,{icon:i0,size:12,strokeWidth:2,className:"text-foreground"})]}),e.linearTicketId&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-muted-foreground/30",children:"•"}),_.jsx(_e,{icon:o0,size:12,strokeWidth:2,className:"text-foreground"})]})]})]})]});return _.jsxs(_.Fragment,{children:[E,S&&er.createPortal(_.jsx("div",{className:"w-72 max-w-[90vw]",children:_.jsx(uT,{task:e,isDragPreview:!0})}),S),_.jsx(cT,{task:e,open:w,onOpenChange:y})]})}const Y7={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},X7={IN_PROGRESS:"border-t-slate-400",IN_REVIEW:"border-t-violet-400",DONE:"border-t-emerald-400",CANCELED:"border-t-rose-500"};function pw({status:e,tasks:t,isMobile:n}){const s=R.useRef(null),[o,u]=R.useState(!1),h=[...t].sort((a,l)=>a.position-l.position);return R.useEffect(()=>{const a=s.current;if(a)return ny({element:a,getData:()=>({type:"column",status:e}),canDrop:({source:l})=>l.data.type==="task",onDragEnter:()=>u(!0),onDragLeave:()=>u(!1),onDrop:()=>u(!1)})},[e]),_.jsxs("div",{ref:s,className:He("flex flex-col rounded-lg border border-t-4 bg-card",n?"h-full w-full":"h-full w-72 flex-shrink-0",X7[e],o&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[!n&&_.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[_.jsx("h3",{className:"text-sm font-medium",children:Y7[e]}),_.jsx("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-muted px-1.5 text-xs font-medium",children:t.length})]}),_.jsx(Yl,{className:"min-h-0 flex-1",children:_.jsx("div",{className:"flex flex-col gap-2 p-2",children:h.map(a=>_.jsx(uT,{task:a},a.id))})})]})}const Mv=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED"],dT={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"};function Q7({status:e}){const t=R.useRef(null),[n,s]=R.useState(!1);return R.useEffect(()=>{const o=t.current;if(o)return ny({element:o,getData:()=>({type:"column",status:e}),canDrop:({source:u})=>u.data.type==="task",onDragEnter:()=>s(!0),onDragLeave:()=>s(!1),onDrop:()=>s(!1)})},[e]),_.jsx("div",{ref:t,className:He("flex-1 rounded-lg border-2 border-dashed px-3 py-2 text-center text-xs font-medium transition-colors",n?"border-primary bg-primary/10 text-primary":"border-muted-foreground/30 text-muted-foreground"),children:dT[e]})}function Z7({repoFilter:e}){const{data:t=[],isLoading:n}=U0(),s=xI(),{activeTask:o}=lT(),[u,h]=R.useState("IN_PROGRESS"),a=R.useMemo(()=>e?t.filter(d=>d.repoName===e):t,[t,e]),l=R.useMemo(()=>{const d={IN_PROGRESS:0,IN_REVIEW:0,DONE:0,CANCELED:0};for(const p of a)d[p.status]++;return d},[a]);return R.useEffect(()=>nT({canMonitor:({source:d})=>d.data.type==="task",onDrop:({source:d,location:p})=>{const f=p.current.dropTargets;if(f.length===0)return;const g=d.data.taskId,S=a.find(y=>y.id===g);if(!S)return;const C=f[0],w=C.data;if(w.type==="column"){const y=w.status;if(y!==S.status){const x=a.filter(v=>v.status===y);s.mutate({taskId:g,status:y,position:x.length})}}else if(w.type==="task"){const y=E_(C.data),x=w.status,v=a.filter(T=>T.status===x).sort((T,A)=>T.position-A.position),b=v.findIndex(T=>T.id===w.taskId);let E=b;y==="bottom"&&(E=b+1),S.status===x&&v.findIndex(A=>A.id===g)<b&&(E=Math.max(0,E-1)),(S.status!==x||E!==S.position)&&s.mutate({taskId:g,status:x,position:E})}}}),[a,s]),n?_.jsx("div",{className:"flex h-full items-center justify-center",children:_.jsx("p",{className:"text-muted-foreground",children:"Loading tasks..."})}):_.jsxs("div",{className:"flex h-full flex-col",children:[_.jsx("div",{className:"border-b lg:hidden",children:_.jsx(_a,{value:u,onValueChange:d=>h(d),children:_.jsx(ya,{variant:"line",className:"w-full justify-start px-4",children:Mv.map(d=>_.jsxs(ir,{value:d,className:"gap-1.5",children:[_.jsx("span",{className:"truncate",children:dT[d]}),_.jsx("span",{className:"text-muted-foreground",children:l[d]})]},d))})})}),_.jsx("div",{className:"pixel-grid hidden h-full justify-center gap-4 overflow-x-auto p-4 lg:flex",children:Mv.map(d=>_.jsx(pw,{status:d,tasks:a.filter(p=>p.status===d)},d))}),_.jsx("div",{className:"pixel-grid flex-1 overflow-y-auto p-4 lg:hidden",children:_.jsx(pw,{status:u,tasks:a.filter(d=>d.status===u),isMobile:!0})}),o&&_.jsx("div",{className:"fixed inset-x-0 bottom-0 flex gap-2 border-t bg-background/95 p-4 backdrop-blur-sm lg:hidden",children:Mv.filter(d=>d!==u).map(d=>_.jsx(Q7,{status:d},d))})]})}function J7(e){return _.jsx($7,{children:_.jsx(Z7,{...e})})}const eB=ws("/tasks/")({component:tB});function tB(){return _.jsx(G7,{children:_.jsx(nB,{})})}function nB(){const{selectMode:e,setSelectMode:t,selectedIds:n,selectedCount:s,exitSelectMode:o}=oT(),u=CI(),{data:h=[]}=U0(),[a,l]=R.useState(null),d=R.useMemo(()=>{const f=new Set(h.map(g=>g.repoName));return Array.from(f).sort()},[h]),p=()=>{const f=Array.from(n);u.mutate(f,{onSuccess:()=>{o()}})};return _.jsxs("div",{className:"flex h-full flex-col",children:[_.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:e?_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-sm font-medium",children:s>0?`${s} selected`:"Select tasks"}),_.jsxs(Be,{variant:"ghost",size:"sm",onClick:o,className:"max-sm:px-2",children:[_.jsx(_e,{icon:_o,size:14,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Cancel"})]})]}),_.jsxs(uc,{children:[_.jsxs(dc,{render:_.jsx(Be,{variant:"destructive",size:"sm",disabled:u.isPending||s===0,className:"max-sm:px-2"}),children:[_.jsx(_e,{icon:ed,size:14,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:u.isPending?"Deleting...":"Delete"}),s>0&&_.jsxs("span",{className:"max-sm:hidden",children:[" (",s,")"]})]}),_.jsxs(fc,{children:[_.jsxs(hc,{children:[_.jsxs(mc,{children:["Delete ",s," Tasks"]}),_.jsx(gc,{children:"This will permanently delete the selected tasks and remove their worktrees. This action cannot be undone."})]}),_.jsxs(pc,{children:[_.jsx(vc,{children:"Cancel"}),_.jsx(yR,{onClick:p,variant:"destructive",disabled:u.isPending,children:u.isPending?"Deleting...":"Delete All"})]})]})]})]}):_.jsxs(_.Fragment,{children:[_.jsx("h1",{className:"text-sm font-medium max-sm:hidden",children:"Tasks"}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs(Il,{value:a??"",onValueChange:f=>l(f||null),children:[_.jsxs(Nl,{size:"sm",className:"max-sm:w-auto",children:[_.jsx(_e,{icon:J2,size:12,strokeWidth:2,className:"text-muted-foreground"}),_.jsx(jl,{children:a||"All Repos"})]}),_.jsxs(Bl,{children:[_.jsx(gr,{value:"",children:"All Repos"}),d.map(f=>_.jsx(gr,{value:f,children:f},f))]})]}),_.jsxs(Be,{variant:"ghost",size:"sm",onClick:()=>t(!0),className:"max-sm:px-2",children:[_.jsx(_e,{icon:s4,size:14,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Select"})]})]})]})}),_.jsx("div",{className:"flex-1 overflow-hidden",children:_.jsx(J7,{repoFilter:a})})]})}const rB=ws("/settings/")({component:sB});function Su({title:e,children:t}){return _.jsxs("div",{className:"relative rounded-lg border border-border bg-card p-4 pt-6",children:[_.jsx("span",{className:"absolute -top-2.5 left-3 bg-card px-2 text-xs font-medium text-muted-foreground",children:e}),t]})}function sB(){const{data:e,isLoading:t}=MI(),{data:n,isLoading:s}=q0(),{data:o,isLoading:u}=dR(),{data:h,isLoading:a}=Tp(),{data:l,isLoading:d}=Lp(),{data:p,isLoading:f}=DI(),{data:g,isLoading:S}=PI(),{data:C,isLoading:w}=NI(),y=II(),x=jI(),v=BI(),b=zI(),[E,T]=R.useState(""),[A,M]=R.useState(""),[L,D]=R.useState(""),[H,z]=R.useState(""),[q,j]=R.useState(""),[K,$]=R.useState(""),[F,G]=R.useState(""),[U,P]=R.useState(!1),[B,I]=R.useState(!1),[W,Y]=R.useState(!1),[J,Z]=R.useState(!1),[ee,X]=R.useState(!1),[V,se]=R.useState(""),[ne,re]=R.useState(!1),[oe,le]=R.useState(""),[ve,ue]=R.useState(!1),[he,de]=R.useState(""),[Ne,Me]=R.useState("");R.useEffect(()=>{e!==void 0&&T(String(e)),n!==void 0&&M(n),o!==void 0&&D(o),h!==void 0&&z(h),l!==void 0&&j(String(l)),p!==void 0&&$(p),g!==void 0&&G(g)},[e,n,o,h,l,p,g]),R.useEffect(()=>{C&&(Y(C.enabled),Z(C.sound?.enabled??!1),X(C.slack?.enabled??!1),se(C.slack?.webhookUrl??""),re(C.discord?.enabled??!1),le(C.discord?.webhookUrl??""),ue(C.pushover?.enabled??!1),de(C.pushover?.appToken??""),Me(C.pushover?.userKey??""))},[C]);const Ae=t||s||u||a||d||f||S||w,be=C&&(W!==C.enabled||J!==(C.sound?.enabled??!1)||ee!==(C.slack?.enabled??!1)||V!==(C.slack?.webhookUrl??"")||ne!==(C.discord?.enabled??!1)||oe!==(C.discord?.webhookUrl??"")||ve!==(C.pushover?.enabled??!1)||he!==(C.pushover?.appToken??"")||Ne!==(C.pushover?.userKey??"")),Oe=E!==String(e)||A!==n||L!==o||H!==h||q!==String(l)||K!==p||F!==g||be,me=async()=>{const xe=[];if(E!==String(e)){const Ve=parseInt(E,10);!isNaN(Ve)&&Ve>=1&&Ve<=65535&&xe.push(new Promise(Ee=>{y.mutate({key:sn.PORT,value:Ve},{onSettled:Ee})}))}if(A!==n&&xe.push(new Promise(Ve=>{y.mutate({key:sn.DEFAULT_GIT_REPOS_DIR,value:A},{onSettled:Ve})})),L!==o&&xe.push(new Promise(Ve=>{y.mutate({key:sn.TASK_CREATION_COMMAND,value:L},{onSettled:Ve})})),H!==h&&xe.push(new Promise(Ve=>{y.mutate({key:sn.HOSTNAME,value:H},{onSettled:Ve})})),q!==String(l)){const Ve=parseInt(q,10);!isNaN(Ve)&&Ve>=1&&Ve<=65535&&xe.push(new Promise(Ee=>{y.mutate({key:sn.SSH_PORT,value:Ve},{onSettled:Ee})}))}K!==p&&xe.push(new Promise(Ve=>{y.mutate({key:sn.LINEAR_API_KEY,value:K},{onSettled:Ve})})),F!==g&&xe.push(new Promise(Ve=>{y.mutate({key:sn.GITHUB_PAT,value:F},{onSettled:Ve})})),be&&xe.push(new Promise(Ve=>{v.mutate({enabled:W,sound:{enabled:J},slack:{enabled:ee,webhookUrl:V},discord:{enabled:ne,webhookUrl:oe},pushover:{enabled:ve,appToken:he,userKey:Ne}},{onSettled:Ve})})),await Promise.all(xe),I(!0),setTimeout(()=>I(!1),2e3)},ke=()=>{x.mutate(sn.PORT,{onSuccess:xe=>{xe.value!==null&&T(String(xe.value))}})},Ce=()=>{x.mutate(sn.DEFAULT_GIT_REPOS_DIR,{onSuccess:xe=>{xe.value&&M(String(xe.value))}})},qe=()=>{x.mutate(sn.TASK_CREATION_COMMAND,{onSuccess:xe=>{xe.value!==null&&xe.value!==void 0&&D(String(xe.value))}})},De=()=>{x.mutate(sn.HOSTNAME,{onSuccess:xe=>{xe.value!==null&&xe.value!==void 0&&z(String(xe.value))}})},Ie=()=>{x.mutate(sn.SSH_PORT,{onSuccess:xe=>{xe.value!==null&&xe.value!==void 0&&j(String(xe.value))}})},rt=()=>{x.mutate(sn.LINEAR_API_KEY,{onSuccess:xe=>{$(xe.value!==null&&xe.value!==void 0?String(xe.value):"")}})},et=()=>{x.mutate(sn.GITHUB_PAT,{onSuccess:xe=>{G(xe.value!==null&&xe.value!==void 0?String(xe.value):"")}})},dt=async xe=>{b.mutate(xe,{onSuccess:Ve=>{Ve.success?Nr.success(`${xe} test successful`):Nr.error(`${xe} test failed: ${Ve.error}`)},onError:Ve=>{Nr.error(`Test failed: ${Ve.message}`)}})};return _.jsxs("div",{className:"flex h-full flex-col",children:[_.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:_.jsx("h1",{className:"text-sm font-medium",children:"Settings"})}),_.jsx("div",{className:"pixel-grid flex-1 overflow-auto p-6",children:_.jsxs("div",{className:"mx-auto max-w-5xl space-y-4",children:[_.jsx(Su,{title:"Server & Defaults",children:_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"space-y-1",children:[_.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[_.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:"Port"}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Wt,{type:"number",min:1,max:65535,value:E,onChange:xe=>T(xe.target.value),placeholder:"3333",disabled:Ae,className:"w-24 font-mono text-sm"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:ke,disabled:Ae||x.isPending,title:"Reset to default",children:_.jsx(_e,{icon:$o,size:14,strokeWidth:2})})]})]}),_.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:"Requires restart"})]}),_.jsxs("div",{className:"space-y-1",children:[_.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[_.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:"Startup Command"}),_.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[_.jsx(Wt,{value:L,onChange:xe=>D(xe.target.value),placeholder:"claude --dangerously-skip-permissions",disabled:Ae,className:"flex-1 font-mono text-sm"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:qe,disabled:Ae||x.isPending,title:"Reset to default",children:_.jsx(_e,{icon:$o,size:14,strokeWidth:2})})]})]}),_.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:"Command for new task terminals"})]})]})}),_.jsx(Su,{title:"Paths",children:_.jsxs("div",{className:"space-y-1",children:[_.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[_.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:"Git Repos Directory"}),_.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[_.jsx(Wt,{value:A,onChange:xe=>M(xe.target.value),placeholder:"~/projects",disabled:Ae,className:"flex-1 font-mono text-sm"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>P(!0),disabled:Ae,title:"Browse",children:_.jsx(_e,{icon:os,size:14,strokeWidth:2})}),_.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ce,disabled:Ae||x.isPending,title:"Reset to default",children:_.jsx(_e,{icon:$o,size:14,strokeWidth:2})})]})]}),_.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:"Starting directory for repo picker"})]})}),_.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[_.jsx(Su,{title:"Remote Access",children:_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"space-y-1",children:[_.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[_.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"Hostname"}),_.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[_.jsx(Wt,{value:H,onChange:xe=>z(xe.target.value),placeholder:"e.g., citadel",disabled:Ae,className:"flex-1 font-mono text-sm"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:De,disabled:Ae||x.isPending,title:"Reset to default",children:_.jsx(_e,{icon:$o,size:14,strokeWidth:2})})]})]}),_.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:"For VS Code SSH URLs"})]}),_.jsxs("div",{className:"space-y-1",children:[_.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[_.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"SSH Port"}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Wt,{type:"number",min:1,max:65535,value:q,onChange:xe=>j(xe.target.value),placeholder:"22",disabled:Ae,className:"w-20 font-mono text-sm"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ie,disabled:Ae||x.isPending,title:"Reset to default",children:_.jsx(_e,{icon:$o,size:14,strokeWidth:2})})]})]}),_.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:"Remote connection port"})]})]})}),_.jsx(Su,{title:"Integrations",children:_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"space-y-1",children:[_.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[_.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"Linear"}),_.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[_.jsx(Wt,{type:"password",value:K,onChange:xe=>$(xe.target.value),placeholder:"lin_api_...",disabled:Ae,className:"flex-1 font-mono text-sm"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:rt,disabled:Ae||x.isPending,title:"Reset to default",children:_.jsx(_e,{icon:$o,size:14,strokeWidth:2})})]})]}),_.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:"API key for ticket sync"})]}),_.jsxs("div",{className:"space-y-1",children:[_.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[_.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"GitHub"}),_.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[_.jsx(Wt,{type:"password",value:F,onChange:xe=>G(xe.target.value),placeholder:"ghp_...",disabled:Ae,className:"flex-1 font-mono text-sm"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:et,disabled:Ae||x.isPending,title:"Reset to default",children:_.jsx(_e,{icon:$o,size:14,strokeWidth:2})})]})]}),_.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:"PAT for Issues & PRs"})]})]})})]}),_.jsx(Su,{title:"Notifications",children:_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[_.jsx("label",{className:"text-sm text-muted-foreground sm:w-40 sm:shrink-0",children:"Enable Notifications"}),_.jsx(ea,{checked:W,onCheckedChange:Y,disabled:Ae})]}),_.jsx("div",{className:"space-y-2 pl-4",children:_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ea,{checked:J,onCheckedChange:Z,disabled:Ae||!W}),_.jsx("label",{className:"text-sm text-muted-foreground",children:"Sound (macOS only)"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("sound"),disabled:Ae||!W||!J||b.isPending,title:"Test sound",children:b.isPending?_.jsx(_e,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}):_.jsx(_e,{icon:zf,size:14,strokeWidth:2})})]})}),_.jsxs("div",{className:"space-y-2 pl-4",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ea,{checked:ee,onCheckedChange:X,disabled:Ae||!W}),_.jsx("label",{className:"text-sm text-muted-foreground",children:"Slack"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("slack"),disabled:Ae||!W||!ee||!V||b.isPending,title:"Test Slack",children:b.isPending?_.jsx(_e,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}):_.jsx(_e,{icon:zf,size:14,strokeWidth:2})})]}),ee&&_.jsx(Wt,{type:"password",value:V,onChange:xe=>se(xe.target.value),placeholder:"https://hooks.slack.com/services/...",disabled:Ae||!W,className:"ml-6 flex-1 font-mono text-sm"})]}),_.jsxs("div",{className:"space-y-2 pl-4",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ea,{checked:ne,onCheckedChange:re,disabled:Ae||!W}),_.jsx("label",{className:"text-sm text-muted-foreground",children:"Discord"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("discord"),disabled:Ae||!W||!ne||!oe||b.isPending,title:"Test Discord",children:b.isPending?_.jsx(_e,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}):_.jsx(_e,{icon:zf,size:14,strokeWidth:2})})]}),ne&&_.jsx(Wt,{type:"password",value:oe,onChange:xe=>le(xe.target.value),placeholder:"https://discord.com/api/webhooks/...",disabled:Ae||!W,className:"ml-6 flex-1 font-mono text-sm"})]}),_.jsxs("div",{className:"space-y-2 pl-4",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ea,{checked:ve,onCheckedChange:ue,disabled:Ae||!W}),_.jsx("label",{className:"text-sm text-muted-foreground",children:"Pushover"}),_.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("pushover"),disabled:Ae||!W||!ve||!he||!Ne||b.isPending,title:"Test Pushover",children:b.isPending?_.jsx(_e,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}):_.jsx(_e,{icon:zf,size:14,strokeWidth:2})})]}),ve&&_.jsxs("div",{className:"ml-6 space-y-2",children:[_.jsx(Wt,{type:"password",value:he,onChange:xe=>de(xe.target.value),placeholder:"App Token",disabled:Ae||!W,className:"flex-1 font-mono text-sm"}),_.jsx(Wt,{type:"password",value:Ne,onChange:xe=>Me(xe.target.value),placeholder:"User Key",disabled:Ae||!W,className:"flex-1 font-mono text-sm"})]})]})]})}),_.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[B&&_.jsxs("span",{className:"flex items-center gap-1 text-xs text-emerald-500",children:[_.jsx(_e,{icon:Ma,size:12,strokeWidth:2}),"Saved"]}),_.jsx(Be,{size:"sm",onClick:me,disabled:!Oe||Ae||y.isPending,children:"Save Changes"})]})]})}),_.jsx($0,{open:U,onOpenChange:P,onSelect:xe=>M(xe),initialPath:A||void 0})]})}const Op="";function iB(){return Kn({queryKey:["github-user"],queryFn:async()=>{const e=await fetch(`${Op}/api/github/user`);return e.ok?e.json():null},staleTime:600*1e3,retry:!1})}function oB(){return Kn({queryKey:["github-orgs"],queryFn:async()=>{const e=await fetch(`${Op}/api/github/orgs`);return e.ok?e.json():[]},staleTime:600*1e3})}function aB(e,t,n){return Kn({queryKey:["github-issues",e,t,n],queryFn:async()=>{const s=new URLSearchParams({filter:e});t&&s.set("viboraReposOnly","true"),n&&s.set("org",n);const o=await fetch(`${Op}/api/github/issues?${s}`);if(!o.ok)throw new Error("Failed to fetch issues");return o.json()},staleTime:300*1e3})}function lB(e,t,n){return Kn({queryKey:["github-prs",e,t,n],queryFn:async()=>{const s=new URLSearchParams({filter:e});t&&s.set("viboraReposOnly","true"),n&&s.set("org",n);const o=await fetch(`${Op}/api/github/prs?${s}`);if(!o.ok)throw new Error("Failed to fetch PRs");return o.json()},staleTime:300*1e3})}function cB({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=aB(e,t,n);if(o)return _.jsx("div",{className:"flex h-48 items-center justify-center",children:_.jsx(_e,{icon:zr,size:24,className:"animate-spin text-muted-foreground"})});if(u)return _.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[_.jsx(_e,{icon:nc,size:24}),_.jsx("p",{className:"text-sm",children:"Failed to load issues"}),_.jsx("p",{className:"text-xs",children:u.message})]});const h={assigned:"No issues assigned to you",created:"No issues created by you",mentioned:"No issues mentioning you"};return s?.length?_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.length," result",s.length!==1?"s":""]}),_.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:s.map(a=>_.jsx(uB,{issue:a},a.id))})]}):_.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[_.jsx(_e,{icon:Ma,size:24}),_.jsx("p",{className:"text-sm",children:h[e]})]})}function uB({issue:e}){return _.jsx(fd,{className:"transition-colors hover:border-border/80",children:_.jsx(hd,{className:"py-4",children:_.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[_.jsx("div",{className:"flex items-start gap-2",children:_.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),_.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:_.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]})}),e.labels.length>0&&_.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>_.jsx(ba,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&_.jsxs(ba,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}function dB({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=lB(e,t,n);if(o)return _.jsx("div",{className:"flex h-48 items-center justify-center",children:_.jsx(_e,{icon:zr,size:24,className:"animate-spin text-muted-foreground"})});if(u)return _.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[_.jsx(_e,{icon:nc,size:24}),_.jsx("p",{className:"text-sm",children:"Failed to load pull requests"}),_.jsx("p",{className:"text-xs",children:u.message})]});const h={all:"No open pull requests",created:"No pull requests created by you",assigned:"No pull requests assigned to you",review_requested:"No pull requests awaiting your review",mentioned:"No pull requests mentioning you"};return s?.length?_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.length," result",s.length!==1?"s":""]}),_.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:s.map(a=>_.jsx(fB,{pr:a},a.id))})]}):_.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[_.jsx(_e,{icon:Ma,size:24}),_.jsx("p",{className:"text-sm",children:h[e]})]})}function fB({pr:e}){return _.jsx(fd,{className:"transition-colors hover:border-border/80",children:_.jsx(hd,{className:"py-4",children:_.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[_.jsx("div",{className:"flex items-start gap-2",children:_.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),_.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[_.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]}),e.draft&&_.jsx(ba,{variant:"secondary",className:He("text-xs","bg-amber-400/20 text-amber-600 dark:text-amber-400"),children:"Draft"})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[e.author.avatarUrl&&_.jsx("img",{src:e.author.avatarUrl,alt:e.author.login,className:"h-4 w-4 rounded-full"}),_.jsx("span",{className:"text-xs text-muted-foreground",children:e.author.login})]}),e.labels.length>0&&_.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>_.jsx(ba,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&_.jsxs(ba,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}const hB=ws("/review/")({component:pB});function pB(){const[e,t]=R.useState("prs"),[n,s]=R.useState("review_requested"),[o,u]=R.useState("assigned"),[h,a]=R.useState(!1),[l,d]=R.useState(""),{data:p,isLoading:f}=iB(),{data:g=[]}=oB();return!f&&!p?_.jsxs("div",{className:"flex h-full flex-col",children:[_.jsx("div",{className:"flex shrink-0 items-center border-b border-border px-4 py-2",children:_.jsx("h1",{className:"text-sm font-medium",children:"Review"})}),_.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:_.jsxs("div",{className:"max-w-md space-y-4 text-center",children:[_.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:_.jsx(_e,{icon:m4,size:24,className:"text-muted-foreground"})}),_.jsx("h2",{className:"text-lg font-medium",children:"GitHub Token Required"}),_.jsx("p",{className:"text-sm text-muted-foreground",children:"To view your issues and pull requests, add a GitHub Personal Access Token in Settings."}),_.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 p-4 text-left",children:[_.jsx("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Required scopes:"}),_.jsxs("ul",{className:"space-y-1 text-xs text-muted-foreground",children:[_.jsxs("li",{children:["• ",_.jsx("code",{className:"rounded bg-muted px-1",children:"repo"})," (for private repositories)"]}),_.jsxs("li",{children:["• ",_.jsx("code",{className:"rounded bg-muted px-1",children:"read:user"})," (for user info)"]}),_.jsxs("li",{children:["• ",_.jsx("code",{className:"rounded bg-muted px-1",children:"read:org"})," (for organization list)"]})]})]}),_.jsxs("div",{className:"flex flex-col gap-2",children:[_.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,read:user,read:org&description=Vibora",target:"_blank",rel:"noopener noreferrer",children:_.jsxs(Be,{variant:"outline",size:"sm",className:"w-full",children:[_.jsx(_e,{icon:g4,size:14,"data-slot":"icon"}),"Generate Token"]})}),_.jsx(qn,{to:"/settings",children:_.jsx(Be,{size:"sm",className:"w-full",children:"Go to Settings"})})]})]})})]}):_.jsxs("div",{className:"flex h-full flex-col",children:[_.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2 max-sm:px-2",children:[_.jsx("div",{className:"flex items-center gap-4 max-sm:gap-2",children:_.jsx("h1",{className:"text-sm font-medium max-sm:hidden",children:"Review"})}),_.jsxs("div",{className:"flex items-center gap-4 max-sm:gap-2",children:[e==="prs"?_.jsxs(Il,{value:n,onValueChange:S=>s(S),children:[_.jsx(Nl,{size:"sm",className:"max-sm:w-auto",children:_.jsx(jl,{})}),_.jsxs(Bl,{children:[_.jsx(gr,{value:"created",children:"Created by me"}),_.jsx(gr,{value:"assigned",children:"Assigned to me"}),_.jsx(gr,{value:"review_requested",children:"Review requests"}),_.jsx(gr,{value:"mentioned",children:"Mentioned"})]})]}):_.jsxs(Il,{value:o,onValueChange:S=>u(S),children:[_.jsx(Nl,{size:"sm",className:"max-sm:w-auto",children:_.jsx(jl,{})}),_.jsxs(Bl,{children:[_.jsx(gr,{value:"assigned",children:"Assigned to me"}),_.jsx(gr,{value:"created",children:"Created by me"}),_.jsx(gr,{value:"mentioned",children:"Mentioned"})]})]}),_.jsxs(Il,{value:l,onValueChange:S=>d(S||""),children:[_.jsx(Nl,{size:"sm",className:"max-sm:w-auto",children:_.jsx(jl,{children:l||"All Orgs"})}),_.jsxs(Bl,{children:[_.jsx(gr,{value:"",children:"All Organizations"}),g.map(S=>_.jsx(gr,{value:S.login,children:S.login},S.login))]})]}),_.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs",title:"Vibora repos only",children:[_.jsx(ea,{checked:h,onCheckedChange:a,disabled:!!l}),_.jsx("span",{className:"text-muted-foreground max-sm:hidden",children:"Vibora repos only"})]})]})]}),_.jsxs(_a,{value:e,onValueChange:S=>t(S),className:"flex flex-1 flex-col overflow-hidden",children:[_.jsx("div",{className:"shrink-0 border-b border-border px-4",children:_.jsxs(ya,{variant:"line",children:[_.jsx(ir,{value:"prs",children:"Pull Requests"}),_.jsx(ir,{value:"issues",children:"Issues"})]})}),_.jsx(_r,{value:"prs",className:"flex-1 overflow-auto p-4",children:_.jsx(dB,{filter:n,viboraReposOnly:h,org:l||void 0})}),_.jsx(_r,{value:"issues",className:"flex-1 overflow-auto p-4",children:_.jsx(cB,{filter:o,viboraReposOnly:h,org:l||void 0})})]})]})}function Gh(e,t,n){return t?`vscode://vscode-remote/ssh-remote+${n!==22?`${t}:${n}`:t}${e}`:`vscode://file${e}`}const mB=ws("/repositories/")({component:_B});function gB({repository:e,onDelete:t}){const[n,s]=R.useState(!1),[o,u]=R.useState(!1),{data:h}=Tp(),{data:a}=Lp(),l=p=>{p.preventDefault(),p.stopPropagation();const f=Gh(e.path,h,a);window.open(f,"_blank")},d=async p=>{p.preventDefault(),p.stopPropagation(),u(!0);try{await t(),s(!1)}catch{}finally{u(!1)}};return _.jsx(qn,{to:"/repositories/$repoId",params:{repoId:e.id},children:_.jsx(fd,{className:"transition-colors hover:border-border/80 cursor-pointer",children:_.jsxs(hd,{className:"flex flex-col gap-2 py-4",children:[_.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[_.jsx("span",{className:"truncate font-medium",children:e.displayName}),_.jsx(Be,{variant:"ghost",size:"icon-sm",onClick:l,className:"shrink-0 text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:_.jsx(_e,{icon:a0,size:14,strokeWidth:2})})]}),_.jsx("div",{onClick:p=>p.preventDefault(),children:_.jsxs(uc,{open:n,onOpenChange:s,children:[_.jsx(dc,{render:_.jsx(Be,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:p=>p.stopPropagation()}),children:_.jsx(_e,{icon:ed,size:14,strokeWidth:2})}),_.jsxs(fc,{children:[_.jsxs(hc,{children:[_.jsx(mc,{children:"Delete Repository"}),_.jsxs(gc,{children:['This will remove "',e.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),_.jsxs(pc,{children:[_.jsx(vc,{disabled:o,children:"Cancel"}),_.jsxs(Be,{variant:"destructive",onClick:d,disabled:o,className:"gap-2",children:[o&&_.jsx(_e,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})})]}),_.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(_e,{icon:os,size:12,strokeWidth:2,className:"shrink-0"}),_.jsx("span",{className:"truncate font-mono",children:e.path})]}),e.startupScript&&_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(_e,{icon:s0,size:12,strokeWidth:2,className:"shrink-0"}),_.jsx("span",{className:"truncate font-mono",children:e.startupScript})]}),e.copyFiles&&_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(_e,{icon:a4,size:12,strokeWidth:2,className:"shrink-0"}),_.jsx("span",{className:"truncate font-mono",children:e.copyFiles})]})]})]})})})}function vB(){const[e,t]=R.useState(!1),[n,s]=R.useState(!1),[o,u]=R.useState(""),[h,a]=R.useState(""),[l,d]=R.useState(""),[p,f]=R.useState(""),g=fR(),{data:S}=q0(),C=x=>{u(x),h||a(x.split("/").pop()||"")},w=x=>{x.preventDefault(),o.trim()&&g.mutate({path:o.trim(),displayName:h.trim()||o.split("/").pop()||"repo",startupScript:l.trim()||null,copyFiles:p.trim()||null},{onSuccess:()=>{t(!1),u(""),a(""),d(""),f("")}})},y=o?o.split("/").pop():"";return _.jsxs(_.Fragment,{children:[_.jsxs(xs,{open:e,onOpenChange:t,children:[_.jsxs(hk,{render:_.jsx(Be,{size:"sm"}),children:[_.jsx(_e,{icon:rc,size:16,strokeWidth:2,"data-slot":"icon"}),"Add Repository"]}),_.jsx(Ss,{className:"sm:max-w-md",children:_.jsxs("form",{onSubmit:w,children:[_.jsxs(Bs,{children:[_.jsx(zs,{children:"Add Repository"}),_.jsx(aa,{children:"Add a git repository for quick access when creating tasks."})]}),_.jsxs(cd,{className:"mt-4",children:[_.jsxs(Cn,{children:[_.jsx(wn,{children:"Repository Path"}),_.jsxs(Be,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>s(!0),children:[_.jsx(_e,{icon:os,size:14,strokeWidth:2,className:"mr-2"}),y?_.jsx("span",{className:"truncate",children:o}):_.jsx("span",{className:"text-muted-foreground",children:"Select repository..."})]})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"displayName",children:"Display Name"}),_.jsx(Wt,{id:"displayName",value:h,onChange:x=>a(x.target.value),placeholder:y||"My Project"})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"startupScript",children:"Startup Script"}),_.jsx(wp,{id:"startupScript",value:l,onChange:x=>d(x.target.value),placeholder:"npm install && npm run dev",rows:2}),_.jsx(oo,{children:"Command to run in the terminal when creating a worktree."})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"copyFiles",children:"Copy Files"}),_.jsx(Wt,{id:"copyFiles",value:p,onChange:x=>f(x.target.value),placeholder:".env, config.local.json"}),_.jsx(oo,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]}),_.jsxs(go,{className:"mt-4",children:[_.jsx(T0,{render:_.jsx(Be,{variant:"outline",type:"button"}),children:"Cancel"}),_.jsx(Be,{type:"submit",disabled:g.isPending||!o.trim(),children:g.isPending?"Adding...":"Add Repository"})]})]})})]}),_.jsx($0,{open:n,onOpenChange:s,onSelect:C,initialPath:S||void 0})]})}function _B(){const{data:e,isLoading:t,error:n}=G0(),s=hR(),o=async u=>{await s.mutateAsync(u)};return _.jsxs("div",{className:"flex h-full flex-col",children:[_.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[_.jsxs("div",{className:"flex items-center gap-4",children:[_.jsx("h1",{className:"text-sm font-medium",children:"Repositories"}),e&&_.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.length," total"]})]}),_.jsx(vB,{})]}),_.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[t&&_.jsx("div",{className:"flex items-center justify-center py-12",children:_.jsx(_e,{icon:zr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),n&&_.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[_.jsx(_e,{icon:nc,size:20,strokeWidth:2}),_.jsxs("span",{className:"text-sm",children:["Failed to load repositories: ",n.message]})]}),!t&&!n&&e?.length===0&&_.jsx("div",{className:"py-12 text-muted-foreground",children:_.jsx("p",{className:"text-sm",children:"No repositories added yet. Add a repository for quick access when creating tasks."})}),_.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:e?.map(u=>_.jsx(gB,{repository:u,onDelete:()=>o(u.id)},u.id))})]})]})}const yB=()=>`http://${window.location.hostname}:3000`,Cu={activeTab:"diff",browserUrl:yB(),diffOptions:{wrap:!0,ignoreWhitespace:!0,includeUntracked:!1},filesViewState:{selectedFile:null,expandedDirs:[]}};function Mp(e){const t=$n(),n=R.useRef(void 0),s=R.useRef({}),{data:o}=cR(e),u=R.useMemo(()=>{const g=o?.viewState;return g?{activeTab:g.activeTab??Cu.activeTab,browserUrl:g.browserUrl??Cu.browserUrl,diffOptions:{...Cu.diffOptions,...g.diffOptions},filesViewState:{...Cu.filesViewState,...g.filesViewState}}:Cu},[o?.viewState]),h=Bn({mutationFn:async g=>{const S=await fetch(`/api/tasks/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({viewState:g})});if(!S.ok)throw new Error("Failed to update view state");return S.json()},onSuccess:g=>{t.setQueryData(["tasks",e],g),t.setQueryData(["tasks"],S=>S&&S.map(C=>C.id===e?g:C))}}),a=R.useCallback(g=>{const S=s.current;s.current={...S,...g,diffOptions:g.diffOptions||S.diffOptions?{...S.diffOptions,...g.diffOptions}:void 0,filesViewState:g.filesViewState||S.filesViewState?{...S.filesViewState,...g.filesViewState}:void 0};const C=s.current,w={activeTab:C.activeTab??u.activeTab,browserUrl:C.browserUrl??u.browserUrl,diffOptions:{...u.diffOptions,...C.diffOptions},filesViewState:{...u.filesViewState,...C.filesViewState}};t.setQueryData(["tasks",e],y=>y&&{...y,viewState:w}),t.setQueryData(["tasks"],y=>y&&y.map(x=>x.id===e?{...x,viewState:w}:x)),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{h.mutate(w),s.current={}},500)},[t,e,u,h]),l=R.useCallback(g=>{a({activeTab:g})},[a]),d=R.useCallback(g=>{a({browserUrl:g})},[a]),p=R.useCallback(g=>{a({diffOptions:g})},[a]),f=R.useCallback(g=>{a({filesViewState:g})},[a]);return{viewState:u,setActiveTab:l,setBrowserUrl:d,setDiffOptions:p,setFilesViewState:f}}function bB(e){const{viewState:t,setActiveTab:n}=Mp(e);return{tab:t.activeTab,setTab:n}}function xB(e){return Kn({queryKey:["linear-ticket",e],queryFn:async()=>{if(!e)return null;const t=await fetch(`/api/linear/ticket/${e}`);return t.ok?t.json():null},enabled:!!e,staleTime:300*1e3})}function mw({taskName:e,cwd:t,className:n,aiMode:s,description:o,startupScript:u}){const h=R.useRef(null),a=R.useRef(null),l=R.useRef(null),d=R.useRef(!1),p=R.useRef(!1),[f,g]=R.useState(null),[S,C]=R.useState(!1),{data:w}=dR(),{setTerminalFocused:y}=K0(),{terminals:x,terminalsLoaded:v,connected:b,newTerminalIds:E,createTerminal:T,attachXterm:A,resizeTerminal:M,setupImagePaste:L,writeToTerminal:D}=ey(),H=f?x.find(j=>j.id===f):null,z=H?.status;R.useEffect(()=>{if(!h.current||a.current)return;const j=new jR.Terminal({cursorBlink:!0,fontSize:13,fontFamily:"JetBrains Mono Variable, Menlo, Monaco, monospace",lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}}),K=new NR.FitAddon,$=new BR.WebLinksAddon;j.loadAddon(K),j.loadAddon($),j.open(h.current),a.current=j,l.current=K,requestAnimationFrame(()=>{K.fit(),C(!0)});const F=setTimeout(()=>{K.fit(),j.refresh(0,j.rows-1)},100),G=()=>y(!0),U=()=>y(!1);return j.textarea&&(j.textarea.addEventListener("focus",G),j.textarea.addEventListener("blur",U)),()=>{clearTimeout(F),j.textarea&&(j.textarea.removeEventListener("focus",G),j.textarea.removeEventListener("blur",U)),y(!1),j.dispose(),a.current=null,l.current=null,C(!1)}},[y]);const q=R.useCallback(()=>{if(!l.current||!a.current)return;l.current.fit();const{cols:j,rows:K}=a.current;f&&M(f,j,K)},[f,M]);return R.useEffect(()=>{if(!h.current)return;const j=()=>{requestAnimationFrame(q)};window.addEventListener("resize",j);const K=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{q(),a.current&&a.current.refresh(0,a.current.rows-1)})};document.addEventListener("visibilitychange",K);const $=new ResizeObserver(j);$.observe(h.current);const F=new IntersectionObserver(G=>{G[0]?.isIntersecting&&requestAnimationFrame(()=>{q(),a.current&&a.current.refresh(0,a.current.rows-1)})},{threshold:.1});return F.observe(h.current),()=>{window.removeEventListener("resize",j),document.removeEventListener("visibilitychange",K),$.disconnect(),F.disconnect()}},[q]),R.useEffect(()=>{if(!b||!t||!S||!v)return;const j=x.find(K=>K.cwd===t);if(j){g(j.id);return}if(!d.current&&a.current){d.current=!0;const{cols:K,rows:$}=a.current;T({name:e,cols:K,rows:$,cwd:t})}},[b,t,S,v,x,e,T]),R.useEffect(()=>{if(!t||f)return;const j=x.find(K=>K.cwd===t);j&&g(j.id)},[x,t,f]),R.useEffect(()=>{if(!f||!a.current||!h.current||p.current)return;const j=E.has(f);j&&E.delete(f);const K=()=>{if(requestAnimationFrame(q),j){u&&setTimeout(()=>{D(f,u+"\r")},100);let G=w;s==="plan"&&o?G=`claude "${`${e}: ${o}`.replace(/"/g,'\\"')}" --allow-dangerously-skip-permissions --permission-mode plan`:s==="default"&&o&&(G=`claude "${`${e}: ${o}`.replace(/"/g,'\\"')}" --dangerously-skip-permissions`),G&&setTimeout(()=>{D(f,G+"\r")},u?300:100)}},$=A(f,a.current,{onAttached:K}),F=L(h.current,f);return p.current=!0,()=>{$(),F(),p.current=!1}},[f,A,L,t,q,w,D,s,o,e,u,E]),t?_.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!b&&_.jsx("div",{className:"shrink-0 px-2 py-1 bg-yellow-500/20 text-yellow-500 text-xs",children:"Connecting to terminal server..."}),z==="error"&&_.jsx("div",{className:"shrink-0 px-2 py-1 bg-red-500/20 text-red-500 text-xs",children:"Terminal failed to start. The worktree directory may not exist."}),z==="exited"&&_.jsxs("div",{className:"shrink-0 px-2 py-1 bg-muted text-muted-foreground text-xs",children:["Terminal exited (code: ",H?.exitCode,")"]}),_.jsxs("div",{className:"relative flex-1",children:[_.jsx("div",{ref:h,className:He("h-full w-full overflow-hidden bg-[#0a0a0a] p-2",n)}),_.jsx("button",{onClick:()=>a.current?.scrollToBottom(),className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:_.jsx(_e,{icon:Y2,size:20,strokeWidth:2})})]})]}):_.jsx("div",{className:He("flex h-full items-center justify-center bg-[#0a0a0a] text-muted-foreground text-sm",n),children:"No worktree path configured for this task"})}function SB(e){const{viewState:t,setDiffOptions:n}=Mp(e);return{options:t.diffOptions,setOption:(s,o)=>{n({[s]:o})},setOptions:n}}function CB(e){const t=[];let n=0,s=0;for(const o of e.split(`
34
+ `))if(o.startsWith("diff --git"))t.push({type:"header",content:o});else if(o.startsWith("index ")||o.startsWith("---")||o.startsWith("+++"))t.push({type:"header",content:o});else if(o.startsWith("@@")){const u=o.match(/@@ -(\d+),?\d* \+(\d+),?\d* @@/);u&&(n=parseInt(u[1],10),s=parseInt(u[2],10)),t.push({type:"hunk",content:o})}else o.startsWith("+")?t.push({type:"added",content:o.slice(1),newLineNumber:s++}):o.startsWith("-")?t.push({type:"removed",content:o.slice(1),oldLineNumber:n++}):o.startsWith(" ")&&t.push({type:"context",content:o.slice(1),oldLineNumber:n++,newLineNumber:s++});return t}function gw({taskId:e,worktreePath:t}){const{options:n,setOption:s}=SB(e),{wrap:o,ignoreWhitespace:u,includeUntracked:h}=n,{data:a,isLoading:l,error:d}=kI(t,{ignoreWhitespace:u,includeUntracked:h}),p=R.useMemo(()=>a?.diff?CB(a.diff):[],[a?.diff]);if(!t)return _.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"});if(l)return _.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading diff..."});if(d)return _.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:d.message});const f=a?.files?.some(g=>g.status==="untracked")??!1;return p.length===0?_.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[_.jsx("p",{children:"No changes detected"}),a?.files&&a.files.length>0&&_.jsxs("div",{className:"text-xs",children:[_.jsx("p",{className:"text-center mb-2",children:"Modified files:"}),_.jsxs("div",{className:"flex flex-col gap-1",children:[a.files.map(g=>_.jsxs("div",{className:"flex gap-2",children:[_.jsxs("span",{className:He("w-4 text-center",g.status==="added"&&"text-green-500",g.status==="deleted"&&"text-red-500",g.status==="modified"&&"text-yellow-500",g.status==="untracked"&&"text-gray-500"),children:[g.status==="added"&&"A",g.status==="deleted"&&"D",g.status==="modified"&&"M",g.status==="untracked"&&"?"]}),_.jsx("span",{children:g.path})]},g.path)),f&&_.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-muted-foreground hover:text-foreground mt-1",children:[_.jsx("input",{type:"checkbox",checked:h,onChange:g=>s("includeUntracked",g.target.checked),className:"w-4 h-3"}),_.jsx("span",{children:"Show untracked files"})]})]})]})]}):_.jsxs("div",{className:"flex flex-col h-full",children:[_.jsxs("div",{className:"flex items-center gap-3 px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[a?.branch&&_.jsxs("span",{className:"text-muted-foreground",children:[a.branch,a.isBranchDiff&&_.jsx("span",{className:"opacity-70",children:" (vs master)"})]}),_.jsx("div",{className:"flex-1"}),_.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[_.jsx("input",{type:"checkbox",checked:o,onChange:g=>s("wrap",g.target.checked),className:"w-3 h-3"}),"Wrap"]}),_.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[_.jsx("input",{type:"checkbox",checked:u,onChange:g=>s("ignoreWhitespace",g.target.checked),className:"w-3 h-3"}),"Ignore whitespace"]}),_.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[_.jsx("input",{type:"checkbox",checked:h,onChange:g=>s("includeUntracked",g.target.checked),className:"w-3 h-3"}),"Untracked"]})]}),_.jsx(Yl,{className:"flex-1 min-h-0",children:_.jsx("div",{className:"font-mono text-xs",children:p.map((g,S)=>_.jsxs("div",{className:He("flex px-2 py-0.5",g.type==="added"&&"bg-green-500/10",g.type==="removed"&&"bg-red-500/10",g.type==="header"&&"bg-muted/50 text-muted-foreground",g.type==="hunk"&&"bg-blue-500/10 text-blue-400"),children:[(g.type==="added"||g.type==="removed"||g.type==="context")&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:g.oldLineNumber??""}),_.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:g.newLineNumber??""})]}),_.jsxs("span",{className:He("w-4 shrink-0 select-none text-center",g.type==="added"&&"text-green-500",g.type==="removed"&&"text-red-500"),children:[g.type==="added"&&"+",g.type==="removed"&&"-"]}),_.jsx("span",{className:He("flex-1",o?"whitespace-pre-wrap break-all":"whitespace-pre",g.type==="added"&&"text-green-400",g.type==="removed"&&"text-red-400"),children:g.content})]},S))})})]})}function wB(e){const{viewState:t,setBrowserUrl:n}=Mp(e);return{url:t.browserUrl,setUrl:n}}function vw({taskId:e}){const{url:t,setUrl:n}=wB(e),[s,o]=R.useState(t),[u,h]=R.useState(0);R.useEffect(()=>{o(t)},[t]);const a=R.useCallback(()=>{h(d=>d+1)},[]),l=R.useCallback(d=>{d.preventDefault();let p=s.trim();!p.startsWith("http://")&&!p.startsWith("https://")&&(p=`http://${p}`),n(p),h(f=>f+1)},[s,n]);return _.jsxs("div",{className:"flex h-full flex-col",children:[_.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-muted/30 px-2 py-1.5",children:[_.jsx(Be,{variant:"ghost",size:"icon-xs",disabled:!0,children:_.jsx(_e,{icon:n4,size:14,strokeWidth:2})}),_.jsx(Be,{variant:"ghost",size:"icon-xs",disabled:!0,children:_.jsx(_e,{icon:X2,size:14,strokeWidth:2})}),_.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:a,children:_.jsx(_e,{icon:b4,size:14,strokeWidth:2})}),_.jsx("form",{onSubmit:l,className:"flex-1",children:_.jsx(Wt,{value:s,onChange:d=>o(d.target.value),className:"h-7 bg-background text-xs",placeholder:"Enter URL..."})})]}),_.jsx("div",{className:"flex-1 overflow-hidden bg-white",children:_.jsx("iframe",{src:t,className:"h-full w-full border-0",title:"Browser Preview",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"},u)})]})}function EB(e){const{viewState:t,setFilesViewState:n}=Mp(e),s=t.filesViewState??{selectedFile:null,expandedDirs:[]},o=R.useCallback(a=>{n({selectedFile:a})},[n]),u=R.useCallback(a=>{const d=s.expandedDirs.includes(a)?s.expandedDirs.filter(p=>p!==a):[...s.expandedDirs,a];n({expandedDirs:d})},[s.expandedDirs,n]),h=R.useCallback(()=>{n({expandedDirs:[]})},[n]);return{selectedFile:s.selectedFile,expandedDirs:s.expandedDirs,setSelectedFile:o,toggleDir:u,collapseAll:h}}function kB(e){const t=e.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","svg","webp","ico"].includes(t)?h4:["ts","tsx","js","jsx","json","css","html","md","yaml","yml","toml","sh","py","rs","go","sql"].includes(t)?l4:c4}function fT({entry:e,depth:t,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u}){const h=s.includes(e.path),a=n===e.path,l=e.type==="directory",d=R.useCallback(()=>{l?u(e.path):o(e.path)},[l,e.path,o,u]);return _.jsxs("div",{children:[_.jsxs("div",{className:He("flex items-center gap-1.5 px-2 py-0.5 cursor-pointer text-sm hover:bg-muted/50",a&&"bg-primary/10 text-primary"),style:{paddingLeft:`${t*12+8}px`},onClick:d,children:[_.jsx(_e,{icon:l?h?i_:os:kB(e.name),size:14,strokeWidth:2,className:He("shrink-0",l?"text-yellow-500":"text-muted-foreground")}),_.jsx("span",{className:"break-all",children:e.name})]}),l&&h&&e.children&&_.jsx("div",{children:e.children.map(p=>_.jsx(fT,{entry:p,depth:t+1,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u},p.path))})]})}function _w({entries:e,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o,onCollapseAll:u}){return e.length===0?_.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No files"}):_.jsxs("div",{className:"flex flex-col h-full",children:[_.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1 border-b border-border",children:[_.jsx("span",{className:"text-xs text-muted-foreground",children:"Files"}),_.jsx("button",{onClick:u,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Collapse all",children:_.jsx(_e,{icon:_4,size:14,strokeWidth:2})})]}),_.jsx("div",{className:"py-1 flex-1 overflow-auto",children:e.map(h=>_.jsx(fT,{entry:h,depth:0,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o},h.path))})]})}const RB="modulepreload",TB=function(e){return"/"+e},yw={},te=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let d=function(p){return Promise.all(p.map(f=>Promise.resolve(f).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};var h=d;document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");o=d(n.map(p=>{if(p=TB(p),p in yw)return;yw[p]=!0;const f=p.endsWith(".css"),g=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const S=document.createElement("link");if(S.rel=f?"stylesheet":RB,f||(S.as="script"),S.crossOrigin="",S.href=p,l&&S.setAttribute("nonce",l),document.head.appendChild(S),f)return new Promise((C,w)=>{S.addEventListener("load",C),S.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return o.then(a=>{for(const l of a||[])l.status==="rejected"&&u(l.reason);return t().catch(u)})};let En=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function LB(e){return ry(e)}function ry(e){return Array.isArray(e)?AB(e):e instanceof RegExp?e:typeof e=="object"?OB(e):e}function AB(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=ry(e[n]);return t}function OB(e){let t={};for(let n in e)t[n]=ry(e[n]);return t}function hT(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function pT(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?pT(e.substring(0,e.length-1)):e.substr(~t+1)}var Dv=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,sh=class{static hasCaptures(e){return e===null?!1:(Dv.lastIndex=0,Dv.test(e))}static replaceCaptures(e,t,n){return e.replace(Dv,(s,o,u,h)=>{let a=n[parseInt(o||u,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(h){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return s})}};function mT(e,t){return e<t?-1:e>t?1:0}function gT(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,s=t.length;if(n===s){for(let o=0;o<n;o++){let u=mT(e[o],t[o]);if(u!==0)return u}return 0}return n-s}function bw(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function vT(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var _T=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},$h=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(PB(e),t)}static createFromParsedTheme(e,t){return jB(e,t)}_cachedMatchRoot=new _T(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,s=this._cachedMatchRoot.get(t).find(o=>MB(e.parent,o.parentScopes));return s?new yT(s.fontStyle,s.foreground,s.background):null}},Pv=class gh{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const s of n)t=new gh(t,s);return t}static from(...t){let n=null;for(let s=0;s<t.length;s++)n=new gh(n,t[s]);return n}push(t){return new gh(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let s=this;for(;s&&s!==t;)n.push(s.scopeName),s=s.parent;return s===t?n.reverse():void 0}};function MB(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let s=t[n],o=!1;if(s===">"){if(n===t.length-1)return!1;s=t[++n],o=!0}for(;e&&!DB(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function DB(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var yT=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function PB(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],s=0;for(let o=0,u=t.length;o<u;o++){let h=t[o];if(!h.settings)continue;let a;if(typeof h.scope=="string"){let f=h.scope;f=f.replace(/^[,]+/,""),f=f.replace(/[,]+$/,""),a=f.split(",")}else Array.isArray(h.scope)?a=h.scope:a=[""];let l=-1;if(typeof h.settings.fontStyle=="string"){l=0;let f=h.settings.fontStyle.split(" ");for(let g=0,S=f.length;g<S;g++)switch(f[g]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let d=null;typeof h.settings.foreground=="string"&&bw(h.settings.foreground)&&(d=h.settings.foreground);let p=null;typeof h.settings.background=="string"&&bw(h.settings.background)&&(p=h.settings.background);for(let f=0,g=a.length;f<g;f++){let C=a[f].trim().split(" "),w=C[C.length-1],y=null;C.length>1&&(y=C.slice(0,C.length-1),y.reverse()),n[s++]=new IB(w,y,o,l,d,p)}}return n}var IB=class{constructor(e,t,n,s,o,u){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=s,this.foreground=o,this.background=u}},Zn=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Zn||{});function jB(e,t){e.sort((l,d)=>{let p=mT(l.scope,d.scope);return p!==0||(p=gT(l.parentScopes,d.parentScopes),p!==0)?p:l.index-d.index});let n=0,s="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(s=l.foreground),l.background!==null&&(o=l.background)}let u=new NB(t),h=new yT(n,u.getId(s),u.getId(o)),a=new zB(new k_(0,null,-1,0,0),[]);for(let l=0,d=e.length;l<d;l++){let p=e[l];a.insert(0,p.scope,p.parentScopes,p.fontStyle,u.getId(p.foreground),u.getId(p.background))}return new $h(u,h,a)}var NB=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},BB=Object.freeze([]),k_=class bT{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,s,o,u){this.scopeDepth=t,this.parentScopes=n||BB,this.fontStyle=s,this.foreground=o,this.background=u}clone(){return new bT(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let s=0,o=t.length;s<o;s++)n[s]=t[s].clone();return n}acceptOverwrite(t,n,s,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),o!==0&&(this.background=o)}},zB=class R_{constructor(t,n=[],s={}){this._mainRule=t,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let s=0,o=0;for(;t.parentScopes[s]===">"&&s++,n.parentScopes[o]===">"&&o++,!(s>=t.parentScopes.length||o>=n.parentScopes.length);){const u=n.parentScopes[o].length-t.parentScopes[s].length;if(u!==0)return u;s++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let s=t.indexOf("."),o,u;if(s===-1?(o=t,u=""):(o=t.substring(0,s),u=t.substring(s+1)),this._children.hasOwnProperty(o))return this._children[o].match(u)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(R_._cmpBySpecificity),n}insert(t,n,s,o,u,h){if(n===""){this._doInsertHere(t,s,o,u,h);return}let a=n.indexOf("."),l,d;a===-1?(l=n,d=""):(l=n.substring(0,a),d=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new R_(this._mainRule.clone(),k_.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,d,s,o,u,h)}_doInsertHere(t,n,s,o,u){if(n===null){this._mainRule.acceptOverwrite(t,s,o,u);return}for(let h=0,a=this._rulesWithParentScopes.length;h<a;h++){let l=this._rulesWithParentScopes[h];if(gT(l.parentScopes,n)===0){l.acceptOverwrite(t,s,o,u);return}}s===-1&&(s=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),u===0&&(u=this._mainRule.background),this._rulesWithParentScopes.push(new k_(t,n,s,o,u))}},Zl=class Jr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Jr.getLanguageId(t),s=Jr.getTokenType(t),o=Jr.getFontStyle(t),u=Jr.getForeground(t),h=Jr.getBackground(t);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:u,background:h})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,s,o,u,h,a){let l=Jr.getLanguageId(t),d=Jr.getTokenType(t),p=Jr.containsBalancedBrackets(t)?1:0,f=Jr.getFontStyle(t),g=Jr.getForeground(t),S=Jr.getBackground(t);return n!==0&&(l=n),s!==8&&(d=s),o!==null&&(p=o?1:0),u!==-1&&(f=u),h!==0&&(g=h),a!==0&&(S=a),(l<<0|d<<8|p<<10|f<<11|g<<15|S<<24)>>>0}};function Kh(e,t){const n=[],s=HB(e);let o=s.next();for(;o!==null;){let l=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=s.next()}let d=h();if(n.push({matcher:d,priority:l}),o!==",")break;o=s.next()}return n;function u(){if(o==="-"){o=s.next();const l=u();return d=>!!l&&!l(d)}if(o==="("){o=s.next();const l=a();return o===")"&&(o=s.next()),l}if(xw(o)){const l=[];do l.push(o),o=s.next();while(xw(o));return d=>t(l,d)}return null}function h(){const l=[];let d=u();for(;d;)l.push(d),d=u();return p=>l.every(f=>f(p))}function a(){const l=[];let d=h();for(;d&&(l.push(d),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");d=h()}return p=>l.some(f=>f(p))}}function xw(e){return!!e&&!!e.match(/[\w\.:]+/)}function HB(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const s=n[0];return n=t.exec(e),s}}}function xT(e){typeof e.dispose=="function"&&e.dispose()}var Yu=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},VB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},FB=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},UB=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Yu(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new FB;for(const n of e)WB(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Yu){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function WB(e,t,n,s){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const u=n.lookup(t);e instanceof Yu?vh({baseGrammar:u,selfGrammar:o},s):T_(e.ruleName,{baseGrammar:u,selfGrammar:o,repository:o.repository},s);const h=n.injections(e.scopeName);if(h)for(const a of h)s.add(new Yu(a))}function T_(e,t,n){if(t.repository&&t.repository[e]){const s=t.repository[e];Yh([s],t,n)}}function vh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Yh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Yh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Yh(e,t,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?hT({},t.repository,s.repository):t.repository;Array.isArray(s.patterns)&&Yh(s.patterns,{...t,repository:o},n);const u=s.include;if(!u)continue;const h=ST(u);switch(h.kind){case 0:vh({...t,selfGrammar:t.baseGrammar},n);break;case 1:vh(t,n);break;case 2:T_(h.ruleName,{...t,repository:o},n);break;case 3:case 4:const a=h.scopeName===t.selfGrammar.scopeName?t.selfGrammar:h.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:o};h.kind===4?T_(h.ruleName,l,n):vh(l,n)}else h.kind===4?n.add(new VB(h.scopeName,h.ruleName)):n.add(new Yu(h.scopeName));break}}}var qB=class{kind=0},GB=class{kind=1},$B=class{constructor(e){this.ruleName=e}kind=2},KB=class{constructor(e){this.scopeName=e}kind=3},YB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function ST(e){if(e==="$base")return new qB;if(e==="$self")return new GB;const t=e.indexOf("#");if(t===-1)return new KB(e);if(t===0)return new $B(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new YB(n,s)}}var XB=/\\(\d+)/,Sw=/\\(\d+)/g,QB=-1,CT=-2;var gd=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,s){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=sh.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=sh.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${pT(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:sh.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:sh.replaceCaptures(this._contentName,e,t)}},ZB=class extends gd{retokenizeCapturedWithRuleId;constructor(e,t,n,s,o){super(e,t,n,s),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,s){throw new Error("Not supported!")}},JB=class extends gd{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,s,o){super(e,t,n,null),this._match=new Xu(s,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e).compileAG(e,n,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Qu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Cw=class extends gd{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,s,o){super(e,t,n,s),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e).compileAG(e,n,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Qu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},L_=class extends gd{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,s,o,u,h,a,l,d){super(e,t,n,s),this._begin=new Xu(o,this.id),this.beginCaptures=u,this._end=new Xu(h||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Qu;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Xh=class extends gd{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,s,o,u,h,a,l){super(e,t,n,s),this._begin=new Xu(o,this.id),this.beginCaptures=u,this.whileCaptures=a,this._while=new Xu(h,CT),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e).compileAG(e,n,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Qu;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Qu,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},wT=class Qn{static createCaptureRule(t,n,s,o,u){return t.registerRule(h=>new ZB(n,h,s,o,u))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new JB(t.$vscodeTextmateLocation,t.id,t.name,t.match,Qn._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=hT({},s,t.repository));let u=t.patterns;return typeof u>"u"&&t.include&&(u=[{include:t.include}]),new Cw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Qn._compilePatterns(u,n,s))}return t.while?new Xh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Qn._compileCaptures(t.beginCaptures||t.captures,n,s),t.while,Qn._compileCaptures(t.whileCaptures||t.captures,n,s),Qn._compilePatterns(t.patterns,n,s)):new L_(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Qn._compileCaptures(t.beginCaptures||t.captures,n,s),t.end,Qn._compileCaptures(t.endCaptures||t.captures,n,s),t.applyEndPatternLast,Qn._compilePatterns(t.patterns,n,s))}),t.id}static _compileCaptures(t,n,s){let o=[];if(t){let u=0;for(const h in t){if(h==="$vscodeTextmateLocation")continue;const a=parseInt(h,10);a>u&&(u=a)}for(let h=0;h<=u;h++)o[h]=null;for(const h in t){if(h==="$vscodeTextmateLocation")continue;const a=parseInt(h,10);let l=0;t[h].patterns&&(l=Qn.getCompiledRuleId(t[h],n,s)),o[a]=Qn.createCaptureRule(n,t[h].$vscodeTextmateLocation,t[h].name,t[h].contentName,l)}}return o}static _compilePatterns(t,n,s){let o=[];if(t)for(let u=0,h=t.length;u<h;u++){const a=t[u];let l=-1;if(a.include){const d=ST(a.include);switch(d.kind){case 0:case 1:l=Qn.getCompiledRuleId(s[a.include],n,s);break;case 2:let p=s[d.ruleName];p&&(l=Qn.getCompiledRuleId(p,n,s));break;case 3:case 4:const f=d.scopeName,g=d.kind===4?d.ruleName:null,S=n.getExternalGrammar(f,s);if(S)if(g){let C=S.repository[g];C&&(l=Qn.getCompiledRuleId(C,n,S.repository))}else l=Qn.getCompiledRuleId(S.repository.$self,n,S.repository);break}}else l=Qn.getCompiledRuleId(a,n,s);if(l!==-1){const d=n.getRule(l);let p=!1;if((d instanceof Cw||d instanceof L_||d instanceof Xh)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;o.push(l)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Xu=class ET{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const s=t.length;let o=0,u=[],h=!1;for(let a=0;a<s;a++)if(t.charAt(a)==="\\"&&a+1<s){const d=t.charAt(a+1);d==="z"?(u.push(t.substring(o,a)),u.push("$(?!\\n)(?<!\\n)"),o=a+2):(d==="A"||d==="G")&&(h=!0),a++}this.hasAnchor=h,o===0?this.source=t:(u.push(t.substring(o,s)),this.source=u.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=XB.test(this.source):this.hasBackReferences=!1}clone(){return new ET(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=n.map(o=>t.substring(o.start,o.end));return Sw.lastIndex=0,this.source.replace(Sw,(o,u)=>vT(s[parseInt(u,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],s=[],o=[],u,h,a,l;for(u=0,h=this.source.length;u<h;u++)a=this.source.charAt(u),t[u]=a,n[u]=a,s[u]=a,o[u]=a,a==="\\"&&u+1<h&&(l=this.source.charAt(u+1),l==="A"?(t[u+1]="￿",n[u+1]="￿",s[u+1]="A",o[u+1]="A"):l==="G"?(t[u+1]="￿",n[u+1]="G",s[u+1]="￿",o[u+1]="G"):(t[u+1]=l,n[u+1]=l,s[u+1]=l,o[u+1]=l),u++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Qu=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new ww(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let s=this._items.map(o=>o.resolveAnchors(t,n));return new ww(e,s,this._items.map(o=>o.ruleId))}},ww=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
35
+ `)}findNextMatchSync(e,t,n){const s=this.scanner.findNextMatchSync(e,t,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},Iv=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ez=class A_{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Iv(t,8),this._embeddedLanguagesMatcher=new tz(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?A_._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Iv(0,0);_getBasicScopeAttributes=new _T(t=>{const n=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new Iv(n,s)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(A_.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},tz=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,s])=>vT(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Ew=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function kT(e,t,n,s,o,u,h,a){const l=t.content.length;let d=!1,p=-1;if(h){const S=nz(e,t,n,s,o,u);o=S.stack,s=S.linePos,n=S.isFirstLine,p=S.anchorPosition}const f=Date.now();for(;!d;){if(a!==0&&Date.now()-f>a)return new Ew(o,!0);g()}return new Ew(o,!1);function g(){const S=rz(e,t,n,s,o,p);if(!S){u.produce(o,l),d=!0;return}const C=S.captureIndices,w=S.matchedRuleId,y=C&&C.length>0?C[0].end>s:!1;if(w===QB){const x=o.getRule(e);u.produce(o,C[0].start),o=o.withContentNameScopesList(o.nameScopesList),Tu(e,t,n,o,u,x.endCaptures,C),u.produce(o,C[0].end);const v=o;if(o=o.parent,p=v.getAnchorPos(),!y&&v.getEnterPos()===s){o=v,u.produce(o,l),d=!0;return}}else{const x=e.getRule(w);u.produce(o,C[0].start);const v=o,b=x.getName(t.content,C),E=o.contentNameScopesList.pushAttributed(b,e);if(o=o.push(w,s,p,C[0].end===l,null,E,E),x instanceof L_){const T=x;Tu(e,t,n,o,u,T.beginCaptures,C),u.produce(o,C[0].end),p=C[0].end;const A=T.getContentName(t.content,C),M=E.pushAttributed(A,e);if(o=o.withContentNameScopesList(M),T.endHasBackReferences&&(o=o.withEndRule(T.getEndWithResolvedBackReferences(t.content,C))),!y&&v.hasSameRuleAs(o)){o=o.pop(),u.produce(o,l),d=!0;return}}else if(x instanceof Xh){const T=x;Tu(e,t,n,o,u,T.beginCaptures,C),u.produce(o,C[0].end),p=C[0].end;const A=T.getContentName(t.content,C),M=E.pushAttributed(A,e);if(o=o.withContentNameScopesList(M),T.whileHasBackReferences&&(o=o.withEndRule(T.getWhileWithResolvedBackReferences(t.content,C))),!y&&v.hasSameRuleAs(o)){o=o.pop(),u.produce(o,l),d=!0;return}}else if(Tu(e,t,n,o,u,x.captures,C),u.produce(o,C[0].end),o=o.pop(),!y){o=o.safePop(),u.produce(o,l),d=!0;return}}C[0].end>s&&(s=C[0].end,n=!1)}}function nz(e,t,n,s,o,u){let h=o.beginRuleCapturedEOL?0:-1;const a=[];for(let l=o;l;l=l.pop()){const d=l.getRule(e);d instanceof Xh&&a.push({rule:d,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:d,findOptions:p}=oz(l.rule,e,l.stack.endRule,n,s===h),f=d.findNextMatchSync(t,s,p);if(f){if(f.ruleId!==CT){o=l.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(u.produce(l.stack,f.captureIndices[0].start),Tu(e,t,n,l.stack,u,l.rule.whileCaptures,f.captureIndices),u.produce(l.stack,f.captureIndices[0].end),h=f.captureIndices[0].end,f.captureIndices[0].end>s&&(s=f.captureIndices[0].end,n=!1))}else{o=l.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:h,isFirstLine:n}}function rz(e,t,n,s,o,u){const h=sz(e,t,n,s,o,u),a=e.getInjections();if(a.length===0)return h;const l=iz(a,e,t,n,s,o,u);if(!l)return h;if(!h)return l;const d=h.captureIndices[0].start,p=l.captureIndices[0].start;return p<d||l.priorityMatch&&p===d?l:h}function sz(e,t,n,s,o,u){const h=o.getRule(e),{ruleScanner:a,findOptions:l}=RT(h,e,o.endRule,n,s===u),d=a.findNextMatchSync(t,s,l);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function iz(e,t,n,s,o,u,h){let a=Number.MAX_VALUE,l=null,d,p=0;const f=u.contentNameScopesList.getScopeNames();for(let g=0,S=e.length;g<S;g++){const C=e[g];if(!C.matcher(f))continue;const w=t.getRule(C.ruleId),{ruleScanner:y,findOptions:x}=RT(w,t,null,s,o===h),v=y.findNextMatchSync(n,o,x);if(!v)continue;const b=v.captureIndices[0].start;if(!(b>=a)&&(a=b,l=v.captureIndices,d=v.ruleId,p=C.priority,a===o))break}return l?{priorityMatch:p===-1,captureIndices:l,matchedRuleId:d}:null}function RT(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function oz(e,t,n,s,o){return{ruleScanner:e.compileWhileAG(t,n,s,o),findOptions:0}}function Tu(e,t,n,s,o,u,h){if(u.length===0)return;const a=t.content,l=Math.min(u.length,h.length),d=[],p=h[0].end;for(let f=0;f<l;f++){const g=u[f];if(g===null)continue;const S=h[f];if(S.length===0)continue;if(S.start>p)break;for(;d.length>0&&d[d.length-1].endPos<=S.start;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?o.produceFromScopes(d[d.length-1].scopes,S.start):o.produce(s,S.start),g.retokenizeCapturedWithRuleId){const w=g.getName(a,h),y=s.contentNameScopesList.pushAttributed(w,e),x=g.getContentName(a,h),v=y.pushAttributed(x,e),b=s.push(g.retokenizeCapturedWithRuleId,S.start,-1,!1,null,y,v),E=e.createOnigString(a.substring(0,S.end));kT(e,E,n&&S.start===0,S.start,b,o,!1,0),xT(E);continue}const C=g.getName(a,h);if(C!==null){const y=(d.length>0?d[d.length-1].scopes:s.contentNameScopesList).pushAttributed(C,e);d.push(new az(y,S.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var az=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function lz(e,t,n,s,o,u,h,a){return new uz(e,t,n,s,o,u,h,a)}function kw(e,t,n,s,o){const u=Kh(t,Qh),h=wT.getCompiledRuleId(n,s,o.repository);for(const a of u)e.push({debugSelector:t,matcher:a.matcher,ruleId:h,grammar:o,priority:a.priority})}function Qh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(s=>{for(let o=n;o<t.length;o++)if(cz(t[o],s))return n=o+1,!0;return!1})}function cz(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var uz=class{constructor(e,t,n,s,o,u,h,a){if(this._rootScopeName=e,this.balancedBracketSelectors=u,this._onigLib=a,this._basicScopeAttributesProvider=new ez(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=h,this._grammar=Rw(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const l of Object.keys(o)){const d=Kh(l,Qh);for(const p of d)this._tokenTypeMatchers.push({matcher:p.matcher,type:o[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,s=e.lookup(n);if(s){const o=s.injections;if(o)for(let h in o)kw(t,h,o[h],this,s);const u=this._grammarRepository.injections(n);u&&u.forEach(h=>{const a=this.getExternalGrammar(h);if(a){const l=a.injectionSelector;l&&kw(t,l,a,this,a)}})}return t.sort((o,u)=>o.priority-u.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Rw(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const s=this._tokenize(e,t,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(e,t,n=0){const s=this._tokenize(e,t,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(e,t,n,s){this._rootId===-1&&(this._rootId=wT.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===O_.NULL){o=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),f=Zl.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),g=this.getRule(this._rootId).getName(null,null);let S;g?S=Iu.createRootAndLookUpScopeName(g,f,this):S=Iu.createRoot("unknown",f),t=new O_(null,this._rootId,-1,-1,!1,null,S,S)}else o=!1,t.reset();e=e+`
36
+ `;const u=this.createOnigString(e),h=u.content.length,a=new fz(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=kT(this,u,o,0,t,a,!0,s);return xT(u),{lineLength:h,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Rw(e,t){return e=LB(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Iu=class Is{constructor(t,n,s){this.parent=t,this.scopePath=n,this.tokenAttributes=s}static fromExtension(t,n){let s=t,o=t?.scopePath??null;for(const u of n)o=Pv.push(o,u.scopeNames),s=new Is(s,o,u.encodedTokenAttributes);return s}static createRoot(t,n){return new Is(null,new Pv(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),u=new Pv(null,t),h=s.themeProvider.themeMatch(u),a=Is.mergeAttributes(n,o,h);return new Is(null,u,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Is.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,s){let o=-1,u=0,h=0;return s!==null&&(o=s.fontStyle,u=s.foregroundId,h=s.backgroundId),Zl.set(t,n.languageId,n.tokenType,null,o,u,h)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Is._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const u of s)o=Is._pushAttributed(o,u,n);return o}static _pushAttributed(t,n,s){const o=s.getMetadataForScope(n),u=t.scopePath.push(n),h=s.themeProvider.themeMatch(u),a=Is.mergeAttributes(t.tokenAttributes,o,h);return new Is(t,u,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let s=this;for(;s&&s!==t;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===t?n.reverse():void 0}},O_=class Zo{constructor(t,n,s,o,u,h,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=u,this.endRule=h,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new Zo(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Zo._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Iu.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Zo._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,s,o,u,h,a){return new Zo(this,t,n,s,o,u,h,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Zo(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const s=Iu.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Zo(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,Iu.fromExtension(s,n.contentNameScopesList))}},dz=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Kh(n,Qh).map(s=>s.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Kh(n,Qh).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},fz=class{constructor(e,t,n,s){this.balancedBracketSelectors=s,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let s=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const u=e?.getScopeNames()??[];for(const h of this._tokenTypeOverrides)h.matcher(u)&&(s=Zl.set(s,0,h.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(u))}if(o&&(s=Zl.set(s,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let s=0,o=this._binaryTokens.length;s<o;s++)n[s]=this._binaryTokens[s];return n}},hz=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,s,o){if(!this._grammars.has(e)){let u=this._rawGrammars.get(e);if(!u)return null;this._grammars.set(e,lz(e,u,t,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},pz=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new hz($h.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme($h.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,s){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(t,n,s){return this._loadGrammar(t,n,s.embeddedLanguages,s.tokenTypes,new dz(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,u){const h=new UB(this._syncRegistry,t);for(;h.Q.length>0;)h.Q.map(a=>this._loadSingleGrammar(a.scopeName)),h.processQueue();return this._grammarForScopeName(t,n,s,o,u)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(t,n=[],s=0,o=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,s,o)}_grammarForScopeName(t,n=0,s=null,o=null,u=null){return this._syncRegistry.grammarForScopeName(t,n,s,o,u)}},M_=O_.NULL;const mz=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class vd{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}vd.prototype.normal={};vd.prototype.property={};vd.prototype.space=void 0;function TT(e,t){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new vd(n,s,t)}function D_(e){return e.toLowerCase()}class Sr{constructor(t,n){this.attribute=n,this.property=t}}Sr.prototype.attribute="";Sr.prototype.booleanish=!1;Sr.prototype.boolean=!1;Sr.prototype.commaOrSpaceSeparated=!1;Sr.prototype.commaSeparated=!1;Sr.prototype.defined=!1;Sr.prototype.mustUseProperty=!1;Sr.prototype.number=!1;Sr.prototype.overloadedBoolean=!1;Sr.prototype.property="";Sr.prototype.spaceSeparated=!1;Sr.prototype.space=void 0;let gz=0;const yt=Va(),Sn=Va(),P_=Va(),je=Va(),Kt=Va(),zl=Va(),Pr=Va();function Va(){return 2**++gz}const I_=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Sn,commaOrSpaceSeparated:Pr,commaSeparated:zl,number:je,overloadedBoolean:P_,spaceSeparated:Kt},Symbol.toStringTag,{value:"Module"})),jv=Object.keys(I_);class sy extends Sr{constructor(t,n,s,o){let u=-1;if(super(t,n),Tw(this,"space",o),typeof s=="number")for(;++u<jv.length;){const h=jv[u];Tw(this,jv[u],(s&I_[h])===I_[h])}}}sy.prototype.defined=!0;function Tw(e,t,n){n&&(e[t]=n)}function yc(e){const t={},n={};for(const[s,o]of Object.entries(e.properties)){const u=new sy(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,n[D_(s)]=s,n[D_(u.attribute)]=s}return new vd(t,n,e.space)}const LT=yc({properties:{ariaActiveDescendant:null,ariaAtomic:Sn,ariaAutoComplete:null,ariaBusy:Sn,ariaChecked:Sn,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Kt,ariaCurrent:null,ariaDescribedBy:Kt,ariaDetails:null,ariaDisabled:Sn,ariaDropEffect:Kt,ariaErrorMessage:null,ariaExpanded:Sn,ariaFlowTo:Kt,ariaGrabbed:Sn,ariaHasPopup:null,ariaHidden:Sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Kt,ariaLevel:je,ariaLive:null,ariaModal:Sn,ariaMultiLine:Sn,ariaMultiSelectable:Sn,ariaOrientation:null,ariaOwns:Kt,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:Sn,ariaReadOnly:Sn,ariaRelevant:null,ariaRequired:Sn,ariaRoleDescription:Kt,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:Sn,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function AT(e,t){return t in e?e[t]:t}function OT(e,t){return AT(e,t.toLowerCase())}const vz=yc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zl,acceptCharset:Kt,accessKey:Kt,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:Kt,autoFocus:yt,autoPlay:yt,blocking:Kt,capture:null,charSet:null,checked:yt,cite:null,className:Kt,cols:je,colSpan:null,content:null,contentEditable:Sn,controls:yt,controlsList:Kt,coords:je|zl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:P_,draggable:Sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:Kt,height:je,hidden:P_,high:je,href:null,hrefLang:null,htmlFor:Kt,httpEquiv:Kt,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:Kt,itemRef:Kt,itemScope:yt,itemType:Kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yt,optimum:je,pattern:null,ping:Kt,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:Kt,required:yt,reversed:yt,rows:je,rowSpan:je,sandbox:Kt,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:Sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Sn,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Kt,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:Sn,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:OT}),_z=yc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Pr,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Kt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:zl,g2:zl,glyphName:zl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:Pr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pr,rev:Pr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pr,requiredFeatures:Pr,requiredFonts:Pr,requiredFormats:Pr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:Pr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pr,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:AT}),MT=yc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),DT=yc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:OT}),PT=yc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),yz=/[A-Z]/g,Lw=/-[a-z]/g,bz=/^data[-\w.:]+$/i;function xz(e,t){const n=D_(t);let s=t,o=Sr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&bz.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Lw,Cz);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Lw.test(u)){let h=u.replace(yz,Sz);h.charAt(0)!=="-"&&(h="-"+h),t="data"+h}}o=sy}return new o(s,t)}function Sz(e){return"-"+e.toLowerCase()}function Cz(e){return e.charAt(1).toUpperCase()}const wz=TT([LT,vz,MT,DT,PT],"html"),IT=TT([LT,_z,MT,DT,PT],"svg"),Aw={}.hasOwnProperty;function Ez(e,t){const n=t||{};function s(o,...u){let h=s.invalid;const a=s.handlers;if(o&&Aw.call(o,e)){const l=String(o[e]);h=Aw.call(a,l)?a[l]:s.unknown}if(h)return h.call(this,o,...u)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const kz=/["&'<>`]/g,Rz=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Tz=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Lz=/[|\\{}()[\]^$+*?.]/g,Ow=new WeakMap;function Az(e,t){if(e=e.replace(t.subset?Oz(t.subset):kz,s),t.subset||t.escapeOnly)return e;return e.replace(Rz,n).replace(Tz,s);function n(o,u,h){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,h.charCodeAt(u+2),t)}function s(o,u,h){return t.format(o.charCodeAt(0),h.charCodeAt(u+1),t)}}function Oz(e){let t=Ow.get(e);return t||(t=Mz(e),Ow.set(e,t)),t}function Mz(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Lz,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Dz=/[\dA-Fa-f]/;function Pz(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!Dz.test(String.fromCharCode(t))?s:s+";"}const Iz=/\d/;function jz(e,t,n){const s="&#"+String(e);return n&&t&&!Iz.test(String.fromCharCode(t))?s:s+";"}const Nz=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Nv={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Bz=["cent","copy","divide","gt","lt","not","para","times"],jT={}.hasOwnProperty,j_={};let ih;for(ih in Nv)jT.call(Nv,ih)&&(j_[Nv[ih]]=ih);const zz=/[^\dA-Za-z]/;function Hz(e,t,n,s){const o=String.fromCharCode(e);if(jT.call(j_,o)){const u=j_[o],h="&"+u;return n&&Nz.includes(u)&&!Bz.includes(u)&&(!s||t&&t!==61&&zz.test(String.fromCharCode(t)))?h:h+";"}return""}function Vz(e,t,n){let s=Pz(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=Hz(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const u=jz(e,t,n.omitOptionalSemicolons);u.length<s.length&&(s=u)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function Hl(e,t){return Az(e,Object.assign({format:Vz},t))}const Fz=/^>|^->|<!--|-->|--!>|<!-$/g,Uz=[">"],Wz=["<",">"];function qz(e,t,n,s){return s.settings.bogusComments?"<?"+Hl(e.value,Object.assign({},s.settings.characterReferences,{subset:Uz}))+">":"<!--"+e.value.replace(Fz,o)+"-->";function o(u){return Hl(u,Object.assign({},s.settings.characterReferences,{subset:Wz}))}}function Gz(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function Mw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,o=n.indexOf(t);for(;o!==-1;)s++,o=n.indexOf(t,o+t.length);return s}function $z(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Kz(e){return e.join(" ").trim()}const Yz=/[ \t\n\f\r]/g;function iy(e){return typeof e=="object"?e.type==="text"?Dw(e.value):!1:Dw(e)}function Dw(e){return e.replace(Yz,"")===""}const In=BT(1),NT=BT(-1),Xz=[];function BT(e){return t;function t(n,s,o){const u=n?n.children:Xz;let h=(s||0)+e,a=u[h];if(!o)for(;a&&iy(a);)h+=e,a=u[h];return a}}const Qz={}.hasOwnProperty;function zT(e){return t;function t(n,s,o){return Qz.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const oy=zT({body:Jz,caption:Bv,colgroup:Bv,dd:rH,dt:nH,head:Bv,html:Zz,li:tH,optgroup:sH,option:iH,p:eH,rp:Pw,rt:Pw,tbody:aH,td:Iw,tfoot:lH,th:Iw,thead:oH,tr:cH});function Bv(e,t,n){const s=In(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&iy(s.value.charAt(0)))}function Zz(e,t,n){const s=In(n,t);return!s||s.type!=="comment"}function Jz(e,t,n){const s=In(n,t);return!s||s.type!=="comment"}function eH(e,t,n){const s=In(n,t);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function tH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="li"}function nH(e,t,n){const s=In(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function rH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function Pw(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function sH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function iH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function oH(e,t,n){const s=In(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function aH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function lH(e,t,n){return!In(n,t)}function cH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="tr"}function Iw(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const uH=zT({body:hH,colgroup:pH,head:fH,html:dH,tbody:mH});function dH(e){const t=In(e,-1);return!t||t.type!=="comment"}function fH(e){const t=new Set;for(const s of e.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(t.has(s.tagName))return!1;t.add(s.tagName)}const n=e.children[0];return!n||n.type==="element"}function hH(e){const t=In(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&iy(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function pH(e,t,n){const s=NT(n,t),o=In(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&oy(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function mH(e,t,n){const s=NT(n,t),o=In(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&oy(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const oh={name:[[`
37
+ \f\r &/=>`.split(""),`
38
+ \f\r "&'/=>\``.split("")],[`\0
39
+ \f\r "&'/<=>`.split(""),`\0
40
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
41
+ \f\r &>`.split(""),`\0
42
+ \f\r "&'<=>\``.split("")],[`\0
43
+ \f\r "&'<=>\``.split(""),`\0
44
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function gH(e,t,n,s){const o=s.schema,u=o.space==="svg"?!1:s.settings.omitOptionalTags;let h=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;o.space==="html"&&e.tagName==="svg"&&(s.schema=IT);const d=vH(s,e.properties),p=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,p&&(h=!1),(d||!u||!uH(e,t,n))&&(a.push("<",e.tagName,d?" "+d:""),h&&(o.space==="svg"||s.settings.closeSelfClosing)&&(l=d.charAt(d.length-1),(!s.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(p),!h&&(!u||!oy(e,t,n))&&a.push("</"+e.tagName+">"),a.join("")}function vH(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const u=_H(e,o,t[o]);u&&n.push(u)}}for(;++s<n.length;){const u=e.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&u!=='"'&&u!=="'"&&(n[s]+=" ")}return n.join("")}function _H(e,t,n){const s=xz(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,u=e.settings.allowDangerousCharacters?0:1;let h=e.quote,a;if(s.overloadedBoolean&&(n===s.attribute||n==="")?n=!0:(s.boolean||s.overloadedBoolean)&&(typeof n!="string"||n===s.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=Hl(s.attribute,Object.assign({},e.settings.characterReferences,{subset:oh.name[o][u]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?$z:Kz)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(a=Hl(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:oh.unquoted[o][u]}))),a!==n&&(e.settings.quoteSmart&&Mw(n,h)>Mw(n,e.alternative)&&(h=e.alternative),a=h+Hl(n,Object.assign({},e.settings.characterReferences,{subset:(h==="'"?oh.single:oh.double)[o][u],attribute:!0}))+h),l+(a&&"="+a))}const yH=["<","&"];function HT(e,t,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Hl(e.value,Object.assign({},s.settings.characterReferences,{subset:yH}))}function bH(e,t,n,s){return s.settings.allowDangerousHtml?e.value:HT(e,t,n,s)}function xH(e,t,n,s){return s.all(e)}const SH=Ez("type",{invalid:CH,unknown:wH,handlers:{comment:qz,doctype:Gz,element:gH,raw:bH,root:xH,text:HT}});function CH(e){throw new Error("Expected node, not `"+e+"`")}function wH(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const EH={},kH={},RH=[];function TH(e,t){const n=t||EH,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:LH,all:AH,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||mz,characterReferences:n.characterReferences||kH,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?IT:wz,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function LH(e,t,n){return SH(e,t,n,this)}function AH(e){const t=[],n=e&&e.children||RH;let s=-1;for(;++s<n.length;)t[s]=this.one(n[s],s,e);return t.join("")}function Zh(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},s=typeof e=="string"?e:e.name;for(const[o,u]of Object.entries(t?.colorReplacements||{}))typeof u=="string"?n[o]=u:o===s&&Object.assign(n,u);return n}function vo(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function OH(e){return Array.isArray(e)?e:[e]}async function VT(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function ay(e){return!e||["plaintext","txt","text","plain"].includes(e)}function FT(e){return e==="ansi"||ay(e)}function ly(e){return e==="none"}function UT(e){return ly(e)}function WT(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const s of n)s&&!e.properties.class.includes(s)&&e.properties.class.push(s);return e}function Dp(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let s=0;const o=[];for(let u=0;u<n.length;u+=2){const h=t?n[u]+(n[u+1]||""):n[u];o.push([h,s]),s+=n[u].length,s+=n[u+1]?.length||0}return o}function MH(e){const t=Dp(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let u=o,h=0;for(const a of t){if(u<a.length)break;u-=a.length,h++}return{line:h,character:u}}function s(o,u){let h=0;for(let a=0;a<o;a++)h+=t[a].length;return h+=u,h}return{lines:t,indexToPos:n,posToIndex:s}}const cy="light-dark()",DH=["color","background-color"];function PH(e,t){let n=0;const s=[];for(const o of t)o>n&&s.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&s.push({...e,content:e.content.slice(n),offset:e.offset+n}),s}function IH(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((s,o)=>s-o);return n.length?e.map(s=>s.flatMap(o=>{const u=n.filter(h=>o.offset<h&&h<o.offset+o.content.length).map(h=>h-o.offset).sort((h,a)=>h-a);return u.length?PH(o,u):o})):e}function jH(e,t,n,s,o="css-vars"){const u={content:e.content,explanation:e.explanation,offset:e.offset},h=t.map(p=>Jh(e.variants[p])),a=new Set(h.flatMap(p=>Object.keys(p))),l={},d=(p,f)=>{const g=f==="color"?"":f==="background-color"?"-bg":`-${f}`;return n+t[p]+(f==="color"?"":g)};return h.forEach((p,f)=>{for(const g of a){const S=p[g]||"inherit";if(f===0&&s&&DH.includes(g))if(s===cy&&h.length>1){const C=t.findIndex(v=>v==="light"),w=t.findIndex(v=>v==="dark");if(C===-1||w===-1)throw new En('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const y=h[C][g]||"inherit",x=h[w][g]||"inherit";l[g]=`light-dark(${y}, ${x})`,o==="css-vars"&&(l[d(f,g)]=S)}else l[g]=S;else o==="css-vars"&&(l[d(f,g)]=S)}}),u.htmlStyle=l,u}function Jh(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Zn.Italic&&(t["font-style"]="italic"),e.fontStyle&Zn.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Zn.Underline&&n.push("underline"),e.fontStyle&Zn.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function N_(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const qT=new WeakMap;function Pp(e,t){qT.set(e,t)}function Zu(e){return qT.get(e)}class bc{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new bc(Object.fromEntries(OH(n).map(s=>[s,M_])),t)}constructor(...t){if(t.length===2){const[n,s]=t;this.lang=s,this._stacks=n}else{const[n,s,o]=t;this.lang=s,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return NH(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function NH(e){const t=[],n=new Set;function s(o){if(n.has(o))return;n.add(o);const u=o?.nameScopesList?.scopeName;u&&t.push(u),o.parent&&s(o.parent)}return s(e),t}function BH(e,t){if(!(e instanceof bc))throw new En("Invalid grammar state");return e.getInternalStack(t)}function zH(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(h){if(typeof h=="number"){if(h<0||h>n.source.length)throw new En(`Invalid decoration offset: ${h}. Code length: ${n.source.length}`);return{...o.indexToPos(h),offset:h}}else{const a=o.lines[h.line];if(a===void 0)throw new En(`Invalid decoration position ${JSON.stringify(h)}. Lines length: ${o.lines.length}`);let l=h.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new En(`Invalid decoration position ${JSON.stringify(h)}. Line ${h.line} length: ${a.length}`);return{...h,character:l,offset:o.posToIndex(h.line,l)}}};const o=MH(n.source),u=(n.options.decorations||[]).map(h=>({...h,start:s(h.start),end:s(h.end)}));HH(u),e.set(n.meta,{decorations:u,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const o=t(this).decorations.flatMap(h=>[h.start.offset,h.end.offset]);return IH(n,o)},code(n){if(!this.options.decorations?.length)return;const s=t(this),o=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==s.converter.lines.length)throw new En(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${s.converter.lines.length}). Failed to apply decorations.`);function u(p,f,g,S){const C=o[p];let w="",y=-1,x=-1;if(f===0&&(y=0),g===0&&(x=0),g===Number.POSITIVE_INFINITY&&(x=C.children.length),y===-1||x===-1)for(let b=0;b<C.children.length;b++)w+=GT(C.children[b]),y===-1&&w.length===f&&(y=b+1),x===-1&&w.length===g&&(x=b+1);if(y===-1)throw new En(`Failed to find start index for decoration ${JSON.stringify(S.start)}`);if(x===-1)throw new En(`Failed to find end index for decoration ${JSON.stringify(S.end)}`);const v=C.children.slice(y,x);if(!S.alwaysWrap&&v.length===C.children.length)a(C,S,"line");else if(!S.alwaysWrap&&v.length===1&&v[0].type==="element")a(v[0],S,"token");else{const b={type:"element",tagName:"span",properties:{},children:v};a(b,S,"wrapper"),C.children.splice(y,v.length,b)}}function h(p,f){o[p]=a(o[p],f,"line")}function a(p,f,g){const S=f.properties||{},C=f.transform||(w=>w);return p.tagName=f.tagName||"span",p.properties={...p.properties,...S,class:p.properties.class},f.properties?.class&&WT(p,f.properties.class),p=C(p,g)||p,p}const l=[],d=s.decorations.sort((p,f)=>f.start.offset-p.start.offset||p.end.offset-f.end.offset);for(const p of d){const{start:f,end:g}=p;if(f.line===g.line)u(f.line,f.character,g.character,p);else if(f.line<g.line){u(f.line,f.character,Number.POSITIVE_INFINITY,p);for(let S=f.line+1;S<g.line;S++)l.unshift(()=>h(S,p));u(g.line,0,g.character,p)}}l.forEach(p=>p())}}}function HH(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new En(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=t+1;s<e.length;s++){const o=e[s],u=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,h=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,a=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,l=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(u||h||a||l){if(u&&h||a&&l||a&&n.start.offset===n.end.offset||h&&o.start.offset===o.end.offset)continue;throw new En(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function GT(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(GT).join(""):""}const VH=[zH()];function ep(e){const t=FH(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...VH]}function FH(e){const t=[],n=[],s=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:s.push(o)}return{pre:t,post:n,normal:s}}var ua=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],zv={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function UH(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const s=e.indexOf("m",n);if(s!==-1)return{sequence:e.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:e.length}}function jw(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(s=>Number.parseInt(s));return n.length!==3||n.some(s=>Number.isNaN(s))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function WH(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const s=Number.parseInt(n);if(!Number.isNaN(s))if(s===0)t.push({type:"resetAll"});else if(s<=9)zv[s]&&t.push({type:"setDecoration",value:zv[s]});else if(s<=29){const o=zv[s-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(s<=37)t.push({type:"setForegroundColor",value:{type:"named",name:ua[s-30]}});else if(s===38){const o=jw(e);o&&t.push({type:"setForegroundColor",value:o})}else if(s===39)t.push({type:"resetForegroundColor"});else if(s<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:ua[s-40]}});else if(s===48){const o=jw(e);o&&t.push({type:"setBackgroundColor",value:o})}else s===49?t.push({type:"resetBackgroundColor"}):s===53?t.push({type:"setDecoration",value:"overline"}):s===55?t.push({type:"resetDecoration",value:"overline"}):s>=90&&s<=97?t.push({type:"setForegroundColor",value:{type:"named",name:ua[s-90+8]}}):s>=100&&s<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:ua[s-100+8]}})}return t}function qH(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let u=0;do{const h=UH(s,u),a=h.sequence?s.substring(u,h.startPosition):s.substring(u);if(a.length>0&&o.push({value:a,foreground:e,background:t,decorations:new Set(n)}),h.sequence){const l=WH(h.sequence);for(const d of l)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of l)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}u=h.position}while(u<s.length);return o}}}var GH={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function $H(e=GH){function t(a){return e[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let s;function o(){if(s)return s;s=[];for(let d=0;d<ua.length;d++)s.push(t(ua[d]));let a=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let p=0;p<6;p++)for(let f=0;f<6;f++)s.push(n([a[d],a[p],a[f]]));let l=8;for(let d=0;d<24;d++,l+=10)s.push(n([l,l,l]));return s}function u(a){return o()[a]}function h(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return u(a.index)}}return{value:h}}const KH={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"};function YH(e,t,n){const s=Zh(e,n),o=Dp(t),u=Object.fromEntries(ua.map(l=>{const d=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,p=e.colors?.[d];return[l,p||KH[l]]})),h=$H(u),a=qH();return o.map(l=>a.parse(l[0]).map(d=>{let p,f;d.decorations.has("reverse")?(p=d.background?h.value(d.background):e.bg,f=d.foreground?h.value(d.foreground):e.fg):(p=d.foreground?h.value(d.foreground):e.fg,f=d.background?h.value(d.background):void 0),p=vo(p,s),f=vo(f,s),d.decorations.has("dim")&&(p=XH(p));let g=Zn.None;return d.decorations.has("bold")&&(g|=Zn.Bold),d.decorations.has("italic")&&(g|=Zn.Italic),d.decorations.has("underline")&&(g|=Zn.Underline),d.decorations.has("strikethrough")&&(g|=Zn.Strikethrough),{content:d.value,offset:l[1],color:p,bgColor:f,fontStyle:g}}))}function XH(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const s=t[1];if(s.length===8){const o=Math.round(Number.parseInt(s.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${s.slice(0,6)}${o}`}else{if(s.length===6)return`#${s}80`;if(s.length===4){const o=s[0],u=s[1],h=s[2],a=s[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${u}${u}${h}${h}${l}`}else if(s.length===3){const o=s[0],u=s[1],h=s[2];return`#${o}${o}${u}${u}${h}${h}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function uy(e,t,n={}){const{theme:s=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(ay(o)||ly(s))return Dp(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:u,colorMap:h}=e.setTheme(s);if(o==="ansi")return YH(u,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new En(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(u.name))throw new En(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${u.name}"`)}return ZH(t,a,u,h,n)}function QH(...e){if(e.length===2)return Zu(e[1]);const[t,n,s={}]=e,{lang:o="text",theme:u=t.getLoadedThemes()[0]}=s;if(ay(o)||ly(u))throw new En("Plain language does not have grammar state");if(o==="ansi")throw new En("ANSI language does not have grammar state");const{theme:h,colorMap:a}=t.setTheme(u),l=t.getLanguage(o);return new bc(dy(n,l,h,a,s).stateStack,l.name,h.name)}function ZH(e,t,n,s,o){const u=dy(e,t,n,s,o),h=new bc(u.stateStack,t.name,n.name);return Pp(u.tokens,h),u.tokens}function dy(e,t,n,s,o){const u=Zh(n,o),{tokenizeMaxLineLength:h=0,tokenizeTimeLimit:a=500}=o,l=Dp(e);let d=o.grammarState?BH(o.grammarState,n.name)??M_:o.grammarContextCode!=null?dy(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:M_,p=[];const f=[];for(let g=0,S=l.length;g<S;g++){const[C,w]=l[g];if(C===""){p=[],f.push([]);continue}if(h>0&&C.length>=h){p=[],f.push([{content:C,offset:w,color:"",fontStyle:0}]);continue}let y,x,v;o.includeExplanation&&(y=t.tokenizeLine(C,d,a),x=y.tokens,v=0);const b=t.tokenizeLine2(C,d,a),E=b.tokens.length/2;for(let T=0;T<E;T++){const A=b.tokens[2*T],M=T+1<E?b.tokens[2*T+2]:C.length;if(A===M)continue;const L=b.tokens[2*T+1],D=vo(s[Zl.getForeground(L)],u),H=Zl.getFontStyle(L),z={content:C.substring(A,M),offset:w+A,color:D,fontStyle:H};if(o.includeExplanation){const q=[];if(o.includeExplanation!=="scopeName")for(const K of n.settings){let $;switch(typeof K.scope){case"string":$=K.scope.split(/,/).map(F=>F.trim());break;case"object":$=K.scope;break;default:continue}q.push({settings:K,selectors:$.map(F=>F.split(/ /))})}z.explanation=[];let j=0;for(;A+j<M;){const K=x[v],$=C.substring(K.startIndex,K.endIndex);j+=$.length,z.explanation.push({content:$,scopes:o.includeExplanation==="scopeName"?JH(K.scopes):eV(q,K.scopes)}),v+=1}}p.push(z)}f.push(p),p=[],d=b.ruleStack}return{tokens:f,stateStack:d}}function JH(e){return e.map(t=>({scopeName:t}))}function eV(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const u=t[s];n[s]={scopeName:u,themeMatches:nV(e,u,t.slice(0,s))}}return n}function Nw(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function tV(e,t,n){if(!Nw(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)Nw(e[s],n[o])&&(s-=1),o-=1;return s===-1}function nV(e,t,n){const s=[];for(const{selectors:o,settings:u}of e)for(const h of o)if(tV(h,t,n)){s.push(u);break}return s}function $T(e,t,n){const s=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),o=s.map(l=>{const d=uy(e,t,{...n,theme:l.theme}),p=Zu(d),f=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:d,state:p,theme:f}}),u=rV(...o.map(l=>l.tokens)),h=u[0].map((l,d)=>l.map((p,f)=>{const g={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=p.explanation),u.forEach((S,C)=>{const{content:w,explanation:y,offset:x,...v}=S[d][f];g.variants[s[C].color]=v}),g})),a=o[0].state?new bc(Object.fromEntries(o.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),o[0].state.lang):void 0;return a&&Pp(h,a),h}function rV(...e){const t=e.map(()=>[]),n=e.length;for(let s=0;s<e[0].length;s++){const o=e.map(l=>l[s]),u=t.map(()=>[]);t.forEach((l,d)=>l.push(u[d]));const h=o.map(()=>0),a=o.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(d=>d.content.length));for(let d=0;d<n;d++){const p=a[d];p.content.length===l?(u[d].push(p),h[d]+=1,a[d]=o[d][h[d]]):(u[d].push({...p,content:p.content.slice(0,l)}),a[d]={...p,content:p.content.slice(l),offset:p.offset+l})}}}return t}function tp(e,t,n){let s,o,u,h,a,l;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:p="--shiki-",colorsRendering:f="css-vars"}=n,g=Object.entries(n.themes).filter(x=>x[1]).map(x=>({color:x[0],theme:x[1]})).sort((x,v)=>x.color===d?-1:v.color===d?1:0);if(g.length===0)throw new En("`themes` option must not be empty");const S=$T(e,t,n);if(l=Zu(S),d&&cy!==d&&!g.find(x=>x.color===d))throw new En(`\`themes\` option must contain the defaultColor key \`${d}\``);const C=g.map(x=>e.getTheme(x.theme)),w=g.map(x=>x.color);u=S.map(x=>x.map(v=>jH(v,w,p,d,f))),l&&Pp(u,l);const y=g.map(x=>Zh(x.theme,n));o=Bw(g,C,y,p,d,"fg",f),s=Bw(g,C,y,p,d,"bg",f),h=`shiki-themes ${C.map(x=>x.name).join(" ")}`,a=d?void 0:[o,s].join(";")}else if("theme"in n){const d=Zh(n.theme,n);u=uy(e,t,n);const p=e.getTheme(n.theme);s=vo(p.bg,d),o=vo(p.fg,d),h=p.name,l=Zu(u)}else throw new En("Invalid options, either `theme` or `themes` must be provided");return{tokens:u,fg:o,bg:s,themeName:h,rootStyle:a,grammarState:l}}function Bw(e,t,n,s,o,u,h){return e.map((a,l)=>{const d=vo(t[l][u],n[l])||"inherit",p=`${s+a.color}${u==="bg"?"-bg":""}:${d}`;if(l===0&&o){if(o===cy&&e.length>1){const f=e.findIndex(w=>w.color==="light"),g=e.findIndex(w=>w.color==="dark");if(f===-1||g===-1)throw new En('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const S=vo(t[f][u],n[f])||"inherit",C=vo(t[g][u],n[g])||"inherit";return`light-dark(${S}, ${C});${p}`}return d}return h==="css-vars"?p:null}).filter(a=>!!a).join(";")}function np(e,t,n,s={meta:{},options:n,codeToHast:(o,u)=>np(e,o,u),codeToTokens:(o,u)=>tp(e,o,u)}){let o=t;for(const C of ep(n))o=C.preprocess?.call(s,o,n)||o;let{tokens:u,fg:h,bg:a,themeName:l,rootStyle:d,grammarState:p}=tp(e,o,n);const{mergeWhitespaces:f=!0,mergeSameStyleTokens:g=!1}=n;f===!0?u=iV(u):f==="never"&&(u=oV(u)),g&&(u=aV(u));const S={...s,get source(){return o}};for(const C of ep(n))u=C.tokens?.call(S,u)||u;return sV(u,{...n,fg:h,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},S,p)}function sV(e,t,n,s=Zu(e)){const o=ep(t),u=[],h={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(d.tabindex=l.toString());for(const[w,y]of Object.entries(t.meta||{}))w.startsWith("_")||(d[w]=y);let p={type:"element",tagName:"pre",properties:d,children:[]},f={type:"element",tagName:"code",properties:{},children:u};const g=[],S={...n,structure:a,addClassToHast:WT,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return h},get pre(){return p},get code(){return f},get lines(){return g}};if(e.forEach((w,y)=>{y&&(a==="inline"?h.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&u.push({type:"text",value:`
45
+ `}));let x={type:"element",tagName:"span",properties:{class:"line"},children:[]},v=0;for(const b of w){let E={type:"element",tagName:"span",properties:{...b.htmlAttrs},children:[{type:"text",value:b.content}]};const T=N_(b.htmlStyle||Jh(b));T&&(E.properties.style=T);for(const A of o)E=A?.span?.call(S,E,y+1,v,x,b)||E;a==="inline"?h.children.push(E):a==="classic"&&x.children.push(E),v+=b.content.length}if(a==="classic"){for(const b of o)x=b?.line?.call(S,x,y+1)||x;g.push(x),u.push(x)}else a==="inline"&&g.push(x)}),a==="classic"){for(const w of o)f=w?.code?.call(S,f)||f;p.children.push(f);for(const w of o)p=w?.pre?.call(S,p)||p;h.children.push(p)}else if(a==="inline"){const w=[];let y={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const b of h.children)b.type==="element"&&b.tagName==="br"?(w.push(y),y={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(b.type==="element"||b.type==="text")&&y.children.push(b);w.push(y);let v={type:"element",tagName:"code",properties:{},children:w};for(const b of o)v=b?.code?.call(S,v)||v;h.children=[];for(let b=0;b<v.children.length;b++){b>0&&h.children.push({type:"element",tagName:"br",properties:{},children:[]});const E=v.children[b];E.type==="element"&&h.children.push(...E.children)}}let C=h;for(const w of o)C=w?.root?.call(S,C)||C;return s&&Pp(C,s),C}function iV(e){return e.map(t=>{const n=[];let s="",o;return t.forEach((u,h)=>{const l=!(u.fontStyle&&(u.fontStyle&Zn.Underline||u.fontStyle&Zn.Strikethrough));l&&u.content.match(/^\s+$/)&&t[h+1]?(o===void 0&&(o=u.offset),s+=u.content):s?(l?n.push({...u,offset:o,content:s+u.content}):n.push({content:s,offset:o},u),o=void 0,s=""):n.push(u)}),n})}function oV(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,o,u,h]=s;if(!o&&!h)return n;const a=[{...n,offset:n.offset+o.length,content:u}];return o&&a.unshift({content:o,offset:n.offset}),h&&a.push({content:h,offset:n.offset+o.length+u.length}),a}))}function aV(e){return e.map(t=>{const n=[];for(const s of t){if(n.length===0){n.push({...s});continue}const o=n[n.length-1],u=N_(o.htmlStyle||Jh(o)),h=N_(s.htmlStyle||Jh(s)),a=o.fontStyle&&(o.fontStyle&Zn.Underline||o.fontStyle&Zn.Strikethrough),l=s.fontStyle&&(s.fontStyle&Zn.Underline||s.fontStyle&Zn.Strikethrough);!a&&!l&&u===h?o.content+=s.content:n.push({...s})}return n})}const lV=TH;function cV(e,t,n){const s={meta:{},options:n,codeToHast:(u,h)=>np(e,u,h),codeToTokens:(u,h)=>tp(e,u,h)};let o=lV(np(e,t,n,s));for(const u of ep(n))o=u.postprocess?.call(s,o,n)||o;return o}const zw={light:"#333333",dark:"#bbbbbb"},Hw={light:"#fffffe",dark:"#1e1e1e"},Vw="__shiki_resolved";function fy(e){if(e?.[Vw])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:s}=t;if(!n||!s){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(s=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!s&&t?.colors?.["editor.foreground"]&&(s=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),s||(s=t.type==="light"?zw.light:zw.dark),n||(n=t.type==="light"?Hw.light:Hw.dark),t.fg=s,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const u=new Map;function h(a){if(u.has(a))return u.get(a);o+=1;const l=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?h(a):(u.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),d=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!d)return a;const p={...a,settings:{...a.settings}};if(l){const f=h(a.settings.foreground);t.colorReplacements[f]=a.settings.foreground,p.settings.foreground=f}if(d){const f=h(a.settings.background);t.colorReplacements[f]=a.settings.background,p.settings.background=f}return p});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=h(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Vw,{enumerable:!1,writable:!1,value:!0}),t}async function KT(e){return Array.from(new Set((await Promise.all(e.filter(t=>!FT(t)).map(async t=>await VT(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function YT(e){return(await Promise.all(e.map(async n=>UT(n)?null:fy(await VT(n))))).filter(n=>!!n)}let uV=3;function dV(e,t=3){t>uV||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Tl=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function XT(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Tl(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class fV extends pz{constructor(t,n,s,o={}){super(t),this._resolver=t,this._themes=n,this._langs=s,this._alias=o,this._themes.map(u=>this.loadTheme(u)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=fy(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=$h.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=XT(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(u=>u.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const s={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const o=this.loadGrammarWithConfiguration(t.scopeName,1,s);if(o.name=t.name,this._resolvedGrammars.set(t.name,o),t.aliases&&t.aliases.forEach(u=>{this._alias[u]=t.name}),this._loadedLanguagesCache=null,n.size)for(const u of n)this._resolvedGrammars.delete(u.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(u.scopeName),this._syncRegistry?._grammars?.delete(u.scopeName),this.loadLanguage(this._langMap.get(u.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const o of t)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),s=n.filter(([o,u])=>!u);if(s.length){const o=n.filter(([u,h])=>h?(h.embeddedLanguages||h.embeddedLangs)?.some(l=>s.map(([d])=>d).includes(l)):!1).filter(u=>!s.includes(u));throw new Tl(`Missing languages ${s.map(([u])=>`\`${u}\``).join(", ")}, required by ${o.map(([u])=>`\`${u}\``).join(", ")}`)}for(const[o,u]of n)this._resolver.addLanguage(u);for(const[o,u]of n)this.loadLanguage(u)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const s of n)this._langGraph.set(s,this._langMap.get(s))}}class hV{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:s=>t.createScanner(s),createOnigString:s=>t.createString(s)},n.forEach(s=>this.addLanguage(s))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let s=[];for(let o=1;o<=n.length;o++){const u=n.slice(0,o).join(".");s=[...s,...this._injections.get(u)||[]]}return s}}let wu=0;function pV(e){wu+=1,e.warnings!==!1&&wu>=10&&wu%10===0&&console.warn(`[Shiki] ${wu} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Tl("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(fy),o=new hV(e.engine,n),u=new fV(o,s,n,e.langAlias);let h;function a(b){return XT(b,e.langAlias)}function l(b){x();const E=u.getGrammar(typeof b=="string"?b:b.name);if(!E)throw new Tl(`Language \`${b}\` not found, you may need to load it first`);return E}function d(b){if(b==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};x();const E=u.getTheme(b);if(!E)throw new Tl(`Theme \`${b}\` not found, you may need to load it first`);return E}function p(b){x();const E=d(b);h!==b&&(u.setTheme(E),h=b);const T=u.getColorMap();return{theme:E,colorMap:T}}function f(){return x(),u.getLoadedThemes()}function g(){return x(),u.getLoadedLanguages()}function S(...b){x(),u.loadLanguages(b.flat(1))}async function C(...b){return S(await KT(b))}function w(...b){x();for(const E of b.flat(1))u.loadTheme(E)}async function y(...b){return x(),w(await YT(b))}function x(){if(t)throw new Tl("Shiki instance has been disposed")}function v(){t||(t=!0,u.dispose(),wu-=1)}return{setTheme:p,getTheme:d,getLanguage:l,getLoadedThemes:f,getLoadedLanguages:g,resolveLangAlias:a,loadLanguage:C,loadLanguageSync:S,loadTheme:y,loadThemeSync:w,dispose:v,[Symbol.dispose]:v}}async function mV(e){e.engine||dV("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([YT(e.themes||[]),KT(e.langs||[]),e.engine]);return pV({...e,themes:t,langs:n,engine:s})}async function gV(e){const t=await mV(e);return{getLastGrammarState:(...n)=>QH(t,...n),codeToTokensBase:(n,s)=>uy(t,n,s),codeToTokensWithThemes:(n,s)=>$T(t,n,s),codeToTokens:(n,s)=>tp(t,n,s),codeToHast:(n,s)=>np(t,n,s),codeToHtml:(n,s)=>cV(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function vV(e){const t=e.langs,n=e.themes,s=e.engine;async function o(u){function h(f){if(typeof f=="string"){if(f=u.langAlias?.[f]||f,FT(f))return[];const g=t[f];if(!g)throw new En(`Language \`${f}\` is not included in this bundle. You may want to load it from external source.`);return g}return f}function a(f){if(UT(f))return"none";if(typeof f=="string"){const g=n[f];if(!g)throw new En(`Theme \`${f}\` is not included in this bundle. You may want to load it from external source.`);return g}return f}const l=(u.themes??[]).map(f=>a(f)),d=(u.langs??[]).map(f=>h(f)),p=await gV({engine:u.engine??s(),...u,themes:l,langs:d});return{...p,loadLanguage(...f){return p.loadLanguage(...f.map(h))},loadTheme(...f){return p.loadTheme(...f.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return o}const QT=[{id:"abap",name:"ABAP",import:(()=>te(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>te(()=>import("./actionscript-3-CfeIJUat.js"),[]))},{id:"ada",name:"Ada",import:(()=>te(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>te(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>te(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>te(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>te(()=>import("./apex-DDbsPZ6N.js"),[]))},{id:"apl",name:"APL",import:(()=>te(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>te(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>te(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>te(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>te(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>te(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>te(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>te(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>te(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>te(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>te(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>te(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>te(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>te(()=>import("./blade-DVc8C-J4.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>te(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>te(()=>import("./c-BIGW1oBm.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>te(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>te(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>te(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>te(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>te(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>te(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>te(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>te(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>te(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>te(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>te(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>te(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>te(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>te(()=>import("./csharp-K5feNrxe.js"),[]))},{id:"css",name:"CSS",import:(()=>te(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>te(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>te(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>te(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>te(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>te(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>te(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>te(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>te(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>te(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>te(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>te(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>te(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>te(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>te(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>te(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>te(()=>import("./erb-BOJIQeun.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>te(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>te(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>te(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>te(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>te(()=>import("./fortran-fixed-form-BZjJHVRy.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>te(()=>import("./fortran-free-form-D22FLkUw.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>te(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>te(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>te(()=>import("./gdscript-DTMYz4Jt.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>te(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>te(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>te(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>te(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>te(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>te(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>te(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>te(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>te(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gnuplot",name:"Gnuplot",import:(()=>te(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>te(()=>import("./go-Dn2_MT6a.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>te(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>te(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>te(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>te(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>te(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>te(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>te(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>te(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>te(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>te(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>te(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>te(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>te(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>te(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>te(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>te(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>te(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>te(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>te(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>te(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>te(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>te(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>te(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>te(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>te(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>te(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>te(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>te(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>te(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>te(()=>import("./julia-C8NyazO9.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>te(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>te(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>te(()=>import("./kusto-BvAqAH-y.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>te(()=>import("./latex-BdAV_C_H.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>te(()=>import("./lean-Bc6EcWN3.js"),[]))},{id:"less",name:"Less",import:(()=>te(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>te(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>te(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>te(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>te(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>te(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>te(()=>import("./luau-CXu1NL6O.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>te(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>te(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>te(()=>import("./marko-CPi9NSCl.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>te(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>te(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>te(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>te(()=>import("./mermaid-DKYwYmdq.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>te(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>te(()=>import("./mojo-1DNp92w6.js"),[]))},{id:"move",name:"Move",import:(()=>te(()=>import("./move-Bu9oaDYs.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>te(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>te(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>te(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>te(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>te(()=>import("./nix-c8nO5XWb.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>te(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>te(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>te(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>te(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>te(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>te(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>te(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>te(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>te(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>te(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>te(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>te(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>te(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>te(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>te(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>te(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>te(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>te(()=>import("./proto-DyJlTyXw.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>te(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>te(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>te(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>te(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>te(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>te(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>te(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>te(()=>import("./r-DiinP2Uv.js"),[]))},{id:"racket",name:"Racket",import:(()=>te(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>te(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>te(()=>import("./razor-CE9lU5zL.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>te(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>te(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>te(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>te(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>te(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>te(()=>import("./rst-B0xPkSld.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>te(()=>import("./ruby-BvKwtOVI.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>te(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>te(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>te(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>te(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>te(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>te(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>te(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>te(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>te(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>te(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>te(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>te(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>te(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>te(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>te(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>te(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>te(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>te(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>te(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>te(()=>import("./svelte-3Dk4HxPD.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>te(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>te(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>te(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>te(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>te(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>te(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>te(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>te(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>te(()=>import("./tex-CxkMU7Pf.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>te(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>te(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>te(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>te(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>te(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>te(()=>import("./twig-CO9l9SDP.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>te(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>te(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>te(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>te(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>te(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>te(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>te(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>te(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>te(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>te(()=>import("./vue-DnHKYNfI.js"),__vite__mapDeps([92,3,2,11,9,15,1])))},{id:"vue-html",name:"Vue HTML",import:(()=>te(()=>import("./vue-html-CChd_i61.js"),__vite__mapDeps([93,92,3,2,11,9,15,1])))},{id:"vue-vine",name:"Vue Vine",import:(()=>te(()=>import("./vue-vine-8moa0y9V.js"),__vite__mapDeps([94,3,5,67,95,12,92,2,11,9,15,1])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>te(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>te(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>te(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>te(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>te(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>te(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>te(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>te(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>te(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>te(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>te(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>te(()=>import("./zig-VOosw3JB.js"),[]))}],_V=Object.fromEntries(QT.map(e=>[e.id,e.import])),yV=Object.fromEntries(QT.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),bV={..._V,...yV},xV=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>te(()=>import("./andromeeda-C-Jbm3Hp.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>te(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>te(()=>import("./ayu-dark-Cv9koXgw.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>te(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>te(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>te(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>te(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>te(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>te(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>te(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>te(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>te(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>te(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>te(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>te(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>te(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>te(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>te(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>te(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>te(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>te(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>te(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>te(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>te(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>te(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>te(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>te(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>te(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>te(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>te(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>te(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>te(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>te(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>te(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>te(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>te(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>te(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>te(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>te(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>te(()=>import("./one-light-PoHY5YXO.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>te(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>te(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>te(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>te(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>te(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>te(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>te(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>te(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>te(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>te(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>te(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>te(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>te(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>te(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>te(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>te(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>te(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],SV=Object.fromEntries(xV.map(e=>[e.id,e.import]));class hy extends Error{constructor(t){super(t),this.name="ShikiError"}}function CV(){return 2147483648}function wV(){return typeof performance<"u"?performance.now():Date.now()}const EV=(e,t)=>e+(t-e%t)%t;async function kV(e){let t,n;const s={};function o(S){n=S,s.HEAPU8=new Uint8Array(S),s.HEAPU32=new Uint32Array(S)}function u(S,C,w){s.HEAPU8.copyWithin(S,C,C+w)}function h(S){try{return t.grow(S-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function a(S){const C=s.HEAPU8.length;S=S>>>0;const w=CV();if(S>w)return!1;for(let y=1;y<=4;y*=2){let x=C*(1+.2/y);x=Math.min(x,S+100663296);const v=Math.min(w,EV(Math.max(S,x),65536));if(h(v))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(S,C,w=1024){const y=C+w;let x=C;for(;S[x]&&!(x>=y);)++x;if(x-C>16&&S.buffer&&l)return l.decode(S.subarray(C,x));let v="";for(;C<x;){let b=S[C++];if(!(b&128)){v+=String.fromCharCode(b);continue}const E=S[C++]&63;if((b&224)===192){v+=String.fromCharCode((b&31)<<6|E);continue}const T=S[C++]&63;if((b&240)===224?b=(b&15)<<12|E<<6|T:b=(b&7)<<18|E<<12|T<<6|S[C++]&63,b<65536)v+=String.fromCharCode(b);else{const A=b-65536;v+=String.fromCharCode(55296|A>>10,56320|A&1023)}}return v}function p(S,C){return S?d(s.HEAPU8,S,C):""}const f={emscripten_get_now:wV,emscripten_memcpy_big:u,emscripten_resize_heap:a,fd_write:()=>0};async function g(){const C=await e({env:f,wasi_snapshot_preview1:f});t=C.memory,o(t.buffer),Object.assign(s,C),s.UTF8ToString=p}return await g(),s}var RV=Object.defineProperty,TV=(e,t,n)=>t in e?RV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,On=(e,t,n)=>TV(e,typeof t!="symbol"?t+"":t,n);let Nn=null;function LV(e){throw new hy(e.UTF8ToString(e.getLastOnigError()))}class Ip{constructor(t){On(this,"utf16Length"),On(this,"utf8Length"),On(this,"utf16Value"),On(this,"utf8Value"),On(this,"utf16OffsetToUtf8"),On(this,"utf8OffsetToUtf16");const n=t.length,s=Ip._utf8ByteLength(t),o=s!==n,u=o?new Uint32Array(n+1):null;o&&(u[n]=s);const h=o?new Uint32Array(s+1):null;o&&(h[s]=n);const a=new Uint8Array(s);let l=0;for(let d=0;d<n;d++){const p=t.charCodeAt(d);let f=p,g=!1;if(p>=55296&&p<=56319&&d+1<n){const S=t.charCodeAt(d+1);S>=56320&&S<=57343&&(f=(p-55296<<10)+65536|S-56320,g=!0)}o&&(u[d]=l,g&&(u[d+1]=l),f<=127?h[l+0]=d:f<=2047?(h[l+0]=d,h[l+1]=d):f<=65535?(h[l+0]=d,h[l+1]=d,h[l+2]=d):(h[l+0]=d,h[l+1]=d,h[l+2]=d,h[l+3]=d)),f<=127?a[l++]=f:f<=2047?(a[l++]=192|(f&1984)>>>6,a[l++]=128|(f&63)>>>0):f<=65535?(a[l++]=224|(f&61440)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0):(a[l++]=240|(f&1835008)>>>18,a[l++]=128|(f&258048)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0),g&&d++}this.utf16Length=n,this.utf8Length=s,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=u,this.utf8OffsetToUtf16=h}static _utf8ByteLength(t){let n=0;for(let s=0,o=t.length;s<o;s++){const u=t.charCodeAt(s);let h=u,a=!1;if(u>=55296&&u<=56319&&s+1<o){const l=t.charCodeAt(s+1);l>=56320&&l<=57343&&(h=(u-55296<<10)+65536|l-56320,a=!0)}h<=127?n+=1:h<=2047?n+=2:h<=65535?n+=3:n+=4,a&&s++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const jp=class js{constructor(t){if(On(this,"id",++js.LAST_ID),On(this,"_onigBinding"),On(this,"content"),On(this,"utf16Length"),On(this,"utf8Length"),On(this,"utf16OffsetToUtf8"),On(this,"utf8OffsetToUtf16"),On(this,"ptr"),!Nn)throw new hy("Must invoke loadWasm first.");this._onigBinding=Nn,this.content=t;const n=new Ip(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!js._sharedPtrInUse?(js._sharedPtr||(js._sharedPtr=Nn.omalloc(1e4)),js._sharedPtrInUse=!0,Nn.HEAPU8.set(n.utf8Value,js._sharedPtr),this.ptr=js._sharedPtr):this.ptr=n.createString(Nn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===js._sharedPtr?js._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};On(jp,"LAST_ID",0);On(jp,"_sharedPtr",0);On(jp,"_sharedPtrInUse",!1);let ZT=jp;class AV{constructor(t){if(On(this,"_onigBinding"),On(this,"_ptr"),!Nn)throw new hy("Must invoke loadWasm first.");const n=[],s=[];for(let a=0,l=t.length;a<l;a++){const d=new Ip(t[a]);n[a]=d.createString(Nn),s[a]=d.utf8Length}const o=Nn.omalloc(4*t.length);Nn.HEAPU32.set(n,o/4);const u=Nn.omalloc(4*t.length);Nn.HEAPU32.set(s,u/4);const h=Nn.createOnigScanner(o,u,t.length);for(let a=0,l=t.length;a<l;a++)Nn.ofree(n[a]);Nn.ofree(u),Nn.ofree(o),h===0&&LV(Nn),this._onigBinding=Nn,this._ptr=h}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof t=="string"){t=new ZT(t);const u=this._findNextMatchSync(t,n,!1,o);return t.dispose(),u}return this._findNextMatchSync(t,n,!1,o)}_findNextMatchSync(t,n,s,o){const u=this._onigBinding,h=u.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(h===0)return null;const a=u.HEAPU32;let l=h/4;const d=a[l++],p=a[l++],f=[];for(let g=0;g<p;g++){const S=t.convertUtf8OffsetToUtf16(a[l++]),C=t.convertUtf8OffsetToUtf16(a[l++]);f[g]={start:S,end:C,length:C-S}}return{index:d,captureIndices:f}}}function OV(e){return typeof e.instantiator=="function"}function MV(e){return typeof e.default=="function"}function DV(e){return typeof e.data<"u"}function PV(e){return typeof Response<"u"&&e instanceof Response}function IV(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let ah;function jV(e){if(ah)return ah;async function t(){Nn=await kV(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),OV(s)?s=await s.instantiator(n):MV(s)?s=await s.default(n):(DV(s)&&(s=s.data),PV(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await NV(s)(n):s=await BV(s)(n):IV(s)?s=await Hv(s)(n):s instanceof WebAssembly.Module?s=await Hv(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Hv(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return ah=t(),ah}function Hv(e){return t=>WebAssembly.instantiate(e,t)}function NV(e){return t=>WebAssembly.instantiateStreaming(e,t)}function BV(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function zV(e){return e&&await jV(e),{createScanner(t){return new AV(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new ZT(t)}}}const HV=vV({langs:bV,themes:SV,engine:()=>zV(te(()=>import("./wasm-CG6Dc4jp.js"),[]))});let lh=null,ch=null;const VV=["typescript","tsx","javascript","jsx","json","css","html","markdown","yaml","toml","bash","shell","python","rust","go","sql","diff","plaintext"];async function FV(){return lh||ch||(ch=HV({themes:["github-dark"],langs:VV}),lh=await ch,lh)}async function UV(e,t){const n=await FV(),s=WV(t);if(!n.getLoadedLanguages().includes(s))try{await n.loadLanguage(s)}catch{return n.codeToHtml(e,{lang:"plaintext",theme:"github-dark"})}return n.codeToHtml(e,{lang:s,theme:"github-dark"})}function WV(e){return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rb:"ruby",rs:"rust",sh:"bash",yml:"yaml",md:"markdown"}[e]||e}function qV(e){const t=e.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",css:"css",html:"html",md:"markdown",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",zsh:"bash",py:"python",rs:"rust",go:"go",sql:"sql",diff:"diff",txt:"plaintext"}[t]||"plaintext"}function Fw({filePath:e,content:t,isLoading:n,error:s,onClose:o}){const[u,h]=R.useState(null),[a,l]=R.useState(!1),[d,p]=R.useState(!0);if(R.useEffect(()=>{if(!t||!e){h(null);return}if(t.mimeType.startsWith("image/")||t.mimeType==="application/octet-stream"){h(null);return}l(!0);const g=qV(e);UV(t.content,g).then(S=>{h(S),l(!1)}).catch(()=>{h(null),l(!1)})},[t,e]),!e)return _.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Select a file to view"});if(n)return _.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading file..."});if(s)return _.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:s.message});if(!t)return _.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Unable to load file"});if(t.mimeType==="application/octet-stream")return _.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[_.jsx("p",{children:"Binary file"}),_.jsxs("p",{className:"text-xs",children:[(t.size/1024).toFixed(1)," KB"]})]});if(t.mimeType.startsWith("image/"))return _.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[_.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[_.jsx("span",{className:"text-muted-foreground truncate",title:e,children:e.split("/").pop()||e}),_.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:_.jsx(_e,{icon:_o,size:14,strokeWidth:2})})]}),_.jsx("div",{className:"flex flex-1 items-center justify-center p-4 bg-[#0d1117]",children:_.jsx("img",{src:t.content,alt:e,className:"max-w-full max-h-full object-contain"})})]});const f=e.split("/").pop()||e;return _.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[_.jsxs("div",{className:"flex shrink-0 items-center gap-3 px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[_.jsx("span",{className:"text-muted-foreground truncate flex-1",title:e,children:f}),t.truncated&&_.jsxs("span",{className:"text-yellow-500",children:["Truncated (",t.lineCount.toLocaleString()," lines)"]}),_.jsxs("span",{className:"text-muted-foreground",children:[(t.size/1024).toFixed(1)," KB"]}),_.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[_.jsx("input",{type:"checkbox",checked:d,onChange:g=>p(g.target.checked),className:"w-3 h-3"}),"Wrap"]}),_.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:_.jsx(_e,{icon:_o,size:14,strokeWidth:2})})]}),_.jsx(Yl,{className:"flex-1 min-h-0",children:a?_.jsx("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm",children:"Highlighting..."}):u?_.jsx("div",{className:He("text-xs [&_pre]:!bg-transparent [&_pre]:!m-0 [&_pre]:!p-2 [&_code]:!bg-transparent",d?"[&_pre]:whitespace-pre-wrap [&_pre]:break-all":"[&_pre]:whitespace-pre"),dangerouslySetInnerHTML:{__html:u}}):_.jsx("pre",{className:He("p-2 font-mono text-xs",d?"whitespace-pre-wrap break-all":"whitespace-pre"),children:t.content})})]})}function GV(){const[e,t]=R.useState(!1);return R.useEffect(()=>{const n=window.matchMedia("(max-width: 639px)");t(n.matches);const s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}function Uw({taskId:e,worktreePath:t}){const{selectedFile:n,expandedDirs:s,setSelectedFile:o,toggleDir:u,collapseAll:h}=EB(e),[a,l]=R.useState("tree"),d=GV(),{data:p,isLoading:f,error:g}=RI(t),{data:S,isLoading:C,error:w}=TI(t,n),y=R.useCallback(b=>{o(b),window.matchMedia("(max-width: 639px)").matches&&l("content")},[o]),x=R.useCallback(()=>{o(null),window.matchMedia("(max-width: 639px)").matches&&l("tree")},[o]),v=R.useCallback(b=>{u(b)},[u]);return t?f?_.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading files..."}):g?_.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:g.message}):d?_.jsxs(_a,{value:a,onValueChange:b=>l(b),className:"flex h-full flex-col",children:[_.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:_.jsxs(ya,{className:"w-full",children:[_.jsx(ir,{value:"tree",className:"flex-1",children:"Files"}),_.jsx(ir,{value:"content",className:"flex-1",children:"Content"})]})}),_.jsx(_r,{value:"tree",className:"flex-1 min-h-0 overflow-hidden",children:_.jsx(Yl,{className:"h-full",children:_.jsx(_w,{entries:p?.entries||[],selectedFile:n,expandedDirs:s,onSelectFile:y,onToggleDir:v,onCollapseAll:h})})}),_.jsx(_r,{value:"content",className:"flex-1 min-h-0 overflow-hidden",children:_.jsx(Fw,{filePath:n,content:S??null,isLoading:C,error:w,onClose:x})})]}):_.jsxs(ta,{direction:"horizontal",className:"h-full",children:[_.jsx(ts,{defaultSize:65,minSize:30,className:"overflow-hidden",children:_.jsx(Fw,{filePath:n,content:S??null,isLoading:C,error:w,onClose:x})}),_.jsx(na,{withHandle:!0}),_.jsx(ts,{defaultSize:35,minSize:15,children:_.jsx(Yl,{className:"h-full",children:_.jsx(_w,{entries:p?.entries||[],selectedFile:n,expandedDirs:s,onSelectFile:y,onToggleDir:v,onCollapseAll:h})})})]}):_.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"})}function $V(){const[e,t]=R.useState(!1);return R.useEffect(()=>{const n=window.matchMedia("(max-width: 639px)");t(n.matches);const s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}const JT=ws("/tasks/$taskId")({component:YV}),Ww={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},KV={IN_PROGRESS:"bg-blue-500/20 text-blue-500",IN_REVIEW:"bg-yellow-500/20 text-yellow-600",DONE:"bg-green-500/20 text-green-600",CANCELED:"bg-red-500/20 text-red-500"};function YV(){const{taskId:e}=JT.useParams(),t=yo(),n=K3(),{data:s,isLoading:o}=cR(e),u=W0(),h=SI(),{tab:a,setTab:l}=bB(e),d=FR(),p=UR(),f=WR(),{data:g}=Tp(),{data:S}=Lp(),{data:C}=xB(s?.linearTicketId??null),w=n.state,y=w?.aiMode&&w?.description?w.aiMode:void 0,x=w?.description,[v,b]=R.useState(!1),[E,T]=R.useState(null),[A,M]=R.useState(!1),[L,D]=R.useState(!1),[H,z]=R.useState(null),[q,j]=R.useState(!1),[K,$]=R.useState(!1),[F,G]=R.useState(null),[U,P]=R.useState(!1),[B,I]=R.useState(!1),[W,Y]=R.useState(!1),[J,Z]=R.useState("terminal"),ee=$V(),{terminals:X,writeToTerminal:V}=ey();R.useEffect(()=>{if(L){const De=setTimeout(()=>D(!1),3e3);return()=>clearTimeout(De)}},[L]),R.useEffect(()=>{if(K){const De=setTimeout(()=>$(!1),3e3);return()=>clearTimeout(De)}},[K]),R.useEffect(()=>{if(B){const De=setTimeout(()=>I(!1),3e3);return()=>clearTimeout(De)}},[B]);const se=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){T(null),D(!1);try{await d.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),D(!0)}catch(De){const Ie=De instanceof Error?De.message:"Sync failed";T(Ie),M(!0)}}},ne=()=>{if(!s||!E)return"";const De=s.baseBranch||"main";return`Fix the git sync issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${De} | Error: ${E} | Steps: 1) Check git status 2) Resolve conflicts or commit/stash changes 3) Rebase onto the parent repo's ${De} branch`},re=()=>{if(!s||!H)return"";const De=s.baseBranch||"main";return`Fix the git merge issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${De} | Error: ${H} | Steps: 1) Check git status in both worktree and parent 2) Resolve any conflicts 3) Ensure worktree changes are committed 4) Retry merge to ${De} 5) On successful merge, run: vibora tasks move ${s.id} --status done`},oe=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){z(null),$(!1);try{await p.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),$(!0),u.mutate({taskId:s.id,updates:{status:"DONE"}})}catch(De){const Ie=De instanceof Error?De.message:"Merge failed";z(Ie),j(!0)}}},le=async()=>{if(s?.repoPath){G(null),I(!1);try{await f.mutateAsync({repoPath:s.repoPath,baseBranch:s.baseBranch}),I(!0)}catch(De){const Ie=De instanceof Error?De.message:"Sync parent failed";G(Ie),P(!0)}}},ve=()=>{if(!s||!F)return"";const De=s.baseBranch||"main";return`Fix the git sync parent issue. Parent repo: ${s.repoPath} | Base branch: ${De} | Error: ${F} | Steps: 1) Check git status in parent repo 2) Resolve any local changes or divergence 3) Fetch and merge/rebase from origin/${De}`},ue=X.find(De=>De.cwd===s?.worktreePath),he=()=>{if(!ue)return;const De=ne();V(ue.id,De+"\r"),M(!1)},de=()=>{if(!ue)return;const Ie=`claude -p "${ne().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;V(ue.id,Ie),M(!1)},Ne=()=>{if(!ue)return;const De=re();V(ue.id,De+"\r"),j(!1)},Me=()=>{if(!ue)return;const Ie=`claude -p "${re().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;V(ue.id,Ie),j(!1)},Ae=()=>{if(!ue)return;const De=ve();V(ue.id,De+"\r"),P(!1)},be=()=>{if(!ue)return;const Ie=`claude -p "${ve().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;V(ue.id,Ie),P(!1)},Oe=()=>{Y(!0)},me=()=>{if(!s?.worktreePath)return;const De=Gh(s.worktreePath,g,S);window.open(De,"_blank"),Y(!1)},ke=()=>{if(!s?.repoPath)return;const De=Gh(s.repoPath,g,S);window.open(De,"_blank"),Y(!1)},Ce=De=>{s&&u.mutate({taskId:s.id,updates:{status:De}})},qe=()=>{s&&h.mutate(s.id,{onSuccess:()=>{t({to:"/tasks"})}})};return o?_.jsx("div",{className:"flex h-full items-center justify-center",children:_.jsx("p",{className:"text-muted-foreground",children:"Loading task..."})}):s?_.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[_.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[_.jsxs("div",{className:"flex-1",children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx("h1",{className:"text-sm font-medium",children:s.title}),_.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>b(!0),title:"Task settings",children:_.jsx(_e,{icon:nE,size:14,strokeWidth:2})})]}),_.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[_.jsx("span",{children:s.repoName}),_.jsx(_e,{icon:o_,size:12,strokeWidth:2}),_.jsx("span",{className:"font-mono",children:s.branch}),s.prUrl&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-muted-foreground/50",children:"•"}),_.jsxs("a",{href:s.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:De=>De.stopPropagation(),children:[_.jsx(_e,{icon:i0,size:14,strokeWidth:2}),_.jsxs("span",{children:["#",s.prUrl.match(/\/pull\/(\d+)/)?.[1]??"PR"]})]})]}),s.linearTicketUrl&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-muted-foreground/50",children:"•"}),_.jsxs("a",{href:s.linearTicketUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:De=>De.stopPropagation(),title:C?.title,children:[_.jsx(_e,{icon:o0,size:14,strokeWidth:2}),_.jsx("span",{children:s.linearTicketId}),C?.status&&_.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",C.status,")"]})]})]})]})]}),_.jsxs(zR,{children:[_.jsx(HR,{render:_.jsx(Be,{variant:"ghost",size:"sm",className:KV[s.status]}),children:Ww[s.status]}),_.jsx(VR,{align:"end",children:_.jsx(PN,{value:s.status,onValueChange:Ce,children:Object.entries(Ww).map(([De,Ie])=>_.jsx(IN,{value:De,children:Ie},De))})})]}),_.jsx(Be,{variant:"ghost",size:"icon-sm",onClick:se,disabled:d.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Pull from main",children:_.jsx(_e,{icon:n_,size:16,strokeWidth:2,className:d.isPending?"animate-spin":""})}),_.jsx(Be,{variant:"ghost",size:"icon-sm",onClick:oe,disabled:p.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Merge to main",children:_.jsx(_e,{icon:r_,size:16,strokeWidth:2,className:p.isPending?"animate-pulse":""})}),_.jsx(Be,{variant:"ghost",size:"icon-sm",onClick:le,disabled:f.isPending||!s.repoPath,className:"text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:_.jsx(_e,{icon:a_,size:16,strokeWidth:2,className:f.isPending?"animate-spin":""})}),_.jsx(Be,{variant:"ghost",size:"icon-sm",onClick:Oe,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:_.jsx(_e,{icon:a0,size:16,strokeWidth:2})}),L&&_.jsx("span",{className:"text-xs text-green-600",children:"Synced!"}),K&&_.jsx("span",{className:"text-xs text-green-600",children:"Merged!"}),B&&_.jsx("span",{className:"text-xs text-green-600",children:"Parent synced!"}),_.jsxs(uc,{children:[_.jsx(dc,{render:_.jsx(Be,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive"}),children:_.jsx(_e,{icon:ed,size:16,strokeWidth:2})}),_.jsxs(fc,{children:[_.jsxs(hc,{children:[_.jsx(mc,{children:"Delete Task"}),_.jsxs(gc,{children:['This will permanently delete "',s.title,'", close its terminal, and remove its worktree. This action cannot be undone.']})]}),_.jsxs(pc,{children:[_.jsx(vc,{children:"Cancel"}),_.jsx(yR,{onClick:qe,variant:"destructive",disabled:h.isPending,children:h.isPending?"Deleting...":"Delete"})]})]})]})]}),ee?_.jsxs(_a,{value:J,onValueChange:De=>Z(De),className:"flex min-h-0 flex-1 flex-col",children:[_.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:_.jsxs(ya,{className:"w-full",children:[_.jsx(ir,{value:"terminal",className:"flex-1",children:"Terminal"}),_.jsx(ir,{value:"details",className:"flex-1",children:"Details"})]})}),_.jsx(_r,{value:"terminal",className:"flex-1 min-h-0",children:_.jsx(mw,{taskId:s.id,taskName:s.title,cwd:s.worktreePath,aiMode:y,description:x,startupScript:s.startupScript})}),_.jsx(_r,{value:"details",className:"flex-1 min-h-0",children:_.jsxs(_a,{value:a,onValueChange:l,className:"flex h-full flex-col",children:[_.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:_.jsxs(ya,{variant:"line",children:[_.jsxs(ir,{value:"diff",children:[_.jsx(_e,{icon:FS,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),_.jsxs(ir,{value:"browser",children:[_.jsx(_e,{icon:s_,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),_.jsxs(ir,{value:"files",children:[_.jsx(_e,{icon:os,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]})}),_.jsx(_r,{value:"diff",className:"flex-1 overflow-hidden",children:_.jsx(gw,{taskId:s.id,worktreePath:s.worktreePath})}),_.jsx(_r,{value:"browser",className:"flex-1 overflow-hidden",children:_.jsx(vw,{taskId:s.id})}),_.jsx(_r,{value:"files",className:"flex-1 overflow-hidden",children:_.jsx(Uw,{taskId:s.id,worktreePath:s.worktreePath})})]})})]}):_.jsxs(ta,{direction:"horizontal",className:"min-h-0 flex-1",children:[_.jsx(ts,{defaultSize:50,minSize:30,children:_.jsx(mw,{taskId:s.id,taskName:s.title,cwd:s.worktreePath,aiMode:y,description:x,startupScript:s.startupScript})}),_.jsx(na,{withHandle:!0}),_.jsx(ts,{defaultSize:50,minSize:30,children:_.jsxs(_a,{value:a,onValueChange:l,className:"flex h-full flex-col",children:[_.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:_.jsxs(ya,{variant:"line",children:[_.jsxs(ir,{value:"diff",children:[_.jsx(_e,{icon:FS,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),_.jsxs(ir,{value:"browser",children:[_.jsx(_e,{icon:s_,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),_.jsxs(ir,{value:"files",children:[_.jsx(_e,{icon:os,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]})}),_.jsx(_r,{value:"diff",className:"flex-1 overflow-hidden",children:_.jsx(gw,{taskId:s.id,worktreePath:s.worktreePath})}),_.jsx(_r,{value:"browser",className:"flex-1 overflow-hidden",children:_.jsx(vw,{taskId:s.id})}),_.jsx(_r,{value:"files",className:"flex-1 overflow-hidden",children:_.jsx(Uw,{taskId:s.id,worktreePath:s.worktreePath})})]})})]}),_.jsx(cT,{task:s,open:v,onOpenChange:b}),_.jsx(xs,{open:W,onOpenChange:Y,children:_.jsxs(Ss,{className:"sm:max-w-sm",children:[_.jsxs(Bs,{children:[_.jsx(zs,{children:"Open in VS Code"}),_.jsx(aa,{children:"Choose which folder to open"})]}),_.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[_.jsxs(Be,{variant:"outline",className:"justify-start font-mono text-sm",onClick:me,disabled:!s.worktreePath,children:[_.jsx(_e,{icon:o_,size:16,strokeWidth:2,className:"mr-2"}),"Worktree",_.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.branch})]}),_.jsxs(Be,{variant:"outline",className:"justify-start font-mono text-sm",onClick:ke,disabled:!s.repoPath,children:[_.jsx(_e,{icon:os,size:16,strokeWidth:2,className:"mr-2"}),"Repository",_.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.repoName})]})]})]})}),_.jsx(xs,{open:A,onOpenChange:M,children:_.jsxs(Ss,{className:"sm:max-w-md",children:[_.jsxs(Bs,{children:[_.jsx(zs,{className:"text-destructive",children:"Sync Failed"}),_.jsx(aa,{children:"An error occurred while syncing with upstream."})]}),_.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:E}),_.jsxs(go,{className:"mt-4 gap-2",children:[_.jsx(Be,{variant:"outline",onClick:()=>M(!1),children:"Close"}),_.jsx(Be,{variant:"outline",onClick:he,disabled:!ue,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),_.jsx(Be,{variant:"destructive",onClick:de,disabled:!ue,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),_.jsx(xs,{open:q,onOpenChange:j,children:_.jsxs(Ss,{className:"sm:max-w-md",children:[_.jsxs(Bs,{children:[_.jsx(zs,{className:"text-destructive",children:"Merge Failed"}),_.jsxs(aa,{children:["An error occurred while merging to ",s?.baseBranch||"main","."]})]}),_.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:H}),_.jsxs(go,{className:"mt-4 gap-2",children:[_.jsx(Be,{variant:"outline",onClick:()=>j(!1),children:"Close"}),_.jsx(Be,{variant:"outline",onClick:Ne,disabled:!ue,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),_.jsx(Be,{variant:"destructive",onClick:Me,disabled:!ue,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),_.jsx(xs,{open:U,onOpenChange:P,children:_.jsxs(Ss,{className:"sm:max-w-md",children:[_.jsxs(Bs,{children:[_.jsx(zs,{className:"text-destructive",children:"Sync Parent Failed"}),_.jsx(aa,{children:"An error occurred while syncing the parent repository with origin."})]}),_.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:F}),_.jsxs(go,{className:"mt-4 gap-2",children:[_.jsx(Be,{variant:"outline",onClick:()=>P(!1),children:"Close"}),_.jsx(Be,{variant:"outline",onClick:Ae,disabled:!ue,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),_.jsx(Be,{variant:"destructive",onClick:be,disabled:!ue,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})})]}):_.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[_.jsx("p",{className:"text-muted-foreground",children:"Task not found"}),_.jsx(qn,{to:"/tasks",children:_.jsx(Be,{variant:"outline",children:"Back to Tasks"})})]})}const e5=ws("/repositories/$repoId")({component:XV});function XV(){const{repoId:e}=e5.useParams(),t=yo(),{data:n,isLoading:s,error:o}=HI(e),u=VI(),h=hR(),{data:a}=Tp(),{data:l}=Lp(),[d,p]=R.useState(""),[f,g]=R.useState(""),[S,C]=R.useState(""),[w,y]=R.useState(!1);R.useEffect(()=>{n&&(p(n.displayName),g(n.startupScript||""),C(n.copyFiles||""),y(!1))},[n]),R.useEffect(()=>{if(n){const E=d!==n.displayName||f!==(n.startupScript||"")||S!==(n.copyFiles||"");y(E)}},[d,f,S,n]);const x=()=>{n&&u.mutate({id:n.id,updates:{displayName:d.trim()||n.path.split("/").pop()||"repo",startupScript:f.trim()||null,copyFiles:S.trim()||null}})},v=async()=>{n&&(await h.mutateAsync(n.id),t({to:"/repositories"}))},b=()=>{if(!n)return;const E=Gh(n.path,a,l);window.open(E,"_blank")};return s?_.jsx("div",{className:"flex h-full items-center justify-center",children:_.jsx(_e,{icon:zr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}):o||!n?_.jsxs("div",{className:"flex h-full flex-col",children:[_.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2",children:_.jsxs(qn,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[_.jsx(_e,{icon:VS,size:16,strokeWidth:2}),"Repositories"]})}),_.jsx("div",{className:"flex flex-1 items-center justify-center",children:_.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[_.jsx(_e,{icon:nc,size:20,strokeWidth:2}),_.jsx("span",{className:"text-sm",children:"Repository not found"})]})})]}):_.jsxs("div",{className:"flex h-full flex-col",children:[_.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs(qn,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[_.jsx(_e,{icon:VS,size:16,strokeWidth:2}),"Repositories"]}),_.jsx("span",{className:"text-muted-foreground",children:"/"}),_.jsx("span",{className:"text-sm font-medium",children:n.displayName})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Be,{variant:"ghost",size:"icon-sm",onClick:b,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:_.jsx(_e,{icon:a0,size:14,strokeWidth:2})}),_.jsxs(uc,{children:[_.jsxs(dc,{render:_.jsx(Be,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive"}),children:[_.jsx(_e,{icon:ed,size:14,strokeWidth:2,"data-slot":"icon"}),"Delete"]}),_.jsxs(fc,{children:[_.jsxs(hc,{children:[_.jsx(mc,{children:"Delete Repository"}),_.jsxs(gc,{children:['This will remove "',n.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),_.jsxs(pc,{children:[_.jsx(vc,{children:"Cancel"}),_.jsx(Be,{variant:"destructive",onClick:v,children:"Delete"})]})]})]}),_.jsx(Be,{size:"sm",onClick:x,disabled:!w||u.isPending,children:u.isPending?"Saving...":"Save"})]})]}),_.jsx("div",{className:"flex-1 overflow-auto p-4",children:_.jsxs("div",{className:"mx-auto max-w-xl space-y-6",children:[_.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[_.jsx(_e,{icon:os,size:14,strokeWidth:2}),_.jsx("span",{className:"font-mono",children:n.path})]}),_.jsxs(cd,{children:[_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"displayName",children:"Display Name"}),_.jsx(Wt,{id:"displayName",value:d,onChange:E=>p(E.target.value),placeholder:n.path.split("/").pop()||"My Project"})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"startupScript",children:"Startup Script"}),_.jsx(wp,{id:"startupScript",value:f,onChange:E=>g(E.target.value),placeholder:"npm install && npm run dev",rows:3}),_.jsx(oo,{children:"Command to run in the terminal when creating a worktree."})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"copyFiles",children:"Copy Files"}),_.jsx(Wt,{id:"copyFiles",value:S,onChange:E=>C(E.target.value),placeholder:".env, config.local.json"}),_.jsx(oo,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]})]})})]})}const QV=Bj.update({id:"/",path:"/",getParentRoute:()=>Ks}),ZV=Gj.update({id:"/worktrees/",path:"/worktrees/",getParentRoute:()=>Ks}),JV=KN.update({id:"/terminals/",path:"/terminals/",getParentRoute:()=>Ks}),eF=eB.update({id:"/tasks/",path:"/tasks/",getParentRoute:()=>Ks}),tF=rB.update({id:"/settings/",path:"/settings/",getParentRoute:()=>Ks}),nF=hB.update({id:"/review/",path:"/review/",getParentRoute:()=>Ks}),rF=mB.update({id:"/repositories/",path:"/repositories/",getParentRoute:()=>Ks}),sF=JT.update({id:"/tasks/$taskId",path:"/tasks/$taskId",getParentRoute:()=>Ks}),iF=e5.update({id:"/repositories/$repoId",path:"/repositories/$repoId",getParentRoute:()=>Ks}),oF={IndexRoute:QV,RepositoriesRepoIdRoute:iF,TasksTaskIdRoute:sF,RepositoriesIndexRoute:rF,ReviewIndexRoute:nF,SettingsIndexRoute:tF,TasksIndexRoute:eF,TerminalsIndexRoute:JV,WorktreesIndexRoute:ZV},aF=Ks._addFileChildren(oF)._addFileTypes(),t5=R.createContext(null);function lF({children:e}){const[t,n]=R.useState(!1),[s,o]=R.useState(!0),[u,h]=R.useState(!1),[a,l]=R.useState(!1),d=R.useCallback(async()=>{try{const S=await fetch("/api/auth/check");if(S.ok){const C=await S.json();h(C.authRequired),n(C.authenticated),C.authRequired&&!C.authenticated&&l(!0)}}catch{h(!1),n(!0)}finally{o(!1)}},[]);R.useEffect(()=>{d()},[d]),R.useEffect(()=>{const S=()=>{u&&(n(!1),l(!0))};return window.addEventListener("vibora:auth-required",S),()=>window.removeEventListener("vibora:auth-required",S)},[u]);const p=R.useCallback(async(S,C)=>{const w=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:S,password:C})});if(!w.ok){const y=await w.json();throw new Error(y.error||"Login failed")}n(!0),l(!1)},[]),f=R.useCallback(async()=>{await fetch("/api/auth/logout",{method:"POST"}),n(!1),l(!0)},[]),g=R.useMemo(()=>({isAuthenticated:t,isLoading:s,authRequired:u,showLoginModal:a,setShowLoginModal:l,login:p,logout:f}),[t,s,u,a,p,f]);return _.jsx(t5.Provider,{value:g,children:e})}function cF(){const e=R.useContext(t5);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function uF(){const{showLoginModal:e,login:t}=cF(),[n,s]=R.useState(""),[o,u]=R.useState(""),[h,a]=R.useState(null),[l,d]=R.useState(!1),p=R.useCallback(async g=>{g.preventDefault(),a(null),d(!0);try{await t(n,o)}catch(S){a(S instanceof Error?S.message:"Login failed")}finally{d(!1)}},[n,o,t]),f=g=>{g.key==="Enter"&&!l&&n&&o&&(g.preventDefault(),p(g))};return _.jsx(xs,{open:e,children:_.jsxs(Ss,{showCloseButton:!1,className:"sm:max-w-sm",onKeyDown:f,children:[_.jsx(Bs,{children:_.jsx(zs,{children:"Login to Vibora"})}),_.jsxs("form",{onSubmit:p,children:[_.jsxs(cd,{className:"mt-4",children:[_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"login-username",children:"Username"}),_.jsx(Wt,{id:"login-username",type:"text",value:n,onChange:g=>s(g.target.value),autoComplete:"username",autoFocus:!0,required:!0})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"login-password",children:"Password"}),_.jsx(Wt,{id:"login-password",type:"password",value:o,onChange:g=>u(g.target.value),autoComplete:"current-password",required:!0})]}),h&&_.jsx("p",{className:"text-sm text-red-500",children:h})]}),_.jsx(go,{className:"mt-4",children:_.jsx(Be,{type:"submit",disabled:l||!n||!o,children:l?"Logging in...":"Login"})})]})]})})}const dF=new vO({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}}),fF=W3({routeTree:aF});hA.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(_O,{client:dF,children:_.jsxs(lF,{children:[_.jsx($3,{router:fF}),_.jsx(uF,{})]})})}));