import l from "../../../@babel/runtime/helpers/esm/objectSpread2.mjs";
import { useContext as S } from "../../../@rc-component/context/es/context.mjs";
import "react";
import "../../../rc-util/node_modules/react-is/index.mjs";
import B from "../context/TableContext.mjs";
import { getColumnsKey as P } from "../utils/valueUtil.mjs";
import j from "../../../rc-util/es/hooks/useEvent.mjs";
import "../../../rc-util/es/hooks/useLayoutEffect.mjs";
import "../../../rc-util/es/warning.mjs";
import z from "../../../classnames/index.mjs";
function U(n, y, s, N) {
  var e = S(B, ["prefixCls", "fixedInfoList", "flattenColumns", "expandableType", "expandRowByClick", "onTriggerExpand", "rowClassName", "expandedRowClassName", "indentSize", "expandIcon", "expandedRowRender", "expandIconColumnIndex", "expandedKeys", "childrenColumnName", "rowExpandable", "onRow"]), b = e.flattenColumns, m = e.expandableType, x = e.expandedKeys, u = e.childrenColumnName, C = e.onTriggerExpand, f = e.rowExpandable, p = e.onRow, R = e.expandRowByClick, o = e.rowClassName, w = m === "nest", v = m === "row" && (!f || f(n)), c = v || w, h = x && x.has(y), T = u && n && n[u], K = j(C), a = p == null ? void 0 : p(n, s), d = a == null ? void 0 : a.onClick, k = function(g) {
    R && c && C(n, g);
    for (var t = arguments.length, E = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
      E[r - 1] = arguments[r];
    d == null || d.apply(void 0, [g].concat(E));
  }, i;
  typeof o == "string" ? i = o : typeof o == "function" && (i = o(n, s, N));
  var I = P(b);
  return l(l({}, e), {}, {
    columnsKey: I,
    nestExpandable: w,
    expanded: h,
    hasNestChildren: T,
    record: n,
    onTriggerExpand: K,
    rowSupportExpand: v,
    expandable: c,
    rowProps: l(l({}, a), {}, {
      className: z(i, a == null ? void 0 : a.className),
      onClick: k
    })
  });
}
export {
  U as default
};
