import{s as M}from"./chunk-LvLJmgfZ.js";import{t as P}from"./react-Bj1aDYRI.js";import{t as _}from"./compiler-runtime-B3qBwwSJ.js";import{o as S,r as N}from"./useEventListener-C0195JsF.js";import{n as u,t as v}from"./cn-DYvqRARy.js";import{t as q}from"./jsx-runtime-Blw4afVn.js";import{C as z}from"./fullscreen-CTDqNQr6.js";var a=M(P(),1),p=M(q(),1);function E(t){let e=t+"CollectionProvider",[o,n]=z(e),[s,l]=o(e,{collectionRef:{current:null},itemMap:new Map}),h=d=>{let{scope:r,children:c}=d,i=a.useRef(null),m=a.useRef(new Map).current;return(0,p.jsx)(s,{scope:r,itemMap:m,collectionRef:i,children:c})};h.displayName=e;let x=t+"CollectionSlot",A=N(x),y=a.forwardRef((d,r)=>{let{scope:c,children:i}=d;return(0,p.jsx)(A,{ref:S(r,l(x,c).collectionRef),children:i})});y.displayName=x;let g=t+"CollectionItemSlot",w="data-radix-collection-item",k=N(g),C=a.forwardRef((d,r)=>{let{scope:c,children:i,...m}=d,f=a.useRef(null),O=S(r,f),R=l(g,c);return a.useEffect(()=>(R.itemMap.set(f,{ref:f,...m}),()=>{R.itemMap.delete(f)})),(0,p.jsx)(k,{[w]:"",ref:O,children:i})});C.displayName=g;function I(d){let r=l(t+"CollectionConsumer",d);return a.useCallback(()=>{let c=r.collectionRef.current;if(!c)return[];let i=Array.from(c.querySelectorAll(`[${w}]`));return Array.from(r.itemMap.values()).sort((m,f)=>i.indexOf(m.ref.current)-i.indexOf(f.ref.current))},[r.collectionRef,r.itemMap])}return[{Provider:h,Slot:y,ItemSlot:C},I,n]}var V=a.createContext(void 0);function $(t){let e=a.useContext(V);return t||e||"ltr"}var B=_();const D=u("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",{variants:{subcontent:{true:"shadow-lg"}}}),F=u("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",{variants:{inset:{true:"pl-8"}}}),b="data-disabled:pointer-events-none data-disabled:opacity-50",G=u(v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground",b),{variants:{}}),H=u("absolute left-2 flex h-3.5 w-3.5 items-center justify-center",{variants:{}}),J=u("px-2 py-1.5 text-sm font-semibold",{variants:{inset:{true:"pl-8"}}}),K=u(v("menu-item relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden",b),{variants:{inset:{true:"pl-8"},variant:{default:"focus:bg-accent focus:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",danger:"focus:bg-(--red-5) focus:text-(--red-12) aria-selected:bg-(--red-5) aria-selected:text-(--red-12)",muted:"focus:bg-muted/70 focus:text-muted-foreground aria-selected:bg-muted/70 aria-selected:text-muted-foreground",success:"focus:bg-(--grass-3) focus:text-(--grass-11) aria-selected:bg-(--grass-3) aria-selected:text-(--grass-11)",disabled:"text-muted-foreground"}},defaultVariants:{variant:"default"}}),L=u("-mx-1 my-1 h-px bg-border last:hidden",{variants:{}}),j=t=>{let e=(0,B.c)(8),o,n;e[0]===t?(o=e[1],n=e[2]):({className:o,...n}=t,e[0]=t,e[1]=o,e[2]=n);let s;e[3]===o?s=e[4]:(s=v("ml-auto text-xs tracking-widest opacity-60",o),e[3]=o,e[4]=s);let l;return e[5]!==n||e[6]!==s?(l=(0,p.jsx)("span",{className:s,...n}),e[5]=n,e[6]=s,e[7]=l):l=e[7],l};j.displayName="MenuShortcut";export{G as a,L as c,E as d,H as i,F as l,j as n,K as o,D as r,J as s,b as t,$ as u};
