import * as c from "react";
import O from "../../../classnames/index.mjs";
import "../../../rc-dialog/es/DialogWrap.mjs";
import h from "../../../rc-dialog/es/Dialog/Content/Panel.mjs";
import { withPureRenderTheme as g } from "../_util/PurePanel.mjs";
import "../config-provider/index.mjs";
import { ConfirmContent as j } from "./ConfirmDialog.mjs";
import { Footer as S, renderCloseIcon as v } from "./shared.mjs";
import I from "./style/index.mjs";
import w from "../config-provider/hooks/useCSSVarCls.mjs";
import { ConfigContext as $ } from "../config-provider/context.mjs";
var E = globalThis && globalThis.__rest || function(o, s) {
  var l = {};
  for (var t in o)
    Object.prototype.hasOwnProperty.call(o, t) && s.indexOf(t) < 0 && (l[t] = o[t]);
  if (o != null && typeof Object.getOwnPropertySymbols == "function")
    for (var e = 0, t = Object.getOwnPropertySymbols(o); e < t.length; e++)
      s.indexOf(t[e]) < 0 && Object.prototype.propertyIsEnumerable.call(o, t[e]) && (l[t[e]] = o[t[e]]);
  return l;
};
const N = (o) => {
  const {
    prefixCls: s,
    className: l,
    closeIcon: t,
    closable: e,
    type: n,
    title: u,
    children: f,
    footer: b
  } = o, P = E(o, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]), {
    getPrefixCls: m
  } = c.useContext($), p = m(), r = s || m("modal"), C = w(p), [x, d, y] = I(r, C), i = `${r}-confirm`;
  let a = {};
  return n ? a = {
    closable: e ?? !1,
    title: "",
    footer: "",
    children: /* @__PURE__ */ c.createElement(j, Object.assign({}, o, {
      prefixCls: r,
      confirmPrefixCls: i,
      rootPrefixCls: p,
      content: f
    }))
  } : a = {
    closable: e ?? !0,
    title: u,
    footer: b !== null && /* @__PURE__ */ c.createElement(S, Object.assign({}, o)),
    children: f
  }, x(/* @__PURE__ */ c.createElement(h, Object.assign({
    prefixCls: r,
    className: O(d, `${r}-pure-panel`, n && i, n && `${i}-${n}`, l, y, C)
  }, P, {
    closeIcon: v(r, t),
    closable: e
  }, a)));
}, D = g(N);
export {
  D as default
};
