PageSourceSearch

https://nextthere.com/assets/calculate-active-index-Bo9BYas1.js

js nextthere.com collected 2026-09-24 19:05:05 UTC 6,249 bytes, 1 lines download raw bytes

1import{o as g,u as S}from"./keyboard-C910qfwt.js";import{E as I,J as N,c as A,r as x}from"./index-DbpIxVVg.js";var M=Object.defineProperty,O=(e,t,n)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t,n)=>(O(e,typeof t!="symbol"?t+"":t,n),n);class T{constructor(){p(this,"current",this.detect()),p(this,"currentId",0)}set(t){this.current!==t&&(this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}}let E=new T;function y(e){if(E.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let t=g(e);if(t)return t.ownerDocument}return document}let w=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var D=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(D||{}),$=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))($||{}),_=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(_||{});function F(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(w)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var L=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(L||{});function P(e,t=0){var n;return e===((n=y(e))==null?void 0:n.body)?!1:S(t,{0(){return e.matches(w)},1(){let u=e;for(;u!==null;){if(u.matches(w))return!0;u=u.parentElement}return!1}})}function z(e){let t=y(e);I(()=>{t&&!P(t.activeElement,0)&&K(e)})}var k=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(k||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function K(e){e==null||e.focus({preventScroll:!0})}let U=["textarea","input"].join(",");function j(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,U))!=null?n:!1}function C(e,t=n=>n){return e.slice().sort((n,u)=>{let i=t(n),r=t(u);if(i===null||r===null)return 0;let l=i.compareDocumentPosition(r);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function B(e,t){return G(F(),t,{relativeTo:e})}function G(e,t,{sorted:n=!0,relativeTo:u=null,skipElements:i=[]}={}){var r;let l=(r=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e==null?void 0:e.ownerDocument)!=null?r:document,o=Array.isArray(e)?n?C(e):e:F(e);i.length>0&&o.length>1&&(o=o.filter(c=>!i.includes(c))),u=u??l.activeElement;let h=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(u))-1;if(t&4)return Math.max(0,o.indexOf(u))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=t&32?{preventScroll:!0}:{},v=0,f=o.length,d;do{if(v>=f||v+f<=0)return 0;let c=a+v;if(t&16)c=(c+f)%f;else{if(c<0)return 3;if(c>=f)return 1}d=o[c],d==null||d.focus(s),v+=h}while(d!==l.activeElement);return t&6&&j(d)&&d.select(),2}function H(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function R(){return/Android/gi.test(window.navigator.userAgent)}function V(){return H()||R()}function m(e,t,n){E.isServer||N(u=>{document.addEventListener(e,t,n),u(()=>document.removeEventListener(e,t,n))})}function W(e,t,n){E.isServer||N(u=>{window.addEventListener(e,t,n),u(()=>window.removeEventListener(e,t,n))})}function Q(e,t,n=A(()=>!0)){function u(r,l){if(!n.value||r.defaultPrevented)return;let o=l(r);if(o===null||!o.getRootNode().contains(o))return;let h=function a(s){return typeof s=="function"?a(s()):Array.isArray(s)||s instanceof Set?s:[s]}(e);
1for(let a of h){if(a===null)continue;let s=a instanceof HTMLElement?a:g(a);if(s!=null&&s.contains(o)||r.composed&&r.composedPath().includes(s))return}return!P(o,L.Loose)&&o.tabIndex!==-1&&r.preventDefault(),t(r,o)}let i=x(null);m("pointerdown",r=>{var l,o;n.value&&(i.value=((o=(l=r.composedPath)==null?void 0:l.call(r))==null?void 0:o[0])||r.target)},!0),m("mousedown",r=>{var l,o;n.value&&(i.value=((o=(l=r.composedPath)==null?void 0:l.call(r))==null?void 0:o[0])||r.target)},!0),m("click",r=>{V()||i.value&&(u(r,()=>i.value),i.value=null)},!0),m("touchend",r=>u(r,()=>r.target instanceof HTMLElement?r.target:null),!0),W("blur",r=>u(r,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function b(e){return[e.screenX,e.screenY]}function Z(){let e=x([-1,-1]);return{wasMoved(t){let n=b(t);return e.value[0]===n[0]&&e.value[1]===n[1]?!1:(e.value=n,!0)},update(t){e.value=b(t)}}}function X(e){throw new Error("Unexpected object: "+e)}var q=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(q||{});function ee(e,t){let n=t.resolveItems();if(n.length<=0)return null;let u=t.resolveActiveIndex(),i=u??-1;switch(e.focus){case 0:{for(let r=0;r<n.length;++r)if(!t.resolveDisabled(n[r],r,n))return r;return u}case 1:{i===-1&&(i=n.length);for(let r=i-1;r>=0;--r)if(!t.resolveDisabled(n[r],r,n))return r;return u}case 2:{for(let r=i+1;r<n.length;++r)if(!t.resolveDisabled(n[r],r,n))return r;return u}case 3:{for(let r=n.length-1;r>=0;--r)if(!t.resolveDisabled(n[r],r,n))return r;return u}case 4:{for(let r=0;r<n.length;++r)if(t.resolveId(n[r],r,n)===e.id)return r;return u}case 5:return null;default:X(e)}}export{D as N,C as O,G as P,K as S,$ as T,z as _,P as a,E as b,q as c,W as d,ee as f,L as h,y as i,V as n,H as t,Z as u,B as v,Q as w};

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.