"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),s=require("../../common/common.js"),r=require("../../common/productGallery.js"),a=require("../../composables/getProductImagesClassName.js"),o=require("../../composables/getProductImagesStyles.js"),i=require("../../composables/getProductImagesAttr.js"),l=require("../../common/productFeaturedImage.js"),u=require("../child/MediaIcon.js"),d=require("../lightbox/ButtonOpenLightBox.js"),c=require("../../../../../image/components/NextImage.js"),n=require("../../../../../carousel-v3/components/root/Carousel.js"),m=require("../../../../../carousel-v3/components/item/CarouselItem.js"),g=require("../../hooks/useGalleryCarousel.js"),p=require("@gem-sdk/system");exports.default=y=>{let{builderPropUID:j,productImages:h,onSwiperReady:q,activeIndexFormFeatureImage:I,onClickFeatureArrow:C,builderPropsClass:x,carouselInstanceUID:b,arrow:P,priorityFeatureImage:f,...v}=y,T=t.useCurrentDevice(),{galleryItemClasses:w}=a.getProductImagesClassName(v),{galleryCarouselSettingAttrs:k}=i.getProductImagesAttr(v),{galleryCarouselStyle:A,galleryCarouselItemStyle:M}=o.getProductImagesStyles(v),{moveToIdx:N,isDisplay:G,shapeByLayout:R,isEnableBorderActive:S,isShowButtonLightbox:F,filteredProductImages:H,handleClickCarouselItem:$,safeMoveToIdx:B,setSliderReady:D}=g.useGalleryCarousel(y);return e.jsx(e.Fragment,{children:G&&e.jsx(n.default,{parentClass:x,rootClass:x,setting:k,styles:A,slidesClass:r.getEditorMinHeightClass(T,v.position,v.navigationPosition),builderProps:{uid:`${j}-carousel`},rootId:s.getGalleryCarouselRootId({carouselInstanceUID:b,builderPropUID:j}),moveToIdx:B,isHiddenArrowWhenDisabled:!0,disableMarginAuto:!0,isEnableCheckHasScrollableContent:!0,onLoaded:e=>{e&&D(!0)},onSwiperReady:q,children:H?.map((t,r)=>{let a=l.isFeatureMedia(t.contentType)?t.previewImage:t.src;return e.jsxs(m.default,{contentType:"productImage",className:w(`gp-gallery-image-item gem-slider-item-${j} ${r===N&&S?"gem-slider-item-active":""}`),onClickItem:()=>$(t?.id),style:M,"data-id":t?.id,children:[e.jsx(c.default,{draggable:"false",src:a,width:t?.width,height:t?.height,alt:t?.alt,setting:{aspectRatio:s.getAspectRatio(R),layout:v?.layout,qualityPercent:v?.qualityPercent,qualityType:v?.qualityType},style:{width:"100%",height:"100%",cursor:"pointer"},className:"product-list-image"}),e.jsx(u.default,{contentType:t?.contentType||""}),p.If(F,e.jsx(d.default,{}))]},t?.id)})})})};
