import { MessageObjectDetail, MessageObjectPreview } from "@open-mercato/ui/backend/messages";
const objectMessageTypes = ["default", "messages.defaultWithObjects"];
const messageObjectTypes = [
  {
    module: "catalog",
    entityType: "product",
    messageTypes: objectMessageTypes,
    entityId: "catalog:catalog_product",
    optionLabelField: "title",
    optionSubtitleField: "subtitle",
    labelKey: "catalog.messageObjects.product.title",
    icon: "package",
    PreviewComponent: MessageObjectPreview,
    DetailComponent: MessageObjectDetail,
    actions: [
      {
        id: "view",
        labelKey: "common.view",
        variant: "outline",
        href: "/backend/catalog/products/{entityId}"
      }
    ],
    loadPreview: async (entityId, ctx) => {
      if (typeof window !== "undefined") {
        return { title: "Product", subtitle: entityId };
      }
      const previews = await import("./lib/messageObjectPreviews.js");
      const productLoader = previews.loadCatalogProductPreview;
      if (productLoader) return productLoader(entityId, ctx);
      return previews.loadCatalogCategoryPreview(entityId, ctx);
    }
  },
  {
    module: "catalog",
    entityType: "variant",
    messageTypes: objectMessageTypes,
    entityId: "catalog:catalog_product_variant",
    optionLabelField: "name",
    optionSubtitleField: "sku",
    labelKey: "catalog.variants.form.editTitle",
    icon: "package-plus",
    PreviewComponent: MessageObjectPreview,
    DetailComponent: MessageObjectDetail,
    actions: [
      {
        id: "view",
        labelKey: "common.view",
        variant: "outline",
        href: "/backend/catalog/products"
      }
    ],
    loadPreview: async (entityId, ctx) => {
      if (typeof window !== "undefined") {
        return { title: "Variant", subtitle: entityId };
      }
      const previews = await import("./lib/messageObjectPreviews.js");
      const variantLoader = previews.loadCatalogVariantPreview;
      if (variantLoader) return variantLoader(entityId, ctx);
      return previews.loadCatalogProductPreview(entityId, ctx);
    }
  },
  {
    module: "catalog",
    entityType: "category",
    messageTypes: objectMessageTypes,
    entityId: "catalog:catalog_product_category",
    optionLabelField: "name",
    optionSubtitleField: "description",
    labelKey: "catalog.messageObjects.category.title",
    icon: "tag",
    PreviewComponent: MessageObjectPreview,
    DetailComponent: MessageObjectDetail,
    actions: [
      {
        id: "view",
        labelKey: "common.view",
        variant: "outline",
        href: "/backend/catalog/categories/{entityId}/edit"
      }
    ],
    loadPreview: async (entityId, ctx) => {
      if (typeof window !== "undefined") {
        return { title: "Category", subtitle: entityId };
      }
      const { loadCatalogCategoryPreview } = await import("./lib/messageObjectPreviews.js");
      return loadCatalogCategoryPreview(entityId, ctx);
    }
  }
];
var message_objects_default = messageObjectTypes;
export {
  message_objects_default as default,
  messageObjectTypes
};
//# sourceMappingURL=message-objects.js.map
