import { j as V } from "./jsx-runtime-OVHDjVDe.js";
import { p as $, C as e } from "./css-D6ZBcSwh.js";
import x from "zod";
import { createElement as C } from "react";
const d = ({
  el: r,
  children: t,
  ...u
}) => C(r, u, t), U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Element: d
}, Symbol.toStringTag, { value: "Module" })), j = ["start", "center", "end", "stretch"], F = x.enum(j), _ = [
  "start",
  "center",
  "end",
  "between",
  "around",
  "evenly"
], P = x.enum(_), g = (r, t) => t ?? (r === "right" || r === "bottom"), v = (r, t, u, o) => {
  if (t === !0) return "x";
  if (u === !0) return "y";
  if (r != null) return $.construct(r);
  if (o == !0) return "x";
}, Z = (r) => r == null || r === !1 ? !1 : r === !0 ? e.M("full") : e.M("full", r), q = ({
  style: r,
  align: t,
  className: u,
  grow: o,
  shrink: a,
  gap: i,
  color: s,
  justify: m,
  reverse: y,
  empty: E,
  pack: c,
  wrap: N,
  center: O,
  direction: M,
  rounded: p,
  sharp: T,
  borderWidth: B,
  borderColor: f,
  full: G,
  background: l,
  bordered: I,
  x: w,
  y: A,
  size: b,
  square: R = !1,
  ...h
}) => {
  const S = v(M, w, A, c), n = [
    u,
    e.B("flex"),
    S != null && e.M("direction", S),
    g(M, y) && e.M("reverse"),
    Z(G),
    c && e.M("pack"),
    m != null && e.M("justify", m),
    t != null && e.M("align", t),
    N === !0 && e.M("wrap"),
    E === !0 && e.M("empty"),
    O === !0 && e.M("center"),
    I === !0 && e.M("bordered"),
    T === !0 && e.M("sharp"),
    b != null && e.M("height", b),
    R === !0 && e.M("square")
  ];
  return r = { borderWidth: B, ...r }, typeof s == "number" ? n.push(e.M("color", s.toString())) : s != null && s !== !1 && (r.color = e.colorVar(s)), typeof l == "number" ? n.push(e.M("bg", l.toString())) : l != null && l !== !1 && (r.backgroundColor = e.colorVar(l)), typeof f == "number" ? n.push(e.M("border-color", f.toString())) : f != null && (r.borderColor = e.colorVar(f)), p === !0 ? n.push(e.M("rounded")) : typeof p == "number" && (r.borderRadius = `${p}rem`), typeof i == "number" ? r.gap = `${i}rem` : i != null && n.push(e.M("gap", i)), typeof o == "number" ? r.flexGrow = o : o === !0 && n.push(e.M("grow")), typeof a == "number" ? r.flexShrink = a : a === !0 && n.push(e.M("shrink")), /* @__PURE__ */ V.jsx(
    d,
    {
      className: e(...n),
      style: r,
      ...h,
      el: h.el ?? "div"
    }
  );
}, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ALIGNMENTS: j,
  Box: q,
  JUSTIFICATIONS: _,
  alignmentZ: F,
  justificationZ: P,
  parseDirection: v,
  shouldReverse: g
}, Symbol.toStringTag, { value: "Module" }));
export {
  j as A,
  H as B,
  d as E,
  U as G,
  q as a,
  v as p
};
