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 asset_exports = {};
__export(asset_exports, {
  ASSET_BROWSE_KIND_VALUES: () => ASSET_BROWSE_KIND_VALUES,
  ASSET_CATEGORY_VALUES: () => ASSET_CATEGORY_VALUES,
  ASSET_FORMAT_VALUES: () => ASSET_FORMAT_VALUES,
  ASSET_LIST_SORT_VALUES: () => ASSET_LIST_SORT_VALUES,
  ASSET_SOURCE_KIND_VALUES: () => ASSET_SOURCE_KIND_VALUES,
  ASSET_SUBCATEGORIES_BY_CATEGORY: () => ASSET_SUBCATEGORIES_BY_CATEGORY,
  ASSET_SUBCATEGORY_DEFINITIONS: () => ASSET_SUBCATEGORY_DEFINITIONS,
  ASSET_SUBCATEGORY_DEFINITIONS_BY_KEY: () => ASSET_SUBCATEGORY_DEFINITIONS_BY_KEY,
  ASSET_SUBCATEGORY_SLUG_REGEX: () => ASSET_SUBCATEGORY_SLUG_REGEX,
  ASSET_VISIBILITY_VALUES: () => ASSET_VISIBILITY_VALUES,
  MODEL_3D_ASSET_SUBCATEGORY_VALUES: () => MODEL_3D_ASSET_SUBCATEGORY_VALUES,
  PLAYDROP_SPEECH_MAX_WORDS: () => PLAYDROP_SPEECH_MAX_WORDS,
  PLAYDROP_SPEECH_VOICE_IDS: () => PLAYDROP_SPEECH_VOICE_IDS,
  countSpeechWords: () => countSpeechWords,
  getAssetSubcategoryDefinition: () => getAssetSubcategoryDefinition,
  getBoxelManifestRole: () => getBoxelManifestRole,
  getRequiredModel3DFileRoles: () => getRequiredModel3DFileRoles,
  isAssetCategory: () => isAssetCategory,
  isAssetFormat: () => isAssetFormat,
  isAssetSourceKind: () => isAssetSourceKind,
  isAssetVisibility: () => isAssetVisibility,
  isBoxelAssetFormat: () => isBoxelAssetFormat,
  isKnownAssetSubcategory: () => isKnownAssetSubcategory,
  isModel3DAssetSubcategory: () => isModel3DAssetSubcategory,
  isValidAssetSubcategorySlug: () => isValidAssetSubcategorySlug,
  isVoxAssetFormat: () => isVoxAssetFormat,
  normalizeAssetSubcategory: () => normalizeAssetSubcategory,
  normalizeSpeechText: () => normalizeSpeechText
});
module.exports = __toCommonJS(asset_exports);
const ASSET_CATEGORY_VALUES = ["IMAGE", "VIDEO", "AUDIO", "SPRITESHEET", "MODEL_3D", "CUSTOM"];
const ASSET_BROWSE_KIND_VALUES = ["images", "music", "sfx", "speech", "videos", "3d"];
const ASSET_FORMAT_VALUES = [
  "PNG",
  "JPEG",
  "WEBP",
  "GIF",
  "ASEPRITE",
  "MP4",
  "WEBM",
  "MP3",
  "WAV",
  "OGG",
  "GLTF",
  "GLB",
  "PLAYDROP_BOXEL_JSON",
  "VOX",
  "CUSTOM"
];
const ASSET_VISIBILITY_VALUES = ["PRIVATE", "PUBLIC"];
const ASSET_SOURCE_KIND_VALUES = ["UPLOAD", "AI", "APP_EMBEDDED", "IMPORT"];
const PLAYDROP_SPEECH_MAX_WORDS = 40;
const PLAYDROP_SPEECH_VOICE_IDS = [
  "default_narrator",
  "warm_storyteller_m",
  "neutral_guide",
  "confident_guide_f",
  "casual_companion_m",
  "atmospheric_storyteller_f",
  "energetic_host_m",
  "bright_creator_f"
];
function normalizeSpeechText(input) {
  return input.trim();
}
function countSpeechWords(input) {
  const normalized = normalizeSpeechText(input);
  return normalized.match(/\S+/g)?.length ?? 0;
}
const MODEL_3D_FORMATS = ["GLB", "GLTF", "PLAYDROP_BOXEL_JSON", "VOX"];
const BOXEL_REQUIRED_FILE_ROLES = ["primary", "mesh", "preview"];
const VOX_REQUIRED_FILE_ROLES = ["primary", "boxel", "mesh", "preview"];
const GLTF_REQUIRED_FILE_ROLES = ["primary"];
const ASSET_SUBCATEGORY_DEFINITIONS = [
  { category: "IMAGE", subcategory: "generic", formats: ["PNG", "JPEG", "WEBP", "GIF"], label: "Image" },
  { category: "SPRITESHEET", subcategory: "generic", formats: ["ASEPRITE", "PNG"], label: "Spritesheet" },
  { category: "VIDEO", subcategory: "generic", formats: ["MP4", "WEBM"], label: "Video" },
  { category: "AUDIO", subcategory: "music", formats: ["MP3", "WAV", "OGG"], label: "Music" },
  { category: "AUDIO", subcategory: "sfx", formats: ["MP3", "WAV", "OGG"], label: "SFX" },
  { category: "AUDIO", subcategory: "speech", formats: ["MP3"], label: "Speech" },
  { category: "AUDIO", subcategory: "generic", formats: ["MP3", "WAV", "OGG"], label: "Audio" },
  { category: "MODEL_3D", subcategory: "generic", formats: MODEL_3D_FORMATS, label: "3D Model" },
  { category: "MODEL_3D", subcategory: "avatar", formats: MODEL_3D_FORMATS, label: "Avatar" },
  { category: "MODEL_3D", subcategory: "humanoid", formats: MODEL_3D_FORMATS, label: "Humanoid" },
  { category: "MODEL_3D", subcategory: "creature", formats: MODEL_3D_FORMATS, label: "Creature" },
  { category: "MODEL_3D", subcategory: "block", formats: MODEL_3D_FORMATS, label: "Block" }
];
const ASSET_SUBCATEGORY_SLUG_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
const MODEL_3D_ASSET_SUBCATEGORY_VALUES = ["generic", "avatar", "humanoid", "creature", "block"];
const MODEL_3D_ASSET_SUBCATEGORY_SET = new Set(MODEL_3D_ASSET_SUBCATEGORY_VALUES);
function isModel3DAssetSubcategory(category, subcategory) {
  return category === "MODEL_3D" && MODEL_3D_ASSET_SUBCATEGORY_SET.has(normalizeAssetSubcategory(subcategory));
}
function isBoxelAssetFormat(format) {
  return format === "PLAYDROP_BOXEL_JSON";
}
function isVoxAssetFormat(format) {
  return format === "VOX";
}
function getRequiredModel3DFileRoles(format) {
  if (format === "PLAYDROP_BOXEL_JSON") {
    return BOXEL_REQUIRED_FILE_ROLES;
  }
  if (format === "VOX") {
    return VOX_REQUIRED_FILE_ROLES;
  }
  if (format === "GLB" || format === "GLTF") {
    return GLTF_REQUIRED_FILE_ROLES;
  }
  return [];
}
function getBoxelManifestRole(format) {
  if (format === "PLAYDROP_BOXEL_JSON") {
    return "primary";
  }
  if (format === "VOX") {
    return "boxel";
  }
  return null;
}
const ASSET_SUBCATEGORY_DEFINITIONS_BY_KEY = Object.fromEntries(ASSET_SUBCATEGORY_DEFINITIONS.map((definition) => [`${definition.category}:${definition.subcategory}`, definition]));
const ASSET_SUBCATEGORIES_BY_CATEGORY = ASSET_CATEGORY_VALUES.reduce((acc, category) => {
  acc[category] = ASSET_SUBCATEGORY_DEFINITIONS.filter((definition) => definition.category === category).map((definition) => definition.subcategory);
  return acc;
}, {
  IMAGE: [],
  VIDEO: [],
  AUDIO: [],
  SPRITESHEET: [],
  MODEL_3D: [],
  CUSTOM: []
});
const ASSET_LIST_SORT_VALUES = ["recent", "likes", "remixes", "comments"];
function isAssetCategory(value) {
  return typeof value === "string" && ASSET_CATEGORY_VALUES.includes(value);
}
function isAssetFormat(value) {
  return typeof value === "string" && ASSET_FORMAT_VALUES.includes(value);
}
function isAssetVisibility(value) {
  return typeof value === "string" && ASSET_VISIBILITY_VALUES.includes(value);
}
function isAssetSourceKind(value) {
  return typeof value === "string" && ASSET_SOURCE_KIND_VALUES.includes(value);
}
function isValidAssetSubcategorySlug(value) {
  return typeof value === "string" && ASSET_SUBCATEGORY_SLUG_REGEX.test(value.trim());
}
function normalizeAssetSubcategory(value) {
  return value.trim().toLowerCase();
}
function isKnownAssetSubcategory(category, subcategory) {
  return ASSET_SUBCATEGORIES_BY_CATEGORY[category].includes(subcategory);
}
function getAssetSubcategoryDefinition(category, subcategory) {
  return ASSET_SUBCATEGORY_DEFINITIONS_BY_KEY[`${category}:${subcategory}`] ?? null;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ASSET_BROWSE_KIND_VALUES,
  ASSET_CATEGORY_VALUES,
  ASSET_FORMAT_VALUES,
  ASSET_LIST_SORT_VALUES,
  ASSET_SOURCE_KIND_VALUES,
  ASSET_SUBCATEGORIES_BY_CATEGORY,
  ASSET_SUBCATEGORY_DEFINITIONS,
  ASSET_SUBCATEGORY_DEFINITIONS_BY_KEY,
  ASSET_SUBCATEGORY_SLUG_REGEX,
  ASSET_VISIBILITY_VALUES,
  MODEL_3D_ASSET_SUBCATEGORY_VALUES,
  PLAYDROP_SPEECH_MAX_WORDS,
  PLAYDROP_SPEECH_VOICE_IDS,
  countSpeechWords,
  getAssetSubcategoryDefinition,
  getBoxelManifestRole,
  getRequiredModel3DFileRoles,
  isAssetCategory,
  isAssetFormat,
  isAssetSourceKind,
  isAssetVisibility,
  isBoxelAssetFormat,
  isKnownAssetSubcategory,
  isModel3DAssetSubcategory,
  isValidAssetSubcategorySlug,
  isVoxAssetFormat,
  normalizeAssetSubcategory,
  normalizeSpeechText
});
