import { h as e } from "./chunk.BlbRoQQ3.js";
import { U as t } from "./use-page-data.Cb2SuuwJ.js";
import "./chunk-LSPN22SI.D75E3zS-.js";
import { c as n } from "./twind.BiM9xcCd.js";
import { b as r } from "./jsx-runtime.DF4K5VCp.js";
import "./chroma-js.Dcir27CH.js";
import "./color-system.Dp99zR0T.js";
import "./react.BZZIbN3T.js";
import "./schema-resolver.p7B_pu36.js";
import { b as i } from "./use-brick-style.DDPl-_C1.js";
import "./use-brick-manifest.Iv9SG-7-.js";
import { b as a } from "./TextContent.B1cB93wj.js";
import { b as o } from "./BrickRoot.DbISziyH.js";
import { b as s } from "./use-brick-props.Db5hMGVc.js";
var c = /* @__PURE__ */ e(r());
function l(e) {
	let { brick: r, editable: l } = e, u = s(e), d = i(r), f = Object.values(d);
	return /* @__PURE__ */ (0, c.jsxs)(o, {
		brick: r,
		editable: l,
		manifest: t,
		className: n("flex relative overflow-hidden !flex-nowrap", u.imagePosition === "left" || u.imagePosition === "right" ? "flex-row" : "flex-col", f),
		children: [
			/* @__PURE__ */ (0, c.jsxs)("div", {
				className: n("card-inner-wrapper", u.imagePosition === "top" ? "order-2" : u.imagePosition === "left" ? "order-last" : "order-1"),
				children: [!u.noTitle && /* @__PURE__ */ (0, c.jsx)("div", {
					className: n("text-[120%] font-semibold z-auto my-4 mx-4"),
					children: /* @__PURE__ */ (0, c.jsx)(a, {
						propPath: "title.content",
						className: n("flex-1"),
						brickId: r.id,
						content: u.title,
						rawContent: r.props.title,
						editable: l,
						inline: !0
					})
				}), u.imagePosition !== "middle" && /* @__PURE__ */ (0, c.jsx)("div", {
					className: n("z-auto p-4", !u.noTitle && "pt-0"),
					children: /* @__PURE__ */ (0, c.jsx)(a, {
						propPath: "text.content",
						className: n("flex-grow"),
						brickId: r.id,
						content: u.text,
						rawContent: r.props.text,
						editable: l
					})
				})]
			}),
			u.cardImage?.src && /* @__PURE__ */ (0, c.jsx)("img", {
				className: n(" select-none pointer-events-none bg-transparent", u.cardImage.position ?? "object-center", u.cardImage.fit ?? "object-cover", u.imagePosition === "left" && "order-1", u.imagePosition === "right" && "order-last", u.imagePosition === "middle" && "order-2", u.imagePosition === "top" && "order-first", u.imagePosition === "bottom" && "order-last mt-auto", u.imagePosition === "left" || u.imagePosition === "right" ? "h-auto w-[clamp(100px,40%,400px)]" : "w-inherit h-[clamp(100px,50%,250px)]"),
				src: u.cardImage.src,
				alt: u.cardImage.alt || "Card Image"
			}),
			u.text && u.imagePosition === "middle" && /* @__PURE__ */ (0, c.jsx)("div", {
				className: n("z-auto p-4 order-last"),
				children: /* @__PURE__ */ (0, c.jsx)(a, {
					propPath: "text.content",
					className: n("flex-1"),
					brickId: r.id,
					content: u.text,
					rawContent: r.props.text,
					editable: l
				})
			})
		]
	});
}
export { l as default };

//# sourceMappingURL=card.BCTF3Tm2.js.map