import { jsxs as f, jsx as a } from "@emotion/react/jsx-runtime";
import { RootStyled as c, FormContainerStyled as p } from "./slots/FormContainerSlots.js";
import { FORM_CONTAINER_CLASSES as d } from "./constants.js";
import i, { useMemo as C } from "react";
import u from "clsx";
import { ActionsContainer as E } from "../CommonActions/components/ActionsContainer/ActionsContainer.js";
const A = (n) => {
  const { children: r, className: s } = n, { fields: l, footer: m } = C(() => {
    const e = [];
    let t = null;
    return i.Children.forEach(r, (o) => {
      i.isValidElement(o) && (o.type === E ? t = o : e.push(o));
    }), { fields: e, footer: t };
  }, [r]);
  return /* @__PURE__ */ f(
    c,
    {
      role: "region",
      "aria-label": "formContainer",
      className: u(d.root, s),
      children: [
        /* @__PURE__ */ a(p, { children: l }),
        m
      ]
    }
  );
};
export {
  A as FormContainer
};
