'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../base/base.js"),a=require("react");exports.default=({product:i,isVariantOutStock:s,...d})=>{let r=i?.medias?.edges.map(e=>e.node),l=i?.variants?.edges.map(e=>{let t=e.node?.mediaId||"0",a=r?.find(e=>e?.id===t)?.src||"";return{title:e.node?.title||"",selectedOptions:e.node?.selectedOptions.map(e=>e.value),mediaId:t,image:a,id:e.node?.id||"0"}}),n=a.useMemo(()=>{let e=d.value?.label,t=l?.find(t=>t?.selectedOptions?.includes(e)&&t?.image)?.image||"";return t},[d.value,l]);return e.jsx(t.default,{...d,swatchesImage:n,isVariantOutStock:s})};
