import { jsx as l } from "react/jsx-runtime";
import { useMemo as u } from "react";
import { c as f } from "./index.CfM2L_w0.js";
import { a as p } from "./index.CfQlFjZU.js";
import { s as a } from "./shared.EdGf6tcG.js";
import { B as h } from "./Button.CpTwUWVr.js";
const z = "creator_buttonGroup_gaTdC", _ = "creator_horizontal_wWCNK", d = "creator_floating_LZbHS", B = "creator_vertical_SIfmO", e = { buttonGroup: z, horizontal: _, floating: d, vertical: B }, g = ({
  buttons: r,
  className: n,
  orientation: t = "horizontal",
  floating: m = !1
}) => ({
  buttons: u(
    () => r.sort((o, s) => {
      const c = o.semantic ? a.indexOf(o.semantic) : a.length + 1, i = s.semantic ? a.indexOf(s.semantic) : a.length + 1;
      return t === "horizontal" ? i - c : c - i;
    }),
    [r, t]
  ).map((o, s) => /* @__PURE__ */ l(
    h,
    {
      size: t === "vertical" ? "full" : o.size,
      ...o
    },
    s
  )),
  className: f(e.buttonGroup, n, {
    [e.vertical]: t === "vertical",
    [e.horizontal]: t === "horizontal",
    [e.floating]: m
  })
}), v = ({ buttons: r, className: n }) => /* @__PURE__ */ l("div", { className: n, children: r }), y = p(v, g);
export {
  y as B,
  g as u
};
