import{delegatedEvents as e,handlers as t}from"../internal-state.mjs";const r=r=>{e.has(r)||(document.addEventListener(r,(e=>{for(var r=e.target,a=t.get(e.target);r&&(!a||!a.some((t=>t.eventName==e.type)));r=r.parentNode,a=t.get(r));return(a||[]).filter((t=>t.handler&&t.eventName==e.type)).map((t=>t.handler(e,r)||!0)).reduce(((e,t)=>e&&t),!0)}),{capture:!0}),e.add(r))};export{r as delegateEvent};
//# sourceMappingURL=event-delegation.mjs.map
