var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __reExport = (target, module2, desc) => {
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
    for (let key of __getOwnPropNames(module2))
      if (!__hasOwnProp.call(target, key) && key !== "default")
        __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
  }
  return target;
};
var __toModule = (module2) => {
  return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
};

// src/services/tunnels/local/ngrockChild.ts
var ngrok = __toModule(require("ngrok"));
var import_debug = __toModule(require("debug"));
var debug = (0, import_debug.default)("@interceptor:tunnel:ngrokChild");
var port = parseInt(process.argv[2]);
debug(`Request open port ${port}`);
ngrok.connect(port).then((url) => {
  debug("connected", url);
  process.send({ url });
}).catch((err) => debug("ERROR", err));
process.on("SIGTERM", async () => {
  debug("ngrok disconnecting");
  await ngrok.disconnect();
  debug("ngrok disconnected");
  process.exit(0);
});
