const eventBus = new class {
	events = {};
	on(e, t) {
		return this.events[e] || (this.events[e] = []), this.events[e].push(t), () => {
			this.events[e] = this.events[e].filter((e) => e !== t);
		};
	}
	emit(e, ...t) {
		this.events[e] && this.events[e].forEach((e) => e(...t));
	}
}();
export { eventBus };
