(function(){try{var g=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};g["__faroBundleId_Speechify Chrome Extension"]="13.4.1"}catch(l){}})();
import{a as c,f as E,h as f}from"./chunk-XBE3KAOI.js";function x({events:i}){let n=Object.fromEntries(i.map(e=>[e,[]]));function o(e,t){if(!i.includes(e))throw new Error(`Invalid event "${String(e)}" provided`);return Array.isArray(n[e])||(n[e]=[]),n[e]?.push(t),()=>r(e,t)}function r(e,t){if(!Array.isArray(n[e]))return;let s=n[e].indexOf(t);s>-1&&n[e].splice(s,1)}async function y(e,t){if(!Array.isArray(n[e]))return;let s=Array.from(n[e]);for(let v of s)await Promise.resolve(v(t)).catch(console.error)}function T(e,t){return o(e,function s(v){r(e,s),t(v)})}function d(){for(let e of Object.keys(n))n[e]=[]}return{on:o,off:r,emit:y,once:T,addEventListener:o,removeEventListener:r,removeAllListeners:d}}var a=c(()=>{"use strict";E();f()});export{x as a,a as b};
//# sourceMappingURL=chunk-6TGE2B2H.js.map
