function e(e){const n=e.tagName.toLowerCase();return"-1"!==e.getAttribute("tabindex")&&(!e.hasAttribute("disabled")&&((!e.hasAttribute("aria-disabled")||"false"===e.getAttribute("aria-disabled"))&&(!("input"===n&&"radio"===e.getAttribute("type")&&!e.hasAttribute("checked"))&&(null!==e.offsetParent&&("hidden"!==window.getComputedStyle(e).visibility&&(!("audio"!==n&&"video"!==n||!e.hasAttribute("controls"))||(!!e.hasAttribute("tabindex")||(!(!e.hasAttribute("contenteditable")||"false"===e.getAttribute("contenteditable"))||["button","input","select","textarea","a","audio","video","summary"].includes(n)))))))))}function n(n){const t=[];!function e(n){n instanceof HTMLElement&&(t.push(n),null!==n.shadowRoot&&"open"===n.shadowRoot.mode&&e(n.shadowRoot)),[...n.children].forEach((n=>e(n)))}(n);return{start:t.find((n=>e(n)))??null,end:t.reverse().find((n=>e(n)))??null}}export{n as g};
