vlt 0.0.0-0.1738340653580 → 0.0.0-0.1738343208096
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cache-unzip/unzip.js +9 -9
- package/commands/config.js +8 -8
- package/commands/exec.js +8 -8
- package/commands/gui.js +12 -12
- package/commands/help.js +8 -8
- package/commands/install-exec.js +8 -8
- package/commands/install.js +12 -12
- package/commands/list.js +12 -12
- package/commands/login.js +10 -10
- package/commands/logout.js +10 -10
- package/commands/pkg.js +8 -8
- package/commands/query.js +12 -12
- package/commands/run-exec.js +8 -8
- package/commands/run.js +8 -8
- package/commands/uninstall.js +11 -11
- package/commands/whoami.js +10 -10
- package/gui/index.js +2 -2
- package/gui/index.js.map +2 -2
- package/gui/main.css +1 -1
- package/package.json +1 -1
- package/rollback-remove/remove.js +9 -9
- package/vlix.js +11 -11
- package/vlr.js +11 -11
- package/vlrx.js +11 -11
- package/vlt.js +11 -11
- package/vlx.js +11 -11
package/gui/index.js
CHANGED
|
@@ -51,7 +51,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
51
51
|
|
|
52
52
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
53
53
|
|
|
54
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return st.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},gO="DialogDescriptionWarning",mO=({contentRef:e,descriptionId:t})=>{let A=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${E9(gO).contentName}}.`;return st.useEffect(()=>{let a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(A))},[A,e,t]),null},Xc=s9,vy=u9,eu=l9,qr=p9,Or=g9,tu=f9,nu=h9,Yl=C9;var RA=w(I(),1),y9=Xc;var fO=eu,Q9=Kl.forwardRef(({className:e,...t},n)=>(0,RA.jsx)(qr,{className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Q9.displayName=qr.displayName;var bO=VA("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Sy=Kl.forwardRef(({side:e="right",className:t,children:n,...A},a)=>(0,RA.jsxs)(fO,{children:[(0,RA.jsx)(Q9,{}),(0,RA.jsxs)(Or,{ref:a,className:v(bO({side:e}),t),...A,children:[n,(0,RA.jsxs)(Yl,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,RA.jsx)(vo,{className:"h-4 w-4"}),(0,RA.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Sy.displayName=Or.displayName;var hO=({className:e,...t})=>(0,RA.jsx)("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",e),...t});hO.displayName="SheetHeader";var BO=({className:e,...t})=>(0,RA.jsx)("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});BO.displayName="SheetFooter";var CO=Kl.forwardRef(({className:e,...t},n)=>(0,RA.jsx)(tu,{ref:n,className:v("text-lg font-semibold text-foreground",e),...t}));CO.displayName=tu.displayName;var wO=Kl.forwardRef(({className:e,...t},n)=>(0,RA.jsx)(nu,{ref:n,className:v("text-sm text-muted-foreground",e),...t}));wO.displayName=nu.displayName;var k9=w(I(),1);function Ly({className:e,...t}){return(0,k9.jsx)("div",{className:v("animate-pulse rounded-md bg-muted",e),...t})}var T2=w(_(),1);var Ce=w(_(),1);var MA=w(_(),1);var I9=["top","right","bottom","left"];var Xa=Math.min,Vn=Math.max,Jl=Math.round,Vl=Math.floor,Ro=e=>({x:e,y:e}),EO={left:"right",right:"left",bottom:"top",top:"bottom"},yO={start:"end",end:"start"};function Rf(e,t,n){return Vn(e,Xa(t,n))}function eo(e,t){return typeof e=="function"?e(t):e}function to(e){return e.split("-")[0]}function cs(e){return e.split("-")[1]}function Mf(e){return e==="x"?"y":"x"}function Nf(e){return e==="y"?"height":"width"}function Mo(e){return["top","bottom"].includes(to(e))?"y":"x"}function Pf(e){return Mf(Mo(e))}function _9(e,t,n){n===void 0&&(n=!1);let A=cs(e),a=Pf(e),o=Nf(a),r=a==="x"?A===(n?"end":"start")?"right":"left":A==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Wl(r)),[r,Wl(r)]}function x9(e){let t=Wl(e);return[Lf(e),t,Lf(t)]}function Lf(e){return e.replace(/start|end/g,t=>yO[t])}function QO(e,t,n){let A=["left","right"],a=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:A:t?A:a;case"left":case"right":return t?o:r;default:return[]}}function D9(e,t,n,A){let a=cs(e),o=QO(to(e),n==="start",A);return a&&(o=o.map(r=>r+"-"+a),t&&(o=o.concat(o.map(Lf)))),o}function Wl(e){return e.replace(/left|right|bottom|top/g,t=>EO[t])}function kO(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ry(e){return typeof e!="number"?kO(e):{top:e,right:e,bottom:e,left:e}}function us(e){let{x:t,y:n,width:A,height:a}=e;return{width:A,height:a,top:n,left:t,right:t+A,bottom:n+a,x:t,y:n}}function v9(e,t,n){let{reference:A,floating:a}=e,o=Mo(t),r=Pf(t),i=Nf(r),s=to(t),c=o==="y",u=A.x+A.width/2-a.width/2,d=A.y+A.height/2-a.height/2,l=A[i]/2-a[i]/2,p;switch(s){case"top":p={x:u,y:A.y-a.height};break;case"bottom":p={x:u,y:A.y+A.height};break;case"right":p={x:A.x+A.width,y:d};break;case"left":p={x:A.x-a.width,y:d};break;default:p={x:A.x,y:A.y}}switch(cs(t)){case"start":p[r]-=l*(n&&c?-1:1);break;case"end":p[r]+=l*(n&&c?-1:1);break}return p}var L9=async(e,t,n)=>{let{placement:A="bottom",strategy:a="absolute",middleware:o=[],platform:r}=n,i=o.filter(Boolean),s=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=v9(c,A,s),l=A,p={},g=0;for(let b=0;b<i.length;b++){let{name:B,fn:f}=i[b],{x:m,y:h,data:C,reset:E}=await f({x:u,y:d,initialPlacement:A,placement:l,strategy:a,middlewareData:p,rects:c,platform:r,elements:{reference:e,floating:t}});u=m??u,d=h??d,p={...p,[B]:{...p[B],...C}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(l=E.placement),E.rects&&(c=E.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:u,y:d}=v9(c,l,s)),b=-1)}return{x:u,y:d,placement:l,strategy:a,middlewareData:p}};async function Au(e,t){var n;t===void 0&&(t={});let{x:A,y:a,platform:o,rects:r,elements:i,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:l=!1,padding:p=0}=eo(t,e),g=Ry(p),B=i[l?d==="floating"?"reference":"floating":d],f=us(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(B)))==null||n?B:B.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(i.floating)),boundary:c,rootBoundary:u,strategy:s})),m=d==="floating"?{x:A,y:a,width:r.floating.width,height:r.floating.height}:r.reference,h=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),C=await(o.isElement==null?void 0:o.isElement(h))?await(o.getScale==null?void 0:o.getScale(h))||{x:1,y:1}:{x:1,y:1},E=us(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:m,offsetParent:h,strategy:s}):m);return{top:(f.top-E.top+g.top)/C.y,bottom:(E.bottom-f.bottom+g.bottom)/C.y,left:(f.left-E.left+g.left)/C.x,right:(E.right-f.right+g.right)/C.x}}var R9=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:A,placement:a,rects:o,platform:r,elements:i,middlewareData:s}=t,{element:c,padding:u=0}=eo(e,t)||{};if(c==null)return{};let d=Ry(u),l={x:n,y:A},p=Pf(a),g=Nf(p),b=await r.getDimensions(c),B=p==="y",f=B?"top":"left",m=B?"bottom":"right",h=B?"clientHeight":"clientWidth",C=o.reference[g]+o.reference[p]-l[p]-o.floating[g],E=l[p]-o.reference[p],Q=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c)),y=Q?Q[h]:0;(!y||!await(r.isElement==null?void 0:r.isElement(Q)))&&(y=i.floating[h]||o.floating[g]);let k=C/2-E/2,R=y/2-b[g]/2-1,F=Xa(d[f],R),U=Xa(d[m],R),M=F,ce=y-b[g]-U,N=y/2-b[g]/2+k,te=Rf(M,N,ce),W=!s.arrow&&cs(a)!=null&&N!==te&&o.reference[g]/2-(N<M?F:U)-b[g]/2<0,ne=W?N<M?N-M:N-ce:0;return{[p]:l[p]+ne,data:{[p]:te,centerOffset:N-te-ne,...W&&{alignmentOffset:ne}},reset:W}}});var M9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,A;let{placement:a,middlewareData:o,rects:r,initialPlacement:i,platform:s,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:l,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...B}=eo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let f=to(a),m=Mo(i),h=to(i)===i,C=await(s.isRTL==null?void 0:s.isRTL(c.floating)),E=l||(h||!b?[Wl(i)]:x9(i)),Q=g!=="none";!l&&Q&&E.push(...D9(i,b,g,C));let y=[i,...E],k=await Au(t,B),R=[],F=((A=o.flip)==null?void 0:A.overflows)||[];if(u&&R.push(k[f]),d){let N=_9(a,r,C);R.push(k[N[0]],k[N[1]])}if(F=[...F,{placement:a,overflows:R}],!R.every(N=>N<=0)){var U,M;let N=(((U=o.flip)==null?void 0:U.index)||0)+1,te=y[N];if(te)return{data:{index:N,overflows:F},reset:{placement:te}};let W=(M=F.filter(ne=>ne.overflows[0]<=0).sort((ne,K)=>ne.overflows[1]-K.overflows[1])[0])==null?void 0:M.placement;if(!W)switch(p){case"bestFit":{var ce;let ne=(ce=F.filter(K=>{if(Q){let H=Mo(K.placement);return H===m||H==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(H=>H>0).reduce((H,ve)=>H+ve,0)]).sort((K,H)=>K[1]-H[1])[0])==null?void 0:ce[0];ne&&(W=ne);break}case"initialPlacement":W=i;break}if(a!==W)return{reset:{placement:W}}}return{}}}};function F9(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function S9(e){return I9.some(t=>e[t]>=0)}var N9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n}=t,{strategy:A="referenceHidden",...a}=eo(e,t);switch(A){case"referenceHidden":{let o=await Au(t,{...a,elementContext:"reference"}),r=F9(o,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:S9(r)}}}case"escaped":{let o=await Au(t,{...a,altBoundary:!0}),r=F9(o,n.floating);return{data:{escapedOffsets:r,escaped:S9(r)}}}default:return{}}}}};async function IO(e,t){let{placement:n,platform:A,elements:a}=e,o=await(A.isRTL==null?void 0:A.isRTL(a.floating)),r=to(n),i=cs(n),s=Mo(n)==="y",c=["left","top"].includes(r)?-1:1,u=o&&s?-1:1,d=eo(t,e),{mainAxis:l,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof g=="number"&&(p=i==="end"?g*-1:g),s?{x:p*u,y:l*c}:{x:l*c,y:p*u}}var P9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,A;let{x:a,y:o,placement:r,middlewareData:i}=t,s=await IO(t,e);return r===((n=i.offset)==null?void 0:n.placement)&&(A=i.arrow)!=null&&A.alignmentOffset?{}:{x:a+s.x,y:o+s.y,data:{...s,placement:r}}}}},j9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:A,placement:a}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:i={fn:B=>{let{x:f,y:m}=B;return{x:f,y:m}}},...s}=eo(e,t),c={x:n,y:A},u=await Au(t,s),d=Mo(to(a)),l=Mf(d),p=c[l],g=c[d];if(o){let B=l==="y"?"top":"left",f=l==="y"?"bottom":"right",m=p+u[B],h=p-u[f];p=Rf(m,p,h)}if(r){let B=d==="y"?"top":"left",f=d==="y"?"bottom":"right",m=g+u[B],h=g-u[f];g=Rf(m,g,h)}let b=i.fn({...t,[l]:p,[d]:g});return{...b,data:{x:b.x-n,y:b.y-A,enabled:{[l]:o,[d]:r}}}}}},G9=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:A,placement:a,rects:o,middlewareData:r}=t,{offset:i=0,mainAxis:s=!0,crossAxis:c=!0}=eo(e,t),u={x:n,y:A},d=Mo(a),l=Mf(d),p=u[l],g=u[d],b=eo(i,t),B=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(s){let h=l==="y"?"height":"width",C=o.reference[l]-o.floating[h]+B.mainAxis,E=o.reference[l]+o.reference[h]-B.mainAxis;p<C?p=C:p>E&&(p=E)}if(c){var f,m;let h=l==="y"?"width":"height",C=["top","left"].includes(to(a)),E=o.reference[d]-o.floating[h]+(C&&((f=r.offset)==null?void 0:f[d])||0)+(C?0:B.crossAxis),Q=o.reference[d]+o.reference[h]+(C?0:((m=r.offset)==null?void 0:m[d])||0)-(C?B.crossAxis:0);g<E?g=E:g>Q&&(g=Q)}return{[l]:p,[d]:g}}}},z9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,A;let{placement:a,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...c}=eo(e,t),u=await Au(t,c),d=to(a),l=cs(a),p=Mo(a)==="y",{width:g,height:b}=o.floating,B,f;d==="top"||d==="bottom"?(B=d,f=l===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(f=d,B=l==="end"?"top":"bottom");let m=b-u.top-u.bottom,h=g-u.left-u.right,C=Xa(b-u[B],m),E=Xa(g-u[f],h),Q=!t.middlewareData.shift,y=C,k=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=h),(A=t.middlewareData.shift)!=null&&A.enabled.y&&(y=m),Q&&!l){let F=Vn(u.left,0),U=Vn(u.right,0),M=Vn(u.top,0),ce=Vn(u.bottom,0);p?k=g-2*(F!==0||U!==0?F+U:Vn(u.left,u.right)):y=b-2*(M!==0||ce!==0?M+ce:Vn(u.top,u.bottom))}await s({...t,availableWidth:k,availableHeight:y});let R=await r.getDimensions(i.floating);return g!==R.width||b!==R.height?{reset:{rects:!0}}:{}}}};function jf(){return typeof window<"u"}function ls(e){return $9(e)?(e.nodeName||"").toLowerCase():"#document"}function mA(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sa(e){var t;return(t=($9(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $9(e){return jf()?e instanceof Node||e instanceof mA(e).Node:!1}function na(e){return jf()?e instanceof Element||e instanceof mA(e).Element:!1}function La(e){return jf()?e instanceof HTMLElement||e instanceof mA(e).HTMLElement:!1}function H9(e){return!jf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mA(e).ShadowRoot}function au(e){let{overflow:t,overflowX:n,overflowY:A,display:a}=Aa(e);return/auto|scroll|overlay|hidden|clip/.test(t+A+n)&&!["inline","contents"].includes(a)}function T9(e){return["table","td","th"].includes(ls(e))}function Xl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Gf(e){let t=zf(),n=na(e)?Aa(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(A=>(n.willChange||"").includes(A))||["paint","layout","strict","content"].some(A=>(n.contain||"").includes(A))}function U9(e){let t=No(e);for(;La(t)&&!ps(t);){if(Gf(t))return t;if(Xl(t))return null;t=No(t)}return null}function zf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ps(e){return["html","body","#document"].includes(ls(e))}function Aa(e){return mA(e).getComputedStyle(e)}function ep(e){return na(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function No(e){if(ls(e)==="html")return e;let t=e.assignedSlot||e.parentNode||H9(e)&&e.host||Sa(e);return H9(t)?t.host:t}function Z9(e){let t=No(e);return ps(t)?e.ownerDocument?e.ownerDocument.body:e.body:La(t)&&au(t)?t:Z9(t)}function ds(e,t,n){var A;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=Z9(e),o=a===((A=e.ownerDocument)==null?void 0:A.body),r=mA(a);if(o){let i=Hf(r);return t.concat(r,r.visualViewport||[],au(a)?a:[],i&&n?ds(i):[])}return t.concat(a,ds(a,[],n))}function Hf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Y9(e){let t=Aa(e),n=parseFloat(t.width)||0,A=parseFloat(t.height)||0,a=La(e),o=a?e.offsetWidth:n,r=a?e.offsetHeight:A,i=Jl(n)!==o||Jl(A)!==r;return i&&(n=o,A=r),{width:n,height:A,$:i}}function Py(e){return na(e)?e:e.contextElement}function ou(e){let t=Py(e);if(!La(t))return Ro(1);let n=t.getBoundingClientRect(),{width:A,height:a,$:o}=Y9(t),r=(o?Jl(n.width):n.width)/A,i=(o?Jl(n.height):n.height)/a;return(!r||!Number.isFinite(r))&&(r=1),(!i||!Number.isFinite(i))&&(i=1),{x:r,y:i}}var _O=Ro(0);function K9(e){let t=mA(e);return!zf()||!t.visualViewport?_O:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==mA(e)?!1:t}function gs(e,t,n,A){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),o=Py(e),r=Ro(1);t&&(A?na(A)&&(r=ou(A)):r=ou(e));let i=xO(o,n,A)?K9(o):Ro(0),s=(a.left+i.x)/r.x,c=(a.top+i.y)/r.y,u=a.width/r.x,d=a.height/r.y;if(o){let l=mA(o),p=A&&na(A)?mA(A):A,g=l,b=Hf(g);for(;b&&A&&p!==g;){let B=ou(b),f=b.getBoundingClientRect(),m=Aa(b),h=f.left+(b.clientLeft+parseFloat(m.paddingLeft))*B.x,C=f.top+(b.clientTop+parseFloat(m.paddingTop))*B.y;s*=B.x,c*=B.y,u*=B.x,d*=B.y,s+=h,c+=C,g=mA(b),b=Hf(g)}}return us({width:u,height:d,x:s,y:c})}function DO(e){let{elements:t,rect:n,offsetParent:A,strategy:a}=e,o=a==="fixed",r=Sa(A),i=t?Xl(t.floating):!1;if(A===r||i&&o)return n;let s={scrollLeft:0,scrollTop:0},c=Ro(1),u=Ro(0),d=La(A);if((d||!d&&!o)&&((ls(A)!=="body"||au(r))&&(s=ep(A)),La(A))){let l=gs(A);c=ou(A),u.x=l.x+A.clientLeft,u.y=l.y+A.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x,y:n.y*c.y-s.scrollTop*c.y+u.y}}function vO(e){return Array.from(e.getClientRects())}function Ny(e,t){let n=ep(e).scrollLeft;return t?t.left+n:gs(Sa(e)).left+n}function FO(e){let t=Sa(e),n=ep(e),A=e.ownerDocument.body,a=Vn(t.scrollWidth,t.clientWidth,A.scrollWidth,A.clientWidth),o=Vn(t.scrollHeight,t.clientHeight,A.scrollHeight,A.clientHeight),r=-n.scrollLeft+Ny(e),i=-n.scrollTop;return Aa(A).direction==="rtl"&&(r+=Vn(t.clientWidth,A.clientWidth)-a),{width:a,height:o,x:r,y:i}}function SO(e,t){let n=mA(e),A=Sa(e),a=n.visualViewport,o=A.clientWidth,r=A.clientHeight,i=0,s=0;if(a){o=a.width,r=a.height;let c=zf();(!c||c&&t==="fixed")&&(i=a.offsetLeft,s=a.offsetTop)}return{width:o,height:r,x:i,y:s}}function LO(e,t){let n=gs(e,!0,t==="fixed"),A=n.top+e.clientTop,a=n.left+e.clientLeft,o=La(e)?ou(e):Ro(1),r=e.clientWidth*o.x,i=e.clientHeight*o.y,s=a*o.x,c=A*o.y;return{width:r,height:i,x:s,y:c}}function q9(e,t,n){let A;if(t==="viewport")A=SO(e,n);else if(t==="document")A=FO(Sa(e));else if(na(t))A=LO(t,n);else{let a=K9(e);A={...t,x:t.x-a.x,y:t.y-a.y}}return us(A)}function W9(e,t){let n=No(e);return n===t||!na(n)||ps(n)?!1:Aa(n).position==="fixed"||W9(n,t)}function RO(e,t){let n=t.get(e);if(n)return n;let A=ds(e,[],!1).filter(i=>na(i)&&ls(i)!=="body"),a=null,o=Aa(e).position==="fixed",r=o?No(e):e;for(;na(r)&&!ps(r);){let i=Aa(r),s=Gf(r);!s&&i.position==="fixed"&&(a=null),(o?!s&&!a:!s&&i.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||au(r)&&!s&&W9(e,r))?A=A.filter(u=>u!==r):a=i,r=No(r)}return t.set(e,A),A}function MO(e){let{element:t,boundary:n,rootBoundary:A,strategy:a}=e,r=[...n==="clippingAncestors"?Xl(t)?[]:RO(t,this._c):[].concat(n),A],i=r[0],s=r.reduce((c,u)=>{let d=q9(t,u,a);return c.top=Vn(d.top,c.top),c.right=Xa(d.right,c.right),c.bottom=Xa(d.bottom,c.bottom),c.left=Vn(d.left,c.left),c},q9(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function NO(e){let{width:t,height:n}=Y9(e);return{width:t,height:n}}function PO(e,t,n){let A=La(t),a=Sa(t),o=n==="fixed",r=gs(e,!0,o,t),i={scrollLeft:0,scrollTop:0},s=Ro(0);if(A||!A&&!o)if((ls(t)!=="body"||au(a))&&(i=ep(t)),A){let p=gs(t,!0,o,t);s.x=p.x+t.clientLeft,s.y=p.y+t.clientTop}else a&&(s.x=Ny(a));let c=0,u=0;if(a&&!A&&!o){let p=a.getBoundingClientRect();u=p.top+i.scrollTop,c=p.left+i.scrollLeft-Ny(a,p)}let d=r.left+i.scrollLeft-s.x-c,l=r.top+i.scrollTop-s.y-u;return{x:d,y:l,width:r.width,height:r.height}}function My(e){return Aa(e).position==="static"}function O9(e,t){if(!La(e)||Aa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Sa(e)===n&&(n=n.ownerDocument.body),n}function J9(e,t){let n=mA(e);if(Xl(e))return n;if(!La(e)){let a=No(e);for(;a&&!ps(a);){if(na(a)&&!My(a))return a;a=No(a)}return n}let A=O9(e,t);for(;A&&T9(A)&&My(A);)A=O9(A,t);return A&&ps(A)&&My(A)&&!Gf(A)?n:A||U9(e)||n}var jO=async function(e){let t=this.getOffsetParent||J9,n=this.getDimensions,A=await n(e.floating);return{reference:PO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:A.width,height:A.height}}};function GO(e){return Aa(e).direction==="rtl"}var V9={convertOffsetParentRelativeRectToViewportRelativeRect:DO,getDocumentElement:Sa,getClippingRect:MO,getOffsetParent:J9,getElementRects:jO,getClientRects:vO,getDimensions:NO,getScale:ou,isElement:na,isRTL:GO};function zO(e,t){let n=null,A,a=Sa(e);function o(){var i;clearTimeout(A),(i=n)==null||i.disconnect(),n=null}function r(i,s){i===void 0&&(i=!1),s===void 0&&(s=1),o();let{left:c,top:u,width:d,height:l}=e.getBoundingClientRect();if(i||t(),!d||!l)return;let p=Vl(u),g=Vl(a.clientWidth-(c+d)),b=Vl(a.clientHeight-(u+l)),B=Vl(c),m={rootMargin:-p+"px "+-g+"px "+-b+"px "+-B+"px",threshold:Vn(0,Xa(1,s))||1},h=!0;function C(E){let Q=E[0].intersectionRatio;if(Q!==s){if(!h)return r();Q?r(!1,Q):A=setTimeout(()=>{r(!1,1e-7)},1e3)}h=!1}try{n=new IntersectionObserver(C,{...m,root:a.ownerDocument})}catch{n=new IntersectionObserver(C,m)}n.observe(e)}return r(!0),o}function jy(e,t,n,A){A===void 0&&(A={});let{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:s=!1}=A,c=Py(e),u=a||o?[...c?ds(c):[],...ds(t)]:[];u.forEach(f=>{a&&f.addEventListener("scroll",n,{passive:!0}),o&&f.addEventListener("resize",n)});let d=c&&i?zO(c,n):null,l=-1,p=null;r&&(p=new ResizeObserver(f=>{let[m]=f;m&&m.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(l),l=requestAnimationFrame(()=>{var h;(h=p)==null||h.observe(t)})),n()}),c&&!s&&p.observe(c),p.observe(t));let g,b=s?gs(e):null;s&&B();function B(){let f=gs(e);b&&(f.x!==b.x||f.y!==b.y||f.width!==b.width||f.height!==b.height)&&n(),b=f,g=requestAnimationFrame(B)}return n(),()=>{var f;u.forEach(m=>{a&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),d?.(),(f=p)==null||f.disconnect(),p=null,s&&cancelAnimationFrame(g)}}var X9=P9;var e2=j9,t2=M9,n2=z9,A2=N9,Gy=R9;var a2=G9,zy=(e,t,n)=>{let A=new Map,a={platform:V9,...n},o={...a.platform,_c:A};return L9(e,t,{...a,platform:o})};var tn=w(_(),1),Uf=w(_(),1),r2=w(Lr(),1),$f=typeof document<"u"?Uf.useLayoutEffect:Uf.useEffect;function Tf(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,A,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(A=n;A--!==0;)if(!Tf(e[A],t[A]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(A=n;A--!==0;)if(!{}.hasOwnProperty.call(t,a[A]))return!1;for(A=n;A--!==0;){let o=a[A];if(!(o==="_owner"&&e.$$typeof)&&!Tf(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function i2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function o2(e,t){let n=i2(e);return Math.round(t*n)/n}function Hy(e){let t=tn.useRef(e);return $f(()=>{t.current=e}),t}function s2(e){e===void 0&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:A=[],platform:a,elements:{reference:o,floating:r}={},transform:i=!0,whileElementsMounted:s,open:c}=e,[u,d]=tn.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[l,p]=tn.useState(A);Tf(l,A)||p(A);let[g,b]=tn.useState(null),[B,f]=tn.useState(null),m=tn.useCallback(K=>{K!==Q.current&&(Q.current=K,b(K))},[]),h=tn.useCallback(K=>{K!==y.current&&(y.current=K,f(K))},[]),C=o||g,E=r||B,Q=tn.useRef(null),y=tn.useRef(null),k=tn.useRef(u),R=s!=null,F=Hy(s),U=Hy(a),M=Hy(c),ce=tn.useCallback(()=>{if(!Q.current||!y.current)return;let K={placement:t,strategy:n,middleware:l};U.current&&(K.platform=U.current),zy(Q.current,y.current,K).then(H=>{let ve={...H,isPositioned:M.current!==!1};N.current&&!Tf(k.current,ve)&&(k.current=ve,r2.flushSync(()=>{d(ve)}))})},[l,t,n,U,M]);$f(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(K=>({...K,isPositioned:!1})))},[c]);let N=tn.useRef(!1);$f(()=>(N.current=!0,()=>{N.current=!1}),[]),$f(()=>{if(C&&(Q.current=C),E&&(y.current=E),C&&E){if(F.current)return F.current(C,E,ce);ce()}},[C,E,ce,F,R]);let te=tn.useMemo(()=>({reference:Q,floating:y,setReference:m,setFloating:h}),[m,h]),W=tn.useMemo(()=>({reference:C,floating:E}),[C,E]),ne=tn.useMemo(()=>{let K={position:n,left:0,top:0};if(!W.floating)return K;let H=o2(W.floating,u.x),ve=o2(W.floating,u.y);return i?{...K,transform:"translate("+H+"px, "+ve+"px)",...i2(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:ve}},[n,i,W.floating,u.x,u.y]);return tn.useMemo(()=>({...u,update:ce,refs:te,elements:W,floatingStyles:ne}),[u,ce,te,W,ne])}var HO=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){let{element:A,padding:a}=typeof e=="function"?e(n):e;return A&&t(A)?A.current!=null?Gy({element:A.current,padding:a}).fn(n):{}:A?Gy({element:A,padding:a}).fn(n):{}}}},c2=(e,t)=>({...X9(e),options:[e,t]}),u2=(e,t)=>({...e2(e),options:[e,t]}),d2=(e,t)=>({...a2(e),options:[e,t]}),l2=(e,t)=>({...t2(e),options:[e,t]}),p2=(e,t)=>({...n2(e),options:[e,t]});var g2=(e,t)=>({...A2(e),options:[e,t]});var m2=(e,t)=>({...HO(e),options:[e,t]});var f2=w(_(),1);var $y=w(I(),1),$O="Arrow",b2=f2.forwardRef((e,t)=>{let{children:n,width:A=10,height:a=5,...o}=e;return(0,$y.jsx)(Z.svg,{...o,ref:t,width:A,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,$y.jsx)("polygon",{points:"0,0 30,0 15,10"})})});b2.displayName=$O;var h2=b2;var Po=w(_(),1),B2=w(I(),1);function ru(e,t=[]){let n=[];function A(o,r){let i=Po.createContext(r),s=n.length;n=[...n,r];function c(d){let{scope:l,children:p,...g}=d,b=l?.[e][s]||i,B=Po.useMemo(()=>g,Object.values(g));return(0,B2.jsx)(b.Provider,{value:B,children:p})}function u(d,l){let p=l?.[e][s]||i,g=Po.useContext(p);if(g)return g;if(r!==void 0)return r;throw new Error(`\`${d}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}let a=()=>{let o=n.map(r=>Po.createContext(r));return function(i){let s=i?.[e]||o;return Po.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return a.scopeName=e,[A,UO(a,...t)]}function UO(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let A=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){let r=A.reduce((i,{useScope:s,scopeName:c})=>{let d=s(o)[`__scope${c}`];return{...i,...d}},{});return Po.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var C2=w(_(),1);function Zf(e){let[t,n]=C2.useState(void 0);return Ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let A=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;let o=a[0],r,i;if("borderBoxSize"in o){let s=o.borderBoxSize,c=Array.isArray(s)?s[0]:s;r=c.inlineSize,i=c.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return A.observe(e,{box:"border-box"}),()=>A.unobserve(e)}else n(void 0)},[e]),t}var Yr=w(I(),1);var Ty="Popper",[w2,aa]=ru(Ty),[ZO,E2]=w2(Ty),y2=e=>{let{__scopePopper:t,children:n}=e,[A,a]=MA.useState(null);return(0,Yr.jsx)(ZO,{scope:t,anchor:A,onAnchorChange:a,children:n})};y2.displayName=Ty;var Q2="PopperAnchor",k2=MA.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:A,...a}=e,o=E2(Q2,n),r=MA.useRef(null),i=pe(t,r);return MA.useEffect(()=>{o.onAnchorChange(A?.current||r.current)}),A?null:(0,Yr.jsx)(Z.div,{...a,ref:i})});k2.displayName=Q2;var Uy="PopperContent",[qO,OO]=w2(Uy),I2=MA.forwardRef((e,t)=>{let{__scopePopper:n,side:A="bottom",sideOffset:a=0,align:o="center",alignOffset:r=0,arrowPadding:i=0,avoidCollisions:s=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:l=!1,updatePositionStrategy:p="optimized",onPlaced:g,...b}=e,B=E2(Uy,n),[f,m]=MA.useState(null),h=pe(t,$=>m($)),[C,E]=MA.useState(null),Q=Zf(C),y=Q?.width??0,k=Q?.height??0,R=A+(o!=="center"?"-"+o:""),F=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},U=Array.isArray(c)?c:[c],M=U.length>0,ce={padding:F,boundary:U.filter(KO),altBoundary:M},{refs:N,floatingStyles:te,placement:W,isPositioned:ne,middlewareData:K}=s2({strategy:"fixed",placement:R,whileElementsMounted:(...$)=>jy(...$,{animationFrame:p==="always"}),elements:{reference:B.anchor},middleware:[c2({mainAxis:a+k,alignmentAxis:r}),s&&u2({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?d2():void 0,...ce}),s&&l2({...ce}),p2({...ce,apply:({elements:$,rects:_e,availableWidth:Dt,availableHeight:Te})=>{let{width:Et,height:Xt}=_e.reference,UA=$.floating.style;UA.setProperty("--radix-popper-available-width",`${Dt}px`),UA.setProperty("--radix-popper-available-height",`${Te}px`),UA.setProperty("--radix-popper-anchor-width",`${Et}px`),UA.setProperty("--radix-popper-anchor-height",`${Xt}px`)}}),C&&m2({element:C,padding:i}),WO({arrowWidth:y,arrowHeight:k}),l&&g2({strategy:"referenceHidden",...ce})]}),[H,ve]=D2(W),Re=Je(g);Ne(()=>{ne&&Re?.()},[ne,Re]);let L=K.arrow?.x,ae=K.arrow?.y,ue=K.arrow?.centerOffset!==0,[Ae,Qe]=MA.useState();return Ne(()=>{f&&Qe(window.getComputedStyle(f).zIndex)},[f]),(0,Yr.jsx)("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:ne?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ae,"--radix-popper-transform-origin":[K.transformOrigin?.x,K.transformOrigin?.y].join(" "),...K.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,Yr.jsx)(qO,{scope:n,placedSide:H,onArrowChange:E,arrowX:L,arrowY:ae,shouldHideArrow:ue,children:(0,Yr.jsx)(Z.div,{"data-side":H,"data-align":ve,...b,ref:h,style:{...b.style,animation:ne?void 0:"none"}})})})});I2.displayName=Uy;var _2="PopperArrow",YO={top:"bottom",right:"left",bottom:"top",left:"right"},x2=MA.forwardRef(function(t,n){let{__scopePopper:A,...a}=t,o=OO(_2,A),r=YO[o.placedSide];return(0,Yr.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[r]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,Yr.jsx)(h2,{...a,ref:n,style:{...a.style,display:"block"}})})});x2.displayName=_2;function KO(e){return e!==null}var WO=e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:A,middlewareData:a}=t,r=a.arrow?.centerOffset!==0,i=r?0:e.arrowWidth,s=r?0:e.arrowHeight,[c,u]=D2(n),d={start:"0%",center:"50%",end:"100%"}[u],l=(a.arrow?.x??0)+i/2,p=(a.arrow?.y??0)+s/2,g="",b="";return c==="bottom"?(g=r?d:`${l}px`,b=`${-s}px`):c==="top"?(g=r?d:`${l}px`,b=`${A.floating.height+s}px`):c==="right"?(g=`${-s}px`,b=r?d:`${p}px`):c==="left"&&(g=`${A.floating.width+s}px`,b=r?d:`${p}px`),{data:{x:g,y:b}}}});function D2(e){let[t,n="center"]=e.split("-");return[t,n]}var jo=y2,Go=k2,Kr=I2,Wr=x2;var v2=w(_(),1);var F2=w(I(),1),JO="VisuallyHidden",ms=v2.forwardRef((e,t)=>(0,F2.jsx)(Z.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ms.displayName=JO;var S2=ms;var nn=w(I(),1),[Of,_he]=Pt("Tooltip",[aa]),Yf=aa(),L2="TooltipProvider",XO=700,Zy="tooltip.open",[eY,Oy]=Of(L2),R2=e=>{let{__scopeTooltip:t,delayDuration:n=XO,skipDelayDuration:A=300,disableHoverableContent:a=!1,children:o}=e,[r,i]=Ce.useState(!0),s=Ce.useRef(!1),c=Ce.useRef(0);return Ce.useEffect(()=>{let u=c.current;return()=>window.clearTimeout(u)},[]),(0,nn.jsx)(eY,{scope:t,isOpenDelayed:r,delayDuration:n,onOpen:Ce.useCallback(()=>{window.clearTimeout(c.current),i(!1)},[]),onClose:Ce.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i(!0),A)},[A]),isPointerInTransitRef:s,onPointerInTransitChange:Ce.useCallback(u=>{s.current=u},[]),disableHoverableContent:a,children:o})};R2.displayName=L2;var Kf="Tooltip",[tY,tp]=Of(Kf),M2=e=>{let{__scopeTooltip:t,children:n,open:A,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:r,delayDuration:i}=e,s=Oy(Kf,e.__scopeTooltip),c=Yf(t),[u,d]=Ce.useState(null),l=Pe(),p=Ce.useRef(0),g=r??s.disableHoverableContent,b=i??s.delayDuration,B=Ce.useRef(!1),[f=!1,m]=Tt({prop:A,defaultProp:a,onChange:y=>{y?(s.onOpen(),document.dispatchEvent(new CustomEvent(Zy))):s.onClose(),o?.(y)}}),h=Ce.useMemo(()=>f?B.current?"delayed-open":"instant-open":"closed",[f]),C=Ce.useCallback(()=>{window.clearTimeout(p.current),B.current=!1,m(!0)},[m]),E=Ce.useCallback(()=>{window.clearTimeout(p.current),m(!1)},[m]),Q=Ce.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{B.current=!0,m(!0)},b)},[b,m]);return Ce.useEffect(()=>()=>window.clearTimeout(p.current),[]),(0,nn.jsx)(jo,{...c,children:(0,nn.jsx)(tY,{scope:t,contentId:l,open:f,stateAttribute:h,trigger:u,onTriggerChange:d,onTriggerEnter:Ce.useCallback(()=>{s.isOpenDelayed?Q():C()},[s.isOpenDelayed,Q,C]),onTriggerLeave:Ce.useCallback(()=>{g?E():window.clearTimeout(p.current)},[E,g]),onOpen:C,onClose:E,disableHoverableContent:g,children:n})})};M2.displayName=Kf;var qy="TooltipTrigger",N2=Ce.forwardRef((e,t)=>{let{__scopeTooltip:n,...A}=e,a=tp(qy,n),o=Oy(qy,n),r=Yf(n),i=Ce.useRef(null),s=pe(t,i,a.onTriggerChange),c=Ce.useRef(!1),u=Ce.useRef(!1),d=Ce.useCallback(()=>c.current=!1,[]);return Ce.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,nn.jsx)(Go,{asChild:!0,...r,children:(0,nn.jsx)(Z.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...A,ref:s,onPointerMove:z(e.onPointerMove,l=>{l.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:z(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:z(e.onFocus,()=>{c.current||a.onOpen()}),onBlur:z(e.onBlur,a.onClose),onClick:z(e.onClick,a.onClose)})})});N2.displayName=qy;var Yy="TooltipPortal",[nY,AY]=Of(Yy,{forceMount:void 0}),aY=e=>{let{__scopeTooltip:t,forceMount:n,children:A,container:a}=e,o=tp(Yy,t);return(0,nn.jsx)(nY,{scope:t,forceMount:n,children:(0,nn.jsx)(jt,{present:n||o.open,children:(0,nn.jsx)(LA,{asChild:!0,container:a,children:A})})})};aY.displayName=Yy;var iu="TooltipContent",P2=Ce.forwardRef((e,t)=>{let n=AY(iu,e.__scopeTooltip),{forceMount:A=n.forceMount,side:a="top",...o}=e,r=tp(iu,e.__scopeTooltip);return(0,nn.jsx)(jt,{present:A||r.open,children:r.disableHoverableContent?(0,nn.jsx)(j2,{side:a,...o,ref:t}):(0,nn.jsx)(oY,{side:a,...o,ref:t})})}),oY=Ce.forwardRef((e,t)=>{let n=tp(iu,e.__scopeTooltip),A=Oy(iu,e.__scopeTooltip),a=Ce.useRef(null),o=pe(t,a),[r,i]=Ce.useState(null),{trigger:s,onClose:c}=n,u=a.current,{onPointerInTransitChange:d}=A,l=Ce.useCallback(()=>{i(null),d(!1)},[d]),p=Ce.useCallback((g,b)=>{let B=g.currentTarget,f={x:g.clientX,y:g.clientY},m=cY(f,B.getBoundingClientRect()),h=uY(f,m),C=dY(b.getBoundingClientRect()),E=pY([...h,...C]);i(E),d(!0)},[d]);return Ce.useEffect(()=>()=>l(),[l]),Ce.useEffect(()=>{if(s&&u){let g=B=>p(B,u),b=B=>p(B,s);return s.addEventListener("pointerleave",g),u.addEventListener("pointerleave",b),()=>{s.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",b)}}},[s,u,p,l]),Ce.useEffect(()=>{if(r){let g=b=>{let B=b.target,f={x:b.clientX,y:b.clientY},m=s?.contains(B)||u?.contains(B),h=!lY(f,r);m?l():h&&(l(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[s,u,r,c,l]),(0,nn.jsx)(j2,{...e,ref:o})}),[rY,iY]=Of(Kf,{isInside:!1}),j2=Ce.forwardRef((e,t)=>{let{__scopeTooltip:n,children:A,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:r,...i}=e,s=tp(iu,n),c=Yf(n),{onClose:u}=s;return Ce.useEffect(()=>(document.addEventListener(Zy,u),()=>document.removeEventListener(Zy,u)),[u]),Ce.useEffect(()=>{if(s.trigger){let d=l=>{l.target?.contains(s.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[s.trigger,u]),(0,nn.jsx)(ea,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:(0,nn.jsxs)(Kr,{"data-state":s.stateAttribute,...c,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,nn.jsx)(XE,{children:A}),(0,nn.jsx)(rY,{scope:n,isInside:!0,children:(0,nn.jsx)(S2,{id:s.contentId,role:"tooltip",children:a||A})})]})})});P2.displayName=iu;var G2="TooltipArrow",sY=Ce.forwardRef((e,t)=>{let{__scopeTooltip:n,...A}=e,a=Yf(n);return iY(G2,n).isInside?null:(0,nn.jsx)(Wr,{...a,...A,ref:t})});sY.displayName=G2;function cY(e,t){let n=Math.abs(t.top-e.y),A=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,A,a,o)){case o:return"left";case a:return"right";case n:return"top";case A:return"bottom";default:throw new Error("unreachable")}}function uY(e,t,n=5){let A=[];switch(t){case"top":A.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":A.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":A.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":A.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return A}function dY(e){let{top:t,right:n,bottom:A,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:A},{x:a,y:A}]}function lY(e,t){let{x:n,y:A}=e,a=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,u=t[r].y;s>A!=u>A&&n<(c-i)*(A-s)/(u-s)+i&&(a=!a)}return a}function pY(e){let t=e.slice();return t.sort((n,A)=>n.x<A.x?-1:n.x>A.x?1:n.y<A.y?-1:n.y>A.y?1:0),gY(t)}function gY(e){if(e.length<=1)return e.slice();let t=[];for(let A=0;A<e.length;A++){let a=e[A];for(;t.length>=2;){let o=t[t.length-1],r=t[t.length-2];if((o.x-r.x)*(a.y-r.y)>=(o.y-r.y)*(a.x-r.x))t.pop();else break}t.push(a)}t.pop();let n=[];for(let A=e.length-1;A>=0;A--){let a=e[A];for(;n.length>=2;){let o=n[n.length-1],r=n[n.length-2];if((o.x-r.x)*(a.y-r.y)>=(o.y-r.y)*(a.x-r.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var z2=R2,H2=M2,$2=N2;var Ky=P2;var U2=w(I(),1),Xe=z2,et=H2,Qt=$2,Oe=T2.forwardRef(({className:e,sideOffset:t=4,...n},A)=>(0,U2.jsx)(Ky,{ref:A,sideOffset:t,className:v("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Oe.displayName=Ky.displayName;var ye=w(I(),1),fY="sidebar:state",bY=60*60*24*7,hY="12.5rem",BY="16rem",CY="3rem",wY="b",Z2=ke.createContext(null);function su(){let e=ke.useContext(Z2);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var Wy=ke.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:A,style:a,children:o,...r},i)=>{let s=J1(),[c,u]=ke.useState(!1),[d,l]=ke.useState(e),p=t??d,g=ke.useCallback(m=>{let h=typeof m=="function"?m(p):m;n?n(h):l(h),document.cookie=`${fY}=${h}; path=/; max-age=${bY}`},[n,p]),b=ke.useCallback(()=>s?u(m=>!m):g(m=>!m),[s,g,u]);ke.useEffect(()=>{let m=h=>{h.key===wY&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),b())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[b]);let B=p?"expanded":"collapsed",f=ke.useMemo(()=>({state:B,open:p,setOpen:g,isMobile:s,openMobile:c,setOpenMobile:u,toggleSidebar:b}),[B,p,g,s,c,u,b]);return(0,ye.jsx)(Z2.Provider,{value:f,children:(0,ye.jsx)(Xe,{delayDuration:0,children:(0,ye.jsx)("div",{style:{"--sidebar-width":hY,"--sidebar-width-icon":CY,...a},className:v("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",A),ref:i,...r,children:o})})})});Wy.displayName="SidebarProvider";var Jy=ke.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:A,children:a,...o},r)=>{let{isMobile:i,state:s,openMobile:c,setOpenMobile:u}=su();return n==="none"?(0,ye.jsx)("div",{className:v("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",A),ref:r,...o,children:a}):i?(0,ye.jsx)(y9,{open:c,onOpenChange:u,...o,children:(0,ye.jsx)(Sy,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":BY},side:e,children:(0,ye.jsx)("div",{className:"flex h-full w-full flex-col",children:a})})}):(0,ye.jsxs)("div",{ref:r,className:"group peer hidden md:block text-sidebar-foreground","data-state":s,"data-collapsible":s==="collapsed"?n:"","data-variant":t,"data-side":e,children:[(0,ye.jsx)("div",{className:v("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,ye.jsx)("div",{className:v("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",A),...o,children:(0,ye.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});Jy.displayName="Sidebar";var EY=ke.forwardRef(({className:e,onClick:t,...n},A)=>{let{toggleSidebar:a}=su();return(0,ye.jsxs)(se,{ref:A,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:v("h-7 w-7",e),onClick:o=>{t?.(o),a()},...n,children:[(0,ye.jsx)(Va,{}),(0,ye.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});EY.displayName="SidebarTrigger";var Vy=ke.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:A}=su();return(0,ye.jsx)("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:A,title:"Toggle Sidebar",className:v("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Vy.displayName="SidebarRail";var yY=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("main",{ref:n,className:v("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));yY.displayName="SidebarInset";var QY=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)(We,{ref:n,"data-sidebar":"input",className:v("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));QY.displayName="SidebarInput";var Xy=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"header",className:v("flex flex-col gap-2 p-2",e),...t}));Xy.displayName="SidebarHeader";var e0=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"footer",className:v("flex flex-col gap-2 p-2",e),...t}));e0.displayName="SidebarFooter";var np=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)(oy,{ref:n,"data-sidebar":"separator",className:v("mx-2 w-auto bg-sidebar-border",e),...t}));np.displayName="SidebarSeparator";var t0=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"content",className:v("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));t0.displayName="SidebarContent";var Ap=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"group",className:v("relative flex w-full min-w-0 flex-col p-2",e),...t}));Ap.displayName="SidebarGroup";var n0=ke.forwardRef(({className:e,asChild:t=!1,...n},A)=>(0,ye.jsx)(t?Nt:"div",{ref:A,"data-sidebar":"group-label",className:v("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n}));n0.displayName="SidebarGroupLabel";var kY=ke.forwardRef(({className:e,asChild:t=!1,...n},A)=>(0,ye.jsx)(t?Nt:"button",{ref:A,"data-sidebar":"group-action",className:v("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n}));kY.displayName="SidebarGroupAction";var IY=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"group-content",className:v("w-full text-sm",e),...t}));IY.displayName="SidebarGroupContent";var oa=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("ul",{ref:n,"data-sidebar":"menu",className:v("flex w-full min-w-0 flex-col gap-1",e),...t}));oa.displayName="SidebarMenu";var ra=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("li",{ref:n,"data-sidebar":"menu-item",className:v("group/menu-item relative",e),...t}));ra.displayName="SidebarMenuItem";var _Y=VA("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),fA=ke.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:A="default",tooltip:a,className:o,...r},i)=>{let s=e?Nt:"button",{isMobile:c,state:u}=su(),d=(0,ye.jsx)(s,{ref:i,"data-sidebar":"menu-button","data-size":A,"data-active":t,className:v(_Y({variant:n,size:A}),o),...r});return a?(typeof a=="string"&&(a={children:a}),(0,ye.jsxs)(et,{children:[(0,ye.jsx)(Qt,{asChild:!0,children:d}),(0,ye.jsx)(Oe,{side:"right",align:"center",hidden:u!=="collapsed"||c,...a})]})):d});fA.displayName="SidebarMenuButton";var xY=ke.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...A},a)=>(0,ye.jsx)(t?Nt:"button",{ref:a,"data-sidebar":"menu-action",className:v("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...A}));xY.displayName="SidebarMenuAction";var A0=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"menu-badge",className:v("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));A0.displayName="SidebarMenuBadge";var DY=ke.forwardRef(({className:e,showIcon:t=!1,...n},A)=>{let a=ke.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,ye.jsxs)("div",{ref:A,"data-sidebar":"menu-skeleton",className:v("rounded-md h-8 flex gap-2 px-2 items-center",e),...n,children:[t&&(0,ye.jsx)(Ly,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,ye.jsx)(Ly,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});DY.displayName="SidebarMenuSkeleton";var cu=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("ul",{ref:n,"data-sidebar":"menu-sub",className:v("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));cu.displayName="SidebarMenuSub";var Wf=ke.forwardRef(({...e},t)=>(0,ye.jsx)("li",{ref:t,...e}));Wf.displayName="SidebarMenuSubItem";var Jf=ke.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:A,...a},o)=>(0,ye.jsx)(e?Nt:"a",{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:v("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",A),...a}));Jf.displayName="SidebarMenuSubButton";var vY=[{title:"Dashboard",url:"/dashboard",icon:Ll}],q2=vY;var In=w(_(),1);var fs=w(I(),1),a0="Collapsible",[FY,Vhe]=Pt(a0),[SY,o0]=FY(a0),O2=In.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:A,defaultOpen:a,disabled:o,onOpenChange:r,...i}=e,[s=!1,c]=Tt({prop:A,defaultProp:a,onChange:r});return(0,fs.jsx)(SY,{scope:n,disabled:o,contentId:Pe(),open:s,onOpenToggle:In.useCallback(()=>c(u=>!u),[c]),children:(0,fs.jsx)(Z.div,{"data-state":c0(s),"data-disabled":o?"":void 0,...i,ref:t})})});O2.displayName=a0;var Y2="CollapsibleTrigger",r0=In.forwardRef((e,t)=>{let{__scopeCollapsible:n,...A}=e,a=o0(Y2,n);return(0,fs.jsx)(Z.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":c0(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...A,ref:t,onClick:z(e.onClick,a.onOpenToggle)})});r0.displayName=Y2;var i0="CollapsibleContent",s0=In.forwardRef((e,t)=>{let{forceMount:n,...A}=e,a=o0(i0,e.__scopeCollapsible);return(0,fs.jsx)(jt,{present:n||a.open,children:({present:o})=>(0,fs.jsx)(LY,{...A,ref:t,present:o})})});s0.displayName=i0;var LY=In.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:A,children:a,...o}=e,r=o0(i0,n),[i,s]=In.useState(A),c=In.useRef(null),u=pe(t,c),d=In.useRef(0),l=d.current,p=In.useRef(0),g=p.current,b=r.open||i,B=In.useRef(b),f=In.useRef();return In.useEffect(()=>{let m=requestAnimationFrame(()=>B.current=!1);return()=>cancelAnimationFrame(m)},[]),Ne(()=>{let m=c.current;if(m){f.current=f.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";let h=m.getBoundingClientRect();d.current=h.height,p.current=h.width,B.current||(m.style.transitionDuration=f.current.transitionDuration,m.style.animationName=f.current.animationName),s(A)}},[r.open,A]),(0,fs.jsx)(Z.div,{"data-state":c0(r.open),"data-disabled":r.disabled?"":void 0,id:r.contentId,hidden:!b,...o,ref:u,style:{"--radix-collapsible-content-height":l?`${l}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:b&&a})});function c0(e){return e?"open":"closed"}var K2=O2;var ap=K2,op=r0,rp=s0;var _n=w(I(),1),W2=()=>{let e=D(n=>n.activeRoute),t=n=>n.map(A=>{let a=A.items?.length;return(0,_n.jsx)(ap,{asChild:!0,defaultOpen:A.isActive,className:"group/collapsible",children:(0,_n.jsxs)(ra,{children:[(0,_n.jsx)(op,{asChild:!0,children:(0,_n.jsx)(fA,{asChild:!0,isActive:e===A.url,className:"data-[active=true]:bg-neutral-800 data-[active=true]:text-white data-[active=true]:dark:bg-neutral-100 data-[active=true]:dark:text-black whitespace-nowrap",tooltip:A.title,children:(0,_n.jsxs)("a",{href:A.url,target:A.url.split("")[0]==="/"?"_top":"_blank",children:[A.icon&&(0,_n.jsx)(A.icon,{}),(0,_n.jsx)("span",{children:A.title}),a&&(0,_n.jsxs)(_n.Fragment,{children:[(0,_n.jsx)(Wa,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:hidden"}),(0,_n.jsx)(va,{className:"ml-auto transition-transform duration-200 group-data-[state=closed]/collapsible:hidden"})]})]})})}),A.items&&a&&(0,_n.jsx)(rp,{children:(0,_n.jsx)(cu,{children:t(A.items)})})]})},A.title)});return(0,_n.jsx)(oa,{children:t(q2)})};var Ra=w(I(),1),J2=()=>{let{resolvedTheme:e}=Rr();return(0,Ra.jsx)(oa,{children:(0,Ra.jsx)(ra,{children:(0,Ra.jsx)(fA,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground whitespace-nowrap",asChild:!0,children:(0,Ra.jsxs)("a",{href:"/",children:[(0,Ra.jsx)("div",{className:"flex items-center justify-center aspect-square h-full",children:(0,Ra.jsx)(U1,{color:e==="dark"?"white":"black",className:"flex items-center justify-center"})}),(0,Ra.jsx)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:(0,Ra.jsxs)("span",{className:"truncate font-semibold",children:["vlt",(0,Ra.jsx)("span",{className:"ml-1 truncate font-light",children:"/volt/"})]})})]})})})})};var Vf=w(_(),1);var zo=w(I(),1),V2=()=>{let e=D(a=>a.activeRoute),t=D(a=>a.savedQueries),[n,A]=(0,Vf.useState)(0);return(0,Vf.useEffect)(()=>{A(t?t.length:0)},[t]),(0,zo.jsx)(oa,{children:(0,zo.jsx)(ra,{children:(0,zo.jsx)(fA,{isActive:e==="/queries",asChild:!0,tooltip:"Saved queries",className:"data-[active=true]:bg-neutral-800 data-[active=true]:text-white data-[active=true]:dark:bg-neutral-100 data-[active=true]:dark:text-black",children:(0,zo.jsxs)("a",{href:"/queries",className:"text-foreground ",children:[(0,zo.jsx)(Do,{}),(0,zo.jsx)("span",{children:"Queries"}),(0,zo.jsx)(A0,{className:e==="/queries"?"text-white dark:text-black":"",children:n!==0?n:void 0})]})})})})};var xs=w(_(),1);var ca=w(_(),1);var tb=w(_(),1),MY=1,NY=1e6;var u0=0;function PY(){return u0=(u0+1)%Number.MAX_SAFE_INTEGER,u0.toString()}var d0=new Map,X2=e=>{if(d0.has(e))return;let t=setTimeout(()=>{d0.delete(e),ip({type:"REMOVE_TOAST",toastId:e})},NY);d0.set(e,t)},jY=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,MY)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{let{toastId:n}=t;return n?X2(n):e.toasts.forEach(A=>{X2(A.id)}),{...e,toasts:e.toasts.map(A=>A.id===n||n===void 0?{...A,open:!1}:A)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Xf=[],eb={toasts:[]};function ip(e){eb=jY(eb,e),Xf.forEach(t=>{t(eb)})}function GY({...e}){let t=PY(),n=a=>ip({type:"UPDATE_TOAST",toast:{...a,id:t}}),A=()=>ip({type:"DISMISS_TOAST",toastId:t});return ip({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||A()}}}),{id:t,dismiss:A,update:n}}function zn(){let[e,t]=tb.useState(eb);return tb.useEffect(()=>(Xf.push(t),()=>{let n=Xf.indexOf(t);n>-1&&Xf.splice(n,1)}),[e]),{...e,toast:GY,dismiss:n=>ip({type:"DISMISS_TOAST",toastId:n})}}var uS=w(_(),1);var NA=w(_(),1);var tS=w(_(),1);function eS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function l0(...e){return t=>{let n=!1,A=e.map(a=>{let o=eS(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a<A.length;a++){let o=A[a];typeof o=="function"?o():eS(e[a],null)}}}}function nb(...e){return tS.useCallback(l0(...e),e)}function p0(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}var Ab=w(_(),1);function ab(e){let t=Ab.useRef({value:e,previous:e});return Ab.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var bA=w(_(),1);var nS=w(_(),1);function zY(e,t){return nS.useReducer((n,A)=>t[n][A]??n,e)}var g0=e=>{let{present:t,children:n}=e,A=HY(t),a=typeof n=="function"?n({present:A.isPresent}):bA.Children.only(n),o=nb(A.ref,$Y(a));return typeof n=="function"||A.isPresent?bA.cloneElement(a,{ref:o}):null};g0.displayName="Presence";function HY(e){let[t,n]=bA.useState(),A=bA.useRef({}),a=bA.useRef(e),o=bA.useRef("none"),r=e?"mounted":"unmounted",[i,s]=zY(r,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return bA.useEffect(()=>{let c=ob(A.current);o.current=i==="mounted"?c:"none"},[i]),Ne(()=>{let c=A.current,u=a.current;if(u!==e){let l=o.current,p=ob(c);e?s("MOUNT"):p==="none"||c?.display==="none"?s("UNMOUNT"):s(u&&l!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,s]),Ne(()=>{if(t){let c,u=t.ownerDocument.defaultView??window,d=p=>{let b=ob(A.current).includes(p.animationName);if(p.target===t&&b&&(s("ANIMATION_END"),!a.current)){let B=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=B)})}},l=p=>{p.target===t&&(o.current=ob(A.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:bA.useCallback(c=>{c&&(A.current=getComputedStyle(c)),n(c)},[])}}function ob(e){return e?.animationName||"none"}function $Y(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var AS=w(_(),1),OY=w(Lr(),1);var xn=w(_(),1);var uu=w(I(),1),f0=xn.forwardRef((e,t)=>{let{children:n,...A}=e,a=xn.Children.toArray(n),o=a.find(UY);if(o){let r=o.props.children,i=a.map(s=>s===o?xn.Children.count(r)>1?xn.Children.only(null):xn.isValidElement(r)?r.props.children:null:s);return(0,uu.jsx)(m0,{...A,ref:t,children:xn.isValidElement(r)?xn.cloneElement(r,void 0,i):null})}return(0,uu.jsx)(m0,{...A,ref:t,children:n})});f0.displayName="Slot";var m0=xn.forwardRef((e,t)=>{let{children:n,...A}=e;if(xn.isValidElement(n)){let a=qY(n);return xn.cloneElement(n,{...ZY(A,n.props),ref:t?l0(t,a):a})}return xn.Children.count(n)>1?xn.Children.only(null):null});m0.displayName="SlotClone";var TY=({children:e})=>(0,uu.jsx)(uu.Fragment,{children:e});function UY(e){return xn.isValidElement(e)&&e.type===TY}function ZY(e,t){let n={...t};for(let A in t){let a=e[A],o=t[A];/^on[A-Z]/.test(A)?a&&o?n[A]=(...i)=>{o(...i),a(...i)}:a&&(n[A]=a):A==="style"?n[A]={...a,...o}:A==="className"&&(n[A]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function qY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aS=w(I(),1),YY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],bs=YY.reduce((e,t)=>{let n=AS.forwardRef((A,a)=>{let{asChild:o,...r}=A,i=o?f0:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,aS.jsx)(i,{...r,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});var Vr=w(I(),1),b0="Checkbox",[KY,LBe]=Pt(b0),[WY,JY]=KY(b0),oS=NA.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:A,checked:a,defaultChecked:o,required:r,disabled:i,value:s="on",onCheckedChange:c,form:u,...d}=e,[l,p]=NA.useState(null),g=nb(t,C=>p(C)),b=NA.useRef(!1),B=l?u||!!l.closest("form"):!0,[f=!1,m]=Tt({prop:a,defaultProp:o,onChange:c}),h=NA.useRef(f);return NA.useEffect(()=>{let C=l?.form;if(C){let E=()=>m(h.current);return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[l,m]),(0,Vr.jsxs)(WY,{scope:n,state:f,disabled:i,children:[(0,Vr.jsx)(bs.button,{type:"button",role:"checkbox","aria-checked":Jr(f)?"mixed":f,"aria-required":r,"data-state":sS(f),"data-disabled":i?"":void 0,disabled:i,value:s,...d,ref:g,onKeyDown:p0(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:p0(e.onClick,C=>{m(E=>Jr(E)?!0:!E),B&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})}),B&&(0,Vr.jsx)(VY,{control:l,bubbles:!b.current,name:A,value:s,checked:f,required:r,disabled:i,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Jr(o)?!1:o})]})});oS.displayName=b0;var rS="CheckboxIndicator",iS=NA.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:A,...a}=e,o=JY(rS,n);return(0,Vr.jsx)(g0,{present:A||Jr(o.state)||o.state===!0,children:(0,Vr.jsx)(bs.span,{"data-state":sS(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});iS.displayName=rS;var VY=e=>{let{control:t,checked:n,bubbles:A=!0,defaultChecked:a,...o}=e,r=NA.useRef(null),i=ab(n),s=Zf(t);NA.useEffect(()=>{let u=r.current,d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(i!==n&&p){let g=new Event("click",{bubbles:A});u.indeterminate=Jr(n),p.call(u,Jr(n)?!1:n),u.dispatchEvent(g)}},[i,n,A]);let c=NA.useRef(Jr(n)?!1:n);return(0,Vr.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??c.current,...o,tabIndex:-1,ref:r,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Jr(e){return e==="indeterminate"}function sS(e){return Jr(e)?"indeterminate":e?"checked":"unchecked"}var h0=oS,cS=iS;var rb=w(I(),1),Ho=uS.forwardRef(({className:e,...t},n)=>(0,rb.jsx)(h0,{ref:n,className:v("peer h-4 w-4 shrink-0 rounded-sm border border-primary 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-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:(0,rb.jsx)(cS,{className:v("flex items-center justify-center text-current"),children:(0,rb.jsx)(Da,{className:"h-4 w-4"})})}));Ho.displayName=h0.displayName;var dS=w(_(),1);var lS=w(I(),1),Gt=(0,dS.forwardRef)(({className:e,...t},n)=>(0,lS.jsx)("div",{ref:n,className:v("rounded-md border px-2.5 py-0.5 text-xs font-semibold",e),...t}));Gt.displayName="Label";var ib=w(_(),1);var pS=w(I(),1),eK=VA("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function $o({className:e,variant:t,...n}){return(0,pS.jsx)("div",{className:v(eK({variant:t}),e),...n})}var gS=w(I(),1),tK=(e,t)=>{if(!e.startsWith("#")||e.length!==7&&e.length!==4)throw new Error("Invalid hex color. Must be in #RRGGBB or #RGB format.");e.length===4&&(e=`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);let n=parseInt(e.slice(1,3),16),A=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16),o=(.2126*n+.7152*A+.0722*a)/255;return t==="dark"?o>.55?"black":"white":o>.618?"black":"white"},ia=({name:e,color:t,className:n=""})=>{let{resolvedTheme:A}=Rr(),[a,o]=(0,ib.useState)("");return(0,ib.useEffect)(()=>{t&&o(tK(t,A))},[t,A]),(0,gS.jsx)($o,{style:{backgroundColor:t,color:a},className:`font-medium ${n}`,children:e})};var ei=w(_(),1);var mS=1,nK=.9,AK=.8,aK=.17,B0=.1,C0=.999,oK=.9999,rK=.99,iK=/[\\\/_+.#"@\[\(\{&]/,sK=/[\\\/_+.#"@\[\(\{&]/g,cK=/[\s-]/,bS=/[\s-]/g;function w0(e,t,n,A,a,o,r){if(o===t.length)return a===e.length?mS:rK;var i=`${a},${o}`;if(r[i]!==void 0)return r[i];for(var s=A.charAt(o),c=n.indexOf(s,a),u=0,d,l,p,g;c>=0;)d=w0(e,t,n,A,c+1,o+1,r),d>u&&(c===a?d*=mS:iK.test(e.charAt(c-1))?(d*=AK,p=e.slice(a,c-1).match(sK),p&&a>0&&(d*=Math.pow(C0,p.length))):cK.test(e.charAt(c-1))?(d*=nK,g=e.slice(a,c-1).match(bS),g&&a>0&&(d*=Math.pow(C0,g.length))):(d*=aK,a>0&&(d*=Math.pow(C0,c-a))),e.charAt(c)!==t.charAt(o)&&(d*=oK)),(d<B0&&n.charAt(c-1)===A.charAt(o+1)||A.charAt(o+1)===A.charAt(o)&&n.charAt(c-1)!==A.charAt(o))&&(l=w0(e,t,n,A,c+1,o+2,r),l*B0>d&&(d=l*B0)),d>u&&(u=d),c=n.indexOf(s,c+1);return r[i]=u,u}function fS(e){return e.toLowerCase().replace(bS," ")}function hS(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,w0(e,t,fS(e),fS(t),0,0,{})}var J=w(_(),1);var CS=w(TE(),1),sp='[cmdk-group=""]',E0='[cmdk-group-items=""]',uK='[cmdk-group-heading=""]',Q0='[cmdk-item=""]',BS=`${Q0}:not([aria-disabled="true"])`,y0="cmdk-item-select",hs="data-value",dK=(e,t,n)=>hS(e,t,n),wS=J.createContext(void 0),up=()=>J.useContext(wS),ES=J.createContext(void 0),k0=()=>J.useContext(ES),yS=J.createContext(void 0),QS=J.forwardRef((e,t)=>{let n=du(()=>{var L,ae;return{search:"",value:(ae=(L=e.value)!=null?L:e.defaultValue)!=null?ae:"",filtered:{count:0,items:new Map,groups:new Set}}}),A=du(()=>new Set),a=du(()=>new Map),o=du(()=>new Map),r=du(()=>new Set),i=kS(e),{label:s,children:c,value:u,onValueChange:d,filter:l,shouldFilter:p,loop:g,disablePointerSelection:b=!1,vimBindings:B=!0,...f}=e,m=Pe(),h=Pe(),C=Pe(),E=J.useRef(null),Q=EK();Bs(()=>{if(u!==void 0){let L=u.trim();n.current.value=L,y.emit()}},[u]),Bs(()=>{Q(6,ce)},[]);let y=J.useMemo(()=>({subscribe:L=>(r.current.add(L),()=>r.current.delete(L)),snapshot:()=>n.current,setState:(L,ae,ue)=>{var Ae,Qe,$;if(!Object.is(n.current[L],ae)){if(n.current[L]=ae,L==="search")M(),F(),Q(1,U);else if(L==="value"&&(ue||Q(5,ce),((Ae=i.current)==null?void 0:Ae.value)!==void 0)){let _e=ae??"";($=(Qe=i.current).onValueChange)==null||$.call(Qe,_e);return}y.emit()}},emit:()=>{r.current.forEach(L=>L())}}),[]),k=J.useMemo(()=>({value:(L,ae,ue)=>{var Ae;ae!==((Ae=o.current.get(L))==null?void 0:Ae.value)&&(o.current.set(L,{value:ae,keywords:ue}),n.current.filtered.items.set(L,R(ae,ue)),Q(2,()=>{F(),y.emit()}))},item:(L,ae)=>(A.current.add(L),ae&&(a.current.has(ae)?a.current.get(ae).add(L):a.current.set(ae,new Set([L]))),Q(3,()=>{M(),F(),n.current.value||U(),y.emit()}),()=>{o.current.delete(L),A.current.delete(L),n.current.filtered.items.delete(L);let ue=N();Q(4,()=>{M(),ue?.getAttribute("id")===L&&U(),y.emit()})}),group:L=>(a.current.has(L)||a.current.set(L,new Set),()=>{o.current.delete(L),a.current.delete(L)}),filter:()=>i.current.shouldFilter,label:s||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:m,inputId:C,labelId:h,listInnerRef:E}),[]);function R(L,ae){var ue,Ae;let Qe=(Ae=(ue=i.current)==null?void 0:ue.filter)!=null?Ae:dK;return L?Qe(L,n.current.search,ae):0}function F(){if(!n.current.search||i.current.shouldFilter===!1)return;let L=n.current.filtered.items,ae=[];n.current.filtered.groups.forEach(Ae=>{let Qe=a.current.get(Ae),$=0;Qe.forEach(_e=>{let Dt=L.get(_e);$=Math.max(Dt,$)}),ae.push([Ae,$])});let ue=E.current;te().sort((Ae,Qe)=>{var $,_e;let Dt=Ae.getAttribute("id"),Te=Qe.getAttribute("id");return(($=L.get(Te))!=null?$:0)-((_e=L.get(Dt))!=null?_e:0)}).forEach(Ae=>{let Qe=Ae.closest(E0);Qe?Qe.appendChild(Ae.parentElement===Qe?Ae:Ae.closest(`${E0} > *`)):ue.appendChild(Ae.parentElement===ue?Ae:Ae.closest(`${E0} > *`))}),ae.sort((Ae,Qe)=>Qe[1]-Ae[1]).forEach(Ae=>{var Qe;let $=(Qe=E.current)==null?void 0:Qe.querySelector(`${sp}[${hs}="${encodeURIComponent(Ae[0])}"]`);$?.parentElement.appendChild($)})}function U(){let L=te().find(ue=>ue.getAttribute("aria-disabled")!=="true"),ae=L?.getAttribute(hs);y.setState("value",ae||void 0)}function M(){var L,ae,ue,Ae;if(!n.current.search||i.current.shouldFilter===!1){n.current.filtered.count=A.current.size;return}n.current.filtered.groups=new Set;let Qe=0;for(let $ of A.current){let _e=(ae=(L=o.current.get($))==null?void 0:L.value)!=null?ae:"",Dt=(Ae=(ue=o.current.get($))==null?void 0:ue.keywords)!=null?Ae:[],Te=R(_e,Dt);n.current.filtered.items.set($,Te),Te>0&&Qe++}for(let[$,_e]of a.current)for(let Dt of _e)if(n.current.filtered.items.get(Dt)>0){n.current.filtered.groups.add($);break}n.current.filtered.count=Qe}function ce(){var L,ae,ue;let Ae=N();Ae&&(((L=Ae.parentElement)==null?void 0:L.firstChild)===Ae&&((ue=(ae=Ae.closest(sp))==null?void 0:ae.querySelector(uK))==null||ue.scrollIntoView({block:"nearest"})),Ae.scrollIntoView({block:"nearest"}))}function N(){var L;return(L=E.current)==null?void 0:L.querySelector(`${Q0}[aria-selected="true"]`)}function te(){var L;return Array.from(((L=E.current)==null?void 0:L.querySelectorAll(BS))||[])}function W(L){let ae=te()[L];ae&&y.setState("value",ae.getAttribute(hs))}function ne(L){var ae;let ue=N(),Ae=te(),Qe=Ae.findIndex(_e=>_e===ue),$=Ae[Qe+L];(ae=i.current)!=null&&ae.loop&&($=Qe+L<0?Ae[Ae.length-1]:Qe+L===Ae.length?Ae[0]:Ae[Qe+L]),$&&y.setState("value",$.getAttribute(hs))}function K(L){let ae=N(),ue=ae?.closest(sp),Ae;for(;ue&&!Ae;)ue=L>0?CK(ue,sp):wK(ue,sp),Ae=ue?.querySelector(BS);Ae?y.setState("value",Ae.getAttribute(hs)):ne(L)}let H=()=>W(te().length-1),ve=L=>{L.preventDefault(),L.metaKey?H():L.altKey?K(1):ne(1)},Re=L=>{L.preventDefault(),L.metaKey?W(0):L.altKey?K(-1):ne(-1)};return J.createElement(Z.div,{ref:t,tabIndex:-1,...f,"cmdk-root":"",onKeyDown:L=>{var ae;if((ae=f.onKeyDown)==null||ae.call(f,L),!L.defaultPrevented)switch(L.key){case"n":case"j":{B&&L.ctrlKey&&ve(L);break}case"ArrowDown":{ve(L);break}case"p":case"k":{B&&L.ctrlKey&&Re(L);break}case"ArrowUp":{Re(L);break}case"Home":{L.preventDefault(),W(0);break}case"End":{L.preventDefault(),H();break}case"Enter":if(!L.nativeEvent.isComposing&&L.keyCode!==229){L.preventDefault();let ue=N();if(ue){let Ae=new Event(y0);ue.dispatchEvent(Ae)}}}}},J.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:QK},s),sb(e,L=>J.createElement(ES.Provider,{value:y},J.createElement(wS.Provider,{value:k},L))))}),lK=J.forwardRef((e,t)=>{var n,A;let a=Pe(),o=J.useRef(null),r=J.useContext(yS),i=up(),s=kS(e),c=(A=(n=s.current)==null?void 0:n.forceMount)!=null?A:r?.forceMount;Bs(()=>{if(!c)return i.item(a,r?.id)},[c]);let u=IS(a,o,[e.value,e.children,o],e.keywords),d=k0(),l=Cs(Q=>Q.value&&Q.value===u.current),p=Cs(Q=>c||i.filter()===!1?!0:Q.search?Q.filtered.items.get(a)>0:!0);J.useEffect(()=>{let Q=o.current;if(!(!Q||e.disabled))return Q.addEventListener(y0,g),()=>Q.removeEventListener(y0,g)},[p,e.onSelect,e.disabled]);function g(){var Q,y;b(),(y=(Q=s.current).onSelect)==null||y.call(Q,u.current)}function b(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:B,value:f,onSelect:m,forceMount:h,keywords:C,...E}=e;return J.createElement(Z.div,{ref:cp([o,t]),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!B,"aria-selected":!!l,"data-disabled":!!B,"data-selected":!!l,onPointerMove:B||i.getDisablePointerSelection()?void 0:b,onClick:B?void 0:g},e.children)}),pK=J.forwardRef((e,t)=>{let{heading:n,children:A,forceMount:a,...o}=e,r=Pe(),i=J.useRef(null),s=J.useRef(null),c=Pe(),u=up(),d=Cs(p=>a||u.filter()===!1?!0:p.search?p.filtered.groups.has(r):!0);Bs(()=>u.group(r),[]),IS(r,i,[e.value,e.heading,s]);let l=J.useMemo(()=>({id:r,forceMount:a}),[a]);return J.createElement(Z.div,{ref:cp([i,t]),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&J.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),sb(e,p=>J.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},J.createElement(yS.Provider,{value:l},p))))}),gK=J.forwardRef((e,t)=>{let{alwaysRender:n,...A}=e,a=J.useRef(null),o=Cs(r=>!r.search);return!n&&!o?null:J.createElement(Z.div,{ref:cp([a,t]),...A,"cmdk-separator":"",role:"separator"})}),mK=J.forwardRef((e,t)=>{let{onValueChange:n,...A}=e,a=e.value!=null,o=k0(),r=Cs(u=>u.search),i=Cs(u=>u.value),s=up(),c=J.useMemo(()=>{var u;let d=(u=s.listInnerRef.current)==null?void 0:u.querySelector(`${Q0}[${hs}="${encodeURIComponent(i)}"]`);return d?.getAttribute("id")},[]);return J.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),J.createElement(Z.input,{ref:t,...A,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":c,id:s.inputId,type:"text",value:a?e.value:r,onChange:u=>{a||o.setState("search",u.target.value),n?.(u.target.value)}})}),fK=J.forwardRef((e,t)=>{let{children:n,label:A="Suggestions",...a}=e,o=J.useRef(null),r=J.useRef(null),i=up();return J.useEffect(()=>{if(r.current&&o.current){let s=r.current,c=o.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let l=s.offsetHeight;c.style.setProperty("--cmdk-list-height",l.toFixed(1)+"px")})});return d.observe(s),()=>{cancelAnimationFrame(u),d.unobserve(s)}}},[]),J.createElement(Z.div,{ref:cp([o,t]),...a,"cmdk-list":"",role:"listbox","aria-label":A,id:i.listId},sb(e,s=>J.createElement("div",{ref:cp([r,i.listInnerRef]),"cmdk-list-sizer":""},s)))}),bK=J.forwardRef((e,t)=>{let{open:n,onOpenChange:A,overlayClassName:a,contentClassName:o,container:r,...i}=e;return J.createElement(Xc,{open:n,onOpenChange:A},J.createElement(eu,{container:r},J.createElement(qr,{"cmdk-overlay":"",className:a}),J.createElement(Or,{"aria-label":e.label,"cmdk-dialog":"",className:o},J.createElement(QS,{ref:t,...i}))))}),hK=J.forwardRef((e,t)=>Cs(n=>n.filtered.count===0)?J.createElement(Z.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),BK=J.forwardRef((e,t)=>{let{progress:n,children:A,label:a="Loading...",...o}=e;return J.createElement(Z.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},sb(e,r=>J.createElement("div",{"aria-hidden":!0},r)))}),Xn=Object.assign(QS,{List:fK,Item:lK,Input:mK,Group:pK,Separator:gK,Dialog:bK,Empty:hK,Loading:BK});function CK(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wK(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function kS(e){let t=J.useRef(e);return Bs(()=>{t.current=e}),t}var Bs=typeof window>"u"?J.useEffect:J.useLayoutEffect;function du(e){let t=J.useRef();return t.current===void 0&&(t.current=e()),t}function cp(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Cs(e){let t=k0(),n=()=>e(t.snapshot());return(0,CS.useSyncExternalStore)(t.subscribe,n,n)}function IS(e,t,n,A=[]){let a=J.useRef(),o=up();return Bs(()=>{var r;let i=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():a.current}})(),s=A.map(c=>c.trim());o.value(e,i,s),(r=t.current)==null||r.setAttribute(hs,i),a.current=i}),a}var EK=()=>{let[e,t]=J.useState(),n=du(()=>new Map);return Bs(()=>{n.current.forEach(A=>A()),n.current=new Map},[e]),(A,a)=>{n.current.set(A,a),t({})}};function yK(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function sb({asChild:e,children:t},n){return e&&J.isValidElement(t)?J.cloneElement(yK(t),{ref:t.ref},n(t.props.children)):n(t)}var QK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};var dp=w(_(),1);var PA=w(I(),1),ws=Xc,lu=vy,kK=eu,_S=Yl,xS=dp.forwardRef(({className:e,...t},n)=>(0,PA.jsx)(qr,{ref:n,className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));xS.displayName=qr.displayName;var Xr=dp.forwardRef(({className:e,children:t,...n},A)=>(0,PA.jsxs)(kK,{children:[(0,PA.jsx)(xS,{}),(0,PA.jsxs)(Or,{ref:A,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,(0,PA.jsxs)(Yl,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,PA.jsx)(vo,{className:"h-4 w-4"}),(0,PA.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Xr.displayName=Or.displayName;var Es=({className:e,...t})=>(0,PA.jsx)("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Es.displayName="DialogHeader";var ys=({className:e,...t})=>(0,PA.jsx)("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ys.displayName="DialogFooter";var Qs=dp.forwardRef(({className:e,...t},n)=>(0,PA.jsx)(tu,{ref:n,className:v("text-lg font-semibold leading-none tracking-tight",e),...t}));Qs.displayName=tu.displayName;var ks=dp.forwardRef(({className:e,...t},n)=>(0,PA.jsx)(nu,{ref:n,className:v("text-sm text-muted-foreground",e),...t}));ks.displayName=nu.displayName;var sa=w(I(),1),I0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn,{ref:n,className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));I0.displayName=Xn.displayName;var _0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,sa.jsx)(xo,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,sa.jsx)(Xn.Input,{ref:n,className:v("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));_0.displayName=Xn.Input.displayName;var x0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn.List,{ref:n,className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));x0.displayName=Xn.List.displayName;var D0=ei.forwardRef((e,t)=>(0,sa.jsx)(Xn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));D0.displayName=Xn.Empty.displayName;var v0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn.Group,{ref:n,className:v("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));v0.displayName=Xn.Group.displayName;var IK=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn.Separator,{ref:n,className:v("-mx-1 h-px bg-border",e),...t}));IK.displayName=Xn.Separator.displayName;var F0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn.Item,{ref:n,className:v("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));F0.displayName=Xn.Item.displayName;var _K=({className:e,...t})=>(0,sa.jsx)("span",{className:v("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});_K.displayName="CommandShortcut";var _s=w(_(),1);var ni=w(_(),1);var $S=w(_(),1);var kt=w(_(),1);var An=w(I(),1),S0="Popover",[DS,BCe]=Pt(S0,[aa]),lp=aa(),[xK,ti]=DS(S0),vS=e=>{let{__scopePopover:t,children:n,open:A,defaultOpen:a,onOpenChange:o,modal:r=!1}=e,i=lp(t),s=kt.useRef(null),[c,u]=kt.useState(!1),[d=!1,l]=Tt({prop:A,defaultProp:a,onChange:o});return(0,An.jsx)(jo,{...i,children:(0,An.jsx)(xK,{scope:t,contentId:Pe(),triggerRef:s,open:d,onOpenChange:l,onOpenToggle:kt.useCallback(()=>l(p=>!p),[l]),hasCustomAnchor:c,onCustomAnchorAdd:kt.useCallback(()=>u(!0),[]),onCustomAnchorRemove:kt.useCallback(()=>u(!1),[]),modal:r,children:n})})};vS.displayName=S0;var FS="PopoverAnchor",DK=kt.forwardRef((e,t)=>{let{__scopePopover:n,...A}=e,a=ti(FS,n),o=lp(n),{onCustomAnchorAdd:r,onCustomAnchorRemove:i}=a;return kt.useEffect(()=>(r(),()=>i()),[r,i]),(0,An.jsx)(Go,{...o,...A,ref:t})});DK.displayName=FS;var SS="PopoverTrigger",LS=kt.forwardRef((e,t)=>{let{__scopePopover:n,...A}=e,a=ti(SS,n),o=lp(n),r=pe(t,a.triggerRef),i=(0,An.jsx)(Z.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":jS(a.open),...A,ref:r,onClick:z(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?i:(0,An.jsx)(Go,{asChild:!0,...o,children:i})});LS.displayName=SS;var L0="PopoverPortal",[vK,FK]=DS(L0,{forceMount:void 0}),RS=e=>{let{__scopePopover:t,forceMount:n,children:A,container:a}=e,o=ti(L0,t);return(0,An.jsx)(vK,{scope:t,forceMount:n,children:(0,An.jsx)(jt,{present:n||o.open,children:(0,An.jsx)(LA,{asChild:!0,container:a,children:A})})})};RS.displayName=L0;var pu="PopoverContent",MS=kt.forwardRef((e,t)=>{let n=FK(pu,e.__scopePopover),{forceMount:A=n.forceMount,...a}=e,o=ti(pu,e.__scopePopover);return(0,An.jsx)(jt,{present:A||o.open,children:o.modal?(0,An.jsx)(SK,{...a,ref:t}):(0,An.jsx)(LK,{...a,ref:t})})});MS.displayName=pu;var SK=kt.forwardRef((e,t)=>{let n=ti(pu,e.__scopePopover),A=kt.useRef(null),a=pe(t,A),o=kt.useRef(!1);return kt.useEffect(()=>{let r=A.current;if(r)return Zr(r)},[]),(0,An.jsx)(Lo,{as:Nt,allowPinchZoom:!0,children:(0,An.jsx)(NS,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,r=>{r.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,r=>{let i=r.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0,c=i.button===2||s;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:z(e.onFocusOutside,r=>r.preventDefault(),{checkForDefaultPrevented:!1})})})}),LK=kt.forwardRef((e,t)=>{let n=ti(pu,e.__scopePopover),A=kt.useRef(!1),a=kt.useRef(!1);return(0,An.jsx)(NS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(A.current||n.triggerRef.current?.focus(),o.preventDefault()),A.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(A.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));let r=o.target;n.triggerRef.current?.contains(r)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),NS=kt.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:A,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:r,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:u,...d}=e,l=ti(pu,n),p=lp(n);return Ur(),(0,An.jsx)(So,{asChild:!0,loop:!0,trapped:A,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,An.jsx)(ea,{asChild:!0,disableOutsidePointerEvents:r,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>l.onOpenChange(!1),children:(0,An.jsx)(Kr,{"data-state":jS(l.open),role:"dialog",id:l.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),PS="PopoverClose",RK=kt.forwardRef((e,t)=>{let{__scopePopover:n,...A}=e,a=ti(PS,n);return(0,An.jsx)(Z.button,{type:"button",...A,ref:t,onClick:z(e.onClick,()=>a.onOpenChange(!1))})});RK.displayName=PS;var MK="PopoverArrow",NK=kt.forwardRef((e,t)=>{let{__scopePopover:n,...A}=e,a=lp(n);return(0,An.jsx)(Wr,{...a,...A,ref:t})});NK.displayName=MK;function jS(e){return e?"open":"closed"}var GS=vS;var zS=LS,HS=RS,R0=MS;var M0=w(I(),1),eA=GS,tA=zS;var Hn=$S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...A},a)=>(0,M0.jsx)(HS,{children:(0,M0.jsx)(R0,{ref:a,align:t,sideOffset:n,className:v("z-[100000] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...A})}));Hn.displayName=R0.displayName;var pp=w(_(),1);var To=w(I(),1),jK=["#ef4444","#f59e0b","#84cc16","#22c55e","#10b981","#06b6d4","#3b82f6","#a855f7"],gu="#00FF5F";function mu({onChange:e,defaultColor:t,defaultInput:n}){let[A,a]=(0,pp.useState)(n??gu),[o,r]=(0,pp.useState)(t??gu);(0,pp.useEffect)(()=>{r(t||gu),r(n||gu)},[t,n]);let i=u=>/^#[0-9A-F]{6}$/i.test(u),s=u=>{let d=u.target.value;i(d)&&(a(d),r(d),e(d))},c=u=>{a(u),r(u),e(u)};return(0,To.jsxs)("div",{className:"w-full max-w-md mx-auto px-2 py-1",children:[(0,To.jsxs)("div",{className:"relative w-full",children:[(0,To.jsx)(We,{className:"w-full",type:"text",value:A,onChange:s,placeholder:"#00FF5F"}),(0,To.jsx)("div",{className:"absolute flex items-center justify-center top-0 bottom-0 my-auto right-2 h-5 w-5 rounded-sm",style:{backgroundColor:i(A)?A:o},children:(0,To.jsx)("input",{onChange:u=>{i(u.target.value)&&(a(u.target.value),e(u.target.value))},className:"relative cursor-pointer h-[20px] w-[20px] opacity-0",type:"color"})})]}),(0,To.jsx)("div",{className:"grid mt-4 grid-cols-8 gap-2",children:jK.map(u=>(0,To.jsx)("button",{onClick:()=>c(u),className:"w-full aspect-square rounded-sm border border-[1px] border-muted-foreground/25 focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:u},"aria-label":`Select color ${u}`},u))})]})}var Dn=[];for(let e=0;e<256;++e)Dn.push((e+256).toString(16).slice(1));function TS(e,t=0){return(Dn[e[t+0]]+Dn[e[t+1]]+Dn[e[t+2]]+Dn[e[t+3]]+"-"+Dn[e[t+4]]+Dn[e[t+5]]+"-"+Dn[e[t+6]]+Dn[e[t+7]]+"-"+Dn[e[t+8]]+Dn[e[t+9]]+"-"+Dn[e[t+10]]+Dn[e[t+11]]+Dn[e[t+12]]+Dn[e[t+13]]+Dn[e[t+14]]+Dn[e[t+15]]).toLowerCase()}var N0,GK=new Uint8Array(16);function P0(){if(!N0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");N0=crypto.getRandomValues.bind(crypto)}return N0(GK)}var zK=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),j0={randomUUID:zK};function HK(e,t,n){if(j0.randomUUID&&!t&&!e)return j0.randomUUID();e=e||{};let A=e.random??e.rng?.()??P0();if(A.length<16)throw new Error("Random bytes length must be >= 16");if(A[6]=A[6]&15|64,A[8]=A[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let a=0;a<16;++a)t[n+a]=A[a];return t}return TS(A)}var Is=HK;var Ye=w(I(),1),US=({onClose:e,label:t="Label Preview"})=>{let[n,A]=(0,ni.useState)(t),[a,o]=(0,ni.useState)(""),[r,i]=(0,ni.useState)("#00FF5F"),[s,c]=(0,ni.useState)(!1),u=D(p=>p.saveQueryLabel),{toast:d}=zn();(0,ni.useEffect)(()=>{A(t)},[t]),(0,ni.useEffect)(()=>{c(n!==""&&n!=="Label Preview")},[n,r]);let l=()=>{let p={id:Is(),name:n,description:a,color:r};u(p),d({title:`${n} successfully created`}),e&&e(!1)};return(0,Ye.jsxs)(Xr,{children:[(0,Ye.jsxs)(Es,{children:[(0,Ye.jsx)(Qs,{className:"text-lg font-medium",children:"Create label"}),(0,Ye.jsx)(ks,{})]}),(0,Ye.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,Ye.jsx)("div",{className:"flex flex-col gap-2",children:(0,Ye.jsx)("div",{className:"flex items-center w-fit",children:(0,Ye.jsx)(ia,{name:n.trim()!==""?n:"Label preview",color:r})})}),(0,Ye.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Ye.jsx)(Gt,{className:"text-xs border-none font-medium",children:"Name"}),(0,Ye.jsx)(We,{value:n,onChange:p=>A(p.target.value),placeholder:"Name"})]}),(0,Ye.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Ye.jsx)(Gt,{className:"text-xs border-none font-medium",children:"Description"}),(0,Ye.jsx)(We,{value:a,onChange:p=>o(p.target.value),placeholder:"Description (optional)"})]}),(0,Ye.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Ye.jsx)(Gt,{className:"text-xs border-none font-medium",children:"Color"}),(0,Ye.jsxs)(eA,{children:[(0,Ye.jsx)(tA,{asChild:!0,children:(0,Ye.jsxs)(se,{variant:"outline",className:"font-normal",children:[(0,Ye.jsx)(Io,{}),(0,Ye.jsx)("span",{children:r})]})}),(0,Ye.jsx)(Hn,{children:(0,Ye.jsx)(mu,{defaultInput:r,defaultColor:r,onChange:i})})]})]})]}),(0,Ye.jsxs)(ys,{children:[(0,Ye.jsx)(_S,{asChild:!0,children:(0,Ye.jsx)(se,{variant:"outline",children:"Cancel"})}),(0,Ye.jsx)(se,{disabled:!s,onClick:l,children:"Create"})]})]})};var ft=w(I(),1),cb=({setIsOpen:e,setItems:t,selectedItems:n,className:A=""})=>{let a=D(l=>l.savedQueryLabels),o=(0,_s.useRef)(null),[r,i]=(0,_s.useState)(""),[s,c]=(0,_s.useState)(!1),u=l=>{o.current&&!o.current.contains(l.target)&&e(!1)};(0,_s.useEffect)(()=>(document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}),[]);let d=l=>{t(p=>{if(p.some(b=>b.name===l))return p.filter(b=>b.name!==l);{let b=a?.find(B=>B.name===l);if(b)return[...p,b]}return p})};return(0,ft.jsxs)(I0,{ref:o,className:A,children:[(0,ft.jsx)(_0,{value:r,onValueChange:i,className:"w-full",placeholder:"Search labels"}),(0,ft.jsxs)(x0,{className:"rounded-sm",children:[(0,ft.jsx)(D0,{className:"py-2 px-3 my-3 items-center",children:(0,ft.jsx)(ws,{open:s,onOpenChange:c,children:(0,ft.jsxs)("div",{className:"flex flex-col gap-3 w-full items-center",children:[(0,ft.jsx)("p",{className:"text-sm text-neutral-400",children:"No labels found."}),(0,ft.jsx)(lu,{children:(0,ft.jsxs)(se,{className:"font-normal w-full",children:['Create label "',r,'"']})}),(0,ft.jsx)(US,{label:r,onClose:c})]})})}),(0,ft.jsx)(v0,{children:a?.map(l=>{let p=n.some(g=>g.name===l.name);return(0,ft.jsxs)(F0,{value:l.name,onSelect:d,className:"cursor-pointer flex flex-col items-start gap-2",children:[(0,ft.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ft.jsx)(Da,{className:v("transition-opacity",p?"opacity-100":"opacity-0")}),(0,ft.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ft.jsx)("div",{className:"h-3 w-3 rounded-full",style:{backgroundColor:l.color}}),(0,ft.jsx)("span",{children:l.name})]})]}),(0,ft.jsx)("div",{className:"-mt-1 ml-7",children:(0,ft.jsx)("p",{className:"text-xs text-neutral-500",children:l.description})})]},l.id)})})]}),(0,ft.jsx)(se,{className:"border-none text-neutral-500 hover:text-primary hover:bg-background rounded-sm mb-2",variant:"outline",size:"sm",asChild:!0,children:(0,ft.jsxs)("a",{href:"/labels",children:[(0,ft.jsx)(zl,{}),(0,ft.jsx)("span",{children:"Edit labels"})]})})]})};var we=w(I(),1),ub=async({updateActiveRoute:e,updateErrorCause:t,updateQuery:n,updateStamp:A,item:a,context:o})=>{let r;try{r=await fetch("/select-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:o})})}catch(s){console.error(s),e("/error"),t("Failed to request project selection.");return}let i=!1;try{i=await r.json()==="ok"}catch(s){console.error(s)}i?(window.scrollTo(0,0),n(a.query),e("/explore"),A()):(e("/error"),t("Failed to select project."))},ZS=({item:e,handleSelect:t,checked:n})=>{let{toast:A}=zn(),[a,o]=(0,ca.useState)(!1),[r,i]=(0,ca.useState)(""),[s,c]=(0,ca.useState)(""),[u,d]=(0,ca.useState)(!1),[l,p]=(0,ca.useState)(!1),[g,b]=(0,ca.useState)([]),[B,f]=(0,ca.useState)(""),[m,h]=(0,ca.useState)(!1),C=D(M=>M.updateSavedQuery),E=D(M=>M.updateActiveRoute),Q=D(M=>M.updateErrorCause),y=D(M=>M.updateQuery),k=D(M=>M.updateStamp);(0,ca.useEffect)(()=>{i(e.name),c(e.context),f(e.query),b(e.labels??[])},[e]),(0,ca.useEffect)(()=>{h(r!==""&&B!=="")},[r,s,B]);let R=()=>{o(!a)},F=()=>{let M={...e,name:r,context:s,query:B,dateModified:new Date().toISOString(),labels:g};C(M),o(!1),A({title:`${r} saved successfully`})},U=async()=>{await ub({updateActiveRoute:E,updateErrorCause:Q,updateQuery:y,updateStamp:k,item:e,context:e.context})};return(0,we.jsxs)("div",{className:`bg-neutral-50 dark:bg-neutral-950 rounded-sm flex flex-col transition-all border border-[1px] hover:border-foreground/50 group ${a?"border-foreground/50":"border-muted-foreground/25 "}`,children:[(0,we.jsxs)("div",{className:"grid grid-cols-12 gap-4 px-3 py-2",children:[(0,we.jsxs)("div",{className:"col-span-2 flex items-center gap-3 grow",children:[(0,we.jsx)(Ho,{checked:n,onCheckedChange:()=>t(e),className:"border-muted-foreground/25 group-hover:border-muted-foreground/50"}),(0,we.jsx)("p",{className:"truncate text-sm font-medium",children:r.trim()!==""?r:"Query Name"})]}),(0,we.jsx)("div",{className:"flex col-span-4 items-center",children:!a&&(0,we.jsx)("p",{className:"text-sm w-[500px] truncate",children:B})}),(0,we.jsx)("div",{className:"flex col-span-2 items-center gap-2 w-full",children:(0,we.jsx)(Xe,{children:(0,we.jsxs)(et,{children:[(0,we.jsx)(Qt,{className:"text-sm truncate w-full text-left",children:e.context}),(0,we.jsx)(Oe,{children:e.context})]})})}),(0,we.jsx)("div",{className:"flex col-span-2 items-center gap-2",children:g.map((M,ce)=>(0,we.jsx)(ia,{name:M.name,color:M.color},ce))}),(0,we.jsxs)("div",{className:"col-span-2 flex gap-4 items-center justify-end",children:[(0,we.jsx)(se,{variant:"outline",className:"text-sm px-3 rounded-sm border border-[1px] border-muted-foreground/25 h-[2rem]",onClick:R,children:a?"Close":"Edit"}),s.trim()!==""&&(0,we.jsxs)(se,{variant:"outline",className:"text-sm px-3 rounded-sm border border-[1px] border-muted-foreground/25 h-[2rem]",role:"link",onClick:()=>void U(),children:[(0,we.jsx)("span",{children:"Run"}),(0,we.jsx)(xa,{})]})]})]}),a&&(0,we.jsxs)("div",{className:"flex flex-col px-3 py-2 border-t-[1px] border-muted-foreground/25",children:[(0,we.jsxs)("div",{className:"flex gap-3 my-3 mb-6",children:[(0,we.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,we.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Name"}),(0,we.jsx)(We,{type:"text",value:r,onChange:M=>i(M.target.value),placeholder:"Name"})]}),(0,we.jsxs)("div",{className:"flex grow flex-col gap-2",children:[(0,we.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Query"}),(0,we.jsx)(We,{type:"text",placeholder:"Query",value:B,onChange:M=>f(M.target.value),className:"w-full"})]}),(0,we.jsxs)("div",{className:"flex grow flex-col gap-2",children:[(0,we.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Directory"}),(0,we.jsx)(We,{type:"text",value:s,onChange:M=>c(M.target.value),placeholder:"Directory (optional)"})]}),(0,we.jsxs)("div",{className:"flex grow flex-col gap-2",children:[(0,we.jsx)(Gt,{className:"text-sm border-none",children:"Labels"}),(0,we.jsxs)(eA,{open:l,onOpenChange:p,children:[(0,we.jsx)(tA,{asChild:!0,children:(0,we.jsxs)(se,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-full justify-between",children:["Select labels",(0,we.jsx)(ns,{className:"opacity-50"})]})}),(0,we.jsx)(Hn,{className:"p-0",children:(0,we.jsx)(cb,{selectedItems:g,setItems:b,setIsOpen:d})})]})]})]}),(0,we.jsx)("div",{className:"flex justify-end items-end mb-0.5",children:(0,we.jsx)(se,{disabled:!m,onClick:F,variant:"default",size:"sm",children:"Save changes"})})]})]})};var Fe=w(I(),1),qS=()=>{let e=D(f=>f.savedQueries),[t,n]=(0,xs.useState)([]),[A,a]=(0,xs.useState)([]),o=D(f=>f.graph),[r,i]=(0,xs.useState)(!1),[s,c]=(0,xs.useState)(!1),u=D(f=>f.updateActiveRoute),d=D(f=>f.updateErrorCause),l=D(f=>f.updateQuery),p=D(f=>f.updateStamp),g=()=>{if(o){let f=o.projectRoot,m=e?.filter(C=>C.context===f),h=e?.filter(C=>C.context.trim()==="");n(m??[]),a(h??[])}};(0,xs.useEffect)(()=>{g()},[e,o]);let b=async f=>{await ub({updateActiveRoute:u,updateErrorCause:d,updateQuery:l,updateStamp:p,item:f,context:f.context})},B=async f=>{await ub({updateActiveRoute:u,updateErrorCause:d,updateQuery:l,updateStamp:p,item:f,context:o?.projectRoot??""})};return A.length===0&&t.length===0?null:(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(np,{}),(0,Fe.jsxs)(Ap,{children:[(0,Fe.jsx)(n0,{className:"font-medium tracking-wide",children:"Queries"}),A.length!==0&&(0,Fe.jsx)(oa,{children:(0,Fe.jsx)(ap,{open:s,onOpenChange:c,children:(0,Fe.jsxs)(ra,{children:[(0,Fe.jsx)(op,{asChild:!0,children:(0,Fe.jsxs)(fA,{tooltip:"Project queries",className:"whitespace-nowrap",children:[s?(0,Fe.jsx)(zc,{}):(0,Fe.jsx)(Hc,{}),(0,Fe.jsx)("span",{children:"Global"}),s?(0,Fe.jsx)(va,{className:"ml-auto"}):(0,Fe.jsx)(Wa,{className:"ml-auto"})]})}),(0,Fe.jsx)(rp,{children:(0,Fe.jsx)(cu,{children:A.map((f,m)=>(0,Fe.jsx)(Wf,{children:(0,Fe.jsx)(Jf,{className:"cursor-pointer whitespace-nowrap truncate",onClick:()=>void B(f),children:f.name})},m))})})]})})}),t.length!==0&&(0,Fe.jsx)(oa,{children:(0,Fe.jsx)(ap,{open:r,onOpenChange:i,children:(0,Fe.jsxs)(ra,{children:[(0,Fe.jsx)(op,{asChild:!0,children:(0,Fe.jsxs)(fA,{tooltip:"Project queries",className:"whitespace-nowrap",children:[r?(0,Fe.jsx)(zc,{}):(0,Fe.jsx)(Hc,{}),(0,Fe.jsx)("span",{children:"Project"}),r?(0,Fe.jsx)(va,{className:"ml-auto"}):(0,Fe.jsx)(Wa,{className:"ml-auto"})]})}),(0,Fe.jsx)(rp,{children:(0,Fe.jsx)(cu,{children:t.map((f,m)=>(0,Fe.jsx)(Wf,{children:(0,Fe.jsx)(Jf,{className:"cursor-pointer whitespace-nowrap truncate",onClick:()=>void b(f),children:f.name})},m))})})]})})})]})]})};var Ai=w(I(),1),OS=()=>{let{toggleSidebar:e}=su();return(0,Ai.jsx)(Xe,{children:(0,Ai.jsxs)(et,{children:[(0,Ai.jsx)(Qt,{asChild:!0,children:(0,Ai.jsx)(fA,{role:"button",onClick:e,className:"w-fit",children:(0,Ai.jsx)(Va,{})})}),(0,Ai.jsx)(Oe,{align:"start",side:"right",children:"toggle sidebar"})]})})};var ua=w(I(),1),YS=()=>(0,ua.jsxs)(e0,{children:[(0,ua.jsx)(oa,{children:(0,ua.jsx)(ra,{children:(0,ua.jsx)(fA,{asChild:!0,children:(0,ua.jsxs)("a",{href:"https://docs.vlt.sh",target:"_blank",children:[(0,ua.jsx)(Rl,{}),(0,ua.jsx)("span",{children:"Documentation"}),(0,ua.jsx)(ts,{className:"ml-auto"})]})})})}),(0,ua.jsx)(np,{}),(0,ua.jsx)(OS,{})]});var da=w(I(),1),KS=(()=>{let e=document.cookie.split("; ").find(n=>n.startsWith("sidebar:state=")),[,t]=e?.split("=")??[];return t==="true"})();function WS(){return(0,da.jsxs)(Jy,{collapsible:"icon",children:[(0,da.jsx)(Xy,{children:(0,da.jsx)(J2,{})}),(0,da.jsxs)(t0,{children:[(0,da.jsxs)(Ap,{className:"gap-1",children:[(0,da.jsx)(W2,{}),(0,da.jsx)(V2,{})]}),(0,da.jsx)(qS,{})]}),(0,da.jsx)(YS,{}),(0,da.jsx)(Vy,{})]})}var ix=w(_(),1);var G0=(e,t,n,A,a=t)=>{let o=new e(n,A?{cause:A}:void 0);return Error.captureStackTrace?.(o,a),o},ie=(e,t,n)=>G0(Error,ie,e,t,n),gp=(e,t,n)=>G0(TypeError,gp,e,t,n),fu=(e,t,n)=>G0(SyntaxError,fu,e,t,n);var IL=w(AL(),1);var yb=e=>"type"in e&&"nodes"in e,Na=e=>{if(!e)throw ie("Expected a query node");if(!yb(e))throw ie("Not a query selector node with children",{found:e});return e},Cu=e=>!!e&&typeof e=="object",NX=e=>Cu(e)&&!!e.attribute&&e.type==="attribute",Qb=e=>{if(!e)throw ie("Expected a query node");if(!NX(e))throw ie("Mismatching query node",{wanted:"attribute",found:e.type});return e},PX=e=>Cu(e)&&!!e.value&&e.type==="class",aL=e=>{if(!e)throw ie("Expected a query node");if(!PX(e))throw ie("Mismatching query node",{wanted:"class",found:e.type});return e},jX=e=>Cu(e)&&!!e.value&&e.type==="combinator",oL=e=>{if(!e)throw ie("Expected a query node");if(!jX(e))throw ie("Mismatching query node",{wanted:"combinator",found:e.type});return e},GX=e=>Cu(e)&&!!e.value&&e.type==="id",rL=e=>{if(!e)throw ie("Expected a query node");if(!GX(e))throw ie("Mismatching query node",{wanted:"id",found:e.type});return e},wu=e=>yb(e)&&e.type==="selector",zX=e=>Cu(e)&&!!e.value&&e.type==="pseudo",iL=e=>{if(!e)throw ie("Expected a query node");if(!zX(e))throw ie("Mismatching query node",{wanted:"pseudo",found:e.type});return e},HX=e=>Cu(e)&&!!e.value&&e.type==="tag",RQ=e=>{if(!e)throw ie("Expected a query node");if(!HX(e))throw ie("Mismatching query node",{wanted:"tag",found:e.type});return e};var kb=e=>String(e),$X=(e,t,n)=>{if(!e.manifest)return;let A=new Set([e.manifest]),a=new Set;for(let r of t)for(let i of A){if(!i)throw ie("failed to find nested property in :attr",{found:t});if(Array.isArray(i)){for(let s of i)A.add(s);continue}if(!(typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&r in i){let s=i[r];s&&(r===n?a.add(s):(A.delete(i),A.add(s)))}}if(!a.size)return;let o=new Set;for(let r of a)if(Array.isArray(r))for(let i of r)o.add(i?kb(i):"");else o.add(kb(r));return[...o]},Pp=(e,t,n,A,a,o=[])=>{let r=s=>t?.(a?kb(s).toLowerCase():kb(s),a?n.toLowerCase():n),i=s=>{for(let c of s.edgesIn)e.partial.edges.delete(c);e.partial.nodes.delete(s)};for(let s of e.partial.nodes){let c=o.length?o:[A],u=$X(s,c,A);if(!u?.length){i(s);continue}t&&!u.some(r)&&i(s)}for(let s of e.partial.edges)A==="name"&&r(s.name)||s.to||e.partial.edges.delete(s);return e},TX={"=":(e,t="")=>e===t,"^=":(e,t="")=>e.startsWith(t),"$=":(e,t="")=>e.endsWith(t),"~=":(e,t="")=>new Set(e.match(/\w+/g)).has(t),"*=":(e,t="")=>e.includes(t),"|=":(e,t="")=>e===t||e.startsWith(`${t}-`),undefined:e=>!!e},jp=new Map(Object.entries(TX)),sL=async e=>{let t=Qb(e.current),n=jp.get(String(t.operator));if(!n){if(e.loose)return e;throw new Error(`Unsupported attribute operator: ${t.operator}`)}let A=t.value||"",a=t.attribute,o=!!t.insensitive;return Pp(e,n,A,a,o)};var UX={prod:async e=>{for(let t of e.partial.edges)(t.type!=="prod"||t.from.dev)&&e.partial.edges.delete(t);for(let t of e.partial.nodes){if(!t.edgesIn.size){e.partial.nodes.delete(t);continue}let n=new Set(t.edgesIn);for(let A of n)e.partial.edges.has(A)||n.delete(A);n.size||e.partial.nodes.delete(t)}return e},dev:async e=>{for(let t of e.partial.edges)t.type!=="dev"&&!t.from.dev&&e.partial.edges.delete(t);for(let t of e.partial.nodes){if(!t.edgesIn.size){e.partial.nodes.delete(t);continue}let n=new Set(t.edgesIn);for(let A of n)e.partial.edges.has(A)||n.delete(A);n.size||e.partial.nodes.delete(t)}return e},optional:async e=>{for(let t of e.partial.edges)t.type!=="optional"&&!t.from.optional&&e.partial.edges.delete(t);for(let t of e.partial.nodes){if(!t.edgesIn.size){e.partial.nodes.delete(t);continue}let n=new Set(t.edgesIn);for(let A of n)e.partial.edges.has(A)||n.delete(A);n.size||e.partial.nodes.delete(t)}return e},peer:async e=>{for(let t of e.partial.edges)t.type!=="peer"&&e.partial.edges.delete(t);for(let t of e.partial.nodes){if(!t.edgesIn.size){e.partial.nodes.delete(t);continue}for(let n of t.edgesIn)e.partial.edges.has(n)||e.partial.nodes.delete(t)}return e},workspace:async e=>{for(let t of e.partial.nodes)(!t.importer||t.mainImporter)&&e.partial.nodes.delete(t);for(let t of e.partial.edges)t.to&&e.partial.nodes.has(t.to)||e.partial.edges.delete(t);return e}},ZX=new Map(Object.entries(UX)),cL=async e=>{let t=aL(e.current),n=t.value&&ZX.get(t.value);if(!n){if(e.loose)return e;throw new Error(`Unsupported class: ${e.current.value}`)}return n(e)};var qX=async e=>{let t=new Set(e.partial.nodes);e.partial.edges.clear(),e.partial.nodes.clear();for(let n of t)for(let A of n.edgesOut.values())A.to&&(e.partial.edges.add(A),e.partial.nodes.add(A.to));return e},OX=async e=>{let t=new Set(e.partial.nodes);e.partial.edges.clear(),e.partial.nodes.clear();for(let n of t)for(let A of n.edgesIn){let a=A.from.edgesOut.values();for(let o of a)o.to&&o.to!==n&&(e.partial.edges.add(o),e.partial.nodes.add(o.to))}return e},YX=async e=>{if(e.prev?.type==="tag"||e.next?.type==="tag")return e;let t=new Set(e.partial.nodes);e.partial.edges.clear(),e.partial.nodes.clear();for(let n of t){let A=new Set;for(let a of n.edgesOut.values())a.to&&(A.add(a.to),e.partial.edges.add(a),e.partial.nodes.add(a.to));for(let a of A)t.add(a)}return e},KX={">":qX,"~":OX," ":YX},WX=new Map(Object.entries(KX)),uL=async e=>{let t=oL(e.current),n=t.value&&WX.get(t.value);if(!n){if(e.loose)return e;throw new Error(`Unsupported combinator: ${e.current.value}`)}return n(e)};var dL=async e=>{let{value:t}=rL(e.current),n=jp.get("=");if(!t)throw ie("Missing identifier name");if(!n)throw ie("Could not find attribute selector comparator");return Pp(e,n,t,"name",!0)};function Pa(e,t,n=-1,A){let a=0,o=0,r=t.length,i=[];for(;a!==-1;){a=e.indexOf(t,o);let s=a===-1||i.length===n-1?e.substring(o):e.substring(o,a);if(i.push(A?.(s,i,a)??s),i.length===n)return i;o=a+r}return i}var lL=e=>{if(!/^[0-9]+$/.test(e))return e;let t=Number(e);return t<=Number.MAX_SAFE_INTEGER?t:e},MQ=(e,t,n)=>{let A=Number(e);if(A>Number.MAX_SAFE_INTEGER)throw Eu(t,`invalid ${n}, must be <= ${Number.MAX_SAFE_INTEGER}`);return A},NQ={prefix:/^[ v=]+/,main:/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)/,prerelease:/-([0-9a-zA-Z_.-]+)(?:$|\+)/,build:/\+([0-9a-zA-Z_.-]+)$/,full:/^[ v=]*(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9a-zA-Z_.-]+))?(?:\+([0-9a-zA-Z_.-]+))?$/},Eu=(e,t)=>fu(`invalid version: ${t}`,{version:e},at),at=class e{raw;major;minor;patch;prerelease;build;toString(){return`${this.major}.${this.minor}.${this.patch}${this.prerelease?"-"+this.prerelease.join("."):""}${this.build?"+"+this.build.join("."):""}`}static parse(t){if(t=t.replace(NQ.prefix,"").trim(),t.length>256)throw Eu(t,"must be less than 256 characters");let n=t.match(NQ.full);if(!n)throw t.match(NQ.main)?Eu(t,"invalid build or patch section"):Eu(t,"no Major.minor.patch tuple present");let[A,a,o,r,i,s]=n,c=MQ(a,t,"major"),u=MQ(o,t,"minor"),d=MQ(r,t,"patch");return new e(t,c,u,d,i,s)}constructor(t,n,A,a,o,r){this.raw=t,this.major=n,this.minor=A,this.patch=a,o&&(this.prerelease=Pa(o,".",-1,i=>{if(!i)throw Eu(t,"invalid prerelease, empty identifiers not allowed");return lL(i)})),r&&(this.build=Pa(r,".",-1,i=>{if(!i)throw Eu(t,"invalid build metadata, empty identifiers not allowed")}))}compare(t){if(this.major>t.major)return 1;if(this.major<t.major)return-1;if(this.minor>t.minor)return 1;if(this.minor<t.minor)return-1;if(this.patch>t.patch)return 1;if(this.patch<t.patch)return-1;if(!t.prerelease?.length)return this.prerelease?.length?-1:0;if(!this.prerelease?.length)return 1;let n=Math.max(this.prerelease.length,t.prerelease.length),A=this.prerelease,a=t.prerelease;for(let o=0;o<n;o++){let r=A[o],i=a[o];if(r!==i)return i===void 0?1:r===void 0?-1:typeof r!=typeof i?typeof r=="string"?1:-1:r>i?1:-1}return 0}rcompare(t){return-1*this.compare(t)}greaterThan(t){return this.compare(t)===1}greaterThanEqual(t){return this.compare(t)>-1}lessThan(t){return this.compare(t)===-1}lessThanEqual(t){return this.compare(t)<1}equals(t){return this.compare(t)===0}tupleEquals(t){return this.major===t.major&&this.minor===t.minor&&this.patch===t.patch}satisfies(t){return t.test(this)}inc(t,n){switch(t){case"premajor":this.prerelease=void 0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n);break;case"preminor":this.prerelease=void 0,this.patch=0,this.minor++,this.inc("pre",n);break;case"prepatch":this.prerelease=void 0,this.inc("patch"),this.inc("pre",n);break;case"prerelease":this.prerelease?.length||this.inc("patch",n),this.inc("pre",n);break;case"pre":{if(!n){if(!this.prerelease?.length){this.prerelease=[0];break}let o=this.prerelease[this.prerelease.length-1];typeof o=="number"?this.prerelease[this.prerelease.length-1]=o+1:this.prerelease.push(0);break}if(!this.prerelease?.length){this.prerelease=[n];break}let A=this.prerelease.indexOf(lL(n));if(A===-1){this.prerelease=[n];break}let a=this.prerelease[A+1];if(typeof a=="number"){this.prerelease[A+1]=a+1;break}if(A===this.prerelease.length-1){this.prerelease.push(0);break}this.prerelease.splice(A+1,0,0);break}case"major":(!this.prerelease?.length||this.minor||this.patch)&&this.major++,this.prerelease=void 0,this.patch=0,this.minor=0;break;case"minor":(!this.prerelease?.length||this.patch)&&this.minor++,this.prerelease=void 0,this.patch=0;break;case"patch":this.prerelease?.length||this.patch++,this.prerelease=void 0;break;default:throw gp("Invalid increment identifier",{version:this,found:t,validOptions:["major","minor","patch","premajor","preminor","prepatch","prerelease","pre"]},this.inc)}return this.raw=this.toString(),this}};var JX=e=>!!e&&(e===">"||e==="<"||e===">="||e==="<="||e===""||e==="~"||e==="^"||e==="~>"),VX=new Set("=v "),Fn=(e,t)=>fu(`invalid comparator: '${e}' ${t}`,{found:e},Hp),nA=(e,t,n)=>{let A=Number(e);if(A!==A)throw Fn(t,`${n} must be numeric or 'x', got: '${e}'`);return A},Fs=(e,t)=>{if(!e)throw Fn(t,"no value provided for operator")},PQ=(e,t,n)=>{if(e&&!zp(e))throw Fn(t,`cannot omit '${n}' and include subsequent fields`)},Ao=0,yu=1,mL=2,zp=e=>!e||e==="X"||e==="x"||e==="*",jQ=e=>e[mL]!==void 0,Ib=e=>e[yu]!==void 0&&e[mL]===void 0,_b=e=>e[Ao]!==void 0&&e[yu]===void 0,pL=e=>e[Ao]===void 0,Hp=class{includePrerelease;raw;tokens;tuples=[];isNone=!1;isAny=!1;toString(){return this.isNone?"<0.0.0-0":this.isAny?"*":this.tuples.map(t=>Gp(t)?"*":t.join("")).join(" ")}constructor(t,n=!1){this.includePrerelease=n,t=t.trim(),this.raw=t;let A=!1,a=Pa(t," ",-1,(s,c,u)=>{if(s==="-"){if(A)throw Fn(t,"multiple hyphen ranges not allowed");if(c.length!==1||u===-1)throw Fn(t,"hyphen must be between two versions");A=!0}else if(A&&c.length!==2)throw Fn(t,"hyphen range must be alone")}),o=[],r=!1,i=0;for(let s of a)if(s!==""){if(!r){r=JX(s),o.push(s),i++;continue}o[i-1]+=s,r=!1}if(A){let[s,c,u]=o;if(!s||!u)throw Fn(t,"hyphen must be between two versions");this.#g(s,u)}else if(!o.length||o.length===1&&zp(o[0]))this.tuples.push(this.#a());else for(let s of o)if(this.#m(s),this.isNone)break;this.tokens=o,this.isAny=!0;for(let s of this.tuples)if(Array.isArray(s)||!s.isAny){this.isAny=!1;break}}#e(t){let n=this.includePrerelease?"0":void 0,[A,a=0,o=0,r=n,i]=this.#A(t);return A===void 0?this.#a():[">=",new at(t,A,a,o,r,i)]}#t(t){let n=this.#A(t);if(jQ(n))return[">",new at(t,...n)];let A=this.includePrerelease?"0":void 0;return Ib(n)?[">=",new at(t,n[Ao],n[yu]+1,0,A,void 0)]:_b(n)?[">=",new at(t,n[Ao]+1,0,0,A,void 0)]:(this.isNone=!0,this.tuples.length=0,gL)}#o(t){let n=this.#A(t);return jQ(n)?["<=",new at(t,...n)]:Ib(n)?["<",new at(t,n[Ao],n[yu]+1,0,"0",void 0)]:_b(n)?["<",new at(t,n[Ao]+1,0,0,"0",void 0)]:this.#a()}#r(t){let n=this.includePrerelease?"0":void 0,[A=0,a=0,o=0,r=n,i]=this.#A(t);return A===0&&a===0&&o===0&&r==="0"?(this.isNone=!0,this.tuples.length=0,gL):["<",new at(t,A,a,o,r,i)]}#i(t,n,A){if(PQ(n,t,"major"),PQ(A,t,"major"),n===""||A==="")throw Fn(t,"(Did you mean '*'?)");return[]}#s(t,n,A,a){if(PQ(a,t,"major"),A===""||a==="")throw Fn(t,`(Did you mean '${n}'?)`);return[nA(n,t,"major")]}#n(t,n,A,a){if(a==="")throw Fn(t,`(Did you mean '${n}.${A}'?)`);return[nA(n,t,"major"),nA(A,t,"minor")]}#c(t,n,A,a){return[nA(n,t,"major"),nA(A,t,"minor"),nA(a,t,"patch")]}#d(t,n,A,a,o){let r=a.substring(0,o),i=a.substring(o+1);if(!r)throw Fn(t,"cannot specify build without patch");if(!i)throw Fn(t,"encountered '+', but no build value");return[nA(n,t,"major"),nA(A,t,"minor"),nA(r,t,"patch"),void 0,i]}#l(t,n,A,a,o){{let r=a.substring(0,o),i=a.substring(o+1);if(!r)throw Fn(t,"cannot specify prerelease without patch");if(!i)throw Fn(t,"encountered '-', but no prerelease value");return[nA(n,t,"major"),nA(A,t,"minor"),nA(r,t,"patch"),i,void 0]}}#p(t,n,A,a,o,r){let i=a.substring(0,o),s=a.substring(o+1,r),c=a.substring(r+1);if(!i)throw Fn(t,"cannot specify prerelease without patch");if(!s)throw Fn(t,"encountered '-', but no prerelease value");if(!c)throw Fn(t,"encountered '+', but no build value");return[nA(n,t,"major"),nA(A,t,"minor"),nA(i,t,"patch"),s,c]}#A(t){let[n,A,a]=Pa(t,".",3),o=0;for(;n&&VX.has(n.charAt(o));)o++;if(n!==void 0&&o!==0&&(n=n.substring(o)),!n||zp(n))return this.#i(t,A,a);if(!A||zp(A))return this.#s(t,n,A,a);if(!a||zp(a))return this.#n(t,n,A,a);let r=a.indexOf("-"),i=a.indexOf("+");return i===-1&&r===-1?this.#c(t,n,A,a):i===-1?this.#l(t,n,A,a,r):r===-1?this.#d(t,n,A,a,i):this.#p(t,n,A,a,r,i)}#g(t,n){let A=this.#e(t),a=this.#o(n),o=Gp(A),r=Gp(a);o&&r?this.tuples.push(this.#a()):o?this.tuples.push(a):r?this.tuples.push(A):this.tuples.push(A,a)}#m(t){let n=t.charAt(0),A=t.substring(0,2),a=t.substring(1),o=t.substring(2);switch(A){case"~>":return Fs(o,t),this.#u(o);case">=":return Fs(o,t),this.tuples.push(this.#e(o));case"<=":return Fs(o,t),this.tuples.push(this.#o(o))}switch(n){case"~":return Fs(a,t),this.#u(a);case"^":return Fs(a,t),this.#f(a);case">":return Fs(a,t),this.tuples.push(this.#t(a));case"<":return Fs(a,t),this.tuples.push(this.#r(a))}return this.#b(t)}#u(t){let n=this.#A(t);if(pL(n)){this.tuples.push(this.#a());return}let A=this.includePrerelease?"0":void 0;if(_b(n)){let[c]=n;this.tuples.push([">=",new at(t,c,0,0,A,void 0)],["<",new at(t,c+1,0,0,"0",void 0)]);return}if(Ib(n)){let[c,u]=n,d=this.includePrerelease?"0":void 0;this.tuples.push([">=",new at(t,c,u,0,d,void 0)],["<",new at(t,c,u+1,0,"0",void 0)]);return}let[a,o,r,i=A,s]=n;this.tuples.push([">=",new at(t,a,o,r,i,s)],["<",new at(t,a,o+1,0,"0",s)])}#f(t){let n=this.#e(t);if(Gp(n)){this.tuples.push(n);return}let A=n[1];A.major!==0?this.tuples.push(n,["<",new at(t,A.major+1,0,0,"0",void 0)]):A.minor!==0?this.tuples.push(n,["<",new at(t,A.major,A.minor+1,0,"0",void 0)]):A.prerelease?.length?this.tuples.push(n,["<",new at(t,A.major,A.minor,A.patch+1,"0",void 0)]):this.tuples.push(["",A])}#b(t){let n=this.#A(t),A=this.includePrerelease?"0":void 0;jQ(n)?this.tuples.push(["",new at(t,...n)]):pL(n)?this.tuples.push(this.#a()):_b(n)?(this.tuples.push([">=",new at(t,n[Ao],0,0,A,void 0)]),this.tuples.push(["<",new at(t,n[Ao]+1,0,0,"0",void 0)])):Ib(n)&&this.tuples.push([">=",new at(t,n[Ao],n[yu],0,A,void 0)],["<",new at(t,n[Ao],n[yu]+1,0,"0",void 0)])}test(t){if(this.isNone)return!1;let n=this.includePrerelease,A=!!t.prerelease?.length,a=n||!A;for(let o of this.tuples){if(Gp(o))continue;let[r,i]=o;switch(a||=!!i.prerelease?.length&&t.tupleEquals(i),r){case"":if(!t.equals(i))return!1;continue;case">":if(!t.greaterThan(i))return!1;continue;case">=":if(!t.greaterThanEqual(i))return!1;continue;case"<":if(!t.lessThan(i))return!1;continue;case"<=":if(!t.lessThanEqual(i))return!1;continue}}return a}#a(){return this.includePrerelease?bL:fL}},Gp=e=>e===fL||e===bL,fL={isAny:!0,toString:()=>"*",includePrerelease:!1,test:e=>!e.prerelease?.length},bL={isAny:!0,toString:()=>"*",includePrerelease:!0,test:e=>!0},gL={isNone:!0,toString:()=>"<0.0.0-0",includePrerelease:!1,test:e=>!1};var xb=class{raw;isAny;isSingle;set=[];includePrerelease;#e;constructor(t,n=!1){this.raw=t,this.includePrerelease=n,this.isAny=!1;let A=!0;this.isSingle=!1,Pa(t,"||",-1,a=>{if(this.isAny)return;let o=new Hp(a,this.includePrerelease);if(o.isAny){this.set=[o],this.isAny=!0;return}this.set.push(o),A?Array.isArray(o.tuples)&&o.tuples.length===1&&Array.isArray(o.tuples[0])&&o.tuples[0][0]===""&&(this.isSingle=!0):this.isSingle=!1,A=!1})}test(t){return this.set.some(n=>n.test(t))}toString(){return this.#e?this.#e:this.isSingle?(this.#e=String(this.set[0]),this.#e):(this.#e=this.set.map(t=>String(t)).join(" || "),this.#e)}};var Db=(e,t=!1)=>{if(typeof e=="object"){if(e.includePrerelease===t)return e;e=e.raw}try{return new xb(e,t)}catch{return}};var XX=Symbol.for("nodejs.util.inspect.custom"),GQ="https://registry.npmjs.org/",vb={npm:"https://registry.npmjs.org/"},Fb={github:"git+ssh://git@github.com:$1/$2.git",bitbucket:"git+ssh://git@bitbucket.org:$1/$2.git",gitlab:"git+ssh://git@gitlab.com:$1/$2.git",gist:"git+ssh://git@gist.github.com/$1.git"},Sb={github:"https://codeload.github.com/$1/$2/tar.gz/$committish",bitbucket:"https://bitbucket.org/$1/$2/get/$committish.tar.gz",gist:"https://codeload.github.com/gist/$1/tar.gz/$committish",gitlab:"https://gitlab.com/$1/$2/repository/archive.tar.gz?ref=$committish"},eee={github:"https://github.com/",bitbucket:"https://bitbucket.org/",gist:"https://gist.github.com/",gitlab:"https://gitlab.com/"},wL={},hL=e=>({...e,registry:e?.registry??GQ,"scope-registries":e?.["scope-registries"]??{},"git-hosts":e?.["git-hosts"]?{...Fb,...e["git-hosts"]}:Fb,registries:e?.registries?{...vb,...e.registries}:vb,"git-host-archives":e?.["git-host-archives"]?{...Sb,...e["git-host-archives"]}:Sb}),tee=(e,t)=>e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("file:")||e.startsWith("http:")||e.startsWith("https:")||e.startsWith("workspace:")||e.startsWith("git@")||e.startsWith("git://")||e.startsWith("git+ssh://")||e.startsWith("git+http://")||e.startsWith("git+https://")||e.startsWith("git+file://")||e.startsWith("git@github.com")||e.startsWith("registry:")||[...Object.keys(t["git-hosts"]),...Object.keys(t.registries)].some(n=>e.startsWith(`${n}:`)),BL=(e,t)=>e.indexOf("@",t?1:0),nee=e=>e.indexOf("#")>2,Aee=e=>e.includes("/"),Ut=class{static parse(t,n,A){return typeof t=="object"?t:new this(t,n,A)}static parseArgs(t,n){let A=hL(n??{});if(tee(t,A)){let a=this.parse("(unknown)",t,A);return a.subspec&&(a.name=a.subspec.name,a.spec=`${a.name}@${a.bareSpec}`),a}else{let a=t.startsWith("@"),o=BL(t,a);return o>-1?this.parse(t.substring(0,o),t.substring(o+1),A):nee(t)||!a&&Aee(t)?this.parse("(unknown)",t,A):this.parse(`${t}@`,A)}}static nodejsDependencies;type;spec;options;name;scope;scopeRegistry;bareSpec;gitRemote;gitSelector;gitSelectorParsed;gitCommittish;namedGitHost;namedGitHostPath;workspaceSpec;workspace;namedRegistry;registry;registrySpec;conventionalRegistryTarball;semver;range;distTag;remoteURL;file;subspec;#e;#t;get final(){return this.#e?this.#e:this.#e=this.subspec?this.subspec.final:this}toString(){if(this.#t!==void 0)return this.#t;let t=this;for(;t.subspec?.subspec;)t=t.subspec;return t.subspec&&t.subspec.type!=="registry"&&(t=t.subspec),this.#t=this.name+"@"+t.bareSpec}constructor(t,n,A={}){if(n&&typeof n=="object"&&(A=n,n=void 0),this.options=hL(A),typeof n=="string")this.name=t,this.#o(t),this.bareSpec=n,this.spec=`${this.name}@${n}`;else{this.spec=t;let u=t.startsWith("@"),d=BL(t,u);d===-1&&(d=t.length,t+="@"),this.name=t.substring(0,d),u&&this.#o(this.name),this.bareSpec=t.substring(d+1)}if(this.bareSpec.startsWith("https://")){for(let[u,d]of Object.entries(eee))if(this.bareSpec.startsWith(d)){let l=new URL(this.bareSpec),[p,g]=l.pathname.replace(/\.git$/,"").replace(/\/+/g," ").trim().split(" ");if(p&&g){this.bareSpec=`${u}:${p}/${g}${l.hash}`,this.spec=`${this.name}@${this.bareSpec}`;break}}}if(this.bareSpec.startsWith("workspace:")){this.type="workspace";let u=this.bareSpec.substring(10).trim(),d=u.lastIndexOf("@");if(d===-1)this.workspace=this.name;else{let g=u.substring(0,d);if(!g||g==="*"||g==="~"||g==="^"||(g.startsWith("@")?g.split("/").length!==2||g.substring(1).includes("@"):g.includes("@")))throw this.#n("workspace: name must be a path or valid package name",{found:g});this.workspace=g}let l=d===-1?u:u.substring(d+1)||"*",p=l==="*"?void 0:Db(l);if(l!=="*"&&l!=="~"&&l!=="^"&&!p)throw this.#n("workspace: spec must be one of *, ~, or ^, or a valid semver range",{found:l,wanted:"'*'|'~'|'^'|SemverRange"});this.workspaceSpec=l,p&&(this.semver=l,this.range=p);return}if(this.bareSpec.startsWith("git://")||this.bareSpec.startsWith("git+ssh://")||this.bareSpec.startsWith("git+http://")||this.bareSpec.startsWith("git+https://")||this.bareSpec.startsWith("git+file://")||this.bareSpec.startsWith("git@github.com")){this.bareSpec.startsWith("git@")&&(this.bareSpec=`git+ssh://${this.bareSpec}`,this.spec=`${this.name}@${this.bareSpec}`),this.type="git";for(let[u,d]of Object.entries(this.options["git-hosts"])){let l=d.indexOf("$");if(l>0&&this.bareSpec.startsWith(d.substring(0,l))){let p=this.bareSpec.substring(l).replace(/\.git(#.*)?$/,"$1");this.bareSpec=`${u}:${p}`,this.spec=`${this.name}@${this.bareSpec}`,this.#r(u,d),this.type="git";return}}this.#c(this.bareSpec);return}let a=Object.entries(this.options["git-hosts"]);for(let[u,d]of a)if(this.#r(u,d)){this.type="git";return}if(this.bareSpec.startsWith("registry:")){let u=this.bareSpec.substring(9),d=u.indexOf("#");if(d===-1)throw this.#n("registry: must include name/version");this.type="registry";let l=u.substring(0,d);l.endsWith("/")||(l+="/");let p=u.substring(d+1);for(let[g,b]of Object.entries(this.options.registries))b.endsWith("/")||(b+="/",this.options.registries[g]=b),b===l&&(this.namedRegistry=g);this.#s(p,l),this.#i();return}let o=Object.entries(this.options.registries);for(let[u,d]of o){let l=`${u}:`;if(this.bareSpec.startsWith(l)){this.type="registry",this.namedRegistry=u,this.#s(this.bareSpec.substring(l.length),d).namedRegistry??=u,this.#i();return}}if(this.bareSpec.startsWith("https://")||this.bareSpec.startsWith("http://")){this.remoteURL=this.bareSpec,this.type="remote";return}if(this.bareSpec.startsWith("file:")){this.type="file";let[u,d]=CL(this.constructor.nodejsDependencies)(this.bareSpec,this);this.file=u,this.bareSpec=d.replace(/\/+$/,""),this.spec=`${this.name}@${this.bareSpec}`;return}if(!this.bareSpec.startsWith("./")&&!this.bareSpec.startsWith("../")&&this.options["git-hosts"].github){let u=this.bareSpec.indexOf("#");if((u===-1?this.bareSpec:this.bareSpec.substring(0,u)).split("/").length===2){this.bareSpec=`github:${this.bareSpec}`,this.spec=`${this.name}@${this.bareSpec}`,this.#r("github",this.options["git-hosts"].github),this.type="git";return}}if(this.bareSpec.includes("/")||this.bareSpec==="."||this.bareSpec===".."){this.type="file";let[u,d]=CL(this.constructor.nodejsDependencies)(`file:${this.bareSpec}`,this);this.bareSpec=d,this.spec=`${this.name}@${this.bareSpec}`,this.file=u;return}this.type="registry";let r=Db(this.bareSpec);r?(this.semver=this.bareSpec.trim(),this.range=r):this.distTag=this.bareSpec,this.registrySpec=this.bareSpec;let{"scope-registries":i,registry:s}=this.options,c=this.scope&&i[this.scope];this.registry=c??s,this.#i()}#o(t){if(!t.startsWith("@"))return;let n=t.indexOf("/");if(n>1&&n<t.length-1){let A=t.substring(0,n);this.registry=this.scopeRegistry=this.options["scope-registries"][A],this.scope=A}}#r(t,n){if(this.bareSpec.startsWith(`${t}:`)){let A=this.bareSpec.indexOf("#"),a=A===-1?this.bareSpec:this.bareSpec.substring(0,A),o=A===-1?"":this.bareSpec.substring(A),r=a.substring(t.length+1);if(!r)throw ie("invalid named git host specifier",{spec:this});let i=r.split("/"),s=n;for(let c=0;c<i.length;c++)s=s.split(`$${c+1}`).join(i[c]);if(s+=o,this.namedGitHost=t,this.namedGitHostPath=r,this.#c(s),this.gitCommittish&&!this.gitSelectorParsed?.path){let c=this.options["git-host-archives"][t];if(c){this.type="remote";let u=c;u=u.split("$committish").join(this.gitCommittish);for(let d=0;d<i.length;d++)u=u.split(`$${d+1}`).join(i[d]);this.remoteURL=u}}return!0}return!1}[XX](){return`@vltpkg/spec.Spec ${String(this)}`}#i(){let{name:t,registry:n,range:A}=this.final;if(!n||!A?.isSingle)return;let a=/^@[^/]+\//;this.conventionalRegistryTarball=String(new URL(`/${t}/-/${t.replace(a,"")}-${A}.tgz`,n))}#s(t,n){return this.registry=n,this.subspec=this.constructor.parse(t,{...this.options,registry:n}),this.subspec}#n(t,n={}){return ie(t,{spec:this.spec,...n},this.#n)}#c(t){let n=t.indexOf("#");if(n===-1){this.gitRemote=t;return}this.gitRemote=t.substring(0,n),this.gitSelector=t.substring(n+1);let[A,a,o]=this.constructor.parseGitSelector(this.gitSelector,this);this.range=o,this.gitCommittish=a,this.gitSelectorParsed=A}static parseGitSelector(t,n){if(!t)return[{}];let A=t.split("::"),a=A[0],o,r,i={};if(typeof a!="string")throw gp("impossible",{found:a,wanted:String});a.includes(":")||(o=a,A.shift());for(let s of A){let c=s.indexOf(":");if(c===-1)continue;let u=s.substring(0,c),d=s.substring(c+1);if(u==="semver"){if(o)throw ie("Cannot specify a semver range and committish value",{spec:n});if(r=Db(d),!r)throw ie(`Invalid git tag semver range: ${d}`,{spec:n})}if(u==="semver"||u==="path")if(u==="path"){if(this.nodejsDependencies?.isAbsolute(d)||/(^|\/|\\)\.\.($|\\|\/)/.test(d))throw ie("Invalid path in git selector",{spec:n});i.path=(this.nodejsDependencies?this.nodejsDependencies.join("/",d).substring(1):d).replace(/\\/g,"/")}else i[u]=d}return[i,o,r]}},CL=e=>(t,n)=>{let A=t.substring(5,7),a=`file:${A==="//"?A:""}`,o=t.substring(a.length),[r="",i="/",s="/",c="/"]=o.split("",4);if(!r)return[".","file:."];if(r==="/"&&i==="~"&&s!=="/"||r==="~"&&i!=="/")throw ie("invalid file: specifier. '~username' not supported",{spec:n});if(r==="~")return e?[e.resolve(e.homedir(),o.substring(2)),`file:${o}`]:[o,`file:${o}`];if(r==="/"&&i==="~")return e?[e.resolve(e.homedir(),o.substring(3)),`file:${o.substring(1)}`]:[o.substring(1),`file:${o.substring(1)}`];if(r==="/"&&i==="."&&(s==="/"||s==="."&&c==="/"))return[o.substring(1),`file:${o.substring(1)}`];if(r==="."&&(i==="/"||i==="."&&s==="/"))return[o,`file:${o}`];if(A==="//")try{let u=new URL(t);if(u.host&&u.host!=="localhost")throw ie("invalid file:// specifier. host must be empty or 'localhost'",{spec:n,found:u.host,validOptions:["","localhost"]});return[u.pathname.replace(/^\/([a-zA-Z]:\/)/,"$1"),`file://${u.pathname}`]}catch(u){throw ie("invalid file:// specifier",{spec:n,cause:u})}return e?.winPath.isAbsolute(o)?[o,`file://${o}`]:[`./${o}`,`file:./${o}`]};var ja="\xB7",aee=new RegExp(`^((git)?${ja}[^${ja}]*${ja}[^${ja}]*(${ja}[^${ja}]*)?$|^(file|remote|workspace)${ja}[^${ja}]*)(${ja}[^${ja}]*)?$`),oee=e=>typeof e=="string"&&aee.test(e),zQ=e=>{if(!oee(e))throw ie("Expected dep id",{found:e});return e};var qo=e=>{let[t,n="",A,a]=e.replaceAll("\xA7","/").split(ja,4),o=decodeURIComponent(n);switch(t){case"git":case"":{if(A===void 0)throw ie(`invalid ${t} id`,{found:e});let r=[t||"registry",o,decodeURIComponent(A)];return a&&r.push(decodeURIComponent(a)),r}case"file":case"remote":case"workspace":{let r=[t,o];return A&&r.push(decodeURIComponent(A)),r}default:throw ie("invalid DepID type",{found:t,validOptions:["git","file","workspace","remote",""]})}},EL=(e,t,n={})=>ree(qo(e),t,n),ree=(e,t,n={})=>{let[A,a,o]=e;switch(A){case"remote":{if(!a)throw ie("no remoteURL found on remote id",{found:e});return Ut.parse(t??"(unknown)",a)}case"file":{if(!a)throw ie("no file path found on remote id",{found:e});return Ut.parse(t??"(unknown)",`file:${a}`,n)}case"registry":{if(typeof a!="string")throw ie("no registry url or name in registry ID",{found:e});if(!o)throw ie("no name/specifier in registry ID",{found:e});if(!a){let i=Ut.parse(o);return t&&i.name!==t?Ut.parse(`${t}@npm:${o}`):i}if(!/^https?:\/\//.test(a)){let i=n.registries?.[a];if(a!=="npm"&&!i)throw ie("named registry not found in options",{name:a,found:e});return Ut.parse(t??"(unknown)",`${a}:${o}`,n)}let r=Ut.parse(t??"(unknown)",`registry:${a}#${o}`,n);return t&&r.final.name!==t?Ut.parse(r.final.name+"@"+r.bareSpec):r}case"git":{if(!a)throw ie("no git remote in git ID",{found:e});return Ut.parse(t??"(unknown)",a+"#"+o,n)}case"workspace":{if(!a)throw ie("no name/path on workspace id",{found:e});return t&&t!==a?Ut.parse(t,`workspace:${a}@*`,n):Ut.parse(a,"workspace:*",n)}}};var Lb=e=>!!e&&typeof e=="object",$p=e=>e===void 0||iee(e),iee=e=>yL(e,t=>typeof t=="string"),yL=(e,t)=>Lb(e)&&Object.entries(e).every(([n,A])=>typeof n=="string"&&t(A));var see=e=>e===void 0||yL(e,t=>uee(t)),cee=e=>e===void 0||typeof e=="boolean",uee=e=>Lb(e)&&cee(e.optional),HQ=e=>e===void 0||typeof e=="string",dee=e=>e===void 0||Lb(e)&&HQ(e.tarball),lee=e=>Lb(e)&&!Array.isArray(e)&&HQ(e.name)&&HQ(e.version)&&$p(e.dependencies)&&$p(e.devDependencies)&&$p(e.optionalDependencies)&&$p(e.peerDependencies)&&$p(e.acceptDependencies)&&see(e.peerDependenciesMeta)&&dee(e.dist);var $Q=(e,t)=>{if(!lee(e))throw ie("invalid manifest",{found:e},t??$Q);return e};var Ss=(e,t)=>{for(let n of t.edgesIn)e.partial.edges.delete(n);e.partial.nodes.delete(t)},QL=e=>{for(let t of e.partial.edges)t.to||e.partial.edges.delete(t)},pee=e=>{let t=Qb(Na(e.pop()).nodes[0]),n=[];for(let A of e)n.push(RQ(Na(A).nodes[0]).value);return n.push(t.attribute),{attribute:t.attribute,insensitive:t.insensitive||!1,operator:t.operator,value:t.value,properties:n}},gee=async e=>{let t;try{t=pee(Na(e.current).nodes)}catch(i){throw ie("Failed to parse :attr selector",{cause:i})}let n=t.operator?jp.get(t.operator):void 0,A=t.value||"",a=t.attribute,o=t.insensitive,r=t.properties;return Pp(e,n,A,a,o,r)},mee=async e=>{for(let t of e.partial.nodes)t.edgesOut.size>0&&Ss(e,t);return e},fee=async e=>{let t=Na(e.current),n=new Set,A=new Set;for(let r of t.nodes)if(wu(r)){let i=await e.walk({initial:{edges:new Set(e.initial.edges),nodes:new Set(e.initial.nodes)},current:r,walk:e.walk,collect:{edges:new Set,nodes:new Set},partial:{edges:new Set(e.partial.edges),nodes:new Set(e.partial.nodes)}});for(let s of i.collect.nodes)n.add(s);for(let s of i.partial.edges)A.add(s)}if(n.size===0)return e.partial.edges.clear(),e.partial.nodes.clear(),e;let a=new Set,o=new Set(n);for(let r of o)for(let i of r.edgesIn)a.add(i.from),i.from.edgesIn.size&&o.add(i.from);e:for(let r of e.partial.nodes){if(r.edgesOut.size===0||!a.has(r)){Ss(e,r);continue}for(let i of r.edgesOut.values())if(A.has(i))continue e;Ss(e,r)}return QL(e),e},bee=async e=>{let t=Na(e.current),n=new Set;for(let A of t.nodes)if(wu(A)){let a=await e.walk({collect:{edges:new Set,nodes:new Set},current:A,initial:e.initial,loose:!0,partial:{nodes:new Set(e.partial.nodes),edges:new Set(e.partial.edges)},walk:e.walk});for(let o of a.collect.nodes)n.add(o)}for(let A of e.partial.nodes)n.has(A)||Ss(e,A);return e},hee=async e=>{for(let t of e.partial.edges)t.to&&e.partial.edges.delete(t);return e.partial.nodes.clear(),e},Bee=async e=>{let t=Na(e.current),n=new Set;for(let A of t.nodes)if(wu(A)){let a=await e.walk({collect:{edges:new Set,nodes:new Set},current:A,initial:e.initial,partial:{nodes:new Set(e.partial.nodes),edges:new Set(e.partial.edges)},walk:e.walk});for(let o of a.collect.nodes)n.add(o)}else throw ie("Error parsing :not() selectors",{wanted:{type:"selector"},found:A});for(let A of e.partial.nodes)n.has(A)&&Ss(e,A);return e},Cee=async e=>{for(let t of e.partial.nodes)(!t.manifest||!$Q(t.manifest).private)&&Ss(e,t);return QL(e),e},wee=async e=>{let[t]=e.initial.nodes.values(),n=t?.graph.mainImporter;if(!n)throw ie(":root pseudo-element works on local graphs only");for(let A of e.partial.edges)A.to!==n&&e.partial.edges.delete(A);return e.partial.nodes.clear(),e.partial.nodes.add(n),e},Eee=async e=>{let[t]=e.initial.nodes.values(),n=t?.graph.importers;if(!n?.size)throw ie(":project pseudo-element works on local graphs only");let A=new Set;for(let a of n)for(let o of a.edgesIn)A.add(o);for(let a of e.partial.edges)(!a.to||!A.has(a))&&e.partial.edges.delete(a);e.partial.nodes.clear();for(let a of n)e.partial.nodes.add(a);return e},yee=async e=>{e.partial.edges.clear(),e.partial.nodes.clear();for(let t of e.initial.edges)e.partial.edges.add(t);for(let t of e.initial.nodes)e.partial.nodes.add(t);return e},Qee=async e=>{let t=Na(e.current),n=Na(t.nodes[0]),A=RQ(n.nodes[0]).value;for(let a of e.partial.nodes)qo(a.id)[0]!==A&&Ss(e,a);return e},kee=new Map(Object.entries({attr:gee,empty:mee,has:fee,is:bee,missing:hee,not:Bee,private:Cee,project:Eee,root:wee,scope:yee,type:Qee})),kL=async e=>{let t=iL(e.current),n=t.value&&kee.get(t.value.slice(1));if(!n){if(e.loose)return e;throw new Error(`Unsupported pseudo-class: ${e.current.value}`)}return n(e)};var Rb=async e=>e,Iee={attribute:sL,class:cL,combinator:uL,comment:Rb,id:dL,nesting:Rb,pseudo:kL,root:Rb,selector:async e=>(e.partial.nodes=new Set(e.initial.nodes),e.partial.edges=new Set(e.initial.edges),e),string:async e=>{throw ie("Unsupported selector",{found:e.current})},tag:async e=>{if(e.current.value!=="{"&&e.current.value!=="}")throw ie("Unsupported selector",{found:e.current});return e},universal:Rb},_ee=new Map(Object.entries(Iee)),TQ=async e=>{let t=_ee.get(e.current.type);if(!t){if(e.loose)return e;throw new Error(`Missing parser for query node: ${e.current.type}`)}if(e=await t(e),yb(e.current)&&e.current.type!=="pseudo"){let n=Na(e.current);if(n.nodes.length)for(let A=0;A<n.nodes.length;A++){let a=n.nodes[A];if(!a)continue;let o={...e,current:a,next:n.nodes[A+1],prev:n.nodes[A-1]};e=await TQ(o)}if(wu(n)){for(let A of e.partial.edges)e.collect.edges.add(A);for(let A of e.partial.nodes)e.collect.nodes.add(A)}}return e},Mb=class{#e;#t;constructor({graph:t}){this.#e=new Map,this.#t=t}async search(t){if(typeof t!="string")throw new TypeError("Query search argument needs to be a string");if(!t)return{edges:[],nodes:[]};let n=this.#e.get(t);if(n)return n;let A=new Set(Array.from(this.#t.nodes.values())),a=new Set(Array.from(this.#t.edges)),{collect:o}=await TQ({current:(0,IL.default)().astSync(t),initial:{nodes:new Set(A),edges:new Set(a)},collect:{nodes:new Set,edges:new Set},partial:{nodes:A,edges:a},walk:TQ}),r={edges:Array.from(o.edges),nodes:Array.from(o.nodes)};return this.#e.set(t,r),r}};var Nb=w(_(),1);var Qu=w(I(),1),_L=({className:e,tabIndex:t,startContent:n,endContent:A})=>{let a=D(i=>i.updateQuery),o=D(i=>i.query),r=(0,Nb.useRef)(null);return(0,Nb.useEffect)(()=>{let i=s=>{switch(!0){case((s.metaKey||s.ctrlKey)&&s.key==="k"):s.preventDefault(),r.current?.focus();break;case s.key==="Escape":s.preventDefault(),r.current?.blur();break;default:break}};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[]),(0,Qu.jsxs)("div",{className:"flex items-center relative grow",children:[n&&(0,Qu.jsx)("div",{className:"absolute pr-8",children:n}),(0,Qu.jsx)(We,{type:"text",role:"search",tabIndex:t,ref:r,className:`${e} ${n?"pl-10":""}`,placeholder:"Query Lookup, e.g: :root > *",value:o,onChange:i=>{let s=i.currentTarget.value;a(s)}}),A&&(0,Qu.jsx)("div",{className:"absolute right-0",children:A})]})};var xL=e=>xee.has(e);var ku=new Set(["dependencies","devDependencies","peerDependencies","optionalDependencies"]),xee=new Set(["prod","dev","peer","optional","peerOptional"]),Dee=new Map([["dependencies","prod"],["devDependencies","dev"],["peerDependencies","peer"],["optionalDependencies","optional"]]),UQ=(e,t,n)=>{let A=Dee.get(e);if(!A)throw ie("Invalid dependency type name",{found:e,validOptions:[...ku]});return A!=="peer"?A:t&&n?.peerDependenciesMeta?.[t]?.optional===!0?"peerOptional":"peer"};var ZQ=e=>({dev:!!(e&Fee),optional:!!(e&vee)});var vee=1,Fee=2;var Tp=e=>{if(!e)return"";let t=e.version?`@${e.version}`:"",[n,A,a]=qo(e.id);if(n==="registry")return`${A?`${A}:`:"npm:"}${a}`;if(n==="workspace")return`workspace:${e.name}`;if(n==="file"&&e.mainImporter)return`root:${e.name}`;{let o=e.name!==e.id?`:${e.name}${t}`:"";return`${n}(${A})${o}`}};var DL=(e,t,n)=>{let A=Object.entries(t);for(let[a,o]of A){let[r,i]=Pa(a," ",2),[s,c]=Pa(o," ",2),u=c?.lastIndexOf(" ")??-1;if(!c||!s||!r||!i||u<1)continue;let d=Ut.parse(i,c.substring(0,u),n),l=c.substring(u+1),p=e.nodes.get(zQ(r));if(!p)throw ie("Edge info missing its `from` node",{found:{nodes:[...e.nodes].map(([b])=>b),from:p,fromId:r,edge:{[a]:o}}});let g=l==="MISSING"?void 0:e.nodes.get(zQ(l));if(!xL(s))throw ie("Found unsupported dependency type in lockfile",{validOptions:[...ku]});e.addEdge(s,d,p,g)}};var vL=(e,t)=>{let n=Object.entries(t);for(let[A,a]of n){if(e.nodes.has(A))continue;let[o,r,i,s,c,u]=a,[d,,l]=qo(A),p=u?e.addNode(A,u):e.addNode(A,void 0,void 0,r??void 0,d==="registry"&&l.indexOf("@")>0?l.split("@").slice(-1)[0]:void 0),{dev:g,optional:b}=ZQ(o);p.dev=g,p.optional=b,p.integrity=i??void 0,p.resolved=s??void 0,p.resolved||p.setResolved(),c&&(p.location=c)}};var qQ={loadEdges:DL,loadNodes:vL};var Iu=w(_(),1);var ai=w(I(),1),Ls=({renderAsLink:e,className:t,...n})=>{let A=v("block rounded-lg border bg-card text-card-foreground shadow-sm",t);return e?(0,ai.jsx)("a",{href:"#",className:A,...n}):(0,ai.jsx)("div",{className:A,...n})};Ls.displayName="Card";var Ga=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("div",{ref:n,className:v("flex flex-col p-6",e),...t}));Ga.displayName="CardHeader";var jA=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("h3",{ref:n,className:v("text-2xl font-semibold leading-none tracking-tight",e),...t}));jA.displayName="CardTitle";var OQ=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("p",{ref:n,className:v("text-sm text-muted-foreground",e),...t}));OQ.displayName="CardDescription";var See=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("div",{ref:n,className:v("p-6 pt-0",e),...t}));See.displayName="CardContent";var Lee=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("div",{ref:n,className:v("flex items-center p-6 pt-0",e),...t}));Lee.displayName="CardFooter";var Up=new Map([[void 0,"border-transparent bg-gray-100 text-neutral-900 hover:bg-gray-100/80"],["prod","border-transparent bg-cyan-100 text-neutral-900 hover:bg-cyan-100/80"],["dev","border-transparent bg-fuchsia-100 text-neutral-900 hover:bg-fuchsia-100/80"],["optional","border-transparent bg-orange-100 text-neutral-900 hover:bg-orange-100/80"],["peer","border-transparent bg-lime-100 text-neutral-900 hover:bg-lime-100/80"],["peerOptional","border-transparent bg-yellow-100 text-neutral-900 hover:bg-yellow-100/80"]]);var Ge=w(I(),1),Ree=({item:e,query:t,updateQuery:n})=>A=>{if(A.preventDefault(),!e.to)return;let a="";if(e.stacked){let o=e.to.name?`[name="${e.to.name}"]`:"",r=e.to.version?`[version="${e.to.version}"]`:"";a=`${t.trim()}${o}${r}`}else{let o="";if(!e.sameItems){let r=e.to.name?`[name="${e.to.name}"]`:"",i=e.to.version?`[version="${e.to.version}"]`:"";o=`${r}${i}`}if(e.to.importer&&!e.from)a=`:project[name="${e.to.name}"]`;else if(e.from){let r=`[name="${e.from.name}"]`,i=e.from.version?`[version="${e.from.version}"]`:"";a=`${r}${i} > :is(${t.trim()}${o})`}else a=`${t.trim()}${o}`}n(a)},FL=({item:e})=>{let t=D(A=>A.updateQuery),n=D(A=>A.query);return(0,Ge.jsxs)("div",{className:"group relative z-10",children:[e.stacked?(0,Ge.jsxs)(Ge.Fragment,{children:[e.size>2?(0,Ge.jsx)("div",{className:"transition-all group-hover:border-neutral-400 dark:group-hover:border-neutral-600 absolute border top-2 left-2 w-[97.5%] h-full bg-card rounded-lg"}):"",(0,Ge.jsx)("div",{className:"transition-all group-hover:border-neutral-400 dark:group-hover:border-neutral-600 absolute border top-1 left-1 w-[99%] h-full bg-card rounded-lg"})]}):"",(0,Ge.jsxs)(Ls,{renderAsLink:!0,className:`relative group-hover:border-neutral-400 dark:group-hover:border-neutral-600 ${e.to?"cursor-pointer":"cursor-default"}`,onClick:Ree({item:e,query:n,updateQuery:t}),children:[(0,Ge.jsxs)(Ga,{className:"m-0 px-4 py-3 rounded-t-lg flex flex-row items-center justify-between border-b-[1px]",children:[(0,Ge.jsx)(Xe,{children:(0,Ge.jsxs)(et,{children:[(0,Ge.jsx)(Qt,{className:"truncate",children:(0,Ge.jsx)(jA,{className:"text-md truncate",children:e.title})}),(0,Ge.jsx)(Oe,{children:(0,Ge.jsx)("p",{children:e.title})})]})}),e.type?(0,Ge.jsx)("div",{className:"flex items-center justify-center text-pretty rounded-md border-[1px] px-2.5 py-0.5 text-xs text-muted-foreground",children:(0,Ge.jsxs)("p",{className:"font-semibold",children:[e.stacked?"":(0,Ge.jsx)("span",{children:e.type}),(0,Ge.jsx)("span",{className:"font-medium px-1 text-muted-foreground",children:"dep of:"}),e.stacked?(0,Ge.jsxs)("span",{children:[e.size," packages"]}):(0,Ge.jsx)("span",{children:Tp(e.from)})]})}):""]}),(0,Ge.jsxs)("div",{className:"w-full h-12 flex items-center gap-4 justify-between border-t-[1px] px-4 py-3",children:[e.version?(0,Ge.jsx)(Xe,{children:(0,Ge.jsxs)(et,{children:[(0,Ge.jsx)(Qt,{className:"rounded-sm border-[1px] px-2 py-1 text-[0.65rem] text-muted-foreground font-mono m-0 align-baseline truncate",children:e.version}),(0,Ge.jsx)(Oe,{children:(0,Ge.jsx)("p",{children:e.version})})]})}):"",(0,Ge.jsx)("div",{className:"flex gap-2",children:e.labels?.length?e.labels.map(A=>(0,Ge.jsx)("div",{children:(0,Ge.jsx)($o,{className:Up.get(A)||"",children:A})},A)):""})]})]})]})};var Jp=w(_(),1);var Oo=w(_(),1);var un=w(_(),1);var re=w(_(),1);var oi=w(_(),1);var Pb=w(I(),1);function ri(e){let t=e+"CollectionProvider",[n,A]=ru(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),r=p=>{let{scope:g,children:b}=p,B=oi.default.useRef(null),f=oi.default.useRef(new Map).current;return(0,Pb.jsx)(a,{scope:g,itemMap:f,collectionRef:B,children:b})};r.displayName=t;let i=e+"CollectionSlot",s=oi.default.forwardRef((p,g)=>{let{scope:b,children:B}=p,f=o(i,b),m=pe(g,f.collectionRef);return(0,Pb.jsx)(Nt,{ref:m,children:B})});s.displayName=i;let c=e+"CollectionItemSlot",u="data-radix-collection-item",d=oi.default.forwardRef((p,g)=>{let{scope:b,children:B,...f}=p,m=oi.default.useRef(null),h=pe(g,m),C=o(c,b);return oi.default.useEffect(()=>(C.itemMap.set(m,{ref:m,...f}),()=>void C.itemMap.delete(m))),(0,Pb.jsx)(Nt,{[u]:"",ref:h,children:B})});d.displayName=c;function l(p){let g=o(e+"CollectionConsumer",p);return oi.default.useCallback(()=>{let B=g.collectionRef.current;if(!B)return[];let f=Array.from(B.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((C,E)=>f.indexOf(C.ref.current)-f.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:r,Slot:s,ItemSlot:d},l,A]}var jb=w(_(),1),Mee=w(I(),1),Nee=jb.createContext(void 0);function ii(e){let t=jb.useContext(Nee);return e||t||"ltr"}var bn=w(_(),1);var si=w(I(),1),YQ="rovingFocusGroup.onEntryFocus",Pee={bubbles:!1,cancelable:!0},Gb="RovingFocusGroup",[KQ,SL,jee]=ri(Gb),[Gee,_u]=ru(Gb,[jee]),[zee,Hee]=Gee(Gb),LL=bn.forwardRef((e,t)=>(0,si.jsx)(KQ.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,si.jsx)(KQ.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,si.jsx)($ee,{...e,ref:t})})}));LL.displayName=Gb;var $ee=bn.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:A,loop:a=!1,dir:o,currentTabStopId:r,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:s,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,l=bn.useRef(null),p=pe(t,l),g=ii(o),[b=null,B]=Tt({prop:r,defaultProp:i,onChange:s}),[f,m]=bn.useState(!1),h=Je(c),C=SL(n),E=bn.useRef(!1),[Q,y]=bn.useState(0);return bn.useEffect(()=>{let k=l.current;if(k)return k.addEventListener(YQ,h),()=>k.removeEventListener(YQ,h)},[h]),(0,si.jsx)(zee,{scope:n,orientation:A,dir:g,loop:a,currentTabStopId:b,onItemFocus:bn.useCallback(k=>B(k),[B]),onItemShiftTab:bn.useCallback(()=>m(!0),[]),onFocusableItemAdd:bn.useCallback(()=>y(k=>k+1),[]),onFocusableItemRemove:bn.useCallback(()=>y(k=>k-1),[]),children:(0,si.jsx)(Z.div,{tabIndex:f||Q===0?-1:0,"data-orientation":A,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{E.current=!0}),onFocus:z(e.onFocus,k=>{let R=!E.current;if(k.target===k.currentTarget&&R&&!f){let F=new CustomEvent(YQ,Pee);if(k.currentTarget.dispatchEvent(F),!F.defaultPrevented){let U=C().filter(W=>W.focusable),M=U.find(W=>W.active),ce=U.find(W=>W.id===b),te=[M,ce,...U].filter(Boolean).map(W=>W.ref.current);NL(te,u)}}E.current=!1}),onBlur:z(e.onBlur,()=>m(!1))})})}),RL="RovingFocusGroupItem",ML=bn.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:A=!0,active:a=!1,tabStopId:o,...r}=e,i=Pe(),s=o||i,c=Hee(RL,n),u=c.currentTabStopId===s,d=SL(n),{onFocusableItemAdd:l,onFocusableItemRemove:p}=c;return bn.useEffect(()=>{if(A)return l(),()=>p()},[A,l,p]),(0,si.jsx)(KQ.ItemSlot,{scope:n,id:s,focusable:A,active:a,children:(0,si.jsx)(Z.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...r,ref:t,onMouseDown:z(e.onMouseDown,g=>{A?c.onItemFocus(s):g.preventDefault()}),onFocus:z(e.onFocus,()=>c.onItemFocus(s)),onKeyDown:z(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;let b=Zee(g,c.orientation,c.dir);if(b!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let f=d().filter(m=>m.focusable).map(m=>m.ref.current);if(b==="last")f.reverse();else if(b==="prev"||b==="next"){b==="prev"&&f.reverse();let m=f.indexOf(g.currentTarget);f=c.loop?qee(f,m+1):f.slice(m+1)}setTimeout(()=>NL(f))}})})})});ML.displayName=RL;var Tee={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uee(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Zee(e,t,n){let A=Uee(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(A))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(A)))return Tee[A]}function NL(e,t=!1){let n=document.activeElement;for(let A of e)if(A===n||(A.focus({preventScroll:t}),document.activeElement!==n))return}function qee(e,t){return e.map((n,A)=>e[(t+A)%e.length])}var zb=LL,Hb=ML;var ge=w(I(),1),WQ=["Enter"," "],Oee=["ArrowDown","PageUp","Home"],GL=["ArrowUp","PageDown","End"],Yee=[...Oee,...GL],Kee={ltr:[...WQ,"ArrowRight"],rtl:[...WQ,"ArrowLeft"]},Wee={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Yp="Menu",[qp,Jee,Vee]=ri(Yp),[Rs,JQ]=Pt(Yp,[Vee,aa,_u]),Kp=aa(),zL=_u(),[HL,ci]=Rs(Yp),[Xee,Wp]=Rs(Yp),$L=e=>{let{__scopeMenu:t,open:n=!1,children:A,dir:a,onOpenChange:o,modal:r=!0}=e,i=Kp(t),[s,c]=re.useState(null),u=re.useRef(!1),d=Je(o),l=ii(a);return re.useEffect(()=>{let p=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),(0,ge.jsx)(jo,{...i,children:(0,ge.jsx)(HL,{scope:t,open:n,onOpenChange:d,content:s,onContentChange:c,children:(0,ge.jsx)(Xee,{scope:t,onClose:re.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:l,modal:r,children:A})})})};$L.displayName=Yp;var ete="MenuAnchor",VQ=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e,a=Kp(n);return(0,ge.jsx)(Go,{...a,...A,ref:t})});VQ.displayName=ete;var XQ="MenuPortal",[tte,TL]=Rs(XQ,{forceMount:void 0}),UL=e=>{let{__scopeMenu:t,forceMount:n,children:A,container:a}=e,o=ci(XQ,t);return(0,ge.jsx)(tte,{scope:t,forceMount:n,children:(0,ge.jsx)(jt,{present:n||o.open,children:(0,ge.jsx)(LA,{asChild:!0,container:a,children:A})})})};UL.displayName=XQ;var ma="MenuContent",[nte,ek]=Rs(ma),ZL=re.forwardRef((e,t)=>{let n=TL(ma,e.__scopeMenu),{forceMount:A=n.forceMount,...a}=e,o=ci(ma,e.__scopeMenu),r=Wp(ma,e.__scopeMenu);return(0,ge.jsx)(qp.Provider,{scope:e.__scopeMenu,children:(0,ge.jsx)(jt,{present:A||o.open,children:(0,ge.jsx)(qp.Slot,{scope:e.__scopeMenu,children:r.modal?(0,ge.jsx)(Ate,{...a,ref:t}):(0,ge.jsx)(ate,{...a,ref:t})})})})}),Ate=re.forwardRef((e,t)=>{let n=ci(ma,e.__scopeMenu),A=re.useRef(null),a=pe(t,A);return re.useEffect(()=>{let o=A.current;if(o)return Zr(o)},[]),(0,ge.jsx)(tk,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ate=re.forwardRef((e,t)=>{let n=ci(ma,e.__scopeMenu);return(0,ge.jsx)(tk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tk=re.forwardRef((e,t)=>{let{__scopeMenu:n,loop:A=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:i,onEntryFocus:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:l,onDismiss:p,disableOutsideScroll:g,...b}=e,B=ci(ma,n),f=Wp(ma,n),m=Kp(n),h=zL(n),C=Jee(n),[E,Q]=re.useState(null),y=re.useRef(null),k=pe(t,y,B.onContentChange),R=re.useRef(0),F=re.useRef(""),U=re.useRef(0),M=re.useRef(null),ce=re.useRef("right"),N=re.useRef(0),te=g?Lo:re.Fragment,W=g?{as:Nt,allowPinchZoom:!0}:void 0,ne=H=>{let ve=F.current+H,Re=C().filter($=>!$.disabled),L=document.activeElement,ae=Re.find($=>$.ref.current===L)?.textValue,ue=Re.map($=>$.textValue),Ae=bte(ue,ve,ae),Qe=Re.find($=>$.textValue===Ae)?.ref.current;(function $(_e){F.current=_e,window.clearTimeout(R.current),_e!==""&&(R.current=window.setTimeout(()=>$(""),1e3))})(ve),Qe&&setTimeout(()=>Qe.focus())};re.useEffect(()=>()=>window.clearTimeout(R.current),[]),Ur();let K=re.useCallback(H=>ce.current===M.current?.side&&Bte(H,M.current?.area),[]);return(0,ge.jsx)(nte,{scope:n,searchRef:F,onItemEnter:re.useCallback(H=>{K(H)&&H.preventDefault()},[K]),onItemLeave:re.useCallback(H=>{K(H)||(y.current?.focus(),Q(null))},[K]),onTriggerLeave:re.useCallback(H=>{K(H)&&H.preventDefault()},[K]),pointerGraceTimerRef:U,onPointerGraceIntentChange:re.useCallback(H=>{M.current=H},[]),children:(0,ge.jsx)(te,{...W,children:(0,ge.jsx)(So,{asChild:!0,trapped:a,onMountAutoFocus:z(o,H=>{H.preventDefault(),y.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:r,children:(0,ge.jsx)(ea,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:l,onDismiss:p,children:(0,ge.jsx)(zb,{asChild:!0,...h,dir:f.dir,orientation:"vertical",loop:A,currentTabStopId:E,onCurrentTabStopIdChange:Q,onEntryFocus:z(s,H=>{f.isUsingKeyboardRef.current||H.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,ge.jsx)(Kr,{role:"menu","aria-orientation":"vertical","data-state":iR(B.open),"data-radix-menu-content":"",dir:f.dir,...m,...b,ref:k,style:{outline:"none",...b.style},onKeyDown:z(b.onKeyDown,H=>{let Re=H.target.closest("[data-radix-menu-content]")===H.currentTarget,L=H.ctrlKey||H.altKey||H.metaKey,ae=H.key.length===1;Re&&(H.key==="Tab"&&H.preventDefault(),!L&&ae&&ne(H.key));let ue=y.current;if(H.target!==ue||!Yee.includes(H.key))return;H.preventDefault();let Qe=C().filter($=>!$.disabled).map($=>$.ref.current);GL.includes(H.key)&&Qe.reverse(),mte(Qe)}),onBlur:z(e.onBlur,H=>{H.currentTarget.contains(H.target)||(window.clearTimeout(R.current),F.current="")}),onPointerMove:z(e.onPointerMove,Op(H=>{let ve=H.target,Re=N.current!==H.clientX;if(H.currentTarget.contains(ve)&&Re){let L=H.clientX>N.current?"right":"left";ce.current=L,N.current=H.clientX}}))})})})})})})});ZL.displayName=ma;var ote="MenuGroup",nk=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e;return(0,ge.jsx)(Z.div,{role:"group",...A,ref:t})});nk.displayName=ote;var rte="MenuLabel",qL=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e;return(0,ge.jsx)(Z.div,{...A,ref:t})});qL.displayName=rte;var $b="MenuItem",jL="menu.itemSelect",Ub=re.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:A,...a}=e,o=re.useRef(null),r=Wp($b,e.__scopeMenu),i=ek($b,e.__scopeMenu),s=pe(t,o),c=re.useRef(!1),u=()=>{let d=o.current;if(!n&&d){let l=new CustomEvent(jL,{bubbles:!0,cancelable:!0});d.addEventListener(jL,p=>A?.(p),{once:!0}),Oc(d,l),l.defaultPrevented?c.current=!1:r.onClose()}};return(0,ge.jsx)(OL,{...a,ref:s,disabled:n,onClick:z(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:z(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,d=>{let l=i.searchRef.current!=="";n||l&&d.key===" "||WQ.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Ub.displayName=$b;var OL=re.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:A=!1,textValue:a,...o}=e,r=ek($b,n),i=zL(n),s=re.useRef(null),c=pe(t,s),[u,d]=re.useState(!1),[l,p]=re.useState("");return re.useEffect(()=>{let g=s.current;g&&p((g.textContent??"").trim())},[o.children]),(0,ge.jsx)(qp.ItemSlot,{scope:n,disabled:A,textValue:a??l,children:(0,ge.jsx)(Hb,{asChild:!0,...i,focusable:!A,children:(0,ge.jsx)(Z.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":A||void 0,"data-disabled":A?"":void 0,...o,ref:c,onPointerMove:z(e.onPointerMove,Op(g=>{A?r.onItemLeave(g):(r.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Op(g=>r.onItemLeave(g))),onFocus:z(e.onFocus,()=>d(!0)),onBlur:z(e.onBlur,()=>d(!1))})})})}),ite="MenuCheckboxItem",YL=re.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:A,...a}=e;return(0,ge.jsx)(XL,{scope:e.__scopeMenu,checked:n,children:(0,ge.jsx)(Ub,{role:"menuitemcheckbox","aria-checked":Tb(n)?"mixed":n,...a,ref:t,"data-state":ok(n),onSelect:z(a.onSelect,()=>A?.(Tb(n)?!0:!n),{checkForDefaultPrevented:!1})})})});YL.displayName=ite;var KL="MenuRadioGroup",[ste,cte]=Rs(KL,{value:void 0,onValueChange:()=>{}}),WL=re.forwardRef((e,t)=>{let{value:n,onValueChange:A,...a}=e,o=Je(A);return(0,ge.jsx)(ste,{scope:e.__scopeMenu,value:n,onValueChange:o,children:(0,ge.jsx)(nk,{...a,ref:t})})});WL.displayName=KL;var JL="MenuRadioItem",VL=re.forwardRef((e,t)=>{let{value:n,...A}=e,a=cte(JL,e.__scopeMenu),o=n===a.value;return(0,ge.jsx)(XL,{scope:e.__scopeMenu,checked:o,children:(0,ge.jsx)(Ub,{role:"menuitemradio","aria-checked":o,...A,ref:t,"data-state":ok(o),onSelect:z(A.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});VL.displayName=JL;var Ak="MenuItemIndicator",[XL,ute]=Rs(Ak,{checked:!1}),eR=re.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:A,...a}=e,o=ute(Ak,n);return(0,ge.jsx)(jt,{present:A||Tb(o.checked)||o.checked===!0,children:(0,ge.jsx)(Z.span,{...a,ref:t,"data-state":ok(o.checked)})})});eR.displayName=Ak;var dte="MenuSeparator",tR=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e;return(0,ge.jsx)(Z.div,{role:"separator","aria-orientation":"horizontal",...A,ref:t})});tR.displayName=dte;var lte="MenuArrow",nR=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e,a=Kp(n);return(0,ge.jsx)(Wr,{...a,...A,ref:t})});nR.displayName=lte;var ak="MenuSub",[pte,AR]=Rs(ak),gte=e=>{let{__scopeMenu:t,children:n,open:A=!1,onOpenChange:a}=e,o=ci(ak,t),r=Kp(t),[i,s]=re.useState(null),[c,u]=re.useState(null),d=Je(a);return re.useEffect(()=>(o.open===!1&&d(!1),()=>d(!1)),[o.open,d]),(0,ge.jsx)(jo,{...r,children:(0,ge.jsx)(HL,{scope:t,open:A,onOpenChange:d,content:c,onContentChange:u,children:(0,ge.jsx)(pte,{scope:t,contentId:Pe(),triggerId:Pe(),trigger:i,onTriggerChange:s,children:n})})})};gte.displayName=ak;var Zp="MenuSubTrigger",aR=re.forwardRef((e,t)=>{let n=ci(Zp,e.__scopeMenu),A=Wp(Zp,e.__scopeMenu),a=AR(Zp,e.__scopeMenu),o=ek(Zp,e.__scopeMenu),r=re.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:s}=o,c={__scopeMenu:e.__scopeMenu},u=re.useCallback(()=>{r.current&&window.clearTimeout(r.current),r.current=null},[]);return re.useEffect(()=>u,[u]),re.useEffect(()=>{let d=i.current;return()=>{window.clearTimeout(d),s(null)}},[i,s]),(0,ge.jsx)(VQ,{asChild:!0,...c,children:(0,ge.jsx)(OL,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":iR(n.open),...e,ref:as(t,a.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Op(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!r.current&&(o.onPointerGraceIntentChange(null),r.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:z(e.onPointerLeave,Op(d=>{u();let l=n.content?.getBoundingClientRect();if(l){let p=n.content?.dataset.side,g=p==="right",b=g?-5:5,B=l[g?"left":"right"],f=l[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+b,y:d.clientY},{x:B,y:l.top},{x:f,y:l.top},{x:f,y:l.bottom},{x:B,y:l.bottom}],side:p}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,d=>{let l=o.searchRef.current!=="";e.disabled||l&&d.key===" "||Kee[A.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});aR.displayName=Zp;var oR="MenuSubContent",rR=re.forwardRef((e,t)=>{let n=TL(ma,e.__scopeMenu),{forceMount:A=n.forceMount,...a}=e,o=ci(ma,e.__scopeMenu),r=Wp(ma,e.__scopeMenu),i=AR(oR,e.__scopeMenu),s=re.useRef(null),c=pe(t,s);return(0,ge.jsx)(qp.Provider,{scope:e.__scopeMenu,children:(0,ge.jsx)(jt,{present:A||o.open,children:(0,ge.jsx)(qp.Slot,{scope:e.__scopeMenu,children:(0,ge.jsx)(tk,{id:i.contentId,"aria-labelledby":i.triggerId,...a,ref:c,align:"start",side:r.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{r.isUsingKeyboardRef.current&&s.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:z(e.onFocusOutside,u=>{u.target!==i.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,u=>{r.onClose(),u.preventDefault()}),onKeyDown:z(e.onKeyDown,u=>{let d=u.currentTarget.contains(u.target),l=Wee[r.dir].includes(u.key);d&&l&&(o.onOpenChange(!1),i.trigger?.focus(),u.preventDefault())})})})})})});rR.displayName=oR;function iR(e){return e?"open":"closed"}function Tb(e){return e==="indeterminate"}function ok(e){return Tb(e)?"indeterminate":e?"checked":"unchecked"}function mte(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function fte(e,t){return e.map((n,A)=>e[(t+A)%e.length])}function bte(e,t,n){let a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1,r=fte(e,Math.max(o,0));a.length===1&&(r=r.filter(c=>c!==n));let s=r.find(c=>c.toLowerCase().startsWith(a.toLowerCase()));return s!==n?s:void 0}function hte(e,t){let{x:n,y:A}=e,a=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,u=t[r].y;s>A!=u>A&&n<(c-i)*(A-s)/(u-s)+i&&(a=!a)}return a}function Bte(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return hte(n,t)}function Op(e){return t=>t.pointerType==="mouse"?e(t):void 0}var sR=$L,cR=VQ,uR=UL,dR=ZL,lR=nk,pR=qL,gR=Ub,mR=YL,fR=WL,bR=VL,hR=eR,BR=tR,CR=nR;var wR=aR,ER=rR;var hn=w(I(),1),rk="DropdownMenu",[wte,p0e]=Pt(rk,[JQ]),AA=JQ(),[Ete,yR]=wte(rk),QR=e=>{let{__scopeDropdownMenu:t,children:n,dir:A,open:a,defaultOpen:o,onOpenChange:r,modal:i=!0}=e,s=AA(t),c=un.useRef(null),[u=!1,d]=Tt({prop:a,defaultProp:o,onChange:r});return(0,hn.jsx)(Ete,{scope:t,triggerId:Pe(),triggerRef:c,contentId:Pe(),open:u,onOpenChange:d,onOpenToggle:un.useCallback(()=>d(l=>!l),[d]),modal:i,children:(0,hn.jsx)(sR,{...s,open:u,onOpenChange:d,dir:A,modal:i,children:n})})};QR.displayName=rk;var kR="DropdownMenuTrigger",IR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:A=!1,...a}=e,o=yR(kR,n),r=AA(n);return(0,hn.jsx)(cR,{asChild:!0,...r,children:(0,hn.jsx)(Z.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":A?"":void 0,disabled:A,...a,ref:as(t,o.triggerRef),onPointerDown:z(e.onPointerDown,i=>{!A&&i.button===0&&i.ctrlKey===!1&&(o.onOpenToggle(),o.open||i.preventDefault())}),onKeyDown:z(e.onKeyDown,i=>{A||(["Enter"," "].includes(i.key)&&o.onOpenToggle(),i.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});IR.displayName=kR;var yte="DropdownMenuPortal",_R=e=>{let{__scopeDropdownMenu:t,...n}=e,A=AA(t);return(0,hn.jsx)(uR,{...A,...n})};_R.displayName=yte;var xR="DropdownMenuContent",DR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=yR(xR,n),o=AA(n),r=un.useRef(!1);return(0,hn.jsx)(dR,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...A,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,i=>{r.current||a.triggerRef.current?.focus(),r.current=!1,i.preventDefault()}),onInteractOutside:z(e.onInteractOutside,i=>{let s=i.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0,u=s.button===2||c;(!a.modal||u)&&(r.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});DR.displayName=xR;var Qte="DropdownMenuGroup",kte=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(lR,{...a,...A,ref:t})});kte.displayName=Qte;var Ite="DropdownMenuLabel",vR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(pR,{...a,...A,ref:t})});vR.displayName=Ite;var _te="DropdownMenuItem",FR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(gR,{...a,...A,ref:t})});FR.displayName=_te;var xte="DropdownMenuCheckboxItem",SR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(mR,{...a,...A,ref:t})});SR.displayName=xte;var Dte="DropdownMenuRadioGroup",vte=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(fR,{...a,...A,ref:t})});vte.displayName=Dte;var Fte="DropdownMenuRadioItem",LR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(bR,{...a,...A,ref:t})});LR.displayName=Fte;var Ste="DropdownMenuItemIndicator",RR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(hR,{...a,...A,ref:t})});RR.displayName=Ste;var Lte="DropdownMenuSeparator",MR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(BR,{...a,...A,ref:t})});MR.displayName=Lte;var Rte="DropdownMenuArrow",Mte=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(CR,{...a,...A,ref:t})});Mte.displayName=Rte;var Nte="DropdownMenuSubTrigger",NR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(wR,{...a,...A,ref:t})});NR.displayName=Nte;var Pte="DropdownMenuSubContent",PR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(ER,{...a,...A,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});PR.displayName=Pte;var jR=QR,GR=IR,zR=_R,ik=DR;var sk=vR,ck=FR,uk=SR;var dk=LR,lk=RR,pk=MR;var gk=NR,mk=PR;var dn=w(I(),1),HR=jR,$R=GR;var Gte=Oo.forwardRef(({className:e,inset:t,children:n,...A},a)=>(0,dn.jsxs)(gk,{ref:a,className:v("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...A,children:[n,(0,dn.jsx)(Wa,{className:"ml-auto"})]}));Gte.displayName=gk.displayName;var zte=Oo.forwardRef(({className:e,...t},n)=>(0,dn.jsx)(mk,{ref:n,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));zte.displayName=mk.displayName;var fk=Oo.forwardRef(({className:e,sideOffset:t=4,...n},A)=>(0,dn.jsx)(zR,{children:(0,dn.jsx)(ik,{ref:A,sideOffset:t,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));fk.displayName=ik.displayName;var bk=Oo.forwardRef(({className:e,inset:t,...n},A)=>(0,dn.jsx)(ck,{ref:A,className:v("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));bk.displayName=ck.displayName;var Hte=Oo.forwardRef(({className:e,children:t,checked:n,...A},a)=>(0,dn.jsxs)(uk,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...A,children:[(0,dn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dn.jsx)(lk,{children:(0,dn.jsx)(Da,{className:"h-4 w-4"})})}),t]}));Hte.displayName=uk.displayName;var $te=Oo.forwardRef(({className:e,children:t,...n},A)=>(0,dn.jsxs)(dk,{ref:A,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[(0,dn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dn.jsx)(lk,{children:(0,dn.jsx)(xl,{className:"h-2 w-2 fill-current"})})}),t]}));$te.displayName=dk.displayName;var Tte=Oo.forwardRef(({className:e,inset:t,...n},A)=>(0,dn.jsx)(sk,{ref:A,className:v("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Tte.displayName=sk.displayName;var Ute=Oo.forwardRef(({className:e,...t},n)=>(0,dn.jsx)(pk,{ref:n,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));Ute.displayName=pk.displayName;var Zte=({className:e,...t})=>(0,dn.jsx)("span",{className:v("ml-auto text-xs tracking-widest opacity-60",e),...t});Zte.displayName="DropdownMenuShortcut";var tt=w(I(),1),xu=({dependencies:e,item:t,highlight:n,parent:A,onSelect:a,onUninstall:o})=>{let r=(0,Jp.useRef)(null),i=(0,Jp.useRef)(null),s=D(d=>d.linePositionReference);(0,Jp.useEffect)(()=>{let d=i.current?.getBoundingClientRect();if(d&&i.current){let l=d.bottom-s;i.current.style.height=`${l}px`}t.depIndex&&r.current&&(r.current.style.zIndex=`${9999-t.depIndex}`)});let c=d=>{d.preventDefault(),o&&o(t)},u=!!o&&t.from?.importer;return(0,tt.jsxs)("div",{className:"group relative z-10",ref:r,children:[t.stacked?(0,tt.jsxs)(tt.Fragment,{children:[t.size>2?(0,tt.jsx)("div",{className:`transition-all absolute border top-2 left-2 w-[96%] h-full bg-card rounded-lg ${a?"group-hover:border-neutral-400 dark:group-hover:border-neutral-600":""}`}):"",(0,tt.jsx)("div",{className:`transition-all absolute border top-1 left-1 w-[98%] h-full bg-card rounded-lg ${a?"group-hover:border-neutral-400 dark:group-hover:border-neutral-600":""}`})]}):"",(0,tt.jsx)(Ls,{role:"article",className:`transition-all relative my-4 ${n?"border-foreground":""} ${a?"cursor-pointer group-hover:border-neutral-400 dark:group-hover:border-neutral-600":""}`,onClick:a,children:(0,tt.jsxs)(Ga,{className:"rounded-t-lg relative flex flex-col w-full p-0",children:[(0,tt.jsxs)("div",{className:"flex items-center px-3 py-2",children:[(0,tt.jsx)(jA,{className:`text-sm font-medium flex-1 items-center ${u?"pl-8":""}`,children:t.name}),(0,tt.jsx)("div",{className:"px-2 py-1 border-[1px] border-solid rounded-full flex-initial",children:(0,tt.jsx)("p",{className:"text-xs",children:t.version})})]}),(0,tt.jsxs)("div",{className:"flex items-center flex-row justify-between gap-2 flex-wrap px-3 py-2 border-muted-foreground/20 border-t-[1px]",children:[(0,tt.jsx)("p",{className:"text-sm text-muted-foreground",children:t.title}),t.labels?.map(d=>(0,tt.jsx)("div",{children:(0,tt.jsx)($o,{className:`grow-0 ${Up.get(d)||""}`,children:d})},d)),A&&(0,tt.jsx)($o,{className:`grow-0 ${Up.get(t.type)||""}`,children:t.type})]})]})}),u?(0,tt.jsx)("div",{className:"absolute top-3 left-3",children:(0,tt.jsxs)(HR,{children:[(0,tt.jsx)($R,{className:"w-8 flex-none",children:(0,tt.jsx)(Pr,{className:"text-muted-foreground",size:20})}),(0,tt.jsx)(fk,{className:"w-48 ml-48",onCloseAutoFocus:d=>d.preventDefault(),children:(0,tt.jsxs)(bk,{onClick:c,children:[(0,tt.jsx)(jl,{size:16}),"Remove dependency"]})})]})}):"",n?(0,tt.jsx)("div",{className:"absolute border-t border-solid border-muted-foreground w-4 -right-4 top-7"}):e?(0,tt.jsx)("div",{className:"absolute border-b border-l border-solid border-neutral-300 dark:border-neutral-600 rounded-bl-sm z-0 h-[5px] w-[9px] -left-[9px] h-[13.35rem] bottom-[62px] group-[&:nth-child(2)]:hidden group-[&:nth-child(3)]:h-24",ref:i}):""]})};var Zb=w(_(),1);var Ko=w(_(),1);var Yo=w(I(),1),hk="Tabs",[qte,M0e]=Pt(hk,[_u]),TR=_u(),[Ote,Bk]=qte(hk),UR=Ko.forwardRef((e,t)=>{let{__scopeTabs:n,value:A,onValueChange:a,defaultValue:o,orientation:r="horizontal",dir:i,activationMode:s="automatic",...c}=e,u=ii(i),[d,l]=Tt({prop:A,onChange:a,defaultProp:o});return(0,Yo.jsx)(Ote,{scope:n,baseId:Pe(),value:d,onValueChange:l,orientation:r,dir:u,activationMode:s,children:(0,Yo.jsx)(Z.div,{dir:u,"data-orientation":r,...c,ref:t})})});UR.displayName=hk;var ZR="TabsList",qR=Ko.forwardRef((e,t)=>{let{__scopeTabs:n,loop:A=!0,...a}=e,o=Bk(ZR,n),r=TR(n);return(0,Yo.jsx)(zb,{asChild:!0,...r,orientation:o.orientation,dir:o.dir,loop:A,children:(0,Yo.jsx)(Z.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});qR.displayName=ZR;var OR="TabsTrigger",YR=Ko.forwardRef((e,t)=>{let{__scopeTabs:n,value:A,disabled:a=!1,...o}=e,r=Bk(OR,n),i=TR(n),s=JR(r.baseId,A),c=VR(r.baseId,A),u=A===r.value;return(0,Yo.jsx)(Hb,{asChild:!0,...i,focusable:!a,active:u,children:(0,Yo.jsx)(Z.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:s,...o,ref:t,onMouseDown:z(e.onMouseDown,d=>{!a&&d.button===0&&d.ctrlKey===!1?r.onValueChange(A):d.preventDefault()}),onKeyDown:z(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&r.onValueChange(A)}),onFocus:z(e.onFocus,()=>{let d=r.activationMode!=="manual";!u&&!a&&d&&r.onValueChange(A)})})})});YR.displayName=OR;var KR="TabsContent",WR=Ko.forwardRef((e,t)=>{let{__scopeTabs:n,value:A,forceMount:a,children:o,...r}=e,i=Bk(KR,n),s=JR(i.baseId,A),c=VR(i.baseId,A),u=A===i.value,d=Ko.useRef(u);return Ko.useEffect(()=>{let l=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(l)},[]),(0,Yo.jsx)(jt,{present:a||u,children:({present:l})=>(0,Yo.jsx)(Z.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":s,hidden:!l,id:c,tabIndex:0,...r,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:l&&o})})});WR.displayName=KR;function JR(e,t){return`${e}-trigger-${t}`}function VR(e,t){return`${e}-content-${t}`}var XR=UR,Ck=qR,wk=YR,Ek=WR;var qb=w(I(),1),eM=XR,yk=Zb.forwardRef(({className:e,...t},n)=>(0,qb.jsx)(Ck,{ref:n,className:v("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));yk.displayName=Ck.displayName;var Qk=Zb.forwardRef(({className:e,...t},n)=>(0,qb.jsx)(wk,{ref:n,className:v("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Qk.displayName=wk.displayName;var kk=Zb.forwardRef(({className:e,...t},n)=>(0,qb.jsx)(Ek,{ref:n,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));kk.displayName=Ek.displayName;var _h=w(_(),1);var Kne=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>Promise.resolve().then(()=>(nM(),tM))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>Promise.resolve().then(()=>(aM(),AM))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>Promise.resolve().then(()=>(rM(),oM))},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:()=>Promise.resolve().then(()=>(sM(),iM))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>Promise.resolve().then(()=>(uM(),cM))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>Promise.resolve().then(()=>(lM(),dM))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>Promise.resolve().then(()=>(gM(),pM))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>Promise.resolve().then(()=>(fM(),mM))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>Promise.resolve().then(()=>(hM(),bM))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>Promise.resolve().then(()=>(CM(),BM))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>Promise.resolve().then(()=>(EM(),wM))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>Promise.resolve().then(()=>(QM(),yM))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>Promise.resolve().then(()=>(IM(),kM))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>Promise.resolve().then(()=>(xM(),_M))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>Promise.resolve().then(()=>(vM(),DM))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>Promise.resolve().then(()=>(SM(),FM))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>Promise.resolve().then(()=>(RM(),LM))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>Promise.resolve().then(()=>(NM(),MM))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>Promise.resolve().then(()=>(jM(),PM))},{id:"houston",displayName:"Houston",type:"dark",import:()=>Promise.resolve().then(()=>(zM(),GM))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>Promise.resolve().then(()=>($M(),HM))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>Promise.resolve().then(()=>(UM(),TM))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>Promise.resolve().then(()=>(qM(),ZM))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>Promise.resolve().then(()=>(YM(),OM))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>Promise.resolve().then(()=>(WM(),KM))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>Promise.resolve().then(()=>(VM(),JM))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>Promise.resolve().then(()=>(eN(),XM))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>Promise.resolve().then(()=>(nN(),tN))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>Promise.resolve().then(()=>(aN(),AN))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>Promise.resolve().then(()=>(rN(),oN))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>Promise.resolve().then(()=>(sN(),iN))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>Promise.resolve().then(()=>(uN(),cN))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>Promise.resolve().then(()=>(lN(),dN))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>Promise.resolve().then(()=>(gN(),pN))},{id:"nord",displayName:"Nord",type:"dark",import:()=>Promise.resolve().then(()=>(fN(),mN))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>Promise.resolve().then(()=>(hN(),bN))},{id:"one-light",displayName:"One Light",type:"light",import:()=>Promise.resolve().then(()=>(CN(),BN))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>Promise.resolve().then(()=>(EN(),wN))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>Promise.resolve().then(()=>(QN(),yN))},{id:"red",displayName:"Red",type:"dark",import:()=>Promise.resolve().then(()=>(IN(),kN))},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:()=>Promise.resolve().then(()=>(xN(),_N))},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:()=>Promise.resolve().then(()=>(vN(),DN))},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:()=>Promise.resolve().then(()=>(SN(),FN))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>Promise.resolve().then(()=>(RN(),LN))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>Promise.resolve().then(()=>(NN(),MN))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>Promise.resolve().then(()=>(jN(),PN))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>Promise.resolve().then(()=>(zN(),GN))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>Promise.resolve().then(()=>($N(),HN))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>Promise.resolve().then(()=>(UN(),TN))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>Promise.resolve().then(()=>(qN(),ZN))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>Promise.resolve().then(()=>(YN(),ON))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>Promise.resolve().then(()=>(WN(),KN))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>Promise.resolve().then(()=>(VN(),JN))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>Promise.resolve().then(()=>(e6(),XN))}],t6=Object.fromEntries(Kne.map(e=>[e.id,e.import]));var fa=class extends Error{constructor(t){super(t),this.name="ShikiError"}};var Vp=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Wne(){return 2147483648}function Jne(){return typeof performance<"u"?performance.now():Date.now()}var Vne=(e,t)=>e+(t-e%t)%t;async function Xne(e){let t,n,A={};function a(p){n=p,A.HEAPU8=new Uint8Array(p),A.HEAPU32=new Uint32Array(p)}function o(p,g,b){A.HEAPU8.copyWithin(p,g,g+b)}function r(p){try{return t.grow(p-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function i(p){let g=A.HEAPU8.length;p=p>>>0;let b=Wne();if(p>b)return!1;for(let B=1;B<=4;B*=2){let f=g*(1+.2/B);f=Math.min(f,p+100663296);let m=Math.min(b,Vne(Math.max(p,f),65536));if(r(m))return!0}return!1}let s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(p,g,b=1024){let B=g+b,f=g;for(;p[f]&&!(f>=B);)++f;if(f-g>16&&p.buffer&&s)return s.decode(p.subarray(g,f));let m="";for(;g<f;){let h=p[g++];if(!(h&128)){m+=String.fromCharCode(h);continue}let C=p[g++]&63;if((h&224)===192){m+=String.fromCharCode((h&31)<<6|C);continue}let E=p[g++]&63;if((h&240)===224?h=(h&15)<<12|C<<6|E:h=(h&7)<<18|C<<12|E<<6|p[g++]&63,h<65536)m+=String.fromCharCode(h);else{let Q=h-65536;m+=String.fromCharCode(55296|Q>>10,56320|Q&1023)}}return m}function u(p,g){return p?c(A.HEAPU8,p,g):""}let d={emscripten_get_now:Jne,emscripten_memcpy_big:o,emscripten_resize_heap:i,fd_write:()=>0};async function l(){let g=await e({env:d,wasi_snapshot_preview1:d});t=g.memory,a(t.buffer),Object.assign(A,g),A.UTF8ToString=u}return await l(),A}var Bn=null;function eAe(e){throw new Vp(e.UTF8ToString(e.getLastOnigError()))}var Yb=class e{static _utf8ByteLength(t){let n=0;for(let A=0,a=t.length;A<a;A++){let o=t.charCodeAt(A),r=o,i=!1;if(o>=55296&&o<=56319&&A+1<a){let s=t.charCodeAt(A+1);s>=56320&&s<=57343&&(r=(o-55296<<10)+65536|s-56320,i=!0)}r<=127?n+=1:r<=2047?n+=2:r<=65535?n+=3:n+=4,i&&A++}return n}utf16Length;utf8Length;utf16Value;utf8Value;utf16OffsetToUtf8;utf8OffsetToUtf16;constructor(t){let n=t.length,A=e._utf8ByteLength(t),a=A!==n,o=a?new Uint32Array(n+1):null;a&&(o[n]=A);let r=a?new Uint32Array(A+1):null;a&&(r[A]=n);let i=new Uint8Array(A),s=0;for(let c=0;c<n;c++){let u=t.charCodeAt(c),d=u,l=!1;if(u>=55296&&u<=56319&&c+1<n){let p=t.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+65536|p-56320,l=!0)}a&&(o[c]=s,l&&(o[c+1]=s),d<=127?r[s+0]=c:d<=2047?(r[s+0]=c,r[s+1]=c):d<=65535?(r[s+0]=c,r[s+1]=c,r[s+2]=c):(r[s+0]=c,r[s+1]=c,r[s+2]=c,r[s+3]=c)),d<=127?i[s++]=d:d<=2047?(i[s++]=192|(d&1984)>>>6,i[s++]=128|(d&63)>>>0):d<=65535?(i[s++]=224|(d&61440)>>>12,i[s++]=128|(d&4032)>>>6,i[s++]=128|(d&63)>>>0):(i[s++]=240|(d&1835008)>>>18,i[s++]=128|(d&258048)>>>12,i[s++]=128|(d&4032)>>>6,i[s++]=128|(d&63)>>>0),l&&c++}this.utf16Length=n,this.utf8Length=A,this.utf16Value=t,this.utf8Value=i,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=r}createString(t){let n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}},Kb=class e{static LAST_ID=0;static _sharedPtr=0;static _sharedPtrInUse=!1;id=++e.LAST_ID;_onigBinding;content;utf16Length;utf8Length;utf16OffsetToUtf8;utf8OffsetToUtf16;ptr;constructor(t){if(!Bn)throw new Vp("Must invoke loadWasm first.");this._onigBinding=Bn,this.content=t;let n=new Yb(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=Bn.omalloc(1e4)),e._sharedPtrInUse=!0,Bn.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._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===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}},_k=class{_onigBinding;_ptr;constructor(t){if(!Bn)throw new Vp("Must invoke loadWasm first.");let n=[],A=[];for(let i=0,s=t.length;i<s;i++){let c=new Yb(t[i]);n[i]=c.createString(Bn),A[i]=c.utf8Length}let a=Bn.omalloc(4*t.length);Bn.HEAPU32.set(n,a/4);let o=Bn.omalloc(4*t.length);Bn.HEAPU32.set(A,o/4);let r=Bn.createOnigScanner(a,o,t.length);for(let i=0,s=t.length;i<s;i++)Bn.ofree(n[i]);Bn.ofree(o),Bn.ofree(a),r===0&&eAe(Bn),this._onigBinding=Bn,this._ptr=r}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,A){let a=0;if(typeof A=="number"&&(a=A),typeof t=="string"){t=new Kb(t);let o=this._findNextMatchSync(t,n,!1,a);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,A,a){let o=this._onigBinding,r=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(r===0)return null;let i=o.HEAPU32,s=r/4,c=i[s++],u=i[s++],d=[];for(let l=0;l<u;l++){let p=t.convertUtf8OffsetToUtf16(i[s++]),g=t.convertUtf8OffsetToUtf16(i[s++]);d[l]={start:p,end:g,length:g-p}}return{index:c,captureIndices:d}}};function tAe(e){return typeof e.instantiator=="function"}function nAe(e){return typeof e.default=="function"}function AAe(e){return typeof e.data<"u"}function aAe(e){return typeof Response<"u"&&e instanceof Response}function oAe(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}var Ob;function n6(e){if(Ob)return Ob;async function t(){Bn=await Xne(async n=>{let A=e;return A=await A,typeof A=="function"&&(A=await A(n)),typeof A=="function"&&(A=await A(n)),tAe(A)?A=await A.instantiator(n):nAe(A)?A=await A.default(n):(AAe(A)&&(A=A.data),aAe(A)?typeof WebAssembly.instantiateStreaming=="function"?A=await rAe(A)(n):A=await iAe(A)(n):oAe(A)?A=await Ik(A)(n):A instanceof WebAssembly.Module?A=await Ik(A)(n):"default"in A&&A.default instanceof WebAssembly.Module&&(A=await Ik(A.default)(n))),"instance"in A&&(A=A.instance),"exports"in A&&(A=A.exports),A})}return Ob=t(),Ob}function Ik(e){return t=>WebAssembly.instantiate(e,t)}function rAe(e){return t=>WebAssembly.instantiateStreaming(e,t)}function iAe(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var sAe;function A6(){return sAe}async function Xp(e){return e&&await n6(e),{createScanner(t){return new _k(t)},createString(t){return new Kb(t)}}}var cAe=!1;function Du(e){cAe&&console.trace(`[SHIKI DEPRECATE]: ${e}`)}function uAe(e){return jk(e)}function jk(e){return Array.isArray(e)?dAe(e):typeof e=="object"?lAe(e):e}function dAe(e){let t=[];for(let n=0,A=e.length;n<A;n++)t[n]=jk(e[n]);return t}function lAe(e){let t={};for(let n in e)t[n]=jk(e[n]);return t}function l6(e,...t){return t.forEach(n=>{for(let A in n)e[A]=n[A]}),e}function p6(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?p6(e.substring(0,e.length-1)):e.substr(~t+1)}var xk=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Wb=class{static hasCaptures(e){return e===null?!1:(xk.lastIndex=0,xk.test(e))}static replaceCaptures(e,t,n){return e.replace(xk,(A,a,o,r)=>{let i=n[parseInt(a||o,10)];if(i){let s=t.substring(i.start,i.end);for(;s[0]===".";)s=s.substring(1);switch(r){case"downcase":return s.toLowerCase();case"upcase":return s.toUpperCase();default:return s}}else return A})}};function g6(e,t){return e<t?-1:e>t?1:0}function m6(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,A=t.length;if(n===A){for(let a=0;a<n;a++){let o=g6(e[a],t[a]);if(o!==0)return o}return 0}return n-A}function a6(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 f6(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var b6=class{constructor(e){this.fn=e,this.cache=new Map}get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},ng=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n,this._cachedMatchRoot=new b6(A=>this._root.match(A))}static createFromRawTheme(e,t){return this.createFromParsedTheme(mAe(e),t)}static createFromParsedTheme(e,t){return bAe(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,A=this._cachedMatchRoot.get(t).find(a=>pAe(e.parent,a.parentScopes));return A?new h6(A.fontStyle,A.foreground,A.background):null}},Dk=class Jb{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let A of n)t=new Jb(t,A);return t}static from(...t){let n=null;for(let A=0;A<t.length;A++)n=new Jb(n,t[A]);return n}push(t){return new Jb(this,t)}getSegments(){let t=this,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){let n=[],A=this;for(;A&&A!==t;)n.push(A.scopeName),A=A.parent;return A===t?n.reverse():void 0}};function pAe(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let A=t[n],a=!1;if(A===">"){if(n===t.length-1)return!1;A=t[++n],a=!0}for(;e&&!gAe(e.scopeName,A);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function gAe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var h6=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function mAe(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],A=0;for(let a=0,o=t.length;a<o;a++){let r=t[a];if(!r.settings)continue;let i;if(typeof r.scope=="string"){let d=r.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),i=d.split(",")}else Array.isArray(r.scope)?i=r.scope:i=[""];let s=-1;if(typeof r.settings.fontStyle=="string"){s=0;let d=r.settings.fontStyle.split(" ");for(let l=0,p=d.length;l<p;l++)switch(d[l]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let c=null;typeof r.settings.foreground=="string"&&a6(r.settings.foreground)&&(c=r.settings.foreground);let u=null;typeof r.settings.background=="string"&&a6(r.settings.background)&&(u=r.settings.background);for(let d=0,l=i.length;d<l;d++){let g=i[d].trim().split(" "),b=g[g.length-1],B=null;g.length>1&&(B=g.slice(0,g.length-1),B.reverse()),n[A++]=new fAe(b,B,a,s,c,u)}}return n}var fAe=class{constructor(e,t,n,A,a,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=A,this.foreground=a,this.background=o}},za=(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))(za||{});function bAe(e,t){e.sort((s,c)=>{let u=g6(s.scope,c.scope);return u!==0||(u=m6(s.parentScopes,c.parentScopes),u!==0)?u:s.index-c.index});let n=0,A="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let s=e.shift();s.fontStyle!==-1&&(n=s.fontStyle),s.foreground!==null&&(A=s.foreground),s.background!==null&&(a=s.background)}let o=new hAe(t),r=new h6(n,o.getId(A),o.getId(a)),i=new CAe(new vk(0,null,-1,0,0),[]);for(let s=0,c=e.length;s<c;s++){let u=e[s];i.insert(0,u.scope,u.parentScopes,u.fontStyle,o.getId(u.foreground),o.getId(u.background))}return new ng(o,r,i)}var hAe=class{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)}},BAe=Object.freeze([]),vk=class B6{constructor(t,n,A,a,o){this.scopeDepth=t,this.parentScopes=n||BAe,this.fontStyle=A,this.foreground=a,this.background=o}clone(){return new B6(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let A=0,a=t.length;A<a;A++)n[A]=t[A].clone();return n}acceptOverwrite(t,n,A,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),A!==0&&(this.foreground=A),a!==0&&(this.background=a)}},CAe=class Fk{constructor(t,n=[],A={}){this._mainRule=t,this._children=A,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let A=0,a=0;for(;t.parentScopes[A]===">"&&A++,n.parentScopes[a]===">"&&a++,!(A>=t.parentScopes.length||a>=n.parentScopes.length);){let o=n.parentScopes[a].length-t.parentScopes[A].length;if(o!==0)return o;A++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let A=t.indexOf("."),a,o;if(A===-1?(a=t,o=""):(a=t.substring(0,A),o=t.substring(A+1)),this._children.hasOwnProperty(a))return this._children[a].match(o)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Fk._cmpBySpecificity),n}insert(t,n,A,a,o,r){if(n===""){this._doInsertHere(t,A,a,o,r);return}let i=n.indexOf("."),s,c;i===-1?(s=n,c=""):(s=n.substring(0,i),c=n.substring(i+1));let u;this._children.hasOwnProperty(s)?u=this._children[s]:(u=new Fk(this._mainRule.clone(),vk.cloneArr(this._rulesWithParentScopes)),this._children[s]=u),u.insert(t+1,c,A,a,o,r)}_doInsertHere(t,n,A,a,o){if(n===null){this._mainRule.acceptOverwrite(t,A,a,o);return}for(let r=0,i=this._rulesWithParentScopes.length;r<i;r++){let s=this._rulesWithParentScopes[r];if(m6(s.parentScopes,n)===0){s.acceptOverwrite(t,A,a,o);return}}A===-1&&(A=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new vk(t,n,A,a,o))}},ui=class ba{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=ba.getLanguageId(t),A=ba.getTokenType(t),a=ba.getFontStyle(t),o=ba.getForeground(t),r=ba.getBackground(t);console.log({languageId:n,tokenType:A,fontStyle:a,foreground:o,background:r})}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,A,a,o,r,i){let s=ba.getLanguageId(t),c=ba.getTokenType(t),u=ba.containsBalancedBrackets(t)?1:0,d=ba.getFontStyle(t),l=ba.getForeground(t),p=ba.getBackground(t);return n!==0&&(s=n),A!==8&&(c=A),a!==null&&(u=a?1:0),o!==-1&&(d=o),r!==0&&(l=r),i!==0&&(p=i),(s<<0|c<<8|u<<10|d<<11|l<<15|p<<24)>>>0}};function Xb(e,t){let n=[],A=wAe(e),a=A.next();for(;a!==null;){let s=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":s=1;break;case"L":s=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=A.next()}let c=r();if(n.push({matcher:c,priority:s}),a!==",")break;a=A.next()}return n;function o(){if(a==="-"){a=A.next();let s=o();return c=>!!s&&!s(c)}if(a==="("){a=A.next();let s=i();return a===")"&&(a=A.next()),s}if(o6(a)){let s=[];do s.push(a),a=A.next();while(o6(a));return c=>t(s,c)}return null}function r(){let s=[],c=o();for(;c;)s.push(c),c=o();return u=>s.every(d=>d(u))}function i(){let s=[],c=r();for(;c&&(s.push(c),a==="|"||a===",");){do a=A.next();while(a==="|"||a===",");c=r()}return u=>s.some(d=>d(u))}}function o6(e){return!!e&&!!e.match(/[\w\.:]+/)}function wAe(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let A=n[0];return n=t.exec(e),A}}}function C6(e){typeof e.dispose=="function"&&e.dispose()}var Ag=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},EAe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},yAe=class{constructor(){this._references=[],this._seenReferenceKeys=new Set,this.visitedRule=new Set}get references(){return this._references}add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},QAe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ag(this.initialScopeName)]}processQueue(){let e=this.Q;this.Q=[];let t=new yAe;for(let n of e)kAe(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof Ag){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 kAe(e,t,n,A){let a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let o=n.lookup(t);e instanceof Ag?Vb({baseGrammar:o,selfGrammar:a},A):Sk(e.ruleName,{baseGrammar:o,selfGrammar:a,repository:a.repository},A);let r=n.injections(e.scopeName);if(r)for(let i of r)A.add(new Ag(i))}function Sk(e,t,n){if(t.repository&&t.repository[e]){let A=t.repository[e];eh([A],t,n)}}function Vb(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&eh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&eh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function eh(e,t,n){for(let A of e){if(n.visitedRule.has(A))continue;n.visitedRule.add(A);let a=A.repository?l6({},t.repository,A.repository):t.repository;Array.isArray(A.patterns)&&eh(A.patterns,{...t,repository:a},n);let o=A.include;if(!o)continue;let r=w6(o);switch(r.kind){case 0:Vb({...t,selfGrammar:t.baseGrammar},n);break;case 1:Vb(t,n);break;case 2:Sk(r.ruleName,{...t,repository:a},n);break;case 3:case 4:let i=r.scopeName===t.selfGrammar.scopeName?t.selfGrammar:r.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){let s={baseGrammar:t.baseGrammar,selfGrammar:i,repository:a};r.kind===4?Sk(r.ruleName,s,n):Vb(s,n)}else r.kind===4?n.add(new EAe(r.scopeName,r.ruleName)):n.add(new Ag(r.scopeName));break}}}var IAe=class{constructor(){this.kind=0}},_Ae=class{constructor(){this.kind=1}},xAe=class{constructor(e){this.ruleName=e,this.kind=2}},DAe=class{constructor(e){this.scopeName=e,this.kind=3}},vAe=class{constructor(e,t){this.scopeName=e,this.ruleName=t,this.kind=4}};function w6(e){if(e==="$base")return new IAe;if(e==="$self")return new _Ae;let t=e.indexOf("#");if(t===-1)return new DAe(e);if(t===0)return new xAe(e.substring(1));{let n=e.substring(0,t),A=e.substring(t+1);return new vAe(n,A)}}var FAe=/\\(\d+)/,r6=/\\(\d+)/g,$0e=Symbol("RuleId"),SAe=-1,E6=-2;var rg=class{constructor(e,t,n,A){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Wb.hasCaptures(this._name),this._contentName=A||null,this._contentNameIsCapturing=Wb.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${p6(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:Wb.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Wb.replaceCaptures(this._contentName,e,t)}},LAe=class extends rg{constructor(e,t,n,A,a){super(e,t,n,A),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,A){throw new Error("Not supported!")}},RAe=class extends rg{constructor(e,t,n,A,a){super(e,t,n,null),this._match=new ag(A,this.id),this.captures=a,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,A){return this._getCachedCompiledPatterns(e).compileAG(e,n,A)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new og,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},i6=class extends rg{constructor(e,t,n,A,a){super(e,t,n,A),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,A){return this._getCachedCompiledPatterns(e).compileAG(e,n,A)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new og,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Lk=class extends rg{constructor(e,t,n,A,a,o,r,i,s,c){super(e,t,n,A),this._begin=new ag(a,this.id),this.beginCaptures=o,this._end=new ag(r||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=s||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.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,A){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,A)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new og;for(let 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}},th=class extends rg{constructor(e,t,n,A,a,o,r,i,s){super(e,t,n,A),this._begin=new ag(a,this.id),this.beginCaptures=o,this.whileCaptures=i,this._while=new ag(r,E6),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=s.patterns,this.hasMissingPatterns=s.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,A){return this._getCachedCompiledPatterns(e).compileAG(e,n,A)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new og;for(let 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,A){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,A)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new og,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},y6=class $n{static createCaptureRule(t,n,A,a,o){return t.registerRule(r=>new LAe(n,r,A,a,o))}static getCompiledRuleId(t,n,A){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new RAe(t.$vscodeTextmateLocation,t.id,t.name,t.match,$n._compileCaptures(t.captures,n,A));if(typeof t.begin>"u"){t.repository&&(A=l6({},A,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new i6(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,$n._compilePatterns(o,n,A))}return t.while?new th(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$n._compileCaptures(t.beginCaptures||t.captures,n,A),t.while,$n._compileCaptures(t.whileCaptures||t.captures,n,A),$n._compilePatterns(t.patterns,n,A)):new Lk(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$n._compileCaptures(t.beginCaptures||t.captures,n,A),t.end,$n._compileCaptures(t.endCaptures||t.captures,n,A),t.applyEndPatternLast,$n._compilePatterns(t.patterns,n,A))}),t.id}static _compileCaptures(t,n,A){let a=[];if(t){let o=0;for(let r in t){if(r==="$vscodeTextmateLocation")continue;let i=parseInt(r,10);i>o&&(o=i)}for(let r=0;r<=o;r++)a[r]=null;for(let r in t){if(r==="$vscodeTextmateLocation")continue;let i=parseInt(r,10),s=0;t[r].patterns&&(s=$n.getCompiledRuleId(t[r],n,A)),a[i]=$n.createCaptureRule(n,t[r].$vscodeTextmateLocation,t[r].name,t[r].contentName,s)}}return a}static _compilePatterns(t,n,A){let a=[];if(t)for(let o=0,r=t.length;o<r;o++){let i=t[o],s=-1;if(i.include){let c=w6(i.include);switch(c.kind){case 0:case 1:s=$n.getCompiledRuleId(A[i.include],n,A);break;case 2:let u=A[c.ruleName];u&&(s=$n.getCompiledRuleId(u,n,A));break;case 3:case 4:let d=c.scopeName,l=c.kind===4?c.ruleName:null,p=n.getExternalGrammar(d,A);if(p)if(l){let g=p.repository[l];g&&(s=$n.getCompiledRuleId(g,n,p.repository))}else s=$n.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else s=$n.getCompiledRuleId(i,n,A);if(s!==-1){let c=n.getRule(s),u=!1;if((c instanceof i6||c instanceof Lk||c instanceof th)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;a.push(s)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},ag=class Q6{constructor(t,n){if(t){let A=t.length,a=0,o=[],r=!1;for(let i=0;i<A;i++)if(t.charAt(i)==="\\"&&i+1<A){let c=t.charAt(i+1);c==="z"?(o.push(t.substring(a,i)),o.push("$(?!\\n)(?<!\\n)"),a=i+2):(c==="A"||c==="G")&&(r=!0),i++}this.hasAnchor=r,a===0?this.source=t:(o.push(t.substring(a,A)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,this.hasBackReferences=FAe.test(this.source)}clone(){return new Q6(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){let A=n.map(a=>t.substring(a.start,a.end));return r6.lastIndex=0,this.source.replace(r6,(a,o)=>f6(A[parseInt(o,10)]||""))}_buildAnchorCache(){let t=[],n=[],A=[],a=[],o,r,i,s;for(o=0,r=this.source.length;o<r;o++)i=this.source.charAt(o),t[o]=i,n[o]=i,A[o]=i,a[o]=i,i==="\\"&&o+1<r&&(s=this.source.charAt(o+1),s==="A"?(t[o+1]="\uFFFF",n[o+1]="\uFFFF",A[o+1]="A",a[o+1]="A"):s==="G"?(t[o+1]="\uFFFF",n[o+1]="G",A[o+1]="\uFFFF",a[o+1]="G"):(t[o+1]=s,n[o+1]=s,A[o+1]=s,a[o+1]=s),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:A.join(""),A1_G1:a.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},og=class{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 s6(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 A=this._items.map(a=>a.resolveAnchors(t,n));return new s6(e,A,this._items.map(a=>a.ruleId))}},s6=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
54
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return st.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},gO="DialogDescriptionWarning",mO=({contentRef:e,descriptionId:t})=>{let A=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${E9(gO).contentName}}.`;return st.useEffect(()=>{let a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(A))},[A,e,t]),null},Xc=s9,vy=u9,eu=l9,qr=p9,Or=g9,tu=f9,nu=h9,Yl=C9;var RA=w(I(),1),y9=Xc;var fO=eu,Q9=Kl.forwardRef(({className:e,...t},n)=>(0,RA.jsx)(qr,{className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Q9.displayName=qr.displayName;var bO=VA("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Sy=Kl.forwardRef(({side:e="right",className:t,children:n,...A},a)=>(0,RA.jsxs)(fO,{children:[(0,RA.jsx)(Q9,{}),(0,RA.jsxs)(Or,{ref:a,className:v(bO({side:e}),t),...A,children:[n,(0,RA.jsxs)(Yl,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,RA.jsx)(vo,{className:"h-4 w-4"}),(0,RA.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Sy.displayName=Or.displayName;var hO=({className:e,...t})=>(0,RA.jsx)("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",e),...t});hO.displayName="SheetHeader";var BO=({className:e,...t})=>(0,RA.jsx)("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});BO.displayName="SheetFooter";var CO=Kl.forwardRef(({className:e,...t},n)=>(0,RA.jsx)(tu,{ref:n,className:v("text-lg font-semibold text-foreground",e),...t}));CO.displayName=tu.displayName;var wO=Kl.forwardRef(({className:e,...t},n)=>(0,RA.jsx)(nu,{ref:n,className:v("text-sm text-muted-foreground",e),...t}));wO.displayName=nu.displayName;var k9=w(I(),1);function Ly({className:e,...t}){return(0,k9.jsx)("div",{className:v("animate-pulse rounded-md bg-muted",e),...t})}var T2=w(_(),1);var Ce=w(_(),1);var MA=w(_(),1);var I9=["top","right","bottom","left"];var Xa=Math.min,Vn=Math.max,Jl=Math.round,Vl=Math.floor,Ro=e=>({x:e,y:e}),EO={left:"right",right:"left",bottom:"top",top:"bottom"},yO={start:"end",end:"start"};function Rf(e,t,n){return Vn(e,Xa(t,n))}function eo(e,t){return typeof e=="function"?e(t):e}function to(e){return e.split("-")[0]}function cs(e){return e.split("-")[1]}function Mf(e){return e==="x"?"y":"x"}function Nf(e){return e==="y"?"height":"width"}function Mo(e){return["top","bottom"].includes(to(e))?"y":"x"}function Pf(e){return Mf(Mo(e))}function _9(e,t,n){n===void 0&&(n=!1);let A=cs(e),a=Pf(e),o=Nf(a),r=a==="x"?A===(n?"end":"start")?"right":"left":A==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Wl(r)),[r,Wl(r)]}function x9(e){let t=Wl(e);return[Lf(e),t,Lf(t)]}function Lf(e){return e.replace(/start|end/g,t=>yO[t])}function QO(e,t,n){let A=["left","right"],a=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:A:t?A:a;case"left":case"right":return t?o:r;default:return[]}}function D9(e,t,n,A){let a=cs(e),o=QO(to(e),n==="start",A);return a&&(o=o.map(r=>r+"-"+a),t&&(o=o.concat(o.map(Lf)))),o}function Wl(e){return e.replace(/left|right|bottom|top/g,t=>EO[t])}function kO(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ry(e){return typeof e!="number"?kO(e):{top:e,right:e,bottom:e,left:e}}function us(e){let{x:t,y:n,width:A,height:a}=e;return{width:A,height:a,top:n,left:t,right:t+A,bottom:n+a,x:t,y:n}}function v9(e,t,n){let{reference:A,floating:a}=e,o=Mo(t),r=Pf(t),i=Nf(r),s=to(t),c=o==="y",u=A.x+A.width/2-a.width/2,d=A.y+A.height/2-a.height/2,l=A[i]/2-a[i]/2,p;switch(s){case"top":p={x:u,y:A.y-a.height};break;case"bottom":p={x:u,y:A.y+A.height};break;case"right":p={x:A.x+A.width,y:d};break;case"left":p={x:A.x-a.width,y:d};break;default:p={x:A.x,y:A.y}}switch(cs(t)){case"start":p[r]-=l*(n&&c?-1:1);break;case"end":p[r]+=l*(n&&c?-1:1);break}return p}var L9=async(e,t,n)=>{let{placement:A="bottom",strategy:a="absolute",middleware:o=[],platform:r}=n,i=o.filter(Boolean),s=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=v9(c,A,s),l=A,p={},g=0;for(let b=0;b<i.length;b++){let{name:B,fn:f}=i[b],{x:m,y:h,data:C,reset:E}=await f({x:u,y:d,initialPlacement:A,placement:l,strategy:a,middlewareData:p,rects:c,platform:r,elements:{reference:e,floating:t}});u=m??u,d=h??d,p={...p,[B]:{...p[B],...C}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(l=E.placement),E.rects&&(c=E.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:u,y:d}=v9(c,l,s)),b=-1)}return{x:u,y:d,placement:l,strategy:a,middlewareData:p}};async function Au(e,t){var n;t===void 0&&(t={});let{x:A,y:a,platform:o,rects:r,elements:i,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:l=!1,padding:p=0}=eo(t,e),g=Ry(p),B=i[l?d==="floating"?"reference":"floating":d],f=us(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(B)))==null||n?B:B.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(i.floating)),boundary:c,rootBoundary:u,strategy:s})),m=d==="floating"?{x:A,y:a,width:r.floating.width,height:r.floating.height}:r.reference,h=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),C=await(o.isElement==null?void 0:o.isElement(h))?await(o.getScale==null?void 0:o.getScale(h))||{x:1,y:1}:{x:1,y:1},E=us(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:m,offsetParent:h,strategy:s}):m);return{top:(f.top-E.top+g.top)/C.y,bottom:(E.bottom-f.bottom+g.bottom)/C.y,left:(f.left-E.left+g.left)/C.x,right:(E.right-f.right+g.right)/C.x}}var R9=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:A,placement:a,rects:o,platform:r,elements:i,middlewareData:s}=t,{element:c,padding:u=0}=eo(e,t)||{};if(c==null)return{};let d=Ry(u),l={x:n,y:A},p=Pf(a),g=Nf(p),b=await r.getDimensions(c),B=p==="y",f=B?"top":"left",m=B?"bottom":"right",h=B?"clientHeight":"clientWidth",C=o.reference[g]+o.reference[p]-l[p]-o.floating[g],E=l[p]-o.reference[p],Q=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c)),y=Q?Q[h]:0;(!y||!await(r.isElement==null?void 0:r.isElement(Q)))&&(y=i.floating[h]||o.floating[g]);let k=C/2-E/2,R=y/2-b[g]/2-1,F=Xa(d[f],R),U=Xa(d[m],R),M=F,ce=y-b[g]-U,N=y/2-b[g]/2+k,te=Rf(M,N,ce),W=!s.arrow&&cs(a)!=null&&N!==te&&o.reference[g]/2-(N<M?F:U)-b[g]/2<0,ne=W?N<M?N-M:N-ce:0;return{[p]:l[p]+ne,data:{[p]:te,centerOffset:N-te-ne,...W&&{alignmentOffset:ne}},reset:W}}});var M9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,A;let{placement:a,middlewareData:o,rects:r,initialPlacement:i,platform:s,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:l,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...B}=eo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let f=to(a),m=Mo(i),h=to(i)===i,C=await(s.isRTL==null?void 0:s.isRTL(c.floating)),E=l||(h||!b?[Wl(i)]:x9(i)),Q=g!=="none";!l&&Q&&E.push(...D9(i,b,g,C));let y=[i,...E],k=await Au(t,B),R=[],F=((A=o.flip)==null?void 0:A.overflows)||[];if(u&&R.push(k[f]),d){let N=_9(a,r,C);R.push(k[N[0]],k[N[1]])}if(F=[...F,{placement:a,overflows:R}],!R.every(N=>N<=0)){var U,M;let N=(((U=o.flip)==null?void 0:U.index)||0)+1,te=y[N];if(te)return{data:{index:N,overflows:F},reset:{placement:te}};let W=(M=F.filter(ne=>ne.overflows[0]<=0).sort((ne,K)=>ne.overflows[1]-K.overflows[1])[0])==null?void 0:M.placement;if(!W)switch(p){case"bestFit":{var ce;let ne=(ce=F.filter(K=>{if(Q){let H=Mo(K.placement);return H===m||H==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(H=>H>0).reduce((H,ve)=>H+ve,0)]).sort((K,H)=>K[1]-H[1])[0])==null?void 0:ce[0];ne&&(W=ne);break}case"initialPlacement":W=i;break}if(a!==W)return{reset:{placement:W}}}return{}}}};function F9(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function S9(e){return I9.some(t=>e[t]>=0)}var N9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n}=t,{strategy:A="referenceHidden",...a}=eo(e,t);switch(A){case"referenceHidden":{let o=await Au(t,{...a,elementContext:"reference"}),r=F9(o,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:S9(r)}}}case"escaped":{let o=await Au(t,{...a,altBoundary:!0}),r=F9(o,n.floating);return{data:{escapedOffsets:r,escaped:S9(r)}}}default:return{}}}}};async function IO(e,t){let{placement:n,platform:A,elements:a}=e,o=await(A.isRTL==null?void 0:A.isRTL(a.floating)),r=to(n),i=cs(n),s=Mo(n)==="y",c=["left","top"].includes(r)?-1:1,u=o&&s?-1:1,d=eo(t,e),{mainAxis:l,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof g=="number"&&(p=i==="end"?g*-1:g),s?{x:p*u,y:l*c}:{x:l*c,y:p*u}}var P9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,A;let{x:a,y:o,placement:r,middlewareData:i}=t,s=await IO(t,e);return r===((n=i.offset)==null?void 0:n.placement)&&(A=i.arrow)!=null&&A.alignmentOffset?{}:{x:a+s.x,y:o+s.y,data:{...s,placement:r}}}}},j9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:A,placement:a}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:i={fn:B=>{let{x:f,y:m}=B;return{x:f,y:m}}},...s}=eo(e,t),c={x:n,y:A},u=await Au(t,s),d=Mo(to(a)),l=Mf(d),p=c[l],g=c[d];if(o){let B=l==="y"?"top":"left",f=l==="y"?"bottom":"right",m=p+u[B],h=p-u[f];p=Rf(m,p,h)}if(r){let B=d==="y"?"top":"left",f=d==="y"?"bottom":"right",m=g+u[B],h=g-u[f];g=Rf(m,g,h)}let b=i.fn({...t,[l]:p,[d]:g});return{...b,data:{x:b.x-n,y:b.y-A,enabled:{[l]:o,[d]:r}}}}}},G9=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:A,placement:a,rects:o,middlewareData:r}=t,{offset:i=0,mainAxis:s=!0,crossAxis:c=!0}=eo(e,t),u={x:n,y:A},d=Mo(a),l=Mf(d),p=u[l],g=u[d],b=eo(i,t),B=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(s){let h=l==="y"?"height":"width",C=o.reference[l]-o.floating[h]+B.mainAxis,E=o.reference[l]+o.reference[h]-B.mainAxis;p<C?p=C:p>E&&(p=E)}if(c){var f,m;let h=l==="y"?"width":"height",C=["top","left"].includes(to(a)),E=o.reference[d]-o.floating[h]+(C&&((f=r.offset)==null?void 0:f[d])||0)+(C?0:B.crossAxis),Q=o.reference[d]+o.reference[h]+(C?0:((m=r.offset)==null?void 0:m[d])||0)-(C?B.crossAxis:0);g<E?g=E:g>Q&&(g=Q)}return{[l]:p,[d]:g}}}},z9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,A;let{placement:a,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...c}=eo(e,t),u=await Au(t,c),d=to(a),l=cs(a),p=Mo(a)==="y",{width:g,height:b}=o.floating,B,f;d==="top"||d==="bottom"?(B=d,f=l===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(f=d,B=l==="end"?"top":"bottom");let m=b-u.top-u.bottom,h=g-u.left-u.right,C=Xa(b-u[B],m),E=Xa(g-u[f],h),Q=!t.middlewareData.shift,y=C,k=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=h),(A=t.middlewareData.shift)!=null&&A.enabled.y&&(y=m),Q&&!l){let F=Vn(u.left,0),U=Vn(u.right,0),M=Vn(u.top,0),ce=Vn(u.bottom,0);p?k=g-2*(F!==0||U!==0?F+U:Vn(u.left,u.right)):y=b-2*(M!==0||ce!==0?M+ce:Vn(u.top,u.bottom))}await s({...t,availableWidth:k,availableHeight:y});let R=await r.getDimensions(i.floating);return g!==R.width||b!==R.height?{reset:{rects:!0}}:{}}}};function jf(){return typeof window<"u"}function ls(e){return $9(e)?(e.nodeName||"").toLowerCase():"#document"}function mA(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sa(e){var t;return(t=($9(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $9(e){return jf()?e instanceof Node||e instanceof mA(e).Node:!1}function na(e){return jf()?e instanceof Element||e instanceof mA(e).Element:!1}function La(e){return jf()?e instanceof HTMLElement||e instanceof mA(e).HTMLElement:!1}function H9(e){return!jf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mA(e).ShadowRoot}function au(e){let{overflow:t,overflowX:n,overflowY:A,display:a}=Aa(e);return/auto|scroll|overlay|hidden|clip/.test(t+A+n)&&!["inline","contents"].includes(a)}function T9(e){return["table","td","th"].includes(ls(e))}function Xl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Gf(e){let t=zf(),n=na(e)?Aa(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(A=>(n.willChange||"").includes(A))||["paint","layout","strict","content"].some(A=>(n.contain||"").includes(A))}function U9(e){let t=No(e);for(;La(t)&&!ps(t);){if(Gf(t))return t;if(Xl(t))return null;t=No(t)}return null}function zf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ps(e){return["html","body","#document"].includes(ls(e))}function Aa(e){return mA(e).getComputedStyle(e)}function ep(e){return na(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function No(e){if(ls(e)==="html")return e;let t=e.assignedSlot||e.parentNode||H9(e)&&e.host||Sa(e);return H9(t)?t.host:t}function Z9(e){let t=No(e);return ps(t)?e.ownerDocument?e.ownerDocument.body:e.body:La(t)&&au(t)?t:Z9(t)}function ds(e,t,n){var A;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=Z9(e),o=a===((A=e.ownerDocument)==null?void 0:A.body),r=mA(a);if(o){let i=Hf(r);return t.concat(r,r.visualViewport||[],au(a)?a:[],i&&n?ds(i):[])}return t.concat(a,ds(a,[],n))}function Hf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Y9(e){let t=Aa(e),n=parseFloat(t.width)||0,A=parseFloat(t.height)||0,a=La(e),o=a?e.offsetWidth:n,r=a?e.offsetHeight:A,i=Jl(n)!==o||Jl(A)!==r;return i&&(n=o,A=r),{width:n,height:A,$:i}}function Py(e){return na(e)?e:e.contextElement}function ou(e){let t=Py(e);if(!La(t))return Ro(1);let n=t.getBoundingClientRect(),{width:A,height:a,$:o}=Y9(t),r=(o?Jl(n.width):n.width)/A,i=(o?Jl(n.height):n.height)/a;return(!r||!Number.isFinite(r))&&(r=1),(!i||!Number.isFinite(i))&&(i=1),{x:r,y:i}}var _O=Ro(0);function K9(e){let t=mA(e);return!zf()||!t.visualViewport?_O:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==mA(e)?!1:t}function gs(e,t,n,A){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),o=Py(e),r=Ro(1);t&&(A?na(A)&&(r=ou(A)):r=ou(e));let i=xO(o,n,A)?K9(o):Ro(0),s=(a.left+i.x)/r.x,c=(a.top+i.y)/r.y,u=a.width/r.x,d=a.height/r.y;if(o){let l=mA(o),p=A&&na(A)?mA(A):A,g=l,b=Hf(g);for(;b&&A&&p!==g;){let B=ou(b),f=b.getBoundingClientRect(),m=Aa(b),h=f.left+(b.clientLeft+parseFloat(m.paddingLeft))*B.x,C=f.top+(b.clientTop+parseFloat(m.paddingTop))*B.y;s*=B.x,c*=B.y,u*=B.x,d*=B.y,s+=h,c+=C,g=mA(b),b=Hf(g)}}return us({width:u,height:d,x:s,y:c})}function DO(e){let{elements:t,rect:n,offsetParent:A,strategy:a}=e,o=a==="fixed",r=Sa(A),i=t?Xl(t.floating):!1;if(A===r||i&&o)return n;let s={scrollLeft:0,scrollTop:0},c=Ro(1),u=Ro(0),d=La(A);if((d||!d&&!o)&&((ls(A)!=="body"||au(r))&&(s=ep(A)),La(A))){let l=gs(A);c=ou(A),u.x=l.x+A.clientLeft,u.y=l.y+A.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x,y:n.y*c.y-s.scrollTop*c.y+u.y}}function vO(e){return Array.from(e.getClientRects())}function Ny(e,t){let n=ep(e).scrollLeft;return t?t.left+n:gs(Sa(e)).left+n}function FO(e){let t=Sa(e),n=ep(e),A=e.ownerDocument.body,a=Vn(t.scrollWidth,t.clientWidth,A.scrollWidth,A.clientWidth),o=Vn(t.scrollHeight,t.clientHeight,A.scrollHeight,A.clientHeight),r=-n.scrollLeft+Ny(e),i=-n.scrollTop;return Aa(A).direction==="rtl"&&(r+=Vn(t.clientWidth,A.clientWidth)-a),{width:a,height:o,x:r,y:i}}function SO(e,t){let n=mA(e),A=Sa(e),a=n.visualViewport,o=A.clientWidth,r=A.clientHeight,i=0,s=0;if(a){o=a.width,r=a.height;let c=zf();(!c||c&&t==="fixed")&&(i=a.offsetLeft,s=a.offsetTop)}return{width:o,height:r,x:i,y:s}}function LO(e,t){let n=gs(e,!0,t==="fixed"),A=n.top+e.clientTop,a=n.left+e.clientLeft,o=La(e)?ou(e):Ro(1),r=e.clientWidth*o.x,i=e.clientHeight*o.y,s=a*o.x,c=A*o.y;return{width:r,height:i,x:s,y:c}}function q9(e,t,n){let A;if(t==="viewport")A=SO(e,n);else if(t==="document")A=FO(Sa(e));else if(na(t))A=LO(t,n);else{let a=K9(e);A={...t,x:t.x-a.x,y:t.y-a.y}}return us(A)}function W9(e,t){let n=No(e);return n===t||!na(n)||ps(n)?!1:Aa(n).position==="fixed"||W9(n,t)}function RO(e,t){let n=t.get(e);if(n)return n;let A=ds(e,[],!1).filter(i=>na(i)&&ls(i)!=="body"),a=null,o=Aa(e).position==="fixed",r=o?No(e):e;for(;na(r)&&!ps(r);){let i=Aa(r),s=Gf(r);!s&&i.position==="fixed"&&(a=null),(o?!s&&!a:!s&&i.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||au(r)&&!s&&W9(e,r))?A=A.filter(u=>u!==r):a=i,r=No(r)}return t.set(e,A),A}function MO(e){let{element:t,boundary:n,rootBoundary:A,strategy:a}=e,r=[...n==="clippingAncestors"?Xl(t)?[]:RO(t,this._c):[].concat(n),A],i=r[0],s=r.reduce((c,u)=>{let d=q9(t,u,a);return c.top=Vn(d.top,c.top),c.right=Xa(d.right,c.right),c.bottom=Xa(d.bottom,c.bottom),c.left=Vn(d.left,c.left),c},q9(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function NO(e){let{width:t,height:n}=Y9(e);return{width:t,height:n}}function PO(e,t,n){let A=La(t),a=Sa(t),o=n==="fixed",r=gs(e,!0,o,t),i={scrollLeft:0,scrollTop:0},s=Ro(0);if(A||!A&&!o)if((ls(t)!=="body"||au(a))&&(i=ep(t)),A){let p=gs(t,!0,o,t);s.x=p.x+t.clientLeft,s.y=p.y+t.clientTop}else a&&(s.x=Ny(a));let c=0,u=0;if(a&&!A&&!o){let p=a.getBoundingClientRect();u=p.top+i.scrollTop,c=p.left+i.scrollLeft-Ny(a,p)}let d=r.left+i.scrollLeft-s.x-c,l=r.top+i.scrollTop-s.y-u;return{x:d,y:l,width:r.width,height:r.height}}function My(e){return Aa(e).position==="static"}function O9(e,t){if(!La(e)||Aa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Sa(e)===n&&(n=n.ownerDocument.body),n}function J9(e,t){let n=mA(e);if(Xl(e))return n;if(!La(e)){let a=No(e);for(;a&&!ps(a);){if(na(a)&&!My(a))return a;a=No(a)}return n}let A=O9(e,t);for(;A&&T9(A)&&My(A);)A=O9(A,t);return A&&ps(A)&&My(A)&&!Gf(A)?n:A||U9(e)||n}var jO=async function(e){let t=this.getOffsetParent||J9,n=this.getDimensions,A=await n(e.floating);return{reference:PO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:A.width,height:A.height}}};function GO(e){return Aa(e).direction==="rtl"}var V9={convertOffsetParentRelativeRectToViewportRelativeRect:DO,getDocumentElement:Sa,getClippingRect:MO,getOffsetParent:J9,getElementRects:jO,getClientRects:vO,getDimensions:NO,getScale:ou,isElement:na,isRTL:GO};function zO(e,t){let n=null,A,a=Sa(e);function o(){var i;clearTimeout(A),(i=n)==null||i.disconnect(),n=null}function r(i,s){i===void 0&&(i=!1),s===void 0&&(s=1),o();let{left:c,top:u,width:d,height:l}=e.getBoundingClientRect();if(i||t(),!d||!l)return;let p=Vl(u),g=Vl(a.clientWidth-(c+d)),b=Vl(a.clientHeight-(u+l)),B=Vl(c),m={rootMargin:-p+"px "+-g+"px "+-b+"px "+-B+"px",threshold:Vn(0,Xa(1,s))||1},h=!0;function C(E){let Q=E[0].intersectionRatio;if(Q!==s){if(!h)return r();Q?r(!1,Q):A=setTimeout(()=>{r(!1,1e-7)},1e3)}h=!1}try{n=new IntersectionObserver(C,{...m,root:a.ownerDocument})}catch{n=new IntersectionObserver(C,m)}n.observe(e)}return r(!0),o}function jy(e,t,n,A){A===void 0&&(A={});let{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:s=!1}=A,c=Py(e),u=a||o?[...c?ds(c):[],...ds(t)]:[];u.forEach(f=>{a&&f.addEventListener("scroll",n,{passive:!0}),o&&f.addEventListener("resize",n)});let d=c&&i?zO(c,n):null,l=-1,p=null;r&&(p=new ResizeObserver(f=>{let[m]=f;m&&m.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(l),l=requestAnimationFrame(()=>{var h;(h=p)==null||h.observe(t)})),n()}),c&&!s&&p.observe(c),p.observe(t));let g,b=s?gs(e):null;s&&B();function B(){let f=gs(e);b&&(f.x!==b.x||f.y!==b.y||f.width!==b.width||f.height!==b.height)&&n(),b=f,g=requestAnimationFrame(B)}return n(),()=>{var f;u.forEach(m=>{a&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),d?.(),(f=p)==null||f.disconnect(),p=null,s&&cancelAnimationFrame(g)}}var X9=P9;var e2=j9,t2=M9,n2=z9,A2=N9,Gy=R9;var a2=G9,zy=(e,t,n)=>{let A=new Map,a={platform:V9,...n},o={...a.platform,_c:A};return L9(e,t,{...a,platform:o})};var tn=w(_(),1),Uf=w(_(),1),r2=w(Lr(),1),$f=typeof document<"u"?Uf.useLayoutEffect:Uf.useEffect;function Tf(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,A,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(A=n;A--!==0;)if(!Tf(e[A],t[A]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(A=n;A--!==0;)if(!{}.hasOwnProperty.call(t,a[A]))return!1;for(A=n;A--!==0;){let o=a[A];if(!(o==="_owner"&&e.$$typeof)&&!Tf(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function i2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function o2(e,t){let n=i2(e);return Math.round(t*n)/n}function Hy(e){let t=tn.useRef(e);return $f(()=>{t.current=e}),t}function s2(e){e===void 0&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:A=[],platform:a,elements:{reference:o,floating:r}={},transform:i=!0,whileElementsMounted:s,open:c}=e,[u,d]=tn.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[l,p]=tn.useState(A);Tf(l,A)||p(A);let[g,b]=tn.useState(null),[B,f]=tn.useState(null),m=tn.useCallback(K=>{K!==Q.current&&(Q.current=K,b(K))},[]),h=tn.useCallback(K=>{K!==y.current&&(y.current=K,f(K))},[]),C=o||g,E=r||B,Q=tn.useRef(null),y=tn.useRef(null),k=tn.useRef(u),R=s!=null,F=Hy(s),U=Hy(a),M=Hy(c),ce=tn.useCallback(()=>{if(!Q.current||!y.current)return;let K={placement:t,strategy:n,middleware:l};U.current&&(K.platform=U.current),zy(Q.current,y.current,K).then(H=>{let ve={...H,isPositioned:M.current!==!1};N.current&&!Tf(k.current,ve)&&(k.current=ve,r2.flushSync(()=>{d(ve)}))})},[l,t,n,U,M]);$f(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(K=>({...K,isPositioned:!1})))},[c]);let N=tn.useRef(!1);$f(()=>(N.current=!0,()=>{N.current=!1}),[]),$f(()=>{if(C&&(Q.current=C),E&&(y.current=E),C&&E){if(F.current)return F.current(C,E,ce);ce()}},[C,E,ce,F,R]);let te=tn.useMemo(()=>({reference:Q,floating:y,setReference:m,setFloating:h}),[m,h]),W=tn.useMemo(()=>({reference:C,floating:E}),[C,E]),ne=tn.useMemo(()=>{let K={position:n,left:0,top:0};if(!W.floating)return K;let H=o2(W.floating,u.x),ve=o2(W.floating,u.y);return i?{...K,transform:"translate("+H+"px, "+ve+"px)",...i2(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:ve}},[n,i,W.floating,u.x,u.y]);return tn.useMemo(()=>({...u,update:ce,refs:te,elements:W,floatingStyles:ne}),[u,ce,te,W,ne])}var HO=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){let{element:A,padding:a}=typeof e=="function"?e(n):e;return A&&t(A)?A.current!=null?Gy({element:A.current,padding:a}).fn(n):{}:A?Gy({element:A,padding:a}).fn(n):{}}}},c2=(e,t)=>({...X9(e),options:[e,t]}),u2=(e,t)=>({...e2(e),options:[e,t]}),d2=(e,t)=>({...a2(e),options:[e,t]}),l2=(e,t)=>({...t2(e),options:[e,t]}),p2=(e,t)=>({...n2(e),options:[e,t]});var g2=(e,t)=>({...A2(e),options:[e,t]});var m2=(e,t)=>({...HO(e),options:[e,t]});var f2=w(_(),1);var $y=w(I(),1),$O="Arrow",b2=f2.forwardRef((e,t)=>{let{children:n,width:A=10,height:a=5,...o}=e;return(0,$y.jsx)(Z.svg,{...o,ref:t,width:A,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,$y.jsx)("polygon",{points:"0,0 30,0 15,10"})})});b2.displayName=$O;var h2=b2;var Po=w(_(),1),B2=w(I(),1);function ru(e,t=[]){let n=[];function A(o,r){let i=Po.createContext(r),s=n.length;n=[...n,r];function c(d){let{scope:l,children:p,...g}=d,b=l?.[e][s]||i,B=Po.useMemo(()=>g,Object.values(g));return(0,B2.jsx)(b.Provider,{value:B,children:p})}function u(d,l){let p=l?.[e][s]||i,g=Po.useContext(p);if(g)return g;if(r!==void 0)return r;throw new Error(`\`${d}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}let a=()=>{let o=n.map(r=>Po.createContext(r));return function(i){let s=i?.[e]||o;return Po.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return a.scopeName=e,[A,UO(a,...t)]}function UO(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let A=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){let r=A.reduce((i,{useScope:s,scopeName:c})=>{let d=s(o)[`__scope${c}`];return{...i,...d}},{});return Po.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var C2=w(_(),1);function Zf(e){let[t,n]=C2.useState(void 0);return Ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let A=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;let o=a[0],r,i;if("borderBoxSize"in o){let s=o.borderBoxSize,c=Array.isArray(s)?s[0]:s;r=c.inlineSize,i=c.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return A.observe(e,{box:"border-box"}),()=>A.unobserve(e)}else n(void 0)},[e]),t}var Yr=w(I(),1);var Ty="Popper",[w2,aa]=ru(Ty),[ZO,E2]=w2(Ty),y2=e=>{let{__scopePopper:t,children:n}=e,[A,a]=MA.useState(null);return(0,Yr.jsx)(ZO,{scope:t,anchor:A,onAnchorChange:a,children:n})};y2.displayName=Ty;var Q2="PopperAnchor",k2=MA.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:A,...a}=e,o=E2(Q2,n),r=MA.useRef(null),i=pe(t,r);return MA.useEffect(()=>{o.onAnchorChange(A?.current||r.current)}),A?null:(0,Yr.jsx)(Z.div,{...a,ref:i})});k2.displayName=Q2;var Uy="PopperContent",[qO,OO]=w2(Uy),I2=MA.forwardRef((e,t)=>{let{__scopePopper:n,side:A="bottom",sideOffset:a=0,align:o="center",alignOffset:r=0,arrowPadding:i=0,avoidCollisions:s=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:l=!1,updatePositionStrategy:p="optimized",onPlaced:g,...b}=e,B=E2(Uy,n),[f,m]=MA.useState(null),h=pe(t,$=>m($)),[C,E]=MA.useState(null),Q=Zf(C),y=Q?.width??0,k=Q?.height??0,R=A+(o!=="center"?"-"+o:""),F=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},U=Array.isArray(c)?c:[c],M=U.length>0,ce={padding:F,boundary:U.filter(KO),altBoundary:M},{refs:N,floatingStyles:te,placement:W,isPositioned:ne,middlewareData:K}=s2({strategy:"fixed",placement:R,whileElementsMounted:(...$)=>jy(...$,{animationFrame:p==="always"}),elements:{reference:B.anchor},middleware:[c2({mainAxis:a+k,alignmentAxis:r}),s&&u2({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?d2():void 0,...ce}),s&&l2({...ce}),p2({...ce,apply:({elements:$,rects:_e,availableWidth:Dt,availableHeight:Te})=>{let{width:Et,height:Xt}=_e.reference,UA=$.floating.style;UA.setProperty("--radix-popper-available-width",`${Dt}px`),UA.setProperty("--radix-popper-available-height",`${Te}px`),UA.setProperty("--radix-popper-anchor-width",`${Et}px`),UA.setProperty("--radix-popper-anchor-height",`${Xt}px`)}}),C&&m2({element:C,padding:i}),WO({arrowWidth:y,arrowHeight:k}),l&&g2({strategy:"referenceHidden",...ce})]}),[H,ve]=D2(W),Re=Je(g);Ne(()=>{ne&&Re?.()},[ne,Re]);let L=K.arrow?.x,ae=K.arrow?.y,ue=K.arrow?.centerOffset!==0,[Ae,Qe]=MA.useState();return Ne(()=>{f&&Qe(window.getComputedStyle(f).zIndex)},[f]),(0,Yr.jsx)("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:ne?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ae,"--radix-popper-transform-origin":[K.transformOrigin?.x,K.transformOrigin?.y].join(" "),...K.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,Yr.jsx)(qO,{scope:n,placedSide:H,onArrowChange:E,arrowX:L,arrowY:ae,shouldHideArrow:ue,children:(0,Yr.jsx)(Z.div,{"data-side":H,"data-align":ve,...b,ref:h,style:{...b.style,animation:ne?void 0:"none"}})})})});I2.displayName=Uy;var _2="PopperArrow",YO={top:"bottom",right:"left",bottom:"top",left:"right"},x2=MA.forwardRef(function(t,n){let{__scopePopper:A,...a}=t,o=OO(_2,A),r=YO[o.placedSide];return(0,Yr.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[r]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,Yr.jsx)(h2,{...a,ref:n,style:{...a.style,display:"block"}})})});x2.displayName=_2;function KO(e){return e!==null}var WO=e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:A,middlewareData:a}=t,r=a.arrow?.centerOffset!==0,i=r?0:e.arrowWidth,s=r?0:e.arrowHeight,[c,u]=D2(n),d={start:"0%",center:"50%",end:"100%"}[u],l=(a.arrow?.x??0)+i/2,p=(a.arrow?.y??0)+s/2,g="",b="";return c==="bottom"?(g=r?d:`${l}px`,b=`${-s}px`):c==="top"?(g=r?d:`${l}px`,b=`${A.floating.height+s}px`):c==="right"?(g=`${-s}px`,b=r?d:`${p}px`):c==="left"&&(g=`${A.floating.width+s}px`,b=r?d:`${p}px`),{data:{x:g,y:b}}}});function D2(e){let[t,n="center"]=e.split("-");return[t,n]}var jo=y2,Go=k2,Kr=I2,Wr=x2;var v2=w(_(),1);var F2=w(I(),1),JO="VisuallyHidden",ms=v2.forwardRef((e,t)=>(0,F2.jsx)(Z.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ms.displayName=JO;var S2=ms;var nn=w(I(),1),[Of,_he]=Pt("Tooltip",[aa]),Yf=aa(),L2="TooltipProvider",XO=700,Zy="tooltip.open",[eY,Oy]=Of(L2),R2=e=>{let{__scopeTooltip:t,delayDuration:n=XO,skipDelayDuration:A=300,disableHoverableContent:a=!1,children:o}=e,[r,i]=Ce.useState(!0),s=Ce.useRef(!1),c=Ce.useRef(0);return Ce.useEffect(()=>{let u=c.current;return()=>window.clearTimeout(u)},[]),(0,nn.jsx)(eY,{scope:t,isOpenDelayed:r,delayDuration:n,onOpen:Ce.useCallback(()=>{window.clearTimeout(c.current),i(!1)},[]),onClose:Ce.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i(!0),A)},[A]),isPointerInTransitRef:s,onPointerInTransitChange:Ce.useCallback(u=>{s.current=u},[]),disableHoverableContent:a,children:o})};R2.displayName=L2;var Kf="Tooltip",[tY,tp]=Of(Kf),M2=e=>{let{__scopeTooltip:t,children:n,open:A,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:r,delayDuration:i}=e,s=Oy(Kf,e.__scopeTooltip),c=Yf(t),[u,d]=Ce.useState(null),l=Pe(),p=Ce.useRef(0),g=r??s.disableHoverableContent,b=i??s.delayDuration,B=Ce.useRef(!1),[f=!1,m]=Tt({prop:A,defaultProp:a,onChange:y=>{y?(s.onOpen(),document.dispatchEvent(new CustomEvent(Zy))):s.onClose(),o?.(y)}}),h=Ce.useMemo(()=>f?B.current?"delayed-open":"instant-open":"closed",[f]),C=Ce.useCallback(()=>{window.clearTimeout(p.current),B.current=!1,m(!0)},[m]),E=Ce.useCallback(()=>{window.clearTimeout(p.current),m(!1)},[m]),Q=Ce.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{B.current=!0,m(!0)},b)},[b,m]);return Ce.useEffect(()=>()=>window.clearTimeout(p.current),[]),(0,nn.jsx)(jo,{...c,children:(0,nn.jsx)(tY,{scope:t,contentId:l,open:f,stateAttribute:h,trigger:u,onTriggerChange:d,onTriggerEnter:Ce.useCallback(()=>{s.isOpenDelayed?Q():C()},[s.isOpenDelayed,Q,C]),onTriggerLeave:Ce.useCallback(()=>{g?E():window.clearTimeout(p.current)},[E,g]),onOpen:C,onClose:E,disableHoverableContent:g,children:n})})};M2.displayName=Kf;var qy="TooltipTrigger",N2=Ce.forwardRef((e,t)=>{let{__scopeTooltip:n,...A}=e,a=tp(qy,n),o=Oy(qy,n),r=Yf(n),i=Ce.useRef(null),s=pe(t,i,a.onTriggerChange),c=Ce.useRef(!1),u=Ce.useRef(!1),d=Ce.useCallback(()=>c.current=!1,[]);return Ce.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,nn.jsx)(Go,{asChild:!0,...r,children:(0,nn.jsx)(Z.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...A,ref:s,onPointerMove:z(e.onPointerMove,l=>{l.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:z(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:z(e.onFocus,()=>{c.current||a.onOpen()}),onBlur:z(e.onBlur,a.onClose),onClick:z(e.onClick,a.onClose)})})});N2.displayName=qy;var Yy="TooltipPortal",[nY,AY]=Of(Yy,{forceMount:void 0}),aY=e=>{let{__scopeTooltip:t,forceMount:n,children:A,container:a}=e,o=tp(Yy,t);return(0,nn.jsx)(nY,{scope:t,forceMount:n,children:(0,nn.jsx)(jt,{present:n||o.open,children:(0,nn.jsx)(LA,{asChild:!0,container:a,children:A})})})};aY.displayName=Yy;var iu="TooltipContent",P2=Ce.forwardRef((e,t)=>{let n=AY(iu,e.__scopeTooltip),{forceMount:A=n.forceMount,side:a="top",...o}=e,r=tp(iu,e.__scopeTooltip);return(0,nn.jsx)(jt,{present:A||r.open,children:r.disableHoverableContent?(0,nn.jsx)(j2,{side:a,...o,ref:t}):(0,nn.jsx)(oY,{side:a,...o,ref:t})})}),oY=Ce.forwardRef((e,t)=>{let n=tp(iu,e.__scopeTooltip),A=Oy(iu,e.__scopeTooltip),a=Ce.useRef(null),o=pe(t,a),[r,i]=Ce.useState(null),{trigger:s,onClose:c}=n,u=a.current,{onPointerInTransitChange:d}=A,l=Ce.useCallback(()=>{i(null),d(!1)},[d]),p=Ce.useCallback((g,b)=>{let B=g.currentTarget,f={x:g.clientX,y:g.clientY},m=cY(f,B.getBoundingClientRect()),h=uY(f,m),C=dY(b.getBoundingClientRect()),E=pY([...h,...C]);i(E),d(!0)},[d]);return Ce.useEffect(()=>()=>l(),[l]),Ce.useEffect(()=>{if(s&&u){let g=B=>p(B,u),b=B=>p(B,s);return s.addEventListener("pointerleave",g),u.addEventListener("pointerleave",b),()=>{s.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",b)}}},[s,u,p,l]),Ce.useEffect(()=>{if(r){let g=b=>{let B=b.target,f={x:b.clientX,y:b.clientY},m=s?.contains(B)||u?.contains(B),h=!lY(f,r);m?l():h&&(l(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[s,u,r,c,l]),(0,nn.jsx)(j2,{...e,ref:o})}),[rY,iY]=Of(Kf,{isInside:!1}),j2=Ce.forwardRef((e,t)=>{let{__scopeTooltip:n,children:A,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:r,...i}=e,s=tp(iu,n),c=Yf(n),{onClose:u}=s;return Ce.useEffect(()=>(document.addEventListener(Zy,u),()=>document.removeEventListener(Zy,u)),[u]),Ce.useEffect(()=>{if(s.trigger){let d=l=>{l.target?.contains(s.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[s.trigger,u]),(0,nn.jsx)(ea,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:(0,nn.jsxs)(Kr,{"data-state":s.stateAttribute,...c,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,nn.jsx)(XE,{children:A}),(0,nn.jsx)(rY,{scope:n,isInside:!0,children:(0,nn.jsx)(S2,{id:s.contentId,role:"tooltip",children:a||A})})]})})});P2.displayName=iu;var G2="TooltipArrow",sY=Ce.forwardRef((e,t)=>{let{__scopeTooltip:n,...A}=e,a=Yf(n);return iY(G2,n).isInside?null:(0,nn.jsx)(Wr,{...a,...A,ref:t})});sY.displayName=G2;function cY(e,t){let n=Math.abs(t.top-e.y),A=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,A,a,o)){case o:return"left";case a:return"right";case n:return"top";case A:return"bottom";default:throw new Error("unreachable")}}function uY(e,t,n=5){let A=[];switch(t){case"top":A.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":A.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":A.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":A.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return A}function dY(e){let{top:t,right:n,bottom:A,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:A},{x:a,y:A}]}function lY(e,t){let{x:n,y:A}=e,a=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,u=t[r].y;s>A!=u>A&&n<(c-i)*(A-s)/(u-s)+i&&(a=!a)}return a}function pY(e){let t=e.slice();return t.sort((n,A)=>n.x<A.x?-1:n.x>A.x?1:n.y<A.y?-1:n.y>A.y?1:0),gY(t)}function gY(e){if(e.length<=1)return e.slice();let t=[];for(let A=0;A<e.length;A++){let a=e[A];for(;t.length>=2;){let o=t[t.length-1],r=t[t.length-2];if((o.x-r.x)*(a.y-r.y)>=(o.y-r.y)*(a.x-r.x))t.pop();else break}t.push(a)}t.pop();let n=[];for(let A=e.length-1;A>=0;A--){let a=e[A];for(;n.length>=2;){let o=n[n.length-1],r=n[n.length-2];if((o.x-r.x)*(a.y-r.y)>=(o.y-r.y)*(a.x-r.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var z2=R2,H2=M2,$2=N2;var Ky=P2;var U2=w(I(),1),Xe=z2,et=H2,Qt=$2,Oe=T2.forwardRef(({className:e,sideOffset:t=4,...n},A)=>(0,U2.jsx)(Ky,{ref:A,sideOffset:t,className:v("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Oe.displayName=Ky.displayName;var ye=w(I(),1),fY="sidebar:state",bY=60*60*24*7,hY="12.5rem",BY="16rem",CY="3rem",wY="b",Z2=ke.createContext(null);function su(){let e=ke.useContext(Z2);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var Wy=ke.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:A,style:a,children:o,...r},i)=>{let s=J1(),[c,u]=ke.useState(!1),[d,l]=ke.useState(e),p=t??d,g=ke.useCallback(m=>{let h=typeof m=="function"?m(p):m;n?n(h):l(h),document.cookie=`${fY}=${h}; path=/; max-age=${bY}`},[n,p]),b=ke.useCallback(()=>s?u(m=>!m):g(m=>!m),[s,g,u]);ke.useEffect(()=>{let m=h=>{h.key===wY&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),b())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[b]);let B=p?"expanded":"collapsed",f=ke.useMemo(()=>({state:B,open:p,setOpen:g,isMobile:s,openMobile:c,setOpenMobile:u,toggleSidebar:b}),[B,p,g,s,c,u,b]);return(0,ye.jsx)(Z2.Provider,{value:f,children:(0,ye.jsx)(Xe,{delayDuration:0,children:(0,ye.jsx)("div",{style:{"--sidebar-width":hY,"--sidebar-width-icon":CY,...a},className:v("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",A),ref:i,...r,children:o})})})});Wy.displayName="SidebarProvider";var Jy=ke.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:A,children:a,...o},r)=>{let{isMobile:i,state:s,openMobile:c,setOpenMobile:u}=su();return n==="none"?(0,ye.jsx)("div",{className:v("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",A),ref:r,...o,children:a}):i?(0,ye.jsx)(y9,{open:c,onOpenChange:u,...o,children:(0,ye.jsx)(Sy,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":BY},side:e,children:(0,ye.jsx)("div",{className:"flex h-full w-full flex-col",children:a})})}):(0,ye.jsxs)("div",{ref:r,className:"group peer hidden md:block text-sidebar-foreground","data-state":s,"data-collapsible":s==="collapsed"?n:"","data-variant":t,"data-side":e,children:[(0,ye.jsx)("div",{className:v("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,ye.jsx)("div",{className:v("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",A),...o,children:(0,ye.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});Jy.displayName="Sidebar";var EY=ke.forwardRef(({className:e,onClick:t,...n},A)=>{let{toggleSidebar:a}=su();return(0,ye.jsxs)(se,{ref:A,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:v("h-7 w-7",e),onClick:o=>{t?.(o),a()},...n,children:[(0,ye.jsx)(Va,{}),(0,ye.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});EY.displayName="SidebarTrigger";var Vy=ke.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:A}=su();return(0,ye.jsx)("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:A,title:"Toggle Sidebar",className:v("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Vy.displayName="SidebarRail";var yY=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("main",{ref:n,className:v("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));yY.displayName="SidebarInset";var QY=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)(We,{ref:n,"data-sidebar":"input",className:v("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));QY.displayName="SidebarInput";var Xy=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"header",className:v("flex flex-col gap-2 p-2",e),...t}));Xy.displayName="SidebarHeader";var e0=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"footer",className:v("flex flex-col gap-2 p-2",e),...t}));e0.displayName="SidebarFooter";var np=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)(oy,{ref:n,"data-sidebar":"separator",className:v("mx-2 w-auto bg-sidebar-border",e),...t}));np.displayName="SidebarSeparator";var t0=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"content",className:v("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));t0.displayName="SidebarContent";var Ap=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"group",className:v("relative flex w-full min-w-0 flex-col p-2",e),...t}));Ap.displayName="SidebarGroup";var n0=ke.forwardRef(({className:e,asChild:t=!1,...n},A)=>(0,ye.jsx)(t?Nt:"div",{ref:A,"data-sidebar":"group-label",className:v("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n}));n0.displayName="SidebarGroupLabel";var kY=ke.forwardRef(({className:e,asChild:t=!1,...n},A)=>(0,ye.jsx)(t?Nt:"button",{ref:A,"data-sidebar":"group-action",className:v("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n}));kY.displayName="SidebarGroupAction";var IY=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"group-content",className:v("w-full text-sm",e),...t}));IY.displayName="SidebarGroupContent";var oa=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("ul",{ref:n,"data-sidebar":"menu",className:v("flex w-full min-w-0 flex-col gap-1",e),...t}));oa.displayName="SidebarMenu";var ra=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("li",{ref:n,"data-sidebar":"menu-item",className:v("group/menu-item relative",e),...t}));ra.displayName="SidebarMenuItem";var _Y=VA("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),fA=ke.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:A="default",tooltip:a,className:o,...r},i)=>{let s=e?Nt:"button",{isMobile:c,state:u}=su(),d=(0,ye.jsx)(s,{ref:i,"data-sidebar":"menu-button","data-size":A,"data-active":t,className:v(_Y({variant:n,size:A}),o),...r});return a?(typeof a=="string"&&(a={children:a}),(0,ye.jsxs)(et,{children:[(0,ye.jsx)(Qt,{asChild:!0,children:d}),(0,ye.jsx)(Oe,{side:"right",align:"center",hidden:u!=="collapsed"||c,...a})]})):d});fA.displayName="SidebarMenuButton";var xY=ke.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...A},a)=>(0,ye.jsx)(t?Nt:"button",{ref:a,"data-sidebar":"menu-action",className:v("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...A}));xY.displayName="SidebarMenuAction";var A0=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("div",{ref:n,"data-sidebar":"menu-badge",className:v("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));A0.displayName="SidebarMenuBadge";var DY=ke.forwardRef(({className:e,showIcon:t=!1,...n},A)=>{let a=ke.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,ye.jsxs)("div",{ref:A,"data-sidebar":"menu-skeleton",className:v("rounded-md h-8 flex gap-2 px-2 items-center",e),...n,children:[t&&(0,ye.jsx)(Ly,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,ye.jsx)(Ly,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});DY.displayName="SidebarMenuSkeleton";var cu=ke.forwardRef(({className:e,...t},n)=>(0,ye.jsx)("ul",{ref:n,"data-sidebar":"menu-sub",className:v("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));cu.displayName="SidebarMenuSub";var Wf=ke.forwardRef(({...e},t)=>(0,ye.jsx)("li",{ref:t,...e}));Wf.displayName="SidebarMenuSubItem";var Jf=ke.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:A,...a},o)=>(0,ye.jsx)(e?Nt:"a",{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:v("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",A),...a}));Jf.displayName="SidebarMenuSubButton";var vY=[{title:"Dashboard",url:"/dashboard",icon:Ll}],q2=vY;var In=w(_(),1);var fs=w(I(),1),a0="Collapsible",[FY,Vhe]=Pt(a0),[SY,o0]=FY(a0),O2=In.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:A,defaultOpen:a,disabled:o,onOpenChange:r,...i}=e,[s=!1,c]=Tt({prop:A,defaultProp:a,onChange:r});return(0,fs.jsx)(SY,{scope:n,disabled:o,contentId:Pe(),open:s,onOpenToggle:In.useCallback(()=>c(u=>!u),[c]),children:(0,fs.jsx)(Z.div,{"data-state":c0(s),"data-disabled":o?"":void 0,...i,ref:t})})});O2.displayName=a0;var Y2="CollapsibleTrigger",r0=In.forwardRef((e,t)=>{let{__scopeCollapsible:n,...A}=e,a=o0(Y2,n);return(0,fs.jsx)(Z.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":c0(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...A,ref:t,onClick:z(e.onClick,a.onOpenToggle)})});r0.displayName=Y2;var i0="CollapsibleContent",s0=In.forwardRef((e,t)=>{let{forceMount:n,...A}=e,a=o0(i0,e.__scopeCollapsible);return(0,fs.jsx)(jt,{present:n||a.open,children:({present:o})=>(0,fs.jsx)(LY,{...A,ref:t,present:o})})});s0.displayName=i0;var LY=In.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:A,children:a,...o}=e,r=o0(i0,n),[i,s]=In.useState(A),c=In.useRef(null),u=pe(t,c),d=In.useRef(0),l=d.current,p=In.useRef(0),g=p.current,b=r.open||i,B=In.useRef(b),f=In.useRef();return In.useEffect(()=>{let m=requestAnimationFrame(()=>B.current=!1);return()=>cancelAnimationFrame(m)},[]),Ne(()=>{let m=c.current;if(m){f.current=f.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";let h=m.getBoundingClientRect();d.current=h.height,p.current=h.width,B.current||(m.style.transitionDuration=f.current.transitionDuration,m.style.animationName=f.current.animationName),s(A)}},[r.open,A]),(0,fs.jsx)(Z.div,{"data-state":c0(r.open),"data-disabled":r.disabled?"":void 0,id:r.contentId,hidden:!b,...o,ref:u,style:{"--radix-collapsible-content-height":l?`${l}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:b&&a})});function c0(e){return e?"open":"closed"}var K2=O2;var ap=K2,op=r0,rp=s0;var _n=w(I(),1),W2=()=>{let e=D(n=>n.activeRoute),t=n=>n.map(A=>{let a=A.items?.length;return(0,_n.jsx)(ap,{asChild:!0,defaultOpen:A.isActive,className:"group/collapsible",children:(0,_n.jsxs)(ra,{children:[(0,_n.jsx)(op,{asChild:!0,children:(0,_n.jsx)(fA,{asChild:!0,isActive:e===A.url,className:"data-[active=true]:bg-neutral-800 data-[active=true]:text-white data-[active=true]:dark:bg-neutral-100 data-[active=true]:dark:text-black whitespace-nowrap",tooltip:A.title,children:(0,_n.jsxs)("a",{href:A.url,target:A.url.split("")[0]==="/"?"_top":"_blank",children:[A.icon&&(0,_n.jsx)(A.icon,{}),(0,_n.jsx)("span",{children:A.title}),a&&(0,_n.jsxs)(_n.Fragment,{children:[(0,_n.jsx)(Wa,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:hidden"}),(0,_n.jsx)(va,{className:"ml-auto transition-transform duration-200 group-data-[state=closed]/collapsible:hidden"})]})]})})}),A.items&&a&&(0,_n.jsx)(rp,{children:(0,_n.jsx)(cu,{children:t(A.items)})})]})},A.title)});return(0,_n.jsx)(oa,{children:t(q2)})};var Ra=w(I(),1),J2=()=>{let{resolvedTheme:e}=Rr();return(0,Ra.jsx)(oa,{children:(0,Ra.jsx)(ra,{children:(0,Ra.jsx)(fA,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground whitespace-nowrap",asChild:!0,children:(0,Ra.jsxs)("a",{href:"/",children:[(0,Ra.jsx)("div",{className:"flex items-center justify-center aspect-square h-full",children:(0,Ra.jsx)(U1,{color:e==="dark"?"white":"black",className:"flex items-center justify-center"})}),(0,Ra.jsx)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:(0,Ra.jsxs)("span",{className:"truncate font-semibold",children:["vlt",(0,Ra.jsx)("span",{className:"ml-1 truncate font-light",children:"/volt/"})]})})]})})})})};var Vf=w(_(),1);var zo=w(I(),1),V2=()=>{let e=D(a=>a.activeRoute),t=D(a=>a.savedQueries),[n,A]=(0,Vf.useState)(0);return(0,Vf.useEffect)(()=>{A(t?t.length:0)},[t]),(0,zo.jsx)(oa,{children:(0,zo.jsx)(ra,{children:(0,zo.jsx)(fA,{isActive:e==="/queries",asChild:!0,tooltip:"Saved queries",className:"data-[active=true]:bg-neutral-800 data-[active=true]:text-white data-[active=true]:dark:bg-neutral-100 data-[active=true]:dark:text-black",children:(0,zo.jsxs)("a",{href:"/queries",className:"text-foreground ",children:[(0,zo.jsx)(Do,{}),(0,zo.jsx)("span",{children:"Queries"}),(0,zo.jsx)(A0,{className:e==="/queries"?"text-white dark:text-black":"",children:n!==0?n:void 0})]})})})})};var xs=w(_(),1);var ca=w(_(),1);var tb=w(_(),1),MY=1,NY=1e6;var u0=0;function PY(){return u0=(u0+1)%Number.MAX_SAFE_INTEGER,u0.toString()}var d0=new Map,X2=e=>{if(d0.has(e))return;let t=setTimeout(()=>{d0.delete(e),ip({type:"REMOVE_TOAST",toastId:e})},NY);d0.set(e,t)},jY=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,MY)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{let{toastId:n}=t;return n?X2(n):e.toasts.forEach(A=>{X2(A.id)}),{...e,toasts:e.toasts.map(A=>A.id===n||n===void 0?{...A,open:!1}:A)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Xf=[],eb={toasts:[]};function ip(e){eb=jY(eb,e),Xf.forEach(t=>{t(eb)})}function GY({...e}){let t=PY(),n=a=>ip({type:"UPDATE_TOAST",toast:{...a,id:t}}),A=()=>ip({type:"DISMISS_TOAST",toastId:t});return ip({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||A()}}}),{id:t,dismiss:A,update:n}}function zn(){let[e,t]=tb.useState(eb);return tb.useEffect(()=>(Xf.push(t),()=>{let n=Xf.indexOf(t);n>-1&&Xf.splice(n,1)}),[e]),{...e,toast:GY,dismiss:n=>ip({type:"DISMISS_TOAST",toastId:n})}}var uS=w(_(),1);var NA=w(_(),1);var tS=w(_(),1);function eS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function l0(...e){return t=>{let n=!1,A=e.map(a=>{let o=eS(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a<A.length;a++){let o=A[a];typeof o=="function"?o():eS(e[a],null)}}}}function nb(...e){return tS.useCallback(l0(...e),e)}function p0(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}var Ab=w(_(),1);function ab(e){let t=Ab.useRef({value:e,previous:e});return Ab.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var bA=w(_(),1);var nS=w(_(),1);function zY(e,t){return nS.useReducer((n,A)=>t[n][A]??n,e)}var g0=e=>{let{present:t,children:n}=e,A=HY(t),a=typeof n=="function"?n({present:A.isPresent}):bA.Children.only(n),o=nb(A.ref,$Y(a));return typeof n=="function"||A.isPresent?bA.cloneElement(a,{ref:o}):null};g0.displayName="Presence";function HY(e){let[t,n]=bA.useState(),A=bA.useRef({}),a=bA.useRef(e),o=bA.useRef("none"),r=e?"mounted":"unmounted",[i,s]=zY(r,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return bA.useEffect(()=>{let c=ob(A.current);o.current=i==="mounted"?c:"none"},[i]),Ne(()=>{let c=A.current,u=a.current;if(u!==e){let l=o.current,p=ob(c);e?s("MOUNT"):p==="none"||c?.display==="none"?s("UNMOUNT"):s(u&&l!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,s]),Ne(()=>{if(t){let c,u=t.ownerDocument.defaultView??window,d=p=>{let b=ob(A.current).includes(p.animationName);if(p.target===t&&b&&(s("ANIMATION_END"),!a.current)){let B=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=B)})}},l=p=>{p.target===t&&(o.current=ob(A.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:bA.useCallback(c=>{c&&(A.current=getComputedStyle(c)),n(c)},[])}}function ob(e){return e?.animationName||"none"}function $Y(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var AS=w(_(),1),OY=w(Lr(),1);var xn=w(_(),1);var uu=w(I(),1),f0=xn.forwardRef((e,t)=>{let{children:n,...A}=e,a=xn.Children.toArray(n),o=a.find(UY);if(o){let r=o.props.children,i=a.map(s=>s===o?xn.Children.count(r)>1?xn.Children.only(null):xn.isValidElement(r)?r.props.children:null:s);return(0,uu.jsx)(m0,{...A,ref:t,children:xn.isValidElement(r)?xn.cloneElement(r,void 0,i):null})}return(0,uu.jsx)(m0,{...A,ref:t,children:n})});f0.displayName="Slot";var m0=xn.forwardRef((e,t)=>{let{children:n,...A}=e;if(xn.isValidElement(n)){let a=qY(n);return xn.cloneElement(n,{...ZY(A,n.props),ref:t?l0(t,a):a})}return xn.Children.count(n)>1?xn.Children.only(null):null});m0.displayName="SlotClone";var TY=({children:e})=>(0,uu.jsx)(uu.Fragment,{children:e});function UY(e){return xn.isValidElement(e)&&e.type===TY}function ZY(e,t){let n={...t};for(let A in t){let a=e[A],o=t[A];/^on[A-Z]/.test(A)?a&&o?n[A]=(...i)=>{o(...i),a(...i)}:a&&(n[A]=a):A==="style"?n[A]={...a,...o}:A==="className"&&(n[A]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function qY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aS=w(I(),1),YY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],bs=YY.reduce((e,t)=>{let n=AS.forwardRef((A,a)=>{let{asChild:o,...r}=A,i=o?f0:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,aS.jsx)(i,{...r,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});var Vr=w(I(),1),b0="Checkbox",[KY,LBe]=Pt(b0),[WY,JY]=KY(b0),oS=NA.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:A,checked:a,defaultChecked:o,required:r,disabled:i,value:s="on",onCheckedChange:c,form:u,...d}=e,[l,p]=NA.useState(null),g=nb(t,C=>p(C)),b=NA.useRef(!1),B=l?u||!!l.closest("form"):!0,[f=!1,m]=Tt({prop:a,defaultProp:o,onChange:c}),h=NA.useRef(f);return NA.useEffect(()=>{let C=l?.form;if(C){let E=()=>m(h.current);return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[l,m]),(0,Vr.jsxs)(WY,{scope:n,state:f,disabled:i,children:[(0,Vr.jsx)(bs.button,{type:"button",role:"checkbox","aria-checked":Jr(f)?"mixed":f,"aria-required":r,"data-state":sS(f),"data-disabled":i?"":void 0,disabled:i,value:s,...d,ref:g,onKeyDown:p0(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:p0(e.onClick,C=>{m(E=>Jr(E)?!0:!E),B&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})}),B&&(0,Vr.jsx)(VY,{control:l,bubbles:!b.current,name:A,value:s,checked:f,required:r,disabled:i,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Jr(o)?!1:o})]})});oS.displayName=b0;var rS="CheckboxIndicator",iS=NA.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:A,...a}=e,o=JY(rS,n);return(0,Vr.jsx)(g0,{present:A||Jr(o.state)||o.state===!0,children:(0,Vr.jsx)(bs.span,{"data-state":sS(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});iS.displayName=rS;var VY=e=>{let{control:t,checked:n,bubbles:A=!0,defaultChecked:a,...o}=e,r=NA.useRef(null),i=ab(n),s=Zf(t);NA.useEffect(()=>{let u=r.current,d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(i!==n&&p){let g=new Event("click",{bubbles:A});u.indeterminate=Jr(n),p.call(u,Jr(n)?!1:n),u.dispatchEvent(g)}},[i,n,A]);let c=NA.useRef(Jr(n)?!1:n);return(0,Vr.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??c.current,...o,tabIndex:-1,ref:r,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Jr(e){return e==="indeterminate"}function sS(e){return Jr(e)?"indeterminate":e?"checked":"unchecked"}var h0=oS,cS=iS;var rb=w(I(),1),Ho=uS.forwardRef(({className:e,...t},n)=>(0,rb.jsx)(h0,{ref:n,className:v("peer h-4 w-4 shrink-0 rounded-sm border border-primary 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-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:(0,rb.jsx)(cS,{className:v("flex items-center justify-center text-current"),children:(0,rb.jsx)(Da,{className:"h-4 w-4"})})}));Ho.displayName=h0.displayName;var dS=w(_(),1);var lS=w(I(),1),Gt=(0,dS.forwardRef)(({className:e,...t},n)=>(0,lS.jsx)("div",{ref:n,className:v("rounded-md border px-2.5 py-0.5 text-xs font-semibold",e),...t}));Gt.displayName="Label";var ib=w(_(),1);var pS=w(I(),1),eK=VA("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function $o({className:e,variant:t,...n}){return(0,pS.jsx)("div",{className:v(eK({variant:t}),e),...n})}var gS=w(I(),1),tK=(e,t)=>{if(!e.startsWith("#")||e.length!==7&&e.length!==4)throw new Error("Invalid hex color. Must be in #RRGGBB or #RGB format.");e.length===4&&(e=`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);let n=parseInt(e.slice(1,3),16),A=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16),o=(.2126*n+.7152*A+.0722*a)/255;return t==="dark"?o>.55?"black":"white":o>.618?"black":"white"},ia=({name:e,color:t,className:n=""})=>{let{resolvedTheme:A}=Rr(),[a,o]=(0,ib.useState)("");return(0,ib.useEffect)(()=>{t&&o(tK(t,A))},[t,A]),(0,gS.jsx)($o,{style:{backgroundColor:t,color:a},className:`font-medium ${n}`,children:e})};var ei=w(_(),1);var mS=1,nK=.9,AK=.8,aK=.17,B0=.1,C0=.999,oK=.9999,rK=.99,iK=/[\\\/_+.#"@\[\(\{&]/,sK=/[\\\/_+.#"@\[\(\{&]/g,cK=/[\s-]/,bS=/[\s-]/g;function w0(e,t,n,A,a,o,r){if(o===t.length)return a===e.length?mS:rK;var i=`${a},${o}`;if(r[i]!==void 0)return r[i];for(var s=A.charAt(o),c=n.indexOf(s,a),u=0,d,l,p,g;c>=0;)d=w0(e,t,n,A,c+1,o+1,r),d>u&&(c===a?d*=mS:iK.test(e.charAt(c-1))?(d*=AK,p=e.slice(a,c-1).match(sK),p&&a>0&&(d*=Math.pow(C0,p.length))):cK.test(e.charAt(c-1))?(d*=nK,g=e.slice(a,c-1).match(bS),g&&a>0&&(d*=Math.pow(C0,g.length))):(d*=aK,a>0&&(d*=Math.pow(C0,c-a))),e.charAt(c)!==t.charAt(o)&&(d*=oK)),(d<B0&&n.charAt(c-1)===A.charAt(o+1)||A.charAt(o+1)===A.charAt(o)&&n.charAt(c-1)!==A.charAt(o))&&(l=w0(e,t,n,A,c+1,o+2,r),l*B0>d&&(d=l*B0)),d>u&&(u=d),c=n.indexOf(s,c+1);return r[i]=u,u}function fS(e){return e.toLowerCase().replace(bS," ")}function hS(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,w0(e,t,fS(e),fS(t),0,0,{})}var J=w(_(),1);var CS=w(TE(),1),sp='[cmdk-group=""]',E0='[cmdk-group-items=""]',uK='[cmdk-group-heading=""]',Q0='[cmdk-item=""]',BS=`${Q0}:not([aria-disabled="true"])`,y0="cmdk-item-select",hs="data-value",dK=(e,t,n)=>hS(e,t,n),wS=J.createContext(void 0),up=()=>J.useContext(wS),ES=J.createContext(void 0),k0=()=>J.useContext(ES),yS=J.createContext(void 0),QS=J.forwardRef((e,t)=>{let n=du(()=>{var L,ae;return{search:"",value:(ae=(L=e.value)!=null?L:e.defaultValue)!=null?ae:"",filtered:{count:0,items:new Map,groups:new Set}}}),A=du(()=>new Set),a=du(()=>new Map),o=du(()=>new Map),r=du(()=>new Set),i=kS(e),{label:s,children:c,value:u,onValueChange:d,filter:l,shouldFilter:p,loop:g,disablePointerSelection:b=!1,vimBindings:B=!0,...f}=e,m=Pe(),h=Pe(),C=Pe(),E=J.useRef(null),Q=EK();Bs(()=>{if(u!==void 0){let L=u.trim();n.current.value=L,y.emit()}},[u]),Bs(()=>{Q(6,ce)},[]);let y=J.useMemo(()=>({subscribe:L=>(r.current.add(L),()=>r.current.delete(L)),snapshot:()=>n.current,setState:(L,ae,ue)=>{var Ae,Qe,$;if(!Object.is(n.current[L],ae)){if(n.current[L]=ae,L==="search")M(),F(),Q(1,U);else if(L==="value"&&(ue||Q(5,ce),((Ae=i.current)==null?void 0:Ae.value)!==void 0)){let _e=ae??"";($=(Qe=i.current).onValueChange)==null||$.call(Qe,_e);return}y.emit()}},emit:()=>{r.current.forEach(L=>L())}}),[]),k=J.useMemo(()=>({value:(L,ae,ue)=>{var Ae;ae!==((Ae=o.current.get(L))==null?void 0:Ae.value)&&(o.current.set(L,{value:ae,keywords:ue}),n.current.filtered.items.set(L,R(ae,ue)),Q(2,()=>{F(),y.emit()}))},item:(L,ae)=>(A.current.add(L),ae&&(a.current.has(ae)?a.current.get(ae).add(L):a.current.set(ae,new Set([L]))),Q(3,()=>{M(),F(),n.current.value||U(),y.emit()}),()=>{o.current.delete(L),A.current.delete(L),n.current.filtered.items.delete(L);let ue=N();Q(4,()=>{M(),ue?.getAttribute("id")===L&&U(),y.emit()})}),group:L=>(a.current.has(L)||a.current.set(L,new Set),()=>{o.current.delete(L),a.current.delete(L)}),filter:()=>i.current.shouldFilter,label:s||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:m,inputId:C,labelId:h,listInnerRef:E}),[]);function R(L,ae){var ue,Ae;let Qe=(Ae=(ue=i.current)==null?void 0:ue.filter)!=null?Ae:dK;return L?Qe(L,n.current.search,ae):0}function F(){if(!n.current.search||i.current.shouldFilter===!1)return;let L=n.current.filtered.items,ae=[];n.current.filtered.groups.forEach(Ae=>{let Qe=a.current.get(Ae),$=0;Qe.forEach(_e=>{let Dt=L.get(_e);$=Math.max(Dt,$)}),ae.push([Ae,$])});let ue=E.current;te().sort((Ae,Qe)=>{var $,_e;let Dt=Ae.getAttribute("id"),Te=Qe.getAttribute("id");return(($=L.get(Te))!=null?$:0)-((_e=L.get(Dt))!=null?_e:0)}).forEach(Ae=>{let Qe=Ae.closest(E0);Qe?Qe.appendChild(Ae.parentElement===Qe?Ae:Ae.closest(`${E0} > *`)):ue.appendChild(Ae.parentElement===ue?Ae:Ae.closest(`${E0} > *`))}),ae.sort((Ae,Qe)=>Qe[1]-Ae[1]).forEach(Ae=>{var Qe;let $=(Qe=E.current)==null?void 0:Qe.querySelector(`${sp}[${hs}="${encodeURIComponent(Ae[0])}"]`);$?.parentElement.appendChild($)})}function U(){let L=te().find(ue=>ue.getAttribute("aria-disabled")!=="true"),ae=L?.getAttribute(hs);y.setState("value",ae||void 0)}function M(){var L,ae,ue,Ae;if(!n.current.search||i.current.shouldFilter===!1){n.current.filtered.count=A.current.size;return}n.current.filtered.groups=new Set;let Qe=0;for(let $ of A.current){let _e=(ae=(L=o.current.get($))==null?void 0:L.value)!=null?ae:"",Dt=(Ae=(ue=o.current.get($))==null?void 0:ue.keywords)!=null?Ae:[],Te=R(_e,Dt);n.current.filtered.items.set($,Te),Te>0&&Qe++}for(let[$,_e]of a.current)for(let Dt of _e)if(n.current.filtered.items.get(Dt)>0){n.current.filtered.groups.add($);break}n.current.filtered.count=Qe}function ce(){var L,ae,ue;let Ae=N();Ae&&(((L=Ae.parentElement)==null?void 0:L.firstChild)===Ae&&((ue=(ae=Ae.closest(sp))==null?void 0:ae.querySelector(uK))==null||ue.scrollIntoView({block:"nearest"})),Ae.scrollIntoView({block:"nearest"}))}function N(){var L;return(L=E.current)==null?void 0:L.querySelector(`${Q0}[aria-selected="true"]`)}function te(){var L;return Array.from(((L=E.current)==null?void 0:L.querySelectorAll(BS))||[])}function W(L){let ae=te()[L];ae&&y.setState("value",ae.getAttribute(hs))}function ne(L){var ae;let ue=N(),Ae=te(),Qe=Ae.findIndex(_e=>_e===ue),$=Ae[Qe+L];(ae=i.current)!=null&&ae.loop&&($=Qe+L<0?Ae[Ae.length-1]:Qe+L===Ae.length?Ae[0]:Ae[Qe+L]),$&&y.setState("value",$.getAttribute(hs))}function K(L){let ae=N(),ue=ae?.closest(sp),Ae;for(;ue&&!Ae;)ue=L>0?CK(ue,sp):wK(ue,sp),Ae=ue?.querySelector(BS);Ae?y.setState("value",Ae.getAttribute(hs)):ne(L)}let H=()=>W(te().length-1),ve=L=>{L.preventDefault(),L.metaKey?H():L.altKey?K(1):ne(1)},Re=L=>{L.preventDefault(),L.metaKey?W(0):L.altKey?K(-1):ne(-1)};return J.createElement(Z.div,{ref:t,tabIndex:-1,...f,"cmdk-root":"",onKeyDown:L=>{var ae;if((ae=f.onKeyDown)==null||ae.call(f,L),!L.defaultPrevented)switch(L.key){case"n":case"j":{B&&L.ctrlKey&&ve(L);break}case"ArrowDown":{ve(L);break}case"p":case"k":{B&&L.ctrlKey&&Re(L);break}case"ArrowUp":{Re(L);break}case"Home":{L.preventDefault(),W(0);break}case"End":{L.preventDefault(),H();break}case"Enter":if(!L.nativeEvent.isComposing&&L.keyCode!==229){L.preventDefault();let ue=N();if(ue){let Ae=new Event(y0);ue.dispatchEvent(Ae)}}}}},J.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:QK},s),sb(e,L=>J.createElement(ES.Provider,{value:y},J.createElement(wS.Provider,{value:k},L))))}),lK=J.forwardRef((e,t)=>{var n,A;let a=Pe(),o=J.useRef(null),r=J.useContext(yS),i=up(),s=kS(e),c=(A=(n=s.current)==null?void 0:n.forceMount)!=null?A:r?.forceMount;Bs(()=>{if(!c)return i.item(a,r?.id)},[c]);let u=IS(a,o,[e.value,e.children,o],e.keywords),d=k0(),l=Cs(Q=>Q.value&&Q.value===u.current),p=Cs(Q=>c||i.filter()===!1?!0:Q.search?Q.filtered.items.get(a)>0:!0);J.useEffect(()=>{let Q=o.current;if(!(!Q||e.disabled))return Q.addEventListener(y0,g),()=>Q.removeEventListener(y0,g)},[p,e.onSelect,e.disabled]);function g(){var Q,y;b(),(y=(Q=s.current).onSelect)==null||y.call(Q,u.current)}function b(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:B,value:f,onSelect:m,forceMount:h,keywords:C,...E}=e;return J.createElement(Z.div,{ref:cp([o,t]),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!B,"aria-selected":!!l,"data-disabled":!!B,"data-selected":!!l,onPointerMove:B||i.getDisablePointerSelection()?void 0:b,onClick:B?void 0:g},e.children)}),pK=J.forwardRef((e,t)=>{let{heading:n,children:A,forceMount:a,...o}=e,r=Pe(),i=J.useRef(null),s=J.useRef(null),c=Pe(),u=up(),d=Cs(p=>a||u.filter()===!1?!0:p.search?p.filtered.groups.has(r):!0);Bs(()=>u.group(r),[]),IS(r,i,[e.value,e.heading,s]);let l=J.useMemo(()=>({id:r,forceMount:a}),[a]);return J.createElement(Z.div,{ref:cp([i,t]),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&J.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),sb(e,p=>J.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},J.createElement(yS.Provider,{value:l},p))))}),gK=J.forwardRef((e,t)=>{let{alwaysRender:n,...A}=e,a=J.useRef(null),o=Cs(r=>!r.search);return!n&&!o?null:J.createElement(Z.div,{ref:cp([a,t]),...A,"cmdk-separator":"",role:"separator"})}),mK=J.forwardRef((e,t)=>{let{onValueChange:n,...A}=e,a=e.value!=null,o=k0(),r=Cs(u=>u.search),i=Cs(u=>u.value),s=up(),c=J.useMemo(()=>{var u;let d=(u=s.listInnerRef.current)==null?void 0:u.querySelector(`${Q0}[${hs}="${encodeURIComponent(i)}"]`);return d?.getAttribute("id")},[]);return J.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),J.createElement(Z.input,{ref:t,...A,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":c,id:s.inputId,type:"text",value:a?e.value:r,onChange:u=>{a||o.setState("search",u.target.value),n?.(u.target.value)}})}),fK=J.forwardRef((e,t)=>{let{children:n,label:A="Suggestions",...a}=e,o=J.useRef(null),r=J.useRef(null),i=up();return J.useEffect(()=>{if(r.current&&o.current){let s=r.current,c=o.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let l=s.offsetHeight;c.style.setProperty("--cmdk-list-height",l.toFixed(1)+"px")})});return d.observe(s),()=>{cancelAnimationFrame(u),d.unobserve(s)}}},[]),J.createElement(Z.div,{ref:cp([o,t]),...a,"cmdk-list":"",role:"listbox","aria-label":A,id:i.listId},sb(e,s=>J.createElement("div",{ref:cp([r,i.listInnerRef]),"cmdk-list-sizer":""},s)))}),bK=J.forwardRef((e,t)=>{let{open:n,onOpenChange:A,overlayClassName:a,contentClassName:o,container:r,...i}=e;return J.createElement(Xc,{open:n,onOpenChange:A},J.createElement(eu,{container:r},J.createElement(qr,{"cmdk-overlay":"",className:a}),J.createElement(Or,{"aria-label":e.label,"cmdk-dialog":"",className:o},J.createElement(QS,{ref:t,...i}))))}),hK=J.forwardRef((e,t)=>Cs(n=>n.filtered.count===0)?J.createElement(Z.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),BK=J.forwardRef((e,t)=>{let{progress:n,children:A,label:a="Loading...",...o}=e;return J.createElement(Z.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},sb(e,r=>J.createElement("div",{"aria-hidden":!0},r)))}),Xn=Object.assign(QS,{List:fK,Item:lK,Input:mK,Group:pK,Separator:gK,Dialog:bK,Empty:hK,Loading:BK});function CK(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wK(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function kS(e){let t=J.useRef(e);return Bs(()=>{t.current=e}),t}var Bs=typeof window>"u"?J.useEffect:J.useLayoutEffect;function du(e){let t=J.useRef();return t.current===void 0&&(t.current=e()),t}function cp(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Cs(e){let t=k0(),n=()=>e(t.snapshot());return(0,CS.useSyncExternalStore)(t.subscribe,n,n)}function IS(e,t,n,A=[]){let a=J.useRef(),o=up();return Bs(()=>{var r;let i=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():a.current}})(),s=A.map(c=>c.trim());o.value(e,i,s),(r=t.current)==null||r.setAttribute(hs,i),a.current=i}),a}var EK=()=>{let[e,t]=J.useState(),n=du(()=>new Map);return Bs(()=>{n.current.forEach(A=>A()),n.current=new Map},[e]),(A,a)=>{n.current.set(A,a),t({})}};function yK(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function sb({asChild:e,children:t},n){return e&&J.isValidElement(t)?J.cloneElement(yK(t),{ref:t.ref},n(t.props.children)):n(t)}var QK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};var dp=w(_(),1);var PA=w(I(),1),ws=Xc,lu=vy,kK=eu,_S=Yl,xS=dp.forwardRef(({className:e,...t},n)=>(0,PA.jsx)(qr,{ref:n,className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));xS.displayName=qr.displayName;var Xr=dp.forwardRef(({className:e,children:t,...n},A)=>(0,PA.jsxs)(kK,{children:[(0,PA.jsx)(xS,{}),(0,PA.jsxs)(Or,{ref:A,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,(0,PA.jsxs)(Yl,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,PA.jsx)(vo,{className:"h-4 w-4"}),(0,PA.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Xr.displayName=Or.displayName;var Es=({className:e,...t})=>(0,PA.jsx)("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Es.displayName="DialogHeader";var ys=({className:e,...t})=>(0,PA.jsx)("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ys.displayName="DialogFooter";var Qs=dp.forwardRef(({className:e,...t},n)=>(0,PA.jsx)(tu,{ref:n,className:v("text-lg font-semibold leading-none tracking-tight",e),...t}));Qs.displayName=tu.displayName;var ks=dp.forwardRef(({className:e,...t},n)=>(0,PA.jsx)(nu,{ref:n,className:v("text-sm text-muted-foreground",e),...t}));ks.displayName=nu.displayName;var sa=w(I(),1),I0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn,{ref:n,className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));I0.displayName=Xn.displayName;var _0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,sa.jsx)(xo,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,sa.jsx)(Xn.Input,{ref:n,className:v("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));_0.displayName=Xn.Input.displayName;var x0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn.List,{ref:n,className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));x0.displayName=Xn.List.displayName;var D0=ei.forwardRef((e,t)=>(0,sa.jsx)(Xn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));D0.displayName=Xn.Empty.displayName;var v0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn.Group,{ref:n,className:v("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));v0.displayName=Xn.Group.displayName;var IK=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn.Separator,{ref:n,className:v("-mx-1 h-px bg-border",e),...t}));IK.displayName=Xn.Separator.displayName;var F0=ei.forwardRef(({className:e,...t},n)=>(0,sa.jsx)(Xn.Item,{ref:n,className:v("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));F0.displayName=Xn.Item.displayName;var _K=({className:e,...t})=>(0,sa.jsx)("span",{className:v("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});_K.displayName="CommandShortcut";var _s=w(_(),1);var ni=w(_(),1);var $S=w(_(),1);var kt=w(_(),1);var An=w(I(),1),S0="Popover",[DS,BCe]=Pt(S0,[aa]),lp=aa(),[xK,ti]=DS(S0),vS=e=>{let{__scopePopover:t,children:n,open:A,defaultOpen:a,onOpenChange:o,modal:r=!1}=e,i=lp(t),s=kt.useRef(null),[c,u]=kt.useState(!1),[d=!1,l]=Tt({prop:A,defaultProp:a,onChange:o});return(0,An.jsx)(jo,{...i,children:(0,An.jsx)(xK,{scope:t,contentId:Pe(),triggerRef:s,open:d,onOpenChange:l,onOpenToggle:kt.useCallback(()=>l(p=>!p),[l]),hasCustomAnchor:c,onCustomAnchorAdd:kt.useCallback(()=>u(!0),[]),onCustomAnchorRemove:kt.useCallback(()=>u(!1),[]),modal:r,children:n})})};vS.displayName=S0;var FS="PopoverAnchor",DK=kt.forwardRef((e,t)=>{let{__scopePopover:n,...A}=e,a=ti(FS,n),o=lp(n),{onCustomAnchorAdd:r,onCustomAnchorRemove:i}=a;return kt.useEffect(()=>(r(),()=>i()),[r,i]),(0,An.jsx)(Go,{...o,...A,ref:t})});DK.displayName=FS;var SS="PopoverTrigger",LS=kt.forwardRef((e,t)=>{let{__scopePopover:n,...A}=e,a=ti(SS,n),o=lp(n),r=pe(t,a.triggerRef),i=(0,An.jsx)(Z.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":jS(a.open),...A,ref:r,onClick:z(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?i:(0,An.jsx)(Go,{asChild:!0,...o,children:i})});LS.displayName=SS;var L0="PopoverPortal",[vK,FK]=DS(L0,{forceMount:void 0}),RS=e=>{let{__scopePopover:t,forceMount:n,children:A,container:a}=e,o=ti(L0,t);return(0,An.jsx)(vK,{scope:t,forceMount:n,children:(0,An.jsx)(jt,{present:n||o.open,children:(0,An.jsx)(LA,{asChild:!0,container:a,children:A})})})};RS.displayName=L0;var pu="PopoverContent",MS=kt.forwardRef((e,t)=>{let n=FK(pu,e.__scopePopover),{forceMount:A=n.forceMount,...a}=e,o=ti(pu,e.__scopePopover);return(0,An.jsx)(jt,{present:A||o.open,children:o.modal?(0,An.jsx)(SK,{...a,ref:t}):(0,An.jsx)(LK,{...a,ref:t})})});MS.displayName=pu;var SK=kt.forwardRef((e,t)=>{let n=ti(pu,e.__scopePopover),A=kt.useRef(null),a=pe(t,A),o=kt.useRef(!1);return kt.useEffect(()=>{let r=A.current;if(r)return Zr(r)},[]),(0,An.jsx)(Lo,{as:Nt,allowPinchZoom:!0,children:(0,An.jsx)(NS,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,r=>{r.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,r=>{let i=r.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0,c=i.button===2||s;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:z(e.onFocusOutside,r=>r.preventDefault(),{checkForDefaultPrevented:!1})})})}),LK=kt.forwardRef((e,t)=>{let n=ti(pu,e.__scopePopover),A=kt.useRef(!1),a=kt.useRef(!1);return(0,An.jsx)(NS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(A.current||n.triggerRef.current?.focus(),o.preventDefault()),A.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(A.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));let r=o.target;n.triggerRef.current?.contains(r)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),NS=kt.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:A,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:r,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:u,...d}=e,l=ti(pu,n),p=lp(n);return Ur(),(0,An.jsx)(So,{asChild:!0,loop:!0,trapped:A,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,An.jsx)(ea,{asChild:!0,disableOutsidePointerEvents:r,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>l.onOpenChange(!1),children:(0,An.jsx)(Kr,{"data-state":jS(l.open),role:"dialog",id:l.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),PS="PopoverClose",RK=kt.forwardRef((e,t)=>{let{__scopePopover:n,...A}=e,a=ti(PS,n);return(0,An.jsx)(Z.button,{type:"button",...A,ref:t,onClick:z(e.onClick,()=>a.onOpenChange(!1))})});RK.displayName=PS;var MK="PopoverArrow",NK=kt.forwardRef((e,t)=>{let{__scopePopover:n,...A}=e,a=lp(n);return(0,An.jsx)(Wr,{...a,...A,ref:t})});NK.displayName=MK;function jS(e){return e?"open":"closed"}var GS=vS;var zS=LS,HS=RS,R0=MS;var M0=w(I(),1),eA=GS,tA=zS;var Hn=$S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...A},a)=>(0,M0.jsx)(HS,{children:(0,M0.jsx)(R0,{ref:a,align:t,sideOffset:n,className:v("z-[100000] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...A})}));Hn.displayName=R0.displayName;var pp=w(_(),1);var To=w(I(),1),jK=["#ef4444","#f59e0b","#84cc16","#22c55e","#10b981","#06b6d4","#3b82f6","#a855f7"],gu="#00FF5F";function mu({onChange:e,defaultColor:t,defaultInput:n}){let[A,a]=(0,pp.useState)(n??gu),[o,r]=(0,pp.useState)(t??gu);(0,pp.useEffect)(()=>{r(t||gu),r(n||gu)},[t,n]);let i=u=>/^#[0-9A-F]{6}$/i.test(u),s=u=>{let d=u.target.value;i(d)&&(a(d),r(d),e(d))},c=u=>{a(u),r(u),e(u)};return(0,To.jsxs)("div",{className:"w-full max-w-md mx-auto px-2 py-1",children:[(0,To.jsxs)("div",{className:"relative w-full",children:[(0,To.jsx)(We,{className:"w-full",type:"text",value:A,onChange:s,placeholder:"#00FF5F"}),(0,To.jsx)("div",{className:"absolute flex items-center justify-center top-0 bottom-0 my-auto right-2 h-5 w-5 rounded-sm",style:{backgroundColor:i(A)?A:o},children:(0,To.jsx)("input",{onChange:u=>{i(u.target.value)&&(a(u.target.value),e(u.target.value))},className:"relative cursor-pointer h-[20px] w-[20px] opacity-0",type:"color"})})]}),(0,To.jsx)("div",{className:"grid mt-4 grid-cols-8 gap-2",children:jK.map(u=>(0,To.jsx)("button",{onClick:()=>c(u),className:"w-full aspect-square rounded-sm border border-[1px] border-muted-foreground/25 focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:u},"aria-label":`Select color ${u}`},u))})]})}var Dn=[];for(let e=0;e<256;++e)Dn.push((e+256).toString(16).slice(1));function TS(e,t=0){return(Dn[e[t+0]]+Dn[e[t+1]]+Dn[e[t+2]]+Dn[e[t+3]]+"-"+Dn[e[t+4]]+Dn[e[t+5]]+"-"+Dn[e[t+6]]+Dn[e[t+7]]+"-"+Dn[e[t+8]]+Dn[e[t+9]]+"-"+Dn[e[t+10]]+Dn[e[t+11]]+Dn[e[t+12]]+Dn[e[t+13]]+Dn[e[t+14]]+Dn[e[t+15]]).toLowerCase()}var N0,GK=new Uint8Array(16);function P0(){if(!N0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");N0=crypto.getRandomValues.bind(crypto)}return N0(GK)}var zK=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),j0={randomUUID:zK};function HK(e,t,n){if(j0.randomUUID&&!t&&!e)return j0.randomUUID();e=e||{};let A=e.random??e.rng?.()??P0();if(A.length<16)throw new Error("Random bytes length must be >= 16");if(A[6]=A[6]&15|64,A[8]=A[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let a=0;a<16;++a)t[n+a]=A[a];return t}return TS(A)}var Is=HK;var Ye=w(I(),1),US=({onClose:e,label:t="Label Preview"})=>{let[n,A]=(0,ni.useState)(t),[a,o]=(0,ni.useState)(""),[r,i]=(0,ni.useState)("#00FF5F"),[s,c]=(0,ni.useState)(!1),u=D(p=>p.saveQueryLabel),{toast:d}=zn();(0,ni.useEffect)(()=>{A(t)},[t]),(0,ni.useEffect)(()=>{c(n!==""&&n!=="Label Preview")},[n,r]);let l=()=>{let p={id:Is(),name:n,description:a,color:r};u(p),d({title:`${n} successfully created`}),e&&e(!1)};return(0,Ye.jsxs)(Xr,{children:[(0,Ye.jsxs)(Es,{children:[(0,Ye.jsx)(Qs,{className:"text-lg font-medium",children:"Create label"}),(0,Ye.jsx)(ks,{})]}),(0,Ye.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,Ye.jsx)("div",{className:"flex flex-col gap-2",children:(0,Ye.jsx)("div",{className:"flex items-center w-fit",children:(0,Ye.jsx)(ia,{name:n.trim()!==""?n:"Label preview",color:r})})}),(0,Ye.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Ye.jsx)(Gt,{className:"text-xs border-none font-medium",children:"Name"}),(0,Ye.jsx)(We,{value:n,onChange:p=>A(p.target.value),placeholder:"Name"})]}),(0,Ye.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Ye.jsx)(Gt,{className:"text-xs border-none font-medium",children:"Description"}),(0,Ye.jsx)(We,{value:a,onChange:p=>o(p.target.value),placeholder:"Description (optional)"})]}),(0,Ye.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Ye.jsx)(Gt,{className:"text-xs border-none font-medium",children:"Color"}),(0,Ye.jsxs)(eA,{children:[(0,Ye.jsx)(tA,{asChild:!0,children:(0,Ye.jsxs)(se,{variant:"outline",className:"font-normal",children:[(0,Ye.jsx)(Io,{}),(0,Ye.jsx)("span",{children:r})]})}),(0,Ye.jsx)(Hn,{children:(0,Ye.jsx)(mu,{defaultInput:r,defaultColor:r,onChange:i})})]})]})]}),(0,Ye.jsxs)(ys,{children:[(0,Ye.jsx)(_S,{asChild:!0,children:(0,Ye.jsx)(se,{variant:"outline",children:"Cancel"})}),(0,Ye.jsx)(se,{disabled:!s,onClick:l,children:"Create"})]})]})};var ft=w(I(),1),cb=({setIsOpen:e,setItems:t,selectedItems:n,className:A=""})=>{let a=D(l=>l.savedQueryLabels),o=(0,_s.useRef)(null),[r,i]=(0,_s.useState)(""),[s,c]=(0,_s.useState)(!1),u=l=>{o.current&&!o.current.contains(l.target)&&e(!1)};(0,_s.useEffect)(()=>(document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}),[]);let d=l=>{t(p=>{if(p.some(b=>b.name===l))return p.filter(b=>b.name!==l);{let b=a?.find(B=>B.name===l);if(b)return[...p,b]}return p})};return(0,ft.jsxs)(I0,{ref:o,className:A,children:[(0,ft.jsx)(_0,{value:r,onValueChange:i,className:"w-full",placeholder:"Search labels"}),(0,ft.jsxs)(x0,{className:"rounded-sm",children:[(0,ft.jsx)(D0,{className:"py-2 px-3 my-3 items-center",children:(0,ft.jsx)(ws,{open:s,onOpenChange:c,children:(0,ft.jsxs)("div",{className:"flex flex-col gap-3 w-full items-center",children:[(0,ft.jsx)("p",{className:"text-sm text-neutral-400",children:"No labels found."}),(0,ft.jsx)(lu,{children:(0,ft.jsxs)(se,{className:"font-normal w-full",children:['Create label "',r,'"']})}),(0,ft.jsx)(US,{label:r,onClose:c})]})})}),(0,ft.jsx)(v0,{children:a?.map(l=>{let p=n.some(g=>g.name===l.name);return(0,ft.jsxs)(F0,{value:l.name,onSelect:d,className:"cursor-pointer flex flex-col items-start gap-2",children:[(0,ft.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ft.jsx)(Da,{className:v("transition-opacity",p?"opacity-100":"opacity-0")}),(0,ft.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ft.jsx)("div",{className:"h-3 w-3 rounded-full",style:{backgroundColor:l.color}}),(0,ft.jsx)("span",{children:l.name})]})]}),(0,ft.jsx)("div",{className:"-mt-1 ml-7",children:(0,ft.jsx)("p",{className:"text-xs text-neutral-500",children:l.description})})]},l.id)})})]}),(0,ft.jsx)(se,{className:"border-none text-neutral-500 hover:text-primary hover:bg-background rounded-sm mb-2",variant:"outline",size:"sm",asChild:!0,children:(0,ft.jsxs)("a",{href:"/labels",children:[(0,ft.jsx)(zl,{}),(0,ft.jsx)("span",{children:"Edit labels"})]})})]})};var we=w(I(),1),ub=async({updateActiveRoute:e,updateErrorCause:t,updateQuery:n,updateStamp:A,item:a,context:o})=>{let r;try{r=await fetch("/select-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:o})})}catch(s){console.error(s),e("/error"),t("Failed to request project selection.");return}let i=!1;try{i=await r.json()==="ok"}catch(s){console.error(s)}i?(window.scrollTo(0,0),n(a.query),e("/explore"),A()):(e("/error"),t("Failed to select project."))},ZS=({item:e,handleSelect:t,checked:n})=>{let{toast:A}=zn(),[a,o]=(0,ca.useState)(!1),[r,i]=(0,ca.useState)(""),[s,c]=(0,ca.useState)(""),[u,d]=(0,ca.useState)(!1),[l,p]=(0,ca.useState)(!1),[g,b]=(0,ca.useState)([]),[B,f]=(0,ca.useState)(""),[m,h]=(0,ca.useState)(!1),C=D(M=>M.updateSavedQuery),E=D(M=>M.updateActiveRoute),Q=D(M=>M.updateErrorCause),y=D(M=>M.updateQuery),k=D(M=>M.updateStamp);(0,ca.useEffect)(()=>{i(e.name),c(e.context),f(e.query),b(e.labels??[])},[e]),(0,ca.useEffect)(()=>{h(r!==""&&B!=="")},[r,s,B]);let R=()=>{o(!a)},F=()=>{let M={...e,name:r,context:s,query:B,dateModified:new Date().toISOString(),labels:g};C(M),o(!1),A({title:`${r} saved successfully`})},U=async()=>{await ub({updateActiveRoute:E,updateErrorCause:Q,updateQuery:y,updateStamp:k,item:e,context:e.context})};return(0,we.jsxs)("div",{className:`bg-neutral-50 dark:bg-neutral-950 rounded-sm flex flex-col transition-all border border-[1px] hover:border-foreground/50 group ${a?"border-foreground/50":"border-muted-foreground/25 "}`,children:[(0,we.jsxs)("div",{className:"grid grid-cols-12 gap-4 px-3 py-2",children:[(0,we.jsxs)("div",{className:"col-span-2 flex items-center gap-3 grow",children:[(0,we.jsx)(Ho,{checked:n,onCheckedChange:()=>t(e),className:"border-muted-foreground/25 group-hover:border-muted-foreground/50"}),(0,we.jsx)("p",{className:"truncate text-sm font-medium",children:r.trim()!==""?r:"Query Name"})]}),(0,we.jsx)("div",{className:"flex col-span-4 items-center",children:!a&&(0,we.jsx)("p",{className:"text-sm w-[500px] truncate",children:B})}),(0,we.jsx)("div",{className:"flex col-span-2 items-center gap-2 w-full",children:(0,we.jsx)(Xe,{children:(0,we.jsxs)(et,{children:[(0,we.jsx)(Qt,{className:"text-sm truncate w-full text-left",children:e.context}),(0,we.jsx)(Oe,{children:e.context})]})})}),(0,we.jsx)("div",{className:"flex col-span-2 items-center gap-2",children:g.map((M,ce)=>(0,we.jsx)(ia,{name:M.name,color:M.color},ce))}),(0,we.jsxs)("div",{className:"col-span-2 flex gap-4 items-center justify-end",children:[(0,we.jsx)(se,{variant:"outline",className:"text-sm px-3 rounded-sm border border-[1px] border-muted-foreground/25 h-[2rem]",onClick:R,children:a?"Close":"Edit"}),s.trim()!==""&&(0,we.jsxs)(se,{variant:"outline",className:"text-sm px-3 rounded-sm border border-[1px] border-muted-foreground/25 h-[2rem]",role:"link",onClick:()=>void U(),children:[(0,we.jsx)("span",{children:"Run"}),(0,we.jsx)(xa,{})]})]})]}),a&&(0,we.jsxs)("div",{className:"flex flex-col px-3 py-2 border-t-[1px] border-muted-foreground/25",children:[(0,we.jsxs)("div",{className:"flex gap-3 my-3 mb-6",children:[(0,we.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,we.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Name"}),(0,we.jsx)(We,{type:"text",value:r,onChange:M=>i(M.target.value),placeholder:"Name"})]}),(0,we.jsxs)("div",{className:"flex grow flex-col gap-2",children:[(0,we.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Query"}),(0,we.jsx)(We,{type:"text",placeholder:"Query",value:B,onChange:M=>f(M.target.value),className:"w-full"})]}),(0,we.jsxs)("div",{className:"flex grow flex-col gap-2",children:[(0,we.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Directory"}),(0,we.jsx)(We,{type:"text",value:s,onChange:M=>c(M.target.value),placeholder:"Directory (optional)"})]}),(0,we.jsxs)("div",{className:"flex grow flex-col gap-2",children:[(0,we.jsx)(Gt,{className:"text-sm border-none",children:"Labels"}),(0,we.jsxs)(eA,{open:l,onOpenChange:p,children:[(0,we.jsx)(tA,{asChild:!0,children:(0,we.jsxs)(se,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-full justify-between",children:["Select labels",(0,we.jsx)(ns,{className:"opacity-50"})]})}),(0,we.jsx)(Hn,{className:"p-0",children:(0,we.jsx)(cb,{selectedItems:g,setItems:b,setIsOpen:d})})]})]})]}),(0,we.jsx)("div",{className:"flex justify-end items-end mb-0.5",children:(0,we.jsx)(se,{disabled:!m,onClick:F,variant:"default",size:"sm",children:"Save changes"})})]})]})};var Fe=w(I(),1),qS=()=>{let e=D(f=>f.savedQueries),[t,n]=(0,xs.useState)([]),[A,a]=(0,xs.useState)([]),o=D(f=>f.graph),[r,i]=(0,xs.useState)(!1),[s,c]=(0,xs.useState)(!1),u=D(f=>f.updateActiveRoute),d=D(f=>f.updateErrorCause),l=D(f=>f.updateQuery),p=D(f=>f.updateStamp),g=()=>{if(o){let f=o.projectRoot,m=e?.filter(C=>C.context===f),h=e?.filter(C=>C.context.trim()==="");n(m??[]),a(h??[])}};(0,xs.useEffect)(()=>{g()},[e,o]);let b=async f=>{await ub({updateActiveRoute:u,updateErrorCause:d,updateQuery:l,updateStamp:p,item:f,context:f.context})},B=async f=>{await ub({updateActiveRoute:u,updateErrorCause:d,updateQuery:l,updateStamp:p,item:f,context:o?.projectRoot??""})};return A.length===0&&t.length===0?null:(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(np,{}),(0,Fe.jsxs)(Ap,{children:[(0,Fe.jsx)(n0,{className:"font-medium tracking-wide",children:"Queries"}),A.length!==0&&(0,Fe.jsx)(oa,{children:(0,Fe.jsx)(ap,{open:s,onOpenChange:c,children:(0,Fe.jsxs)(ra,{children:[(0,Fe.jsx)(op,{asChild:!0,children:(0,Fe.jsxs)(fA,{tooltip:"Project queries",className:"whitespace-nowrap",children:[s?(0,Fe.jsx)(zc,{}):(0,Fe.jsx)(Hc,{}),(0,Fe.jsx)("span",{children:"Global"}),s?(0,Fe.jsx)(va,{className:"ml-auto"}):(0,Fe.jsx)(Wa,{className:"ml-auto"})]})}),(0,Fe.jsx)(rp,{children:(0,Fe.jsx)(cu,{children:A.map((f,m)=>(0,Fe.jsx)(Wf,{children:(0,Fe.jsx)(Jf,{className:"cursor-pointer whitespace-nowrap truncate",onClick:()=>void B(f),children:f.name})},m))})})]})})}),t.length!==0&&(0,Fe.jsx)(oa,{children:(0,Fe.jsx)(ap,{open:r,onOpenChange:i,children:(0,Fe.jsxs)(ra,{children:[(0,Fe.jsx)(op,{asChild:!0,children:(0,Fe.jsxs)(fA,{tooltip:"Project queries",className:"whitespace-nowrap",children:[r?(0,Fe.jsx)(zc,{}):(0,Fe.jsx)(Hc,{}),(0,Fe.jsx)("span",{children:"Project"}),r?(0,Fe.jsx)(va,{className:"ml-auto"}):(0,Fe.jsx)(Wa,{className:"ml-auto"})]})}),(0,Fe.jsx)(rp,{children:(0,Fe.jsx)(cu,{children:t.map((f,m)=>(0,Fe.jsx)(Wf,{children:(0,Fe.jsx)(Jf,{className:"cursor-pointer whitespace-nowrap truncate",onClick:()=>void b(f),children:f.name})},m))})})]})})})]})]})};var Ai=w(I(),1),OS=()=>{let{toggleSidebar:e}=su();return(0,Ai.jsx)(Xe,{children:(0,Ai.jsxs)(et,{children:[(0,Ai.jsx)(Qt,{asChild:!0,children:(0,Ai.jsx)(fA,{role:"button",onClick:e,className:"w-fit",children:(0,Ai.jsx)(Va,{})})}),(0,Ai.jsx)(Oe,{align:"start",side:"right",children:"toggle sidebar"})]})})};var ua=w(I(),1),YS=()=>(0,ua.jsxs)(e0,{children:[(0,ua.jsx)(oa,{children:(0,ua.jsx)(ra,{children:(0,ua.jsx)(fA,{asChild:!0,children:(0,ua.jsxs)("a",{href:"https://docs.vlt.sh",target:"_blank",children:[(0,ua.jsx)(Rl,{}),(0,ua.jsx)("span",{children:"Documentation"}),(0,ua.jsx)(ts,{className:"ml-auto"})]})})})}),(0,ua.jsx)(np,{}),(0,ua.jsx)(OS,{})]});var da=w(I(),1),KS=(()=>{let e=document.cookie.split("; ").find(n=>n.startsWith("sidebar:state=")),[,t]=e?.split("=")??[];return t==="true"})();function WS(){return(0,da.jsxs)(Jy,{collapsible:"icon",children:[(0,da.jsx)(Xy,{children:(0,da.jsx)(J2,{})}),(0,da.jsxs)(t0,{children:[(0,da.jsxs)(Ap,{className:"gap-1",children:[(0,da.jsx)(W2,{}),(0,da.jsx)(V2,{})]}),(0,da.jsx)(qS,{})]}),(0,da.jsx)(YS,{}),(0,da.jsx)(Vy,{})]})}var ix=w(_(),1);var G0=(e,t,n,A,a=t)=>{let o=new e(n,A?{cause:A}:void 0);return Error.captureStackTrace?.(o,a),o},ie=(e,t,n)=>G0(Error,ie,e,t,n),gp=(e,t,n)=>G0(TypeError,gp,e,t,n),fu=(e,t,n)=>G0(SyntaxError,fu,e,t,n);var IL=w(AL(),1);var yb=e=>"type"in e&&"nodes"in e,Na=e=>{if(!e)throw ie("Expected a query node");if(!yb(e))throw ie("Not a query selector node with children",{found:e});return e},Cu=e=>!!e&&typeof e=="object",NX=e=>Cu(e)&&!!e.attribute&&e.type==="attribute",Qb=e=>{if(!e)throw ie("Expected a query node");if(!NX(e))throw ie("Mismatching query node",{wanted:"attribute",found:e.type});return e},PX=e=>Cu(e)&&!!e.value&&e.type==="class",aL=e=>{if(!e)throw ie("Expected a query node");if(!PX(e))throw ie("Mismatching query node",{wanted:"class",found:e.type});return e},jX=e=>Cu(e)&&!!e.value&&e.type==="combinator",oL=e=>{if(!e)throw ie("Expected a query node");if(!jX(e))throw ie("Mismatching query node",{wanted:"combinator",found:e.type});return e},GX=e=>Cu(e)&&!!e.value&&e.type==="id",rL=e=>{if(!e)throw ie("Expected a query node");if(!GX(e))throw ie("Mismatching query node",{wanted:"id",found:e.type});return e},wu=e=>yb(e)&&e.type==="selector",zX=e=>Cu(e)&&!!e.value&&e.type==="pseudo",iL=e=>{if(!e)throw ie("Expected a query node");if(!zX(e))throw ie("Mismatching query node",{wanted:"pseudo",found:e.type});return e},HX=e=>Cu(e)&&!!e.value&&e.type==="tag",RQ=e=>{if(!e)throw ie("Expected a query node");if(!HX(e))throw ie("Mismatching query node",{wanted:"tag",found:e.type});return e};var kb=e=>String(e),$X=(e,t,n)=>{if(!e.manifest)return;let A=new Set([e.manifest]),a=new Set;for(let r of t)for(let i of A){if(!i)throw ie("failed to find nested property in :attr",{found:t});if(Array.isArray(i)){for(let s of i)A.add(s);continue}if(!(typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&r in i){let s=i[r];s&&(r===n?a.add(s):(A.delete(i),A.add(s)))}}if(!a.size)return;let o=new Set;for(let r of a)if(Array.isArray(r))for(let i of r)o.add(i?kb(i):"");else o.add(kb(r));return[...o]},Pp=(e,t,n,A,a,o=[])=>{let r=s=>t?.(a?kb(s).toLowerCase():kb(s),a?n.toLowerCase():n),i=s=>{for(let c of s.edgesIn)e.partial.edges.delete(c);e.partial.nodes.delete(s)};for(let s of e.partial.nodes){let c=o.length?o:[A],u=$X(s,c,A);if(!u?.length){i(s);continue}t&&!u.some(r)&&i(s)}for(let s of e.partial.edges)A==="name"&&r(s.name)||s.to||e.partial.edges.delete(s);return e},TX={"=":(e,t="")=>e===t,"^=":(e,t="")=>e.startsWith(t),"$=":(e,t="")=>e.endsWith(t),"~=":(e,t="")=>new Set(e.match(/\w+/g)).has(t),"*=":(e,t="")=>e.includes(t),"|=":(e,t="")=>e===t||e.startsWith(`${t}-`),undefined:e=>!!e},jp=new Map(Object.entries(TX)),sL=async e=>{let t=Qb(e.current),n=jp.get(String(t.operator));if(!n){if(e.loose)return e;throw new Error(`Unsupported attribute operator: ${t.operator}`)}let A=t.value||"",a=t.attribute,o=!!t.insensitive;return Pp(e,n,A,a,o)};var UX={prod:async e=>{for(let t of e.partial.edges)(t.type!=="prod"||t.from.dev)&&e.partial.edges.delete(t);for(let t of e.partial.nodes){if(!t.edgesIn.size){e.partial.nodes.delete(t);continue}let n=new Set(t.edgesIn);for(let A of n)e.partial.edges.has(A)||n.delete(A);n.size||e.partial.nodes.delete(t)}return e},dev:async e=>{for(let t of e.partial.edges)t.type!=="dev"&&!t.from.dev&&e.partial.edges.delete(t);for(let t of e.partial.nodes){if(!t.edgesIn.size){e.partial.nodes.delete(t);continue}let n=new Set(t.edgesIn);for(let A of n)e.partial.edges.has(A)||n.delete(A);n.size||e.partial.nodes.delete(t)}return e},optional:async e=>{for(let t of e.partial.edges)t.type!=="optional"&&!t.from.optional&&e.partial.edges.delete(t);for(let t of e.partial.nodes){if(!t.edgesIn.size){e.partial.nodes.delete(t);continue}let n=new Set(t.edgesIn);for(let A of n)e.partial.edges.has(A)||n.delete(A);n.size||e.partial.nodes.delete(t)}return e},peer:async e=>{for(let t of e.partial.edges)t.type!=="peer"&&e.partial.edges.delete(t);for(let t of e.partial.nodes){if(!t.edgesIn.size){e.partial.nodes.delete(t);continue}for(let n of t.edgesIn)e.partial.edges.has(n)||e.partial.nodes.delete(t)}return e},workspace:async e=>{for(let t of e.partial.nodes)(!t.importer||t.mainImporter)&&e.partial.nodes.delete(t);for(let t of e.partial.edges)t.to&&e.partial.nodes.has(t.to)||e.partial.edges.delete(t);return e}},ZX=new Map(Object.entries(UX)),cL=async e=>{let t=aL(e.current),n=t.value&&ZX.get(t.value);if(!n){if(e.loose)return e;throw new Error(`Unsupported class: ${e.current.value}`)}return n(e)};var qX=async e=>{let t=new Set(e.partial.nodes);e.partial.edges.clear(),e.partial.nodes.clear();for(let n of t)for(let A of n.edgesOut.values())A.to&&(e.partial.edges.add(A),e.partial.nodes.add(A.to));return e},OX=async e=>{let t=new Set(e.partial.nodes);e.partial.edges.clear(),e.partial.nodes.clear();for(let n of t)for(let A of n.edgesIn){let a=A.from.edgesOut.values();for(let o of a)o.to&&o.to!==n&&(e.partial.edges.add(o),e.partial.nodes.add(o.to))}return e},YX=async e=>{if(e.prev?.type==="tag"||e.next?.type==="tag")return e;let t=new Set(e.partial.nodes);e.partial.edges.clear(),e.partial.nodes.clear();for(let n of t){let A=new Set;for(let a of n.edgesOut.values())a.to&&(A.add(a.to),e.partial.edges.add(a),e.partial.nodes.add(a.to));for(let a of A)t.add(a)}return e},KX={">":qX,"~":OX," ":YX},WX=new Map(Object.entries(KX)),uL=async e=>{let t=oL(e.current),n=t.value&&WX.get(t.value);if(!n){if(e.loose)return e;throw new Error(`Unsupported combinator: ${e.current.value}`)}return n(e)};var dL=async e=>{let{value:t}=rL(e.current),n=jp.get("=");if(!t)throw ie("Missing identifier name");if(!n)throw ie("Could not find attribute selector comparator");return Pp(e,n,t,"name",!0)};function Pa(e,t,n=-1,A){let a=0,o=0,r=t.length,i=[];for(;a!==-1;){a=e.indexOf(t,o);let s=a===-1||i.length===n-1?e.substring(o):e.substring(o,a);if(i.push(A?.(s,i,a)??s),i.length===n)return i;o=a+r}return i}var lL=e=>{if(!/^[0-9]+$/.test(e))return e;let t=Number(e);return t<=Number.MAX_SAFE_INTEGER?t:e},MQ=(e,t,n)=>{let A=Number(e);if(A>Number.MAX_SAFE_INTEGER)throw Eu(t,`invalid ${n}, must be <= ${Number.MAX_SAFE_INTEGER}`);return A},NQ={prefix:/^[ v=]+/,main:/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)/,prerelease:/-([0-9a-zA-Z_.-]+)(?:$|\+)/,build:/\+([0-9a-zA-Z_.-]+)$/,full:/^[ v=]*(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9a-zA-Z_.-]+))?(?:\+([0-9a-zA-Z_.-]+))?$/},Eu=(e,t)=>fu(`invalid version: ${t}`,{version:e},at),at=class e{raw;major;minor;patch;prerelease;build;toString(){return`${this.major}.${this.minor}.${this.patch}${this.prerelease?"-"+this.prerelease.join("."):""}${this.build?"+"+this.build.join("."):""}`}static parse(t){if(t=t.replace(NQ.prefix,"").trim(),t.length>256)throw Eu(t,"must be less than 256 characters");let n=t.match(NQ.full);if(!n)throw t.match(NQ.main)?Eu(t,"invalid build or patch section"):Eu(t,"no Major.minor.patch tuple present");let[A,a,o,r,i,s]=n,c=MQ(a,t,"major"),u=MQ(o,t,"minor"),d=MQ(r,t,"patch");return new e(t,c,u,d,i,s)}constructor(t,n,A,a,o,r){this.raw=t,this.major=n,this.minor=A,this.patch=a,o&&(this.prerelease=Pa(o,".",-1,i=>{if(!i)throw Eu(t,"invalid prerelease, empty identifiers not allowed");return lL(i)})),r&&(this.build=Pa(r,".",-1,i=>{if(!i)throw Eu(t,"invalid build metadata, empty identifiers not allowed")}))}compare(t){if(this.major>t.major)return 1;if(this.major<t.major)return-1;if(this.minor>t.minor)return 1;if(this.minor<t.minor)return-1;if(this.patch>t.patch)return 1;if(this.patch<t.patch)return-1;if(!t.prerelease?.length)return this.prerelease?.length?-1:0;if(!this.prerelease?.length)return 1;let n=Math.max(this.prerelease.length,t.prerelease.length),A=this.prerelease,a=t.prerelease;for(let o=0;o<n;o++){let r=A[o],i=a[o];if(r!==i)return i===void 0?1:r===void 0?-1:typeof r!=typeof i?typeof r=="string"?1:-1:r>i?1:-1}return 0}rcompare(t){return-1*this.compare(t)}greaterThan(t){return this.compare(t)===1}greaterThanEqual(t){return this.compare(t)>-1}lessThan(t){return this.compare(t)===-1}lessThanEqual(t){return this.compare(t)<1}equals(t){return this.compare(t)===0}tupleEquals(t){return this.major===t.major&&this.minor===t.minor&&this.patch===t.patch}satisfies(t){return t.test(this)}inc(t,n){switch(t){case"premajor":this.prerelease=void 0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n);break;case"preminor":this.prerelease=void 0,this.patch=0,this.minor++,this.inc("pre",n);break;case"prepatch":this.prerelease=void 0,this.inc("patch"),this.inc("pre",n);break;case"prerelease":this.prerelease?.length||this.inc("patch",n),this.inc("pre",n);break;case"pre":{if(!n){if(!this.prerelease?.length){this.prerelease=[0];break}let o=this.prerelease[this.prerelease.length-1];typeof o=="number"?this.prerelease[this.prerelease.length-1]=o+1:this.prerelease.push(0);break}if(!this.prerelease?.length){this.prerelease=[n];break}let A=this.prerelease.indexOf(lL(n));if(A===-1){this.prerelease=[n];break}let a=this.prerelease[A+1];if(typeof a=="number"){this.prerelease[A+1]=a+1;break}if(A===this.prerelease.length-1){this.prerelease.push(0);break}this.prerelease.splice(A+1,0,0);break}case"major":(!this.prerelease?.length||this.minor||this.patch)&&this.major++,this.prerelease=void 0,this.patch=0,this.minor=0;break;case"minor":(!this.prerelease?.length||this.patch)&&this.minor++,this.prerelease=void 0,this.patch=0;break;case"patch":this.prerelease?.length||this.patch++,this.prerelease=void 0;break;default:throw gp("Invalid increment identifier",{version:this,found:t,validOptions:["major","minor","patch","premajor","preminor","prepatch","prerelease","pre"]},this.inc)}return this.raw=this.toString(),this}};var JX=e=>!!e&&(e===">"||e==="<"||e===">="||e==="<="||e===""||e==="~"||e==="^"||e==="~>"),VX=new Set("=v "),Fn=(e,t)=>fu(`invalid comparator: '${e}' ${t}`,{found:e},Hp),nA=(e,t,n)=>{let A=Number(e);if(A!==A)throw Fn(t,`${n} must be numeric or 'x', got: '${e}'`);return A},Fs=(e,t)=>{if(!e)throw Fn(t,"no value provided for operator")},PQ=(e,t,n)=>{if(e&&!zp(e))throw Fn(t,`cannot omit '${n}' and include subsequent fields`)},Ao=0,yu=1,mL=2,zp=e=>!e||e==="X"||e==="x"||e==="*",jQ=e=>e[mL]!==void 0,Ib=e=>e[yu]!==void 0&&e[mL]===void 0,_b=e=>e[Ao]!==void 0&&e[yu]===void 0,pL=e=>e[Ao]===void 0,Hp=class{includePrerelease;raw;tokens;tuples=[];isNone=!1;isAny=!1;toString(){return this.isNone?"<0.0.0-0":this.isAny?"*":this.tuples.map(t=>Gp(t)?"*":t.join("")).join(" ")}constructor(t,n=!1){this.includePrerelease=n,t=t.trim(),this.raw=t;let A=!1,a=Pa(t," ",-1,(s,c,u)=>{if(s==="-"){if(A)throw Fn(t,"multiple hyphen ranges not allowed");if(c.length!==1||u===-1)throw Fn(t,"hyphen must be between two versions");A=!0}else if(A&&c.length!==2)throw Fn(t,"hyphen range must be alone")}),o=[],r=!1,i=0;for(let s of a)if(s!==""){if(!r){r=JX(s),o.push(s),i++;continue}o[i-1]+=s,r=!1}if(A){let[s,c,u]=o;if(!s||!u)throw Fn(t,"hyphen must be between two versions");this.#g(s,u)}else if(!o.length||o.length===1&&zp(o[0]))this.tuples.push(this.#a());else for(let s of o)if(this.#m(s),this.isNone)break;this.tokens=o,this.isAny=!0;for(let s of this.tuples)if(Array.isArray(s)||!s.isAny){this.isAny=!1;break}}#e(t){let n=this.includePrerelease?"0":void 0,[A,a=0,o=0,r=n,i]=this.#A(t);return A===void 0?this.#a():[">=",new at(t,A,a,o,r,i)]}#t(t){let n=this.#A(t);if(jQ(n))return[">",new at(t,...n)];let A=this.includePrerelease?"0":void 0;return Ib(n)?[">=",new at(t,n[Ao],n[yu]+1,0,A,void 0)]:_b(n)?[">=",new at(t,n[Ao]+1,0,0,A,void 0)]:(this.isNone=!0,this.tuples.length=0,gL)}#o(t){let n=this.#A(t);return jQ(n)?["<=",new at(t,...n)]:Ib(n)?["<",new at(t,n[Ao],n[yu]+1,0,"0",void 0)]:_b(n)?["<",new at(t,n[Ao]+1,0,0,"0",void 0)]:this.#a()}#r(t){let n=this.includePrerelease?"0":void 0,[A=0,a=0,o=0,r=n,i]=this.#A(t);return A===0&&a===0&&o===0&&r==="0"?(this.isNone=!0,this.tuples.length=0,gL):["<",new at(t,A,a,o,r,i)]}#i(t,n,A){if(PQ(n,t,"major"),PQ(A,t,"major"),n===""||A==="")throw Fn(t,"(Did you mean '*'?)");return[]}#s(t,n,A,a){if(PQ(a,t,"major"),A===""||a==="")throw Fn(t,`(Did you mean '${n}'?)`);return[nA(n,t,"major")]}#n(t,n,A,a){if(a==="")throw Fn(t,`(Did you mean '${n}.${A}'?)`);return[nA(n,t,"major"),nA(A,t,"minor")]}#c(t,n,A,a){return[nA(n,t,"major"),nA(A,t,"minor"),nA(a,t,"patch")]}#d(t,n,A,a,o){let r=a.substring(0,o),i=a.substring(o+1);if(!r)throw Fn(t,"cannot specify build without patch");if(!i)throw Fn(t,"encountered '+', but no build value");return[nA(n,t,"major"),nA(A,t,"minor"),nA(r,t,"patch"),void 0,i]}#l(t,n,A,a,o){{let r=a.substring(0,o),i=a.substring(o+1);if(!r)throw Fn(t,"cannot specify prerelease without patch");if(!i)throw Fn(t,"encountered '-', but no prerelease value");return[nA(n,t,"major"),nA(A,t,"minor"),nA(r,t,"patch"),i,void 0]}}#p(t,n,A,a,o,r){let i=a.substring(0,o),s=a.substring(o+1,r),c=a.substring(r+1);if(!i)throw Fn(t,"cannot specify prerelease without patch");if(!s)throw Fn(t,"encountered '-', but no prerelease value");if(!c)throw Fn(t,"encountered '+', but no build value");return[nA(n,t,"major"),nA(A,t,"minor"),nA(i,t,"patch"),s,c]}#A(t){let[n,A,a]=Pa(t,".",3),o=0;for(;n&&VX.has(n.charAt(o));)o++;if(n!==void 0&&o!==0&&(n=n.substring(o)),!n||zp(n))return this.#i(t,A,a);if(!A||zp(A))return this.#s(t,n,A,a);if(!a||zp(a))return this.#n(t,n,A,a);let r=a.indexOf("-"),i=a.indexOf("+");return i===-1&&r===-1?this.#c(t,n,A,a):i===-1?this.#l(t,n,A,a,r):r===-1?this.#d(t,n,A,a,i):this.#p(t,n,A,a,r,i)}#g(t,n){let A=this.#e(t),a=this.#o(n),o=Gp(A),r=Gp(a);o&&r?this.tuples.push(this.#a()):o?this.tuples.push(a):r?this.tuples.push(A):this.tuples.push(A,a)}#m(t){let n=t.charAt(0),A=t.substring(0,2),a=t.substring(1),o=t.substring(2);switch(A){case"~>":return Fs(o,t),this.#u(o);case">=":return Fs(o,t),this.tuples.push(this.#e(o));case"<=":return Fs(o,t),this.tuples.push(this.#o(o))}switch(n){case"~":return Fs(a,t),this.#u(a);case"^":return Fs(a,t),this.#f(a);case">":return Fs(a,t),this.tuples.push(this.#t(a));case"<":return Fs(a,t),this.tuples.push(this.#r(a))}return this.#b(t)}#u(t){let n=this.#A(t);if(pL(n)){this.tuples.push(this.#a());return}let A=this.includePrerelease?"0":void 0;if(_b(n)){let[c]=n;this.tuples.push([">=",new at(t,c,0,0,A,void 0)],["<",new at(t,c+1,0,0,"0",void 0)]);return}if(Ib(n)){let[c,u]=n,d=this.includePrerelease?"0":void 0;this.tuples.push([">=",new at(t,c,u,0,d,void 0)],["<",new at(t,c,u+1,0,"0",void 0)]);return}let[a,o,r,i=A,s]=n;this.tuples.push([">=",new at(t,a,o,r,i,s)],["<",new at(t,a,o+1,0,"0",s)])}#f(t){let n=this.#e(t);if(Gp(n)){this.tuples.push(n);return}let A=n[1];A.major!==0?this.tuples.push(n,["<",new at(t,A.major+1,0,0,"0",void 0)]):A.minor!==0?this.tuples.push(n,["<",new at(t,A.major,A.minor+1,0,"0",void 0)]):A.prerelease?.length?this.tuples.push(n,["<",new at(t,A.major,A.minor,A.patch+1,"0",void 0)]):this.tuples.push(["",A])}#b(t){let n=this.#A(t),A=this.includePrerelease?"0":void 0;jQ(n)?this.tuples.push(["",new at(t,...n)]):pL(n)?this.tuples.push(this.#a()):_b(n)?(this.tuples.push([">=",new at(t,n[Ao],0,0,A,void 0)]),this.tuples.push(["<",new at(t,n[Ao]+1,0,0,"0",void 0)])):Ib(n)&&this.tuples.push([">=",new at(t,n[Ao],n[yu],0,A,void 0)],["<",new at(t,n[Ao],n[yu]+1,0,"0",void 0)])}test(t){if(this.isNone)return!1;let n=this.includePrerelease,A=!!t.prerelease?.length,a=n||!A;for(let o of this.tuples){if(Gp(o))continue;let[r,i]=o;switch(a||=!!i.prerelease?.length&&t.tupleEquals(i),r){case"":if(!t.equals(i))return!1;continue;case">":if(!t.greaterThan(i))return!1;continue;case">=":if(!t.greaterThanEqual(i))return!1;continue;case"<":if(!t.lessThan(i))return!1;continue;case"<=":if(!t.lessThanEqual(i))return!1;continue}}return a}#a(){return this.includePrerelease?bL:fL}},Gp=e=>e===fL||e===bL,fL={isAny:!0,toString:()=>"*",includePrerelease:!1,test:e=>!e.prerelease?.length},bL={isAny:!0,toString:()=>"*",includePrerelease:!0,test:e=>!0},gL={isNone:!0,toString:()=>"<0.0.0-0",includePrerelease:!1,test:e=>!1};var xb=class{raw;isAny;isSingle;set=[];includePrerelease;#e;constructor(t,n=!1){this.raw=t,this.includePrerelease=n,this.isAny=!1;let A=!0;this.isSingle=!1,Pa(t,"||",-1,a=>{if(this.isAny)return;let o=new Hp(a,this.includePrerelease);if(o.isAny){this.set=[o],this.isAny=!0;return}this.set.push(o),A?Array.isArray(o.tuples)&&o.tuples.length===1&&Array.isArray(o.tuples[0])&&o.tuples[0][0]===""&&(this.isSingle=!0):this.isSingle=!1,A=!1})}test(t){return this.set.some(n=>n.test(t))}toString(){return this.#e?this.#e:this.isSingle?(this.#e=String(this.set[0]),this.#e):(this.#e=this.set.map(t=>String(t)).join(" || "),this.#e)}};var Db=(e,t=!1)=>{if(typeof e=="object"){if(e.includePrerelease===t)return e;e=e.raw}try{return new xb(e,t)}catch{return}};var XX=Symbol.for("nodejs.util.inspect.custom"),GQ="https://registry.npmjs.org/",vb={npm:"https://registry.npmjs.org/"},Fb={github:"git+ssh://git@github.com:$1/$2.git",bitbucket:"git+ssh://git@bitbucket.org:$1/$2.git",gitlab:"git+ssh://git@gitlab.com:$1/$2.git",gist:"git+ssh://git@gist.github.com/$1.git"},Sb={github:"https://codeload.github.com/$1/$2/tar.gz/$committish",bitbucket:"https://bitbucket.org/$1/$2/get/$committish.tar.gz",gist:"https://codeload.github.com/gist/$1/tar.gz/$committish",gitlab:"https://gitlab.com/$1/$2/repository/archive.tar.gz?ref=$committish"},eee={github:"https://github.com/",bitbucket:"https://bitbucket.org/",gist:"https://gist.github.com/",gitlab:"https://gitlab.com/"},wL={},hL=e=>({...e,registry:e?.registry??GQ,"scope-registries":e?.["scope-registries"]??{},"git-hosts":e?.["git-hosts"]?{...Fb,...e["git-hosts"]}:Fb,registries:e?.registries?{...vb,...e.registries}:vb,"git-host-archives":e?.["git-host-archives"]?{...Sb,...e["git-host-archives"]}:Sb}),tee=(e,t)=>e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("file:")||e.startsWith("http:")||e.startsWith("https:")||e.startsWith("workspace:")||e.startsWith("git@")||e.startsWith("git://")||e.startsWith("git+ssh://")||e.startsWith("git+http://")||e.startsWith("git+https://")||e.startsWith("git+file://")||e.startsWith("git@github.com")||e.startsWith("registry:")||[...Object.keys(t["git-hosts"]),...Object.keys(t.registries)].some(n=>e.startsWith(`${n}:`)),BL=(e,t)=>e.indexOf("@",t?1:0),nee=e=>e.indexOf("#")>2,Aee=e=>e.includes("/"),Ut=class{static parse(t,n,A){return typeof t=="object"?t:new this(t,n,A)}static parseArgs(t,n){let A=hL(n??{});if(tee(t,A)){let a=this.parse("(unknown)",t,A);return a.subspec&&(a.name=a.subspec.name,a.spec=`${a.name}@${a.bareSpec}`),a}else{let a=t.startsWith("@"),o=BL(t,a);return o>-1?this.parse(t.substring(0,o),t.substring(o+1),A):nee(t)||!a&&Aee(t)?this.parse("(unknown)",t,A):this.parse(`${t}@`,A)}}static nodejsDependencies;type;spec;options;name;scope;scopeRegistry;bareSpec;gitRemote;gitSelector;gitSelectorParsed;gitCommittish;namedGitHost;namedGitHostPath;workspaceSpec;workspace;namedRegistry;registry;registrySpec;conventionalRegistryTarball;semver;range;distTag;remoteURL;file;subspec;#e;#t;get final(){return this.#e?this.#e:this.#e=this.subspec?this.subspec.final:this}toString(){if(this.#t!==void 0)return this.#t;let t=this;for(;t.subspec?.subspec;)t=t.subspec;return t.subspec&&t.subspec.type!=="registry"&&(t=t.subspec),this.#t=this.name+"@"+t.bareSpec}constructor(t,n,A={}){if(n&&typeof n=="object"&&(A=n,n=void 0),this.options=hL(A),typeof n=="string")this.name=t,this.#o(t),this.bareSpec=n,this.spec=`${this.name}@${n}`;else{this.spec=t;let u=t.startsWith("@"),d=BL(t,u);d===-1&&(d=t.length,t+="@"),this.name=t.substring(0,d),u&&this.#o(this.name),this.bareSpec=t.substring(d+1)}if(this.bareSpec.startsWith("https://")){for(let[u,d]of Object.entries(eee))if(this.bareSpec.startsWith(d)){let l=new URL(this.bareSpec),[p,g]=l.pathname.replace(/\.git$/,"").replace(/\/+/g," ").trim().split(" ");if(p&&g){this.bareSpec=`${u}:${p}/${g}${l.hash}`,this.spec=`${this.name}@${this.bareSpec}`;break}}}if(this.bareSpec.startsWith("workspace:")){this.type="workspace";let u=this.bareSpec.substring(10).trim(),d=u.lastIndexOf("@");if(d===-1)this.workspace=this.name;else{let g=u.substring(0,d);if(!g||g==="*"||g==="~"||g==="^"||(g.startsWith("@")?g.split("/").length!==2||g.substring(1).includes("@"):g.includes("@")))throw this.#n("workspace: name must be a path or valid package name",{found:g});this.workspace=g}let l=d===-1?u:u.substring(d+1)||"*",p=l==="*"?void 0:Db(l);if(l!=="*"&&l!=="~"&&l!=="^"&&!p)throw this.#n("workspace: spec must be one of *, ~, or ^, or a valid semver range",{found:l,wanted:"'*'|'~'|'^'|SemverRange"});this.workspaceSpec=l,p&&(this.semver=l,this.range=p);return}if(this.bareSpec.startsWith("git://")||this.bareSpec.startsWith("git+ssh://")||this.bareSpec.startsWith("git+http://")||this.bareSpec.startsWith("git+https://")||this.bareSpec.startsWith("git+file://")||this.bareSpec.startsWith("git@github.com")){this.bareSpec.startsWith("git@")&&(this.bareSpec=`git+ssh://${this.bareSpec}`,this.spec=`${this.name}@${this.bareSpec}`),this.type="git";for(let[u,d]of Object.entries(this.options["git-hosts"])){let l=d.indexOf("$");if(l>0&&this.bareSpec.startsWith(d.substring(0,l))){let p=this.bareSpec.substring(l).replace(/\.git(#.*)?$/,"$1");this.bareSpec=`${u}:${p}`,this.spec=`${this.name}@${this.bareSpec}`,this.#r(u,d),this.type="git";return}}this.#c(this.bareSpec);return}let a=Object.entries(this.options["git-hosts"]);for(let[u,d]of a)if(this.#r(u,d)){this.type="git";return}if(this.bareSpec.startsWith("registry:")){let u=this.bareSpec.substring(9),d=u.indexOf("#");if(d===-1)throw this.#n("registry: must include name/version");this.type="registry";let l=u.substring(0,d);l.endsWith("/")||(l+="/");let p=u.substring(d+1);for(let[g,b]of Object.entries(this.options.registries))b.endsWith("/")||(b+="/",this.options.registries[g]=b),b===l&&(this.namedRegistry=g);this.#s(p,l),this.#i();return}let o=Object.entries(this.options.registries);for(let[u,d]of o){let l=`${u}:`;if(this.bareSpec.startsWith(l)){this.type="registry",this.namedRegistry=u,this.#s(this.bareSpec.substring(l.length),d).namedRegistry??=u,this.#i();return}}if(this.bareSpec.startsWith("https://")||this.bareSpec.startsWith("http://")){this.remoteURL=this.bareSpec,this.type="remote";return}if(this.bareSpec.startsWith("file:")){this.type="file";let[u,d]=CL(this.constructor.nodejsDependencies)(this.bareSpec,this);this.file=u,this.bareSpec=d.replace(/\/+$/,""),this.spec=`${this.name}@${this.bareSpec}`;return}if(!this.bareSpec.startsWith("./")&&!this.bareSpec.startsWith("../")&&this.options["git-hosts"].github){let u=this.bareSpec.indexOf("#");if((u===-1?this.bareSpec:this.bareSpec.substring(0,u)).split("/").length===2){this.bareSpec=`github:${this.bareSpec}`,this.spec=`${this.name}@${this.bareSpec}`,this.#r("github",this.options["git-hosts"].github),this.type="git";return}}if(this.bareSpec.includes("/")||this.bareSpec==="."||this.bareSpec===".."){this.type="file";let[u,d]=CL(this.constructor.nodejsDependencies)(`file:${this.bareSpec}`,this);this.bareSpec=d,this.spec=`${this.name}@${this.bareSpec}`,this.file=u;return}this.type="registry";let r=Db(this.bareSpec);r?(this.semver=this.bareSpec.trim(),this.range=r):this.distTag=this.bareSpec,this.registrySpec=this.bareSpec;let{"scope-registries":i,registry:s}=this.options,c=this.scope&&i[this.scope];this.registry=c??s,this.#i()}#o(t){if(!t.startsWith("@"))return;let n=t.indexOf("/");if(n>1&&n<t.length-1){let A=t.substring(0,n);this.registry=this.scopeRegistry=this.options["scope-registries"][A],this.scope=A}}#r(t,n){if(this.bareSpec.startsWith(`${t}:`)){let A=this.bareSpec.indexOf("#"),a=A===-1?this.bareSpec:this.bareSpec.substring(0,A),o=A===-1?"":this.bareSpec.substring(A),r=a.substring(t.length+1);if(!r)throw ie("invalid named git host specifier",{spec:this});let i=r.split("/"),s=n;for(let c=0;c<i.length;c++)s=s.split(`$${c+1}`).join(i[c]);if(s+=o,this.namedGitHost=t,this.namedGitHostPath=r,this.#c(s),this.gitCommittish&&!this.gitSelectorParsed?.path){let c=this.options["git-host-archives"][t];if(c){this.type="remote";let u=c;u=u.split("$committish").join(this.gitCommittish);for(let d=0;d<i.length;d++)u=u.split(`$${d+1}`).join(i[d]);this.remoteURL=u}}return!0}return!1}[XX](){return`@vltpkg/spec.Spec ${String(this)}`}#i(){let{name:t,registry:n,range:A}=this.final;if(!n||!A?.isSingle)return;let a=/^@[^/]+\//;this.conventionalRegistryTarball=String(new URL(`/${t}/-/${t.replace(a,"")}-${A}.tgz`,n))}#s(t,n){return this.registry=n,this.subspec=this.constructor.parse(t,{...this.options,registry:n}),this.subspec}#n(t,n={}){return ie(t,{spec:this.spec,...n},this.#n)}#c(t){let n=t.indexOf("#");if(n===-1){this.gitRemote=t;return}this.gitRemote=t.substring(0,n),this.gitSelector=t.substring(n+1);let[A,a,o]=this.constructor.parseGitSelector(this.gitSelector,this);this.range=o,this.gitCommittish=a,this.gitSelectorParsed=A}static parseGitSelector(t,n){if(!t)return[{}];let A=t.split("::"),a=A[0],o,r,i={};if(typeof a!="string")throw gp("impossible",{found:a,wanted:String});a.includes(":")||(o=a,A.shift());for(let s of A){let c=s.indexOf(":");if(c===-1)continue;let u=s.substring(0,c),d=s.substring(c+1);if(u==="semver"){if(o)throw ie("Cannot specify a semver range and committish value",{spec:n});if(r=Db(d),!r)throw ie(`Invalid git tag semver range: ${d}`,{spec:n})}if(u==="semver"||u==="path")if(u==="path"){if(this.nodejsDependencies?.isAbsolute(d)||/(^|\/|\\)\.\.($|\\|\/)/.test(d))throw ie("Invalid path in git selector",{spec:n});i.path=(this.nodejsDependencies?this.nodejsDependencies.join("/",d).substring(1):d).replace(/\\/g,"/")}else i[u]=d}return[i,o,r]}},CL=e=>(t,n)=>{let A=t.substring(5,7),a=`file:${A==="//"?A:""}`,o=t.substring(a.length),[r="",i="/",s="/",c="/"]=o.split("",4);if(!r)return[".","file:."];if(r==="/"&&i==="~"&&s!=="/"||r==="~"&&i!=="/")throw ie("invalid file: specifier. '~username' not supported",{spec:n});if(r==="~")return e?[e.resolve(e.homedir(),o.substring(2)),`file:${o}`]:[o,`file:${o}`];if(r==="/"&&i==="~")return e?[e.resolve(e.homedir(),o.substring(3)),`file:${o.substring(1)}`]:[o.substring(1),`file:${o.substring(1)}`];if(r==="/"&&i==="."&&(s==="/"||s==="."&&c==="/"))return[o.substring(1),`file:${o.substring(1)}`];if(r==="."&&(i==="/"||i==="."&&s==="/"))return[o,`file:${o}`];if(A==="//")try{let u=new URL(t);if(u.host&&u.host!=="localhost")throw ie("invalid file:// specifier. host must be empty or 'localhost'",{spec:n,found:u.host,validOptions:["","localhost"]});return[u.pathname.replace(/^\/([a-zA-Z]:\/)/,"$1"),`file://${u.pathname}`]}catch(u){throw ie("invalid file:// specifier",{spec:n,cause:u})}return e?.winPath.isAbsolute(o)?[o,`file://${o}`]:[`./${o}`,`file:./${o}`]};var ja="\xB7",aee=new RegExp(`^((git)?${ja}[^${ja}]*${ja}[^${ja}]*(${ja}[^${ja}]*)?$|^(file|remote|workspace)${ja}[^${ja}]*)(${ja}[^${ja}]*)?$`),oee=e=>typeof e=="string"&&aee.test(e),zQ=e=>{if(!oee(e))throw ie("Expected dep id",{found:e});return e};var qo=e=>{let[t,n="",A,a]=e.replaceAll("\xA7","/").split(ja,4),o=decodeURIComponent(n);switch(t){case"git":case"":{if(A===void 0)throw ie(`invalid ${t} id`,{found:e});let r=[t||"registry",o,decodeURIComponent(A)];return a&&r.push(decodeURIComponent(a)),r}case"file":case"remote":case"workspace":{let r=[t,o];return A&&r.push(decodeURIComponent(A)),r}default:throw ie("invalid DepID type",{found:t,validOptions:["git","file","workspace","remote",""]})}},EL=(e,t,n={})=>ree(qo(e),t,n),ree=(e,t,n={})=>{let[A,a,o]=e;switch(A){case"remote":{if(!a)throw ie("no remoteURL found on remote id",{found:e});return Ut.parse(t??"(unknown)",a)}case"file":{if(!a)throw ie("no file path found on remote id",{found:e});return Ut.parse(t??"(unknown)",`file:${a}`,n)}case"registry":{if(typeof a!="string")throw ie("no registry url or name in registry ID",{found:e});if(!o)throw ie("no name/specifier in registry ID",{found:e});if(!a){let i=Ut.parse(o);return t&&i.name!==t?Ut.parse(`${t}@npm:${o}`):i}if(!/^https?:\/\//.test(a)){let i=n.registries?.[a];if(a!=="npm"&&!i)throw ie("named registry not found in options",{name:a,found:e});return Ut.parse(t??"(unknown)",`${a}:${o}`,n)}let r=Ut.parse(t??"(unknown)",`registry:${a}#${o}`,n);return t&&r.final.name!==t?Ut.parse(r.final.name+"@"+r.bareSpec):r}case"git":{if(!a)throw ie("no git remote in git ID",{found:e});return Ut.parse(t??"(unknown)",a+"#"+o,n)}case"workspace":{if(!a)throw ie("no name/path on workspace id",{found:e});return t&&t!==a?Ut.parse(t,`workspace:${a}@*`,n):Ut.parse(a,"workspace:*",n)}}};var Lb=e=>!!e&&typeof e=="object",$p=e=>e===void 0||iee(e),iee=e=>yL(e,t=>typeof t=="string"),yL=(e,t)=>Lb(e)&&Object.entries(e).every(([n,A])=>typeof n=="string"&&t(A));var see=e=>e===void 0||yL(e,t=>uee(t)),cee=e=>e===void 0||typeof e=="boolean",uee=e=>Lb(e)&&cee(e.optional),HQ=e=>e===void 0||typeof e=="string",dee=e=>e===void 0||Lb(e)&&HQ(e.tarball),lee=e=>Lb(e)&&!Array.isArray(e)&&HQ(e.name)&&HQ(e.version)&&$p(e.dependencies)&&$p(e.devDependencies)&&$p(e.optionalDependencies)&&$p(e.peerDependencies)&&$p(e.acceptDependencies)&&see(e.peerDependenciesMeta)&&dee(e.dist);var $Q=(e,t)=>{if(!lee(e))throw ie("invalid manifest",{found:e},t??$Q);return e};var Ss=(e,t)=>{for(let n of t.edgesIn)e.partial.edges.delete(n);e.partial.nodes.delete(t)},QL=e=>{for(let t of e.partial.edges)t.to||e.partial.edges.delete(t)},pee=e=>{let t=Qb(Na(e.pop()).nodes[0]),n=[];for(let A of e)n.push(RQ(Na(A).nodes[0]).value);return n.push(t.attribute),{attribute:t.attribute,insensitive:t.insensitive||!1,operator:t.operator,value:t.value,properties:n}},gee=async e=>{let t;try{t=pee(Na(e.current).nodes)}catch(i){throw ie("Failed to parse :attr selector",{cause:i})}let n=t.operator?jp.get(t.operator):void 0,A=t.value||"",a=t.attribute,o=t.insensitive,r=t.properties;return Pp(e,n,A,a,o,r)},mee=async e=>{for(let t of e.partial.nodes)t.edgesOut.size>0&&Ss(e,t);return e},fee=async e=>{let t=Na(e.current),n=new Set,A=new Set;for(let r of t.nodes)if(wu(r)){let i=await e.walk({initial:{edges:new Set(e.initial.edges),nodes:new Set(e.initial.nodes)},current:r,walk:e.walk,collect:{edges:new Set,nodes:new Set},partial:{edges:new Set(e.partial.edges),nodes:new Set(e.partial.nodes)}});for(let s of i.collect.nodes)n.add(s);for(let s of i.partial.edges)A.add(s)}if(n.size===0)return e.partial.edges.clear(),e.partial.nodes.clear(),e;let a=new Set,o=new Set(n);for(let r of o)for(let i of r.edgesIn)a.add(i.from),i.from.edgesIn.size&&o.add(i.from);e:for(let r of e.partial.nodes){if(r.edgesOut.size===0||!a.has(r)){Ss(e,r);continue}for(let i of r.edgesOut.values())if(A.has(i))continue e;Ss(e,r)}return QL(e),e},bee=async e=>{let t=Na(e.current),n=new Set;for(let A of t.nodes)if(wu(A)){let a=await e.walk({collect:{edges:new Set,nodes:new Set},current:A,initial:e.initial,loose:!0,partial:{nodes:new Set(e.partial.nodes),edges:new Set(e.partial.edges)},walk:e.walk});for(let o of a.collect.nodes)n.add(o)}for(let A of e.partial.nodes)n.has(A)||Ss(e,A);return e},hee=async e=>{for(let t of e.partial.edges)t.to&&e.partial.edges.delete(t);return e.partial.nodes.clear(),e},Bee=async e=>{let t=Na(e.current),n=new Set;for(let A of t.nodes)if(wu(A)){let a=await e.walk({collect:{edges:new Set,nodes:new Set},current:A,initial:e.initial,partial:{nodes:new Set(e.partial.nodes),edges:new Set(e.partial.edges)},walk:e.walk});for(let o of a.collect.nodes)n.add(o)}else throw ie("Error parsing :not() selectors",{wanted:{type:"selector"},found:A});for(let A of e.partial.nodes)n.has(A)&&Ss(e,A);return e},Cee=async e=>{for(let t of e.partial.nodes)(!t.manifest||!$Q(t.manifest).private)&&Ss(e,t);return QL(e),e},wee=async e=>{let[t]=e.initial.nodes.values(),n=t?.graph.mainImporter;if(!n)throw ie(":root pseudo-element works on local graphs only");for(let A of e.partial.edges)A.to!==n&&e.partial.edges.delete(A);return e.partial.nodes.clear(),e.partial.nodes.add(n),e},Eee=async e=>{let[t]=e.initial.nodes.values(),n=t?.graph.importers;if(!n?.size)throw ie(":project pseudo-element works on local graphs only");let A=new Set;for(let a of n)for(let o of a.edgesIn)A.add(o);for(let a of e.partial.edges)(!a.to||!A.has(a))&&e.partial.edges.delete(a);e.partial.nodes.clear();for(let a of n)e.partial.nodes.add(a);return e},yee=async e=>{e.partial.edges.clear(),e.partial.nodes.clear();for(let t of e.initial.edges)e.partial.edges.add(t);for(let t of e.initial.nodes)e.partial.nodes.add(t);return e},Qee=async e=>{let t=Na(e.current),n=Na(t.nodes[0]),A=RQ(n.nodes[0]).value;for(let a of e.partial.nodes)qo(a.id)[0]!==A&&Ss(e,a);return e},kee=new Map(Object.entries({attr:gee,empty:mee,has:fee,is:bee,missing:hee,not:Bee,private:Cee,project:Eee,root:wee,scope:yee,type:Qee})),kL=async e=>{let t=iL(e.current),n=t.value&&kee.get(t.value.slice(1));if(!n){if(e.loose)return e;throw new Error(`Unsupported pseudo-class: ${e.current.value}`)}return n(e)};var Rb=async e=>e,Iee={attribute:sL,class:cL,combinator:uL,comment:Rb,id:dL,nesting:Rb,pseudo:kL,root:Rb,selector:async e=>(e.partial.nodes=new Set(e.initial.nodes),e.partial.edges=new Set(e.initial.edges),e),string:async e=>{throw ie("Unsupported selector",{found:e.current})},tag:async e=>{if(e.current.value!=="{"&&e.current.value!=="}")throw ie("Unsupported selector",{found:e.current});return e},universal:Rb},_ee=new Map(Object.entries(Iee)),TQ=async e=>{let t=_ee.get(e.current.type);if(!t){if(e.loose)return e;throw new Error(`Missing parser for query node: ${e.current.type}`)}if(e=await t(e),yb(e.current)&&e.current.type!=="pseudo"){let n=Na(e.current);if(n.nodes.length)for(let A=0;A<n.nodes.length;A++){let a=n.nodes[A];if(!a)continue;let o={...e,current:a,next:n.nodes[A+1],prev:n.nodes[A-1]};e=await TQ(o)}if(wu(n)){for(let A of e.partial.edges)e.collect.edges.add(A);for(let A of e.partial.nodes)e.collect.nodes.add(A)}}return e},Mb=class{#e;#t;constructor({graph:t}){this.#e=new Map,this.#t=t}async search(t){if(typeof t!="string")throw new TypeError("Query search argument needs to be a string");if(!t)return{edges:[],nodes:[]};let n=this.#e.get(t);if(n)return n;let A=new Set(Array.from(this.#t.nodes.values())),a=new Set(Array.from(this.#t.edges)),{collect:o}=await TQ({current:(0,IL.default)().astSync(t),initial:{nodes:new Set(A),edges:new Set(a)},collect:{nodes:new Set,edges:new Set},partial:{nodes:A,edges:a},walk:TQ}),r={edges:Array.from(o.edges),nodes:Array.from(o.nodes)};return this.#e.set(t,r),r}};var Nb=w(_(),1);var Qu=w(I(),1),_L=({className:e,tabIndex:t,startContent:n,endContent:A})=>{let a=D(i=>i.updateQuery),o=D(i=>i.query),r=(0,Nb.useRef)(null);return(0,Nb.useEffect)(()=>{let i=s=>{switch(!0){case((s.metaKey||s.ctrlKey)&&s.key==="k"):s.preventDefault(),r.current?.focus();break;case s.key==="Escape":s.preventDefault(),r.current?.blur();break;default:break}};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[]),(0,Qu.jsxs)("div",{className:"flex items-center relative grow",children:[n&&(0,Qu.jsx)("div",{className:"absolute pr-8",children:n}),(0,Qu.jsx)(We,{type:"text",role:"search",tabIndex:t,ref:r,className:`${e} ${n?"pl-10":""}`,placeholder:"Query Lookup, e.g: :root > *",value:o,onChange:i=>{let s=i.currentTarget.value;a(s)}}),A&&(0,Qu.jsx)("div",{className:"absolute right-0",children:A})]})};var xL=e=>xee.has(e);var ku=new Set(["dependencies","devDependencies","peerDependencies","optionalDependencies"]),xee=new Set(["prod","dev","peer","optional","peerOptional"]),Dee=new Map([["dependencies","prod"],["devDependencies","dev"],["peerDependencies","peer"],["optionalDependencies","optional"]]),UQ=(e,t,n)=>{let A=Dee.get(e);if(!A)throw ie("Invalid dependency type name",{found:e,validOptions:[...ku]});return A!=="peer"?A:t&&n?.peerDependenciesMeta?.[t]?.optional===!0?"peerOptional":"peer"};var ZQ=e=>({dev:!!(e&Fee),optional:!!(e&vee)});var vee=1,Fee=2;var Tp=e=>{if(!e)return"";let t=e.version?`@${e.version}`:"",[n,A,a]=qo(e.id);if(n==="registry")return`${A?`${A}:`:"npm:"}${a}`;if(n==="workspace")return`workspace:${e.name}`;if(n==="file"&&e.mainImporter)return`root:${e.name}`;{let o=e.name!==e.id?`:${e.name}${t}`:"";return`${n}(${A})${o}`}};var DL=(e,t,n)=>{let A=Object.entries(t);for(let[a,o]of A){let[r,i]=Pa(a," ",2),[s,c]=Pa(o," ",2),u=c?.lastIndexOf(" ")??-1;if(!c||!s||!r||!i||u<1)continue;let d=Ut.parse(i,c.substring(0,u),n),l=c.substring(u+1),p=e.nodes.get(zQ(r));if(!p)throw ie("Edge info missing its `from` node",{found:{nodes:[...e.nodes].map(([b])=>b),from:p,fromId:r,edge:{[a]:o}}});let g=l==="MISSING"?void 0:e.nodes.get(zQ(l));if(!xL(s))throw ie("Found unsupported dependency type in lockfile",{validOptions:[...ku]});e.addEdge(s,d,p,g)}};var vL=(e,t)=>{let n=Object.entries(t);for(let[A,a]of n){if(e.nodes.has(A))continue;let[o,r,i,s,c,u]=a,[d,,l]=qo(A),p=u?e.addNode(A,u):e.addNode(A,void 0,void 0,r??void 0,d==="registry"&&l.indexOf("@")>0?l.split("@").slice(-1)[0]:void 0),{dev:g,optional:b}=ZQ(o);p.dev=g,p.optional=b,p.integrity=i??void 0,p.resolved=s??void 0,p.resolved||p.setResolved(),c&&(p.location=c)}};var qQ={loadEdges:DL,loadNodes:vL};var Iu=w(_(),1);var ai=w(I(),1),Ls=({renderAsLink:e,className:t,...n})=>{let A=v("block rounded-lg border bg-card text-card-foreground shadow-sm",t);return e?(0,ai.jsx)("a",{href:"#",className:A,...n}):(0,ai.jsx)("div",{className:A,...n})};Ls.displayName="Card";var Ga=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("div",{ref:n,className:v("flex flex-col p-6",e),...t}));Ga.displayName="CardHeader";var jA=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("h3",{ref:n,className:v("text-2xl font-semibold leading-none tracking-tight",e),...t}));jA.displayName="CardTitle";var OQ=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("p",{ref:n,className:v("text-sm text-muted-foreground",e),...t}));OQ.displayName="CardDescription";var See=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("div",{ref:n,className:v("p-6 pt-0",e),...t}));See.displayName="CardContent";var Lee=(0,Iu.forwardRef)(({className:e,...t},n)=>(0,ai.jsx)("div",{ref:n,className:v("flex items-center p-6 pt-0",e),...t}));Lee.displayName="CardFooter";var Up=new Map([[void 0,"border-transparent bg-gray-100 text-neutral-900 hover:bg-gray-100/80"],["prod","border-transparent bg-cyan-100 text-neutral-900 hover:bg-cyan-100/80"],["dev","border-transparent bg-fuchsia-100 text-neutral-900 hover:bg-fuchsia-100/80"],["optional","border-transparent bg-orange-100 text-neutral-900 hover:bg-orange-100/80"],["peer","border-transparent bg-lime-100 text-neutral-900 hover:bg-lime-100/80"],["peerOptional","border-transparent bg-yellow-100 text-neutral-900 hover:bg-yellow-100/80"]]);var Ge=w(I(),1),Ree=({item:e,query:t,updateQuery:n})=>A=>{if(A.preventDefault(),!e.to)return;let a="";if(e.stacked){let o=e.to.name?`[name="${e.to.name}"]`:"",r=e.to.version?`[version="${e.to.version}"]`:"";a=`${t.trim()}${o}${r}`}else{let o="";if(!e.sameItems){let r=e.to.name?`[name="${e.to.name}"]`:"",i=e.to.version?`[version="${e.to.version}"]`:"";o=`${r}${i}`}if(e.to.importer&&!e.from)a=`:project[name="${e.to.name}"]`;else if(e.from){let r=`[name="${e.from.name}"]`,i=e.from.version?`[version="${e.from.version}"]`:"";a=`${r}${i} > :is(${t.trim()}${o})`}else a=`${t.trim()}${o}`}n(a)},FL=({item:e})=>{let t=D(A=>A.updateQuery),n=D(A=>A.query);return(0,Ge.jsxs)("div",{className:"group relative z-10",children:[e.stacked?(0,Ge.jsxs)(Ge.Fragment,{children:[e.size>2?(0,Ge.jsx)("div",{className:"transition-all group-hover:border-neutral-400 dark:group-hover:border-neutral-600 absolute border top-2 left-2 w-[97.5%] h-full bg-card rounded-lg"}):"",(0,Ge.jsx)("div",{className:"transition-all group-hover:border-neutral-400 dark:group-hover:border-neutral-600 absolute border top-1 left-1 w-[99%] h-full bg-card rounded-lg"})]}):"",(0,Ge.jsxs)(Ls,{renderAsLink:!0,className:`relative group-hover:border-neutral-400 dark:group-hover:border-neutral-600 ${e.to?"cursor-pointer":"cursor-default"}`,onClick:Ree({item:e,query:n,updateQuery:t}),children:[(0,Ge.jsxs)(Ga,{className:"m-0 px-4 py-3 rounded-t-lg flex flex-row items-center justify-between border-b-[1px]",children:[(0,Ge.jsx)(Xe,{children:(0,Ge.jsxs)(et,{children:[(0,Ge.jsx)(Qt,{className:"truncate",children:(0,Ge.jsx)(jA,{className:"text-md truncate",children:e.title})}),(0,Ge.jsx)(Oe,{children:(0,Ge.jsx)("p",{children:e.title})})]})}),e.type?(0,Ge.jsx)("div",{className:"flex items-center justify-center text-pretty rounded-md border-[1px] px-2.5 py-0.5 text-xs text-muted-foreground",children:(0,Ge.jsxs)("p",{className:"font-semibold",children:[e.stacked?"":(0,Ge.jsx)("span",{children:e.type}),(0,Ge.jsx)("span",{className:"font-medium px-1 text-muted-foreground",children:"dep of:"}),e.stacked?(0,Ge.jsxs)("span",{children:[e.size," packages"]}):(0,Ge.jsx)("span",{children:Tp(e.from)})]})}):""]}),(0,Ge.jsxs)("div",{className:"w-full h-12 flex items-center gap-4 justify-between border-t-[1px] px-4 py-3",children:[e.version?(0,Ge.jsx)(Xe,{children:(0,Ge.jsxs)(et,{children:[(0,Ge.jsx)(Qt,{className:"rounded-sm border-[1px] px-2 py-1 text-[0.65rem] text-muted-foreground font-mono m-0 align-baseline truncate",children:e.version}),(0,Ge.jsx)(Oe,{children:(0,Ge.jsx)("p",{children:e.version})})]})}):"",(0,Ge.jsx)("div",{className:"flex gap-2",children:e.labels?.length?e.labels.map(A=>(0,Ge.jsx)("div",{children:(0,Ge.jsx)($o,{className:Up.get(A)||"",children:A})},A)):""})]})]})]})};var Jp=w(_(),1);var Oo=w(_(),1);var un=w(_(),1);var re=w(_(),1);var oi=w(_(),1);var Pb=w(I(),1);function ri(e){let t=e+"CollectionProvider",[n,A]=ru(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),r=p=>{let{scope:g,children:b}=p,B=oi.default.useRef(null),f=oi.default.useRef(new Map).current;return(0,Pb.jsx)(a,{scope:g,itemMap:f,collectionRef:B,children:b})};r.displayName=t;let i=e+"CollectionSlot",s=oi.default.forwardRef((p,g)=>{let{scope:b,children:B}=p,f=o(i,b),m=pe(g,f.collectionRef);return(0,Pb.jsx)(Nt,{ref:m,children:B})});s.displayName=i;let c=e+"CollectionItemSlot",u="data-radix-collection-item",d=oi.default.forwardRef((p,g)=>{let{scope:b,children:B,...f}=p,m=oi.default.useRef(null),h=pe(g,m),C=o(c,b);return oi.default.useEffect(()=>(C.itemMap.set(m,{ref:m,...f}),()=>void C.itemMap.delete(m))),(0,Pb.jsx)(Nt,{[u]:"",ref:h,children:B})});d.displayName=c;function l(p){let g=o(e+"CollectionConsumer",p);return oi.default.useCallback(()=>{let B=g.collectionRef.current;if(!B)return[];let f=Array.from(B.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((C,E)=>f.indexOf(C.ref.current)-f.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:r,Slot:s,ItemSlot:d},l,A]}var jb=w(_(),1),Mee=w(I(),1),Nee=jb.createContext(void 0);function ii(e){let t=jb.useContext(Nee);return e||t||"ltr"}var bn=w(_(),1);var si=w(I(),1),YQ="rovingFocusGroup.onEntryFocus",Pee={bubbles:!1,cancelable:!0},Gb="RovingFocusGroup",[KQ,SL,jee]=ri(Gb),[Gee,_u]=ru(Gb,[jee]),[zee,Hee]=Gee(Gb),LL=bn.forwardRef((e,t)=>(0,si.jsx)(KQ.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,si.jsx)(KQ.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,si.jsx)($ee,{...e,ref:t})})}));LL.displayName=Gb;var $ee=bn.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:A,loop:a=!1,dir:o,currentTabStopId:r,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:s,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,l=bn.useRef(null),p=pe(t,l),g=ii(o),[b=null,B]=Tt({prop:r,defaultProp:i,onChange:s}),[f,m]=bn.useState(!1),h=Je(c),C=SL(n),E=bn.useRef(!1),[Q,y]=bn.useState(0);return bn.useEffect(()=>{let k=l.current;if(k)return k.addEventListener(YQ,h),()=>k.removeEventListener(YQ,h)},[h]),(0,si.jsx)(zee,{scope:n,orientation:A,dir:g,loop:a,currentTabStopId:b,onItemFocus:bn.useCallback(k=>B(k),[B]),onItemShiftTab:bn.useCallback(()=>m(!0),[]),onFocusableItemAdd:bn.useCallback(()=>y(k=>k+1),[]),onFocusableItemRemove:bn.useCallback(()=>y(k=>k-1),[]),children:(0,si.jsx)(Z.div,{tabIndex:f||Q===0?-1:0,"data-orientation":A,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{E.current=!0}),onFocus:z(e.onFocus,k=>{let R=!E.current;if(k.target===k.currentTarget&&R&&!f){let F=new CustomEvent(YQ,Pee);if(k.currentTarget.dispatchEvent(F),!F.defaultPrevented){let U=C().filter(W=>W.focusable),M=U.find(W=>W.active),ce=U.find(W=>W.id===b),te=[M,ce,...U].filter(Boolean).map(W=>W.ref.current);NL(te,u)}}E.current=!1}),onBlur:z(e.onBlur,()=>m(!1))})})}),RL="RovingFocusGroupItem",ML=bn.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:A=!0,active:a=!1,tabStopId:o,...r}=e,i=Pe(),s=o||i,c=Hee(RL,n),u=c.currentTabStopId===s,d=SL(n),{onFocusableItemAdd:l,onFocusableItemRemove:p}=c;return bn.useEffect(()=>{if(A)return l(),()=>p()},[A,l,p]),(0,si.jsx)(KQ.ItemSlot,{scope:n,id:s,focusable:A,active:a,children:(0,si.jsx)(Z.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...r,ref:t,onMouseDown:z(e.onMouseDown,g=>{A?c.onItemFocus(s):g.preventDefault()}),onFocus:z(e.onFocus,()=>c.onItemFocus(s)),onKeyDown:z(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;let b=Zee(g,c.orientation,c.dir);if(b!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let f=d().filter(m=>m.focusable).map(m=>m.ref.current);if(b==="last")f.reverse();else if(b==="prev"||b==="next"){b==="prev"&&f.reverse();let m=f.indexOf(g.currentTarget);f=c.loop?qee(f,m+1):f.slice(m+1)}setTimeout(()=>NL(f))}})})})});ML.displayName=RL;var Tee={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uee(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Zee(e,t,n){let A=Uee(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(A))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(A)))return Tee[A]}function NL(e,t=!1){let n=document.activeElement;for(let A of e)if(A===n||(A.focus({preventScroll:t}),document.activeElement!==n))return}function qee(e,t){return e.map((n,A)=>e[(t+A)%e.length])}var zb=LL,Hb=ML;var ge=w(I(),1),WQ=["Enter"," "],Oee=["ArrowDown","PageUp","Home"],GL=["ArrowUp","PageDown","End"],Yee=[...Oee,...GL],Kee={ltr:[...WQ,"ArrowRight"],rtl:[...WQ,"ArrowLeft"]},Wee={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Yp="Menu",[qp,Jee,Vee]=ri(Yp),[Rs,JQ]=Pt(Yp,[Vee,aa,_u]),Kp=aa(),zL=_u(),[HL,ci]=Rs(Yp),[Xee,Wp]=Rs(Yp),$L=e=>{let{__scopeMenu:t,open:n=!1,children:A,dir:a,onOpenChange:o,modal:r=!0}=e,i=Kp(t),[s,c]=re.useState(null),u=re.useRef(!1),d=Je(o),l=ii(a);return re.useEffect(()=>{let p=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),(0,ge.jsx)(jo,{...i,children:(0,ge.jsx)(HL,{scope:t,open:n,onOpenChange:d,content:s,onContentChange:c,children:(0,ge.jsx)(Xee,{scope:t,onClose:re.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:l,modal:r,children:A})})})};$L.displayName=Yp;var ete="MenuAnchor",VQ=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e,a=Kp(n);return(0,ge.jsx)(Go,{...a,...A,ref:t})});VQ.displayName=ete;var XQ="MenuPortal",[tte,TL]=Rs(XQ,{forceMount:void 0}),UL=e=>{let{__scopeMenu:t,forceMount:n,children:A,container:a}=e,o=ci(XQ,t);return(0,ge.jsx)(tte,{scope:t,forceMount:n,children:(0,ge.jsx)(jt,{present:n||o.open,children:(0,ge.jsx)(LA,{asChild:!0,container:a,children:A})})})};UL.displayName=XQ;var ma="MenuContent",[nte,ek]=Rs(ma),ZL=re.forwardRef((e,t)=>{let n=TL(ma,e.__scopeMenu),{forceMount:A=n.forceMount,...a}=e,o=ci(ma,e.__scopeMenu),r=Wp(ma,e.__scopeMenu);return(0,ge.jsx)(qp.Provider,{scope:e.__scopeMenu,children:(0,ge.jsx)(jt,{present:A||o.open,children:(0,ge.jsx)(qp.Slot,{scope:e.__scopeMenu,children:r.modal?(0,ge.jsx)(Ate,{...a,ref:t}):(0,ge.jsx)(ate,{...a,ref:t})})})})}),Ate=re.forwardRef((e,t)=>{let n=ci(ma,e.__scopeMenu),A=re.useRef(null),a=pe(t,A);return re.useEffect(()=>{let o=A.current;if(o)return Zr(o)},[]),(0,ge.jsx)(tk,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ate=re.forwardRef((e,t)=>{let n=ci(ma,e.__scopeMenu);return(0,ge.jsx)(tk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tk=re.forwardRef((e,t)=>{let{__scopeMenu:n,loop:A=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:i,onEntryFocus:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:l,onDismiss:p,disableOutsideScroll:g,...b}=e,B=ci(ma,n),f=Wp(ma,n),m=Kp(n),h=zL(n),C=Jee(n),[E,Q]=re.useState(null),y=re.useRef(null),k=pe(t,y,B.onContentChange),R=re.useRef(0),F=re.useRef(""),U=re.useRef(0),M=re.useRef(null),ce=re.useRef("right"),N=re.useRef(0),te=g?Lo:re.Fragment,W=g?{as:Nt,allowPinchZoom:!0}:void 0,ne=H=>{let ve=F.current+H,Re=C().filter($=>!$.disabled),L=document.activeElement,ae=Re.find($=>$.ref.current===L)?.textValue,ue=Re.map($=>$.textValue),Ae=bte(ue,ve,ae),Qe=Re.find($=>$.textValue===Ae)?.ref.current;(function $(_e){F.current=_e,window.clearTimeout(R.current),_e!==""&&(R.current=window.setTimeout(()=>$(""),1e3))})(ve),Qe&&setTimeout(()=>Qe.focus())};re.useEffect(()=>()=>window.clearTimeout(R.current),[]),Ur();let K=re.useCallback(H=>ce.current===M.current?.side&&Bte(H,M.current?.area),[]);return(0,ge.jsx)(nte,{scope:n,searchRef:F,onItemEnter:re.useCallback(H=>{K(H)&&H.preventDefault()},[K]),onItemLeave:re.useCallback(H=>{K(H)||(y.current?.focus(),Q(null))},[K]),onTriggerLeave:re.useCallback(H=>{K(H)&&H.preventDefault()},[K]),pointerGraceTimerRef:U,onPointerGraceIntentChange:re.useCallback(H=>{M.current=H},[]),children:(0,ge.jsx)(te,{...W,children:(0,ge.jsx)(So,{asChild:!0,trapped:a,onMountAutoFocus:z(o,H=>{H.preventDefault(),y.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:r,children:(0,ge.jsx)(ea,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:l,onDismiss:p,children:(0,ge.jsx)(zb,{asChild:!0,...h,dir:f.dir,orientation:"vertical",loop:A,currentTabStopId:E,onCurrentTabStopIdChange:Q,onEntryFocus:z(s,H=>{f.isUsingKeyboardRef.current||H.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,ge.jsx)(Kr,{role:"menu","aria-orientation":"vertical","data-state":iR(B.open),"data-radix-menu-content":"",dir:f.dir,...m,...b,ref:k,style:{outline:"none",...b.style},onKeyDown:z(b.onKeyDown,H=>{let Re=H.target.closest("[data-radix-menu-content]")===H.currentTarget,L=H.ctrlKey||H.altKey||H.metaKey,ae=H.key.length===1;Re&&(H.key==="Tab"&&H.preventDefault(),!L&&ae&&ne(H.key));let ue=y.current;if(H.target!==ue||!Yee.includes(H.key))return;H.preventDefault();let Qe=C().filter($=>!$.disabled).map($=>$.ref.current);GL.includes(H.key)&&Qe.reverse(),mte(Qe)}),onBlur:z(e.onBlur,H=>{H.currentTarget.contains(H.target)||(window.clearTimeout(R.current),F.current="")}),onPointerMove:z(e.onPointerMove,Op(H=>{let ve=H.target,Re=N.current!==H.clientX;if(H.currentTarget.contains(ve)&&Re){let L=H.clientX>N.current?"right":"left";ce.current=L,N.current=H.clientX}}))})})})})})})});ZL.displayName=ma;var ote="MenuGroup",nk=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e;return(0,ge.jsx)(Z.div,{role:"group",...A,ref:t})});nk.displayName=ote;var rte="MenuLabel",qL=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e;return(0,ge.jsx)(Z.div,{...A,ref:t})});qL.displayName=rte;var $b="MenuItem",jL="menu.itemSelect",Ub=re.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:A,...a}=e,o=re.useRef(null),r=Wp($b,e.__scopeMenu),i=ek($b,e.__scopeMenu),s=pe(t,o),c=re.useRef(!1),u=()=>{let d=o.current;if(!n&&d){let l=new CustomEvent(jL,{bubbles:!0,cancelable:!0});d.addEventListener(jL,p=>A?.(p),{once:!0}),Oc(d,l),l.defaultPrevented?c.current=!1:r.onClose()}};return(0,ge.jsx)(OL,{...a,ref:s,disabled:n,onClick:z(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:z(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,d=>{let l=i.searchRef.current!=="";n||l&&d.key===" "||WQ.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Ub.displayName=$b;var OL=re.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:A=!1,textValue:a,...o}=e,r=ek($b,n),i=zL(n),s=re.useRef(null),c=pe(t,s),[u,d]=re.useState(!1),[l,p]=re.useState("");return re.useEffect(()=>{let g=s.current;g&&p((g.textContent??"").trim())},[o.children]),(0,ge.jsx)(qp.ItemSlot,{scope:n,disabled:A,textValue:a??l,children:(0,ge.jsx)(Hb,{asChild:!0,...i,focusable:!A,children:(0,ge.jsx)(Z.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":A||void 0,"data-disabled":A?"":void 0,...o,ref:c,onPointerMove:z(e.onPointerMove,Op(g=>{A?r.onItemLeave(g):(r.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Op(g=>r.onItemLeave(g))),onFocus:z(e.onFocus,()=>d(!0)),onBlur:z(e.onBlur,()=>d(!1))})})})}),ite="MenuCheckboxItem",YL=re.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:A,...a}=e;return(0,ge.jsx)(XL,{scope:e.__scopeMenu,checked:n,children:(0,ge.jsx)(Ub,{role:"menuitemcheckbox","aria-checked":Tb(n)?"mixed":n,...a,ref:t,"data-state":ok(n),onSelect:z(a.onSelect,()=>A?.(Tb(n)?!0:!n),{checkForDefaultPrevented:!1})})})});YL.displayName=ite;var KL="MenuRadioGroup",[ste,cte]=Rs(KL,{value:void 0,onValueChange:()=>{}}),WL=re.forwardRef((e,t)=>{let{value:n,onValueChange:A,...a}=e,o=Je(A);return(0,ge.jsx)(ste,{scope:e.__scopeMenu,value:n,onValueChange:o,children:(0,ge.jsx)(nk,{...a,ref:t})})});WL.displayName=KL;var JL="MenuRadioItem",VL=re.forwardRef((e,t)=>{let{value:n,...A}=e,a=cte(JL,e.__scopeMenu),o=n===a.value;return(0,ge.jsx)(XL,{scope:e.__scopeMenu,checked:o,children:(0,ge.jsx)(Ub,{role:"menuitemradio","aria-checked":o,...A,ref:t,"data-state":ok(o),onSelect:z(A.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});VL.displayName=JL;var Ak="MenuItemIndicator",[XL,ute]=Rs(Ak,{checked:!1}),eR=re.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:A,...a}=e,o=ute(Ak,n);return(0,ge.jsx)(jt,{present:A||Tb(o.checked)||o.checked===!0,children:(0,ge.jsx)(Z.span,{...a,ref:t,"data-state":ok(o.checked)})})});eR.displayName=Ak;var dte="MenuSeparator",tR=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e;return(0,ge.jsx)(Z.div,{role:"separator","aria-orientation":"horizontal",...A,ref:t})});tR.displayName=dte;var lte="MenuArrow",nR=re.forwardRef((e,t)=>{let{__scopeMenu:n,...A}=e,a=Kp(n);return(0,ge.jsx)(Wr,{...a,...A,ref:t})});nR.displayName=lte;var ak="MenuSub",[pte,AR]=Rs(ak),gte=e=>{let{__scopeMenu:t,children:n,open:A=!1,onOpenChange:a}=e,o=ci(ak,t),r=Kp(t),[i,s]=re.useState(null),[c,u]=re.useState(null),d=Je(a);return re.useEffect(()=>(o.open===!1&&d(!1),()=>d(!1)),[o.open,d]),(0,ge.jsx)(jo,{...r,children:(0,ge.jsx)(HL,{scope:t,open:A,onOpenChange:d,content:c,onContentChange:u,children:(0,ge.jsx)(pte,{scope:t,contentId:Pe(),triggerId:Pe(),trigger:i,onTriggerChange:s,children:n})})})};gte.displayName=ak;var Zp="MenuSubTrigger",aR=re.forwardRef((e,t)=>{let n=ci(Zp,e.__scopeMenu),A=Wp(Zp,e.__scopeMenu),a=AR(Zp,e.__scopeMenu),o=ek(Zp,e.__scopeMenu),r=re.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:s}=o,c={__scopeMenu:e.__scopeMenu},u=re.useCallback(()=>{r.current&&window.clearTimeout(r.current),r.current=null},[]);return re.useEffect(()=>u,[u]),re.useEffect(()=>{let d=i.current;return()=>{window.clearTimeout(d),s(null)}},[i,s]),(0,ge.jsx)(VQ,{asChild:!0,...c,children:(0,ge.jsx)(OL,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":iR(n.open),...e,ref:as(t,a.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Op(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!r.current&&(o.onPointerGraceIntentChange(null),r.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:z(e.onPointerLeave,Op(d=>{u();let l=n.content?.getBoundingClientRect();if(l){let p=n.content?.dataset.side,g=p==="right",b=g?-5:5,B=l[g?"left":"right"],f=l[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+b,y:d.clientY},{x:B,y:l.top},{x:f,y:l.top},{x:f,y:l.bottom},{x:B,y:l.bottom}],side:p}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,d=>{let l=o.searchRef.current!=="";e.disabled||l&&d.key===" "||Kee[A.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});aR.displayName=Zp;var oR="MenuSubContent",rR=re.forwardRef((e,t)=>{let n=TL(ma,e.__scopeMenu),{forceMount:A=n.forceMount,...a}=e,o=ci(ma,e.__scopeMenu),r=Wp(ma,e.__scopeMenu),i=AR(oR,e.__scopeMenu),s=re.useRef(null),c=pe(t,s);return(0,ge.jsx)(qp.Provider,{scope:e.__scopeMenu,children:(0,ge.jsx)(jt,{present:A||o.open,children:(0,ge.jsx)(qp.Slot,{scope:e.__scopeMenu,children:(0,ge.jsx)(tk,{id:i.contentId,"aria-labelledby":i.triggerId,...a,ref:c,align:"start",side:r.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{r.isUsingKeyboardRef.current&&s.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:z(e.onFocusOutside,u=>{u.target!==i.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,u=>{r.onClose(),u.preventDefault()}),onKeyDown:z(e.onKeyDown,u=>{let d=u.currentTarget.contains(u.target),l=Wee[r.dir].includes(u.key);d&&l&&(o.onOpenChange(!1),i.trigger?.focus(),u.preventDefault())})})})})})});rR.displayName=oR;function iR(e){return e?"open":"closed"}function Tb(e){return e==="indeterminate"}function ok(e){return Tb(e)?"indeterminate":e?"checked":"unchecked"}function mte(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function fte(e,t){return e.map((n,A)=>e[(t+A)%e.length])}function bte(e,t,n){let a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1,r=fte(e,Math.max(o,0));a.length===1&&(r=r.filter(c=>c!==n));let s=r.find(c=>c.toLowerCase().startsWith(a.toLowerCase()));return s!==n?s:void 0}function hte(e,t){let{x:n,y:A}=e,a=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,u=t[r].y;s>A!=u>A&&n<(c-i)*(A-s)/(u-s)+i&&(a=!a)}return a}function Bte(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return hte(n,t)}function Op(e){return t=>t.pointerType==="mouse"?e(t):void 0}var sR=$L,cR=VQ,uR=UL,dR=ZL,lR=nk,pR=qL,gR=Ub,mR=YL,fR=WL,bR=VL,hR=eR,BR=tR,CR=nR;var wR=aR,ER=rR;var hn=w(I(),1),rk="DropdownMenu",[wte,p0e]=Pt(rk,[JQ]),AA=JQ(),[Ete,yR]=wte(rk),QR=e=>{let{__scopeDropdownMenu:t,children:n,dir:A,open:a,defaultOpen:o,onOpenChange:r,modal:i=!0}=e,s=AA(t),c=un.useRef(null),[u=!1,d]=Tt({prop:a,defaultProp:o,onChange:r});return(0,hn.jsx)(Ete,{scope:t,triggerId:Pe(),triggerRef:c,contentId:Pe(),open:u,onOpenChange:d,onOpenToggle:un.useCallback(()=>d(l=>!l),[d]),modal:i,children:(0,hn.jsx)(sR,{...s,open:u,onOpenChange:d,dir:A,modal:i,children:n})})};QR.displayName=rk;var kR="DropdownMenuTrigger",IR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:A=!1,...a}=e,o=yR(kR,n),r=AA(n);return(0,hn.jsx)(cR,{asChild:!0,...r,children:(0,hn.jsx)(Z.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":A?"":void 0,disabled:A,...a,ref:as(t,o.triggerRef),onPointerDown:z(e.onPointerDown,i=>{!A&&i.button===0&&i.ctrlKey===!1&&(o.onOpenToggle(),o.open||i.preventDefault())}),onKeyDown:z(e.onKeyDown,i=>{A||(["Enter"," "].includes(i.key)&&o.onOpenToggle(),i.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});IR.displayName=kR;var yte="DropdownMenuPortal",_R=e=>{let{__scopeDropdownMenu:t,...n}=e,A=AA(t);return(0,hn.jsx)(uR,{...A,...n})};_R.displayName=yte;var xR="DropdownMenuContent",DR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=yR(xR,n),o=AA(n),r=un.useRef(!1);return(0,hn.jsx)(dR,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...A,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,i=>{r.current||a.triggerRef.current?.focus(),r.current=!1,i.preventDefault()}),onInteractOutside:z(e.onInteractOutside,i=>{let s=i.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0,u=s.button===2||c;(!a.modal||u)&&(r.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});DR.displayName=xR;var Qte="DropdownMenuGroup",kte=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(lR,{...a,...A,ref:t})});kte.displayName=Qte;var Ite="DropdownMenuLabel",vR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(pR,{...a,...A,ref:t})});vR.displayName=Ite;var _te="DropdownMenuItem",FR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(gR,{...a,...A,ref:t})});FR.displayName=_te;var xte="DropdownMenuCheckboxItem",SR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(mR,{...a,...A,ref:t})});SR.displayName=xte;var Dte="DropdownMenuRadioGroup",vte=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(fR,{...a,...A,ref:t})});vte.displayName=Dte;var Fte="DropdownMenuRadioItem",LR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(bR,{...a,...A,ref:t})});LR.displayName=Fte;var Ste="DropdownMenuItemIndicator",RR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(hR,{...a,...A,ref:t})});RR.displayName=Ste;var Lte="DropdownMenuSeparator",MR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(BR,{...a,...A,ref:t})});MR.displayName=Lte;var Rte="DropdownMenuArrow",Mte=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(CR,{...a,...A,ref:t})});Mte.displayName=Rte;var Nte="DropdownMenuSubTrigger",NR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(wR,{...a,...A,ref:t})});NR.displayName=Nte;var Pte="DropdownMenuSubContent",PR=un.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...A}=e,a=AA(n);return(0,hn.jsx)(ER,{...a,...A,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});PR.displayName=Pte;var jR=QR,GR=IR,zR=_R,ik=DR;var sk=vR,ck=FR,uk=SR;var dk=LR,lk=RR,pk=MR;var gk=NR,mk=PR;var dn=w(I(),1),HR=jR,$R=GR;var Gte=Oo.forwardRef(({className:e,inset:t,children:n,...A},a)=>(0,dn.jsxs)(gk,{ref:a,className:v("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...A,children:[n,(0,dn.jsx)(Wa,{className:"ml-auto"})]}));Gte.displayName=gk.displayName;var zte=Oo.forwardRef(({className:e,...t},n)=>(0,dn.jsx)(mk,{ref:n,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));zte.displayName=mk.displayName;var fk=Oo.forwardRef(({className:e,sideOffset:t=4,...n},A)=>(0,dn.jsx)(zR,{children:(0,dn.jsx)(ik,{ref:A,sideOffset:t,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));fk.displayName=ik.displayName;var bk=Oo.forwardRef(({className:e,inset:t,...n},A)=>(0,dn.jsx)(ck,{ref:A,className:v("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));bk.displayName=ck.displayName;var Hte=Oo.forwardRef(({className:e,children:t,checked:n,...A},a)=>(0,dn.jsxs)(uk,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...A,children:[(0,dn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dn.jsx)(lk,{children:(0,dn.jsx)(Da,{className:"h-4 w-4"})})}),t]}));Hte.displayName=uk.displayName;var $te=Oo.forwardRef(({className:e,children:t,...n},A)=>(0,dn.jsxs)(dk,{ref:A,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[(0,dn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dn.jsx)(lk,{children:(0,dn.jsx)(xl,{className:"h-2 w-2 fill-current"})})}),t]}));$te.displayName=dk.displayName;var Tte=Oo.forwardRef(({className:e,inset:t,...n},A)=>(0,dn.jsx)(sk,{ref:A,className:v("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Tte.displayName=sk.displayName;var Ute=Oo.forwardRef(({className:e,...t},n)=>(0,dn.jsx)(pk,{ref:n,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));Ute.displayName=pk.displayName;var Zte=({className:e,...t})=>(0,dn.jsx)("span",{className:v("ml-auto text-xs tracking-widest opacity-60",e),...t});Zte.displayName="DropdownMenuShortcut";var tt=w(I(),1),xu=({dependencies:e,item:t,highlight:n,parent:A,onSelect:a,onUninstall:o})=>{let r=(0,Jp.useRef)(null),i=(0,Jp.useRef)(null),s=D(d=>d.linePositionReference);(0,Jp.useEffect)(()=>{let d=i.current?.getBoundingClientRect();if(d&&i.current){let l=d.bottom-s;i.current.style.height=`${l}px`}t.depIndex&&r.current&&(r.current.style.zIndex=`${9999-t.depIndex}`)});let c=d=>{d.preventDefault(),o&&o(t)},u=!!o&&t.from?.importer;return(0,tt.jsxs)("div",{className:"group relative z-10",ref:r,children:[t.stacked?(0,tt.jsxs)(tt.Fragment,{children:[t.size>2?(0,tt.jsx)("div",{className:`transition-all absolute border top-2 left-2 w-[96%] h-full bg-card rounded-lg ${a?"group-hover:border-neutral-400 dark:group-hover:border-neutral-600":""}`}):"",(0,tt.jsx)("div",{className:`transition-all absolute border top-1 left-1 w-[98%] h-full bg-card rounded-lg ${a?"group-hover:border-neutral-400 dark:group-hover:border-neutral-600":""}`})]}):"",(0,tt.jsx)(Ls,{role:"article",className:`transition-all relative my-4 ${n?"border-foreground":""} ${a?"cursor-pointer group-hover:border-neutral-400 dark:group-hover:border-neutral-600":""}`,onClick:a,children:(0,tt.jsxs)(Ga,{className:"rounded-t-lg relative flex flex-col w-full p-0",children:[(0,tt.jsxs)("div",{className:"flex items-center px-3 py-2",children:[(0,tt.jsx)(jA,{className:`text-sm font-medium flex-1 items-center ${u?"pl-8":""}`,children:t.name}),(0,tt.jsx)("div",{className:"px-2 py-1 border-[1px] border-solid rounded-full flex-initial",children:(0,tt.jsx)("p",{className:"text-xs",children:t.version})})]}),(0,tt.jsxs)("div",{className:"flex items-center flex-row justify-between gap-2 flex-wrap px-3 py-2 border-muted-foreground/20 border-t-[1px]",children:[(0,tt.jsx)("p",{className:"text-sm text-muted-foreground",children:t.title}),t.labels?.map(d=>(0,tt.jsx)("div",{children:(0,tt.jsx)($o,{className:`grow-0 ${Up.get(d)||""}`,children:d})},d)),A&&(0,tt.jsx)($o,{className:`grow-0 ${Up.get(t.type)||""}`,children:t.type})]})]})}),u?(0,tt.jsx)("div",{className:"absolute top-3 left-3",children:(0,tt.jsxs)(HR,{children:[(0,tt.jsx)($R,{className:"w-8 flex-none",children:(0,tt.jsx)(Pr,{className:"text-muted-foreground",size:20})}),(0,tt.jsx)(fk,{className:"w-48 ml-48 z-[100000]",onCloseAutoFocus:d=>d.preventDefault(),children:(0,tt.jsxs)(bk,{onClick:c,children:[(0,tt.jsx)(jl,{size:16}),"Remove dependency"]})})]})}):"",n?(0,tt.jsx)("div",{className:"absolute border-t border-solid border-muted-foreground w-4 -right-4 top-7"}):e?(0,tt.jsx)("div",{className:"absolute border-b border-l border-solid border-neutral-300 dark:border-neutral-600 rounded-bl-sm z-0 h-[5px] w-[9px] -left-[9px] h-[13.35rem] bottom-[62px] group-[&:nth-child(2)]:hidden group-[&:nth-child(3)]:h-24",ref:i}):""]})};var Zb=w(_(),1);var Ko=w(_(),1);var Yo=w(I(),1),hk="Tabs",[qte,M0e]=Pt(hk,[_u]),TR=_u(),[Ote,Bk]=qte(hk),UR=Ko.forwardRef((e,t)=>{let{__scopeTabs:n,value:A,onValueChange:a,defaultValue:o,orientation:r="horizontal",dir:i,activationMode:s="automatic",...c}=e,u=ii(i),[d,l]=Tt({prop:A,onChange:a,defaultProp:o});return(0,Yo.jsx)(Ote,{scope:n,baseId:Pe(),value:d,onValueChange:l,orientation:r,dir:u,activationMode:s,children:(0,Yo.jsx)(Z.div,{dir:u,"data-orientation":r,...c,ref:t})})});UR.displayName=hk;var ZR="TabsList",qR=Ko.forwardRef((e,t)=>{let{__scopeTabs:n,loop:A=!0,...a}=e,o=Bk(ZR,n),r=TR(n);return(0,Yo.jsx)(zb,{asChild:!0,...r,orientation:o.orientation,dir:o.dir,loop:A,children:(0,Yo.jsx)(Z.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});qR.displayName=ZR;var OR="TabsTrigger",YR=Ko.forwardRef((e,t)=>{let{__scopeTabs:n,value:A,disabled:a=!1,...o}=e,r=Bk(OR,n),i=TR(n),s=JR(r.baseId,A),c=VR(r.baseId,A),u=A===r.value;return(0,Yo.jsx)(Hb,{asChild:!0,...i,focusable:!a,active:u,children:(0,Yo.jsx)(Z.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:s,...o,ref:t,onMouseDown:z(e.onMouseDown,d=>{!a&&d.button===0&&d.ctrlKey===!1?r.onValueChange(A):d.preventDefault()}),onKeyDown:z(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&r.onValueChange(A)}),onFocus:z(e.onFocus,()=>{let d=r.activationMode!=="manual";!u&&!a&&d&&r.onValueChange(A)})})})});YR.displayName=OR;var KR="TabsContent",WR=Ko.forwardRef((e,t)=>{let{__scopeTabs:n,value:A,forceMount:a,children:o,...r}=e,i=Bk(KR,n),s=JR(i.baseId,A),c=VR(i.baseId,A),u=A===i.value,d=Ko.useRef(u);return Ko.useEffect(()=>{let l=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(l)},[]),(0,Yo.jsx)(jt,{present:a||u,children:({present:l})=>(0,Yo.jsx)(Z.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":s,hidden:!l,id:c,tabIndex:0,...r,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:l&&o})})});WR.displayName=KR;function JR(e,t){return`${e}-trigger-${t}`}function VR(e,t){return`${e}-content-${t}`}var XR=UR,Ck=qR,wk=YR,Ek=WR;var qb=w(I(),1),eM=XR,yk=Zb.forwardRef(({className:e,...t},n)=>(0,qb.jsx)(Ck,{ref:n,className:v("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));yk.displayName=Ck.displayName;var Qk=Zb.forwardRef(({className:e,...t},n)=>(0,qb.jsx)(wk,{ref:n,className:v("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Qk.displayName=wk.displayName;var kk=Zb.forwardRef(({className:e,...t},n)=>(0,qb.jsx)(Ek,{ref:n,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));kk.displayName=Ek.displayName;var _h=w(_(),1);var Kne=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>Promise.resolve().then(()=>(nM(),tM))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>Promise.resolve().then(()=>(aM(),AM))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>Promise.resolve().then(()=>(rM(),oM))},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:()=>Promise.resolve().then(()=>(sM(),iM))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>Promise.resolve().then(()=>(uM(),cM))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>Promise.resolve().then(()=>(lM(),dM))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>Promise.resolve().then(()=>(gM(),pM))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>Promise.resolve().then(()=>(fM(),mM))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>Promise.resolve().then(()=>(hM(),bM))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>Promise.resolve().then(()=>(CM(),BM))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>Promise.resolve().then(()=>(EM(),wM))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>Promise.resolve().then(()=>(QM(),yM))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>Promise.resolve().then(()=>(IM(),kM))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>Promise.resolve().then(()=>(xM(),_M))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>Promise.resolve().then(()=>(vM(),DM))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>Promise.resolve().then(()=>(SM(),FM))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>Promise.resolve().then(()=>(RM(),LM))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>Promise.resolve().then(()=>(NM(),MM))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>Promise.resolve().then(()=>(jM(),PM))},{id:"houston",displayName:"Houston",type:"dark",import:()=>Promise.resolve().then(()=>(zM(),GM))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>Promise.resolve().then(()=>($M(),HM))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>Promise.resolve().then(()=>(UM(),TM))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>Promise.resolve().then(()=>(qM(),ZM))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>Promise.resolve().then(()=>(YM(),OM))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>Promise.resolve().then(()=>(WM(),KM))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>Promise.resolve().then(()=>(VM(),JM))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>Promise.resolve().then(()=>(eN(),XM))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>Promise.resolve().then(()=>(nN(),tN))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>Promise.resolve().then(()=>(aN(),AN))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>Promise.resolve().then(()=>(rN(),oN))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>Promise.resolve().then(()=>(sN(),iN))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>Promise.resolve().then(()=>(uN(),cN))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>Promise.resolve().then(()=>(lN(),dN))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>Promise.resolve().then(()=>(gN(),pN))},{id:"nord",displayName:"Nord",type:"dark",import:()=>Promise.resolve().then(()=>(fN(),mN))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>Promise.resolve().then(()=>(hN(),bN))},{id:"one-light",displayName:"One Light",type:"light",import:()=>Promise.resolve().then(()=>(CN(),BN))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>Promise.resolve().then(()=>(EN(),wN))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>Promise.resolve().then(()=>(QN(),yN))},{id:"red",displayName:"Red",type:"dark",import:()=>Promise.resolve().then(()=>(IN(),kN))},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:()=>Promise.resolve().then(()=>(xN(),_N))},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:()=>Promise.resolve().then(()=>(vN(),DN))},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:()=>Promise.resolve().then(()=>(SN(),FN))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>Promise.resolve().then(()=>(RN(),LN))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>Promise.resolve().then(()=>(NN(),MN))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>Promise.resolve().then(()=>(jN(),PN))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>Promise.resolve().then(()=>(zN(),GN))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>Promise.resolve().then(()=>($N(),HN))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>Promise.resolve().then(()=>(UN(),TN))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>Promise.resolve().then(()=>(qN(),ZN))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>Promise.resolve().then(()=>(YN(),ON))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>Promise.resolve().then(()=>(WN(),KN))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>Promise.resolve().then(()=>(VN(),JN))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>Promise.resolve().then(()=>(e6(),XN))}],t6=Object.fromEntries(Kne.map(e=>[e.id,e.import]));var fa=class extends Error{constructor(t){super(t),this.name="ShikiError"}};var Vp=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Wne(){return 2147483648}function Jne(){return typeof performance<"u"?performance.now():Date.now()}var Vne=(e,t)=>e+(t-e%t)%t;async function Xne(e){let t,n,A={};function a(p){n=p,A.HEAPU8=new Uint8Array(p),A.HEAPU32=new Uint32Array(p)}function o(p,g,b){A.HEAPU8.copyWithin(p,g,g+b)}function r(p){try{return t.grow(p-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function i(p){let g=A.HEAPU8.length;p=p>>>0;let b=Wne();if(p>b)return!1;for(let B=1;B<=4;B*=2){let f=g*(1+.2/B);f=Math.min(f,p+100663296);let m=Math.min(b,Vne(Math.max(p,f),65536));if(r(m))return!0}return!1}let s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(p,g,b=1024){let B=g+b,f=g;for(;p[f]&&!(f>=B);)++f;if(f-g>16&&p.buffer&&s)return s.decode(p.subarray(g,f));let m="";for(;g<f;){let h=p[g++];if(!(h&128)){m+=String.fromCharCode(h);continue}let C=p[g++]&63;if((h&224)===192){m+=String.fromCharCode((h&31)<<6|C);continue}let E=p[g++]&63;if((h&240)===224?h=(h&15)<<12|C<<6|E:h=(h&7)<<18|C<<12|E<<6|p[g++]&63,h<65536)m+=String.fromCharCode(h);else{let Q=h-65536;m+=String.fromCharCode(55296|Q>>10,56320|Q&1023)}}return m}function u(p,g){return p?c(A.HEAPU8,p,g):""}let d={emscripten_get_now:Jne,emscripten_memcpy_big:o,emscripten_resize_heap:i,fd_write:()=>0};async function l(){let g=await e({env:d,wasi_snapshot_preview1:d});t=g.memory,a(t.buffer),Object.assign(A,g),A.UTF8ToString=u}return await l(),A}var Bn=null;function eAe(e){throw new Vp(e.UTF8ToString(e.getLastOnigError()))}var Yb=class e{static _utf8ByteLength(t){let n=0;for(let A=0,a=t.length;A<a;A++){let o=t.charCodeAt(A),r=o,i=!1;if(o>=55296&&o<=56319&&A+1<a){let s=t.charCodeAt(A+1);s>=56320&&s<=57343&&(r=(o-55296<<10)+65536|s-56320,i=!0)}r<=127?n+=1:r<=2047?n+=2:r<=65535?n+=3:n+=4,i&&A++}return n}utf16Length;utf8Length;utf16Value;utf8Value;utf16OffsetToUtf8;utf8OffsetToUtf16;constructor(t){let n=t.length,A=e._utf8ByteLength(t),a=A!==n,o=a?new Uint32Array(n+1):null;a&&(o[n]=A);let r=a?new Uint32Array(A+1):null;a&&(r[A]=n);let i=new Uint8Array(A),s=0;for(let c=0;c<n;c++){let u=t.charCodeAt(c),d=u,l=!1;if(u>=55296&&u<=56319&&c+1<n){let p=t.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+65536|p-56320,l=!0)}a&&(o[c]=s,l&&(o[c+1]=s),d<=127?r[s+0]=c:d<=2047?(r[s+0]=c,r[s+1]=c):d<=65535?(r[s+0]=c,r[s+1]=c,r[s+2]=c):(r[s+0]=c,r[s+1]=c,r[s+2]=c,r[s+3]=c)),d<=127?i[s++]=d:d<=2047?(i[s++]=192|(d&1984)>>>6,i[s++]=128|(d&63)>>>0):d<=65535?(i[s++]=224|(d&61440)>>>12,i[s++]=128|(d&4032)>>>6,i[s++]=128|(d&63)>>>0):(i[s++]=240|(d&1835008)>>>18,i[s++]=128|(d&258048)>>>12,i[s++]=128|(d&4032)>>>6,i[s++]=128|(d&63)>>>0),l&&c++}this.utf16Length=n,this.utf8Length=A,this.utf16Value=t,this.utf8Value=i,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=r}createString(t){let n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}},Kb=class e{static LAST_ID=0;static _sharedPtr=0;static _sharedPtrInUse=!1;id=++e.LAST_ID;_onigBinding;content;utf16Length;utf8Length;utf16OffsetToUtf8;utf8OffsetToUtf16;ptr;constructor(t){if(!Bn)throw new Vp("Must invoke loadWasm first.");this._onigBinding=Bn,this.content=t;let n=new Yb(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=Bn.omalloc(1e4)),e._sharedPtrInUse=!0,Bn.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._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===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}},_k=class{_onigBinding;_ptr;constructor(t){if(!Bn)throw new Vp("Must invoke loadWasm first.");let n=[],A=[];for(let i=0,s=t.length;i<s;i++){let c=new Yb(t[i]);n[i]=c.createString(Bn),A[i]=c.utf8Length}let a=Bn.omalloc(4*t.length);Bn.HEAPU32.set(n,a/4);let o=Bn.omalloc(4*t.length);Bn.HEAPU32.set(A,o/4);let r=Bn.createOnigScanner(a,o,t.length);for(let i=0,s=t.length;i<s;i++)Bn.ofree(n[i]);Bn.ofree(o),Bn.ofree(a),r===0&&eAe(Bn),this._onigBinding=Bn,this._ptr=r}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,A){let a=0;if(typeof A=="number"&&(a=A),typeof t=="string"){t=new Kb(t);let o=this._findNextMatchSync(t,n,!1,a);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,A,a){let o=this._onigBinding,r=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(r===0)return null;let i=o.HEAPU32,s=r/4,c=i[s++],u=i[s++],d=[];for(let l=0;l<u;l++){let p=t.convertUtf8OffsetToUtf16(i[s++]),g=t.convertUtf8OffsetToUtf16(i[s++]);d[l]={start:p,end:g,length:g-p}}return{index:c,captureIndices:d}}};function tAe(e){return typeof e.instantiator=="function"}function nAe(e){return typeof e.default=="function"}function AAe(e){return typeof e.data<"u"}function aAe(e){return typeof Response<"u"&&e instanceof Response}function oAe(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}var Ob;function n6(e){if(Ob)return Ob;async function t(){Bn=await Xne(async n=>{let A=e;return A=await A,typeof A=="function"&&(A=await A(n)),typeof A=="function"&&(A=await A(n)),tAe(A)?A=await A.instantiator(n):nAe(A)?A=await A.default(n):(AAe(A)&&(A=A.data),aAe(A)?typeof WebAssembly.instantiateStreaming=="function"?A=await rAe(A)(n):A=await iAe(A)(n):oAe(A)?A=await Ik(A)(n):A instanceof WebAssembly.Module?A=await Ik(A)(n):"default"in A&&A.default instanceof WebAssembly.Module&&(A=await Ik(A.default)(n))),"instance"in A&&(A=A.instance),"exports"in A&&(A=A.exports),A})}return Ob=t(),Ob}function Ik(e){return t=>WebAssembly.instantiate(e,t)}function rAe(e){return t=>WebAssembly.instantiateStreaming(e,t)}function iAe(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var sAe;function A6(){return sAe}async function Xp(e){return e&&await n6(e),{createScanner(t){return new _k(t)},createString(t){return new Kb(t)}}}var cAe=!1;function Du(e){cAe&&console.trace(`[SHIKI DEPRECATE]: ${e}`)}function uAe(e){return jk(e)}function jk(e){return Array.isArray(e)?dAe(e):typeof e=="object"?lAe(e):e}function dAe(e){let t=[];for(let n=0,A=e.length;n<A;n++)t[n]=jk(e[n]);return t}function lAe(e){let t={};for(let n in e)t[n]=jk(e[n]);return t}function l6(e,...t){return t.forEach(n=>{for(let A in n)e[A]=n[A]}),e}function p6(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?p6(e.substring(0,e.length-1)):e.substr(~t+1)}var xk=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Wb=class{static hasCaptures(e){return e===null?!1:(xk.lastIndex=0,xk.test(e))}static replaceCaptures(e,t,n){return e.replace(xk,(A,a,o,r)=>{let i=n[parseInt(a||o,10)];if(i){let s=t.substring(i.start,i.end);for(;s[0]===".";)s=s.substring(1);switch(r){case"downcase":return s.toLowerCase();case"upcase":return s.toUpperCase();default:return s}}else return A})}};function g6(e,t){return e<t?-1:e>t?1:0}function m6(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,A=t.length;if(n===A){for(let a=0;a<n;a++){let o=g6(e[a],t[a]);if(o!==0)return o}return 0}return n-A}function a6(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 f6(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var b6=class{constructor(e){this.fn=e,this.cache=new Map}get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},ng=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n,this._cachedMatchRoot=new b6(A=>this._root.match(A))}static createFromRawTheme(e,t){return this.createFromParsedTheme(mAe(e),t)}static createFromParsedTheme(e,t){return bAe(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,A=this._cachedMatchRoot.get(t).find(a=>pAe(e.parent,a.parentScopes));return A?new h6(A.fontStyle,A.foreground,A.background):null}},Dk=class Jb{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let A of n)t=new Jb(t,A);return t}static from(...t){let n=null;for(let A=0;A<t.length;A++)n=new Jb(n,t[A]);return n}push(t){return new Jb(this,t)}getSegments(){let t=this,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){let n=[],A=this;for(;A&&A!==t;)n.push(A.scopeName),A=A.parent;return A===t?n.reverse():void 0}};function pAe(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let A=t[n],a=!1;if(A===">"){if(n===t.length-1)return!1;A=t[++n],a=!0}for(;e&&!gAe(e.scopeName,A);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function gAe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var h6=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function mAe(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],A=0;for(let a=0,o=t.length;a<o;a++){let r=t[a];if(!r.settings)continue;let i;if(typeof r.scope=="string"){let d=r.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),i=d.split(",")}else Array.isArray(r.scope)?i=r.scope:i=[""];let s=-1;if(typeof r.settings.fontStyle=="string"){s=0;let d=r.settings.fontStyle.split(" ");for(let l=0,p=d.length;l<p;l++)switch(d[l]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let c=null;typeof r.settings.foreground=="string"&&a6(r.settings.foreground)&&(c=r.settings.foreground);let u=null;typeof r.settings.background=="string"&&a6(r.settings.background)&&(u=r.settings.background);for(let d=0,l=i.length;d<l;d++){let g=i[d].trim().split(" "),b=g[g.length-1],B=null;g.length>1&&(B=g.slice(0,g.length-1),B.reverse()),n[A++]=new fAe(b,B,a,s,c,u)}}return n}var fAe=class{constructor(e,t,n,A,a,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=A,this.foreground=a,this.background=o}},za=(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))(za||{});function bAe(e,t){e.sort((s,c)=>{let u=g6(s.scope,c.scope);return u!==0||(u=m6(s.parentScopes,c.parentScopes),u!==0)?u:s.index-c.index});let n=0,A="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let s=e.shift();s.fontStyle!==-1&&(n=s.fontStyle),s.foreground!==null&&(A=s.foreground),s.background!==null&&(a=s.background)}let o=new hAe(t),r=new h6(n,o.getId(A),o.getId(a)),i=new CAe(new vk(0,null,-1,0,0),[]);for(let s=0,c=e.length;s<c;s++){let u=e[s];i.insert(0,u.scope,u.parentScopes,u.fontStyle,o.getId(u.foreground),o.getId(u.background))}return new ng(o,r,i)}var hAe=class{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)}},BAe=Object.freeze([]),vk=class B6{constructor(t,n,A,a,o){this.scopeDepth=t,this.parentScopes=n||BAe,this.fontStyle=A,this.foreground=a,this.background=o}clone(){return new B6(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let A=0,a=t.length;A<a;A++)n[A]=t[A].clone();return n}acceptOverwrite(t,n,A,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),A!==0&&(this.foreground=A),a!==0&&(this.background=a)}},CAe=class Fk{constructor(t,n=[],A={}){this._mainRule=t,this._children=A,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let A=0,a=0;for(;t.parentScopes[A]===">"&&A++,n.parentScopes[a]===">"&&a++,!(A>=t.parentScopes.length||a>=n.parentScopes.length);){let o=n.parentScopes[a].length-t.parentScopes[A].length;if(o!==0)return o;A++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let A=t.indexOf("."),a,o;if(A===-1?(a=t,o=""):(a=t.substring(0,A),o=t.substring(A+1)),this._children.hasOwnProperty(a))return this._children[a].match(o)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Fk._cmpBySpecificity),n}insert(t,n,A,a,o,r){if(n===""){this._doInsertHere(t,A,a,o,r);return}let i=n.indexOf("."),s,c;i===-1?(s=n,c=""):(s=n.substring(0,i),c=n.substring(i+1));let u;this._children.hasOwnProperty(s)?u=this._children[s]:(u=new Fk(this._mainRule.clone(),vk.cloneArr(this._rulesWithParentScopes)),this._children[s]=u),u.insert(t+1,c,A,a,o,r)}_doInsertHere(t,n,A,a,o){if(n===null){this._mainRule.acceptOverwrite(t,A,a,o);return}for(let r=0,i=this._rulesWithParentScopes.length;r<i;r++){let s=this._rulesWithParentScopes[r];if(m6(s.parentScopes,n)===0){s.acceptOverwrite(t,A,a,o);return}}A===-1&&(A=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new vk(t,n,A,a,o))}},ui=class ba{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=ba.getLanguageId(t),A=ba.getTokenType(t),a=ba.getFontStyle(t),o=ba.getForeground(t),r=ba.getBackground(t);console.log({languageId:n,tokenType:A,fontStyle:a,foreground:o,background:r})}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,A,a,o,r,i){let s=ba.getLanguageId(t),c=ba.getTokenType(t),u=ba.containsBalancedBrackets(t)?1:0,d=ba.getFontStyle(t),l=ba.getForeground(t),p=ba.getBackground(t);return n!==0&&(s=n),A!==8&&(c=A),a!==null&&(u=a?1:0),o!==-1&&(d=o),r!==0&&(l=r),i!==0&&(p=i),(s<<0|c<<8|u<<10|d<<11|l<<15|p<<24)>>>0}};function Xb(e,t){let n=[],A=wAe(e),a=A.next();for(;a!==null;){let s=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":s=1;break;case"L":s=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=A.next()}let c=r();if(n.push({matcher:c,priority:s}),a!==",")break;a=A.next()}return n;function o(){if(a==="-"){a=A.next();let s=o();return c=>!!s&&!s(c)}if(a==="("){a=A.next();let s=i();return a===")"&&(a=A.next()),s}if(o6(a)){let s=[];do s.push(a),a=A.next();while(o6(a));return c=>t(s,c)}return null}function r(){let s=[],c=o();for(;c;)s.push(c),c=o();return u=>s.every(d=>d(u))}function i(){let s=[],c=r();for(;c&&(s.push(c),a==="|"||a===",");){do a=A.next();while(a==="|"||a===",");c=r()}return u=>s.some(d=>d(u))}}function o6(e){return!!e&&!!e.match(/[\w\.:]+/)}function wAe(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let A=n[0];return n=t.exec(e),A}}}function C6(e){typeof e.dispose=="function"&&e.dispose()}var Ag=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},EAe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},yAe=class{constructor(){this._references=[],this._seenReferenceKeys=new Set,this.visitedRule=new Set}get references(){return this._references}add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},QAe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ag(this.initialScopeName)]}processQueue(){let e=this.Q;this.Q=[];let t=new yAe;for(let n of e)kAe(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof Ag){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 kAe(e,t,n,A){let a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let o=n.lookup(t);e instanceof Ag?Vb({baseGrammar:o,selfGrammar:a},A):Sk(e.ruleName,{baseGrammar:o,selfGrammar:a,repository:a.repository},A);let r=n.injections(e.scopeName);if(r)for(let i of r)A.add(new Ag(i))}function Sk(e,t,n){if(t.repository&&t.repository[e]){let A=t.repository[e];eh([A],t,n)}}function Vb(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&eh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&eh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function eh(e,t,n){for(let A of e){if(n.visitedRule.has(A))continue;n.visitedRule.add(A);let a=A.repository?l6({},t.repository,A.repository):t.repository;Array.isArray(A.patterns)&&eh(A.patterns,{...t,repository:a},n);let o=A.include;if(!o)continue;let r=w6(o);switch(r.kind){case 0:Vb({...t,selfGrammar:t.baseGrammar},n);break;case 1:Vb(t,n);break;case 2:Sk(r.ruleName,{...t,repository:a},n);break;case 3:case 4:let i=r.scopeName===t.selfGrammar.scopeName?t.selfGrammar:r.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){let s={baseGrammar:t.baseGrammar,selfGrammar:i,repository:a};r.kind===4?Sk(r.ruleName,s,n):Vb(s,n)}else r.kind===4?n.add(new EAe(r.scopeName,r.ruleName)):n.add(new Ag(r.scopeName));break}}}var IAe=class{constructor(){this.kind=0}},_Ae=class{constructor(){this.kind=1}},xAe=class{constructor(e){this.ruleName=e,this.kind=2}},DAe=class{constructor(e){this.scopeName=e,this.kind=3}},vAe=class{constructor(e,t){this.scopeName=e,this.ruleName=t,this.kind=4}};function w6(e){if(e==="$base")return new IAe;if(e==="$self")return new _Ae;let t=e.indexOf("#");if(t===-1)return new DAe(e);if(t===0)return new xAe(e.substring(1));{let n=e.substring(0,t),A=e.substring(t+1);return new vAe(n,A)}}var FAe=/\\(\d+)/,r6=/\\(\d+)/g,$0e=Symbol("RuleId"),SAe=-1,E6=-2;var rg=class{constructor(e,t,n,A){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Wb.hasCaptures(this._name),this._contentName=A||null,this._contentNameIsCapturing=Wb.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${p6(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:Wb.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Wb.replaceCaptures(this._contentName,e,t)}},LAe=class extends rg{constructor(e,t,n,A,a){super(e,t,n,A),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,A){throw new Error("Not supported!")}},RAe=class extends rg{constructor(e,t,n,A,a){super(e,t,n,null),this._match=new ag(A,this.id),this.captures=a,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,A){return this._getCachedCompiledPatterns(e).compileAG(e,n,A)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new og,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},i6=class extends rg{constructor(e,t,n,A,a){super(e,t,n,A),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,A){return this._getCachedCompiledPatterns(e).compileAG(e,n,A)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new og,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Lk=class extends rg{constructor(e,t,n,A,a,o,r,i,s,c){super(e,t,n,A),this._begin=new ag(a,this.id),this.beginCaptures=o,this._end=new ag(r||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=s||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.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,A){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,A)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new og;for(let 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}},th=class extends rg{constructor(e,t,n,A,a,o,r,i,s){super(e,t,n,A),this._begin=new ag(a,this.id),this.beginCaptures=o,this.whileCaptures=i,this._while=new ag(r,E6),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=s.patterns,this.hasMissingPatterns=s.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,A){return this._getCachedCompiledPatterns(e).compileAG(e,n,A)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new og;for(let 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,A){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,A)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new og,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},y6=class $n{static createCaptureRule(t,n,A,a,o){return t.registerRule(r=>new LAe(n,r,A,a,o))}static getCompiledRuleId(t,n,A){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new RAe(t.$vscodeTextmateLocation,t.id,t.name,t.match,$n._compileCaptures(t.captures,n,A));if(typeof t.begin>"u"){t.repository&&(A=l6({},A,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new i6(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,$n._compilePatterns(o,n,A))}return t.while?new th(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$n._compileCaptures(t.beginCaptures||t.captures,n,A),t.while,$n._compileCaptures(t.whileCaptures||t.captures,n,A),$n._compilePatterns(t.patterns,n,A)):new Lk(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$n._compileCaptures(t.beginCaptures||t.captures,n,A),t.end,$n._compileCaptures(t.endCaptures||t.captures,n,A),t.applyEndPatternLast,$n._compilePatterns(t.patterns,n,A))}),t.id}static _compileCaptures(t,n,A){let a=[];if(t){let o=0;for(let r in t){if(r==="$vscodeTextmateLocation")continue;let i=parseInt(r,10);i>o&&(o=i)}for(let r=0;r<=o;r++)a[r]=null;for(let r in t){if(r==="$vscodeTextmateLocation")continue;let i=parseInt(r,10),s=0;t[r].patterns&&(s=$n.getCompiledRuleId(t[r],n,A)),a[i]=$n.createCaptureRule(n,t[r].$vscodeTextmateLocation,t[r].name,t[r].contentName,s)}}return a}static _compilePatterns(t,n,A){let a=[];if(t)for(let o=0,r=t.length;o<r;o++){let i=t[o],s=-1;if(i.include){let c=w6(i.include);switch(c.kind){case 0:case 1:s=$n.getCompiledRuleId(A[i.include],n,A);break;case 2:let u=A[c.ruleName];u&&(s=$n.getCompiledRuleId(u,n,A));break;case 3:case 4:let d=c.scopeName,l=c.kind===4?c.ruleName:null,p=n.getExternalGrammar(d,A);if(p)if(l){let g=p.repository[l];g&&(s=$n.getCompiledRuleId(g,n,p.repository))}else s=$n.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else s=$n.getCompiledRuleId(i,n,A);if(s!==-1){let c=n.getRule(s),u=!1;if((c instanceof i6||c instanceof Lk||c instanceof th)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;a.push(s)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},ag=class Q6{constructor(t,n){if(t){let A=t.length,a=0,o=[],r=!1;for(let i=0;i<A;i++)if(t.charAt(i)==="\\"&&i+1<A){let c=t.charAt(i+1);c==="z"?(o.push(t.substring(a,i)),o.push("$(?!\\n)(?<!\\n)"),a=i+2):(c==="A"||c==="G")&&(r=!0),i++}this.hasAnchor=r,a===0?this.source=t:(o.push(t.substring(a,A)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,this.hasBackReferences=FAe.test(this.source)}clone(){return new Q6(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){let A=n.map(a=>t.substring(a.start,a.end));return r6.lastIndex=0,this.source.replace(r6,(a,o)=>f6(A[parseInt(o,10)]||""))}_buildAnchorCache(){let t=[],n=[],A=[],a=[],o,r,i,s;for(o=0,r=this.source.length;o<r;o++)i=this.source.charAt(o),t[o]=i,n[o]=i,A[o]=i,a[o]=i,i==="\\"&&o+1<r&&(s=this.source.charAt(o+1),s==="A"?(t[o+1]="\uFFFF",n[o+1]="\uFFFF",A[o+1]="A",a[o+1]="A"):s==="G"?(t[o+1]="\uFFFF",n[o+1]="G",A[o+1]="\uFFFF",a[o+1]="G"):(t[o+1]=s,n[o+1]=s,A[o+1]=s,a[o+1]=s),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:A.join(""),A1_G1:a.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},og=class{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 s6(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 A=this._items.map(a=>a.resolveAnchors(t,n));return new s6(e,A,this._items.map(a=>a.ruleId))}},s6=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
55
55
|
`)}findNextMatchSync(e,t,n){let A=this.scanner.findNextMatchSync(e,t,n);return A?{ruleId:this.rules[A.index],captureIndices:A.captureIndices}:null}},Rk=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Gk=class Mk{constructor(t,n){this._getBasicScopeAttributes=new b6(A=>{let a=this._scopeToLanguage(A),o=this._toStandardTokenType(A);return new Rk(a,o)}),this._defaultAttributes=new Rk(t,8),this._embeddedLanguagesMatcher=new NAe(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Mk._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){let n=t.match(Mk.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!")}};Gk._NULL_SCOPE_METADATA=new Rk(0,0);Gk.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;var MAe=Gk,NAe=class{constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([n,A])=>f6(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},T0e={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},k6=!1,c6=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function I6(e,t,n,A,a,o,r,i){let s=t.content.length,c=!1,u=-1;if(r){let p=PAe(e,t,n,A,a,o);a=p.stack,A=p.linePos,n=p.isFirstLine,u=p.anchorPosition}let d=Date.now();for(;!c;){if(i!==0&&Date.now()-d>i)return new c6(a,!0);l()}return new c6(a,!1);function l(){let p=jAe(e,t,n,A,a,u);if(!p){o.produce(a,s),c=!0;return}let g=p.captureIndices,b=p.matchedRuleId,B=g&&g.length>0?g[0].end>A:!1;if(b===SAe){let f=a.getRule(e);o.produce(a,g[0].start),a=a.withContentNameScopesList(a.nameScopesList),eg(e,t,n,a,o,f.endCaptures,g),o.produce(a,g[0].end);let m=a;if(a=a.parent,u=m.getAnchorPos(),!B&&m.getEnterPos()===A){a=m,o.produce(a,s),c=!0;return}}else{let f=e.getRule(b);o.produce(a,g[0].start);let m=a,h=f.getName(t.content,g),C=a.contentNameScopesList.pushAttributed(h,e);if(a=a.push(b,A,u,g[0].end===s,null,C,C),f instanceof Lk){let E=f;eg(e,t,n,a,o,E.beginCaptures,g),o.produce(a,g[0].end),u=g[0].end;let Q=E.getContentName(t.content,g),y=C.pushAttributed(Q,e);if(a=a.withContentNameScopesList(y),E.endHasBackReferences&&(a=a.withEndRule(E.getEndWithResolvedBackReferences(t.content,g))),!B&&m.hasSameRuleAs(a)){a=a.pop(),o.produce(a,s),c=!0;return}}else if(f instanceof th){let E=f;eg(e,t,n,a,o,E.beginCaptures,g),o.produce(a,g[0].end),u=g[0].end;let Q=E.getContentName(t.content,g),y=C.pushAttributed(Q,e);if(a=a.withContentNameScopesList(y),E.whileHasBackReferences&&(a=a.withEndRule(E.getWhileWithResolvedBackReferences(t.content,g))),!B&&m.hasSameRuleAs(a)){a=a.pop(),o.produce(a,s),c=!0;return}}else if(eg(e,t,n,a,o,f.captures,g),o.produce(a,g[0].end),a=a.pop(),!B){a=a.safePop(),o.produce(a,s),c=!0;return}}g[0].end>A&&(A=g[0].end,n=!1)}}function PAe(e,t,n,A,a,o){let r=a.beginRuleCapturedEOL?0:-1,i=[];for(let s=a;s;s=s.pop()){let c=s.getRule(e);c instanceof th&&i.push({rule:c,stack:s})}for(let s=i.pop();s;s=i.pop()){let{ruleScanner:c,findOptions:u}=HAe(s.rule,e,s.stack.endRule,n,A===r),d=c.findNextMatchSync(t,A,u);if(d){if(d.ruleId!==E6){a=s.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(o.produce(s.stack,d.captureIndices[0].start),eg(e,t,n,s.stack,o,s.rule.whileCaptures,d.captureIndices),o.produce(s.stack,d.captureIndices[0].end),r=d.captureIndices[0].end,d.captureIndices[0].end>A&&(A=d.captureIndices[0].end,n=!1))}else{a=s.stack.pop();break}}return{stack:a,linePos:A,anchorPosition:r,isFirstLine:n}}function jAe(e,t,n,A,a,o){let r=GAe(e,t,n,A,a,o),i=e.getInjections();if(i.length===0)return r;let s=zAe(i,e,t,n,A,a,o);if(!s)return r;if(!r)return s;let c=r.captureIndices[0].start,u=s.captureIndices[0].start;return u<c||s.priorityMatch&&u===c?s:r}function GAe(e,t,n,A,a,o){let r=a.getRule(e),{ruleScanner:i,findOptions:s}=_6(r,e,a.endRule,n,A===o),c=i.findNextMatchSync(t,A,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function zAe(e,t,n,A,a,o,r){let i=Number.MAX_VALUE,s=null,c,u=0,d=o.contentNameScopesList.getScopeNames();for(let l=0,p=e.length;l<p;l++){let g=e[l];if(!g.matcher(d))continue;let b=t.getRule(g.ruleId),{ruleScanner:B,findOptions:f}=_6(b,t,null,A,a===r),m=B.findNextMatchSync(n,a,f);if(!m)continue;let h=m.captureIndices[0].start;if(!(h>=i)&&(i=h,s=m.captureIndices,c=m.ruleId,u=g.priority,i===a))break}return s?{priorityMatch:u===-1,captureIndices:s,matchedRuleId:c}:null}function _6(e,t,n,A,a){if(k6){let r=e.compile(t,n),i=x6(A,a);return{ruleScanner:r,findOptions:i}}return{ruleScanner:e.compileAG(t,n,A,a),findOptions:0}}function HAe(e,t,n,A,a){if(k6){let r=e.compileWhile(t,n),i=x6(A,a);return{ruleScanner:r,findOptions:i}}return{ruleScanner:e.compileWhileAG(t,n,A,a),findOptions:0}}function x6(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function eg(e,t,n,A,a,o,r){if(o.length===0)return;let i=t.content,s=Math.min(o.length,r.length),c=[],u=r[0].end;for(let d=0;d<s;d++){let l=o[d];if(l===null)continue;let p=r[d];if(p.length===0)continue;if(p.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=p.start;)a.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?a.produceFromScopes(c[c.length-1].scopes,p.start):a.produce(A,p.start),l.retokenizeCapturedWithRuleId){let b=l.getName(i,r),B=A.contentNameScopesList.pushAttributed(b,e),f=l.getContentName(i,r),m=B.pushAttributed(f,e),h=A.push(l.retokenizeCapturedWithRuleId,p.start,-1,!1,null,B,m),C=e.createOnigString(i.substring(0,p.end));I6(e,C,n&&p.start===0,p.start,h,a,!1,0),C6(C);continue}let g=l.getName(i,r);if(g!==null){let B=(c.length>0?c[c.length-1].scopes:A.contentNameScopesList).pushAttributed(g,e);c.push(new $Ae(B,p.end))}}for(;c.length>0;)a.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var $Ae=class{constructor(e,t){this.scopes=e,this.endPos=t}};function TAe(e,t,n,A,a,o,r,i){return new ZAe(e,t,n,A,a,o,r,i)}function u6(e,t,n,A,a){let o=Xb(t,nh),r=y6.getCompiledRuleId(n,A,a.repository);for(let i of o)e.push({debugSelector:t,matcher:i.matcher,ruleId:r,grammar:a,priority:i.priority})}function nh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(A=>{for(let a=n;a<t.length;a++)if(UAe(t[a],A))return n=a+1,!0;return!1})}function UAe(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var ZAe=class{constructor(e,t,n,A,a,o,r,i){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=i,this._basicScopeAttributesProvider=new MAe(n,A),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=r,this._grammar=d6(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(let s of Object.keys(a)){let c=Xb(s,nh);for(let u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:a[s]})}}get themeProvider(){return this._grammarRepository}dispose(){for(let 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(){let e={lookup:a=>a===this._rootScopeName?this._grammar:this.getExternalGrammar(a),injections:a=>this._grammarRepository.injections(a)},t=[],n=this._rootScopeName,A=e.lookup(n);if(A){let a=A.injections;if(a)for(let r in a)u6(t,r,a[r],this,A);let o=this._grammarRepository.injections(n);o&&o.forEach(r=>{let i=this.getExternalGrammar(r);if(i){let s=i.injectionSelector;s&&u6(t,s,i,this,i)}})}return t.sort((a,o)=>a.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let 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){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=d6(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let A=this._tokenize(e,t,!1,n);return{tokens:A.lineTokens.getResult(A.ruleStack,A.lineLength),ruleStack:A.ruleStack,stoppedEarly:A.stoppedEarly}}tokenizeLine2(e,t,n=0){let A=this._tokenize(e,t,!0,n);return{tokens:A.lineTokens.getBinaryResult(A.ruleStack,A.lineLength),ruleStack:A.ruleStack,stoppedEarly:A.stoppedEarly}}_tokenize(e,t,n,A){this._rootId===-1&&(this._rootId=y6.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!t||t===Pk.NULL){a=!0;let c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=ui.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),l=this.getRule(this._rootId).getName(null,null),p;l?p=tg.createRootAndLookUpScopeName(l,d,this):p=tg.createRoot("unknown",d),t=new Pk(null,this._rootId,-1,-1,!1,null,p,p)}else a=!1,t.reset();e=e+`
|
|
56
56
|
`;let o=this.createOnigString(e),r=o.content.length,i=new OAe(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),s=I6(this,o,a,0,t,i,!0,A);return C6(o),{lineLength:r,lineTokens:i,ruleStack:s.stack,stoppedEarly:s.stoppedEarly}}};function d6(e,t){return e=uAe(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 tg=class ao{constructor(t,n,A){this.parent=t,this.scopePath=n,this.tokenAttributes=A}static fromExtension(t,n){let A=t,a=t?.scopePath??null;for(let o of n)a=Dk.push(a,o.scopeNames),A=new ao(A,a,o.encodedTokenAttributes);return A}static createRoot(t,n){return new ao(null,new Dk(null,t),n)}static createRootAndLookUpScopeName(t,n,A){let a=A.getMetadataForScope(t),o=new Dk(null,t),r=A.themeProvider.themeMatch(o),i=ao.mergeAttributes(n,a,r);return new ao(null,o,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ao.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,A){let a=-1,o=0,r=0;return A!==null&&(a=A.fontStyle,o=A.foregroundId,r=A.backgroundId),ui.set(t,n.languageId,n.tokenType,null,a,o,r)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ao._pushAttributed(this,t,n);let A=t.split(/ /g),a=this;for(let o of A)a=ao._pushAttributed(a,o,n);return a}static _pushAttributed(t,n,A){let a=A.getMetadataForScope(n),o=t.scopePath.push(n),r=A.themeProvider.themeMatch(o),i=ao.mergeAttributes(t.tokenAttributes,a,r);return new ao(t,o,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){let n=[],A=this;for(;A&&A!==t;)n.push({encodedTokenAttributes:A.tokenAttributes,scopeNames:A.scopePath.getExtensionIfDefined(A.parent?.scopePath??null)}),A=A.parent;return A===t?n.reverse():void 0}},Nk=class vu{constructor(t,n,A,a,o,r,i,s){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=r,this.nameScopesList=i,this.contentNameScopesList=s,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=A,this._anchorPos=a}equals(t){return t===null?!1:vu._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?tg.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(){vu._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,A,a,o,r,i){return new vu(this,t,n,A,a,o,r,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){let 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 vu(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){let A=tg.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new vu(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,A,tg.fromExtension(A,n.contentNameScopesList))}};Nk.NULL=new Nk(null,0,0,0,!1,null,null,null);var Pk=Nk,qAe=class{constructor(e,t){this.allowAny=!1,this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Xb(n,nh).map(A=>A.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Xb(n,nh).map(A=>A.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},OAe=class{constructor(e,t,n,A){this.balancedBracketSelectors=A,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let A=e?.tokenAttributes??0,a=!1;if(this.balancedBracketSelectors?.matchesAlways&&(a=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let o=e?.getScopeNames()??[];for(let r of this._tokenTypeOverrides)r.matcher(o)&&(A=ui.set(A,0,r.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(o))}if(a&&(A=ui.set(A,0,8,a,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===A){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(A),this._lastTokenEndIndex=t;return}let 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);let n=new Uint32Array(this._binaryTokens.length);for(let A=0,a=this._binaryTokens.length;A<a;A++)n[A]=this._binaryTokens[A];return n}},YAe=class{constructor(e,t){this._onigLib=t,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=e}dispose(){for(let 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,A,a){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,TAe(e,o,t,n,A,a,this,this._onigLib))}return this._grammars.get(e)}},D6=class{constructor(e){this._options=e,this._syncRegistry=new YAe(ng.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ng.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new qAe(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,A,a){let o=new QAe(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(r=>this._loadSingleGrammar(r.scopeName)),o.processQueue();return this._grammarForScopeName(e,t,n,A,a)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,A=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,A)}_grammarForScopeName(e,t=0,n=null,A=null,a=null){return this._syncRegistry.grammarForScopeName(e,t,n,A,a)}},Ah=Pk.NULL;var v6=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Wo=class{constructor(t,n,A){this.property=t,this.normal=n,A&&(this.space=A)}};Wo.prototype.property={};Wo.prototype.normal={};Wo.prototype.space=null;function zk(e,t){let n={},A={},a=-1;for(;++a<e.length;)Object.assign(n,e[a].property),Object.assign(A,e[a].normal);return new Wo(n,A,t)}function ig(e){return e.toLowerCase()}var Tn=class{constructor(t,n){this.property=t,this.attribute=n}};Tn.prototype.space=null;Tn.prototype.boolean=!1;Tn.prototype.booleanish=!1;Tn.prototype.overloadedBoolean=!1;Tn.prototype.number=!1;Tn.prototype.commaSeparated=!1;Tn.prototype.spaceSeparated=!1;Tn.prototype.commaOrSpaceSeparated=!1;Tn.prototype.mustUseProperty=!1;Tn.prototype.defined=!1;var sg={};S(sg,{boolean:()=>be,booleanish:()=>zt,commaOrSpaceSeparated:()=>BA,commaSeparated:()=>di,number:()=>j,overloadedBoolean:()=>Hk,spaceSeparated:()=>Ke});var KAe=0,be=Ms(),zt=Ms(),Hk=Ms(),j=Ms(),Ke=Ms(),di=Ms(),BA=Ms();function Ms(){return 2**++KAe}var $k=Object.keys(sg),Ns=class extends Tn{constructor(t,n,A,a){let o=-1;if(super(t,n),F6(this,"space",a),typeof A=="number")for(;++o<$k.length;){let r=$k[o];F6(this,$k[o],(A&sg[r])===sg[r])}}};Ns.prototype.defined=!0;function F6(e,t,n){n&&(e[t]=n)}var WAe={}.hasOwnProperty;function ha(e){let t={},n={},A;for(A in e.properties)if(WAe.call(e.properties,A)){let a=e.properties[A],o=new Ns(A,e.transform(e.attributes||{},A),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(A)&&(o.mustUseProperty=!0),t[A]=o,n[ig(A)]=A,n[ig(o.attribute)]=A}return new Wo(t,n,e.space)}var Tk=ha({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}});var Uk=ha({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function ah(e,t){return t in e?e[t]:t}function oh(e,t){return ah(e,t.toLowerCase())}var Zk=ha({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:oh,properties:{xmlns:null,xmlnsXLink:null}});var qk=ha({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:zt,ariaAutoComplete:null,ariaBusy:zt,ariaChecked:zt,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:Ke,ariaCurrent:null,ariaDescribedBy:Ke,ariaDetails:null,ariaDisabled:zt,ariaDropEffect:Ke,ariaErrorMessage:null,ariaExpanded:zt,ariaFlowTo:Ke,ariaGrabbed:zt,ariaHasPopup:null,ariaHidden:zt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ke,ariaLevel:j,ariaLive:null,ariaModal:zt,ariaMultiLine:zt,ariaMultiSelectable:zt,ariaOrientation:null,ariaOwns:Ke,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:zt,ariaReadOnly:zt,ariaRelevant:null,ariaRequired:zt,ariaRoleDescription:Ke,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:zt,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null}});var S6=ha({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:oh,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:di,acceptCharset:Ke,accessKey:Ke,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:Ke,autoFocus:be,autoPlay:be,blocking:Ke,capture:null,charSet:null,checked:be,cite:null,className:Ke,cols:j,colSpan:null,content:null,contentEditable:zt,controls:be,controlsList:Ke,coords:j|di,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:Hk,draggable:zt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:Ke,height:j,hidden:be,high:j,href:null,hrefLang:null,htmlFor:Ke,httpEquiv:Ke,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:Ke,itemRef:Ke,itemScope:be,itemType:Ke,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,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:be,optimum:j,pattern:null,ping:Ke,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:Ke,required:be,reversed:be,rows:j,rowSpan:j,sandbox:Ke,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:zt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:j,step:null,style:null,tabIndex:j,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:zt,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ke,axis:null,background:null,bgColor:null,border:j,borderColor:null,bottomMargin:j,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:zt,standby:null,summary:null,text:null,topMargin:j,valueType:null,version:null,vAlign:null,vLink:null,vSpace:j,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:j,security:null,unselectable:null}});var L6=ha({space:"svg",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"},transform:ah,properties:{about:BA,accentHeight:j,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:j,amplitude:j,arabicForm:null,ascent:j,attributeName:null,attributeType:null,azimuth:j,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:j,by:null,calcMode:null,capHeight:j,className:Ke,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:j,diffuseConstant:j,direction:null,display:null,dur:null,divisor:j,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:j,enableBackground:null,end:null,event:null,exponent:j,externalResourcesRequired:null,fill:null,fillOpacity:j,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:di,g2:di,glyphName:di,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:j,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:j,horizOriginX:j,horizOriginY:j,id:null,ideographic:j,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:j,k:j,k1:j,k2:j,k3:j,k4:j,kernelMatrix:BA,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:j,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:j,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:j,overlineThickness:j,paintOrder:null,panose1:null,path:null,pathLength:j,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ke,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:BA,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:BA,rev:BA,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:BA,requiredFeatures:BA,requiredFonts:BA,requiredFormats:BA,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:j,specularExponent:j,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:j,strikethroughThickness:j,string:null,stroke:null,strokeDashArray:BA,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:j,strokeOpacity:j,strokeWidth:null,style:null,surfaceScale:j,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:BA,tabIndex:j,tableValues:null,target:null,targetX:j,targetY:j,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:BA,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:j,underlineThickness:j,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:j,values:null,vAlphabetic:j,vMathematical:j,vectorEffect:null,vHanging:j,vIdeographic:j,version:null,vertAdvY:j,vertOriginX:j,vertOriginY:j,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:j,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}});var JAe=/^data[-\w.:]+$/i,R6=/-[a-z]/g,VAe=/[A-Z]/g;function Ok(e,t){let n=ig(t),A=t,a=Tn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&JAe.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(R6,eae);A="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!R6.test(o)){let r=o.replace(VAe,XAe);r.charAt(0)!=="-"&&(r="-"+r),t="data"+r}}a=Ns}return new a(A,t)}function XAe(e){return"-"+e.toLowerCase()}function eae(e){return e.charAt(1).toUpperCase()}var M6=zk([Uk,Tk,Zk,qk,S6],"html"),rh=zk([Uk,Tk,Zk,qk,L6],"svg");var N6={}.hasOwnProperty;function P6(e,t){let n=t||{};function A(a,...o){let r=A.invalid,i=A.handlers;if(a&&N6.call(a,e)){let s=String(a[e]);r=N6.call(i,s)?i[s]:A.unknown}if(r)return r.call(this,a,...o)}return A.handlers=n.handlers||{},A.invalid=n.invalid,A.unknown=n.unknown,A}var tae=/["&'<>`]/g,nae=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Aae=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,aae=/[|\\{}()[\]^$+*?.]/g,j6=new WeakMap;function G6(e,t){if(e=e.replace(t.subset?oae(t.subset):tae,A),t.subset||t.escapeOnly)return e;return e.replace(nae,n).replace(Aae,A);function n(a,o,r){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,r.charCodeAt(o+2),t)}function A(a,o,r){return t.format(a.charCodeAt(0),r.charCodeAt(o+1),t)}}function oae(e){let t=j6.get(e);return t||(t=rae(e),j6.set(e,t)),t}function rae(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(aae,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}var iae=/[\dA-Fa-f]/;function z6(e,t,n){let A="&#x"+e.toString(16).toUpperCase();return n&&t&&!iae.test(String.fromCharCode(t))?A:A+";"}var sae=/\d/;function H6(e,t,n){let A="&#"+String(e);return n&&t&&!sae.test(String.fromCharCode(t))?A:A+";"}var $6=["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"];var ih={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var T6=["cent","copy","divide","gt","lt","not","para","times"];var U6={}.hasOwnProperty,Yk={},sh;for(sh in ih)U6.call(ih,sh)&&(Yk[ih[sh]]=sh);var cae=/[^\dA-Za-z]/;function Z6(e,t,n,A){let a=String.fromCharCode(e);if(U6.call(Yk,a)){let o=Yk[a],r="&"+o;return n&&$6.includes(o)&&!T6.includes(o)&&(!A||t&&t!==61&&cae.test(String.fromCharCode(t)))?r:r+";"}return""}function q6(e,t,n){let A=z6(e,t,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=Z6(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){let o=H6(e,t,n.omitOptionalSemicolons);o.length<A.length&&(A=o)}return a&&(!n.useShortestReferences||a.length<A.length)?a:A}function Jo(e,t){return G6(e,Object.assign({format:q6},t))}var uae=/^>|^->|<!--|-->|--!>|<!-$/g,dae=[">"],lae=["<",">"];function O6(e,t,n,A){return A.settings.bogusComments?"<?"+Jo(e.value,Object.assign({},A.settings.characterReferences,{subset:dae}))+">":"<!--"+e.value.replace(uae,a)+"-->";function a(o){return Jo(o,Object.assign({},A.settings.characterReferences,{subset:lae}))}}function Y6(e,t,n,A){return"<!"+(A.settings.upperDoctype?"DOCTYPE":"doctype")+(A.settings.tightDoctype?"":" ")+"html>"}function Kk(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let A=0,a=n.indexOf(t);for(;a!==-1;)A++,a=n.indexOf(t,a+t.length);return A}function K6(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function W6(e){return e.join(" ").trim()}var pae=/[ \t\n\f\r]/g;function Ps(e){return typeof e=="object"?e.type==="text"?J6(e.value):!1:J6(e)}function J6(e){return e.replace(pae,"")===""}var Zt=V6(1),Wk=V6(-1),gae=[];function V6(e){return t;function t(n,A,a){let o=n?n.children:gae,r=(A||0)+e,i=o[r];if(!a)for(;i&&Ps(i);)r+=e,i=o[r];return i}}var mae={}.hasOwnProperty;function ch(e){return t;function t(n,A,a){return mae.call(e,n.tagName)&&e[n.tagName](n,A,a)}}var cg=ch({body:bae,caption:Jk,colgroup:Jk,dd:wae,dt:Cae,head:Jk,html:fae,li:Bae,optgroup:Eae,option:yae,p:hae,rp:X6,rt:X6,tbody:kae,td:e3,tfoot:Iae,th:e3,thead:Qae,tr:_ae});function Jk(e,t,n){let A=Zt(n,t,!0);return!A||A.type!=="comment"&&!(A.type==="text"&&Ps(A.value.charAt(0)))}function fae(e,t,n){let A=Zt(n,t);return!A||A.type!=="comment"}function bae(e,t,n){let A=Zt(n,t);return!A||A.type!=="comment"}function hae(e,t,n){let A=Zt(n,t);return A?A.type==="element"&&(A.tagName==="address"||A.tagName==="article"||A.tagName==="aside"||A.tagName==="blockquote"||A.tagName==="details"||A.tagName==="div"||A.tagName==="dl"||A.tagName==="fieldset"||A.tagName==="figcaption"||A.tagName==="figure"||A.tagName==="footer"||A.tagName==="form"||A.tagName==="h1"||A.tagName==="h2"||A.tagName==="h3"||A.tagName==="h4"||A.tagName==="h5"||A.tagName==="h6"||A.tagName==="header"||A.tagName==="hgroup"||A.tagName==="hr"||A.tagName==="main"||A.tagName==="menu"||A.tagName==="nav"||A.tagName==="ol"||A.tagName==="p"||A.tagName==="pre"||A.tagName==="section"||A.tagName==="table"||A.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 Bae(e,t,n){let A=Zt(n,t);return!A||A.type==="element"&&A.tagName==="li"}function Cae(e,t,n){let A=Zt(n,t);return!!(A&&A.type==="element"&&(A.tagName==="dt"||A.tagName==="dd"))}function wae(e,t,n){let A=Zt(n,t);return!A||A.type==="element"&&(A.tagName==="dt"||A.tagName==="dd")}function X6(e,t,n){let A=Zt(n,t);return!A||A.type==="element"&&(A.tagName==="rp"||A.tagName==="rt")}function Eae(e,t,n){let A=Zt(n,t);return!A||A.type==="element"&&A.tagName==="optgroup"}function yae(e,t,n){let A=Zt(n,t);return!A||A.type==="element"&&(A.tagName==="option"||A.tagName==="optgroup")}function Qae(e,t,n){let A=Zt(n,t);return!!(A&&A.type==="element"&&(A.tagName==="tbody"||A.tagName==="tfoot"))}function kae(e,t,n){let A=Zt(n,t);return!A||A.type==="element"&&(A.tagName==="tbody"||A.tagName==="tfoot")}function Iae(e,t,n){return!Zt(n,t)}function _ae(e,t,n){let A=Zt(n,t);return!A||A.type==="element"&&A.tagName==="tr"}function e3(e,t,n){let A=Zt(n,t);return!A||A.type==="element"&&(A.tagName==="td"||A.tagName==="th")}var t3=ch({body:vae,colgroup:Fae,head:Dae,html:xae,tbody:Sae});function xae(e){let t=Zt(e,-1);return!t||t.type!=="comment"}function Dae(e){let t=new Set;for(let A of e.children)if(A.type==="element"&&(A.tagName==="base"||A.tagName==="title")){if(t.has(A.tagName))return!1;t.add(A.tagName)}let n=e.children[0];return!n||n.type==="element"}function vae(e){let t=Zt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ps(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Fae(e,t,n){let A=Wk(n,t),a=Zt(e,-1,!0);return n&&A&&A.type==="element"&&A.tagName==="colgroup"&&cg(A,n.children.indexOf(A),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function Sae(e,t,n){let A=Wk(n,t),a=Zt(e,-1);return n&&A&&A.type==="element"&&(A.tagName==="thead"||A.tagName==="tbody")&&cg(A,n.children.indexOf(A),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}var uh={name:[[`
|
|
57
57
|
\f\r &/=>`.split(""),`
|
|
@@ -70,7 +70,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
70
70
|
top: ${s}px !important;
|
|
71
71
|
left: ${c}px !important;
|
|
72
72
|
}
|
|
73
|
-
`),()=>{document.head.removeChild(u)}},[t]),(0,Yz.jsx)(N_,{isPresent:t,childRef:A,sizeRef:a,children:KB.cloneElement(e,{ref:A})})}var Jz=({children:e,initial:t,isPresent:n,onExitComplete:A,custom:a,presenceAffectsLayout:o,mode:r})=>{let i=or(Uce),s=(0,Xs.useId)(),c=(0,Xs.useCallback)(d=>{i.set(d,!0);for(let l of i.values())if(!l)return;A&&A()},[i,A]),u=(0,Xs.useMemo)(()=>({id:s,initial:t,isPresent:n,custom:a,onExitComplete:c,register:d=>(i.set(d,!1),()=>i.delete(d))}),o?[Math.random(),c]:[n,c]);return(0,Xs.useMemo)(()=>{i.forEach((d,l)=>i.set(l,!1))},[n]),Wz.useEffect(()=>{!n&&!i.size&&A&&A()},[n]),r==="popLayout"&&(e=(0,P_.jsx)(Kz,{isPresent:n,children:e})),(0,P_.jsx)(_i.Provider,{value:u,children:e})};function Uce(){return new Map}var WB=w(_(),1),Pg=e=>e.key||"";function j_(e){let t=[];return WB.Children.forEach(e,n=>{(0,WB.isValidElement)(n)&&t.push(n)}),t}var JB=({children:e,exitBeforeEnter:t,custom:n,initial:A=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:r="sync"})=>{aA(!t,"Replace exitBeforeEnter with mode='wait'");let i=(0,uo.useMemo)(()=>j_(e),[e]),s=i.map(Pg),c=(0,uo.useRef)(!0),u=(0,uo.useRef)(i),d=or(()=>new Map),[l,p]=(0,uo.useState)(i),[g,b]=(0,uo.useState)(i);MB(()=>{c.current=!1,u.current=i;for(let m=0;m<g.length;m++){let h=Pg(g[m]);s.includes(h)?d.delete(h):d.get(h)!==!0&&d.set(h,!1)}},[g,s.length,s.join("-")]);let B=[];if(i!==l){let m=[...i];for(let h=0;h<g.length;h++){let C=g[h],E=Pg(C);s.includes(E)||(m.splice(h,0,C),B.push(C))}r==="wait"&&B.length&&(m=B),b(j_(m)),p(i);return}let{forceRender:f}=(0,uo.useContext)(Ad);return(0,jg.jsx)(jg.Fragment,{children:g.map(m=>{let h=Pg(m),C=i===g||s.includes(h),E=()=>{if(d.has(h))d.set(h,!0);else return;let Q=!0;d.forEach(y=>{y||(Q=!1)}),Q&&(f?.(),b(u.current),a&&a())};return(0,jg.jsx)(Jz,{isPresent:C,initial:!c.current||A?void 0:!1,custom:C?void 0:n,presenceAffectsLayout:o,mode:r,onExitComplete:C?void 0:E,children:m},h)})})};function Vz(e,t,n){var A;if(typeof e=="string"){let a=document;t&&(aA(!!t.current,"Scope provided, but no element detected."),a=t.current),n?((A=n[e])!==null&&A!==void 0||(n[e]=a.querySelectorAll(e)),e=n[e]):e=a.querySelectorAll(e)}else e instanceof Element&&(e=[e]);return Array.from(e||[])}var Xz=w(_(),1);function eH(e){return(0,Xz.useEffect)(()=>()=>e(),[])}function tH(e,t=100,n){let A=n({...e,keyframes:[0,t]}),a=Math.min(oB(A),2e4);return{type:"keyframes",ease:o=>A.next(a*o).value/t,duration:Un(a)}}function Gg(e){return typeof e=="object"&&!Array.isArray(e)}function VB(e,t,n,A){return typeof e=="string"&&Gg(t)?Vz(e,n,A):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function G_(e,t,n,A){var a;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:(a=A.get(t))!==null&&a!==void 0?a:e}var nH=(e,t,n)=>{let A=t-e;return((n-e)%A+A)%A+e};function AH(e,t){return Xh(e)?e[nH(0,e.length,t)]:e}function qce(e,t,n){for(let A=0;A<e.length;A++){let a=e[A];a.at>t&&a.at<n&&(Qi(e,a),A--)}}function aH(e,t,n,A,a,o){qce(e,a,o);for(let r=0;r<t.length;r++)e.push({value:t[r],at:De(a,o,A[r]),easing:AH(n,r)})}function oH(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Oce="easeInOut";function sH(e,{defaultTransition:t={},...n}={},A,a){let o=t.duration||.3,r=new Map,i=new Map,s={},c=new Map,u=0,d=0,l=0;for(let p=0;p<e.length;p++){let g=e[p];if(typeof g=="string"){c.set(g,d);continue}else if(!Array.isArray(g)){c.set(g.name,G_(d,g.at,u,c));continue}let[b,B,f={}]=g;f.at!==void 0&&(d=G_(d,f.at,u,c));let m=0,h=(C,E,Q,y=0,k=0)=>{let R=Yce(C),{delay:F=0,times:U=aB(R),type:M="keyframes",...ce}=E,{ease:N=t.ease||"easeOut",duration:te}=E,W=typeof F=="function"?F(y,k):F,ne=R.length,K=yi(M)?M:a?.[M];if(ne<=2&&K){let L=100;if(ne===2&&Jce(R)){let Ae=R[1]-R[0];L=Math.abs(Ae)}let ae={...ce};te!==void 0&&(ae.duration=Cn(te));let ue=tH(ae,L,K);N=ue.ease,te=ue.duration}te??(te=o);let H=d+W,ve=H+te;U.length===1&&U[0]===0&&(U[1]=1);let Re=U.length-R.length;Re>0&&AB(U,Re),R.length===1&&R.unshift(null),aH(Q,R,N,U,H,ve),m=Math.max(W+te,m),l=Math.max(ve,l)};if(Ue(b)){let C=rH(b,i);h(B,f,iH("default",C))}else{let C=VB(b,B,A,s),E=C.length;for(let Q=0;Q<E;Q++){B=B,f=f;let y=C[Q],k=rH(y,i);for(let R in B)h(B[R],Kce(f,R),iH(R,k),Q,E)}}u=d,d+=m}return i.forEach((p,g)=>{for(let b in p){let B=p[b];B.sort(oH);let f=[],m=[],h=[];for(let E=0;E<B.length;E++){let{at:Q,value:y,easing:k}=B[E];f.push(y),m.push(HA(0,l,Q)),h.push(k||"easeOut")}m[0]!==0&&(m.unshift(0),f.unshift(f[0]),h.unshift(Oce)),m[m.length-1]!==1&&(m.push(1),f.push(null)),r.has(g)||r.set(g,{keyframes:{},transition:{}});let C=r.get(g);C.keyframes[b]=f,C.transition[b]={...t,duration:l,ease:h,times:m,...n}}}),r}function rH(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function iH(e,t){return t[e]||(t[e]=[]),t[e]}function Yce(e){return Array.isArray(e)?e:[e]}function Kce(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Wce=e=>typeof e=="number",Jce=e=>e.every(Wce);function Vce(e,t){return e in t}var XB=class extends Bd{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(Vce(n,t)){let A=t[n];if(typeof A=="string"||typeof A=="number")return A}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return ot()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}};function cH(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=IB(e)?new Ed(t):new wd(t);n.mount(e),rr.set(e,n)}function uH(e){let t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new XB(t);n.mount(e),rr.set(e,n)}function Xce(e,t){return Ue(e)||typeof e=="number"||typeof e=="string"&&!Gg(t)}function eC(e,t,n,A){let a=[];if(Xce(e,t))a.push(_B(e,Gg(t)&&t.default||t,n&&(n.default||n)));else{let o=VB(e,t,A),r=o.length;aA(!!r,"No valid elements provided.");for(let i=0;i<r;i++){let s=o[i],c=s instanceof Element?cH:uH;rr.has(s)||c(s);let u=rr.get(s),d={...n};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(i,r)),a.push(...Xu(u,{...t,transition:d},{}))}}return a}function dH(e,t,n){let A=[];return sH(e,t,n,{spring:Zu}).forEach(({keyframes:o,transition:r},i)=>{A.push(...eC(i,o,r))}),A}function eue(e){return Array.isArray(e)&&Array.isArray(e[0])}function z_(e){function t(n,A,a){let o=[];eue(n)?o=dH(n,A,e):o=eC(n,A,a,e);let r=new Ku(o);return e&&e.animations.push(r),r}return t}var qPe=z_();function vi(){let e=or(()=>({current:null,animations:[]})),t=or(()=>z_(e));return eH(()=>{e.animations.forEach(n=>n.stop())}),[e,t]}var de=w(I(),1),tue=({item:e,specOptions:t})=>{if(e.to&&!e.to.mainImporter){let[n,A]=qo(e.to.id);switch(n){case"registry":{for(let[a,o]of Object.entries(t["scope-registries"]))if(e.to.name?.startsWith(a))return(0,de.jsx)("div",{children:(0,de.jsx)(Xe,{children:(0,de.jsxs)(et,{children:[(0,de.jsxs)(Qt,{className:"px-1 py-1 text-xs text-muted-foreground font-mono m-0 align-baseline truncate",children:[(0,de.jsx)("span",{children:"registered-scope"}),(0,de.jsxs)("span",{children:[e.title,"@",e.version]})]}),(0,de.jsx)(Oe,{children:String(o)})]})})});return(0,de.jsx)("div",{children:(0,de.jsx)(Xe,{children:(0,de.jsxs)(et,{children:[(0,de.jsxs)(Qt,{className:"px-1 py-1 text-xs text-muted-foreground font-mono m-0 align-baseline truncate",children:[(0,de.jsxs)("span",{children:[A||"npm",":"]}),(0,de.jsxs)("span",{children:[e.title,"@",e.version]})]}),(0,de.jsx)(Oe,{children:A&&t.registries[A]?t.registries[A]:t.registry||Ut.defaultRegistry})]})})})}case"git":case"workspace":case"file":case"remote":return(0,de.jsx)("div",{children:A})}}return""},lH=({item:e})=>{let t=D(s=>s.specOptions),n=D(s=>s.updateLinePositionReference),A=(0,ec.useRef)(null),[a,o]=(0,ec.useState)({}),r=D(s=>s.stamp);(0,ec.useEffect)(()=>{let s=()=>{let c=A.current?.getBoundingClientRect();c?.top&&n(c.top)};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)}),(0,ec.useEffect)(()=>{async function s(){if(!e.to?.name)return;let c=EL(e.to.id,e.to.name,t),u=e.to.manifest??{};for await(let d of xj(c,u))o({...a,...d})}s()},[r]);let i=()=>{o({...a,publisherAvatar:void 0})};return(0,de.jsxs)("div",{className:"relative",children:[(0,de.jsxs)(Ls,{className:"relative my-4 border-muted-foreground",children:[(0,de.jsxs)("div",{className:"flex justify-stretch gap-4 w-full p-6",children:[(0,de.jsxs)(Kt.div,{className:"flex gap-4 grow items-start w-full",initial:{opacity:0},animate:{opacity:1},children:[(0,de.jsxs)(zI,{className:"size-16 rounded-lg border border-solid border-neutral-200",children:[a.favicon?(0,de.jsx)(Kt.img,{src:a.favicon.src,alt:a.favicon.alt,initial:{opacity:0},animate:{opacity:1}}):"",(0,de.jsx)(HI,{className:"rounded-lg border-none",children:e.to?.mainImporter?(0,de.jsx)(Ja,{size:24}):(0,de.jsx)(Gl,{size:24})})]}),(0,de.jsxs)("div",{className:"flex flex-col",children:[(0,de.jsxs)("div",{className:"mt-2",children:[(0,de.jsxs)("span",{className:`${e.title.length<9?"text-3xl":e.title.length<18?"text-xl":"text-md"} font-medium`,children:[e.title," "]}),(0,de.jsx)("span",{className:`${e.title.length<9?"text-xl":e.title.length<18?"text-lg":"text-sm"} font-medium text-muted-foreground mb-[1px]`,children:e.version})]}),t?(0,de.jsx)(tue,{item:e,specOptions:t}):""]})]}),(0,de.jsxs)("div",{className:"flex flex-col justify-end w-full gap-4 mt-4",children:[a.downloads?.weekly?(0,de.jsx)(Kt.div,{className:"flex flex-row-reverse",initial:{opacity:0},animate:{opacity:1},children:(0,de.jsxs)("span",{className:"text-md font-medium text-muted-foreground text-right",children:[(0,de.jsxs)("span",{className:"text-foreground",children:[a.downloads.weekly.toLocaleString()," ","Downloads"]})," ","Last Week"]})}):"",(0,de.jsxs)("div",{className:"flex flex-row-reverse items-center gap-2",children:[a.publisherAvatar?.src?(0,de.jsx)(Kt.img,{className:"size-8 rounded-full",src:a.publisherAvatar.src,alt:a.publisherAvatar.alt,onError:i,initial:{opacity:0},animate:{opacity:1}}):"",a.publisher?.name?(0,de.jsxs)(Kt.div,{className:"text-sm font-medium",initial:{opacity:0},animate:{opacity:1},children:[(0,de.jsxs)("span",{className:"text-xs text-muted-foreground mb-[1px]",children:["Published by:"," "]}),(0,de.jsx)("span",{children:a.publisher.name})]}):""]})]})]}),e.to?.manifest?.description||a.author?.name?(0,de.jsxs)("div",{className:"px-6 pb-6 -mt-6",children:[e.to?.manifest?.description?(0,de.jsx)(OQ,{className:"grow content-center py-2",children:e.to.manifest.description}):"",a.author?.name?(0,de.jsx)(Kt.div,{className:"flex items-center gap-2",initial:{opacity:0},animate:{opacity:1},children:(0,de.jsxs)("span",{className:"text-xs font-medium text-muted-foreground",children:["Authored by: ",a.author.name]})}):""]}):"",(0,de.jsx)("div",{className:"px-4 pb-4 w-full",children:(0,de.jsxs)(eM,{defaultValue:"package.json",children:[(0,de.jsx)(yk,{className:"grid w-full grid-cols-2",children:(0,de.jsxs)(Qk,{value:"package.json",className:"w-36",children:[(0,de.jsx)(Dl,{size:16,className:"mr-2"}),"package.json"]})}),(0,de.jsx)(kk,{value:"package.json",children:(0,de.jsx)(Ij,{code:e.to?.manifest?JSON.stringify(e.to.manifest,null,2):"",lang:"json"})})]})})]}),e.to?.edgesOut&&e.to.edgesOut.size>0?(0,de.jsx)("div",{ref:A,className:"absolute border-t border-solid border-neutral-300 dark:border-neutral-600 rounded-tr-sm w-4 top-[44px] -right-4"}):""]})};var pH=w(I(),1),Fi=({children:e,className:t,...n})=>(0,pH.jsx)("div",{className:v("pt-6 text-md flex flex-row items-center font-medium",t),...n,children:e});var nc=w(_(),1);var oC=w(_(),1);var bH=w(_(),1);var gH=w(_(),1);var mH=w(I(),1),nue="Label",fH=gH.forwardRef((e,t)=>(0,mH.jsx)(Z.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));fH.displayName=nue;var H_=fH;var hH=w(I(),1),aue=VA("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),zg=bH.forwardRef(({className:e,...t},n)=>(0,hH.jsx)(H_,{ref:n,className:v(aue(),e),...t}));zg.displayName=H_.displayName;var Ri=w(_(),1);var Y=w(_(),1),Y_=w(Lr(),1);function $_(e,[t,n]){return Math.min(n,Math.max(t,e))}var le=w(I(),1),oue=[" ","Enter","ArrowUp","ArrowDown"],rue=[" ","Enter"],$g="Select",[nC,AC,iue]=ri($g),[yd,$je]=Pt($g,[iue,aa]),aC=aa(),[sue,Si]=yd($g),[cue,uue]=yd($g),BH=e=>{let{__scopeSelect:t,children:n,open:A,defaultOpen:a,onOpenChange:o,value:r,defaultValue:i,onValueChange:s,dir:c,name:u,autoComplete:d,disabled:l,required:p,form:g}=e,b=aC(t),[B,f]=Y.useState(null),[m,h]=Y.useState(null),[C,E]=Y.useState(!1),Q=ii(c),[y=!1,k]=Tt({prop:A,defaultProp:a,onChange:o}),[R,F]=Tt({prop:r,defaultProp:i,onChange:s}),U=Y.useRef(null),M=B?g||!!B.closest("form"):!0,[ce,N]=Y.useState(new Set),te=Array.from(ce).map(W=>W.props.value).join(";");return(0,le.jsx)(jo,{...b,children:(0,le.jsxs)(sue,{required:p,scope:t,trigger:B,onTriggerChange:f,valueNode:m,onValueNodeChange:h,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:Pe(),value:R,onValueChange:F,open:y,onOpenChange:k,dir:Q,triggerPointerDownPosRef:U,disabled:l,children:[(0,le.jsx)(nC.Provider,{scope:t,children:(0,le.jsx)(cue,{scope:e.__scopeSelect,onNativeOptionAdd:Y.useCallback(W=>{N(ne=>new Set(ne).add(W))},[]),onNativeOptionRemove:Y.useCallback(W=>{N(ne=>{let K=new Set(ne);return K.delete(W),K})},[]),children:n})}),M?(0,le.jsxs)(UH,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:R,onChange:W=>F(W.target.value),disabled:l,form:g,children:[R===void 0?(0,le.jsx)("option",{value:""}):null,Array.from(ce)]},te):null]})})};BH.displayName=$g;var CH="SelectTrigger",wH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:A=!1,...a}=e,o=aC(n),r=Si(CH,n),i=r.disabled||A,s=pe(t,r.onTriggerChange),c=AC(n),u=Y.useRef("touch"),[d,l,p]=ZH(b=>{let B=c().filter(h=>!h.disabled),f=B.find(h=>h.value===r.value),m=qH(B,b,f);m!==void 0&&r.onValueChange(m.value)}),g=b=>{i||(r.onOpenChange(!0),p()),b&&(r.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return(0,le.jsx)(Go,{asChild:!0,...o,children:(0,le.jsx)(Z.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":TH(r.value)?"":void 0,...a,ref:s,onClick:z(a.onClick,b=>{b.currentTarget.focus(),u.current!=="mouse"&&g(b)}),onPointerDown:z(a.onPointerDown,b=>{u.current=b.pointerType;let B=b.target;B.hasPointerCapture(b.pointerId)&&B.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(g(b),b.preventDefault())}),onKeyDown:z(a.onKeyDown,b=>{let B=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&l(b.key),!(B&&b.key===" ")&&oue.includes(b.key)&&(g(),b.preventDefault())})})})});wH.displayName=CH;var EH="SelectValue",yH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,className:A,style:a,children:o,placeholder:r="",...i}=e,s=Si(EH,n),{onValueNodeHasChildrenChange:c}=s,u=o!==void 0,d=pe(t,s.onValueNodeChange);return Ne(()=>{c(u)},[c,u]),(0,le.jsx)(Z.span,{...i,ref:d,style:{pointerEvents:"none"},children:TH(s.value)?(0,le.jsx)(le.Fragment,{children:r}):o})});yH.displayName=EH;var due="SelectIcon",QH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,children:A,...a}=e;return(0,le.jsx)(Z.span,{"aria-hidden":!0,...a,ref:t,children:A||"\u25BC"})});QH.displayName=due;var lue="SelectPortal",kH=e=>(0,le.jsx)(LA,{asChild:!0,...e});kH.displayName=lue;var tc="SelectContent",IH=Y.forwardRef((e,t)=>{let n=Si(tc,e.__scopeSelect),[A,a]=Y.useState();if(Ne(()=>{a(new DocumentFragment)},[]),!n.open){let o=A;return o?Y_.createPortal((0,le.jsx)(_H,{scope:e.__scopeSelect,children:(0,le.jsx)(nC.Slot,{scope:e.__scopeSelect,children:(0,le.jsx)("div",{children:e.children})})}),o):null}return(0,le.jsx)(xH,{...e,ref:t})});IH.displayName=tc;var Ta=10,[_H,Li]=yd(tc),pue="SelectContentImpl",xH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,position:A="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:r,side:i,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:l,collisionPadding:p,sticky:g,hideWhenDetached:b,avoidCollisions:B,...f}=e,m=Si(tc,n),[h,C]=Y.useState(null),[E,Q]=Y.useState(null),y=pe(t,$=>C($)),[k,R]=Y.useState(null),[F,U]=Y.useState(null),M=AC(n),[ce,N]=Y.useState(!1),te=Y.useRef(!1);Y.useEffect(()=>{if(h)return Zr(h)},[h]),Ur();let W=Y.useCallback($=>{let[_e,...Dt]=M().map(Xt=>Xt.ref.current),[Te]=Dt.slice(-1),Et=document.activeElement;for(let Xt of $)if(Xt===Et||(Xt?.scrollIntoView({block:"nearest"}),Xt===_e&&E&&(E.scrollTop=0),Xt===Te&&E&&(E.scrollTop=E.scrollHeight),Xt?.focus(),document.activeElement!==Et))return},[M,E]),ne=Y.useCallback(()=>W([k,h]),[W,k,h]);Y.useEffect(()=>{ce&&ne()},[ce,ne]);let{onOpenChange:K,triggerPointerDownPosRef:H}=m;Y.useEffect(()=>{if(h){let $={x:0,y:0},_e=Te=>{$={x:Math.abs(Math.round(Te.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(Te.pageY)-(H.current?.y??0))}},Dt=Te=>{$.x<=10&&$.y<=10?Te.preventDefault():h.contains(Te.target)||K(!1),document.removeEventListener("pointermove",_e),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",_e),document.addEventListener("pointerup",Dt,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",_e),document.removeEventListener("pointerup",Dt,{capture:!0})}}},[h,K,H]),Y.useEffect(()=>{let $=()=>K(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[K]);let[ve,Re]=ZH($=>{let _e=M().filter(Et=>!Et.disabled),Dt=_e.find(Et=>Et.ref.current===document.activeElement),Te=qH(_e,$,Dt);Te&&setTimeout(()=>Te.ref.current.focus())}),L=Y.useCallback(($,_e,Dt)=>{let Te=!te.current&&!Dt;(m.value!==void 0&&m.value===_e||Te)&&(R($),Te&&(te.current=!0))},[m.value]),ae=Y.useCallback(()=>h?.focus(),[h]),ue=Y.useCallback(($,_e,Dt)=>{let Te=!te.current&&!Dt;(m.value!==void 0&&m.value===_e||Te)&&U($)},[m.value]),Ae=A==="popper"?T_:DH,Qe=Ae===T_?{side:i,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:l,collisionPadding:p,sticky:g,hideWhenDetached:b,avoidCollisions:B}:{};return(0,le.jsx)(_H,{scope:n,content:h,viewport:E,onViewportChange:Q,itemRefCallback:L,selectedItem:k,onItemLeave:ae,itemTextRefCallback:ue,focusSelectedItem:ne,selectedItemText:F,position:A,isPositioned:ce,searchRef:ve,children:(0,le.jsx)(Lo,{as:Nt,allowPinchZoom:!0,children:(0,le.jsx)(So,{asChild:!0,trapped:m.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:z(a,$=>{m.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:(0,le.jsx)(ea,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:(0,le.jsx)(Ae,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:$=>$.preventDefault(),...f,...Qe,onPlaced:()=>N(!0),ref:y,style:{display:"flex",flexDirection:"column",outline:"none",...f.style},onKeyDown:z(f.onKeyDown,$=>{let _e=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!_e&&$.key.length===1&&Re($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Te=M().filter(Et=>!Et.disabled).map(Et=>Et.ref.current);if(["ArrowUp","End"].includes($.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){let Et=$.target,Xt=Te.indexOf(Et);Te=Te.slice(Xt+1)}setTimeout(()=>W(Te)),$.preventDefault()}})})})})})})});xH.displayName=pue;var gue="SelectItemAlignedPosition",DH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:A,...a}=e,o=Si(tc,n),r=Li(tc,n),[i,s]=Y.useState(null),[c,u]=Y.useState(null),d=pe(t,y=>u(y)),l=AC(n),p=Y.useRef(!1),g=Y.useRef(!0),{viewport:b,selectedItem:B,selectedItemText:f,focusSelectedItem:m}=r,h=Y.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&c&&b&&B&&f){let y=o.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),R=o.valueNode.getBoundingClientRect(),F=f.getBoundingClientRect();if(o.dir!=="rtl"){let Et=F.left-k.left,Xt=R.left-Et,UA=y.left-Xt,Gi=y.width+UA,BC=Math.max(Gi,k.width),CC=window.innerWidth-Ta,wC=$_(Xt,[Ta,Math.max(Ta,CC-BC)]);i.style.minWidth=Gi+"px",i.style.left=wC+"px"}else{let Et=k.right-F.right,Xt=window.innerWidth-R.right-Et,UA=window.innerWidth-y.right-Xt,Gi=y.width+UA,BC=Math.max(Gi,k.width),CC=window.innerWidth-Ta,wC=$_(Xt,[Ta,Math.max(Ta,CC-BC)]);i.style.minWidth=Gi+"px",i.style.right=wC+"px"}let U=l(),M=window.innerHeight-Ta*2,ce=b.scrollHeight,N=window.getComputedStyle(c),te=parseInt(N.borderTopWidth,10),W=parseInt(N.paddingTop,10),ne=parseInt(N.borderBottomWidth,10),K=parseInt(N.paddingBottom,10),H=te+W+ce+K+ne,ve=Math.min(B.offsetHeight*5,H),Re=window.getComputedStyle(b),L=parseInt(Re.paddingTop,10),ae=parseInt(Re.paddingBottom,10),ue=y.top+y.height/2-Ta,Ae=M-ue,Qe=B.offsetHeight/2,$=B.offsetTop+Qe,_e=te+W+$,Dt=H-_e;if(_e<=ue){let Et=U.length>0&&B===U[U.length-1].ref.current;i.style.bottom="0px";let Xt=c.clientHeight-b.offsetTop-b.offsetHeight,UA=Math.max(Ae,Qe+(Et?ae:0)+Xt+ne),Gi=_e+UA;i.style.height=Gi+"px"}else{let Et=U.length>0&&B===U[0].ref.current;i.style.top="0px";let UA=Math.max(ue,te+b.offsetTop+(Et?L:0)+Qe)+Dt;i.style.height=UA+"px",b.scrollTop=_e-ue+b.offsetTop}i.style.margin=`${Ta}px 0`,i.style.minHeight=ve+"px",i.style.maxHeight=M+"px",A?.(),requestAnimationFrame(()=>p.current=!0)}},[l,o.trigger,o.valueNode,i,c,b,B,f,o.dir,A]);Ne(()=>h(),[h]);let[C,E]=Y.useState();Ne(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);let Q=Y.useCallback(y=>{y&&g.current===!0&&(h(),m?.(),g.current=!1)},[h,m]);return(0,le.jsx)(fue,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:p,onScrollButtonChange:Q,children:(0,le.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:(0,le.jsx)(Z.div,{...a,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});DH.displayName=gue;var mue="SelectPopperPosition",T_=Y.forwardRef((e,t)=>{let{__scopeSelect:n,align:A="start",collisionPadding:a=Ta,...o}=e,r=aC(n);return(0,le.jsx)(Kr,{...r,...o,ref:t,align:A,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});T_.displayName=mue;var[fue,K_]=yd(tc,{}),U_="SelectViewport",vH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:A,...a}=e,o=Li(U_,n),r=K_(U_,n),i=pe(t,o.onViewportChange),s=Y.useRef(0);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:A}),(0,le.jsx)(nC.Slot,{scope:n,children:(0,le.jsx)(Z.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:z(a.onScroll,c=>{let u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:l}=r;if(l?.current&&d){let p=Math.abs(s.current-u.scrollTop);if(p>0){let g=window.innerHeight-Ta*2,b=parseFloat(d.style.minHeight),B=parseFloat(d.style.height),f=Math.max(b,B);if(f<g){let m=f+p,h=Math.min(g,m),C=m-h;d.style.height=h+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}s.current=u.scrollTop})})})]})});vH.displayName=U_;var FH="SelectGroup",[bue,hue]=yd(FH),Bue=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e,a=Pe();return(0,le.jsx)(bue,{scope:n,id:a,children:(0,le.jsx)(Z.div,{role:"group","aria-labelledby":a,...A,ref:t})})});Bue.displayName=FH;var SH="SelectLabel",LH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e,a=hue(SH,n);return(0,le.jsx)(Z.div,{id:a.id,...A,ref:t})});LH.displayName=SH;var tC="SelectItem",[Cue,RH]=yd(tC),MH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,value:A,disabled:a=!1,textValue:o,...r}=e,i=Si(tC,n),s=Li(tC,n),c=i.value===A,[u,d]=Y.useState(o??""),[l,p]=Y.useState(!1),g=pe(t,m=>s.itemRefCallback?.(m,A,a)),b=Pe(),B=Y.useRef("touch"),f=()=>{a||(i.onValueChange(A),i.onOpenChange(!1))};if(A==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,le.jsx)(Cue,{scope:n,value:A,disabled:a,textId:b,isSelected:c,onItemTextChange:Y.useCallback(m=>{d(h=>h||(m?.textContent??"").trim())},[]),children:(0,le.jsx)(nC.ItemSlot,{scope:n,value:A,disabled:a,textValue:u,children:(0,le.jsx)(Z.div,{role:"option","aria-labelledby":b,"data-highlighted":l?"":void 0,"aria-selected":c&&l,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...r,ref:g,onFocus:z(r.onFocus,()=>p(!0)),onBlur:z(r.onBlur,()=>p(!1)),onClick:z(r.onClick,()=>{B.current!=="mouse"&&f()}),onPointerUp:z(r.onPointerUp,()=>{B.current==="mouse"&&f()}),onPointerDown:z(r.onPointerDown,m=>{B.current=m.pointerType}),onPointerMove:z(r.onPointerMove,m=>{B.current=m.pointerType,a?s.onItemLeave?.():B.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(r.onPointerLeave,m=>{m.currentTarget===document.activeElement&&s.onItemLeave?.()}),onKeyDown:z(r.onKeyDown,m=>{s.searchRef?.current!==""&&m.key===" "||(rue.includes(m.key)&&f(),m.key===" "&&m.preventDefault())})})})})});MH.displayName=tC;var Hg="SelectItemText",NH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,className:A,style:a,...o}=e,r=Si(Hg,n),i=Li(Hg,n),s=RH(Hg,n),c=uue(Hg,n),[u,d]=Y.useState(null),l=pe(t,f=>d(f),s.onItemTextChange,f=>i.itemTextRefCallback?.(f,s.value,s.disabled)),p=u?.textContent,g=Y.useMemo(()=>(0,le.jsx)("option",{value:s.value,disabled:s.disabled,children:p},s.value),[s.disabled,s.value,p]),{onNativeOptionAdd:b,onNativeOptionRemove:B}=c;return Ne(()=>(b(g),()=>B(g)),[b,B,g]),(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(Z.span,{id:s.textId,...o,ref:l}),s.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Y_.createPortal(o.children,r.valueNode):null]})});NH.displayName=Hg;var PH="SelectItemIndicator",jH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e;return RH(PH,n).isSelected?(0,le.jsx)(Z.span,{"aria-hidden":!0,...A,ref:t}):null});jH.displayName=PH;var Z_="SelectScrollUpButton",GH=Y.forwardRef((e,t)=>{let n=Li(Z_,e.__scopeSelect),A=K_(Z_,e.__scopeSelect),[a,o]=Y.useState(!1),r=pe(t,A.onScrollButtonChange);return Ne(()=>{if(n.viewport&&n.isPositioned){let s=function(){let u=c.scrollTop>0;o(u)};var i=s;let c=n.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),a?(0,le.jsx)(HH,{...e,ref:r,onAutoScroll:()=>{let{viewport:i,selectedItem:s}=n;i&&s&&(i.scrollTop=i.scrollTop-s.offsetHeight)}}):null});GH.displayName=Z_;var q_="SelectScrollDownButton",zH=Y.forwardRef((e,t)=>{let n=Li(q_,e.__scopeSelect),A=K_(q_,e.__scopeSelect),[a,o]=Y.useState(!1),r=pe(t,A.onScrollButtonChange);return Ne(()=>{if(n.viewport&&n.isPositioned){let s=function(){let u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;o(d)};var i=s;let c=n.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),a?(0,le.jsx)(HH,{...e,ref:r,onAutoScroll:()=>{let{viewport:i,selectedItem:s}=n;i&&s&&(i.scrollTop=i.scrollTop+s.offsetHeight)}}):null});zH.displayName=q_;var HH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:A,...a}=e,o=Li("SelectScrollButton",n),r=Y.useRef(null),i=AC(n),s=Y.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return Y.useEffect(()=>()=>s(),[s]),Ne(()=>{i().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),(0,le.jsx)(Z.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:z(a.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(A,50))}),onPointerMove:z(a.onPointerMove,()=>{o.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(A,50))}),onPointerLeave:z(a.onPointerLeave,()=>{s()})})}),wue="SelectSeparator",$H=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e;return(0,le.jsx)(Z.div,{"aria-hidden":!0,...A,ref:t})});$H.displayName=wue;var O_="SelectArrow",Eue=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e,a=aC(n),o=Si(O_,n),r=Li(O_,n);return o.open&&r.position==="popper"?(0,le.jsx)(Wr,{...a,...A,ref:t}):null});Eue.displayName=O_;function TH(e){return e===""||e===void 0}var UH=Y.forwardRef((e,t)=>{let{value:n,...A}=e,a=Y.useRef(null),o=pe(t,a),r=ab(n);return Y.useEffect(()=>{let i=a.current,s=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(s,"value").set;if(r!==n&&u){let d=new Event("change",{bubbles:!0});u.call(i,n),i.dispatchEvent(d)}},[r,n]),(0,le.jsx)(ms,{asChild:!0,children:(0,le.jsx)("select",{...A,ref:o,defaultValue:n})})});UH.displayName="BubbleSelect";function ZH(e){let t=Je(e),n=Y.useRef(""),A=Y.useRef(0),a=Y.useCallback(r=>{let i=n.current+r;t(i),function s(c){n.current=c,window.clearTimeout(A.current),c!==""&&(A.current=window.setTimeout(()=>s(""),1e3))}(i)},[t]),o=Y.useCallback(()=>{n.current="",window.clearTimeout(A.current)},[]);return Y.useEffect(()=>()=>window.clearTimeout(A.current),[]),[n,a,o]}function qH(e,t,n){let a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1,r=yue(e,Math.max(o,0));a.length===1&&(r=r.filter(c=>c!==n));let s=r.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return s!==n?s:void 0}function yue(e,t){return e.map((n,A)=>e[(t+A)%e.length])}var OH=BH,W_=wH,YH=yH,KH=QH,WH=kH,J_=IH,JH=vH;var V_=LH,X_=MH,VH=NH,XH=jH,ex=GH,tx=zH,nx=$H;var Wt=w(I(),1),e$=OH;var t$=YH,Ax=Ri.forwardRef(({className:e,children:t,...n},A)=>(0,Wt.jsxs)(W_,{ref:A,className:v("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,(0,Wt.jsx)(KH,{asChild:!0,children:(0,Wt.jsx)(va,{className:"h-4 w-4 opacity-50"})})]}));Ax.displayName=W_.displayName;var n$=Ri.forwardRef(({className:e,...t},n)=>(0,Wt.jsx)(ex,{ref:n,className:v("flex cursor-default items-center justify-center py-1",e),...t,children:(0,Wt.jsx)(_l,{className:"h-4 w-4"})}));n$.displayName=ex.displayName;var A$=Ri.forwardRef(({className:e,...t},n)=>(0,Wt.jsx)(tx,{ref:n,className:v("flex cursor-default items-center justify-center py-1",e),...t,children:(0,Wt.jsx)(va,{className:"h-4 w-4"})}));A$.displayName=tx.displayName;var ax=Ri.forwardRef(({className:e,children:t,position:n="popper",...A},a)=>(0,Wt.jsx)(WH,{children:(0,Wt.jsxs)(J_,{ref:a,className:v("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...A,children:[(0,Wt.jsx)(n$,{}),(0,Wt.jsx)(JH,{className:v("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),(0,Wt.jsx)(A$,{})]})}));ax.displayName=J_.displayName;var kue=Ri.forwardRef(({className:e,...t},n)=>(0,Wt.jsx)(V_,{ref:n,className:v("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));kue.displayName=V_.displayName;var Qd=Ri.forwardRef(({className:e,children:t,...n},A)=>(0,Wt.jsxs)(X_,{ref:A,className:v("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[(0,Wt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Wt.jsx)(XH,{children:(0,Wt.jsx)(Da,{className:"h-4 w-4"})})}),(0,Wt.jsx)(VH,{children:t})]}));Qd.displayName=X_.displayName;var Iue=Ri.forwardRef(({className:e,...t},n)=>(0,Wt.jsx)(nx,{ref:n,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));Iue.displayName=nx.displayName;var a$=w(_(),1);var o$=w(I(),1),_ue="w-6 h-6 rounded-full animate-spin",ox=a$.forwardRef((e,t)=>{let{className:n,...A}=e;return(0,o$.jsx)(Ml,{ref:t,className:v(_ue,n),...A})});ox.displayName="LoadingSpinner";var fe=w(I(),1),r$=({error:e,inProgress:t,onInstall:n,onClose:A})=>{let[a,o]=(0,oC.useState)(""),[r,i]=(0,oC.useState)("latest"),[s,c]=(0,oC.useState)("prod"),u=p=>{p.stopPropagation(),p.preventDefault(),n({name:a,version:r,type:s})},d=p=>{p.key==="Enter"&&u(p)},l=p=>{p.preventDefault(),p.stopPropagation(),A()};return t?(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(Ga,{className:"rounded-t-lg relative flex flex-col w-full p-0",children:(0,fe.jsx)("div",{className:"flex items-center justify-between px-6 py-4",children:(0,fe.jsxs)(jA,{className:"text-lg font-medium flex items-center",children:[(0,fe.jsx)(Tc,{size:18,className:"mr-2"}),"Add new dependency"]})})}),(0,fe.jsx)("div",{className:"flex justify-center items-center h-48",children:(0,fe.jsx)(ox,{})})]}):e?(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(Ga,{className:"rounded-t-lg relative flex flex-col w-full p-0",children:(0,fe.jsx)("div",{className:"flex items-center justify-between px-6 py-4",children:(0,fe.jsxs)(jA,{className:"text-lg font-medium flex items-center",children:[(0,fe.jsx)(Il,{size:18,className:"mr-2"}),"Error"]})})}),(0,fe.jsx)("div",{className:"flex items-center flex-row justify-between gap-2 flex-wrap p-6 border-muted-foreground/20 border-t-[1px]",children:(0,fe.jsx)("p",{className:"text-sm",children:e})}),(0,fe.jsx)("div",{className:"flex justify-end w-full",children:(0,fe.jsx)(se,{className:"m-2",role:"cancel",variant:"secondary",tabIndex:4,onClick:l,children:"Close"})})]}):(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(Ga,{className:"rounded-t-lg relative flex flex-col w-full p-0",children:(0,fe.jsx)("div",{className:"flex items-center justify-between px-6 py-4",children:(0,fe.jsxs)(jA,{className:"text-lg font-medium flex items-center",children:[(0,fe.jsx)(Tc,{size:18,className:"mr-2"}),"Add new dependency"]})})}),(0,fe.jsxs)("form",{className:"flex items-center flex-row justify-between gap-2 flex-wrap p-6 border-muted-foreground/20 border-t-[1px]",onSubmit:u,onKeyDown:d,children:[(0,fe.jsx)(zg,{htmlFor:"package-name",className:"ml-1",children:"Package Name"}),(0,fe.jsx)(We,{id:"package-name",tabIndex:1,type:"text",role:"input",placeholder:"Package name",value:a,onChange:p=>{let g=p.currentTarget.value;o(g)}}),(0,fe.jsx)(zg,{htmlFor:"package-version",className:"ml-1 mt-2",children:"Version | Spec"}),(0,fe.jsx)(We,{id:"package-version",tabIndex:2,type:"text",role:"input",value:r,onChange:p=>{let g=p.currentTarget.value;i(g)}}),(0,fe.jsx)(zg,{htmlFor:"package-type",className:"ml-1 mt-2",children:"Type"}),(0,fe.jsxs)(e$,{defaultValue:s,onValueChange:c,children:[(0,fe.jsx)(Ax,{children:(0,fe.jsx)(t$,{tabIndex:3})}),(0,fe.jsxs)(ax,{children:[(0,fe.jsx)(Qd,{value:"prod",children:"dependencies"}),(0,fe.jsx)(Qd,{value:"dev",children:"devDependencies"}),(0,fe.jsx)(Qd,{value:"optional",children:"optionalDependencies"}),(0,fe.jsx)(Qd,{value:"peer",children:"peerDependencies"})]})]}),(0,fe.jsxs)("div",{className:"flex justify-end w-full",children:[(0,fe.jsx)(se,{className:"mt-2 mr-2",role:"cancel",variant:"secondary",tabIndex:4,onClick:l,children:"Cancel"}),(0,fe.jsxs)(se,{className:"mt-2",role:"submit",tabIndex:5,children:[(0,fe.jsx)(Pl,{size:16}),"Install package"]})]})]})]})};var ht=w(I(),1),i$=async({operation:e,setError:t,setInProgress:n,updateStamp:A,toast:a,importerId:o,name:r,version:i,type:s,onSuccessful:c})=>{let u=e==="install"?{add:{[o]:{[r]:{version:i,type:s}}}}:{remove:{[o]:[r]}},d;try{n(!0),d=await fetch(`/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)})}catch(g){console.error(g),t(String(g));return}finally{n(!1)}let l=!1,p="";try{p=await d.json(),l=p==="ok"}catch(g){console.warn("unable to parse json response:",g)}l?(a({description:`Successfully ${e}ed: ${r}`}),c?.(r),A()):((d.status===500||d.status===400)&&p&&t(p),p||t("Failed to install dependency."))},s$=({dependencies:e,importerId:t,onDependencyClick:n,uninstalledDependencies:A})=>{let[a,o]=vi(),{toast:r}=zn(),i=D(y=>y.updateStamp),s=D(y=>y.updateActiveRoute),c=D(y=>y.updateErrorCause),[u,d]=(0,nc.useState)(""),[l,p]=(0,nc.useState)(!1),[g,b]=(0,nc.useState)(!1),[B,f]=(0,nc.useState)([]);(0,nc.useEffect)(()=>{a.current&&(g?o(a.current,{rotate:-45}):o(a.current,{rotate:0}))},[g,a]);let m=()=>{g&&u&&(d(""),p(!1)),b(!g)},h=y=>{m(),f([y,...B])},C=y=>{f([...B].filter(k=>k!==y))},E=({name:y,version:k,type:R})=>{t&&i$({operation:"install",setError:d,setInProgress:p,updateStamp:i,toast:r,importerId:t,name:y,version:k,type:R,onSuccessful:h}).catch(F=>{console.error(F),s("/error"),c("Unexpected error trying to install dependency.")})},Q=y=>{t&&i$({operation:"uninstall",setError:d,setInProgress:p,updateStamp:i,toast:r,importerId:t,name:y.name,onSuccessful:C}).catch(k=>{console.error(k),s("/error"),c("Unexpected error trying to uninstall dependency.")})};return(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsxs)(Fi,{children:[(0,ht.jsx)($c,{size:22,className:"mr-3 rotate-180"}),"Dependencies",t?(0,ht.jsx)("div",{className:"grow flex justify-end",children:(0,ht.jsx)(Xe,{children:(0,ht.jsxs)(eA,{onOpenChange:b,open:g,children:[(0,ht.jsx)(tA,{children:(0,ht.jsxs)(et,{children:[(0,ht.jsx)(Qt,{asChild:!0,children:(0,ht.jsx)("div",{onClick:m,className:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground size-6",children:(0,ht.jsx)(_o,{ref:a})})}),(0,ht.jsx)(Oe,{children:(0,ht.jsx)("p",{children:"Add a new dependency"})})]})}),(0,ht.jsx)(Hn,{align:"end",className:"p-0 w-96 top-0 right-0",children:(0,ht.jsx)(r$,{error:u,inProgress:l,onInstall:E,onClose:m})})]})})}):""]}),[...e.filter(y=>B.includes(y.name)).sort((y,k)=>y.name.localeCompare(k.name,"en")),...e.filter(y=>!B.includes(y.name)).sort((y,k)=>y.name.localeCompare(k.name,"en"))].map(y=>(0,ht.jsx)(xu,{item:y,dependencies:!0,onSelect:n(y),onUninstall:Q},y.id)),A.length?(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsxs)(Fi,{children:[(0,ht.jsx)($c,{size:22,className:"mr-3 rotate-180"}),"Uninstalled Dependencies"]}),[...A.sort((y,k)=>y.name.localeCompare(k.name,"en"))].map(y=>(0,ht.jsx)(xu,{item:y,dependencies:!0},y.id))]}):""]})};var Rt=w(I(),1),c$=()=>{let e=D(A=>A.updateActiveRoute),t=D(A=>A.updateQuery);return(0,Rt.jsxs)("section",{className:"flex flex-col min-h-[70svh] h-full w-full px-8 pt-4 items-center justify-center",children:[(0,Rt.jsxs)("div",{className:"relative flex flex-col items-center justify-center h-fit w-fit -mt-10 mb-8",children:[(0,Rt.jsx)(rx,{className:"w-[275px] h-[64px] opacity-30 -mb-6"}),(0,Rt.jsx)(rx,{className:"z-[1] shadow-lg"}),(0,Rt.jsx)(rx,{className:"w-[275px] h-[64px] opacity-30 -mt-6"})]}),(0,Rt.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 text-center",children:[(0,Rt.jsx)("h4",{className:"text-xl font-semibold",children:"No results found"}),(0,Rt.jsx)("p",{className:"text-sm text-neutral-500",children:"Your Query did not match any results in this project."}),(0,Rt.jsx)("div",{className:"mt-3 flex gap-3 items-center justify-center",children:(0,Rt.jsxs)(se,{onClick:()=>{e("/explore"),t(":root")},children:[(0,Rt.jsx)("span",{children:"Project Root"}),(0,Rt.jsx)(xa,{})]})})]})]})},rx=({className:e=""})=>(0,Rt.jsxs)("div",{className:`w-[300px] h-[70px] rounded-sm border-[1px] border-neutral-200 dark:border-neutral-800 bg-muted dark:bg-black flex flex-col ${e}`,children:[(0,Rt.jsxs)("div",{className:"flex justify-between items-center border-b-[1px] border-neutral-200 dark:border-neutral-800 p-2",children:[(0,Rt.jsx)("div",{className:"h-[18px] w-[80px] bg-neutral-200 dark:bg-neutral-950 border-[1px] rounded-sm border-neutral-300 dark:border-neutral-800"}),(0,Rt.jsx)("div",{className:"h-[16px] w-[60px] bg-neutral-200 dark:bg-neutral-950 border-[1px] rounded-sm border-neutral-300 dark:border-neutral-800"})]}),(0,Rt.jsxs)("div",{className:"flex justify-between items-center h-full w-full p-2",children:[(0,Rt.jsx)("div",{className:"h-[12px] w-[125px] bg-neutral-200 dark:bg-neutral-950 border-[1px] border-neutral-300 dark:border-neutral-800 rounded-sm"}),(0,Rt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Rt.jsx)("div",{className:"rounded-full bg-sky-400/25 dark:bg-sky-800/25 border-[1px] border-sky-400 dark:border-sky-800 h-[12px] w-[30px]"}),(0,Rt.jsx)("div",{className:"rounded-full bg-red-400/25 dark:bg-red-800/25 border-[1px] border-red-400 dark:border-red-800 h-[12px] w-[38px]"})]})]})]});var Bt=w(I(),1),xue=(e,t)=>{let n=[],A=new Map,a=new Map,o=[...e];for(let u of t)if(u.importer){let d=u.name||"";o.unshift({name:d,type:"prod",spec:Ut.parse(d||"",u.mainImporter?"file:.":"workspace:*"),from:void 0,to:u})}let r=new Set(o.map(u=>u.to?.id)),i=r.size>1,s=r.size===1;for(let u of o){if(s&&!u.from&&o.length>1)continue;let d=u.to?.id,l=u.spec?.bareSpec?`@${u.spec.bareSpec}`:"",p=u.from?`${u.name}${l}`:u.name;if(!d){n.push({...u,id:`${u.from?.id}${p}`,labels:u.type?[u.type]:[],title:p,version:"Missing package",sameItems:s,stacked:!1,size:1});continue}let g=a.get(d);if(g&&i)A.get(d)?.add(u),g.size+=1,g.stacked=!0,p!==g.title&&(g.spec?.bareSpec!==u.spec?.bareSpec&&(g.title=g.name),g.name!==u.name&&(g.title=`${g.name} and ${g.size} more`));else{let b=u.to?.dev?"dev":u.to?.optional?"optional":void 0,B=u.to?.importer&&!u.to.mainImporter?"workspace":void 0,f=u.to?.edgesIn?Array.from(u.to.edgesIn).map(C=>C.type):[],m=Array.from(new Set([...f,b,B].filter(Boolean))),h={...u,id:`${u.from?.id}${u.to?.id}`||p,labels:m,title:p,version:u.to?Tp(u.to):"",sameItems:s,stacked:!1,size:1};n.push(h),A.set(d,new Set([u])),a.set(d,h)}}let c=n[0];return c&&n.length===1&&(c.title=c.to?.name||"Missing package",c.version=c.to?.version?`v${c.to.version}`:""),n.sort((u,d)=>u.name.localeCompare(d.name,"en"))},Due=(e,t)=>{if(!t)return;let n=e?.spec?.bareSpec?`@${e.spec.bareSpec}`:"",A=e?.name?`${e.name}${n}`:"";return{...e,id:t.id,name:t.name||"",title:A,version:t.version||"",stacked:!1,size:1,labels:void 0}},vue=(e,t)=>{let n=[];if(!e)return n;for(let A of Array.from(e.edgesIn)){if(A.from===t)continue;let a=`${A.name}@${A.spec.bareSpec}`;n.push({...A,id:A.from.id,title:a,version:A.from.version||"",name:A.from.name||"",stacked:A.from.edgesIn.size>1,size:A.from.edgesIn.size,labels:void 0})}return n},Fue=(e,t)=>{let n=[];if(!t)return n;for(let A of Array.from(t.edgesOut.values()).sort((a,o)=>a.name.localeCompare(o.name,"en"))){if(!A.to)continue;let a=`${A.name}@${A.spec.bareSpec}`;n.push({...A,depIndex:e.currIndex++,id:A.to.id,title:a,name:A.to.name||"",version:A.to.version||"",stacked:!1,size:1,labels:[A.type]})}return n},Sue=(e,t)=>{let n=[],A=t?.manifest;if(!A)return n;let a=[];for(let o of ku){let r=A[o];if(r)for(let[i,s]of Object.entries(r))a.push({name:i,version:s,type:o})}for(let{name:o,version:r,type:i}of a.sort((s,c)=>s.name.localeCompare(c.name,"en"))){if(t.edgesOut.get(o)?.to)continue;let c=`${o}@${r}`;n.push({depIndex:e.currIndex++,id:`uninstalled-dep:${c}`,title:c,name:o,version:r,stacked:!1,size:1,labels:[UQ(i,o,A)]})}return n.sort((o,r)=>o.name.localeCompare(r.name,"en"))},Lue=e=>{if(!e.to)return"";let t=e.to.name?`[name="${e.to.name}"]`:"",n=e.to.version?`[version="${e.to.version}"]`:"";return`${t}${n}`},u$=()=>{let e=D(B=>B.updateQuery),t=D(B=>B.query),n=D(B=>B.edges),A=D(B=>B.nodes),a=xue(n,A),o=a.length===1,[r]=a,i=o&&r?.to?.importer?r.to.id:void 0,s=o?r?.from:void 0,c=Due(r,s),u=o&&vue(r?.to,s),d={currIndex:0},l=o&&Fue(d,r?.to),p=o&&Sue(d,r?.to),g=(B,f)=>()=>{let m=r?.to?.name?`[name="${r.to.name}"]`:"",h=r?.to?.version?`[version="${r.to.version}"]`:"",C=f&&t.endsWith(`> ${m}${h}`)&&t.slice(0,t.lastIndexOf(">"));if(C)e(C);else{let E=B.from?.name?`[name="${B.from.name}"]`:"",Q=B.from?.version?`[version="${B.from.version}"]`:"";e(`${E}${Q}`)}},b=B=>()=>{let f=Lue(B);if(f)if(t.includes(f)){let m=t.split(f).slice(0,-1).concat([""]).join(f);e(m)}else{let m=`${t} > ${f}`;e(m)}};return a.length?(0,Bt.jsxs)("div",{className:"grow grid grid-cols-7 gap-4 px-8 bg-secondary dark:bg-black",children:[(0,Bt.jsxs)("div",{className:"col-span-2",children:[c?(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsxs)(Fi,{children:[(0,Bt.jsx)(vl,{size:22,className:"mr-3"}),"Parent"]}),(0,Bt.jsx)(xu,{parent:!0,item:c,highlight:!0,onSelect:g(c,!0)})]}):"",u&&u.length>0?(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsxs)(Fi,{children:[(0,Bt.jsx)(Fl,{size:22,className:"mr-3"}),"Dependents"]}),u.map(B=>(0,Bt.jsx)(xu,{item:B,onSelect:g(B)},B.id))]}):""]}),(0,Bt.jsxs)("div",{className:"col-span-3",children:[a.length>1?(0,Bt.jsx)(Fi,{className:"mb-4",children:"Results"}):(0,Bt.jsxs)(Fi,{children:[(0,Bt.jsx)(Sl,{size:22,className:"mr-3"}),"Selected Item"]}),(0,Bt.jsx)("div",{className:"flex flex-col gap-6",children:a.map(B=>o?(0,Bt.jsx)(lH,{item:B},B.id):(0,Bt.jsx)(FL,{item:B},B.id))})]}),(0,Bt.jsx)("div",{className:"col-span-2",children:l&&l.length>0||r?.to?.importer?(0,Bt.jsx)(s$,{dependencies:l||[],importerId:i,onDependencyClick:b,uninstalledDependencies:p||[]}):""})]}):(0,Bt.jsx)(c$,{})};var Rue=e=>{let{registries:t,registry:n,"git-hosts":A,"git-host-archives":a,"scope-registries":o}=e.options;return{registries:{...vb,...t},registry:n||GQ,"git-hosts":{...Fb,...A},"git-host-archives":{...Sb,...a},"scope-registries":{...wL,...o}}},d$=e=>{let[t]=e.importers,n={importers:new Set,edges:new Set,nodes:new Map,projectRoot:t?.projectRoot||"",addEdge(o,r,i,s){let c=i.edgesOut.get(r.name);if(c){let d=c;if(d.type===o&&d.spec.bareSpec===r.bareSpec)return s&&s!==d.to&&(d.to=s,d.to.edgesIn.add(d)),d;this.edges.delete(d)}let u={from:i,name:r.name,spec:r,to:s,type:o};return i.edgesOut.set(r.name,u),s?.edgesIn.add(u),this.edges.add(u),u},addNode(o,r){let i=this,s={id:o,name:r.name,version:r.version,manifest:r,edgesIn:new Set,edgesOut:new Map,graph:i,importer:!1,mainImporter:!1,projectRoot:i.projectRoot,dev:!1,optional:!1,setResolved(){}};return this.nodes.set(s.id,s),s}};for(let o of e.importers){let r=o.id,i=n,s=i.addNode(r,o.manifest);s.importer=!0,s.mainImporter=o.id===t?.id,s.location=o.location,s.integrity=o.integrity,s.resolved=o.resolved,s.dev=o.dev,s.optional=o.optional,i.mainImporter||(i.mainImporter=s),i.importers.add(s)}let A=n;qQ.loadNodes(A,e.lockfile.nodes);let a=Rue(e.lockfile);return qQ.loadEdges(A,e.lockfile.edges,a),{graph:A,specOptions:a}};var l$=w(I(),1),kd=({children:e,className:t=""})=>(0,l$.jsx)("kbd",{className:`flex items-center justify-center rounded-sm h-[1.5rem] w-[1.5rem] text-xs font-mono text-foreground bg-muted border border-muted-foreground/20 ${t}`,children:e});var On=w(_(),1);var p$=w(_(),1);var on=w(I(),1),rC=({deleteDialogOpen:e,setDeleteDialogOpen:t,selectedQueries:n,type:A,onClose:a,text:o="Delete"})=>{let{toast:r}=zn(),[i,s]=(0,p$.useState)(!1),c=D(d=>d.deleteSavedQueries),u=()=>{t(!1),s(!1),c(n),r({title:"Deleted successfully"}),a&&a()};return(0,on.jsxs)(ws,{open:e,onOpenChange:t,children:[(0,on.jsx)(et,{open:i,onOpenChange:s,children:(0,on.jsxs)(Xe,{children:[(0,on.jsx)(lu,{asChild:!0,children:A==="icon"?(0,on.jsx)(se,{onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),disabled:n.length<=0,className:"rounded-sm border border-[1px] border-muted-foreground/25",size:"icon",variant:"ghost",children:(0,on.jsx)(As,{})}):(0,on.jsx)(se,{variant:"destructive",children:o})}),(0,on.jsxs)(Oe,{children:["Delete ",n.length<=1?"Query":"Queries"]})]})}),(0,on.jsxs)(Xr,{children:[(0,on.jsxs)(Es,{children:[(0,on.jsxs)(Qs,{className:"font-medium",children:["Delete ",n.length<=1?"Query":"Queries"]}),(0,on.jsx)(ks,{})]}),(0,on.jsxs)("div",{children:["You're about to delete:",(0,on.jsx)("ul",{className:"my-3 list-none",children:n.map((d,l)=>(0,on.jsx)("li",{className:"font-medium",children:d.name},l))}),"This action cannot be undone."]}),(0,on.jsxs)(ys,{children:[(0,on.jsx)(se,{variant:"outline",onClick:()=>t(!1),children:"No, Keep It."}),(0,on.jsx)(se,{variant:"destructive",onClick:u,children:"Yes, Delete!"})]})]})]})};var Se=w(I(),1),Mue=()=>{let[e,t]=(0,On.useState)(!1),[n,A]=vi(),a=D(c=>c.savedQueries),o=D(c=>c.query),[r,i]=(0,On.useState)(),{resolvedTheme:s}=Rr();return(0,On.useEffect)(()=>{let c=a?.find(u=>u.query===o);i(c&&s==="dark"?"#fafafa":"#212121"),e?A(n.current,{rotate:-71.5}):A(n.current,{rotate:0})},[e,a,o,s]),(0,Se.jsxs)(eA,{open:e,onOpenChange:t,children:[(0,Se.jsx)(tA,{className:"flex items-center justify-center",children:(0,Se.jsx)(Xe,{children:(0,Se.jsxs)(et,{children:[(0,Se.jsx)(Qt,{asChild:!0,className:"flex rounded-sm items-center justify-center h-[1.5rem] w-[1.5rem] bg-muted border border-muted-foreground/20",children:(0,Se.jsx)("div",{onClick:()=>t(!e),className:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-[1.5rem] w-[1.5rem]",children:(0,Se.jsx)(Do,{ref:n,size:20,fill:r})})}),(0,Se.jsx)(Oe,{children:(0,Se.jsx)("p",{children:"Save query"})})]})})}),(0,Se.jsx)(Hn,{className:"p-0 w-full",align:"end",children:(0,Se.jsx)(Nue,{isOpen:e,setIsOpen:t})})]})},Nue=({isOpen:e,setIsOpen:t})=>{let[n,A]=(0,On.useState)(!1),[a,o]=(0,On.useState)(!1),r=(0,On.useRef)(!1),[i,s]=(0,On.useState)(null),[c,u]=(0,On.useState)(""),[d,l]=(0,On.useState)(""),[p,g]=(0,On.useState)([]),b=D(C=>C.saveQuery),B=D(C=>C.nodes),f=D(C=>C.updateSavedQuery),m=D(C=>C.savedQueries),h=D(C=>C.query);return(0,On.useEffect)(()=>{if(!r.current){r.current=!0;let C=m?.find(E=>E.query===h);if(s(C??null),C&&c!==""){g(C.labels??[]),u(C.name||B[0]?.manifest?.name||""),l(C.context||B[0]?.projectRoot||"");let E={...C,name:c,context:d,query:h,labels:p,dateModified:new Date().toISOString()};f(E)}C||b({id:Is(),name:B[0]?.manifest?.name??"Query",context:B[0]?.projectRoot??"",query:h,labels:p,dateCreated:new Date().toISOString(),dateModified:new Date().toISOString()})}},[]),(0,On.useEffect)(()=>{if(!e){let C=m?.find(E=>E.query===h);if(s(C??null),C&&c!==""){g(C.labels??[]),u(C.name||B[0]?.manifest?.name||""),l(C.context||B[0]?.projectRoot||"");let E={...C,name:c,context:d,query:h,labels:p,dateModified:new Date().toISOString()};f(E)}}},[e]),(0,On.useEffect)(()=>{g(i?.labels??[]),u(i?.name??B[0]?.manifest?.name??""),l(i?.context??B[0]?.projectRoot??"")},[i]),e?(0,Se.jsxs)("div",{className:"flex flex-col w-[325px]",children:[(0,Se.jsx)(Ga,{className:"px-6 py-4",children:(0,Se.jsx)(jA,{className:"text-lg font-medium",children:i?"Edit Query":"Added Query!"})}),(0,Se.jsxs)("div",{className:"flex px-6 py-4 flex-col gap-2 border-muted-foreground/20 border-t-[1px]",children:[(0,Se.jsx)(Gt,{className:"font-medium border-none",children:"Name"}),(0,Se.jsx)(We,{type:"text",autoComplete:"off",placeholder:"Name",value:c,onChange:C=>{let E=C.currentTarget.value;u(E)}}),(0,Se.jsx)(Gt,{className:"font-medium border-none mt-2",children:"Directory"}),(0,Se.jsx)(We,{id:"query-context",type:"text",autoComplete:"off",placeholder:"Directory (optional)",value:d,onChange:C=>{let E=C.currentTarget.value;l(E)}}),(0,Se.jsx)(Gt,{className:"font-medium border-none mt-2",children:"Labels"}),p.length!==0&&(0,Se.jsx)("div",{className:"ml-2 flex flex-wrap gap-2",children:p.map((C,E)=>(0,Se.jsx)(ia,{name:C.name,color:C.color},E))}),(0,Se.jsxs)(eA,{children:[(0,Se.jsx)(tA,{asChild:!0,children:(0,Se.jsxs)(se,{variant:"outline",role:"combobox",className:"w-full justify-between font-normal",children:["Select labels",(0,Se.jsx)(ns,{className:"opacity-50"})]})}),(0,Se.jsx)(Hn,{className:"p-0",children:(0,Se.jsx)(cb,{selectedItems:p,setItems:g,setIsOpen:o})})]}),(0,Se.jsx)("div",{className:"flex justify-end items-center w-full mt-4 gap-2",children:(0,Se.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,Se.jsx)(rC,{type:"button",text:"Remove",deleteDialogOpen:n,setDeleteDialogOpen:A,onClose:()=>t(!1),selectedQueries:[{...i,name:c,context:d,query:h,labels:p}]}),(0,Se.jsx)(se,{onClick:()=>t(!1),children:"Done"})]})})]})]}):null},g$=Mue;var iC=w(_(),1);var Jt=w(I(),1),m$=()=>{let e=D(a=>a.savedQueries),t=D(a=>a.query),[n,A]=(0,iC.useState)([]);return(0,iC.useEffect)(()=>{if(e&&e.length!==0){let a=e.filter(o=>o.query===t);A(a)}},[e,t]),(0,Jt.jsxs)(Jt.Fragment,{children:[(0,Jt.jsx)(Pue,{className:"mr-1",queries:n}),n.length>1&&n[0]&&(0,Jt.jsx)(jue,{className:"mr-2",query:n[0].query,numberOfQueries:n.length})]})},Pue=({queries:e,className:t=""})=>{let n=D(a=>a.updateActiveRoute),A=a=>{n("/labels"),history.pushState({route:"/labels"},"",`/labels?name=${encodeURIComponent(a)}`)};return(0,Jt.jsxs)(eA,{children:[(0,Jt.jsx)(tA,{className:"flex items-center justify-center",children:(0,Jt.jsx)(et,{children:(0,Jt.jsxs)(Xe,{children:[(0,Jt.jsx)(Qt,{asChild:!0,className:"flex items-center justify-center",children:(0,Jt.jsx)("div",{className:`flex -space-x-2 ${t}`,children:e.map(a=>a.labels?.length?a.labels.map((o,r)=>(0,Jt.jsx)("div",{className:"inline-block size-4 rounded-full ring-muted ring-1",style:{backgroundColor:o.color,borderColor:o.color}},r)):null)})}),(0,Jt.jsx)(Oe,{children:"Labels"})]})})}),(0,Jt.jsxs)(Hn,{children:[(0,Jt.jsx)("p",{className:"font-semibold mb-2",children:"Labels"}),(0,Jt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(a=>a.labels?.length?a.labels.map((o,r)=>(0,Jt.jsx)("button",{onClick:()=>A(o.name),children:(0,Jt.jsx)(ia,{name:o.name,color:o.color})},r)):null)})]})]})},jue=({numberOfQueries:e,className:t="",query:n})=>(0,Jt.jsxs)("a",{href:`/queries?query=${encodeURIComponent(n)}`,className:`cursor-pointer text-[10px] flex items-center h-[1.5rem] justify-center bg-muted transition-all border border-muted-foreground/20 px-2 py-1 rounded-sm ${t}`,children:["Matches ",e," Queries"]});var Mi=w(I(),1),f$=()=>{let e=D(a=>a.updateActiveRoute),t=D(a=>a.updateQuery),n=D(a=>a.query);return(0,Mi.jsx)(Xe,{children:(0,Mi.jsxs)(et,{children:[(0,Mi.jsx)(Qt,{asChild:!0,children:(0,Mi.jsx)(se,{disabled:n===Ql,onClick:()=>{e("/explore"),t(":root")},size:"icon",variant:"secondary",children:(0,Mi.jsx)(Ja,{})})}),(0,Mi.jsx)(Oe,{children:"Go to project root"})]})})};var pn=w(I(),1),Gue=async({updateHasDashboard:e,updateGraph:t,updateQ:n,updateSpecOptions:A,stamp:a})=>{let r=await(await fetch("./graph.json?random="+a)).json(),{graph:i,specOptions:s}=d$(r),c=new Mb({graph:i});e(r.hasDashboard),t(i),A(s),n(c)},b$=()=>{let e=D(i=>i.updateActiveRoute),t=D(i=>i.updateErrorCause),n=D(i=>i.updateHasDashboard),A=D(i=>i.updateGraph),a=D(i=>i.updateQ),o=D(i=>i.updateSpecOptions),r=D(i=>i.stamp);return(0,ix.useEffect)(()=>{Gue({updateHasDashboard:n,updateGraph:A,updateQ:a,updateSpecOptions:o,stamp:r}).catch(i=>{console.error(i),e("/error"),t("Failed to initialize explorer.")})},[r]),(0,pn.jsx)(zue,{})},zue=()=>{let e=D(r=>r.dashboard),t=D(r=>r.updateEdges),n=D(r=>r.updateNodes),A=D(r=>r.graph),a=D(r=>r.query),o=D(r=>r.q);return(0,ix.useEffect)(()=>{async function r(){if(!o)return;let i=await o.search(a);t(i.edges),n(i.nodes);let s=history.state;(!s||a!==s.query||s.route!=="/explore")&&(history.pushState({query:a,route:"/explore"},"","/explore?query="+encodeURIComponent(a)),window.scrollTo(0,0))}r().catch(i=>console.error(i))},[a,o]),(0,pn.jsxs)("section",{className:"flex grow flex-col justify-between bg-white dark:bg-black",children:[(0,pn.jsxs)("div",{className:"flex items-center justify-between w-full px-8 pt-4 border-t-[1px]",children:[A?.projectRoot?(0,pn.jsxs)("p",{className:"text-xs font-mono font-light text-muted-foreground",children:[":host-context(file:",A.projectRoot,")"]}):"",e?.buildVersion?(0,pn.jsxs)("p",{className:"text-xs font-mono font-light text-muted-foreground text-right",children:["build: v",e.buildVersion]}):""]}),(0,pn.jsx)("section",{className:"flex items-center px-8 py-4 border-b-[1px] border-solid",children:(0,pn.jsxs)("div",{className:"flex flex-row gap-2 w-full",children:[(0,pn.jsx)(f$,{}),(0,pn.jsx)(_L,{tabIndex:0,className:"w-full bg-muted-foreground/5",startContent:(0,pn.jsx)(xo,{size:20,className:"ml-3",color:"#a3a3a3"}),endContent:(0,pn.jsxs)("div",{className:"items-center hidden md:flex gap-1 mr-3 backdrop-blur-sm",children:[(0,pn.jsx)(m$,{}),(0,pn.jsx)(g$,{}),(0,pn.jsx)(kd,{className:'ml-3 relative before:content-[" "] before:-ml-10 before:absolute before:h-[0.75rem] before:w-[1.25px] before:rounded-sm before:bg-neutral-600',children:(0,pn.jsx)(ko,{size:12})}),(0,pn.jsx)(kd,{className:"text-sm",children:"k"})]})})]})}),(0,pn.jsx)(u$,{})]})};var h$=w(_(),1);var O=w(I(),1),B$=()=>{let e=D(o=>o.updateActiveRoute),t=D(o=>o.previousRoute),n=D(o=>o.errorCause);return(0,h$.useEffect)(()=>{history.pushState({query:"",route:"/error"},"","/error"),window.scrollTo(0,0)}),(0,O.jsx)("section",{className:"flex grow flex-col items-center min-h-[80svh] bg-white dark:bg-black justify-center",children:(0,O.jsxs)("div",{className:"relative flex flex-col items-center justify-center -mt-32",children:[(0,O.jsxs)("div",{className:"relative flex flex-col gap-8",children:[(0,O.jsx)("div",{className:"absolute inset-0 bg-gradient-radial from-white/0 dark:from-black/0 via-transparent dark:to-black to-white z-[2]"}),(0,O.jsxs)("div",{className:"flex gap-8 opacity-50",children:[(0,O.jsx)(sC,{}),(0,O.jsx)(cC,{}),(0,O.jsx)(sC,{})]}),(0,O.jsxs)("div",{className:"flex gap-8 opacity-80",children:[(0,O.jsx)(sC,{}),(0,O.jsx)(Hue,{}),(0,O.jsx)(cC,{})]}),(0,O.jsxs)("div",{className:"flex gap-8 opacity-50",children:[(0,O.jsx)(cC,{}),(0,O.jsx)(sC,{}),(0,O.jsx)(cC,{})]})]}),(0,O.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 -mt-32",children:[(0,O.jsx)("h4",{className:"text-xl font-semibold z-[2]",children:"Something went wrong"}),(0,O.jsx)("p",{className:"text-sm text-neutral-500 text-center z-[2]",children:n||"An unexpected error occured."}),(0,O.jsxs)("div",{className:"flex gap-3 mt-3 z-[2]",children:[(0,O.jsx)(se,{variant:"outline",onClick:o=>{o.preventDefault(),e(t)},children:"Back"}),(0,O.jsxs)(se,{onClick:o=>{o.preventDefault(),e("/dashboard")},children:[(0,O.jsx)("span",{children:"Dashboard"}),(0,O.jsx)(xa,{})]})]})]}),(0,O.jsx)("div",{className:"absolute -bottom-6 h-[150px] -left-6 -right-6 z-[1] bg-gradient-radial from-white dark:from-black dark:to-black/0 to-white/0"})]})})},sC=()=>(0,O.jsxs)("div",{className:"relative flex flex-col gap-2",children:[(0,O.jsxs)("div",{className:"w-[175px] h-[100px] border-[1px] border-neutral-400 dark:border-neutral-800 rounded-sm bg-neutral-400/10 dark:bg-neutral-800/10 flex",children:[(0,O.jsxs)("div",{className:"w-1/4 bg-neutral-700/25 border-r-[1px] border-neutral-700/50 flex flex-col justify-between px-[3px] py-[3px]",children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("div",{className:"w-full h-[7px] bg-neutral-700/50 rounded-[2px]"}),(0,O.jsxs)("div",{className:"flex items-center gap-1 mt-1.5",children:[(0,O.jsx)("div",{className:"size-[5px] rounded-[1px] bg-neutral-700/60"}),(0,O.jsx)("div",{className:"w-2/3 h-[5px] bg-neutral-700/60 rounded-[1px]"})]}),(0,O.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,O.jsx)("div",{className:"size-[5px] rounded-[1px] bg-neutral-700/60"}),(0,O.jsx)("div",{className:"w-1/3 h-[5px] bg-neutral-700/60 rounded-[1px]"})]})]}),(0,O.jsx)("div",{children:(0,O.jsx)("div",{className:"size-[5px] rouned-[1px] bg-neutral-700/60"})})]}),(0,O.jsxs)("div",{className:"flex w-full flex-col px-[6px] py-[3px]",children:[(0,O.jsx)("div",{className:"w-1/4 h-[6px] bg-neutral-700/60 rounded-[1px]"}),(0,O.jsxs)("div",{className:"flex w-full justify-between gap-1 mt-2",children:[(0,O.jsx)("div",{className:"w-1/3 h-[24px] border-[1px] border-neutral-400/90 dark:border-neutral-800/90 bg-neutral-400/60 dark:bg-neutral-800/60"}),(0,O.jsx)("div",{className:"w-1/3 h-[24px] border-[1px] border-neutral-400/90 dark:border-neutral-800/90 bg-neutral-400/60 dark:bg-neutral-800/60"}),(0,O.jsx)("div",{className:"w-1/3 h-[24px] border-[1px] border-neutral-400/90 dark:border-neutral-800/90 bg-neutral-400/60 dark:bg-neutral-800/60"})]})]})]}),(0,O.jsx)("div",{className:"w-[80px] h-[12px] bg-neutral-200 dark:bg-neutral-900/80 rounded-[2px]"})]}),cC=()=>(0,O.jsxs)("div",{className:"relative flex flex-col gap-2",children:[(0,O.jsxs)("div",{className:"w-[175px] h-[100px] border-[1px] border-neutral-400 dark:border-neutral-800 rounded-sm bg-neutral-400/10 dark:bg-neutral-800/10 flex",children:[(0,O.jsxs)("div",{className:"flex flex-col items-center justify-between px-[1.6px] py-[3px] w-[10px] bg-neutral-400/25 dark:bg-neutral-700/25 border-r-[1px] border-neutral-400/50 dark:border-neutral-700/50",children:[(0,O.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,O.jsx)("div",{className:"size-[6px] bg-neutral-400 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsxs)("div",{className:"flex flex-col items-center justify-center mt-1.5 gap-1",children:[(0,O.jsx)("div",{className:"size-[6px] bg-neutral-400 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsx)("div",{className:"size-[6px] bg-neutral-400 dark:bg-neutral-700/60 rounded-[1px]"})]})]}),(0,O.jsx)("div",{className:"flex items-center justify-center",children:(0,O.jsx)("div",{className:"size-[6px] bg-neutral-400 dark:bg-neutral-700/60 rounded-[1px]"})})]}),(0,O.jsxs)("div",{className:"flex flex-col w-full px-[6px] py-[3px]",children:[(0,O.jsx)("div",{className:"w-1/4 h-[6px] bg-neutral-400/60 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsxs)("div",{className:"flex items-center justify-between mt-1.5",children:[(0,O.jsxs)("div",{className:"flex items-center justify-center gap-1",children:[(0,O.jsx)("div",{className:"w-[25px] h-[6px] bg-neutral-400/60 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsx)("div",{className:"w-[12px] h-[6px] bg-neutral-400/60 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsx)("div",{className:"w-[6px] h-[6px] bg-neutral-400/60 dark:bg-neutral-700/60 rounded-[1px]"})]}),(0,O.jsx)("div",{className:"flex items-center justify-center gap-1",children:(0,O.jsx)("div",{className:"w-[20px] h-[6px] bg-neutral-900/60 dark:bg-neutral-500/60 rounded-[1px]"})})]}),(0,O.jsxs)("div",{className:"flex flex-col mt-2 gap-1.5 w-full",children:[(0,O.jsx)("div",{className:"w-full h-[8px] bg-neutral-400/20 dark:bg-neutral-700/20 border-[0.75px] border-neutral-400/70 dark:border-neutral-700/70 rounded-[1px]"}),(0,O.jsx)("div",{className:"w-full h-[8px] bg-neutral-400/20 dark:bg-neutral-700/20 border-[0.75px] border-neutral-400/70 dark:border-neutral-700/70 rounded-[1px]"}),(0,O.jsx)("div",{className:"w-full h-[8px] bg-neutral-400/20 dark:bg-neutral-700/20 border-[0.75px] border-neutral-400/70 dark:border-neutral-700/70 rounded-[1px]"})]})]})]}),(0,O.jsx)("div",{className:"w-[60px] h-[12px] bg-neutral-200 dark:bg-neutral-900/80 rounded-[2px]"})]}),Hue=()=>(0,O.jsxs)("div",{className:"relative flex flex-col gap-2",children:[(0,O.jsx)("div",{className:"w-[175px] h-[100px] border-[1px] border-red-800 rounded-sm bg-red-700/10 flex items-center justify-center",children:(0,O.jsx)("div",{className:"size-8 bg-red-500/30 rounded-sm flex items-center justify-center",children:(0,O.jsx)(Gr,{className:"text-red-500",size:16})})}),(0,O.jsx)("div",{className:"w-[100px] h-[12px] bg-neutral-200 dark:bg-neutral-900/80 rounded-[2px]"})]});var K$=w(_(),1);var gC=w(_(),1);var $ue=Math.pow(10,8)*24*60*60*1e3,I7e=-$ue,uC=6048e5,C$=864e5;var Tue=3600;var w$=Tue*24,_7e=w$*7,Uue=w$*365.2425,Zue=Uue/12,x7e=Zue*3,sx=Symbol.for("constructDateFrom");function IA(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&sx in e?e[sx](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ht(e,t){return IA(t||e,e)}var que={};function Ni(){return que}function sr(e,t){let n=Ni(),A=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Ht(e,t?.in),o=a.getDay(),r=(o<A?7:0)+o-A;return a.setDate(a.getDate()-r),a.setHours(0,0,0,0),a}function Ac(e,t){return sr(e,{...t,weekStartsOn:1})}function dC(e,t){let n=Ht(e,t?.in),A=n.getFullYear(),a=IA(n,0);a.setFullYear(A+1,0,4),a.setHours(0,0,0,0);let o=Ac(a),r=IA(n,0);r.setFullYear(A,0,4),r.setHours(0,0,0,0);let i=Ac(r);return n.getTime()>=o.getTime()?A+1:n.getTime()>=i.getTime()?A:A-1}function cx(e){let t=Ht(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function E$(e,...t){let n=IA.bind(null,e||t.find(A=>typeof A=="object"));return t.map(n)}function ux(e,t){let n=Ht(e,t?.in);return n.setHours(0,0,0,0),n}function y$(e,t,n){let[A,a]=E$(n?.in,e,t),o=ux(A),r=ux(a),i=+o-cx(o),s=+r-cx(r);return Math.round((i-s)/C$)}function Q$(e,t){let n=dC(e,t),A=IA(t?.in||e,0);return A.setFullYear(n,0,4),A.setHours(0,0,0,0),Ac(A)}function k$(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function I$(e){return!(!k$(e)&&typeof e!="number"||isNaN(+Ht(e)))}function _$(e,t){let n=Ht(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var Oue={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},x$=(e,t,n)=>{let A,a=Oue[e];return typeof a=="string"?A=a:t===1?A=a.one:A=a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+A:A+" ago":A};function lC(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Yue={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Kue={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wue={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},D$={date:lC({formats:Yue,defaultWidth:"full"}),time:lC({formats:Kue,defaultWidth:"full"}),dateTime:lC({formats:Wue,defaultWidth:"full"})};var Jue={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},v$=(e,t,n,A)=>Jue[e];function Id(e){return(t,n)=>{let A=n?.context?String(n.context):"standalone",a;if(A==="formatting"&&e.formattingValues){let r=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):r;a=e.formattingValues[i]||e.formattingValues[r]}else{let r=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;a=e.values[i]||e.values[r]}let o=e.argumentCallback?e.argumentCallback(t):t;return a[o]}}var Vue={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xue={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ede={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tde={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nde={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ade={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ade=(e,t)=>{let n=Number(e),A=n%100;if(A>20||A<10)switch(A%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},F$={ordinalNumber:ade,era:Id({values:Vue,defaultWidth:"wide"}),quarter:Id({values:Xue,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Id({values:ede,defaultWidth:"wide"}),day:Id({values:tde,defaultWidth:"wide"}),dayPeriod:Id({values:nde,defaultWidth:"wide",formattingValues:Ade,defaultFormattingWidth:"wide"})};function _d(e){return(t,n={})=>{let A=n.width,a=A&&e.matchPatterns[A]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;let r=o[0],i=A&&e.parsePatterns[A]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(i)?rde(i,d=>d.test(r)):ode(i,d=>d.test(r)),c;c=e.valueCallback?e.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;let u=t.slice(r.length);return{value:c,rest:u}}}function ode(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function rde(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function S$(e){return(t,n={})=>{let A=t.match(e.matchPattern);if(!A)return null;let a=A[0],o=t.match(e.parsePattern);if(!o)return null;let r=e.valueCallback?e.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;let i=t.slice(a.length);return{value:r,rest:i}}}var ide=/^(\d+)(th|st|nd|rd)?/i,sde=/\d+/i,cde={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ude={any:[/^b/i,/^(a|c)/i]},dde={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lde={any:[/1/i,/2/i,/3/i,/4/i]},pde={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gde={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},mde={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},fde={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bde={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hde={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},L$={ordinalNumber:S$({matchPattern:ide,parsePattern:sde,valueCallback:e=>parseInt(e,10)}),era:_d({matchPatterns:cde,defaultMatchWidth:"wide",parsePatterns:ude,defaultParseWidth:"any"}),quarter:_d({matchPatterns:dde,defaultMatchWidth:"wide",parsePatterns:lde,defaultParseWidth:"any",valueCallback:e=>e+1}),month:_d({matchPatterns:pde,defaultMatchWidth:"wide",parsePatterns:gde,defaultParseWidth:"any"}),day:_d({matchPatterns:mde,defaultMatchWidth:"wide",parsePatterns:fde,defaultParseWidth:"any"}),dayPeriod:_d({matchPatterns:bde,defaultMatchWidth:"any",parsePatterns:hde,defaultParseWidth:"any"})};var dx={code:"en-US",formatDistance:x$,formatLong:D$,formatRelative:v$,localize:F$,match:L$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function R$(e,t){let n=Ht(e,t?.in);return y$(n,_$(n))+1}function M$(e,t){let n=Ht(e,t?.in),A=+Ac(n)-+Q$(n);return Math.round(A/uC)+1}function pC(e,t){let n=Ht(e,t?.in),A=n.getFullYear(),a=Ni(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,r=IA(t?.in||e,0);r.setFullYear(A+1,0,o),r.setHours(0,0,0,0);let i=sr(r,t),s=IA(t?.in||e,0);s.setFullYear(A,0,o),s.setHours(0,0,0,0);let c=sr(s,t);return+n>=+i?A+1:+n>=+c?A:A-1}function N$(e,t){let n=Ni(),A=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=pC(e,t),o=IA(t?.in||e,0);return o.setFullYear(a,0,A),o.setHours(0,0,0,0),sr(o,t)}function P$(e,t){let n=Ht(e,t?.in),A=+sr(n,t)-+N$(n,t);return Math.round(A/uC)+1}function ze(e,t){let n=e<0?"-":"",A=Math.abs(e).toString().padStart(t,"0");return n+A}var cr={y(e,t){let n=e.getFullYear(),A=n>0?n:1-n;return ze(t==="yy"?A%100:A,t.length)},M(e,t){let n=e.getMonth();return t==="M"?String(n+1):ze(n+1,2)},d(e,t){return ze(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ze(e.getHours()%12||12,t.length)},H(e,t){return ze(e.getHours(),t.length)},m(e,t){return ze(e.getMinutes(),t.length)},s(e,t){return ze(e.getSeconds(),t.length)},S(e,t){let n=t.length,A=e.getMilliseconds(),a=Math.trunc(A*Math.pow(10,n-3));return ze(a,t.length)}};var xd={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lx={G:function(e,t,n){let A=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(A,{width:"abbreviated"});case"GGGGG":return n.era(A,{width:"narrow"});case"GGGG":default:return n.era(A,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){let A=e.getFullYear(),a=A>0?A:1-A;return n.ordinalNumber(a,{unit:"year"})}return cr.y(e,t)},Y:function(e,t,n,A){let a=pC(e,A),o=a>0?a:1-a;if(t==="YY"){let r=o%100;return ze(r,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ze(o,t.length)},R:function(e,t){let n=dC(e);return ze(n,t.length)},u:function(e,t){let n=e.getFullYear();return ze(n,t.length)},Q:function(e,t,n){let A=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(A);case"QQ":return ze(A,2);case"Qo":return n.ordinalNumber(A,{unit:"quarter"});case"QQQ":return n.quarter(A,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(A,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(A,{width:"wide",context:"formatting"})}},q:function(e,t,n){let A=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(A);case"qq":return ze(A,2);case"qo":return n.ordinalNumber(A,{unit:"quarter"});case"qqq":return n.quarter(A,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(A,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(A,{width:"wide",context:"standalone"})}},M:function(e,t,n){let A=e.getMonth();switch(t){case"M":case"MM":return cr.M(e,t);case"Mo":return n.ordinalNumber(A+1,{unit:"month"});case"MMM":return n.month(A,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(A,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(A,{width:"wide",context:"formatting"})}},L:function(e,t,n){let A=e.getMonth();switch(t){case"L":return String(A+1);case"LL":return ze(A+1,2);case"Lo":return n.ordinalNumber(A+1,{unit:"month"});case"LLL":return n.month(A,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(A,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(A,{width:"wide",context:"standalone"})}},w:function(e,t,n,A){let a=P$(e,A);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):ze(a,t.length)},I:function(e,t,n){let A=M$(e);return t==="Io"?n.ordinalNumber(A,{unit:"week"}):ze(A,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):cr.d(e,t)},D:function(e,t,n){let A=R$(e);return t==="Do"?n.ordinalNumber(A,{unit:"dayOfYear"}):ze(A,t.length)},E:function(e,t,n){let A=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(A,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(A,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(A,{width:"short",context:"formatting"});case"EEEE":default:return n.day(A,{width:"wide",context:"formatting"})}},e:function(e,t,n,A){let a=e.getDay(),o=(a-A.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ze(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,A){let a=e.getDay(),o=(a-A.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ze(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){let A=e.getDay(),a=A===0?7:A;switch(t){case"i":return String(a);case"ii":return ze(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(A,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(A,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(A,{width:"short",context:"formatting"});case"iiii":default:return n.day(A,{width:"wide",context:"formatting"})}},a:function(e,t,n){let a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){let A=e.getHours(),a;switch(A===12?a=xd.noon:A===0?a=xd.midnight:a=A/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){let A=e.getHours(),a;switch(A>=17?a=xd.evening:A>=12?a=xd.afternoon:A>=4?a=xd.morning:a=xd.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let A=e.getHours()%12;return A===0&&(A=12),n.ordinalNumber(A,{unit:"hour"})}return cr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):cr.H(e,t)},K:function(e,t,n){let A=e.getHours()%12;return t==="Ko"?n.ordinalNumber(A,{unit:"hour"}):ze(A,t.length)},k:function(e,t,n){let A=e.getHours();return A===0&&(A=24),t==="ko"?n.ordinalNumber(A,{unit:"hour"}):ze(A,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):cr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):cr.s(e,t)},S:function(e,t){return cr.S(e,t)},X:function(e,t,n){let A=e.getTimezoneOffset();if(A===0)return"Z";switch(t){case"X":return G$(A);case"XXXX":case"XX":return ac(A);case"XXXXX":case"XXX":default:return ac(A,":")}},x:function(e,t,n){let A=e.getTimezoneOffset();switch(t){case"x":return G$(A);case"xxxx":case"xx":return ac(A);case"xxxxx":case"xxx":default:return ac(A,":")}},O:function(e,t,n){let A=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+j$(A,":");case"OOOO":default:return"GMT"+ac(A,":")}},z:function(e,t,n){let A=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+j$(A,":");case"zzzz":default:return"GMT"+ac(A,":")}},t:function(e,t,n){let A=Math.trunc(+e/1e3);return ze(A,t.length)},T:function(e,t,n){return ze(+e,t.length)}};function j$(e,t=""){let n=e>0?"-":"+",A=Math.abs(e),a=Math.trunc(A/60),o=A%60;return o===0?n+String(a):n+String(a)+t+ze(o,2)}function G$(e,t){return e%60===0?(e>0?"-":"+")+ze(Math.abs(e)/60,2):ac(e,t)}function ac(e,t=""){let n=e>0?"-":"+",A=Math.abs(e),a=ze(Math.trunc(A/60),2),o=ze(A%60,2);return n+a+t+o}var z$=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},H$=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Bde=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],A=n[1],a=n[2];if(!a)return z$(e,t);let o;switch(A){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",z$(A,t)).replace("{{time}}",H$(a,t))},$$={p:H$,P:Bde};var Cde=/^D+$/,wde=/^Y+$/,Ede=["D","DD","YY","YYYY"];function T$(e){return Cde.test(e)}function U$(e){return wde.test(e)}function Z$(e,t,n){let A=yde(e,t,n);if(console.warn(A),Ede.includes(e))throw new RangeError(A)}function yde(e,t,n){let A=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${A} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Qde=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kde=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ide=/^'([^]*?)'?$/,_de=/''/g,xde=/[a-zA-Z]/;function q$(e,t,n){let A=Ni(),a=n?.locale??A.locale??dx,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??A.firstWeekContainsDate??A.locale?.options?.firstWeekContainsDate??1,r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??A.weekStartsOn??A.locale?.options?.weekStartsOn??0,i=Ht(e,n?.in);if(!I$(i))throw new RangeError("Invalid time value");let s=t.match(kde).map(u=>{let d=u[0];if(d==="p"||d==="P"){let l=$$[d];return l(u,a.formatLong)}return u}).join("").match(Qde).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:Dde(u)};if(lx[d])return{isToken:!0,value:u};if(d.match(xde))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});a.localize.preprocessor&&(s=a.localize.preprocessor(i,s));let c={firstWeekContainsDate:o,weekStartsOn:r,locale:a};return s.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!n?.useAdditionalWeekYearTokens&&U$(d)||!n?.useAdditionalDayOfYearTokens&&T$(d))&&Z$(d,t,String(e));let l=lx[d[0]];return l(i,d,a.localize,c)}).join("")}function Dde(e){let t=e.match(Ide);return t?t[1].replace(_de,"'"):e}var po=w(_(),1);var lo=w(I(),1),Dd=({items:e,setFilteredItems:t,placeholder:n})=>{let[A,a]=(0,po.useState)(""),o=(0,po.useRef)(null),r=(0,po.useRef)(!0);return(0,po.useEffect)(()=>{if(r.current)return;let i=new URLSearchParams(window.location.search),s=e?Object.keys(e[0]??{}):[];if(A.trim()||(i.forEach((u,d)=>i.delete(d)),t(e??[])),A.trim()!==""&&(i.forEach((u,d)=>i.delete(d)),i.set("filter",A)),A.split("=")[0]==="label"){i.forEach((d,l)=>i.delete(l));let u=A.split("=")[1];u&&i.set("label",u)}if(s.some(u=>A.includes(u))){i.forEach((l,p)=>i.delete(p));let[u,d]=A.split("=");u&&d&&i.set(u,d)}let c=`${window.location.pathname}?${i.toString()}`;window.history.replaceState({},"",c)},[A]),(0,po.useEffect)(()=>{let i=new URLSearchParams(window.location.search),s=e?Object.keys(e[0]??{}):[],u=Array.from(i.keys()).find(d=>s.includes(d));u&&a(`${u}=${i.get(u)}`),i.get("label")&&a(`label=${i.get("label")?.toLowerCase()}`),r.current=!1},[]),(0,po.useEffect)(()=>{if(!e){t([]);return}let i=new URLSearchParams(window.location.search),s=[];for(let[u,d]of i.entries())s.push({key:u,value:d});let c=e.filter(u=>s.every(d=>{if(d.key==="filter"){let l=d.value.toLowerCase();return Object.values(u).some(p=>String(p).toLowerCase().includes(l))}else if(d.key==="label"){let l=d.value.toLowerCase();return(u.labels??[]).some(g=>g.name.toLowerCase().includes(l))}else{let l=String(u[d.key]||"").toLowerCase(),p=d.value.toLowerCase();return l===p}}));t(c)},[e,window.location.search,A]),(0,po.useEffect)(()=>{let i=s=>{switch(!0){case((s.metaKey||s.ctrlKey)&&s.key==="k"):s.preventDefault(),o.current?.focus();break;case s.key==="Escape":s.preventDefault(),o.current?.blur();break;default:break}};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[]),(0,lo.jsxs)("div",{className:"relative flex items-center w-[384px]",children:[(0,lo.jsx)(xo,{size:18,className:"absolute left-0 ml-3 text-neutral-500"}),(0,lo.jsx)(We,{type:"text",ref:o,className:"pl-9 pr-20",role:"search",placeholder:n,value:A,onChange:i=>a(i.target.value)}),(0,lo.jsx)("div",{className:"flex gap-2 absolute right-0",children:(0,lo.jsxs)("div",{className:"items-center hidden md:flex gap-1 mr-3 backdrop-blur-sm",children:[(0,lo.jsx)(kd,{children:(0,lo.jsx)(ko,{size:12})}),(0,lo.jsx)(kd,{className:"text-sm",children:"k"})]})})]})};var O$=w(_(),1);var TA=w(I(),1),vd=({sortKey:e,filteredItems:t,setFilteredItems:n})=>{let[A,a]=(0,O$.useState)("ascending"),o=[{icon:c=>(0,TA.jsx)(Mr,{...c}),option:"ascending",toolTipContent:"Sort ascending"},{icon:c=>(0,TA.jsx)(Nr,{...c}),option:"descending",toolTipContent:"Sort descending"}],r=c=>{let u=A===c?c==="ascending"?"descending":"ascending":c;a(u),u==="ascending"?i():s()},i=()=>{let c=[...t].sort((u,d)=>String(u[e]).localeCompare(String(d[e])));n(c)},s=()=>{let c=[...t].sort((u,d)=>String(d[e]).localeCompare(String(u[e])));n(c)};return(0,TA.jsx)("div",{className:"flex mx-3",children:(0,TA.jsxs)("div",{className:"relative flex items-center p-1 h-[2.5rem] bg-white dark:bg-black w-full rounded-sm border border-[1px] border-muted-foreground/25",children:[(0,TA.jsx)(Kt.div,{className:"absolute h-[2rem] w-[2rem] rounded-sm bg-muted border border-muted-foreground/20",animate:{left:A==="ascending"?4:36}}),o.map((c,u)=>(0,TA.jsx)(Xe,{children:(0,TA.jsxs)(et,{children:[(0,TA.jsx)(Qt,{asChild:!0,children:(0,TA.jsx)("div",{onClick:()=>{r(c.option)},className:"cursor-pointer h-[2rem] w-[2rem] rounded-sm flex items-center justify-center z-[1]",children:(0,TA.jsx)(c.icon,{size:20,className:"text-muted-foreground"})})}),(0,TA.jsx)(Oe,{children:c.toolTipContent})]})},u))]})})};var Ct=w(I(),1),vde=async({updateActiveRoute:e,updateErrorCause:t,updateQuery:n,updateStamp:A,item:a})=>{let o;try{o=await fetch("/select-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a.path})})}catch(i){console.error(i),e("/error"),t("Failed to request project selection.");return}let r=!1;try{r=await o.json()==="ok"}catch(i){console.error(i)}r?(window.scrollTo(0,0),n(Ql),e("/explore"),A()):(e("/error"),t("Failed to select project."))},Fde=({item:e})=>{let t=D(r=>r.updateActiveRoute),n=D(r=>r.updateErrorCause),A=D(r=>r.updateQuery),a=D(r=>r.updateStamp);return(0,Ct.jsxs)("a",{href:"#",className:"border-[1px] rounded-lg w-full md:w-96 hover:border-muted-foreground/50 transition-all duration-250 bg-card",onClick:r=>{r.preventDefault(),vde({updateActiveRoute:t,updateErrorCause:n,updateQuery:A,updateStamp:a,item:e}).catch(i=>console.error(i))},children:[(0,Ct.jsxs)("div",{className:"flex flex-col items-start h-20 justify-between px-4 py-3",children:[(0,Ct.jsx)("div",{className:"flex flex-row w-full items-center justify-end",children:e.mtime?(0,Ct.jsx)("div",{className:"text-[0.7rem] text-muted-foreground",children:q$(new Date(e.mtime).toJSON(),"LLLL do, yyyy | hh:mm aa")}):""}),(0,Ct.jsx)("div",{className:"flex",children:(0,Ct.jsx)(jA,{className:"self-end text-md font-medium",children:e.name})})]}),(0,Ct.jsxs)("div",{className:"w-full h-12 flex items-center gap-4 justify-between border-t-[1px] px-4 py-3",children:[(0,Ct.jsx)(Xe,{children:(0,Ct.jsxs)(et,{children:[(0,Ct.jsx)(Qt,{className:"rounded-sm border-[1px] px-2 py-1 text-[0.65rem] text-muted-foreground font-mono m-0 align-baseline truncate",children:e.readablePath}),(0,Ct.jsx)(Oe,{children:e.readablePath})]})}),(0,Ct.jsx)("div",{className:"flex gap-2",children:e.tools.map((r,i)=>(0,Ct.jsx)("div",{className:"flex-none bg-secondary rounded-xl px-2 py-1",children:(0,Ct.jsx)("p",{className:"text-[0.7rem] font-medium text-primary ",children:r})},i))})]})]})},Y$=()=>{let e=D(A=>A.dashboard),[t,n]=(0,gC.useState)([]);return(0,gC.useEffect)(()=>{e&&n(e.projects.sort((A,a)=>A.name.localeCompare(a.name)))},[e]),(0,Ct.jsxs)("div",{className:"flex flex-col grow bg-secondary dark:bg-black px-8 py-8",children:[(0,Ct.jsxs)("div",{className:"flex gap-2 mb-8",children:[(0,Ct.jsx)(Dd,{placeholder:"Filter Projects",items:e?.projects??[],setFilteredItems:n}),(0,Ct.jsx)(vd,{filteredItems:t,setFilteredItems:n,sortKey:"name"})]}),(0,Ct.jsxs)("div",{className:"flex flex-col",children:[(0,Ct.jsx)("p",{className:"text-sm font-semibold mb-4",children:"Projects"}),(0,Ct.jsx)("div",{className:"flex flex-row flex-wrap gap-8",children:e?.projects?t.map((A,a)=>(0,Ct.jsx)(Fde,{item:A},a)):(0,Ct.jsx)("p",{children:"No projects found"})})]})]})};var Pi=w(I(),1),Sde=async({updateDashboard:e,stamp:t})=>{let A=await(await fetch("./dashboard.json?random="+t)).json();e(A)},px=()=>{let e=D(o=>o.dashboard),t=D(o=>o.updateActiveRoute),n=D(o=>o.updateDashboard),A=D(o=>o.updateErrorCause),a=D(o=>o.stamp);return(0,K$.useEffect)(()=>{async function o(){await Sde({updateDashboard:n,stamp:a}),history.pushState({query:"",route:"/dashboard"},"","/dashboard"),window.scrollTo?.(0,0)}o().catch(r=>{console.error(r),t("/error"),A("Failed to initialize dashboard.")})},[a]),(0,Pi.jsxs)("section",{className:"flex grow w-full flex-col min-h-[80svh] bg-white dark:bg-black",children:[(0,Pi.jsxs)("div",{className:"flex items-center justify-between w-full px-8 py-4 border-b-[1px] border-t-[1px] border-solid",children:[e?.cwd?(0,Pi.jsxs)("p",{className:"text-xs font-mono font-light text-muted-foreground",children:["Directory: ",e.cwd]}):"",e?.buildVersion?(0,Pi.jsxs)("p",{className:"text-xs font-mono font-light text-muted-foreground text-right",children:["build: v",e.buildVersion]}):""]}),(0,Pi.jsx)(Lde,{})]})},Lde=()=>(0,Pi.jsx)(Y$,{});var Fd=w(_(),1);var W$=w(_(),1);var He=w(I(),1),J$=()=>{let[e,t]=vi(),[n,A]=vi();return(0,W$.useEffect)(()=>{let{x:a,y:o,width:r,height:i}=n.current.getBoundingClientRect(),s={centerX:a+r/2,centerY:o+i/2},{x:c,y:u,width:d,height:l}=e.current.getBoundingClientRect(),p={centerX:c+d,centerY:u+l};A(n.current,{x:[0,-(s.centerX-p.centerX),0],y:[55,-(s.centerY-p.centerY),0]},{duration:2}),t(e.current,{scale:[1,1.2,1]},{delay:.75,duration:.5}),t("#icon",{rotate:[0,-71]},{delay:.75,duration:.5}),t("#icon",{fill:["","currentColor"]},{delay:.75,duration:.5});let g=setTimeout(()=>{A(n.current,{x:[0,Math.random()*10,Math.random()*10],y:[0,Math.random()*10,Math.random()*10]},{ease:"easeInOut",duration:2,repeat:1/0,repeatType:"mirror"})},2500);return()=>{clearTimeout(g)}},[e,n]),(0,He.jsx)("div",{className:"flex items-center justify-center h-full w-full bg-white dark:bg-black",children:(0,He.jsxs)("div",{className:"-mt-20 flex flex-col items-center justify-center gap-3 mt-10",children:[(0,He.jsxs)("div",{className:"relative flex items-center justify-center mb-20",children:[(0,He.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:.5},className:"absolute z-[1] w-[450px] h-[450px] border-[1px] border-neutral-500/10 rounded-full"}),(0,He.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:1},className:"absolute z-[1] w-[300px] h-[300px] border-[1px] border-neutral-500/15 rounded-full"}),(0,He.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:1.5},className:"absolute z-[1] w-[150px] h-[150px] border-[1px] border-neutral-500/20 rounded-full"}),(0,He.jsxs)("div",{className:"absolute z-[2] flex items-center justify-center h-[50px] w-[400px] bg-gradient-to-r from-white to-neutral-400 dark:from-black dark:to-neutral-800 rounded-[8px]",children:[(0,He.jsxs)("div",{className:"relative flex items-center h-[48.25px] w-[398.25px] bg-white dark:bg-black rounded-[6.25px] shadow-2xl",children:[(0,He.jsx)("p",{className:"-ml-32 bg-gradient-to-r from-white dark:from-black to-neutral-500 dark:to-neutral-500 text-transparent bg-clip-text absolute whitespace-nowrap",children:'[name="my-project"] > :is(:project > *[name="tap"])'}),(0,He.jsxs)("div",{className:"ml-auto flex gap-2 mr-3",children:[(0,He.jsx)("div",{ref:e,className:"flex items-center justify-center h-[24px] w-[24px] rounded-sm border-[1px] bg-neutral-700 dark:bg-neutral-300 border-neutral-800 dark:border-neutral-900",children:(0,He.jsx)(Do,{id:"icon",size:16,className:"text-neutral-100 dark:text-neutral-900"})}),(0,He.jsxs)("div",{className:"flex items-center justify-center gap-1 before:content-[''] before:w-[0.9px] before:h-[14px] before:bg-neutral-400 dark:before:bg-neutral-800 before:rounded-full before:mr-1",children:[(0,He.jsx)("div",{className:"flex items-center justify-center h-[24px] w-[24px] rounded-sm border-[1px] bg-neutral-100 dark:bg-neutral-900 border-neutral-400 dark:border-neutral-800",children:(0,He.jsx)(ko,{size:13,className:"text-neutral-500"})}),(0,He.jsx)("div",{className:"flex items-center justify-center h-[24px] w-[24px] rounded-sm border-[1px] bg-neutral-100 dark:bg-neutral-900 border-neutral-400 dark:border-neutral-800",children:(0,He.jsx)("span",{className:"font-mono text-sm text-neutral-500",children:"k"})})]})]})]}),(0,He.jsx)("div",{ref:n,className:"absolute -right-10 top-10",children:(0,He.jsx)("div",{className:"relative",children:(0,He.jsx)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"1",viewBox:"0 0 16 16",className:"h-6 w-6 transform -rotate-[70deg] -translate-x-[12px] -translate-y-[10px] stroke-sky-500 text-sky-400 dark:stroke-sky-500 dark:text-sky-700 ",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:(0,He.jsx)("path",{d:"M14.082 2.182a.5.5 0 0 1 .103.557L8.528 15.467a.5.5 0 0 1-.917-.007L5.57 10.694.803 8.652a.5.5 0 0 1-.006-.916l12.728-5.657a.5.5 0 0 1 .556.103z"})})})})]})]}),(0,He.jsx)("h3",{className:"text-xl font-medium",children:"No saved Queries yet"}),(0,He.jsxs)("p",{className:"text-sm text-neutral-500 text-center",children:["Looks like you haven't saved any Queries yet,",(0,He.jsx)("br",{}),"explore your Projects to add one!"]}),(0,He.jsx)("div",{className:"flex gap-3"}),(0,He.jsx)(se,{asChild:!0,className:"z-[2]",children:(0,He.jsxs)("a",{href:"/",children:[(0,He.jsx)("span",{children:"Explore Projects"}),(0,He.jsx)(xa,{})]})})]})})};var Ze=w(I(),1),V$=()=>{let e=D(u=>u.savedQueries),[t,n]=(0,Fd.useState)(e??[]),[A,a]=(0,Fd.useState)(!1),[o,r]=(0,Fd.useState)([]),i=D(u=>u.savedQueryLabels),s=u=>{r(d=>d.some(p=>p.id===u.id)?d.filter(p=>p.id!==u.id):[...d,u])},c=()=>{t.length===o.length?r([]):r(t)};return(0,Fd.useEffect)(()=>{if(e){let u=[...e].sort((d,l)=>d.name.localeCompare(l.name));n(u)}},[e]),(0,Ze.jsxs)("section",{className:"flex grow w-full flex-col min-h-[80svh] bg-white dark:bg-black",children:[(0,Ze.jsxs)("div",{className:"flex flex-col px-8 py-4",children:[(0,Ze.jsxs)("div",{className:"flex justify-between",children:[(0,Ze.jsxs)("div",{className:"flex gap-2",children:[(0,Ze.jsx)(Dd,{placeholder:"Filter Queries",items:e,setFilteredItems:n}),(0,Ze.jsx)(vd,{filteredItems:t,setFilteredItems:n,sortKey:"name"}),(0,Ze.jsx)("div",{className:"flex items-center",children:(0,Ze.jsx)("div",{className:"flex items-center",children:(0,Ze.jsx)(rC,{deleteDialogOpen:A,setDeleteDialogOpen:a,selectedQueries:o,type:"icon"})})})]}),(0,Ze.jsx)(se,{asChild:!0,variant:"outline",children:(0,Ze.jsxs)("a",{href:"/labels",children:[(0,Ze.jsx)($l,{}),(0,Ze.jsx)("span",{children:"Labels"}),(0,Ze.jsx)($o,{variant:"secondary",children:i?.length})]})})]}),(0,Ze.jsxs)("div",{className:"mt-6",children:[!!e?.length&&(0,Ze.jsxs)("div",{className:"grid grid-cols-12 gap-4",children:[(0,Ze.jsxs)("div",{className:"col-span-2 flex items-center gap-3 px-3",children:[(0,Ze.jsx)(Ho,{onCheckedChange:c,className:"border-muted-foreground/50 hover:border-muted-foreground/75"}),(0,Ze.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Name"})]}),(0,Ze.jsx)("div",{className:"col-span-4 items-center px-1",children:(0,Ze.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Query"})}),(0,Ze.jsx)("div",{className:"col-span-2 items-center",children:(0,Ze.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Directory"})}),(0,Ze.jsx)("div",{className:"col-span-4 items-center",children:(0,Ze.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Labels"})})]}),(0,Ze.jsx)("div",{className:"mt-3 flex flex-col gap-3",children:e&&t.map((u,d)=>(0,Ze.jsx)(ZS,{checked:o.some(l=>l.id===u.id),handleSelect:s,item:u},d))})]})]}),!e?.length&&(0,Ze.jsx)(J$,{})]})};var rc=w(_(),1);var ur=w(_(),1);var Le=w(I(),1),X$=({queryLabel:e,checked:t,handleSelect:n})=>{let[A,a]=(0,ur.useState)(!1),[o,r]=(0,ur.useState)(""),[i,s]=(0,ur.useState)(""),[c,u]=(0,ur.useState)(gu),d=D(C=>C.updateSavedQueryLabel),{toast:l}=zn(),[p,g]=(0,ur.useState)(0),b=D(C=>C.savedQueries),B=D(C=>C.updateActiveRoute),f=()=>{a(!A)},m=()=>{let C={...e,name:i,description:o,color:c};d(C),a(!1),l({title:`${i} saved successfully`})},h=()=>{B("/queries"),history.pushState({route:"/queries"},"",`/queries?label=${encodeURIComponent(i)}`)};return(0,ur.useEffect)(()=>{g(0);let C=b?.reduce((E,Q)=>E+(Q.labels?.filter(y=>y.name===e.name).length||0),0);g(C||0)},[e,b]),(0,ur.useEffect)(()=>{s(e.name),r(e.description),u(e.color)},[e]),(0,Le.jsxs)("div",{className:"bg-neutral-50/50 dark:bg-neutral-950 rounded-sm transition-all border border-[1px] border-muted-foreground/25 group hover:border-foreground/50",children:[(0,Le.jsxs)("div",{className:"grid grid-cols-8 flex items-center px-3 py-2",children:[(0,Le.jsxs)("div",{className:"col-span-2 flex gap-3 items-center",children:[(0,Le.jsx)(Ho,{onCheckedChange:()=>n(e),checked:t,className:"border-muted-foreground/25 group-hover:border-muted-foreground/50"}),(0,Le.jsx)(ia,{name:i.trim()!==""?i:"Label preview",color:c})]}),(0,Le.jsx)("div",{className:"col-span-4 flex items-center",children:!A&&(0,Le.jsx)("p",{className:"text-sm truncate",children:o})}),(0,Le.jsx)("div",{className:"flex items-center justify-center",children:(0,Le.jsxs)(se,{variant:"ghost",className:"flex items-center justify-center gap-1",onClick:()=>p?h():void 0,children:[(0,Le.jsx)("span",{children:p}),(0,Le.jsx)(ts,{})]})}),(0,Le.jsx)("div",{className:"flex items-center justify-end",children:(0,Le.jsx)(se,{variant:"outline",className:"text-sm px-3 rounded-sm border border-[1px] border-muted-foreground/25 h-[2rem]",onClick:f,children:A?"Close":"Edit"})})]}),A&&(0,Le.jsx)("div",{className:"pt-6 mb-3 flex flex-col px-3 py-2 border-t-[1px] border-muted-foreground/25",children:(0,Le.jsxs)("div",{className:"flex gap-3",children:[(0,Le.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Le.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Name"}),(0,Le.jsx)(We,{type:"text",value:i,onChange:C=>s(C.target.value),placeholder:"Name"})]}),(0,Le.jsxs)("div",{className:"flex flex-col gap-2 grow",children:[(0,Le.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Description"}),(0,Le.jsx)(We,{type:"text",value:o,onChange:C=>r(C.target.value),placeholder:"Description (optional)"})]}),(0,Le.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Le.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Color"}),(0,Le.jsxs)(eA,{children:[(0,Le.jsx)(tA,{asChild:!0,children:(0,Le.jsxs)(se,{className:"w-[120px] font-normal",variant:"outline",children:[(0,Le.jsx)(Io,{}),(0,Le.jsx)("span",{children:c})]})}),(0,Le.jsx)(Hn,{children:(0,Le.jsx)(mu,{defaultInput:c,defaultColor:c,onChange:u})})]})]}),(0,Le.jsx)("div",{className:"flex items-end mb-0.5",children:(0,Le.jsx)(se,{disabled:i.trim()===""||i==="Label preview",onClick:m,variant:"default",size:"sm",children:"Save changes"})})]})})]})};var eT=w(_(),1);var Vt=w(I(),1),tT=({deleteDialogOpen:e,setDeleteDialogOpen:t,selectedLabels:n})=>{let{toast:A}=zn(),[a,o]=(0,eT.useState)(!1),r=D(s=>s.deleteSavedQueryLabels),i=()=>{t(!1),o(!1),r(n),A({title:"Deleted successfully"})};return(0,Vt.jsx)("div",{className:"flex items-center",children:(0,Vt.jsx)("div",{className:"flex items-center",children:(0,Vt.jsxs)(ws,{open:e,onOpenChange:t,children:[(0,Vt.jsx)(et,{open:a,onOpenChange:o,children:(0,Vt.jsxs)(Xe,{children:[(0,Vt.jsx)(lu,{asChild:!0,children:(0,Vt.jsx)(se,{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),disabled:n.length<=0,className:"rounded-sm border border-[1px] border-muted-foreground/25",size:"icon",variant:"ghost",children:(0,Vt.jsx)(As,{})})}),(0,Vt.jsxs)(Oe,{children:["Delete"," ",n.length<=1?"Label":"Labels"]})]})}),(0,Vt.jsxs)(Xr,{children:[(0,Vt.jsxs)(Es,{children:[(0,Vt.jsxs)(Qs,{className:"font-medium",children:["Delete"," ",n.length<=1?"Label":"Labels"]}),(0,Vt.jsx)(ks,{})]}),(0,Vt.jsxs)("div",{children:["You're about to delete:",(0,Vt.jsx)("ul",{className:"my-3 list-none",children:n.map((s,c)=>(0,Vt.jsx)("li",{className:"font-medium",children:s.name},c))}),"This action cannot be undone."]}),(0,Vt.jsxs)(ys,{children:[(0,Vt.jsx)(se,{variant:"outline",onClick:()=>t(!1),children:"No, Keep It."}),(0,Vt.jsx)(se,{variant:"destructive",onClick:i,children:"Yes, Delete!"})]})]})]})})})};var oc=w(_(),1);var wt=w(I(),1),mC=({closeCreate:e})=>{let[t,n]=(0,oc.useState)("Label preview"),[A,a]=(0,oc.useState)(""),[o,r]=(0,oc.useState)("#00FF5F"),[i,s]=(0,oc.useState)(!1),c=D(p=>p.saveQueryLabel),{toast:u}=zn(),d=()=>{e()},l=()=>{c({id:Is(),name:t,description:A,color:o}),u({title:`${t} saved successfully`}),e()};return(0,oc.useEffect)(()=>{t.trim()!==""&&t.trim()!=="Label preview"?s(!0):s(!1)},[t,A,o]),(0,wt.jsx)("div",{className:"bg-neutral-100 dark:bg-neutral-950 rounded-sm transition-all border border-[1px] border-muted-foreground/25",children:(0,wt.jsxs)("div",{className:"flex flex-col px-3 py-3 gap-3",children:[(0,wt.jsx)("div",{children:(0,wt.jsx)(ia,{name:t.trim()!==""?t:"Label preview",color:o})}),(0,wt.jsxs)("div",{className:"flex mt-4 gap-3 w-full",children:[(0,wt.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,wt.jsx)(Gt,{className:"text-sm font-medium border-none",children:"Name"}),(0,wt.jsx)(We,{type:"text",value:t,onChange:p=>n(p.target.value),placeholder:"Name"})]}),(0,wt.jsxs)("div",{className:"flex flex-col gap-2 grow",children:[(0,wt.jsx)(Gt,{className:"text-sm font-medium border-none",children:"Description"}),(0,wt.jsx)(We,{type:"text",value:A,onChange:p=>a(p.target.value),placeholder:"Description (optional)"})]}),(0,wt.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,wt.jsx)(Gt,{className:"text-sm font-medium border-none",children:"Color"}),(0,wt.jsxs)(eA,{children:[(0,wt.jsx)(tA,{asChild:!0,children:(0,wt.jsxs)(se,{className:"w-[120px]",variant:"outline",children:[(0,wt.jsx)(Io,{}),(0,wt.jsx)("span",{children:o})]})}),(0,wt.jsx)(Hn,{children:(0,wt.jsx)(mu,{defaultColor:o,defaultInput:o,onChange:r})})]})]}),(0,wt.jsxs)("div",{className:"flex items-end justify-end gap-3",children:[(0,wt.jsx)(se,{onClick:d,variant:"outline",children:"Cancel"}),(0,wt.jsx)(se,{disabled:!i,onClick:l,children:"Create label"})]})]})]})})};var nT=w(_(),1);var xt=w(I(),1),AT=()=>{let[e,t]=(0,nT.useState)(!1);return(0,xt.jsxs)("div",{className:"flex items-center justify-center h-full w-full bg-white dark:bg-black",children:[(0,xt.jsx)(JB,{children:!e&&(0,xt.jsxs)(Kt.div,{initial:{opacity:1},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"-mt-20 flex flex-col gap-3 items-center justify-center",children:[(0,xt.jsxs)("div",{className:"relative flex items-center justify-center mb-20",children:[(0,xt.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:.5},className:"absolute w-[450px] h-[450px] border-[1px] border-neutral-500/10 rounded-full"}),(0,xt.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:1},className:"absolute w-[300px] h-[300px] border-[1px] border-neutral-500/15 rounded-full"}),(0,xt.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:1.5},className:"absolute w-[150px] h-[150px] border-[1px] border-neutral-500/20 rounded-full"}),(0,xt.jsx)("div",{className:"relative flex items-center justify-center h-[42px] w-[400px] bg-gradient-to-r from-white dark:from-black to-muted-foreground dark:to-muted-foreground rounded-[8px]",children:(0,xt.jsxs)("div",{className:"flex items-center justify-center h-[40px] w-[398px] bg-white dark:bg-black rounded-[7px]",children:[(0,xt.jsx)("span",{className:"absolute my-auto mr-32 text-sm tracking bg-gradient-to-r from-white dark:from-black dark:to-neutral-500 to-neutral-500 text-transparent bg-clip-text",children:"Need to update insecure packages"}),(0,xt.jsx)(Kt.div,{initial:{opacity:.5},animate:{opacity:[.5,.8,.5]},transition:{duration:8,repeat:1/0,ease:"linear",repeatType:"loop"},className:"absolute flex items-center justify-center my-auto right-3 bg-red-500 h-[24px] w-[80px] rounded-full",children:(0,xt.jsx)("span",{className:"text-xs font-semibold tracking-wide",children:"Insecure"})})]})})]}),(0,xt.jsx)("h3",{className:"text-xl z-[2] font-medium",children:"No saved Labels yet"}),(0,xt.jsxs)("p",{className:"text-sm z-[2] text-neutral-500 text-center",children:["Looks like you haven't made any Labels yet,",(0,xt.jsx)("br",{}),"Labels are a great way to mark your dependencies."]}),(0,xt.jsx)("div",{className:"flex gap-3"}),(0,xt.jsxs)(se,{onClick:()=>t(!0),children:[(0,xt.jsx)("span",{children:"New Label"}),(0,xt.jsx)(_o,{})]})]})}),(0,xt.jsx)(JB,{children:e&&(0,xt.jsx)(Kt.div,{className:"absolute",exit:{opacity:0,y:10},initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,xt.jsx)(mC,{closeCreate:()=>t(!1)})})})]})};var dt=w(I(),1),aT=()=>{let[e,t]=(0,rc.useState)(!1),[n,A]=(0,rc.useState)(!1),[a,o]=(0,rc.useState)([]),[r,i]=(0,rc.useState)([]),s=D(d=>d.savedQueryLabels),c=d=>{i(l=>l.some(g=>g.id===d.id)?l.filter(g=>g.id!==d.id):[...l,d])},u=()=>{a.length===r.length?i([]):i(a)};return(0,rc.useEffect)(()=>{if(s){let d=[...s].sort((l,p)=>l.name.localeCompare(p.name));o(d)}},[s]),(0,dt.jsxs)("section",{className:"flex grow w-full flex-col min-h-[80svh] bg-white dark:bg-black",children:[(0,dt.jsxs)("div",{className:"flex flex-col px-8 py-4",children:[(0,dt.jsxs)("div",{className:"flex justify-between",children:[(0,dt.jsxs)("div",{className:"flex gap-2",children:[(0,dt.jsx)(Dd,{placeholder:"Filter Labels",items:s,setFilteredItems:o}),(0,dt.jsx)(vd,{filteredItems:a,setFilteredItems:o,sortKey:"name"}),(0,dt.jsx)(tT,{deleteDialogOpen:e,setDeleteDialogOpen:t,selectedLabels:r})]}),(0,dt.jsx)("div",{children:s?.length!==0&&(0,dt.jsxs)(se,{disabled:n,onClick:()=>A(!0),children:[(0,dt.jsx)("span",{children:"New Label"}),(0,dt.jsx)(_o,{})]})})]}),n&&(0,dt.jsx)("div",{className:"mt-6",children:(0,dt.jsx)(mC,{closeCreate:()=>A(!1)})}),!!s?.length&&(0,dt.jsxs)("div",{className:"mt-6 grid grid-cols-8 px-3",children:[(0,dt.jsxs)("div",{className:"col-span-2 flex items-center gap-3",children:[(0,dt.jsx)(Ho,{onCheckedChange:u,className:"border-muted-foreground/50 hover:border-muted-foreground/75"}),(0,dt.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Name"})]}),(0,dt.jsx)("div",{className:"col-span-4 flex items-center",children:(0,dt.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Description"})}),(0,dt.jsx)("div",{className:"flex items-center justify-center",children:(0,dt.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"References"})})]}),(0,dt.jsx)("div",{className:"mt-3 flex flex-col gap-3",children:s&&a.map((d,l)=>(0,dt.jsx)(X$,{checked:r.some(p=>p.id===d.id),handleSelect:c,queryLabel:d},l))})]}),!s?.length&&(0,dt.jsx)(AT,{})]})};var ic=w(_(),1);var Be=w(_(),1),rT=w(Lr(),1);var $e=w(I(),1),hx="ToastProvider",[Bx,Rde,Mde]=ri("Toast"),[iT,aTe]=Pt("Toast",[Mde]),[Nde,bC]=iT(hx),sT=e=>{let{__scopeToast:t,label:n="Notification",duration:A=5e3,swipeDirection:a="right",swipeThreshold:o=50,children:r}=e,[i,s]=Be.useState(null),[c,u]=Be.useState(0),d=Be.useRef(!1),l=Be.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${hx}\`. Expected non-empty \`string\`.`),(0,$e.jsx)(Bx.Provider,{scope:t,children:(0,$e.jsx)(Nde,{scope:t,label:n,duration:A,swipeDirection:a,swipeThreshold:o,toastCount:c,viewport:i,onViewportChange:s,onToastAdd:Be.useCallback(()=>u(p=>p+1),[]),onToastRemove:Be.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:l,children:r})})};sT.displayName=hx;var cT="ToastViewport",Pde=["F8"],mx="toast.viewportPause",fx="toast.viewportResume",uT=Be.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:A=Pde,label:a="Notifications ({hotkey})",...o}=e,r=bC(cT,n),i=Rde(n),s=Be.useRef(null),c=Be.useRef(null),u=Be.useRef(null),d=Be.useRef(null),l=pe(t,d,r.onViewportChange),p=A.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=r.toastCount>0;Be.useEffect(()=>{let B=f=>{A.length!==0&&A.every(h=>f[h]||f.code===h)&&d.current?.focus()};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[A]),Be.useEffect(()=>{let B=s.current,f=d.current;if(g&&B&&f){let m=()=>{if(!r.isClosePausedRef.current){let Q=new CustomEvent(mx);f.dispatchEvent(Q),r.isClosePausedRef.current=!0}},h=()=>{if(r.isClosePausedRef.current){let Q=new CustomEvent(fx);f.dispatchEvent(Q),r.isClosePausedRef.current=!1}},C=Q=>{!B.contains(Q.relatedTarget)&&h()},E=()=>{B.contains(document.activeElement)||h()};return B.addEventListener("focusin",m),B.addEventListener("focusout",C),B.addEventListener("pointermove",m),B.addEventListener("pointerleave",E),window.addEventListener("blur",m),window.addEventListener("focus",h),()=>{B.removeEventListener("focusin",m),B.removeEventListener("focusout",C),B.removeEventListener("pointermove",m),B.removeEventListener("pointerleave",E),window.removeEventListener("blur",m),window.removeEventListener("focus",h)}}},[g,r.isClosePausedRef]);let b=Be.useCallback(({tabbingDirection:B})=>{let m=i().map(h=>{let C=h.ref.current,E=[C,...Wde(C)];return B==="forwards"?E:E.reverse()});return(B==="forwards"?m.reverse():m).flat()},[i]);return Be.useEffect(()=>{let B=d.current;if(B){let f=m=>{let h=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!h){let E=document.activeElement,Q=m.shiftKey;if(m.target===B&&Q){c.current?.focus();return}let R=b({tabbingDirection:Q?"backwards":"forwards"}),F=R.findIndex(U=>U===E);gx(R.slice(F+1))?m.preventDefault():Q?c.current?.focus():u.current?.focus()}};return B.addEventListener("keydown",f),()=>B.removeEventListener("keydown",f)}},[i,b]),(0,$e.jsxs)(D8,{ref:s,role:"region","aria-label":a.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&(0,$e.jsx)(bx,{ref:c,onFocusFromOutsideViewport:()=>{let B=b({tabbingDirection:"forwards"});gx(B)}}),(0,$e.jsx)(Bx.Slot,{scope:n,children:(0,$e.jsx)(Z.ol,{tabIndex:-1,...o,ref:l})}),g&&(0,$e.jsx)(bx,{ref:u,onFocusFromOutsideViewport:()=>{let B=b({tabbingDirection:"backwards"});gx(B)}})]})});uT.displayName=cT;var dT="ToastFocusProxy",bx=Be.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:A,...a}=e,o=bC(dT,n);return(0,$e.jsx)(ms,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:r=>{let i=r.relatedTarget;!o.viewport?.contains(i)&&A()}})});bx.displayName=dT;var hC="Toast",jde="toast.swipeStart",Gde="toast.swipeMove",zde="toast.swipeCancel",Hde="toast.swipeEnd",lT=Be.forwardRef((e,t)=>{let{forceMount:n,open:A,defaultOpen:a,onOpenChange:o,...r}=e,[i=!0,s]=Tt({prop:A,defaultProp:a,onChange:o});return(0,$e.jsx)(jt,{present:n||i,children:(0,$e.jsx)(Ude,{open:i,...r,ref:t,onClose:()=>s(!1),onPause:Je(e.onPause),onResume:Je(e.onResume),onSwipeStart:z(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:z(e.onSwipeMove,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:z(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:z(e.onSwipeEnd,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),s(!1)})})})});lT.displayName=hC;var[$de,Tde]=iT(hC,{onClose(){}}),Ude=Be.forwardRef((e,t)=>{let{__scopeToast:n,type:A="foreground",duration:a,open:o,onClose:r,onEscapeKeyDown:i,onPause:s,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:l,onSwipeEnd:p,...g}=e,b=bC(hC,n),[B,f]=Be.useState(null),m=pe(t,N=>f(N)),h=Be.useRef(null),C=Be.useRef(null),E=a||b.duration,Q=Be.useRef(0),y=Be.useRef(E),k=Be.useRef(0),{onToastAdd:R,onToastRemove:F}=b,U=Je(()=>{B?.contains(document.activeElement)&&b.viewport?.focus(),r()}),M=Be.useCallback(N=>{!N||N===1/0||(window.clearTimeout(k.current),Q.current=new Date().getTime(),k.current=window.setTimeout(U,N))},[U]);Be.useEffect(()=>{let N=b.viewport;if(N){let te=()=>{M(y.current),c?.()},W=()=>{let ne=new Date().getTime()-Q.current;y.current=y.current-ne,window.clearTimeout(k.current),s?.()};return N.addEventListener(mx,W),N.addEventListener(fx,te),()=>{N.removeEventListener(mx,W),N.removeEventListener(fx,te)}}},[b.viewport,E,s,c,M]),Be.useEffect(()=>{o&&!b.isClosePausedRef.current&&M(E)},[o,E,b.isClosePausedRef,M]),Be.useEffect(()=>(R(),()=>F()),[R,F]);let ce=Be.useMemo(()=>B?BT(B):null,[B]);return b.viewport?(0,$e.jsxs)($e.Fragment,{children:[ce&&(0,$e.jsx)(Zde,{__scopeToast:n,role:"status","aria-live":A==="foreground"?"assertive":"polite","aria-atomic":!0,children:ce}),(0,$e.jsx)($de,{scope:n,onClose:U,children:rT.createPortal((0,$e.jsx)(Bx.ItemSlot,{scope:n,children:(0,$e.jsx)(x8,{asChild:!0,onEscapeKeyDown:z(i,()=>{b.isFocusedToastEscapeKeyDownRef.current||U(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,$e.jsx)(Z.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":b.swipeDirection,...g,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:z(e.onKeyDown,N=>{N.key==="Escape"&&(i?.(N.nativeEvent),N.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,U()))}),onPointerDown:z(e.onPointerDown,N=>{N.button===0&&(h.current={x:N.clientX,y:N.clientY})}),onPointerMove:z(e.onPointerMove,N=>{if(!h.current)return;let te=N.clientX-h.current.x,W=N.clientY-h.current.y,ne=!!C.current,K=["left","right"].includes(b.swipeDirection),H=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,ve=K?H(0,te):0,Re=K?0:H(0,W),L=N.pointerType==="touch"?10:2,ae={x:ve,y:Re},ue={originalEvent:N,delta:ae};ne?(C.current=ae,fC(Gde,d,ue,{discrete:!1})):oT(ae,b.swipeDirection,L)?(C.current=ae,fC(jde,u,ue,{discrete:!1}),N.target.setPointerCapture(N.pointerId)):(Math.abs(te)>L||Math.abs(W)>L)&&(h.current=null)}),onPointerUp:z(e.onPointerUp,N=>{let te=C.current,W=N.target;if(W.hasPointerCapture(N.pointerId)&&W.releasePointerCapture(N.pointerId),C.current=null,h.current=null,te){let ne=N.currentTarget,K={originalEvent:N,delta:te};oT(te,b.swipeDirection,b.swipeThreshold)?fC(Hde,p,K,{discrete:!0}):fC(zde,l,K,{discrete:!0}),ne.addEventListener("click",H=>H.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),Zde=e=>{let{__scopeToast:t,children:n,...A}=e,a=bC(hC,t),[o,r]=Be.useState(!1),[i,s]=Be.useState(!1);return Yde(()=>r(!0)),Be.useEffect(()=>{let c=window.setTimeout(()=>s(!0),1e3);return()=>window.clearTimeout(c)},[]),i?null:(0,$e.jsx)(LA,{asChild:!0,children:(0,$e.jsx)(ms,{...A,children:o&&(0,$e.jsxs)($e.Fragment,{children:[a.label," ",n]})})})},qde="ToastTitle",pT=Be.forwardRef((e,t)=>{let{__scopeToast:n,...A}=e;return(0,$e.jsx)(Z.div,{...A,ref:t})});pT.displayName=qde;var Ode="ToastDescription",gT=Be.forwardRef((e,t)=>{let{__scopeToast:n,...A}=e;return(0,$e.jsx)(Z.div,{...A,ref:t})});gT.displayName=Ode;var mT="ToastAction",fT=Be.forwardRef((e,t)=>{let{altText:n,...A}=e;return n.trim()?(0,$e.jsx)(hT,{altText:n,asChild:!0,children:(0,$e.jsx)(Cx,{...A,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${mT}\`. Expected non-empty \`string\`.`),null)});fT.displayName=mT;var bT="ToastClose",Cx=Be.forwardRef((e,t)=>{let{__scopeToast:n,...A}=e,a=Tde(bT,n);return(0,$e.jsx)(hT,{asChild:!0,children:(0,$e.jsx)(Z.button,{type:"button",...A,ref:t,onClick:z(e.onClick,a.onClose)})})});Cx.displayName=bT;var hT=Be.forwardRef((e,t)=>{let{__scopeToast:n,altText:A,...a}=e;return(0,$e.jsx)(Z.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":A||void 0,...a,ref:t})});function BT(e){let t=[];return Array.from(e.childNodes).forEach(A=>{if(A.nodeType===A.TEXT_NODE&&A.textContent&&t.push(A.textContent),Kde(A)){let a=A.ariaHidden||A.hidden||A.style.display==="none",o=A.dataset.radixToastAnnounceExclude==="";if(!a)if(o){let r=A.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...BT(A))}}),t}function fC(e,t,n,{discrete:A}){let a=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),A?Oc(a,o):a.dispatchEvent(o)}var oT=(e,t,n=0)=>{let A=Math.abs(e.x),a=Math.abs(e.y),o=A>a;return t==="left"||t==="right"?o&&A>n:!o&&a>n};function Yde(e=()=>{}){let t=Je(e);Ne(()=>{let n=0,A=0;return n=window.requestAnimationFrame(()=>A=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(A)}},[t])}function Kde(e){return e.nodeType===e.ELEMENT_NODE}function Wde(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:A=>{let a=A.tagName==="INPUT"&&A.type==="hidden";return A.disabled||A.hidden||a?NodeFilter.FILTER_SKIP:A.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gx(e){let t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var CT=sT,wx=uT,Ex=lT,yx=pT,Qx=gT,kx=fT,Ix=Cx;var ji=w(I(),1),wT=CT,_x=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(wx,{ref:n,className:v("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));_x.displayName=wx.displayName;var Vde=VA("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),xx=ic.forwardRef(({className:e,variant:t,...n},A)=>(0,ji.jsx)(Ex,{ref:A,className:v(Vde({variant:t}),e),...n}));xx.displayName=Ex.displayName;var Xde=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(kx,{ref:n,className:v("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Xde.displayName=kx.displayName;var Dx=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(Ix,{ref:n,className:v("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,ji.jsx)(vo,{className:"h-4 w-4"})}));Dx.displayName=Ix.displayName;var vx=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(yx,{ref:n,className:v("text-sm font-semibold",e),...t}));vx.displayName=yx.displayName;var Fx=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(Qx,{ref:n,className:v("text-sm opacity-90",e),...t}));Fx.displayName=Qx.displayName;var dr=w(I(),1);function ET(){let{toasts:e}=zn();return(0,dr.jsxs)(wT,{children:[e.map(function({id:t,title:n,description:A,action:a,...o}){return(0,dr.jsxs)(xx,{...o,children:[(0,dr.jsxs)("div",{className:"grid gap-1",children:[n&&(0,dr.jsx)(vx,{children:n}),A&&(0,dr.jsx)(Fx,{children:A})]}),a,(0,dr.jsx)(Dx,{})]},t)}),(0,dr.jsx)(_x,{})]})}var gn=w(I(),1),yT={"/dashboard":(0,gn.jsx)(px,{}),"/error":(0,gn.jsx)(B$,{}),"/explore":(0,gn.jsx)(b$,{}),"/queries":(0,gn.jsx)(V$,{}),"/labels":(0,gn.jsx)(aT,{})},sc=()=>{let e=D(A=>A.activeRoute),t=(0,gn.jsx)(px,{}),n=Object.keys(yT).find(A=>e.startsWith(A));return(0,gn.jsx)(Wy,{defaultOpen:KS,children:(0,gn.jsxs)(sc.Wrapper,{children:[(0,gn.jsxs)(sc.Body,{children:[(0,gn.jsx)(WS,{}),(0,gn.jsxs)(sc.Content,{children:[(0,gn.jsx)(R1,{}),n?yT[n]:t,(0,gn.jsx)(Z1,{})]})]}),(0,gn.jsx)(ET,{})]})})};sc.Wrapper=({children:e})=>(0,gn.jsx)("div",{className:"flex flex-col min-h-svh w-full",children:e});sc.Body=({children:e})=>(0,gn.jsx)("div",{className:"flex flex-row min-h-svh w-full",children:e});sc.Content=({children:e})=>(0,gn.jsx)("div",{className:"flex flex-col grow w-full",children:e});var QT=sc;var Tg=w(I(),1),ele=()=>(0,Tg.jsx)(QT,{}),kT=document.getElementById("app");kT&&(0,_T.createRoot)(kT).render((0,Tg.jsx)(IT.StrictMode,{children:(0,Tg.jsx)(S1,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:(0,Tg.jsx)(ele,{})})}));
|
|
73
|
+
`),()=>{document.head.removeChild(u)}},[t]),(0,Yz.jsx)(N_,{isPresent:t,childRef:A,sizeRef:a,children:KB.cloneElement(e,{ref:A})})}var Jz=({children:e,initial:t,isPresent:n,onExitComplete:A,custom:a,presenceAffectsLayout:o,mode:r})=>{let i=or(Uce),s=(0,Xs.useId)(),c=(0,Xs.useCallback)(d=>{i.set(d,!0);for(let l of i.values())if(!l)return;A&&A()},[i,A]),u=(0,Xs.useMemo)(()=>({id:s,initial:t,isPresent:n,custom:a,onExitComplete:c,register:d=>(i.set(d,!1),()=>i.delete(d))}),o?[Math.random(),c]:[n,c]);return(0,Xs.useMemo)(()=>{i.forEach((d,l)=>i.set(l,!1))},[n]),Wz.useEffect(()=>{!n&&!i.size&&A&&A()},[n]),r==="popLayout"&&(e=(0,P_.jsx)(Kz,{isPresent:n,children:e})),(0,P_.jsx)(_i.Provider,{value:u,children:e})};function Uce(){return new Map}var WB=w(_(),1),Pg=e=>e.key||"";function j_(e){let t=[];return WB.Children.forEach(e,n=>{(0,WB.isValidElement)(n)&&t.push(n)}),t}var JB=({children:e,exitBeforeEnter:t,custom:n,initial:A=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:r="sync"})=>{aA(!t,"Replace exitBeforeEnter with mode='wait'");let i=(0,uo.useMemo)(()=>j_(e),[e]),s=i.map(Pg),c=(0,uo.useRef)(!0),u=(0,uo.useRef)(i),d=or(()=>new Map),[l,p]=(0,uo.useState)(i),[g,b]=(0,uo.useState)(i);MB(()=>{c.current=!1,u.current=i;for(let m=0;m<g.length;m++){let h=Pg(g[m]);s.includes(h)?d.delete(h):d.get(h)!==!0&&d.set(h,!1)}},[g,s.length,s.join("-")]);let B=[];if(i!==l){let m=[...i];for(let h=0;h<g.length;h++){let C=g[h],E=Pg(C);s.includes(E)||(m.splice(h,0,C),B.push(C))}r==="wait"&&B.length&&(m=B),b(j_(m)),p(i);return}let{forceRender:f}=(0,uo.useContext)(Ad);return(0,jg.jsx)(jg.Fragment,{children:g.map(m=>{let h=Pg(m),C=i===g||s.includes(h),E=()=>{if(d.has(h))d.set(h,!0);else return;let Q=!0;d.forEach(y=>{y||(Q=!1)}),Q&&(f?.(),b(u.current),a&&a())};return(0,jg.jsx)(Jz,{isPresent:C,initial:!c.current||A?void 0:!1,custom:C?void 0:n,presenceAffectsLayout:o,mode:r,onExitComplete:C?void 0:E,children:m},h)})})};function Vz(e,t,n){var A;if(typeof e=="string"){let a=document;t&&(aA(!!t.current,"Scope provided, but no element detected."),a=t.current),n?((A=n[e])!==null&&A!==void 0||(n[e]=a.querySelectorAll(e)),e=n[e]):e=a.querySelectorAll(e)}else e instanceof Element&&(e=[e]);return Array.from(e||[])}var Xz=w(_(),1);function eH(e){return(0,Xz.useEffect)(()=>()=>e(),[])}function tH(e,t=100,n){let A=n({...e,keyframes:[0,t]}),a=Math.min(oB(A),2e4);return{type:"keyframes",ease:o=>A.next(a*o).value/t,duration:Un(a)}}function Gg(e){return typeof e=="object"&&!Array.isArray(e)}function VB(e,t,n,A){return typeof e=="string"&&Gg(t)?Vz(e,n,A):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function G_(e,t,n,A){var a;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:(a=A.get(t))!==null&&a!==void 0?a:e}var nH=(e,t,n)=>{let A=t-e;return((n-e)%A+A)%A+e};function AH(e,t){return Xh(e)?e[nH(0,e.length,t)]:e}function qce(e,t,n){for(let A=0;A<e.length;A++){let a=e[A];a.at>t&&a.at<n&&(Qi(e,a),A--)}}function aH(e,t,n,A,a,o){qce(e,a,o);for(let r=0;r<t.length;r++)e.push({value:t[r],at:De(a,o,A[r]),easing:AH(n,r)})}function oH(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Oce="easeInOut";function sH(e,{defaultTransition:t={},...n}={},A,a){let o=t.duration||.3,r=new Map,i=new Map,s={},c=new Map,u=0,d=0,l=0;for(let p=0;p<e.length;p++){let g=e[p];if(typeof g=="string"){c.set(g,d);continue}else if(!Array.isArray(g)){c.set(g.name,G_(d,g.at,u,c));continue}let[b,B,f={}]=g;f.at!==void 0&&(d=G_(d,f.at,u,c));let m=0,h=(C,E,Q,y=0,k=0)=>{let R=Yce(C),{delay:F=0,times:U=aB(R),type:M="keyframes",...ce}=E,{ease:N=t.ease||"easeOut",duration:te}=E,W=typeof F=="function"?F(y,k):F,ne=R.length,K=yi(M)?M:a?.[M];if(ne<=2&&K){let L=100;if(ne===2&&Jce(R)){let Ae=R[1]-R[0];L=Math.abs(Ae)}let ae={...ce};te!==void 0&&(ae.duration=Cn(te));let ue=tH(ae,L,K);N=ue.ease,te=ue.duration}te??(te=o);let H=d+W,ve=H+te;U.length===1&&U[0]===0&&(U[1]=1);let Re=U.length-R.length;Re>0&&AB(U,Re),R.length===1&&R.unshift(null),aH(Q,R,N,U,H,ve),m=Math.max(W+te,m),l=Math.max(ve,l)};if(Ue(b)){let C=rH(b,i);h(B,f,iH("default",C))}else{let C=VB(b,B,A,s),E=C.length;for(let Q=0;Q<E;Q++){B=B,f=f;let y=C[Q],k=rH(y,i);for(let R in B)h(B[R],Kce(f,R),iH(R,k),Q,E)}}u=d,d+=m}return i.forEach((p,g)=>{for(let b in p){let B=p[b];B.sort(oH);let f=[],m=[],h=[];for(let E=0;E<B.length;E++){let{at:Q,value:y,easing:k}=B[E];f.push(y),m.push(HA(0,l,Q)),h.push(k||"easeOut")}m[0]!==0&&(m.unshift(0),f.unshift(f[0]),h.unshift(Oce)),m[m.length-1]!==1&&(m.push(1),f.push(null)),r.has(g)||r.set(g,{keyframes:{},transition:{}});let C=r.get(g);C.keyframes[b]=f,C.transition[b]={...t,duration:l,ease:h,times:m,...n}}}),r}function rH(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function iH(e,t){return t[e]||(t[e]=[]),t[e]}function Yce(e){return Array.isArray(e)?e:[e]}function Kce(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Wce=e=>typeof e=="number",Jce=e=>e.every(Wce);function Vce(e,t){return e in t}var XB=class extends Bd{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(Vce(n,t)){let A=t[n];if(typeof A=="string"||typeof A=="number")return A}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return ot()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}};function cH(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=IB(e)?new Ed(t):new wd(t);n.mount(e),rr.set(e,n)}function uH(e){let t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new XB(t);n.mount(e),rr.set(e,n)}function Xce(e,t){return Ue(e)||typeof e=="number"||typeof e=="string"&&!Gg(t)}function eC(e,t,n,A){let a=[];if(Xce(e,t))a.push(_B(e,Gg(t)&&t.default||t,n&&(n.default||n)));else{let o=VB(e,t,A),r=o.length;aA(!!r,"No valid elements provided.");for(let i=0;i<r;i++){let s=o[i],c=s instanceof Element?cH:uH;rr.has(s)||c(s);let u=rr.get(s),d={...n};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(i,r)),a.push(...Xu(u,{...t,transition:d},{}))}}return a}function dH(e,t,n){let A=[];return sH(e,t,n,{spring:Zu}).forEach(({keyframes:o,transition:r},i)=>{A.push(...eC(i,o,r))}),A}function eue(e){return Array.isArray(e)&&Array.isArray(e[0])}function z_(e){function t(n,A,a){let o=[];eue(n)?o=dH(n,A,e):o=eC(n,A,a,e);let r=new Ku(o);return e&&e.animations.push(r),r}return t}var qPe=z_();function vi(){let e=or(()=>({current:null,animations:[]})),t=or(()=>z_(e));return eH(()=>{e.animations.forEach(n=>n.stop())}),[e,t]}var de=w(I(),1),tue=({item:e,specOptions:t})=>{if(e.to&&!e.to.mainImporter){let[n,A]=qo(e.to.id);switch(n){case"registry":{for(let[a,o]of Object.entries(t["scope-registries"]))if(e.to.name?.startsWith(a))return(0,de.jsx)("div",{children:(0,de.jsx)(Xe,{children:(0,de.jsxs)(et,{children:[(0,de.jsxs)(Qt,{className:"px-1 py-1 text-xs text-muted-foreground font-mono m-0 align-baseline truncate",children:[(0,de.jsx)("span",{children:"registered-scope"}),(0,de.jsxs)("span",{children:[e.title,"@",e.version]})]}),(0,de.jsx)(Oe,{children:String(o)})]})})});return(0,de.jsx)("div",{children:(0,de.jsx)(Xe,{children:(0,de.jsxs)(et,{children:[(0,de.jsxs)(Qt,{className:"px-1 py-1 text-xs text-muted-foreground font-mono m-0 align-baseline truncate",children:[(0,de.jsxs)("span",{children:[A||"npm",":"]}),(0,de.jsxs)("span",{children:[e.title,"@",e.version]})]}),(0,de.jsx)(Oe,{children:A&&t.registries[A]?t.registries[A]:t.registry||Ut.defaultRegistry})]})})})}case"git":case"workspace":case"file":case"remote":return(0,de.jsx)("div",{children:A})}}return""},lH=({item:e})=>{let t=D(s=>s.specOptions),n=D(s=>s.updateLinePositionReference),A=(0,ec.useRef)(null),[a,o]=(0,ec.useState)({}),r=D(s=>s.stamp);(0,ec.useEffect)(()=>{let s=()=>{let c=A.current?.getBoundingClientRect();c?.top&&n(c.top)};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)}),(0,ec.useEffect)(()=>{async function s(){if(!e.to?.name)return;let c=EL(e.to.id,e.to.name,t),u=e.to.manifest??{};for await(let d of xj(c,u))o({...a,...d})}s()},[r]);let i=()=>{o({...a,publisherAvatar:void 0})};return(0,de.jsxs)("div",{className:"relative",children:[(0,de.jsxs)(Ls,{className:"relative my-4 border-muted-foreground",children:[(0,de.jsxs)("div",{className:"flex justify-stretch gap-4 w-full p-6",children:[(0,de.jsxs)(Kt.div,{className:"flex gap-4 grow items-start w-full",initial:{opacity:0},animate:{opacity:1},children:[(0,de.jsxs)(zI,{className:"size-16 rounded-lg border border-solid border-neutral-200",children:[a.favicon?(0,de.jsx)(Kt.img,{src:a.favicon.src,alt:a.favicon.alt,initial:{opacity:0},animate:{opacity:1}}):"",(0,de.jsx)(HI,{className:"rounded-lg border-none",children:e.to?.mainImporter?(0,de.jsx)(Ja,{size:24}):(0,de.jsx)(Gl,{size:24})})]}),(0,de.jsxs)("div",{className:"flex flex-col",children:[(0,de.jsxs)("div",{className:"mt-2",children:[(0,de.jsxs)("span",{className:`${e.title.length<9?"text-3xl":e.title.length<18?"text-xl":"text-md"} font-medium`,children:[e.title," "]}),(0,de.jsx)("span",{className:`${e.title.length<9?"text-xl":e.title.length<18?"text-lg":"text-sm"} font-medium text-muted-foreground mb-[1px]`,children:e.version})]}),t?(0,de.jsx)(tue,{item:e,specOptions:t}):""]})]}),(0,de.jsxs)("div",{className:"flex flex-col justify-end w-full gap-4 mt-4",children:[a.downloads?.weekly?(0,de.jsx)(Kt.div,{className:"flex flex-row-reverse",initial:{opacity:0},animate:{opacity:1},children:(0,de.jsxs)("span",{className:"text-md font-medium text-muted-foreground text-right",children:[(0,de.jsxs)("span",{className:"text-foreground",children:[a.downloads.weekly.toLocaleString()," ","Downloads"]})," ","Last Week"]})}):"",(0,de.jsxs)("div",{className:"flex flex-row-reverse items-center gap-2",children:[a.publisherAvatar?.src?(0,de.jsx)(Kt.img,{className:"size-8 rounded-full",src:a.publisherAvatar.src,alt:a.publisherAvatar.alt,onError:i,initial:{opacity:0},animate:{opacity:1}}):"",a.publisher?.name?(0,de.jsxs)(Kt.div,{className:"text-sm font-medium",initial:{opacity:0},animate:{opacity:1},children:[(0,de.jsxs)("span",{className:"text-xs text-muted-foreground mb-[1px]",children:["Published by:"," "]}),(0,de.jsx)("span",{children:a.publisher.name})]}):""]})]})]}),e.to?.manifest?.description||a.author?.name?(0,de.jsxs)("div",{className:"px-6 pb-6 -mt-6",children:[e.to?.manifest?.description?(0,de.jsx)(OQ,{className:"grow content-center py-2",children:e.to.manifest.description}):"",a.author?.name?(0,de.jsx)(Kt.div,{className:"flex items-center gap-2",initial:{opacity:0},animate:{opacity:1},children:(0,de.jsxs)("span",{className:"text-xs font-medium text-muted-foreground",children:["Authored by: ",a.author.name]})}):""]}):"",(0,de.jsx)("div",{className:"px-4 pb-4 w-full",children:(0,de.jsxs)(eM,{defaultValue:"package.json",children:[(0,de.jsx)(yk,{className:"grid w-full grid-cols-2",children:(0,de.jsxs)(Qk,{value:"package.json",className:"w-36",children:[(0,de.jsx)(Dl,{size:16,className:"mr-2"}),"package.json"]})}),(0,de.jsx)(kk,{value:"package.json",children:(0,de.jsx)(Ij,{code:e.to?.manifest?JSON.stringify(e.to.manifest,null,2):"",lang:"json"})})]})})]}),e.to?.edgesOut&&e.to.edgesOut.size>0?(0,de.jsx)("div",{ref:A,className:"absolute border-t border-solid border-neutral-300 dark:border-neutral-600 rounded-tr-sm w-4 top-[44px] -right-4"}):""]})};var pH=w(I(),1),Fi=({children:e,className:t,...n})=>(0,pH.jsx)("div",{className:v("pt-6 text-md flex flex-row items-center font-medium",t),...n,children:e});var nc=w(_(),1);var oC=w(_(),1);var bH=w(_(),1);var gH=w(_(),1);var mH=w(I(),1),nue="Label",fH=gH.forwardRef((e,t)=>(0,mH.jsx)(Z.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));fH.displayName=nue;var H_=fH;var hH=w(I(),1),aue=VA("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),zg=bH.forwardRef(({className:e,...t},n)=>(0,hH.jsx)(H_,{ref:n,className:v(aue(),e),...t}));zg.displayName=H_.displayName;var Ri=w(_(),1);var Y=w(_(),1),Y_=w(Lr(),1);function $_(e,[t,n]){return Math.min(n,Math.max(t,e))}var le=w(I(),1),oue=[" ","Enter","ArrowUp","ArrowDown"],rue=[" ","Enter"],$g="Select",[nC,AC,iue]=ri($g),[yd,$je]=Pt($g,[iue,aa]),aC=aa(),[sue,Si]=yd($g),[cue,uue]=yd($g),BH=e=>{let{__scopeSelect:t,children:n,open:A,defaultOpen:a,onOpenChange:o,value:r,defaultValue:i,onValueChange:s,dir:c,name:u,autoComplete:d,disabled:l,required:p,form:g}=e,b=aC(t),[B,f]=Y.useState(null),[m,h]=Y.useState(null),[C,E]=Y.useState(!1),Q=ii(c),[y=!1,k]=Tt({prop:A,defaultProp:a,onChange:o}),[R,F]=Tt({prop:r,defaultProp:i,onChange:s}),U=Y.useRef(null),M=B?g||!!B.closest("form"):!0,[ce,N]=Y.useState(new Set),te=Array.from(ce).map(W=>W.props.value).join(";");return(0,le.jsx)(jo,{...b,children:(0,le.jsxs)(sue,{required:p,scope:t,trigger:B,onTriggerChange:f,valueNode:m,onValueNodeChange:h,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:Pe(),value:R,onValueChange:F,open:y,onOpenChange:k,dir:Q,triggerPointerDownPosRef:U,disabled:l,children:[(0,le.jsx)(nC.Provider,{scope:t,children:(0,le.jsx)(cue,{scope:e.__scopeSelect,onNativeOptionAdd:Y.useCallback(W=>{N(ne=>new Set(ne).add(W))},[]),onNativeOptionRemove:Y.useCallback(W=>{N(ne=>{let K=new Set(ne);return K.delete(W),K})},[]),children:n})}),M?(0,le.jsxs)(UH,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:R,onChange:W=>F(W.target.value),disabled:l,form:g,children:[R===void 0?(0,le.jsx)("option",{value:""}):null,Array.from(ce)]},te):null]})})};BH.displayName=$g;var CH="SelectTrigger",wH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:A=!1,...a}=e,o=aC(n),r=Si(CH,n),i=r.disabled||A,s=pe(t,r.onTriggerChange),c=AC(n),u=Y.useRef("touch"),[d,l,p]=ZH(b=>{let B=c().filter(h=>!h.disabled),f=B.find(h=>h.value===r.value),m=qH(B,b,f);m!==void 0&&r.onValueChange(m.value)}),g=b=>{i||(r.onOpenChange(!0),p()),b&&(r.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return(0,le.jsx)(Go,{asChild:!0,...o,children:(0,le.jsx)(Z.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":TH(r.value)?"":void 0,...a,ref:s,onClick:z(a.onClick,b=>{b.currentTarget.focus(),u.current!=="mouse"&&g(b)}),onPointerDown:z(a.onPointerDown,b=>{u.current=b.pointerType;let B=b.target;B.hasPointerCapture(b.pointerId)&&B.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(g(b),b.preventDefault())}),onKeyDown:z(a.onKeyDown,b=>{let B=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&l(b.key),!(B&&b.key===" ")&&oue.includes(b.key)&&(g(),b.preventDefault())})})})});wH.displayName=CH;var EH="SelectValue",yH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,className:A,style:a,children:o,placeholder:r="",...i}=e,s=Si(EH,n),{onValueNodeHasChildrenChange:c}=s,u=o!==void 0,d=pe(t,s.onValueNodeChange);return Ne(()=>{c(u)},[c,u]),(0,le.jsx)(Z.span,{...i,ref:d,style:{pointerEvents:"none"},children:TH(s.value)?(0,le.jsx)(le.Fragment,{children:r}):o})});yH.displayName=EH;var due="SelectIcon",QH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,children:A,...a}=e;return(0,le.jsx)(Z.span,{"aria-hidden":!0,...a,ref:t,children:A||"\u25BC"})});QH.displayName=due;var lue="SelectPortal",kH=e=>(0,le.jsx)(LA,{asChild:!0,...e});kH.displayName=lue;var tc="SelectContent",IH=Y.forwardRef((e,t)=>{let n=Si(tc,e.__scopeSelect),[A,a]=Y.useState();if(Ne(()=>{a(new DocumentFragment)},[]),!n.open){let o=A;return o?Y_.createPortal((0,le.jsx)(_H,{scope:e.__scopeSelect,children:(0,le.jsx)(nC.Slot,{scope:e.__scopeSelect,children:(0,le.jsx)("div",{children:e.children})})}),o):null}return(0,le.jsx)(xH,{...e,ref:t})});IH.displayName=tc;var Ta=10,[_H,Li]=yd(tc),pue="SelectContentImpl",xH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,position:A="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:r,side:i,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:l,collisionPadding:p,sticky:g,hideWhenDetached:b,avoidCollisions:B,...f}=e,m=Si(tc,n),[h,C]=Y.useState(null),[E,Q]=Y.useState(null),y=pe(t,$=>C($)),[k,R]=Y.useState(null),[F,U]=Y.useState(null),M=AC(n),[ce,N]=Y.useState(!1),te=Y.useRef(!1);Y.useEffect(()=>{if(h)return Zr(h)},[h]),Ur();let W=Y.useCallback($=>{let[_e,...Dt]=M().map(Xt=>Xt.ref.current),[Te]=Dt.slice(-1),Et=document.activeElement;for(let Xt of $)if(Xt===Et||(Xt?.scrollIntoView({block:"nearest"}),Xt===_e&&E&&(E.scrollTop=0),Xt===Te&&E&&(E.scrollTop=E.scrollHeight),Xt?.focus(),document.activeElement!==Et))return},[M,E]),ne=Y.useCallback(()=>W([k,h]),[W,k,h]);Y.useEffect(()=>{ce&&ne()},[ce,ne]);let{onOpenChange:K,triggerPointerDownPosRef:H}=m;Y.useEffect(()=>{if(h){let $={x:0,y:0},_e=Te=>{$={x:Math.abs(Math.round(Te.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(Te.pageY)-(H.current?.y??0))}},Dt=Te=>{$.x<=10&&$.y<=10?Te.preventDefault():h.contains(Te.target)||K(!1),document.removeEventListener("pointermove",_e),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",_e),document.addEventListener("pointerup",Dt,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",_e),document.removeEventListener("pointerup",Dt,{capture:!0})}}},[h,K,H]),Y.useEffect(()=>{let $=()=>K(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[K]);let[ve,Re]=ZH($=>{let _e=M().filter(Et=>!Et.disabled),Dt=_e.find(Et=>Et.ref.current===document.activeElement),Te=qH(_e,$,Dt);Te&&setTimeout(()=>Te.ref.current.focus())}),L=Y.useCallback(($,_e,Dt)=>{let Te=!te.current&&!Dt;(m.value!==void 0&&m.value===_e||Te)&&(R($),Te&&(te.current=!0))},[m.value]),ae=Y.useCallback(()=>h?.focus(),[h]),ue=Y.useCallback(($,_e,Dt)=>{let Te=!te.current&&!Dt;(m.value!==void 0&&m.value===_e||Te)&&U($)},[m.value]),Ae=A==="popper"?T_:DH,Qe=Ae===T_?{side:i,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:l,collisionPadding:p,sticky:g,hideWhenDetached:b,avoidCollisions:B}:{};return(0,le.jsx)(_H,{scope:n,content:h,viewport:E,onViewportChange:Q,itemRefCallback:L,selectedItem:k,onItemLeave:ae,itemTextRefCallback:ue,focusSelectedItem:ne,selectedItemText:F,position:A,isPositioned:ce,searchRef:ve,children:(0,le.jsx)(Lo,{as:Nt,allowPinchZoom:!0,children:(0,le.jsx)(So,{asChild:!0,trapped:m.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:z(a,$=>{m.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:(0,le.jsx)(ea,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:(0,le.jsx)(Ae,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:$=>$.preventDefault(),...f,...Qe,onPlaced:()=>N(!0),ref:y,style:{display:"flex",flexDirection:"column",outline:"none",...f.style},onKeyDown:z(f.onKeyDown,$=>{let _e=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!_e&&$.key.length===1&&Re($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Te=M().filter(Et=>!Et.disabled).map(Et=>Et.ref.current);if(["ArrowUp","End"].includes($.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){let Et=$.target,Xt=Te.indexOf(Et);Te=Te.slice(Xt+1)}setTimeout(()=>W(Te)),$.preventDefault()}})})})})})})});xH.displayName=pue;var gue="SelectItemAlignedPosition",DH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:A,...a}=e,o=Si(tc,n),r=Li(tc,n),[i,s]=Y.useState(null),[c,u]=Y.useState(null),d=pe(t,y=>u(y)),l=AC(n),p=Y.useRef(!1),g=Y.useRef(!0),{viewport:b,selectedItem:B,selectedItemText:f,focusSelectedItem:m}=r,h=Y.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&c&&b&&B&&f){let y=o.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),R=o.valueNode.getBoundingClientRect(),F=f.getBoundingClientRect();if(o.dir!=="rtl"){let Et=F.left-k.left,Xt=R.left-Et,UA=y.left-Xt,Gi=y.width+UA,BC=Math.max(Gi,k.width),CC=window.innerWidth-Ta,wC=$_(Xt,[Ta,Math.max(Ta,CC-BC)]);i.style.minWidth=Gi+"px",i.style.left=wC+"px"}else{let Et=k.right-F.right,Xt=window.innerWidth-R.right-Et,UA=window.innerWidth-y.right-Xt,Gi=y.width+UA,BC=Math.max(Gi,k.width),CC=window.innerWidth-Ta,wC=$_(Xt,[Ta,Math.max(Ta,CC-BC)]);i.style.minWidth=Gi+"px",i.style.right=wC+"px"}let U=l(),M=window.innerHeight-Ta*2,ce=b.scrollHeight,N=window.getComputedStyle(c),te=parseInt(N.borderTopWidth,10),W=parseInt(N.paddingTop,10),ne=parseInt(N.borderBottomWidth,10),K=parseInt(N.paddingBottom,10),H=te+W+ce+K+ne,ve=Math.min(B.offsetHeight*5,H),Re=window.getComputedStyle(b),L=parseInt(Re.paddingTop,10),ae=parseInt(Re.paddingBottom,10),ue=y.top+y.height/2-Ta,Ae=M-ue,Qe=B.offsetHeight/2,$=B.offsetTop+Qe,_e=te+W+$,Dt=H-_e;if(_e<=ue){let Et=U.length>0&&B===U[U.length-1].ref.current;i.style.bottom="0px";let Xt=c.clientHeight-b.offsetTop-b.offsetHeight,UA=Math.max(Ae,Qe+(Et?ae:0)+Xt+ne),Gi=_e+UA;i.style.height=Gi+"px"}else{let Et=U.length>0&&B===U[0].ref.current;i.style.top="0px";let UA=Math.max(ue,te+b.offsetTop+(Et?L:0)+Qe)+Dt;i.style.height=UA+"px",b.scrollTop=_e-ue+b.offsetTop}i.style.margin=`${Ta}px 0`,i.style.minHeight=ve+"px",i.style.maxHeight=M+"px",A?.(),requestAnimationFrame(()=>p.current=!0)}},[l,o.trigger,o.valueNode,i,c,b,B,f,o.dir,A]);Ne(()=>h(),[h]);let[C,E]=Y.useState();Ne(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);let Q=Y.useCallback(y=>{y&&g.current===!0&&(h(),m?.(),g.current=!1)},[h,m]);return(0,le.jsx)(fue,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:p,onScrollButtonChange:Q,children:(0,le.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:(0,le.jsx)(Z.div,{...a,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});DH.displayName=gue;var mue="SelectPopperPosition",T_=Y.forwardRef((e,t)=>{let{__scopeSelect:n,align:A="start",collisionPadding:a=Ta,...o}=e,r=aC(n);return(0,le.jsx)(Kr,{...r,...o,ref:t,align:A,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});T_.displayName=mue;var[fue,K_]=yd(tc,{}),U_="SelectViewport",vH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:A,...a}=e,o=Li(U_,n),r=K_(U_,n),i=pe(t,o.onViewportChange),s=Y.useRef(0);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:A}),(0,le.jsx)(nC.Slot,{scope:n,children:(0,le.jsx)(Z.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:z(a.onScroll,c=>{let u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:l}=r;if(l?.current&&d){let p=Math.abs(s.current-u.scrollTop);if(p>0){let g=window.innerHeight-Ta*2,b=parseFloat(d.style.minHeight),B=parseFloat(d.style.height),f=Math.max(b,B);if(f<g){let m=f+p,h=Math.min(g,m),C=m-h;d.style.height=h+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}s.current=u.scrollTop})})})]})});vH.displayName=U_;var FH="SelectGroup",[bue,hue]=yd(FH),Bue=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e,a=Pe();return(0,le.jsx)(bue,{scope:n,id:a,children:(0,le.jsx)(Z.div,{role:"group","aria-labelledby":a,...A,ref:t})})});Bue.displayName=FH;var SH="SelectLabel",LH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e,a=hue(SH,n);return(0,le.jsx)(Z.div,{id:a.id,...A,ref:t})});LH.displayName=SH;var tC="SelectItem",[Cue,RH]=yd(tC),MH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,value:A,disabled:a=!1,textValue:o,...r}=e,i=Si(tC,n),s=Li(tC,n),c=i.value===A,[u,d]=Y.useState(o??""),[l,p]=Y.useState(!1),g=pe(t,m=>s.itemRefCallback?.(m,A,a)),b=Pe(),B=Y.useRef("touch"),f=()=>{a||(i.onValueChange(A),i.onOpenChange(!1))};if(A==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,le.jsx)(Cue,{scope:n,value:A,disabled:a,textId:b,isSelected:c,onItemTextChange:Y.useCallback(m=>{d(h=>h||(m?.textContent??"").trim())},[]),children:(0,le.jsx)(nC.ItemSlot,{scope:n,value:A,disabled:a,textValue:u,children:(0,le.jsx)(Z.div,{role:"option","aria-labelledby":b,"data-highlighted":l?"":void 0,"aria-selected":c&&l,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...r,ref:g,onFocus:z(r.onFocus,()=>p(!0)),onBlur:z(r.onBlur,()=>p(!1)),onClick:z(r.onClick,()=>{B.current!=="mouse"&&f()}),onPointerUp:z(r.onPointerUp,()=>{B.current==="mouse"&&f()}),onPointerDown:z(r.onPointerDown,m=>{B.current=m.pointerType}),onPointerMove:z(r.onPointerMove,m=>{B.current=m.pointerType,a?s.onItemLeave?.():B.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(r.onPointerLeave,m=>{m.currentTarget===document.activeElement&&s.onItemLeave?.()}),onKeyDown:z(r.onKeyDown,m=>{s.searchRef?.current!==""&&m.key===" "||(rue.includes(m.key)&&f(),m.key===" "&&m.preventDefault())})})})})});MH.displayName=tC;var Hg="SelectItemText",NH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,className:A,style:a,...o}=e,r=Si(Hg,n),i=Li(Hg,n),s=RH(Hg,n),c=uue(Hg,n),[u,d]=Y.useState(null),l=pe(t,f=>d(f),s.onItemTextChange,f=>i.itemTextRefCallback?.(f,s.value,s.disabled)),p=u?.textContent,g=Y.useMemo(()=>(0,le.jsx)("option",{value:s.value,disabled:s.disabled,children:p},s.value),[s.disabled,s.value,p]),{onNativeOptionAdd:b,onNativeOptionRemove:B}=c;return Ne(()=>(b(g),()=>B(g)),[b,B,g]),(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(Z.span,{id:s.textId,...o,ref:l}),s.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Y_.createPortal(o.children,r.valueNode):null]})});NH.displayName=Hg;var PH="SelectItemIndicator",jH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e;return RH(PH,n).isSelected?(0,le.jsx)(Z.span,{"aria-hidden":!0,...A,ref:t}):null});jH.displayName=PH;var Z_="SelectScrollUpButton",GH=Y.forwardRef((e,t)=>{let n=Li(Z_,e.__scopeSelect),A=K_(Z_,e.__scopeSelect),[a,o]=Y.useState(!1),r=pe(t,A.onScrollButtonChange);return Ne(()=>{if(n.viewport&&n.isPositioned){let s=function(){let u=c.scrollTop>0;o(u)};var i=s;let c=n.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),a?(0,le.jsx)(HH,{...e,ref:r,onAutoScroll:()=>{let{viewport:i,selectedItem:s}=n;i&&s&&(i.scrollTop=i.scrollTop-s.offsetHeight)}}):null});GH.displayName=Z_;var q_="SelectScrollDownButton",zH=Y.forwardRef((e,t)=>{let n=Li(q_,e.__scopeSelect),A=K_(q_,e.__scopeSelect),[a,o]=Y.useState(!1),r=pe(t,A.onScrollButtonChange);return Ne(()=>{if(n.viewport&&n.isPositioned){let s=function(){let u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;o(d)};var i=s;let c=n.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),a?(0,le.jsx)(HH,{...e,ref:r,onAutoScroll:()=>{let{viewport:i,selectedItem:s}=n;i&&s&&(i.scrollTop=i.scrollTop+s.offsetHeight)}}):null});zH.displayName=q_;var HH=Y.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:A,...a}=e,o=Li("SelectScrollButton",n),r=Y.useRef(null),i=AC(n),s=Y.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return Y.useEffect(()=>()=>s(),[s]),Ne(()=>{i().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),(0,le.jsx)(Z.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:z(a.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(A,50))}),onPointerMove:z(a.onPointerMove,()=>{o.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(A,50))}),onPointerLeave:z(a.onPointerLeave,()=>{s()})})}),wue="SelectSeparator",$H=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e;return(0,le.jsx)(Z.div,{"aria-hidden":!0,...A,ref:t})});$H.displayName=wue;var O_="SelectArrow",Eue=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...A}=e,a=aC(n),o=Si(O_,n),r=Li(O_,n);return o.open&&r.position==="popper"?(0,le.jsx)(Wr,{...a,...A,ref:t}):null});Eue.displayName=O_;function TH(e){return e===""||e===void 0}var UH=Y.forwardRef((e,t)=>{let{value:n,...A}=e,a=Y.useRef(null),o=pe(t,a),r=ab(n);return Y.useEffect(()=>{let i=a.current,s=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(s,"value").set;if(r!==n&&u){let d=new Event("change",{bubbles:!0});u.call(i,n),i.dispatchEvent(d)}},[r,n]),(0,le.jsx)(ms,{asChild:!0,children:(0,le.jsx)("select",{...A,ref:o,defaultValue:n})})});UH.displayName="BubbleSelect";function ZH(e){let t=Je(e),n=Y.useRef(""),A=Y.useRef(0),a=Y.useCallback(r=>{let i=n.current+r;t(i),function s(c){n.current=c,window.clearTimeout(A.current),c!==""&&(A.current=window.setTimeout(()=>s(""),1e3))}(i)},[t]),o=Y.useCallback(()=>{n.current="",window.clearTimeout(A.current)},[]);return Y.useEffect(()=>()=>window.clearTimeout(A.current),[]),[n,a,o]}function qH(e,t,n){let a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1,r=yue(e,Math.max(o,0));a.length===1&&(r=r.filter(c=>c!==n));let s=r.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return s!==n?s:void 0}function yue(e,t){return e.map((n,A)=>e[(t+A)%e.length])}var OH=BH,W_=wH,YH=yH,KH=QH,WH=kH,J_=IH,JH=vH;var V_=LH,X_=MH,VH=NH,XH=jH,ex=GH,tx=zH,nx=$H;var Wt=w(I(),1),e$=OH;var t$=YH,Ax=Ri.forwardRef(({className:e,children:t,...n},A)=>(0,Wt.jsxs)(W_,{ref:A,className:v("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,(0,Wt.jsx)(KH,{asChild:!0,children:(0,Wt.jsx)(va,{className:"h-4 w-4 opacity-50"})})]}));Ax.displayName=W_.displayName;var n$=Ri.forwardRef(({className:e,...t},n)=>(0,Wt.jsx)(ex,{ref:n,className:v("flex cursor-default items-center justify-center py-1",e),...t,children:(0,Wt.jsx)(_l,{className:"h-4 w-4"})}));n$.displayName=ex.displayName;var A$=Ri.forwardRef(({className:e,...t},n)=>(0,Wt.jsx)(tx,{ref:n,className:v("flex cursor-default items-center justify-center py-1",e),...t,children:(0,Wt.jsx)(va,{className:"h-4 w-4"})}));A$.displayName=tx.displayName;var ax=Ri.forwardRef(({className:e,children:t,position:n="popper",...A},a)=>(0,Wt.jsx)(WH,{children:(0,Wt.jsxs)(J_,{ref:a,className:v("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...A,children:[(0,Wt.jsx)(n$,{}),(0,Wt.jsx)(JH,{className:v("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),(0,Wt.jsx)(A$,{})]})}));ax.displayName=J_.displayName;var kue=Ri.forwardRef(({className:e,...t},n)=>(0,Wt.jsx)(V_,{ref:n,className:v("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));kue.displayName=V_.displayName;var Qd=Ri.forwardRef(({className:e,children:t,...n},A)=>(0,Wt.jsxs)(X_,{ref:A,className:v("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[(0,Wt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Wt.jsx)(XH,{children:(0,Wt.jsx)(Da,{className:"h-4 w-4"})})}),(0,Wt.jsx)(VH,{children:t})]}));Qd.displayName=X_.displayName;var Iue=Ri.forwardRef(({className:e,...t},n)=>(0,Wt.jsx)(nx,{ref:n,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));Iue.displayName=nx.displayName;var a$=w(_(),1);var o$=w(I(),1),_ue="w-6 h-6 rounded-full animate-spin",ox=a$.forwardRef((e,t)=>{let{className:n,...A}=e;return(0,o$.jsx)(Ml,{ref:t,className:v(_ue,n),...A})});ox.displayName="LoadingSpinner";var fe=w(I(),1),r$=({error:e,inProgress:t,onInstall:n,onClose:A})=>{let[a,o]=(0,oC.useState)(""),[r,i]=(0,oC.useState)("latest"),[s,c]=(0,oC.useState)("prod"),u=p=>{p.stopPropagation(),p.preventDefault(),n({name:a,version:r,type:s})},d=p=>{p.key==="Enter"&&u(p)},l=p=>{p.preventDefault(),p.stopPropagation(),A()};return t?(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(Ga,{className:"rounded-t-lg relative flex flex-col w-full p-0",children:(0,fe.jsx)("div",{className:"flex items-center justify-between px-6 py-4",children:(0,fe.jsxs)(jA,{className:"text-lg font-medium flex items-center",children:[(0,fe.jsx)(Tc,{size:18,className:"mr-2"}),"Add new dependency"]})})}),(0,fe.jsx)("div",{className:"flex justify-center items-center h-48",children:(0,fe.jsx)(ox,{})})]}):e?(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(Ga,{className:"rounded-t-lg relative flex flex-col w-full p-0",children:(0,fe.jsx)("div",{className:"flex items-center justify-between px-6 py-4",children:(0,fe.jsxs)(jA,{className:"text-lg font-medium flex items-center",children:[(0,fe.jsx)(Il,{size:18,className:"mr-2"}),"Error"]})})}),(0,fe.jsx)("div",{className:"flex items-center flex-row justify-between gap-2 flex-wrap p-6 border-muted-foreground/20 border-t-[1px]",children:(0,fe.jsx)("p",{className:"text-sm",children:e})}),(0,fe.jsx)("div",{className:"flex justify-end w-full",children:(0,fe.jsx)(se,{className:"m-2",role:"cancel",variant:"secondary",tabIndex:4,onClick:l,children:"Close"})})]}):(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(Ga,{className:"rounded-t-lg relative flex flex-col w-full p-0",children:(0,fe.jsx)("div",{className:"flex items-center justify-between px-6 py-4",children:(0,fe.jsxs)(jA,{className:"text-lg font-medium flex items-center",children:[(0,fe.jsx)(Tc,{size:18,className:"mr-2"}),"Add new dependency"]})})}),(0,fe.jsxs)("form",{className:"flex items-center flex-row justify-between gap-2 flex-wrap p-6 border-muted-foreground/20 border-t-[1px]",onSubmit:u,onKeyDown:d,children:[(0,fe.jsx)(zg,{htmlFor:"package-name",className:"ml-1",children:"Package Name"}),(0,fe.jsx)(We,{id:"package-name",tabIndex:1,type:"text",role:"input",placeholder:"Package name",value:a,onChange:p=>{let g=p.currentTarget.value;o(g)}}),(0,fe.jsx)(zg,{htmlFor:"package-version",className:"ml-1 mt-2",children:"Version | Spec"}),(0,fe.jsx)(We,{id:"package-version",tabIndex:2,type:"text",role:"input",value:r,onChange:p=>{let g=p.currentTarget.value;i(g)}}),(0,fe.jsx)(zg,{htmlFor:"package-type",className:"ml-1 mt-2",children:"Type"}),(0,fe.jsxs)(e$,{defaultValue:s,onValueChange:c,children:[(0,fe.jsx)(Ax,{children:(0,fe.jsx)(t$,{tabIndex:3})}),(0,fe.jsxs)(ax,{children:[(0,fe.jsx)(Qd,{value:"prod",children:"dependencies"}),(0,fe.jsx)(Qd,{value:"dev",children:"devDependencies"}),(0,fe.jsx)(Qd,{value:"optional",children:"optionalDependencies"}),(0,fe.jsx)(Qd,{value:"peer",children:"peerDependencies"})]})]}),(0,fe.jsxs)("div",{className:"flex justify-end w-full",children:[(0,fe.jsx)(se,{className:"mt-2 mr-2",role:"cancel",variant:"secondary",tabIndex:4,onClick:l,children:"Cancel"}),(0,fe.jsxs)(se,{className:"mt-2",role:"submit",tabIndex:5,children:[(0,fe.jsx)(Pl,{size:16}),"Install package"]})]})]})]})};var ht=w(I(),1),i$=async({operation:e,setError:t,setInProgress:n,updateStamp:A,toast:a,importerId:o,name:r,version:i,type:s,onSuccessful:c})=>{let u=e==="install"?{add:{[o]:{[r]:{version:i,type:s}}}}:{remove:{[o]:[r]}},d;try{n(!0),d=await fetch(`/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)})}catch(g){console.error(g),t(String(g));return}finally{n(!1)}let l=!1,p="";try{p=await d.json(),l=p==="ok"}catch(g){console.warn("unable to parse json response:",g)}l?(a({description:`Successfully ${e}ed: ${r}`}),c?.(r),A()):((d.status===500||d.status===400)&&p&&t(p),p||t("Failed to install dependency."))},s$=({dependencies:e,importerId:t,onDependencyClick:n,uninstalledDependencies:A})=>{let[a,o]=vi(),{toast:r}=zn(),i=D(y=>y.updateStamp),s=D(y=>y.updateActiveRoute),c=D(y=>y.updateErrorCause),[u,d]=(0,nc.useState)(""),[l,p]=(0,nc.useState)(!1),[g,b]=(0,nc.useState)(!1),[B,f]=(0,nc.useState)([]);(0,nc.useEffect)(()=>{a.current&&(g?o(a.current,{rotate:-45}):o(a.current,{rotate:0}))},[g,a]);let m=()=>{g&&u&&(d(""),p(!1)),b(!g)},h=y=>{m(),f([y,...B])},C=y=>{f([...B].filter(k=>k!==y))},E=({name:y,version:k,type:R})=>{t&&i$({operation:"install",setError:d,setInProgress:p,updateStamp:i,toast:r,importerId:t,name:y,version:k,type:R,onSuccessful:h}).catch(F=>{console.error(F),s("/error"),c("Unexpected error trying to install dependency.")})},Q=y=>{t&&i$({operation:"uninstall",setError:d,setInProgress:p,updateStamp:i,toast:r,importerId:t,name:y.name,onSuccessful:C}).catch(k=>{console.error(k),s("/error"),c("Unexpected error trying to uninstall dependency.")})};return(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsxs)(Fi,{children:[(0,ht.jsx)($c,{size:22,className:"mr-3 rotate-180"}),"Dependencies",t?(0,ht.jsx)("div",{className:"grow flex justify-end",children:(0,ht.jsx)(Xe,{children:(0,ht.jsxs)(eA,{onOpenChange:b,open:g,children:[(0,ht.jsx)(tA,{children:(0,ht.jsxs)(et,{children:[(0,ht.jsx)(Qt,{asChild:!0,children:(0,ht.jsx)("div",{onClick:m,className:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground size-6",children:(0,ht.jsx)(_o,{ref:a})})}),(0,ht.jsx)(Oe,{children:(0,ht.jsx)("p",{children:"Add a new dependency"})})]})}),(0,ht.jsx)(Hn,{align:"end",className:"p-0 w-96 top-0 right-0",children:(0,ht.jsx)(r$,{error:u,inProgress:l,onInstall:E,onClose:m})})]})})}):""]}),[...e.filter(y=>B.includes(y.name)).sort((y,k)=>y.name.localeCompare(k.name,"en")),...e.filter(y=>!B.includes(y.name)).sort((y,k)=>y.name.localeCompare(k.name,"en"))].map(y=>(0,ht.jsx)(xu,{item:y,dependencies:!0,onSelect:n(y),onUninstall:Q},y.id)),A.length?(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsxs)(Fi,{children:[(0,ht.jsx)($c,{size:22,className:"mr-3 rotate-180"}),"Uninstalled Dependencies"]}),[...A.sort((y,k)=>y.name.localeCompare(k.name,"en"))].map(y=>(0,ht.jsx)(xu,{item:y,dependencies:!0},y.id))]}):""]})};var Rt=w(I(),1),c$=()=>{let e=D(A=>A.updateActiveRoute),t=D(A=>A.updateQuery);return(0,Rt.jsxs)("section",{className:"flex flex-col min-h-[70svh] h-full w-full px-8 pt-4 items-center justify-center",children:[(0,Rt.jsxs)("div",{className:"relative flex flex-col items-center justify-center h-fit w-fit -mt-10 mb-8",children:[(0,Rt.jsx)(rx,{className:"w-[275px] h-[64px] opacity-30 -mb-6"}),(0,Rt.jsx)(rx,{className:"z-[1] shadow-lg"}),(0,Rt.jsx)(rx,{className:"w-[275px] h-[64px] opacity-30 -mt-6"})]}),(0,Rt.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 text-center",children:[(0,Rt.jsx)("h4",{className:"text-xl font-semibold",children:"No results found"}),(0,Rt.jsx)("p",{className:"text-sm text-neutral-500",children:"Your Query did not match any results in this project."}),(0,Rt.jsx)("div",{className:"mt-3 flex gap-3 items-center justify-center",children:(0,Rt.jsxs)(se,{onClick:()=>{e("/explore"),t(":root")},children:[(0,Rt.jsx)("span",{children:"Project Root"}),(0,Rt.jsx)(xa,{})]})})]})]})},rx=({className:e=""})=>(0,Rt.jsxs)("div",{className:`w-[300px] h-[70px] rounded-sm border-[1px] border-neutral-200 dark:border-neutral-800 bg-muted dark:bg-black flex flex-col ${e}`,children:[(0,Rt.jsxs)("div",{className:"flex justify-between items-center border-b-[1px] border-neutral-200 dark:border-neutral-800 p-2",children:[(0,Rt.jsx)("div",{className:"h-[18px] w-[80px] bg-neutral-200 dark:bg-neutral-950 border-[1px] rounded-sm border-neutral-300 dark:border-neutral-800"}),(0,Rt.jsx)("div",{className:"h-[16px] w-[60px] bg-neutral-200 dark:bg-neutral-950 border-[1px] rounded-sm border-neutral-300 dark:border-neutral-800"})]}),(0,Rt.jsxs)("div",{className:"flex justify-between items-center h-full w-full p-2",children:[(0,Rt.jsx)("div",{className:"h-[12px] w-[125px] bg-neutral-200 dark:bg-neutral-950 border-[1px] border-neutral-300 dark:border-neutral-800 rounded-sm"}),(0,Rt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Rt.jsx)("div",{className:"rounded-full bg-sky-400/25 dark:bg-sky-800/25 border-[1px] border-sky-400 dark:border-sky-800 h-[12px] w-[30px]"}),(0,Rt.jsx)("div",{className:"rounded-full bg-red-400/25 dark:bg-red-800/25 border-[1px] border-red-400 dark:border-red-800 h-[12px] w-[38px]"})]})]})]});var Bt=w(I(),1),xue=(e,t)=>{let n=[],A=new Map,a=new Map,o=[...e];for(let u of t)if(u.importer){let d=u.name||"";o.unshift({name:d,type:"prod",spec:Ut.parse(d||"",u.mainImporter?"file:.":"workspace:*"),from:void 0,to:u})}let r=new Set(o.map(u=>u.to?.id)),i=r.size>1,s=r.size===1;for(let u of o){if(s&&!u.from&&o.length>1)continue;let d=u.to?.id,l=u.spec?.bareSpec?`@${u.spec.bareSpec}`:"",p=u.from?`${u.name}${l}`:u.name;if(!d){n.push({...u,id:`${u.from?.id}${p}`,labels:u.type?[u.type]:[],title:p,version:"Missing package",sameItems:s,stacked:!1,size:1});continue}let g=a.get(d);if(g&&i)A.get(d)?.add(u),g.size+=1,g.stacked=!0,p!==g.title&&(g.spec?.bareSpec!==u.spec?.bareSpec&&(g.title=g.name),g.name!==u.name&&(g.title=`${g.name} and ${g.size} more`));else{let b=u.to?.dev?"dev":u.to?.optional?"optional":void 0,B=u.to?.importer&&!u.to.mainImporter?"workspace":void 0,f=u.to?.edgesIn?Array.from(u.to.edgesIn).map(C=>C.type):[],m=Array.from(new Set([...f,b,B].filter(Boolean))),h={...u,id:`${u.from?.id}${u.to?.id}`||p,labels:m,title:p,version:u.to?Tp(u.to):"",sameItems:s,stacked:!1,size:1};n.push(h),A.set(d,new Set([u])),a.set(d,h)}}let c=n[0];return c&&n.length===1&&(c.title=c.to?.name||"Missing package",c.version=c.to?.version?`v${c.to.version}`:""),n.sort((u,d)=>u.name.localeCompare(d.name,"en"))},Due=(e,t)=>{if(!t)return;let n=e?.spec?.bareSpec?`@${e.spec.bareSpec}`:"",A=e?.name?`${e.name}${n}`:"";return{...e,id:t.id,name:t.name||"",title:A,version:t.version||"",stacked:!1,size:1,labels:void 0}},vue=(e,t)=>{let n=[];if(!e)return n;for(let A of Array.from(e.edgesIn)){if(A.from===t)continue;let a=`${A.name}@${A.spec.bareSpec}`;n.push({...A,id:A.from.id,title:a,version:A.from.version||"",name:A.from.name||"",stacked:A.from.edgesIn.size>1,size:A.from.edgesIn.size,labels:void 0})}return n},Fue=(e,t)=>{let n=[];if(!t)return n;for(let A of Array.from(t.edgesOut.values()).sort((a,o)=>a.name.localeCompare(o.name,"en"))){if(!A.to)continue;let a=`${A.name}@${A.spec.bareSpec}`;n.push({...A,depIndex:e.currIndex++,id:A.to.id,title:a,name:A.to.name||"",version:A.to.version||"",stacked:!1,size:1,labels:[A.type]})}return n},Sue=(e,t)=>{let n=[],A=t?.manifest;if(!A)return n;let a=[];for(let o of ku){let r=A[o];if(r)for(let[i,s]of Object.entries(r))a.push({name:i,version:s,type:o})}for(let{name:o,version:r,type:i}of a.sort((s,c)=>s.name.localeCompare(c.name,"en"))){if(t.edgesOut.get(o)?.to)continue;let c=`${o}@${r}`;n.push({depIndex:e.currIndex++,id:`uninstalled-dep:${c}`,title:c,name:o,version:r,stacked:!1,size:1,labels:[UQ(i,o,A)]})}return n.sort((o,r)=>o.name.localeCompare(r.name,"en"))},Lue=e=>{if(!e.to)return"";let t=e.to.name?`[name="${e.to.name}"]`:"",n=e.to.version?`[version="${e.to.version}"]`:"";return`${t}${n}`},u$=()=>{let e=D(B=>B.updateQuery),t=D(B=>B.query),n=D(B=>B.edges),A=D(B=>B.nodes),a=xue(n,A),o=a.length===1,[r]=a,i=o&&r?.to?.importer?r.to.id:void 0,s=o?r?.from:void 0,c=Due(r,s),u=o&&vue(r?.to,s),d={currIndex:0},l=o&&Fue(d,r?.to),p=o&&Sue(d,r?.to),g=(B,f)=>()=>{let m=r?.to?.name?`[name="${r.to.name}"]`:"",h=r?.to?.version?`[version="${r.to.version}"]`:"",C=f&&t.endsWith(`> ${m}${h}`)&&t.slice(0,t.lastIndexOf(">"));if(C)e(C);else{let E=B.from?.name?`[name="${B.from.name}"]`:"",Q=B.from?.version?`[version="${B.from.version}"]`:"";e(`${E}${Q}`)}},b=B=>()=>{let f=Lue(B);if(f)if(t.includes(f)){let m=t.split(f).slice(0,-1).concat([""]).join(f);e(m)}else{let m=`${t} > ${f}`;e(m)}};return a.length?(0,Bt.jsxs)("div",{className:"grow grid grid-cols-7 gap-4 px-8 bg-secondary dark:bg-black",children:[(0,Bt.jsxs)("div",{className:"col-span-2",children:[c?(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsxs)(Fi,{children:[(0,Bt.jsx)(vl,{size:22,className:"mr-3"}),"Parent"]}),(0,Bt.jsx)(xu,{parent:!0,item:c,highlight:!0,onSelect:g(c,!0)})]}):"",u&&u.length>0?(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsxs)(Fi,{children:[(0,Bt.jsx)(Fl,{size:22,className:"mr-3"}),"Dependents"]}),u.map(B=>(0,Bt.jsx)(xu,{item:B,onSelect:g(B)},B.id))]}):""]}),(0,Bt.jsxs)("div",{className:"col-span-3",children:[a.length>1?(0,Bt.jsx)(Fi,{className:"mb-4",children:"Results"}):(0,Bt.jsxs)(Fi,{children:[(0,Bt.jsx)(Sl,{size:22,className:"mr-3"}),"Selected Item"]}),(0,Bt.jsx)("div",{className:"flex flex-col gap-6",children:a.map(B=>o?(0,Bt.jsx)(lH,{item:B},B.id):(0,Bt.jsx)(FL,{item:B},B.id))})]}),(0,Bt.jsx)("div",{className:"col-span-2",children:l&&l.length>0||r?.to?.importer?(0,Bt.jsx)(s$,{dependencies:l||[],importerId:i,onDependencyClick:b,uninstalledDependencies:p||[]}):""})]}):(0,Bt.jsx)(c$,{})};var Rue=e=>{let{registries:t,registry:n,"git-hosts":A,"git-host-archives":a,"scope-registries":o}=e.options;return{registries:{...vb,...t},registry:n||GQ,"git-hosts":{...Fb,...A},"git-host-archives":{...Sb,...a},"scope-registries":{...wL,...o}}},d$=e=>{let[t]=e.importers,n={importers:new Set,edges:new Set,nodes:new Map,projectRoot:t?.projectRoot||"",addEdge(o,r,i,s){let c=i.edgesOut.get(r.name);if(c){let d=c;if(d.type===o&&d.spec.bareSpec===r.bareSpec)return s&&s!==d.to&&(d.to=s,d.to.edgesIn.add(d)),d;this.edges.delete(d)}let u={from:i,name:r.name,spec:r,to:s,type:o};return i.edgesOut.set(r.name,u),s?.edgesIn.add(u),this.edges.add(u),u},addNode(o,r){let i=this,s={id:o,name:r.name,version:r.version,manifest:r,edgesIn:new Set,edgesOut:new Map,graph:i,importer:!1,mainImporter:!1,projectRoot:i.projectRoot,dev:!1,optional:!1,setResolved(){}};return this.nodes.set(s.id,s),s}};for(let o of e.importers){let r=o.id,i=n,s=i.addNode(r,o.manifest);s.importer=!0,s.mainImporter=o.id===t?.id,s.location=o.location,s.integrity=o.integrity,s.resolved=o.resolved,s.dev=o.dev,s.optional=o.optional,i.mainImporter||(i.mainImporter=s),i.importers.add(s)}let A=n;qQ.loadNodes(A,e.lockfile.nodes);let a=Rue(e.lockfile);return qQ.loadEdges(A,e.lockfile.edges,a),{graph:A,specOptions:a}};var l$=w(I(),1),kd=({children:e,className:t=""})=>(0,l$.jsx)("kbd",{className:`flex items-center justify-center rounded-sm h-[1.5rem] w-[1.5rem] text-xs font-mono text-foreground bg-muted border border-muted-foreground/20 ${t}`,children:e});var On=w(_(),1);var p$=w(_(),1);var on=w(I(),1),rC=({deleteDialogOpen:e,setDeleteDialogOpen:t,selectedQueries:n,type:A,onClose:a,text:o="Delete"})=>{let{toast:r}=zn(),[i,s]=(0,p$.useState)(!1),c=D(d=>d.deleteSavedQueries),u=()=>{t(!1),s(!1),c(n),r({title:"Deleted successfully"}),a&&a()};return(0,on.jsxs)(ws,{open:e,onOpenChange:t,children:[(0,on.jsx)(et,{open:i,onOpenChange:s,children:(0,on.jsxs)(Xe,{children:[(0,on.jsx)(lu,{asChild:!0,children:A==="icon"?(0,on.jsx)(se,{onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),disabled:n.length<=0,className:"rounded-sm border border-[1px] border-muted-foreground/25",size:"icon",variant:"ghost",children:(0,on.jsx)(As,{})}):(0,on.jsx)(se,{variant:"destructive",children:o})}),(0,on.jsxs)(Oe,{children:["Delete ",n.length<=1?"Query":"Queries"]})]})}),(0,on.jsxs)(Xr,{children:[(0,on.jsxs)(Es,{children:[(0,on.jsxs)(Qs,{className:"font-medium",children:["Delete ",n.length<=1?"Query":"Queries"]}),(0,on.jsx)(ks,{})]}),(0,on.jsxs)("div",{children:["You're about to delete:",(0,on.jsx)("ul",{className:"my-3 list-none",children:n.map((d,l)=>(0,on.jsx)("li",{className:"font-medium",children:d.name},l))}),"This action cannot be undone."]}),(0,on.jsxs)(ys,{children:[(0,on.jsx)(se,{variant:"outline",onClick:()=>t(!1),children:"No, Keep It."}),(0,on.jsx)(se,{variant:"destructive",onClick:u,children:"Yes, Delete!"})]})]})]})};var Se=w(I(),1),Mue=()=>{let[e,t]=(0,On.useState)(!1),[n,A]=vi(),a=D(c=>c.savedQueries),o=D(c=>c.query),[r,i]=(0,On.useState)(),{resolvedTheme:s}=Rr();return(0,On.useEffect)(()=>{let c=a?.find(u=>u.query===o);i(c&&s==="dark"?"#fafafa":"#212121"),e?A(n.current,{rotate:-71.5}):A(n.current,{rotate:0})},[e,a,o,s]),(0,Se.jsxs)(eA,{open:e,onOpenChange:t,children:[(0,Se.jsx)(tA,{className:"flex items-center justify-center",children:(0,Se.jsx)(Xe,{children:(0,Se.jsxs)(et,{children:[(0,Se.jsx)(Qt,{asChild:!0,className:"flex rounded-sm items-center justify-center h-[1.5rem] w-[1.5rem] bg-muted border border-muted-foreground/20",children:(0,Se.jsx)("div",{onClick:()=>t(!e),className:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-[1.5rem] w-[1.5rem]",children:(0,Se.jsx)(Do,{ref:n,size:20,fill:r})})}),(0,Se.jsx)(Oe,{children:(0,Se.jsx)("p",{children:"Save query"})})]})})}),(0,Se.jsx)(Hn,{className:"p-0 w-full",align:"end",children:(0,Se.jsx)(Nue,{isOpen:e,setIsOpen:t})})]})},Nue=({isOpen:e,setIsOpen:t})=>{let[n,A]=(0,On.useState)(!1),[a,o]=(0,On.useState)(!1),r=(0,On.useRef)(!1),[i,s]=(0,On.useState)(null),[c,u]=(0,On.useState)(""),[d,l]=(0,On.useState)(""),[p,g]=(0,On.useState)([]),b=D(C=>C.saveQuery),B=D(C=>C.nodes),f=D(C=>C.updateSavedQuery),m=D(C=>C.savedQueries),h=D(C=>C.query);return(0,On.useEffect)(()=>{if(!r.current){r.current=!0;let C=m?.find(E=>E.query===h);if(s(C??null),C&&c!==""){g(C.labels??[]),u(C.name||B[0]?.manifest?.name||""),l(C.context||B[0]?.projectRoot||"");let E={...C,name:c,context:d,query:h,labels:p,dateModified:new Date().toISOString()};f(E)}C||b({id:Is(),name:B[0]?.manifest?.name??"Query",context:B[0]?.projectRoot??"",query:h,labels:p,dateCreated:new Date().toISOString(),dateModified:new Date().toISOString()})}},[]),(0,On.useEffect)(()=>{if(!e){let C=m?.find(E=>E.query===h);if(s(C??null),C&&c!==""){g(C.labels??[]),u(C.name||B[0]?.manifest?.name||""),l(C.context||B[0]?.projectRoot||"");let E={...C,name:c,context:d,query:h,labels:p,dateModified:new Date().toISOString()};f(E)}}},[e]),(0,On.useEffect)(()=>{g(i?.labels??[]),u(i?.name??B[0]?.manifest?.name??""),l(i?.context??B[0]?.projectRoot??"")},[i]),e?(0,Se.jsxs)("div",{className:"flex flex-col w-[325px]",children:[(0,Se.jsx)(Ga,{className:"px-6 py-4",children:(0,Se.jsx)(jA,{className:"text-lg font-medium",children:i?"Edit Query":"Added Query!"})}),(0,Se.jsxs)("div",{className:"flex px-6 py-4 flex-col gap-2 border-muted-foreground/20 border-t-[1px]",children:[(0,Se.jsx)(Gt,{className:"font-medium border-none",children:"Name"}),(0,Se.jsx)(We,{type:"text",autoComplete:"off",placeholder:"Name",value:c,onChange:C=>{let E=C.currentTarget.value;u(E)}}),(0,Se.jsx)(Gt,{className:"font-medium border-none mt-2",children:"Directory"}),(0,Se.jsx)(We,{id:"query-context",type:"text",autoComplete:"off",placeholder:"Directory (optional)",value:d,onChange:C=>{let E=C.currentTarget.value;l(E)}}),(0,Se.jsx)(Gt,{className:"font-medium border-none mt-2",children:"Labels"}),p.length!==0&&(0,Se.jsx)("div",{className:"ml-2 flex flex-wrap gap-2",children:p.map((C,E)=>(0,Se.jsx)(ia,{name:C.name,color:C.color},E))}),(0,Se.jsxs)(eA,{children:[(0,Se.jsx)(tA,{asChild:!0,children:(0,Se.jsxs)(se,{variant:"outline",role:"combobox",className:"w-full justify-between font-normal",children:["Select labels",(0,Se.jsx)(ns,{className:"opacity-50"})]})}),(0,Se.jsx)(Hn,{className:"p-0",children:(0,Se.jsx)(cb,{selectedItems:p,setItems:g,setIsOpen:o})})]}),(0,Se.jsx)("div",{className:"flex justify-end items-center w-full mt-4 gap-2",children:(0,Se.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,Se.jsx)(rC,{type:"button",text:"Remove",deleteDialogOpen:n,setDeleteDialogOpen:A,onClose:()=>t(!1),selectedQueries:[{...i,name:c,context:d,query:h,labels:p}]}),(0,Se.jsx)(se,{onClick:()=>t(!1),children:"Done"})]})})]})]}):null},g$=Mue;var iC=w(_(),1);var Jt=w(I(),1),m$=()=>{let e=D(a=>a.savedQueries),t=D(a=>a.query),[n,A]=(0,iC.useState)([]);return(0,iC.useEffect)(()=>{if(e&&e.length!==0){let a=e.filter(o=>o.query===t);A(a)}},[e,t]),(0,Jt.jsxs)(Jt.Fragment,{children:[(0,Jt.jsx)(Pue,{className:"mr-1",queries:n}),n.length>1&&n[0]&&(0,Jt.jsx)(jue,{className:"mr-2",query:n[0].query,numberOfQueries:n.length})]})},Pue=({queries:e,className:t=""})=>{let n=D(a=>a.updateActiveRoute),A=a=>{n("/labels"),history.pushState({route:"/labels"},"",`/labels?name=${encodeURIComponent(a)}`)};return(0,Jt.jsxs)(eA,{children:[(0,Jt.jsx)(tA,{className:"flex items-center justify-center",children:(0,Jt.jsx)(et,{children:(0,Jt.jsxs)(Xe,{children:[(0,Jt.jsx)(Qt,{asChild:!0,className:"flex items-center justify-center",children:(0,Jt.jsx)("div",{className:`flex -space-x-2 ${t}`,children:e.map(a=>a.labels?.length?a.labels.map((o,r)=>(0,Jt.jsx)("div",{className:"inline-block size-4 rounded-full ring-muted ring-1",style:{backgroundColor:o.color,borderColor:o.color}},r)):null)})}),(0,Jt.jsx)(Oe,{children:"Labels"})]})})}),(0,Jt.jsxs)(Hn,{children:[(0,Jt.jsx)("p",{className:"font-semibold mb-2",children:"Labels"}),(0,Jt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(a=>a.labels?.length?a.labels.map((o,r)=>(0,Jt.jsx)("button",{onClick:()=>A(o.name),children:(0,Jt.jsx)(ia,{name:o.name,color:o.color})},r)):null)})]})]})},jue=({numberOfQueries:e,className:t="",query:n})=>(0,Jt.jsxs)("a",{href:`/queries?query=${encodeURIComponent(n)}`,className:`cursor-pointer text-[10px] flex items-center h-[1.5rem] justify-center bg-muted transition-all border border-muted-foreground/20 px-2 py-1 rounded-sm ${t}`,children:["Matches ",e," Queries"]});var Mi=w(I(),1),f$=()=>{let e=D(a=>a.updateActiveRoute),t=D(a=>a.updateQuery),n=D(a=>a.query);return(0,Mi.jsx)(Xe,{children:(0,Mi.jsxs)(et,{children:[(0,Mi.jsx)(Qt,{asChild:!0,children:(0,Mi.jsx)(se,{disabled:n===Ql,onClick:()=>{e("/explore"),t(":root")},size:"icon",variant:"secondary",children:(0,Mi.jsx)(Ja,{})})}),(0,Mi.jsx)(Oe,{children:"Go to project root"})]})})};var pn=w(I(),1),Gue=async({updateHasDashboard:e,updateGraph:t,updateQ:n,updateSpecOptions:A,stamp:a})=>{let r=await(await fetch("./graph.json?random="+a)).json(),{graph:i,specOptions:s}=d$(r),c=new Mb({graph:i});e(r.hasDashboard),t(i),A(s),n(c)},b$=()=>{let e=D(i=>i.updateActiveRoute),t=D(i=>i.updateErrorCause),n=D(i=>i.updateHasDashboard),A=D(i=>i.updateGraph),a=D(i=>i.updateQ),o=D(i=>i.updateSpecOptions),r=D(i=>i.stamp);return(0,ix.useEffect)(()=>{Gue({updateHasDashboard:n,updateGraph:A,updateQ:a,updateSpecOptions:o,stamp:r}).catch(i=>{console.error(i),e("/error"),t("Failed to initialize explorer.")})},[r]),(0,pn.jsx)(zue,{})},zue=()=>{let e=D(r=>r.dashboard),t=D(r=>r.updateEdges),n=D(r=>r.updateNodes),A=D(r=>r.graph),a=D(r=>r.query),o=D(r=>r.q);return(0,ix.useEffect)(()=>{async function r(){if(!o)return;let i=await o.search(a);t(i.edges),n(i.nodes);let s=history.state;(!s||a!==s.query||s.route!=="/explore")&&(history.pushState({query:a,route:"/explore"},"","/explore?query="+encodeURIComponent(a)),window.scrollTo(0,0))}r().catch(i=>console.error(i))},[a,o]),(0,pn.jsxs)("section",{className:"flex grow flex-col justify-between bg-white dark:bg-black",children:[(0,pn.jsxs)("div",{className:"flex items-center justify-between w-full px-8 pt-4 border-t-[1px]",children:[A?.projectRoot?(0,pn.jsxs)("p",{className:"text-xs font-mono font-light text-muted-foreground",children:[":host-context(file:",A.projectRoot,")"]}):"",e?.buildVersion?(0,pn.jsxs)("p",{className:"text-xs font-mono font-light text-muted-foreground text-right",children:["build: v",e.buildVersion]}):""]}),(0,pn.jsx)("section",{className:"flex items-center px-8 py-4 border-b-[1px] border-solid",children:(0,pn.jsxs)("div",{className:"flex flex-row gap-2 w-full",children:[(0,pn.jsx)(f$,{}),(0,pn.jsx)(_L,{tabIndex:0,className:"w-full bg-muted-foreground/5",startContent:(0,pn.jsx)(xo,{size:20,className:"ml-3",color:"#a3a3a3"}),endContent:(0,pn.jsxs)("div",{className:"items-center hidden md:flex gap-1 mr-3 backdrop-blur-sm",children:[(0,pn.jsx)(m$,{}),(0,pn.jsx)(g$,{}),(0,pn.jsx)(kd,{className:'ml-3 relative before:content-[" "] before:-ml-10 before:absolute before:h-[0.75rem] before:w-[1.25px] before:rounded-sm before:bg-neutral-600',children:(0,pn.jsx)(ko,{size:12})}),(0,pn.jsx)(kd,{className:"text-sm",children:"k"})]})})]})}),(0,pn.jsx)(u$,{})]})};var h$=w(_(),1);var O=w(I(),1),B$=()=>{let e=D(o=>o.updateActiveRoute),t=D(o=>o.previousRoute),n=D(o=>o.errorCause);return(0,h$.useEffect)(()=>{history.pushState({query:"",route:"/error"},"","/error"),window.scrollTo(0,0)}),(0,O.jsx)("section",{className:"flex grow flex-col items-center min-h-[80svh] bg-white dark:bg-black justify-center",children:(0,O.jsxs)("div",{className:"relative flex flex-col items-center justify-center -mt-32",children:[(0,O.jsxs)("div",{className:"relative flex flex-col gap-8",children:[(0,O.jsx)("div",{className:"absolute inset-0 bg-gradient-radial from-white/0 dark:from-black/0 via-transparent dark:to-black to-white z-[2]"}),(0,O.jsxs)("div",{className:"flex gap-8 opacity-50",children:[(0,O.jsx)(sC,{}),(0,O.jsx)(cC,{}),(0,O.jsx)(sC,{})]}),(0,O.jsxs)("div",{className:"flex gap-8 opacity-80",children:[(0,O.jsx)(sC,{}),(0,O.jsx)(Hue,{}),(0,O.jsx)(cC,{})]}),(0,O.jsxs)("div",{className:"flex gap-8 opacity-50",children:[(0,O.jsx)(cC,{}),(0,O.jsx)(sC,{}),(0,O.jsx)(cC,{})]})]}),(0,O.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 -mt-32",children:[(0,O.jsx)("h4",{className:"text-xl font-semibold z-[2]",children:"Something went wrong"}),(0,O.jsx)("p",{className:"text-sm text-neutral-500 text-center z-[2]",children:n||"An unexpected error occured."}),(0,O.jsxs)("div",{className:"flex gap-3 mt-3 z-[2]",children:[(0,O.jsx)(se,{variant:"outline",onClick:o=>{o.preventDefault(),e(t)},children:"Back"}),(0,O.jsxs)(se,{onClick:o=>{o.preventDefault(),e("/dashboard")},children:[(0,O.jsx)("span",{children:"Dashboard"}),(0,O.jsx)(xa,{})]})]})]}),(0,O.jsx)("div",{className:"absolute -bottom-6 h-[150px] -left-6 -right-6 z-[1] bg-gradient-radial from-white dark:from-black dark:to-black/0 to-white/0"})]})})},sC=()=>(0,O.jsxs)("div",{className:"relative flex flex-col gap-2",children:[(0,O.jsxs)("div",{className:"w-[175px] h-[100px] border-[1px] border-neutral-400 dark:border-neutral-800 rounded-sm bg-neutral-400/10 dark:bg-neutral-800/10 flex",children:[(0,O.jsxs)("div",{className:"w-1/4 bg-neutral-700/25 border-r-[1px] border-neutral-700/50 flex flex-col justify-between px-[3px] py-[3px]",children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("div",{className:"w-full h-[7px] bg-neutral-700/50 rounded-[2px]"}),(0,O.jsxs)("div",{className:"flex items-center gap-1 mt-1.5",children:[(0,O.jsx)("div",{className:"size-[5px] rounded-[1px] bg-neutral-700/60"}),(0,O.jsx)("div",{className:"w-2/3 h-[5px] bg-neutral-700/60 rounded-[1px]"})]}),(0,O.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,O.jsx)("div",{className:"size-[5px] rounded-[1px] bg-neutral-700/60"}),(0,O.jsx)("div",{className:"w-1/3 h-[5px] bg-neutral-700/60 rounded-[1px]"})]})]}),(0,O.jsx)("div",{children:(0,O.jsx)("div",{className:"size-[5px] rouned-[1px] bg-neutral-700/60"})})]}),(0,O.jsxs)("div",{className:"flex w-full flex-col px-[6px] py-[3px]",children:[(0,O.jsx)("div",{className:"w-1/4 h-[6px] bg-neutral-700/60 rounded-[1px]"}),(0,O.jsxs)("div",{className:"flex w-full justify-between gap-1 mt-2",children:[(0,O.jsx)("div",{className:"w-1/3 h-[24px] border-[1px] border-neutral-400/90 dark:border-neutral-800/90 bg-neutral-400/60 dark:bg-neutral-800/60"}),(0,O.jsx)("div",{className:"w-1/3 h-[24px] border-[1px] border-neutral-400/90 dark:border-neutral-800/90 bg-neutral-400/60 dark:bg-neutral-800/60"}),(0,O.jsx)("div",{className:"w-1/3 h-[24px] border-[1px] border-neutral-400/90 dark:border-neutral-800/90 bg-neutral-400/60 dark:bg-neutral-800/60"})]})]})]}),(0,O.jsx)("div",{className:"w-[80px] h-[12px] bg-neutral-200 dark:bg-neutral-900/80 rounded-[2px]"})]}),cC=()=>(0,O.jsxs)("div",{className:"relative flex flex-col gap-2",children:[(0,O.jsxs)("div",{className:"w-[175px] h-[100px] border-[1px] border-neutral-400 dark:border-neutral-800 rounded-sm bg-neutral-400/10 dark:bg-neutral-800/10 flex",children:[(0,O.jsxs)("div",{className:"flex flex-col items-center justify-between px-[1.6px] py-[3px] w-[10px] bg-neutral-400/25 dark:bg-neutral-700/25 border-r-[1px] border-neutral-400/50 dark:border-neutral-700/50",children:[(0,O.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,O.jsx)("div",{className:"size-[6px] bg-neutral-400 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsxs)("div",{className:"flex flex-col items-center justify-center mt-1.5 gap-1",children:[(0,O.jsx)("div",{className:"size-[6px] bg-neutral-400 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsx)("div",{className:"size-[6px] bg-neutral-400 dark:bg-neutral-700/60 rounded-[1px]"})]})]}),(0,O.jsx)("div",{className:"flex items-center justify-center",children:(0,O.jsx)("div",{className:"size-[6px] bg-neutral-400 dark:bg-neutral-700/60 rounded-[1px]"})})]}),(0,O.jsxs)("div",{className:"flex flex-col w-full px-[6px] py-[3px]",children:[(0,O.jsx)("div",{className:"w-1/4 h-[6px] bg-neutral-400/60 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsxs)("div",{className:"flex items-center justify-between mt-1.5",children:[(0,O.jsxs)("div",{className:"flex items-center justify-center gap-1",children:[(0,O.jsx)("div",{className:"w-[25px] h-[6px] bg-neutral-400/60 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsx)("div",{className:"w-[12px] h-[6px] bg-neutral-400/60 dark:bg-neutral-700/60 rounded-[1px]"}),(0,O.jsx)("div",{className:"w-[6px] h-[6px] bg-neutral-400/60 dark:bg-neutral-700/60 rounded-[1px]"})]}),(0,O.jsx)("div",{className:"flex items-center justify-center gap-1",children:(0,O.jsx)("div",{className:"w-[20px] h-[6px] bg-neutral-900/60 dark:bg-neutral-500/60 rounded-[1px]"})})]}),(0,O.jsxs)("div",{className:"flex flex-col mt-2 gap-1.5 w-full",children:[(0,O.jsx)("div",{className:"w-full h-[8px] bg-neutral-400/20 dark:bg-neutral-700/20 border-[0.75px] border-neutral-400/70 dark:border-neutral-700/70 rounded-[1px]"}),(0,O.jsx)("div",{className:"w-full h-[8px] bg-neutral-400/20 dark:bg-neutral-700/20 border-[0.75px] border-neutral-400/70 dark:border-neutral-700/70 rounded-[1px]"}),(0,O.jsx)("div",{className:"w-full h-[8px] bg-neutral-400/20 dark:bg-neutral-700/20 border-[0.75px] border-neutral-400/70 dark:border-neutral-700/70 rounded-[1px]"})]})]})]}),(0,O.jsx)("div",{className:"w-[60px] h-[12px] bg-neutral-200 dark:bg-neutral-900/80 rounded-[2px]"})]}),Hue=()=>(0,O.jsxs)("div",{className:"relative flex flex-col gap-2",children:[(0,O.jsx)("div",{className:"w-[175px] h-[100px] border-[1px] border-red-800 rounded-sm bg-red-700/10 flex items-center justify-center",children:(0,O.jsx)("div",{className:"size-8 bg-red-500/30 rounded-sm flex items-center justify-center",children:(0,O.jsx)(Gr,{className:"text-red-500",size:16})})}),(0,O.jsx)("div",{className:"w-[100px] h-[12px] bg-neutral-200 dark:bg-neutral-900/80 rounded-[2px]"})]});var K$=w(_(),1);var gC=w(_(),1);var $ue=Math.pow(10,8)*24*60*60*1e3,I7e=-$ue,uC=6048e5,C$=864e5;var Tue=3600;var w$=Tue*24,_7e=w$*7,Uue=w$*365.2425,Zue=Uue/12,x7e=Zue*3,sx=Symbol.for("constructDateFrom");function IA(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&sx in e?e[sx](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ht(e,t){return IA(t||e,e)}var que={};function Ni(){return que}function sr(e,t){let n=Ni(),A=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Ht(e,t?.in),o=a.getDay(),r=(o<A?7:0)+o-A;return a.setDate(a.getDate()-r),a.setHours(0,0,0,0),a}function Ac(e,t){return sr(e,{...t,weekStartsOn:1})}function dC(e,t){let n=Ht(e,t?.in),A=n.getFullYear(),a=IA(n,0);a.setFullYear(A+1,0,4),a.setHours(0,0,0,0);let o=Ac(a),r=IA(n,0);r.setFullYear(A,0,4),r.setHours(0,0,0,0);let i=Ac(r);return n.getTime()>=o.getTime()?A+1:n.getTime()>=i.getTime()?A:A-1}function cx(e){let t=Ht(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function E$(e,...t){let n=IA.bind(null,e||t.find(A=>typeof A=="object"));return t.map(n)}function ux(e,t){let n=Ht(e,t?.in);return n.setHours(0,0,0,0),n}function y$(e,t,n){let[A,a]=E$(n?.in,e,t),o=ux(A),r=ux(a),i=+o-cx(o),s=+r-cx(r);return Math.round((i-s)/C$)}function Q$(e,t){let n=dC(e,t),A=IA(t?.in||e,0);return A.setFullYear(n,0,4),A.setHours(0,0,0,0),Ac(A)}function k$(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function I$(e){return!(!k$(e)&&typeof e!="number"||isNaN(+Ht(e)))}function _$(e,t){let n=Ht(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var Oue={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},x$=(e,t,n)=>{let A,a=Oue[e];return typeof a=="string"?A=a:t===1?A=a.one:A=a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+A:A+" ago":A};function lC(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Yue={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Kue={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wue={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},D$={date:lC({formats:Yue,defaultWidth:"full"}),time:lC({formats:Kue,defaultWidth:"full"}),dateTime:lC({formats:Wue,defaultWidth:"full"})};var Jue={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},v$=(e,t,n,A)=>Jue[e];function Id(e){return(t,n)=>{let A=n?.context?String(n.context):"standalone",a;if(A==="formatting"&&e.formattingValues){let r=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):r;a=e.formattingValues[i]||e.formattingValues[r]}else{let r=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;a=e.values[i]||e.values[r]}let o=e.argumentCallback?e.argumentCallback(t):t;return a[o]}}var Vue={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xue={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ede={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tde={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nde={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ade={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ade=(e,t)=>{let n=Number(e),A=n%100;if(A>20||A<10)switch(A%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},F$={ordinalNumber:ade,era:Id({values:Vue,defaultWidth:"wide"}),quarter:Id({values:Xue,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Id({values:ede,defaultWidth:"wide"}),day:Id({values:tde,defaultWidth:"wide"}),dayPeriod:Id({values:nde,defaultWidth:"wide",formattingValues:Ade,defaultFormattingWidth:"wide"})};function _d(e){return(t,n={})=>{let A=n.width,a=A&&e.matchPatterns[A]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;let r=o[0],i=A&&e.parsePatterns[A]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(i)?rde(i,d=>d.test(r)):ode(i,d=>d.test(r)),c;c=e.valueCallback?e.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;let u=t.slice(r.length);return{value:c,rest:u}}}function ode(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function rde(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function S$(e){return(t,n={})=>{let A=t.match(e.matchPattern);if(!A)return null;let a=A[0],o=t.match(e.parsePattern);if(!o)return null;let r=e.valueCallback?e.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;let i=t.slice(a.length);return{value:r,rest:i}}}var ide=/^(\d+)(th|st|nd|rd)?/i,sde=/\d+/i,cde={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ude={any:[/^b/i,/^(a|c)/i]},dde={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lde={any:[/1/i,/2/i,/3/i,/4/i]},pde={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gde={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},mde={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},fde={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bde={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hde={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},L$={ordinalNumber:S$({matchPattern:ide,parsePattern:sde,valueCallback:e=>parseInt(e,10)}),era:_d({matchPatterns:cde,defaultMatchWidth:"wide",parsePatterns:ude,defaultParseWidth:"any"}),quarter:_d({matchPatterns:dde,defaultMatchWidth:"wide",parsePatterns:lde,defaultParseWidth:"any",valueCallback:e=>e+1}),month:_d({matchPatterns:pde,defaultMatchWidth:"wide",parsePatterns:gde,defaultParseWidth:"any"}),day:_d({matchPatterns:mde,defaultMatchWidth:"wide",parsePatterns:fde,defaultParseWidth:"any"}),dayPeriod:_d({matchPatterns:bde,defaultMatchWidth:"any",parsePatterns:hde,defaultParseWidth:"any"})};var dx={code:"en-US",formatDistance:x$,formatLong:D$,formatRelative:v$,localize:F$,match:L$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function R$(e,t){let n=Ht(e,t?.in);return y$(n,_$(n))+1}function M$(e,t){let n=Ht(e,t?.in),A=+Ac(n)-+Q$(n);return Math.round(A/uC)+1}function pC(e,t){let n=Ht(e,t?.in),A=n.getFullYear(),a=Ni(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,r=IA(t?.in||e,0);r.setFullYear(A+1,0,o),r.setHours(0,0,0,0);let i=sr(r,t),s=IA(t?.in||e,0);s.setFullYear(A,0,o),s.setHours(0,0,0,0);let c=sr(s,t);return+n>=+i?A+1:+n>=+c?A:A-1}function N$(e,t){let n=Ni(),A=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=pC(e,t),o=IA(t?.in||e,0);return o.setFullYear(a,0,A),o.setHours(0,0,0,0),sr(o,t)}function P$(e,t){let n=Ht(e,t?.in),A=+sr(n,t)-+N$(n,t);return Math.round(A/uC)+1}function ze(e,t){let n=e<0?"-":"",A=Math.abs(e).toString().padStart(t,"0");return n+A}var cr={y(e,t){let n=e.getFullYear(),A=n>0?n:1-n;return ze(t==="yy"?A%100:A,t.length)},M(e,t){let n=e.getMonth();return t==="M"?String(n+1):ze(n+1,2)},d(e,t){return ze(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ze(e.getHours()%12||12,t.length)},H(e,t){return ze(e.getHours(),t.length)},m(e,t){return ze(e.getMinutes(),t.length)},s(e,t){return ze(e.getSeconds(),t.length)},S(e,t){let n=t.length,A=e.getMilliseconds(),a=Math.trunc(A*Math.pow(10,n-3));return ze(a,t.length)}};var xd={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lx={G:function(e,t,n){let A=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(A,{width:"abbreviated"});case"GGGGG":return n.era(A,{width:"narrow"});case"GGGG":default:return n.era(A,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){let A=e.getFullYear(),a=A>0?A:1-A;return n.ordinalNumber(a,{unit:"year"})}return cr.y(e,t)},Y:function(e,t,n,A){let a=pC(e,A),o=a>0?a:1-a;if(t==="YY"){let r=o%100;return ze(r,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ze(o,t.length)},R:function(e,t){let n=dC(e);return ze(n,t.length)},u:function(e,t){let n=e.getFullYear();return ze(n,t.length)},Q:function(e,t,n){let A=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(A);case"QQ":return ze(A,2);case"Qo":return n.ordinalNumber(A,{unit:"quarter"});case"QQQ":return n.quarter(A,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(A,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(A,{width:"wide",context:"formatting"})}},q:function(e,t,n){let A=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(A);case"qq":return ze(A,2);case"qo":return n.ordinalNumber(A,{unit:"quarter"});case"qqq":return n.quarter(A,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(A,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(A,{width:"wide",context:"standalone"})}},M:function(e,t,n){let A=e.getMonth();switch(t){case"M":case"MM":return cr.M(e,t);case"Mo":return n.ordinalNumber(A+1,{unit:"month"});case"MMM":return n.month(A,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(A,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(A,{width:"wide",context:"formatting"})}},L:function(e,t,n){let A=e.getMonth();switch(t){case"L":return String(A+1);case"LL":return ze(A+1,2);case"Lo":return n.ordinalNumber(A+1,{unit:"month"});case"LLL":return n.month(A,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(A,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(A,{width:"wide",context:"standalone"})}},w:function(e,t,n,A){let a=P$(e,A);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):ze(a,t.length)},I:function(e,t,n){let A=M$(e);return t==="Io"?n.ordinalNumber(A,{unit:"week"}):ze(A,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):cr.d(e,t)},D:function(e,t,n){let A=R$(e);return t==="Do"?n.ordinalNumber(A,{unit:"dayOfYear"}):ze(A,t.length)},E:function(e,t,n){let A=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(A,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(A,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(A,{width:"short",context:"formatting"});case"EEEE":default:return n.day(A,{width:"wide",context:"formatting"})}},e:function(e,t,n,A){let a=e.getDay(),o=(a-A.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ze(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,A){let a=e.getDay(),o=(a-A.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ze(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){let A=e.getDay(),a=A===0?7:A;switch(t){case"i":return String(a);case"ii":return ze(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(A,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(A,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(A,{width:"short",context:"formatting"});case"iiii":default:return n.day(A,{width:"wide",context:"formatting"})}},a:function(e,t,n){let a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){let A=e.getHours(),a;switch(A===12?a=xd.noon:A===0?a=xd.midnight:a=A/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){let A=e.getHours(),a;switch(A>=17?a=xd.evening:A>=12?a=xd.afternoon:A>=4?a=xd.morning:a=xd.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let A=e.getHours()%12;return A===0&&(A=12),n.ordinalNumber(A,{unit:"hour"})}return cr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):cr.H(e,t)},K:function(e,t,n){let A=e.getHours()%12;return t==="Ko"?n.ordinalNumber(A,{unit:"hour"}):ze(A,t.length)},k:function(e,t,n){let A=e.getHours();return A===0&&(A=24),t==="ko"?n.ordinalNumber(A,{unit:"hour"}):ze(A,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):cr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):cr.s(e,t)},S:function(e,t){return cr.S(e,t)},X:function(e,t,n){let A=e.getTimezoneOffset();if(A===0)return"Z";switch(t){case"X":return G$(A);case"XXXX":case"XX":return ac(A);case"XXXXX":case"XXX":default:return ac(A,":")}},x:function(e,t,n){let A=e.getTimezoneOffset();switch(t){case"x":return G$(A);case"xxxx":case"xx":return ac(A);case"xxxxx":case"xxx":default:return ac(A,":")}},O:function(e,t,n){let A=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+j$(A,":");case"OOOO":default:return"GMT"+ac(A,":")}},z:function(e,t,n){let A=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+j$(A,":");case"zzzz":default:return"GMT"+ac(A,":")}},t:function(e,t,n){let A=Math.trunc(+e/1e3);return ze(A,t.length)},T:function(e,t,n){return ze(+e,t.length)}};function j$(e,t=""){let n=e>0?"-":"+",A=Math.abs(e),a=Math.trunc(A/60),o=A%60;return o===0?n+String(a):n+String(a)+t+ze(o,2)}function G$(e,t){return e%60===0?(e>0?"-":"+")+ze(Math.abs(e)/60,2):ac(e,t)}function ac(e,t=""){let n=e>0?"-":"+",A=Math.abs(e),a=ze(Math.trunc(A/60),2),o=ze(A%60,2);return n+a+t+o}var z$=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},H$=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Bde=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],A=n[1],a=n[2];if(!a)return z$(e,t);let o;switch(A){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",z$(A,t)).replace("{{time}}",H$(a,t))},$$={p:H$,P:Bde};var Cde=/^D+$/,wde=/^Y+$/,Ede=["D","DD","YY","YYYY"];function T$(e){return Cde.test(e)}function U$(e){return wde.test(e)}function Z$(e,t,n){let A=yde(e,t,n);if(console.warn(A),Ede.includes(e))throw new RangeError(A)}function yde(e,t,n){let A=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${A} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Qde=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kde=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ide=/^'([^]*?)'?$/,_de=/''/g,xde=/[a-zA-Z]/;function q$(e,t,n){let A=Ni(),a=n?.locale??A.locale??dx,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??A.firstWeekContainsDate??A.locale?.options?.firstWeekContainsDate??1,r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??A.weekStartsOn??A.locale?.options?.weekStartsOn??0,i=Ht(e,n?.in);if(!I$(i))throw new RangeError("Invalid time value");let s=t.match(kde).map(u=>{let d=u[0];if(d==="p"||d==="P"){let l=$$[d];return l(u,a.formatLong)}return u}).join("").match(Qde).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:Dde(u)};if(lx[d])return{isToken:!0,value:u};if(d.match(xde))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});a.localize.preprocessor&&(s=a.localize.preprocessor(i,s));let c={firstWeekContainsDate:o,weekStartsOn:r,locale:a};return s.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!n?.useAdditionalWeekYearTokens&&U$(d)||!n?.useAdditionalDayOfYearTokens&&T$(d))&&Z$(d,t,String(e));let l=lx[d[0]];return l(i,d,a.localize,c)}).join("")}function Dde(e){let t=e.match(Ide);return t?t[1].replace(_de,"'"):e}var po=w(_(),1);var lo=w(I(),1),Dd=({items:e,setFilteredItems:t,placeholder:n})=>{let[A,a]=(0,po.useState)(""),o=(0,po.useRef)(null),r=(0,po.useRef)(!0);return(0,po.useEffect)(()=>{if(r.current)return;let i=new URLSearchParams(window.location.search),s=e?Object.keys(e[0]??{}):[];if(A.trim()||(i.forEach((u,d)=>i.delete(d)),t(e??[])),A.trim()!==""&&(i.forEach((u,d)=>i.delete(d)),i.set("filter",A)),A.split("=")[0]==="label"){i.forEach((d,l)=>i.delete(l));let u=A.split("=")[1];u&&i.set("label",u)}if(s.some(u=>A.includes(u))){i.forEach((l,p)=>i.delete(p));let[u,d]=A.split("=");u&&d&&i.set(u,d)}let c=`${window.location.pathname}?${i.toString()}`;window.history.replaceState({},"",c)},[A]),(0,po.useEffect)(()=>{let i=new URLSearchParams(window.location.search),s=e?Object.keys(e[0]??{}):[],u=Array.from(i.keys()).find(d=>s.includes(d));u&&a(`${u}=${i.get(u)}`),i.get("label")&&a(`label=${i.get("label")?.toLowerCase()}`),r.current=!1},[]),(0,po.useEffect)(()=>{if(!e){t([]);return}let i=new URLSearchParams(window.location.search),s=[];for(let[u,d]of i.entries())s.push({key:u,value:d});let c=e.filter(u=>s.every(d=>{if(d.key==="filter"){let l=d.value.toLowerCase();return Object.values(u).some(p=>String(p).toLowerCase().includes(l))}else if(d.key==="label"){let l=d.value.toLowerCase();return(u.labels??[]).some(g=>g.name.toLowerCase().includes(l))}else{let l=String(u[d.key]||"").toLowerCase(),p=d.value.toLowerCase();return l===p}}));t(c)},[e,window.location.search,A]),(0,po.useEffect)(()=>{let i=s=>{switch(!0){case((s.metaKey||s.ctrlKey)&&s.key==="k"):s.preventDefault(),o.current?.focus();break;case s.key==="Escape":s.preventDefault(),o.current?.blur();break;default:break}};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[]),(0,lo.jsxs)("div",{className:"relative flex items-center w-[384px]",children:[(0,lo.jsx)(xo,{size:18,className:"absolute left-0 ml-3 text-neutral-500"}),(0,lo.jsx)(We,{type:"text",ref:o,className:"pl-9 pr-20",role:"search",placeholder:n,value:A,onChange:i=>a(i.target.value)}),(0,lo.jsx)("div",{className:"flex gap-2 absolute right-0",children:(0,lo.jsxs)("div",{className:"items-center hidden md:flex gap-1 mr-3 backdrop-blur-sm",children:[(0,lo.jsx)(kd,{children:(0,lo.jsx)(ko,{size:12})}),(0,lo.jsx)(kd,{className:"text-sm",children:"k"})]})})]})};var O$=w(_(),1);var TA=w(I(),1),vd=({sortKey:e,filteredItems:t,setFilteredItems:n})=>{let[A,a]=(0,O$.useState)("ascending"),o=[{icon:c=>(0,TA.jsx)(Mr,{...c}),option:"ascending",toolTipContent:"Sort ascending"},{icon:c=>(0,TA.jsx)(Nr,{...c}),option:"descending",toolTipContent:"Sort descending"}],r=c=>{let u=A===c?c==="ascending"?"descending":"ascending":c;a(u),u==="ascending"?i():s()},i=()=>{let c=[...t].sort((u,d)=>String(u[e]).localeCompare(String(d[e])));n(c)},s=()=>{let c=[...t].sort((u,d)=>String(d[e]).localeCompare(String(u[e])));n(c)};return(0,TA.jsx)("div",{className:"flex mx-3",children:(0,TA.jsxs)("div",{className:"relative flex items-center p-1 h-[2.5rem] bg-white dark:bg-black w-full rounded-sm border border-[1px] border-muted-foreground/25",children:[(0,TA.jsx)(Kt.div,{className:"absolute h-[2rem] w-[2rem] rounded-sm bg-muted border border-muted-foreground/20",animate:{left:A==="ascending"?4:36}}),o.map((c,u)=>(0,TA.jsx)(Xe,{children:(0,TA.jsxs)(et,{children:[(0,TA.jsx)(Qt,{asChild:!0,children:(0,TA.jsx)("div",{onClick:()=>{r(c.option)},className:"cursor-pointer h-[2rem] w-[2rem] rounded-sm flex items-center justify-center z-[1]",children:(0,TA.jsx)(c.icon,{size:20,className:"text-muted-foreground"})})}),(0,TA.jsx)(Oe,{children:c.toolTipContent})]})},u))]})})};var Ct=w(I(),1),vde=async({updateActiveRoute:e,updateErrorCause:t,updateQuery:n,updateStamp:A,item:a})=>{let o;try{o=await fetch("/select-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a.path})})}catch(i){console.error(i),e("/error"),t("Failed to request project selection.");return}let r=!1;try{r=await o.json()==="ok"}catch(i){console.error(i)}r?(window.scrollTo(0,0),n(Ql),e("/explore"),A()):(e("/error"),t("Failed to select project."))},Fde=({item:e})=>{let t=D(r=>r.updateActiveRoute),n=D(r=>r.updateErrorCause),A=D(r=>r.updateQuery),a=D(r=>r.updateStamp);return(0,Ct.jsxs)("a",{href:"#",className:"border-[1px] rounded-lg w-full md:w-96 hover:border-muted-foreground/50 transition-all duration-250 bg-card",onClick:r=>{r.preventDefault(),vde({updateActiveRoute:t,updateErrorCause:n,updateQuery:A,updateStamp:a,item:e}).catch(i=>console.error(i))},children:[(0,Ct.jsxs)("div",{className:"flex flex-col items-start h-20 justify-between px-4 py-3",children:[(0,Ct.jsx)("div",{className:"flex flex-row w-full items-center justify-end",children:e.mtime?(0,Ct.jsx)("div",{className:"text-[0.7rem] text-muted-foreground",children:q$(new Date(e.mtime).toJSON(),"LLLL do, yyyy | hh:mm aa")}):""}),(0,Ct.jsx)("div",{className:"flex",children:(0,Ct.jsx)(jA,{className:"self-end text-md font-medium",children:e.name})})]}),(0,Ct.jsxs)("div",{className:"w-full h-12 flex items-center gap-4 justify-between border-t-[1px] px-4 py-3",children:[(0,Ct.jsx)(Xe,{children:(0,Ct.jsxs)(et,{children:[(0,Ct.jsx)(Qt,{className:"rounded-sm border-[1px] px-2 py-1 text-[0.65rem] text-muted-foreground font-mono m-0 align-baseline truncate",children:e.readablePath}),(0,Ct.jsx)(Oe,{children:e.readablePath})]})}),(0,Ct.jsx)("div",{className:"flex gap-2",children:e.tools.map((r,i)=>(0,Ct.jsx)("div",{className:"flex-none bg-secondary rounded-xl px-2 py-1",children:(0,Ct.jsx)("p",{className:"text-[0.7rem] font-medium text-primary ",children:r})},i))})]})]})},Y$=()=>{let e=D(A=>A.dashboard),[t,n]=(0,gC.useState)([]);return(0,gC.useEffect)(()=>{e&&n(e.projects.sort((A,a)=>A.name.localeCompare(a.name)))},[e]),(0,Ct.jsxs)("div",{className:"flex flex-col grow bg-secondary dark:bg-black px-8 py-8",children:[(0,Ct.jsxs)("div",{className:"flex gap-2 mb-8",children:[(0,Ct.jsx)(Dd,{placeholder:"Filter Projects",items:e?.projects??[],setFilteredItems:n}),(0,Ct.jsx)(vd,{filteredItems:t,setFilteredItems:n,sortKey:"name"})]}),(0,Ct.jsxs)("div",{className:"flex flex-col",children:[(0,Ct.jsx)("p",{className:"text-sm font-semibold mb-4",children:"Projects"}),(0,Ct.jsx)("div",{className:"flex flex-row flex-wrap gap-8",children:e?.projects?t.map((A,a)=>(0,Ct.jsx)(Fde,{item:A},a)):(0,Ct.jsx)("p",{children:"No projects found"})})]})]})};var Pi=w(I(),1),Sde=async({updateDashboard:e,stamp:t})=>{let A=await(await fetch("./dashboard.json?random="+t)).json();e(A)},px=()=>{let e=D(o=>o.dashboard),t=D(o=>o.updateActiveRoute),n=D(o=>o.updateDashboard),A=D(o=>o.updateErrorCause),a=D(o=>o.stamp);return(0,K$.useEffect)(()=>{async function o(){await Sde({updateDashboard:n,stamp:a}),history.pushState({query:"",route:"/dashboard"},"","/dashboard"),window.scrollTo?.(0,0)}o().catch(r=>{console.error(r),t("/error"),A("Failed to initialize dashboard.")})},[a]),(0,Pi.jsxs)("section",{className:"flex grow w-full flex-col min-h-[80svh] bg-white dark:bg-black",children:[(0,Pi.jsxs)("div",{className:"flex items-center justify-between w-full px-8 py-4 border-b-[1px] border-t-[1px] border-solid",children:[e?.cwd?(0,Pi.jsxs)("p",{className:"text-xs font-mono font-light text-muted-foreground",children:["Directory: ",e.cwd]}):"",e?.buildVersion?(0,Pi.jsxs)("p",{className:"text-xs font-mono font-light text-muted-foreground text-right",children:["build: v",e.buildVersion]}):""]}),(0,Pi.jsx)(Lde,{})]})},Lde=()=>(0,Pi.jsx)(Y$,{});var Fd=w(_(),1);var W$=w(_(),1);var He=w(I(),1),J$=()=>{let[e,t]=vi(),[n,A]=vi();return(0,W$.useEffect)(()=>{let{x:a,y:o,width:r,height:i}=n.current.getBoundingClientRect(),s={centerX:a+r/2,centerY:o+i/2},{x:c,y:u,width:d,height:l}=e.current.getBoundingClientRect(),p={centerX:c+d,centerY:u+l};A(n.current,{x:[0,-(s.centerX-p.centerX),0],y:[55,-(s.centerY-p.centerY),0]},{duration:2}),t(e.current,{scale:[1,1.2,1]},{delay:.75,duration:.5}),t("#icon",{rotate:[0,-71]},{delay:.75,duration:.5}),t("#icon",{fill:["","currentColor"]},{delay:.75,duration:.5});let g=setTimeout(()=>{A(n.current,{x:[0,Math.random()*10,Math.random()*10],y:[0,Math.random()*10,Math.random()*10]},{ease:"easeInOut",duration:2,repeat:1/0,repeatType:"mirror"})},2500);return()=>{clearTimeout(g)}},[e,n]),(0,He.jsx)("div",{className:"flex items-center justify-center h-full w-full bg-white dark:bg-black",children:(0,He.jsxs)("div",{className:"-mt-20 flex flex-col items-center justify-center gap-3 mt-10",children:[(0,He.jsxs)("div",{className:"relative flex items-center justify-center mb-20",children:[(0,He.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:.5},className:"absolute z-[1] w-[450px] h-[450px] border-[1px] border-neutral-500/10 rounded-full"}),(0,He.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:1},className:"absolute z-[1] w-[300px] h-[300px] border-[1px] border-neutral-500/15 rounded-full"}),(0,He.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:1.5},className:"absolute z-[1] w-[150px] h-[150px] border-[1px] border-neutral-500/20 rounded-full"}),(0,He.jsxs)("div",{className:"absolute z-[2] flex items-center justify-center h-[50px] w-[400px] bg-gradient-to-r from-white to-neutral-400 dark:from-black dark:to-neutral-800 rounded-[8px]",children:[(0,He.jsxs)("div",{className:"relative flex items-center h-[48.25px] w-[398.25px] bg-white dark:bg-black rounded-[6.25px] shadow-2xl",children:[(0,He.jsx)("p",{className:"-ml-32 bg-gradient-to-r from-white dark:from-black to-neutral-500 dark:to-neutral-500 text-transparent bg-clip-text absolute whitespace-nowrap",children:'[name="my-project"] > :is(:project > *[name="tap"])'}),(0,He.jsxs)("div",{className:"ml-auto flex gap-2 mr-3",children:[(0,He.jsx)("div",{ref:e,className:"flex items-center justify-center h-[24px] w-[24px] rounded-sm border-[1px] bg-neutral-700 dark:bg-neutral-300 border-neutral-800 dark:border-neutral-900",children:(0,He.jsx)(Do,{id:"icon",size:16,className:"text-neutral-100 dark:text-neutral-900"})}),(0,He.jsxs)("div",{className:"flex items-center justify-center gap-1 before:content-[''] before:w-[0.9px] before:h-[14px] before:bg-neutral-400 dark:before:bg-neutral-800 before:rounded-full before:mr-1",children:[(0,He.jsx)("div",{className:"flex items-center justify-center h-[24px] w-[24px] rounded-sm border-[1px] bg-neutral-100 dark:bg-neutral-900 border-neutral-400 dark:border-neutral-800",children:(0,He.jsx)(ko,{size:13,className:"text-neutral-500"})}),(0,He.jsx)("div",{className:"flex items-center justify-center h-[24px] w-[24px] rounded-sm border-[1px] bg-neutral-100 dark:bg-neutral-900 border-neutral-400 dark:border-neutral-800",children:(0,He.jsx)("span",{className:"font-mono text-sm text-neutral-500",children:"k"})})]})]})]}),(0,He.jsx)("div",{ref:n,className:"absolute -right-10 top-10",children:(0,He.jsx)("div",{className:"relative",children:(0,He.jsx)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"1",viewBox:"0 0 16 16",className:"h-6 w-6 transform -rotate-[70deg] -translate-x-[12px] -translate-y-[10px] stroke-sky-500 text-sky-400 dark:stroke-sky-500 dark:text-sky-700 ",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:(0,He.jsx)("path",{d:"M14.082 2.182a.5.5 0 0 1 .103.557L8.528 15.467a.5.5 0 0 1-.917-.007L5.57 10.694.803 8.652a.5.5 0 0 1-.006-.916l12.728-5.657a.5.5 0 0 1 .556.103z"})})})})]})]}),(0,He.jsx)("h3",{className:"text-xl font-medium",children:"No saved Queries yet"}),(0,He.jsxs)("p",{className:"text-sm text-neutral-500 text-center",children:["Looks like you haven't saved any Queries yet,",(0,He.jsx)("br",{}),"explore your Projects to add one!"]}),(0,He.jsx)("div",{className:"flex gap-3"}),(0,He.jsx)(se,{asChild:!0,className:"z-[2]",children:(0,He.jsxs)("a",{href:"/",children:[(0,He.jsx)("span",{children:"Explore Projects"}),(0,He.jsx)(xa,{})]})})]})})};var Ze=w(I(),1),V$=()=>{let e=D(u=>u.savedQueries),[t,n]=(0,Fd.useState)(e??[]),[A,a]=(0,Fd.useState)(!1),[o,r]=(0,Fd.useState)([]),i=D(u=>u.savedQueryLabels),s=u=>{r(d=>d.some(p=>p.id===u.id)?d.filter(p=>p.id!==u.id):[...d,u])},c=()=>{t.length===o.length?r([]):r(t)};return(0,Fd.useEffect)(()=>{if(e){let u=[...e].sort((d,l)=>d.name.localeCompare(l.name));n(u)}},[e]),(0,Ze.jsxs)("section",{className:"flex grow w-full flex-col min-h-[80svh] bg-white dark:bg-black",children:[(0,Ze.jsxs)("div",{className:"flex flex-col px-8 py-4",children:[(0,Ze.jsxs)("div",{className:"flex justify-between",children:[(0,Ze.jsxs)("div",{className:"flex gap-2",children:[(0,Ze.jsx)(Dd,{placeholder:"Filter Queries",items:e,setFilteredItems:n}),(0,Ze.jsx)(vd,{filteredItems:t,setFilteredItems:n,sortKey:"name"}),(0,Ze.jsx)("div",{className:"flex items-center",children:(0,Ze.jsx)("div",{className:"flex items-center",children:(0,Ze.jsx)(rC,{deleteDialogOpen:A,setDeleteDialogOpen:a,selectedQueries:o,type:"icon"})})})]}),(0,Ze.jsx)(se,{asChild:!0,variant:"outline",children:(0,Ze.jsxs)("a",{href:"/labels",children:[(0,Ze.jsx)($l,{}),(0,Ze.jsx)("span",{children:"Labels"}),(0,Ze.jsx)($o,{variant:"secondary",children:i?.length})]})})]}),(0,Ze.jsxs)("div",{className:"mt-6",children:[!!e?.length&&(0,Ze.jsxs)("div",{className:"grid grid-cols-12 gap-4",children:[(0,Ze.jsxs)("div",{className:"col-span-2 flex items-center gap-3 px-3",children:[(0,Ze.jsx)(Ho,{onCheckedChange:c,className:"border-muted-foreground/50 hover:border-muted-foreground/75"}),(0,Ze.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Name"})]}),(0,Ze.jsx)("div",{className:"col-span-4 items-center px-1",children:(0,Ze.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Query"})}),(0,Ze.jsx)("div",{className:"col-span-2 items-center",children:(0,Ze.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Directory"})}),(0,Ze.jsx)("div",{className:"col-span-4 items-center",children:(0,Ze.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Labels"})})]}),(0,Ze.jsx)("div",{className:"mt-3 flex flex-col gap-3",children:e&&t.map((u,d)=>(0,Ze.jsx)(ZS,{checked:o.some(l=>l.id===u.id),handleSelect:s,item:u},d))})]})]}),!e?.length&&(0,Ze.jsx)(J$,{})]})};var rc=w(_(),1);var ur=w(_(),1);var Le=w(I(),1),X$=({queryLabel:e,checked:t,handleSelect:n})=>{let[A,a]=(0,ur.useState)(!1),[o,r]=(0,ur.useState)(""),[i,s]=(0,ur.useState)(""),[c,u]=(0,ur.useState)(gu),d=D(C=>C.updateSavedQueryLabel),{toast:l}=zn(),[p,g]=(0,ur.useState)(0),b=D(C=>C.savedQueries),B=D(C=>C.updateActiveRoute),f=()=>{a(!A)},m=()=>{let C={...e,name:i,description:o,color:c};d(C),a(!1),l({title:`${i} saved successfully`})},h=()=>{B("/queries"),history.pushState({route:"/queries"},"",`/queries?label=${encodeURIComponent(i)}`)};return(0,ur.useEffect)(()=>{g(0);let C=b?.reduce((E,Q)=>E+(Q.labels?.filter(y=>y.name===e.name).length||0),0);g(C||0)},[e,b]),(0,ur.useEffect)(()=>{s(e.name),r(e.description),u(e.color)},[e]),(0,Le.jsxs)("div",{className:"bg-neutral-50/50 dark:bg-neutral-950 rounded-sm transition-all border border-[1px] border-muted-foreground/25 group hover:border-foreground/50",children:[(0,Le.jsxs)("div",{className:"grid grid-cols-8 flex items-center px-3 py-2",children:[(0,Le.jsxs)("div",{className:"col-span-2 flex gap-3 items-center",children:[(0,Le.jsx)(Ho,{onCheckedChange:()=>n(e),checked:t,className:"border-muted-foreground/25 group-hover:border-muted-foreground/50"}),(0,Le.jsx)(ia,{name:i.trim()!==""?i:"Label preview",color:c})]}),(0,Le.jsx)("div",{className:"col-span-4 flex items-center",children:!A&&(0,Le.jsx)("p",{className:"text-sm truncate",children:o})}),(0,Le.jsx)("div",{className:"flex items-center justify-center",children:(0,Le.jsxs)(se,{variant:"ghost",className:"flex items-center justify-center gap-1",onClick:()=>p?h():void 0,children:[(0,Le.jsx)("span",{children:p}),(0,Le.jsx)(ts,{})]})}),(0,Le.jsx)("div",{className:"flex items-center justify-end",children:(0,Le.jsx)(se,{variant:"outline",className:"text-sm px-3 rounded-sm border border-[1px] border-muted-foreground/25 h-[2rem]",onClick:f,children:A?"Close":"Edit"})})]}),A&&(0,Le.jsx)("div",{className:"pt-6 mb-3 flex flex-col px-3 py-2 border-t-[1px] border-muted-foreground/25",children:(0,Le.jsxs)("div",{className:"flex gap-3",children:[(0,Le.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Le.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Name"}),(0,Le.jsx)(We,{type:"text",value:i,onChange:C=>s(C.target.value),placeholder:"Name"})]}),(0,Le.jsxs)("div",{className:"flex flex-col gap-2 grow",children:[(0,Le.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Description"}),(0,Le.jsx)(We,{type:"text",value:o,onChange:C=>r(C.target.value),placeholder:"Description (optional)"})]}),(0,Le.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Le.jsx)(Gt,{className:"font-medium text-sm border-none",children:"Color"}),(0,Le.jsxs)(eA,{children:[(0,Le.jsx)(tA,{asChild:!0,children:(0,Le.jsxs)(se,{className:"w-[120px] font-normal",variant:"outline",children:[(0,Le.jsx)(Io,{}),(0,Le.jsx)("span",{children:c})]})}),(0,Le.jsx)(Hn,{children:(0,Le.jsx)(mu,{defaultInput:c,defaultColor:c,onChange:u})})]})]}),(0,Le.jsx)("div",{className:"flex items-end mb-0.5",children:(0,Le.jsx)(se,{disabled:i.trim()===""||i==="Label preview",onClick:m,variant:"default",size:"sm",children:"Save changes"})})]})})]})};var eT=w(_(),1);var Vt=w(I(),1),tT=({deleteDialogOpen:e,setDeleteDialogOpen:t,selectedLabels:n})=>{let{toast:A}=zn(),[a,o]=(0,eT.useState)(!1),r=D(s=>s.deleteSavedQueryLabels),i=()=>{t(!1),o(!1),r(n),A({title:"Deleted successfully"})};return(0,Vt.jsx)("div",{className:"flex items-center",children:(0,Vt.jsx)("div",{className:"flex items-center",children:(0,Vt.jsxs)(ws,{open:e,onOpenChange:t,children:[(0,Vt.jsx)(et,{open:a,onOpenChange:o,children:(0,Vt.jsxs)(Xe,{children:[(0,Vt.jsx)(lu,{asChild:!0,children:(0,Vt.jsx)(se,{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),disabled:n.length<=0,className:"rounded-sm border border-[1px] border-muted-foreground/25",size:"icon",variant:"ghost",children:(0,Vt.jsx)(As,{})})}),(0,Vt.jsxs)(Oe,{children:["Delete"," ",n.length<=1?"Label":"Labels"]})]})}),(0,Vt.jsxs)(Xr,{children:[(0,Vt.jsxs)(Es,{children:[(0,Vt.jsxs)(Qs,{className:"font-medium",children:["Delete"," ",n.length<=1?"Label":"Labels"]}),(0,Vt.jsx)(ks,{})]}),(0,Vt.jsxs)("div",{children:["You're about to delete:",(0,Vt.jsx)("ul",{className:"my-3 list-none",children:n.map((s,c)=>(0,Vt.jsx)("li",{className:"font-medium",children:s.name},c))}),"This action cannot be undone."]}),(0,Vt.jsxs)(ys,{children:[(0,Vt.jsx)(se,{variant:"outline",onClick:()=>t(!1),children:"No, Keep It."}),(0,Vt.jsx)(se,{variant:"destructive",onClick:i,children:"Yes, Delete!"})]})]})]})})})};var oc=w(_(),1);var wt=w(I(),1),mC=({closeCreate:e})=>{let[t,n]=(0,oc.useState)("Label preview"),[A,a]=(0,oc.useState)(""),[o,r]=(0,oc.useState)("#00FF5F"),[i,s]=(0,oc.useState)(!1),c=D(p=>p.saveQueryLabel),{toast:u}=zn(),d=()=>{e()},l=()=>{c({id:Is(),name:t,description:A,color:o}),u({title:`${t} saved successfully`}),e()};return(0,oc.useEffect)(()=>{t.trim()!==""&&t.trim()!=="Label preview"?s(!0):s(!1)},[t,A,o]),(0,wt.jsx)("div",{className:"bg-neutral-100 dark:bg-neutral-950 rounded-sm transition-all border border-[1px] border-muted-foreground/25",children:(0,wt.jsxs)("div",{className:"flex flex-col px-3 py-3 gap-3",children:[(0,wt.jsx)("div",{children:(0,wt.jsx)(ia,{name:t.trim()!==""?t:"Label preview",color:o})}),(0,wt.jsxs)("div",{className:"flex mt-4 gap-3 w-full",children:[(0,wt.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,wt.jsx)(Gt,{className:"text-sm font-medium border-none",children:"Name"}),(0,wt.jsx)(We,{type:"text",value:t,onChange:p=>n(p.target.value),placeholder:"Name"})]}),(0,wt.jsxs)("div",{className:"flex flex-col gap-2 grow",children:[(0,wt.jsx)(Gt,{className:"text-sm font-medium border-none",children:"Description"}),(0,wt.jsx)(We,{type:"text",value:A,onChange:p=>a(p.target.value),placeholder:"Description (optional)"})]}),(0,wt.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,wt.jsx)(Gt,{className:"text-sm font-medium border-none",children:"Color"}),(0,wt.jsxs)(eA,{children:[(0,wt.jsx)(tA,{asChild:!0,children:(0,wt.jsxs)(se,{className:"w-[120px]",variant:"outline",children:[(0,wt.jsx)(Io,{}),(0,wt.jsx)("span",{children:o})]})}),(0,wt.jsx)(Hn,{children:(0,wt.jsx)(mu,{defaultColor:o,defaultInput:o,onChange:r})})]})]}),(0,wt.jsxs)("div",{className:"flex items-end justify-end gap-3",children:[(0,wt.jsx)(se,{onClick:d,variant:"outline",children:"Cancel"}),(0,wt.jsx)(se,{disabled:!i,onClick:l,children:"Create label"})]})]})]})})};var nT=w(_(),1);var xt=w(I(),1),AT=()=>{let[e,t]=(0,nT.useState)(!1);return(0,xt.jsxs)("div",{className:"flex items-center justify-center h-full w-full bg-white dark:bg-black",children:[(0,xt.jsx)(JB,{children:!e&&(0,xt.jsxs)(Kt.div,{initial:{opacity:1},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"-mt-20 flex flex-col gap-3 items-center justify-center",children:[(0,xt.jsxs)("div",{className:"relative flex items-center justify-center mb-20",children:[(0,xt.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:.5},className:"absolute w-[450px] h-[450px] border-[1px] border-neutral-500/10 rounded-full"}),(0,xt.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:1},className:"absolute w-[300px] h-[300px] border-[1px] border-neutral-500/15 rounded-full"}),(0,xt.jsx)(Kt.div,{initial:{opacity:1},animate:{opacity:[0,1,0]},transition:{duration:3,repeat:1/0,delay:1.5},className:"absolute w-[150px] h-[150px] border-[1px] border-neutral-500/20 rounded-full"}),(0,xt.jsx)("div",{className:"relative flex items-center justify-center h-[42px] w-[400px] bg-gradient-to-r from-white dark:from-black to-muted-foreground dark:to-muted-foreground rounded-[8px]",children:(0,xt.jsxs)("div",{className:"flex items-center justify-center h-[40px] w-[398px] bg-white dark:bg-black rounded-[7px]",children:[(0,xt.jsx)("span",{className:"absolute my-auto mr-32 text-sm tracking bg-gradient-to-r from-white dark:from-black dark:to-neutral-500 to-neutral-500 text-transparent bg-clip-text",children:"Need to update insecure packages"}),(0,xt.jsx)(Kt.div,{initial:{opacity:.5},animate:{opacity:[.5,.8,.5]},transition:{duration:8,repeat:1/0,ease:"linear",repeatType:"loop"},className:"absolute flex items-center justify-center my-auto right-3 bg-red-500 h-[24px] w-[80px] rounded-full",children:(0,xt.jsx)("span",{className:"text-xs font-semibold tracking-wide",children:"Insecure"})})]})})]}),(0,xt.jsx)("h3",{className:"text-xl z-[2] font-medium",children:"No saved Labels yet"}),(0,xt.jsxs)("p",{className:"text-sm z-[2] text-neutral-500 text-center",children:["Looks like you haven't made any Labels yet,",(0,xt.jsx)("br",{}),"Labels are a great way to mark your dependencies."]}),(0,xt.jsx)("div",{className:"flex gap-3"}),(0,xt.jsxs)(se,{onClick:()=>t(!0),children:[(0,xt.jsx)("span",{children:"New Label"}),(0,xt.jsx)(_o,{})]})]})}),(0,xt.jsx)(JB,{children:e&&(0,xt.jsx)(Kt.div,{className:"absolute",exit:{opacity:0,y:10},initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,xt.jsx)(mC,{closeCreate:()=>t(!1)})})})]})};var dt=w(I(),1),aT=()=>{let[e,t]=(0,rc.useState)(!1),[n,A]=(0,rc.useState)(!1),[a,o]=(0,rc.useState)([]),[r,i]=(0,rc.useState)([]),s=D(d=>d.savedQueryLabels),c=d=>{i(l=>l.some(g=>g.id===d.id)?l.filter(g=>g.id!==d.id):[...l,d])},u=()=>{a.length===r.length?i([]):i(a)};return(0,rc.useEffect)(()=>{if(s){let d=[...s].sort((l,p)=>l.name.localeCompare(p.name));o(d)}},[s]),(0,dt.jsxs)("section",{className:"flex grow w-full flex-col min-h-[80svh] bg-white dark:bg-black",children:[(0,dt.jsxs)("div",{className:"flex flex-col px-8 py-4",children:[(0,dt.jsxs)("div",{className:"flex justify-between",children:[(0,dt.jsxs)("div",{className:"flex gap-2",children:[(0,dt.jsx)(Dd,{placeholder:"Filter Labels",items:s,setFilteredItems:o}),(0,dt.jsx)(vd,{filteredItems:a,setFilteredItems:o,sortKey:"name"}),(0,dt.jsx)(tT,{deleteDialogOpen:e,setDeleteDialogOpen:t,selectedLabels:r})]}),(0,dt.jsx)("div",{children:s?.length!==0&&(0,dt.jsxs)(se,{disabled:n,onClick:()=>A(!0),children:[(0,dt.jsx)("span",{children:"New Label"}),(0,dt.jsx)(_o,{})]})})]}),n&&(0,dt.jsx)("div",{className:"mt-6",children:(0,dt.jsx)(mC,{closeCreate:()=>A(!1)})}),!!s?.length&&(0,dt.jsxs)("div",{className:"mt-6 grid grid-cols-8 px-3",children:[(0,dt.jsxs)("div",{className:"col-span-2 flex items-center gap-3",children:[(0,dt.jsx)(Ho,{onCheckedChange:u,className:"border-muted-foreground/50 hover:border-muted-foreground/75"}),(0,dt.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Name"})]}),(0,dt.jsx)("div",{className:"col-span-4 flex items-center",children:(0,dt.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"Description"})}),(0,dt.jsx)("div",{className:"flex items-center justify-center",children:(0,dt.jsx)("p",{className:"text-neutral-500 text-sm font-medium",children:"References"})})]}),(0,dt.jsx)("div",{className:"mt-3 flex flex-col gap-3",children:s&&a.map((d,l)=>(0,dt.jsx)(X$,{checked:r.some(p=>p.id===d.id),handleSelect:c,queryLabel:d},l))})]}),!s?.length&&(0,dt.jsx)(AT,{})]})};var ic=w(_(),1);var Be=w(_(),1),rT=w(Lr(),1);var $e=w(I(),1),hx="ToastProvider",[Bx,Rde,Mde]=ri("Toast"),[iT,aTe]=Pt("Toast",[Mde]),[Nde,bC]=iT(hx),sT=e=>{let{__scopeToast:t,label:n="Notification",duration:A=5e3,swipeDirection:a="right",swipeThreshold:o=50,children:r}=e,[i,s]=Be.useState(null),[c,u]=Be.useState(0),d=Be.useRef(!1),l=Be.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${hx}\`. Expected non-empty \`string\`.`),(0,$e.jsx)(Bx.Provider,{scope:t,children:(0,$e.jsx)(Nde,{scope:t,label:n,duration:A,swipeDirection:a,swipeThreshold:o,toastCount:c,viewport:i,onViewportChange:s,onToastAdd:Be.useCallback(()=>u(p=>p+1),[]),onToastRemove:Be.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:l,children:r})})};sT.displayName=hx;var cT="ToastViewport",Pde=["F8"],mx="toast.viewportPause",fx="toast.viewportResume",uT=Be.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:A=Pde,label:a="Notifications ({hotkey})",...o}=e,r=bC(cT,n),i=Rde(n),s=Be.useRef(null),c=Be.useRef(null),u=Be.useRef(null),d=Be.useRef(null),l=pe(t,d,r.onViewportChange),p=A.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=r.toastCount>0;Be.useEffect(()=>{let B=f=>{A.length!==0&&A.every(h=>f[h]||f.code===h)&&d.current?.focus()};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[A]),Be.useEffect(()=>{let B=s.current,f=d.current;if(g&&B&&f){let m=()=>{if(!r.isClosePausedRef.current){let Q=new CustomEvent(mx);f.dispatchEvent(Q),r.isClosePausedRef.current=!0}},h=()=>{if(r.isClosePausedRef.current){let Q=new CustomEvent(fx);f.dispatchEvent(Q),r.isClosePausedRef.current=!1}},C=Q=>{!B.contains(Q.relatedTarget)&&h()},E=()=>{B.contains(document.activeElement)||h()};return B.addEventListener("focusin",m),B.addEventListener("focusout",C),B.addEventListener("pointermove",m),B.addEventListener("pointerleave",E),window.addEventListener("blur",m),window.addEventListener("focus",h),()=>{B.removeEventListener("focusin",m),B.removeEventListener("focusout",C),B.removeEventListener("pointermove",m),B.removeEventListener("pointerleave",E),window.removeEventListener("blur",m),window.removeEventListener("focus",h)}}},[g,r.isClosePausedRef]);let b=Be.useCallback(({tabbingDirection:B})=>{let m=i().map(h=>{let C=h.ref.current,E=[C,...Wde(C)];return B==="forwards"?E:E.reverse()});return(B==="forwards"?m.reverse():m).flat()},[i]);return Be.useEffect(()=>{let B=d.current;if(B){let f=m=>{let h=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!h){let E=document.activeElement,Q=m.shiftKey;if(m.target===B&&Q){c.current?.focus();return}let R=b({tabbingDirection:Q?"backwards":"forwards"}),F=R.findIndex(U=>U===E);gx(R.slice(F+1))?m.preventDefault():Q?c.current?.focus():u.current?.focus()}};return B.addEventListener("keydown",f),()=>B.removeEventListener("keydown",f)}},[i,b]),(0,$e.jsxs)(D8,{ref:s,role:"region","aria-label":a.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&(0,$e.jsx)(bx,{ref:c,onFocusFromOutsideViewport:()=>{let B=b({tabbingDirection:"forwards"});gx(B)}}),(0,$e.jsx)(Bx.Slot,{scope:n,children:(0,$e.jsx)(Z.ol,{tabIndex:-1,...o,ref:l})}),g&&(0,$e.jsx)(bx,{ref:u,onFocusFromOutsideViewport:()=>{let B=b({tabbingDirection:"backwards"});gx(B)}})]})});uT.displayName=cT;var dT="ToastFocusProxy",bx=Be.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:A,...a}=e,o=bC(dT,n);return(0,$e.jsx)(ms,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:r=>{let i=r.relatedTarget;!o.viewport?.contains(i)&&A()}})});bx.displayName=dT;var hC="Toast",jde="toast.swipeStart",Gde="toast.swipeMove",zde="toast.swipeCancel",Hde="toast.swipeEnd",lT=Be.forwardRef((e,t)=>{let{forceMount:n,open:A,defaultOpen:a,onOpenChange:o,...r}=e,[i=!0,s]=Tt({prop:A,defaultProp:a,onChange:o});return(0,$e.jsx)(jt,{present:n||i,children:(0,$e.jsx)(Ude,{open:i,...r,ref:t,onClose:()=>s(!1),onPause:Je(e.onPause),onResume:Je(e.onResume),onSwipeStart:z(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:z(e.onSwipeMove,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:z(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:z(e.onSwipeEnd,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),s(!1)})})})});lT.displayName=hC;var[$de,Tde]=iT(hC,{onClose(){}}),Ude=Be.forwardRef((e,t)=>{let{__scopeToast:n,type:A="foreground",duration:a,open:o,onClose:r,onEscapeKeyDown:i,onPause:s,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:l,onSwipeEnd:p,...g}=e,b=bC(hC,n),[B,f]=Be.useState(null),m=pe(t,N=>f(N)),h=Be.useRef(null),C=Be.useRef(null),E=a||b.duration,Q=Be.useRef(0),y=Be.useRef(E),k=Be.useRef(0),{onToastAdd:R,onToastRemove:F}=b,U=Je(()=>{B?.contains(document.activeElement)&&b.viewport?.focus(),r()}),M=Be.useCallback(N=>{!N||N===1/0||(window.clearTimeout(k.current),Q.current=new Date().getTime(),k.current=window.setTimeout(U,N))},[U]);Be.useEffect(()=>{let N=b.viewport;if(N){let te=()=>{M(y.current),c?.()},W=()=>{let ne=new Date().getTime()-Q.current;y.current=y.current-ne,window.clearTimeout(k.current),s?.()};return N.addEventListener(mx,W),N.addEventListener(fx,te),()=>{N.removeEventListener(mx,W),N.removeEventListener(fx,te)}}},[b.viewport,E,s,c,M]),Be.useEffect(()=>{o&&!b.isClosePausedRef.current&&M(E)},[o,E,b.isClosePausedRef,M]),Be.useEffect(()=>(R(),()=>F()),[R,F]);let ce=Be.useMemo(()=>B?BT(B):null,[B]);return b.viewport?(0,$e.jsxs)($e.Fragment,{children:[ce&&(0,$e.jsx)(Zde,{__scopeToast:n,role:"status","aria-live":A==="foreground"?"assertive":"polite","aria-atomic":!0,children:ce}),(0,$e.jsx)($de,{scope:n,onClose:U,children:rT.createPortal((0,$e.jsx)(Bx.ItemSlot,{scope:n,children:(0,$e.jsx)(x8,{asChild:!0,onEscapeKeyDown:z(i,()=>{b.isFocusedToastEscapeKeyDownRef.current||U(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,$e.jsx)(Z.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":b.swipeDirection,...g,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:z(e.onKeyDown,N=>{N.key==="Escape"&&(i?.(N.nativeEvent),N.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,U()))}),onPointerDown:z(e.onPointerDown,N=>{N.button===0&&(h.current={x:N.clientX,y:N.clientY})}),onPointerMove:z(e.onPointerMove,N=>{if(!h.current)return;let te=N.clientX-h.current.x,W=N.clientY-h.current.y,ne=!!C.current,K=["left","right"].includes(b.swipeDirection),H=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,ve=K?H(0,te):0,Re=K?0:H(0,W),L=N.pointerType==="touch"?10:2,ae={x:ve,y:Re},ue={originalEvent:N,delta:ae};ne?(C.current=ae,fC(Gde,d,ue,{discrete:!1})):oT(ae,b.swipeDirection,L)?(C.current=ae,fC(jde,u,ue,{discrete:!1}),N.target.setPointerCapture(N.pointerId)):(Math.abs(te)>L||Math.abs(W)>L)&&(h.current=null)}),onPointerUp:z(e.onPointerUp,N=>{let te=C.current,W=N.target;if(W.hasPointerCapture(N.pointerId)&&W.releasePointerCapture(N.pointerId),C.current=null,h.current=null,te){let ne=N.currentTarget,K={originalEvent:N,delta:te};oT(te,b.swipeDirection,b.swipeThreshold)?fC(Hde,p,K,{discrete:!0}):fC(zde,l,K,{discrete:!0}),ne.addEventListener("click",H=>H.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),Zde=e=>{let{__scopeToast:t,children:n,...A}=e,a=bC(hC,t),[o,r]=Be.useState(!1),[i,s]=Be.useState(!1);return Yde(()=>r(!0)),Be.useEffect(()=>{let c=window.setTimeout(()=>s(!0),1e3);return()=>window.clearTimeout(c)},[]),i?null:(0,$e.jsx)(LA,{asChild:!0,children:(0,$e.jsx)(ms,{...A,children:o&&(0,$e.jsxs)($e.Fragment,{children:[a.label," ",n]})})})},qde="ToastTitle",pT=Be.forwardRef((e,t)=>{let{__scopeToast:n,...A}=e;return(0,$e.jsx)(Z.div,{...A,ref:t})});pT.displayName=qde;var Ode="ToastDescription",gT=Be.forwardRef((e,t)=>{let{__scopeToast:n,...A}=e;return(0,$e.jsx)(Z.div,{...A,ref:t})});gT.displayName=Ode;var mT="ToastAction",fT=Be.forwardRef((e,t)=>{let{altText:n,...A}=e;return n.trim()?(0,$e.jsx)(hT,{altText:n,asChild:!0,children:(0,$e.jsx)(Cx,{...A,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${mT}\`. Expected non-empty \`string\`.`),null)});fT.displayName=mT;var bT="ToastClose",Cx=Be.forwardRef((e,t)=>{let{__scopeToast:n,...A}=e,a=Tde(bT,n);return(0,$e.jsx)(hT,{asChild:!0,children:(0,$e.jsx)(Z.button,{type:"button",...A,ref:t,onClick:z(e.onClick,a.onClose)})})});Cx.displayName=bT;var hT=Be.forwardRef((e,t)=>{let{__scopeToast:n,altText:A,...a}=e;return(0,$e.jsx)(Z.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":A||void 0,...a,ref:t})});function BT(e){let t=[];return Array.from(e.childNodes).forEach(A=>{if(A.nodeType===A.TEXT_NODE&&A.textContent&&t.push(A.textContent),Kde(A)){let a=A.ariaHidden||A.hidden||A.style.display==="none",o=A.dataset.radixToastAnnounceExclude==="";if(!a)if(o){let r=A.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...BT(A))}}),t}function fC(e,t,n,{discrete:A}){let a=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),A?Oc(a,o):a.dispatchEvent(o)}var oT=(e,t,n=0)=>{let A=Math.abs(e.x),a=Math.abs(e.y),o=A>a;return t==="left"||t==="right"?o&&A>n:!o&&a>n};function Yde(e=()=>{}){let t=Je(e);Ne(()=>{let n=0,A=0;return n=window.requestAnimationFrame(()=>A=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(A)}},[t])}function Kde(e){return e.nodeType===e.ELEMENT_NODE}function Wde(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:A=>{let a=A.tagName==="INPUT"&&A.type==="hidden";return A.disabled||A.hidden||a?NodeFilter.FILTER_SKIP:A.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gx(e){let t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var CT=sT,wx=uT,Ex=lT,yx=pT,Qx=gT,kx=fT,Ix=Cx;var ji=w(I(),1),wT=CT,_x=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(wx,{ref:n,className:v("fixed top-0 z-[10001] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));_x.displayName=wx.displayName;var Vde=VA("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),xx=ic.forwardRef(({className:e,variant:t,...n},A)=>(0,ji.jsx)(Ex,{ref:A,className:v(Vde({variant:t}),e),...n}));xx.displayName=Ex.displayName;var Xde=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(kx,{ref:n,className:v("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Xde.displayName=kx.displayName;var Dx=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(Ix,{ref:n,className:v("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,ji.jsx)(vo,{className:"h-4 w-4"})}));Dx.displayName=Ix.displayName;var vx=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(yx,{ref:n,className:v("text-sm font-semibold",e),...t}));vx.displayName=yx.displayName;var Fx=ic.forwardRef(({className:e,...t},n)=>(0,ji.jsx)(Qx,{ref:n,className:v("text-sm opacity-90",e),...t}));Fx.displayName=Qx.displayName;var dr=w(I(),1);function ET(){let{toasts:e}=zn();return(0,dr.jsxs)(wT,{children:[e.map(function({id:t,title:n,description:A,action:a,...o}){return(0,dr.jsxs)(xx,{...o,children:[(0,dr.jsxs)("div",{className:"grid gap-1",children:[n&&(0,dr.jsx)(vx,{children:n}),A&&(0,dr.jsx)(Fx,{children:A})]}),a,(0,dr.jsx)(Dx,{})]},t)}),(0,dr.jsx)(_x,{})]})}var gn=w(I(),1),yT={"/dashboard":(0,gn.jsx)(px,{}),"/error":(0,gn.jsx)(B$,{}),"/explore":(0,gn.jsx)(b$,{}),"/queries":(0,gn.jsx)(V$,{}),"/labels":(0,gn.jsx)(aT,{})},sc=()=>{let e=D(A=>A.activeRoute),t=(0,gn.jsx)(px,{}),n=Object.keys(yT).find(A=>e.startsWith(A));return(0,gn.jsx)(Wy,{defaultOpen:KS,children:(0,gn.jsxs)(sc.Wrapper,{children:[(0,gn.jsxs)(sc.Body,{children:[(0,gn.jsx)(WS,{}),(0,gn.jsxs)(sc.Content,{children:[(0,gn.jsx)(R1,{}),n?yT[n]:t,(0,gn.jsx)(Z1,{})]})]}),(0,gn.jsx)(ET,{})]})})};sc.Wrapper=({children:e})=>(0,gn.jsx)("div",{className:"flex flex-col min-h-svh w-full",children:e});sc.Body=({children:e})=>(0,gn.jsx)("div",{className:"flex flex-row min-h-svh w-full",children:e});sc.Content=({children:e})=>(0,gn.jsx)("div",{className:"flex flex-col grow w-full",children:e});var QT=sc;var Tg=w(I(),1),ele=()=>(0,Tg.jsx)(QT,{}),kT=document.getElementById("app");kT&&(0,_T.createRoot)(kT).render((0,Tg.jsx)(IT.StrictMode,{children:(0,Tg.jsx)(S1,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:(0,Tg.jsx)(ele,{})})}));
|
|
74
74
|
/*! Bundled license information:
|
|
75
75
|
|
|
76
76
|
react/cjs/react.production.min.js:
|