{"version":3,"names":["activeElement","doc","element","shadowRoot"],"sources":["active-element.ts"],"sourcesContent":["/**\n * Shadow-DOM-safe `document.activeElement`.\n *\n * When focus lives inside a shadow tree, `document.activeElement` reports\n * the shadow host; to reach the actual focused element you must descend\n * through each nested `shadowRoot.activeElement`.\n */\nexport function activeElement(doc: Document): Element | null {\n\tlet element = doc.activeElement;\n\n\twhile (element?.shadowRoot?.activeElement != null) {\n\t\telement = element.shadowRoot.activeElement;\n\t}\n\n\treturn element;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAACC,GAAa,EAAkB;EAC5D,IAAIC,OAAO,GAAGD,GAAG,CAACD,aAAa;EAE/B,OAAOE,OAAO,EAAEC,UAAU,EAAEH,aAAa,IAAI,IAAI,EAAE;IAClDE,OAAO,GAAGA,OAAO,CAACC,UAAU,CAACH,aAAa;EAC3C;EAEA,OAAOE,OAAO;AACf","ignoreList":[]}