const i='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',c=t=>getComputedStyle(t).position==="fixed"?!1:t.offsetParent!==null,d=t=>Array.from(t.querySelectorAll(i)).filter(e=>u(e)&&c(e)),u=t=>{if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.disabled)return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return!(t.type==="hidden"||t.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},l=function(t,e,...o){let n;e.includes("mouse")||e.includes("click")?n="MouseEvents":e.includes("key")?n="KeyboardEvent":n="HTMLEvents";const s=document.createEvent(n);return s.initEvent(e,...o),t.dispatchEvent(s),t},a=t=>!t.getAttribute("aria-owns"),f=(t,e,o)=>{const{parentNode:n}=t;if(!n)return null;const s=n.querySelectorAll(o),r=Array.prototype.indexOf.call(s,t);return s[r+e]||null},b=t=>{t&&(t.focus(),!a(t)&&t.click())};export{b as f,f as g,a as i,d as o,l as t};
