"use strict";
/* Socket Lib - Built with esbuild */
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 node_exports = {};
__export(node_exports, {
  ESNEXT: () => ESNEXT,
  NODE_SEA_FUSE: () => NODE_SEA_FUSE,
  getExecPath: () => getExecPath,
  getMaintainedNodeVersions: () => getMaintainedNodeVersions,
  getNodeDisableSigusr1Flags: () => getNodeDisableSigusr1Flags,
  getNodeHardenFlags: () => getNodeHardenFlags,
  getNodeMajorVersion: () => getNodeMajorVersion,
  getNodeMinorVersion: () => getNodeMinorVersion,
  getNodeNoWarningsFlags: () => getNodeNoWarningsFlags,
  getNodePatchVersion: () => getNodePatchVersion,
  getNodePermissionFlags: () => getNodePermissionFlags,
  getNodeVersion: () => getNodeVersion,
  supportsNodeCompileCacheApi: () => supportsNodeCompileCacheApi,
  supportsNodeCompileCacheEnvVar: () => supportsNodeCompileCacheEnvVar,
  supportsNodeDisableSigusr1Flag: () => supportsNodeDisableSigusr1Flag,
  supportsNodeDisableWarningFlag: () => supportsNodeDisableWarningFlag,
  supportsNodePermissionFlag: () => supportsNodePermissionFlag,
  supportsNodeRequireModule: () => supportsNodeRequireModule,
  supportsNodeRun: () => supportsNodeRun,
  supportsProcessSend: () => supportsProcessSend
});
module.exports = __toCommonJS(node_exports);
var import_maintained_node_versions = require("../maintained-node-versions");
const NODE_VERSION = process.version;
function getNodeVersion() {
  return NODE_VERSION;
}
function getNodeMajorVersion() {
  return Number.parseInt(NODE_VERSION.slice(1).split(".")[0] ?? "0", 10);
}
function getNodeMinorVersion() {
  return Number.parseInt(NODE_VERSION.split(".")[1] ?? "0", 10);
}
function getNodePatchVersion() {
  return Number.parseInt(NODE_VERSION.split(".")[2] ?? "0", 10);
}
function getMaintainedNodeVersions() {
  return import_maintained_node_versions.maintainedNodeVersions;
}
function supportsNodeCompileCacheApi() {
  const major = getNodeMajorVersion();
  return major >= 24;
}
function supportsNodeCompileCacheEnvVar() {
  const major = getNodeMajorVersion();
  return major >= 22;
}
function supportsNodeDisableWarningFlag() {
  const major = getNodeMajorVersion();
  return major >= 21;
}
function supportsNodePermissionFlag() {
  const major = getNodeMajorVersion();
  return major >= 20;
}
function supportsNodeRequireModule() {
  const major = getNodeMajorVersion();
  return major >= 23 || major === 22 && getNodeMinorVersion() >= 12;
}
function supportsNodeRun() {
  const major = getNodeMajorVersion();
  return major >= 23 || major === 22 && getNodeMinorVersion() >= 11;
}
function supportsNodeDisableSigusr1Flag() {
  const major = getNodeMajorVersion();
  const minor = getNodeMinorVersion();
  if (major >= 24) {
    return minor >= 8;
  }
  if (major === 23) {
    return minor >= 7;
  }
  if (major === 22) {
    return minor >= 14;
  }
  return false;
}
let _nodeDisableSigusr1Flags;
function getNodeDisableSigusr1Flags() {
  if (_nodeDisableSigusr1Flags === void 0) {
    _nodeDisableSigusr1Flags = supportsNodeDisableSigusr1Flag() ? ["--disable-sigusr1"] : ["--no-inspect"];
  }
  return _nodeDisableSigusr1Flags;
}
function supportsProcessSend() {
  return typeof process.send === "function";
}
let _nodeHardenFlags;
let _nodePermissionFlags;
function getNodePermissionFlags() {
  if (_nodePermissionFlags === void 0) {
    const major = getNodeMajorVersion();
    if (major >= 24) {
      _nodePermissionFlags = [
        // Allow reading from the entire filesystem (npm needs to read package.json, node_modules, etc.).
        "--allow-fs-read=*",
        // Allow writing to the entire filesystem (npm needs to write to node_modules, cache, etc.).
        "--allow-fs-write=*",
        // Allow spawning child processes (npm needs to run lifecycle scripts, git, etc.).
        "--allow-child-process"
      ];
    } else {
      _nodePermissionFlags = [];
    }
  }
  return _nodePermissionFlags;
}
function getNodeHardenFlags() {
  if (_nodeHardenFlags === void 0) {
    const major = getNodeMajorVersion();
    const flags = ["--disable-proto=delete"];
    if (major >= 24) {
      flags.push("--permission");
      flags.push(...getNodePermissionFlags());
    } else if (major >= 20) {
      flags.push("--experimental-permission");
    }
    if (major >= 22) {
      flags.push("--force-node-api-uncaught-exceptions-policy");
    }
    _nodeHardenFlags = flags;
  }
  return _nodeHardenFlags;
}
let _nodeNoWarningsFlags;
function getNodeNoWarningsFlags() {
  if (_nodeNoWarningsFlags === void 0) {
    _nodeNoWarningsFlags = ["--no-warnings", "--no-deprecation"];
  }
  return _nodeNoWarningsFlags;
}
function getExecPath() {
  return process.execPath;
}
const NODE_SEA_FUSE = "NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2";
const ESNEXT = "esnext";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ESNEXT,
  NODE_SEA_FUSE,
  getExecPath,
  getMaintainedNodeVersions,
  getNodeDisableSigusr1Flags,
  getNodeHardenFlags,
  getNodeMajorVersion,
  getNodeMinorVersion,
  getNodeNoWarningsFlags,
  getNodePatchVersion,
  getNodePermissionFlags,
  getNodeVersion,
  supportsNodeCompileCacheApi,
  supportsNodeCompileCacheEnvVar,
  supportsNodeDisableSigusr1Flag,
  supportsNodeDisableWarningFlag,
  supportsNodePermissionFlag,
  supportsNodeRequireModule,
  supportsNodeRun,
  supportsProcessSend
});
