'use client';
"use strict";var jsxRuntime=require("react/jsx-runtime"),React=require("react"),helper=require("../../../../common/helper.js"),system=require("@gem-sdk/system"),Arrow=require("./Arrow.js"),CarouselPostPurchase=require("./CarouselPostPurchase.js"),useCarousel=require("../../../hooks/useCarousel.js"),classes=require("../../../common/classes.js"),styles=require("../../../common/styles.js");const CarouselWrapperPostPurchase=({styles:e,setting:s,productImages:r,objectFit:t="cover",aspectRatio:a,itemPerSlide:o=1,spacing:u,navigation:c="none",vertical:l=!1,border:i="none",idxActive:n})=>{let m={...e,...s},{layoutType:P}=m||{},{setMoveToIdx:h,setMaxIdx:p}=useCarousel.useCarousel(),j=helper.postPurchaseSpacing[u||"none"]??"0px",x="one-col"===P,y=system.createClass(classes.getImageListClass()),C=system.createStyle(styles.getImageListStyle({gap:j,vertical:l}));return React.useEffect(()=>{let e=r.length-Number(o||0);p(e)},[r.length,o,p]),React.useEffect(()=>{(n||0===n)&&1===o&&h(n)},[n,o,h]),jsxRuntime.jsxs("div",{className:y,style:C,children:[jsxRuntime.jsx(Arrow.ArrowPostPurchase,{type:"prev",navigation:c,vertical:l,hidden:x}),jsxRuntime.jsx(CarouselPostPurchase.CarouselPostPurchase,{productImages:r,itemPerRow:o,border:i,aspectRatio:a,objectFit:t,vertical:l}),jsxRuntime.jsx(Arrow.ArrowPostPurchase,{type:"next",navigation:c,vertical:l,hidden:x})]})};exports.CarouselWrapperPostPurchase=CarouselWrapperPostPurchase;
