{"version":3,"sources":["shadow_dom_selector.ts"],"sourcesContent":["export function querySelectorAll(selector:string, node:HTMLElement|Document = globalThis.document)  {\n    const nodes = [...node.querySelectorAll(selector)],\n        nodeIterator = document.createNodeIterator(node, Node.ELEMENT_NODE);\n    let currentNode;\n    while (currentNode = nodeIterator.nextNode()) {\n        if(currentNode.shadowRoot) {\n            nodes.push(...querySelectorAll(selector, currentNode.shadowRoot));\n        }\n    }\n    return nodes;\n}\n\nexport function querySelector(selector:string, node:HTMLElement|Document = globalThis.document):Node|null  {\n    const foundNode = node.querySelector(selector);\n    if (foundNode) return foundNode;\n    const nodeIterator = document.createNodeIterator(node, Node.ELEMENT_NODE);\n    let currentNode;\n    while (currentNode = nodeIterator.nextNode()) {\n        if (currentNode.shadowRoot) {\n            const innerNode = querySelector(selector, currentNode.shadowRoot)\n            if (innerNode) return innerNode;\n        }\n    }\n    return null;\n}"],"names":["querySelectorAll","selector","node","globalThis","document","currentNode","nodes","nodeIterator","createNodeIterator","Node","ELEMENT_NODE","nextNode","shadowRoot","push","querySelector","foundNode","innerNode"],"mappings":"AAAA,OAAO,SAASA,iBAAiBC,QAAe,EAAEC,OAA4BC,WAAWC,QAAQ;QAGzFC;IAFJ,IAAMC,QAAQ;WAAIJ,KAAKF,gBAAgB,CAACC;KAAU,EAC9CM,eAAeH,SAASI,kBAAkB,CAACN,MAAMO,KAAKC,YAAY;IAEtE,MAAOL,cAAcE,aAAaI,QAAQ,IACnCN,YAAYO,UAAU,IACrBN,MAAMO,IAAI,IAAIb,iBAAiBC,UAAUI,YAAYO,UAAU;IAGvE,OAAON;AACX;AAEA,OAAO,SAASQ,cAAcb,QAAe,EAAEC,OAA4BC,WAAWC,QAAQ;QAItFC;IAHJ,IAAMU,YAAYb,KAAKY,aAAa,CAACb;IACrC,IAAIc,WAAW,OAAOA;IACtB,IAAMR,eAAeH,SAASI,kBAAkB,CAACN,MAAMO,KAAKC,YAAY;IAExE,MAAOL,cAAcE,aAAaI,QAAQ,IACtC,IAAIN,YAAYO,UAAU,EAAE;QACxB,IAAMI,YAAYF,cAAcb,UAAUI,YAAYO,UAAU;QAChE,IAAII,WAAW,OAAOA;IAC1B;IAEJ,OAAO;AACX","sourceRoot":"/lib/uix-0.4.39/src/uix-dom/dom/","file":"shadow_dom_selector.ts"}