const EVENTS_KEY = "__shooter_ws_events_clients";
const eventsClients = globalThis[EVENTS_KEY] || /* @__PURE__ */ new Set();
globalThis[EVENTS_KEY] = eventsClients;
function broadcastEvent(event) {
  const data = JSON.stringify({
    ...event,
    timestamp: (/* @__PURE__ */ new Date()).toISOString()
  });
  for (const ws of eventsClients) {
    if (ws.readyState === 1) {
      ws.send(data);
    }
  }
}
function getEventsClientCount() {
  return eventsClients.size;
}

export { broadcastEvent as b, getEventsClientCount as g };
//# sourceMappingURL=events-handler-Dm1mNPQP.js.map
