var _a;let supportsEventOptions=(()=>{let e=!1,t=!1,n={get capture(){return e=!0,!0},get once(){return t=!0,!0}},i=0,r=()=>{i++},l=document.createElement("div");l.addEventListener("click",r,n);let a=e&&t;return a&&(l.dispatchEvent(new Event("click")),l.dispatchEvent(new Event("click")),a=1==i),l.removeEventListener("click",r,n),a})(),nativeEventTarget=null!=(_a=window.EventTarget)?_a:window.Node;if(!supportsEventOptions&&"addEventListener"in nativeEventTarget.prototype){let e=e=>{let t,n;return e&&("object"==typeof e||"function"==typeof e)?(t=!!e.capture,n=!!e.once):(t=!!e,n=!1),{capture:t,once:n}},t=nativeEventTarget.prototype.addEventListener,n=nativeEventTarget.prototype.removeEventListener,i=new WeakMap,r=new WeakMap,l=(e,t,n)=>{let l=n?i:r,a=l.get(e);void 0===a&&l.set(e,a=new Map);let o=a.get(t);return void 0===o&&a.set(t,o=new WeakMap),o};nativeEventTarget.prototype.addEventListener=function(i,r,a){if(null==r)return;let{capture:o,once:v}=e(a),p=l(this,i,o);if(!p.has(r)){let e=v?t=>(p.delete(r),n.call(this,i,e,o),"function"==typeof r)?r.call(this,t):"function"==typeof(null==r?void 0:r.handleEvent)?r.handleEvent(t):void 0:null;p.set(r,e),t.call(this,i,null!=e?e:r,o)}},nativeEventTarget.prototype.removeEventListener=function(t,i,r){if(null==i)return;let{capture:a}=e(r),o=l(this,t,a),v=o.get(i);void 0!==v&&(o.delete(i),n.call(this,t,null!=v?v:i,a))}}export{};