'use client';
"use strict";var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core");require("react");var Row=require("../../../../../grid/components/row/Row.js"),ChildrenDroppable=require("../../../../../grid/components/ChildrenDroppable.js"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),classes=require("../common/classes.js");const ProductOfferItem=e=>{let{product:r,setting:s,builderProps:t,children:i,index:d,totalProduct:o,builderAttrs:c,styles:a}=e,u=core.useEditorMode(),{variantSelected:l,productOfferLayout:n,layout:m,...j}=s??{};Object.keys(m||{}).forEach(e=>{n?.[e]==="2col"&&m?.[e]&&(m[e].display="fill")});let f=l?.[r?.baseID??""]?.variantId,x=system.createAttr({...attrs.getProductOfferAttrs(r,t?.uid)}),p=system.createClass({...classes.getProductOfferItemClasses(d,s,o)});return jsxRuntime.jsx("div",{className:p,children:jsxRuntime.jsx(core.ProductProvider,{product:r,readOnly:!0,initialVariantId:f??"Latest",uid:t?.uid,children:jsxRuntime.jsx("div",{..."edit"===u?{...x}:{},children:jsxRuntime.jsx(Row.default,{builderAttrs:c,setting:{...j,layout:m},styles:a,children:core.isEmptyChildren(i)?jsxRuntime.jsx(ChildrenDroppable.default,{}):i})})})},`uid-${r?.id}`)};exports.ProductOfferItem=ProductOfferItem;
