import { defineComponent as S, useSlots as _, computed as s, openBlock as i, createElementBlock as r, normalizeStyle as g, normalizeClass as h, unref as l, createBlock as p, mergeProps as C, createSlots as $, withCtx as a, renderSlot as f, isVNode as c, resolveDynamicComponent as d, toDisplayString as m, createCommentVNode as u } from "vue";
import { omit as B } from "lodash-unified";
import "../../config-provider/index.mjs";
import "../ap-title/ApTitle.vue.mjs";
import N from "./style/index.mjs";
import { useNamespace as b } from "../../config-provider/hooks/use-namespace.mjs";
import z from "../ap-title/ApTitle.vue2.mjs";
const D = { key: 2 }, V = { key: 2 }, F = /* @__PURE__ */ S({
  __name: "ApCard",
  props: {
    titleProps: {},
    padding: {}
  },
  setup(x) {
    const e = x, t = _(), { b: n } = b("ap-card"), P = N("ap-card"), y = s(
      () => B(e?.titleProps || {}, ["prefix", "suffix"])
    ), k = s(() => Object.keys(e?.titleProps || {})?.length), v = s(() => e.padding ?? "var(--ap-card-padding, 12px 16px)");
    return (o, j) => (i(), r("div", {
      class: h([l(n)(), l(P)]),
      style: g({
        padding: v.value
      })
    }, [
      k.value || t?.titlePrefix || t?.titleSuffix ? (i(), p(z, C({
        key: 0,
        class: [`${l(n)()}-title`]
      }, {
        ...y.value
      }), $({ _: 2 }, [
        t?.titleSuffix || e?.titleProps?.suffix ? {
          name: "suffix",
          fn: a(() => [
            t?.titleSuffix ? f(o.$slots, "titleSuffix", { key: 0 }) : c(e?.titleProps?.suffix) ? (i(), p(d(e?.titleProps?.suffix), { key: 1 })) : (i(), r("div", D, m(e?.titleProps?.suffix), 1))
          ]),
          key: "0"
        } : void 0,
        t?.titlePrefix || e?.titleProps?.prefix ? {
          name: "prefix",
          fn: a(() => [
            t?.titlePrefix ? f(o.$slots, "titlePrefix", { key: 0 }) : u("", !0),
            c(e?.titleProps?.prefix) ? (i(), p(d(e?.titleProps?.prefix), { key: 1 })) : (i(), r("div", V, m(e?.titleProps?.prefix), 1))
          ]),
          key: "1"
        } : void 0
      ]), 1040, ["class"])) : u("", !0),
      f(o.$slots, "default")
    ], 6));
  }
});
export {
  F as default
};
