import{template as o}from"@gem-sdk/core";import t from"../../../carousel-v3/components/item/CarouselItem.liquid.js";import r from"../../../carousel-v3/components/root/Carousel.liquid.js";import{getData as e}from"./common/helpers.js";import{getClass as i}from"./common/classes.js";import{getStyle as s}from"./common/styles.js";import{getStaticLocale as d}from"../../../helpers.js";import u from"./ProductListCarouselItem.liquid.js";let ProductListCarouselLayout=c=>{let{builderProps:l,advanced:n,productSrc:a,productListId:p}=c,{carouselConfigSetting:m,carouselConfigStyle:f}=e(c),{carouselItemStyle:g}=s(c),{carouselClass:$}=i(c);return o`
    ${r({advanced:n,builderProps:{...l},rootAttrs:{"items-repeat":"true"},rootId:`product-list-carousel-${l?.uid}`,rootClass:$,setting:m,styles:f,isProductList:!0,children:`
        {%- assign count = 0 -%}
        {%- for product in products limit: limit -%}
        {%- if product.id != empty -%}
        {%- assign count = count | plus: 1 -%}
        {%- assign variant = product.selected_or_first_available_variant -%}
        {%- assign product_form_id = 'product-form-' | append: "${l?.uid}" | append: product.id -%}
        ${t({builderProps:{...l},style:g,parentId:`product-list-carousel-${l?.uid} gp-child-item-${l?.uid}`,parentStyle:f,parentSettings:m,background:m?.background,children:`
            ${u({...c})}
          `})}
        {%- endif -%}
        {% endfor %}
        {%- if count == 0 and ${p.length} == 0 -%}
          {% if '${a}' == 'RelatedProduct' -%}
              <div>${d("ProductList","no_related_products")}</div>
            {% else %}
              <div>${d("ProductList","no_products_found")}</div>
          {%- endif -%}
        {%- endif -%}
      `})}
  `};export{ProductListCarouselLayout as default};
