import{S as L,T as p,U as v,V as S,W as T,X as k,B,C as M,Y as W}from"./BZ0BXH4m.js";const q=new Set,x=new Set;function O(r,a,i,n={}){function e(t){if(n.capture||C.call(a,t),!t.cancelBubble)return W(()=>i?.call(this,t))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?M(()=>{a.addEventListener(r,e,n)}):a.addEventListener(r,e,n),e}function H(r,a,i,n,e){var t={capture:n,passive:e},l=O(r,a,i,t);(a===document.body||a===window||a===document||a instanceof HTMLMediaElement)&&B(()=>{a.removeEventListener(r,l,t)})}function N(r){for(var a=0;a<r.length;a++)q.add(r[a]);for(var i of x)i(r)}let g=null;function C(r){var a=this,i=a.ownerDocument,n=r.type,e=r.composedPath?.()||[],t=e[0]||r.target;g=r;var l=0,_=g===r&&r.__root;if(_){var u=e.indexOf(_);if(u!==-1&&(a===document||a===window)){r.__root=a;return}var d=e.indexOf(a);if(d===-1)return;u<=d&&(l=u)}if(t=e[l]||r.target,t!==a){L(r,"currentTarget",{configurable:!0,get(){return t||i}});var w=T,b=k;p(null),v(null);try{for(var c,h=[];t!==null;){var f=t.assignedSlot||t.parentNode||t.host||null;try{var o=t["__"+n];if(o!=null&&(!t.disabled||r.target===t))if(S(o)){var[y,...E]=o;y.apply(t,[r,...E])}else o.call(t,r)}catch(s){c?h.push(s):c=s}if(r.cancelBubble||f===a||f===null)break;t=f}if(c){for(let s of h)queueMicrotask(()=>{throw s});throw c}}finally{r.__root=a,delete r.currentTarget,p(w),v(b)}}}export{q as a,N as d,H as e,C as h,x as r};
