"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),productImage=require("../helpers/product-image.js"),helpers=require("./product-images/common/helpers.js"),ProductFeaturedImage_liquid=require("./product-images/ProductFeaturedImage.liquid.js"),ProductGalleryCarousel_liquid=require("./product-images/ProductGalleryCarousel.liquid.js"),ProductGalleryGrid_liquid=require("./product-images/ProductGalleryGrid.liquid.js"),productGallery=require("./product-images/common/productGallery.js"),helpers$1=require("../../helpers.js");const ProductImages=e=>{let{setting:t,styles:r,builderProps:i,style:l}=e,s={...e.styles,...e.setting},a={...e.styles,...e.setting},o=e=>core.getResponsiveValueByScreen(r?.position,e),d=()=>helpers.getDisplayStyle(e=>!!t?.galleryVisible&&!core.getResponsiveValueByScreen(t?.galleryVisible,e),"inline-flex"),u=`
    {
      "id":${JSON.stringify(i?.uid)},
      "setting":${JSON.stringify(t)},
      "styles":${JSON.stringify(r)},
      "product":{{ product | json | escape }}
    }
  `;return core.template`
  {% assign featured_image = product.featured_image %}
  {%- if variant != null and variant.featured_image != null -%}
  {% assign featured_image = variant.featured_image %}
  {%- endif -%}
  <gp-product-images
    gp-data='${u}'
    style="${{...l}}"
    class="${core.cls({"gp-overflow-hidden":helpers.checkAddOverFlowClass(l)})}"
  >
    <div
        class="${core.cls("gp-flex gp-w-full",{...productImage.getFlexDirection(e)})}"
        style="${{...helpers.getStyleAlignment(r?.align,r?.position)}}"
      >
        ${ProductFeaturedImage_liquid.default({...s})}
        {%- if product.media.size > 1 -%}
          <div
            class="${core.cls("gallery-wrapper gp-product-images-gallery gp-inline-flex gp-h-fit gp-max-w-full",{"gp-justify-start":"bottom-left"==o("desktop"),"tablet:gp-justify-start":"bottom-left"==o("tablet"),"mobile:gp-justify-start":"bottom-left"==o("mobile"),"gp-justify-center":"bottom-center"==o("desktop"),"tablet:gp-justify-center":"bottom-center"==o("tablet"),"mobile:gp-justify-center":"bottom-center"==o("mobile"),"gp-mx-auto":"bottom-center"==o("desktop"),"tablet:gp-mx-auto":"bottom-center"==o("tablet"),"mobile:gp-mx-auto":"bottom-center"==o("mobile")})}"
            style="${{...core.makeStyle({fs:"1.23"}),...d(),...productGallery.getStyleWidthForGallery({galleryVisible:t?.galleryVisible,featureImageVisible:t?.featureImageVisible,position:r?.position,width:r?.width,widthHorizontalLayout:r?.widthHorizontalLayout}),...productGallery.getStyleGallerySpacing(r?.position,r?.gallerySpacing)}}"
          >
            ${ProductGalleryCarousel_liquid.default({builderPropUID:i?.uid,...a})}
            ${ProductGalleryGrid_liquid.default({builderPropUID:i?.uid,...a})}
          </div>
        {%- endif -%}
      </div>
  </gp-product-images>
  ${core.RenderIf(core.isLocalEnv,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-product-images.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-product-images.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};exports.default=ProductImages;
