import{template as o}from"@gem-sdk/core";import t from"../../../carousel/components/item/CarouselItem.liquid.js";import r from"../../../carousel/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 l=l=>{let{builderProps:c,advanced:n,productSrc:a,productListId:p}=l,{carouselConfigSetting:m,carouselConfigStyle:f}=e(l),{carouselItemStyle:$}=s(l),{carouselClass:g}=i(l);return o`
    ${r({advanced:n,builderProps:{...c},rootAttrs:{"items-repeat":"true"},rootId:`product-list-carousel-${c?.uid}`,rootClass:g,setting:m,styles:f,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: "${c?.uid}" | append: product.id -%}
        ${t({builderProps:{...c},style:$,parentId:`product-list-carousel-${c?.uid} gp-child-item-${c?.uid}`,parentStyle:f,background:m?.background,children:`
            ${u({...l})}
          `})}
        {%- 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{l as default};
