'use strict';

// src/showmasterpiece/types/index.ts
function buildDefaultHomeTabConfig() {
  return [];
}
function normalizeHomeTabConfig(input) {
  if (!input || input.length === 0) {
    return [];
  }
  const filtered = input.filter((item) => {
    if (!item) {
      return false;
    }
    const rawName = typeof item.name === "string" ? item.name : item.category;
    return typeof rawName === "string" && rawName.trim().length > 0;
  }).map((item) => {
    const rawName = typeof item.name === "string" ? item.name : item.category;
    const name = typeof rawName === "string" ? rawName.trim() : "";
    const description = typeof item.description === "string" ? item.description.trim() : item.description;
    return {
      name,
      description: description && description.length > 0 ? description : null,
      category: name,
      visible: item.visible ?? true,
      order: Number.isFinite(item.order) ? Number(item.order) : 0
    };
  });
  if (filtered.length === 0) {
    return [];
  }
  filtered.sort((a, b) => a.order - b.order);
  const normalized = filtered.map((item, index) => ({ ...item, order: index }));
  if (!normalized.some((item) => item.visible)) {
    const firstItem = normalized[0];
    if (firstItem) {
      normalized[0] = { ...firstItem, visible: true };
    }
  }
  return normalized;
}
var categories = {
  ["collection" /* COLLECTION */]: {
    value: "collection" /* COLLECTION */,
    displayName: "\u753B\u96C6",
    description: "\u7528\u4E8E\u5C55\u793A\u827A\u672F\u4F5C\u54C1"
  },
  ["acrylic" /* ACRYLIC */]: {
    value: "acrylic" /* ACRYLIC */,
    displayName: "\u7ACB\u724C",
    description: "\u7ACB\u724C\u5236\u54C1"
  },
  ["badge" /* BADGE */]: {
    value: "badge" /* BADGE */,
    displayName: "\u5427\u5527",
    description: "\u5FBD\u7AE0\u7C7B\u5546\u54C1"
  },
  ["color_paper" /* COLOR_PAPER */]: {
    value: "color_paper" /* COLOR_PAPER */,
    displayName: "\u8272\u7EB8",
    description: "\u5F69\u8272\u7EB8\u5F20\u5236\u54C1"
  },
  ["transparent_card" /* TRANSPARENT_CARD */]: {
    value: "transparent_card" /* TRANSPARENT_CARD */,
    displayName: "\u900F\u5361",
    description: "\u900F\u660E\u5361\u7247\u5236\u54C1"
  },
  ["postcard" /* POSTCARD */]: {
    value: "postcard" /* POSTCARD */,
    displayName: "\u660E\u4FE1\u7247",
    description: "\u660E\u4FE1\u7247\u7C7B\u5546\u54C1"
  },
  ["laser_ticket" /* LASER_TICKET */]: {
    value: "laser_ticket" /* LASER_TICKET */,
    displayName: "\u956D\u5C04\u7968",
    description: "\u956D\u5C04\u7968\u7C7B\u5546\u54C1"
  },
  ["canvas_bag" /* CANVAS_BAG */]: {
    value: "canvas_bag" /* CANVAS_BAG */,
    displayName: "\u5E06\u5E03\u5305",
    description: "\u5E06\u5E03\u5305\u7C7B\u5546\u54C1"
  },
  ["spiral_notebook" /* SPIRAL_NOTEBOOK */]: {
    value: "spiral_notebook" /* SPIRAL_NOTEBOOK */,
    displayName: "\u7EBF\u5708\u7B14\u8BB0\u672C",
    description: "\u7EBF\u5708\u88C5\u8BA2\u7B14\u8BB0\u672C"
  },
  ["mouse_pad" /* MOUSE_PAD */]: {
    value: "mouse_pad" /* MOUSE_PAD */,
    displayName: "\u9F20\u6807\u57AB",
    description: "\u9F20\u6807\u57AB\u7C7B\u5546\u54C1"
  },
  ["support_stick" /* SUPPORT_STICK */]: {
    value: "support_stick" /* SUPPORT_STICK */,
    displayName: "\u5E94\u63F4\u68D2",
    description: "\u5E94\u63F4\u68D2\u7C7B\u5546\u54C1"
  },
  ["keychain" /* KEYCHAIN */]: {
    value: "keychain" /* KEYCHAIN */,
    displayName: "\u6302\u4EF6/\u94A5\u5319\u6263",
    description: "\u6302\u4EF6/\u94A5\u5319\u6263\u7C7B\u5546\u54C1"
  },
  ["other" /* OTHER */]: {
    value: "other" /* OTHER */,
    displayName: "\u5176\u5B83",
    description: "\u5176\u4ED6\u7C7B\u578B\u5546\u54C1"
  }
};
function getCategoryDisplayName(category) {
  return categories[category]?.displayName || category;
}
function getCategoryInfo(category) {
  return categories[category] || {
    value: category,
    displayName: category,
    description: ""
  };
}
if (!Object.getOwnPropertyDescriptor(String.prototype, "displayName")) {
  Object.defineProperty(String.prototype, "displayName", {
    get() {
      return getCategoryDisplayName(this);
    }
  });
}
if (!Object.getOwnPropertyDescriptor(String.prototype, "categoryInfo")) {
  Object.defineProperty(String.prototype, "categoryInfo", {
    get() {
      return getCategoryInfo(this);
    }
  });
}

exports.buildDefaultHomeTabConfig = buildDefaultHomeTabConfig;
exports.getCategoryDisplayName = getCategoryDisplayName;
exports.normalizeHomeTabConfig = normalizeHomeTabConfig;
//# sourceMappingURL=chunk-DENROXAE.js.map
//# sourceMappingURL=chunk-DENROXAE.js.map