1import{t as e}from"./CCKzoQOE2.js";import{d as t,f as n,i as r,l as i,n as a,r as o,t as s}from"./Dyi3vQE62.js";import{a as c}from"./hdrIdrB62.js";function l(e){return window.getComputedStyle(e).getPropertyValue(`direction`)}var u=[s,n,i],d=[r,t,`End`];[...u,...d];function f(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?a:o,vertical:s}[t]}function p(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?o:a,vertical:r}[t]}function m(e=`ltr`,t=`horizontal`){return[`ltr`,`rtl`].includes(e)||(e=`ltr`),[`horizontal`,`vertical`].includes(t)||(t=`horizontal`),{nextKey:f(e,t),prevKey:p(e,t)}}var h=class{#e;#t=e(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){let e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,n=!1){let c=this.#e.rootNode.current;if(!c||!e)return;let u=this.getCandidateNodes();if(!u.length)return;let d=u.indexOf(e),{nextKey:f,prevKey:p}=m(l(c),this.#e.orientation.current),h=this.#e.loop.current,g={[f]:d+1,[p]:d-1,[i]:0,End:u.length-1};if(n){let e=f===`ArrowDown`?o:s,t=p===`ArrowUp`?a:r;g[e]=d+1,g[t]=d-1}let _=g[t.key];if(_===void 0)return;t.preventDefault(),_<0&&h?_=u.length-1:_===u.length&&h&&(_=0);let v=u[_];if(v)return v.focus(),this.#t.current=v.id,this.#e.onCandidateFocus?.(v),v}getTabIndex(e){let t=this.getCandidateNodes(),n=this.#t.current!==null;return e&&!n&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}focusCurrentTabStop(){let e=this.#t.current;if(!e)return;let t=this.#e.rootNode.current?.querySelector(`#${e}`);!t||!c(t)||t.focus()}};export{h 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.