import{r as y,j as a,F as x,a as i}from"./index.9be5fb1a.js";import"./ecb79917.js";import{M}from"./132ab464.js";import"./a36cb30c.js";import"./d060b8a3.js";import"./119338b3.js";import"./097174ad.js";import"./f84d33f8.js";import"./1cfd448b.js";import"./a5033887.js";import{a as m}from"./3037522c.js";import{LeftCaret as C,RightCaret as S}from"./a08c3446.js";import"./ac04e32d.js";import"./3fd5546a.js";import"./30205710.js";import"./b84f6150.js";import"./7cc0a16d.js";import"./2dce7371.js";import"./0ddb42b7.js";import"./8e2e2f72.js";import"./06774632.js";function H({media:r}){if(!r.length)return null;const[o,l]=y.exports.useState(0),s=r.length,d=()=>{l(o===s-1?0:o+1)},p=()=>{l(o===0?s-1:o-1)},u=({totalSlides:t})=>{const e=o+1;return a("div",{className:"mobile-slide-navigation-fraction",children:[i("span",{children:e}),i("span",{children:"|"}),i("span",{children:t})]})},h=({totalSlides:t})=>a("div",{className:"mobile-slide-navigation",children:[i("button",{className:"focus:outline-none",onClick:p,children:i(C,{})}),i(u,{totalSlides:t}),i("button",{className:"focus:outline-none",onClick:d,children:i(S,{})})]});return a(x,{children:[i("div",{className:"w-full h-[80vh] carousel flex lg:hidden bg-[#F3ECEE]","data-test":"mobile-product-gallery",children:r.map((t,e)=>{var c;let n={};const g=e===0,b=e===1,w=e===r.length-1,f=e%3===0,v=(c=t==null?void 0:t.image)==null?void 0:c.url.includes("Product_Mood"),E={...t,image:{...t.image,altText:t.alt||"Product image"}};switch(t.mediaContentType){case"IMAGE":n={width:800,widths:[400,800,1200,1600,2e3,2400]};break;case"VIDEO":n={width:"100%",autoPlay:!0,controls:!1,muted:!0,loop:!0,preload:"auto"};break;case"EXTERNAL_VIDEO":n={width:"100%"};break;case"MODEL_3D":n={width:"100%",interactionPromptThreshold:"0",ar:!0,loading:m,disableZoom:!0};break}e===0&&t.mediaContentType==="IMAGE"&&(n.loading=m);const N=[g?"mobile-item-first":"",b?"mobile-item-middle":"",w?"mobile-item-last":"",v?"mobile-item-mood":""].join(" ");return i("div",{className:"carousel-item mobile-item w-full image-loading ",children:i(M,{tabIndex:"0",data:E,sizes:f?"(min-width: 64em) 60vw, (min-width: 48em) 50vw, 90vw":"(min-width: 64em) 30vw, (min-width: 48em) 25vw, 90vw",options:{crop:"center",scale:2},className:`${N} w-full object-contain mobile-carousel-image mix-blend-multiply`,...n,style:{TouchAction:"none",transform:`translateX(-${o*100}%)`,opacity:o===e?1:0,transition:"opacity 0.5s ease-in-out"}})},t.id||t.image.id)})}),i("div",{className:"mobile-slide-navigation-wrapper",children:i(h,{totalSlides:r.length})})]})}export{H as MobileProductGallery};
//# sourceMappingURL=b556a99c.js.map