import { mergeClassNameOverrides as c } from "../../../utils/mergeClassNameOverrides.js";
import b from "../../../utils/classNames.js";
const m = {
  TABLE: "table-view-table",
  SINGLE_CARD: "table-view-single-card",
  MULTI_CARDS: "table-view-multi-cards"
}, w = (s) => s?.split(" ").map((l) => l.trim()).filter(Boolean) ?? [], C = (s) => s === "shadow" || s.startsWith("shadow-") ? "shadow" : s === "border-radius" || s.startsWith("border-radius-") ? "rounded" : s, u = (s) => {
  const { shadow: l, border: r, rounded: o, className: t } = s, d = b(l && "shadow", r && "border", o && "rounded"), i = w(t).map(C).join(" "), e = c(d, i), a = new Set(w(e));
  return {
    hasShadow: !!l && a.has("shadow"),
    hasBorder: !!r && a.has("border"),
    hasRounded: !!o && a.has("rounded")
  };
}, f = (s) => {
  const { viewType: l, hover: r = !1, shadow: o = !1, border: t = !0, rounded: d = !0, className: i, cardsStyle: e } = s, a = l === "TABLE", n = r, h = u({ shadow: o, border: t, rounded: d, className: i });
  return {
    hasHover: n,
    isTableView: a,
    styleClassSwitches: h,
    cardClasses: {
      rowClassName: a ? void 0 : b(
        h.hasShadow && "shadow-default",
        h.hasBorder && "border",
        e?.className
      ),
      cellClassName: a ? void 0 : e?.rowClassName,
      labelClassName: a ? void 0 : e?.labelClassName,
      contentClassName: a ? void 0 : e?.contentClassName
    }
  };
}, N = (s) => {
  const {
    viewType: l,
    condensed: r = !1,
    striped: o = !1,
    gridLines: t = !1,
    className: d,
    tableUseOverflow: i,
    flags: e,
    hasHover: a,
    styleClassSwitches: n
  } = s;
  return b(
    "table",
    m[l],
    a && "table-hover",
    r && "table-condensed",
    e.isTableView && t && "table-grid-lines",
    e.isTableView && o && "table-striped",
    e.isTableView && n.hasShadow && "shadow-default",
    e.isTableView && n.hasBorder && "border",
    n.hasRounded && "table-rounded",
    e.isTableView && (e.hasHeader ? "table-has-head" : "table-no-head"),
    e.isTableView && e.hasFooter && "table-has-footer",
    e.isTableView && i && "table-allow-horizontal-overflow",
    d
  );
};
export {
  N as resolveTableBaseClassName,
  f as resolveTableClassConfig,
  u as resolveTableStyleClassSwitches
};
//# sourceMappingURL=resolveTableClassConfig.js.map
