import { ax as MediumHelper, ap as YoutubeVideoMediumCodec, ao as ImageMediumCodec } from "./index.js";
const ItemImageTag = Object.freeze({
  heroBanner: "hero-banner",
  featured: "featured",
  screenshot: "screenshot",
  productCover: "product-cover",
  productBanner: "product-banner"
});
const _ItemHelper = class {
  static getScreenshotImages(itemImages) {
    return itemImages.filter((itemImages2) => itemImages2.as === ItemImageTag.screenshot);
  }
};
let ItemHelper = _ItemHelper;
ItemHelper.getMedia = (item, itemPublishingContent) => {
  if (itemPublishingContent && itemPublishingContent.medias && itemPublishingContent.medias.length > 0) {
    return itemPublishingContent.medias;
  }
  if (item == null ? void 0 : item.images) {
    const media = [];
    const rawItemMedia = _ItemHelper.getScreenshotImages(item.images);
    rawItemMedia.forEach((rawItemMedium) => {
      const [medium, error] = MediumHelper.fromRaw(rawItemMedium);
      if (!error && medium)
        media.push(medium);
    });
    return [...media.filter(YoutubeVideoMediumCodec.is), ...media.filter(ImageMediumCodec.is)];
  }
  return null;
};
export { ItemHelper as I, ItemImageTag as a };
