import { a as h } from "./chunk-L42YBY5I.js";
import { b as r } from "./chunk-AQPN5SE2.js";
import { a as o } from "./chunk-MPBYGS6W.js";
import { b as m } from "./chunk-CT3EI7YN.js";
import { b as u } from "./chunk-6WCGUAQN.js";
import { e as f } from "./chunk-VZPXXFVX.js";
import { c as s } from "./chunk-2IYSJYNE.js";
import { d as b, b as y } from "./chunk-E22E4XWE.js";
import { a } from "./chunk-SFKZAUPW.js";
import { b as p } from "./chunk-I46VBMLF.js";
import { Type as t } from "@sinclair/typebox";
import { customAlphabet as g } from "../../../../node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/index.browser.js";
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
var O = g("azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN", 7);
t.Object({ left: t.Optional(t.String({ title: "top", description: "The left position in css unit." })), top: t.Optional(t.String({ title: "top", description: "The top position in css unit." })), right: t.Optional(t.String({ title: "right", description: "The right position in css unit." })), bottom: t.Optional(t.String({ title: "bottom", description: "The bottom position in css unit." })), inset: t.Optional(t.String({ title: "inset", description: "The inset position in css unit." })), translateX: t.Optional(t.String({ title: "translateX", description: "The translateX position in css unit." })), translateY: t.Optional(t.String({ title: "translateY", description: "The translateY position in css unit." })), rotate: t.Optional(t.String({ title: "rotate", description: "The rotate position in css unit." })) });
var k = a(Object.keys(r), { title: "Brick type" }), T = t.Object({ id: t.String({ title: "ID", description: "A unique identifier for the brick." }), type: k, props: t.Any({ title: "Props", description: "The static props of the brick. The available props depends on the brick type." }), mobileProps: t.Optional(t.Any({ title: "Props", description: "The overriden props for mobile, merged with desktop props." })), propsMapping: t.Optional(t.Object({}, { description: "Dynamic props mapping for the brick. Used to map dynamic content to the brick's props. Can only be used if the brick is a child of a 'dynamic' brick. One can only reference the fields from the database that is specified in the dynamic brick.", "ui:field": "hidden", examples: [{ "$.property1": "$.databaseField1", "$.property2": "$.databaseField2.subField1", "$.property3.subProp1": "$.databaseField3", "$.property3.subProp3": "$.databaseField4.subField2" }], additionalProperties: !0 })) }, { $id: "brick", additionalProperties: !0 }), n = t.Object({ colorPreset: t.Optional(f({ title: "Color" })), direction: t.Optional(m({ default: "flex-row", title: "Direction", description: "The direction of the section. Only apply to desktop. On mobile, it is always vertical.", "ui:responsive": "desktop" })), minHeight: t.Optional(s({ title: "Min height", default: "fit-content", description: "The min height of the section", "ui:field": "hidden" })), variant: t.Optional(a(["navbar", "footer", "sidebar"], { title: "Custom section variant", description: "Used for custom styling and layout.", enumNames: ["Navbar", "Footer", "Sidebar"], "ui:field": "hidden" })), maxWidth: t.Optional(h("Max width", "max-w-full", { options: [{ value: "max-w-screen-lg", title: "M", description: "Common for text-heavy content/blog posts" }, { value: "max-w-screen-xl", title: "L", description: "Usefull or some landing pages" }, { value: "max-w-screen-2xl", title: "XL", description: "Common width" }, { value: "max-w-full", title: "Full", description: "Takes the entire space" }], description: "The maximum width of the section. Desktop only", displayAs: "button-group", "ui:responsive": "desktop" })), justifyContent: t.Optional(y({ default: "justify-center" })), alignItems: t.Optional(b({ default: "items-center", description: "The vertical alignment of bricks within the section." })), padding: t.Optional(u({ default: "p-4", description: "The padding of the section.", "ui:responsive": !0, "default:mobile": "p-3" })), gap: t.Optional(s({ title: "Gap", description: "The gap between the bricks in the section.", default: "20px", "ui:styleId": "styles:gap" })), lastTouched: t.Optional(t.Number({ description: "Do not use this field. It is used internally by the editor.", "ui:field": "hidden", "ai:hidden": !0 })) }, { additionalProperties: !0, "ai:instructions": "Do not use the border prop" }), l = t.Object({ id: t.String({ description: "The unique ID of the section. Use a human readable url-safe slug" }), label: t.Optional(t.String({ description: "The label (name) of the section. Used for editor purposes only." })), order: t.Number({ description: "Determines section order in the page (lower numbers appear first). 0-based" }), props: n, mobileProps: t.Optional(t.Partial(n, { additionalProperties: !1 })), bricks: t.Array(T) }, { $id: "section", description: "Sections are direct children of the page that are stacked vertically, but they always align their children horizontally (flex-row)." }), v = p(l.properties.props, "desktop"), w = p(l.properties.mobileProps, "mobile");
function X(e) {
  return e.map((i) => ({ ...i, props: o({}, v, i.props), mobileProps: o({}, w, i.mobileProps || {}), bricks: i.bricks.map(d).filter(Boolean) }));
}
function d(e) {
  let i = r[e.type];
  return i ? { ...e, props: o({}, i.props, { ...e.props, ...e.props.$children ? { $children: e.props.$children.map(d).filter(Boolean) } : {} }) } : (console.warn(`No default props found for brick type: ${e.type}`), !1);
}
function M(e, i = !1) {
  let c = { ...r[e].props, ghost: i };
  return { id: `b-${O()}`, type: e, props: c };
}
export {
  O as a,
  k as b,
  T as c,
  n as d,
  l as e,
  X as f,
  d as g,
  M as h
};
//# sourceMappingURL=chunk-NLEWXPVM.js.map
