"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }

var _chunkMMUXNMJFcjs = require('./chunk-MMUXNMJF.cjs');

// src/client/log.ts
function logger() {
  return _chunkMMUXNMJFcjs.getLogger.call(void 0, "actor-client");
}

// src/common/websocket.ts
var webSocketPromise = null;
async function importWebSocket() {
  if (webSocketPromise !== null) {
    return webSocketPromise;
  }
  webSocketPromise = (async () => {
    let _WebSocket;
    if (typeof WebSocket !== "undefined") {
      _WebSocket = WebSocket;
    } else {
      try {
        const moduleName = "ws";
        const ws = await Promise.resolve().then(() => _interopRequireWildcard(require(
          /* webpackIgnore: true */
          moduleName
        )));
        _WebSocket = ws.default;
        logger().debug("using websocket from npm");
      } catch (e) {
        _WebSocket = class MockWebSocket {
          constructor() {
            throw new Error(
              'WebSocket support requires installing the "ws" peer dependency.'
            );
          }
        };
        logger().debug("using mock websocket");
      }
    }
    return _WebSocket;
  })();
  return webSocketPromise;
}




exports.logger = logger; exports.importWebSocket = importWebSocket;
//# sourceMappingURL=chunk-FUBHHHK5.cjs.map