1import{o as e,t}from"./react-B8HINTYZ.js";import{i as n}from"./bundle-mjs-C77yRssA.js";import{a as r,n as i}from"./dist-CDZqEP_V.js";import{S as a,b as o,g as s,h as c,v as l,x as u}from"./dist-BedKRH-1.js";var d=e(t(),1),f=n();function p(e){let t=e+`CollectionProvider`,[n,a]=u(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=e=>{let{scope:t,children:n}=e,r=d.useRef(null),i=d.useRef(new Map).current;return(0,f.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})};c.displayName=t;let l=e+`CollectionSlot`,p=i(l),m=d.forwardRef((e,t)=>{let{scope:n,children:i}=e;return(0,f.jsx)(p,{ref:r(t,s(l,n).collectionRef),children:i})});m.displayName=l;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=i(h),v=d.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=d.useRef(null),c=r(t,o),l=s(h,n);return d.useEffect(()=>(l.itemMap.set(o,{ref:o,...a}),()=>void l.itemMap.delete(o))),(0,f.jsx)(_,{[g]:``,ref:c,children:i})});v.displayName=h;function y(t){let n=s(e+`CollectionConsumer`,t);return d.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},y,a]}var m=d.createContext(void 0);function h(e){let t=d.useContext(m);return e||t||`ltr`}var g=`rovingFocusGroup.onEntryFocus`,_={bubbles:!1,cancelable:!0},v=`RovingFocusGroup`,[y,b,x]=p(v),[S,C]=u(v,[x]),[w,T]=S(v),E=d.forwardRef((e,t)=>(0,f.jsx)(y.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(y.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(D,{...e,ref:t})})}));E.displayName=v;var D=d.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:s=!1,dir:u,currentTabStopId:p,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:y,onEntryFocus:x,preventScrollOnEntryFocus:S=!1,...C}=e,T=d.useRef(null),E=r(t,T),D=h(u),[O,k]=l({prop:p,defaultProp:m??null,onChange:y,caller:v}
vendor: 2,710 bytes, line 1
1),[A,j]=d.useState(!1),M=c(x),P=b(n),F=d.useRef(!1),[I,L]=d.useState(0);return d.useEffect(()=>{let e=T.current;if(e)return e.addEventListener(g,M),()=>e.removeEventListener(g,M)},[M]),(0,f.jsx)(w,{scope:n,orientation:i,dir:D,loop:s,currentTabStopId:O,onItemFocus:d.useCallback(e=>k(e),[k]),onItemShiftTab:d.useCallback(()=>j(!0),[]),onFocusableItemAdd:d.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:d.useCallback(()=>L(e=>e-1),[]),children:(0,f.jsx)(a.div,{tabIndex:A||I===0?-1:0,"data-orientation":i,...C,ref:E,style:{outline:`none`,...e.style},onMouseDown:o(e.onMouseDown,()=>{F.current=!0}),onFocus:o(e.onFocus,e=>{let t=!F.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(g,_);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);N([e.find(e=>e.active),e.find(e=>e.id===O),...e].filter(Boolean).map(e=>e.ref.current),S)}}F.current=!1}),onBlur:o(e.onBlur,()=>j(!1))})})}),O=`RovingFocusGroupItem`,k=d.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:c,children:l,...u}=e,p=s(),m=c||p,h=T(O,n),g=h.currentTabStopId===m,_=b(n),{onFocusableItemAdd:v,onFocusableItemRemove:x,currentTabStopId:S}=h;return d.useEffect(()=>{if(r)return v(),()=>x()},[r,v,x]),(0,f.jsx)(y.ItemSlot,{scope:n,id:m,focusable:r,active:i,children:(0,f.jsx)(a.span,{tabIndex:g?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:o(e.onMouseDown,e=>{r?h.onItemFocus(m):e.preventDefault()}),onFocus:o(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:o(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){h.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=M(e,h.orientation,h.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=_().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=h.loop?P(n,r+1):n.slice(r+1)}setTimeout(()=>N(n))}}),children:typeof l==`function`?l({isCurrentTabStop:g,hasTabStop:S!=null}):l})})});k.displayName=O;var A={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function j(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function M(e,t,n){let r=j(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return A[r]}function N(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function P(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var F=E,I=k;export{p as a,h as i,F as n,C as r,I as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.