"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"),n=require("../lightbox/ButtonOpenLightBox.js"),c=require("../../../../../image/components/NextImage.js"),d=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,arrow:b,priorityFeatureImage:P,...f}=y,v=t.useCurrentDevice(),{galleryItemClasses:T}=a.getProductImagesClassName(f),{galleryCarouselSettingAttrs:w}=i.getProductImagesAttr(f),{galleryCarouselStyle:k,galleryCarouselItemStyle:A}=o.getProductImagesStyles(f),{isDisplay:M,shapeByLayout:N,isShowButtonLightbox:S,filteredProductImages:F,handleClickCarouselItem:G,safeMoveToIdx:H,setSliderReady:R}=g.useGalleryCarousel(y);return e.jsx(e.Fragment,{children:M&&e.jsx(d.default,{parentClass:x,rootClass:x,setting:w,styles:k,slidesClass:r.getEditorMinHeightClass(v,f.position,f.navigationPosition),builderProps:{uid:`${j}-carousel`},moveToIdx:H,isHiddenArrowWhenDisabled:!0,disableMarginAuto:!0,isEnableCheckHasScrollableContent:!0,onLoaded:e=>{e&&R(!0)},onSwiperReady:q,children:F?.map(t=>{let r=l.isFeatureMedia(t.contentType)?t.previewImage:t.src;return e.jsxs(m.default,{contentType:"productImage",className:T(`gp-gallery-image-item gem-slider-item-${j}`),onClickItem:()=>G(t?.id),style:A,"data-id":t?.id,children:[e.jsx(c.default,{draggable:"false",src:r,width:t?.width,height:t?.height,alt:t?.alt,setting:{aspectRatio:s.getAspectRatio(N),layout:f?.layout,qualityPercent:f?.qualityPercent,qualityType:f?.qualityType},style:{width:"100%",height:"100%",cursor:"pointer"},className:"product-list-image"}),e.jsx(u.default,{contentType:t?.contentType||""}),p.If(S,e.jsx(n.default,{}))]},t?.id)})})})};
