1import{d as h,ao as N,az as P,aA as $,aq as D,a as F,bf as C,c as q,o as _,w as b,A as R,u,P as B,r as w,aL as V,e as T,ah as U,aH as j,aE as z}from"./Ces8kCBB.js";import{f as E,E as H,a as L,g as Y,w as J}from"./CPSO2RqD.js";const[Q,W]=N("RovingFocusGroup");var X=h({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(I,{expose:l,emit:o}){const i=I,d=o,{loop:g,orientation:p,dir:y}=P(i),v=$(y),e=D(i,"currentTabStopId",d,{defaultValue:i.defaultCurrentTabStopId,passive:i.currentTabStopId===void 0}),t=F(!1),a=F(!1),s=F(0),{getItems:S,CollectionSlot:K}=C({isProvider:!0});function x(r){const c=!a.value;if(r.currentTarget&&r.target===r.currentTarget&&c&&!t.value){const f=new CustomEvent(H,L);if(r.currentTarget.dispatchEvent(f),d("entryFocus",f),!f.defaultPrevented){const m=S().map(n=>n.ref).filter(n=>n.dataset.disabled!==""),O=m.find(n=>n.getAttribute("data-active")===""),k=m.find(n=>n.getAttribute("data-highlighted")===""),G=m.find(n=>
1n.id===e.value),M=[O,k,G,...m].filter(Boolean);E(M,i.preventScrollOnEntryFocus)}}a.value=!1}function A(){setTimeout(()=>{a.value=!1},1)}return l({getItems:S}),W({loop:g,dir:v,orientation:p,currentTabStopId:e,onItemFocus:r=>{e.value=r},onItemShiftTab:()=>{t.value=!0},onFocusableItemAdd:()=>{s.value++},onFocusableItemRemove:()=>{s.value--}}),(r,c)=>(_(),q(u(K),null,{default:b(()=>[R(u(B),{tabindex:t.value||s.value===0?-1:0,"data-orientation":u(p),as:r.as,"as-child":r.asChild,dir:u(v),style:{outline:"none"},onMousedown:c[0]||(c[0]=f=>a.value=!0),onMouseup:A,onFocus:x,onBlur:c[1]||(c[1]=f=>t.value=!1)},{default:b(()=>[w(r.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),ae=X,Z=h({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(I){const l=I,o=Q(),i=V(),d=T(()=>l.tabStopId||i),g=T(()=>o.currentTabStopId.value===d.value),{getItems:p,CollectionItem:y}=C();U(()=>{l.focusable&&o.onFocusableItemAdd()}),j(()=>{l.focusable&&o.onFocusableItemRemove()});function v(e){if(e.key==="Tab"&&e.shiftKey){o.onItemShiftTab();return}if(e.target!==e.currentTarget)return;const t=Y(e,o.orientation.value,o.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!l.allowShiftKey&&e.shiftKey)return;e.preventDefault();let a=[...p().map(s=>s.ref).filter(s=>s.dataset.disabled!=="")];if(t==="last")a.reverse();else if(t==="prev"||t==="next"){t==="prev"&&a.reverse();const s=a.indexOf(e.currentTarget);a=o.loop.value?J(a,s+1):a.slice(s+1)}z(()=>E(a))}}return(e,t)=>(_(),q(u(y),null,{default:b(()=>[R(u(B),{tabindex:g.value?0:-1,"data-orientation":u(o).orientation.value,"data-active":e.active?"":void 0,"data-disabled":e.focusable?void 0:"",as:e.as,"as-child":e.asChild,onMousedown:t[0]||(t[0]=a=>{e.focusable?u(o).onItemFocus(d.value):a.preventDefault()}),onFocus:t[1]||(t[1]=a=>u(o).onItemFocus(d.value)),onKeydown:v},{default:b(()=>[w(e.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),oe=Z;export{oe as R,ae as a};
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.