vibora 1.10.0 → 1.12.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.
Files changed (37) hide show
  1. package/bin/vibora.js +95 -208
  2. package/dist/assets/index-BiapsD8F.css +1 -0
  3. package/dist/assets/{index-DptSra7n.js → index-C4ahV9ZS.js} +62 -62
  4. package/dist/index.html +2 -2
  5. package/package.json +1 -1
  6. package/server/index.js +233 -88
  7. package/dist/assets/index-BMm5AnYN.js +0 -45
  8. package/dist/assets/index-BNhD6i8B.js +0 -45
  9. package/dist/assets/index-BfcOSnqG.css +0 -1
  10. package/dist/assets/index-Bj6X8q5U.js +0 -46
  11. package/dist/assets/index-BrWX1YZT.css +0 -1
  12. package/dist/assets/index-BxOt05pH.css +0 -1
  13. package/dist/assets/index-BxbgLbxS.css +0 -1
  14. package/dist/assets/index-ByL08tgg.js +0 -45
  15. package/dist/assets/index-C7bo3ECQ.css +0 -1
  16. package/dist/assets/index-CCtJOkVu.js +0 -116
  17. package/dist/assets/index-COn-Eyu7.css +0 -1
  18. package/dist/assets/index-ClQ5DUcr.js +0 -46
  19. package/dist/assets/index-Co_u49xL.css +0 -1
  20. package/dist/assets/index-D5T2n3lt.css +0 -1
  21. package/dist/assets/index-DCMXlbkM.css +0 -1
  22. package/dist/assets/index-DDBvX7Ij.css +0 -1
  23. package/dist/assets/index-DJxCuTf-.js +0 -45
  24. package/dist/assets/index-DP-OAlLv.js +0 -116
  25. package/dist/assets/index-DS5B_viR.js +0 -116
  26. package/dist/assets/index-DgP1TgfA.js +0 -45
  27. package/dist/assets/index-DijiKhVm.js +0 -46
  28. package/dist/assets/index-Djf_9c_I.css +0 -1
  29. package/dist/assets/index-Hcd8Y1ma.js +0 -45
  30. package/dist/assets/index-I_FT38E3.css +0 -1
  31. package/dist/assets/index-IdRTHnwv.js +0 -51
  32. package/dist/assets/index-QutiQrzr.js +0 -45
  33. package/dist/assets/index-ViklVZfD.js +0 -51
  34. package/dist/assets/index-Xk8D-HCD.css +0 -1
  35. package/dist/assets/index-f56gTmVJ.css +0 -1
  36. package/dist/assets/index-qBnZOT-E.js +0 -45
  37. package/dist/assets/index-r3_O3Fa_.js +0 -45
@@ -1,51 +0,0 @@
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 lA(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 Gw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fg={exports:{}},hu={};var Gx;function cA(){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 uA(){return $x||($x=1,Fg.exports=cA()),Fg.exports}var _=uA(),Ug={exports:{}},pt={};var Kx;function dA(){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(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,y={};function b(D,N,W){this.props=D,this.context=N,this.refs=y,this.updater=W||C}b.prototype.isReactComponent={},b.prototype.setState=function(D,N){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,N,"setState")},b.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function v(){}v.prototype=b.prototype;function x(D,N,W){this.props=D,this.context=N,this.refs=y,this.updater=W||C}var E=x.prototype=new v;E.constructor=x,w(E,b.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 P(D,N,W){var Z=W.ref;return{$$typeof:e,type:D,key:N,ref:Z!==void 0?Z:null,props:W}}function z(D,N){return P(D.type,N,D.props)}function H(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function q(D){var N={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(W){return N[W]})}var I=/\/+/g;function K(D,N){return typeof D=="object"&&D!==null&&D.key!=null?q(""+D.key):N.toString(36)}function Y(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(A,A):(D.status="pending",D.then(function(N){D.status==="pending"&&(D.status="fulfilled",D.value=N)},function(N){D.status==="pending"&&(D.status="rejected",D.reason=N)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function V(D,N,W,Z,ee){var te=typeof D;(te==="undefined"||te==="boolean")&&(D=null);var X=!1;if(D===null)X=!0;else switch(te){case"bigint":case"string":case"number":X=!0;break;case"object":switch(D.$$typeof){case e:case t:X=!0;break;case p:return X=D._init,V(X(D._payload),N,W,Z,ee)}}if(X)return ee=ee(D),X=Z===""?"."+K(D,0):Z,T(ee)?(W="",X!=null&&(W=X.replace(I,"$&/")+"/"),V(ee,N,W,"",function(ne){return ne})):ee!=null&&(H(ee)&&(ee=z(ee,W+(ee.key==null||D&&D.key===ee.key?"":(""+ee.key).replace(I,"$&/")+"/")+X)),N.push(ee)),1;X=0;var F=Z===""?".":Z+":";if(T(D))for(var se=0;se<D.length;se++)Z=D[se],te=F+K(Z,se),X+=V(Z,N,W,te,ee);else if(se=S(D),typeof se=="function")for(D=se.call(D),se=0;!(Z=D.next()).done;)Z=Z.value,te=F+K(Z,se++),X+=V(Z,N,W,te,ee);else if(te==="object"){if(typeof D.then=="function")return V(Y(D),N,W,Z,ee);throw N=String(D),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return X}function $(D,N,W){if(D==null)return D;var Z=[],ee=0;return V(D,Z,"","",function(te){return N.call(W,te,ee++)}),Z}function G(D){if(D._status===-1){var N=D._result;N=N(),N.then(function(W){(D._status===0||D._status===-1)&&(D._status=1,D._result=W)},function(W){(D._status===0||D._status===-1)&&(D._status=2,D._result=W)}),D._status===-1&&(D._status=0,D._result=N)}if(D._status===1)return D._result.default;throw D._result}var j=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var N=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(N))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},U={map:$,forEach:function(D,N,W){$(D,function(){N.apply(this,arguments)},W)},count:function(D){var N=0;return $(D,function(){N++}),N},toArray:function(D){return $(D,function(N){return N})||[]},only:function(D){if(!H(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return pt.Activity=f,pt.Children=U,pt.Component=b,pt.Fragment=n,pt.Profiler=o,pt.PureComponent=x,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(D){return M.H.useMemoCache(D)}},pt.cache=function(D){return function(){return D.apply(null,arguments)}},pt.cacheSignal=function(){return null},pt.cloneElement=function(D,N,W){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var Z=w({},D.props),ee=D.key;if(N!=null)for(te in N.key!==void 0&&(ee=""+N.key),N)!L.call(N,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&N.ref===void 0||(Z[te]=N[te]);var te=arguments.length-2;if(te===1)Z.children=W;else if(1<te){for(var X=Array(te),F=0;F<te;F++)X[F]=arguments[F+2];Z.children=X}return P(D.type,ee,Z)},pt.createContext=function(D){return D={$$typeof:h,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:u,_context:D},D},pt.createElement=function(D,N,W){var Z,ee={},te=null;if(N!=null)for(Z in N.key!==void 0&&(te=""+N.key),N)L.call(N,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ee[Z]=N[Z]);var X=arguments.length-2;if(X===1)ee.children=W;else if(1<X){for(var F=Array(X),se=0;se<X;se++)F[se]=arguments[se+2];ee.children=F}if(D&&D.defaultProps)for(Z in X=D.defaultProps,X)ee[Z]===void 0&&(ee[Z]=X[Z]);return P(D,te,ee)},pt.createRef=function(){return{current:null}},pt.forwardRef=function(D){return{$$typeof:a,render:D}},pt.isValidElement=H,pt.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:G}},pt.memo=function(D,N){return{$$typeof:d,type:D,compare:N===void 0?null:N}},pt.startTransition=function(D){var N=M.T,W={};M.T=W;try{var Z=D(),ee=M.S;ee!==null&&ee(W,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(A,j)}catch(te){j(te)}finally{N!==null&&W.types!==null&&(N.types=W.types),M.T=N}},pt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},pt.use=function(D){return M.H.use(D)},pt.useActionState=function(D,N,W){return M.H.useActionState(D,N,W)},pt.useCallback=function(D,N){return M.H.useCallback(D,N)},pt.useContext=function(D){return M.H.useContext(D)},pt.useDebugValue=function(){},pt.useDeferredValue=function(D,N){return M.H.useDeferredValue(D,N)},pt.useEffect=function(D,N){return M.H.useEffect(D,N)},pt.useEffectEvent=function(D){return M.H.useEffectEvent(D)},pt.useId=function(){return M.H.useId()},pt.useImperativeHandle=function(D,N,W){return M.H.useImperativeHandle(D,N,W)},pt.useInsertionEffect=function(D,N){return M.H.useInsertionEffect(D,N)},pt.useLayoutEffect=function(D,N){return M.H.useLayoutEffect(D,N)},pt.useMemo=function(D,N){return M.H.useMemo(D,N)},pt.useOptimistic=function(D,N){return M.H.useOptimistic(D,N)},pt.useReducer=function(D,N,W){return M.H.useReducer(D,N,W)},pt.useRef=function(D){return M.H.useRef(D)},pt.useState=function(D){return M.H.useState(D)},pt.useSyncExternalStore=function(D,N,W){return M.H.useSyncExternalStore(D,N,W)},pt.useTransition=function(){return M.H.useTransition()},pt.version="19.2.3",pt}var Yx;function Ju(){return Yx||(Yx=1,Ug.exports=dA()),Ug.exports}var R=Ju();const ze=Gw(R),$w=lA({__proto__:null,default:ze},[R]);var Wg={exports:{}},pu={},qg={exports:{}},Gg={};var Xx;function fA(){return Xx||(Xx=1,(function(e){function t(V,$){var G=V.length;V.push($);e:for(;0<G;){var j=G-1>>>1,U=V[j];if(0<o(U,$))V[j]=$,V[G]=U,G=j;else break e}}function n(V){return V.length===0?null:V[0]}function s(V){if(V.length===0)return null;var $=V[0],G=V.pop();if(G!==$){V[0]=G;e:for(var j=0,U=V.length,D=U>>>1;j<D;){var N=2*(j+1)-1,W=V[N],Z=N+1,ee=V[Z];if(0>o(W,G))Z<U&&0>o(ee,W)?(V[j]=ee,V[Z]=G,j=Z):(V[j]=W,V[N]=G,j=N);else if(Z<U&&0>o(ee,G))V[j]=ee,V[Z]=G,j=Z;else break e}}return $}function o(V,$){var G=V.sortIndex-$.sortIndex;return G!==0?G:V.id-$.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,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function E(V){for(var $=n(d);$!==null;){if($.callback===null)s(d);else if($.startTime<=V)s(d),$.sortIndex=$.expirationTime,t(l,$);else break;$=n(d)}}function T(V){if(w=!1,E(V),!C)if(n(l)!==null)C=!0,A||(A=!0,q());else{var $=n(d);$!==null&&Y(T,$.startTime-V)}}var A=!1,M=-1,L=5,P=-1;function z(){return y?!0:!(e.unstable_now()-P<L)}function H(){if(y=!1,A){var V=e.unstable_now();P=V;var $=!0;try{e:{C=!1,w&&(w=!1,v(M),M=-1),S=!0;var G=g;try{t:{for(E(V),f=n(l);f!==null&&!(f.expirationTime>V&&z());){var j=f.callback;if(typeof j=="function"){f.callback=null,g=f.priorityLevel;var U=j(f.expirationTime<=V);if(V=e.unstable_now(),typeof U=="function"){f.callback=U,E(V),$=!0;break t}f===n(l)&&s(l),E(V)}else s(l);f=n(l)}if(f!==null)$=!0;else{var D=n(d);D!==null&&Y(T,D.startTime-V),$=!1}}break e}finally{f=null,g=G,S=!1}$=void 0}}finally{$?q():A=!1}}}var q;if(typeof x=="function")q=function(){x(H)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,K=I.port2;I.port1.onmessage=H,q=function(){K.postMessage(null)}}else q=function(){b(H,0)};function Y(V,$){M=b(function(){V(e.unstable_now())},$)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(V){switch(g){case 1:case 2:case 3:var $=3;break;default:$=g}var G=g;g=$;try{return V()}finally{g=G}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(V,$){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var G=g;g=V;try{return $()}finally{g=G}},e.unstable_scheduleCallback=function(V,$,G){var j=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?j+G:j):G=j,V){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=G+U,V={id:p++,callback:$,priorityLevel:V,startTime:G,expirationTime:U,sortIndex:-1},G>j?(V.sortIndex=G,t(d,V),n(l)===null&&V===n(d)&&(w?(v(M),M=-1):w=!0,Y(T,G-j))):(V.sortIndex=U,t(l,V),C||S||(C=!0,A||(A=!0,q()))),V},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(V){var $=g;return function(){var G=g;g=$;try{return V.apply(this,arguments)}finally{g=G}}}})(Gg)),Gg}var Qx;function hA(){return Qx||(Qx=1,qg.exports=fA()),qg.exports}var $g={exports:{}},Xn={};var Zx;function pA(){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 Kw(){if(Jx)return $g.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(),$g.exports=pA(),$g.exports}var eS;function mA(){if(eS)return pu;eS=1;var e=hA(),t=Ju(),n=Kw();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 B=!1,Q=k.child;Q;){if(Q===c){B=!0,c=k,m=O;break}if(Q===m){B=!0,m=k,c=O;break}Q=Q.sibling}if(!B){for(Q=O.child;Q;){if(Q===c){B=!0,c=O,m=k;break}if(Q===m){B=!0,m=O,c=k;break}Q=Q.sibling}if(!B)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"),b=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),x=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"),P=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function q(r){return r===null||typeof r!="object"?null:(r=H&&r[H]||r["@@iterator"],typeof r=="function"?r:null)}var I=Symbol.for("react.client.reference");function K(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===I?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case b:return"Profiler";case y:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case P:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case C:return"Portal";case x: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 Y=Array.isArray,V=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},j=[],U=-1;function D(r){return{current:r}}function N(r){0>U||(r.current=j[U],j[U]=null,U--)}function W(r,i){U++,j[U]=r.current,r.current=i}var Z=D(null),ee=D(null),te=D(null),X=D(null);function F(r,i){switch(W(te,i),W(ee,r),W(Z,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}}N(Z),W(Z,r)}function se(){N(Z),N(ee),N(te)}function ne(r){r.memoizedState!==null&&W(X,r);var i=Z.current,c=gx(i,r.type);i!==c&&(W(ee,r),W(Z,c))}function re(r){ee.current===r&&(N(Z),N(ee)),X.current===r&&(N(X),cu._currentValue=G)}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 ge=!1;function ue(r,i){if(!r||ge)return"";ge=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(i){var Le=function(){throw Error()};if(Object.defineProperty(Le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Le,[])}catch(ye){var me=ye}Reflect.construct(r,[],Le)}else{try{Le.call()}catch(ye){me=ye}r.call(Le.prototype)}}else{try{throw Error()}catch(ye){me=ye}(Le=r())&&typeof Le.catch=="function"&&Le.catch(function(){})}}catch(ye){if(ye&&me&&typeof ye.stack=="string")return[ye.stack,me.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(),B=O[0],Q=O[1];if(B&&Q){var ie=B.split(`
5
- `),he=Q.split(`
6
- `);for(k=m=0;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;for(;k<he.length&&!he[k].includes("DetermineComponentFrameRoot");)k++;if(m===ie.length||k===he.length)for(m=ie.length-1,k=he.length-1;1<=m&&0<=k&&ie[m]!==he[k];)k--;for(;1<=m&&0<=k;m--,k--)if(ie[m]!==he[k]){if(m!==1||k!==1)do if(m--,k--,0>k||ie[m]!==he[k]){var Ce=`
7
- `+ie[m].replace(" at new "," at ");return r.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",r.displayName)),Ce}while(1<=m&&0<=k);break}}}finally{ge=!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 ue(r.type,!1);case 11:return ue(r.type.render,!1);case 1:return ue(r.type,!0);case 31:return ve("Activity");default:return""}}function Ie(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 De=Object.prototype.hasOwnProperty,Oe=e.unstable_scheduleCallback,be=e.unstable_cancelCallback,Me=e.unstable_shouldYield,pe=e.unstable_requestPaint,Re=e.unstable_now,we=e.unstable_getCurrentPriorityLevel,We=e.unstable_ImmediatePriority,et=e.unstable_UserBlockingPriority,xe=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,tt=e.unstable_IdlePriority,dt=e.log,Se=e.unstable_setDisableYieldValue,He=null,ke=null;function nt(r){if(typeof dt=="function"&&Se(r),ke&&typeof ke.setStrictMode=="function")try{ke.setStrictMode(He,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,B=r.pingedLanes;r=r.warmLanes;var Q=m&134217727;return Q!==0?(m=Q&~O,m!==0?k=vt(m):(B&=Q,B!==0?k=vt(B):c||(c=Q&~r,c!==0&&(k=vt(c))))):(Q=m&~O,Q!==0?k=vt(Q):B!==0?k=vt(B):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 It(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 B=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,he=r.hiddenUpdates;for(c=B&~c;0<c;){var Ce=31-lt(c),Le=1<<Ce;Q[Ce]=0,ie[Ce]=-1;var me=he[Ce];if(me!==null)for(he[Ce]=null,Ce=0;Ce<me.length;Ce++){var ye=me[Ce];ye!==null&&(ye.lane&=-536870913)}c&=~Le}m!==0&&Qe(r,m,0),O!==0&&k===0&&r.tag!==0&&(r.suspendedLanes|=O&~(B&~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=$.p;return r!==0?r:(r=window.event,r===void 0?32:zx(r.type))}function Fa(r,i){var c=$.p;try{return $.p=r,i()}finally{$.p=c}}var wr=Math.random().toString(36).slice(2),pn="__reactFiber$"+wr,mn="__reactProps$"+wr,ks="__reactContainer$"+wr,Er="__reactEvents$"+wr,Xs="__reactListeners$"+wr,Ip="__reactHandles$"+wr,xc="__reactResources$"+wr,Ro="__reactMarker$"+wr;function To(r){delete r[pn],delete r[mn],delete r[Er],delete r[Xs],delete r[Ip]}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 kr(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 Np=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 Bp(r){return De.call(Wa,r)?!0:De.call(Ua,r)?!1:Np.test(r)?Wa[r]=!0:(Ua[r]=!0,!1)}function Zs(r,i,c){if(Bp(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 Rr(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 zp(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(B){c=""+B,O.call(this,B)}}),Object.defineProperty(r,i,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(B){c=""+B},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Sc(r){if(!r._valueTracker){var i=_d(r)?"checked":"value";r._valueTracker=zp(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,B,Q){r.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?r.type=B:r.removeAttribute("type"),i!=null?B==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+lr(i)):r.value!==""+lr(i)&&(r.value=""+lr(i)):B!=="submit"&&B!=="reset"||r.removeAttribute("value"),i!=null?Ec(r,B,lr(i)):c!=null?Ec(r,B,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,B,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,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(r.name=B),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 Fe(r,i,c,m){if(i==null){if(m!=null){if(c!=null)throw Error(s(92));if(Y(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 rt(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 Hp(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 Vp=!1;function my(r,i,c){if(Vp)return r(i,c);Vp=!0;try{var m=r(i);return m}finally{if(Vp=!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"),Fp=!1;if(ni)try{var Rc={};Object.defineProperty(Rc,"passive",{get:function(){Fp=!0}}),window.addEventListener("test",Rc,Rc),window.removeEventListener("test",Rc,Rc)}catch{Fp=!1}var Oi=null,Up=null,Sd=null;function gy(){if(Sd)return Sd;var r,i=Up,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 B=c-r;for(m=1;m<=B&&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,B){this._reactName=c,this._targetInst=k,this.type=m,this.nativeEvent=O,this.target=B,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}),o5=ur(Tc),Wp,qp,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:$p,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"?(Wp=r.screenX-Lc.screenX,qp=r.screenY-Lc.screenY):qp=Wp=0,Lc=r),Wp)},movementY:function(r){return"movementY"in r?r.movementY:qp}}),_y=ur(kd),a5=f({},kd,{dataTransfer:0}),l5=ur(a5),c5=f({},Tc,{relatedTarget:0}),Gp=ur(c5),u5=f({},Ao,{animationName:0,elapsedTime:0,pseudoElement:0}),d5=ur(u5),f5=f({},Ao,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),h5=ur(f5),p5=f({},Ao,{data:0}),yy=ur(p5),m5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},g5={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"},v5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _5(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=v5[r])?!!i[r]:!1}function $p(){return _5}var y5=f({},Tc,{key:function(r){if(r.key){var i=m5[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"?g5[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$p,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}}),b5=ur(y5),x5=f({},kd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),by=ur(x5),S5=f({},Tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$p}),C5=ur(S5),w5=f({},Ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),E5=ur(w5),k5=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}),R5=ur(k5),T5=f({},Ao,{newState:0,oldState:0}),L5=ur(T5),A5=[9,13,27,32],Kp=ni&&"CompositionEvent"in window,Ac=null;ni&&"documentMode"in document&&(Ac=document.documentMode);var O5=ni&&"TextEvent"in window&&!Ac,xy=ni&&(!Kp||Ac&&8<Ac&&11>=Ac),Sy=" ",Cy=!1;function wy(r,i){switch(r){case"keyup":return A5.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 M5(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 D5(r,i){if(Ka)return r==="compositionend"||!Kp&&wy(r,i)?(r=gy(),Sd=Up=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 P5={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"?!!P5[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 j5(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 Yp;if(ni){var Xp="oninput"in document;if(!Xp){var Ay=document.createElement("div");Ay.setAttribute("oninput","return;"),Xp=typeof Ay.oninput=="function"}Yp=Xp}else Yp=!1;Ly=Yp&&(!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,Hp(r)),my(j5,i)}}function I5(r,i,c){r==="focusin"?(Oy(),Oc=i,Mc=c,Oc.attachEvent("onpropertychange",My)):r==="focusout"&&Oy()}function N5(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Rd(Mc)}function B5(r,i){if(r==="click")return Rd(i)}function z5(r,i){if(r==="input"||r==="change")return Rd(i)}function H5(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Tr=typeof Object.is=="function"?Object.is:H5;function Dc(r,i){if(Tr(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(!De.call(i,k)||!Tr(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 jy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?jy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Iy(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 Qp(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 V5=ni&&"documentMode"in document&&11>=document.documentMode,Ya=null,Zp=null,Pc=null,Jp=!1;function Ny(r,i,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Jp||Ya==null||Ya!==Li(m)||(m=Ya,"selectionStart"in m&&Qp(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(Zp,"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")},em={},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(em[r])return em[r];if(!Xa[r])return r;var i=Xa[r],c;for(c in i)if(i.hasOwnProperty(c)&&c in By)return em[r]=i[c];return r}var zy=Mo("animationend"),Hy=Mo("animationiteration"),Vy=Mo("animationstart"),F5=Mo("transitionrun"),U5=Mo("transitionstart"),W5=Mo("transitioncancel"),Fy=Mo("transitionend"),Uy=new Map,tm="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(" ");tm.push("scrollEnd");function ps(r,i){Uy.set(r,i),kr(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,nm=0;function Ld(){for(var r=Qa,i=nm=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 B=m.pending;B===null?k.next=k:(k.next=B.next,B.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,nm|=m,r.lanes|=m,r=r.alternate,r!==null&&(r.lanes|=m)}function rm(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,fg=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 q5(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 Lr(r,i,c,m){return new q5(r,i,c,m)}function sm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ri(r,i){var c=r.alternate;return c===null?(c=Lr(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 B=0;if(m=r,typeof r=="function")sm(r)&&(B=1);else if(typeof r=="string")B=XL(r,c,Z.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case P:return r=Lr(31,c,i,k),r.elementType=P,r.lanes=O,r;case w:return Po(c.children,k,O,i);case y:B=8,k|=24;break;case b:return r=Lr(12,c,i,k|2),r.elementType=b,r.lanes=O,r;case T:return r=Lr(13,c,i,k),r.elementType=T,r.lanes=O,r;case A:return r=Lr(19,c,i,k),r.elementType=A,r.lanes=O,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case x:B=10;break e;case v:B=9;break e;case E:B=11;break e;case M:B=14;break e;case L:B=16,m=null;break e}B=29,c=Error(s(130,r===null?"null":typeof r,"")),m=null}return i=Lr(B,c,i,k),i.elementType=r,i.type=m,i.lanes=O,i}function Po(r,i,c,m){return r=Lr(7,r,m,i),r.lanes=c,r}function im(r,i,c){return r=Lr(6,r,null,i),r.lanes=c,r}function Gy(r){var i=Lr(18,null,null,0);return i.stateNode=r,i}function om(r,i,c){return i=Lr(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:Ie(i)},$y.set(r,i),i)}return{value:r,source:i,stack:Ie(i)}}var Ja=[],el=0,Dd=null,jc=0,Gr=[],$r=0,Mi=null,Ts=1,Ls="";function si(r,i){Ja[el++]=jc,Ja[el++]=Dd,Dd=r,jc=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 B=k-k%5;O=(m&(1<<B)-1).toString(32),m>>=B,k-=B,Ts=1<<32-lt(i)+k|c<<k|m,Ls=O+r}else Ts=1<<O|c<<k|m,Ls=r}function am(r){r.return!==null&&(si(r,1),Ky(r,1,0))}function lm(r){for(;r===Dd;)Dd=Ja[--el],Ja[el]=null,jc=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,cm=Error(s(519));function Pi(r){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ic(qr(i,r)),cm}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),Fe(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")||Rg(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=Mg,Mg=null,Yt=r):Yt=i):Yt=Hn?Xr(r.stateNode.nextSibling):null;return!0}function jo(){Yt=Hn=null,At=!1}function um(){var r=Di;return r!==null&&(pr===null?pr=r:pr.push.apply(pr,r),Di=null),r}function Ic(r){Di===null?Di=[r]:Di.push(r)}var dm=D(null),Io=null,ii=null;function ji(r,i,c){W(dm,i._currentValue),i._currentValue=c}function oi(r){r._currentValue=dm.current,N(dm)}function fm(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 hm(r,i,c,m){var k=r.child;for(k!==null&&(k.return=r);k!==null;){var O=k.dependencies;if(O!==null){var B=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),fm(O.return,c,r),m||(B=null);break e}O=Q.next}}else if(k.tag===18){if(B=k.return,B===null)throw Error(s(341));B.lanes|=c,O=B.alternate,O!==null&&(O.lanes|=c),fm(B,c,r),B=null}else B=k.child;if(B!==null)B.return=k;else for(B=k;B!==null;){if(B===r){B=null;break}if(k=B.sibling,k!==null){k.return=B.return,B=k;break}B=B.return}k=B}}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 B=k.alternate;if(B===null)throw Error(s(387));if(B=B.memoizedProps,B!==null){var Q=k.type;Tr(k.pendingProps.value,B.value)||(r!==null?r.push(Q):r=[Q])}}else if(k===X.current){if(B=k.alternate,B===null)throw Error(s(387));B.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(r!==null?r.push(cu):r=[cu])}k=k.return}r!==null&&hm(i,r,c,m),i.flags|=262144}function Pd(r){for(r=r.firstContext;r!==null;){if(!Tr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function No(r){Io=r,ii=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Vn(r){return Zy(Io,r)}function jd(r,i){return Io===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 G5=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()})}},$5=e.unstable_scheduleCallback,K5=e.unstable_NormalPriority,_n={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pm(){return{controller:new G5,data:new Map,refCount:0}}function Nc(r){r.refCount--,r.refCount===0&&$5(K5,function(){r.controller.abort()})}var Bc=null,mm=0,rl=0,sl=null;function Y5(r,i){if(Bc===null){var c=Bc=[];mm=0,rl=_g(),sl={status:"pending",value:void 0,then:function(m){c.push(m)}}}return mm++,i.then(Jy,Jy),i}function Jy(){if(--mm===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 X5(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=V.S;V.S=function(r,i){Nb=Re(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Y5(r,i),e1!==null&&e1(r,i)};var Bo=D(null);function gm(){var r=Bo.current;return r!==null?r:qt.pooledCache}function Id(r,i){i===null?W(Bo,Bo.current):W(Bo,i.pool)}function t1(){var r=gm();return r===null?null:{parent:_n._currentValue,pool:r}}var il=Error(s(460)),vm=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 B(ce){return r&&ce.alternate===null&&(ce.flags|=67108866),ce}function Q(ce,ae,fe,Te){return ae===null||ae.tag!==6?(ae=im(fe,ce.mode,Te),ae.return=ce,ae):(ae=k(ae,fe),ae.return=ce,ae)}function ie(ce,ae,fe,Te){var it=fe.type;return it===w?Ce(ce,ae,fe.props.children,Te,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,Te),Hc(ae,fe),ae.return=ce,ae)}function he(ce,ae,fe,Te){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==fe.containerInfo||ae.stateNode.implementation!==fe.implementation?(ae=om(fe,ce.mode,Te),ae.return=ce,ae):(ae=k(ae,fe.children||[]),ae.return=ce,ae)}function Ce(ce,ae,fe,Te,it){return ae===null||ae.tag!==7?(ae=Po(fe,ce.mode,Te,it),ae.return=ce,ae):(ae=k(ae,fe),ae.return=ce,ae)}function Le(ce,ae,fe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=im(""+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=om(ae,ce.mode,fe),ae.return=ce,ae;case L:return ae=zo(ae),Le(ce,ae,fe)}if(Y(ae)||q(ae))return ae=Po(ae,ce.mode,fe,null),ae.return=ce,ae;if(typeof ae.then=="function")return Le(ce,zd(ae),fe);if(ae.$$typeof===x)return Le(ce,jd(ce,ae),fe);Hd(ce,ae)}return null}function me(ce,ae,fe,Te){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,Te);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case S:return fe.key===it?ie(ce,ae,fe,Te):null;case C:return fe.key===it?he(ce,ae,fe,Te):null;case L:return fe=zo(fe),me(ce,ae,fe,Te)}if(Y(fe)||q(fe))return it!==null?null:Ce(ce,ae,fe,Te,null);if(typeof fe.then=="function")return me(ce,ae,zd(fe),Te);if(fe.$$typeof===x)return me(ce,ae,jd(ce,fe),Te);Hd(ce,fe)}return null}function ye(ce,ae,fe,Te,it){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return ce=ce.get(fe)||null,Q(ae,ce,""+Te,it);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case S:return ce=ce.get(Te.key===null?fe:Te.key)||null,ie(ae,ce,Te,it);case C:return ce=ce.get(Te.key===null?fe:Te.key)||null,he(ae,ce,Te,it);case L:return Te=zo(Te),ye(ce,ae,fe,Te,it)}if(Y(Te)||q(Te))return ce=ce.get(fe)||null,Ce(ae,ce,Te,it,null);if(typeof Te.then=="function")return ye(ce,ae,fe,zd(Te),it);if(Te.$$typeof===x)return ye(ce,ae,fe,jd(ae,Te),it);Hd(ae,Te)}return null}function $e(ce,ae,fe,Te){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=me(ce,Ze,fe[_t],Te);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=Le(ce,fe[_t],Te),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],Te),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,Te){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=me(ce,Ze,Dt.value,Te);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=Le(ce,Dt.value,Te),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,Te),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(aA){return i(ce,aA)}),At&&si(ce,_t),it}function Ut(ce,ae,fe,Te){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),Te=k(ae,fe.props.children),Te.return=ce,ce=Te;break e}}else if(ae.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===L&&zo(it)===ae.type){c(ce,ae.sibling),Te=k(ae,fe.props),Hc(Te,fe),Te.return=ce,ce=Te;break e}c(ce,ae);break}else i(ce,ae);ae=ae.sibling}fe.type===w?(Te=Po(fe.props.children,ce.mode,Te,fe.key),Te.return=ce,ce=Te):(Te=Md(fe.type,fe.key,fe.props,null,ce.mode,Te),Hc(Te,fe),Te.return=ce,ce=Te)}return B(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),Te=k(ae,fe.children||[]),Te.return=ce,ce=Te;break e}else{c(ce,ae);break}else i(ce,ae);ae=ae.sibling}Te=om(fe,ce.mode,Te),Te.return=ce,ce=Te}return B(ce);case L:return fe=zo(fe),Ut(ce,ae,fe,Te)}if(Y(fe))return $e(ce,ae,fe,Te);if(q(fe)){if(it=q(fe),typeof it!="function")throw Error(s(150));return fe=it.call(fe),ut(ce,ae,fe,Te)}if(typeof fe.then=="function")return Ut(ce,ae,zd(fe),Te);if(fe.$$typeof===x)return Ut(ce,ae,jd(ce,fe),Te);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),Te=k(ae,fe),Te.return=ce,ce=Te):(c(ce,ae),Te=im(fe,ce.mode,Te),Te.return=ce,ce=Te),B(ce)):c(ce,ae)}return function(ce,ae,fe,Te){try{zc=0;var it=Ut(ce,ae,fe,Te);return ol=null,it}catch(Ze){if(Ze===il||Ze===Nd)throw Ze;var Mt=Lr(29,Ze,null,ce.mode);return Mt.lanes=Te,Mt.return=ce,Mt}}}var Vo=o1(!0),a1=o1(!1),Ii=!1;function _m(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ym(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,(jt&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 bm(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 B={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};O===null?k=O=B:O=O.next=B,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 xm=!1;function Fc(){if(xm){var r=sl;if(r!==null)throw r}}function Uc(r,i,c,m){xm=!1;var k=r.updateQueue;Ii=!1;var O=k.firstBaseUpdate,B=k.lastBaseUpdate,Q=k.shared.pending;if(Q!==null){k.shared.pending=null;var ie=Q,he=ie.next;ie.next=null,B===null?O=he:B.next=he,B=ie;var Ce=r.alternate;Ce!==null&&(Ce=Ce.updateQueue,Q=Ce.lastBaseUpdate,Q!==B&&(Q===null?Ce.firstBaseUpdate=he:Q.next=he,Ce.lastBaseUpdate=ie))}if(O!==null){var Le=k.baseState;B=0,Ce=he=ie=null,Q=O;do{var me=Q.lane&-536870913,ye=me!==Q.lane;if(ye?(Tt&me)===me:(m&me)===me){me!==0&&me===rl&&(xm=!0),Ce!==null&&(Ce=Ce.next={lane:0,tag:Q.tag,payload:Q.payload,callback:null,next:null});e:{var $e=r,ut=Q;me=i;var Ut=c;switch(ut.tag){case 1:if($e=ut.payload,typeof $e=="function"){Le=$e.call(Ut,Le,me);break e}Le=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=ut.payload,me=typeof $e=="function"?$e.call(Ut,Le,me):$e,me==null)break e;Le=f({},Le,me);break e;case 2:Ii=!0}}me=Q.callback,me!==null&&(r.flags|=64,ye&&(r.flags|=8192),ye=k.callbacks,ye===null?k.callbacks=[me]:ye.push(me))}else ye={lane:me,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},Ce===null?(he=Ce=ye,ie=Le):Ce=Ce.next=ye,B|=me;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);Ce===null&&(ie=Le),k.baseState=ie,k.firstBaseUpdate=he,k.lastBaseUpdate=Ce,O===null&&(k.shared.lanes=0),Ui|=B,r.lanes=B,r.memoizedState=Le}}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=D(null),Vd=D(0);function u1(r,i){r=mi,W(Vd,r),W(al,i),mi=r|i.baseLanes}function Sm(){W(Vd,mi),W(al,al.current)}function Cm(){mi=Vd.current,N(al),N(Vd)}var Ar=D(null),Yr=null;function zi(r){var i=r.alternate;W(cn,cn.current&1),W(Ar,r),Yr===null&&(i===null||al.current!==null||i.memoizedState!==null)&&(Yr=r)}function wm(r){W(cn,cn.current),W(Ar,r),Yr===null&&(Yr=r)}function d1(r){r.tag===22?(W(cn,cn.current),W(Ar,r),Yr===null&&(Yr=r)):Hi()}function Hi(){W(cn,cn.current),W(Ar,Ar.current)}function Or(r){N(Ar),Yr===r&&(Yr=null),N(cn)}var cn=D(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||Ag(c)||Og(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,Q5=0;function an(){throw Error(s(321))}function Em(r,i){if(i===null)return!1;for(var c=0;c<i.length&&c<r.length;c++)if(!Tr(r[c],i[c]))return!1;return!0}function km(r,i,c,m,k,O){return ai=O,gt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,V.H=r===null||r.memoizedState===null?K1:Vm,Fo=!1,O=c(m,k),Fo=!1,ll&&(O=h1(i,c,m,k)),f1(r),O}function f1(r){V.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)}V.H=Y1,O=i(c,m)}while(ll);return O}function Z5(){var r=V.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 Rm(){var r=Wd!==0;return Wd=0,r}function Tm(r,i,c){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~c}function Lm(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,V.H=i===null||i.memoizedState===null?K1:Vm),r}function Gd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return qc(r);if(r.$$typeof===x)return Vn(r)}throw Error(s(438,String(r)))}function Am(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]=z;return i.index++,c}function li(r,i){return typeof i=="function"?i(r):i}function $d(r){var i=un();return Om(i,Vt,r)}function Om(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 B=k.next;k.next=O.next,O.next=B}i.baseQueue=k=O,m.pending=null}if(O=r.baseState,k===null)r.memoizedState=O;else{i=k.next;var Q=B=null,ie=null,he=i,Ce=!1;do{var Le=he.lane&-536870913;if(Le!==he.lane?(Tt&Le)===Le:(ai&Le)===Le){var me=he.revertLane;if(me===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),Le===rl&&(Ce=!0);else if((ai&me)===me){he=he.next,me===rl&&(Ce=!0);continue}else Le={lane:0,revertLane:he.revertLane,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},ie===null?(Q=ie=Le,B=O):ie=ie.next=Le,gt.lanes|=me,Ui|=me;Le=he.action,Fo&&c(O,Le),O=he.hasEagerState?he.eagerState:c(O,Le)}else me={lane:Le,revertLane:he.revertLane,gesture:he.gesture,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},ie===null?(Q=ie=me,B=O):ie=ie.next=me,gt.lanes|=Le,Ui|=Le;he=he.next}while(he!==null&&he!==i);if(ie===null?B=O:ie.next=Q,!Tr(O,r.memoizedState)&&(bn=!0,Ce&&(c=sl,c!==null)))throw c;r.memoizedState=O,r.baseState=B,r.baseQueue=ie,m.lastRenderedState=O}return k===null&&(m.lanes=0),[r.memoizedState,m.dispatch]}function Mm(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 B=k=k.next;do O=r(O,B.action),B=B.next;while(B!==k);Tr(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 B=!Tr((Vt||k).memoizedState,c);if(B&&(k.memoizedState=c,bn=!0),k=k.queue,jm(v1.bind(null,m,k,r),[r]),k.getSnapshot!==i||B||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!Tr(r,c)}catch{return!0}}function y1(r){var i=Do(r,2);i!==null&&mr(i,r,2)}function Dm(r){var i=rr();if(typeof r=="function"){var c=r;if(r=c(),Fo){nt(!0);try{c()}finally{nt(!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,Om(r,Vt,typeof m=="function"?m:li)}function J5(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(B){O.listeners.push(B)}};V.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=V.T,B={};V.T=B;try{var Q=c(k,m),ie=V.S;ie!==null&&ie(B,Q),S1(r,i,Q)}catch(he){Pm(r,i,he)}finally{O!==null&&B.types!==null&&(O.types=B.types),V.T=O}}else try{O=c(k,m),S1(r,i,O)}catch(he){Pm(r,i,he)}}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 Pm(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 Pm(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=Dm(!1),O=Hm.bind(null,gt,!1,m.queue),m=rr(),k={state:i,dispatch:null,action:r,pending:null},m.queue=k,c=J5.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=Om(r,i,E1)[0],r=$d(li)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=qc(i)}catch(B){throw B===il?Nd:B}else m=i;i=un();var k=i.queue,O=k.dispatch;return c!==i.memoizedState&&(gt.flags|=2048,ul(9,{destroy:void 0},eL.bind(null,k,c),null)),[m,O,r]}function eL(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&&Em(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 tL(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 tL({ref:i,nextImpl:r}),function(){if((jt&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 j1(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 I1(r,i,c){c=c!=null?c.concat([r]):null,Yd(4,4,j1.bind(null,i,r),c)}function Im(){}function N1(r,i){var c=un();i=i===void 0?null:i;var m=c.memoizedState;return i!==null&&Em(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&&Em(i,m[1]))return m[0];if(m=r(),Fo){nt(!0);try{r()}finally{nt(!1)}}return c.memoizedState=[m,i],m}function Nm(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 Tr(c,i)?c:al.current!==null?(r=Nm(r,c,m),Tr(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=$.p;$.p=O!==0&&8>O?O:8;var B=V.T,Q={};V.T=Q,Hm(r,!1,i,c);try{var ie=k(),he=V.S;if(he!==null&&he(Q,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Ce=X5(ie,m);Gc(r,i,Ce,Pr(r))}else Gc(r,i,m,Pr(r))}catch(Le){Gc(r,i,{then:function(){},status:"rejected",reason:Le},Pr())}finally{$.p=O,B!==null&&Q.types!==null&&(B.types=Q.types),V.T=B}}function nL(){}function Bm(r,i,c,m){if(r.tag!==5)throw Error(s(476));var k=V1(r).queue;H1(r,k,i,G,c===null?nL:function(){return F1(r),c(m)})}function V1(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:G},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,{},Pr())}function zm(){return Vn(cu)}function U1(){return un().memoizedState}function W1(){return un().memoizedState}function rL(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var c=Pr();r=Ni(c);var m=Bi(i,r,c);m!==null&&(mr(m,i,c),Vc(m,i,c)),i={cache:pm()},r.payload=i;return}i=i.return}}function sL(r,i,c){var m=Pr();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Xd(r)?G1(i,c):(c=rm(r,i,c,m),c!==null&&(mr(c,r,m),$1(c,i,m)))}function q1(r,i,c){var m=Pr();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 B=i.lastRenderedState,Q=O(B,c);if(k.hasEagerState=!0,k.eagerState=Q,Tr(Q,B))return Ad(r,i,k,0),qt===null&&Ld(),!1}catch{}if(c=rm(r,i,k,m),c!==null)return mr(c,r,m),$1(c,i,m),!0}return!1}function Hm(r,i,c,m){if(m={lane:2,revertLane:_g(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Xd(r)){if(i)throw Error(s(479))}else i=rm(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,j1.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){nt(!0);try{r()}finally{nt(!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){nt(!0);try{c(i)}finally{nt(!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=sL.bind(null,gt,r),[m.memoizedState,r]},useRef:function(r){var i=rr();return r={current:r},i.memoizedState=r},useState:function(r){r=Dm(r);var i=r.queue,c=q1.bind(null,gt,i);return i.dispatch=c,[r.memoizedState,c]},useDebugValue:Im,useDeferredValue:function(r,i){var c=rr();return Nm(c,r,i)},useTransition:function(){var r=Dm(!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=Q5++,i="_"+i+"r_"+c.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:zm,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=Hm.bind(null,gt,!0,c),c.dispatch=i,[r,i]},useMemoCache:Am,useCacheRefresh:function(){return rr().memoizedState=rL.bind(null,gt)},useEffectEvent:function(r){var i=rr(),c={impl:r};return i.memoizedState=c,function(){if((jt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Vm={readContext:Vn,use:Gd,useCallback:N1,useContext:Vn,useEffect:jm,useImperativeHandle:I1,useInsertionEffect:D1,useLayoutEffect:P1,useMemo:B1,useReducer:$d,useRef:A1,useState:function(){return $d(li)},useDebugValue:Im,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:zm,useFormState:R1,useActionState:R1,useOptimistic:function(r,i){var c=un();return b1(c,Vt,r,i)},useMemoCache:Am,useCacheRefresh:W1};Vm.useEffectEvent=M1;var Y1={readContext:Vn,use:Gd,useCallback:N1,useContext:Vn,useEffect:jm,useImperativeHandle:I1,useInsertionEffect:D1,useLayoutEffect:P1,useMemo:B1,useReducer:Mm,useRef:A1,useState:function(){return Mm(li)},useDebugValue:Im,useDeferredValue:function(r,i){var c=un();return Vt===null?Nm(c,r,i):z1(c,Vt.memoizedState,r,i)},useTransition:function(){var r=Mm(li)[0],i=un().memoizedState;return[typeof r=="boolean"?r:qc(r),i]},useSyncExternalStore:p1,useId:U1,useHostTransitionStatus:zm,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:Am,useCacheRefresh:W1};Y1.useEffectEvent=M1;function Fm(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 Um={enqueueSetState:function(r,i,c){r=r._reactInternals;var m=Pr(),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=Pr(),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=Pr(),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,B){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,O,B):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&&Um.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 Wm(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 B=c.stateNode;B!==null&&typeof B.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 iL(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=Ar.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),mg(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)),mg(r,m,k)),!1}throw Error(s(435,c.tag))}return mg(r,m,k),uf(),!1}if(At)return i=Ar.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=k,m!==cm&&(r=Error(s(422),{cause:m}),Ic(qr(r,c)))):(m!==cm&&(i=Error(s(423),{cause:m}),Ic(qr(i,c))),r=r.current.alternate,r.flags|=65536,k&=-k,r.lanes|=k,m=qr(m,c),k=Wm(r.stateNode,m,k),bm(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=Wm(c.stateNode,m,r),bm(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),bm(c,k),!1}c=c.return}while(c!==null);return!1}var qm=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 B={};for(var Q in m)Q!=="ref"&&(B[Q]=m[Q])}else B=m;return No(i),m=km(r,i,c,B,O,k),Q=Rm(),r!==null&&!bn?(Tm(r,i,k),ci(r,i,k)):(At&&Q&&am(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"&&!sm(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,!Jm(r,k)){var B=O.memoizedProps;if(c=c.compare,c=c!==null?c:Dc,c(B,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,Jm(r,k))(r.flags&131072)!==0&&(bn=!0);else return i.lanes=r.lanes,ci(r,i,k)}return Gm(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&&Id(i,O!==null?O.cachePool:null),O!==null?u1(i,O):Sm(),d1(i);else return m=i.lanes=536870912,lb(r,i,O!==null?O.baseLanes|c:c,c,m)}else O!==null?(Id(i,O.cachePool),u1(i,O),Hi(),i.memoizedState=null):(r!==null&&Id(i,null),Sm(),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=gm();return O=O===null?null:{parent:_n._currentValue,pool:O},i.memoizedState={baseLanes:c,cachePool:O},r!==null&&Id(i,null),Sm(),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,Or(i),i.memoizedState=null,r}function oL(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(wm(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 B=O.dehydrated;if(wm(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&&(B=Rn(m,c),B!==0&&B!==O.retryLane))throw O.retryLane=B,Do(r,B),mr(m,r,B),qm;uf(),i=cb(r,i,c)}else r=O.treeContext,Yt=Xr(B.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 Gm(r,i,c,m,k){return No(i),c=km(r,i,c,m,void 0,k),m=Rm(),r!==null&&!bn?(Tm(r,i,k),ci(r,i,k)):(At&&m&&am(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=Rm(),r!==null&&!bn?(Tm(r,i,O),ci(r,i,O)):(At&&m&&am(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,B=c.contextType;typeof B=="object"&&B!==null&&(O=Vn(B)),O=new c(m,O),i.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=Um,i.stateNode=O,O._reactInternals=i,O=i.stateNode,O.props=m,O.state=i.memoizedState,O.refs={},_m(i),B=c.contextType,O.context=typeof B=="object"&&B!==null?Vn(B):Za,O.state=i.memoizedState,B=c.getDerivedStateFromProps,typeof B=="function"&&(Fm(i,c,B,m),O.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(B=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),B!==O.state&&Um.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 he=O.context,Ce=c.contextType;B=Za,typeof Ce=="object"&&Ce!==null&&(B=Vn(Ce));var Le=c.getDerivedStateFromProps;Ce=typeof Le=="function"||typeof O.getSnapshotBeforeUpdate=="function",Q=i.pendingProps!==Q,Ce||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Q||he!==B)&&Q1(i,O,m,B),Ii=!1;var me=i.memoizedState;O.state=me,Uc(i,m,O,k),Fc(),he=i.memoizedState,Q||me!==he||Ii?(typeof Le=="function"&&(Fm(i,c,Le,m),he=i.memoizedState),(ie=Ii||X1(i,c,ie,m,me,he,B))?(Ce||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=he),O.props=m,O.state=he,O.context=B,m=ie):(typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{O=i.stateNode,ym(r,i),B=i.memoizedProps,Ce=Uo(c,B),O.props=Ce,Le=i.pendingProps,me=O.context,he=c.contextType,ie=Za,typeof he=="object"&&he!==null&&(ie=Vn(he)),Q=c.getDerivedStateFromProps,(he=typeof Q=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(B!==Le||me!==ie)&&Q1(i,O,m,ie),Ii=!1,me=i.memoizedState,O.state=me,Uc(i,m,O,k),Fc();var ye=i.memoizedState;B!==Le||me!==ye||Ii||r!==null&&r.dependencies!==null&&Pd(r.dependencies)?(typeof Q=="function"&&(Fm(i,c,Q,m),ye=i.memoizedState),(Ce=Ii||X1(i,c,Ce,m,me,ye,ie)||r!==null&&r.dependencies!==null&&Pd(r.dependencies))?(he||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"||B===r.memoizedProps&&me===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||B===r.memoizedProps&&me===r.memoizedState||(i.flags|=1024),i.memoizedProps=m,i.memoizedState=ye),O.props=m,O.state=ye,O.context=ie,m=Ce):(typeof O.componentDidUpdate!="function"||B===r.memoizedProps&&me===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||B===r.memoizedProps&&me===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 jo(),i.flags|=256,Fn(r,i,c,m),i.child}var $m={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Km(r){return{baseLanes:r,cachePool:t1()}}function Ym(r,i,c){return r=r!==null?r.childLanes&~c:0,i&&(r|=Dr),r}function hb(r,i,c){var m=i.pendingProps,k=!1,O=(i.flags&128)!==0,B;if((B=O)||(B=r!==null&&r.memoizedState===null?!1:(cn.current&2)!==0),B&&(k=!0,i.flags&=-129),B=(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 Og(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=Km(c),m.childLanes=Ym(r,B,c),i.memoizedState=$m,Kc(null,m)):(zi(i),Xm(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=Qm(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=Km(c),m.childLanes=Ym(r,B,c),i.memoizedState=$m,i=Kc(null,m));else if(zi(i),Og(Q)){if(B=Q.nextSibling&&Q.nextSibling.dataset,B)var he=B.dgst;B=he,m=Error(s(419)),m.stack="",m.digest=B,Ic({value:m,source:null,stack:null}),i=Qm(r,i,c)}else if(bn||nl(r,i,c,!1),B=(c&r.childLanes)!==0,bn||B){if(B=qt,B!==null&&(m=Rn(B,c),m!==0&&m!==ie.retryLane))throw ie.retryLane=m,Do(r,m),mr(B,r,m),qm;Ag(Q)||uf(),i=Qm(r,i,c)}else Ag(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=Xm(i,m.children),i.flags|=4096);return i}return k?(Hi(),Q=m.fallback,k=i.mode,ie=r.child,he=ie.sibling,m=ri(ie,{mode:"hidden",children:m.children}),m.subtreeFlags=ie.subtreeFlags&65011712,he!==null?Q=ri(he,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=Km(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=Ym(r,B,c),i.memoizedState=$m,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&&(B=i.deletions,B===null?(i.deletions=[r],i.flags|=16):B.push(r)),i.child=c,i.memoizedState=null,c)}function Xm(r,i){return i=ef({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function ef(r,i){return r=Lr(22,r,null,i),r.lanes=0,r}function Qm(r,i,c){return Vo(i,r.child,null,c),r=Xm(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),fm(r.return,i,c)}function Zm(r,i,c,m,k,O){var B=r.memoizedState;B===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:k,treeForkCount:O}:(B.isBackwards=i,B.rendering=null,B.renderingStartTime=0,B.last=m,B.tail=c,B.tailMode=k,B.treeForkCount=O)}function mb(r,i,c){var m=i.pendingProps,k=m.revealOrder,O=m.tail;m=m.children;var B=cn.current,Q=(B&2)!==0;if(Q?(B=B&1|2,i.flags|=128):B&=1,W(cn,B),Fn(r,i,m,c),m=At?jc: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),Zm(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}Zm(i,!0,c,null,O,m);break;case"together":Zm(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 Jm(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Pd(r)))}function aL(r,i,c){switch(i.tag){case 3:F(i,i.stateNode.containerInfo),ji(i,_n,r.memoizedState.cache),jo();break;case 27:case 5:ne(i);break;case 4:F(i,i.stateNode.containerInfo);break;case 10:ji(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,wm(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),W(cn,cn.current),m)break;return null;case 22:return i.lanes=0,ab(r,i,c,i.pendingProps);case 24:ji(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(!Jm(r,c)&&(i.flags&128)===0)return bn=!1,aL(r,i,c);bn=(r.flags&131072)!==0}else bn=!1,At&&(i.flags&1048576)!==0&&Ky(i,jc,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")sm(r)?(m=Uo(r,m),i.tag=1,i=db(null,i,r,m,c)):(i.tag=0,i=Gm(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 Gm(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(F(i,i.stateNode.containerInfo),r===null)throw Error(s(387));m=i.pendingProps;var O=i.memoizedState;k=O.element,ym(r,i),Uc(i,m,null,c);var B=i.memoizedState;if(m=B.cache,ji(i,_n,m),m!==O.cache&&hm(i,[_n],c,!0),Fc(),m=B.element,O.isDehydrated)if(O={element:m,isDehydrated:!1,cache:B.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),Ic(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(jo(),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(te.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,te.current),Hn=i,Kr=!0,k=Yt,Ki(i.type)?(Mg=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=NL(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,B=r!==null?r.memoizedProps:null,m=O.children,Rg(k,O)?m=null:B!==null&&Rg(k,B)&&(i.flags|=32),i.memoizedState!==null&&(k=km(r,i,Z5,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=BL(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 F(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,ji(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 oL(r,i,c);case 22:return ab(r,i,c,i.pendingProps);case 24:return No(i),m=Vn(_n),r===null?(k=gm(),k===null&&(k=qt,O=pm(),k.pooledCache=O,O.refCount++,O!==null&&(k.pooledCacheLanes|=c),k=O),i.memoizedState={parent:m,cache:k},_m(i),ji(i,_n,k)):((r.lanes&c)!==0&&(ym(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),ji(i,_n,m)):(m=O.cache,ji(i,_n,m),m!==k.cache&&hm(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 eg(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,vm}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,vm}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 lL(r,i,c){var m=i.pendingProps;switch(lm(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,um())),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),eg(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),eg(i,k,r,m,c)),null;case 27:if(re(i),c=te.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=Z.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=Z.current,tl(i))Xy(i);else{var B=vf(te.current);switch(O){case 1:O=B.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:O=B.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":O=B.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":O=B.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":O=B.createElement("div"),O.innerHTML="<script><\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof m.is=="string"?B.createElement("select",{is:m.is}):B.createElement("select"),m.multiple?O.multiple=!0:m.size&&(O.size=m.size);break;default:O=typeof m.is=="string"?B.createElement(k,{is:m.is}):B.createElement(k)}}O[pn]=i,O[mn]=m;e:for(B=i.child;B!==null;){if(B.tag===5||B.tag===6)O.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===i)break e;for(;B.sibling===null;){if(B.return===null||B.return===i)break e;B=B.return}B.sibling.return=B.return,B=B.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),eg(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=te.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 jo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),r=!1}else c=um(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return i.flags&256?(Or(i),i):(Or(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 jo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),k=!1}else k=um(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=k),k=!0;if(!k)return i.flags&256?(Or(i),i):(Or(i),null)}return Or(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&&Sg(i.stateNode.containerInfo),Xt(i),null;case 10:return oi(i.type),Xt(i),null;case 19:if(N(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 W(cn,cn.current&1|2),At&&si(i,m.treeForkCount),i.child}r=r.sibling}m.tail!==null&&Re()>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*Re()-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=Re(),r.sibling=null,c=cn.current,W(cn,k?c&1|2:c&1),At&&si(i,m.treeForkCount),r):(Xt(i),null);case 22:case 23:return Or(i),Cm(),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&&N(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 cL(r,i){switch(lm(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(Or(i),i.alternate===null)throw Error(s(340));jo()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Or(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(s(340));jo()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return N(cn),null;case 4:return se(),null;case 10:return oi(i.type),null;case 22:case 23:return Or(i),Cm(),r!==null&&N(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(lm(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&&Or(i);break;case 13:Or(i);break;case 19:N(cn);break;case 10:oi(i.type);break;case 22:case 23:Or(i),Cm(),r!==null&&N(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,B=c.inst;m=O(),B.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 B=m.inst,Q=B.destroy;if(Q!==void 0){B.destroy=void 0,k=i;var ie=c,he=Q;try{he()}catch(Ce){zt(k,ie,Ce)}}}m=m.next}while(m!==O)}}catch(Ce){zt(i,i.return,Ce)}}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 tg(r,i,c){try{var m=r.stateNode;OL(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 ng(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 rg(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(rg(r,i,c),r=r.sibling;r!==null;)rg(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,sg=!1,wb=typeof WeakSet=="function"?WeakSet:Set,Nn=null;function uL(r,i){if(r=r.containerInfo,Eg=wf,r=Iy(r),Qp(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 B=0,Q=-1,ie=-1,he=0,Ce=0,Le=r,me=null;t:for(;;){for(var ye;Le!==c||k!==0&&Le.nodeType!==3||(Q=B+k),Le!==O||m!==0&&Le.nodeType!==3||(ie=B+m),Le.nodeType===3&&(B+=Le.nodeValue.length),(ye=Le.firstChild)!==null;)me=Le,Le=ye;for(;;){if(Le===r)break t;if(me===c&&++he===k&&(Q=B),me===O&&++Ce===m&&(ie=B),(ye=Le.nextSibling)!==null)break;Le=me,me=Le.parentNode}Le=ye}c=Q===-1||ie===-1?null:{start:Q,end:ie}}else c=null}c=c||{start:0,end:0}}else c=null;for(kg={focusedElem:r,selectionRange:c},wf=!1,Nn=i;Nn!==null;)if(i=Nn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Nn=r;else for(;Nn!==null;){switch(i=Nn,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)Lg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Lg(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,Nn=r;break}Nn=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(B){zt(c,c.return,B)}else{var k=Uo(c.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(k,i,r.__reactInternalSnapshotBeforeUpdate)}catch(B){zt(c,c.return,B)}}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(B){zt(c,c.return,B)}}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=yL.bind(null,c),zL(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(ke&&typeof ke.onCommitFiberUnmount=="function")try{ke.onCommitFiberUnmount(He,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 dL(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=dL(r);i.forEach(function(m){if(!c.has(m)){c.add(m);var k=bL.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,B=i,Q=B;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,B,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 B=Ax("link","href",k).get(m+(c.href||""));if(B){for(var Q=0;Q<B.length;Q++)if(O=B[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)){B.splice(Q,1);break t}}O=k.createElement(m),Un(O,m,c),k.head.appendChild(O);break;case"meta":if(B=Ax("meta","content",k).get(m+(c.content||""))){for(Q=0;Q<B.length;Q++)if(O=B[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)){B.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&&tg(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&&tg(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{rt(k,"")}catch($e){zt(r,r.return,$e)}}m&4&&r.stateNode!=null&&(k=r.memoizedProps,tg(r,k,c!==null?c.memoizedProps:k)),m&1024&&(sg=!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)}sg&&(sg=!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=Re()),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,he=di,Ce=xn;if(di=he||k,xn=Ce||ie,fr(i,r),xn=Ce,di=he,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)B=O.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{Q=ie.stateNode;var Le=ie.memoizedProps.style,me=Le!=null&&Le.hasOwnProperty("display")?Le.display:null;Q.style.display=me==null||typeof me=="boolean"?"":(""+me).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=ng(r);nf(r,O,k);break;case 5:var B=c.stateNode;c.flags&32&&(rt(B,""),c.flags&=-33);var Q=ng(r);nf(r,Q,B);break;case 3:case 4:var ie=c.stateNode.containerInfo,he=ng(r);rg(r,he,ie);break;default:throw Error(s(161))}}catch(Ce){zt(r,r.return,Ce)}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,B=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(he){zt(m,m.return,he)}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(he){zt(m,m.return,he)}}c&&B&64&&yb(O),Qc(O,O.return);break;case 27:Cb(O);case 26:case 5:pi(k,O,c),c&&m===null&&B&4&&xb(O),Qc(O,O.return);break;case 12:pi(k,O,c);break;case 31:pi(k,O,c),c&&B&4&&Tb(k,O);break;case 13:pi(k,O,c),c&&B&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 ig(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 og(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,B=O.id,Q=O.onPostCommit;typeof Q=="function"&&Q(B,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,B=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&&ig(B,i);break;case 24:gs(r,i,c,m),k&2048&&og(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,B=i,Q=c,ie=m,he=B.flags;switch(B.tag){case 0:case 11:case 15:dl(O,B,Q,ie,k),Xc(8,B);break;case 23:break;case 22:var Ce=B.stateNode;B.memoizedState!==null?Ce._visibility&2?dl(O,B,Q,ie,k):Zc(O,B):(Ce._visibility|=2,dl(O,B,Q,ie,k)),k&&he&2048&&ig(B.alternate,B);break;case 24:dl(O,B,Q,ie,k),k&&he&2048&&og(B.alternate,B);break;default:dl(O,B,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&&ig(m.alternate,m);break;case 24:Zc(c,m),k&2048&&og(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&&QL(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];Nn=m,Ib(m,r)}Pb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)jb(r),r=r.sibling}function jb(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];Nn=m,Ib(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 Ib(r,i){for(;Nn!==null;){var c=Nn;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,Nn=m;else e:for(c=r;Nn!==null;){m=Nn;var k=m.sibling,O=m.return;if(kb(m),m===c){Nn=null;break e}if(k!==null){k.return=O,Nn=k;break e}Nn=O}}}var fL={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}},hL=typeof WeakMap=="function"?WeakMap:Map,jt=0,qt=null,Et=null,Tt=0,Bt=0,Mr=null,Fi=!1,hl=!1,ag=!1,mi=0,ln=0,Ui=0,qo=0,lg=0,Dr=0,pl=0,tu=null,pr=null,cg=!1,of=0,Nb=0,af=1/0,lf=null,Wi=null,Tn=0,qi=null,ml=null,gi=0,ug=0,dg=null,Bb=null,nu=0,fg=null;function Pr(){return(jt&2)!==0&&Tt!==0?Tt&-Tt:V.T!==null?_g():Es()}function zb(){if(Dr===0)if((Tt&536870912)===0||At){var r=nn;nn<<=1,(nn&3932160)===0&&(nn=262144),Dr=r}else Dr=536870912;return r=Ar.current,r!==null&&(r.flags|=32),Dr}function mr(r,i,c){(r===qt&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)&&(gl(r,0),Gi(r,Tt,Dr,!1)),bt(r,c),((jt&2)===0||r!==qt)&&(r===qt&&((jt&2)===0&&(qo|=c),ln===4&&Gi(r,Tt,Dr,!1)),Os(r))}function Hb(r,i,c){if((jt&6)!==0)throw Error(s(327));var m=!c&&(i&127)===0&&(i&r.expiredLanes)===0||Ot(r,i),k=m?gL(r,i):pg(r,i,!0),O=m;do{if(k===0){hl&&!m&&Gi(r,i,0,!1);break}else{if(c=r.current.alternate,O&&!pL(c)){k=pg(r,i,!1),O=!1;continue}if(k===2){if(O=i,r.errorRecoveryDisabledLanes&O)var B=0;else B=r.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){i=B;e:{var Q=r;k=tu;var ie=Q.current.memoizedState.isDehydrated;if(ie&&(gl(Q,B).flags|=256),B=pg(Q,B,!1),B!==2){if(ag&&!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=B}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,Dr,!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-Re(),10<k)){if(Gi(m,i,Dr,!Fi),Je(m,0,!0)!==0)break e;gi=i,m.timeoutHandle=vx(Vb.bind(null,m,c,pr,lf,cg,i,Dr,qo,pl,Fi,O,"Throttled",-0,0),k);break e}Vb(m,c,pr,lf,cg,i,Dr,qo,pl,Fi,O,null,-0,0)}}break}while(!0);Os(r)}function Vb(r,i,c,m,k,O,B,Q,ie,he,Ce,Le,me,ye){if(r.timeoutHandle=-1,Le=i.subtreeFlags,Le&8192||(Le&16785408)===16785408){Le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hs},Db(i,O,Le);var $e=(O&62914560)===O?of-Re():(O&4194048)===O?Nb-Re():0;if($e=ZL(Le,$e),$e!==null){gi=O,r.cancelPendingCommit=$e(Yb.bind(null,r,i,O,c,m,k,B,Q,ie,Ce,Le,null,me,ye)),Gi(r,O,B,!he);return}}Yb(r,i,O,c,m,k,B,Q,ie)}function pL(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(!Tr(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&=~lg,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),B=1<<O;m[O]=-1,k&=~B}c!==0&&Qe(r,c,i)}function cf(){return(jt&6)===0?(ru(0),!1):!0}function hg(){if(Et!==null){if(Bt===0)var r=Et.return;else r=Et,ii=Io=null,Lm(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,PL(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),gi=0,hg(),qt=r,Et=c=ri(r.current,null),Tt=i,Bt=0,Mr=null,Fi=!1,hl=Ot(r,i),ag=!1,pl=Dr=lg=qo=Ui=ln=0,pr=tu=null,cg=!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,V.H=$c,i===il||i===Nd?(i=s1(),Bt=3):i===vm?(i=s1(),Bt=4):Bt=i===qm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Mr=i,Et===null&&(ln=1,Qd(r,qr(i,r.current)))}function Ub(){var r=Ar.current;return r===null?!0:(Tt&4194048)===Tt?Yr===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?r===Yr:!1}function Wb(){var r=V.H;return V.H=$c,r===null?$c:r}function qb(){var r=V.A;return V.A=fL,r}function uf(){ln=4,Fi||(Tt&4194048)!==Tt&&Ar.current!==null||(hl=!0),(Ui&134217727)===0&&(qo&134217727)===0||qt===null||Gi(qt,Tt,Dr,!1)}function pg(r,i,c){var m=jt;jt|=2;var k=Wb(),O=qb();(qt!==r||Tt!==i)&&(lf=null,gl(r,i)),i=!1;var B=ln;e:do try{if(Bt!==0&&Et!==null){var Q=Et,ie=Mr;switch(Bt){case 8:hg(),B=6;break e;case 3:case 2:case 9:case 6:Ar.current===null&&(i=!0);var he=Bt;if(Bt=0,Mr=null,vl(r,Q,ie,he),c&&hl){B=0;break e}break;default:he=Bt,Bt=0,Mr=null,vl(r,Q,ie,he)}}mL(),B=ln;break}catch(Ce){Fb(r,Ce)}while(!0);return i&&r.shellSuspendCounter++,ii=Io=null,jt=m,V.H=k,V.A=O,Et===null&&(qt=null,Tt=0,Ld()),B}function mL(){for(;Et!==null;)Gb(Et)}function gL(r,i){var c=jt;jt|=2;var m=Wb(),k=qb();qt!==r||Tt!==i?(lf=null,af=Re()+500,gl(r,i)):hl=Ot(r,i);e:do try{if(Bt!==0&&Et!==null){i=Et;var O=Mr;t:switch(Bt){case 1:Bt=0,Mr=null,vl(r,i,O,1);break;case 2:case 9:if(n1(O)){Bt=0,Mr=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,Mr=null,$b(i)):(Bt=0,Mr=null,vl(r,i,O,7));break;case 5:var B=null;switch(Et.tag){case 26:B=Et.memoizedState;case 5:case 27:var Q=Et;if(B?Mx(B):Q.stateNode.complete){Bt=0,Mr=null;var ie=Q.sibling;if(ie!==null)Et=ie;else{var he=Q.return;he!==null?(Et=he,df(he)):Et=null}break t}}Bt=0,Mr=null,vl(r,i,O,5);break;case 6:Bt=0,Mr=null,vl(r,i,O,6);break;case 8:hg(),ln=6;break e;default:throw Error(s(462))}}vL();break}catch(Ce){Fb(r,Ce)}while(!0);return ii=Io=null,V.H=m,V.A=k,jt=c,Et!==null?0:(qt=null,Tt=0,Ld(),ln)}function vL(){for(;Et!==null&&!Me();)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:Lm(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=Io=null,Lm(i),ol=null,zc=0;var k=i.return;try{if(iL(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=Ar.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=lL(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=cL(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,B,Q,ie){r.cancelPendingCommit=null;do ff();while(Tn!==0);if((jt&6)!==0)throw Error(s(327));if(i!==null){if(i===r.current)throw Error(s(177));if(O=i.lanes|i.childLanes,O|=nm,xt(r,c,O,B,Q,ie),r===qt&&(Et=qt=null,Tt=0),ml=i,qi=r,gi=c,ug=O,dg=k,Bb=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,xL(xe,function(){return ex(),null})):(r.callbackNode=null,r.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=V.T,V.T=null,k=$.p,$.p=2,B=jt,jt|=4;try{uL(r,i,c)}finally{jt=B,$.p=k,V.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=V.T,V.T=null;var m=$.p;$.p=2;var k=jt;jt|=4;try{Ab(i,r);var O=kg,B=Iy(r.containerInfo),Q=O.focusedElem,ie=O.selectionRange;if(B!==Q&&Q&&Q.ownerDocument&&jy(Q.ownerDocument.documentElement,Q)){if(ie!==null&&Qp(Q)){var he=ie.start,Ce=ie.end;if(Ce===void 0&&(Ce=he),"selectionStart"in Q)Q.selectionStart=he,Q.selectionEnd=Math.min(Ce,Q.value.length);else{var Le=Q.ownerDocument||document,me=Le&&Le.defaultView||window;if(me.getSelection){var ye=me.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&&(B=Ut,Ut=ut,ut=B);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=Le.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(Le=[],ye=Q;ye=ye.parentNode;)ye.nodeType===1&&Le.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof Q.focus=="function"&&Q.focus(),Q=0;Q<Le.length;Q++){var Te=Le[Q];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}wf=!!Eg,kg=Eg=null}finally{jt=k,$.p=m,V.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=V.T,V.T=null;var m=$.p;$.p=2;var k=jt;jt|=4;try{Eb(r,i.alternate,i)}finally{jt=k,$.p=m,V.T=c}}Tn=3}}function Zb(){if(Tn===4||Tn===3){Tn=0,pe();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,ke&&typeof ke.onCommitFiberRoot=="function")try{ke.onCommitFiberRoot(He,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=V.T,k=$.p,$.p=2,V.T=null;try{for(var O=r.onRecoverableError,B=0;B<m.length;B++){var Q=m[B];O(Q.value,{componentStack:Q.stack})}}finally{V.T=i,$.p=k}}(gi&3)!==0&&ff(),Os(r),k=r.pendingLanes,(c&261930)!==0&&(k&42)!==0?r===fg?nu++:(nu=0,fg=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=ug;ug=0;var c=zn(gi),m=V.T,k=$.p;try{$.p=32>c?32:c,V.T=null,c=dg,dg=null;var O=qi,B=gi;if(Tn=0,ml=qi=null,gi=0,(jt&6)!==0)throw Error(s(331));var Q=jt;if(jt|=4,jb(O.current),Mb(O,O.current,B,c),jt=Q,ru(0,!1),ke&&typeof ke.onPostCommitFiberRoot=="function")try{ke.onPostCommitFiberRoot(He,O)}catch{}return!0}finally{$.p=k,V.T=m,Jb(r,i)}}function tx(r,i,c){i=qr(c,i),i=Wm(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 mg(r,i,c){var m=r.pingCache;if(m===null){m=r.pingCache=new hL;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)||(ag=!0,k.add(c),r=_L.bind(null,r,i,c),i.then(r,r))}function _L(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>Re()-of?(jt&2)===0&&gl(r,0):lg|=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 yL(r){var i=r.memoizedState,c=0;i!==null&&(c=i.retryLane),nx(r,c)}function bL(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 xL(r,i){return Oe(r,i)}var hf=null,_l=null,gg=!1,pf=!1,vg=!1,$i=0;function Os(r){r!==_l&&r.next===null&&(_l===null?hf=_l=r:_l=_l.next=r),pf=!0,gg||(gg=!0,CL())}function ru(r,i){if(!vg&&pf){vg=!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 B=m.suspendedLanes,Q=m.pingedLanes;O=(1<<31-lt(42|r)+1)-1,O&=k&~(B&~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);vg=!1}}function SL(){rx()}function rx(){pf=gg=!1;var r=0;$i!==0&&DL()&&(r=$i);for(var i=Re(),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 B=31-lt(O),Q=1<<B,ie=k[B];ie===-1?((Q&c)===0||(Q&m)!==0)&&(k[B]=It(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=et;break;case 32:c=xe;break;case 268435456:c=tt;break;default:c=xe}return m=ix.bind(null,r),c=Oe(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,Re()),r.callbackNode!=null&&r.callbackNode===c?ix.bind(null,r):null)}function ox(r,i){if(ff())return null;Hb(r,i,!0)}function CL(){jL(function(){(jt&6)!==0?Oe(We,SL):rx()})}function _g(){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 wL(r,i,c,m,k){if(i==="submit"&&c&&c.stateNode===k){var O=ax((k[mn]||null).action),B=m.submitter;B&&(i=(i=B[mn]||null)?ax(i.formAction):B.getAttribute("formAction"),i!==null&&(O=i,B=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=B?lx(k,B):new FormData(k);Bm(c,{pending:!0,data:ie,method:k.method,action:O},null,ie)}}else typeof O=="function"&&(Q.preventDefault(),ie=B?lx(k,B):new FormData(k),Bm(c,{pending:!0,data:ie,method:k.method,action:O},O,ie))},currentTarget:k}]})}}for(var yg=0;yg<tm.length;yg++){var bg=tm[yg],EL=bg.toLowerCase(),kL=bg[0].toUpperCase()+bg.slice(1);ps(EL,"on"+kL)}ps(zy,"onAnimationEnd"),ps(Hy,"onAnimationIteration"),ps(Vy,"onAnimationStart"),ps("dblclick","onDoubleClick"),ps("focusin","onFocus"),ps("focusout","onBlur"),ps(F5,"onTransitionRun"),ps(U5,"onTransitionStart"),ps(W5,"onTransitionCancel"),ps(Fy,"onTransitionEnd"),fs("onMouseEnter",["mouseout","mouseover"]),fs("onMouseLeave",["mouseout","mouseover"]),fs("onPointerEnter",["pointerout","pointerover"]),fs("onPointerLeave",["pointerout","pointerover"]),kr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),kr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),kr("onBeforeInput",["compositionend","keypress","textInput","paste"]),kr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),kr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),kr("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(" "),RL=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 B=m.length-1;0<=B;B--){var Q=m[B],ie=Q.instance,he=Q.currentTarget;if(Q=Q.listener,ie!==O&&k.isPropagationStopped())break e;O=Q,k.currentTarget=he;try{O(k)}catch(Ce){Td(Ce)}k.currentTarget=null,O=ie}else for(B=0;B<m.length;B++){if(Q=m[B],ie=Q.instance,he=Q.currentTarget,Q=Q.listener,ie!==O&&k.isPropagationStopped())break e;O=Q,k.currentTarget=he;try{O(k)}catch(Ce){Td(Ce)}k.currentTarget=null,O=ie}}}}function kt(r,i){var c=i[Er];c===void 0&&(c=i[Er]=new Set);var m=r+"__bubble";c.has(m)||(ux(i,r,2,!1),c.add(m))}function xg(r,i,c){var m=0;i&&(m|=4),ux(c,r,m,i)}var mf="_reactListening"+Math.random().toString(36).slice(2);function Sg(r){if(!r[mf]){r[mf]=!0,tr.forEach(function(c){c!=="selectionchange"&&(RL.has(c)||xg(c,!1,r),xg(c,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[mf]||(i[mf]=!0,xg("selectionchange",!1,i))}}function ux(r,i,c,m){switch(zx(i)){case 2:var k=tA;break;case 8:k=nA;break;default:k=Ng}c=k.bind(null,i,c,r),k=void 0,!Fp||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 Cg(r,i,c,m,k){var O=m;if((i&1)===0&&(i&2)===0&&m!==null)e:for(;;){if(m===null)return;var B=m.tag;if(B===3||B===4){var Q=m.stateNode.containerInfo;if(Q===k)break;if(B===4)for(B=m.return;B!==null;){var ie=B.tag;if((ie===3||ie===4)&&B.stateNode.containerInfo===k)return;B=B.return}for(;Q!==null;){if(B=Qs(Q),B===null)return;if(ie=B.tag,ie===5||ie===6||ie===26||ie===27){m=O=B;continue e}Q=Q.parentNode}}m=m.return}my(function(){var he=O,Ce=Hp(c),Le=[];e:{var me=Uy.get(r);if(me!==void 0){var ye=Ed,$e=r;switch(r){case"keypress":if(Cd(c)===0)break e;case"keydown":case"keyup":ye=b5;break;case"focusin":$e="focus",ye=Gp;break;case"focusout":$e="blur",ye=Gp;break;case"beforeblur":case"afterblur":ye=Gp;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=l5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=C5;break;case zy:case Hy:case Vy:ye=d5;break;case Fy:ye=E5;break;case"scroll":case"scrollend":ye=o5;break;case"wheel":ye=R5;break;case"copy":case"cut":case"paste":ye=h5;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=L5}var ut=(i&4)!==0,Ut=!ut&&(r==="scroll"||r==="scrollend"),ce=ut?me!==null?me+"Capture":null:me;ut=[];for(var ae=he,fe;ae!==null;){var Te=ae;if(fe=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||fe===null||ce===null||(Te=kc(ae,ce),Te!=null&&ut.push(iu(ae,Te,fe))),Ut)break;ae=ae.return}0<ut.length&&(me=new ye(me,$e,null,c,Ce),Le.push({event:me,listeners:ut}))}}if((i&7)===0){e:{if(me=r==="mouseover"||r==="pointerover",ye=r==="mouseout"||r==="pointerout",me&&c!==xd&&($e=c.relatedTarget||c.fromElement)&&(Qs($e)||$e[ks]))break e;if((ye||me)&&(me=Ce.window===Ce?Ce:(me=Ce.ownerDocument)?me.defaultView||me.parentWindow:window,ye?($e=c.relatedTarget||c.toElement,ye=he,$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=he),ye!==$e)){if(ut=_y,Te="onMouseLeave",ce="onMouseEnter",ae="mouse",(r==="pointerout"||r==="pointerover")&&(ut=by,Te="onPointerLeave",ce="onPointerEnter",ae="pointer"),Ut=ye==null?me:Lo(ye),fe=$e==null?me:Lo($e),me=new ut(Te,ae+"leave",ye,c,Ce),me.target=Ut,me.relatedTarget=fe,Te=null,Qs(Ce)===he&&(ut=new ut(ce,ae+"enter",$e,c,Ce),ut.target=fe,ut.relatedTarget=Ut,Te=ut),Ut=Te,ye&&$e)t:{for(ut=TL,ce=ye,ae=$e,fe=0,Te=ce;Te;Te=ut(Te))fe++;Te=0;for(var it=ae;it;it=ut(it))Te++;for(;0<fe-Te;)ce=ut(ce),fe--;for(;0<Te-fe;)ae=ut(ae),Te--;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(Le,me,ye,ut,!1),$e!==null&&Ut!==null&&dx(Le,Ut,$e,ut,!0)}}e:{if(me=he?Lo(he):window,ye=me.nodeName&&me.nodeName.toLowerCase(),ye==="select"||ye==="input"&&me.type==="file")var Mt=Ty;else if(ky(me))if(Ly)Mt=z5;else{Mt=N5;var Ze=I5}else ye=me.nodeName,!ye||ye.toLowerCase()!=="input"||me.type!=="checkbox"&&me.type!=="radio"?he&&vn(he.elementType)&&(Mt=Ty):Mt=B5;if(Mt&&(Mt=Mt(r,he))){Ry(Le,Mt,c,Ce);break e}Ze&&Ze(r,me,he),r==="focusout"&&he&&me.type==="number"&&he.memoizedProps.value!=null&&Ec(me,"number",me.value)}switch(Ze=he?Lo(he):window,r){case"focusin":(ky(Ze)||Ze.contentEditable==="true")&&(Ya=Ze,Zp=he,Pc=null);break;case"focusout":Pc=Zp=Ya=null;break;case"mousedown":Jp=!0;break;case"contextmenu":case"mouseup":case"dragend":Jp=!1,Ny(Le,c,Ce);break;case"selectionchange":if(V5)break;case"keydown":case"keyup":Ny(Le,c,Ce)}var _t;if(Kp)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=Ce,Up="value"in Oi?Oi.value:Oi.textContent,Ka=!0)),Ze=gf(he,Lt),0<Ze.length&&(Lt=new yy(Lt,r,null,c,Ce),Le.push({event:Lt,listeners:Ze}),_t?Lt.data=_t:(_t=Ey(c),_t!==null&&(Lt.data=_t)))),(_t=O5?M5(r,c):D5(r,c))&&(Lt=gf(he,"onBeforeInput"),0<Lt.length&&(Ze=new yy("onBeforeInput","beforeinput",null,c,Ce),Le.push({event:Ze,listeners:Lt}),Ze.data=_t)),wL(Le,r,he,c,Ce)}cx(Le,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 TL(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,B=[];c!==null&&c!==m;){var Q=c,ie=Q.alternate,he=Q.stateNode;if(Q=Q.tag,ie!==null&&ie===m)break;Q!==5&&Q!==26&&Q!==27||he===null||(ie=he,k?(he=kc(c,O),he!=null&&B.unshift(iu(c,he,ie))):k||(he=kc(c,O),he!=null&&B.push(iu(c,he,ie)))),c=c.return}B.length!==0&&r.push({event:i,listeners:B})}var LL=/\r\n?/g,AL=/\u0000|\uFFFD/g;function fx(r){return(typeof r=="string"?r:""+r).replace(LL,`
10
- `).replace(AL,"")}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===""||rt(r,m):(typeof m=="number"||typeof m=="bigint")&&i!=="body"&&rt(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":Rr(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Rr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Rr(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Rr(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Rr(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Rr(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Rr(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Rr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Rr(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 wg(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"?rt(r,m):(typeof m=="number"||typeof m=="bigint")&&rt(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 B=c[O];if(B!=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,B,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=B=k=null,ie=null,he=null;for(m in c)if(c.hasOwnProperty(m)){var Ce=c[m];if(Ce!=null)switch(m){case"name":k=Ce;break;case"type":B=Ce;break;case"checked":ie=Ce;break;case"defaultChecked":he=Ce;break;case"value":O=Ce;break;case"defaultValue":Q=Ce;break;case"children":case"dangerouslySetInnerHTML":if(Ce!=null)throw Error(s(137,i));break;default:Ft(r,i,m,Ce,c,null)}}yd(r,O,Q,ie,he,B,k,!1);return;case"select":kt("invalid",r),m=B=O=null;for(k in c)if(c.hasOwnProperty(k)&&(Q=c[k],Q!=null))switch(k){case"value":O=Q;break;case"defaultValue":B=Q;break;case"multiple":m=Q;default:Ft(r,i,k,Q,c,null)}i=O,c=B,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(B in c)if(c.hasOwnProperty(B)&&(Q=c[B],Q!=null))switch(B){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,B,Q,c,null)}Fe(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(he in c)if(c.hasOwnProperty(he)&&(m=c[he],m!=null))switch(he){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ft(r,i,he,m,c,null)}return;default:if(vn(i)){for(Ce in c)c.hasOwnProperty(Ce)&&(m=c[Ce],m!==void 0&&wg(r,i,Ce,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 OL(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,B=null,Q=null,ie=null,he=null,Ce=null;for(ye in c){var Le=c[ye];if(c.hasOwnProperty(ye)&&Le!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":ie=Le;default:m.hasOwnProperty(ye)||Ft(r,i,ye,null,m,Le)}}for(var me in m){var ye=m[me];if(Le=c[me],m.hasOwnProperty(me)&&(ye!=null||Le!=null))switch(me){case"type":O=ye;break;case"name":k=ye;break;case"checked":he=ye;break;case"defaultChecked":Ce=ye;break;case"value":B=ye;break;case"defaultValue":Q=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,i));break;default:ye!==Le&&Ft(r,i,me,ye,m,Le)}}wc(r,B,Q,ie,he,Ce,O,k);return;case"select":ye=B=Q=me=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":me=O;break;case"defaultValue":Q=O;break;case"multiple":B=O;default:O!==ie&&Ft(r,i,k,O,m,ie)}i=Q,c=B,m=ye,me!=null?Ai(r,!!c,me,!1):!!m!=!!c&&(i!=null?Ai(r,!!c,i,!0):Ai(r,!!c,c?[]:"",!1));return;case"textarea":ye=me=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(B in m)if(k=m[B],O=c[B],m.hasOwnProperty(B)&&(k!=null||O!=null))switch(B){case"value":me=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,B,k,m,O)}bd(r,me,ye);return;case"option":for(var $e in c)me=c[$e],c.hasOwnProperty($e)&&me!=null&&!m.hasOwnProperty($e)&&($e==="selected"?r.selected=!1:Ft(r,i,$e,null,m,me));for(ie in m)me=m[ie],ye=c[ie],m.hasOwnProperty(ie)&&me!==ye&&(me!=null||ye!=null)&&(ie==="selected"?r.selected=me&&typeof me!="function"&&typeof me!="symbol":Ft(r,i,ie,me,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)me=c[ut],c.hasOwnProperty(ut)&&me!=null&&!m.hasOwnProperty(ut)&&Ft(r,i,ut,null,m,me);for(he in m)if(me=m[he],ye=c[he],m.hasOwnProperty(he)&&me!==ye&&(me!=null||ye!=null))switch(he){case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(s(137,i));break;default:Ft(r,i,he,me,m,ye)}return;default:if(vn(i)){for(var Ut in c)me=c[Ut],c.hasOwnProperty(Ut)&&me!==void 0&&!m.hasOwnProperty(Ut)&&wg(r,i,Ut,void 0,m,me);for(Ce in m)me=m[Ce],ye=c[Ce],!m.hasOwnProperty(Ce)||me===ye||me===void 0&&ye===void 0||wg(r,i,Ce,me,m,ye);return}}for(var ce in c)me=c[ce],c.hasOwnProperty(ce)&&me!=null&&!m.hasOwnProperty(ce)&&Ft(r,i,ce,null,m,me);for(Le in m)me=m[Le],ye=c[Le],!m.hasOwnProperty(Le)||me===ye||me==null&&ye==null||Ft(r,i,Le,me,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 ML(){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,B=k.initiatorType,Q=k.duration;if(O&&Q&&px(B)){for(B=0,Q=k.responseEnd,m+=1;m<c.length;m++){var ie=c[m],he=ie.startTime;if(he>Q)break;var Ce=ie.transferSize,Le=ie.initiatorType;Ce&&px(Le)&&(ie=ie.responseEnd,B+=Ce*(ie<Q?1:(Q-he)/(ie-he)))}if(--m,i+=8*(O+B)/(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 Eg=null,kg=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 Rg(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 Tg=null;function DL(){var r=window.event;return r&&r.type==="popstate"?r===Tg?!1:(Tg=r,!0):(Tg=null,!1)}var vx=typeof setTimeout=="function"?setTimeout:void 0,PL=typeof clearTimeout=="function"?clearTimeout:void 0,_x=typeof Promise=="function"?Promise:void 0,jL=typeof queueMicrotask=="function"?queueMicrotask:typeof _x<"u"?function(r){return _x.resolve(null).then(r).catch(IL)}:vx;function IL(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 B=O.nextSibling,Q=O.nodeName;O[Ro]||Q==="SCRIPT"||Q==="STYLE"||Q==="LINK"&&O.rel.toLowerCase()==="stylesheet"||c.removeChild(O),O=B}}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 Lg(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":Lg(c),To(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function NL(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 BL(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 Ag(r){return r.data==="$?"||r.data==="$~"}function Og(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function zL(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 Mg=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=$.d;$.d={f:HL,r:VL,D:FL,C:UL,L:WL,m:qL,X:$L,S:GL,M:KL};function HL(){var r=vi.f(),i=cf();return r||i}function VL(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 FL(r){vi.D(r),kx("dns-prefetch",r,null)}function UL(r,i){vi.C(r,i),kx("preconnect",r,i)}function WL(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 qL(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 GL(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 B=k.get(O);if(!B){var Q={loading:0,preload:null};if(B=m.querySelector(au(O)))Q.loading=5;else{r=f({rel:"stylesheet",href:r,"data-precedence":i},c),(c=Qr.get(O))&&Dg(r,c);var ie=B=m.createElement("link");gn(ie),Un(ie,"link",r),ie._p=new Promise(function(he,Ce){ie.onload=he,ie.onerror=Ce}),ie.addEventListener("load",function(){Q.loading|=1}),ie.addEventListener("error",function(){Q.loading|=2}),Q.loading|=4,yf(B,i,m)}B={type:"stylesheet",instance:B,count:1,state:Q},k.set(O,B)}}}function $L(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))&&Pg(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 KL(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))&&Pg(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=te.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,B=O.get(r);if(B||(k=k.ownerDocument||k,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(r,B),(O=k.querySelector(au(r)))&&!O._p&&(B.instance=O,B.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||YL(k,r,c,B.state))),i&&m===null)throw Error(s(528,""));return B}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 YL(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))&&Dg(m,k),O=(r.ownerDocument||r).createElement("link"),gn(O);var B=O;return B._p=new Promise(function(Q,ie){B.onload=Q,B.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),Pg(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,B=0;B<m.length;B++){var Q=m[B];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 Dg(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Pg(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 B=O.getAttribute(i)||"";B=r+B;var Q=m.get(B);Q?Q.push(O):m.set(B,[O])}}return m}function Ox(r,i,c){r=r.ownerDocument||r,r.head.insertBefore(c,i==="title"?r.querySelector("head > title"):null)}function XL(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 QL(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))&&Dg(m,k),O=O.createElement("link"),gn(O);var B=O;B._p=new Promise(function(Q,ie){B.onload=Q,B.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 ZL(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*ML());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(JL,r),Sf=null,xf.call(r))}function JL(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 B=k[O];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(c.set(B.dataset.precedence,B),m=B)}m&&c.set(null,m)}k=i.instance,B=k.getAttribute("data-precedence"),O=c.get(B)||m,O===m&&c.set(null,k),c.set(B,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:x,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function eA(r,i,c,m,k,O,B,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=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function Dx(r,i,c,m,k,O,B,Q,ie,he,Ce,Le){return r=new eA(r,i,c,B,ie,he,Ce,Le,Q),i=1,O===!0&&(i|=24),O=Lr(3,null,null,i),r.current=O,O.stateNode=r,i=pm(),i.refCount++,r.pooledCache=i,i.refCount++,O.memoizedState={element:m,isDehydrated:c,cache:i},_m(O),r}function Px(r){return r?(r=Za,r):Za}function jx(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 Ix(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<i?c:i}}function Ig(r,i){Ix(r,i),(r=r.alternate)&&Ix(r,i)}function Nx(r){if(r.tag===13||r.tag===31){var i=Do(r,67108864);i!==null&&mr(i,r,67108864),Ig(r,67108864)}}function Bx(r){if(r.tag===13||r.tag===31){var i=Pr();i=Yn(i);var c=Do(r,i);c!==null&&mr(c,r,i),Ig(r,i)}}var wf=!0;function tA(r,i,c,m){var k=V.T;V.T=null;var O=$.p;try{$.p=2,Ng(r,i,c,m)}finally{$.p=O,V.T=k}}function nA(r,i,c,m){var k=V.T;V.T=null;var O=$.p;try{$.p=8,Ng(r,i,c,m)}finally{$.p=O,V.T=k}}function Ng(r,i,c,m){if(wf){var k=Bg(m);if(k===null)Cg(r,i,m,Ef,c),Hx(r,m);else if(sA(k,r,i,c,m))m.stopPropagation();else if(Hx(r,m),i&4&&-1<rA.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 B=vt(O.pendingLanes);if(B!==0){var Q=O;for(Q.pendingLanes|=2,Q.entangledLanes|=2;B;){var ie=1<<31-lt(B);Q.entanglements[1]|=ie,B&=~ie}Os(O),(jt&6)===0&&(af=Re()+500,ru(0))}}break;case 31:case 13:Q=Do(O,2),Q!==null&&mr(Q,O,2),cf(),Ig(O,2)}if(O=Bg(m),O===null&&Cg(r,i,m,Ef,c),O===k)break;k=O}k!==null&&m.stopPropagation()}else Cg(r,i,m,null,c)}}function Bg(r){return r=Hp(r),zg(r)}var Ef=null;function zg(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(we()){case We:return 2;case et:return 8;case xe:case Ge:return 32;case tt:return 268435456;default:return 32}default:return 32}}var Hg=!1,Yi=null,Xi=null,Qi=null,uu=new Map,du=new Map,Zi=[],rA="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 sA(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=Bg(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 iA(){Hg=!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,Hg||(Hg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,iA)))}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(zg(m||c)===null)continue;break}var O=Rs(c);O!==null&&(r.splice(i,3),i-=3,Bm(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],B=k[mn]||null;if(typeof O=="function")B||Ux(c);else if(B){var Q=null;if(O&&O.hasAttribute("formAction")){if(k=O,B=O[mn]||null)Q=B.formAction;else if(zg(k)!==null)continue}else Q=B.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(B){return k=B})},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 Vg(r){this._internalRoot=r}Lf.prototype.render=Vg.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(s(409));var c=i.current,m=Pr();jx(c,m,r,i,null,null)},Lf.prototype.unmount=Vg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;jx(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"));$.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 oA={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Af=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Af.isDisabled&&Af.supportsFiber)try{He=Af.inject(oA),ke=Af}catch{}}return pu.createRoot=function(r,i){if(!o(r))throw Error(s(299));var c=!1,m="",k=Z1,O=J1,B=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&&(B=i.onRecoverableError)),i=Dx(r,1,!1,null,null,c,m,null,k,O,B,Wx),r[ks]=i.current,Sg(r),new Vg(i)},pu.hydrateRoot=function(r,i,c){if(!o(r))throw Error(s(299));var m=!1,k="",O=Z1,B=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&&(B=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,B,Q,Wx),i.context=Px(null),c=i.current,m=Pr(),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,Sg(r),new Lf(i)},pu.version="19.2.3",pu}var tS;function gA(){if(tS)return Wg.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(),Wg.exports=mA(),Wg.exports}var vA=gA();const Hv=new WeakMap,_A=new WeakMap,_h={current:[]};let Kg=!1,Lu=0;const Eu=new Set,Of=new Map;function Yw(e){for(const t of e){if(_h.current.includes(t))continue;_h.current.push(t),t.recompute();const n=_A.get(t);if(n)for(const s of n){const o=Hv.get(s);o?.length&&Yw(o)}}}function yA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function bA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Xw(e){if(Lu>0&&!Of.has(e)&&Of.set(e,e.prevState),Eu.add(e),!(Lu>0)&&!Kg)try{for(Kg=!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,yA(n)}for(const n of t){const s=Hv.get(n);s&&(_h.current.push(n),Yw(s))}for(const n of t){const s=Hv.get(n);if(s)for(const o of s)bA(o)}}}finally{Kg=!1,_h.current=[],Of.clear()}}function Au(e){Lu++;try{e()}finally{if(Lu--,Lu===0){const t=Eu.values().next().value;t&&Xw(t)}}}function xA(e){return typeof e=="function"}let SA=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):xA(t)?this.state=t(this.prevState):this.state=t,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),Xw(this)}};const lo="__TSR_index",nS="popstate",rS="beforeunload";function CA(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=N_();return{...t,key:n,__TSR_key:n,[lo]:e}}function wA(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=N_();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,b;const v=()=>{y&&(M._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),M._ignoreSubscribers=!1,y=void 0,b=void 0,p=void 0)},x=(L,P,z)=>{const H=a(P);b||(p=d),d=yh(P,z),y={href:H,state:z,isPush:y?.isPush||L==="push"},b||(b=Promise.resolve().then(()=>v()))},E=L=>{d=l(),M.notify({type:L})},T=async()=>{if(g){g=!1;return}const L=l(),P=L.state[lo]-d.state[lo],z=P===1,H=P===-1,q=!z&&!H||f;f=!1;const I=q?"GO":H?"BACK":"FORWARD",K=q?{type:"GO",index:P}:{type:H?"BACK":"FORWARD"};if(S)S=!1;else{const Y=u();if(typeof document<"u"&&Y.length){for(const V of Y)if(await V.blockerFn({currentLocation:d,nextLocation:L,action:I})){g=!0,t.history.go(1),M.notify(K);return}}}d=l(),M.notify(K)},A=L=>{if(C){C=!1;return}let P=!1;const z=u();if(typeof document<"u"&&z.length)for(const H of z){const q=H.enableBeforeUnload??!0;if(q===!0){P=!0;break}if(typeof q=="function"&&q()===!0){P=!0;break}}if(P)return L.preventDefault(),L.returnValue=""},M=CA({getLocation:w,getLength:()=>t.history.length,pushState:(L,P)=>x("push",L,P),replaceState:(L,P)=>x("replace",L,P),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 P=n.apply(t.history,L);return M._ignoreSubscribers||E("PUSH"),P},t.history.replaceState=function(...L){const P=s.apply(t.history,L);return M._ignoreSubscribers||E("REPLACE"),P},M}function yh(e,t){const n=e.indexOf("#"),s=e.indexOf("?"),o=N_();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 N_(){return(Math.random()+1).toString(36).substring(7)}function bh(e){return e[e.length-1]}function EA(e){return typeof e=="function"}function ro(e,t){return EA(e)?e(t):e}const kA=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:kA.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 RA="Invariant failed";function xi(e,t){if(!e)throw new Error(RA)}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,Iu=3,TA=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,LA=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,AA=/^([^{]*)\{\$\}([^}]*)$/;function B_(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(AA);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(LA);if(a){const d=a[1],p=a[2],f=a[3],g=d.length;return n[0]=Iu,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(TA);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=B_(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 b=o.static?.get(y);if(b)g=b;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 b=y.toLowerCase(),v=o.staticInsensitive?.get(b);if(v)g=v;else{o.staticInsensitive??=new Map;const x=Nu(n.fullPath??n.from);x.parent=o,x.depth=u,g=x,o.staticInsensitive.set(b,x)}}break}case Sa:{const y=l.substring(S,f[1]),b=l.substring(f[4],C),v=p&&!!(y||b),x=y?v?y:y.toLowerCase():void 0,E=b?v?b:b.toLowerCase():void 0,T=o.dynamic?.find(A=>A.caseSensitive===v&&A.prefix===x&&A.suffix===E);if(T)g=T;else{const A=Xg(Sa,n.fullPath??n.from,v,x,E);g=A,A.depth=u,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case Iu:{const y=l.substring(S,f[1]),b=l.substring(f[4],C),v=p&&!!(y||b),x=y?v?y:y.toLowerCase():void 0,E=b?v?b:b.toLowerCase():void 0,T=o.optional?.find(A=>A.caseSensitive===v&&A.prefix===x&&A.suffix===E);if(T)g=T;else{const A=Xg(Iu,n.fullPath??n.from,v,x,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]),b=l.substring(f[4],C),v=p&&!!(y||b),x=y?v?y:y.toLowerCase():void 0,E=b?v?b:b.toLowerCase():void 0,T=Xg(Ca,n.fullPath??n.from,v,x,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 Yg(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(Yg);for(const t of e.dynamic)Jo(t)}if(e.optional?.length){e.optional.sort(Yg);for(const t of e.optional)Jo(t)}if(e.wildcard?.length){e.wildcard.sort(Yg);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 Xg(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 OA(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 MA(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=z_(e,t.masksTree);return t.flatCache.set(e,s),s}function DA(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 z_(s,h,n)}function PA(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=z_(e,t.segmentTree,n);return u&&(u.branch=BA(u.route)),t.matchCache.set(s,u),u}function jA(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function IA(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=jA(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 z_(e,t,n=!1){const s=e.split("/"),o=HA(e,s,t,n);if(!o)return null;const u=NA(e,s,o),h="**"in o;return h&&(u["**"]=o["**"]),{route:h?o.node.notFound??o.node.route:o.node.route,params:u}}function NA(e,t,n){const s=zA(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),b=p.substring(S,p.length-w);u[y]=decodeURIComponent(b)}else{const w=g.substring(1);u[w]=decodeURIComponent(p)}}else if(d.kind===Iu){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 BA(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function zA(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function HA(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:b,optionals:v}=f;s&&g.notFound&&Mf(d,f)&&(d=f);const x=S===h;if(x){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=x?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&&(x||!(A.caseSensitive?E:T??=E.toLowerCase()).startsWith(M)))){if(L){if(x)continue;const P=t.slice(S).join("/").slice(-L.length);if((A.caseSensitive?P:P.toLowerCase())!==L)continue}l={node:A,index:S,skipped:C,depth:w,statics:y,dynamics:b,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 P=g.optional[L];a.push({node:P,index:S,skipped:A,depth:M,statics:y,dynamics:b,optionals:v})}if(!x)for(let L=g.optional.length-1;L>=0;L--){const P=g.optional[L],{prefix:z,suffix:H}=P;if(z||H){const q=P.caseSensitive?E:T??=E.toLowerCase();if(z&&!q.startsWith(z)||H&&!q.endsWith(H))continue}a.push({node:P,index:S+1,skipped:C,depth:M,statics:y,dynamics:b,optionals:v+1})}}if(!x&&g.dynamic&&E)for(let A=g.dynamic.length-1;A>=0;A--){const M=g.dynamic[A],{prefix:L,suffix:P}=M;if(L||P){const z=M.caseSensitive?E:T??=E.toLowerCase();if(L&&!z.startsWith(L)||P&&!z.endsWith(P))continue}a.push({node:M,index:S+1,skipped:C,depth:w+1,statics:y,dynamics:b+1,optionals:v})}if(!x&&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:b,optionals:v})}if(!x&&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:b,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 H_(e.filter(t=>t!==void 0).join("/"))}function H_(e){return e.replace(/\/{2,}/g,"/")}function Qw(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 Zw(e){return fa(Qw(e))}function Ch(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function VA(e,t,n){return Ch(e,n)===Ch(t,n)}function FA({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=B_(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),b=g.substring(l[2],l[3]);S===Sa?d+=w||y?`${w}{$${b}}${y}`:`$${b}`:S===Ca?d+=w||y?`${w}{$}${y}`:"$":d+=`${w}{-$${b}}${y}`}d=H_(d);const p=d||"/";return h&&s&&s.set(h,p),p}function Qg(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?encodeURI(s):UA(s,n)}function Zg({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=B_(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=Qg("_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=Qg(S,t,n)??"undefined";l+="/"+C+y+w;continue}if(g===Iu){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),b=Qg(S,t,n)??"";l+="/"+w+b+y;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:o,interpolatedPath:l||"/",isMissingParams:s}}function UA(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 WA(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const wh="tsr-scroll-restoration-v1_3",qA=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function GA(){const e=WA();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=GA(),Vv=e=>e.state.__TSR_key||e.href;function $A(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 Jw({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 KA(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||Vv;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=$A(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",qA(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})||(Jw({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 YA(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 XA(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 Jg(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function QA(e){const t=new URLSearchParams(e),n={};for(const[s,o]of t.entries()){const u=n[s];u==null?n[s]=Jg(o):Array.isArray(u)?u.push(Jg(o)):n[s]=[u,Jg(o)]}return n}const ZA=e3(JSON.parse),JA=t3(JSON.stringify,JSON.parse);function e3(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=QA(t);for(const s in n){const o=n[s];if(typeof o=="string")try{n[s]=e(o)}catch{}}return n}}function t3(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=XA(o,s);return u?`?${u}`:""}}const Ir="__root__";function e2(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)),V_=(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},t2=(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,t2(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):(t2(e,n),n)}},n2=(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}))},n3=(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)},r2=(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||o2(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const h=setTimeout(()=>{dh(e)},o);s._nonReactive.pendingTimeout=h}},r3=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;r2(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()},s3=(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"),r2(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={...V_(e,n,!1),...o.__routeContext},{search:w,params:y,cause:b}=o,v=sp(e,t),x={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":b,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(x),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)},i3=(e,t)=>{const{id:n,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s],u=()=>{if(e.router.isServer){const l=n3(e,n,t,o);if(co(l))return l.then(a)}return a()},h=()=>s3(e,n,t,o),a=()=>{if(n2(e,n))return;const l=r3(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}})},s2=(e,t,n,s)=>{const o=e.matchPromises[n-1],{params:u,loaderDeps:h,abortController:a,cause:l}=e.router.getMatch(t),d=V_(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)&&i2(s);const u=s.options.loader?.(s2(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)}},o3=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:V_(e,t)}))};if(n2(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(s2(e,n,t,h)):C,y=!!g&&!e.router.state.matches.some(E=>E.id===n),b=e.router.getMatch(n);b._nonReactive.loaderPromise=Vl(),y!==b.preload&&e.updateMatch(n,E=>({...E,preload:y}));const{status:v,invalid:x}=b;if(o=v==="success"&&(x||(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=i3(t,o);co(u)&&await u}const n=t.firstBadMatchIndex??t.matches.length;for(let o=0;o<n;o++)t.matchPromises.push(o3(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 i2(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 a2){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 o2(e){for(const t of a2)if(e.options[t]?.preload)return!0;return!1}const a2=["component","errorComponent","pendingComponent","notFoundComponent"];function a3(e){return{input:({url:t})=>{for(const n of e)t=l2(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=c2(e[n],t);return t}}}function l3(e){const t=Zw(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 l2(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 c2(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 c3{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=wA())),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 SA(d3(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),KA(this));let a=!1;const l=this.options.basepath??"/",d=this.options.rewrite;if(u||o!==l||h!==d){this.basepath=l;const g=[];Zw(l)!==""&&g.push(l3({basepath:l})),d&&g.push(d),this.rewrite=g.length===0?void 0:g.length===1?g[0]:a3(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}=IA(this.routeTree,this.options.caseSensitive,(h,a)=>{h.init({originalIndex:a})});this.options.routeMasks&&OA(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=l2(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)=>FA({base:n,to:H_(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=>f3({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=Zg({path:S,params:C}).interpolatedPath,y=this.matchRoutes(w,void 0,{_buildLocation:!0}).map(z=>this.looseRoutesById[z.routeId]);if(Object.keys(C).length>0)for(const z of y){const H=z.options.params?.stringify??z.options.stringifyParams;H&&Object.assign(C,H(C))}const b=n.leaveParams?S:cS(Zg({path:S,params:C,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let v=f;if(n._includeValidateSearch&&this.options.search?.strict){const z={};y.forEach(H=>{if(H.options.validateSearch)try{Object.assign(z,Fv(H.options.validateSearch,{...z,...v}))}catch{}}),v=z}v=h3({search:v,dest:u,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),v=es(f,v);const x=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=`${b}${x}${T}`,L=new URL(M,this.origin),P=c2(this.rewrite,L);return{publicHref:P.pathname+P.search+P.hash,href:M,url:P,pathname:b,search:v,searchStr:x,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=MA(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 e2({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(b=>b.id===y.id)),f=w.filter(y=>!C.some(b=>b.id===y.id)),g=w.filter(y=>C.some(b=>b.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=i2,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=DA(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??JA,parseSearch:t.parseSearch??ZA}),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 I=S?.search??t.search,K=S?._strictSearch??void 0;try{const Y=Fv(f.options.validateSearch,{...I})??void 0;return[{...I,...Y},{...K,...Y},void 0]}catch(Y){let V=Y;if(Y instanceof kh||(V=new kh(Y.message,{cause:Y})),n?.throwOnError)throw V;return[I,{},V]}})(),b=f.options.loaderDeps?.({search:C})??"",v=b?JSON.stringify(b):"",{interpolatedPath:x,usedParams:E}=Zg({path:f.fullPath,params:u,decodeCharMap:this.pathParamsDecodeCharMap}),T=f.id+x+v,A=this.getMatch(T),M=this.state.matches.find(I=>I.routeId===f.id),L=A?._strictParams??E;let P;if(!A){const I=f.options.params?.parse??f.options.parseParams;if(I)try{Object.assign(L,I(L))}catch(K){if(is(K)||bs(K)?P=K:P=new u3(K.message,{cause:K}),n?.throwOnError)throw P}}Object.assign(u,L);const z=M?"stay":"enter";let H;if(A)H={...A,cause:z,params:M?es(M.params,u):u,_strictParams:L,search:es(M?M.search:A.search,C),_strictSearch:w};else{const I=f.options.loader||f.options.beforeLoad||f.lazyFn||o2(f)?"pending":"success";H={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:x,updatedAt:Date.now(),search:M?es(M.search,C):C,_strictSearch:w,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Vl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:z,loaderDeps:M?es(M.loaderDeps,b):b,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||(H.globalNotFound=l===f.id),H.searchError=y;const q=p(S);H.context={...q,...H.__routeContext,...H.__beforeLoadContext},d.push(H)}),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 b={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(b)??void 0}f.context={...y,...f.__routeContext,...f.__beforeLoadContext}}}),d}}class kh extends Error{}class u3 extends Error{}function d3(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Fv(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 f3({pathname:e,routesById:t,processedTree:n}){const s={},o=fa(e);let u;const h=PA(o,n,!0);return h&&(u=h.route,Object.assign(s,h.params)),{matchedRoutes:h?.branch||[t[Ir]],routeParams:s,foundRoute:u}}function h3({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,...Fv(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 p3="Error preloading route! ☝️";class u2{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=Qw(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 m3 extends u2{constructor(t){super(t)}}function F_(e){const t=e.errorComponent??ip;return _.jsx(g3,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?R.createElement(t,{error:n,reset:s}):e.children})}class g3 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 v3({children:e,fallback:t=null}){return _3()?_.jsx(ze.Fragment,{children:e}):_.jsx(ze.Fragment,{children:t})}function _3(){return ze.useSyncExternalStore(y3,()=>!0,()=>!1)}function y3(){return()=>{}}var ev={exports:{}},tv={},nv={exports:{}},rv={};var fS;function b3(){if(fS)return rv;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 rv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,rv}var hS;function d2(){return hS||(hS=1,nv.exports=b3()),nv.exports}var pS;function x3(){if(pS)return tv;pS=1;var e=Ju(),t=d2();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 tv.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 b(A){if(!v){if(v=!0,x=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(x,A))return M;var L=g(A);return S!==void 0&&S(M,L)?(x=A,M):(x=A,E=L)}var v=!1,x,E,T=f===void 0?null:f;return[function(){return b(p())},T===null?void 0:function(){return b(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},tv}var mS;function S3(){return mS||(mS=1,ev.exports=x3()),ev.exports}var f2=S3();function C3(e,t=s=>s,n={}){const s=n.equal??w3;return f2.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function w3(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 sv=R.createContext(null);function h2(){return typeof document>"u"?sv:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=sv,sv)}function Fr(e){const t=R.useContext(h2());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 C3(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),E3=R.createContext(void 0);function Fs(e){const t=R.useContext(e.from?E3: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 U_(e){return Fs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function W_(e){const{select:t,...n}=e;return Fs({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function q_(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 G_(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 jf=typeof window<"u"?R.useLayoutEffect:R.useEffect;function iv(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 k3(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 R3(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=Kw();const T3=Gw(er);function L3(e,t){const n=Fr(),[s,o]=R.useState(!1),u=R.useRef(!1),h=R3(t),{activeProps:a,inactiveProps:l,activeOptions:d,to:p,preload:f,preloadDelay:g,hashScrollIntoView:S,replace:C,startTransition:w,resetScroll:y,viewTransition:b,children:v,target:x,disabled:E,style:T,className:A,onClick:M,onFocus:L,onMouseEnter:P,onMouseLeave:z,onTouchStart:H,ignoreBlocker:q,params:I,search:K,hash:Y,state:V,mask:$,reloadDocument:G,unsafeRelative:j,from:U,_fromLocation:D,...N}=e,W=Jn({select:pe=>pe.location.search,structuralSharing:!0}),Z=e.from,ee=R.useMemo(()=>({...e,from:Z}),[n,W,Z,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),te=R.useMemo(()=>n.buildLocation({...ee}),[n,ee]),X=R.useMemo(()=>{if(E)return;let pe=te.maskedLocation?te.maskedLocation.url.href:te.url.href,Re=!1;return n.origin&&(pe.startsWith(n.origin)?pe=n.history.createHref(pe.replace(n.origin,""))||"/":Re=!0),{href:pe,external:Re}},[E,te.maskedLocation,te.url,n.origin,n.history]),F=R.useMemo(()=>{if(X?.external)return X.href;try{return new URL(p),p}catch{}},[p,X]),se=e.reloadDocument||F?!1:f??n.options.defaultPreload,ne=g??n.options.defaultPreloadDelay??0,re=Jn({select:pe=>{if(F)return!1;if(d?.exact){if(!VA(pe.location.pathname,te.pathname,n.basepath))return!1}else{const Re=Ch(pe.location.pathname,n.basepath),we=Ch(te.pathname,n.basepath);if(!(Re.startsWith(we)&&(Re.length===we.length||Re[we.length]==="/")))return!1}return(d?.includeSearch??!0)&&!da(pe.location.search,te.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?pe.location.hash===te.hash:!0}}),oe=R.useCallback(()=>{n.preloadRoute({...ee}).catch(pe=>{console.warn(pe),console.warn(p3)})},[n,ee]),le=R.useCallback(pe=>{pe?.isIntersecting&&oe()},[oe]);k3(h,le,P3,{disabled:!!E||se!=="viewport"}),R.useEffect(()=>{u.current||!E&&se==="render"&&(oe(),u.current=!0)},[E,oe,se]);const ve=pe=>{const Re=pe.currentTarget.getAttribute("target"),we=x!==void 0?x:Re;if(!E&&!j3(pe)&&!pe.defaultPrevented&&(!we||we==="_self")&&pe.button===0){pe.preventDefault(),er.flushSync(()=>{o(!0)});const We=n.subscribe("onResolved",()=>{We(),o(!1)});n.navigate({...ee,replace:C,resetScroll:y,hashScrollIntoView:S,startTransition:w,viewTransition:b,ignoreBlocker:q})}};if(F)return{...N,ref:h,href:F,...v&&{children:v},...x&&{target:x},...E&&{disabled:E},...T&&{style:T},...A&&{className:A},...M&&{onClick:M},...L&&{onFocus:L},...P&&{onMouseEnter:P},...z&&{onMouseLeave:z},...H&&{onTouchStart:H}};const ge=pe=>{E||se&&oe()},ue=ge,de=pe=>{if(!(E||!se))if(!ne)oe();else{const Re=pe.target;if(gu.has(Re))return;const we=setTimeout(()=>{gu.delete(Re),oe()},ne);gu.set(Re,we)}},Ie=pe=>{if(E||!se||!ne)return;const Re=pe.target,we=gu.get(Re);we&&(clearTimeout(we),gu.delete(Re))},De=re?ro(a,{})??A3:ov,Oe=re?ov:ro(l,{})??ov,be=[A,De.className,Oe.className].filter(Boolean).join(" "),Me=(T||De.style||Oe.style)&&{...T,...De.style,...Oe.style};return{...N,...De,...Oe,href:X?.href,ref:h,onClick:vu([M,ve]),onFocus:vu([L,ge]),onMouseEnter:vu([P,de]),onMouseLeave:vu([z,Ie]),onTouchStart:vu([H,ue]),disabled:!!E,target:x,...Me&&{style:Me},...be&&{className:be},...E&&O3,...re&&M3,...s&&D3}}const ov={},A3={className:"active"},O3={role:"link","aria-disabled":!0},M3={"data-status":"active","aria-current":"page"},D3={"data-transitioning":"transitioning"},gu=new WeakMap,P3={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}=L3(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 j3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let I3=class extends u2{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=>G_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>q_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>W_({...n,from:this.id}),this.useLoaderData=n=>U_({...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 N3(e){return new I3(e)}class B3 extends m3{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=>G_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>q_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>W_({...n,from:this.id}),this.useLoaderData=n=>U_({...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 z3(e){return new B3(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=N3(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=>G_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>q_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>W_({...n,from:this.options.id}),this.useLoaderData=n=>U_({...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 H3(){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=iv(u),a=u||n||o,l=iv(a),d=u||o,p=iv(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]),jf(()=>{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]),jf(()=>{h&&!u&&e.emit({type:"onLoad",...ha(e.state)})},[h,e,u]),jf(()=>{p&&!d&&e.emit({type:"onBeforeRouteMount",...ha(e.state)})},[d,p,e]),jf(()=>{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&&YA(e)}},[a,l,e]),null}function V3(e){const t=Jn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return _.jsx(F_,{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 F3(){return _.jsx("p",{children:"Not Found"})}function El(e){return _.jsx(_.Fragment,{children:e.children})}function p2(e,t,n){return t.options.notFoundComponent?_.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?_.jsx(e.options.defaultNotFoundComponent,{...n}):_.jsx(F3,{})}function U3({children:e}){const t=Fr();return t.isServer?_.jsx("script",{nonce:t.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function W3(){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||Vv)(e.latestLocation),s=n!==Vv(e.latestLocation)?n:void 0,o={storageKey:wh,shouldScrollRestoration:!0};return s&&(o.key=s),_.jsx(U3,{children:`(${Jw.toString()})(${JSON.stringify(o)})`})}const m2=R.memo(function({matchId:t}){const n=Fr(),s=Jn({select:b=>{const v=b.matches.find(x=>x.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?F_:El,S=d?V3:El,C=Jn({select:b=>b.loadedAt}),w=Jn({select:b=>{const v=b.matches.findIndex(x=>x.id===t);return b.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:(b,v)=>{if(is(b))throw b;l?.(b,v)},children:_.jsx(S,{fallback:b=>{if(!d||b.routeId&&b.routeId!==s.routeId||!b.routeId&&!o.isRoot)throw b;return R.createElement(d,b)},children:p||s._displayPending?_.jsx(v3,{fallback:h,children:_.jsx(bS,{matchId:t})}):_.jsx(bS,{matchId:t})})})})}),w===Ir&&n.options.scrollRestoration?_.jsxs(_.Fragment,{children:[_.jsx(q3,{}),_.jsx(W3,{})]}):null]})});function q3(){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(g2,{})},[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)),p2(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}),g2=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 p2(t,o,void 0);if(!h)return null;const l=_.jsx(m2,{matchId:h});return s===Ir?_.jsx(R.Suspense,{fallback:a,children:l}):l});function G3(){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(H3,{}),_.jsx($3,{})]});return e.options.InnerWrap?_.jsx(e.options.InnerWrap,{children:u}):u}function $3(){const e=Fr(),t=Jn({select:o=>o.matches[0]?.id}),n=Jn({select:o=>o.loadedAt}),s=t?_.jsx(m2,{matchId:t}):null;return _.jsx(op.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:_.jsx(F_,{getResetKey:()=>n,errorComponent:ip,onCatch:o=>{o.message||o.toString()},children:s})})}const K3=e=>new Y3(e);class Y3 extends c3{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=ws,globalThis.createLazyFileRoute=yS):typeof window<"u"&&(window.createFileRoute=ws,window.createLazyFileRoute=yS);function X3({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=h2(),o=_.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?_.jsx(e.options.Wrap,{children:o}):o}function Q3({router:e,...t}){return _.jsx(X3,{router:e,...t,children:_.jsx(G3,{})})}function Z3(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(){}},J3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},eO=class{#e=J3;#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 eO;function tO(e){setTimeout(e,0)}var wa=typeof window>"u"||"Deno"in globalThis;function sr(){}function nO(e,t){return typeof e=="function"?e(t):e}function Uv(e){return typeof e=="number"&&e>=0&&e!==1/0}function v2(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!==$_(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 $_(e,t){return(t?.queryKeyHashFn||Ea)(e)}function Ea(e){return JSON.stringify(e,(t,n)=>Wv(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 rO=Object.prototype.hasOwnProperty;function _2(e,t){if(e===t)return e;const n=CS(e)&&CS(t);if(!n&&!(Wv(e)&&Wv(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:rO.call(e,p))&&l++;continue}if(f===null||g===null||typeof f!="object"||typeof g!="object"){a[p]=g;continue}const S=_2(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 Wv(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 sO(e){return new Promise(t=>{ra.setTimeout(t,e)})}function qv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?_2(e,t):t}function iO(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function oO(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var K_=Symbol();function y2(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===K_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function b2(e,t){return typeof e=="function"?e(...t):!!e}var aO=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"}},Y_=new aO;function Gv(){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 lO=tO;function cO(){let e=[],t=0,n=a=>{a()},s=a=>{a()},o=lO;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=cO(),uO=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 uO;function dO(e){return Math.min(1e3*2**e,3e4)}function x2(e){return(e??"online")==="online"?Th.isOnline():!0}var $v=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function S2(e){let t=!1,n=0,s;const o=Gv(),u=()=>o.status!=="pending",h=w=>{if(!u()){const y=new $v(w);g(y),e.onCancel?.(y)}},a=()=>{t=!0},l=()=>{t=!1},d=()=>Y_.isFocused()&&(e.networkMode==="always"||Th.isOnline())&&e.canRun(),p=()=>x2(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(b){w=Promise.reject(b)}Promise.resolve(w).then(f).catch(b=>{if(u())return;const v=e.retry??(wa?0:3),x=e.retryDelay??dO,E=typeof x=="function"?x(n,b):x,T=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,b);if(t||!T){g(b);return}n++,e.onFail?.(n,b),sO(E).then(()=>d()?void 0:S()).then(()=>{t?g(b):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 C2=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uv(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)}},fO=class extends C2{#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=qv(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===K_||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:!v2(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=y2(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=S2({initialPromise:t?.initialPromise,fn:h.fetchFn,onCancel:a=>{a instanceof $v&&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 $v){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,...w2(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 w2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:x2(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 hO=class extends Jl{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=Gv(),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 Kv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Kv(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 mO(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||!Uv(e))return;const n=v2(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||!Uv(this.#l)||this.#l===0)&&(this.#u=ra.setInterval(()=>{(this.options.refetchIntervalInBackground||Y_.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(),P=!L&&RS(e,t),z=L&&TS(e,n,t,s);(P||z)&&(p={...p,...w2(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=qv(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=qv(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 b=p.fetchStatus==="fetching",v=w==="pending",x=w==="error",E=v&&b,T=g!==void 0,M={status:w,fetchStatus:p.fetchStatus,isPending:v,isSuccess:w==="success",isError:x,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:b,isRefetching:b&&!v,isLoadingError:x&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&T,isStale:X_(e,t),refetch:this.refetch,promise:this.#a,isEnabled:ns(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=H=>{M.status==="error"?H.reject(M.error):M.data!==void 0&&H.resolve(M.data)},P=()=>{const H=this.#a=M.promise=Gv();L(H)},z=this.#a;switch(z.status){case"pending":e.queryHash===n.queryHash&&L(z);break;case"fulfilled":(M.status==="error"||M.data!==z.value)&&P();break;case"rejected":(M.status!=="error"||M.error!==z.reason)&&P();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 pO(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 pO(e,t)||e.state.data!==void 0&&Kv(e,t,t.refetchOnMount)}function Kv(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&&X_(e,t)}return!1}function TS(e,t,n,s){return(e!==t||ns(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&X_(e,n)}function X_(e,t){return ns(t.enabled,e)!==!1&&e.isStaleByTime(uo(t.staleTime,e))}function mO(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=y2(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})(),x=await g(v),{maxPages:E}=t.options,T=y?oO:iO;return{pages:T(C.pages,x,E),pageParams:T(C.pageParams,w,E)}};if(o&&u.length){const C=o==="backward",w=C?gO:AS,y={pages:u,pageParams:h},b=w(s,y);a=await S(y,b,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 gO(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var vO=class extends C2{#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||E2(),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=S2({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 E2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _O=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 vO({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=If(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=If(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=If(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=If(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 If(e){return e.options.scope?.id}var yO=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??E2();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)})})}},bO=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??$_(s,t);let u=this.get(o);return u||(u=new fO({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()})})}},xO=class{#e;#t;#n;#s;#r;#o;#a;#i;constructor(e={}){this.#e=e.queryCache||new bO,this.#t=e.mutationCache||new _O,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=Y_.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=nO(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=$_(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===K_&&(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()}},k2=R.createContext(void 0),$n=e=>{const t=R.useContext(k2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},SO=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(k2.Provider,{value:e,children:t})),R2=R.createContext(!1),CO=()=>R.useContext(R2);R2.Provider;function wO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var EO=R.createContext(wO()),kO=()=>R.useContext(EO),RO=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},TO=e=>{R.useEffect(()=>{e.clearReset()},[e])},LO=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||b2(n,[e.error,s])),AO=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))}},OO=(e,t)=>e.isLoading&&e.isFetching&&!t,MO=(e,t)=>e?.suspense&&t.isPending,OS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function DO(e,t,n){const s=CO(),o=kO(),u=$n(),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h),h._optimisticResults=s?"isRestoring":"optimistic",AO(h),RO(h,o),TO(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]),MO(h,d))throw OS(h,l,o);if(LO({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&&OO(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 DO(e,hO)}function jn(e,t){const n=$n(),[s]=R.useState(()=>new yO(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&&b2(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 Q_(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=(Q_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Q_(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 Yv(e){return!ap()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kn(e).ShadowRoot}const PO=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)&&!PO.has(o)}const jO=new Set(["table","td","th"]);function IO(e){return jO.has(bo(e))}const NO=[":popover-open",":modal"];function lp(e){return NO.some(t=>{try{return e.matches(t)}catch{return!1}})}const BO=["transform","translate","scale","rotate","perspective"],zO=["transform","translate","scale","rotate","perspective","filter"],HO=["paint","layout","strict","content"];function Z_(e){const t=cp(),n=Nt(e)?Vr(e):e;return BO.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)||zO.some(s=>(n.willChange||"").includes(s))||HO.some(s=>(n.contain||"").includes(s))}function VO(e){let t=Us(e);for(;en(t)&&!Hs(t);){if(Z_(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 FO=new Set(["html","body","#document"]);function Hs(e){return FO.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||Yv(e)&&e.host||qs(e);return Yv(t)?t.host:t}function T2(e){const t=Us(e);return Hs(t)?e.ownerDocument?e.ownerDocument.body:e.body:en(t)&&Aa(t)?t:T2(t)}function fo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=T2(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),h=kn(o);if(u){const a=Xv(h);return t.concat(h,h.visualViewport||[],Aa(o)?o:[],a&&n?fo(a):[])}return t.concat(o,fo(o,[],n))}function Xv(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 av=$w[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],UO=av&&av!==R.useLayoutEffect?av:e=>e();function Pe(e){const t=Gn(WO).current;return t.next=e,UO(t.effect),t.trampoline}function WO(){const e={next:void 0,callback:qO,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function qO(){}const GO=()=>{},Ve=typeof document<"u"?R.useLayoutEffect:GO;function Qv(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={...Zv(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 $O(e){if(e.length===0)return Mu;if(e.length===1)return Zv(e[0],Mu);let t={...Zv(e[0],Mu)};for(let n=1;n<e.length;n+=1)t=ku(t,e[n]);return t}function ku(e,t){return L2(t)?t(e):KO(e,t)}function KO(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Qv(e.style,s);break}case"className":{e[n]=A2(e.className,s);break}default:YO(n,s)?e[n]=XO(e[n],s):e[n]=s}}return e}function YO(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 L2(e){return typeof e=="function"}function Zv(e,t){return L2(e)?e(t):e??Mu}function XO(e,t){return t?e?n=>{if(QO(n)){const o=n;Jv(o);const u=t(o);return o.baseUIHandlerPrevented||e?.(o),u}const s=t(n);return e?.(n),s}:t:e}function Jv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function A2(e,t){return t?e?t+" "+e:t:e}function QO(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 O2=R.createContext(void 0);function J_(e=!1){const t=R.useContext(O2);if(t===void 0&&!e)throw new Error(Pt(16));return t}function ZO(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 Sr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:o=!0}=e,u=R.useRef(null),h=J_(!0)!==void 0,a=Pe(()=>{const g=u.current;return!!(g?.tagName==="A"&&g?.href)}),{props:l}=ZO({focusableWhenDisabled:n,disabled:t,composite:h,tabIndex:s,isNativeButton:o}),d=R.useCallback(()=>{const g=u.current;JO(g)&&h&&t&&l.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,l.disabled,h]);Ve(d,[d]);const p=R.useCallback((g={})=>{const{onClick:S,onMouseDown:C,onKeyUp:w,onKeyDown:y,onPointerDown:b,...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||(Jv(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||(Jv(E),w?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!o&&!t&&E.key===" "&&S?.(E)},onPointerDown(E){if(t){E.preventDefault();return}b?.(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 JO(e){return en(e)&&e.tagName==="BUTTON"}function cs(e,t,n,s){const o=Gn(M2).current;return tM(o,e,t,n,s)&&D2(o,[e,t,n,s]),o.callback}function eM(e){const t=Gn(M2).current;return nM(t,e)&&D2(t,e),t.callback}function M2(){return{callback:null,cleanup:null,refs:[]}}function tM(e,t,n,s,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==o}function nM(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function D2(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 rM=parseInt(R.version,10);function e0(e){return rM>=e}function DS(e){if(!R.isValidElement(e))return null;const t=e,n=t.props;return(e0(19)?n?.ref:t.ref)??null}function sM(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 iM(e,t){return typeof e=="function"?e(t):e}function oM(e,t){return typeof e=="function"?e(t):e}function on(){}const br=Object.freeze([]),tn=Object.freeze({}),aM=500,lM=500,cM={style:{transition:"none"}},P2="data-base-ui-click-trigger",t0={fallbackAxisSide:"none"},uM={fallbackAxisSide:"end"},dM={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function at(e,t,n={}){const s=t.render,o=fM(t,n);if(n.enabled===!1)return null;const u=n.state??tn;return hM(e,s,o,u)}function fM(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?iM(n,u):void 0,f=d?oM(s,u):void 0,g=d?sM(u,l):tn,S=d?Qv(g,Array.isArray(a)?$O(a):a)??tn:tn;return typeof document<"u"&&(d?Array.isArray(h)?S.ref=eM([S.ref,DS(o),...h]):S.ref=cs(S.ref,DS(o),h):cs(null,null)),d?(p!==void 0&&(S.className=A2(S.className,p)),f!==void 0&&(S.style=Qv(S.style,f)),S):tn}function hM(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 pM(e,n);throw new Error(Pt(8))}function pM(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 mM=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}=Sr({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 j2(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=j2(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=j2(e))&&(s&&(s+=" "),s+=t);return s}const PS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jS=I2,Oa=(e,t)=>n=>{var s;if(t?.variants==null)return jS(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 jS(e,h,l,n?.class,n?.className)},gM=(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},vM=(e,t)=>({classGroupId:e,validator:t}),N2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lh="-",IS=[],_M="arbitrary..",yM=e=>{const t=xM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return bM(h);const a=h.split(Lh),l=a[0]===""&&a.length>1?1:0;return B2(a,l,t)},getConflictingClassGroupIds:(h,a)=>{if(a){const l=s[h],d=n[h];return l?d?gM(d,l):l:d||IS}return n[h]||IS}}},B2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],u=n.nextPart.get(o);if(u){const d=B2(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}},bM=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?_M+s:void 0})(),xM=e=>{const{theme:t,classGroups:n}=e;return SM(n,t)},SM=(e,t)=>{const n=N2();for(const s in e){const o=e[s];n0(o,n,s,t)}return n},n0=(e,t,n,s)=>{const o=e.length;for(let u=0;u<o;u++){const h=e[u];CM(h,t,n,s)}},CM=(e,t,n,s)=>{if(typeof e=="string"){wM(e,t,n);return}if(typeof e=="function"){EM(e,t,n,s);return}kM(e,t,n,s)},wM=(e,t,n)=>{const s=e===""?t:z2(t,e);s.classGroupId=n},EM=(e,t,n,s)=>{if(RM(e)){n0(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(vM(n,e))},kM=(e,t,n,s)=>{const o=Object.entries(e),u=o.length;for(let h=0;h<u;h++){const[a,l]=o[h];n0(l,z2(t,a),n,s)}},z2=(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=N2(),n.nextPart.set(h,a)),n=a}return n},RM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,TM=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)}}},e_="!",NS=":",LM=[],BS=(e,t,n,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:o}),AM=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(e_)?(g=f.slice(0,-1),S=!0):f.startsWith(e_)&&(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(LM,!1,h,void 0,!0)}if(n){const o=s;s=u=>n({className:u,parseClassName:o})}return s},OM=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}},MM=e=>({cache:TM(e.cacheSize),parseClassName:AM(e),sortModifiers:OM(e),...yM(e)}),DM=/\s+/,PM=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:u}=t,h=[],a=e.trim().split(DM);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,b=s(y?C.substring(0,w):C);if(!b){if(!y){l=p+(l.length>0?" "+l:l);continue}if(b=s(C),!b){l=p+(l.length>0?" "+l:l);continue}y=!1}const v=g.length===0?"":g.length===1?g[0]:u(g).join(":"),x=S?v+e_:v,E=x+b;if(h.indexOf(E)>-1)continue;h.push(E);const T=o(b,y);for(let A=0;A<T.length;++A){const M=T[A];h.push(x+M)}l=p+(l.length>0?" "+l:l)}return l},jM=(...e)=>{let t=0,n,s,o="";for(;t<e.length;)(n=e[t++])&&(s=H2(n))&&(o&&(o+=" "),o+=s);return o},H2=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=H2(e[s]))&&(n&&(n+=" "),n+=t);return n},IM=(e,...t)=>{let n,s,o,u;const h=l=>{const d=t.reduce((p,f)=>f(p),e());return n=MM(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=PM(l,n);return o(l,p),p};return u=h,(...l)=>u(jM(...l))},NM=[],Ln=e=>{const t=n=>n[e]||NM;return t.isThemeGetter=!0,t},V2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,F2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,BM=/^\d+\/\d+$/,zM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HM=/\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$/,VM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,FM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,UM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cl=e=>BM.test(e),St=e=>!!e&&!Number.isNaN(Number(e)),eo=e=>!!e&&Number.isInteger(Number(e)),lv=e=>e.endsWith("%")&&St(e.slice(0,-1)),_i=e=>zM.test(e),WM=()=>!0,qM=e=>HM.test(e)&&!VM.test(e),U2=()=>!1,GM=e=>FM.test(e),$M=e=>UM.test(e),KM=e=>!Ke(e)&&!Ye(e),YM=e=>ec(e,G2,U2),Ke=e=>V2.test(e),Go=e=>ec(e,$2,qM),cv=e=>ec(e,e4,St),zS=e=>ec(e,W2,U2),XM=e=>ec(e,q2,$M),Nf=e=>ec(e,K2,GM),Ye=e=>F2.test(e),_u=e=>tc(e,$2),QM=e=>tc(e,t4),HS=e=>tc(e,W2),ZM=e=>tc(e,G2),JM=e=>tc(e,q2),Bf=e=>tc(e,K2,!0),ec=(e,t,n)=>{const s=V2.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},tc=(e,t,n=!1)=>{const s=F2.exec(e);return s?s[1]?t(s[1]):n:!1},W2=e=>e==="position"||e==="percentage",q2=e=>e==="image"||e==="url",G2=e=>e==="length"||e==="size"||e==="bg-size",$2=e=>e==="length",e4=e=>e==="number",t4=e=>e==="family-name",K2=e=>e==="shadow",n4=()=>{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"),b=Ln("ease"),v=Ln("animate"),x=()=>["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],P=()=>[Cl,"full","auto",...L()],z=()=>[eo,"none","subgrid",Ye,Ke],H=()=>["auto",{span:["full",eo,Ye,Ke]},eo,Ye,Ke],q=()=>[eo,"auto",Ye,Ke],I=()=>["auto","min","max","fr",Ye,Ke],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...L()],$=()=>[Cl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],G=()=>[e,Ye,Ke],j=()=>[...E(),HS,zS,{position:[Ye,Ke]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",ZM,YM,{size:[Ye,Ke]}],N=()=>[lv,_u,Go],W=()=>["","none","full",d,Ye,Ke],Z=()=>["",St,_u,Go],ee=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[St,lv,HS,zS],F=()=>["","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:[WM],container:[_i],"drop-shadow":[_i],ease:["in","out","in-out"],font:[KM],"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":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object: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:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],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":z()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:H()}],"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":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],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:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[a,"screen",...$()]}],"min-w":[{"min-w":[a,"screen","none",...$()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[h]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,_u,Go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ye,cv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lv,Ke]}],"font-family":[{font:[QM,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,cv]}],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:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[St,"from-font","auto",Ye,Go]}],"text-decoration-color":[{decoration:G()}],"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:j()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eo,Ye,Ke],radial:["",Ye,Ke],conic:[eo,Ye,Ke]},JM,XM]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[St,Ye,Ke]}],"outline-w":[{outline:["",St,_u,Go]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",p,Bf,Nf]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",f,Bf,Nf]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[St,Go]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",g,Bf,Nf]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[St,Ye,Ke]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"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":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"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":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"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":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"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":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"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":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"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":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"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":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"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":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ke]}],filter:[{filter:["","none",Ye,Ke]}],blur:[{blur:F()}],brightness:[{brightness:[St,Ye,Ke]}],contrast:[{contrast:[St,Ye,Ke]}],"drop-shadow":[{"drop-shadow":["","none",S,Bf,Nf]}],"drop-shadow-color":[{"drop-shadow":G()}],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":F()}],"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",b,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:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"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",...G()]}],"stroke-w":[{stroke:[St,_u,Go,cv]}],stroke:[{stroke:["none",...G()]}],"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"]}},r4=IM(n4);function Be(...e){return r4(I2(e))}const s4=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 Ne({className:e,variant:t="default",size:n="default",...s}){return _.jsx(mM,{"data-slot":"button",className:Be(s4({variant:t,size:n,className:e})),...s})}const i4={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,...i4,width:t,height:t,color:l||e,className:o,...C,...f},b=[...h&&u?u:a].sort(([,v],[,x])=>{const E=v.opacity!==void 0;return x.opacity!==void 0?1:E?-1:0}).map(([v,x])=>{const E=x.opacity!==void 0,T=E&&!p?x.opacity:void 0,A=d?{...x.stroke!==void 0?{stroke:E?d:l||e}:{fill:E?d:l||e}}:{};return R.createElement(v,{...x,...C,...A,opacity:T,key:x.key})});return R.createElement("svg",w,b)});_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"}]],Y2=[["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"}]],t_=[["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"}]],X2=[["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"}]],o4=[["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"}]],Q2=[["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"}]],Z2=[["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"}]],n_=[["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"}]],r_=[["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"}]],a4=[["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"}]],l4=[["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"}]],c4=[["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"}]],u4=[["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"}]],r0=[["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"}]],d4=[["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"}]],J2=[["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"}]],f4=[["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"}]],h4=[["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"}]],eE=[["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"}]],s_=[["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"}]],tE=[["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"}]],i_=[["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"}]],s0=[["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"}]],p4=[["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"}]],m4=[["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"}]],g4=[["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"}]],v4=[["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"}]],_4=[["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"}]],y4=[["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"}]],b4=[["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"}]],x4=[["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"}]],S4=[["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"}]],C4=[["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"}]],o_=[["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"}]],w4=[["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"}]],E4=[["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"}]],nE=[["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"}]],rE=[["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"}]],i0=[["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"}]],k4=[["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"}]],R4=[["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"}]],o0=[["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"}]],a0=R.createContext(void 0);function wi(e){const t=R.useContext(a0);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 T4={[Oh.startingStyle]:""},L4={[Oh.endingStyle]:""},Gs={transitionStatus(e){return e==="starting"?T4:e==="ending"?L4: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})({}),a_=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const A4={[a_.popupOpen]:""},O4={[a_.popupOpen]:"",[a_.pressed]:""},M4={[sa.open]:""},D4={[sa.closed]:""},P4={[sa.anchorHidden]:""},l0={open(e){return e?A4:null}},zu={open(e){return e?O4:null}},xo={open(e){return e?M4:D4},anchorHidden(e){return e?P4:null}},j4={...xo,...Gs},sE=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:j4,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",c0="outside-press",ma="item-press",I4="close-press",US="clear-press",ia="input-change",no="input-clear",ka="focus-out",dp="escape-key",Du="list-navigation",iE="cancel-open",Ru="sibling-open",oE="imperative-action",N4="window-resize";function Ue(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,Ue(I4,C.nativeEvent))}const{getButtonProps:f,buttonRef:g}=Sr({disabled:u,native:h}),S=R.useMemo(()=>({disabled:u}),[u]);return at("button",t,{state:S,ref:[n,g],props:[{onClick:p},a,f]})}),B4={...$w};let WS=0;function z4(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=B4.useId;function Da(e,t){if(qS!==void 0){const n=qS();return e??(t?`${t}-${n}`:n)}return z4(e,t)}function ar(e){return Da(e,"base-ui")}const aE=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]})}),H4=[];function lE(e){R.useEffect(e,H4)}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 lE(e.disposeEffect),e}function hn(e){const t=Gn(V4,e).current;return t.next=e,Ve(t.effect),t}function V4(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Pa=typeof navigator<"u",uv=W4(),cE=G4(),u0=q4(),d0=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),F4=uv.platform==="MacIntel"&&uv.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(uv.platform),GS=Pa&&/firefox/i.test(u0),uE=Pa&&/apple/i.test(navigator.vendor),Dh=Pa&&/android/i.test(cE)||/android/i.test(u0),U4=Pa&&cE.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,dE=u0.includes("jsdom/");function W4(){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 q4(){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 G4(){if(!Pa)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const l_="data-base-ui-focusable",fE="active",hE="selected",pE="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ho="ArrowLeft",po="ArrowRight",f0="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&&Yv(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 $4(e){return e.matches("html,body")}function dn(e){return e?.ownerDocument||document}function h0(e){return en(e)&&e.matches(pE)}function c_(e){return e?e.getAttribute("role")==="combobox"&&h0(e):!1}function K4(e){if(!e||dE)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Hu(e){return e?e.hasAttribute(l_)?e:e.querySelector(`[${l_}]`)||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 Y4(e){return"nativeEvent"in e}function mE(e){return e.mozInputSource===0&&e.isTrusted?!0:Dh&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function gE(e){return dE?!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 vE(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const X4=["top","right","bottom","left"],Wl=Math.min,Nr=Math.max,Ph=Math.round,kl=Math.floor,Vs=e=>({x:e,y:e}),Q4={left:"right",right:"left",bottom:"top",top:"bottom"},Z4={start:"end",end:"start"};function u_(e,t,n){return Nr(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 p0(e){return e==="x"?"y":"x"}function m0(e){return e==="y"?"height":"width"}const J4=new Set(["top","bottom"]);function rs(e){return J4.has(Hr(e))?"y":"x"}function g0(e){return p0(rs(e))}function eD(e,t,n){n===void 0&&(n=!1);const s=So(e),o=g0(e),u=m0(o);let h=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(h=jh(h)),[h,jh(h)]}function tD(e){const t=jh(e);return[d_(e),t,d_(t)]}function d_(e){return e.replace(/start|end/g,t=>Z4[t])}const KS=["left","right"],YS=["right","left"],nD=["top","bottom"],rD=["bottom","top"];function sD(e,t,n){switch(e){case"top":case"bottom":return n?t?YS:KS:t?KS:YS;case"left":case"right":return t?nD:rD;default:return[]}}function iD(e,t,n,s){const o=So(e);let u=sD(Hr(e),n==="start",s);return o&&(u=u.map(h=>h+"-"+o),t&&(u=u.concat(u.map(d_)))),u}function jh(e){return e.replace(/left|right|bottom|top/g,t=>Q4[t])}function oD(e){return{top:0,right:0,bottom:0,left:0,...e}}function _E(e){return typeof e!="number"?oD(e):{top:e,right:e,bottom:e,left:e}}function Ih(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 f_(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 yE(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 b=null,v=-1;e.current.forEach((x,E)=>{if(x==null)return;const T=x.closest('[role="row"]');T&&(C=!0),(T!==b||v===-1)&&(b=T,v+=1,g[v]=[]),g[v].push(E),S[E]=v})}const w=C&&g.length>0&&g.some(b=>b.length!==u);function y(b){if(!w||d===-1)return;const v=S[d];if(v==null)return;const x=g[v].indexOf(d);let E=b==="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=b==="up"?E-1:E+1;continue}const M=Math.min(x,A.length-1);for(let L=M;L>=0;L-=1){const P=A[L];if(!mo(e,P,h))return P}E=b==="up"?E-1:E+1,s&&(E<0?E=g.length-1:E>=g.length&&(E=0))}}if(t.key===f0){const b=y("up");if(b!==void 0)p&&fn(t),f=b;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,x=l%u,E=l-(x-v);x===v?f=l:f=x>v?E:E-u}Ll(e,f)&&(f=d)}}if(t.key===td){const b=y("down");b!==void 0?(p&&fn(t),f=b):(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 b=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,b)&&(f=Wn(e,{startingIndex:d-d%u-1,disabledIndices:h}))):s&&(f=Wn(e,{startingIndex:d-d%u-1,disabledIndices:h})),Hf(f,u,b)&&(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,b)&&(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,b)&&(f=d));const v=kl(l/u)===b;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 bE(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 xE(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 SE(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 aD=["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=aD.join(","),CE=typeof Element>"u",ql=CE?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Bh=!CE&&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},lD=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},wE=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},EE=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},kE=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||lD(t))&&!EE(t)?0:t.tabIndex},cD=function(t,n){var s=kE(t);return s<0&&n&&!EE(t)?0:s},uD=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},RE=function(t){return t.tagName==="INPUT"},dD=function(t){return RE(t)&&t.type==="hidden"},fD=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},hD=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},pD=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=hD(o,t.form);return!u||u===t},mD=function(t){return RE(t)&&t.type==="radio"},gD=function(t){return mD(t)&&!pD(t)},vD=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},_D=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(vD(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return XS(t);return!1},yD=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},h_=function(t,n){return!(n.disabled||Vu(n)||dD(n)||_D(n,t)||fD(n)||yD(n))},p_=function(t,n){return!(gD(n)||kE(n)<0||!h_(t,n))},bD=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},TE=function(t){var n=[],s=[];return t.forEach(function(o,u){var h=!!o.scopeParent,a=h?o.scopeParent:o,l=cD(a,h),d=h?TE(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(uD).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:p_.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:bD}):s=wE(t,n.includeContainer,p_.bind(null,n)),TE(s)},xD=function(t,n){n=n||{};var s;return n.getShadowRoot?s=zh([t],n.includeContainer,{filter:h_.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=wE(t,n.includeContainer,h_.bind(null,n)),s},LE=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ql.call(t,Nh)===!1?!1:p_(n,t)};const sc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function AE(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 v0(e){return AE(dn(e).body,1)||e}function OE(e){return AE(dn(e).body,-1)||e}function ME(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 SD(e){return ME(e,1)}function CD(e){return ME(e,-1)}function Al(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!ft(n,s)}function wD(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 DE(){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 _0{nodesRef={current:[]};events=DE();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 PE=R.createContext(null),jE=R.createContext(null),Ei=()=>R.useContext(PE)?.id||null,Co=e=>{const t=R.useContext(jE);return e??t};function IE(e){const t=Da(),n=Co(e),s=Ei();return Ve(()=>{if(!t)return;const o={id:t,parentId:s};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,s]),t}function ED(e){const{children:t,id:n}=e,s=Ei();return _.jsx(PE.Provider,{value:R.useMemo(()=>({id:n,parentId:s}),[n,s]),children:t})}function kD(e){const{children:t,externalTree:n}=e,s=Gn(()=>n??new _0).current;return _.jsx(jE.Provider,{value:s,children:t})}function Gl(e){return`data-base-ui-${e}`}function dv(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 RD{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 RD;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 lE(e.disposeEffect),e}function xr(e){return e?.ownerDocument||document}const $l=R.forwardRef(function(t,n){const[s,o]=R.useState();Ve(()=>{uE&&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={},fv=0;const NE=e=>e&&(e.host||NE(e.parentNode)),TD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=NE(n);return e.contains(s)?s:null}).filter(n=>n!=null);function LD(e,t,n,s){const o="data-base-ui-inert",u=s?"inert":n?"aria-hidden":null,h=TD(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",b=JS(u),v=(b.get(C)||0)+1,x=(p.get(C)||0)+1;b.set(C,v),p.set(C,x),d.push(C),v===1&&y&&Uf.add(C),x===1&&C.setAttribute(o,""),!y&&u&&C.setAttribute(u,u==="inert"?"":"true")}})}return fv+=1,()=>{d.forEach(S=>{const C=JS(u),y=(C.get(S)||0)-1,b=(p.get(S)||0)-1;C.set(S,y),p.set(S,b),y||(!Uf.has(S)&&u&&S.removeAttribute(u),Uf.delete(S)),b||S.removeAttribute(o)}),fv-=1,fv||(Ol.inert=new WeakMap,Ol["aria-hidden"]=new WeakMap,Ol.none=new WeakMap,Uf=new WeakSet,Wf={})}}function AD(e,t=!1,n=!1){const s=dn(e[0]).body;return LD(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const BE=R.createContext(null),zE=()=>R.useContext(BE),OD=Gl("portal");function MD(e={}){const{ref:t,container:n,componentProps:s=tn,elementProps:o,elementState:u}=e,h=Da(),l=zE()?.portalNode,[d,p]=R.useState(null),[f,g]=R.useState(null),S=R.useRef(null);Ve(()=>{if(n===null){S.current&&(S.current=null,g(null),p(null));return}if(h==null)return;const y=(n&&(Q_(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,[OD]:""},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}=MD({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),b=w?.modal,v=w?.open,x=typeof a=="boolean"?a:!!w&&!w.modal&&w.open&&!!d;R.useEffect(()=>{if(!d||b)return;function T(A){d&&Al(A)&&(A.type==="focusin"?QS:wD)(d)}return d.addEventListener("focusin",T,!0),d.addEventListener("focusout",T,!0),()=>{d.removeEventListener("focusin",T,!0),d.removeEventListener("focusout",T,!0)}},[d,b]),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(BE.Provider,{value:E,children:[x&&d&&_.jsx($l,{"data-type":"outside",ref:f,onFocus:T=>{if(Al(T,d))S.current?.focus();else{const A=w?w.domReference:null;OE(A)?.focus()}}}),x&&d&&_.jsx("span",{"aria-owns":d.id,style:dM}),d&&er.createPortal(s,d),x&&d&&_.jsx($l,{"data-type":"outside",ref:g,onFocus:T=>{if(Al(T,d))C.current?.focus();else{const A=w?w.domReference:null;v0(A)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Ue(ka,T.nativeEvent))}}})]})]})});function Qo(e){return e==null?e:"current"in e?e.current:e}function DD(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 y0(){io=io.filter(e=>e.isConnected)}function PD(e){y0(),e&&bo(e)!=="body"&&(io.push(e),io.length>eC&&(io=io.slice(-eC)))}function hv(){return y0(),io[io.length-1]}function jD(e){if(!e)return null;const t=sc();return LE(e,t)?e:nd(e,t)[0]||e}function ID(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=xD(e,n).filter(h=>{const a=h.getAttribute("data-tabindex")||"";return LE(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,b=y.useState("open"),v=y.useState("domReferenceElement"),x=y.useState("floatingElement"),{events:E,dataRef:T}=y.context,A=Pe(()=>T.current.floatingContext?.nodeId),M=Pe(f),L=u===!1,P=c_(v)&&L,z=hn(o),H=hn(u),q=hn(h),I=hn(p),K=Co(w),Y=zE(),V=R.useRef(null),$=R.useRef(null),G=R.useRef(!1),j=R.useRef(!1),U=R.useRef(!1),D=R.useRef(-1),N=R.useRef(""),W=R.useRef(""),Z=Qt(),ee=Qt(),te=rd(),X=Y!=null,F=Hu(x),se=Pe((ue=F)=>ue?nd(ue,sc()):[]),ne=Pe(ue=>{const de=se(ue);return z.current.map(()=>de).filter(Boolean).flat()});R.useEffect(()=>{if(s||!l)return;function ue(Ie){Ie.key==="Tab"&&ft(F,_s(dn(F)))&&se().length===0&&!P&&fn(Ie)}const de=dn(F);return de.addEventListener("keydown",ue),()=>{de.removeEventListener("keydown",ue)}},[s,v,F,l,z,P,se,ne]),R.useEffect(()=>{if(s||!x)return;function ue(de){const Ie=Pn(de),Oe=se().indexOf(Ie);Oe!==-1&&(D.current=Oe)}return x.addEventListener("focusin",ue),()=>{x.removeEventListener("focusin",ue)}},[s,x,se]),R.useEffect(()=>{if(s||!b)return;const ue=dn(F);function de(){U.current=!1}function Ie(Oe){const be=Pn(Oe),Me=ft(x,be)||ft(v,be)||ft(Y?.portalNode,be);U.current=!Me,W.current=Oe.pointerType||"keyboard"}function De(){W.current="keyboard"}return ue.addEventListener("pointerdown",Ie,!0),ue.addEventListener("pointerup",de,!0),ue.addEventListener("pointercancel",de,!0),ue.addEventListener("keydown",De,!0),()=>{ue.removeEventListener("pointerdown",Ie,!0),ue.removeEventListener("pointerup",de,!0),ue.removeEventListener("pointercancel",de,!0),ue.removeEventListener("keydown",De,!0)}},[s,x,v,F,b,Y]),R.useEffect(()=>{if(s||!d)return;function ue(){j.current=!0,ee.start(0,()=>{j.current=!1})}function de(be){const Me=be.relatedTarget,pe=be.currentTarget,Re=Pn(be);queueMicrotask(()=>{const we=A(),We=y.context.triggerElements,et=!(ft(v,Me)||ft(x,Me)||ft(Me,x)||ft(Y?.portalNode,Me)||Me!=null&&We.hasElement(Me)||We.hasMatchingElement(xe=>ft(xe,Me))||Me?.hasAttribute(Gl("focus-guard"))||K&&(ga(K.nodesRef.current,we).find(xe=>ft(xe.context?.elements.floating,Me)||ft(xe.context?.elements.domReference,Me))||$S(K.nodesRef.current,we).find(xe=>[xe.context?.elements.floating,Hu(xe.context?.elements.floating)].includes(Me)||xe.context?.elements.domReference===Me)));if(pe===v&&F&&tC(F,z),a&&pe!==v&&!ID(Re)&&_s(dn(F))===dn(F).body){if(en(F)&&(F.focus(),a==="popup")){te.request(()=>{F.focus()});return}const xe=D.current,Ge=se(),tt=Ge[xe]||Ge[Ge.length-1]||F;en(tt)&&tt.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(P||!l)&&Me&&et&&!j.current&&(P||Me!==hv())&&(G.current=!0,y.setOpen(!1,Ue(ka,be)))})}function Ie(){U.current||(T.current.insideReactTree=!0,Z.start(0,()=>{T.current.insideReactTree=!1}))}const De=en(v)?v:null,Oe=[];if(!(!x&&!De))return De&&(De.addEventListener("focusout",de),De.addEventListener("pointerdown",ue),Oe.push(()=>{De.removeEventListener("focusout",de),De.removeEventListener("pointerdown",ue)})),x&&(x.addEventListener("focusout",de),Y&&(x.addEventListener("focusout",Ie,!0),Oe.push(()=>{x.removeEventListener("focusout",Ie,!0)})),Oe.push(()=>{x.removeEventListener("focusout",de)})),()=>{Oe.forEach(be=>{be()})}},[s,v,x,F,l,K,Y,y,d,a,se,P,A,z,T,Z,ee,te]);const re=R.useRef(null),oe=R.useRef(null),le=cs(re,C,Y?.beforeInsideRef),ve=cs(oe,Y?.afterInsideRef);R.useEffect(()=>{if(s||!x||!b)return;const ue=Array.from(Y?.portalNode?.querySelectorAll(`[${Gl("portal")}]`)||[]),Ie=(K?$S(K.nodesRef.current,A()):[]).find(be=>c_(be.context?.elements.domReference||null))?.context?.elements.domReference,De=[x,Ie,...ue,...M(),V.current,$.current,re.current,oe.current,Y?.beforeOutsideRef.current,Y?.afterOutsideRef.current,Qo(S),Qo(g),P?v:null].filter(be=>be!=null),Oe=AD(De,l||P);return()=>{Oe()}},[b,s,v,x,l,z,Y,P,K,A,M,g,S]),Ve(()=>{if(!b||s||!en(F))return;const ue=dn(F),de=_s(ue);queueMicrotask(()=>{const Ie=ne(F),De=H.current,Oe=typeof De=="function"?De(I.current||""):De;if(Oe===void 0||Oe===!1)return;let be;Oe===!0||Oe===null?be=Ie[0]||F:be=Qo(Oe),be=be||Ie[0]||F,!ft(F,de)&&hh(be,{preventScroll:be===F})})},[s,b,F,L,ne,H,I]),Ve(()=>{if(s||!F)return;const ue=dn(F),de=_s(ue);PD(de);function Ie(be){if(be.open||(N.current=DD(be.nativeEvent,W.current)),be.reason===Br&&be.nativeEvent.type==="mouseleave"&&(G.current=!0),be.reason===c0)if(be.nested)G.current=!1;else if(mE(be.nativeEvent)||gE(be.nativeEvent))G.current=!1;else{let Me=!1;document.createElement("div").focus({get preventScroll(){return Me=!0,!1}}),Me?G.current=!1:G.current=!0}}E.on("openchange",Ie);const De=ue.createElement("span");De.setAttribute("tabindex","-1"),De.setAttribute("aria-hidden","true"),Object.assign(De.style,ic),X&&v&&v.insertAdjacentElement("afterend",De);function Oe(){const be=q.current;let Me=typeof be=="function"?be(N.current):be;if(Me===void 0||Me===!1)return null;if(Me===null&&(Me=!0),typeof Me=="boolean"){const Re=v||hv();return Re&&Re.isConnected?Re:De}const pe=v||hv()||De;return Qo(Me)||pe}return()=>{E.off("openchange",Ie);const be=_s(ue),Me=ft(x,be)||K&&ga(K.nodesRef.current,A(),!1).some(Re=>ft(Re.context?.elements.floating,be)),pe=Oe();queueMicrotask(()=>{const Re=jD(pe),we=typeof q.current!="boolean";q.current&&!G.current&&en(Re)&&(!(!we&&Re!==be&&be!==ue.body)||Me)&&Re.focus({preventScroll:!0}),De.remove()})}},[s,x,F,q,T,E,K,X,v,A]),R.useEffect(()=>{queueMicrotask(()=>{G.current=!1})},[s]),R.useEffect(()=>{if(s||!b)return;function ue(Ie){Pn(Ie)?.closest(`[${P2}]`)&&(j.current=!0)}const de=dn(F);return de.addEventListener("pointerdown",ue,!0),()=>{de.removeEventListener("pointerdown",ue,!0)}},[s,b,F]),Ve(()=>{if(!s&&Y)return Y.setFocusManagerState({modal:l,closeOnFocusOut:d,open:b,onOpenChange:y.setOpen,domReference:v}),()=>{Y.setFocusManagerState(null)}},[s,Y,l,b,y,d,v]),Ve(()=>{if(!(s||!F))return tC(F,z),()=>{queueMicrotask(y0)}},[s,F,z]);const ge=!s&&(l?!P:!0)&&(X||l);return _.jsxs(R.Fragment,{children:[ge&&_.jsx($l,{"data-type":"inside",ref:le,onFocus:ue=>{if(l){const de=ne();hh(de[de.length-1])}else Y?.portalNode&&(G.current=!1,Al(ue,Y.portalNode)?v0(v)?.focus():Qo(S??Y.beforeOutsideRef)?.focus())}}),n,ge&&_.jsx($l,{"data-type":"inside",ref:ve,onFocus:ue=>{l?hh(ne()[0]):Y?.portalNode&&(d&&(G.current=!0),Al(ue,Y.portalNode)?OE(v)?.focus():Qo(g??Y.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,b=n.select("open");if(C.button!==0||u==="click"||Ul(w,!0)&&a)return;const v=s.current.openEvent,x=v?.type,E=n.select("domReferenceElement")!==C.currentTarget,T=b&&E||!(b&&h&&(!(v&&l)||x==="click"||x==="mousedown"));if(h0(y.target)){const M=Ue(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=Ue(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"),b=s.current.openEvent,v=n.select("domReferenceElement")!==C.currentTarget,x=y&&v||!(y&&h&&(!(b&&l)||vE(b))),E=Ue(pa,C.nativeEvent,C.currentTarget);x&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,E)}):n.setOpen(x,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=g0(t),a=m0(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 ND=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:b}=a[w],{x:v,y:x,data:E,reset:T}=await b({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=x??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=_E(S),y=a[g?f==="floating"?"reference":"floating":f],b=Ih(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,x=await(u.getOffsetParent==null?void 0:u.getOffsetParent(a.floating)),E=await(u.isElement==null?void 0:u.isElement(x))?await(u.getScale==null?void 0:u.getScale(x))||{x:1,y:1}:{x:1,y:1},T=Ih(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:l}):v);return{top:(b.top-T.top+C.top)/E.y,bottom:(T.bottom-b.bottom+C.bottom)/E.y,left:(b.left-T.left+C.left)/E.x,right:(T.right-b.right+C.right)/E.x}}const BD=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 b=Hr(o),v=rs(a),x=Hr(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(d.floating)),T=g||(x||!w?[jh(a)]:tD(a)),A=C!=="none";!g&&A&&T.push(...iD(a,w,C,E));const M=[a,...T],L=await Fu(t,y),P=[];let z=((s=u.flip)==null?void 0:s.overflows)||[];if(p&&P.push(L[b]),f){const K=eD(o,h,E);P.push(L[K[0]],L[K[1]])}if(z=[...z,{placement:o,overflows:P}],!P.every(K=>K<=0)){var H,q;const K=(((H=u.flip)==null?void 0:H.index)||0)+1,Y=M[K];if(Y&&(!(f==="alignment"?v!==rs(Y):!1)||z.every(G=>rs(G.placement)===v?G.overflows[0]>0:!0)))return{data:{index:K,overflows:z},reset:{placement:Y}};let V=(q=z.filter($=>$.overflows[0]<=0).sort(($,G)=>$.overflows[1]-G.overflows[1])[0])==null?void 0:q.placement;if(!V)switch(S){case"bestFit":{var I;const $=(I=z.filter(G=>{if(A){const j=rs(G.placement);return j===v||j==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(j=>j>0).reduce((j,U)=>j+U,0)]).sort((G,j)=>G[1]-j[1])[0])==null?void 0:I[0];$&&(V=$);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}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 X4.some(t=>e[t]>=0)}const zD=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{}}}}},HE=new Set(["left","top"]);async function HD(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=HE.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 VD=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 HD(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}}}}},FD=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:b,y:v}=y;return{x:b,y:v}}},...l}=Si(e,t),d={x:n,y:s},p=await Fu(t,l),f=rs(Hr(o)),g=p0(f);let S=d[g],C=d[f];if(u){const y=g==="y"?"top":"left",b=g==="y"?"bottom":"right",v=S+p[y],x=S-p[b];S=u_(v,S,x)}if(h){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=C+p[y],x=C-p[b];C=u_(v,C,x)}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}}}}}},UD=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=p0(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 x=g==="y"?"height":"width",E=u.reference[g]-u.floating[x]+y.mainAxis,T=u.reference[g]+u.reference[x]-y.mainAxis;S<E?S=E:S>T&&(S=T)}if(d){var b,v;const x=g==="y"?"width":"height",E=HE.has(Hr(o)),T=u.reference[f]-u.floating[x]+(E&&((b=h.offset)==null?void 0:b[f])||0)+(E?0:y.crossAxis),A=u.reference[f]+u.reference[x]+(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}}}},WD=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,b;f==="top"||f==="bottom"?(y=f,b=g===(await(h.isRTL==null?void 0:h.isRTL(a.floating))?"start":"end")?"left":"right"):(b=f,y=g==="end"?"top":"bottom");const v=w-p.top-p.bottom,x=C-p.left-p.right,E=Wl(w-p[y],v),T=Wl(C-p[b],x),A=!t.middlewareData.shift;let M=E,L=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=x),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(M=v),A&&!g){const z=Nr(p.left,0),H=Nr(p.right,0),q=Nr(p.top,0),I=Nr(p.bottom,0);S?L=C-2*(z!==0||H!==0?z+H:Nr(p.left,p.right)):M=w-2*(q!==0||I!==0?q+I:Nr(p.top,p.bottom))}await l({...t,availableWidth:L,availableHeight:M});const P=await h.getDimensions(a.floating);return C!==P.width||w!==P.height?{reset:{rects:!0}}:{}}}};function VE(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 b0(e){return Nt(e)?e:e.contextElement}function Ml(e){const t=b0(e);if(!en(t))return Vs(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:u}=VE(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 qD=Vs(0);function FE(e){const t=kn(e);return!cp()||!t.visualViewport?qD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function GD(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=b0(e);let h=Vs(1);t&&(s?Nt(s)&&(h=Ml(s)):h=Ml(e));const a=GD(u,n,s)?FE(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=Xv(C);for(;w&&s&&S!==C;){const y=Ml(w),b=w.getBoundingClientRect(),v=Vr(w),x=b.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,E=b.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,d*=y.y,p*=y.x,f*=y.y,l+=x,d+=E,C=kn(w),w=Xv(C)}}return Ih({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 UE(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 $D(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?UE(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 KD(e){return Array.from(e.getClientRects())}function YD(e){const t=qs(e),n=up(e),s=e.ownerDocument.body,o=Nr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=Nr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let h=-n.scrollLeft+mp(e);const a=-n.scrollTop;return Vr(s).direction==="rtl"&&(h+=Nr(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:h,y:a}}const iC=25;function XD(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 QD=new Set(["absolute","fixed"]);function ZD(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=XD(e,n);else if(t==="document")s=YD(qs(e));else if(Nt(t))s=ZD(t,n);else{const o=FE(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ih(s)}function WE(e,t){const n=Us(e);return n===t||!Nt(n)||Hs(n)?!1:Vr(n).position==="fixed"||WE(n,t)}function JD(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=Z_(h);!l&&a.position==="fixed"&&(o=null),(u?!l&&!o:!l&&a.position==="static"&&!!o&&QD.has(o.position)||Aa(h)&&!l&&WE(e,h))?s=s.filter(p=>p!==h):o=a,h=Us(h)}return t.set(e,s),s}function e6(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const h=[...n==="clippingAncestors"?lp(t)?[]:JD(t,this._c):[].concat(n),s],a=h[0],l=h.reduce((d,p)=>{const f=oC(t,p,o);return d.top=Nr(f.top,d.top),d.right=Wl(f.right,d.right),d.bottom=Wl(f.bottom,d.bottom),d.left=Nr(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 t6(e){const{width:t,height:n}=VE(e);return{width:t,height:n}}function n6(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?UE(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 pv(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 qE(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)&&!pv(o))return o;o=Us(o)}return n}let s=aC(e,t);for(;s&&IO(s)&&pv(s);)s=aC(s,t);return s&&Hs(s)&&pv(s)&&!Z_(s)?n:s||VO(e)||n}const r6=async function(e){const t=this.getOffsetParent||qE,n=this.getDimensions,s=await n(e.floating);return{reference:n6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function s6(e){return Vr(e).direction==="rtl"}const i6={convertOffsetParentRelativeRectToViewportRelativeRect:$D,getDocumentElement:qs,getClippingRect:e6,getOffsetParent:qE,getElementRects:r6,getClientRects:KD,getDimensions:t6,getScale:Ml,isElement:Nt,isRTL:s6};function GE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function o6(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)),b=kl(p),x={rootMargin:-C+"px "+-w+"px "+-y+"px "+-b+"px",threshold:Nr(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&&!GE(d,e.getBoundingClientRect())&&h(),E=!1}try{n=new IntersectionObserver(T,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,x)}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=b0(e),p=o||u?[...d?fo(d):[],...fo(t)]:[];p.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});const f=d&&a?o6(d,n):null;let g=-1,S=null;h&&(S=new ResizeObserver(b=>{let[v]=b;v&&v.target===d&&S&&(S.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=S)==null||x.observe(t)})),n()}),d&&!l&&S.observe(d),S.observe(t));let C,w=l?Ta(e):null;l&&y();function y(){const b=Ta(e);w&&!GE(w,b)&&n(),w=b,C=requestAnimationFrame(y)}return n(),()=>{var b;p.forEach(v=>{o&&v.removeEventListener("scroll",n),u&&v.removeEventListener("resize",n)}),f?.(),(b=S)==null||b.disconnect(),S=null,l&&cancelAnimationFrame(C)}}const a6=VD,l6=FD,c6=BD,u6=WD,d6=zD,f6=UD,h6=(e,t,n)=>{const s=new Map,o={platform:i6,...n},u={...o.platform,_c:s};return ND(e,t,{...o,platform:u})};var p6=typeof document<"u",m6=function(){},ph=p6?R.useLayoutEffect:m6;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 $E(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cC(e,t){const n=$E(e);return Math.round(t*n)/n}function mv(e){const t=R.useRef(e);return ph(()=>{t.current=e}),t}function g6(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,b]=R.useState(null),v=R.useCallback(G=>{G!==A.current&&(A.current=G,w(G))},[]),x=R.useCallback(G=>{G!==M.current&&(M.current=G,b(G))},[]),E=u||C,T=h||y,A=R.useRef(null),M=R.useRef(null),L=R.useRef(p),P=l!=null,z=mv(l),H=mv(o),q=mv(d),I=R.useCallback(()=>{if(!A.current||!M.current)return;const G={placement:t,strategy:n,middleware:g};H.current&&(G.platform=H.current),h6(A.current,M.current,G).then(j=>{const U={...j,isPositioned:q.current!==!1};K.current&&!Hh(L.current,U)&&(L.current=U,er.flushSync(()=>{f(U)}))})},[g,t,n,H,q]);ph(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(G=>({...G,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(z.current)return z.current(E,T,I);I()}},[E,T,I,z,P]);const Y=R.useMemo(()=>({reference:A,floating:M,setReference:v,setFloating:x}),[v,x]),V=R.useMemo(()=>({reference:E,floating:T}),[E,T]),$=R.useMemo(()=>{const G={position:n,left:0,top:0};if(!V.floating)return G;const j=cC(V.floating,p.x),U=cC(V.floating,p.y);return a?{...G,transform:"translate("+j+"px, "+U+"px)",...$E(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:U}},[n,a,V.floating,p.x,p.y]);return R.useMemo(()=>({...p,update:I,refs:Y,elements:V,floatingStyles:$}),[p,I,Y,V,$])}const v6=(e,t)=>({...a6(e),options:[e,t]}),_6=(e,t)=>({...l6(e),options:[e,t]}),y6=(e,t)=>({...f6(e),options:[e,t]}),b6=(e,t)=>({...c6(e),options:[e,t]}),x6=(e,t)=>({...u6(e),options:[e,t]}),S6=(e,t)=>({...d6(e),options:[e,t]}),C6={intentional:"onClick",sloppy:"onPointerDown"};function w6(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:b}=t,v=Co(b),x=Pe(typeof f=="function"?f:()=>!1),E=typeof f=="function"?x:f,T=R.useRef(!1),{escapeKey:A,outsidePress:M}=w6(y),L=R.useRef(null),P=Qt(),z=Qt(),H=Pe(()=>{z.clear(),l.current.insideReactTree=!1}),q=R.useRef(!1),I=R.useRef(""),K=Pe(re=>{I.current=re.pointerType}),Y=Pe(()=>{const re=I.current,oe=re==="pen"||!re?"mouse":re,le=typeof g=="function"?g():g;return typeof le=="string"?le:le[oe]}),V=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 ue=!0;if(le.forEach(de=>{de.context?.open&&!de.context.dataRef.current.__escapeKeyBubbles&&(ue=!1)}),!ue)return}const ve=Y4(re)?re.nativeEvent:re,ge=Ue(dp,ve);n.setOpen(!1,ge),!A&&!ge.isPropagationAllowed&&re.stopPropagation()}),$=Pe(re=>{const oe=Y();return oe==="intentional"&&re.type!=="click"||oe==="sloppy"&&re.type==="click"}),G=Pe(()=>{l.current.insideReactTree=!0,z.start(0,H)}),j=Pe((re,oe=!1)=>{if($(re)){H();return}if(l.current.insideReactTree){H();return}if(Y()==="intentional"&&oe||typeof E=="function"&&!E(re))return;const le=Pn(re),ve=`[${Gl("inert")}]`,ge=dn(n.select("floatingElement")).querySelectorAll(ve),ue=n.context.triggerElements;if(le&&(ue.hasElement(le)||ue.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(ge.length&&Nt(le)&&!$4(le)&&!ft(le,n.select("floatingElement"))&&Array.from(ge).every(be=>!ft(de,be)))return;if(en(le)&&!("touches"in re)){const be=Hs(le),Me=Vr(le),pe=/auto|scroll/,Re=be||pe.test(Me.overflowX),we=be||pe.test(Me.overflowY),We=Re&&le.clientWidth>0&&le.scrollWidth>le.clientWidth,et=we&&le.clientHeight>0&&le.scrollHeight>le.clientHeight,xe=Me.direction==="rtl",Ge=et&&(xe?re.offsetX<=le.offsetWidth-le.clientWidth:re.offsetX>le.clientWidth),tt=We&&re.offsetY>le.clientHeight;if(Ge||tt)return}const Ie=l.current.floatingContext?.nodeId,De=v&&ga(v.nodesRef.current,Ie).some(be=>vs(re,be.context?.elements.floating));if(vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement"))||De)return;const Oe=v?ga(v.nodesRef.current,Ie):[];if(Oe.length>0){let be=!0;if(Oe.forEach(Me=>{Me.context?.open&&!Me.context.dataRef.current.__outsidePressBubbles&&(be=!1)}),!be)return}n.setOpen(!1,Ue(c0,re)),H()}),U=Pe(re=>{Y()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!d||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement"))||j(re)}),D=Pe(re=>{if(Y()!=="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},P.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),N=Pe(re=>{const oe=Pn(re);function le(){D(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)}),W=Pe(re=>{const oe=T.current;if(T.current=!1,P.clear(),re.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const le=Pn(re);function ve(){re.type==="pointerdown"?U(re):j(re,oe),le?.removeEventListener(re.type,ve)}le?.addEventListener(re.type,ve)}),Z=Pe(re=>{if(Y()!=="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),ge=Math.sqrt(le*le+ve*ve);ge>5&&(L.current.dismissOnTouchEnd=!0),ge>10&&(j(re),P.clear(),L.current=null)}),ee=Pe(re=>{const oe=Pn(re);function le(){Z(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)}),te=Pe(re=>{Y()!=="sloppy"||!L.current||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&j(re),P.clear(),L.current=null)}),X=Pe(re=>{const oe=Pn(re);function le(){te(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,Ue(Mn,de))}function le(){re.clear(),q.current=!0}function ve(){re.start(cp()?5:0,()=>{q.current=!1})}const ge=dn(o);ge.addEventListener("pointerdown",K,!0),p&&(ge.addEventListener("keydown",V),ge.addEventListener("compositionstart",le),ge.addEventListener("compositionend",ve)),E&&(ge.addEventListener("click",W,!0),ge.addEventListener("pointerdown",W,!0),ge.addEventListener("touchstart",N,!0),ge.addEventListener("touchmove",ee,!0),ge.addEventListener("touchend",X,!0),ge.addEventListener("mousedown",W,!0));let ue=[];return w&&(Nt(h)&&(ue=fo(h)),Nt(o)&&(ue=ue.concat(fo(o))),!Nt(u)&&u&&u.contextElement&&(ue=ue.concat(fo(u.contextElement)))),ue=ue.filter(de=>de!==ge.defaultView?.visualViewport),ue.forEach(de=>{de.addEventListener("scroll",oe,{passive:!0})}),()=>{ge.removeEventListener("pointerdown",K,!0),p&&(ge.removeEventListener("keydown",V),ge.removeEventListener("compositionstart",le),ge.removeEventListener("compositionend",ve)),E&&(ge.removeEventListener("click",W,!0),ge.removeEventListener("pointerdown",W,!0),ge.removeEventListener("touchstart",N,!0),ge.removeEventListener("touchmove",ee,!0),ge.removeEventListener("touchend",X,!0),ge.removeEventListener("mousedown",W,!0)),ue.forEach(de=>{de.removeEventListener("scroll",oe)}),re.clear()}},[l,o,u,h,p,E,s,a,w,d,A,M,V,j,W,U,N,ee,X,K,n]),R.useEffect(H,[E,H]);const F=R.useMemo(()=>({onKeyDown:V,...S&&{[C6[C]]:re=>{n.setOpen(!1,Ue(pa,re.nativeEvent))},...C!=="intentional"&&{onClick(re){n.setOpen(!1,Ue(pa,re.nativeEvent))}}}}),[V,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:V,onPointerDown:se,onMouseDown:se,onMouseUp:se,onClickCapture:G,onMouseDownCapture:G,onPointerDownCapture:G,onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[V,se,G]);return R.useMemo(()=>d?{reference:F,floating:ne,trigger:F}:{},[d,F,ne])}var Vh=Symbol("NOT_FOUND");function E6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function k6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function R6(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 T6(e){const t=Array.isArray(e[0])?e[0]:e;return R6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function L6(e,t){const n=[],{length:s}=e;for(let o=0;o<s;o++)n.push(e[o].apply(null,t));return n}function A6(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 O6(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 M6=(e,t)=>e===t;function D6(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 P6(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=M6,maxSize:o=1,resultEqualityCheck:u}=n,h=D6(s);let a=0;const l=o<=1?A6(h):O6(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 j6=class{constructor(e){this.value=e}deref(){return this.value}},I6=typeof WeakRef<"u"?WeakRef:j6,N6=0,dC=1;function qf(){return{s:N6,v:void 0,o:null,p:null}}function KE(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 I6(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 YE(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()),E6(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const p={...n,...l},{memoize:f,memoizeOptions:g=[],argsMemoize:S=KE,argsMemoizeOptions:C=[]}=p,w=uC(g),y=uC(C),b=T6(o),v=f(function(){return u++,d.apply(null,arguments)},...w),x=S(function(){h++;const T=L6(b,arguments);return a=v.apply(null,T),a},...y);return Object.assign(x,{resultFunc:d,memoizedResultFunc:v,dependencies:b,dependencyRecomputations:()=>h,resetDependencyRecomputations:()=>{h=0},lastResult:()=>a,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:f,argsMemoize:S})};return Object.assign(s,{withTypes:()=>s}),s}var B6=YE(KE),z6=Object.assign((e,t=B6)=>{k6(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:()=>z6});YE({memoize:P6,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ee=(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 H6=d2();const V6=e0(19),F6=V6?U6:W6;function Ae(e,t,n,s,o){return F6(e,t,n,s,o)}function U6(e,t,n,s,o){const u=R.useCallback(()=>t(e.getSnapshot(),n,s,o),[e,t,n,s,o]);return H6.useSyncExternalStore(e.subscribe,u,u)}function W6(e,t,n,s,o){return f2.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 x0 extends va{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}controlledValues=new Map;useSyncedValue(t,n){R.useDebugValue(t),Ve(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){Ve(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){const n=Object.values(t);Ve(()=>{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})),Ve(()=>{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 Ae(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 q6={open:Ee(e=>e.open),domReferenceElement:Ee(e=>e.domReferenceElement),referenceElement:Ee(e=>e.positionReference??e.referenceElement),floatingElement:Ee(e=>e.floatingElement),floatingId:Ee(e=>e.floatingId)};class S0 extends x0{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:DE(),nested:n,noEmit:s,triggerElements:u},q6)}setOpen=(t,n)=>{if((!t||!this.state.open||vE(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),Ve(()=>{if(!e&&u&&s!=="ending"&&n){const a=Ns.request(()=>{o("ending")});return()=>{Ns.cancel(a)}}},[e,u,s,n]),Ve(()=>{if(!e||t)return;const a=Ns.request(()=>{o(void 0)});return()=>{Ns.cancel(a)}},[t,e]),Ve(()=>{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 G6(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=G6(s,n);R.useEffect(()=>{t&&a(()=>{n===u.current&&h()})},[t,n,h,a,u])}function $6(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 XE(e,t,n,s){const o=n.useState("isMountedByTrigger",e),u=$6(e,n),h=Pe(a=>{u(a),a!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...s})});return Ve(()=>{o&&n.update({activeTriggerElement:t.current,...s})},[o,n,t,...Object.values(s)]),{registerTrigger:h,isMountedByThisTrigger:o}}function QE(e){const t=e.useState("open");Ve(()=>{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 ZE(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 K6(){return new S0({open:!1,floatingElement:null,referenceElement:null,triggerElements:new vp,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function JE(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:K6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:tn,inactiveTriggerProps:tn,popupProps:tn}}const ek={open:Ee(e=>e.open),mounted:Ee(e=>e.mounted),transitionStatus:Ee(e=>e.transitionStatus),floatingRootContext:Ee(e=>e.floatingRootContext),preventUnmountingOnClose:Ee(e=>e.preventUnmountingOnClose),payload:Ee(e=>e.payload),activeTriggerId:Ee(e=>e.activeTriggerId),activeTriggerElement:Ee(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ee((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:Ee((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:Ee((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:Ee((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Ee(e=>e.popupProps),popupElement:Ee(e=>e.popupElement),positionerElement:Ee(e=>e.positionerElement)};function C0(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,o=Da(),u=Ei()!=null,h=Gn(()=>new S0({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 Ve(()=>{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 Y6(e={}){const{nodeId:t,externalTree:n}=e,s=C0(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);Ve(()=>{u.domReference&&(l.current=u.domReference)},[u.domReference]);const p=g6({...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]),b=R.useCallback(M=>{w(M),p.refs.setFloating(M)},[p.refs]),v=R.useMemo(()=>({...p.refs,setReference:y,setFloating:b,setPositionReference:f,domReference:l}),[p.refs,y,b,f]),x=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:x,nodeId:t,rootStore:o}),[p,v,x,t,o,E,T]);return Ve(()=>{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:x,rootStore:o}),[p,v,x,A,o])}function tk(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 S0({open:a,referenceElement:l,floatingElement:d,triggerElements:p,onOpenChange:o,floatingId:u,nested:h,noEmit:n})).current;return Ve(()=>{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 gv=U4&&uE;function X6(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),gv&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",w,!0)),()=>{g.removeEventListener("blur",S),gv&&(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(gv&&!f.relatedTarget){if(!d.current&&!h0(g))return}else if(!K4(g))return}n.setOpen(!0,Ue(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,Ue(Mh,S))})}}),[o,n,h,l]);return R.useMemo(()=>u?{reference:p,trigger:p}:{},[u,p])}const m_=Gl("safe-polygon"),Q6=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${pE}`;function Z6(e){return e?!!e.closest(Q6):!1}function nk(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 J6=new Set(["click","mousedown"]);function e8(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:b}=nk(n),v=Co(d),x=Ei(),E=Pe(()=>f.current?!0:h.current.openEvent?J6.has(h.current.openEvent.type):!1),T=Pe(()=>{const z=h.current.openEvent?.type;return z?.includes("mouse")&&z!=="mousedown"}),A=R.useCallback((z,H=!0)=>{const q=t8(l,p.current);q&&!g.current?y.start(q,()=>n.setOpen(!1,Ue(Br,z))):H&&(y.clear(),n.setOpen(!1,Ue(Br,z)))},[l,g,n,p,y]),M=Pe(()=>{C.current(),g.current=void 0}),L=Pe(()=>{if(S.current){const z=dn(o).body;z.style.pointerEvents="",z.removeAttribute(m_),S.current=!1}}),P=Pe(z=>{const H=Pn(z);if(!Z6(H)){f.current=!1;return}f.current=!0});Ve(()=>{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]),Ve(()=>{if(a&&s&&b.current?.blockPointerEvents&&T()&&Nt(u)&&o){S.current=!0;const z=dn(o).body;z.setAttribute(m_,"");const H=u,q=o,I=v?.nodesRef.current.find(K=>K.id===x)?.context?.elements.floating;return I&&(I.style.pointerEvents=""),z.style.pointerEvents="none",H.style.pointerEvents="auto",q.style.pointerEvents="auto",()=>{z.style.pointerEvents="",H.style.pointerEvents="",q.style.pointerEvents=""}}},[a,s,u,o,b,T,v,x,S]),R.useEffect(()=>{if(!a)return;function z(K){if(E()||!h.current.floatingContext||!n.select("open"))return;const Y=n.context.triggerElements;K.relatedTarget&&Y.hasElement(K.relatedTarget)||(L(),M(),E()||A(K))}function H(K){y.clear(),L(),g.current?.(K),M()}function q(K){E()||A(K,!1)}const I=o;return I&&(I.addEventListener("mouseleave",z),I.addEventListener("mouseenter",H),I.addEventListener("mouseleave",q),I.addEventListener("pointerdown",P,!0)),()=>{I&&(I.removeEventListener("mouseleave",z),I.removeEventListener("mouseenter",H),I.removeEventListener("mouseleave",q),I.removeEventListener("pointerdown",P,!0))}})}function t8(e,t){return t&&!Ul(t)?0:typeof e=="function"?e():e}function vv(e){return typeof e=="function"?e():e}const n8={current:null};function r8(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=n8,externalTree:g,isActiveTrigger:S=!0}=t,C=Co(g),{pointerTypeRef:w,interactedInsideRef:y,handlerRef:b,blockMouseMoveRef:v,performedPointerEventsMutationRef:x,unbindMouseMoveRef:E,restTimeoutPendingRef:T,openChangeTimeout:A,restTimeout:M,handleCloseOptionsRef:L}=nk(n),P=hn(a),z=hn(h),H=hn(d);S&&(L.current=P.current?.__options);const q=Pe(()=>y.current?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),I=R.useCallback(($,G=!0)=>{const j=dv(z.current,"close",w.current);j&&!b.current?A.start(j,()=>n.setOpen(!1,Ue(Br,$))):G&&(A.clear(),n.setOpen(!1,Ue(Br,$)))},[z,b,n,w,A]),K=Pe(()=>{E.current(),b.current=void 0}),Y=Pe(()=>{if(x.current){const $=dn(n.select("domReferenceElement")).body;$.style.pointerEvents="",$.removeAttribute(m_),x.current=!1}});R.useEffect(()=>{if(!u)return;function $(G){G.open||(A.clear(),M.clear(),v.current=!0,T.current=!1)}return o.on("openchange",$),()=>{o.off("openchange",$)}},[u,o,A,M,v,T]);const V=Pe($=>{if(q()||!s.current.floatingContext)return;const G=n.context.triggerElements;if($.relatedTarget&&G.hasElement($.relatedTarget))return;const j=f.current;P.current?.({...s.current.floatingContext,tree:C,x:$.clientX,y:$.clientY,onClose(){Y(),K(),!q()&&j===n.select("domReferenceElement")&&I($)}})($)});return R.useEffect(()=>{if(!u)return;const $=f.current??(S?n.select("domReferenceElement"):null);if(!Nt($))return;function G(D){if(A.clear(),v.current=!1,l&&!Ul(w.current)||vv(H.current)>0&&!dv(z.current,"open"))return;const N=dv(z.current,"open",w.current),W=n.select("domReferenceElement"),Z=n.context.triggerElements,ee=(Z.hasElement(D.target)||Z.hasMatchingElement(F=>ft(F,D.target)))&&(!W||!ft(W,D.target)),te=D.currentTarget??null,X=!n.select("open")||ee;N?A.start(N,()=>{X&&n.setOpen(!0,Ue(Br,D,te))}):X&&n.setOpen(!0,Ue(Br,D,te))}function j(D){if(q()){Y();return}E.current();const N=n.select("domReferenceElement"),W=dn(N);M.clear(),T.current=!1;const Z=n.context.triggerElements;if(D.relatedTarget&&Z.hasElement(D.relatedTarget))return;if(P.current&&s.current.floatingContext){n.select("open")||A.clear();const te=f.current;b.current=P.current({...s.current.floatingContext,tree:C,x:D.clientX,y:D.clientY,onClose(){Y(),K(),!q()&&te===n.select("domReferenceElement")&&I(D,!0)}});const X=b.current;X(D),W.addEventListener("mousemove",X),E.current=()=>{W.removeEventListener("mousemove",X)};return}(w.current!=="touch"||!ft(n.select("floatingElement"),D.relatedTarget))&&I(D)}function U(D){V(D)}return n.select("open")&&$.addEventListener("mouseleave",U),p&&$.addEventListener("mousemove",G,{once:!0}),$.addEventListener("mouseenter",G),$.addEventListener("mouseleave",j),()=>{$.removeEventListener("mouseleave",U),p&&$.removeEventListener("mousemove",G),$.removeEventListener("mouseenter",G),$.removeEventListener("mouseleave",j)}},[K,Y,v,s,z,I,n,u,P,V,S,q,l,p,w,H,M,T,A,f,C,E,b]),R.useMemo(()=>{function $(G){w.current=G.pointerType}return{onPointerDown:$,onPointerEnter:$,onMouseMove(G){const{nativeEvent:j}=G,U=G.currentTarget,D=n.select("domReferenceElement"),N=n.context.triggerElements,W=n.select("open"),Z=(N.hasElement(G.target)||N.hasMatchingElement(te=>ft(te,G.target)))&&(!D||!ft(D,G.target));if(l&&!Ul(w.current)||W&&!Z||vv(H.current)===0||!Z&&T.current&&G.movementX**2+G.movementY**2<2)return;M.clear();function ee(){!v.current&&(!W||Z)&&n.setOpen(!0,Ue(Br,j,U))}w.current==="touch"?er.flushSync(()=>{ee()}):Z&&W?ee():(T.current=!0,M.start(vv(H.current),ee))}}},[v,l,n,w,H,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[l_]="");for(const h in e)o&&e&&(h===fE||h===hE)||(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===fE||o===hE)||(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 s8="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===f0||e===td,e===ho||e===po)}function _v(e,t,n){return _p(t,e===td,n?e===ho:e===po)||e==="Enter"||e===" "||e===""}function i8(e,t,n){return _p(t,n?e===ho:e===po,e===td)}function o8(e,t,n,s){const o=n?e===po:e===ho,u=e===f0;return t==="both"||t==="horizontal"&&s&&s>1?e===s8:_p(t,o,u)}function w0(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:b="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:x=!0,disabledIndices:E=void 0,orientation:T="vertical",parentOrientation:A,cols:M=1,scrollItemIntoView:L=!0,itemSizes:P,dense:z=!1,id:H,resetOnPointerLeave:q=!0,externalTree:I}=t,K=Hu(o),Y=hn(K),V=Ei(),$=Co(I);Ve(()=>{h.current.orientation=T},[h,T]);const G=c_(u),j=R.useRef(b),U=R.useRef(f??-1),D=R.useRef(null),N=R.useRef(!0),W=Pe(pe=>{d(U.current===-1?null:U.current,pe)}),Z=R.useRef(W),ee=R.useRef(!!o),te=R.useRef(s),X=R.useRef(!1),F=R.useRef(!1),se=hn(E),ne=hn(s),re=hn(L),oe=hn(f),le=hn(q),ve=Pe(()=>{function pe(et){y?$?.events.emit("virtualfocus",et):hh(et,{sync:X.current,preventScroll:!0})}const Re=a.current[U.current],we=F.current;Re&&pe(Re),(X.current?et=>et():requestAnimationFrame)(()=>{const et=a.current[U.current]||Re;if(!et)return;Re||pe(et);const xe=re.current;xe&&ue&&(we||!N.current)&&et.scrollIntoView?.(typeof xe=="boolean"?{block:"nearest",inline:"nearest"}:xe)})});Ve(()=>{p&&(s&&o?(U.current=f??-1,j.current&&f!=null&&(F.current=!0,W())):ee.current&&(U.current=-1,Z.current()))},[p,s,o,f,W]),Ve(()=>{if(p){if(!s){X.current=!1;return}if(o)if(l==null){if(X.current=!1,oe.current!=null)return;if(ee.current&&(U.current=-1,ve()),(!te.current||!ee.current)&&j.current&&(D.current!=null||j.current===!0&&D.current==null)){let pe=0;const Re=()=>{a.current[0]==null?(pe<2&&(pe?requestAnimationFrame:queueMicrotask)(Re),pe+=1):(U.current=D.current==null||_v(D.current,T,w)||C?fh(a):f_(a),D.current=null,W())};Re()}}else Ll(a,l)||(U.current=l,ve(),F.current=!1)}},[p,s,o,l,oe,C,a,T,w,W,ve,se]),Ve(()=>{if(!p||o||!$||y||!ee.current)return;const pe=$.nodesRef.current,Re=pe.find(et=>et.id===V)?.context?.elements.floating,we=_s(dn(o)),We=pe.some(et=>et.context&&ft(et.context.elements.floating,we));Re&&!We&&N.current&&Re.focus({preventScroll:!0})},[p,o,$,V,y]),Ve(()=>{Z.current=W,te.current=s,ee.current=!!o}),Ve(()=>{s||(D.current=null,j.current=b)},[s,b]);const ge=l!=null,ue=R.useMemo(()=>{function pe(we){if(!ne.current)return;const We=a.current.indexOf(we.currentTarget);We!==-1&&U.current!==We&&(U.current=We,W(we))}return{onFocus(we){X.current=!0,pe(we)},onClick:({currentTarget:we})=>we.focus({preventScroll:!0}),onMouseMove(we){X.current=!0,F.current=!1,v&&pe(we)},onPointerLeave(we){if(!ne.current||!N.current||we.pointerType==="touch")return;X.current=!0;const We=we.relatedTarget;!v||a.current.includes(We)||le.current&&(U.current=-1,W(we),y||Y.current?.focus({preventScroll:!0}))}}},[ne,Y,v,a,W,le,y]),de=R.useCallback(()=>A??$?.nodesRef.current.find(pe=>pe.id===V)?.context?.dataRef?.current.orientation,[V,$,A]),Ie=Pe(pe=>{if(N.current=!1,X.current=!0,pe.which===229||!ne.current&&pe.currentTarget===Y.current)return;if(C&&o8(pe.key,T,w,M)){$f(pe.key,de())||fn(pe),n.setOpen(!1,Ue(Du,pe.nativeEvent)),en(u)&&(y?$?.events.emit("virtualfocus",u):u.focus());return}const Re=U.current,we=fh(a,E),We=f_(a,E);if(G||(pe.key==="Home"&&(fn(pe),U.current=we,W(pe)),pe.key==="End"&&(fn(pe),U.current=We,W(pe))),M>1){const et=P||Array.from({length:a.current.length},()=>({width:1,height:1})),xe=bE(et,M,z),Ge=xe.findIndex(Se=>Se!=null&&!mo(a,Se,E)),tt=xe.reduce((Se,He,ke)=>He!=null&&!mo(a,He,E)?ke:Se,-1),dt=xe[yE({current:xe.map(Se=>Se!=null?a.current[Se]:null)},{event:pe,orientation:T,loopFocus:S,rtl:w,cols:M,disabledIndices:SE([...(typeof E!="function"?E:null)||a.current.map((Se,He)=>mo(a,He,E)?He:void 0),void 0],xe),minIndex:Ge,maxIndex:tt,prevIndex:xE(U.current>We?we:U.current,et,xe,M,pe.key===td?"bl":pe.key===(w?ho:po)?"tr":"tl"),stopEvent:!0})];if(dt!=null&&(U.current=dt,W(pe)),T==="both")return}if($f(pe.key,T)){if(fn(pe),s&&!y&&_s(pe.currentTarget.ownerDocument)===pe.currentTarget){U.current=_v(pe.key,T,w)?we:We,W(pe);return}_v(pe.key,T,w)?S?Re>=We?g&&Re!==a.current.length?U.current=-1:(X.current=!1,U.current=we):U.current=Wn(a,{startingIndex:Re,disabledIndices:E}):U.current=Math.min(We,Wn(a,{startingIndex:Re,disabledIndices:E})):S?Re<=we?g&&Re!==-1?U.current=a.current.length:(X.current=!1,U.current=We):U.current=Wn(a,{startingIndex:Re,decrement:!0,disabledIndices:E}):U.current=Math.max(we,Wn(a,{startingIndex:Re,decrement:!0,disabledIndices:E})),Ll(a,U.current)&&(U.current=-1),W(pe)}}),De=R.useMemo(()=>y&&s&&ge&&{"aria-activedescendant":`${H}-${l}`},[y,s,ge,H,l]),Oe=R.useMemo(()=>({"aria-orientation":T==="both"?void 0:T,...G?{}:De,onKeyDown(pe){if(pe.key==="Tab"&&pe.shiftKey&&s&&!y){const Re=Pn(pe.nativeEvent);if(Re&&!ft(Y.current,Re))return;fn(pe),n.setOpen(!1,Ue(ka,pe.nativeEvent)),en(u)&&u.focus();return}Ie(pe)},onPointerMove(){N.current=!0}}),[De,Ie,Y,T,G,n,s,y,u]),be=R.useMemo(()=>{function pe(we){b==="auto"&&mE(we.nativeEvent)&&(j.current=!y)}function Re(we){j.current=b,b==="auto"&&gE(we.nativeEvent)&&(j.current=!0)}return{onKeyDown(we){const We=n.select("open");N.current=!1;const et=we.key.startsWith("Arrow"),xe=i8(we.key,de(),w),Ge=$f(we.key,T),tt=(C?xe:Ge)||we.key==="Enter"||we.key.trim()==="";if(y&&We)return Ie(we);if(!(!We&&!x&&et)){if(tt){const dt=$f(we.key,de());D.current=C&&dt?null:we.key}if(C){xe&&(fn(we),We?(U.current=fh(a,se.current),W(we)):n.setOpen(!0,Ue(Du,we.nativeEvent,we.currentTarget)));return}Ge&&(oe.current!=null&&(U.current=oe.current),fn(we),!We&&x?n.setOpen(!0,Ue(Du,we.nativeEvent,we.currentTarget)):Ie(we),We&&W(we))}},onFocus(we){n.select("open")&&!y&&(U.current=-1,W(we))},onPointerDown:Re,onPointerEnter:Re,onMouseDown:pe,onClick:pe}},[Ie,se,b,a,C,W,n,x,T,de,w,oe,y]),Me=R.useMemo(()=>({...De,...be}),[De,be]);return R.useMemo(()=>p?{reference:Me,floating:Oe,item:ue,trigger:be}:{},[p,Me,Oe,be,ue])}const a8=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function rk(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=a8.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]),b=R.useMemo(()=>{const x={id:f,...g&&{role:g}};return g==="tooltip"||l==="label"?x:{...x,...g==="menu"&&{"aria-labelledby":p}}},[g,f,p,l]),v=R.useCallback(({active:x,selected:E})=>{const T={role:"option",...x&&{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:b,item:v,trigger:w}:{},[a,y,b,w,v])}function E0(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=br,selectedIndex:S=null}=t,C=Qt(),w=R.useRef(""),y=R.useRef(S??h??-1),b=R.useRef(null);Ve(()=>{s&&(C.clear(),b.current=null,w.current="")},[s,C]),Ve(()=>{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))}),x=Pe(A=>{function M(q,I,K){const Y=p?p(I,K):I.find(V=>V?.toLocaleLowerCase().indexOf(K.toLocaleLowerCase())===0);return Y?q.indexOf(Y):-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=b.current),w.current+=A.key,C.start(f,()=>{w.current="",y.current=b.current,v(!1)});const z=y.current,H=M(L,[...L.slice((z||0)+1),...L.slice(0,(z||0)+1)],w.current);H!==-1?(a?.(H),b.current=H):A.key!==" "&&(w.current="",v(!1))}),E=R.useMemo(()=>({onKeyDown:x}),[x]),T=R.useMemo(()=>({onKeyDown:x,onKeyUp(A){A.key===" "&&v(!1)}}),[x,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 l8(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function c8(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:b})=>function(x){function E(){o.clear(),w()}if(o.clear(),!C.domReference||!C.floating||S==null||f==null||g==null)return;const{clientX:T,clientY:A}=x,M=[T,A],L=Pn(x),P=x.type==="mouseleave",z=ft(C.floating,L),H=ft(C.domReference,L),q=C.domReference.getBoundingClientRect(),I=C.floating.getBoundingClientRect(),K=S.split("-")[0],Y=f>I.right-I.width/2,V=g>I.bottom-I.height/2,$=l8(M,q),G=I.width>q.width,j=I.height>q.height,U=(G?q:I).left,D=(G?q:I).right,N=(j?q:I).top,W=(j?q:I).bottom;if(z&&(u=!0,!P))return;if(H&&(u=!1),H&&!P){u=!0;return}if(P&&Nt(x.relatedTarget)&&ft(C.floating,x.relatedTarget)||b&&ga(b.nodesRef.current,y).some(({context:te})=>te?.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 Z=[];switch(K){case"top":Z=[[U,q.top+1],[U,I.bottom-1],[D,I.bottom-1],[D,q.top+1]];break;case"bottom":Z=[[U,I.top+1],[U,q.bottom-1],[D,q.bottom-1],[D,I.top+1]];break;case"left":Z=[[I.right-1,W],[I.right-1,N],[q.left+1,N],[q.left+1,W]];break;case"right":Z=[[q.right-1,W],[q.right-1,N],[I.left+1,N],[I.left+1,W]];break}function ee([te,X]){switch(K){case"top":{const F=[G?te+t/2:Y?te+t*4:te-t*4,X+t+1],se=[G?te-t/2:Y?te+t*4:te-t*4,X+t+1],ne=[[I.left,Y||G?I.bottom-t:I.top],[I.right,Y?G?I.bottom-t:I.top:I.bottom-t]];return[F,se,...ne]}case"bottom":{const F=[G?te+t/2:Y?te+t*4:te-t*4,X-t],se=[G?te-t/2:Y?te+t*4:te-t*4,X-t],ne=[[I.left,Y||G?I.top+t:I.bottom],[I.right,Y?G?I.top+t:I.bottom:I.top+t]];return[F,se,...ne]}case"left":{const F=[te+t+1,j?X+t/2:V?X+t*4:X-t*4],se=[te+t+1,j?X-t/2:V?X+t*4:X-t*4];return[...[[V||j?I.right-t:I.left,I.top],[V?j?I.right-t:I.left:I.right-t,I.bottom]],F,se]}case"right":{const F=[te-t,j?X+t/2:V?X+t*4:X-t*4],se=[te-t,j?X-t/2:V?X+t*4:X-t*4],ne=[[V||j?I.left+t:I.right,I.top],[V?j?I.left+t:I.right:I.left+t,I.bottom]];return[F,se,...ne]}default:return[]}}if(!hC([T,A],Z)){if(u&&!$)return E();if(!P&&s){const te=d(x.clientX,x.clientY);if(te!==null&&te<.1)return E()}hC([T,A],ee([f,g]))?!u&&s&&o.start(40,E):E()}};return p.__options={blockPointerEvents:n},p}let u8=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),d8=(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 sk=R.createContext(void 0);function f8(){const e=R.useContext(sk);if(e===void 0)throw new Error(Pt(26));return e}const Dl="ArrowUp",oa="ArrowDown",Uu="ArrowLeft",Pl="ArrowRight",id="Home",od="End",ik=new Set([Uu,Pl]),h8=new Set([Uu,Pl,id,od]),ok=new Set([Dl,oa]),p8=new Set([Dl,oa,id,od]),ak=new Set([...ik,...ok]),m8=new Set([...ak,id,od]),k0=new Set([Dl,oa,Uu,Pl,id,od]),g8="Shift",v8="Control",_8="Alt",y8="Meta",b8=new Set([g8,v8,_8,y8]);function x8(e){return en(e)&&e.tagName==="INPUT"}function pC(e){return!!(x8(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 S8={...xo,...Gs,nestedDialogOpen(e){return e?{[d8.nestedDialogOpen]:""}:null}},lk=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"),b=l.useState("open"),v=l.useState("openMethod"),x=l.useState("titleElementId"),E=l.useState("transitionStatus"),T=l.useState("role");f8(),Ur({open:b,ref:l.context.popupRef,onComplete(){b&&l.context.onOpenChangeComplete?.(!0)}});function A(H){return H==="touch"?l.context.popupRef.current:!0}const M=u===void 0?A:u,L=y>0,P=R.useMemo(()=>({open:b,nested:w,transitionStatus:E,nestedDialogOpen:L}),[b,w,E,L]),z=at("div",t,{state:P,props:[g,{"aria-labelledby":x??void 0,"aria-describedby":d??void 0,role:T,tabIndex:-1,hidden:!C,onKeyDown(H){k0.has(H.key)&&H.stopPropagation()},style:{[u8.nestedDialogs]:y}},a],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:S8});return _.jsx(pp,{context:f,openInteractionType:v,disabled:!C,closeOnFocusOut:!p,initialFocus:M,returnFocus:o,modal:S!==!1,restoreFocus:"popup",children:z})});function yp(e){return e0(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}})}),ck=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(sk.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 C8(e){if(typeof document>"u")return!1;const t=xr(e);return kn(t).innerWidth-t.documentElement.clientWidth>0}function w8(e){const t=xr(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 E8(e){const t=xr(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(d0&&(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 b=n.scrollHeight>n.clientHeight,v=n.scrollWidth>n.clientWidth,x=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),P=Aa(n)?n:s;if(l){n.style.scrollbarGutter=y,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(b||x)&&(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 k8{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=xr(t).documentElement,o=kn(s).getComputedStyle(s).overflowY;if(o==="hidden"||o==="clip"){this.restore=on;return}const u=F4||!C8(t);this.restore=u?w8(t):E8(t)}}const R8=new k8;function xp(e=!0,t=null){Ve(()=>{if(e)return R8.acquire(t)},[e,t])}function T8(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}=T8(s);return R.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:u,onPointerDown:h}}),[t,o,u,h])}function uk(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);QE(t);const{forceUnmount:f}=ZE(o,t,()=>{p()}),g=Pe(z=>{const H=Ue(z);return H.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},H}),S=R.useCallback(()=>{t.setOpen(!1,g(oE))},[t,g]);R.useImperativeHandle(s,()=>({unmount:f,close:S}),[f,S]);const C=tk({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,y]=R.useState(0),b=w===0,v=rk(C),x=gp(C,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:h==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(z){if("button"in z&&z.button!==0||"touches"in z&&z.touches.length!==1)return!1;const H=Pn(z);if(b&&!u){const q=H;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:b});xp(o&&h===!0,a);const{getReferenceProps:E,getFloatingProps:T,getTriggerProps:A}=oc([v,x]);t.useContextCallback("onNestedDialogOpen",z=>{y(z+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]),P=R.useMemo(()=>T(),[T]);t.useSyncedValues({openMethod:l,activeTriggerProps:M,inactiveTriggerProps:L,popupProps:P,floatingRootContext:C,nestedOpenDialogCount:w})}const L8={...ek,modal:Ee(e=>e.modal),nested:Ee(e=>e.nested),nestedOpenDialogCount:Ee(e=>e.nestedOpenDialogCount),disablePointerDismissal:Ee(e=>e.disablePointerDismissal),openMethod:Ee(e=>e.openMethod),descriptionElementId:Ee(e=>e.descriptionElementId),titleElementId:Ee(e=>e.titleElementId),viewportElement:Ee(e=>e.viewportElement),role:Ee(e=>e.role)};class dk extends x0{constructor(t){super(A8(t),{popupRef:R.createRef(),backdropRef:R.createRef(),internalBackdropRef:R.createRef(),triggerElements:new vp,onOpenChange:void 0,onOpenChangeComplete:void 0},L8)}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 A8(e={}){return{...JE(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function O8(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 dk({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");uk({store:C,actionsRef:l,parentContext:g?.store.context});const y=R.useMemo(()=>({store:C}),[C]);return _.jsx(a0.Provider,{value:y,children:typeof t=="function"?t({payload:w}):t})}const fk=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]})}),hk=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:b,isMountedByThisTrigger:v}=XE(S,y,g,{payload:l}),{getButtonProps:x,buttonRef:E}=Sr({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,b,y],props:[A.getReferenceProps(),L,{[P2]:"",id:S},p,x],stateAttributesMapping:l0})});function xs({...e}){return _.jsx(O8,{"data-slot":"dialog",...e})}function pk({...e}){return _.jsx(hk,{"data-slot":"dialog-trigger",...e})}function M8({...e}){return _.jsx(ck,{"data-slot":"dialog-portal",...e})}function R0({...e}){return _.jsx(fp,{"data-slot":"dialog-close",...e})}function D8({className:e,...t}){return _.jsx(sE,{"data-slot":"dialog-overlay",className:Be("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(M8,{children:[_.jsx(D8,{}),_.jsxs(lk,{"data-slot":"dialog-content",className:Be("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(Ne,{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:Be("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:Be("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...s,children:[n,t&&_.jsx(fp,{render:_.jsx(Ne,{variant:"outline"}),children:"Close"})]})}function zs({className:e,...t}){return _.jsx(fk,{"data-slot":"dialog-title",className:Be("text-sm font-medium",e),...t})}function aa({className:e,...t}){return _.jsx(aE,{"data-slot":"dialog-description",className:Be("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 P8={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ja={valid(e){return e===null?null:e?{[bC.valid]:""}:{[bC.invalid]:""}}},j8=R.createContext({invalid:void 0,name:void 0,validityData:{state:P8,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(j8);if(t.setValidityData===on&&!e)throw new Error(Pt(28));return t}const I8=R.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:on,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function ad(){return R.useContext(I8)}const N8=R.createContext({controlId:void 0,setControlId:on,labelId:void 0,setLabelId:on,messageIds:[],setMessageIds:on,getDescriptionProps:e=>e});function wo(){return R.useContext(N8)}function B8(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 Ve(()=>{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);Ve(()=>{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]),Ve(()=>{!t||!s||a.current.fields.set(s,{getValue:g,name:o,controlRef:u,validityData:B8(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]),Ve(()=>{const S=a.current.fields;return()=>{s&&S.delete(s)}},[a,s])}const z8=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,b=R.useMemo(()=>({...g,disabled:w}),[g,w]),{setTouched:v,setDirty:x,validityData:E,setFocused:T,setFilled:A,validationMode:M,validation:L}=us(),{labelId:P}=wo(),z=Cp({id:u});Ve(()=>{const V=a!=null;L.inputRef.current?.value||V&&a!==""?A(!0):V&&a===""&&A(!1)},[L.inputRef,A,a]);const[H,q]=as({controlled:a,default:p,name:"FieldControl",state:"value"}),I=a!==void 0,K=Pe((V,$)=>{d?.(V,$),!$.isCanceled&&q(V)});return ld({id:z,name:y,commit:L.commit,value:H,getValue:()=>L.inputRef.current?.value,controlRef:L.inputRef}),at("input",t,{ref:n,state:b,props:[{id:z,disabled:w,name:y,ref:L.inputRef,"aria-labelledby":P,...I?{value:H}:{defaultValue:p},onChange(V){const $=V.currentTarget.value;K($,Ue(Mn,V.nativeEvent)),x($!==E.initialValue),A($!=="")},onFocus(){T(!0)},onBlur(V){v(!0),T(!1),M==="onBlur"&&L.commit(V.currentTarget.value)},onKeyDown(V){V.currentTarget.tagName==="INPUT"&&V.key==="Enter"&&(v(!0),L.commit(V.currentTarget.value))}},L.getInputValidationProps(),f],stateAttributesMapping:ja})}),H8=R.createContext({disabled:!1});function V8(){return R.useContext(H8)}const F8=R.createContext(void 0);function U8(e=!0){const t=R.useContext(F8);if(t===void 0&&!e)throw new Error(Pt(3));return t}const W8=R.forwardRef(function(t,n){return _.jsx(z8,{ref:n,...t})});function Wt({className:e,type:t,...n}){return _.jsx(W8,{type:t,"data-slot":"input",className:Be("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 T0({className:e,...t}){return _.jsx("textarea",{"data-slot":"textarea",className:Be("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})}async function mk(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 q8(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 G8=e=>{switch(e){case"success":return Y8;case"info":return Q8;case"warning":return X8;case"error":return Z8;default:return null}},$8=Array(12).fill(0),K8=({visible:e,className:t})=>ze.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ze.createElement("div",{className:"sonner-spinner"},$8.map((n,s)=>ze.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),Y8=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"})),X8=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"})),Q8=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"})),Z8=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"})),J8=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"})),eP=()=>{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 g_=1;class tP{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:g_++,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(rP(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||g_++;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 gr=new tP,nP=(e,t)=>{const n=t?.id||g_++;return gr.addToast({title:e,...t,id:n}),n},rP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",sP=nP,iP=()=>gr.toasts,oP=()=>gr.getActiveToasts(),yr=Object.assign(sP,{success:gr.success,info:gr.info,warning:gr.warning,error:gr.error,custom:gr.custom,message:gr.message,promise:gr.promise,dismiss:gr.dismiss,loading:gr.loading},{getHistory:iP,getToasts:oP});q8("[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 Yf(e){return e.label!==void 0}const aP=3,lP="24px",cP="16px",xC=4e3,uP=356,dP=14,fP=45,hP=200;function Ms(...e){return e.filter(Boolean).join(" ")}function pP(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const mP=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:b,toasts:v,expanded:x,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:L,actionButtonStyle:P,className:z="",descriptionClassName:H="",duration:q,position:I,gap:K,expandByDefault:Y,classNames:V,icons:$,closeButtonAriaLabel:G="Close toast"}=e,[j,U]=ze.useState(null),[D,N]=ze.useState(null),[W,Z]=ze.useState(!1),[ee,te]=ze.useState(!1),[X,F]=ze.useState(!1),[se,ne]=ze.useState(!1),[re,oe]=ze.useState(!1),[le,ve]=ze.useState(0),[ge,ue]=ze.useState(0),de=ze.useRef(f.duration||q||xC),Ie=ze.useRef(null),De=ze.useRef(null),Oe=b===0,be=b+1<=w,Me=f.type,pe=f.dismissible!==!1,Re=f.className||"",we=f.descriptionClassName||"",We=ze.useMemo(()=>y.findIndex(Je=>Je.toastId===f.id)||0,[y,f.id]),et=ze.useMemo(()=>{var Je;return(Je=f.closeButton)!=null?Je:A},[f.closeButton,A]),xe=ze.useMemo(()=>f.duration||q||xC,[f.duration,q]),Ge=ze.useRef(0),tt=ze.useRef(0),dt=ze.useRef(0),Se=ze.useRef(null),[He,ke]=I.split("-"),nt=ze.useMemo(()=>y.reduce((Je,Ot,It)=>It>=We?Je:Je+Ot.height,0),[y,We]),lt=eP(),Xe=f.invert||p,st=Me==="loading";tt.current=ze.useMemo(()=>We*K+nt,[We,nt]),ze.useEffect(()=>{de.current=xe},[xe]),ze.useEffect(()=>{Z(!0)},[]),ze.useEffect(()=>{const Je=De.current;if(Je){const Ot=Je.getBoundingClientRect().height;return ue(Ot),C(It=>[{toastId:f.id,height:Ot,position:f.position},...It]),()=>C(It=>It.filter(ot=>ot.toastId!==f.id))}},[C,f.id]),ze.useLayoutEffect(()=>{if(!W)return;const Je=De.current,Ot=Je.style.height;Je.style.height="auto";const It=Je.getBoundingClientRect().height;Je.style.height=Ot,ue(It),C(ot=>ot.find(bt=>bt.toastId===f.id)?ot.map(bt=>bt.toastId===f.id?{...bt,height:It}:bt):[{toastId:f.id,height:It,position:f.position},...ot])},[W,f.title,f.description,C,f.id,f.jsx,f.action,f.cancel]);const Ct=ze.useCallback(()=>{te(!0),ve(tt.current),C(Je=>Je.filter(Ot=>Ot.toastId!==f.id)),setTimeout(()=>{E(f)},hP)},[f,E,C,tt]);ze.useEffect(()=>{if(f.promise&&Me==="loading"||f.duration===1/0||f.type==="loading")return;let Je;return x||S||lt?(()=>{if(dt.current<Ge.current){const ot=new Date().getTime()-Ge.current;de.current=de.current-ot}dt.current=new Date().getTime()})():de.current!==1/0&&(Ge.current=new Date().getTime(),Je=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Ct()},de.current)),()=>clearTimeout(Je)},[x,S,f,Me,lt,Ct]),ze.useEffect(()=>{f.delete&&(Ct(),f.onDismiss==null||f.onDismiss.call(f,f))},[Ct,f.delete]);function ct(){var Je;if($?.loading){var Ot;return ze.createElement("div",{className:Ms(V?.loader,f==null||(Ot=f.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":Me==="loading"},$.loading)}return ze.createElement(K8,{className:Ms(V?.loader,f==null||(Je=f.classNames)==null?void 0:Je.loader),visible:Me==="loading"})}const nn=f.icon||$?.[Me]||G8(Me);var Rt,vt;return ze.createElement("li",{tabIndex:0,ref:De,className:Ms(z,Re,V?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,V?.default,V?.[Me],f==null||(n=f.classNames)==null?void 0:n[Me]),"data-sonner-toast":"","data-rich-colors":(Rt=f.richColors)!=null?Rt:T,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":W,"data-promise":!!f.promise,"data-swiped":re,"data-removed":ee,"data-visible":be,"data-y-position":He,"data-x-position":ke,"data-index":b,"data-front":Oe,"data-swiping":X,"data-dismissible":pe,"data-type":Me,"data-invert":Xe,"data-swipe-out":se,"data-swipe-direction":D,"data-expanded":!!(x||Y&&W),"data-testid":f.testId,style:{"--index":b,"--toasts-before":b,"--z-index":v.length-b,"--offset":`${ee?le:tt.current}px`,"--initial-height":Y?"auto":`${ge}px`,...M,...f.style},onDragEnd:()=>{F(!1),U(null),Se.current=null},onPointerDown:Je=>{Je.button!==2&&(st||!pe||(Ie.current=new Date,ve(tt.current),Je.target.setPointerCapture(Je.pointerId),Je.target.tagName!=="BUTTON"&&(F(!0),Se.current={x:Je.clientX,y:Je.clientY})))},onPointerUp:()=>{var Je,Ot,It;if(se||!pe)return;Se.current=null;const ot=Number(((Je=De.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wt=Number(((Ot=De.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((It=Ie.current)==null?void 0:It.getTime()),xt=j==="x"?ot:wt,Qe=Math.abs(xt)/bt;if(Math.abs(xt)>=fP||Qe>.11){ve(tt.current),f.onDismiss==null||f.onDismiss.call(f,f),N(j==="x"?ot>0?"right":"left":wt>0?"down":"up"),Ct(),ne(!0);return}else{var Ht,Rn;(Ht=De.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(Rn=De.current)==null||Rn.style.setProperty("--swipe-amount-y","0px")}oe(!1),F(!1),U(null)},onPointerMove:Je=>{var Ot,It,ot;if(!Se.current||!pe||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const bt=Je.clientY-Se.current.y,xt=Je.clientX-Se.current.x;var Qe;const Ht=(Qe=e.swipeDirections)!=null?Qe:pP(I);!j&&(Math.abs(xt)>1||Math.abs(bt)>1)&&U(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(j==="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(j==="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),(It=De.current)==null||It.style.setProperty("--swipe-amount-x",`${Rn.x}px`),(ot=De.current)==null||ot.style.setProperty("--swipe-amount-y",`${Rn.y}px`)}},et&&!f.jsx&&Me!=="loading"?ze.createElement("button",{"aria-label":G,"data-disabled":st,"data-close-button":!0,onClick:st||!pe?()=>{}:()=>{Ct(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Ms(V?.closeButton,f==null||(s=f.classNames)==null?void 0:s.closeButton)},(vt=$?.close)!=null?vt:J8):null,(Me||f.icon||f.promise)&&f.icon!==null&&($?.[Me]!==null||f.icon)?ze.createElement("div",{"data-icon":"",className:Ms(V?.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(V?.content,f==null||(u=f.classNames)==null?void 0:u.content)},ze.createElement("div",{"data-title":"",className:Ms(V?.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(H,we,V?.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&&Yf(f.cancel)?ze.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Je=>{Yf(f.cancel)&&pe&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Je),Ct())},className:Ms(V?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,ze.isValidElement(f.action)?f.action:f.action&&Yf(f.action)?ze.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||P,onClick:Je=>{Yf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Je),!Je.defaultPrevented&&Ct())},className:Ms(V?.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function SC(){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 gP(e,t){const n={};return[e,t].forEach((s,o)=>{const u=o===1,h=u?"--mobile-offset":"--offset",a=u?cP:lP;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 vP=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=aP,toastOptions:b,dir:v=SC(),gap:x=dP,icons:E,containerAriaLabel:T="Notifications"}=t,[A,M]=ze.useState([]),L=ze.useMemo(()=>s?A.filter(W=>W.toasterId===s):A.filter(W=>!W.toasterId),[A,s]),P=ze.useMemo(()=>Array.from(new Set([u].concat(L.filter(W=>W.position).map(W=>W.position)))),[L,u]),[z,H]=ze.useState([]),[q,I]=ze.useState(!1),[K,Y]=ze.useState(!1),[V,$]=ze.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ze.useRef(null),j=h.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=ze.useRef(null),D=ze.useRef(!1),N=ze.useCallback(W=>{M(Z=>{var ee;return(ee=Z.find(te=>te.id===W.id))!=null&&ee.delete||gr.dismiss(W.id),Z.filter(({id:te})=>te!==W.id)})},[]);return ze.useEffect(()=>gr.subscribe(W=>{if(W.dismiss){requestAnimationFrame(()=>{M(Z=>Z.map(ee=>ee.id===W.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{T3.flushSync(()=>{M(Z=>{const ee=Z.findIndex(te=>te.id===W.id);return ee!==-1?[...Z.slice(0,ee),{...Z[ee],...W},...Z.slice(ee+1)]:[W,...Z]})})})}),[A]),ze.useEffect(()=>{if(g!=="system"){$(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:Z})=>{$(Z?"dark":"light")})}catch{W.addListener(({matches:ee})=>{try{$(ee?"dark":"light")}catch(te){console.error(te)}})}},[g]),ze.useEffect(()=>{A.length<=1&&I(!1)},[A]),ze.useEffect(()=>{const W=Z=>{var ee;if(h.every(F=>Z[F]||Z.code===F)){var X;I(!0),(X=G.current)==null||X.focus()}Z.code==="Escape"&&(document.activeElement===G.current||(ee=G.current)!=null&&ee.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[h]),ze.useEffect(()=>{if(G.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,D.current=!1)}},[G.current]),ze.createElement("section",{ref:n,"aria-label":`${T} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((W,Z)=>{var ee;const[te,X]=W.split("-");return L.length?ze.createElement("ol",{key:W,dir:v==="auto"?SC():v,tabIndex:-1,ref:G,className:d,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":te,"data-x-position":X,style:{"--front-toast-height":`${((ee=z[0])==null?void 0:ee.height)||0}px`,"--width":`${uP}px`,"--gap":`${x}px`,...w,...gP(p,f)},onBlur:F=>{D.current&&!F.currentTarget.contains(F.relatedTarget)&&(D.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||D.current||(D.current=!0,U.current=F.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{K||I(!1)},onDragEnd:()=>I(!1),onPointerDown:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},L.filter(F=>!F.position&&Z===0||F.position===W).map((F,se)=>{var ne,re;return ze.createElement(mP,{key:F.id,icons:E,index:se,toast:F,defaultRichColors:S,duration:(ne=b?.duration)!=null?ne:C,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:o,visibleToasts:y,closeButton:(re=b?.closeButton)!=null?re:l,interacting:K,position:W,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:N,toasts:L.filter(oe=>oe.position==F.position),heights:z.filter(oe=>oe.position==F.position),setHeights:H,expandByDefault:a,gap:x,expanded:q,swipeDirections:t.swipeDirections})})):null}))});function _P(e){const t=/\/[\w\-/.]+\.(png|jpg|jpeg|gif|webp|svg)/gi;return[...e.match(t)||[]]}function CC(e){return`/api/uploads/${e.split("/").pop()}`}function gk({value:e,onValueChange:t,className:n,disabled:s,...o}){const[u,h]=R.useState(!1),a=R.useRef(null),l=_P(e),d=async p=>{const f=p.clipboardData?.items;if(f){for(const g of f)if(g.type.startsWith("image/")){p.preventDefault();const S=g.getAsFile();if(!S)return;h(!0);try{const C=await mk(S),w=a.current;if(w){const y=w.selectionStart,b=w.selectionEnd,v=e.slice(0,y),x=e.slice(b),E=v&&!v.endsWith(`
22
- `)?`
23
- `:"",T=x&&!x.startsWith(`
24
- `)?`
25
- `:"",A=v+E+C+T+x;t(A)}else t(e+(e?`
26
- `:"")+C)}catch(C){yr.error("Failed to upload image"),console.error("Upload error:",C)}finally{h(!1)}return}}};return _.jsxs("div",{className:"space-y-2",children:[_.jsxs("div",{className:"relative",children:[_.jsx(T0,{ref:a,value:e,onChange:p=>t(p.target.value),onPaste:d,className:Be(u&&"opacity-50",n),disabled:u||s,...o}),u&&_.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 rounded-md",children:_.jsx("span",{className:"text-sm text-muted-foreground",children:"Uploading..."})})]}),l.length>0&&_.jsx("div",{className:"flex flex-wrap gap-2",children:l.map((p,f)=>_.jsx("a",{href:CC(p),target:"_blank",rel:"noopener noreferrer",className:"block",children:_.jsx("img",{src:CC(p),alt:`Attachment ${f+1}`,className:"h-16 w-auto rounded border object-cover hover:opacity-80 transition-opacity"})},f))})]})}function yP({className:e,...t}){return _.jsx("label",{"data-slot":"label",className:Be("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 bP=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 xP({className:e,orientation:t="horizontal",...n}){return _.jsx(bP,{"data-slot":"separator",orientation:t,className:Be("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:Be("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 SP=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:Be(SP({orientation:t}),e),...n})}function wn({className:e,...t}){return _.jsx(yP,{"data-slot":"field-label",className:Be("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:Be("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 vk(e){const t=R.useRef(!0);t.current&&(t.current=!1,e())}const _k=R.createContext(null),yk=R.createContext(null);function $s(){const e=R.useContext(_k);if(e===null)throw new Error(Pt(60));return e}function bk(){const e=R.useContext(yk);if(e===null)throw new Error(Pt(61));return e}const xk=(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 Sk(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 Ck(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 CP(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=Ck(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 wP(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>An(n,t)).join(", ")}const ht={id:Ee(e=>e.id),modal:Ee(e=>e.modal),multiple:Ee(e=>e.multiple),items:Ee(e=>e.items),itemToStringLabel:Ee(e=>e.itemToStringLabel),itemToStringValue:Ee(e=>e.itemToStringValue),isItemEqualToValue:Ee(e=>e.isItemEqualToValue),value:Ee(e=>e.value),open:Ee(e=>e.open),mounted:Ee(e=>e.mounted),forceMount:Ee(e=>e.forceMount),transitionStatus:Ee(e=>e.transitionStatus),openMethod:Ee(e=>e.openMethod),activeIndex:Ee(e=>e.activeIndex),selectedIndex:Ee(e=>e.selectedIndex),isActive:Ee((e,t)=>e.activeIndex===t),isSelected:Ee((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:Ee((e,t)=>e.selectedIndex===t),popupProps:Ee(e=>e.popupProps),triggerProps:Ee(e=>e.triggerProps),triggerElement:Ee(e=>e.triggerElement),positionerElement:Ee(e=>e.positionerElement),listElement:Ee(e=>e.listElement),scrollUpArrowVisible:Ee(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ee(e=>e.scrollDownArrowVisible),hasScrollArrows:Ee(e=>e.hasScrollArrows),serializedValue:Ee(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);Ve(()=>{n.current!==e&&s(n.current)},[e,s]),Ve(()=>{n.current=e},[e])}function EP(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:b=!1,itemToStringLabel:v,itemToStringValue:x,isItemEqualToValue:E=xk,highlightItemOnHover:T=!0,children:A}=e,{clearErrors:M}=ad(),{setDirty:L,shouldValidateOnChange:P,validityData:z,setFilled:H,name:q,disabled:I,validation:K}=us(),{controlId:Y}=wo(),V=Cp({id:t}),$=I||d,G=q??l,[j,U]=as({controlled:n,default:b?s??br:s,name:"Select",state:"value"}),[D,N]=as({controlled:u,default:h,name:"Select",state:"open"}),W=R.useRef([]),Z=R.useRef([]),ee=R.useRef(null),te=R.useRef(null),X=R.useRef(0),F=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:ge,setMounted:ue,transitionStatus:de}=ki(D),{openMethod:Ie,triggerProps:De,reset:Oe}=Sp(D),be=Gn(()=>new va({id:V,modal:g,multiple:b,itemToStringLabel:v,itemToStringValue:x,isItemEqualToValue:E,value:j,open:D,mounted:ge,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,Me=Ae(be,ht.activeIndex),pe=Ae(be,ht.selectedIndex),Re=Ae(be,ht.triggerElement),we=Ae(be,ht.positionerElement),We=R.useMemo(()=>b&&Array.isArray(j)&&j.length===0?"":ys(j,x),[b,j,x]),et=R.useMemo(()=>b&&Array.isArray(j)?j.map(ot=>ys(ot,x)):ys(j,x),[b,j,x]),xe=hn(be.state.triggerElement);ld({id:V,commit:K.commit,value:j,controlRef:xe,name:G,getValue:()=>et});const Ge=R.useRef(j);Ve(()=>{j!==Ge.current&&be.set("forceMount",!0)},[be,j]),Ve(()=>{H(j!==null)},[j,H]),Ve(function(){if(D)return;const wt=se.current;if(b){const xt=Array.isArray(j)?j:[];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,j,E);be.set("selectedIndex",bt===-1?null:bt)},[b,D,j,se,E,be]),ca(j,()=>{M(G),L(j!==z.initialValue),P()?K.commit(j):K.commit(j,!0)});const tt=Pe((ot,wt)=>{if(a?.(ot,wt),!wt.isCanceled&&(N(ot),!ot&&be.state.activeIndex!==null)){const bt=W.current[be.state.activeIndex];queueMicrotask(()=>{bt?.setAttribute("tabindex","-1")})}}),dt=Pe(()=>{ue(!1),be.set("activeIndex",null),Oe(),w?.(!1)});Ur({enabled:!S,open:D,ref:ee,onComplete(){D||dt()}}),R.useImperativeHandle(S,()=>({unmount:dt}),[dt]);const Se=Pe((ot,wt)=>{o?.(ot,wt),!wt.isCanceled&&U(ot)}),He=Pe(()=>{const ot=be.state.listElement||ee.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)}),ke=C0({open:D,onOpenChange:tt,elements:{reference:Re,floating:we}}),nt=sd(ke,{enabled:!p&&!$,event:"mousedown"}),lt=gp(ke,{bubbles:!1}),Xe=w0(ke,{enabled:!p&&!$,listRef:W,activeIndex:Me,selectedIndex:pe,disabledIndices:br,onNavigate(ot){ot===null&&!D||be.set("activeIndex",ot)},focusItemOnHover:!1}),st=E0(ke,{enabled:!p&&!$&&(D||!b),listRef:Z,activeIndex:Me,selectedIndex:pe,onMatch(ot){D?be.set("activeIndex",ot):Se(se.current[ot],Ue("none"))},onTypingChange(ot){ne.current=ot}}),{getReferenceProps:Ct,getFloatingProps:ct,getItemProps:nn}=oc([nt,lt,Xe,st]),Rt=R.useMemo(()=>Ws(Ct(),De),[Ct,De]);vk(()=>{be.update({popupProps:ct(),triggerProps:Rt})}),Ve(()=>{be.update({id:V,modal:g,multiple:b,value:j,open:D,mounted:ge,transitionStatus:de,popupProps:ct(),triggerProps:Rt,items:y,itemToStringLabel:v,itemToStringValue:x,isItemEqualToValue:E,openMethod:Ie})},[be,V,g,b,j,D,ge,de,ct,Rt,y,v,x,E,Ie]);const vt=R.useMemo(()=>({store:be,name:G,required:f,disabled:$,readOnly:p,multiple:b,itemToStringLabel:v,itemToStringValue:x,highlightItemOnHover:T,setValue:Se,setOpen:tt,listRef:W,popupRef:ee,scrollHandlerRef:te,handleScrollArrowVisibility:He,scrollArrowsMountedCountRef:X,getItemProps:nn,events:ke.context.events,valueRef:F,valuesRef:se,labelsRef:Z,typingRef:ne,selectionRef:le,selectedItemTextRef:oe,validation:K,onOpenChangeComplete:w,keyboardActiveRef:re,alignItemWithTriggerActiveRef:ve,initialValueRef:Ge}),[be,G,f,$,p,b,v,x,T,Se,tt,nn,ke.context.events,K,w,He]),Je=cs(C,K.inputRef),Ot=b&&Array.isArray(j)&&j.length>0,It=R.useMemo(()=>!b||!Array.isArray(j)||!G?null:j.map(ot=>{const wt=ys(ot,x);return _.jsx("input",{type:"hidden",name:G,value:wt},wt)}),[b,j,G,x]);return _.jsx(_k.Provider,{value:vt,children:_.jsxs(yk.Provider,{value:ke,children:[A,_.jsx("input",{...K.getInputValidationProps({onFocus(){be.state.triggerElement?.focus()},onChange(ot){if(ot.nativeEvent.defaultPrevented)return;const wt=ot.target.value,bt=Ue(Mn,ot.nativeEvent);function xt(){if(b)return;const Qe=se.current.find(Ht=>ys(Ht,x).toLowerCase()===wt.toLowerCase());Qe!=null&&(L(Qe!==z.initialValue),Se(Qe,bt),P()&&K.commit(Qe))}be.set("forceMount",!0),queueMicrotask(xt)}}),id:t||Y||void 0,name:b?void 0:G,value:We,disabled:$,required:f&&!Ot,readOnly:p,ref:Je,style:ic,tabIndex:-1,"aria-hidden":!0}),It]})})}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 Xf=2,kP={...zu,...ja,value:()=>null},RP=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:b,readOnly:v,alignItemWithTriggerActiveRef:x,disabled:E,keyboardActiveRef:T}=$s(),A=g||E||u,M=Ae(C,ht.open),L=Ae(C,ht.value),P=Ae(C,ht.triggerProps),z=Ae(C,ht.positionerElement),H=Ae(C,ht.listElement),q=Ae(C,ht.serializedValue),I=hn(z),K=R.useRef(null),Y=Qt(),V=Qt(),{getButtonProps:$,buttonRef:G}=Sr({disabled:A,native:h}),j=Pe(te=>{C.set("triggerElement",te)}),U=cs(n,K,G,j),D=Qt(),N=Qt();R.useEffect(()=>{if(M)return N.start(200,()=>{y.current.allowUnselectedMouseUp=!0,D.start(200,()=>{y.current.allowSelectedMouseUp=!0})}),()=>{D.clear(),N.clear()};y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},V.clear()},[M,y,V,D,N]);const W=R.useMemo(()=>H?.id??Hu(z)?.id,[H,z]),Z=Ws(P,{role:"combobox","aria-expanded":M?"true":"false","aria-haspopup":"listbox","aria-controls":M?W:void 0,"aria-labelledby":S,"aria-readonly":v||void 0,tabIndex:A?-1:0,ref:U,onFocus(te){d(!0),M&&x.current&&w(!1,Ue(ka,te.nativeEvent)),Y.start(0,()=>{C.set("forceMount",!0)})},onBlur(){l(!0),d(!1),p==="onBlur"&&b.commit(L)},onPointerMove(){T.current=!1},onKeyDown(){T.current=!0},onMouseDown(te){if(M)return;const X=xr(te.currentTarget);function F(se){if(!K.current)return;const ne=se.target;if(ft(K.current,ne)||ft(I.current,ne)||ne===K.current)return;const re=L0(K.current);se.clientX>=re.left-Xf&&se.clientX<=re.right+Xf&&se.clientY>=re.top-Xf&&se.clientY<=re.bottom+Xf||w(!1,Ue(iE,se))}V.start(0,()=>{X.addEventListener("mouseup",F,{once:!0})})}},b.getValidationProps,a,$);Z.role="combobox";const ee=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:ee,stateAttributesMapping:kP,props:Z})}),TP={value:()=>null},LP=R.forwardRef(function(t,n){const{className:s,render:o,children:u,...h}=t,{store:a,valueRef:l}=$s(),d=Ae(a,ht.value),p=Ae(a,ht.items),f=Ae(a,ht.itemToStringLabel),g=Ae(a,ht.serializedValue),S=R.useMemo(()=>({value:d,placeholder:!g}),[d,g]),C=typeof u=="function"?u(d):u??(Array.isArray(d)?wP(d,f):CP(d,p,f));return at("span",t,{state:S,ref:[n,l],props:[{children:C},h],stateAttributesMapping:TP})}),AP=R.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h}=$s(),a=Ae(h,ht.open),l=R.useMemo(()=>({open:a}),[a]);return at("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:l0})}),OP=R.createContext(void 0),MP=R.forwardRef(function(t,n){const{store:s}=$s(),o=Ae(s,ht.mounted),u=Ae(s,ht.forceMount);return o||u?_.jsx(OP.Provider,{value:!0,children:_.jsx(hp,{ref:n,...t})}):null}),wk=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function DP(){return R.useContext(wk)}function ud(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:o}=e,u=Pe(o),h=R.useRef(0),a=Gn(jP).current,l=Gn(PP).current,[d,p]=R.useState(0),f=R.useRef(d),g=Pe((b,v)=>{l.set(b,v??null),f.current+=1,p(f.current)}),S=Pe(b=>{l.delete(b),f.current+=1,p(f.current)}),C=R.useMemo(()=>{const b=new Map;return Array.from(l.keys()).filter(x=>x.isConnected).sort(IP).forEach((x,E)=>{const T=l.get(x)??{};b.set(x,{...T,index:E})}),b},[l,d]);Ve(()=>{if(typeof MutationObserver!="function"||C.size===0)return;const b=new MutationObserver(v=>{const x=new Set,E=T=>x.has(T)?x.delete(T):x.add(T);v.forEach(T=>{T.removedNodes.forEach(E),T.addedNodes.forEach(E)}),x.size===0&&(f.current+=1,p(f.current))});return C.forEach((v,x)=>{x.parentElement&&b.observe(x.parentElement,{childList:!0})}),()=>{b.disconnect()}},[C]),Ve(()=>{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]),Ve(()=>()=>{n.current=[]},[n]),Ve(()=>()=>{s&&(s.current=[])},[s]);const w=Pe(b=>(a.add(b),()=>{a.delete(b)}));Ve(()=>{a.forEach(b=>b(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(wk.Provider,{value:y,children:t})}function PP(){return new Map}function jP(){return new Set}function IP(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 NP=R.createContext(void 0);function Ia(){return R.useContext(NP)?.direction??"ltr"}const BP=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=_E(p),S={x:n,y:s},C=g0(o),w=m0(C),y=await h.getDimensions(d),b=C==="y",v=b?"top":"left",x=b?"bottom":"right",E=b?"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 P=T/2-A/2,z=L/2-y[w]/2-1,H=Math.min(g[v],z),q=Math.min(g[x],z),I=H,K=L-y[w]-q,Y=L/2-y[w]/2+P,V=u_(I,Y,K),$=!l.arrow&&So(o)!=null&&Y!==V&&u.reference[w]/2-(Y<I?H:q)-y[w]/2<0,G=$?Y<I?Y-I:Y-K:0;return{[C]:S[C]+G,data:{[C]:V,centerOffset:Y-V-G,...$&&{alignmentOffset:G}},reset:$}}}),zP=(e,t)=>({...BP(e),options:[e,t]}),HP={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 S6().fn(e)).data?.referenceHidden||u}}}},VP={sideX:"left",sideY:"top"};function Ek(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 wC(e,t,n){const{rects:s,placement:o}=e;return{side:Ek(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:b,adaptiveOrigin:v,lazyFlip:x=!1,externalTree:E}=e,[T,A]=R.useState(null);!C&&T!==null&&A(null);const M=w.side||"flip",L=w.align||"flip",P=w.fallbackAxisSide||"end",z=typeof t=="function"?t:void 0,H=Pe(z),q=z?H:t,I=hn(t),Y=Ia()==="rtl",V=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":Y?"left":"right","inline-start":Y?"right":"left"}[s],$=u==="center"?V:`${V}-${u}`;let G=l;const j=1,U=s==="bottom"?j:0,D=s==="top"?j:0,N=s==="right"?j:0,W=s==="left"?j:0;typeof G=="number"?G={top:G+U,right:G+W,bottom:G+D,left:G+N}:G&&(G={top:(G.top||0)+U,right:(G.right||0)+W,bottom:(G.bottom||0)+D,left:(G.left||0)+N});const Z={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:G},ee=R.useRef(null),te=hn(o),X=hn(h),ne=[v6(Xe=>{const st=wC(Xe,s,Y),Ct=typeof te.current=="function"?te.current(st):te.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,Y,s])],re=L==="none"&&M!=="shift",oe=!re&&(d||y||M==="shift"),le=M==="none"?null:b6({...Z,padding:{top:G.top+j,right:G.right+j,bottom:G.bottom+j,left:G.left+j},mainAxis:!y&&M==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),ve=re?null:_6(Xe=>{const st=xr(Xe.elements.floating).documentElement;return{...Z,rootBoundary:y?{x:0,y:0,width:st.clientWidth,height:st.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:oe,limiter:d||y?void 0:y6(Ct=>{if(!ee.current)return{};const{width:ct,height:nn}=ee.current.getBoundingClientRect(),Rt=rs(Hr(Ct.placement)),vt=Rt==="y"?ct:nn,Je=Rt==="y"?G.left+G.right:G.top+G.bottom;return{offset:vt/2+Je/2}})}},[Z,d,y,G,L]);M==="shift"||L==="shift"||u==="center"?ne.push(ve,le):ne.push(le,ve),ne.push(x6({...Z,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)})}}),zP(()=>({element:ee.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=ee.current,It=Ct.arrow?.x||0,ot=Ct.arrow?.y||0,wt=Ot?.clientWidth||0,bt=Ot?.clientHeight||0,xt=It+wt/2,Qe=ot+bt/2,Ht=Math.abs(Ct.shift?.y||0),Rn=nn.reference.height/2,Yn=typeof o=="function"?o(wC(Xe,s,Y)):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),{}}},HP,v),Ve(()=>{!C&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[C,S]);const ge=R.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:ue,elements:de,x:Ie,y:De,middlewareData:Oe,update:be,placement:Me,context:pe,isPositioned:Re,floatingStyles:we}=Y6({rootContext:S,placement:$,middleware:ne,strategy:n,whileElementsMounted:g?void 0:(...Xe)=>lC(...Xe,ge),nodeId:b,externalTree:E}),{sideX:We,sideY:et}=Oe.adaptiveOrigin||VP,xe=Re?n:"fixed",Ge=R.useMemo(()=>v?{position:xe,[We]:Ie,[et]:De}:{position:xe,...we},[v,xe,We,Ie,et,De,we]),tt=R.useRef(null);Ve(()=>{if(!C)return;const Xe=I.current,st=typeof Xe=="function"?Xe():Xe,ct=(EC(st)?st.current:st)||null||null;ct!==tt.current&&(ue.setPositionReference(ct),tt.current=ct)},[C,ue,q,I]),R.useEffect(()=>{if(!C)return;const Xe=I.current;typeof Xe!="function"&&EC(Xe)&&Xe.current!==tt.current&&(ue.setPositionReference(Xe.current),tt.current=Xe.current)},[C,ue,q,I]),R.useEffect(()=>{if(g&&C&&de.domReference&&de.floating)return lC(de.domReference,de.floating,be,ge)},[g,C,de,be,ge]);const dt=Hr(Me),Se=Ek(s,dt,Y),He=So(Me)||"center",ke=!!Oe.hide?.referenceHidden;Ve(()=>{x&&C&&Re&&A(dt)},[x,C,Re,dt]);const nt=R.useMemo(()=>({position:"absolute",top:Oe.arrow?.y,left:Oe.arrow?.x}),[Oe.arrow]),lt=Oe.arrow?.centerOffset!==0;return R.useMemo(()=>({positionerStyles:Ge,arrowStyles:nt,arrowRef:ee,arrowUncentered:lt,side:Se,align:He,physicalSide:dt,anchorHidden:ke,refs:ue,context:pe,isPositioned:Re,update:be}),[Ge,nt,ee,lt,Se,He,dt,ke,ue,pe,Re,be])}function EC(e){return e!=null&&"current"in e}const kk=R.createContext(void 0);function O0(){const e=R.useContext(kk);if(!e)throw new Error(Pt(59));return e}function Fh(e,t){e&&Object.assign(e.style,t)}const Rk={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},FP={position:"fixed"},UP=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:b=t0,...v}=t,{store:x,listRef:E,labelsRef:T,alignItemWithTriggerActiveRef:A,selectedItemTextRef:M,valuesRef:L,initialValueRef:P,popupRef:z,setValue:H}=$s(),q=bk(),I=Ae(x,ht.open),K=Ae(x,ht.mounted),Y=Ae(x,ht.modal),V=Ae(x,ht.value),$=Ae(x,ht.openMethod),G=Ae(x,ht.positionerElement),j=Ae(x,ht.triggerElement),U=Ae(x,ht.isItemEqualToValue),D=R.useRef(null),N=R.useRef(null),[W,Z]=R.useState(y),ee=K&&W&&$!=="touch";!K&&W!==y&&Z(y),Ve(()=>{K||(ht.scrollUpArrowVisible(x.state)&&x.set("scrollUpArrowVisible",!1),ht.scrollDownArrowVisible(x.state)&&x.set("scrollDownArrowVisible",!1))},[x,K]),R.useImperativeHandle(A,()=>ee),xp((ee||Y)&&I&&$!=="touch",j);const te=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??ee,collisionAvoidance:b,keepMounted:!0}),X=ee?"none":te.side,F=ee?FP:te.positionerStyles,se=R.useMemo(()=>{const ue={};return I||(ue.pointerEvents="none"),{role:"presentation",hidden:!K,style:{...F,...ue}}},[I,K,F]),ne=R.useMemo(()=>({open:I,side:X,align:te.align,anchorHidden:te.anchorHidden}),[I,X,te.align,te.anchorHidden]),re=Pe(ue=>{x.set("positionerElement",ue)}),oe=at("div",t,{ref:[n,re],state:ne,stateAttributesMapping:xo,props:[se,v]}),le=R.useRef(0),ve=Pe(ue=>{if(ue.size===0&&le.current===0||L.current.length===0)return;const de=le.current;if(le.current=ue.size,ue.size===de)return;const Ie=Ue(Mn);if(de!==0&&!x.state.multiple&&V!==null&&Kl(L.current,V,U)===-1){const Oe=P.current,Me=Oe!=null&&la(L.current,Oe,U)?Oe:null;H(Me,Ie),Me===null&&(x.set("selectedIndex",null),M.current=null)}if(de!==0&&x.state.multiple&&Array.isArray(V)){const De=V.filter(Oe=>la(L.current,Oe,U));(De.length!==V.length||De.some(Oe=>!la(V,Oe,U)))&&(H(De,Ie),De.length===0&&(x.set("selectedIndex",null),M.current=null))}if(I&&ee){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const De={height:""};Fh(G,De),Fh(z.current,De)}}),ge=R.useMemo(()=>({...te,side:X,alignItemWithTriggerActive:ee,setControlledAlignItemWithTrigger:Z,scrollUpArrowRef:D,scrollDownArrowRef:N}),[te,X,ee,Z]);return _.jsx(ud,{elementsRef:E,labelsRef:T,onMapChange:ve,children:_.jsxs(kk.Provider,{value:ge,children:[K&&Y&&_.jsx(bp,{inert:yp(!I),cutout:j}),oe]})})});function Tk(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 Qf="base-ui-disable-scrollbar",Wu={className:Qf,element:_.jsx("style",{href:Qf,precedence:"base-ui:low",children:`.${Qf}{scrollbar-width:none}.${Qf}::-webkit-scrollbar{display:none}`})},WP=R.createContext(void 0);function M0(e){return R.useContext(WP)}function D0(e){return e==="starting"?cM:tn}const qP={...xo,...Gs},GP=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:b,alignItemWithTriggerActive:v,setControlledAlignItemWithTrigger:x,scrollDownArrowRef:E,scrollUpArrowRef:T}=O0(),A=M0()!=null,M=bk(),L=Qt(),P=Ae(h,ht.id),z=Ae(h,ht.open),H=Ae(h,ht.mounted),q=Ae(h,ht.popupProps),I=Ae(h,ht.transitionStatus),K=Ae(h,ht.triggerElement),Y=Ae(h,ht.positionerElement),V=Ae(h,ht.listElement),$=R.useRef(0),G=R.useRef(!1),j=R.useRef(0),U=R.useRef(!1),D=R.useRef({}),N=rd(),W=Pe(X=>{if(!Y||!a.current||!U.current)return;if(G.current||!v){C();return}const F=Y.style.top==="0px",se=Y.style.bottom==="0px",ne=Y.getBoundingClientRect().height,re=xr(Y),oe=getComputedStyle(Y),le=parseFloat(oe.marginTop),ve=parseFloat(oe.marginBottom),ge=re.documentElement.clientHeight-le-ve,ue=X.scrollTop,de=X.scrollHeight,Ie=X.clientHeight,De=de-Ie;let Oe=null,be=null,Me=!1;if(F){const pe=De-ue,Re=ne+pe,we=Math.min(Re,ge);Oe=we,we!==ge?be=De:Me=!0}else if(se){const pe=ue-0,Re=ne+pe,we=Math.min(Re,ge),We=Re-ge;Oe=we,we!==ge?be=0:(Me=!0,ue<De&&(be=ue-(pe-We)))}Oe!=null&&(Y.style.height=`${Oe}px`),be!=null&&(X.scrollTop=be),Me&&(G.current=!0),C()});R.useImperativeHandle(w,()=>W,[W]),Ur({open:z,ref:a,onComplete(){z&&l?.(!0)}});const Z=R.useMemo(()=>({open:z,transitionStatus:I,side:y,align:b}),[z,I,y,b]);Ve(()=>{!Y||!a.current||Object.keys(D.current).length||(D.current={top:Y.style.top||"0",left:Y.style.left||"0",right:Y.style.right,height:Y.style.height,bottom:Y.style.bottom,minHeight:Y.style.minHeight,maxHeight:Y.style.maxHeight,marginTop:Y.style.marginTop,marginBottom:Y.style.marginBottom})},[a,Y]),Ve(()=>{H||v||(U.current=!1,G.current=!1,$.current=0,j.current=0,Fh(Y,D.current))},[H,v,Y,a]),Ve(()=>{const X=a.current;if(!(!H||!K||!Y||!X)){if(!v){U.current=!0,N.request(C);return}queueMicrotask(()=>{const F=getComputedStyle(Y),se=getComputedStyle(X),ne=xr(K),re=kn(Y),oe=K.getBoundingClientRect(),le=Y.getBoundingClientRect(),ve=oe.left,ge=oe.height,ue=V||X,de=ue.scrollHeight,Ie=parseFloat(se.borderBottomWidth),De=parseFloat(F.marginTop)||10,Oe=parseFloat(F.marginBottom)||10,be=parseFloat(F.minHeight)||100,Me=5,pe=5,Re=20,we=ne.documentElement.clientHeight-De-Oe,We=ne.documentElement.clientWidth,et=we-oe.bottom+ge,xe=f.current,Ge=p.current;let tt=0,dt=0;if(xe&&Ge){const vt=Ge.getBoundingClientRect(),Je=xe.getBoundingClientRect(),Ot=vt.left-ve,It=Je.left-le.left,ot=vt.top-oe.top+vt.height/2,wt=Je.top-le.top+Je.height/2;tt=Ot-It,dt=wt-ot}const Se=et+dt+Oe+Ie;let He=Math.min(we,Se);const ke=we-De-Oe,nt=Se-He,lt=Math.max(Me,ve+tt),Xe=We-pe,st=Math.max(0,lt+le.width-Xe);Y.style.left=`${lt-st}px`,Y.style.height=`${He}px`,Y.style.maxHeight="auto",Y.style.marginTop=`${De}px`,Y.style.marginBottom=`${Oe}px`,X.style.height="100%";const Ct=ue.scrollHeight-ue.clientHeight,ct=nt>=Ct;ct&&(He=Math.min(we,le.height)-(nt-Ct));const nn=oe.top<Re||oe.bottom>we-Re||He<Math.min(de,be),Rt=(re.visualViewport?.scale??1)!==1&&d0;if(nn||Rt){U.current=!0,Fh(Y,D.current),er.flushSync(()=>x(!1));return}if(ct){const vt=Math.max(0,we-Se);Y.style.top=le.height>=ke?"0":`${vt}px`,Y.style.height=`${He}px`,ue.scrollTop=ue.scrollHeight-ue.clientHeight,$.current=Math.max(be,He)}else Y.style.bottom="0",$.current=Math.max(be,He),ue.scrollTop=nt;$.current===we&&(G.current=!0),C(),setTimeout(()=>{U.current=!0})})}},[h,H,Y,K,p,f,a,C,v,x,N,E,T,V]),R.useEffect(()=>{if(!v||!Y||!H)return;const X=kn(Y);function F(se){d(!1,Ue(N4,se))}return X.addEventListener("resize",F),()=>{X.removeEventListener("resize",F)}},[d,v,Y,H]);const ee={...V?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${P}-list`},onKeyDown(X){g.current=!0,A&&k0.has(X.key)&&X.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(X){if(Tk(X)||X.pointerType==="touch")return;const F=X.currentTarget;L.start(0,()=>{h.set("activeIndex",null),F.focus({preventScroll:!0})})},onScroll(X){V||w.current?.(X.currentTarget)},...v&&{style:V?{height:"100%"}:Rk}},te=at("div",t,{ref:[n,a],state:Z,stateAttributesMapping:qP,props:[q,ee,D0(I),{className:!V&&v?Wu.className:void 0},u]});return _.jsxs(R.Fragment,{children:[Wu.element,_.jsx(pp,{context:M,modal:!1,disabled:!H,restoreFocus:!0,children:te})]})}),$P=R.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h,scrollHandlerRef:a}=$s(),{alignItemWithTriggerActive:l}=O0(),d=Ae(h,ht.hasScrollArrows),p=Ae(h,ht.openMethod),f=Ae(h,ht.multiple),S={id:`${Ae(h,ht.id)}-list`,role:"listbox","aria-multiselectable":f||void 0,onScroll(w){a.current?.(w.currentTarget)},...l&&{style:Rk},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}=DP(),g=R.useRef(-1),[S,C]=R.useState(u??(o===P0.GuessFromOrder?()=>{if(g.current===-1){const b=f.current;f.current+=1,g.current=b}return g.current}:-1)),w=R.useRef(null),y=R.useCallback(b=>{if(w.current=b,S!==-1&&b!==null&&(d.current[S]=b,p)){const v=t!==void 0;p.current[S]=v?t:s?.current?.textContent??b.textContent}},[S,d,p,t,s]);return Ve(()=>{if(u!=null)return;const b=w.current;if(b)return h(b,n),()=>{a(b)}},[u,h,a,n]),Ve(()=>{if(u==null)return l(b=>{const v=w.current?b.get(w.current)?.index:null;v!=null&&C(v)})},[u,l,C]),R.useMemo(()=>({ref:y,index:S}),[S,y])}const Lk=R.createContext(void 0);function j0(){const e=R.useContext(Lk);if(!e)throw new Error(Pt(57));return e}const KP=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:b,valuesRef:v,keyboardActiveRef:x,multiple:E,highlightItemOnHover:T}=$s(),A=Qt(),M=Ae(g,ht.isActive,f.index),L=Ae(g,ht.isSelected,f.index,u),P=Ae(g,ht.isSelectedByFocus,f.index),z=Ae(g,ht.isItemEqualToValue),H=f.index,q=H!==-1,I=R.useRef(null),K=hn(H);Ve(()=>{if(!q)return;const te=v.current;return te[H]=u,()=>{delete te[H]}},[q,H,u,v]),Ve(()=>{if(!q)return;const te=g.state.value;let X=te;E&&Array.isArray(te)&&te.length>0&&(X=te[te.length-1]),X!==void 0&&Ci(X,u,z)&&g.set("selectedIndex",H)},[q,H,E,z,g,u]);const Y=R.useMemo(()=>({disabled:a,selected:L,highlighted:M}),[a,L,M]),V=S({active:M,selected:L});V.onFocus=void 0,V.id=void 0;const $=R.useRef(null),G=R.useRef("mouse"),j=R.useRef(!1),{getButtonProps:U,buttonRef:D}=Sr({disabled:a,focusableWhenDisabled:!0,native:l});function N(te){const X=g.state.value;if(E){const F=Array.isArray(X)?X:[],se=L?Sk(F,u,z):[...F,u];w(se,Ue(ma,te))}else w(u,Ue(ma,te)),C(!1,Ue(ma,te))}const W={role:"option","aria-selected":L,"aria-disabled":a||void 0,tabIndex:M?0:-1,onFocus(){g.set("activeIndex",H)},onMouseEnter(){!x.current&&g.state.selectedIndex===null&&g.set("activeIndex",H)},onMouseMove(){T&&g.set("activeIndex",H)},onMouseLeave(te){!T||x.current||Tk(te)||A.start(0,()=>{g.state.activeIndex===H&&g.set("activeIndex",null)})},onTouchStart(){y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(te){$.current=te.key,g.set("activeIndex",H)},onClick(te){j.current=!1,!(te.type==="keydown"&&$.current===null)&&(a||$.current===" "&&b.current||G.current!=="touch"&&!M||($.current=null,N(te.nativeEvent)))},onPointerEnter(te){G.current=te.pointerType},onPointerDown(te){G.current=te.pointerType,j.current=!0},onMouseUp(te){if(a)return;if(j.current){j.current=!1;return}const X=!y.current.allowSelectedMouseUp&&L,F=!y.current.allowUnselectedMouseUp&&!L;X||F||G.current!=="touch"&&!M||N(te.nativeEvent)}},Z=at("div",t,{ref:[D,n,f.ref,I],state:Y,props:[V,W,d,U]}),ee=R.useMemo(()=>({selected:L,indexRef:K,textRef:p,selectedByFocus:P,hasRegistered:q}),[L,K,p,P,q]);return _.jsx(Lk.Provider,{value:ee,children:Z})})),YP=R.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=j0();return s||o?_.jsx(XP,{...t,ref:n}):null}),XP=R.memo(R.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=j0(),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})),QP=R.memo(R.forwardRef(function(t,n){const{indexRef:s,textRef:o,selectedByFocus:u,hasRegistered:h}=j0(),{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})})),Ak=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,b=Ae(l,y),v=Ae(l,ht.openMethod),x=b&&v!=="touch",E=Qt(),T=u==="up"?w:C,{transitionStatus:A,setMounted:M}=ki(x);Ve(()=>(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:x,ref:T,onComplete(){x||M(!1)}});const L=R.useMemo(()=>({direction:u,visible:x,side:S,transitionStatus:A}),[u,x,S,A]),z=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 I(){const K=l.state.listElement??d.current;if(!K)return;l.set("activeIndex",null),f();const Y=K.scrollTop===0,V=Math.round(K.scrollTop+K.clientHeight)>=K.scrollHeight;if(p.current.length===0&&(u==="up"?l.set("scrollUpArrowVisible",!Y):l.set("scrollDownArrowVisible",!V)),u==="up"&&Y||u==="down"&&V){E.clear();return}if((l.state.listElement||d.current)&&p.current&&p.current.length>0){const G=p.current,j=T.current?.offsetHeight||0;if(u==="up"){let U=0;const D=K.scrollTop+j;for(let W=0;W<G.length;W+=1){const Z=G[W];if(Z&&Z.offsetTop>=D){U=W;break}}const N=Math.max(0,U-1);if(N<U){const W=G[N];W&&(K.scrollTop=Math.max(0,W.offsetTop-j))}else K.scrollTop=0}else{let U=G.length-1;const D=K.scrollTop+K.clientHeight-j;for(let W=0;W<G.length;W+=1){const Z=G[W];if(Z&&Z.offsetTop+Z.offsetHeight>D){U=Math.max(0,W-1);break}}const N=Math.min(G.length-1,U+1);if(N>U){const W=G[N];W&&(K.scrollTop=W.offsetTop+W.offsetHeight-K.clientHeight+j)}else K.scrollTop=K.scrollHeight-K.clientHeight}}E.start(40,I)}E.start(40,I)},onMouseLeave(){E.clear()}},a]});return x||h?z:null}),ZP=R.forwardRef(function(t,n){return _.jsx(Ak,{...t,ref:n,direction:"down"})}),JP=R.forwardRef(function(t,n){return _.jsx(Ak,{...t,ref:n,direction:"up"})}),jl=EP;function Il({className:e,...t}){return _.jsx(LP,{"data-slot":"select-value",className:Be("flex flex-1 text-left",e),...t})}function Nl({className:e,size:t="default",children:n,...s}){return _.jsxs(RP,{"data-slot":"select-trigger","data-size":t,className:Be("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(AP,{render:_.jsx(_e,{icon:R4,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(MP,{children:_.jsx(UP,{side:n,sideOffset:s,align:o,alignOffset:u,alignItemWithTrigger:h,className:"isolate z-50",children:_.jsxs(GP,{"data-slot":"select-content",className:Be("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(e9,{}),_.jsx($P,{children:t}),_.jsx(t9,{})]})})})}function vr({className:e,children:t,...n}){return _.jsxs(KP,{"data-slot":"select-item",className:Be("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(QP,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),_.jsx(YP,{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 e9({className:e,...t}){return _.jsx(JP,{"data-slot":"select-scroll-up-button",className:Be("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:Z2,strokeWidth:2})})}function t9({className:e,...t}){return _.jsx(ZP,{"data-slot":"select-scroll-down-button",className:Be("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:Y2,strokeWidth:2})})}const Ok=R.createContext(void 0);function I0(){const e=R.useContext(Ok);if(e===void 0)throw new Error(Pt(64));return e}let n9=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const N0={tabActivationDirection:e=>({[n9.activationDirection]:e})},r9=R.forwardRef(function(t,n){const{className:s,defaultValue:o=0,onValueChange:u,orientation:h="horizontal",render:a,value:l,...d}=t,p=Ia(),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"}),b=l!==void 0,[v,x]=R.useState(()=>new Map),[E,T]=R.useState("none"),A=Pe(($,G)=>{u?.($,G),!G.isCanceled&&(y($),T(G.activationDirection))}),M=Pe(($,G)=>{C(j=>{if(j.get($)===G)return j;const U=new Map(j);return U.set($,G),U})}),L=Pe(($,G)=>{C(j=>{if(!j.has($)||j.get($)!==G)return j;const U=new Map(j);return U.delete($),U})}),P=R.useCallback($=>S.get($),[S]),z=R.useCallback($=>{for(const G of v.values())if($===G?.value)return G?.id},[v]),H=R.useCallback($=>{if($===void 0)return null;for(const[G,j]of v.entries())if(j!=null&&$===(j.value??j.index))return G;return null},[v]),q=R.useMemo(()=>({direction:p,getTabElementBySelectedValue:H,getTabIdByPanelValue:z,getTabPanelIdByValue:P,onValueChange:A,orientation:h,registerMountedTabPanel:M,setTabMap:x,unregisterMountedTabPanel:L,tabActivationDirection:E,value:w}),[p,H,z,P,A,h,M,x,L,E,w]),I=R.useMemo(()=>{for(const $ of v.values())if($!=null&&$.value===w)return $},[v,w]),K=R.useMemo(()=>{for(const $ of v.values())if($!=null&&!$.disabled)return $.value},[v]);Ve(()=>{if(b||v.size===0)return;const $=I?.disabled,G=I==null&&w!==null;if(f&&$&&w===o||!$&&!G)return;const U=K??null;w!==U&&(y(U),T("none"))},[o,K,f,b,I,T,y,v,w]);const V=at("div",t,{state:{orientation:h,tabActivationDirection:E},ref:n,props:d,stateAttributesMapping:N0});return _.jsx(Ok.Provider,{value:q,children:_.jsx(ud,{elementsRef:g,children:V})})}),Mk="data-composite-item-active";function Dk(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=J_(),{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 Pk=R.createContext(void 0);function s9(){const e=R.useContext(Pk);if(e===void 0)throw new Error(Pt(65));return e}const i9=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}=I0(),{activateOnFocus:S,highlightedTabIndex:C,onTabActivation:w,setHighlightedTabIndex:y,tabsListElement:b}=s9(),v=ar(a),x=R.useMemo(()=>({disabled:o,id:v,value:h}),[o,v,h]),{compositeProps:E,compositeRef:T,index:A}=Dk({metadata:x}),M=h===p,L=R.useRef(!1);Ve(()=>{if(L.current){L.current=!1;return}if(!(M&&A>-1&&C!==A))return;const j=b;if(j!=null){const U=_s(xr(j));if(U&&ft(j,U))return}o||y(A)},[M,A,C,y,o,b]);const{getButtonProps:P,buttonRef:z}=Sr({disabled:o,native:l,focusableWhenDisabled:!0}),H=f(h),q=R.useRef(!1),I=R.useRef(!1);function K(j){M||o||w(h,Ue(Mn,j.nativeEvent,void 0,{activationDirection:"none"}))}function Y(j){M||(A>-1&&!o&&y(A),!o&&S&&(!q.current||q.current&&I.current)&&w(h,Ue(Mn,j.nativeEvent,void 0,{activationDirection:"none"})))}function V(j){if(M||o)return;q.current=!0;function U(){q.current=!1,I.current=!1}(!j.button||j.button===0)&&(I.current=!0,xr(j.currentTarget).addEventListener("pointerup",U,{once:!0}))}const $=R.useMemo(()=>({disabled:o,active:M,orientation:g}),[o,M,g]);return at("button",t,{state:$,ref:[n,z,T],props:[E,{role:"tab","aria-controls":H,"aria-selected":M,id:v,onClick:K,onFocus:Y,onPointerDown:V,[Mk]:M?"":void 0,onKeyDownCapture(){L.current=!0}},d,P]})});let o9=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const a9=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}=I0(),C=ar(),w=R.useMemo(()=>({id:C,value:o}),[C,o]),{ref:y,index:b}=ac({metadata:w}),v=o!==l,x=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":x,hidden:v,id:C??void 0,role:"tabpanel",tabIndex:v?-1:0,[o9.index]:b},a],stateAttributesMapping:N0});return Ve(()=>{if(!(v&&!h)&&C!=null)return g(o,C),()=>{S(o,C)}},[v,h,o,C,g,S]),!v||h?T:null});function l9(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const c9=[];function u9(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=c9}=e,[C,w]=R.useState(0),y=n>1,b=R.useRef(null),v=cs(b,d),x=R.useRef([]),E=R.useRef(!1),T=a??C,A=Pe((P,z=!1)=>{if((l??w)(P),z){const H=x.current[P];mC(b.current,H,h,u)}}),M=Pe(P=>{if(P.size===0||E.current)return;E.current=!0;const z=Array.from(P.keys()),H=z.find(I=>I?.hasAttribute(Mk))??null,q=H?z.indexOf(H):-1;q!==-1&&A(q),mC(b.current,H,h,u)}),L=R.useMemo(()=>({"aria-orientation":u==="both"?void 0:u,ref:v,onFocus(P){!b.current||!pC(P.target)||P.target.setSelectionRange(0,P.target.value.length??0)},onKeyDown(P){const z=p?m8:ak;if(!z.has(P.key)||d9(P,S)||!b.current)return;const q=h==="rtl",I=q?Uu:Pl,K={horizontal:I,vertical:oa,both:I}[u],Y=q?Pl:Uu,V={horizontal:Y,vertical:Dl,both:Y}[u];if(pC(P.target)&&!l9(P.target)){const W=P.target.selectionStart,Z=P.target.selectionEnd,ee=P.target.value??"";if(W==null||P.shiftKey||W!==Z||P.key!==V&&W<ee.length||P.key!==K&&W>0)return}let $=T;const G=fh(x,g),j=f_(x,g);if(y){const W=t||Array.from({length:x.current.length},()=>({width:1,height:1})),Z=bE(W,n,o),ee=Z.findIndex(X=>X!=null&&!mo(x,X,g)),te=Z.reduce((X,F,se)=>F!=null&&!mo(x,F,g)?se:X,-1);$=Z[yE({current:Z.map(X=>X?x.current[X]:null)},{event:P,orientation:u,loopFocus:s,cols:n,disabledIndices:SE([...g||x.current.map((X,F)=>mo(x,F)?F:void 0),void 0],Z),minIndex:ee,maxIndex:te,prevIndex:xE(T>j?G:T,W,Z,n,P.key===oa?"bl":P.key===Pl?"tr":"tl"),rtl:q})]}const U={horizontal:[I],vertical:[oa],both:[I,oa]}[u],D={horizontal:[Y],vertical:[Dl],both:[Y,Dl]}[u],N=y?z:{horizontal:p?h8:ik,vertical:p?p8:ok,both:z}[u];p&&(P.key===id?$=G:P.key===od&&($=j)),$===T&&(U.includes(P.key)||D.includes(P.key))&&(s&&$===j&&U.includes(P.key)?$=G:s&&$===G&&D.includes(P.key)?$=j:$=Wn(x,{startingIndex:$,decrement:D.includes(P.key),disabledIndices:g})),$!==T&&!Ll(x,$)&&(f&&P.stopPropagation(),N.has(P.key)&&P.preventDefault(),A($,!0),queueMicrotask(()=>{x.current[$]?.focus()}))}}),[n,o,h,g,x,p,T,y,t,s,v,S,A,u,f]);return R.useMemo(()=>({props:L,highlightedIndex:T,onHighlightedIndexChange:A,elementsRef:x,disabledIndices:g,onMapChange:M,relayKeyboardEvent:L.onKeyDown}),[L,T,A,x,g,M])}function d9(e,t){for(const n of b8.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function jk(e){const{render:t,className:n,refs:s=br,props:o=br,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:b,disabledIndices:v,modifierKeys:x,highlightItemOnHover:E=!1,tag:T="div",...A}=e,M=Ia(),{props:L,highlightedIndex:P,onHighlightedIndexChange:z,elementsRef:H,onMapChange:q,relayKeyboardEvent:I}=u9({itemSizes:f,cols:S,loopFocus:g,dense:p,orientation:d,highlightedIndex:a,onHighlightedIndexChange:l,rootRef:b,stopEventPropagation:y,enableHomeAndEndKeys:C,direction:M,disabledIndices:v,modifierKeys:x}),K=at(T,e,{state:u,ref:s,props:[L,...o,A],stateAttributesMapping:h}),Y=R.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:z,highlightItemOnHover:E,relayKeyboardEvent:I}),[P,z,E,I]);return _.jsx(O2.Provider,{value:Y,children:_.jsx(ud,{elementsRef:H,onMapChange:V=>{w?.(V),q(V)},children:K})})}const f9=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}=I0(),[C,w]=R.useState(0),[y,b]=R.useState(null),v=h9(f,p,y,l),x=Pe((M,L)=>{if(M!==f){const P=v(M);L.activationDirection=P,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:x,setHighlightedTabIndex:w,tabsListElement:y,value:f}),[s,C,x,w,y,f]);return _.jsx(Pk.Provider,{value:A,children:_.jsx(jk,{render:h,className:o,state:E,refs:[n,b],props:[T,a],stateAttributesMapping:N0,highlightedIndex:C,enableHomeAndEndKeys:!0,loopFocus:u,orientation:p,onHighlightedIndexChange:w,onMapChange:g,disabledIndices:br})})});function kC(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 h9(e,t,n,s){const[o,u]=R.useState(null);return Ve(()=>{if(e==null||n==null){u(null);return}const h=s(e);if(h==null){u(null);return}const{left:a,top:l}=kC(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}=kC(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(r9,{"data-slot":"tabs","data-orientation":t,className:Be("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const p9=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(f9,{"data-slot":"tabs-list","data-variant":t,className:Be(p9({variant:t}),e),...n})}function ir({className:e,...t}){return _.jsx(i9,{"data-slot":"tabs-trigger",className:Be("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(a9,{"data-slot":"tabs-content",className:Be("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function m9(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 dk({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");uk({store:g,actionsRef:h,parentContext:p?.store.context});const C=R.useMemo(()=>({store:g}),[g]);return _.jsx(a0.Provider,{value:C,children:typeof t=="function"?t({payload:S}):t})}const Ik=R.createContext(void 0),Nk=R.createContext(void 0),Bk=R.createContext(void 0),zk=R.createContext("");function Ri(){const e=R.useContext(Ik);if(!e)throw new Error(Pt(22));return e}function wp(){const e=R.useContext(Nk);if(!e)throw new Error(Pt(23));return e}function Na(){const e=R.useContext(Bk);if(!e)throw new Error(Pt(24));return e}function B0(){return R.useContext(zk)}const qe={id:Ee(e=>e.id),query:Ee(e=>e.query),items:Ee(e=>e.items),selectedValue:Ee(e=>e.selectedValue),open:Ee(e=>e.open),mounted:Ee(e=>e.mounted),forceMounted:Ee(e=>e.forceMounted),inline:Ee(e=>e.inline),activeIndex:Ee(e=>e.activeIndex),selectedIndex:Ee(e=>e.selectedIndex),isActive:Ee((e,t)=>e.activeIndex===t),isSelected:Ee((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:Ee(e=>e.transitionStatus),popupProps:Ee(e=>e.popupProps),inputProps:Ee(e=>e.inputProps),triggerProps:Ee(e=>e.triggerProps),getItemProps:Ee(e=>e.getItemProps),positionerElement:Ee(e=>e.positionerElement),listElement:Ee(e=>e.listElement),triggerElement:Ee(e=>e.triggerElement),inputElement:Ee(e=>e.inputElement),popupSide:Ee(e=>e.popupSide),openMethod:Ee(e=>e.openMethod),inputInsidePopup:Ee(e=>e.inputInsidePopup),selectionMode:Ee(e=>e.selectionMode),listRef:Ee(e=>e.listRef),labelsRef:Ee(e=>e.labelsRef),popupRef:Ee(e=>e.popupRef),emptyRef:Ee(e=>e.emptyRef),inputRef:Ee(e=>e.inputRef),keyboardActiveRef:Ee(e=>e.keyboardActiveRef),chipsContainerRef:Ee(e=>e.chipsContainerRef),clearRef:Ee(e=>e.clearRef),valuesRef:Ee(e=>e.valuesRef),allValuesRef:Ee(e=>e.allValuesRef),name:Ee(e=>e.name),disabled:Ee(e=>e.disabled),readOnly:Ee(e=>e.readOnly),required:Ee(e=>e.required),grid:Ee(e=>e.grid),isGrouped:Ee(e=>e.isGrouped),virtualized:Ee(e=>e.virtualized),onOpenChangeComplete:Ee(e=>e.onOpenChangeComplete),openOnInputClick:Ee(e=>e.openOnInputClick),itemToStringLabel:Ee(e=>e.itemToStringLabel),isItemEqualToValue:Ee(e=>e.isItemEqualToValue),modal:Ee(e=>e.modal),autoHighlight:Ee(e=>e.autoHighlight),submitOnItemClick:Ee(e=>e.submitOnItemClick)};function g9(e,t){return(n,s)=>{if(n==null)return!1;const o=An(n,t);return e.contains(o,s)}}function v9(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 RC=new Map;function Hk(e){return Array.isArray(e)?e.map(t=>Hk(t)).join(","):e==null?"":String(e)}function _9(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Hk(e.locale)}|${JSON.stringify(t)}`,s=RC.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 RC.set(n,u),u}const y9=_9,Vk=Symbol("none"),Ko={value:Vk,index:-1};function b9(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:b,filter:v,openOnInputClick:x=!0,autoHighlight:E=!1,keepHighlight:T=!1,highlightItemOnHover:A=!0,itemToStringLabel:M,itemToStringValue:L,isItemEqualToValue:P=xk,virtualized:z=!1,inline:H=!1,fillInputOnItemPress:q=!0,modal:I=!1,limit:K=-1,autoComplete:Y="list",locale:V,submitOnItemClick:$=!1}=e,{clearErrors:G}=ad(),{setDirty:j,validityData:U,shouldValidateOnChange:D,setFilled:N,name:W,disabled:Z,validation:ee}=us(),te=Cp({id:t}),X=y9({locale:V}),[F,se]=R.useState(!1),[ne,re]=R.useState(null),oe=R.useRef([]),le=R.useRef([]),ve=R.useRef(null),ge=R.useRef(null),ue=R.useRef(null),de=R.useRef(!0),Ie=R.useRef(!1),De=R.useRef(null),Oe=R.useRef(null),be=R.useRef(null),Me=R.useRef(Ko),pe=R.useRef(null),Re=R.useRef([]),we=R.useRef([]),We=Z||f,et=W??p,xe=l==="multiple",Ge=l==="single",tt=a!==void 0||h!==void 0,dt=y!==void 0,Se=b!==void 0;let He;E==="always"?He="always":He=E?"input-change":!1;const[ke,nt]=as({controlled:o,default:xe?s??br:s,name:"Combobox",state:"selectedValue"}),lt=R.useMemo(()=>v===null?()=>!0:v!==void 0?v:Ge&&!F?v9(X,M,ke):g9(X,M),[v,Ge,ke,F,X,M]),Xe=Gn(()=>tt?h??"":Ge?An(ke,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=Ck(y),vt=ne??(st===""?"":String(st).trim()),Je=Ge?An(ke,M):"",Ot=Ge&&!F&&vt!==""&&Je!==""&&Je.length===vt.length&&X.contains(Je,vt),It=Ot?"":vt,ot=dt&&Se&&Ot,wt=R.useMemo(()=>y?Rt?y.flatMap(Fe=>Fe.items):y:br,[y,Rt]),bt=R.useMemo(()=>{if(b&&!ot)return b;if(!y)return br;if(Rt){const rt=y,mt=[];let $t=0;for(const rn of rt){if(K>-1&&$t>=K)break;const vn=It===""?rn.items:rn.items.filter(ti=>lt(ti,It,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(It==="")return K>-1?wt.slice(0,K):wt;const Fe=[];for(const rt of wt){if(K>-1&&Fe.length>=K)break;lt(rt,It,M)&&Fe.push(rt)}return Fe},[b,ot,y,Rt,It,K,lt,M,wt]),xt=R.useMemo(()=>Rt?bt.flatMap(rt=>rt.items):bt,[bt,Rt]),Qe=Gn(()=>new va({id:te,selectedValue:ke,open:ct,filter:lt,query:vt,items:y,selectionMode:l,listRef:oe,labelsRef:le,popupRef:ve,emptyRef:ue,inputRef:ge,keyboardActiveRef:de,chipsContainerRef:De,clearRef:Oe,valuesRef:Re,allValuesRef:we,selectionEventRef:be,name:et,disabled:We,readOnly:g,required:S,grid:w,isGrouped:Rt,virtualized:z,openOnInputClick:x,itemToStringLabel:M,isItemEqualToValue:P,modal:I,autoHighlight:He,submitOnItemClick:$,hasInputValue:tt,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:H,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:ke,Rn=R.useMemo(()=>l==="none"?Ht:Array.isArray(ke)?ke.map(Fe=>ys(Fe,L)):ys(ke,L),[Ht,L,l,ke]),Yn=Pe(d),zn=Pe(n),Es=Ae(Qe,qe.activeIndex),Fa=Ae(Qe,qe.selectedIndex),wr=Ae(Qe,qe.positionerElement),pn=Ae(Qe,qe.listElement),mn=Ae(Qe,qe.triggerElement),ks=Ae(Qe,qe.inputElement),Er=Ae(Qe,qe.inline),Xs=Ae(Qe,qe.inputInsidePopup),Ip=hn(mn),{mounted:xc,setMounted:Ro,transitionStatus:To}=ki(ct),{openMethod:Qs,triggerProps:Rs,reset:Lo}=Sp(ct);ld({id:te,name:et,commit:ee.commit,value:Ht,controlRef:Xs?Ip:ge,getValue:()=>Rn});const ds=Pe(()=>{y?le.current=xt.map(Fe=>An(Fe,M)):Qe.set("forceMounted",!0)}),gn=R.useRef(ke);Ve(()=>{ke!==gn.current&&ds()},[ds,ke]);const tr=Pe(Fe=>{Qe.update(Fe);const rt=Fe.type||"none";if(Fe.activeIndex!==void 0)if(Fe.activeIndex===null)Me.current!==Ko&&(Me.current=Ko,Yn(void 0,yu(rt,void 0,{index:-1})));else{const mt=Re.current[Fe.activeIndex];Me.current={value:mt,index:Fe.activeIndex},Yn(mt,yu(rt,void 0,{index:Fe.activeIndex}))}}),nr=Pe((Fe,rt)=>{if(Ie.current=rt.reason===no,e.onInputValueChange?.(Fe,rt),!rt.isCanceled){if(rt.reason===ia){const mt=Fe.trim()!=="";mt&&se(!0),pe.current={hasQuery:mt},mt&&He&&Qe.state.activeIndex==null&&Qe.set("activeIndex",0)}Ct(Fe)}}),kr=Pe((Fe,rt)=>{ct!==Fe&&(rt.reason==="escape-key"&&dt&&xt.length===0&&!Qe.state.emptyRef.current&&rt.allowPropagation(),e.onOpenChange?.(Fe,rt),!rt.isCanceled&&(!Fe&&F&&(Ge?(re(vt),vt===""&&se(!1)):xe&&(Er||Xs?tr({activeIndex:null}):re(vt),nr("",Ue(no,rt.event)))),nn(Fe)))}),fs=Pe((Fe,rt)=>{if(u?.(Fe,rt),rt.isCanceled)return;nt(Fe),(l==="none"&&ve.current&&q||Ge&&!Qe.state.inputInsidePopup)&&nr(An(Fe,M),Ue(rt.reason,rt.event)),Ge&&Fe!=null&&rt.reason!==ia&&F&&re(vt)}),Np=Pe((Fe,rt)=>{let mt=rt;if(mt===void 0){if(Es===null)return;mt=Re.current[Es]}const $t=Pn(Fe),rn=be.current??Fe;be.current=null;const vn=Ue(ma,rn),Js=$t?.closest("a")?.getAttribute("href");if(Js){Js.startsWith("#")&&kr(!1,vn);return}if(xe){const ei=Array.isArray(ke)?ke:[],hs=la(ei,mt,Qe.state.isItemEqualToValue)?Sk(ei,mt,Qe.state.isItemEqualToValue):[...ei,mt];if(fs(hs,vn),!(ge.current?ge.current.value.trim()!=="":!1))return;Qe.state.inputInsidePopup?nr("",Ue(no,vn.event)):kr(!1,vn)}else fs(mt,vn),kr(!1,vn)}),Ua=Pe(()=>{if(!Qe.state.submitOnItemClick)return;const Fe=Qe.state.inputElement?.form;Fe&&typeof Fe.requestSubmit=="function"&&Fe.requestSubmit()}),Wa=Pe(()=>{if(Ro(!1),zn?.(!1),se(!1),Lo(),re(null),tr(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),xe&&ge.current&&ge.current.value!==""&&!Ie.current&&nr("",Ue(no)),Ge)if(Qe.state.inputInsidePopup)ge.current&&ge.current.value!==""&&nr("",Ue(no));else{const Fe=An(ke,M);ge.current&&ge.current.value!==Fe&&nr(Fe,Ue(Fe===""?no:Mn))}}),Bp=R.useMemo(()=>Er&&wr?{current:wr.closest('[role="dialog"]')}:ve,[Er,wr]);Ur({enabled:!e.actionsRef,open:ct,ref:Bp,onComplete(){ct||Wa()}}),R.useImperativeHandle(e.actionsRef,()=>({unmount:Wa}),[Wa]),Ve(function(){if(ct||l==="none")return;const rt=y?wt:we.current;if(xe){const mt=Array.isArray(ke)?ke:[],$t=mt[mt.length-1],rn=Kl(rt,$t,P);tr({selectedIndex:rn===-1?null:rn})}else{const mt=Kl(rt,ke,P);tr({selectedIndex:mt===-1?null:mt})}},[ct,ke,y,l,wt,xe,P,tr]),Ve(()=>{y&&(Re.current=xt,oe.current.length=xt.length)},[y,xt]),Ve(()=>{const Fe=pe.current;if(Fe&&(Fe.hasQuery?He&&Qe.set("activeIndex",0):He==="always"&&Qe.set("activeIndex",0),pe.current=null),!ct&&!Er)return;const mt=dt||Se?xt:Re.current,$t=Qe.state.activeIndex;if($t==null){if(He==="always"&&mt.length>0){Qe.set("activeIndex",0);return}Me.current!==Ko&&(Me.current=Ko,Qe.state.onItemHighlighted(void 0,yu(Mn,void 0,{index:-1})));return}if($t>=mt.length){Me.current!==Ko&&(Me.current=Ko,Qe.state.onItemHighlighted(void 0,yu(Mn,void 0,{index:-1}))),Qe.set("activeIndex",null);return}const rn=mt[$t],vn=Me.current.value,Js=vn!==Vk&&Qe.state.isItemEqualToValue(rn,vn);(Me.current.index!==$t||!Js)&&(Me.current={value:rn,index:$t},Qe.state.onItemHighlighted(rn,yu(Mn,void 0,{index:$t})))},[Es,He,Se,dt,xt,Er,ct,Qe]),Ve(()=>{if(!y||l==="none")return;const Fe=wt;if(xe){const $t=Array.isArray(ke)?ke:br,rn=$t.filter(vn=>la(Fe,vn,Qe.state.isItemEqualToValue));rn.length!==$t.length&&nt(rn);return}if(ke==null?!0:la(Fe,ke,Qe.state.isItemEqualToValue))return;let mt=null;if(s!=null&&la(Fe,s,Qe.state.isItemEqualToValue)&&(mt=s),nt(mt),!Qe.state.inputInsidePopup){const $t=An(mt,M);ge.current&&ge.current.value!==$t&&nr($t,Ue(Mn))}},[y,wt,xe,l,ke,s,nt,M,Qe,nr]),Ve(()=>{if(l==="none"){N(String(st)!=="");return}N(xe?Array.isArray(ke)&&ke.length>0:ke!=null)},[N,l,st,ke,xe]),R.useEffect(()=>{dt&&He&&xt.length===0&&tr({activeIndex:null})},[dt,He,xt.length,tr]),ca(vt,()=>{!ct||vt===""||vt===String(Xe)||se(!0)}),ca(ke,()=>{if(l!=="none"&&(G(et),j(ke!==U.initialValue),D()?ee.commit(ke):ee.commit(ke,!0),xe&&Qe.state.selectedIndex!==null&&(!Array.isArray(ke)||ke.length===0)&&tr({activeIndex:null,selectedIndex:null}),Ge&&!tt&&!Xs)){const Fe=An(ke,M);st!==Fe&&nr(Fe,Ue(Mn))}}),ca(st,()=>{l==="none"&&(G(et),j(st!==U.initialValue),D()?ee.commit(st):ee.commit(st,!0))}),ca(y,()=>{if(!Ge||tt||Xs||F)return;const Fe=An(ke,M);st!==Fe&&nr(Fe,Ue(Mn))});const Zs=C0({open:Er?!0:ct,onOpenChange:kr,elements:{reference:Xs?mn:ks,floating:wr}});let Ti,Rr;Er||(Ti=w?"grid":"listbox",Rr=ct?"true":"false");const lr=R.useMemo(()=>{const Fe=ks?.tagName==="INPUT",rt=Fe||ct,mt=Fe?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return rt&&(mt.role="combobox",mt["aria-expanded"]=Rr,mt["aria-haspopup"]=Ti,mt["aria-controls"]=ct?pn?.id:void 0,mt["aria-autocomplete"]=Y),{reference:mt,floating:{role:"presentation"}}},[ks,ct,Rr,Ti,pn?.id,Y]),_d=sd(Zs,{enabled:!g&&!We&&x,event:"mousedown-only",toggle:!1,touchOpenDelay:Xs?0:50}),zp=gp(Zs,{enabled:!g&&!We&&!Er,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Er?!0:void 0,outsidePress(Fe){const rt=Pn(Fe);return!ft(mn,rt)&&!ft(Oe.current,rt)&&!ft(De.current,rt)}}),Sc=w0(Zs,{enabled:!g&&!We,id:te,listRef:oe,activeIndex:Es,selectedIndex:Fa,virtual:!0,loopFocus:!0,allowEscape:!He,focusItemOnOpen:F||l==="none"&&!He?!1:"auto",focusItemOnHover:A,resetOnPointerLeave:!T,cols:w?2:1,orientation:w?"horizontal":void 0,disabledIndices:br,onNavigate(Fe,rt){!rt&&!ct||To==="ending"||tr(rt?{activeIndex:Fe,type:de.current?"keyboard":"pointer"}:{activeIndex:Fe})}}),{getReferenceProps:qa,getFloatingProps:Li,getItemProps:Cc}=oc([lr,_d,zp,Sc]);vk(()=>{Qe.update({inline:H,popupProps:Li(),inputProps:qa(),triggerProps:Rs,getItemProps:Cc,setOpen:kr,setInputValue:nr,setSelectedValue:fs,setIndices:tr,onItemHighlighted:Yn,handleSelection:Np,forceMount:ds,requestSubmit:Ua})}),Ve(()=>{Qe.update({id:te,selectedValue:ke,open:ct,mounted:xc,transitionStatus:To,items:y,inline:H,popupProps:Li(),inputProps:qa(),triggerProps:Rs,openMethod:Qs,getItemProps:Cc,selectionMode:l,name:et,disabled:We,readOnly:g,required:S,grid:w,isGrouped:Rt,virtualized:z,onOpenChangeComplete:zn,openOnInputClick:x,itemToStringLabel:M,modal:I,autoHighlight:He,isItemEqualToValue:P,submitOnItemClick:$,hasInputValue:tt,requestSubmit:Ua})},[Qe,te,ke,ct,xc,To,y,Li,qa,Cc,Qs,Rs,l,et,We,g,S,ee,w,Rt,z,zn,x,M,I,P,$,tt,H,Ua,He]);const cr=cs(C,ee.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=xe&&Array.isArray(ke)&&ke.length>0,Ai=R.useMemo(()=>!xe||!Array.isArray(ke)||!et?null:ke.map(Fe=>{const rt=ys(Fe,L);return _.jsx("input",{type:"hidden",name:et,value:rt},rt)}),[xe,ke,et,L]),bd=_.jsxs(R.Fragment,{children:[e.children,_.jsx("input",{...ee.getInputValidationProps({onFocus(){if(Xs){mn?.focus();return}(ge.current||mn)?.focus()},onChange(Fe){if(Fe.nativeEvent.defaultPrevented)return;const rt=Fe.target.value,mt=Ue(ia,Fe.nativeEvent);function $t(){if(xe)return;if(l==="none"){j(rt!==U.initialValue),nr(rt,mt),D()&&ee.commit(rt);return}const rn=Re.current.find(vn=>ys(vn,L).toLowerCase()===rt.toLowerCase());rn!=null&&(j(rn!==U.initialValue),fs?.(rn,mt),D()&&ee.commit(rn))}y?$t():(ds(),queueMicrotask($t))}}),id:te,name:xe||l==="none"?void 0:et,disabled:We,required:S&&!Ec,readOnly:g,value:yd,ref:cr,style:ic,tabIndex:-1,"aria-hidden":!0}),Ai]});return _.jsx(Ik.Provider,{value:Qe,children:_.jsx(Nk.Provider,{value:Zs,children:_.jsx(Bk.Provider,{value:wc,children:_.jsx(zk.Provider,{value:st,children:bd})})})})}const Zf=2,x9={...zu,...ja},S9=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=Ae(w,qe.selectionMode),b=Ae(w,qe.disabled),v=Ae(w,qe.readOnly),x=Ae(w,qe.listElement),E=Ae(w,qe.triggerProps),T=Ae(w,qe.triggerElement),A=Ae(w,qe.inputInsidePopup),M=Ae(w,qe.open),L=Ae(w,qe.selectedValue),P=Ae(w,qe.activeIndex),z=Ae(w,qe.selectedIndex),H=wp(),q=B0(),I=Qt(),K=d||b||h,Y=R.useRef("");function V(ee){Y.current=ee.pointerType}const $=H.select("domReferenceElement");R.useEffect(()=>{A&&T&&T!==$&&H.set("domReferenceElement",T)},[T,$,H,A]);const{reference:G}=E0(H,{enabled:!M&&!v&&!b&&y==="single",listRef:w.state.labelsRef,activeIndex:P,selectedIndex:z,onMatch(ee){const te=w.state.valuesRef.current[ee];te!==void 0&&w.state.setSelectedValue(te,Ue("none"))}}),{reference:j}=sd(H,{enabled:!v&&!b,event:"mousedown"}),{buttonRef:U,getButtonProps:D}=Sr({native:u,disabled:K}),N=R.useMemo(()=>({...l,open:M,disabled:K}),[l,M,K]),W=Pe(ee=>{w.set("triggerElement",ee)});return at("button",t,{ref:[n,U,W],state:N,props:[E,j,G,{tabIndex:A?0:-1,disabled:K,role:A?"combobox":void 0,"aria-expanded":M?"true":"false","aria-haspopup":A?"dialog":"listbox","aria-controls":M?x?.id:void 0,"aria-readonly":v||void 0,"aria-labelledby":C,onPointerDown:V,onPointerEnter:V,onFocus(){f(!0),!(K||v)&&I.start(0,w.state.forceMount)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const ee=y==="none"?q:L;S.commit(ee)}},onMouseDown(ee){if(K||v||(A||H.set("domReferenceElement",ee.currentTarget),w.state.forceMount(),Y.current!=="touch"&&(w.state.inputRef.current?.focus(),A||ee.preventDefault()),M))return;const te=xr(ee.currentTarget);function X(F){if(!T)return;const se=Pn(F),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=F.clientX>=oe.left-Zf&&F.clientX<=oe.right+Zf,ve=F.clientY>=oe.top-Zf&&F.clientY<=oe.bottom+Zf;le&&ve||w.state.setOpen(!1,Ue("cancel-open",F))}A&&te.addEventListener("mouseup",X,{once:!0})},onKeyDown(ee){K||v||(ee.key==="ArrowDown"||ee.key==="ArrowUp")&&(fn(ee),w.state.setOpen(!0,Ue(Du,ee.nativeEvent)),w.state.inputRef.current?.focus())}},S?S.getValidationProps(a):a,D],stateAttributesMapping:x9})}),C9=R.createContext(void 0);function w9(){return R.useContext(C9)}const Fk=R.createContext(void 0);function z0(e){const t=R.useContext(Fk);if(t===void 0&&!e)throw new Error(Pt(21));return t}const E9={...zu,...ja,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},k9=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=w9(),b=!!z0(!0),v=Ri(),{filteredItems:x}=Na(),E=B0(),T=ar(h),A=Ia(),M=Ae(v,qe.disabled),L=Ae(v,qe.readOnly),P=Ae(v,qe.name),z=Ae(v,qe.selectionMode),H=Ae(v,qe.autoHighlight),q=Ae(v,qe.inputProps),I=Ae(v,qe.triggerProps),K=Ae(v,qe.open),Y=Ae(v,qe.mounted),V=Ae(v,qe.selectedValue),$=Ae(v,qe.popupSide),G=Ae(v,qe.positionerElement),j=!!H,U=Y&&G?$:null,D=d||M||u,N=x.length===0,[W,Z]=R.useState(null),ee=R.useRef(!1),te=Pe(ne=>{const re=b||v.state.inline;re&&!v.state.hasInputValue&&v.state.setInputValue("",Ue(Mn)),v.update({inputElement:ne,inputInsidePopup:re})}),X=R.useMemo(()=>({...l,open:K,disabled:D,readOnly:L,popupSide:U,listEmpty:N}),[l,K,D,L,U,N]);function F(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<V.length-1?re=oe+1:re=void 0;else if(ne.key==="Backspace"||ne.key==="Delete"){ne.preventDefault();const le=oe>=V.length-1?V.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&&V.length>0?(ne.preventDefault(),re=Math.max(V.length-1,0)):ne.key==="Backspace"&&ne.currentTarget.value===""&&V.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,te],props:[q,I,{type:"text",value:t.value??W??E,"aria-readonly":L||void 0,"aria-labelledby":C,disabled:D,readOnly:L,...z==="none"&&P&&{name:P},id:T,onFocus(){f(!0)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const ne=z==="none"?E:V;S.commit(ne)}},onCompositionStart(ne){Dh||(ee.current=!0,Z(ne.currentTarget.value))},onCompositionEnd(ne){ee.current=!1;const re=ne.currentTarget.value;Z(null),v.state.setInputValue(re,Ue(ia,ne.nativeEvent))},onChange(ne){if(ee.current){const ve=ne.currentTarget.value;Z(ve),ve===""&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,Ue(no,ne.nativeEvent));const ge=ve.trim(),ue=j&&ge!=="";!L&&!D&&ge!==""&&(v.state.setOpen(!0,Ue(ia,ne.nativeEvent)),j||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&v.state.activeIndex!==null&&!ue&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"});return}v.state.setInputValue(ne.currentTarget.value,Ue(ia,ne.nativeEvent));const re=ne.currentTarget.value==="",oe=Ue(no,ne.nativeEvent);re&&!v.state.inputInsidePopup&&(z==="single"&&v.state.setSelectedValue(null,oe),v.state.openOnInputClick||v.state.setOpen(!1,oe));const le=ne.currentTarget.value.trim();!L&&!D&&le!==""&&(v.state.setOpen(!0,Ue(ia,ne.nativeEvent)),j||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&v.state.activeIndex!==null&&!j&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(ne){if(D||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 ge=GS&&le?re.value.length:0;re.setSelectionRange(ge,ge),re.scrollLeft=0;return}if(ne.key==="End"){fn(ne);const ge=GS&&le?0:re.value.length;re.setSelectionRange(ge,ge),re.scrollLeft=le?-oe:oe;return}if(!Y&&ne.key==="Escape"){const ge=z==="multiple"&&Array.isArray(V)?V.length===0:V===null,ue=Ue(dp,ne.nativeEvent),de=z==="multiple"?[]:null;v.state.setInputValue("",ue),v.state.setSelectedValue(de,ue),!ge&&!v.state.inline&&!ue.isPropagationAllowed&&ne.stopPropagation();return}if(w&&ne.key==="Backspace"&&re.value===""&&w.highlightedChipIndex===void 0&&Array.isArray(V)&&V.length>0){const ge=V.slice(0,-1);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"}),v.state.setSelectedValue(ge,Ue(Mn,ne.nativeEvent));return}const ve=F(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 ge=v.state.activeIndex,ue=ne.nativeEvent;if(ge===null){v.state.setOpen(!1,Ue(Mn,ue));return}fn(ne);const de=v.state.listRef.current[ge];de&&(v.state.selectionEventRef.current=ue,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:E9})}),R9={...Gs,...l0},T9=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=Ae(p,qe.selectionMode),g=Ae(p,qe.disabled),S=Ae(p,qe.readOnly),C=Ae(p,qe.open),w=Ae(p,qe.selectedValue),y=B0();let b=!1;f==="none"?b=y!=="":f==="single"?b=w!=null:b=Array.isArray(w)&&w.length>0;const v=d||g||u,{buttonRef:x,getButtonProps:E}=Sr({native:h,disabled:v}),{mounted:T,transitionStatus:A,setMounted:M}=ki(b),L=R.useMemo(()=>({disabled:v,open:C,transitionStatus:A}),[v,C,A]);Ur({open:b,ref:p.state.clearRef,onComplete(){b||M(!1)}});const P=at("button",t,{state:L,ref:[n,x,p.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:v,"aria-readonly":S||void 0,onMouseDown(H){H.preventDefault()},onClick(H){if(v||S)return;const q=p.state.keyboardActiveRef;p.state.setInputValue("",Ue(US,H.nativeEvent)),f!=="none"?(p.state.setSelectedValue(Array.isArray(w)?[]:null,Ue(US,H.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:R9});return a||T?P:null}),L9=R.createContext(null);function A9(){return R.useContext(L9)}function O9(e){const{children:t}=e,{filteredItems:n}=Na(),s=A9(),o=s?s.items:n;return o?_.jsx(R.Fragment,{children:o.map(t)}):null}const M9=R.forwardRef(function(t,n){var s;const{render:o,className:u,children:h,...a}=t,l=Ri(),d=wp(),p=!!z0(!0),{filteredItems:f}=Na(),g=Ae(l,qe.items),S=Ae(l,qe.labelsRef),C=Ae(l,qe.listRef),w=Ae(l,qe.selectionMode),y=Ae(l,qe.grid),b=Ae(l,qe.popupProps),v=Ae(l,qe.disabled),x=Ae(l,qe.readOnly),E=Ae(l,qe.virtualized),T=w==="multiple",A=f.length===0,M=Pe(I=>{l.set("positionerElement",I)}),L=Pe(I=>{l.set("listElement",I)}),P=R.useMemo(()=>typeof h=="function"?s||(s=_.jsx(O9,{children:h})):h,[h]),z=R.useMemo(()=>({empty:A}),[A]),H=d.useState("floatingId"),q=at("div",t,{state:z,ref:[n,L,p?null:M],props:[b,{children:P,tabIndex:-1,id:H,role:y?"grid":"listbox","aria-multiselectable":T?"true":void 0,onKeyDown(I){if(!(v||x)&&I.key==="Enter"){const K=l.state.activeIndex;if(K==null)return;fn(I);const Y=I.nativeEvent,V=l.state.listRef.current[K];V&&(l.state.selectionEventRef.current=Y,V.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})}),Uk=R.createContext(void 0);function D9(){const e=R.useContext(Uk);if(e===void 0)throw new Error(Pt(20));return e}const P9=R.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,u=Ri(),h=Ae(u,qe.mounted),a=Ae(u,qe.forceMounted);return h||s||a?_.jsx(Uk.Provider,{value:s,children:_.jsx(hp,{ref:n,...o})}):null}),j9=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=t0,...b}=t,v=Ri(),{filteredItems:x}=Na(),E=wp(),T=D9(),A=Ae(v,qe.modal),M=Ae(v,qe.open),L=Ae(v,qe.mounted),P=Ae(v,qe.openMethod),z=Ae(v,qe.triggerElement),H=Ae(v,qe.inputElement),q=Ae(v,qe.inputInsidePopup),I=x.length===0,Y=A0({anchor:u??(q?z:H),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&&P!=="touch",z);const V=R.useMemo(()=>{const D={...Y.positionerStyles};return M||(D.pointerEvents="none"),{role:"presentation",hidden:!L,style:D}},[M,L,Y.positionerStyles]),$=R.useMemo(()=>({open:M,side:Y.side,align:Y.align,anchorHidden:Y.anchorHidden,empty:I}),[M,Y.side,Y.align,Y.anchorHidden,I]);Ve(()=>{v.set("popupSide",Y.side)},[v,Y.side]);const G=R.useMemo(()=>({side:Y.side,align:Y.align,arrowRef:Y.arrowRef,arrowUncentered:Y.arrowUncentered,arrowStyles:Y.arrowStyles,anchorHidden:Y.anchorHidden,isPositioned:Y.isPositioned}),[Y.side,Y.align,Y.arrowRef,Y.arrowUncentered,Y.arrowStyles,Y.anchorHidden,Y.isPositioned]),j=Pe(D=>{v.set("positionerElement",D)}),U=at("div",t,{state:$,ref:[n,j],props:[V,b],stateAttributesMapping:xo});return _.jsxs(Fk.Provider,{value:G,children:[L&&A&&_.jsx(bp,{inert:yp(!M),cutout:H??z}),U]})}),I9={...xo,...Gs},N9=R.forwardRef(function(t,n){const{render:s,className:o,initialFocus:u,finalFocus:h,...a}=t,l=Ri(),d=z0(),p=wp(),{filteredItems:f}=Na(),g=Ae(l,qe.mounted),S=Ae(l,qe.open),C=Ae(l,qe.openMethod),w=Ae(l,qe.transitionStatus),y=Ae(l,qe.inputInsidePopup),b=Ae(l,qe.inputElement),v=f.length===0;Ur({open:S,ref:l.state.popupRef,onComplete(){S&&l.state.onOpenChangeComplete(!0)}});const x=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:x,ref:[n,l.state.popupRef],props:[{role:y?"dialog":"presentation",tabIndex:-1,onFocus(L){const P=Pn(L.nativeEvent);C!=="touch"&&(ft(l.state.listElement,P)||P===L.currentTarget)&&l.state.inputRef.current?.focus()}},D0(w),a],stateAttributesMapping:I9}),A=u===void 0?y?L=>L==="touch"?l.state.popupRef.current:b:!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})}),Wk=R.createContext(void 0);function qk(){const e=R.useContext(Wk);if(!e)throw new Error(Pt(19));return e}const B9=R.createContext(!1);function z9(){return R.useContext(B9)}const H9=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=z9(),{flatFilteredItems:w}=Na(),y=Ae(S,qe.open),b=Ae(S,qe.selectionMode),v=Ae(S,qe.readOnly),x=Ae(S,qe.virtualized),E=Ae(S,qe.isItemEqualToValue),T=b!=="none",A=h??(x?Kl(w,u,E):g.index),M=g.index!==-1,L=Ae(S,qe.id),P=Ae(S,qe.isActive,A),z=Ae(S,qe.isSelected,u),H=Ae(S,qe.items),q=Ae(S,qe.getItemProps),I=R.useRef(null),K=L!=null&&M?`${L}-${A}`:void 0,Y=z&&T;Ve(()=>{if(!(M&&(x||h!=null)))return;const ee=S.state.listRef.current;return ee[A]=I.current,()=>{delete ee[A]}},[M,x,A,h,S]),Ve(()=>{if(!M||H)return;const Z=S.state.valuesRef.current;return Z[A]=u,b!=="none"&&S.state.allValuesRef.current.push(u),()=>{delete Z[A]}},[M,H,A,u,S,b]),Ve(()=>{if(!y){p.current=!1;return}if(!M||H)return;const Z=S.state.selectedValue,ee=Array.isArray(Z)?Z[Z.length-1]:Z;Ci(ee,u,E)&&S.set("selectedIndex",A)},[M,H,y,S,A,u,E]);const V=R.useMemo(()=>({disabled:a,selected:Y,highlighted:P}),[a,Y,P]),$=q({active:P,selected:Y});$.id=void 0,$.onFocus=void 0;const{getButtonProps:G,buttonRef:j}=Sr({disabled:a,focusableWhenDisabled:!0,native:l});function U(Z){function ee(){S.state.handleSelection(Z,u)}S.state.submitOnItemClick?(er.flushSync(ee),S.state.requestSubmit()):ee()}const D={id:K,role:C?"gridcell":"option","aria-disabled":a||void 0,"aria-selected":T?Y:void 0,tabIndex:void 0,onPointerDownCapture(Z){p.current=!0,Z.preventDefault()},onClick(Z){a||v||U(Z.nativeEvent)},onMouseUp(Z){const ee=p.current;p.current=!1,!(a||v||Z.button!==0||ee||!P)&&U(Z.nativeEvent)}},N=at("div",t,{ref:[j,n,g.ref,I],state:V,props:[$,D,d,G]}),W=R.useMemo(()=>({selected:Y,textRef:f}),[Y,f]);return _.jsx(Wk.Provider,{value:W,children:N})})),V9=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 TC=(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 Gk(e){return R.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[TC.checked]:""}:{[TC.unchecked]:""}},...ja}),[e.indeterminate])}const $k=R.createContext(void 0);function F9(){const e=R.useContext($k);if(e===void 0)throw new Error(Pt(14));return e}const U9="data-parent",W9=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:b,nativeButton:v=!1,...x}=t,{clearErrors:E}=ad(),{disabled:T,name:A,setDirty:M,setFilled:L,setFocused:P,setTouched:z,state:H,validationMode:q,validityData:I,shouldValidateOnChange:K,validation:Y}=us(),V=V8(),{labelId:$,controlId:G,setControlId:j,getDescriptionProps:U}=wo(),D=U8(),N=D?.parent,W=N&&D.allValues,Z=T||V.disabled||D?.disabled||h,ee=A??p,te=b??ee,X=ar(),F=ar();let se=G;W?se=g?F:`${N.id}-${te}`:a&&(se=a);let ne={};W&&(g?ne=D.parent.getParentProps():te&&(ne=D.parent.getChildProps(te)));const re=Pe(f),{checked:oe=s,indeterminate:le=l,onCheckedChange:ve,...ge}=ne,ue=D?.value,de=D?.setValue,Ie=D?.defaultValue,De=R.useRef(null),{getButtonProps:Oe,buttonRef:be}=Sr({disabled:Z,native:v}),Me=D?.validation??Y,[pe,Re]=as({controlled:te&&ue&&!g?ue.includes(te):oe,default:te&&Ie&&!g?Ie.includes(te):u,name:"Checkbox",state:"checked"});Ve(()=>{if(j!==on)return j(se),()=>{j(void 0)}},[se,D,j,g]),ld({enabled:!D,id:X,commit:Me.commit,value:pe,controlRef:De,name:ee,getValue:()=>pe});const we=R.useRef(null),We=cs(d,we,Me.inputRef);Ve(()=>{we.current&&(we.current.indeterminate=le,pe&&L(!0))},[pe,le,L]),ca(pe,()=>{D&&!g||(E(ee),L(pe),M(pe!==I.initialValue),K()?Me.commit(pe):Me.commit(pe,!0))});const et=Ws({checked:pe,disabled:Z,name:g?void 0:ee,id:se??void 0,required:w,ref:We,style:ic,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(He){if(He.nativeEvent.defaultPrevented)return;const ke=He.target.checked,nt=Ue(Mn,He.nativeEvent);if(ve?.(ke,nt),re(ke,nt),!nt.isCanceled&&(Re(ke),te&&ue&&de&&!g)){const lt=ke?[...ue,te]:ue.filter(Xe=>Xe!==te);de(lt,nt)}},onFocus(){De.current?.focus()}},b!==void 0?{value:(D?pe&&b:b)||""}:tn,U,D?Me.getValidationProps:Me.getInputValidationProps),xe=W?!!oe:pe,Ge=W&&le||l;R.useEffect(()=>{N&&te&&N.disabledStatesRef.current.set(te,Z)},[N,Z,te]);const tt=R.useMemo(()=>({...H,checked:xe,disabled:Z,readOnly:S,required:w,indeterminate:Ge}),[H,xe,Z,S,w,Ge]),dt=Gk(tt),Se=at("span",t,{state:tt,ref:[be,De,n,D?.registerControlRef],props:[{id:X,role:"checkbox","aria-checked":le?"mixed":pe,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":$,[U9]:g?"":void 0,onFocus(){P(!0)},onBlur(){const He=we.current;He&&(z(!0),P(!1),q==="onBlur"&&Me.commit(D?ue:He.checked))},onClick(He){S||Z||(He.preventDefault(),we.current?.click())}},U,Me.getValidationProps,x,ge,Oe],stateAttributesMapping:dt});return _.jsxs($k.Provider,{value:tt,children:[Se,!pe&&!D&&ee&&!g&&y!==void 0&&_.jsx("input",{type:"hidden",name:ee,value:y}),_.jsx("input",{...et})]})}),q9=R.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=F9(),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=Gk(a),C=R.useMemo(()=>({...S,...Gs,...ja}),[S]),w=u||l,y=at("span",t,{enabled:w,ref:[n,f],state:g,stateAttributesMapping:C,props:h});return w?y:null});function G9(e){const{multiple:t=!1,defaultValue:n,value:s,onValueChange:o,...u}=e;return _.jsx(b9,{...u,selectionMode:t?"multiple":"single",selectedValue:s,defaultSelectedValue:n,onSelectedValueChange:o})}const $9=R.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=qk();return s||o?_.jsx(K9,{...t,ref:n}):null}),K9=R.memo(R.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=qk(),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})),Y9=R.createContext(void 0);function Ep(e=!0){const t=R.useContext(Y9);if(t===void 0&&!e)throw new Error(Pt(25));return t}const Kk=R.createContext(void 0);function H0(e){const t=R.useContext(Kk);if(t===void 0&&!e)throw new Error(Pt(33));return t}const Yk=R.createContext(void 0);function Eo(e){const t=R.useContext(Yk);if(t===void 0&&!e)throw new Error(Pt(36));return t}const Xk={type:"regular-item"};function Qk(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=Ep(!0),f=p!==void 0,{events:g}=u.useState("floatingTreeRoot"),{getButtonProps:S,buttonRef:C}=Sr({disabled:n,focusableWhenDisabled:!0,native:h}),w=R.useCallback(b=>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 x=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,f&&x&&Math.abs(v.clientX-x.x)<=1&&Math.abs(v.clientY-x.y)<=1)return}d.current&&u.context.allowMouseUpTriggerRef.current&&(!f||v.button===2)&&a.type==="regular-item"&&d.current.click()}},b,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 LC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const Zk={checked(e){return e?{[LC.checked]:""}:{[LC.unchecked]:""}},...Gs},X9=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:b,itemRef:v}=Qk({closeOnClick:d,disabled:l,highlighted:w,id:S,store:C,nativeButton:a,nodeId:g?.nodeId,itemMetadata:Xk}),x=R.useMemo(()=>({disabled:l,highlighted:w}),[l,w]);return at("div",t,{state:x,props:[y,p,b],ref:[v,n,f.ref]})}),Q9={...xo,...Gs},Z9=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"),b=a.useState("parent"),v=a.useState("lastOpenChangeReason"),x=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 I(K){a.setOpen(!1,Ue(K.reason,K.domEvent))}return T.events.on("close",I),()=>{T.events.off("close",I)}},[T.events,a]);const L=a.useState("hoverEnabled"),P=a.useState("disabled");e8(E,{enabled:L&&!P&&b.type!=="context-menu"&&b.type!=="menubar",closeDelay:A});const z=R.useMemo(()=>({transitionStatus:g,side:l,align:d,open:f,nested:b.type==="menu",instant:w}),[g,l,d,f,b.type,w]),H=at("div",t,{state:z,ref:[n,a.context.popupRef],stateAttributesMapping:Q9,props:[S,{onKeyDown(I){p&&k0.has(I.key)&&I.stopPropagation()}},D0(g),h,{"data-rootownerid":x}]});let q=b.type===void 0||b.type==="context-menu";return(y||b.type==="menubar"&&v!==c0)&&(q=!0),_.jsx(pp,{context:E,modal:!1,disabled:!C,returnFocus:u===void 0?q:u,initialFocus:b.type!=="menu",restoreFocus:!0,externalTree:b.type!=="menubar"?T:void 0,previousFocusableElement:M,nextFocusableElement:b.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:b.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:H})}),Jk=R.createContext(void 0);function J9(){const e=R.useContext(Jk);if(e===void 0)throw new Error(Pt(32));return e}const ej=R.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=Eo();return u.useState("mounted")||s?_.jsx(Jk.Provider,{value:s,children:_.jsx(hp,{ref:n,...o})}):null}),tj=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=t0,...b}=t,{store:v}=Eo(),x=J9(),E=Ep(!0),T=v.useState("parent"),A=v.useState("floatingRootContext"),M=v.useState("floatingTreeRoot"),L=v.useState("mounted"),P=v.useState("open"),z=v.useState("modal"),H=v.useState("activeTriggerElement"),q=v.useState("lastOpenChangeReason"),I=v.useState("floatingNodeId"),K=v.useState("floatingParentNodeId");let Y=s,V=d,$=p,G=l,j=y;T.type==="context-menu"&&(Y=s??T.context?.anchor,G=G??"start",!a&&G!=="center"&&($=t.alignOffset??2,V=t.sideOffset??-5));let U=a,D=G;T.type==="menu"?(U=U??"inline-end",D=D??"start",j=t.collisionAvoidance??uM):T.type==="menubar"&&(U=U??"bottom",D=D??"start");const N=T.type==="context-menu",W=A0({anchor:Y,floatingRootContext:A,positionMethod:E?"fixed":o,mounted:L,side:U,sideOffset:V,align:D,alignOffset:$,arrowPadding:N?0:S,collisionBoundary:f,collisionPadding:g,sticky:C,nodeId:I,keepMounted:x,disableAnchorTracking:w,collisionAvoidance:j,shiftCrossAxis:N,externalTree:M}),Z=R.useMemo(()=>{const ne={};return P||(ne.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...W.positionerStyles,...ne}}},[P,L,W.positionerStyles]);R.useEffect(()=>{function ne(re){re.open?(re.parentNodeId===I&&v.set("hoverEnabled",!1),re.nodeId!==I&&re.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,Ue(Ru))):re.parentNodeId===I&&re.reason!==Ru&&v.set("hoverEnabled",!0)}return M.events.on("menuopenchange",ne),()=>{M.events.off("menuopenchange",ne)}},[v,M.events,I]),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,Ue(oe))}return M.events.on("menuopenchange",ne),()=>{M.events.off("menuopenchange",ne)}},[M.events,v]),R.useEffect(()=>{function ne(re){!P||re.nodeId!==v.select("floatingParentNodeId")||re.target&&H&&H!==re.target&&v.setOpen(!1,Ue(Ru))}return M.events.on("itemhover",ne),()=>{M.events.off("itemhover",ne)}},[M.events,P,H,v]),R.useEffect(()=>{const ne={open:P,nodeId:I,parentNodeId:K,reason:v.select("lastOpenChangeReason")};M.events.emit("menuopenchange",ne)},[M.events,P,v,I,K]);const ee=R.useMemo(()=>({open:P,side:W.side,align:W.align,anchorHidden:W.anchorHidden,nested:T.type==="menu"}),[P,W.side,W.align,W.anchorHidden,T.type]),te=R.useMemo(()=>({side:W.side,align:W.align,arrowRef:W.arrowRef,arrowUncentered:W.arrowUncentered,arrowStyles:W.arrowStyles,nodeId:W.context.nodeId}),[W.side,W.align,W.arrowRef,W.arrowUncentered,W.arrowStyles,W.context.nodeId]),X=at("div",t,{state:ee,stateAttributesMapping:xo,ref:[n,v.useStateSetter("positionerElement")],props:[Z,b]}),F=L&&T.type!=="menu"&&(T.type!=="menubar"&&z&&q!==Br||T.type==="menubar"&&T.context.modal);let se=null;return T.type==="menubar"?se=T.context.contentElement:T.type===void 0&&(se=H),_.jsxs(Kk.Provider,{value:te,children:[F&&_.jsx(bp,{ref:T.type==="context-menu"||T.type==="nested-context-menu"?T.context.internalBackdropRef:null,inert:yp(!P),cutout:se}),_.jsx(ED,{id:I,children:_.jsx(ud,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:X})})]})}),eR=R.createContext(void 0);function nj(){const e=R.useContext(eR);if(e===void 0)throw new Error(Pt(34));return e}const rj=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((b,v)=>{g?.(b,v),!v.isCanceled&&f(b)}),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(eR.Provider,{value:y,children:w})})),tR=R.createContext(void 0);function sj(){const e=R.useContext(tR);if(e===void 0)throw new Error(Pt(35));return e}const ij=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),b=w.useState("itemProps"),{value:v,setValue:x,disabled:E}=nj(),T=E||l,A=v===p,{getItemProps:M,itemRef:L}=Qk({closeOnClick:d,disabled:T,highlighted:y,id:C,store:w,nativeButton:a,nodeId:S?.nodeId,itemMetadata:Xk}),P=R.useMemo(()=>({disabled:T,highlighted:y,checked:A}),[T,y,A]),z=Pe(q=>{const I={...Ue(ma,q.nativeEvent),preventUnmountOnClose:()=>{}};x(p,I)}),H=at("div",t,{state:P,stateAttributesMapping:Zk,props:[b,{role:"menuitemradio","aria-checked":A,onClick:z},f,M],ref:[L,n,g.ref]});return _.jsx(tR.Provider,{value:P,children:H})}),oj=R.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=sj(),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:Zk,ref:[n,l],props:{"aria-hidden":!0,...h},enabled:u||a.checked})}),aj=R.createContext(null);function nR(e){return R.useContext(aj)}const lj={...ek,disabled:Ee(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Ee(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Ee(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:Ee(e=>e.stickIfOpen),parent:Ee(e=>e.parent),rootId:Ee(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Ee(e=>e.activeIndex),isActive:Ee((e,t)=>e.activeIndex===t),hoverEnabled:Ee(e=>e.hoverEnabled),instantType:Ee(e=>e.instantType),lastOpenChangeReason:Ee(e=>e.openChangeReason),floatingTreeRoot:Ee(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Ee(e=>e.floatingNodeId),floatingParentNodeId:Ee(e=>e.floatingParentNodeId),itemProps:Ee(e=>e.itemProps),closeDelay:Ee(e=>e.closeDelay),keyboardEventRelay:Ee(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class V0 extends x0{constructor(t){super({...cj(),...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},lj),this.observe(Ee(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 cj(){return{...JE(),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 _0,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:tn,keyboardEventRelay:void 0,closeDelay:0}}const uj=R.createContext(void 0);function dj(){return R.useContext(uj)}function fj(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=Ep(!0),b=Eo(!0),v=nR(),x=dj(),E=R.useMemo(()=>x&&b?{type:"menu",store:b.store}:v?{type:"menubar",context:v}:y&&!b?{type:"context-menu",context:y}:{type:void 0},[y,b,v,x]),T=V0.useStore(g?.store,{parent:E}),A=T.useState("floatingTreeRoot"),M=IE(A),L=Ei();Ve(()=>{y&&!b?T.update({parent:{type:"context-menu",context:y},floatingNodeId:M,floatingParentNodeId:L}):b&&T.update({floatingNodeId:M,floatingParentNodeId:L})},[y,b,M,L,T]),T.useControlledProp("open",n,u),T.useControlledProp("activeTriggerId",S,C),T.useContextCallback("onOpenChangeComplete",o);const P=T.useState("open"),z=T.useState("activeTriggerElement"),H=T.useState("positionerElement"),q=T.useState("hoverEnabled"),I=T.useState("modal"),K=T.useState("disabled"),Y=T.useState("lastOpenChangeReason"),V=T.useState("parent"),$=T.useState("activeIndex"),G=T.useState("payload"),j=T.useState("floatingParentNodeId"),U=R.useRef(null),D=j!=null;let N;T.useSyncedValues({disabled:h,modal:V.type===void 0?a:void 0,rootId:Da()});const{openMethod:W,triggerProps:Z,reset:ee}=Sp(P);QE(T);const{forceUnmount:te}=ZE(P,T,()=>{T.update({allowMouseEnter:!1,stickIfOpen:!0}),ee()}),X=R.useRef(V.type!=="context-menu"),F=Qt();R.useEffect(()=>{if(P||(U.current=null),V.type==="context-menu"){if(!P){F.clear(),X.current=!1;return}F.start(500,()=>{X.current=!0})}},[F,P,V.type]),xp(P&&I&&Y!==Br&&W!=="touch",H),Ve(()=>{!P&&!q&&T.set("hoverEnabled",!0)},[P,q,T]);const se=R.useRef(!0),ne=Qt(),re=Pe((ke,nt)=>{const lt=nt.reason;if(P===ke&&nt.trigger===z||(nt.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},!ke&&nt.trigger==null&&(nt.trigger=z??void 0),s?.(ke,nt),nt.isCanceled))return;const Xe={open:ke,nativeEvent:nt.event,reason:nt.reason,nested:D};N?.emit("openchange",Xe);const st=nt.event;if(ke===!1&&st?.type==="click"&&st.pointerType==="touch"&&!se.current)return;if(!ke&&$!==null){const Rt=T.context.itemDomElements.current[$];queueMicrotask(()=>{Rt?.setAttribute("tabindex","-1")})}ke&&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=!ke&&(lt===dp||lt==null);function nn(){const Rt={open:ke,openChangeReason:lt};U.current=nt.event??null;const vt=nt.trigger?.id??null;(vt||ke)&&(Rt.activeTriggerId=vt,Rt.activeTriggerElement=nt.trigger??null),T.update(Rt)}lt===Br?er.flushSync(nn):nn(),V.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(ke=>{const nt=Ue(ke);return nt.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},nt},[T]),le=R.useCallback(()=>{T.setOpen(!1,oe(oE))},[T,oe]);R.useImperativeHandle(p,()=>({unmount:te,close:le}),[te,le]);let ve;V.type==="context-menu"&&(ve=V.context),R.useImperativeHandle(ve?.positionerRef,()=>H,[H]),R.useImperativeHandle(ve?.actionsRef,()=>({setOpen:re}),[re]);const ge=tk({popupStore:T,onOpenChange:re});N=ge.context.events,R.useEffect(()=>{const ke=({open:nt,eventDetails:lt})=>re(nt,lt);return N.on("setOpen",ke),()=>{N?.off("setOpen",ke)}},[N,re]);const ue=gp(ge,{enabled:!K,bubbles:f&&V.type==="menu",outsidePress(){return V.type!=="context-menu"||U.current?.type==="contextmenu"?!0:X.current},externalTree:D?A:void 0}),de=rk(ge,{role:"menu"}),Ie=Ia(),De=R.useCallback(ke=>{T.select("activeIndex")!==ke&&T.set("activeIndex",ke)},[T]),Oe=w0(ge,{enabled:!K,listRef:T.context.itemDomElements,activeIndex:$,nested:V.type!==void 0,loopFocus:l,orientation:d,parentOrientation:V.type==="menubar"?V.context.orientation:void 0,rtl:Ie==="rtl",disabledIndices:br,onNavigate:De,openOnArrowKeyDown:V.type!=="context-menu",externalTree:D?A:void 0,focusItemOnHover:w}),be=R.useCallback(ke=>{T.context.typingRef.current=ke},[T]),Me=E0(ge,{listRef:T.context.itemLabels,activeIndex:$,resetMs:aM,onMatch:ke=>{P&&ke!==$&&T.set("activeIndex",ke)},onTypingChange:be}),{getReferenceProps:pe,getFloatingProps:Re,getItemProps:we,getTriggerProps:We}=oc([ue,de,Oe,Me]),et=R.useMemo(()=>{const ke=Ws(pe(),{onMouseEnter(){T.set("hoverEnabled",!0)},onMouseMove(){T.set("allowMouseEnter",!0)}},Z);return delete ke.role,ke},[pe,T,Z]),xe=R.useMemo(()=>{const ke=We();if(!ke)return ke;const nt=Ws(ke,Z);return delete nt.role,delete nt["aria-controls"],nt},[We,Z]),Ge=rd(),tt=R.useMemo(()=>Re({onMouseEnter(){V.type==="menu"&&Ge.request(()=>T.set("hoverEnabled",!1))},onMouseMove(){T.set("allowMouseEnter",!0)},onClick(){T.select("hoverEnabled")&&T.set("hoverEnabled",!1)},onKeyDown(ke){const nt=T.select("keyboardEventRelay");nt&&!ke.isPropagationStopped()&&nt(ke)}}),[Re,V.type,Ge,T]),dt=R.useMemo(()=>we(),[we]);T.useSyncedValues({floatingRootContext:ge,activeTriggerProps:et,inactiveTriggerProps:xe,popupProps:tt,itemProps:dt});const Se=R.useMemo(()=>({store:T,parent:E}),[T,E]),He=_.jsx(Yk.Provider,{value:Se,children:typeof t=="function"?t({payload:G}):t});return V.type===void 0||V.type==="context-menu"?_.jsx(kD,{externalTree:A,children:He}):He}function rR(e){const{render:t,className:n,state:s=tn,props:o=br,refs:u=br,metadata:h,stateAttributesMapping:a,tag:l="div",...d}=e,{compositeProps:p,compositeRef:f}=Dk({metadata:h});return at(l,e,{state:s,ref:[...u,f],props:[p,...o,d],stateAttributesMapping:a})}function sR(e){if(en(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Hs(e))return sR(Us(e))}function hj(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,xr(u.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:u=>{o.current&&(o.current=!1,u.preventBaseUIHandler())}}:tn,[t,n,s])}const Jf=2,pj=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),b=w.useState("isTriggerActive",y),v=w.useState("floatingRootContext"),x=w.useState("isOpenedByTrigger",y),E=R.useRef(null),T=gj(),A=J_(!0),M=Co(),L=R.useMemo(()=>M??new _0,[M]),P=IE(L),z=Ei(),{registerTrigger:H,isMountedByThisTrigger:q}=XE(y,E,w,{payload:g,closeDelay:p,parent:T,floatingTreeRoot:L,floatingNodeId:P,floatingParentNodeId:z,keyboardEventRelay:A?.relayKeyboardEvent}),I=w.useState("disabled"),K=u||I||T.type==="menubar"&&T.context.disabled,{getButtonProps:Y,buttonRef:V}=Sr({disabled:K,native:h});R.useEffect(()=>{!x&&T.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,x,T.type]);const $=R.useRef(null),G=Qt(),j=Pe(de=>{if(!$.current)return;G.clear(),w.context.allowMouseUpTriggerRef.current=!1;const Ie=de.target;if(ft($.current,Ie)||ft(w.select("positionerElement"),Ie)||Ie===$.current||Ie!=null&&sR(Ie)===w.select("rootId"))return;const De=L0($.current);de.clientX>=De.left-Jf&&de.clientX<=De.right+Jf&&de.clientY>=De.top-Jf&&de.clientY<=De.bottom+Jf||L.events.emit("close",{domEvent:de,reason:iE})});R.useEffect(()=>{x&&w.select("lastOpenChangeReason")===Br&&xr($.current).addEventListener("mouseup",j,{once:!0})},[x,j,w]);const U=T.type==="menubar"&&T.context.hasSubmenuOpen,N=r8(v,{enabled:(l??U??!1)&&!K&&T.type!=="context-menu"&&(T.type!=="menubar"||U&&!q),handleClose:c8({blockPointerEvents:T.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:T.type===void 0?d:void 0,delay:{close:p},triggerElementRef:E,externalTree:L,isActiveTrigger:b}),W=mj(x,w.select("lastOpenChangeReason")),Z=sd(v,{enabled:!K&&T.type!=="context-menu",event:x&&T.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0?W:!1}),ee=X6(v,{enabled:!K&&(T.type!=="menubar"&&x||U)}),te=hj({open:x,enabled:T.type==="menubar",mouseDownAction:"open"}),X=oc([Z,ee]),F=T.type==="menubar",se=R.useMemo(()=>({disabled:K,open:x}),[K,x]),ne=w.useState("triggerProps",q),re=[$,n,V,H,E],oe=[X.getReferenceProps(),N??tn,ne,{"aria-haspopup":"menu",id:y,onMouseDown:de=>{if(w.select("open"))return;G.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),xr(de.currentTarget).addEventListener("mouseup",j,{once:!0})}},F?{role:"menuitem"}:{},te,S,Y],le=R.useRef(null),ve=Pe(de=>{er.flushSync(()=>{w.setOpen(!1,Ue(ka,de.nativeEvent,de.currentTarget))}),CD(le.current)?.focus()}),ge=Pe(de=>{const Ie=w.select("positionerElement");if(Ie&&Al(de,Ie))w.context.beforeContentFocusGuardRef.current?.focus();else{er.flushSync(()=>{w.setOpen(!1,Ue(ka,de.nativeEvent,de.currentTarget))});let De=SD(E.current);for(;De!==null&&ft(Ie,De)||De?.hasAttribute("aria-hidden");){const Oe=De;if(De=v0(De),De===Oe)break}De?.focus()}}),ue=at("button",t,{enabled:!F,stateAttributesMapping:zu,state:se,ref:re,props:oe});return F?_.jsx(rR,{tag:"button",render:s,className:o,state:se,refs:re,props:oe,stateAttributesMapping:zu}):x?_.jsxs(R.Fragment,{children:[_.jsx($l,{ref:le,onFocus:ve},`${y}-pre-focus-guard`),_.jsx(R.Fragment,{children:ue},y),_.jsx($l,{ref:w.context.triggerFocusTargetRef,onFocus:ge},`${y}-post-focus-guard`)]}):_.jsx(R.Fragment,{children:ue},y)});function mj(e,t){const n=Qt(),[s,o]=R.useState(!1);return Ve(()=>{e&&t==="trigger-hover"?(o(!0),n.start(lM,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),s}function gj(){const e=Ep(!0),t=Eo(!0),n=nR();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 iR=R.createContext(void 0);function kp(){const e=R.useContext(iR);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 eh=500,AC=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 vj=(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},OC={width:0,height:0},_j={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},yj=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(OC),[w,y]=R.useState(OC),[b,v]=R.useState(!1),[x,E]=R.useState(_j),T=ar(),A=R.useRef(null),M=R.useRef(null),L=R.useRef(null),P=R.useRef(null),z=R.useRef(null),H=R.useRef(null),q=R.useRef(null),I=R.useRef(!1),K=R.useRef(0),Y=R.useRef(0),V=R.useRef(0),$=R.useRef(0),G=R.useRef("vertical"),j=Qt(),U=Qt(),D=R.useRef({x:0,y:0}),[N,W]=R.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),Z=bj(u),ee=Pe(ve=>{const ge=ve.x-D.current.x,ue=ve.y-D.current.y;D.current=ve,ue!==0&&(g(!0),j.start(eh,()=>{g(!1)})),ge!==0&&(p(!0),U.start(eh,()=>{p(!1)}))}),te=Pe(ve=>{ve.button===0&&(I.current=!0,K.current=ve.clientY,Y.current=ve.clientX,G.current=ve.currentTarget.getAttribute(vj.orientation),M.current&&(V.current=M.current.scrollTop,$.current=M.current.scrollLeft),z.current&&G.current==="vertical"&&z.current.setPointerCapture(ve.pointerId),H.current&&G.current==="horizontal"&&H.current.setPointerCapture(ve.pointerId))}),X=Pe(ve=>{if(!I.current)return;const ge=ve.clientY-K.current,ue=ve.clientX-Y.current;if(M.current){const de=M.current.scrollHeight,Ie=M.current.clientHeight,De=M.current.scrollWidth,Oe=M.current.clientWidth;if(z.current&&L.current&&G.current==="vertical"){const be=ss(L.current,"padding","y"),Me=ss(z.current,"margin","y"),pe=z.current.offsetHeight,Re=L.current.offsetHeight-pe-be-Me,we=ge/Re;M.current.scrollTop=V.current+we*(de-Ie),ve.preventDefault(),g(!0),j.start(eh,()=>{g(!1)})}if(H.current&&P.current&&G.current==="horizontal"){const be=ss(P.current,"padding","x"),Me=ss(H.current,"margin","x"),pe=H.current.offsetWidth,Re=P.current.offsetWidth-pe-be-Me,we=ue/Re;M.current.scrollLeft=$.current+we*(De-Oe),ve.preventDefault(),p(!0),U.start(eh,()=>{p(!1)})}}}),F=Pe(ve=>{I.current=!1,z.current&&G.current==="vertical"&&z.current.releasePointerCapture(ve.pointerId),H.current&&G.current==="horizontal"&&H.current.releasePointerCapture(ve.pointerId)});function se(ve){const ge=ve.pointerType==="touch";if(v(ge),!ge){const ue=ft(A.current,ve.target);l(ue)}}const ne=R.useMemo(()=>({hasOverflowX:!N.scrollbarXHidden,hasOverflowY:!N.scrollbarYHidden,overflowXStart:x.xStart,overflowXEnd:x.xEnd,overflowYStart:x.yStart,overflowYEnd:x.yEnd,cornerHidden:N.cornerHidden}),[N.scrollbarXHidden,N.scrollbarYHidden,N.cornerHidden,x]),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:te,handlePointerMove:X,handlePointerUp:F,handleScroll:ee,cornerSize:S,setCornerSize:C,thumbSize:w,setThumbSize:y,touchModality:b,cornerRef:q,scrollingX:d,setScrollingX:p,scrollingY:f,setScrollingY:g,hovering:a,setHovering:l,viewportRef:M,rootRef:A,scrollbarYRef:L,scrollbarXRef:P,thumbYRef:z,thumbXRef:H,rootId:T,hiddenState:N,setHiddenState:W,overflowEdges:x,setOverflowEdges:E,viewportState:ne,overflowEdgeThreshold:Z}),[te,X,F,ee,S,w,b,q,d,p,f,g,a,l,M,A,L,P,z,H,T,N,x,ne,Z]);return _.jsxs(iR.Provider,{value:le,children:[Wu.element,oe]})});function bj(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 xj=R.createContext(void 0);function Sj(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})({}),MC=!1;function Cj(){MC||d0||(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{}}),MC=!0)}const wj=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:b,setHovering:v,setOverflowEdges:x,overflowEdges:E,overflowEdgeThreshold:T}=kp(),A=Ia(),M=R.useRef(!0),L=Qt(),P=Qt();function z(){const $=h.current,G=a.current,j=l.current,U=d.current,D=p.current,N=f.current;if(!$)return;const W=$.scrollHeight,Z=$.scrollWidth,ee=$.clientHeight,te=$.clientWidth,X=$.scrollTop,F=$.scrollLeft;if(W===0||Z===0)return;const se=ee>=W,ne=te>=Z,re=te/Z,oe=ee/W,le=Math.max(0,Z-te),ve=Math.max(0,W-ee);let ge=0,ue=0;ne||(A==="rtl"?ge=yi(-F,0,le):ge=yi(F,0,le),ue=le-ge);const de=se?0:yi(X,0,ve),Ie=se?0:ve-de,De=ne?0:te,Oe=se?0:ee,be=ss(j,"padding","x"),Me=ss(G,"padding","y"),pe=ss(D,"margin","x"),Re=ss(U,"margin","y"),we=De-be-pe,We=Oe-Me-Re,et=j?Math.min(j.offsetWidth,we):we,xe=G?Math.min(G.offsetHeight,We):We,Ge=Math.max(AC,et*re),tt=Math.max(AC,xe*oe);if(S(Xe=>Xe.height===tt&&Xe.width===Ge?Xe:{width:Ge,height:tt}),G&&U){const Xe=G.offsetHeight-tt-Me-Re,st=W-ee,Ct=st===0?0:X/st,ct=Math.min(Xe,Math.max(0,Ct*Xe));U.style.transform=`translate3d(0,${ct}px,0)`}if(j&&D){const Xe=j.offsetWidth-Ge-be-pe,st=Z-te,Ct=st===0?0:F/st,ct=A==="rtl"?yi(Ct*Xe,-Xe,0):yi(Ct*Xe,0,Xe);D.style.transform=`translate3d(${ct}px,0,0)`}const dt=yi(ge,0,le),Se=yi(ue,0,le),He=yi(de,0,ve),ke=yi(Ie,0,ve),nt=[[ao.scrollAreaOverflowXStart,dt],[ao.scrollAreaOverflowXEnd,Se],[ao.scrollAreaOverflowYStart,He],[ao.scrollAreaOverflowYEnd,ke]];for(const[Xe,st]of nt)$.style.setProperty(Xe,`${st}px`);if(N){if(ne||se)g({width:0,height:0});else if(!ne&&!se){const Xe=G?.offsetWidth||0,st=j?.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&&Se>T.xEnd,yStart:!se&&He>T.yStart,yEnd:!se&&ke>T.yEnd};x(Xe=>Xe.xStart===lt.xStart&&Xe.xEnd===lt.xEnd&&Xe.yStart===lt.yStart&&Xe.yEnd===lt.yEnd?Xe:lt)}const H=Pe(()=>{er.flushSync(z)});Ve(()=>h.current?(Cj(),Sj(h.current,H)):void 0,[H,h]),Ve(()=>{queueMicrotask(H)},[H,y,A]),Ve(()=>{h.current?.matches(":hover")&&v(!0)},[h,v]),R.useEffect(()=>{const $=h.current;if(typeof ResizeObserver>"u"||!$)return;const G=new ResizeObserver(H);return G.observe($),P.start(0,()=>{Promise.all($.getAnimations({subtree:!0}).map(j=>j.finished)).then(H).catch(()=>{})}),()=>{G.disconnect(),P.clear()}},[H,h,P]);function q(){M.current=!1}const I={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!y.scrollbarXHidden||!y.scrollbarYHidden)&&{tabIndex:0},className:Wu.className,style:{overflow:"scroll"},onScroll(){h.current&&(H(),M.current||b({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]),Y=at("div",t,{ref:[n,h],state:K,props:[I,u],stateAttributesMapping:F0}),V=R.useMemo(()=>({computeThumbPosition:H}),[H]);return _.jsx(xj.Provider,{value:V,children:Y})}),oR=R.createContext(void 0);function Ej(){const e=R.useContext(oR);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 kj=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:b,handlePointerDown:v,handlePointerUp:x,rootId:E,thumbSize:T}=kp(),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=Ia();R.useEffect(()=>{const I=w.current,K=u==="vertical"?S.current:C.current;if(!K)return;function Y(V){if(!(!I||!K||V.ctrlKey)){if(V.preventDefault(),u==="vertical"){if(I.scrollTop===0&&V.deltaY<0)return}else if(I.scrollLeft===0&&V.deltaX<0)return;if(u==="vertical"){if(I.scrollTop===I.scrollHeight-I.clientHeight&&V.deltaY>0)return}else if(I.scrollLeft===I.scrollWidth-I.clientWidth&&V.deltaX>0)return;u==="vertical"?I.scrollTop+=V.deltaY:I.scrollLeft+=V.deltaX}}return K.addEventListener("wheel",Y,{passive:!1}),()=>{K.removeEventListener("wheel",Y)}},[u,C,S,w]);const L={...E&&{"data-id":`${E}-scrollbar`},onPointerDown(I){if(I.button===0&&I.currentTarget===I.target&&w.current){if(y.current&&S.current&&u==="vertical"){const K=ss(y.current,"margin","y"),Y=ss(S.current,"padding","y"),V=y.current.offsetHeight,$=S.current.getBoundingClientRect(),G=I.clientY-$.top-V/2-Y+K/2,j=w.current.scrollHeight,U=w.current.clientHeight,D=S.current.offsetHeight-V-Y-K,W=G/D*(j-U);w.current.scrollTop=W}if(b.current&&C.current&&u==="horizontal"){const K=ss(b.current,"margin","x"),Y=ss(C.current,"padding","x"),V=b.current.offsetWidth,$=C.current.getBoundingClientRect(),G=I.clientX-$.left-V/2-Y+K/2,j=w.current.scrollWidth,U=w.current.clientWidth,D=C.current.offsetWidth-V-Y-K,N=G/D;let W;M==="rtl"?(W=(1-N)*(j-U),w.current.scrollLeft<=0&&(W=-W)):W=N*(j-U),w.current.scrollLeft=W}v(I)}},onPointerUp:x,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`}}},P=at("div",t,{ref:[n,u==="vertical"?S:C],state:A,props:[L,a],stateAttributesMapping:F0}),z=R.useMemo(()=>({orientation:u}),[u]),H=u==="vertical"?f.scrollbarYHidden:f.scrollbarXHidden;return h||!H?_.jsx(oR.Provider,{value:z,children:P}):null}),Rj=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}=kp(),{orientation:S}=Ej(),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]})}),Tj=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{cornerRef:h,cornerSize:a,hiddenState:l}=kp(),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}),aR=R.createContext(void 0);function Lj(){const e=R.useContext(aR);if(e===void 0)throw new Error(Pt(63));return e}let DC=(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 lR={...ja,checked(e){return e?{[DC.checked]:""}:{[DC.unchecked]:""}}},Aj=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:b}=ad(),{state:v,setTouched:x,setDirty:E,validityData:T,setFilled:A,setFocused:M,shouldValidateOnChange:L,validationMode:P,disabled:z,name:H,validation:q}=us(),{labelId:I}=wo(),K=z||S,Y=H??l,V=Pe(p),$=R.useRef(null),G=cs($,a,q.inputRef),j=R.useRef(null),U=ar(),D=Cp({id:h,implicit:!1,controlRef:j}),[N,W]=as({controlled:s,default:!!u,name:"Switch",state:"checked"});ld({id:U,commit:q.commit,value:N,controlRef:j,name:Y,getValue:()=>N}),Ve(()=>{$.current&&A($.current.checked)},[$,A]),ca(N,()=>{b(Y),E(N!==T.initialValue),A(N),L()?q.commit(N):q.commit(N,!0)});const{getButtonProps:Z,buttonRef:ee}=Sr({disabled:K,native:d}),te={id:U,role:"switch","aria-checked":N,"aria-readonly":f||void 0,"aria-labelledby":I,onFocus(){K||M(!0)},onBlur(){const ne=$.current;!ne||K||(x(!0),M(!1),P==="onBlur"&&q.commit(ne.checked))},onClick(ne){f||K||(ne.preventDefault(),$?.current?.click())}},X=R.useMemo(()=>Ws({checked:N,disabled:K,id:D,name:Y,required:g,style:ic,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:G,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const re=ne.target.checked,oe=Ue(Mn,ne.nativeEvent);V?.(re,oe),!oe.isCanceled&&W(re)},onFocus(){j.current?.focus()}},q.getInputValidationProps),[N,K,G,D,Y,V,g,W,q]),F=R.useMemo(()=>({...v,checked:N,disabled:K,readOnly:f,required:g}),[v,N,K,f,g]),se=at("span",t,{state:F,ref:[n,j,ee],props:[te,q.getValidationProps,y,Z],stateAttributesMapping:lR});return _.jsxs(aR.Provider,{value:F,children:[se,!N&&Y&&w!==void 0&&_.jsx("input",{type:"hidden",name:Y,value:w}),_.jsx("input",{...X})]})}),Oj=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{state:h}=us(),a=Lj(),l={...h,...a};return at("span",t,{state:l,ref:n,stateAttributesMapping:lR,props:u})}),cR=R.createContext(void 0);function Mj(e=!0){const t=R.useContext(cR);if(t===void 0&&!e)throw new Error(Pt(7));return t}const Dj=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=Mj(),y=w?.value??[],b=w?void 0:o,v=(u||w?.disabled)??!1,[x,E]=as({controlled:w?y?.indexOf(C)>-1:l,default:b,name:"Toggle",state:"pressed"}),T=Pe((q,I)=>{C&&w?.setGroupValue?.(C,q,I),a?.(q,I)}),{getButtonProps:A,buttonRef:M}=Sr({disabled:v,native:g}),L=R.useMemo(()=>({disabled:v,pressed:x}),[v,x]),P=[M,n],z=[{"aria-pressed":x,onClick(q){const I=!x,K=Ue(Mn,q.nativeEvent);T(I,K),!K.isCanceled&&E(I)}},S,A],H=at("button",t,{enabled:!w,state:L,ref:P,props:z});return w?_.jsx(rR,{tag:"button",render:d,className:s,state:L,refs:P,props:z}):H});let Pj=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const PC={multiple(e){return e?{[Pj.multiple]:""}:null}},jj=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,b]=as({controlled:d,default:C,name:"ToggleGroup",state:"value"}),v=Pe((M,L,P)=>{let z;if(l?(z=y.slice(),L?z.push(M):z.splice(y.indexOf(M),1)):z=L?[M]:[],Array.isArray(z)){if(h?.(z,P),P.isCanceled)return;b(z)}}),x=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:x,ref:n,props:[T,g],stateAttributesMapping:PC});return _.jsx(cR.Provider,{value:E,children:S?A:_.jsx(jk,{render:f,className:p,state:x,refs:[n],props:[T,g],stateAttributesMapping:PC,loopFocus:u})})});function Ij(e){return at(e.defaultTagName??"div",e,e)}function Nj({className:e,...t}){return _.jsx("div",{"data-slot":"input-group",role:"group",className:Be("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 Bj=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 zj({className:e,align:t="inline-start",...n}){return _.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Be(Bj({align:t}),e),onClick:s=>{s.target.closest("button")||s.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const Hj=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 uR({className:e,type:t="button",variant:n="ghost",size:s="xs",...o}){return _.jsx(Ne,{type:t,"data-size":s,variant:n,className:Be(Hj({size:s}),e),...o})}function Vj({className:e,...t}){return _.jsx(Wt,{"data-slot":"input-group-control",className:Be("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 Fj=G9;function Uj({className:e,children:t,...n}){return _.jsxs(S9,{"data-slot":"combobox-trigger",className:Be("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,_.jsx(_e,{icon:Y2,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function Wj({className:e,...t}){return _.jsx(T9,{"data-slot":"combobox-clear",render:_.jsx(uR,{variant:"ghost",size:"icon-xs"}),className:Be(e),...t,children:_.jsx(_e,{icon:_o,strokeWidth:2,className:"pointer-events-none"})})}function qj({className:e,children:t,disabled:n=!1,showTrigger:s=!0,showClear:o=!1,...u}){return _.jsxs(Nj,{className:Be("w-auto",e),children:[_.jsx(k9,{render:_.jsx(Vj,{disabled:n}),...u}),_.jsxs(zj,{align:"inline-end",children:[s&&_.jsx(uR,{size:"icon-xs",variant:"ghost",render:_.jsx(Uj,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),o&&_.jsx(Wj,{disabled:n})]}),t]})}function Gj({className:e,side:t="bottom",sideOffset:n=6,align:s="start",alignOffset:o=0,anchor:u,...h}){return _.jsx(P9,{children:_.jsx(j9,{side:t,sideOffset:n,align:s,alignOffset:o,anchor:u,className:"isolate z-50",children:_.jsx(N9,{"data-slot":"combobox-content","data-chips":!!u,className:Be("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 $j({className:e,...t}){return _.jsx(M9,{"data-slot":"combobox-list",className:Be("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 Kj({className:e,children:t,...n}){return _.jsxs(H9,{"data-slot":"combobox-item",className:Be("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($9,{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 Yj({className:e,...t}){return _.jsx(V9,{"data-slot":"combobox-empty",className:Be("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}const Xj=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"}}),dR=R.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function Qj({className:e,variant:t,size:n,spacing:s=0,orientation:o="horizontal",children:u,...h}){return _.jsx(jj,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":s,"data-orientation":o,style:{"--gap":s},className:Be("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(dR.Provider,{value:{variant:t,size:n,spacing:s,orientation:o},children:u})})}function yv({className:e,children:t,variant:n="default",size:s="default",...o}){const u=R.useContext(dR);return _.jsx(Dj,{"data-slot":"toggle-group-item","data-variant":u.variant||n,"data-size":u.size||s,"data-spacing":u.spacing,className:Be("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",Xj({variant:u.variant||n,size:u.size||s}),e),...o,children:t})}function ea({className:e,size:t="default",...n}){return _.jsx(Aj,{"data-slot":"switch","data-size":t,className:Be("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(Oj,{"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 fR(e){return Kn({queryKey:["tasks",e],queryFn:()=>Zt(`${Ba}/api/tasks/${e}`),enabled:!!e})}function Zj(){const e=$n();return jn({mutationFn:t=>Zt(`${Ba}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function Jj(){const e=$n();return jn({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 jn({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 eI(){const e=$n();return jn({mutationFn:t=>Zt(`${Ba}/api/tasks/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function tI(){const e=$n();return jn({mutationFn:t=>Zt(`${Ba}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}const lc="";function nI(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 rI(e){return Kn({queryKey:["git","branches",e],queryFn:()=>Zt(`${lc}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function sI(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 iI(e){return Kn({queryKey:["fs","tree",e],queryFn:()=>Zt(`${lc}/api/fs/tree?root=${encodeURIComponent(e)}`),enabled:!!e,staleTime:1e4})}function oI(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 aI(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"},lI=3333,cI="claude --dangerously-skip-permissions";function ko(e){return Kn({queryKey:["config",e],queryFn:()=>Zt(`${cc}/api/config/${e}`)})}function uI(){const e=ko(sn.PORT);return{...e,data:e.data?.value??lI,isDefault:e.data?.isDefault??!0}}function hR(){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 pR(){const e=ko(sn.TASK_CREATION_COMMAND);return{...e,data:e.data?.value??cI,isDefault:e.data?.isDefault??!0}}function Rp(){const e=ko(sn.HOSTNAME);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function Tp(){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 fI(){const e=ko(sn.GITHUB_PAT);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function hI(){const e=$n();return jn({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 pI(){const e=$n();return jn({mutationFn:t=>Zt(`${cc}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function mI(){return Kn({queryKey:["config","notifications"],queryFn:()=>Zt(`${cc}/api/config/notifications`)})}function gI(){const e=$n();return jn({mutationFn:t=>Zt(`${cc}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function vI(){return jn({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 _I(e){return Kn({queryKey:["repositories",e],queryFn:()=>Zt(`${dd}/api/repositories/${e}`),enabled:!!e})}function mR(){const e=$n();return jn({mutationFn:t=>Zt(`${dd}/api/repositories`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function yI(){const e=$n();return jn({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 gR(){const e=$n();return jn({mutationFn:t=>Zt(`${dd}/api/repositories/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function Yl({className:e,children:t,...n}){return _.jsxs(yj,{"data-slot":"scroll-area",className:Be("relative",e),...n,children:[_.jsx(wj,{"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(bI,{}),_.jsx(Tj,{})]})}function bI({className:e,orientation:t="vertical",...n}){return _.jsx(kj,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Be("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(Rj,{"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}=nI(e?o??"":null),S=x=>{p&&(u(p.path+"/"+x),d(""))},C=()=>{p?.parent&&p.parent!==p.path&&(u(p.parent),d(""))},w=()=>{u(null),d("")},y=()=>{h.trim()&&(u(h.trim()),d(""))},b=x=>{n(x),t(!1)},v=p?.entries.filter(x=>x.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(xP,{}),_.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:x=>a(x.target.value),placeholder:"/path/to/your/project",onKeyDown:x=>x.key==="Enter"&&y(),className:"flex-1"}),_.jsx(Ne,{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:E4,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),_.jsx(Wt,{value:l,onChange:x=>d(x.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Ne,{variant:"outline",size:"icon-sm",onClick:w,title:"Home",children:_.jsx(_e,{icon:g4,size:14,strokeWidth:2})}),_.jsx(Ne,{variant:"outline",size:"icon-sm",onClick:C,disabled:!p||p.parent===p.path,title:"Parent directory",children:_.jsx(_e,{icon:Z2,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(Ne,{variant:"outline",size:"sm",onClick:()=>p&&b(p.path),disabled:!p,className:"max-sm:px-2",title:"Select current directory",children:[_.jsx(_e,{icon:s_,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(x=>_.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group",children:x.type==="directory"?_.jsxs(_.Fragment,{children:[_.jsx(_e,{icon:x.isGitRepo?s_:os,size:16,strokeWidth:2,className:x.isGitRepo?"text-emerald-500":"text-blue-500"}),_.jsx("button",{onClick:()=>S(x.name),className:"flex-1 text-left text-xs truncate hover:underline",children:x.name}),x.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:x.name})]})},x.name))]})]})}),_.jsxs(go,{children:[_.jsx(R0,{render:_.jsx(Ne,{variant:"outline"}),children:"Cancel"}),_.jsx(Ne,{onClick:()=>p&&b(p.path),disabled:!p,children:"Select Path"})]})]})})}function xI(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function SI(e){const t=xI(e);if(!t)return"";const n=Math.random().toString(36).substring(2,6);return`${t}-${n}`}function CI({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,b]=R.useState(""),[v,x]=R.useState(""),[E,T]=R.useState(!0),[A,M]=R.useState("none"),[L,P]=R.useState(null),[z,H]=R.useState("browse"),[q,I]=R.useState(""),[K,Y]=R.useState(null),[V,$]=R.useState(!1),G=yo(),j=Zj(),U=mR(),{data:D}=hR(),{data:N}=q0(),{data:W}=G0(),{data:Z,isLoading:ee}=rI(g||null),te=L?W?.find(le=>le.id===L):null,X=R.useMemo(()=>{if(!W)return[];if(!q.trim())return W;const le=q.toLowerCase();return W.filter(ve=>ve.displayName.toLowerCase().includes(le)||ve.path.toLowerCase().includes(le))},[W,q]);R.useEffect(()=>{W&&W.length>0?H("saved"):H("browse")},[W]),R.useEffect(()=>{w(Z?Z.current||Z.branches[0]||"main":"")},[Z,g]),R.useEffect(()=>{p.trim()&&A==="none"&&M("plan")},[p,A]);const F=le=>{d(le),x(SI(le))},se=async le=>{Y(null),$(!0);try{if(!(await aI(le)).isGitRepo){Y("Selected folder is not a git repository"),$(!1);return}if(S(le),P(null),!W?.find(ue=>ue.path===le)){const ue=le.split("/").pop()||"Unknown";U.mutate({path:le,displayName:ue})}}catch(ve){Y(ve instanceof Error?ve.message:"Failed to validate repository")}finally{$(!1)}},ne=le=>{if(le.preventDefault(),!l.trim()||!g)return;const ve=g.split("/").pop()||"repo",ge=y.trim()||v,ue=`${D}/${ge}`;j.mutate({title:l.trim(),description:p.trim(),repoPath:g,repoName:ve,baseBranch:C||"main",branch:ge,worktreePath:ue,initializeVibora:E,copyFiles:te?.copyFiles||void 0,startupScript:te?.startupScript||void 0},{onSuccess:de=>{const Ie=A!=="none"&&p.trim()?{aiMode:A,description:p.trim()}:void 0;u(!1),d(""),f(""),S(""),w(""),b(""),x(""),T(!0),M("none"),P(null),I(""),Y(null),H(W&&W.length>0?"saved":"browse"),G({to:"/tasks/$taskId",params:{taskId:de.id},state:Ie})}})},re=y.trim()||v,oe=re?`${D}/${re}`:"";return _.jsxs(_.Fragment,{children:[_.jsxs(xs,{open:o,onOpenChange:u,children:[_.jsxs(pk,{render:_.jsx(Ne,{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=>F(le.target.value),placeholder:"Add user authentication",required:!0})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"description",children:"Description"}),_.jsx(gk,{id:"description",value:p,onValueChange:f,placeholder:"Implement OAuth2 login flow...",rows:2})]}),_.jsxs(Cn,{children:[_.jsx(wn,{children:"AI Mode"}),_.jsxs(Qj,{value:[A],onValueChange:le=>{const ve=Array.isArray(le)?le[0]:le;ve&&M(ve)},className:"w-full",variant:"outline",children:[_.jsx(yv,{value:"none",className:"flex-1",children:"None"}),_.jsx(yv,{value:"plan",className:"flex-1",children:"Plan"}),_.jsx(yv,{value:"default",className:"flex-1",children:"Default"})]})]}),_.jsxs(Cn,{children:[_.jsx(wn,{children:"Repository"}),_.jsxs(_a,{value:z,onValueChange:le=>{H(le),Y(null)},children:[_.jsxs(ya,{children:[_.jsx(ir,{value:"saved",disabled:!W?.length,children:"Saved"}),_.jsx(ir,{value:"browse",children:"Browse"})]}),_.jsx(_r,{value:"saved",className:"mt-2",children:_.jsxs(Fj,{value:L||"",onValueChange:le=>{const ve=W?.find(ge=>ge.id===le);ve&&(P(le),S(ve.path),I(ve.displayName),Y(null))},inputValue:q,onInputValueChange:le=>{I(le),te&&le!==te.displayName&&P(null)},itemToStringLabel:le=>W?.find(ve=>ve.id===le)?.displayName||"",children:[_.jsx(qj,{placeholder:"Search repositories...",className:"w-full"}),_.jsx(Gj,{children:_.jsxs($j,{children:[_.jsx(Yj,{children:"No repositories found"}),X.map(le=>_.jsx(Kj,{value:le.id,children:le.displayName},le.id))]})})]})}),_.jsx(_r,{value:"browse",className:"mt-2",children:_.jsxs(Ne,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>a(!0),disabled:V,children:[_.jsx(_e,{icon:os,size:14,strokeWidth:2,className:"mr-2"}),V?_.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(jl,{value:C,onValueChange:le=>w(le??""),disabled:!g||ee,children:[_.jsx(Nl,{className:"w-full",children:_.jsx(Il,{children:C||_.jsx("span",{className:"text-muted-foreground",children:g?ee?"Loading branches...":"Select branch":"Select repository first"})})}),_.jsx(Bl,{children:Z?.branches.map(le=>_.jsxs(vr,{value:le,children:[le,le===Z.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=>b(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(R0,{render:_.jsx(Ne,{variant:"outline",type:"button"}),children:"Cancel"}),_.jsx(Ne,{type:"submit",disabled:j.isPending||!l.trim()||!g,children:j.isPending?"Creating...":"Create Task"})]})]})})]}),_.jsx($0,{open:h,onOpenChange:a,onSelect:se,initialPath:N||void 0})]})}function wI({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(Ne,{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(Ne,{variant:s==="/terminals"?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[_.jsx(_e,{icon:r0,size:16,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Terminals"})]})}),_.jsx(qn,{to:"/worktrees",children:_.jsxs(Ne,{variant:s.startsWith("/worktrees")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[_.jsx(_e,{icon:tE,size:16,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Worktrees"})]})}),_.jsx(qn,{to:"/repositories",children:_.jsxs(Ne,{variant:s.startsWith("/repositories")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[_.jsx(_e,{icon:J2,size:16,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Repositories"})]})}),_.jsx(qn,{to:"/review",children:_.jsxs(Ne,{variant:s.startsWith("/review")?"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:"Review"})]})})]})]}),_.jsxs("div",{className:"flex shrink-0 items-center gap-2 max-sm:gap-1",children:[_.jsx(CI,{open:o,onOpenChange:u}),_.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:t,title:"Command Palette (⌘K)",children:_.jsx(_e,{icon:r_,size:16,strokeWidth:2})}),_.jsx(qn,{to:"/settings",children:_.jsx(Ne,{variant:s==="/settings"?"secondary":"ghost",size:"icon-sm",children:_.jsx(_e,{icon:nE,size:16,strokeWidth:2})})})]})]})}function EI(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const kI=10,RI=2e3;function TI(){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":yr.success(d,{description:p});break;case"error":yr.error(d,{description:p});break;case"warning":yr.warning(d,{description:p});break;default:yr.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=EI(),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<kI&&(s.current++,n.current=setTimeout(()=>{o.current?.()},RI))},d.onerror=()=>{}},[u]);o.current=h,R.useEffect(()=>(h(),()=>{n.current&&clearTimeout(n.current),t.current&&(t.current.close(),t.current=null)}),[h])}const vR=R.createContext(null);function LI({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(vR.Provider,{value:l,children:e})}function K0(){const e=R.useContext(vR);if(!e)throw new Error("useKeyboardContext must be used within a KeyboardProvider");return e}function AI(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function _R(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 OI(e,t){const n=_R(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 yR(e){const t=_R(e),n=[],s=AI();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 MI(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&&MI(f.target)&&!d.some(C=>C.toLowerCase()==="escape")||!d.some(S=>OI(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 jC(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 DI(e,t){return t.trim()?e.map(s=>{let o=jC(s.label,t);if(s.keywords)for(const u of s.keywords){const h=jC(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 PI(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 jI={navigation:"Navigation",actions:"Actions"},II={activeTabId:null,focusedTerminals:{}};function bR(){const e=$n(),t=R.useRef(void 0),n=R.useRef({}),{data:s=II,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=jn({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 NI({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}=bR(),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:r0,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:tE,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:J2,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:nE,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:m4,size:16,strokeWidth:2}),action:()=>{a(!1),s?.()}}],[C,n,s,w]),b=R.useMemo(()=>DI(y,l),[y,l]),v=R.useMemo(()=>PI(b),[b]),x=R.useMemo(()=>{const A=[],M=["navigation","actions"];for(const L of M){const P=v.get(L);P&&A.push(...P)}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,x.length-1));break;case"ArrowUp":A.preventDefault(),f(M=>Math.max(M-1,0));break;case"Enter":A.preventDefault(),x[p]&&x[p].action();break;case"Escape":A.preventDefault(),a(!1);break}},[x,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:b.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:jI[A]}),M.map(L=>{const P=T++,z=P===p;return _.jsxs("button",{"data-selected":z,onClick:()=>L.action(),onMouseEnter:()=>f(P),className:Be("flex w-full items-center gap-3 rounded-md px-2 py-2 text-sm",z?"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:yR(L.shortcut)})]},L.id)})]},A)})})})]})})}const BI=[{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 zI({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:BI.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:yR(s.shortcut)})]},s.shortcut))})]},n.title))})]})})}const HI=({...e})=>_.jsx(vP,{theme:"dark",className:"toaster group",icons:{success:_.jsx(_e,{icon:c4,strokeWidth:2,className:"size-4"}),info:_.jsx(_e,{icon:_4,strokeWidth:2,className:"size-4"}),warning:_.jsx(_e,{icon:nc,strokeWidth:2,className:"size-4"}),error:_.jsx(_e,{icon:C4,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=z3({component:FI});function VI(){return TI(),null}function FI(){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(LI,{children:_.jsxs("div",{className:"flex h-screen flex-col overflow-x-hidden bg-background text-foreground",children:[_.jsx(VI,{}),_.jsx(wI,{onNewTaskRef:h,onOpenCommandPalette:d}),_.jsx("main",{className:"isolate flex-1 overflow-hidden",children:_.jsx(g2,{})}),_.jsx(NI,{open:o,onOpenChange:u,onNewTask:a,onShowShortcuts:l}),_.jsx(zI,{open:n,onOpenChange:s}),_.jsx(HI,{position:"bottom-right"})]})})}const UI=ws("/")({beforeLoad:()=>{throw e2({to:"/tasks"})}}),xR="";function WI(){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(`${xR}/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(b=>[b.path,{...b,size:0,sizeFormatted:"...",branch:"..."}]))),u(!1),a(y.length>0)}),C.addEventListener("worktree:details",w=>{const y=JSON.parse(w.data);t(b=>{const v=new Map(b),x=v.get(y.path);return x&&v.set(y.path,{...x,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 qI(){const e=$n();return jn({mutationFn:({worktreePath:t,repoPath:n})=>Zt(`${xR}/api/worktrees`,{method:"DELETE",body:JSON.stringify({worktreePath:t,repoPath:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worktrees"]}),e.invalidateQueries({queryKey:["tasks"]})}})}const GI=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 Ij({defaultTagName:"span",props:Ws({className:Be(GI({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:Be("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 $I({className:e,...t}){return _.jsx("div",{"data-slot":"card-header",className:Be("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 KI({className:e,...t}){return _.jsx("div",{"data-slot":"card-title",className:Be("text-sm font-medium",e),...t})}function hd({className:e,...t}){return _.jsx("div",{"data-slot":"card-content",className:Be("px-4 group-data-[size=sm]/card:px-3",e),...t})}function uc({...e}){return _.jsx(m9,{"data-slot":"alert-dialog",...e})}function dc({...e}){return _.jsx(hk,{"data-slot":"alert-dialog-trigger",...e})}function YI({...e}){return _.jsx(ck,{"data-slot":"alert-dialog-portal",...e})}function XI({className:e,...t}){return _.jsx(sE,{"data-slot":"alert-dialog-overlay",className:Be("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(YI,{children:[_.jsx(XI,{}),_.jsx(lk,{"data-slot":"alert-dialog-content","data-size":t,className:Be("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:Be("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:Be("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(fk,{"data-slot":"alert-dialog-title",className:Be("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(aE,{"data-slot":"alert-dialog-description",className:Be("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function SR({className:e,...t}){return _.jsx(Ne,{"data-slot":"alert-dialog-action",className:Be(e),...t})}function vc({className:e,variant:t="outline",size:n="default",...s}){return _.jsx(fp,{"data-slot":"alert-dialog-cancel",className:Be(e),render:_.jsx(Ne,{variant:t,size:n}),...s})}const CR={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},__={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"},QI=ws("/worktrees/")({component:tN});function ZI(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 JI({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:Be("shrink-0",__.ORPHANED),children:"Orphaned"}):e.taskStatus?_.jsx(ba,{className:Be("shrink-0",__[e.taskStatus]),children:CR[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:i_,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:p4,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:a4,size:12,strokeWidth:2,className:"shrink-0"}),_.jsx("span",{children:ZI(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:Q2,size:12,strokeWidth:2,className:"shrink-0"})]})})]})]}),_.jsxs(uc,{open:n,onOpenChange:s,children:[_.jsx(dc,{render:_.jsx(Ne,{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(Ne,{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 eN=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED","ORPHANED"];function tN(){const{worktrees:e,summary:t,isLoading:n,isLoadingDetails:s,error:o,refetch:u}=WI(),h=qI(),[a,l]=R.useState(new Set),[d,p]=R.useState(!1),[f,g]=R.useState(!1),S=x=>{l(E=>{const T=new Set(E);return T.has(x)?T.delete(x):T.add(x),T})},C=()=>{l(new Set)},w=R.useMemo(()=>a.size===0?e:e.filter(x=>!!(x.isOrphaned&&a.has("ORPHANED")||x.taskStatus&&a.has(x.taskStatus))),[e,a]),y=R.useMemo(()=>e.filter(x=>x.taskStatus==="DONE"||x.taskStatus==="CANCELED"),[e]),b=async()=>{if(y.length!==0){g(!0);try{for(const x of y)await h.mutateAsync({worktreePath:x.path,repoPath:x.repoPath});p(!1),u()}catch{}finally{g(!1)}}},v=async x=>{await h.mutateAsync({worktreePath:x.path,repoPath:x.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(x=>x.isOrphaned).length)>0&&_.jsxs("span",{className:"text-destructive",children:[t?.orphaned??e.filter(x=>x.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(Ne,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground hover:text-destructive",disabled:s}),children:[_.jsx(_e,{icon:u4,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(x=>x.taskStatus==="DONE").length>0&&_.jsxs("span",{className:"mr-3",children:[_.jsx("span",{className:"font-medium text-emerald-600",children:y.filter(x=>x.taskStatus==="DONE").length})," ","Done"]}),y.filter(x=>x.taskStatus==="CANCELED").length>0&&_.jsxs("span",{children:[_.jsx("span",{className:"font-medium text-rose-600",children:y.filter(x=>x.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(Ne,{variant:"destructive",onClick:b,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(Ne,{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:eN.map(x=>{const E=a.has(x);return _.jsx("button",{onClick:()=>S(x),className:Be("rounded-full px-2.5 py-1 text-xs font-medium transition-colors",E?__[x]:"bg-muted text-muted-foreground hover:bg-muted/80"),children:CR[x]},x)})})]}),_.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(x=>_.jsx(JI,{worktree:x,onDelete:v},x.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 y_(e,t){return t.sort(e==="horizontal"?nN:rN)}function nN(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function rN(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function wR(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 sN({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}=wR(s,h),d=e==="horizontal"?a:l;d<u&&(u=d,o=h)}return Gt(o,"No rect found"),o}function ER(e){const{element:t,orientation:n,panels:s,separators:o}=e,u=y_(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 b=d[0],v=sN({orientation:n,rects:[g,S],targetRect:b.element.getBoundingClientRect()});C=[b,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 iN(e,t){const n=getComputedStyle(e),s=parseFloat(n.fontSize);return t*s}function oN(e,t){const n=getComputedStyle(e.ownerDocument.body),s=parseFloat(n.fontSize);return t*s}function aN(e){return e/100*window.innerHeight}function lN(e){return e/100*window.innerWidth}function cN(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]=cN(n);switch(u){case"%":{s=o/100*e;break}case"px":{s=o;break}case"rem":{s=oN(t,o);break}case"em":{s=iN(t,o);break}case"vh":{s=aN(o);break}case"vw":{s=lN(o);break}}return s}function Cs(e){return parseFloat(e.toFixed(3))}function NC(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 uN{#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 uN;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 dN=e=>e,bv=()=>{},kR=1,RR=2,TR=4,LR=8,BC={coarse:10,precise:5};function fN({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&kR)!==0,h=(e&RR)!==0,a=(e&TR)!==0,l=(e&LR)!==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 xv,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=fN({cursorFlags:e,groups:t.hitRegions.map(o=>o.group),state:t.state}),s=`*{cursor: ${n} !important; ${t.state==="active"?"touch-action: none;":""} }`;if(xv===s)return;xv=s,n?Ds.cssRules.length===0?Ds.insertRule(s):Ds.replaceSync(s):Ds.cssRules.length===1&&Ds.deleteRule(0);break}case"inactive":{xv=void 0,Ds.cssRules.length===1&&Ds.deleteRule(0);break}}}function hN(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:b,minSize:v=0}=w;if(b){const x=h[C];if(Gt(x!=null,`Previous layout not found for panel index ${C}`),or(x,y)){const E=v-x;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:b,minSize:v=0}=w;if(b){const x=h[C];if(Gt(x!=null,`Previous layout not found for panel index ${C}`),or(x,v)){const E=x-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 x=Rl({panelConstraints:n[w],size:100})-v;if(y+=x,w+=C,w<0||w>=n.length)break}const b=Math.min(Math.abs(e),Math.abs(y));e=e<0?0-b:b}{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 b=y-w,v=Rl({panelConstraints:n[C],size:b});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(hN(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,b=Rl({panelConstraints:n[C],size:y});if(l[C]=b,!or(b,y)){let v=y-b,x=e<0?p:d;for(;x>=0&&x<n.length;){const E=l[x];Gt(E!=null,`Previous layout not found for panel index ${x}`);const T=E+v,A=Rl({panelConstraints:n[x],size:T});if(or(E,A)||(v-=A-E,l[x]=A),or(v,0))break;e>0?x--:x++}}}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 AR({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:b,separatorToPanels:v}=s.get(l)??{defaultLayoutDeferred:!1};if(y&&C&&b&&v){const x=Gu({delta:S,initialLayout:C,panelConstraints:y,pivotIndices:a.panels.map(E=>g.indexOf(E)),prevLayout:b,trigger:"mouse-or-touch"});if(_c(x,b)){if(S!==0&&!p)switch(f){case"horizontal":{u|=S<0?kR:RR;break}case"vertical":{u|=S<0?TR:LR;break}}}else{h.set(a.group,{defaultLayoutDeferred:w,derivedPanelConstraints:y,layout:x,separatorToPanels:v});const E=a.group.panels.map(({id:T})=>T).join(",");a.group.inMemoryLayouts[E]=x}}}),ls({cursorFlags:u,mountedGroups:h}),Y0()}function zC(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&&AR({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 OR({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 MR(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=MR(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=OR({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 HC(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}=MR(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 pN(e,t,n){let s,o={x:1/0,y:1/0};for(const u of t){const h=wR(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 mN(){return nh===void 0&&(typeof matchMedia=="function"?nh=!!matchMedia("(pointer:coarse)").matches:nh=!1),nh}function gN(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:UC(e),b:UC(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:FC(VC(n.a)),b:FC(VC(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 vN=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function _N(e){const t=getComputedStyle(DR(e)??e).display;return t==="flex"||t==="inline-flex"}function yN(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||_N(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"||vN.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function VC(e){let t=e.length;for(;t--;){const n=e[t];if(Gt(n,"Missing node"),yN(n))return n}return null}function FC(e){return e&&Number(getComputedStyle(e).zIndex)||0}function UC(e){const t=[];for(;e;)t.push(e),e=DR(e);return t}function DR(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}function bN(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 xN({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!(n instanceof HTMLElement)||n.contains(e)||e.contains(n))return!0;if(gN(n,e)>0){let s=n;for(;s;){if(s.contains(e))return!0;if(bN(s.getBoundingClientRect(),t))return!1;s=s.parentElement}}return!0}function PR(e,t){const n=[];return t.forEach((s,o)=>{if(o.disabled)return;const u=mN()?BC.coarse:BC.precise,h=ER(o),a=pN(o.orientation,h,{x:e.clientX,y:e.clientY});a&&a.distance.x<=u&&a.distance.y<=u&&xN({groupElement:o.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function WC(e){if(e.defaultPrevented)return;const{mountedGroups:t}=Ys(),n=PR(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 qC(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}AR({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break}default:{const s=PR(e,n);s.length===0?t.state!=="inactive"&&ls({interactionState:{state:"inactive"}}):ls({interactionState:{hitRegions:s,state:"hover"}}),Y0();break}}}function GC(e){if(e.defaultPrevented)return;e.preventDefault();const{interactionState:t}=Ys();t.state==="active"&&(ls({cursorFlags:0,interactionState:{state:"inactive"}}),Y0())}function $C(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 SN(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 CN(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 wN(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(b=>{const v=b.mountedGroups.get(e);if(v){const x=NC(e),E=v.defaultLayoutDeferred?$C(x):v.layout,T=La({layout:E,panelConstraints:x});return!v.defaultLayoutDeferred&&_c(E,T)&&CN(v.derivedPanelConstraints,x)?b:{mountedGroups:new Map(b.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:x,layout:T,separatorToPanels:v.separatorToPanels})}}return b})}}else SN(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=NC(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??$C(h),p=La({layout:d,panelConstraints:h}),f=ER(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",zC),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",HC)}),g.mountedGroups.size===1&&(window.addEventListener("pointerdown",WC),window.addEventListener("pointermove",qC),window.addEventListener("pointerup",GC)),function(){t=!1;const S=ls(C=>{const w=new Map(C.mountedGroups);return w.delete(e),{mountedGroups:w}});e.element.removeEventListener("pointerleave",zC),e.separators.forEach(C=>{C.element.removeEventListener("keydown",HC)}),S.mountedGroups.size===0&&(window.removeEventListener("pointerdown",WC),window.removeEventListener("pointermove",qC),window.removeEventListener("pointerup",GC)),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 EN(e){const t=R.useRef({...e});return za(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const jR="--react-resizable-panels--panel--pointer-events";function IR(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 NR=R.createContext(null);function kN(e,t){const n=R.useRef({getLayout:()=>({}),setLayout:dN});R.useImperativeHandle(t,()=>n.current,[]),za(()=>{Object.assign(n.current,OR({groupId:e}))})}function RN({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(Y=>{_c(g.current,Y)||(g.current=Y,l?.(Y))}),C=X0(a),[w,y]=R.useState(!1),[b,v]=R.useState(null),[x,E]=R.useState(n??{}),[T,A]=R.useState([]),[M,L]=R.useState([]),P=R.useRef({lastExpandedPanelSizes:{},layouts:{}}),z=Z0(v,u);kN(C,h);const H=R.useMemo(()=>({id:C,orientation:d,registerPanel:Y=>(A(V=>y_(d,[...V,Y])),()=>{A(V=>V.filter($=>$!==Y))}),registerSeparator:Y=>(L(V=>y_(d,[...V,Y])),()=>{L(V=>V.filter($=>$!==Y))})}),[C,d]),q=EN({defaultLayout:n,disableCursor:s}),I=R.useRef(null);za(()=>{if(b===null)return;const Y={defaultLayout:q.defaultLayout,disableCursor:!!q.disableCursor,disabled:!!o,element:b,id:C,inMemoryLastExpandedPanelSizes:P.current.lastExpandedPanelSizes,inMemoryLayouts:P.current.layouts,orientation:d,panels:T,separators:M};I.current=Y;const V=wN(Y),$=Ys().mountedGroups.get(Y);if($){const{defaultLayoutDeferred:U,derivedPanelConstraints:D,layout:N}=$;!U&&D.length>0&&(E(N),S?.(N))}const G=xa.addListener("interactionStateChange",U=>{U.state==="active"?y(U.hitRegions.some(D=>D.group===Y)):y(!1)}),j=xa.addListener("mountedGroupsChange",U=>{const D=U.get(Y);if(D){const{defaultLayoutDeferred:N,derivedPanelConstraints:W,layout:Z}=D;if(N||W.length===0)return;E(Z),S?.(Z)}});return()=>{I.current=null,V(),G(),j()}},[o,b,C,S,d,T,M,q]),R.useEffect(()=>{const Y=I.current;Y&&(Y.defaultLayout=n,Y.disableCursor=!!s)});const K={[jR]:w?"none":void 0};for(const Y in x){const V=IR(C,Y),$=x[Y];K[V]=$}return _.jsx(NR.Provider,{value:H,children:_.jsx("div",{...f,"aria-orientation":d,className:t,"data-group":!0,"data-testid":C,id:C,ref:z,style:{...p,...K,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}function J0(){const e=R.useContext(NR);return Gt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function TN({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"}),b=La({layout:y,panelConstraints:p});_c(g,b)||ls(v=>({mountedGroups:new Map(v.mountedGroups).set(f,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:b,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 LN(e,t){const{id:n}=J0(),s=R.useRef({collapse:bv,expand:bv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:bv});R.useImperativeHandle(t,()=>s.current,[]),za(()=>{Object.assign(s.current,TN({groupId:n,panelId:e}))})}function AN({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),b=Z0(y,u),{id:v,registerPanel:x}=J0(),E=d!==null,T=Q0(M=>{d?.(M,h)});za(()=>{if(w!==null)return x({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,x]),LN(C,p);const A=IR(v,C);return _.jsx("div",{...g,"data-panel":!0,"data-testid":C,id:C,ref:b,style:{...ON,flexBasis:0,flexGrow:`var(${A}, 1)`,flexShrink:1,overflow:"hidden",pointerEvents:`var(${jR})`},children:_.jsx("div",{className:t,style:{width:"100%",height:"100%",...f},children:e})})}const ON={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 MN({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 DN({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(),b=w==="horizontal"?"vertical":"horizontal";return za(()=>{if(f!==null){const v={element:f,id:h},x=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:P},z)=>{if(z.id===C){const H=P.get(v);if(H){const q=H[0],I=z.panels.indexOf(q);l(MN({layout:L,panelConstraints:M,panelId:q.id,panelIndex:I}))}}})});return()=>{E(),T(),x()}}},[f,C,h,y]),_.jsx("div",{...u,"aria-controls":a.valueControls,"aria-orientation":b,"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(RN,{"data-slot":"resizable-panel-group",orientation:t,className:Be("flex h-full w-full data-[orientation=vertical]:flex-col",e),...n})}function ts({...e}){return _.jsx(AN,{"data-slot":"resizable-panel",...e})}function na({withHandle:e,className:t,...n}){return _.jsx(DN,{"data-slot":"resizable-handle",className:Be("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 Sv={exports:{}},KC;function PN(){return KC||(KC=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,x,E,T){var A,M=arguments.length,L=M<3?x:T===null?T=Object.getOwnPropertyDescriptor(x,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,x,E,T);else for(var P=v.length-1;P>=0;P--)(A=v[P])&&(L=(M<3?A(L):M>3?A(x,E,L):A(x,E))||L);return M>3&&L&&Object.defineProperty(x,E,L),L},p=this&&this.__param||function(v,x){return function(E,T){x(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 b=a.AccessibilityManager=class extends S.Disposable{constructor(v,x,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(`
27
- `)))),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 x=0;x<v;x++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
28
- `&&(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,x){this._liveRegionDebouncer.refresh(v,x,this._terminal.rows)}_renderRows(v,x){const E=this._terminal.buffer,T=E.lines.length.toString();for(let A=v;A<=x;A++){const M=E.lines.get(E.ydisp+A),L=[],P=M?.translateToString(!0,void 0,void 0,L)||"",z=(E.ydisp+A+1).toString(),H=this._rowElements[A];H&&(P.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=P,this._rowColumns.set(H,L)),H.setAttribute("aria-posinset",z),H.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,x){const E=v.target,T=this._rowElements[x===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==T)return;let A,M;if(x===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),x===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(x===0?-1:1),this._rowElements[x===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 x={node:v.anchorNode,offset:v.anchorOffset},E={node:v.focusNode,offset:v.focusOffset};if((x.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===E.node&&x.offset>E.offset)&&([x,E]=[E,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const 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:P,offset:z})=>{const H=P instanceof Text?P.parentNode:P;let q=parseInt(H?.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const I=this._rowColumns.get(H);if(!I)return console.warn("columns is null. Race condition?"),null;let K=z<I.length?I[z]:I.slice(-1)[0]+1;return K>=this._terminal.cols&&(++q,K=0),{row:q,column:K}},M=A(x),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 x=this._rowContainer.children.length;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);for(;this._rowElements.length>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=b=d([p(1,w.IInstantiationService),p(2,C.ICoreBrowserService),p(3,C.IRenderService)],b)},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,b=g.clientY-w.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${y}px`,S.style.top=`${b}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(b,v,x,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,v,x,E);else for(var L=b.length-1;L>=0;L--)(T=b[L])&&(M=(A<3?T(M):A>3?T(v,x,M):T(v,x))||M);return A>3&&M&&Object.defineProperty(v,x,M),M},p=this&&this.__param||function(b,v){return function(x,E){v(x,E,b)}};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(b,v,x,E,T){super(),this._element=b,this._mouseService=v,this._renderService=x,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(b){this._lastMouseEvent=b;const v=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const x=b.composedPath();for(let E=0;E<x.length;E++){const T=x[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(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,v){this._activeProviderReplies&&v||(this._activeProviderReplies?.forEach((E=>{E?.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let x=!1;for(const[E,T]of this._linkProviderService.linkProviders.entries())v?this._activeProviderReplies?.get(E)&&(x=this._checkLinkProviderResult(E,b,x)):T.provideLinks(b.y,(A=>{if(this._isMouseOut)return;const M=A?.map((L=>({link:L})));this._activeProviderReplies?.set(E,M),x=this._checkLinkProviderResult(E,b,x),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,v){const x=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<b?0:M.link.range.start.x,P=M.link.range.end.y>b?this._bufferService.cols:M.link.range.end.x;for(let z=L;z<=P;z++){if(x.has(z)){T.splice(A--,1);break}x.add(z)}}}}_checkLinkProviderResult(b,v,x){if(!this._activeProviderReplies)return x;const E=this._activeProviderReplies.get(b);let T=!1;for(let A=0;A<b;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&&(x=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let A=0;A<this._activeProviderReplies.size;A++){const M=this._activeProviderReplies.get(A)?.find((L=>this._linkAtPosition(L.link,v)));if(M){x=!0,this._handleNewLink(M);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const v=this._positionFromMouseEvent(b,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,v){this._currentLink&&this._lastMouseEvent&&(!b||!v||this._currentLink.link.range.start.y>=b&&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(b){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(b.link,v)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:x=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:x=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((x=>{if(!this._currentLink)return;const E=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+x.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(b,v,x){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(x,v.text)}_fireUnderlineEvent(b,v){const x=b.range,E=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-E-1,x.end.x,x.end.y-E-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(b,v,x){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(x,v.text)}_linkAtPosition(b,v){const x=b.range.start.y*this._bufferService.cols+b.range.start.x,E=b.range.end.y*this._bufferService.cols+b.range.end.x,T=v.y*this._bufferService.cols+v.x;return x<=T&&T<=E}_positionFromMouseEvent(b,v,x){const E=x.getCoords(b,v,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,v,x,E,T){return{x1:b,y1:v,x2:x,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,b,v){var x,E=arguments.length,T=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,b,v);else for(var A=w.length-1;A>=0;A--)(x=w[A])&&(T=(E<3?x(T):E>3?x(y,b,T):x(y,b))||T);return E>3&&T&&Object.defineProperty(y,b,T),T},p=this&&this.__param||function(w,y){return function(b,v){y(b,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,b){this._bufferService=w,this._optionsService=y,this._oscLinkService=b}provideLinks(w,y){const b=this._bufferService.buffer.lines.get(w-1);if(!b)return void y(void 0);const v=[],x=this._optionsService.rawOptions.linkHandler,E=new f.CellData,T=b.getTrimmedLength();let A=-1,M=-1,L=!1;for(let P=0;P<T;P++)if(M!==-1||b.hasContent(P)){if(b.loadCell(P,E),E.hasExtendedAttrs()&&E.extended.urlId){if(M===-1){M=P,A=E.extended.urlId;continue}L=E.extended.urlId!==A}else M!==-1&&(L=!0);if(L||M!==-1&&P===T-1){const z=this._oscLinkService.getLinkData(A)?.uri;if(z){const H={start:{x:M+1,y:w},end:{x:P+(L||P!==T-1?0:1),y:w}};let q=!1;if(!x?.allowNonHttpProtocols)try{const I=new URL(z);["http:","https:"].includes(I.protocol)||(q=!0)}catch{q=!0}q||v.push({text:z,range:H,activate:(I,K)=>x?x.activate(I,K,H):C(0,K),hover:(I,K)=>x?.hover?.(I,K,H),leave:(I,K)=>x?.leave?.(I,K,H)})}L=!1,E.hasExtendedAttrs()&&E.extended.urlId?(M=P,A=E.extended.urlId):(M=-1,A=-1)}}y(v)}};function C(w,y){if(confirm(`Do you want to navigate to ${y}?
29
-
30
- WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.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),b=l(2950),v=l(1296),x=l(428),E=l(4269),T=l(5114),A=l(8934),M=l(3230),L=l(9312),P=l(4725),z=l(6731),H=l(8055),q=l(8969),I=l(8460),K=l(844),Y=l(6114),V=l(8437),$=l(2584),G=l(7399),j=l(5941),U=l(9074),D=l(2585),N=l(5435),W=l(4567),Z=l(779);class ee 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=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(P.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((F,se)=>this.refresh(F,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((F=>this._reportWindowsOptions(F)))),this.register(this._inputHandler.onColor((F=>this._handleColorEvent(F)))),this.register((0,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((F=>this._afterResize(F.cols,F.rows)))),this.register((0,K.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const F of X){let se,ne="";switch(F.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;"+F.index}switch(F.type){case 0:const re=H.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[F.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${ne};${(0,j.toRgbString)(re)}${$.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((oe=>oe.ansi[F.index]=H.channels.toColor(...F.color)));else{const oe=se;this._themeService.modifyColors((le=>le[oe]=H.channels.toColor(...F.color)))}break;case 2:this._themeService.restoreColor(F.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(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.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($.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,F=this.buffer.lines.get(X);if(!F)return;const se=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,re=F.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",(F=>{this.hasSelection()&&(0,d.copyHandler)(F,this._selectionService)})));const X=F=>(0,d.handlePasteEvent)(F,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,p.addDisposableDomListener)(this.element,"paste",X)),Y.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(F=>{F.button===2&&(0,d.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(F=>{(0,d.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(F=>{F.button===1&&(0,d.moveTextAreaUnderMouseCursor)(F,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 F=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),F.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),F.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),Y.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(P.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(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(P.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(z.ThemeService),this._instantiationService.setService(P.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(P.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(P.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(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(P.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(F);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(P.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(W.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,F=this.element;function se(oe){const le=X._mouseService.getMouseReportCoords(oe,X.screenElement);if(!le)return!1;let ve,ge;switch(oe.overrideType||oe.type){case"mousemove":ge=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":ge=0,ve=oe.button<3?oe.button:3;break;case"mousedown":ge=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;ge=oe.deltaY<0?0:1,ve=4;break;default:return!1}return!(ge===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:ge,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||(F.addEventListener("mousemove",re.mousemove),ne.mousemove=re.mousemove):(F.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&oe?ne.wheel||(F.addEventListener("wheel",re.wheel,{passive:!1}),ne.wheel=re.wheel):(F.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)(F,"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)(F,"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=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(oe.deltaY<0?"A":"B");let ge="";for(let ue=0;ue<Math.abs(le);ue++)ge+=ve;return this.coreService.triggerDataEvent(ge,!0),this.cancel(oe,!0)}return this.viewport.handleWheel(oe)?this.cancel(oe):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(F,"touchstart",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(oe),this.cancel(oe)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(F,"touchmove",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(oe)?void 0:this.cancel(oe)}),{passive:!1}))}refresh(X,F){this._renderService?.refreshRows(X,F)}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,F,se=0){se===1?(super.scrollLines(X,F,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 F=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),F}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,F,se){this._selectionService.setSelection(X,F,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,F){this._selectionService?.selectLines(X,F)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const F=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!F&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;F||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,G.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!==$.C0.ETX&&se.key!==$.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,F){const se=X.isMac&&!this.options.macOptionIsMeta&&F.altKey&&!F.ctrlKey&&!F.metaKey||X.isWindows&&F.altKey&&F.ctrlKey&&!F.metaKey||X.isWindows&&F.getModifierState("AltGraph");return F.type==="keypress"?se:se&&(!F.keyCode||F.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(F){return F.keyCode===16||F.keyCode===17||F.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let F;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)F=X.charCode;else if(X.which===null||X.which===void 0)F=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;F=X.which}return!(!F||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(F=String.fromCharCode(F),this._onKey.fire({key:F,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(F,!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 F=X.data;return this.coreService.triggerDataEvent(F,!0),this.cancel(X),!0}return!1}resize(X,F){X!==this.cols||F!==this.rows?super.resize(X,F):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,F){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(V.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($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case N.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const F=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${se};${F}t`);break;case N.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(`${$.C0.ESC}[6;${re};${ne}t`)}}cancel(X,F){if(this.options.cancelEvents||F)return X.preventDefault(),X.stopPropagation(),!1}}a.Terminal=ee},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(b,v,x,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,v,x,E);else for(var L=b.length-1;L>=0;L--)(T=b[L])&&(M=(A<3?T(M):A>3?T(v,x,M):T(v,x))||M);return A>3&&M&&Object.defineProperty(v,x,M),M},p=this&&this.__param||function(b,v){return function(x,E){v(x,E,b)}};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(b,v,x,E,T,A,M,L){super(),this._viewportElement=b,this._scrollArea=v,this._bufferService=x,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((P=>this._activeBuffer=P.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((P=>this._renderDimensions=P))),this._handleThemeChange(L.colors),this.register(L.onChangeColors((P=>this._handleThemeChange(P)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const 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 b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const 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 b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,v){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(v<0&&this._viewportElement.scrollTop!==0||v>0&&x<this._lastRecordedBufferHeight)||(b.cancelable&&b.preventDefault(),!1)}handleWheel(b){const v=this._getPixelsScrolled(b);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(b,v))}scrollLines(b){if(b!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const v=b*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:b,suppressScrollEvent:!1})}_getPixelsScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let v=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_LINE?v*=this._currentRowHeight:b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._currentRowHeight*this._bufferService.rows),v}getBufferElements(b,v){let x,E="";const T=[],A=v??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let L=b;L<A;L++){const P=M.get(L);if(!P)continue;const z=M.get(L+1)?.isWrapped;if(E+=P.translateToString(!z),!z||L===M.length-1){const H=document.createElement("div");H.textContent=E,T.push(H),E.length>0&&(x=H),E=""}}return{bufferElements:T,cursorElement:x}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let v=this._applyScrollModifier(b.deltaY,b);return b.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):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._bufferService.rows),v}_applyScrollModifier(b,v){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&v.altKey||x==="ctrl"&&v.ctrlKey||x==="shift"&&v.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const v=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,v!==0&&(this._viewportElement.scrollTop+=v,this._bubbleScroll(b,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,b,v){var x,E=arguments.length,T=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,b,v);else for(var A=w.length-1;A>=0;A--)(x=w[A])&&(T=(E<3?x(T):E>3?x(y,b,T):x(y,b))||T);return E>3&&T&&Object.defineProperty(y,b,T),T},p=this&&this.__param||function(w,y){return function(b,v){y(b,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,b,v,x){super(),this._screenElement=w,this._bufferService=y,this._coreBrowserService=b,this._decorationService=v,this._renderService=x,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((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 b=w.options.x??0;return b&&b>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 b=this._decorationElements.get(w);b||(b=this._createElement(w),w.element=b,this._decorationElements.set(w,b),this._container.appendChild(b),w.onDispose((()=>{this._decorationElements.delete(w),b.remove()}))),b.style.top=y*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(b)}}_refreshXPosition(w,y=w.element){if(!y)return;const b=w.options.x??0;(w.options.anchor||"left")==="right"?y.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=b?b*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(x,E,T,A){var M,L=arguments.length,P=L<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(x,E,T,A);else for(var z=x.length-1;z>=0;z--)(M=x[z])&&(P=(L<3?M(P):L>3?M(E,T,P):M(E,T))||P);return L>3&&P&&Object.defineProperty(E,T,P),P},p=this&&this.__param||function(x,E){return function(T,A){E(T,A,x)}};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},b={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(x,E,T,A,M,L,P){super(),this._viewportElement=x,this._screenElement=E,this._bufferService=T,this._decorationService=A,this._renderService=M,this._optionsService=L,this._coreBrowserService=P,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 z=this._canvas.getContext("2d");if(!z)throw new Error("Ctx cannot be null");this._ctx=z,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 x=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=x,y.center=E,y.right=x,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=y.left,b.right=y.left+y.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const x=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(x,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 x=this._colorZoneStore.zones;for(const E of x)E.position!=="full"&&this._renderColorZone(E);for(const E of x)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(x){this._ctx.fillStyle=x.color,this._ctx.fillRect(b[x.position||"full"],Math.round((this._canvas.height-1)*(x.startBufferLine/this._bufferService.buffers.active.lines.length)-w[x.position||"full"]/2),y[x.position||"full"],Math.round((this._canvas.height-1)*((x.endBufferLine-x.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[x.position||"full"]))}_queueRefresh(x,E){this._shouldUpdateDimensions=x||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,b,v){var x,E=arguments.length,T=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,b,v);else for(var A=w.length-1;A>=0;A--)(x=w[A])&&(T=(E<3?x(T):E>3?x(y,b,T):x(y,b))||T);return E>3&&T&&Object.defineProperty(y,b,T),T},p=this&&this.__param||function(w,y){return function(b,v){y(b,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,b,v,x,E){this._textarea=w,this._compositionView=y,this._bufferService=b,this._optionsService=v,this._coreService=x,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 b;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),b.length>0&&this._coreService.triggerDataEvent(b,!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,b=y.replace(w,"");this._dataAlreadySent=b,y.length>w.length?this._coreService.triggerDataEvent(b,!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),b=this._renderService.dimensions.css.cell.height,v=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,x=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=x+"px",this._compositionView.style.top=v+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=x+"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,b){if(!C)return;const v=l(d,p,f);return v?(v[0]=Math.ceil((v[0]+(b?w/2:0))/w),v[1]=Math.ceil(v[1]/y),v[0]=Math.min(Math.max(v[0],1),g+(b?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,b,v,x){const E=y-f(y,v),T=b-f(b,v),A=Math.abs(E-T)-(function(M,L,P){let z=0;const H=M-f(M,P),q=L-f(L,P);for(let I=0;I<Math.abs(H-q);I++){const K=g(M,L)==="A"?-1:1;P.buffer.lines.get(H+K*I)?.isWrapped&&z++}return z})(y,b,v);return w(A,C(g(y,b),x))}function f(y,b){let v=0,x=b.buffer.lines.get(y),E=x?.isWrapped;for(;E&&y>=0&&y<b.rows;)v++,x=b.buffer.lines.get(--y),E=x?.isWrapped;return v}function g(y,b){return y>b?"A":"B"}function S(y,b,v,x,E,T){let A=y,M=b,L="";for(;A!==v||M!==x;)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,b){const v=b?"O":"[";return d.C0.ESC+v+y}function w(y,b){y=Math.floor(y);let v="";for(let x=0;x<y;x++)v+=b;return v}a.moveToCellSequence=function(y,b,v,x){const E=v.buffer.x,T=v.buffer.y;if(!v.buffer.hasScrollback)return(function(L,P,z,H,q,I){return p(P,H,q,I).length===0?"":w(S(L,P,L,P-f(P,q),!1,q).length,C("D",I))})(E,T,0,b,v,x)+p(T,b,v,x)+(function(L,P,z,H,q,I){let K;K=p(P,H,q,I).length>0?H-f(H,q):P;const Y=H,V=(function($,G,j,U,D,N){let W;return W=p(j,U,D,N).length>0?U-f(U,D):G,$<j&&W<=U||$>=j&&W<U?"C":"D"})(L,P,z,H,q,I);return w(S(L,K,z,Y,V==="C",q).length,C(V,I))})(E,T,y,b,v,x);let A;if(T===b)return A=E>y?"D":"C",w(Math.abs(E-y),C(A,x));A=T>b?"D":"C";const M=Math.abs(T-b);return w((function(L,P){return P.cols-L})(T>b?y:E,v)+(M-1)*v.cols+1+((T>b?E:y)-1),C(A,x))}},1296:function(h,a,l){var d=this&&this.__decorate||function(I,K,Y,V){var $,G=arguments.length,j=G<3?K:V===null?V=Object.getOwnPropertyDescriptor(K,Y):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(I,K,Y,V);else for(var U=I.length-1;U>=0;U--)($=I[U])&&(j=(G<3?$(j):G>3?$(K,Y,j):$(K,Y))||j);return G>3&&j&&Object.defineProperty(K,Y,j),j},p=this&&this.__param||function(I,K){return function(Y,V){K(Y,V,I)}};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),b=l(8055),v=l(8460),x=l(844),E=l(2585),T="xterm-dom-renderer-owner-",A="xterm-rows",M="xterm-fg-",L="xterm-bg-",P="xterm-focus",z="xterm-selection";let H=1,q=a.DomRenderer=class extends x.Disposable{constructor(I,K,Y,V,$,G,j,U,D,N,W,Z,ee){super(),this._terminal=I,this._document=K,this._element=Y,this._screenElement=V,this._viewportElement=$,this._helperContainer=G,this._linkifier2=j,this._charSizeService=D,this._optionsService=N,this._bufferService=W,this._coreBrowserService=Z,this._themeService=ee,this._terminalClass=H++,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(z),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((te=>this._injectCss(te)))),this._injectCss(this._themeService.colors),this._rowFactory=U.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((te=>this._handleLinkHover(te)))),this.register(this._linkifier2.onHideLinkUnderline((te=>this._handleLinkLeave(te)))),this.register((0,x.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 I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),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/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),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 Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.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(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${A} { color: ${I.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: ${b.color.multiplyOpacity(I.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 Y=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;K+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${V} { 50% { box-shadow: none; }}`,K+=`@keyframes ${$} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,K+=`${this._terminalSelector} .${A}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${A}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${A}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${z} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${z} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${z} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[G,j]of I.ansi.entries())K+=`${this._terminalSelector} .${M}${G} { color: ${j.css}; }${this._terminalSelector} .${M}${G}.xterm-dim { color: ${b.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${L}${G} { background-color: ${j.css}; }`;K+=`${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(I.background).css}; }${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${L}${S.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,K){for(let Y=this._rowElements.length;Y<=K;Y++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,K){this._refreshRowElements(I,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(P),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(P),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,K,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,K,Y),this.renderRows(0,this._bufferService.rows-1),!I||!K)return;this._selectionRenderModel.update(this._terminal,I,K,Y);const V=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,G=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(G>=this._bufferService.rows||j<0)return;const U=this._document.createDocumentFragment();if(Y){const D=I[0]>K[0];U.appendChild(this._createSelectionElement(G,D?K[0]:I[0],D?I[0]:K[0],j-G+1))}else{const D=V===G?I[0]:0,N=G===$?K[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(G,D,N));const W=j-G-1;if(U.appendChild(this._createSelectionElement(G+1,0,this._bufferService.cols,W)),G!==j){const Z=$===j?K[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(j,0,Z))}}this._selectionContainer.appendChild(U)}_createSelectionElement(I,K,Y,V=1){const $=this._document.createElement("div"),G=K*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(Y-K);return G+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-G),$.style.height=V*this.dimensions.css.cell.height+"px",$.style.top=I*this.dimensions.css.cell.height+"px",$.style.left=`${G}px`,$.style.width=`${j}px`,$}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 I of this._rowElements)I.replaceChildren()}renderRows(I,K){const Y=this._bufferService.buffer,V=Y.ybase+Y.y,$=Math.min(Y.x,this._bufferService.cols-1),G=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=I;D<=K;D++){const N=D+Y.ydisp,W=this._rowElements[D],Z=Y.lines.get(N);if(!W||!Z)break;W.replaceChildren(...this._rowFactory.createRow(Z,N,N===V,j,U,$,G,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,K,Y,V,$,G){Y<0&&(I=0),V<0&&(K=0);const j=this._bufferService.rows-1;Y=Math.max(Math.min(Y,j),0),V=Math.max(Math.min(V,j),0),$=Math.min($,this._bufferService.cols);const U=this._bufferService.buffer,D=U.ybase+U.y,N=Math.min(U.x,$-1),W=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,ee=this._optionsService.rawOptions.cursorInactiveStyle;for(let te=Y;te<=V;++te){const X=te+U.ydisp,F=this._rowElements[te],se=U.lines.get(X);if(!F||!se)break;F.replaceChildren(...this._rowFactory.createRow(se,X,X===D,Z,ee,N,W,this.dimensions.css.cell.width,this._widthCache,G?te===Y?I:0:-1,G?(te===V?K:$)-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,P){var z,H=arguments.length,q=H<3?M:P===null?P=Object.getOwnPropertyDescriptor(M,L):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(A,M,L,P);else for(var I=A.length-1;I>=0;I--)(z=A[I])&&(q=(H<3?z(q):H>3?z(M,L,q):z(M,L))||q);return H>3&&q&&Object.defineProperty(M,L,q),q},p=this&&this.__param||function(A,M){return function(L,P){M(L,P,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),b=l(4269),v=l(6171),x=l(3734);let E=a.DomRendererRowFactory=class{constructor(A,M,L,P,z,H,q){this._document=A,this._characterJoinerService=M,this._optionsService=L,this._coreBrowserService=P,this._coreService=z,this._decorationService=H,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,P,z,H,q,I,K,Y,V){const $=[],G=this._characterJoinerService.getJoinedCharacters(M),j=this._themeService.colors;let U,D=A.getNoBgTrimmedLength();L&&D<H+1&&(D=H+1);let N=0,W="",Z=0,ee=0,te=0,X=!1,F=0,se=!1,ne=0;const re=[],oe=Y!==-1&&V!==-1;for(let le=0;le<D;le++){A.loadCell(le,this._workCell);let ve=this._workCell.getWidth();if(ve===0)continue;let ge=!1,ue=le,de=this._workCell;if(G.length>0&&le===G[0][0]){ge=!0;const Se=G.shift();de=new b.JoinedCellData(this._workCell,A.translateToString(!0,Se[0],Se[1]),Se[1]-Se[0]),ue=Se[1]-1,ve=de.getWidth()}const Ie=this._isCellInSelection(le,M),De=L&&le===H,Oe=oe&&le>=Y&&le<=V;let be=!1;this._decorationService.forEachDecorationAtCell(le,M,void 0,(Se=>{be=!0}));let Me=de.getChars()||g.WHITESPACE_CELL_CHAR;if(Me===" "&&(de.isUnderline()||de.isOverline())&&(Me=" "),ne=ve*I-K.get(Me,de.isBold(),de.isItalic()),U){if(N&&(Ie&&se||!Ie&&!se&&de.bg===Z)&&(Ie&&se&&j.selectionForeground||de.fg===ee)&&de.extended.ext===te&&Oe===X&&ne===F&&!De&&!ge&&!be){de.isInvisible()?W+=g.WHITESPACE_CELL_CHAR:W+=Me,N++;continue}N&&(U.textContent=W),U=this._document.createElement("span"),N=0,W=""}else U=this._document.createElement("span");if(Z=de.bg,ee=de.fg,te=de.extended.ext,X=Oe,F=ne,se=Ie,ge&&H>=le&&H<=ue&&(H=le),!this._coreService.isCursorHidden&&De&&this._coreService.isCursorInitialized){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&re.push("xterm-cursor-blink"),re.push(P==="bar"?"xterm-cursor-bar":P==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(z)switch(z){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"),W=de.isInvisible()?g.WHITESPACE_CELL_CHAR:de.getChars()||g.WHITESPACE_CELL_CHAR,de.isUnderline()&&(re.push(`xterm-underline-${de.extended.underlineStyle}`),W===" "&&(W=" "),!de.isUnderlineColorDefault()))if(de.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(de.getUnderlineColor()).join(",")})`;else{let Se=de.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&de.isBold()&&Se<8&&(Se+=8),U.style.textDecorationColor=j.ansi[Se].css}de.isOverline()&&(re.push("xterm-overline"),W===" "&&(W=" ")),de.isStrikethrough()&&re.push("xterm-strikethrough"),Oe&&(U.style.textDecoration="underline");let pe=de.getFgColor(),Re=de.getFgColorMode(),we=de.getBgColor(),We=de.getBgColorMode();const et=!!de.isInverse();if(et){const Se=pe;pe=we,we=Se;const He=Re;Re=We,We=He}let xe,Ge,tt,dt=!1;switch(this._decorationService.forEachDecorationAtCell(le,M,void 0,(Se=>{Se.options.layer!=="top"&&dt||(Se.backgroundColorRGB&&(We=50331648,we=Se.backgroundColorRGB.rgba>>8&16777215,xe=Se.backgroundColorRGB),Se.foregroundColorRGB&&(Re=50331648,pe=Se.foregroundColorRGB.rgba>>8&16777215,Ge=Se.foregroundColorRGB),dt=Se.options.layer==="top")})),!dt&&Ie&&(xe=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,we=xe.rgba>>8&16777215,We=50331648,dt=!0,j.selectionForeground&&(Re=50331648,pe=j.selectionForeground.rgba>>8&16777215,Ge=j.selectionForeground)),dt&&re.push("xterm-decoration-top"),We){case 16777216:case 33554432:tt=j.ansi[we],re.push(`xterm-bg-${we}`);break;case 50331648:tt=w.channels.toColor(we>>16,we>>8&255,255&we),this._addStyle(U,`background-color:#${T((we>>>0).toString(16),"0",6)}`);break;default:et?(tt=j.foreground,re.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):tt=j.background}switch(xe||de.isDim()&&(xe=w.color.multiplyOpacity(tt,.5)),Re){case 16777216:case 33554432:de.isBold()&&pe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(pe+=8),this._applyMinimumContrast(U,tt,j.ansi[pe],de,xe,void 0)||re.push(`xterm-fg-${pe}`);break;case 50331648:const Se=w.channels.toColor(pe>>16&255,pe>>8&255,255&pe);this._applyMinimumContrast(U,tt,Se,de,xe,Ge)||this._addStyle(U,`color:#${T(pe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,tt,j.foreground,de,xe,Ge)||et&&re.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}re.length&&(U.className=re.join(" "),re.length=0),De||ge||be?U.textContent=W:N++,ne!==this.defaultSpacing&&(U.style.letterSpacing=`${ne}px`),$.push(U),le=ue}return U&&N&&(U.textContent=W),$}_applyMinimumContrast(A,M,L,P,z,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,v.treatGlyphAsBackgroundColor)(P.getCode()))return!1;const q=this._getContrastCache(P);let I;if(z||H||(I=q.getColor(M.rgba,L.rgba)),I===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(P.isDim()?2:1);I=w.color.ensureContrastRatio(z||M,H||L,K),q.setColor((z||M).rgba,(H||L).rgba,I??null)}return!!I&&(this._addStyle(A,`color:${I.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,P=this._selectionEnd;return!(!L||!P)&&(this._columnSelectMode?L[0]<=P[0]?A>=L[0]&&M>=L[1]&&A<P[0]&&M<=P[1]:A<L[0]&&M>=L[1]&&A>=P[0]&&M<=P[1]:M>L[1]&&M<P[1]||L[1]===P[1]&&M===L[1]&&A>=L[0]&&A<P[0]||L[1]<P[1]&&M===P[1]&&A<P[0]||L[1]<P[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,b=Math.max(w,0),v=Math.min(y,p.rows-1);b>=p.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=w,this.viewportEndRow=y,this.viewportCappedStartRow=b,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,x,E,T){var A,M=arguments.length,L=M<3?x:T===null?T=Object.getOwnPropertyDescriptor(x,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,x,E,T);else for(var P=v.length-1;P>=0;P--)(A=v[P])&&(L=(M<3?A(L):M>3?A(x,E,L):A(x,E))||L);return M>3&&L&&Object.defineProperty(x,E,L),L},p=this&&this.__param||function(v,x){return function(E,T){x(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,x,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 b(this._optionsService))}catch{this._measureStrategy=this.register(new y(v,x,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(x,E){x!==void 0&&x>0&&E!==void 0&&E>0&&(this._result.width=x,this._result.height=E)}}class y extends w{constructor(x,E,T){super(),this._document=x,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 b extends w{constructor(x){super(),this._optionsService=x,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 x=this._ctx.measureText("W");return this._validateAndSet(x.width,x.fontBoundingBoxAscent+x.fontBoundingBoxDescent),this._result}}},4269:function(h,a,l){var d=this&&this.__decorate||function(b,v,x,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,v,x,E);else for(var L=b.length-1;L>=0;L--)(T=b[L])&&(M=(A<3?T(M):A>3?T(v,x,M):T(v,x))||M);return A>3&&M&&Object.defineProperty(v,x,M),M},p=this&&this.__param||function(b,v){return function(x,E){v(x,E,b)}};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,x,E){super(),this.content=0,this.combinedData="",this.fg=v.fg,this.bg=v.bg,this.combinedData=x,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 BR{constructor(v){this._bufferService=v,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(v){const x={id:this._nextCharacterJoinerId++,handler:v};return this._characterJoiners.push(x),x.id}deregister(v){for(let x=0;x<this._characterJoiners.length;x++)if(this._characterJoiners[x].id===v)return this._characterJoiners.splice(x,1),!0;return!1}getJoinedCharacters(v){if(this._characterJoiners.length===0)return[];const x=this._bufferService.buffer.lines.get(v);if(!x||x.length===0)return[];const E=[],T=x.translateToString(!0);let A=0,M=0,L=0,P=x.getFg(0),z=x.getBg(0);for(let H=0;H<x.getTrimmedLength();H++)if(x.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==P||this._workCell.bg!==z){if(H-A>1){const q=this._getJoinedRanges(T,L,M,x,A);for(let I=0;I<q.length;I++)E.push(q[I])}A=H,L=M,P=this._workCell.fg,z=this._workCell.bg}M+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-A>1){const H=this._getJoinedRanges(T,L,M,x,A);for(let q=0;q<H.length;q++)E.push(H[q])}return E}_getJoinedRanges(v,x,E,T,A){const M=v.substring(x,E);let L=[];try{L=this._characterJoiners[0].handler(M)}catch(P){console.error(P)}for(let P=1;P<this._characterJoiners.length;P++)try{const z=this._characterJoiners[P].handler(M);for(let H=0;H<z.length;H++)BR._mergeRanges(L,z[H])}catch(z){console.error(z)}return this._stringRangesToCellRanges(L,T,A),L}_stringRangesToCellRanges(v,x,E){let T=0,A=!1,M=0,L=v[T];if(L){for(let P=E;P<this._bufferService.cols;P++){const z=x.getWidth(P),H=x.getString(P).length||g.WHITESPACE_CELL_CHAR.length;if(z!==0){if(!A&&L[0]<=M&&(L[0]=P,A=!0),L[1]<=M){if(L[1]=P,L=v[++T],!L)break;L[0]<=M?(L[0]=P,A=!0):A=!1}M+=H}}L&&(L[1]=this._bufferService.cols)}}static _mergeRanges(v,x){let E=!1;for(let T=0;T<v.length;T++){const A=v[T];if(E){if(x[1]<=A[0])return v[T-1][1]=x[1],v;if(x[1]<=A[1])return v[T-1][1]=Math.max(x[1],A[1]),v.splice(T,1),v;v.splice(T,1),T--}else{if(x[1]<=A[0])return v.splice(T,0,x),v;if(x[1]<=A[1])return A[0]=Math.min(x[0],A[0]),v;x[0]<A[1]&&(A[0]=Math.min(x[0],A[0]),E=!0)}}return E?v[v.length-1][1]=x[1]:v.push(x),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,b){super(),this._textarea=w,this._window=y,this.mainDocument=b,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,b){var v,x=arguments.length,E=x<3?w:b===null?b=Object.getOwnPropertyDescriptor(w,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,w,y,b);else for(var T=C.length-1;T>=0;T--)(v=C[T])&&(E=(x<3?v(E):x>3?v(w,y,E):v(w,y))||E);return x>3&&E&&Object.defineProperty(w,y,E),E},p=this&&this.__param||function(C,w){return function(y,b){w(y,b,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,b,v){return(0,g.getCoords)(window,C,w,y,b,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,x,E,T){var A,M=arguments.length,L=M<3?x:T===null?T=Object.getOwnPropertyDescriptor(x,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,x,E,T);else for(var P=v.length-1;P>=0;P--)(A=v[P])&&(L=(M<3?A(L):M>3?A(x,E,L):A(x,E))||L);return M>3&&L&&Object.defineProperty(x,E,L),L},p=this&&this.__param||function(v,x){return function(E,T){x(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 b=a.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,x,E,T,A,M,L,P){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(((z,H)=>this._renderRows(z,H)),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(P.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(L.window,x),this.register(L.onWindowChange((z=>this._registerIntersectionObserver(z,x))))}_registerIntersectionObserver(v,x){if("IntersectionObserver"in v){const E=new v.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});E.observe(x),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,x,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,x,this._rowCount))}_renderRows(v,x){this._renderer.value&&(v=Math.min(v,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(v,x),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:v,end:x}),this._onRender.fire({start:v,end:x}),this._isNextRenderRedrawOnly=!0)}resize(v,x){this._rowCount=x,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(v){this._renderer.value=v,this._renderer.value&&(this._renderer.value.onRequestRedraw((x=>this.refreshRows(x.start,x.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,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(v,x))):this._renderer.value.handleResize(v,x),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(v,x,E){this._selectionState.start=v,this._selectionState.end=x,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(v,x,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};a.RenderService=b=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)],b)},9312:function(h,a,l){var d=this&&this.__decorate||function(L,P,z,H){var q,I=arguments.length,K=I<3?P:H===null?H=Object.getOwnPropertyDescriptor(P,z):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(L,P,z,H);else for(var Y=L.length-1;Y>=0;Y--)(q=L[Y])&&(K=(I<3?q(K):I>3?q(P,z,K):q(P,z))||K);return I>3&&K&&Object.defineProperty(P,z,K),K},p=this&&this.__param||function(L,P){return function(z,H){P(z,H,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),b=l(6114),v=l(4841),x=l(511),E=l(2585),T=" ",A=new RegExp(T,"g");let M=a.SelectionService=class extends y.Disposable{constructor(L,P,z,H,q,I,K,Y,V){super(),this._element=L,this._screenElement=P,this._linkifier=z,this._bufferService=H,this._coreService=q,this._mouseService=I,this._optionsService=K,this._renderService=Y,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new x.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new 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=$=>this._handleMouseMove($),this._mouseUpListener=$=>this._handleMouseUp($),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim(($=>this._handleTrim($))),this.register(this._bufferService.buffers.onBufferActivate(($=>this._handleBufferActivate($)))),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,P=this._model.finalSelectionEnd;return!(!L||!P||L[0]===P[0]&&L[1]===P[1])}get selectionText(){const L=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;if(!L||!P)return"";const z=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(L[0]===P[0])return"";const q=L[0]<P[0]?L[0]:P[0],I=L[0]<P[0]?P[0]:L[0];for(let K=L[1];K<=P[1];K++){const Y=z.translateBufferLineToString(K,!0,q,I);H.push(Y)}}else{const q=L[1]===P[1]?P[0]:void 0;H.push(z.translateBufferLineToString(L[1],!0,L[0],q));for(let I=L[1]+1;I<=P[1]-1;I++){const K=z.lines.get(I),Y=z.translateBufferLineToString(I,!0);K?.isWrapped?H[H.length-1]+=Y:H.push(Y)}if(L[1]!==P[1]){const I=z.lines.get(P[1]),K=z.translateBufferLineToString(P[1],!0,0,P[0]);I&&I.isWrapped?H[H.length-1]+=K:H.push(K)}}return H.map((q=>q.replace(A," "))).join(b.isWindows?`\r
31
- `:`
32
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(L){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.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 P=this._getMouseBufferCoords(L),z=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(z&&H&&P)&&this._areCoordsInSelection(P,z,H)}isCellInSelection(L,P){const z=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!z||!H)&&this._areCoordsInSelection([L,P],z,H)}_areCoordsInSelection(L,P,z){return L[1]>P[1]&&L[1]<z[1]||P[1]===z[1]&&L[1]===P[1]&&L[0]>=P[0]&&L[0]<z[0]||P[1]<z[1]&&L[1]===z[1]&&L[0]<z[0]||P[1]<z[1]&&L[1]===P[1]&&L[0]>=P[0]}_selectWordAtCursor(L,P){const z=this._linkifier.currentLink?.link?.range;if(z)return this._model.selectionStart=[z.start.x-1,z.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(z,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(L);return!!H&&(this._selectWordAt(H,P),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(L,P){this._model.clearSelection(),L=Math.max(L,0),P=Math.min(P,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,L],this._model.selectionEnd=[this._bufferService.cols,P],this.refresh(),this._onSelectionChange.fire()}_handleTrim(L){this._model.handleTrim(L)&&this.refresh()}_getMouseBufferCoords(L){const P=this._mouseService.getCoords(L,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(P)return P[0]--,P[1]--,P[1]+=this._bufferService.buffer.ydisp,P}_getMouseEventScrollAmount(L){let P=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,L,this._screenElement)[1];const z=this._renderService.dimensions.css.canvas.height;return P>=0&&P<=z?0:(P>z&&(P-=z),P=Math.min(Math.max(P,-50),50),P/=50,P/Math.abs(P)+Math.round(14*P))}shouldForceSelection(L){return b.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 P=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);P&&P.length!==this._model.selectionStart[0]&&P.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(L){this._selectWordAtCursor(L,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(L){const P=this._getMouseBufferCoords(L);P&&(this._activeSelectionMode=2,this._selectLineAt(P[1]))}shouldColumnSelect(L){return L.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(L){if(L.stopImmediatePropagation(),!this._model.selectionStart)return;const P=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 z=this._bufferService.buffer;if(this._model.selectionEnd[1]<z.lines.length){const H=z.lines.get(this._model.selectionEnd[1]);H&&H.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}P&&P[0]===this._model.selectionEnd[0]&&P[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 P=L.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&P<500&&L.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const z=this._mouseService.getCoords(L,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(z&&z[0]!==void 0&&z[1]!==void 0){const H=(0,g.moveToCellSequence)(z[0]-1,z[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const L=this._model.finalSelectionStart,P=this._model.finalSelectionEnd,z=!(!L||!P||L[0]===P[0]&&L[1]===P[1]);z?L&&P&&(this._oldSelectionStart&&this._oldSelectionEnd&&L[0]===this._oldSelectionStart[0]&&L[1]===this._oldSelectionStart[1]&&P[0]===this._oldSelectionEnd[0]&&P[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(L,P,z)):this._oldHasSelection&&this._fireOnSelectionChange(L,P,z)}_fireOnSelectionChange(L,P,z){this._oldSelectionStart=L,this._oldSelectionEnd=P,this._oldHasSelection=z,this._onSelectionChange.fire()}_handleBufferActivate(L){this.clearSelection(),this._trimListener.dispose(),this._trimListener=L.activeBuffer.lines.onTrim((P=>this._handleTrim(P)))}_convertViewportColToCharacterIndex(L,P){let z=P;for(let H=0;P>=H;H++){const q=L.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?z--:q>1&&P!==H&&(z+=q-1)}return z}setSelection(L,P,z){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[L,P],this._model.selectionStartLength=z,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(L){this._isClickInSelection(L)||(this._selectWordAtCursor(L,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(L,P,z=!0,H=!0){if(L[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,I=q.lines.get(L[1]);if(!I)return;const K=q.translateBufferLineToString(L[1],!1);let Y=this._convertViewportColToCharacterIndex(I,L[0]),V=Y;const $=L[0]-Y;let G=0,j=0,U=0,D=0;if(K.charAt(Y)===" "){for(;Y>0&&K.charAt(Y-1)===" ";)Y--;for(;V<K.length&&K.charAt(V+1)===" ";)V++}else{let Z=L[0],ee=L[0];I.getWidth(Z)===0&&(G++,Z--),I.getWidth(ee)===2&&(j++,ee++);const te=I.getString(ee).length;for(te>1&&(D+=te-1,V+=te-1);Z>0&&Y>0&&!this._isCharWordSeparator(I.loadCell(Z-1,this._workCell));){I.loadCell(Z-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(G++,Z--):X>1&&(U+=X-1,Y-=X-1),Y--,Z--}for(;ee<I.length&&V+1<K.length&&!this._isCharWordSeparator(I.loadCell(ee+1,this._workCell));){I.loadCell(ee+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,ee++):X>1&&(D+=X-1,V+=X-1),V++,ee++}}V++;let N=Y+$-G+U,W=Math.min(this._bufferService.cols,V-Y+G+j-U-D);if(P||K.slice(Y,V).trim()!==""){if(z&&N===0&&I.getCodePoint(0)!==32){const Z=q.lines.get(L[1]-1);if(Z&&I.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ee=this._getWordAt([this._bufferService.cols-1,L[1]-1],!1,!0,!1);if(ee){const te=this._bufferService.cols-ee.start;N-=te,W+=te}}}if(H&&N+W===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const Z=q.lines.get(L[1]+1);if(Z?.isWrapped&&Z.getCodePoint(0)!==32){const ee=this._getWordAt([0,L[1]+1],!1,!1,!0);ee&&(W+=ee.length)}}return{start:N,length:W}}}_selectWordAt(L,P){const z=this._getWordAt(L,P);if(z){for(;z.start<0;)z.start+=this._bufferService.cols,L[1]--;this._model.selectionStart=[z.start,L[1]],this._model.selectionStartLength=z.length}}_selectToWordAt(L){const P=this._getWordAt(L,!0);if(P){let z=L[1];for(;P.start<0;)P.start+=this._bufferService.cols,z--;if(!this._model.areSelectionValuesReversed())for(;P.start+P.length>this._bufferService.cols;)P.length-=this._bufferService.cols,z++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?P.start:P.start+P.length,z]}}_isCharWordSeparator(L){return L.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(L.getChars())>=0}_selectLineAt(L){const P=this._bufferService.buffer.getWrappedRangeForLine(L),z={start:{x:0,y:P.first},end:{x:this._bufferService.cols-1,y:P.last}};this._model.selectionStart=[0,P.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,v.getRangeLength)(z,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,P,z){var H,q=arguments.length,I=q<3?L:z===null?z=Object.getOwnPropertyDescriptor(L,P):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(M,L,P,z);else for(var K=M.length-1;K>=0;K--)(H=M[K])&&(I=(q<3?H(I):q>3?H(L,P,I):H(L,P))||I);return q>3&&I&&Object.defineProperty(L,P,I),I},p=this&&this.__param||function(M,L){return function(P,z){L(P,z,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"),b=g.css.toColor("#000000"),v=g.css.toColor("#ffffff"),x=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 P=0;P<216;P++){const z=L[P/36%6|0],H=L[P/6%6|0],q=L[P%6];M.push({css:g.channels.toCss(z,H,q),rgba:g.channels.toRgba(z,H,q)})}for(let P=0;P<24;P++){const z=8+10*P;M.push({css:g.channels.toCss(z,z,z),rgba:g.channels.toRgba(z,z,z)})}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:b,cursor:v,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:g.color.blend(b,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:g.color.blend(b,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,b),L.cursor=A(M.cursor,v),L.cursorAccent=A(M.cursorAccent,x),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 P=Math.min(L.ansi.length-16,M.extendedAnsi.length);for(let z=0;z<P;z++)L.ansi[z+16]=A(M.extendedAnsi[z],a.DEFAULT_ANSI_COLORS[z+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 b=C-1;b>=0;b--)this.set(S+b+w,this.get(S+b));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 b(x){const E=x.toString(16);return E.length<2?"0"+E:E}function v(x,E){return x<E?(E+.05)/(x+.05):(x+.05)/(E+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(x){x.toCss=function(E,T,A,M){return M!==void 0?`#${b(E)}${b(T)}${b(A)}${b(M)}`:`#${b(E)}${b(T)}${b(A)}`},x.toRgba=function(E,T,A,M=255){return(E<<24|T<<16|A<<8|M)>>>0},x.toColor=function(E,T,A,M){return{css:x.toCss(E,T,A,M),rgba:x.toRgba(E,T,A,M)}}})(g||(a.channels=g={})),(function(x){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)}}x.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,P=A.rgba>>8&255,z=T.rgba>>24&255,H=T.rgba>>16&255,q=T.rgba>>8&255;return l=z+Math.round((M-z)*f),d=H+Math.round((L-H)*f),p=q+Math.round((P-q)*f),{css:g.toCss(l,d,p),rgba:g.toRgba(l,d,p)}},x.isOpaque=function(T){return(255&T.rgba)==255},x.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)},x.opaque=function(T){const A=(255|T.rgba)>>>0;return[l,d,p]=y.toChannels(A),{css:g.toCss(l,d,p),rgba:A}},x.opacity=E,x.multiplyOpacity=function(T,A){return f=255&T.rgba,E(T,f*A/255)},x.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(S||(a.color=S={})),(function(x){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{}x.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(x){function E(T,A,M){const L=T/255,P=A/255,z=M/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.0722*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))}x.relativeLuminance=function(T){return E(T>>16&255,T>>8&255,255&T)},x.relativeLuminance2=E})(w||(a.rgb=w={})),(function(x){function E(A,M,L){const P=A>>24&255,z=A>>16&255,H=A>>8&255;let q=M>>24&255,I=M>>16&255,K=M>>8&255,Y=v(w.relativeLuminance2(q,I,K),w.relativeLuminance2(P,z,H));for(;Y<L&&(q>0||I>0||K>0);)q-=Math.max(0,Math.ceil(.1*q)),I-=Math.max(0,Math.ceil(.1*I)),K-=Math.max(0,Math.ceil(.1*K)),Y=v(w.relativeLuminance2(q,I,K),w.relativeLuminance2(P,z,H));return(q<<24|I<<16|K<<8|255)>>>0}function T(A,M,L){const P=A>>24&255,z=A>>16&255,H=A>>8&255;let q=M>>24&255,I=M>>16&255,K=M>>8&255,Y=v(w.relativeLuminance2(q,I,K),w.relativeLuminance2(P,z,H));for(;Y<L&&(q<255||I<255||K<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),I=Math.min(255,I+Math.ceil(.1*(255-I))),K=Math.min(255,K+Math.ceil(.1*(255-K))),Y=v(w.relativeLuminance2(q,I,K),w.relativeLuminance2(P,z,H));return(q<<24|I<<16|K<<8|255)>>>0}x.blend=function(A,M){if(f=(255&M)/255,f===1)return M;const L=M>>24&255,P=M>>16&255,z=M>>8&255,H=A>>24&255,q=A>>16&255,I=A>>8&255;return l=H+Math.round((L-H)*f),d=q+Math.round((P-q)*f),p=I+Math.round((z-I)*f),g.toRgba(l,d,p)},x.ensureContrastRatio=function(A,M,L){const P=w.relativeLuminance(A>>8),z=w.relativeLuminance(M>>8);if(v(P,z)<L){if(z<P){const I=E(A,M,L),K=v(P,w.relativeLuminance(I>>8));if(K<L){const Y=T(A,M,L);return K>v(P,w.relativeLuminance(Y>>8))?I:Y}return I}const H=T(A,M,L),q=v(P,w.relativeLuminance(H>>8));if(q<L){const I=E(A,M,L);return q>v(P,w.relativeLuminance(I>>8))?H:I}return H}},x.reduceLuminance=E,x.increaseLuminance=T,x.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]}})(y||(a.rgba=y={})),a.toPaddedHex=b,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),b=l(1753),v=l(1480),x=l(7994),E=l(9282),T=l(5435),A=l(5981),M=l(2660);let L=!1;class P extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((H=>{this._onScrollApi?.fire(H.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(H){for(const q in H)this.optionsService.options[q]=H[q]}constructor(H){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(H)),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(b.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(x.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,I)=>this._inputHandler.parse(q,I)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,q){this._writeBuffer.write(H,q)}writeSync(H,q){this._logService.logLevel<=p.LogLevelEnum.WARN&&!L&&(this._logService.warn("writeSync is unreliable and will be removed soon."),L=!0),this._writeBuffer.writeSync(H,q)}input(H,q=!0){this.coreService.triggerDataEvent(H,q)}resize(H,q){isNaN(H)||isNaN(q)||(H=Math.max(H,S.MINIMUM_COLS),q=Math.max(q,S.MINIMUM_ROWS),this._bufferService.resize(H,q))}scroll(H,q=!1){this._bufferService.scroll(H,q)}scrollLines(H,q,I){this._bufferService.scrollLines(H,q,I)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const q=H-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler(H,q){return this._inputHandler.registerEscHandler(H,q)}registerDcsHandler(H,q){return this._inputHandler.registerDcsHandler(H,q)}registerCsiHandler(H,q){return this._inputHandler.registerCsiHandler(H,q)}registerOscHandler(H,q){return this._inputHandler.registerOscHandler(H,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?H=q.backend==="conpty"&&q.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const q of H)q.dispose()}))}}}a.CoreTerminal=P},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(G,j,U,D){var N,W=arguments.length,Z=W<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,U):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(G,j,U,D);else for(var ee=G.length-1;ee>=0;ee--)(N=G[ee])&&(Z=(W<3?N(Z):W>3?N(j,U,Z):N(j,U))||Z);return W>3&&Z&&Object.defineProperty(j,U,Z),Z},p=this&&this.__param||function(G,j){return function(U,D){j(U,D,G)}};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),b=l(8460),v=l(643),x=l(511),E=l(3734),T=l(2585),A=l(1480),M=l(6242),L=l(6351),P=l(5941),z={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function q(G,j){if(G>24)return j.setWinLines||!1;switch(G){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var I;(function(G){G[G.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",G[G.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(a.WindowsOptionsReportType=I={}));let K=0;class Y extends C.Disposable{getAttrData(){return this._curAttrData}constructor(j,U,D,N,W,Z,ee,te,X=new S.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=U,this._coreService=D,this._logService=N,this._optionsService=W,this._oscLinkService=Z,this._coreMouseService=ee,this._unicodeService=te,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new x.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 b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((F=>this._activeBuffer=F.activeBuffer))),this._parser.setCsiHandlerFallback(((F,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(F),params:se.toArray()})})),this._parser.setEscHandlerFallback((F=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(F)})})),this._parser.setExecuteHandlerFallback((F=>{this._logService.debug("Unknown EXECUTE code: ",{code:F})})),this._parser.setOscHandlerFallback(((F,se,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:F,action:se,data:ne})})),this._parser.setDcsHandlerFallback(((F,se,ne)=>{se==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(F),action:se,payload:ne})})),this._parser.setPrintHandler(((F,se,ne)=>this.print(F,se,ne))),this._parser.registerCsiHandler({final:"@"},(F=>this.insertChars(F))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(F=>this.scrollLeft(F))),this._parser.registerCsiHandler({final:"A"},(F=>this.cursorUp(F))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(F=>this.scrollRight(F))),this._parser.registerCsiHandler({final:"B"},(F=>this.cursorDown(F))),this._parser.registerCsiHandler({final:"C"},(F=>this.cursorForward(F))),this._parser.registerCsiHandler({final:"D"},(F=>this.cursorBackward(F))),this._parser.registerCsiHandler({final:"E"},(F=>this.cursorNextLine(F))),this._parser.registerCsiHandler({final:"F"},(F=>this.cursorPrecedingLine(F))),this._parser.registerCsiHandler({final:"G"},(F=>this.cursorCharAbsolute(F))),this._parser.registerCsiHandler({final:"H"},(F=>this.cursorPosition(F))),this._parser.registerCsiHandler({final:"I"},(F=>this.cursorForwardTab(F))),this._parser.registerCsiHandler({final:"J"},(F=>this.eraseInDisplay(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(F=>this.eraseInDisplay(F,!0))),this._parser.registerCsiHandler({final:"K"},(F=>this.eraseInLine(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(F=>this.eraseInLine(F,!0))),this._parser.registerCsiHandler({final:"L"},(F=>this.insertLines(F))),this._parser.registerCsiHandler({final:"M"},(F=>this.deleteLines(F))),this._parser.registerCsiHandler({final:"P"},(F=>this.deleteChars(F))),this._parser.registerCsiHandler({final:"S"},(F=>this.scrollUp(F))),this._parser.registerCsiHandler({final:"T"},(F=>this.scrollDown(F))),this._parser.registerCsiHandler({final:"X"},(F=>this.eraseChars(F))),this._parser.registerCsiHandler({final:"Z"},(F=>this.cursorBackwardTab(F))),this._parser.registerCsiHandler({final:"`"},(F=>this.charPosAbsolute(F))),this._parser.registerCsiHandler({final:"a"},(F=>this.hPositionRelative(F))),this._parser.registerCsiHandler({final:"b"},(F=>this.repeatPrecedingCharacter(F))),this._parser.registerCsiHandler({final:"c"},(F=>this.sendDeviceAttributesPrimary(F))),this._parser.registerCsiHandler({prefix:">",final:"c"},(F=>this.sendDeviceAttributesSecondary(F))),this._parser.registerCsiHandler({final:"d"},(F=>this.linePosAbsolute(F))),this._parser.registerCsiHandler({final:"e"},(F=>this.vPositionRelative(F))),this._parser.registerCsiHandler({final:"f"},(F=>this.hVPosition(F))),this._parser.registerCsiHandler({final:"g"},(F=>this.tabClear(F))),this._parser.registerCsiHandler({final:"h"},(F=>this.setMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(F=>this.setModePrivate(F))),this._parser.registerCsiHandler({final:"l"},(F=>this.resetMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(F=>this.resetModePrivate(F))),this._parser.registerCsiHandler({final:"m"},(F=>this.charAttributes(F))),this._parser.registerCsiHandler({final:"n"},(F=>this.deviceStatus(F))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(F=>this.deviceStatusPrivate(F))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(F=>this.softReset(F))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(F=>this.setCursorStyle(F))),this._parser.registerCsiHandler({final:"r"},(F=>this.setScrollRegion(F))),this._parser.registerCsiHandler({final:"s"},(F=>this.saveCursor(F))),this._parser.registerCsiHandler({final:"t"},(F=>this.windowOptions(F))),this._parser.registerCsiHandler({final:"u"},(F=>this.restoreCursor(F))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(F=>this.insertColumns(F))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(F=>this.deleteColumns(F))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(F=>this.selectProtected(F))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(F=>this.requestMode(F,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(F=>this.requestMode(F,!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((F=>(this.setTitle(F),this.setIconName(F),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((F=>this.setIconName(F)))),this._parser.registerOscHandler(2,new M.OscHandler((F=>this.setTitle(F)))),this._parser.registerOscHandler(4,new M.OscHandler((F=>this.setOrReportIndexedColor(F)))),this._parser.registerOscHandler(8,new M.OscHandler((F=>this.setHyperlink(F)))),this._parser.registerOscHandler(10,new M.OscHandler((F=>this.setOrReportFgColor(F)))),this._parser.registerOscHandler(11,new M.OscHandler((F=>this.setOrReportBgColor(F)))),this._parser.registerOscHandler(12,new M.OscHandler((F=>this.setOrReportCursorColor(F)))),this._parser.registerOscHandler(104,new M.OscHandler((F=>this.restoreIndexedColor(F)))),this._parser.registerOscHandler(110,new M.OscHandler((F=>this.restoreFgColor(F)))),this._parser.registerOscHandler(111,new M.OscHandler((F=>this.restoreBgColor(F)))),this._parser.registerOscHandler(112,new M.OscHandler((F=>this.restoreCursorColor(F)))),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 F in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:F},(()=>this.selectCharset("("+F))),this._parser.registerEscHandler({intermediates:")",final:F},(()=>this.selectCharset(")"+F))),this._parser.registerEscHandler({intermediates:"*",final:F},(()=>this.selectCharset("*"+F))),this._parser.registerEscHandler({intermediates:"+",final:F},(()=>this.selectCharset("+"+F))),this._parser.registerEscHandler({intermediates:"-",final:F},(()=>this.selectCharset("-"+F))),this._parser.registerEscHandler({intermediates:".",final:F},(()=>this.selectCharset("."+F))),this._parser.registerEscHandler({intermediates:"/",final:F},(()=>this.selectCharset("/"+F)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((F=>(this._logService.error("Parsing error: ",F),F))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new L.DcsHandler(((F,se)=>this.requestStatusString(F,se))))}_preserveStack(j,U,D,N){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=D,this._parseStack.position=N}_logSlowResolvingAsync(j){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([j,new Promise(((U,D)=>setTimeout((()=>D("#SLOW_TIMEOUT")),5e3)))]).catch((U=>{if(U!=="#SLOW_TIMEOUT")throw U;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,U){let D,N=this._activeBuffer.x,W=this._activeBuffer.y,Z=0;const ee=this._parseStack.paused;if(ee){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(D),D;N=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>H&&(Z=this._parseStack.position+H)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(F=>String.fromCharCode(F))).join("")}"`),typeof j=="string"?j.split("").map((F=>F.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(j.length,H))),ee||this._dirtyRowTracker.clearRange(),j.length>H)for(let F=Z;F<j.length;F+=H){const se=F+H<j.length?F+H:j.length,ne=typeof j=="string"?this._stringDecoder.decode(j.substring(F,se),this._parseBuffer):this._utf8Decoder.decode(j.subarray(F,se),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(N,W,ne,F),this._logSlowResolvingAsync(D),D}else if(!ee){const F=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,F))return this._preserveStack(N,W,F,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===N&&this._activeBuffer.y===W||this._onCursorMove.fire();const te=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(te,this._bufferService.rows-1))}print(j,U,D){let N,W;const Z=this._charsetService.charset,ee=this._optionsService.rawOptions.screenReaderMode,te=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,F=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&&D-U>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=U;oe<D;++oe){if(N=j[oe],N<127&&Z){const ue=Z[String.fromCharCode(N)];ue&&(N=ue.charCodeAt(0))}const le=this._unicodeService.charProperties(N,re);W=A.UnicodeService.extractWidth(le);const ve=A.UnicodeService.extractShouldJoin(le),ge=ve?A.UnicodeService.extractWidth(re):0;if(re=le,ee&&this._onA11yChar.fire((0,w.stringFromCodePoint)(N)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-ge>te){if(X){const ue=ne;let de=this._activeBuffer.x-ge;for(this._activeBuffer.x=ge,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),ge>0&&ne instanceof y.BufferLine&&ne.copyCellsFrom(ue,de,0,ge,!1);de<te;)ue.setCellFromCodepoint(de++,0,1,se)}else if(this._activeBuffer.x=te-1,W===2)continue}if(ve&&this._activeBuffer.x){const ue=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-ue,N,W);for(let de=W-ge;--de>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(F&&(ne.insertCells(this._activeBuffer.x,W-ge,this._activeBuffer.getNullCell(se)),ne.getWidth(te-1)===2&&ne.setCellFromCodepoint(te-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,se)),ne.setCellFromCodepoint(this._activeBuffer.x++,N,W,se),W>0)for(;--W;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=re,this._activeBuffer.x<te&&D-U>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(j,U){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,U):this._parser.registerCsiHandler(j,(D=>!q(D.params[0],this._optionsService.rawOptions.windowOptions)||U(D)))}registerDcsHandler(j,U){return this._parser.registerDcsHandler(j,new L.DcsHandler(U))}registerEscHandler(j,U){return this._parser.registerEscHandler(j,U)}registerOscHandler(j,U){return this._parser.registerOscHandler(j,new M.OscHandler(U))}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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=j,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+U)}cursorUp(j){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const U=j.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=j.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=j.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const U=j.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,U,D,N=!1,W=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);Z.replaceCells(U,D,this._activeBuffer.getNullCell(this._eraseAttrData()),W),N&&(Z.isWrapped=!1)}_resetBufferLine(j,U=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),D.isWrapped=!1)}eraseInDisplay(j,U=!1){let D;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);D<this._bufferService.rows;D++)this._resetBufferLine(D,U);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,U);this._dirtyRowTracker.markDirty(0);break;case 3:const N=this._activeBuffer.lines.length-this._bufferService.rows;N>0&&(this._activeBuffer.lines.trimStart(N),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-N,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-N,0),this._onScroll.fire(0))}return!0}eraseInLine(j,U=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,U);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,U)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let U=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,N=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-N+1;for(;U--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let U=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let N;for(N=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-N;U--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let U=j.params[0]||1;for(;U--;)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(j){let U=j.params[0]||1;for(;U--;)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(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);N.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),N.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);N.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),N.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);N.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),N.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);N.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),N.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const U=this._parser.precedingJoinState;if(!U)return!0;const D=j.params[0]||1,N=A.UnicodeService.extractWidth(U),W=this._activeBuffer.x-N,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),ee=new Uint32Array(Z.length*D);let te=0;for(let F=0;F<Z.length;){const se=Z.codePointAt(F)||0;ee[te++]=se,F+=se>65535?2:1}let X=te;for(let F=1;F<D;++F)ee.copyWithin(X,0,te),X+=te;return this.print(ee,0,X),!0}sendDeviceAttributesPrimary(j){return j.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(j){return j.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(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let U=0;U<j.length;U++)switch(j.params[U]){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(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let U=0;U<j.length;U++)switch(j.params[U]){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(),j.params[U]===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(j,U){const D=this._coreService.decPrivateModes,{activeProtocol:N,activeEncoding:W}=this._coreMouseService,Z=this._coreService,{buffers:ee,cols:te}=this._bufferService,{active:X,alt:F}=ee,se=this._optionsService.rawOptions,ne=ve=>ve?1:2,re=j.params[0];return oe=re,le=U?re===2?4:re===4?ne(Z.modes.insertMode):re===12?3:re===20?ne(se.convertEol):0:re===1?ne(D.applicationCursorKeys):re===3?se.windowOptions.setWinLines?te===80?2:te===132?1:0:0:re===6?ne(D.origin):re===7?ne(D.wraparound):re===8?3:re===9?ne(N==="X10"):re===12?ne(se.cursorBlink):re===25?ne(!Z.isCursorHidden):re===45?ne(D.reverseWraparound):re===66?ne(D.applicationKeypad):re===67?4:re===1e3?ne(N==="VT200"):re===1002?ne(N==="DRAG"):re===1003?ne(N==="ANY"):re===1004?ne(D.sendFocus):re===1005?4:re===1006?ne(W==="SGR"):re===1015?4:re===1016?ne(W==="SGR_PIXELS"):re===1048?1:re===47||re===1047||re===1049?ne(X===F):re===2004?ne(D.bracketedPasteMode):0,Z.triggerDataEvent(`${f.C0.ESC}[${U?"":"?"}${oe};${le}$y`),!0;var oe,le}_updateAttrColor(j,U,D,N,W){return U===2?(j|=50331648,j&=-16777216,j|=E.AttributeData.fromColorRGB([D,N,W])):U===5&&(j&=-50331904,j|=33554432|255&D),j}_extractColor(j,U,D){const N=[0,0,-1,0,0,0];let W=0,Z=0;do{if(N[Z+W]=j.params[U+Z],j.hasSubParams(U+Z)){const ee=j.getSubParams(U+Z);let te=0;do N[1]===5&&(W=1),N[Z+te+1+W]=ee[te];while(++te<ee.length&&te+Z+1+W<N.length);break}if(N[1]===5&&Z+W>=2||N[1]===2&&Z+W>=5)break;N[1]&&(W=1)}while(++Z+U<j.length&&Z+W<N.length);for(let ee=2;ee<N.length;++ee)N[ee]===-1&&(N[ee]=0);switch(N[0]){case 38:D.fg=this._updateAttrColor(D.fg,N[1],N[3],N[4],N[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,N[1],N[3],N[4],N[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,N[1],N[3],N[4],N[5])}return Z}_processUnderline(j,U){U.extended=U.extended.clone(),(!~j||j>5)&&(j=1),U.extended.underlineStyle=j,U.fg|=268435456,j===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(j){j.fg=y.DEFAULT_ATTR_DATA.fg,j.bg=y.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=j.length;let D;const N=this._curAttrData;for(let W=0;W<U;W++)D=j.params[W],D>=30&&D<=37?(N.fg&=-50331904,N.fg|=16777216|D-30):D>=40&&D<=47?(N.bg&=-50331904,N.bg|=16777216|D-40):D>=90&&D<=97?(N.fg&=-50331904,N.fg|=16777224|D-90):D>=100&&D<=107?(N.bg&=-50331904,N.bg|=16777224|D-100):D===0?this._processSGR0(N):D===1?N.fg|=134217728:D===3?N.bg|=67108864:D===4?(N.fg|=268435456,this._processUnderline(j.hasSubParams(W)?j.getSubParams(W)[0]:1,N)):D===5?N.fg|=536870912:D===7?N.fg|=67108864:D===8?N.fg|=1073741824:D===9?N.fg|=2147483648:D===2?N.bg|=134217728:D===21?this._processUnderline(2,N):D===22?(N.fg&=-134217729,N.bg&=-134217729):D===23?N.bg&=-67108865:D===24?(N.fg&=-268435457,this._processUnderline(0,N)):D===25?N.fg&=-536870913:D===27?N.fg&=-67108865:D===28?N.fg&=-1073741825:D===29?N.fg&=2147483647:D===39?(N.fg&=-67108864,N.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):D===49?(N.bg&=-67108864,N.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?W+=this._extractColor(j,W,N):D===53?N.bg|=1073741824:D===55?N.bg&=-1073741825:D===59?(N.extended=N.extended.clone(),N.extended.underlineColor=-1,N.updateExtended()):D===100?(N.fg&=-67108864,N.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,N.bg&=-67108864,N.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${U};${D}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const U=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${U};${D}R`)}return!0}softReset(j){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(j){const U=j.params[0]||1;switch(U){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 D=U%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(j){const U=j.params[0]||1;let D;return(j.length<2||(D=j.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(j){if(!q(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.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:U!==0&&U!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),U!==0&&U!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:U!==0&&U!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),U!==0&&U!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const U=[],D=j.split(";");for(;D.length>1;){const N=D.shift(),W=D.shift();if(/^\d+$/.exec(N)){const Z=parseInt(N);if($(Z))if(W==="?")U.push({type:0,index:Z});else{const ee=(0,P.parseColor)(W);ee&&U.push({type:1,index:Z,color:ee})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(j){const U=j.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(j,U){this._getCurrentLinkId()&&this._finishHyperlink();const D=j.split(":");let N;const W=D.findIndex((Z=>Z.startsWith("id=")));return W!==-1&&(N=D[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:N,uri:U}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,U){const D=j.split(";");for(let N=0;N<D.length&&!(U>=this._specialColors.length);++N,++U)if(D[N]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const W=(0,P.parseColor)(D[N]);W&&this._onColor.fire([{type:1,index:this._specialColors[U],color:W}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const U=[],D=j.split(";");for(let N=0;N<D.length;++N)if(/^\d+$/.exec(D[N])){const W=parseInt(D[N]);$(W)&&U.push({type:2,index:W})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(z[j[0]],g.CHARSETS[j[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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new x.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const D=this._activeBuffer.ybase+this._activeBuffer.y+U,N=this._activeBuffer.lines.get(D);N&&(N.fill(j),N.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,U){const D=this._bufferService.buffer,N=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${W}${f.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[N.cursorStyle]-(N.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,U){this._dirtyRowTracker.markRangeDirty(j,U)}}a.InputHandler=Y;let V=class{constructor(G){this._bufferService=G,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(G){G<this.start?this.start=G:G>this.end&&(this.end=G)}markRangeDirty(G,j){G>j&&(K=G,G=j,j=K),G<this.start&&(this.start=G),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function $(G){return 0<=G&&G<256}V=d([p(0,T.IBufferService)],V)},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(),b=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),w=Math.max(C,w),b=S.timeRemaining(),1.5*w>b)return y-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-C))}ms`),void this._start();y=b}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),b=l(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(v,x,E){this._hasScrollback=v,this._optionsService=x,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=b.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,x){return new g.BufferLine(this._bufferService.cols,this.getNullCell(v),x)}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 x=v+this._optionsService.rawOptions.scrollback;return x>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:x}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=g.DEFAULT_ATTR_DATA);let x=this._rows;for(;x--;)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,x){const E=this.getNullCell(g.DEFAULT_ATTR_DATA);let T=0;const A=this._getCorrectBufferLength(x);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<x)for(let L=this._rows;L<x;L++)this.lines.length<x+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new 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>x;L--)this.lines.length>x+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,x-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(v,x),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=x,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 x=0;for(;this._memoryCleanupPosition<this.lines.length;)if(x+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),x>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,x){this._cols!==v&&(v>this._cols?this._reflowLarger(v,x):this._reflowSmaller(v,x))}_reflowLarger(v,x){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,x,T.countRemoved)}}_reflowLargerAdjustViewport(v,x,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<x&&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,x){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 P=[L];for(;L.isWrapped&&M>0;)L=this.lines.get(--M),P.unshift(L);const z=this.ybase+this.y;if(z>=M&&z<M+P.length)continue;const H=P[P.length-1].getTrimmedLength(),q=(0,S.reflowSmallerGetNewLineLengths)(P,this._cols,v),I=q.length-P.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const Y=[];for(let D=0;D<I;D++){const N=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);Y.push(N)}Y.length>0&&(T.push({start:M+P.length+A,newLines:Y}),A+=Y.length),P.push(...Y);let V=q.length-1,$=q[V];$===0&&(V--,$=q[V]);let G=P.length-I-1,j=H;for(;G>=0;){const D=Math.min(j,$);if(P[V]===void 0)break;if(P[V].copyCellsFrom(P[G],j-D,$-D,D,!0),$-=D,$===0&&(V--,$=q[V]),j-=D,j===0){G--;const N=Math.max(G,0);j=(0,S.getWrappedLineTrimmedLength)(P,N,this._cols)}}for(let D=0;D<P.length;D++)q[D]<v&&P[D].setCell(q[D],E);let U=I-K;for(;U-- >0;)this.ybase===0?this.y<x-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+A)-x&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+x-1)}if(T.length>0){const M=[],L=[];for(let V=0;V<this.lines.length;V++)L.push(this.lines.get(V));const P=this.lines.length;let z=P-1,H=0,q=T[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let I=0;for(let V=Math.min(this.lines.maxLength-1,P+A-1);V>=0;V--)if(q&&q.start>z+I){for(let $=q.newLines.length-1;$>=0;$--)this.lines.set(V--,q.newLines[$]);V++,M.push({index:z+1,amount:q.newLines.length}),I+=q.newLines.length,q=T[++H]}else this.lines.set(V,L[z--]);let K=0;for(let V=M.length-1;V>=0;V--)M[V].index+=K,this.lines.onInsertEmitter.fire(M[V]),K+=M[V].amount;const Y=Math.max(0,P+A-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(v,x,E=0,T){const A=this.lines.get(v);return A?A.translateToString(x,E,T):""}getWrappedRangeForLine(v){let x=v,E=v;for(;x>0&&this.lines.get(x).isWrapped;)x--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:x,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 x=0;x<this.markers.length;x++)this.markers[x].line===v&&(this.markers[x].dispose(),this.markers.splice(x--,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 x=new y.Marker(v);return this.markers.push(x),x.register(this.lines.onTrim((E=>{x.line-=E,x.line<0&&x.dispose()}))),x.register(this.lines.onInsert((E=>{x.line>=E.index&&(x.line+=E.amount)}))),x.register(this.lines.onDelete((E=>{x.line>=E.index&&x.line<E.index+E.amount&&x.dispose(),x.line>E.index&&(x.line-=E.amount)}))),x.register(x.onDispose((()=>this._removeMarker(x)))),x}_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,b,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const x=b||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,x);this.length=y}get(y){const b=this._data[3*y+0],v=2097151&b;return[this._data[3*y+1],2097152&b?this._combined[y]:v?(0,g.stringFromCodePoint)(v):"",b>>22,2097152&b?this._combined[y].charCodeAt(this._combined[y].length-1):v]}set(y,b){this._data[3*y+1]=b[f.CHAR_DATA_ATTR_INDEX],b[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=b[1],this._data[3*y+0]=2097152|y|b[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=b[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[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 b=this._data[3*y+0];return 2097152&b?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&b}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const b=this._data[3*y+0];return 2097152&b?this._combined[y]:2097151&b?(0,g.stringFromCodePoint)(2097151&b):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,b){return S=3*y,b.content=this._data[S+0],b.fg=this._data[S+1],b.bg=this._data[S+2],2097152&b.content&&(b.combinedData=this._combined[y]),268435456&b.bg&&(b.extended=this._extendedAttrs[y]),b}setCell(y,b){2097152&b.content&&(this._combined[y]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[y]=b.extended),this._data[3*y+0]=b.content,this._data[3*y+1]=b.fg,this._data[3*y+2]=b.bg}setCellFromCodepoint(y,b,v,x){268435456&x.bg&&(this._extendedAttrs[y]=x.extended),this._data[3*y+0]=b|v<<22,this._data[3*y+1]=x.fg,this._data[3*y+2]=x.bg}addCodepointToCell(y,b,v){let x=this._data[3*y+0];2097152&x?this._combined[y]+=(0,g.stringFromCodePoint)(b):2097151&x?(this._combined[y]=(0,g.stringFromCodePoint)(2097151&x)+(0,g.stringFromCodePoint)(b),x&=-2097152,x|=2097152):x=b|4194304,v&&(x&=-12582913,x|=v<<22),this._data[3*y+0]=x}insertCells(y,b,v){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),b<this.length-y){const x=new p.CellData;for(let E=this.length-y-b-1;E>=0;--E)this.setCell(y+b+E,this.loadCell(y+E,x));for(let E=0;E<b;++E)this.setCell(y+E,v)}else for(let x=y;x<this.length;++x)this.setCell(x,v);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,v)}deleteCells(y,b,v){if(y%=this.length,b<this.length-y){const x=new p.CellData;for(let E=0;E<this.length-y-b;++E)this.setCell(y+E,this.loadCell(y+b+E,x));for(let E=this.length-b;E<this.length;++E)this.setCell(E,v)}else for(let x=y;x<this.length;++x)this.setCell(x,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,b,v,x=!1){if(x)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,v),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,v);y<b&&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),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,v);y<b&&y<this.length;)this.setCell(y++,v)}resize(y,b){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 x=new Uint32Array(v);x.set(this._data),this._data=x}for(let x=this.length;x<y;++x)this.setCell(x,b)}else{this._data=this._data.subarray(0,v);const x=Object.keys(this._combined);for(let T=0;T<x.length;T++){const A=parseInt(x[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,b=!1){if(b)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 b in y._combined)this._combined[b]=y._combined[b];this._extendedAttrs={};for(const b in y._extendedAttrs)this._extendedAttrs[b]=y._extendedAttrs[b];this.isWrapped=y.isWrapped}clone(){const y=new C(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const b in this._combined)y._combined[b]=this._combined[b];for(const b in this._extendedAttrs)y._extendedAttrs[b]=this._extendedAttrs[b];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,b,v,x,E){const T=y._data;if(E)for(let M=x-1;M>=0;M--){for(let L=0;L<3;L++)this._data[3*(v+M)+L]=T[3*(b+M)+L];268435456&T[3*(b+M)+2]&&(this._extendedAttrs[v+M]=y._extendedAttrs[b+M])}else for(let M=0;M<x;M++){for(let L=0;L<3;L++)this._data[3*(v+M)+L]=T[3*(b+M)+L];268435456&T[3*(b+M)+2]&&(this._extendedAttrs[v+M]=y._extendedAttrs[b+M])}const A=Object.keys(y._combined);for(let M=0;M<A.length;M++){const L=parseInt(A[M],10);L>=b&&(this._combined[L-b+v]=y._combined[L])}}translateToString(y,b,v,x){b=b??0,v=v??this.length,y&&(v=Math.min(v,this.getTrimmedLength())),x&&(x.length=0);let E="";for(;b<v;){const T=this._data[3*b+0],A=2097151&T,M=2097152&T?this._combined[b]:A?(0,g.stringFromCodePoint)(A):f.WHITESPACE_CELL_CHAR;if(E+=M,x)for(let L=0;L<M.length;++L)x.push(b);b+=T>>22||1}return x&&x.push(b),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,b=d.get(++y);if(!b.isWrapped)continue;const v=[d.get(w)];for(;y<d.length&&b.isWrapped;)v.push(b),b=d.get(++y);if(g>=w&&g<y){w+=v.length-1;continue}let x=0,E=l(v,x,p),T=1,A=0;for(;T<v.length;){const L=l(v,T,p),P=L-A,z=f-E,H=Math.min(P,z);v[x].copyCellsFrom(v[T],A,E,H,!1),E+=H,E===f&&(x++,E=0),A+=H,A===L&&(T++,A=0),E===0&&x!==0&&v[x-1].getWidth(f-1)===2&&(v[x].copyCellsFrom(v[x-1],f-1,E++,1,!1),v[x-1].setCell(f-1,S))}v[x].replaceCells(E,f,S);let M=0;for(let L=v.length-1;L>0&&(L>x||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(((b,v)=>l(d,v,p))).reduce(((b,v)=>b+v));let C=0,w=0,y=0;for(;y<S;){if(S-y<f){g.push(S-y);break}C+=f;const b=l(d,w,p);C>b&&(C-=b,w++);const v=d[w].getWidth(C-1)===2;v&&C--;const x=v?f-1:f;g.push(x),y+=x}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 b=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(y-55296)+b-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=`
33
- `,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 b=p[f.keyCode],v=b?.[f.shiftKey?1:0];if(v)w.key=d.C0.ESC+v;else if(f.keyCode>=65&&f.keyCode<=90){const x=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(x);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 x=f.code.slice(3,4);f.shiftKey||(x=x.toLowerCase()),w.key=d.C0.ESC+x,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,b=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,P=L-M;for(;b<P;){if(b>=p)return 0;if(A=l[b++],(192&A)!=128){b--,E=!0;break}this.interim[M++]=A,T<<=6,T|=63&A}E||(L===2?T<128?b--: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 x=b;for(;x<p;){for(;!(!(x<v)||128&(f=l[x])||128&(g=l[x+1])||128&(S=l[x+2])||128&(C=l[x+3]));)d[w++]=f,d[w++]=g,d[w++]=S,d[w++]=C,x+=4;if(f=l[x++],f<128)d[w++]=f;else if((224&f)==192){if(x>=p)return this.interim[0]=f,w;if(g=l[x++],(192&g)!=128){x--;continue}if(y=(31&f)<<6|63&g,y<128){x--;continue}d[w++]=y}else if((240&f)==224){if(x>=p)return this.interim[0]=f,w;if(g=l[x++],(192&g)!=128){x--;continue}if(x>=p)return this.interim[0]=f,this.interim[1]=g,w;if(S=l[x++],(192&S)!=128){x--;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(x>=p)return this.interim[0]=f,w;if(g=l[x++],(192&g)!=128){x--;continue}if(x>=p)return this.interim[0]=f,this.interim[1]=g,w;if(S=l[x++],(192&S)!=128){x--;continue}if(x>=p)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=S,w;if(C=l[x++],(192&C)!=128){x--;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,b=0,v=w.length-1;if(C<w[0][0]||C>w[v][1])return!1;for(;v>=b;)if(y=b+v>>1,C>w[y][1])b=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 b=d.UnicodeService.extractWidth(C);b===0?y=!1:b>w&&(w=b)}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],b=this._action(y,C);if(b){const x=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void b.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(x)}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 b=y.indexOf(w);b!==-1&&y.splice(b,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=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 b=this._active.length-1;b>=0;b--)this._active[b].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,b=this._active.length-1,v=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,y=w,v=this._stack.fallThrough,this._stack.paused=!1),!v&&y===!1){for(;b>=0&&(y=this._active[b].unhook(C),y!==!0);b--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,y;b--}for(;b>=0;b--)if(y=this._active[b].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,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(b){this.table=new Uint8Array(b)}setDefault(b,v){this.table.fill(b<<4|v)}add(b,v,x,E){this.table[v<<8|b]=x<<4|E}addMany(b,v,x,E){for(let T=0;T<b.length;T++)this.table[v<<8|b[T]]=x<<4|E}}a.TransitionTable=S;const C=160;a.VT500_TRANSITION_TABLE=(function(){const y=new S(4095),b=Array.apply(null,Array(256)).map(((M,L)=>L)),v=(M,L)=>b.slice(M,L),x=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(x,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(x,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(x,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(x,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(b=a.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(v,x,E)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,x)=>{},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(b,v=[64,126]){let x=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=b.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<b.intermediates.length;++T){const A=b.intermediates.charCodeAt(T);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=A}}if(b.final.length!==1)throw new Error("final must be a single byte");const E=b.final.charCodeAt(0);if(v[0]>E||E>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return x<<=8,x|=E,x}identToString(b){const v=[];for(;b;)v.push(String.fromCharCode(255&b)),b>>=8;return v.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,v){const x=this._identifier(b,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const E=this._escHandlers[x];return E.push(v),{dispose:()=>{const T=E.indexOf(v);T!==-1&&E.splice(T,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,v){this._executeHandlers[b.charCodeAt(0)]=v}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,v){const x=this._identifier(b);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const E=this._csiHandlers[x];return E.push(v),{dispose:()=>{const T=E.indexOf(v);T!==-1&&E.splice(T,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,v){return this._dcsParser.registerHandler(this._identifier(b),v)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,v){return this._oscParser.registerHandler(b,v)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,v,x,E,T){this._parseStack.state=b,this._parseStack.handlers=v,this._parseStack.handlerPos=x,this._parseStack.transition=E,this._parseStack.chunkPos=T}parse(b,v,x){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(x===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const L=this._parseStack.handlers;let P=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(x===!1&&P>-1){for(;P>=0&&(E=L[P](this._params),E!==!0);P--)if(E instanceof Promise)return this._parseStack.handlerPos=P,E}this._parseStack.handlers=[];break;case 4:if(x===!1&&P>-1){for(;P>=0&&(E=L[P](),E!==!0);P--)if(E instanceof Promise)return this._parseStack.handlerPos=P,E}this._parseStack.handlers=[];break;case 6:if(T=b[this._parseStack.chunkPos],E=this._dcsParser.unhook(T!==24&&T!==26,x),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=b[this._parseStack.chunkPos],E=this._oscParser.end(T!==24&&T!==26,x),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=b[L],A=this._transitions.table[this.currentState<<8|(T<160?T:C)],A>>4){case 2:for(let I=L+1;;++I){if(I>=v||(T=b[I])<32||T>126&&T<C){this._printHandler(b,L,I),L=I-1;break}if(++I>=v||(T=b[I])<32||T>126&&T<C){this._printHandler(b,L,I),L=I-1;break}if(++I>=v||(T=b[I])<32||T>126&&T<C){this._printHandler(b,L,I),L=I-1;break}if(++I>=v||(T=b[I])<32||T>126&&T<C){this._printHandler(b,L,I),L=I-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 P=this._csiHandlers[this._collect<<8|T];let z=P?P.length-1:-1;for(;z>=0&&(E=P[z](this._params),E!==!0);z--)if(E instanceof Promise)return this._preserveStack(3,P,z,A,L),E;z<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=b[L])>47&&T<60);L--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const H=this._escHandlers[this._collect<<8|T];let q=H?H.length-1:-1;for(;q>=0&&(E=H[q](),E!==!0);q--)if(E instanceof Promise)return this._preserveStack(4,H,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 I=L+1;;++I)if(I>=v||(T=b[I])===24||T===26||T===27||T>127&&T<C){this._dcsParser.put(b,L,I),L=I-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 I=L+1;;I++)if(I>=v||(T=b[I])<32||T>127&&T<C){this._oscParser.put(b,L,I),L=I-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,b,v,x){var E,T=arguments.length,A=T<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,b,v,x);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(A=(T<3?E(A):T>3?E(b,v,A):E(b,v))||A);return T>3&&A&&Object.defineProperty(b,v,A),A},p=this&&this.__param||function(y,b){return function(v,x){b(v,x,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,b){this.cols=y,this.rows=b,this.buffers.resize(y,b),this._onResize.fire({cols:y,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,b=!1){const v=this.buffer;let x;x=this._cachedBlankLine,x&&x.length===this.cols&&x.getFg(0)===y.fg&&x.getBg(0)===y.bg||(x=v.getBlankLine(y,b),this._cachedBlankLine=x),x.isWrapped=b;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(x):v.lines.push(x.clone()):v.lines.splice(T+1,0,x.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,x.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(y,b,v){const x=this.buffer;if(y<0){if(x.ydisp===0)return;this.isUserScrolling=!0}else y+x.ydisp>=x.ybase&&(this.isUserScrolling=!1);const E=x.ydisp;x.ydisp=Math.max(Math.min(x.ydisp+y,x.ybase),0),E!==x.ydisp&&(b||this._onScroll.fire(x.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(x,E,T,A){var M,L=arguments.length,P=L<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(x,E,T,A);else for(var z=x.length-1;z>=0;z--)(M=x[z])&&(P=(L<3?M(P):L>3?M(E,T,P):M(E,T))||P);return L>3&&P&&Object.defineProperty(E,T,P),P},p=this&&this.__param||function(x,E){return function(T,A){E(T,A,x)}};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:x=>x.button!==4&&x.action===1&&(x.ctrl=!1,x.alt=!1,x.shift=!1,!0)},VT200:{events:19,restrict:x=>x.action!==32},DRAG:{events:23,restrict:x=>x.action!==32||x.button!==3},ANY:{events:31,restrict:x=>!0}};function w(x,E){let T=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(T|=64,T|=x.action):(T|=3&x.button,4&x.button&&(T|=64),8&x.button&&(T|=128),x.action===32?T|=32:x.action!==0||E||(T|=3)),T}const y=String.fromCharCode,b={DEFAULT:x=>{const E=[w(x,!1)+32,x.col+32,x.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${y(E[0])}${y(E[1])}${y(E[2])}`},SGR:x=>{const E=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${w(x,!0)};${x.col};${x.row}${E}`},SGR_PIXELS:x=>{const E=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${w(x,!0)};${x.x};${x.y}${E}`}};let v=a.CoreMouseService=class extends S.Disposable{constructor(x,E){super(),this._bufferService=x,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(b))this.addEncoding(T,b[T]);this.reset()}addProtocol(x,E){this._protocols[x]=E}addEncoding(x,E){this._encodings[x]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(x){if(!this._protocols[x])throw new Error(`unknown protocol "${x}"`);this._activeProtocol=x,this._onProtocolChange.fire(this._protocols[x].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(x){if(!this._encodings[x])throw new Error(`unknown encoding "${x}"`);this._activeEncoding=x}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(x){if(x.col<0||x.col>=this._bufferService.cols||x.row<0||x.row>=this._bufferService.rows||x.button===4&&x.action===32||x.button===3&&x.action!==32||x.button!==4&&(x.action===2||x.action===3)||(x.col++,x.row++,x.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,x,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(x))return!1;const E=this._encodings[this._activeEncoding](x);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=x,!0}explainEvents(x){return{down:!!(1&x),up:!!(2&x),drag:!!(4&x),move:!!(8&x),wheel:!!(16&x)}}_equalEvents(x,E,T){if(T){if(x.x!==E.x||x.y!==E.y)return!1}else if(x.col!==E.col||x.row!==E.row)return!1;return x.button===E.button&&x.action===E.action&&x.ctrl===E.ctrl&&x.alt===E.alt&&x.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,x,E,T){var A,M=arguments.length,L=M<3?x:T===null?T=Object.getOwnPropertyDescriptor(x,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,x,E,T);else for(var P=v.length-1;P>=0;P--)(A=v[P])&&(L=(M<3?A(L):M>3?A(x,E,L):A(x,E))||L);return M>3&&L&&Object.defineProperty(x,E,L),L},p=this&&this.__param||function(v,x){return function(E,T){x(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 b=a.CoreService=class extends S.Disposable{constructor(v,x,E){super(),this._bufferService=v,this._logService=x,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,x=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;x&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),x&&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((x=>x.charCodeAt(0))))),this._onBinary.fire(v))}};a.CoreService=b=d([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],b)},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 x=new y(v);if(x){const E=x.marker.onDispose((()=>x.dispose()));x.onDispose((()=>{x&&(this._decorations.delete(x)&&this._onDecorationRemoved.fire(x),E.dispose())})),this._decorations.insert(x),this._onDecorationRegistered.fire(x)}return x}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,x,E){let T=0,A=0;for(const M of this._decorations.getKeyIterator(x))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,x,E,T){this._decorations.forEachByKey(x,(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(((b,v)=>b.index-v.index)),w=[];for(const b of C){const v=this._services.get(b.id);if(!v)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${b.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,b,v,x){var E,T=arguments.length,A=T<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,b,v,x);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(A=(T<3?E(A):T>3?E(b,v,A):E(b,v))||A);return T>3&&A&&Object.defineProperty(b,v,A),A},p=this&&this.__param||function(y,b){return function(v,x){b(v,x,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 b=0;b<y.length;b++)typeof y[b]=="function"&&(y[b]=y[b]())}_log(y,b,v){this._evalLazyOptionalParams(v),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...v)}trace(y,...b){this._logLevel<=g.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,y,b)}debug(y,...b){this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,y,b)}info(y,...b){this._logLevel<=g.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,y,b)}warn(y,...b){this._logLevel<=g.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,y,b)}error(y,...b){this._logLevel<=g.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,y,b)}};a.LogService=w=d([p(0,g.IOptionsService)],w),a.setTraceLogger=function(y){C=y},a.traceCall=function(y,b,v){if(typeof v.value!="function")throw new Error("not supported");const x=v.value;v.value=function(...E){if(C.logLevel!==g.LogLevelEnum.TRACE)return x.apply(this,E);C.trace(`GlyphRenderer#${x.name}(${E.map((A=>JSON.stringify(A))).join(", ")})`);const T=x.apply(this,E);return C.trace(`GlyphRenderer#${x.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 b in w)if(b in y)try{const v=w[b];y[b]=this._sanitizeAndValidateOption(b,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((b=>{b===w&&y(this.rawOptions[w])}))}onMultipleOptionChange(w,y){return this.onOptionChange((b=>{w.indexOf(b)!==-1&&y()}))}_setupOptions(){const w=b=>{if(!(b in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},y=(b,v)=>{if(!(b in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);v=this._sanitizeAndValidateOption(b,v),this.rawOptions[b]!==v&&(this.rawOptions[b]=v,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const v={get:w.bind(this,b),set:y.bind(this,b)};Object.defineProperty(this.options,b,v)}}_sanitizeAndValidateOption(w,y){switch(w){case"cursorStyle":if(y||(y=a.DEFAULT_OPTIONS[w]),!(function(b){return b==="block"||b==="underline"||b==="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 b,v=arguments.length,x=v<3?C:y===null?y=Object.getOwnPropertyDescriptor(C,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(S,C,w,y);else for(var E=S.length-1;E>=0;E--)(b=S[E])&&(x=(v<3?b(x):v>3?b(C,w,x):b(C,w))||x);return v>3&&x&&Object.defineProperty(C,w,x),x},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),b=this._entriesWithId.get(y);if(b)return this.addLineToLink(b.id,C.ybase+C.y),b.id;const v=C.addMarker(C.ybase+C.y),x={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(x,v))),this._entriesWithId.set(x.key,x),this._dataByLinkId.set(x.id,x),x.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,b){y[l]===y?y[d].push({id:w,index:b}):(y[d]=[{id:w,index:b}],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 b=0;b<y;++b){let v=S.charCodeAt(b);if(55296<=v&&v<=56319){if(++b>=y)return C+this.wcwidth(v);const T=S.charCodeAt(b);56320<=T&&T<=57343?v=1024*(v-55296)+T-56320+65536:C+=this.wcwidth(T)}const x=this.charProperties(v,w);let E=f.extractWidth(x);f.extractShouldJoin(x)&&(E-=f.extractWidth(w)),C+=E,w=x}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(b){super(),this._core=this.register(new l.Terminal(b)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const v=E=>this._core.options[E],x=(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:x.bind(this,E)};Object.defineProperty(this._publicOptions,E,T)}}_checkReadonlyOptions(b){if(C.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new 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 b=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:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const v in b)this._publicOptions[v]=b[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,v=!0){this._core.input(b,v)}resize(b,v){this._verifyIntegers(b,v),this._core.resize(b,v)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,v,x){this._verifyIntegers(b,v,x),this._core.select(b,v,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,v){this._verifyIntegers(b,v),this._core.selectLines(b,v)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,v){this._core.write(b,v)}writeln(b,v){this._core.write(b),this._core.write(`\r
34
- `,v)}paste(b){this._core.paste(b)}refresh(b,v){this._verifyIntegers(b,v),this._core.refresh(b,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return a}_verifyIntegers(...b){for(const v of b)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const v of b)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})()))})(Sv)),Sv.exports}var zR=PN(),Cv={exports:{}},YC;function jN(){return YC||(YC=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})()))})(Cv)),Cv.exports}var HR=jN(),wv={exports:{}},XC;function IN(){return XC||(XC=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,b]=d._getWindowedLineStrings(f-1,S),v=y.join("");let x;const E=[];for(;x=w.exec(v);){const T=x[0];if(!l(T))continue;const[A,M]=d._mapStrIdx(S,b,0,x.index),[L,P]=d._mapStrIdx(S,A,M,T.length);if(A===-1||M===-1||L===-1||P===-1)continue;const z={start:{x:M+1,y:A+1},end:{x:P,y:L+1}};E.push({range:z,text:T,activate:C})}return E}static _getWindowedLineStrings(f,g){let S,C=f,w=f,y=0,b="";const v=[];if(S=g.buffer.active.getLine(f)){const x=S.translateToString(!0);if(S.isWrapped&&x[0]!==" "){for(y=0;(S=g.buffer.active.getLine(--C))&&y<2048&&(b=S.translateToString(!0),y+=b.length,v.push(b),S.isWrapped&&b.indexOf(" ")===-1););v.reverse()}for(v.push(x),y=0;(S=g.buffer.active.getLine(++w))&&S.isWrapped&&y<2048&&(b=S.translateToString(!0),y+=b.length,v.push(b),b.indexOf(" ")===-1););}return[v,C]}static _mapStrIdx(f,g,S,C){const w=f.buffer.active,y=w.getNullCell();let b=S;for(;C;){const v=w.getLine(g);if(!v)return[-1,-1];for(let x=b;x<v.length;++x){v.getCell(x,y);const E=y.getChars();if(y.getWidth()&&(C-=E.length||1,x===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,x]}g++,b=0}return[g,b]}}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})()))})(wv)),wv.exports}var VR=IN();function NN({className:e,onReady:t,onResize:n,onContainerReady:s,terminalId:o,setupImagePaste:u}){const h=R.useRef(null),a=R.useRef(null),l=R.useRef(null),d=R.useRef(n),{setTerminalFocused:p}=K0();R.useEffect(()=>{d.current=n},[n]);const f=R.useCallback(()=>{if(!l.current||!a.current)return;l.current.fit();const{cols:S,rows:C}=a.current;d.current?.(S,C)},[]);R.useEffect(()=>{if(!h.current||a.current)return;const S=new zR.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"}}),C=new HR.FitAddon,w=new VR.WebLinksAddon;S.loadAddon(C),S.loadAddon(w),S.open(h.current),a.current=S,l.current=C,requestAnimationFrame(()=>{f(),t?.(S),h.current&&s?.(h.current)});const y=()=>p(!0),b=()=>p(!1);S.textarea&&(S.textarea.addEventListener("focus",y),S.textarea.addEventListener("blur",b));const v=setTimeout(()=>{f(),S.refresh(0,S.rows-1)},100),x=()=>{requestAnimationFrame(f)};window.addEventListener("resize",x);const E=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{f(),S.refresh(0,S.rows-1)})};document.addEventListener("visibilitychange",E);const T=new ResizeObserver(x);T.observe(h.current);const A=new IntersectionObserver(M=>{M[0]?.isIntersecting&&requestAnimationFrame(()=>{f(),S.refresh(0,S.rows-1)})},{threshold:.1});return A.observe(h.current),()=>{clearTimeout(v),window.removeEventListener("resize",x),document.removeEventListener("visibilitychange",E),T.disconnect(),A.disconnect(),S.textarea&&(S.textarea.removeEventListener("focus",y),S.textarea.removeEventListener("blur",b)),p(!1),S.dispose(),a.current=null,l.current=null}},[f,t,s,p]),R.useEffect(()=>!h.current||!o||!u?void 0:u(h.current,o),[o,u]);const g=R.useCallback(()=>{a.current?.scrollToBottom()},[]);return _.jsxs("div",{className:"relative h-full w-full max-w-full",children:[_.jsx("div",{ref:h,className:Be("h-full w-full max-w-full overflow-hidden bg-[#0a0a0a] p-2",e)}),_.jsx("button",{onClick:g,className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:_.jsx(_e,{icon:X2,size:20,strokeWidth:2})})]})}function BN({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:Be("flex h-6 items-center gap-2 border-b border-border bg-card px-2 text-xs",s),children:[_.jsx("span",{className:Be("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:Be("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:Be({"text-muted-foreground":n===0,"text-red-400":n!==0}),children:["exit ",n]})]})]})}function FR({...e}){return _.jsx(fj,{"data-slot":"dropdown-menu",...e})}function UR({...e}){return _.jsx(pj,{"data-slot":"dropdown-menu-trigger",...e})}function WR({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:s=4,className:o,...u}){return _.jsx(ej,{children:_.jsx(tj,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:s,children:_.jsx(Z9,{"data-slot":"dropdown-menu-content",className:Be("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 Ev({className:e,inset:t,variant:n="default",...s}){return _.jsx(X9,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Be("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 zN({...e}){return _.jsx(rj,{"data-slot":"dropdown-menu-radio-group",...e})}function HN({className:e,children:t,...n}){return _.jsxs(ij,{"data-slot":"dropdown-menu-radio-item",className:Be("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(oj,{children:_.jsx(_e,{icon:Ma,strokeWidth:2})})}),t]})}const VN="";function qR(){return jn({mutationFn:async e=>{const t=await fetch(`${VN}/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 FN="";function GR(){return jn({mutationFn:async e=>{const t=await fetch(`${FN}/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 UN="";function $R(){return jn({mutationFn:async e=>{const t=await fetch(`${UN}/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()}})}const WN="";function KR(){return jn({mutationFn:async e=>{const t=await fetch(`${WN}/api/tasks/${e}/kill-claude`,{method:"POST"});if(!t.ok){const n=await t.json();throw new Error(n.error||"Failed to kill Claude")}return t.json()}})}function qN({repoPath:e,worktreePath:t,baseBranch:n,taskId:s,isMobile:o}){const u=qR(),h=GR(),a=$R(),l=W0(),d=KR(),p=async()=>{try{await u.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),yr.success("Synced from main")}catch(C){const w=C instanceof Error?C.message:"Sync failed";yr.error(w)}},f=async()=>{try{await h.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),yr.success("Merged to main"),d.mutate(s),l.mutate({taskId:s,updates:{status:"DONE"}})}catch(C){const w=C instanceof Error?C.message:"Merge failed";yr.error(w)}},g=async()=>{try{await a.mutateAsync({repoPath:e,baseBranch:n}),yr.success("Parent synced with origin")}catch(C){const w=C instanceof Error?C.message:"Sync parent failed";yr.error(w)}},S=u.isPending||h.isPending||a.isPending;return o?_.jsxs(FR,{children:[_.jsx(UR,{className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground",children:_.jsx(_e,{icon:x4,size:12,strokeWidth:2,className:S?"animate-pulse":""})}),_.jsxs(WR,{align:"end",children:[_.jsxs(Ev,{onClick:p,disabled:u.isPending,children:[_.jsx(_e,{icon:t_,size:12,strokeWidth:2,className:u.isPending?"animate-spin":""}),"Pull from main"]}),_.jsxs(Ev,{onClick:f,disabled:h.isPending,children:[_.jsx(_e,{icon:n_,size:12,strokeWidth:2,className:h.isPending?"animate-pulse":""}),"Merge to main"]}),_.jsxs(Ev,{onClick:g,disabled:a.isPending,children:[_.jsx(_e,{icon:o_,size:12,strokeWidth:2,className:a.isPending?"animate-spin":""}),"Sync parent with origin"]})]})]}):_.jsxs(_.Fragment,{children:[_.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:p,disabled:u.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Pull from main",children:_.jsx(_e,{icon:t_,size:12,strokeWidth:2,className:u.isPending?"animate-spin":""})}),_.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:f,disabled:h.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Merge to main",children:_.jsx(_e,{icon:n_,size:12,strokeWidth:2,className:h.isPending?"animate-pulse":""})}),_.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:g,disabled:a.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:_.jsx(_e,{icon:o_,size:12,strokeWidth:2,className:a.isPending?"animate-spin":""})})]})}function GN({terminal:e,taskInfo:t,isMobile:n,onClose:s,onReady:o,onResize:u,onRename:h,onContainerReady:a,setupImagePaste:l}){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:i0,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(qN,{repoPath:t.repoPath,worktreePath:t.worktreePath,baseBranch:t.baseBranch,taskId:t.taskId,isMobile:n})})]}):_.jsxs(_.Fragment,{children:[_.jsx(BN,{name:e.name,status:e.status,exitCode:e.exitCode,className:"flex-1 border-b-0",onRename:h}),s&&_.jsx(Ne,{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(NN,{onReady:o,onResize:u,onContainerReady:a,terminalId:e.id,setupImagePaste:l})})]})}function $N({onAdd:e}){return _.jsx("div",{className:"flex h-full items-center justify-center bg-[#0a0a0a]",children:e?_.jsxs(Ne,{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 KN(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 YN(){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 XN({terminals:e,onTerminalClose:t,onTerminalAdd:n,onTerminalReady:s,onTerminalResize:o,onTerminalRename:u,onTerminalContainerReady:h,setupImagePaste:a,taskInfoByCwd:l}){const d=YN();if(e.length===0)return _.jsx($N,{onAdd:n});const{rows:p,cols:f}=KN(e.length),g=[];for(let C=0;C<p;C++){const w=C*f,y=Math.min(w+f,e.length);w<e.length&&g.push(e.slice(w,y))}const S=C=>_.jsx(GN,{terminal:C,taskInfo:C.cwd?l?.get(C.cwd):void 0,isMobile:d,onClose:t?()=>t(C.id):void 0,onReady:s?w=>s(C.id,w):void 0,onResize:o?(w,y)=>o(C.id,w,y):void 0,onRename:u?w=>u(C.id,w):void 0,onContainerReady:h?w=>h(C.id,w):void 0,setupImagePaste:a});return e.length===1?_.jsx("div",{className:"h-full w-full max-w-full min-w-0 overflow-hidden",children:S(e[0])}):e.length===2?_.jsxs(ta,{direction:d?"vertical":"horizontal",className:"h-full max-w-full",children:[_.jsx(ts,{defaultSize:50,minSize:15,children:S(e[0])},e[0].id),_.jsx(na,{}),_.jsx(ts,{defaultSize:50,minSize:15,children:S(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:S(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:S(e[1])},e[1].id),_.jsx(na,{}),_.jsx(ts,{defaultSize:50,minSize:15,children:S(e[2])},e[2].id)]})})]}):_.jsx(ta,{direction:"vertical",className:"h-full max-w-full",children:g.map((C,w)=>_.jsxs(R.Fragment,{children:[w>0&&_.jsx(na,{}),_.jsx(ts,{defaultSize:100/g.length,minSize:15,children:C.length===1?S(C[0]):_.jsx(ta,{direction:"horizontal",className:"h-full max-w-full",children:C.map((y,b)=>_.jsxs(R.Fragment,{children:[b>0&&_.jsx(na,{}),_.jsx(ts,{defaultSize:100/f,minSize:15,children:S(y)})]},y.id))})})]},`row-${w}`))})}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:Be("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(Ne,{variant:"ghost",size:"icon-xs",onClick:g,className:"h-4 w-4",children:_.jsx(_e,{icon:k4,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(Ne,{variant:"ghost",size:"icon-xs",onClick:o,className:"ml-1",children:_.jsx(_e,{icon:rc,size:14,strokeWidth:2})})]})}function ZN(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}function ey(e={}){const{url:t=ZN(),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),b=R.useRef(new Map),v=R.useRef(()=>{}),x=R.useRef(null),E=R.useRef(!1),T=R.useCallback(D=>{g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify(D))},[]),A=R.useCallback(D=>{try{const N=JSON.parse(D.data);switch(N.type){case"terminals:list":u(N.payload.terminals),a(!0);break;case"terminal:created":u(W=>[...W,N.payload.terminal]),N.payload.isNew&&y.current.add(N.payload.terminal.id);break;case"terminal:output":{const W=w.current.get(N.payload.terminalId);W&&W.write(N.payload.data);break}case"terminal:attached":{const W=w.current.get(N.payload.terminalId);W&&(W.reset(),N.payload.buffer&&W.write(N.payload.buffer));const Z=b.current.get(N.payload.terminalId);Z&&(b.current.delete(N.payload.terminalId),Z());break}case"terminal:bufferCleared":{const W=w.current.get(N.payload.terminalId);W&&W.reset();break}case"terminal:exit":u(W=>W.map(Z=>Z.id===N.payload.terminalId?{...Z,status:"exited",exitCode:N.payload.exitCode}:Z));break;case"terminal:error":console.error("Terminal error:",N.payload.error);break;case"terminal:renamed":u(W=>W.map(Z=>Z.id===N.payload.terminalId?{...Z,name:N.payload.name}:Z));break;case"terminal:destroyed":w.current.delete(N.payload.terminalId),u(W=>W.filter(Z=>Z.id!==N.payload.terminalId));break;case"terminal:tabAssigned":u(W=>W.map(Z=>Z.id===N.payload.terminalId?{...Z,tabId:N.payload.tabId??void 0,positionInTab:N.payload.positionInTab}:Z));break;case"tabs:list":d(N.payload.tabs);break;case"tab:created":d(W=>[...W,N.payload.tab].sort((Z,ee)=>Z.position-ee.position));break;case"tab:renamed":d(W=>W.map(Z=>Z.id===N.payload.tabId?{...Z,name:N.payload.name}:Z));break;case"tab:deleted":d(W=>W.filter(Z=>Z.id!==N.payload.tabId));break;case"tab:reordered":d(W=>W.map(Z=>Z.id===N.payload.tabId?{...Z,position:N.payload.position}:Z).sort((Z,ee)=>Z.position-ee.position));break}}catch(N){console.error("Failed to parse WebSocket message:",N)}},[]),M=R.useCallback(()=>{const D=g.current;if(D&&(D.readyState===WebSocket.CONNECTING||D.readyState===WebSocket.OPEN))return;const N=new WebSocket(t);g.current=N,N.onopen=()=>{f(!0),S.current=0},N.onmessage=A,N.onclose=()=>{f(!1),a(!1),g.current===N&&(g.current=null),S.current<s&&(S.current++,C.current=setTimeout(()=>v.current(),n))},N.onerror=()=>{}},[t,n,s,A]);v.current=M,R.useEffect(()=>(M(),()=>{C.current&&clearTimeout(C.current),g.current&&(g.current.close(),g.current=null)}),[M]),R.useEffect(()=>{if(p&&!E.current){const D=setTimeout(()=>{x.current&&document.hasFocus()&&document.visibilityState==="visible"&&w.current.get(x.current)?.focus()},150);return()=>clearTimeout(D)}E.current=p},[p]);const L=R.useCallback(D=>{T({type:"terminal:create",payload:D})},[T]),P=R.useCallback(D=>{T({type:"terminal:destroy",payload:{terminalId:D}}),w.current.delete(D),u(N=>N.filter(W=>W.id!==D))},[T]),z=R.useCallback((D,N)=>{T({type:"terminal:input",payload:{terminalId:D,data:N}})},[T]),H=R.useCallback((D,N,W)=>{T({type:"terminal:resize",payload:{terminalId:D,cols:N,rows:W}})},[T]),q=R.useCallback((D,N)=>{T({type:"terminal:rename",payload:{terminalId:D,name:N}})},[T]),I=R.useCallback(D=>{T({type:"terminal:clearBuffer",payload:{terminalId:D}})},[T]),K=R.useCallback((D,N,W)=>{T({type:"terminal:assignTab",payload:{terminalId:D,tabId:N,positionInTab:W}})},[T]),Y=R.useCallback((D,N)=>{T({type:"tab:create",payload:{name:D,position:N}})},[T]),V=R.useCallback((D,N)=>{T({type:"tab:rename",payload:{tabId:D,name:N}})},[T]),$=R.useCallback(D=>{T({type:"tab:delete",payload:{tabId:D}})},[T]),G=R.useCallback((D,N)=>{T({type:"tab:reorder",payload:{tabId:D,position:N}})},[T]),j=R.useCallback((D,N,W)=>{w.current.set(D,N),N.attachCustomKeyEventHandler(te=>te.type==="keydown"&&te.shiftKey&&te.key==="Enter"?(te.preventDefault(),te.stopPropagation(),z(D,`
35
- `),!1):!0);const Z=N.onData(te=>{z(D,te)}),ee=()=>{x.current=D};return N.textarea?.addEventListener("focus",ee),W?.onAttached&&b.current.set(D,W.onAttached),T({type:"terminal:attach",payload:{terminalId:D}}),()=>{Z.dispose(),w.current.delete(D),b.current.delete(D),N.textarea?.removeEventListener("focus",ee)}},[T,z]),U=R.useCallback((D,N)=>{const W=async Z=>{const ee=Z.clipboardData?.items;if(ee){for(const te of ee)if(te.type.startsWith("image/")){Z.preventDefault(),Z.stopPropagation();const X=te.getAsFile();if(!X)return;try{const F=await mk(X);z(N,F)}catch(F){console.error("Failed to upload image:",F)}return}}};return D.addEventListener("paste",W,!0),()=>{D.removeEventListener("paste",W,!0)}},[z]);return{terminals:o,terminalsLoaded:h,tabs:l,connected:p,newTerminalIds:y.current,createTerminal:L,destroyTerminal:P,writeToTerminal:z,resizeTerminal:H,renameTerminal:q,clearTerminalBuffer:I,assignTerminalToTab:K,createTab:Y,renameTab:V,deleteTab:$,reorderTab:G,attachXterm:j,setupImagePaste:U}}const Ps="all-tasks",QC=["IN_PROGRESS","IN_REVIEW"],JN=ws("/terminals/")({component:e7});function e7(){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}=bR();R.useEffect(()=>{if(t.length>0&&!w){const D=t.map(N=>N.id);(!S||!D.includes(S)&&S!==Ps)&&C(t[0].id)}},[t,S,w,C]);const{data:y=[]}=U0(),{data:b=[]}=G0(),{data:v}=hR(),[x,E]=R.useState(null),T=R.useMemo(()=>{const D=new Map;for(const N of b)D.set(N.path,N.id);return D},[b]),A=R.useMemo(()=>new Set(y.filter(D=>QC.includes(D.status)&&D.worktreePath).map(D=>D.worktreePath)),[y]),M=R.useMemo(()=>new Set(y.filter(D=>D.worktreePath).map(D=>D.worktreePath)),[y]),L=R.useMemo(()=>{const D=new Map;for(const N of y)N.worktreePath&&D.set(N.worktreePath,{taskId:N.id,repoId:T.get(N.repoPath),repoName:N.repoName,title:N.title,repoPath:N.repoPath,worktreePath:N.worktreePath,baseBranch:N.baseBranch,branch:N.branch});return D},[y,T]),P=R.useMemo(()=>{const D=new Set(y.filter(N=>QC.includes(N.status)).map(N=>N.repoName));return Array.from(D).sort()},[y]),z=R.useRef(new Map),H=R.useRef(0);R.useEffect(()=>{if(v)for(const D of e){const N=D.cwd?.startsWith(v),W=D.cwd&&M.has(D.cwd);N&&!W&&o(D.id)}},[e,M,v,o]);const q=R.useMemo(()=>S===Ps?e.filter(D=>D.cwd&&A.has(D.cwd)).filter(D=>x?y.find(W=>W.worktreePath===D.cwd)?.repoName===x:!0).sort((D,N)=>{const W=y.find(ee=>ee.worktreePath===D.cwd),Z=y.find(ee=>ee.worktreePath===N.cwd);return!W||!Z?0:new Date(Z.createdAt).getTime()-new Date(W.createdAt).getTime()}):e.filter(D=>D.tabId===S).sort((D,N)=>(D.positionInTab??0)-(N.positionInTab??0)),[S,e,A,x,y]),I=R.useCallback(()=>{H.current++;const N=e.filter(W=>W.tabId===S).length;s({name:`Terminal ${H.current}`,cols:80,rows:24,tabId:S??void 0,positionInTab:N})},[s,S,e]);R.useEffect(()=>{for(const D of e)D.cwd&&M.has(D.cwd)&&D.tabId&&h(D.id,null)},[e,M,h]);const K=R.useCallback(D=>{const N=z.current.get(D);N&&(N(),z.current.delete(D)),o(D)},[o]),Y=R.useCallback((D,N)=>{const W=p(D,N);z.current.set(D,W)},[p]),V=R.useCallback((D,N,W)=>{f(D,N,W)},[f]),$=R.useCallback((D,N)=>{u(D,N)},[u]),G=R.useCallback(()=>{const D=t.length;a(`Tab ${D+1}`)},[a,t.length]),j=R.useCallback(D=>{const N=e.filter(W=>W.tabId===D);for(const W of N)K(W.id);d(D)},[e,d,K]),U=t.map((D,N)=>({id:D.id,name:D.name,layout:"single",position:N}));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:U,activeTabId:S??"",onTabSelect:C,onTabClose:j,onTabCreate:G,onTabRename:l})}),_.jsxs("div",{className:"flex shrink-0 items-center gap-3 max-sm:gap-1",children:[S===Ps&&P.length>1&&_.jsxs(jl,{value:x??"",onValueChange:D=>E(D||null),children:[_.jsxs(Nl,{size:"sm",className:"max-sm:w-auto",children:[_.jsx(_e,{icon:eE,size:12,strokeWidth:2,className:"text-muted-foreground"}),_.jsx(Il,{children:x||"All Repos"})]}),_.jsxs(Bl,{children:[_.jsx(vr,{value:"",children:"All Repos"}),P.map(D=>_.jsx(vr,{value:D,children:D},D))]})]}),_.jsxs("button",{onClick:()=>C(Ps),className:Be("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(Ne,{variant:"outline",size:"sm",onClick:I,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(XN,{terminals:q,onTerminalClose:S===Ps?void 0:K,onTerminalAdd:n&&S!==Ps?I:void 0,onTerminalReady:Y,onTerminalResize:V,onTerminalRename:S===Ps?void 0:$,setupImagePaste:g,taskInfoByCwd:S===Ps?L:void 0})})]})}function t7(e){if(Array.isArray(e))return e}function n7(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 b_(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 YR(e,t){if(e){if(typeof e=="string")return b_(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)?b_(e,t):void 0}}function r7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
36
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XR(e,t){return t7(e)||n7(e,t)||YR(e,t)||r7()}var kv={},xu={},ZC;function QR(){if(ZC)return xu;ZC=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={},JC;function s7(){if(JC)return Xo;JC=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=QR();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 ew;function i7(){return ew||(ew=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=QR();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=s7();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})})(kv)),kv}var Ql=i7(),ZR="data-pdnd-honey-pot";function JR(e){return e instanceof Element&&e.hasAttribute(ZR)}function eT(e){var t=document.elementsFromPoint(e.x,e.y),n=XR(t,2),s=n[0],o=n[1];return s?JR(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 o7(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 a7(e){var t=o7(e,"string");return $u(t)=="symbol"?t:t+""}function pd(e,t,n){return(t=a7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tT=2147483647;function tw(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 nw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tw(Object(n),!0).forEach(function(s){pd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var Ku=2,rw=Ku/2;function l7(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function c7(e){return{x:e.x-rw,y:e.y-rw}}function u7(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function d7(e){return{x:Math.min(e.x,window.innerWidth-Ku),y:Math.min(e.y,window.innerHeight-Ku)}}function sw(e){var t=e.client,n=d7(u7(c7(l7(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:Ku,height:Ku})}function iw(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 f7(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 h7(e){var t=e.initial,n=document.createElement("div");n.setAttribute(ZR,"true");var s=sw({client:t});Object.assign(n.style,nw(nw({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},iw({clientRect:s})),{},{pointerEvents:"auto",zIndex:tT})),document.body.appendChild(n);var o=Ql.bind(window,{type:"pointermove",listener:function(h){var a={x:h.clientX,y:h.clientY};s=sw({client:a}),Object.assign(n.style,iw({clientRect:s}))},options:{capture:!0}});return function(h){var a=h.current;if(o(),f7({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 p7(){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=h7({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 m7(e){if(Array.isArray(e))return b_(e)}function g7(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function v7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
37
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nT(e){return m7(e)||g7(e)||YR(e)||v7()}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 _7=Ha(function(){return navigator.userAgent.includes("Firefox")}),md=Ha(function(){var t=navigator,n=t.userAgent;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),x_={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function y7(e){var t=e.dragLeave;return md()?t.hasOwnProperty(x_.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[x_.isEnteringWindow]=!0),n.isOverWindow=!0,n.enterCount++}},{type:"dragleave",listener:function(u){n.enterCount--,n.isOverWindow&&n.enterCount===0&&(u[x_.isLeavingWindow]=!0,n.isOverWindow=!1)}}],{capture:!0})})();function b7(e){return"nodeName"in e}function x7(e){return b7(e)&&e.ownerDocument!==document}function S7(e){var t=e.dragLeave,n=t.type,s=t.relatedTarget;return n!=="dragleave"?!1:md()?y7({dragLeave:t}):s==null?!0:_7()?x7(s):s instanceof HTMLIFrameElement}function C7(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 w7=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},Rv=w7(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 E7(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(),Rv.cancel(),u({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:o,current:d}}})},drag:function(l){var d=l.current;Rv(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(),Rv.cancel(),u({eventName:"onDrop",payload:{source:p??t,location:{current:d,previous:o,initial:n}}})}};return h}var S_={isActive:!1};function rT(){return!S_.isActive}function k7(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function R7(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 T7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=e.dispatchEvent;if(!rT())return;var u=L7({event:t,dragType:n,getDropTargetsOver:s});S_.isActive=!0;var h={current:u};Tv({event:t,current:u.dropTargets});var a=E7({source:n.payload,dispatchEvent:o,initial:u});function l(S){var C=R7({current:h.current.dropTargets,next:S.dropTargets});h.current=S,C&&a.dragUpdate({current:h.current})}function d(S){var C=Pu(S),w=JR(S.target)?eT({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(),Tv({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(){S_.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){S7({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(),Tv({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(nT(C7({onDragEnd:p}))),{capture:!0});a.start({nativeSetDragImage:k7(t)})}function Tv(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 L7(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 ow={canStart:rT,start:T7},C_=new Map;function A7(e){var t=e.typeKey,n=e.mount,s=C_.get(t);if(s)return s.usageCount++,s;var o={typeKey:t,unmount:n(),usageCount:1};return C_.set(t,o),o}function O7(e){var t=A7(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),C_.delete(e.typeKey))}}function Lp(){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 sT(e,t){var n=t.attribute,s=t.value;return e.setAttribute(n,s),function(){return e.removeAttribute(n)}}function aw(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?aw(Object(n),!0).forEach(function(s){pd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Lv(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=M7(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.
38
- 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 M7(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 Av(e){return e.slice(0).reverse()}function D7(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=Lp(sT(S.element,{attribute:o,value:"true"}),h(S));return Ha(C)}function l(S){var C,w,y,b,v=S.source,x=S.target,E=S.input,T=S.result,A=T===void 0?[]:T;if(x==null)return A;if(!(x instanceof Element))return x instanceof Node?l({source:v,target:x.parentElement,input:E,result:A}):A;var M=x.closest(u);if(M==null)return A;var L=s.get(M);if(L==null)return A;var P={input:E,source:v,element:L.element};if(L.canDrop&&!L.canDrop(P))return l({source:v,target:L.element.parentElement,input:E,result:A});var z=(C=(w=L.getData)===null||w===void 0?void 0:w.call(L,P))!==null&&C!==void 0?C:{},H=(y=(b=L.getDropEffect)===null||b===void 0?void 0:b.call(L,P))!==null&&y!==void 0?y:n,q={data:z,element:L.element,dropEffect:H,isActiveDueToStickiness:!1};return l({source:v,target:L.element.parentElement,input:E,result:[].concat(nT(A),[q])})}function d(S){var C=S.eventName,w=S.payload,y=Lv(w.location.current.dropTargets),b;try{for(y.s();!(b=y.n()).done;){var v,x=b.value,E=s.get(x.element),T=to(to({},w),{},{self:x});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($){return $.element})),b=new Set,v=Lv(w.location.previous.dropTargets),x;try{for(v.s();!(x=v.n()).done;){var E,T=x.value;b.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 P;A==null||(P=A.onDragLeave)===null||P===void 0||P.call(A,L)}}}catch($){v.e($)}finally{v.f()}var z=Lv(w.location.current.dropTargets),H;try{for(z.s();!(H=z.n()).done;){var q,I,K=H.value;if(!b.has(K.element)){var Y=to(to({},w),{},{self:K}),V=s.get(K.element);V==null||(q=V.onDropTargetChange)===null||q===void 0||q.call(V,Y),V==null||(I=V.onDragEnter)===null||I===void 0||I.call(V,Y)}}}catch($){z.e($)}finally{z.f()}}};function f(S){p[S.eventName](S)}function g(S){var C=S.source,w=S.target,y=S.input,b=S.current,v=l({source:C,target:w,input:y});if(v.length>=b.length)return v;for(var x=Av(b),E=Av(v),T=[],A=0;A<x.length;A++){var M,L=x[A],P=E[A];if(P!=null){T.push(P);continue}var z=T[A-1],H=x[A-1];if(z?.element!==H?.element)break;var q=s.get(L.element);if(!q)break;var I={input:y,source:C,element:q.element};if(q.canDrop&&!q.canDrop(I)||!((M=q.getIsSticky)!==null&&M!==void 0&&M.call(q,I)))break;T.push(to(to({},L),{},{isActiveDueToStickiness:!0}))}return Av(T)}return{dropTargetForConsumers:a,getIsOver:g,dispatchEvent:f}}function P7(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=j7(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.
39
- 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 j7(e,t){if(e){if(typeof e=="string")return cw(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)?cw(e,t):void 0}}function cw(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 uw(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 I7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uw(Object(n),!0).forEach(function(s){pd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function N7(){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=I7({},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=P7(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 B7(e){var t=e.typeKey,n=e.mount,s=e.dispatchEventToSource,o=e.onPostDispatch,u=e.defaultDropEffect,h=N7(),a=D7({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;ow.start({event:g,dragType:S,getDropTargetsOver:a.getIsOver,dispatchEvent:l})}function p(){function f(){var g={canStart:ow.canStart,start:d};return n(g)}return O7({typeKey:t,mount:f})}return{registerUsage:p,dropTarget:a.dropTargetForConsumers,monitor:h.monitorForConsumers}}var iT=Ha(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),z7="pdnd:android-fallback",dw="text/plain",H7="text/uri-list",V7="application/vnd.pdnd",qh=new WeakMap;function F7(e){return qh.set(e.element,e),function(){qh.delete(e.element)}}var fw=p7(),ty=B7({typeKey:"element",defaultDropEffect:"move",mount:function(t){return Lp(fw.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=eT({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,b=Object.entries(w);y<b.length;y++){var v=XR(b[y],2),x=v[0],E=v[1];s.dataTransfer.setData(x,E??"")}iT()&&!s.dataTransfer.types.includes(dw)&&!s.dataTransfer.types.includes(H7)&&s.dataTransfer.setData(dw,z7),s.dataTransfer.setData(V7,"");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:fw.getOnPostDispatch()}),ny=ty.dropTarget,oT=ty.monitor;function U7(e){var t=Lp(ty.registerUsage(),F7(e),sT(e.element,{attribute:"draggable",value:"true"}));return Ha(t)}function hw(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 pw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hw(Object(n),!0).forEach(function(s){pd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var W7={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)}},aT=Symbol("closestEdge");function q7(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:W7[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 pw(pw({},e),{},pd({},aT,p))}function w_(e){var t;return(t=e[aT])!==null&&t!==void 0?t:null}function G7(){return{x:0,y:0}}function $7(e){var t=e.render,n=e.nativeSetDragImage,s=e.getOffset,o=s===void 0?G7:s,u=document.createElement("div");Object.assign(u.style,{position:"fixed",top:0,left:0,zIndex:tT,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=oT({onDragStart:a,onDrop:a})}var K7=Ha(function(){return md()&&"ontouchend"in document}),Y7=function(t){var n=t.container,s=n.getBoundingClientRect();return{x:s.width/2,y:s.height/2}};function X7(e){return function(n){var s=n.container;if(K7()||iT())return Y7({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 lT=R.forwardRef(({className:e,...t},n)=>_.jsx(W9,{ref:n,className:Be("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(q9,{className:"flex items-center justify-center",children:_.jsx(_e,{icon:Ma,size:12,strokeWidth:3})})}));lT.displayName="Checkbox";const cT=R.createContext(null);function Q7({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(cT.Provider,{value:{selectMode:t,setSelectMode:n,selectedIds:s,isSelected:d,toggle:u,selectAll:h,clearSelection:a,exitSelectMode:l,selectedCount:s.size},children:e})}function uT(){const e=R.useContext(cT);if(!e)throw new Error("useSelection must be used within a SelectionProvider");return e}const dT=R.createContext(null);function Z7({children:e}){const[t,n]=R.useState(null);return _.jsx(dT.Provider,{value:{activeTask:t,setActiveTask:n},children:e})}function fT(){const e=R.useContext(dT);if(!e)throw new Error("useDrag must be used within DragProvider");return e}function J7(e){return e.match(/\/issue\/([A-Z]+-\d+)/i)?.[1]??null}function hT({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 b=l.trim();b!==(e.prUrl||"")&&(C.prUrl=b||null);const v=p.trim();v!==(e.linearTicketUrl||"")&&(C.linearTicketUrl=v||null,C.linearTicketId=v?J7(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(gk,{id:"config-description",value:h,onValueChange:a,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(Ne,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),_.jsx(Ne,{onClick:g,disabled:!o.trim(),children:"Save"})]})]})})}function pT({task:e,isDragPreview:t}){const{selectMode:n,isSelected:s,toggle:o}=uT(),{setActiveTask:u}=fT(),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),b=R.useRef(!1);R.useEffect(()=>{const T=l.current;if(!(!T||n||t))return Lp(U7({element:T,getInitialData:()=>({type:"task",taskId:e.id,status:e.status}),onGenerateDragPreview:({nativeSetDragImage:A})=>{$7({nativeSetDragImage:A,getOffset:X7({x:"16px",y:"8px"}),render:({container:M})=>{C(M)}})},onDragStart:()=>{p(!0),u(e),b.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 q7(L,{input:A,element:M,allowedEdges:["top","bottom"]})},canDrop:({source:A})=>A.data.taskId!==e.id,onDragEnter:({self:A})=>{g(w_(A.data))},onDrag:({self:A})=>{g(w_(A.data))},onDragLeave:()=>{g(null)},onDrop:()=>{g(null)}}))},[e,n,t,u]);const v=()=>{b.current=!1},x=T=>{if(n){T.preventDefault(),o(e.id);return}b.current||a({to:"/tasks/$taskId",params:{taskId:e.id}}),b.current=!1},E=_.jsxs(fd,{ref:t?void 0:l,onPointerDown:v,onClick:x,className:Be("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:Be("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(lT,{checked:h,className:"cursor-pointer pointer-events-none"})}),_.jsxs($I,{className:Be("p-3 pb-1 flex flex-row items-start justify-between gap-2",n&&"pr-8"),children:[_.jsx(KI,{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:rE,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:s0,size:12,strokeWidth:2,className:"text-foreground"})]}),e.linearTicketId&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-muted-foreground/30",children:"•"}),_.jsx(_e,{icon:i0,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(pT,{task:e,isDragPreview:!0})}),S),_.jsx(hT,{task:e,open:w,onOpenChange:y})]})}const eB={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},tB={IN_PROGRESS:"border-t-slate-400",IN_REVIEW:"border-t-violet-400",DONE:"border-t-emerald-400",CANCELED:"border-t-rose-500"};function mw({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:Be("flex flex-col rounded-lg border border-t-4 bg-card",n?"h-full w-full":"h-full w-72 min-w-52 flex-shrink",tB[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:eB[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(pT,{task:a},a.id))})})]})}const Ov=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED"],mT={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"};function nB({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:Be("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:mT[e]})}function rB({repoFilter:e}){const{data:t=[],isLoading:n}=U0(),s=Jj(),{activeTask:o}=fT(),[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(()=>oT({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 b=a.filter(v=>v.status===y);s.mutate({taskId:g,status:y,position:b.length})}}else if(w.type==="task"){const y=w_(C.data),b=w.status,v=a.filter(T=>T.status===b).sort((T,A)=>T.position-A.position),x=v.findIndex(T=>T.id===w.taskId);let E=x;y==="bottom"&&(E=x+1),S.status===b&&v.findIndex(A=>A.id===g)<x&&(E=Math.max(0,E-1)),(S.status!==b||E!==S.position)&&s.mutate({taskId:g,status:b,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:Ov.map(d=>_.jsxs(ir,{value:d,className:"gap-1.5",children:[_.jsx("span",{className:"truncate",children:mT[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:Ov.map(d=>_.jsx(mw,{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(mw,{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:Ov.filter(d=>d!==u).map(d=>_.jsx(nB,{status:d},d))})]})}function sB(e){return _.jsx(Z7,{children:_.jsx(rB,{...e})})}const iB=ws("/tasks/")({component:oB});function oB(){return _.jsx(Q7,{children:_.jsx(aB,{})})}function aB(){const{selectMode:e,setSelectMode:t,selectedIds:n,selectedCount:s,exitSelectMode:o}=uT(),u=tI(),{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(Ne,{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(Ne,{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(SR,{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(jl,{value:a??"",onValueChange:f=>l(f||null),children:[_.jsxs(Nl,{size:"sm",className:"max-sm:w-auto",children:[_.jsx(_e,{icon:eE,size:12,strokeWidth:2,className:"text-muted-foreground"}),_.jsx(Il,{children:a||"All Repos"})]}),_.jsxs(Bl,{children:[_.jsx(vr,{value:"",children:"All Repos"}),d.map(f=>_.jsx(vr,{value:f,children:f},f))]})]}),_.jsxs(Ne,{variant:"ghost",size:"sm",onClick:()=>t(!0),className:"max-sm:px-2",children:[_.jsx(_e,{icon:l4,size:14,strokeWidth:2,"data-slot":"icon"}),_.jsx("span",{className:"max-sm:hidden",children:"Select"})]})]})]})}),_.jsx("div",{className:"flex-1 overflow-hidden",children:_.jsx(sB,{repoFilter:a})})]})}const lB=ws("/settings/")({component:cB});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 cB(){const{data:e,isLoading:t}=uI(),{data:n,isLoading:s}=q0(),{data:o,isLoading:u}=pR(),{data:h,isLoading:a}=Rp(),{data:l,isLoading:d}=Tp(),{data:p,isLoading:f}=dI(),{data:g,isLoading:S}=fI(),{data:C,isLoading:w}=mI(),y=hI(),b=pI(),v=gI(),x=vI(),[E,T]=R.useState(""),[A,M]=R.useState(""),[L,P]=R.useState(""),[z,H]=R.useState(""),[q,I]=R.useState(""),[K,Y]=R.useState(""),[V,$]=R.useState(""),[G,j]=R.useState(!1),[U,D]=R.useState(!1),[N,W]=R.useState(!1),[Z,ee]=R.useState(!1),[te,X]=R.useState(!1),[F,se]=R.useState(""),[ne,re]=R.useState(!1),[oe,le]=R.useState(""),[ve,ge]=R.useState(!1),[ue,de]=R.useState(""),[Ie,De]=R.useState("");R.useEffect(()=>{e!==void 0&&T(String(e)),n!==void 0&&M(n),o!==void 0&&P(o),h!==void 0&&H(h),l!==void 0&&I(String(l)),p!==void 0&&Y(p),g!==void 0&&$(g)},[e,n,o,h,l,p,g]),R.useEffect(()=>{C&&(W(C.enabled),ee(C.sound?.enabled??!1),X(C.slack?.enabled??!1),se(C.slack?.webhookUrl??""),re(C.discord?.enabled??!1),le(C.discord?.webhookUrl??""),ge(C.pushover?.enabled??!1),de(C.pushover?.appToken??""),De(C.pushover?.userKey??""))},[C]);const Oe=t||s||u||a||d||f||S||w,be=C&&(N!==C.enabled||Z!==(C.sound?.enabled??!1)||te!==(C.slack?.enabled??!1)||F!==(C.slack?.webhookUrl??"")||ne!==(C.discord?.enabled??!1)||oe!==(C.discord?.webhookUrl??"")||ve!==(C.pushover?.enabled??!1)||ue!==(C.pushover?.appToken??"")||Ie!==(C.pushover?.userKey??"")),Me=E!==String(e)||A!==n||L!==o||z!==h||q!==String(l)||K!==p||V!==g||be,pe=async()=>{const Se=[];if(E!==String(e)){const He=parseInt(E,10);!isNaN(He)&&He>=1&&He<=65535&&Se.push(new Promise(ke=>{y.mutate({key:sn.PORT,value:He},{onSettled:ke})}))}if(A!==n&&Se.push(new Promise(He=>{y.mutate({key:sn.DEFAULT_GIT_REPOS_DIR,value:A},{onSettled:He})})),L!==o&&Se.push(new Promise(He=>{y.mutate({key:sn.TASK_CREATION_COMMAND,value:L},{onSettled:He})})),z!==h&&Se.push(new Promise(He=>{y.mutate({key:sn.HOSTNAME,value:z},{onSettled:He})})),q!==String(l)){const He=parseInt(q,10);!isNaN(He)&&He>=1&&He<=65535&&Se.push(new Promise(ke=>{y.mutate({key:sn.SSH_PORT,value:He},{onSettled:ke})}))}K!==p&&Se.push(new Promise(He=>{y.mutate({key:sn.LINEAR_API_KEY,value:K},{onSettled:He})})),V!==g&&Se.push(new Promise(He=>{y.mutate({key:sn.GITHUB_PAT,value:V},{onSettled:He})})),be&&Se.push(new Promise(He=>{v.mutate({enabled:N,sound:{enabled:Z},slack:{enabled:te,webhookUrl:F},discord:{enabled:ne,webhookUrl:oe},pushover:{enabled:ve,appToken:ue,userKey:Ie}},{onSettled:He})})),await Promise.all(Se),D(!0),setTimeout(()=>D(!1),2e3)},Re=()=>{b.mutate(sn.PORT,{onSuccess:Se=>{Se.value!==null&&T(String(Se.value))}})},we=()=>{b.mutate(sn.DEFAULT_GIT_REPOS_DIR,{onSuccess:Se=>{Se.value&&M(String(Se.value))}})},We=()=>{b.mutate(sn.TASK_CREATION_COMMAND,{onSuccess:Se=>{Se.value!==null&&Se.value!==void 0&&P(String(Se.value))}})},et=()=>{b.mutate(sn.HOSTNAME,{onSuccess:Se=>{Se.value!==null&&Se.value!==void 0&&H(String(Se.value))}})},xe=()=>{b.mutate(sn.SSH_PORT,{onSuccess:Se=>{Se.value!==null&&Se.value!==void 0&&I(String(Se.value))}})},Ge=()=>{b.mutate(sn.LINEAR_API_KEY,{onSuccess:Se=>{Y(Se.value!==null&&Se.value!==void 0?String(Se.value):"")}})},tt=()=>{b.mutate(sn.GITHUB_PAT,{onSuccess:Se=>{$(Se.value!==null&&Se.value!==void 0?String(Se.value):"")}})},dt=async Se=>{x.mutate(Se,{onSuccess:He=>{He.success?yr.success(`${Se} test successful`):yr.error(`${Se} test failed: ${He.error}`)},onError:He=>{yr.error(`Test failed: ${He.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:Se=>T(Se.target.value),placeholder:"3333",disabled:Oe,className:"w-24 font-mono text-sm"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Re,disabled:Oe||b.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:Se=>P(Se.target.value),placeholder:"claude --dangerously-skip-permissions",disabled:Oe,className:"flex-1 font-mono text-sm"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:We,disabled:Oe||b.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:Se=>M(Se.target.value),placeholder:"~/projects",disabled:Oe,className:"flex-1 font-mono text-sm"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>j(!0),disabled:Oe,title:"Browse",children:_.jsx(_e,{icon:os,size:14,strokeWidth:2})}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:we,disabled:Oe||b.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:z,onChange:Se=>H(Se.target.value),placeholder:"e.g., citadel",disabled:Oe,className:"flex-1 font-mono text-sm"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:et,disabled:Oe||b.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:Se=>I(Se.target.value),placeholder:"22",disabled:Oe,className:"w-20 font-mono text-sm"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:xe,disabled:Oe||b.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:Se=>Y(Se.target.value),placeholder:"lin_api_...",disabled:Oe,className:"flex-1 font-mono text-sm"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ge,disabled:Oe||b.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:V,onChange:Se=>$(Se.target.value),placeholder:"ghp_...",disabled:Oe,className:"flex-1 font-mono text-sm"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:tt,disabled:Oe||b.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:N,onCheckedChange:W,disabled:Oe})]}),_.jsx("div",{className:"space-y-2 pl-4",children:_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ea,{checked:Z,onCheckedChange:ee,disabled:Oe||!N}),_.jsx("label",{className:"text-sm text-muted-foreground",children:"Sound (macOS only)"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("sound"),disabled:Oe||!N||!Z||x.isPending,title:"Test sound",children:x.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:te,onCheckedChange:X,disabled:Oe||!N}),_.jsx("label",{className:"text-sm text-muted-foreground",children:"Slack"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("slack"),disabled:Oe||!N||!te||!F||x.isPending,title:"Test Slack",children:x.isPending?_.jsx(_e,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}):_.jsx(_e,{icon:zf,size:14,strokeWidth:2})})]}),te&&_.jsx(Wt,{type:"password",value:F,onChange:Se=>se(Se.target.value),placeholder:"https://hooks.slack.com/services/...",disabled:Oe||!N,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:Oe||!N}),_.jsx("label",{className:"text-sm text-muted-foreground",children:"Discord"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("discord"),disabled:Oe||!N||!ne||!oe||x.isPending,title:"Test Discord",children:x.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:Se=>le(Se.target.value),placeholder:"https://discord.com/api/webhooks/...",disabled:Oe||!N,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:ge,disabled:Oe||!N}),_.jsx("label",{className:"text-sm text-muted-foreground",children:"Pushover"}),_.jsx(Ne,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("pushover"),disabled:Oe||!N||!ve||!ue||!Ie||x.isPending,title:"Test Pushover",children:x.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:ue,onChange:Se=>de(Se.target.value),placeholder:"App Token",disabled:Oe||!N,className:"flex-1 font-mono text-sm"}),_.jsx(Wt,{type:"password",value:Ie,onChange:Se=>De(Se.target.value),placeholder:"User Key",disabled:Oe||!N,className:"flex-1 font-mono text-sm"})]})]})]})}),_.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[U&&_.jsxs("span",{className:"flex items-center gap-1 text-xs text-emerald-500",children:[_.jsx(_e,{icon:Ma,size:12,strokeWidth:2}),"Saved"]}),_.jsx(Ne,{size:"sm",onClick:pe,disabled:!Me||Oe||y.isPending,children:"Save Changes"})]})]})}),_.jsx($0,{open:G,onOpenChange:j,onSelect:Se=>M(Se),initialPath:A||void 0})]})}const Ap="";function uB(){return Kn({queryKey:["github-user"],queryFn:async()=>{const e=await fetch(`${Ap}/api/github/user`);return e.ok?e.json():null},staleTime:600*1e3,retry:!1})}function dB(){return Kn({queryKey:["github-orgs"],queryFn:async()=>{const e=await fetch(`${Ap}/api/github/orgs`);return e.ok?e.json():[]},staleTime:600*1e3})}function fB(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(`${Ap}/api/github/issues?${s}`);if(!o.ok)throw new Error("Failed to fetch issues");return o.json()},staleTime:300*1e3})}function hB(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(`${Ap}/api/github/prs?${s}`);if(!o.ok)throw new Error("Failed to fetch PRs");return o.json()},staleTime:300*1e3})}function pB({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=fB(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(mB,{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 mB({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 gB({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=hB(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(vB,{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 vB({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:Be("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 _B=ws("/review/")({component:yB});function yB(){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}=uB(),{data:g=[]}=dB();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:y4,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(Ne,{variant:"outline",size:"sm",className:"w-full",children:[_.jsx(_e,{icon:b4,size:14,"data-slot":"icon"}),"Generate Token"]})}),_.jsx(qn,{to:"/settings",children:_.jsx(Ne,{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(jl,{value:n,onValueChange:S=>s(S),children:[_.jsx(Nl,{size:"sm",className:"max-sm:w-auto",children:_.jsx(Il,{})}),_.jsxs(Bl,{children:[_.jsx(vr,{value:"created",children:"Created by me"}),_.jsx(vr,{value:"assigned",children:"Assigned to me"}),_.jsx(vr,{value:"review_requested",children:"Review requests"}),_.jsx(vr,{value:"mentioned",children:"Mentioned"})]})]}):_.jsxs(jl,{value:o,onValueChange:S=>u(S),children:[_.jsx(Nl,{size:"sm",className:"max-sm:w-auto",children:_.jsx(Il,{})}),_.jsxs(Bl,{children:[_.jsx(vr,{value:"assigned",children:"Assigned to me"}),_.jsx(vr,{value:"created",children:"Created by me"}),_.jsx(vr,{value:"mentioned",children:"Mentioned"})]})]}),_.jsxs(jl,{value:l,onValueChange:S=>d(S||""),children:[_.jsx(Nl,{size:"sm",className:"max-sm:w-auto",children:_.jsx(Il,{children:l||"All Orgs"})}),_.jsxs(Bl,{children:[_.jsx(vr,{value:"",children:"All Organizations"}),g.map(S=>_.jsx(vr,{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(gB,{filter:n,viboraReposOnly:h,org:l||void 0})}),_.jsx(_r,{value:"issues",className:"flex-1 overflow-auto p-4",children:_.jsx(pB,{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 bB=ws("/repositories/")({component:CB});function xB({repository:e,onDelete:t}){const[n,s]=R.useState(!1),[o,u]=R.useState(!1),{data:h}=Rp(),{data:a}=Tp(),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 _.jsxs("div",{className:"relative h-full",children:[_.jsx(qn,{to:"/repositories/$repoId",params:{repoId:e.id},className:"block h-full",children:_.jsx(fd,{className:"h-full 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:[_.jsx("span",{className:"min-w-0 truncate font-medium",children:e.displayName}),_.jsxs("div",{className:"flex shrink-0 gap-1",children:[_.jsx("div",{className:"size-6"}),_.jsx("div",{className:"size-6"})]})]}),_.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:r0,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:d4,size:12,strokeWidth:2,className:"shrink-0"}),_.jsx("span",{className:"truncate font-mono",children:e.copyFiles})]})]})]})})}),_.jsxs("div",{className:"absolute right-3 top-3 flex gap-1",children:[_.jsx(Ne,{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:o0,size:14,strokeWidth:2})}),_.jsxs(uc,{open:n,onOpenChange:s,children:[_.jsx(dc,{render:_.jsx(Ne,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive"}),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(Ne,{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"]})]})]})]})]})]})}function SB(){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=mR(),{data:S}=q0(),C=b=>{u(b),h||a(b.split("/").pop()||"")},w=b=>{b.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(pk,{render:_.jsx(Ne,{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(Ne,{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:b=>a(b.target.value),placeholder:y||"My Project"})]}),_.jsxs(Cn,{children:[_.jsx(wn,{htmlFor:"startupScript",children:"Startup Script"}),_.jsx(T0,{id:"startupScript",value:l,onChange:b=>d(b.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:b=>f(b.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(R0,{render:_.jsx(Ne,{variant:"outline",type:"button"}),children:"Cancel"}),_.jsx(Ne,{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 CB(){const{data:e,isLoading:t,error:n}=G0(),s=gR(),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(SB,{})]}),_.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 auto-rows-fr grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:e?.map(u=>_.jsx(xB,{repository:u,onDelete:()=>o(u.id)},u.id))})]})]})}const wB=()=>`http://${window.location.hostname}:3000`,Cu={activeTab:"diff",browserUrl:wB(),diffOptions:{wrap:!0,ignoreWhitespace:!0,includeUntracked:!1},filesViewState:{selectedFile:null,expandedDirs:[]}};function Op(e){const t=$n(),n=R.useRef(void 0),s=R.useRef({}),{data:o}=fR(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=jn({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(b=>b.id===e?{...b,viewState:w}:b)),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 EB(e){const{viewState:t,setActiveTab:n}=Op(e);return{tab:t.activeTab,setTab:n}}function kB(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 gw({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}=pR(),{setTerminalFocused:y}=K0(),{terminals:b,terminalsLoaded:v,connected:x,newTerminalIds:E,createTerminal:T,attachXterm:A,resizeTerminal:M,setupImagePaste:L,writeToTerminal:P}=ey(),z=f?b.find(I=>I.id===f):null,H=z?.status;R.useEffect(()=>{if(!h.current||a.current)return;const I=new zR.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 HR.FitAddon,Y=new VR.WebLinksAddon;I.loadAddon(K),I.loadAddon(Y),I.open(h.current),a.current=I,l.current=K,requestAnimationFrame(()=>{K.fit(),C(!0)});const V=setTimeout(()=>{K.fit(),I.refresh(0,I.rows-1)},100),$=()=>y(!0),G=()=>y(!1);return I.textarea&&(I.textarea.addEventListener("focus",$),I.textarea.addEventListener("blur",G)),()=>{clearTimeout(V),I.textarea&&(I.textarea.removeEventListener("focus",$),I.textarea.removeEventListener("blur",G)),y(!1),I.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:I,rows:K}=a.current;f&&M(f,I,K)},[f,M]);return R.useEffect(()=>{if(!h.current)return;const I=()=>{requestAnimationFrame(q)};window.addEventListener("resize",I);const K=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{q(),a.current&&a.current.refresh(0,a.current.rows-1)})};document.addEventListener("visibilitychange",K);const Y=new ResizeObserver(I);Y.observe(h.current);const V=new IntersectionObserver($=>{$[0]?.isIntersecting&&requestAnimationFrame(()=>{q(),a.current&&a.current.refresh(0,a.current.rows-1)})},{threshold:.1});return V.observe(h.current),()=>{window.removeEventListener("resize",I),document.removeEventListener("visibilitychange",K),Y.disconnect(),V.disconnect()}},[q]),R.useEffect(()=>{if(!x||!t||!S||!v)return;const I=b.find(K=>K.cwd===t);if(I){g(I.id);return}if(!d.current&&a.current){d.current=!0;const{cols:K,rows:Y}=a.current;T({name:e,cols:K,rows:Y,cwd:t})}},[x,t,S,v,b,e,T]),R.useEffect(()=>{if(!t||f)return;const I=b.find(K=>K.cwd===t);I&&g(I.id)},[b,t,f]),R.useEffect(()=>{if(!f||!a.current||!h.current||p.current)return;const I=E.has(f);I&&E.delete(f);const K=()=>{if(requestAnimationFrame(q),I){u&&setTimeout(()=>{P(f,u+"\r")},100);let $=w;s==="plan"&&o?$=`claude "${`${e}: ${o}`.replace(/"/g,'\\"')}" --allow-dangerously-skip-permissions --permission-mode plan`:s==="default"&&o&&($=`claude "${`${e}: ${o}`.replace(/"/g,'\\"')}" --dangerously-skip-permissions`),$&&setTimeout(()=>{P(f,$+"\r")},u?300:100)}},Y=A(f,a.current,{onAttached:K}),V=L(h.current,f);return p.current=!0,()=>{Y(),V(),p.current=!1}},[f,A,L,t,q,w,P,s,o,e,u,E]),t?_.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!x&&_.jsx("div",{className:"shrink-0 px-2 py-1 bg-yellow-500/20 text-yellow-500 text-xs",children:"Connecting to terminal server..."}),H==="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."}),H==="exited"&&_.jsxs("div",{className:"shrink-0 px-2 py-1 bg-muted text-muted-foreground text-xs",children:["Terminal exited (code: ",z?.exitCode,")"]}),_.jsxs("div",{className:"relative flex-1",children:[_.jsx("div",{ref:h,className:Be("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:X2,size:20,strokeWidth:2})})]})]}):_.jsx("div",{className:Be("flex h-full items-center justify-center bg-[#0a0a0a] text-muted-foreground text-sm",n),children:"No worktree path configured for this task"})}function RB(e){const{viewState:t,setDiffOptions:n}=Op(e);return{options:t.diffOptions,setOption:(s,o)=>{n({[s]:o})},setOptions:n}}function TB(e){const t=[];let n=0,s=0;for(const o of e.split(`
40
- `))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 vw({taskId:e,worktreePath:t}){const{options:n,setOption:s}=RB(e),{wrap:o,ignoreWhitespace:u,includeUntracked:h}=n,{data:a,isLoading:l,error:d}=sI(t,{ignoreWhitespace:u,includeUntracked:h}),p=R.useMemo(()=>a?.diff?TB(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:Be("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:Be("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:Be("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:Be("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 LB(e){const{viewState:t,setBrowserUrl:n}=Op(e);return{url:t.browserUrl,setUrl:n}}function _w({taskId:e}){const{url:t,setUrl:n}=LB(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(Ne,{variant:"ghost",size:"icon-xs",disabled:!0,children:_.jsx(_e,{icon:o4,size:14,strokeWidth:2})}),_.jsx(Ne,{variant:"ghost",size:"icon-xs",disabled:!0,children:_.jsx(_e,{icon:Q2,size:14,strokeWidth:2})}),_.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:a,children:_.jsx(_e,{icon:w4,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 AB(e){const{viewState:t,setFilesViewState:n}=Op(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 OB(e){const t=e.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","svg","webp","ico"].includes(t)?v4:["ts","tsx","js","jsx","json","css","html","md","yaml","yml","toml","sh","py","rs","go","sql"].includes(t)?f4:h4}function gT({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:Be("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?s_:os:OB(e.name),size:14,strokeWidth:2,className:Be("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(gT,{entry:p,depth:t+1,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u},p.path))})]})}function yw({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:S4,size:14,strokeWidth:2})})]}),_.jsx("div",{className:"py-1 flex-1 overflow-auto",children:e.map(h=>_.jsx(gT,{entry:h,depth:0,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o},h.path))})]})}const MB="modulepreload",DB=function(e){return"/"+e},bw={},J=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=DB(p),p in bw)return;bw[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":MB,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 PB(e){return ry(e)}function ry(e){return Array.isArray(e)?jB(e):e instanceof RegExp?e:typeof e=="object"?IB(e):e}function jB(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=ry(e[n]);return t}function IB(e){let t={};for(let n in e)t[n]=ry(e[n]);return t}function vT(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function _T(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?_T(e.substring(0,e.length-1)):e.substr(~t+1)}var Mv=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,sh=class{static hasCaptures(e){return e===null?!1:(Mv.lastIndex=0,Mv.test(e))}static replaceCaptures(e,t,n){return e.replace(Mv,(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 yT(e,t){return e<t?-1:e>t?1:0}function bT(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=yT(e[o],t[o]);if(u!==0)return u}return 0}return n-s}function xw(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 xT(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ST=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(zB(e),t)}static createFromParsedTheme(e,t){return VB(e,t)}_cachedMatchRoot=new ST(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=>NB(e.parent,o.parentScopes));return s?new CT(s.fontStyle,s.foreground,s.background):null}},Dv=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 NB(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&&!BB(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function BB(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var CT=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function zB(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"&&xw(h.settings.foreground)&&(d=h.settings.foreground);let p=null;typeof h.settings.background=="string"&&xw(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 HB(w,y,o,l,d,p)}}return n}var HB=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 VB(e,t){e.sort((l,d)=>{let p=yT(l.scope,d.scope);return p!==0||(p=bT(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 FB(t),h=new CT(n,u.getId(s),u.getId(o)),a=new WB(new E_(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 FB=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)}},UB=Object.freeze([]),E_=class wT{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,s,o,u){this.scopeDepth=t,this.parentScopes=n||UB,this.fontStyle=s,this.foreground=o,this.background=u}clone(){return new wT(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)}},WB=class k_{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(k_._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 k_(this._mainRule.clone(),E_.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(bT(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 E_(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=qB(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(Sw(o)){const l=[];do l.push(o),o=s.next();while(Sw(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 Sw(e){return!!e&&!!e.match(/[\w\.:]+/)}function qB(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 ET(e){typeof e.dispose=="function"&&e.dispose()}var Yu=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},GB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},$B=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))}},KB=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 $B;for(const n of e)YB(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 YB(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):R_(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 R_(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?vT({},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=kT(u);switch(h.kind){case 0:vh({...t,selfGrammar:t.baseGrammar},n);break;case 1:vh(t,n);break;case 2:R_(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?R_(h.ruleName,l,n):vh(l,n)}else h.kind===4?n.add(new GB(h.scopeName,h.ruleName)):n.add(new Yu(h.scopeName));break}}}var XB=class{kind=0},QB=class{kind=1},ZB=class{constructor(e){this.ruleName=e}kind=2},JB=class{constructor(e){this.scopeName=e}kind=3},ez=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function kT(e){if(e==="$base")return new XB;if(e==="$self")return new QB;const t=e.indexOf("#");if(t===-1)return new JB(e);if(t===0)return new ZB(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new ez(n,s)}}var tz=/\\(\d+)/,Cw=/\\(\d+)/g,nz=-1,RT=-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?`${_T(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)}},rz=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!")}},sz=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}},ww=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}},T_=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,RT),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}},TT=class Qn{static createCaptureRule(t,n,s,o,u){return t.registerRule(h=>new rz(n,h,s,o,u))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new sz(t.$vscodeTextmateLocation,t.id,t.name,t.match,Qn._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=vT({},s,t.repository));let u=t.patterns;return typeof u>"u"&&t.include&&(u=[{include:t.include}]),new ww(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 T_(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=kT(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 ww||d instanceof T_||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 LT{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=tz.test(this.source):this.hasBackReferences=!1}clone(){return new LT(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 Cw.lastIndex=0,this.source.replace(Cw,(o,u)=>xT(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 Ew(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 Ew(e,s,this._items.map(o=>o.ruleId))}},Ew=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(`
41
- `)}findNextMatchSync(e,t,n){const s=this.scanner.findNextMatchSync(e,t,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},Pv=class{constructor(e,t){this.languageId=e,this.tokenType=t}},iz=class L_{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Pv(t,8),this._embeddedLanguagesMatcher=new oz(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?L_._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Pv(0,0);_getBasicScopeAttributes=new ST(t=>{const n=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new Pv(n,s)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(L_.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/},oz=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])=>xT(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])}},kw=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function AT(e,t,n,s,o,u,h,a){const l=t.content.length;let d=!1,p=-1;if(h){const S=az(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 kw(o,!0);g()}return new kw(o,!1);function g(){const S=lz(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===nz){const b=o.getRule(e);u.produce(o,C[0].start),o=o.withContentNameScopesList(o.nameScopesList),Tu(e,t,n,o,u,b.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 b=e.getRule(w);u.produce(o,C[0].start);const v=o,x=b.getName(t.content,C),E=o.contentNameScopesList.pushAttributed(x,e);if(o=o.push(w,s,p,C[0].end===l,null,E,E),b instanceof T_){const T=b;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(b instanceof Xh){const T=b;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,b.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 az(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}=dz(l.rule,e,l.stack.endRule,n,s===h),f=d.findNextMatchSync(t,s,p);if(f){if(f.ruleId!==RT){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 lz(e,t,n,s,o,u){const h=cz(e,t,n,s,o,u),a=e.getInjections();if(a.length===0)return h;const l=uz(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 cz(e,t,n,s,o,u){const h=o.getRule(e),{ruleScanner:a,findOptions:l}=OT(h,e,o.endRule,n,s===u),d=a.findNextMatchSync(t,s,l);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function uz(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:b}=OT(w,t,null,s,o===h),v=y.findNextMatchSync(n,o,b);if(!v)continue;const x=v.captureIndices[0].start;if(!(x>=a)&&(a=x,l=v.captureIndices,d=v.ruleId,p=C.priority,a===o))break}return l?{priorityMatch:p===-1,captureIndices:l,matchedRuleId:d}:null}function OT(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function dz(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),b=g.getContentName(a,h),v=y.pushAttributed(b,e),x=s.push(g.retokenizeCapturedWithRuleId,S.start,-1,!1,null,y,v),E=e.createOnigString(a.substring(0,S.end));AT(e,E,n&&S.start===0,S.start,x,o,!1,0),ET(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 fz(y,S.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var fz=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function hz(e,t,n,s,o,u,h,a){return new mz(e,t,n,s,o,u,h,a)}function Rw(e,t,n,s,o){const u=Kh(t,Qh),h=TT.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(pz(t[o],s))return n=o+1,!0;return!1})}function pz(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 mz=class{constructor(e,t,n,s,o,u,h,a){if(this._rootScopeName=e,this.balancedBracketSelectors=u,this._onigLib=a,this._basicScopeAttributesProvider=new iz(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=h,this._grammar=Tw(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)Rw(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&&Rw(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]=Tw(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=TT.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===A_.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=ju.createRootAndLookUpScopeName(g,f,this):S=ju.createRoot("unknown",f),t=new A_(null,this._rootId,-1,-1,!1,null,S,S)}else o=!1,t.reset();e=e+`
42
- `;const u=this.createOnigString(e),h=u.content.length,a=new vz(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=AT(this,u,o,0,t,a,!0,s);return ET(u),{lineLength:h,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Tw(e,t){return e=PB(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 ju=class js{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=Dv.push(o,u.scopeNames),s=new js(s,o,u.encodedTokenAttributes);return s}static createRoot(t,n){return new js(null,new Dv(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),u=new Dv(null,t),h=s.themeProvider.themeMatch(u),a=js.mergeAttributes(n,o,h);return new js(null,u,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return js.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 js._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const u of s)o=js._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=js.mergeAttributes(t.tokenAttributes,o,h);return new js(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}},A_=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)?ju.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=ju.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Zo(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,ju.fromExtension(s,n.contentNameScopesList))}},gz=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}},vz=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}},_z=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,hz(e,u,t,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},yz=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new _z($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 gz(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,u){const h=new KB(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)}},O_=A_.NULL;const bz=["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 MT(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 M_(e){return e.toLowerCase()}class Cr{constructor(t,n){this.attribute=n,this.property=t}}Cr.prototype.attribute="";Cr.prototype.booleanish=!1;Cr.prototype.boolean=!1;Cr.prototype.commaOrSpaceSeparated=!1;Cr.prototype.commaSeparated=!1;Cr.prototype.defined=!1;Cr.prototype.mustUseProperty=!1;Cr.prototype.number=!1;Cr.prototype.overloadedBoolean=!1;Cr.prototype.property="";Cr.prototype.spaceSeparated=!1;Cr.prototype.space=void 0;let xz=0;const yt=Va(),Sn=Va(),D_=Va(),je=Va(),Kt=Va(),zl=Va(),jr=Va();function Va(){return 2**++xz}const P_=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Sn,commaOrSpaceSeparated:jr,commaSeparated:zl,number:je,overloadedBoolean:D_,spaceSeparated:Kt},Symbol.toStringTag,{value:"Module"})),jv=Object.keys(P_);class sy extends Cr{constructor(t,n,s,o){let u=-1;if(super(t,n),Lw(this,"space",o),typeof s=="number")for(;++u<jv.length;){const h=jv[u];Lw(this,jv[u],(s&P_[h])===P_[h])}}}sy.prototype.defined=!0;function Lw(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[M_(s)]=s,n[M_(u.attribute)]=s}return new vd(t,n,e.space)}const DT=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 PT(e,t){return t in e?e[t]:t}function jT(e,t){return PT(e,t.toLowerCase())}const Sz=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:D_,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:D_,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:jT}),Cz=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:jr,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:jr,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:jr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jr,rev:jr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jr,requiredFeatures:jr,requiredFonts:jr,requiredFormats:jr,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:jr,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:jr,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:jr,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:PT}),IT=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()}}),NT=yc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jT}),BT=yc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wz=/[A-Z]/g,Aw=/-[a-z]/g,Ez=/^data[-\w.:]+$/i;function kz(e,t){const n=M_(t);let s=t,o=Cr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ez.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Aw,Tz);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Aw.test(u)){let h=u.replace(wz,Rz);h.charAt(0)!=="-"&&(h="-"+h),t="data"+h}}o=sy}return new o(s,t)}function Rz(e){return"-"+e.toLowerCase()}function Tz(e){return e.charAt(1).toUpperCase()}const Lz=MT([DT,Sz,IT,NT,BT],"html"),zT=MT([DT,Cz,IT,NT,BT],"svg"),Ow={}.hasOwnProperty;function Az(e,t){const n=t||{};function s(o,...u){let h=s.invalid;const a=s.handlers;if(o&&Ow.call(o,e)){const l=String(o[e]);h=Ow.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 Oz=/["&'<>`]/g,Mz=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Dz=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Pz=/[|\\{}()[\]^$+*?.]/g,Mw=new WeakMap;function jz(e,t){if(e=e.replace(t.subset?Iz(t.subset):Oz,s),t.subset||t.escapeOnly)return e;return e.replace(Mz,n).replace(Dz,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 Iz(e){let t=Mw.get(e);return t||(t=Nz(e),Mw.set(e,t)),t}function Nz(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Pz,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Bz=/[\dA-Fa-f]/;function zz(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!Bz.test(String.fromCharCode(t))?s:s+";"}const Hz=/\d/;function Vz(e,t,n){const s="&#"+String(e);return n&&t&&!Hz.test(String.fromCharCode(t))?s:s+";"}const Fz=["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"],Iv={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:"€"},Uz=["cent","copy","divide","gt","lt","not","para","times"],HT={}.hasOwnProperty,j_={};let ih;for(ih in Iv)HT.call(Iv,ih)&&(j_[Iv[ih]]=ih);const Wz=/[^\dA-Za-z]/;function qz(e,t,n,s){const o=String.fromCharCode(e);if(HT.call(j_,o)){const u=j_[o],h="&"+u;return n&&Fz.includes(u)&&!Uz.includes(u)&&(!s||t&&t!==61&&Wz.test(String.fromCharCode(t)))?h:h+";"}return""}function Gz(e,t,n){let s=zz(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=qz(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const u=Vz(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 jz(e,Object.assign({format:Gz},t))}const $z=/^>|^->|<!--|-->|--!>|<!-$/g,Kz=[">"],Yz=["<",">"];function Xz(e,t,n,s){return s.settings.bogusComments?"<?"+Hl(e.value,Object.assign({},s.settings.characterReferences,{subset:Kz}))+">":"<!--"+e.value.replace($z,o)+"-->";function o(u){return Hl(u,Object.assign({},s.settings.characterReferences,{subset:Yz}))}}function Qz(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function Dw(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 Zz(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Jz(e){return e.join(" ").trim()}const eH=/[ \t\n\f\r]/g;function iy(e){return typeof e=="object"?e.type==="text"?Pw(e.value):!1:Pw(e)}function Pw(e){return e.replace(eH,"")===""}const In=FT(1),VT=FT(-1),tH=[];function FT(e){return t;function t(n,s,o){const u=n?n.children:tH;let h=(s||0)+e,a=u[h];if(!o)for(;a&&iy(a);)h+=e,a=u[h];return a}}const nH={}.hasOwnProperty;function UT(e){return t;function t(n,s,o){return nH.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const oy=UT({body:sH,caption:Nv,colgroup:Nv,dd:lH,dt:aH,head:Nv,html:rH,li:oH,optgroup:cH,option:uH,p:iH,rp:jw,rt:jw,tbody:fH,td:Iw,tfoot:hH,th:Iw,thead:dH,tr:pH});function Nv(e,t,n){const s=In(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&iy(s.value.charAt(0)))}function rH(e,t,n){const s=In(n,t);return!s||s.type!=="comment"}function sH(e,t,n){const s=In(n,t);return!s||s.type!=="comment"}function iH(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 oH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="li"}function aH(e,t,n){const s=In(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function lH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function jw(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function cH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function uH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function dH(e,t,n){const s=In(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function fH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function hH(e,t,n){return!In(n,t)}function pH(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 mH=UT({body:_H,colgroup:yH,head:vH,html:gH,tbody:bH});function gH(e){const t=In(e,-1);return!t||t.type!=="comment"}function vH(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 _H(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 yH(e,t,n){const s=VT(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 bH(e,t,n){const s=VT(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:[[`
43
- \f\r &/=>`.split(""),`
44
- \f\r "&'/=>\``.split("")],[`\0
45
- \f\r "&'/<=>`.split(""),`\0
46
- \f\r "&'/<=>\``.split("")]],unquoted:[[`
47
- \f\r &>`.split(""),`\0
48
- \f\r "&'<=>\``.split("")],[`\0
49
- \f\r "&'<=>\``.split(""),`\0
50
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function xH(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=zT);const d=SH(s,e.properties),p=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,p&&(h=!1),(d||!u||!mH(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 SH(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const u=CH(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 CH(e,t,n){const s=kz(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?Zz:Jz)(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&&Dw(n,h)>Dw(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 wH=["<","&"];function WT(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:wH}))}function EH(e,t,n,s){return s.settings.allowDangerousHtml?e.value:WT(e,t,n,s)}function kH(e,t,n,s){return s.all(e)}const RH=Az("type",{invalid:TH,unknown:LH,handlers:{comment:Xz,doctype:Qz,element:xH,raw:EH,root:kH,text:WT}});function TH(e){throw new Error("Expected node, not `"+e+"`")}function LH(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const AH={},OH={},MH=[];function DH(e,t){const n=t||AH,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:PH,all:jH,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||bz,characterReferences:n.characterReferences||OH,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?zT:Lz,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function PH(e,t,n){return RH(e,t,n,this)}function jH(e){const t=[],n=e&&e.children||MH;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 IH(e){return Array.isArray(e)?e:[e]}async function qT(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 GT(e){return e==="ansi"||ay(e)}function ly(e){return e==="none"}function $T(e){return ly(e)}function KT(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 Mp(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 NH(e){const t=Mp(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()",BH=["color","background-color"];function zH(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 HH(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?zH(o,u):o})):e}function VH(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&&BH.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",b=h[w][g]||"inherit";l[g]=`light-dark(${y}, ${b})`,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 I_(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const YT=new WeakMap;function Dp(e,t){YT.set(e,t)}function Zu(e){return YT.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(IH(n).map(s=>[s,O_])),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 FH(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function FH(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 UH(e,t){if(!(e instanceof bc))throw new En("Invalid grammar state");return e.getInternalStack(t)}function WH(){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=NH(n.source),u=(n.options.decorations||[]).map(h=>({...h,start:s(h.start),end:s(h.end)}));qH(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 HH(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,b=-1;if(f===0&&(y=0),g===0&&(b=0),g===Number.POSITIVE_INFINITY&&(b=C.children.length),y===-1||b===-1)for(let x=0;x<C.children.length;x++)w+=XT(C.children[x]),y===-1&&w.length===f&&(y=x+1),b===-1&&w.length===g&&(b=x+1);if(y===-1)throw new En(`Failed to find start index for decoration ${JSON.stringify(S.start)}`);if(b===-1)throw new En(`Failed to find end index for decoration ${JSON.stringify(S.end)}`);const v=C.children.slice(y,b);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 x={type:"element",tagName:"span",properties:{},children:v};a(x,S,"wrapper"),C.children.splice(y,v.length,x)}}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&&KT(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 qH(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 XT(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(XT).join(""):""}const GH=[WH()];function ep(e){const t=$H(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...GH]}function $H(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"],Bv={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function KH(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 Nw(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 YH(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)Bv[s]&&t.push({type:"setDecoration",value:Bv[s]});else if(s<=29){const o=Bv[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=Nw(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=Nw(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 XH(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let u=0;do{const h=KH(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=YH(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 QH={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 ZH(e=QH){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 JH={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 eV(e,t,n){const s=Zh(e,n),o=Mp(t),u=Object.fromEntries(ua.map(l=>{const d=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,p=e.colors?.[d];return[l,p||JH[l]]})),h=ZH(u),a=XH();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=tV(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 tV(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 Mp(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:u,colorMap:h}=e.setTheme(s);if(o==="ansi")return eV(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 rV(t,a,u,h,n)}function nV(...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 rV(e,t,n,s,o){const u=dy(e,t,n,s,o),h=new bc(u.stateStack,t.name,n.name);return Dp(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=Mp(e);let d=o.grammarState?UH(o.grammarState,n.name)??O_:o.grammarContextCode!=null?dy(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:O_,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,b,v;o.includeExplanation&&(y=t.tokenizeLine(C,d,a),b=y.tokens,v=0);const x=t.tokenizeLine2(C,d,a),E=x.tokens.length/2;for(let T=0;T<E;T++){const A=x.tokens[2*T],M=T+1<E?x.tokens[2*T+2]:C.length;if(A===M)continue;const L=x.tokens[2*T+1],P=vo(s[Zl.getForeground(L)],u),z=Zl.getFontStyle(L),H={content:C.substring(A,M),offset:w+A,color:P,fontStyle:z};if(o.includeExplanation){const q=[];if(o.includeExplanation!=="scopeName")for(const K of n.settings){let Y;switch(typeof K.scope){case"string":Y=K.scope.split(/,/).map(V=>V.trim());break;case"object":Y=K.scope;break;default:continue}q.push({settings:K,selectors:Y.map(V=>V.split(/ /))})}H.explanation=[];let I=0;for(;A+I<M;){const K=b[v],Y=C.substring(K.startIndex,K.endIndex);I+=Y.length,H.explanation.push({content:Y,scopes:o.includeExplanation==="scopeName"?sV(K.scopes):iV(q,K.scopes)}),v+=1}}p.push(H)}f.push(p),p=[],d=x.ruleStack}return{tokens:f,stateStack:d}}function sV(e){return e.map(t=>({scopeName:t}))}function iV(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const u=t[s];n[s]={scopeName:u,themeMatches:aV(e,u,t.slice(0,s))}}return n}function Bw(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function oV(e,t,n){if(!Bw(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)Bw(e[s],n[o])&&(s-=1),o-=1;return s===-1}function aV(e,t,n){const s=[];for(const{selectors:o,settings:u}of e)for(const h of o)if(oV(h,t,n)){s.push(u);break}return s}function QT(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=lV(...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:b,...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&&Dp(h,a),h}function lV(...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(b=>b[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,v)=>b.color===d?-1:v.color===d?1:0);if(g.length===0)throw new En("`themes` option must not be empty");const S=QT(e,t,n);if(l=Zu(S),d&&cy!==d&&!g.find(b=>b.color===d))throw new En(`\`themes\` option must contain the defaultColor key \`${d}\``);const C=g.map(b=>e.getTheme(b.theme)),w=g.map(b=>b.color);u=S.map(b=>b.map(v=>VH(v,w,p,d,f))),l&&Dp(u,l);const y=g.map(b=>Zh(b.theme,n));o=zw(g,C,y,p,d,"fg",f),s=zw(g,C,y,p,d,"bg",f),h=`shiki-themes ${C.map(b=>b.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 zw(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=uV(u):f==="never"&&(u=dV(u)),g&&(u=fV(u));const S={...s,get source(){return o}};for(const C of ep(n))u=C.tokens?.call(S,u)||u;return cV(u,{...n,fg:h,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},S,p)}function cV(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:KT,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:`
51
- `}));let b={type:"element",tagName:"span",properties:{class:"line"},children:[]},v=0;for(const x of w){let E={type:"element",tagName:"span",properties:{...x.htmlAttrs},children:[{type:"text",value:x.content}]};const T=I_(x.htmlStyle||Jh(x));T&&(E.properties.style=T);for(const A of o)E=A?.span?.call(S,E,y+1,v,b,x)||E;a==="inline"?h.children.push(E):a==="classic"&&b.children.push(E),v+=x.content.length}if(a==="classic"){for(const x of o)b=x?.line?.call(S,b,y+1)||b;g.push(b),u.push(b)}else a==="inline"&&g.push(b)}),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 x of h.children)x.type==="element"&&x.tagName==="br"?(w.push(y),y={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(x.type==="element"||x.type==="text")&&y.children.push(x);w.push(y);let v={type:"element",tagName:"code",properties:{},children:w};for(const x of o)v=x?.code?.call(S,v)||v;h.children=[];for(let x=0;x<v.children.length;x++){x>0&&h.children.push({type:"element",tagName:"br",properties:{},children:[]});const E=v.children[x];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&&Dp(C,s),C}function uV(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 dV(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 fV(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=I_(o.htmlStyle||Jh(o)),h=I_(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 hV=DH;function pV(e,t,n){const s={meta:{},options:n,codeToHast:(u,h)=>np(e,u,h),codeToTokens:(u,h)=>tp(e,u,h)};let o=hV(np(e,t,n,s));for(const u of ep(n))o=u.postprocess?.call(s,o,n)||o;return o}const Hw={light:"#333333",dark:"#bbbbbb"},Vw={light:"#fffffe",dark:"#1e1e1e"},Fw="__shiki_resolved";function fy(e){if(e?.[Fw])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"?Hw.light:Hw.dark),n||(n=t.type==="light"?Vw.light:Vw.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,Fw,{enumerable:!1,writable:!1,value:!0}),t}async function ZT(e){return Array.from(new Set((await Promise.all(e.filter(t=>!GT(t)).map(async t=>await qT(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function JT(e){return(await Promise.all(e.map(async n=>$T(n)?null:fy(await qT(n))))).filter(n=>!!n)}let mV=3;function gV(e,t=3){t>mV||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Tl=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function e5(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 vV extends yz{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=e5(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 _V{_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 yV(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 _V(e.engine,n),u=new vV(o,s,n,e.langAlias);let h;function a(x){return e5(x,e.langAlias)}function l(x){b();const E=u.getGrammar(typeof x=="string"?x:x.name);if(!E)throw new Tl(`Language \`${x}\` not found, you may need to load it first`);return E}function d(x){if(x==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const E=u.getTheme(x);if(!E)throw new Tl(`Theme \`${x}\` not found, you may need to load it first`);return E}function p(x){b();const E=d(x);h!==x&&(u.setTheme(E),h=x);const T=u.getColorMap();return{theme:E,colorMap:T}}function f(){return b(),u.getLoadedThemes()}function g(){return b(),u.getLoadedLanguages()}function S(...x){b(),u.loadLanguages(x.flat(1))}async function C(...x){return S(await ZT(x))}function w(...x){b();for(const E of x.flat(1))u.loadTheme(E)}async function y(...x){return b(),w(await JT(x))}function b(){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 bV(e){e.engine||gV("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([JT(e.themes||[]),ZT(e.langs||[]),e.engine]);return yV({...e,themes:t,langs:n,engine:s})}async function xV(e){const t=await bV(e);return{getLastGrammarState:(...n)=>nV(t,...n),codeToTokensBase:(n,s)=>uy(t,n,s),codeToTokensWithThemes:(n,s)=>QT(t,n,s),codeToTokens:(n,s)=>tp(t,n,s),codeToHast:(n,s)=>np(t,n,s),codeToHtml:(n,s)=>pV(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function SV(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,GT(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($T(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 xV({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 t5=[{id:"abap",name:"ABAP",import:(()=>J(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>J(()=>import("./actionscript-3-CfeIJUat.js"),[]))},{id:"ada",name:"Ada",import:(()=>J(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>J(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>J(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>J(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>J(()=>import("./apex-DDbsPZ6N.js"),[]))},{id:"apl",name:"APL",import:(()=>J(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>J(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>J(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>J(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>J(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>J(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>J(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>J(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>J(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>J(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>J(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>J(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>J(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>J(()=>import("./blade-DVc8C-J4.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>J(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>J(()=>import("./c-BIGW1oBm.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>J(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>J(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>J(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>J(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>J(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>J(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>J(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>J(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>J(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>J(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>J(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>J(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>J(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>J(()=>import("./csharp-K5feNrxe.js"),[]))},{id:"css",name:"CSS",import:(()=>J(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>J(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>J(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>J(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>J(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>J(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>J(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>J(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>J(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>J(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>J(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>J(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>J(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>J(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>J(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>J(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>J(()=>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:(()=>J(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>J(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>J(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>J(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>J(()=>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:(()=>J(()=>import("./fortran-free-form-D22FLkUw.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>J(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>J(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>J(()=>import("./gdscript-DTMYz4Jt.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>J(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>J(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>J(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>J(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>J(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>J(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>J(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>J(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>J(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gnuplot",name:"Gnuplot",import:(()=>J(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>J(()=>import("./go-Dn2_MT6a.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>J(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>J(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>J(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>J(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>J(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>J(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>J(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>J(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>J(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>J(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>J(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>J(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>J(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>J(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>J(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>J(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>J(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>J(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>J(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>J(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>J(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>J(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>J(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>J(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>J(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>J(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>J(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>J(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>J(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>J(()=>import("./julia-C8NyazO9.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>J(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>J(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>J(()=>import("./kusto-BvAqAH-y.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>J(()=>import("./latex-BdAV_C_H.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>J(()=>import("./lean-Bc6EcWN3.js"),[]))},{id:"less",name:"Less",import:(()=>J(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>J(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>J(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>J(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>J(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>J(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>J(()=>import("./luau-CXu1NL6O.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>J(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>J(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>J(()=>import("./marko-CPi9NSCl.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>J(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>J(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>J(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>J(()=>import("./mermaid-DKYwYmdq.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>J(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>J(()=>import("./mojo-1DNp92w6.js"),[]))},{id:"move",name:"Move",import:(()=>J(()=>import("./move-Bu9oaDYs.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>J(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>J(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>J(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>J(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>J(()=>import("./nix-c8nO5XWb.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>J(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>J(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>J(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>J(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>J(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>J(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>J(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>J(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>J(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>J(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>J(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>J(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>J(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>J(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>J(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>J(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>J(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>J(()=>import("./proto-DyJlTyXw.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>J(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>J(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>J(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>J(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>J(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>J(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>J(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>J(()=>import("./r-DiinP2Uv.js"),[]))},{id:"racket",name:"Racket",import:(()=>J(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>J(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>J(()=>import("./razor-CE9lU5zL.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>J(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>J(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>J(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>J(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>J(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>J(()=>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:(()=>J(()=>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:(()=>J(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>J(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>J(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>J(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>J(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>J(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>J(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>J(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>J(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>J(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>J(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>J(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>J(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>J(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>J(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>J(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>J(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>J(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>J(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>J(()=>import("./svelte-3Dk4HxPD.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>J(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>J(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>J(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>J(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>J(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>J(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>J(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>J(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>J(()=>import("./tex-CxkMU7Pf.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>J(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>J(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>J(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>J(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>J(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>J(()=>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:(()=>J(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>J(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>J(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>J(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>J(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>J(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>J(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>J(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>J(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>J(()=>import("./vue-DnHKYNfI.js"),__vite__mapDeps([92,3,2,11,9,15,1])))},{id:"vue-html",name:"Vue HTML",import:(()=>J(()=>import("./vue-html-CChd_i61.js"),__vite__mapDeps([93,92,3,2,11,9,15,1])))},{id:"vue-vine",name:"Vue Vine",import:(()=>J(()=>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:(()=>J(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>J(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>J(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>J(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>J(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>J(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>J(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>J(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>J(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>J(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>J(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>J(()=>import("./zig-VOosw3JB.js"),[]))}],CV=Object.fromEntries(t5.map(e=>[e.id,e.import])),wV=Object.fromEntries(t5.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),EV={...CV,...wV},kV=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>J(()=>import("./andromeeda-C-Jbm3Hp.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>J(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>J(()=>import("./ayu-dark-Cv9koXgw.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>J(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>J(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>J(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>J(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>J(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>J(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>J(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>J(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>J(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>J(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>J(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>J(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>J(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>J(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>J(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>J(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>J(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>J(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>J(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>J(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>J(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>J(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>J(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>J(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>J(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>J(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>J(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>J(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>J(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>J(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>J(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>J(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>J(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>J(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>J(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>J(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>J(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>J(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>J(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>J(()=>import("./one-light-PoHY5YXO.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>J(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>J(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>J(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>J(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>J(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>J(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>J(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>J(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>J(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>J(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>J(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>J(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>J(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>J(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>J(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>J(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>J(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],RV=Object.fromEntries(kV.map(e=>[e.id,e.import]));class hy extends Error{constructor(t){super(t),this.name="ShikiError"}}function TV(){return 2147483648}function LV(){return typeof performance<"u"?performance.now():Date.now()}const AV=(e,t)=>e+(t-e%t)%t;async function OV(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=TV();if(S>w)return!1;for(let y=1;y<=4;y*=2){let b=C*(1+.2/y);b=Math.min(b,S+100663296);const v=Math.min(w,AV(Math.max(S,b),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 b=C;for(;S[b]&&!(b>=y);)++b;if(b-C>16&&S.buffer&&l)return l.decode(S.subarray(C,b));let v="";for(;C<b;){let x=S[C++];if(!(x&128)){v+=String.fromCharCode(x);continue}const E=S[C++]&63;if((x&224)===192){v+=String.fromCharCode((x&31)<<6|E);continue}const T=S[C++]&63;if((x&240)===224?x=(x&15)<<12|E<<6|T:x=(x&7)<<18|E<<12|T<<6|S[C++]&63,x<65536)v+=String.fromCharCode(x);else{const A=x-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:LV,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 MV=Object.defineProperty,DV=(e,t,n)=>t in e?MV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,On=(e,t,n)=>DV(e,typeof t!="symbol"?t+"":t,n);let Bn=null;function PV(e){throw new hy(e.UTF8ToString(e.getLastOnigError()))}class Pp{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=Pp._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 Is{constructor(t){if(On(this,"id",++Is.LAST_ID),On(this,"_onigBinding"),On(this,"content"),On(this,"utf16Length"),On(this,"utf8Length"),On(this,"utf16OffsetToUtf8"),On(this,"utf8OffsetToUtf16"),On(this,"ptr"),!Bn)throw new hy("Must invoke loadWasm first.");this._onigBinding=Bn,this.content=t;const n=new Pp(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Is._sharedPtrInUse?(Is._sharedPtr||(Is._sharedPtr=Bn.omalloc(1e4)),Is._sharedPtrInUse=!0,Bn.HEAPU8.set(n.utf8Value,Is._sharedPtr),this.ptr=Is._sharedPtr):this.ptr=n.createString(Bn)}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===Is._sharedPtr?Is._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};On(jp,"LAST_ID",0);On(jp,"_sharedPtr",0);On(jp,"_sharedPtrInUse",!1);let n5=jp;class jV{constructor(t){if(On(this,"_onigBinding"),On(this,"_ptr"),!Bn)throw new hy("Must invoke loadWasm first.");const n=[],s=[];for(let a=0,l=t.length;a<l;a++){const d=new Pp(t[a]);n[a]=d.createString(Bn),s[a]=d.utf8Length}const o=Bn.omalloc(4*t.length);Bn.HEAPU32.set(n,o/4);const u=Bn.omalloc(4*t.length);Bn.HEAPU32.set(s,u/4);const h=Bn.createOnigScanner(o,u,t.length);for(let a=0,l=t.length;a<l;a++)Bn.ofree(n[a]);Bn.ofree(u),Bn.ofree(o),h===0&&PV(Bn),this._onigBinding=Bn,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 n5(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 IV(e){return typeof e.instantiator=="function"}function NV(e){return typeof e.default=="function"}function BV(e){return typeof e.data<"u"}function zV(e){return typeof Response<"u"&&e instanceof Response}function HV(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 VV(e){if(ah)return ah;async function t(){Bn=await OV(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),IV(s)?s=await s.instantiator(n):NV(s)?s=await s.default(n):(BV(s)&&(s=s.data),zV(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await FV(s)(n):s=await UV(s)(n):HV(s)?s=await zv(s)(n):s instanceof WebAssembly.Module?s=await zv(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await zv(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return ah=t(),ah}function zv(e){return t=>WebAssembly.instantiate(e,t)}function FV(e){return t=>WebAssembly.instantiateStreaming(e,t)}function UV(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function WV(e){return e&&await VV(e),{createScanner(t){return new jV(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new n5(t)}}}const qV=SV({langs:EV,themes:RV,engine:()=>WV(J(()=>import("./wasm-CG6Dc4jp.js"),[]))});let lh=null,ch=null;const GV=["typescript","tsx","javascript","jsx","json","css","html","markdown","yaml","toml","bash","shell","python","rust","go","sql","diff","plaintext"];async function $V(){return lh||ch||(ch=qV({themes:["github-dark"],langs:GV}),lh=await ch,lh)}async function KV(e,t){const n=await $V(),s=YV(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 YV(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 XV(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 Uw({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=XV(e);KV(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:Be("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:Be("p-2 font-mono text-xs",d?"whitespace-pre-wrap break-all":"whitespace-pre"),children:t.content})})]})}function QV(){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 Ww({taskId:e,worktreePath:t}){const{selectedFile:n,expandedDirs:s,setSelectedFile:o,toggleDir:u,collapseAll:h}=AB(e),[a,l]=R.useState("tree"),d=QV(),{data:p,isLoading:f,error:g}=iI(t),{data:S,isLoading:C,error:w}=oI(t,n),y=R.useCallback(x=>{o(x),window.matchMedia("(max-width: 639px)").matches&&l("content")},[o]),b=R.useCallback(()=>{o(null),window.matchMedia("(max-width: 639px)").matches&&l("tree")},[o]),v=R.useCallback(x=>{u(x)},[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:x=>l(x),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(yw,{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(Uw,{filePath:n,content:S??null,isLoading:C,error:w,onClose:b})})]}):_.jsxs(ta,{direction:"horizontal",className:"h-full",children:[_.jsx(ts,{defaultSize:65,minSize:30,className:"overflow-hidden",children:_.jsx(Uw,{filePath:n,content:S??null,isLoading:C,error:w,onClose:b})}),_.jsx(na,{withHandle:!0}),_.jsx(ts,{defaultSize:35,minSize:15,children:_.jsx(Yl,{className:"h-full",children:_.jsx(yw,{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 ZV(){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 r5=ws("/tasks/$taskId")({component:eF}),qw={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},JV={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 eF(){const{taskId:e}=r5.useParams(),t=yo(),n=Z3(),{data:s,isLoading:o}=fR(e),u=W0(),h=eI(),{tab:a,setTab:l}=EB(e),d=qR(),p=GR(),f=$R(),g=KR(),{data:S}=Rp(),{data:C}=Tp(),{data:w}=kB(s?.linearTicketId??null),y=n.state,b=y?.aiMode&&y?.description?y.aiMode:void 0,v=y?.description,[x,E]=R.useState(!1),[T,A]=R.useState(null),[M,L]=R.useState(!1),[P,z]=R.useState(!1),[H,q]=R.useState(null),[I,K]=R.useState(!1),[Y,V]=R.useState(!1),[$,G]=R.useState(null),[j,U]=R.useState(!1),[D,N]=R.useState(!1),[W,Z]=R.useState(!1),[ee,te]=R.useState("terminal"),X=ZV(),{terminals:F,writeToTerminal:se}=ey();R.useEffect(()=>{if(P){const xe=setTimeout(()=>z(!1),3e3);return()=>clearTimeout(xe)}},[P]),R.useEffect(()=>{if(Y){const xe=setTimeout(()=>V(!1),3e3);return()=>clearTimeout(xe)}},[Y]),R.useEffect(()=>{if(D){const xe=setTimeout(()=>N(!1),3e3);return()=>clearTimeout(xe)}},[D]);const ne=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){A(null),z(!1);try{await d.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),z(!0)}catch(xe){const Ge=xe instanceof Error?xe.message:"Sync failed";A(Ge),L(!0)}}},re=()=>{if(!s||!T)return"";const xe=s.baseBranch||"main";return`Fix the git sync issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${xe} | Error: ${T} | Steps: 1) Check git status 2) Resolve conflicts or commit/stash changes 3) Rebase onto the parent repo's ${xe} branch`},oe=()=>{if(!s||!H)return"";const xe=s.baseBranch||"main";return`Fix the git merge issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${xe} | 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 ${xe} 5) On successful merge, run: vibora tasks move ${s.id} --status done`},le=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){q(null),V(!1);try{await p.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),V(!0),g.mutate(s.id),u.mutate({taskId:s.id,updates:{status:"DONE"}})}catch(xe){const Ge=xe instanceof Error?xe.message:"Merge failed";q(Ge),K(!0)}}},ve=async()=>{if(s?.repoPath){G(null),N(!1);try{await f.mutateAsync({repoPath:s.repoPath,baseBranch:s.baseBranch}),N(!0)}catch(xe){const Ge=xe instanceof Error?xe.message:"Sync parent failed";G(Ge),U(!0)}}},ge=()=>{if(!s||!$)return"";const xe=s.baseBranch||"main";return`Fix the git sync parent issue. Parent repo: ${s.repoPath} | Base branch: ${xe} | Error: ${$} | Steps: 1) Check git status in parent repo 2) Resolve any local changes or divergence 3) Fetch and merge/rebase from origin/${xe}`},ue=F.find(xe=>xe.cwd===s?.worktreePath),de=()=>{if(!ue)return;const xe=re();se(ue.id,xe+"\r"),L(!1)},Ie=()=>{if(!ue)return;const Ge=`claude -p "${re().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;se(ue.id,Ge),L(!1)},De=()=>{if(!ue)return;const xe=oe();se(ue.id,xe+"\r"),K(!1)},Oe=()=>{if(!ue)return;const Ge=`claude -p "${oe().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;se(ue.id,Ge),K(!1)},be=()=>{if(!ue)return;const xe=ge();se(ue.id,xe+"\r"),U(!1)},Me=()=>{if(!ue)return;const Ge=`claude -p "${ge().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;se(ue.id,Ge),U(!1)},pe=()=>{Z(!0)},Re=()=>{if(!s?.worktreePath)return;const xe=Gh(s.worktreePath,S,C);window.open(xe,"_blank"),Z(!1)},we=()=>{if(!s?.repoPath)return;const xe=Gh(s.repoPath,S,C);window.open(xe,"_blank"),Z(!1)},We=xe=>{s&&u.mutate({taskId:s.id,updates:{status:xe}})},et=()=>{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:()=>E(!0),title:"Task settings",children:_.jsx(_e,{icon:rE,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:i_,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:xe=>xe.stopPropagation(),children:[_.jsx(_e,{icon:s0,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:xe=>xe.stopPropagation(),title:w?.title,children:[_.jsx(_e,{icon:i0,size:14,strokeWidth:2}),_.jsx("span",{children:s.linearTicketId}),w?.status&&_.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",w.status,")"]})]})]})]})]}),_.jsxs(FR,{children:[_.jsx(UR,{render:_.jsx(Ne,{variant:"ghost",size:"sm",className:JV[s.status]}),children:qw[s.status]}),_.jsx(WR,{align:"end",children:_.jsx(zN,{value:s.status,onValueChange:We,children:Object.entries(qw).map(([xe,Ge])=>_.jsx(HN,{value:xe,children:Ge},xe))})})]}),_.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:ne,disabled:d.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Pull from main",children:_.jsx(_e,{icon:t_,size:16,strokeWidth:2,className:d.isPending?"animate-spin":""})}),_.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:le,disabled:p.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Merge to main",children:_.jsx(_e,{icon:n_,size:16,strokeWidth:2,className:p.isPending?"animate-pulse":""})}),_.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:ve,disabled:f.isPending||!s.repoPath,className:"text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:_.jsx(_e,{icon:o_,size:16,strokeWidth:2,className:f.isPending?"animate-spin":""})}),_.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:pe,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:_.jsx(_e,{icon:o0,size:16,strokeWidth:2})}),P&&_.jsx("span",{className:"text-xs text-green-600",children:"Synced!"}),Y&&_.jsx("span",{className:"text-xs text-green-600",children:"Merged!"}),D&&_.jsx("span",{className:"text-xs text-green-600",children:"Parent synced!"}),_.jsxs(uc,{children:[_.jsx(dc,{render:_.jsx(Ne,{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(SR,{onClick:et,variant:"destructive",disabled:h.isPending,children:h.isPending?"Deleting...":"Delete"})]})]})]})]}),X?_.jsxs(_a,{value:ee,onValueChange:xe=>te(xe),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(gw,{taskId:s.id,taskName:s.title,cwd:s.worktreePath,aiMode:b,description:v,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:r_,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(vw,{taskId:s.id,worktreePath:s.worktreePath})}),_.jsx(_r,{value:"browser",className:"flex-1 overflow-hidden",children:_.jsx(_w,{taskId:s.id})}),_.jsx(_r,{value:"files",className:"flex-1 overflow-hidden",children:_.jsx(Ww,{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(gw,{taskId:s.id,taskName:s.title,cwd:s.worktreePath,aiMode:b,description:v,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:r_,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(vw,{taskId:s.id,worktreePath:s.worktreePath})}),_.jsx(_r,{value:"browser",className:"flex-1 overflow-hidden",children:_.jsx(_w,{taskId:s.id})}),_.jsx(_r,{value:"files",className:"flex-1 overflow-hidden",children:_.jsx(Ww,{taskId:s.id,worktreePath:s.worktreePath})})]})})]}),_.jsx(hT,{task:s,open:x,onOpenChange:E}),_.jsx(xs,{open:W,onOpenChange:Z,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(Ne,{variant:"outline",className:"justify-start font-mono text-sm",onClick:Re,disabled:!s.worktreePath,children:[_.jsx(_e,{icon:i_,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(Ne,{variant:"outline",className:"justify-start font-mono text-sm",onClick:we,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:M,onOpenChange:L,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:T}),_.jsxs(go,{className:"mt-4 gap-2",children:[_.jsx(Ne,{variant:"outline",onClick:()=>L(!1),children:"Close"}),_.jsx(Ne,{variant:"outline",onClick:de,disabled:!ue,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),_.jsx(Ne,{variant:"destructive",onClick:Ie,disabled:!ue,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),_.jsx(xs,{open:I,onOpenChange:K,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(Ne,{variant:"outline",onClick:()=>K(!1),children:"Close"}),_.jsx(Ne,{variant:"outline",onClick:De,disabled:!ue,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),_.jsx(Ne,{variant:"destructive",onClick:Oe,disabled:!ue,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),_.jsx(xs,{open:j,onOpenChange:U,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:$}),_.jsxs(go,{className:"mt-4 gap-2",children:[_.jsx(Ne,{variant:"outline",onClick:()=>U(!1),children:"Close"}),_.jsx(Ne,{variant:"outline",onClick:be,disabled:!ue,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),_.jsx(Ne,{variant:"destructive",onClick:Me,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(Ne,{variant:"outline",children:"Back to Tasks"})})]})}const s5=ws("/repositories/$repoId")({component:tF});function tF(){const{repoId:e}=s5.useParams(),t=yo(),{data:n,isLoading:s,error:o}=_I(e),u=yI(),h=gR(),{data:a}=Rp(),{data:l}=Tp(),[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 b=()=>{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"}))},x=()=>{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(Ne,{variant:"ghost",size:"icon-sm",onClick:x,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:_.jsx(_e,{icon:o0,size:14,strokeWidth:2})}),_.jsxs(uc,{children:[_.jsxs(dc,{render:_.jsx(Ne,{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(Ne,{variant:"destructive",onClick:v,children:"Delete"})]})]})]}),_.jsx(Ne,{size:"sm",onClick:b,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(T0,{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 nF=UI.update({id:"/",path:"/",getParentRoute:()=>Ks}),rF=QI.update({id:"/worktrees/",path:"/worktrees/",getParentRoute:()=>Ks}),sF=JN.update({id:"/terminals/",path:"/terminals/",getParentRoute:()=>Ks}),iF=iB.update({id:"/tasks/",path:"/tasks/",getParentRoute:()=>Ks}),oF=lB.update({id:"/settings/",path:"/settings/",getParentRoute:()=>Ks}),aF=_B.update({id:"/review/",path:"/review/",getParentRoute:()=>Ks}),lF=bB.update({id:"/repositories/",path:"/repositories/",getParentRoute:()=>Ks}),cF=r5.update({id:"/tasks/$taskId",path:"/tasks/$taskId",getParentRoute:()=>Ks}),uF=s5.update({id:"/repositories/$repoId",path:"/repositories/$repoId",getParentRoute:()=>Ks}),dF={IndexRoute:nF,RepositoriesRepoIdRoute:uF,TasksTaskIdRoute:cF,RepositoriesIndexRoute:lF,ReviewIndexRoute:aF,SettingsIndexRoute:oF,TasksIndexRoute:iF,TerminalsIndexRoute:sF,WorktreesIndexRoute:rF},fF=Ks._addFileChildren(dF)._addFileTypes(),i5=R.createContext(null);function hF({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(i5.Provider,{value:g,children:e})}function pF(){const e=R.useContext(i5);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function mF(){const{showLoginModal:e,login:t}=pF(),[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(Ne,{type:"submit",disabled:l||!n||!o,children:l?"Logging in...":"Login"})})]})]})})}const gF=new xO({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}}),vF=K3({routeTree:fF});vA.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(SO,{client:gF,children:_.jsxs(hF,{children:[_.jsx(Q3,{router:vF}),_.jsx(mF,{})]})})}));