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