import { jsxs as d, jsx as e } from "@emotion/react/jsx-runtime";
import { Header as S } from "./components/Header.js";
import { PaperFormRootStyled as C, ContentStyled as F } from "./slots/PaperFormSlots.js";
import { useRef as P } from "react";
import { getComponentSlotRoot as R } from "../../utils/getComponentSlotRoot.js";
import { PAPER_FORM_KEY as z } from "./constants.js";
import { useComponentSize as E } from "../../hooks/useComponentSize/index.js";
import { PropertyValue as V } from "../PropertyValue/PropertyValue.js";
const j = (r) => typeof r == "object" && r !== null && "property" in r && "value" in r, v = (r) => Array.isArray(r) ? r.map(
  (o) => j(o) ? /* @__PURE__ */ e(V, { ...o }, o.property) : o
) : r;
function b(r) {
  const {
    urlIcon: o,
    title: p,
    children: s,
    dataTestId: i,
    color: n = "default",
    size: a = "medium",
    isForm: u = !1,
    variant: t = "standard",
    height: f = "auto"
  } = r, { currentSize: l } = E(a), c = P(null), y = R(z), m = {
    size: l,
    color: n,
    isForm: u,
    paperFormVariant: t,
    height: f
  };
  return /* @__PURE__ */ d(
    C,
    {
      className: y,
      ref: c,
      ownerState: { ...m },
      ...process.env.NODE_ENV !== "production" ? { "data-testid": i } : {},
      children: [
        t !== "onlyContainer" && /* @__PURE__ */ e(S, { urlIcon: o, title: p, color: n, size: a, variant: t }),
        /* @__PURE__ */ e(F, { ownerState: { ...m }, children: v(s) })
      ]
    }
  );
}
export {
  b as PaperForm
};
