import{correctNodes as i}from"./utils/correctFocus.js";import{pickFocusable as t}from"./utils/firstFocus.js";import{isGuard as r}from"./utils/is.js";var f="NEW_FOCUS",s=function(f,s,e,n){var o=f.length,a=f[0],O=f[o-1],d=r(e);if(!(f.indexOf(e)>=0)){var x=s.indexOf(e),u=n?s.indexOf(n):x,m=n?f.indexOf(n):-1,c=x-u,h=s.indexOf(a),b=s.indexOf(O),l=i(s),p=l.indexOf(e)-(n?l.indexOf(n):x),v=t(f,0),F=t(f,o-1);return-1===x||-1===m?"NEW_FOCUS":!c&&m>=0?m:x<=h&&d&&Math.abs(c)>1?F:x>=b&&d&&Math.abs(c)>1?v:c&&Math.abs(p)>1?m:x<=h?F:x>b?v:c?Math.abs(c)>1?m:(o+m+c)%o:void 0}};export{f as NEW_FOCUS,s as newFocus};
//# sourceMappingURL=solver.js.map
