import B from "../../../classnames/index.mjs";
import * as s from "react";
import "../config-provider/index.mjs";
import I from "./Avatar.mjs";
import z from "./Button.mjs";
import V from "./Element.mjs";
import A from "./Image.mjs";
import T from "./Input.mjs";
import q from "./Node.mjs";
import D from "./Paragraph.mjs";
import R from "./Title.mjs";
import _ from "./style/index.mjs";
import { ConfigContext as F } from "../config-provider/context.mjs";
function f(e) {
  return e && typeof e == "object" ? e : {};
}
function G(e, r) {
  return e && !r ? {
    size: "large",
    shape: "square"
  } : {
    size: "large",
    shape: "circle"
  };
}
function H(e, r) {
  return !e && r ? {
    width: "38%"
  } : e && r ? {
    width: "50%"
  } : {};
}
function J(e, r) {
  const o = {};
  return (!e || !r) && (o.width = "61%"), !e && r ? o.rows = 3 : o.rows = 2, o;
}
const a = (e) => {
  const {
    prefixCls: r,
    loading: o,
    className: b,
    rootClassName: j,
    style: O,
    children: u,
    avatar: g = !1,
    title: d = !0,
    paragraph: v = !0,
    active: P,
    round: S
  } = e, {
    getPrefixCls: $,
    direction: k,
    skeleton: n
  } = s.useContext(F), t = $("skeleton", r), [x, E, w] = _(t);
  if (o || !("loading" in e)) {
    const i = !!g, l = !!d, c = !!v;
    let h;
    if (i) {
      const m = Object.assign(Object.assign({
        prefixCls: `${t}-avatar`
      }, G(l, c)), f(g));
      h = /* @__PURE__ */ s.createElement("div", {
        className: `${t}-header`
      }, /* @__PURE__ */ s.createElement(V, Object.assign({}, m)));
    }
    let N;
    if (l || c) {
      let m;
      if (l) {
        const p = Object.assign(Object.assign({
          prefixCls: `${t}-title`
        }, H(i, c)), f(d));
        m = /* @__PURE__ */ s.createElement(R, Object.assign({}, p));
      }
      let C;
      if (c) {
        const p = Object.assign(Object.assign({
          prefixCls: `${t}-paragraph`
        }, J(i, l)), f(v));
        C = /* @__PURE__ */ s.createElement(D, Object.assign({}, p));
      }
      N = /* @__PURE__ */ s.createElement("div", {
        className: `${t}-content`
      }, m, C);
    }
    const y = B(t, {
      [`${t}-with-avatar`]: i,
      [`${t}-active`]: P,
      [`${t}-rtl`]: k === "rtl",
      [`${t}-round`]: S
    }, n == null ? void 0 : n.className, b, j, E, w);
    return x(/* @__PURE__ */ s.createElement("div", {
      className: y,
      style: Object.assign(Object.assign({}, n == null ? void 0 : n.style), O)
    }, h, N));
  }
  return typeof u < "u" ? u : null;
};
a.Button = z;
a.Avatar = I;
a.Input = T;
a.Image = A;
a.Node = q;
process.env.NODE_ENV !== "production" && (a.displayName = "Skeleton");
const se = a;
export {
  se as default
};
