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 version_exports = {};
__export(version_exports, {
  APP_AUTH_MODE_VALUES: () => APP_AUTH_MODE_VALUES,
  APP_CONTROLLER_MODE_VALUES: () => APP_CONTROLLER_MODE_VALUES,
  APP_HOSTING_MODE_VALUES: () => APP_HOSTING_MODE_VALUES,
  APP_UPLOAD_INIT_STATUS_VALUES: () => APP_UPLOAD_INIT_STATUS_VALUES,
  APP_UPLOAD_LAUNCH_CHECK_STATUS_VALUES: () => APP_UPLOAD_LAUNCH_CHECK_STATUS_VALUES,
  APP_UPLOAD_SESSION_STATUS_VALUES: () => APP_UPLOAD_SESSION_STATUS_VALUES,
  APP_VERSION_VISIBILITY_VALUES: () => APP_VERSION_VISIBILITY_VALUES,
  DEFAULT_APP_AUTH_MODE: () => DEFAULT_APP_AUTH_MODE,
  DEFAULT_APP_CONTROLLER_MODE: () => DEFAULT_APP_CONTROLLER_MODE,
  DEFAULT_APP_HOSTING_MODE: () => DEFAULT_APP_HOSTING_MODE,
  DEFAULT_APP_PREVIEWABLE: () => DEFAULT_APP_PREVIEWABLE,
  DEFAULT_APP_VERSION_VISIBILITY: () => DEFAULT_APP_VERSION_VISIBILITY,
  REVIEW_STATE_VALUES: () => REVIEW_STATE_VALUES,
  SEMVER_REGEX: () => SEMVER_REGEX,
  compareVersions: () => compareVersions,
  formatVersion: () => formatVersion,
  isAppAuthMode: () => isAppAuthMode,
  isAppControllerMode: () => isAppControllerMode,
  isAppHostingMode: () => isAppHostingMode,
  isAppVersionVisibility: () => isAppVersionVisibility,
  isReviewState: () => isReviewState,
  isValidVersion: () => isValidVersion,
  parseAppAuthMode: () => parseAppAuthMode,
  parseAppControllerMode: () => parseAppControllerMode,
  parseAppHostingMode: () => parseAppHostingMode,
  parseAppVersionVisibility: () => parseAppVersionVisibility,
  parseReviewState: () => parseReviewState,
  parseVersion: () => parseVersion
});
module.exports = __toCommonJS(version_exports);
const APP_HOSTING_MODE_VALUES = ["HOSTED", "EXTERNAL"];
const DEFAULT_APP_HOSTING_MODE = "HOSTED";
function isAppHostingMode(value) {
  if (typeof value !== "string") {
    return false;
  }
  return APP_HOSTING_MODE_VALUES.includes(value.trim().toUpperCase());
}
function parseAppHostingMode(value) {
  if (typeof value !== "string") {
    return null;
  }
  const normalized = value.trim().toUpperCase();
  return isAppHostingMode(normalized) ? normalized : null;
}
const APP_VERSION_VISIBILITY_VALUES = ["PRIVATE", "PUBLIC"];
const DEFAULT_APP_VERSION_VISIBILITY = "PUBLIC";
function isAppVersionVisibility(value) {
  if (typeof value !== "string") {
    return false;
  }
  return APP_VERSION_VISIBILITY_VALUES.includes(value.trim().toUpperCase());
}
function parseAppVersionVisibility(value) {
  if (typeof value !== "string") {
    return null;
  }
  const normalized = value.trim().toUpperCase();
  return isAppVersionVisibility(normalized) ? normalized : null;
}
const REVIEW_STATE_VALUES = [
  "NOT_REQUIRED",
  "QUEUED",
  "RUNNING",
  "SUPERSEDED",
  "LOW_QUALITY",
  "PASSED",
  "GOOD",
  "EXCELLENT",
  "FAILED",
  "ERROR"
];
function isReviewState(value) {
  if (typeof value !== "string") {
    return false;
  }
  return REVIEW_STATE_VALUES.includes(value.trim().toUpperCase());
}
function parseReviewState(value) {
  if (typeof value !== "string") {
    return null;
  }
  const normalized = value.trim().toUpperCase();
  return isReviewState(normalized) ? normalized : null;
}
const APP_AUTH_MODE_VALUES = ["REQUIRED", "OPTIONAL", "NONE"];
const DEFAULT_APP_AUTH_MODE = "REQUIRED";
function isAppAuthMode(value) {
  if (typeof value !== "string") {
    return false;
  }
  return APP_AUTH_MODE_VALUES.includes(value.trim().toUpperCase());
}
function parseAppAuthMode(value) {
  if (typeof value !== "string") {
    return null;
  }
  const normalized = value.trim().toUpperCase();
  return isAppAuthMode(normalized) ? normalized : null;
}
const APP_CONTROLLER_MODE_VALUES = ["UNSUPPORTED", "SUPPORTED", "REQUIRED"];
const DEFAULT_APP_CONTROLLER_MODE = "UNSUPPORTED";
function isAppControllerMode(value) {
  if (typeof value !== "string") {
    return false;
  }
  return APP_CONTROLLER_MODE_VALUES.includes(value.trim().toUpperCase());
}
function parseAppControllerMode(value) {
  if (typeof value !== "string") {
    return null;
  }
  const normalized = value.trim().toUpperCase();
  return isAppControllerMode(normalized) ? normalized : null;
}
const DEFAULT_APP_PREVIEWABLE = false;
const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
function formatVersion(v) {
  return `${v.major}.${v.minor}.${v.patch}`;
}
function parseVersion(s) {
  const match = s.match(SEMVER_REGEX);
  if (!match)
    return null;
  const [, major, minor, patch] = match;
  if (!major || !minor || !patch) {
    return null;
  }
  return {
    major: parseInt(major, 10),
    minor: parseInt(minor, 10),
    patch: parseInt(patch, 10)
  };
}
function isValidVersion(s) {
  return SEMVER_REGEX.test(s);
}
function compareVersions(a, b) {
  if (a.major !== b.major)
    return a.major - b.major;
  if (a.minor !== b.minor)
    return a.minor - b.minor;
  return a.patch - b.patch;
}
const APP_UPLOAD_SESSION_STATUS_VALUES = ["OPEN", "FINALIZED", "ABORTED", "EXPIRED"];
const APP_UPLOAD_INIT_STATUS_VALUES = ["created", "resume", "finalized"];
const APP_UPLOAD_LAUNCH_CHECK_STATUS_VALUES = ["NOT_RUN", "PASSED", "FAILED"];
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  APP_AUTH_MODE_VALUES,
  APP_CONTROLLER_MODE_VALUES,
  APP_HOSTING_MODE_VALUES,
  APP_UPLOAD_INIT_STATUS_VALUES,
  APP_UPLOAD_LAUNCH_CHECK_STATUS_VALUES,
  APP_UPLOAD_SESSION_STATUS_VALUES,
  APP_VERSION_VISIBILITY_VALUES,
  DEFAULT_APP_AUTH_MODE,
  DEFAULT_APP_CONTROLLER_MODE,
  DEFAULT_APP_HOSTING_MODE,
  DEFAULT_APP_PREVIEWABLE,
  DEFAULT_APP_VERSION_VISIBILITY,
  REVIEW_STATE_VALUES,
  SEMVER_REGEX,
  compareVersions,
  formatVersion,
  isAppAuthMode,
  isAppControllerMode,
  isAppHostingMode,
  isAppVersionVisibility,
  isReviewState,
  isValidVersion,
  parseAppAuthMode,
  parseAppControllerMode,
  parseAppHostingMode,
  parseAppVersionVisibility,
  parseReviewState,
  parseVersion
});
