HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/design.system/node_modules/msw/lib/core/ws.js
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var ws_exports = {};
__export(ws_exports, {
  ws: () => ws
});
module.exports = __toCommonJS(ws_exports);
var import_outvariant = require("outvariant");
var import_WebSocketHandler = require("./handlers/WebSocketHandler.js");
var import_matchRequestUrl = require("./utils/matching/matchRequestUrl.js");
var import_WebSocketClientManager = require("./ws/WebSocketClientManager.js");
function isBroadcastChannelWithUnref(channel) {
  return typeof Reflect.get(channel, "unref") !== "undefined";
}
const webSocketChannel = new BroadcastChannel("msw:websocket-client-manager");
if (isBroadcastChannelWithUnref(webSocketChannel)) {
  webSocketChannel.unref();
}
function createWebSocketLinkHandler(url) {
  (0, import_outvariant.invariant)(url, "Expected a WebSocket server URL but got undefined");
  (0, import_outvariant.invariant)(
    (0, import_matchRequestUrl.isPath)(url),
    "Expected a WebSocket server URL to be a valid path but got %s",
    typeof url
  );
  const clientManager = new import_WebSocketClientManager.WebSocketClientManager(webSocketChannel);
  return {
    get clients() {
      return clientManager.clients;
    },
    addEventListener(event, listener) {
      const handler = new import_WebSocketHandler.WebSocketHandler(url);
      handler[import_WebSocketHandler.kEmitter].on("connection", async ({ client }) => {
        await clientManager.addConnection(client);
      });
      handler[import_WebSocketHandler.kEmitter].on(event, listener);
      return handler;
    },
    broadcast(data) {
      this.broadcastExcept([], data);
    },
    broadcastExcept(clients, data) {
      const ignoreClients = Array.prototype.concat(clients).map((client) => client.id);
      clientManager.clients.forEach((otherClient) => {
        if (!ignoreClients.includes(otherClient.id)) {
          otherClient.send(data);
        }
      });
    }
  };
}
const ws = {
  link: createWebSocketLinkHandler
};
//# sourceMappingURL=ws.js.map