"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../../grid/components/ChildrenDroppable.js"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),attrs=require("./common/attrs.js");const ProductListGridLayout=e=>{let{children:r,productSortedById:t,generateGridRowArray:s,setting:i}=e,l=core.useEditorMode(),{gridLayoutStyle:a}=styles.getStyle(e),{gridLayoutClass:o,productItemClass:c}=classes.getClass(e),{productListAttr:d,getAttrProductItemEditor:n}=attrs.getAttr(e);return jsxRuntime.jsx("div",{...d,style:a,className:o,children:t?.length?t?.map((e,t)=>jsxRuntime.jsx(core.ProductProvider,{product:e,readOnly:!0,children:jsxRuntime.jsx("div",{..."edit"===l?n(e?.baseID):{},className:c,style:{"--grchild":i?.sameHeight?s?.[t]?.gridRow:void 0,"--mbchild":s?.[t]?.marginBottom},children:core.isEmptyChildren(r)?jsxRuntime.jsx(ChildrenDroppable.default,{}):React.Children.map(r,e=>React.isValidElement(e)?React.createElement(e.type,{...e.props,key:e.key}):null)})},e?.baseID)):null})};exports.default=ProductListGridLayout;
