import { jsx as r, jsxs as g } from "react/jsx-runtime";
import { forwardRef as h } from "react";
import { b as f } from "./use-section-style.BAfgyRSq.js";
import { u as v, E as x } from "./use-device-info.C708K3qk.js";
import { B as D } from "./BrickWrapper.D6AtxE97.js";
import { _ as d } from "./twind.D7be0E5m.js";
import { C as y } from "./dnd.esm.ByOls-Fs.js";
import { J as b, r as B } from "./use-editor.BroT97uF.js";
const M = h(({ brick: e, editable: i }, s) => {
  var n;
  const a = f(e);
  return /* @__PURE__ */ r("div", { className: d("flex flex-1 min-h-fit", Object.values(a)), ref: s, children: i ? /* @__PURE__ */ r(j, { brick: e }) : (n = e.props.$children) == null ? void 0 : n.map((o) => /* @__PURE__ */ r(D, { brick: o }, o.id)) });
}), C = (e, i, s) => null;
function j({ brick: e }) {
  const i = e.props, s = f(e), a = Object.values(s), { isDesktop: n } = v(), o = b(), u = B();
  return /* @__PURE__ */ r(
    y,
    {
      droppableId: e.id,
      type: "brick",
      isDropDisabled: !n,
      direction: "vertical",
      mode: "virtual",
      renderClone: C,
      children: (p, c) => {
        var m;
        return /* @__PURE__ */ r(
          "div",
          {
            ...p.droppableProps,
            ref: p.innerRef,
            className: d(
              "flex-1 flex flex-col",
              c.isDraggingOver && "!outline !outline-2 !outline-orange-300",
              (c.isDraggingOver || o) && "!overflow-y-hidden",
              c.isDraggingOver && "[&>*]:(!transform-none)",
              ...a
            ),
            children: ((m = i.$children) == null ? void 0 : m.length) > 0 ? i.$children.filter((t) => {
              var l;
              return !((l = t.props.hidden) != null && l[u]);
            }).map((t, l) => /* @__PURE__ */ r(x, { brick: t, isContainerChild: !0, index: l }, `${t.id}`)) : /* @__PURE__ */ g(
              "div",
              {
                className: d(
                  "w-full h-full text-center p-4 rounded flex justify-center items-center text-base font-medium"
                ),
                children: [
                  "This is a dynamic box.",
                  /* @__PURE__ */ r("br", {}),
                  "Drag bricks here to stack them inside."
                ]
              }
            )
          }
        );
      }
    }
  );
}
export {
  M as default
};
//# sourceMappingURL=dynamic.B2QaZqU_.js.map
