import { a as n } from "../../../../sdk/dist/shared/chunk-EYPREFMH.js";
import "@sinclair/typebox";
import "../../../../sdk/dist/shared/chunk-UU2MSQXY.js";
import "../../../../sdk/dist/shared/chunk-T3LIA4YB.js";
import "../../../../sdk/dist/shared/chunk-YBGPPF7T.js";
import "../../../../sdk/dist/shared/chunk-UMHXXXVP.js";
import "../../../../sdk/dist/shared/chunk-5N6MBJJ4.js";
import { tx as m, css as f } from "../../../../style-system/dist/twind.js";
import { getStyleProperties as h } from "../styles/style-props.js";
import { usePageAttributes as y } from "../../../../../use-page-data.js";
import p from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js";
import { extractStylePath as g, pageStylesHelpersMap as x } from "../styles/helpers.js";
function B({ attributes: t, editable: e, typography: o, showIntro: r }) {
  const s = h(n), i = P(s);
  return m(
    "flex flex-col group/page mx-auto relative max-w-full w-full p-0 antialiased",
    e && "overflow-hidden min-h-[100cqh]",
    t.colorPreset.color,
    Object.values(i),
    d(o),
    // Animate all bricks when the page is loading
    e && r && "[&>.brick-wrapper]:(opacity-0 animate-elastic-pop)"
  );
}
function P(t) {
  const e = y();
  return Object.entries(t).reduce(
    (r, [s, i]) => {
      const l = x[i];
      if (!l)
        return r;
      const a = g(s);
      r[a] = r[a] ?? [];
      const u = p(e, s), c = p(n.properties, s);
      return r[a].push(m(l?.(u, void 0, c))), r;
    },
    {}
  );
}
function d(t) {
  function e(o) {
    return o.type === "stack" ? `var(--font-${o.family})` : `"${o.family}"`;
  }
  return f({
    fontFamily: e(t.body),
    fontSize: `${t.base}px`,
    "& h1, & h2, & h3, & h4, & h5, & h6, & h7": {
      fontFamily: e(t.heading)
    }
  });
}
export {
  B as usePageStyle
};
//# sourceMappingURL=use-page-style.js.map
