"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),a=require("../gallery-carousel/GalleryCarousel.js"),s=require("../child/ProductGalleryGrid.js"),l=require("../child/ProductFeaturedImageCarousel.js"),i=require("../../composables/getProductImagesStyles.js"),t=require("../../composables/getProductImagesClassName.js"),d=require("../../hooks/useFeatureImageWithGallery.js");exports.default=u=>{let{setting:o,styles:c,builderProps:g,gallery:n,onHandleClickImage:m,priorityFeatureImage:p,children:I,noDataChildren:j}=u,x={...o,...c},{isShowCarousel:y,featureImageHeight:P,featureWrapperImage:h,onClickFeatureArrow:C,activeIndexFromFeatureImage:F,setOnClickFeatureArrow:f,onHandleLoadedFeatureImage:v,setActiveIndexFromFeatureImage:b}=d.useFeatureImageWithGallery(u);if(n?.[0]?.id==="noImageError")return e.jsx(e.Fragment,{children:j});let{ftImageGalleryClasses:q,imageGalleryWrapperClasses:k}=t.getProductImagesClassName(u),{wrapperFeaturedImageStyle:H,featureImageStyle:G,galleryImageStyle:N}=i.getProductImagesStyles(x,{gallery:n,featureImageHeight:P});return e.jsxs("div",{className:r.cls("gp-grid gp-w-full gp-relative"),style:H,children:[e.jsx("div",{className:q,style:G,children:e.jsx(l.default,{imgRef:h,productImages:n,...x,onHandleClick:(e,r)=>m(e||"",r),onHandleLoaded:v,onHandleUpdateActiveIndex:b,onClickArrow:e=>f(e),builderPropUID:g?.uid,builderPropsClass:`gp-product-images-feature-${g?.uid}`,children:I})}),n.length>1&&e.jsx("div",{className:k,style:N,children:y?e.jsx(a.default,{productImages:n,position:x?.position,...x,builderPropUID:g?.uid,onHandleClick:(e,r)=>m(e||"",r),activeIndexFormFeatureImage:F,priorityFeatureImage:p,onClickFeatureArrow:C,builderPropsClass:`gp-product-images-gallery-${g?.uid}`}):e.jsx(s.default,{productImages:n,...x,builderPropUID:g?.uid,onHandleClick:(e,r)=>m(e||"",r),activeIndexFormFeatureImage:F,isHiddenInteraction:!0})})]})};
