const candidateSelectors = [ 'input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])', 'details>summary:first-of-type', 'details', ]; const candidateSelector = /* #__PURE__ */ candidateSelectors.join(','); const matches = typeof Element === 'undefined' ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; const getCandidates = function (el, includeContainer, filter) { let candidates = Array.prototype.slice.apply( el.querySelectorAll(candidateSelector) ); if (includeContainer && matches.call(el, candidateSelector)) { candidates.unshift(el); } candidates = candidates.filter(filter); return candidates; }; const isContentEditable = function (node) { return node.contentEditable === 'true'; }; const getTabindex = function (node) { const tabindexAttr = parseInt(node.getAttribute('tabindex'), 10); if (!isNaN(tabindexAttr)) { return tabindexAttr; } // Browsers do not return `tabIndex` correctly for contentEditable nodes; // so if they don't have a tabindex attribute specifically set, assume it's 0. if (isContentEditable(node)) { return 0; } // in Chrome,
,