import * as e from "react";
import _ from "../../../@ant-design/icons/es/icons/CheckCircleFilled.mjs";
import h from "../../../@ant-design/icons/es/icons/CloseCircleFilled.mjs";
import y from "../../../@ant-design/icons/es/icons/ExclamationCircleFilled.mjs";
import b from "../../../@ant-design/icons/es/icons/WarningFilled.mjs";
import d from "../../../classnames/index.mjs";
import { devUseWarning as D } from "../_util/warning.mjs";
import "../config-provider/index.mjs";
import I from "./noFound.mjs";
import O from "./serverError.mjs";
import P from "./style/index.mjs";
import V from "./unauthorized.mjs";
import { ConfigContext as F } from "../config-provider/context.mjs";
const M = {
  success: _,
  error: h,
  info: y,
  warning: b
}, c = {
  404: I,
  500: O,
  403: V
}, k = Object.keys(c), G = (o) => {
  let {
    prefixCls: r,
    icon: t,
    status: i
  } = o;
  const l = d(`${r}-icon`);
  if (process.env.NODE_ENV !== "production") {
    const a = D("Result");
    process.env.NODE_ENV !== "production" && a(!(typeof t == "string" && t.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${t}\` at https://ant.design/components/icon`);
  }
  if (k.includes(`${i}`)) {
    const a = c[i];
    return /* @__PURE__ */ e.createElement("div", {
      className: `${l} ${r}-image`
    }, /* @__PURE__ */ e.createElement(a, null));
  }
  const u = /* @__PURE__ */ e.createElement(M[i]);
  return t === null || t === !1 ? null : /* @__PURE__ */ e.createElement("div", {
    className: l
  }, t || u);
}, T = (o) => {
  let {
    prefixCls: r,
    extra: t
  } = o;
  return t ? /* @__PURE__ */ e.createElement("div", {
    className: `${r}-extra`
  }, t) : null;
}, m = (o) => {
  let {
    prefixCls: r,
    className: t,
    rootClassName: i,
    subTitle: l,
    title: u,
    style: a,
    children: p,
    status: E = "info",
    icon: f,
    extra: N
  } = o;
  const {
    getPrefixCls: C,
    direction: x,
    result: n
  } = e.useContext(F), s = C("result", r), [v, g, $] = P(s), R = d(s, `${s}-${E}`, t, n == null ? void 0 : n.className, i, {
    [`${s}-rtl`]: x === "rtl"
  }, g, $), S = Object.assign(Object.assign({}, n == null ? void 0 : n.style), a);
  return v(/* @__PURE__ */ e.createElement("div", {
    className: R,
    style: S
  }, /* @__PURE__ */ e.createElement(G, {
    prefixCls: s,
    status: E,
    icon: f
  }), /* @__PURE__ */ e.createElement("div", {
    className: `${s}-title`
  }, u), l && /* @__PURE__ */ e.createElement("div", {
    className: `${s}-subtitle`
  }, l), /* @__PURE__ */ e.createElement(T, {
    prefixCls: s,
    extra: N
  }), p && /* @__PURE__ */ e.createElement("div", {
    className: `${s}-content`
  }, p)));
};
m.PRESENTED_IMAGE_403 = c[403];
m.PRESENTED_IMAGE_404 = c[404];
m.PRESENTED_IMAGE_500 = c[500];
process.env.NODE_ENV !== "production" && (m.displayName = "Result");
const Q = m;
export {
  c as ExceptionMap,
  M as IconMap,
  Q as default
};
