vendor: 4,332 bytes, line 1
1import{r as s,j as F,bC as H,bt as D,bq as R,br as Y,bp as V,bi as q,bB as z,bh as J}from"./main-DX7XzkoU.js";function Q(e,o=[]){let n=[];function r(p,u){const a=s.createContext(u),i=n.length;n=[...n,u];function c(b){const{scope:l,children:g,...t}=b,m=(l==null?void 0:l[e][i])||a,S=s.useMemo(()=>t,Object.values(t));return F.jsx(m.Provider,{value:S,children:g})}function C(b,l){const g=(l==null?void 0:l[e][i])||a,t=s.useContext(g);if(t)return t;if(u!==void 0)return u;throw new Error(`\`${b}\` must be used within \`${p}\``)}return c.displayName=p+"Provider",[c,C]}const d=()=>{const p=n.map(u=>s.createContext(u));return function(a){const i=(a==null?void 0:a[e])||p;return s.useMemo(()=>({[`__scope${e}`]:{...a,[e]:i}}),[a,i])}};return d.scopeName=e,[r,W(d,...o)]}function W(...e){const o=e[0];if(e.length===1)return o;const n=()=>{const r=e.map(d=>({useScope:d(),scopeName:d.scopeName}));return function(p){const u=r.reduce((a,{useScope:i,scopeName:c})=>{const b=i(p)[`__scope${c}`];return{...a,...b}},{});return s.useMemo(()=>({[`__scope${o.scopeName}`]:u}),[u])}};return n.scopeName=o.scopeName,n}var h="rovingFocusGroup.onEntryFocus",X={bubbles:!1,cancelable:!0},E="RovingFocusGroup",[A,G,Z]=Y(E),[ee,le]=Q(E,[Z]),[te,oe]=ee(E),N=s.forwardRef((e,o)=>F.jsx(A.Provider,{scope:e.__scopeRovingFocusGroup,children:F.jsx(A.Slot,{scope:e.__scopeRovingFocusGroup,children:F.jsx(ne,{...e,ref:o})})}));N.displayName=E;var ne=s.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:d=!1,dir:p,currentTabStopId:u,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:i,onEntryFocus:c,preventScrollOnEntryFocus:C=!1,...b}=e,l=s.useRef(null),g=V(o,l),t=q(p),[m=null,S]=z({prop:u,defaultProp:a,onChange:i}),[v,I]=s.useState(!1),w=J(c),K=G(n),T=s.useRef(!1),[k,P]=s.useState(0);return s.useEffect(()=>{const f=l.current;if(f)return f.addEventListener(h,w),()=>f.removeEventListener(h,w)},[w]),F.jsx(te,{scope:n,orientation:r,dir:t,loop:d,currentTabStopId:m,onItemFocus:s.useCallback(f=>S(f),[S]),onItemShiftTab:s.useCallback(()=>I(!0),[]),onFocusableItemAdd:s.useCallback(()=>P(f=>f+1),[]),onFocusableItemRemove:s.useCallback(()=>P(f=>f-1),[]),children:F.jsx(D.div,{tabIndex:v||k===0?-1:0,"data-orientation":r,...b,ref:g,style:{outline:"none",...e.style},onMouseDown:R(e.onMouseDown,()=>{T.current=!0}),onFocus:R(e.onFocus,f=>{const L=!T.current;if(f.target===f.currentTarget&&L&&!v){const y=new CustomEvent(h,X);if(f.currentTarget.dispatchEvent(y),!y.defaultPrevented){const _=K().filter(x=>x.focusable),U=_.find(x=>x.active),B=_.find(x=>x.id===m),$=[U,B,..._].filter(Boolean).map(x=>x.ref.current);j($,C)}}T.current=!1}),onBlur:R(e.onBlur,()=>I(!1))})})}),O="RovingFocusGroupItem",M=s.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:d=!1,tabStopId:p,...u}=e,a=H(),i=p||a,c=oe(O,n),C=c.currentTabStopId===i,b=G(n),{onFocusableItemAdd:l,onFocusableItemRemove:g}=c;return s.useEffect(()=>{if(r)return l(),()=>g()},[r,l,g]),F.jsx(A.ItemSlot,{scope:n,id:i,focusable:r,active:d,children:F.jsx(D.span,{tabIndex:C?0:-1,"data-orientation":c.orientation,...u,ref:o,onMouseDown:R(e.onMouseDown,t=>{r?c.onItemFocus(i):t.preventDefault()}),onFocus:R(e.onFocus,()=>c.onItemFocus(i)),onKeyDown:R(e.onKeyDown,t=>{if(t.key==="Tab"&&t.shiftKey){c.onItemShiftTab();return}if(t.target!==t.currentTarget)return;const m=ce(t,c.orientation,c.dir);if(m!==void 0){if(t.metaKey||t.ctrlKey||t.altKey||t.shiftKey)return;t.preventDefault();let v=b().filter(I=>I.focusable).map(I=>I.ref.current);if(m==="last")v.reverse();else if(m==="prev"||m==="next"){m==="prev"&&v.reverse();const I=v.indexOf(t.currentTarget);v=c.loop?ue(v,I+1):v.slice(I+1)}setTimeout(()=>j(v))}})})})});M.displayName=O;var re={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function se(e,o){return o!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ce(e,o,n){const r=se(e.key,n);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return re[r]}function j(e,o=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:o}),document.activeElement!==n))return}function ue(e,o){return e.map((n,r)=>e[(o+r)%e.length])}var fe=N,de=M;export{de as I,fe as R,le as c};
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.