import { g as Ce, m as Te, d as r, r as ze, ag as A, t as ne, i as ie, u as $, ch as I, c as D, ci as X, _ as g, cj as H, o as oe, ck as s, cl as re, cm as y, am as Be, av as le, h as we, bk as Me, P as x, cn as Ae, co as Ie, aX as j, cp as q } from "./index2.js";
import { defineComponent as m, computed as T, createVNode as i, isVNode as ae } from "vue";
const De = (e) => {
  const {
    antCls: t,
    componentCls: a,
    cardHeadHeight: n,
    cardPaddingBase: o,
    cardHeadTabsMarginBottom: d
  } = e;
  return r(r({
    display: "flex",
    justifyContent: "center",
    flexDirection: "column",
    minHeight: n,
    marginBottom: -1,
    padding: `0 ${o}px`,
    color: e.colorTextHeading,
    fontWeight: e.fontWeightStrong,
    fontSize: e.fontSizeLG,
    background: "transparent",
    borderBottom: `${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`,
    borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`
  }, A()), {
    "&-wrapper": {
      width: "100%",
      display: "flex",
      alignItems: "center"
    },
    "&-title": r(r({
      display: "inline-block",
      flex: 1
    }, ne), {
      [`
          > ${a}-typography,
          > ${a}-typography-edit-content
        `]: {
        insetInlineStart: 0,
        marginTop: 0,
        marginBottom: 0
      }
    }),
    [`${t}-tabs-top`]: {
      clear: "both",
      marginBottom: d,
      color: e.colorText,
      fontWeight: "normal",
      fontSize: e.fontSize,
      "&-bar": {
        borderBottom: `${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`
      }
    }
  });
}, He = (e) => {
  const {
    cardPaddingBase: t,
    colorBorderSecondary: a,
    cardShadow: n,
    lineWidth: o
  } = e;
  return {
    width: "33.33%",
    padding: t,
    border: 0,
    borderRadius: 0,
    boxShadow: `
      ${o}px 0 0 0 ${a},
      0 ${o}px 0 0 ${a},
      ${o}px ${o}px 0 0 ${a},
      ${o}px 0 0 0 ${a} inset,
      0 ${o}px 0 0 ${a} inset;
    `,
    transition: `all ${e.motionDurationMid}`,
    "&-hoverable:hover": {
      position: "relative",
      zIndex: 1,
      boxShadow: n
    }
  };
}, Re = (e) => {
  const {
    componentCls: t,
    iconCls: a,
    cardActionsLiMargin: n,
    cardActionsIconSize: o,
    colorBorderSecondary: d
  } = e;
  return r(r({
    margin: 0,
    padding: 0,
    listStyle: "none",
    background: e.colorBgContainer,
    borderTop: `${e.lineWidth}px ${e.lineType} ${d}`,
    display: "flex",
    borderRadius: `0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px `
  }, A()), {
    "& > li": {
      margin: n,
      color: e.colorTextDescription,
      textAlign: "center",
      "> span": {
        position: "relative",
        display: "block",
        minWidth: e.cardActionsIconSize * 2,
        fontSize: e.fontSize,
        lineHeight: e.lineHeight,
        cursor: "pointer",
        "&:hover": {
          color: e.colorPrimary,
          transition: `color ${e.motionDurationMid}`
        },
        [`a:not(${t}-btn), > ${a}`]: {
          display: "inline-block",
          width: "100%",
          color: e.colorTextDescription,
          lineHeight: `${e.fontSize * e.lineHeight}px`,
          transition: `color ${e.motionDurationMid}`,
          "&:hover": {
            color: e.colorPrimary
          }
        },
        [`> ${a}`]: {
          fontSize: o,
          lineHeight: `${o * e.lineHeight}px`
        }
      },
      "&:not(:last-child)": {
        borderInlineEnd: `${e.lineWidth}px ${e.lineType} ${d}`
      }
    }
  });
}, Pe = (e) => r(r({
  margin: `-${e.marginXXS}px 0`,
  display: "flex"
}, A()), {
  "&-avatar": {
    paddingInlineEnd: e.padding
  },
  "&-detail": {
    overflow: "hidden",
    flex: 1,
    "> div:not(:last-child)": {
      marginBottom: e.marginXS
    }
  },
  "&-title": r({
    color: e.colorTextHeading,
    fontWeight: e.fontWeightStrong,
    fontSize: e.fontSizeLG
  }, ne),
  "&-description": {
    color: e.colorTextDescription
  }
}), Ge = (e) => {
  const {
    componentCls: t,
    cardPaddingBase: a,
    colorFillAlter: n
  } = e;
  return {
    [`${t}-head`]: {
      padding: `0 ${a}px`,
      background: n,
      "&-title": {
        fontSize: e.fontSize
      }
    },
    [`${t}-body`]: {
      padding: `${e.padding}px ${a}px`
    }
  };
}, Le = (e) => {
  const {
    componentCls: t
  } = e;
  return {
    overflow: "hidden",
    [`${t}-body`]: {
      userSelect: "none"
    }
  };
}, Ee = (e) => {
  const {
    componentCls: t,
    cardShadow: a,
    cardHeadPadding: n,
    colorBorderSecondary: o,
    boxShadow: d,
    cardPaddingBase: v
  } = e;
  return {
    [t]: r(r({}, ze(e)), {
      position: "relative",
      background: e.colorBgContainer,
      borderRadius: e.borderRadiusLG,
      [`&:not(${t}-bordered)`]: {
        boxShadow: d
      },
      [`${t}-head`]: De(e),
      [`${t}-extra`]: {
        // https://stackoverflow.com/a/22429853/3040605
        marginInlineStart: "auto",
        color: "",
        fontWeight: "normal",
        fontSize: e.fontSize
      },
      [`${t}-body`]: r({
        padding: v,
        borderRadius: ` 0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`
      }, A()),
      [`${t}-grid`]: He(e),
      [`${t}-cover`]: {
        "> *": {
          display: "block",
          width: "100%"
        },
        img: {
          borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`
        }
      },
      [`${t}-actions`]: Re(e),
      [`${t}-meta`]: Pe(e)
    }),
    [`${t}-bordered`]: {
      border: `${e.lineWidth}px ${e.lineType} ${o}`,
      [`${t}-cover`]: {
        marginTop: -1,
        marginInlineStart: -1,
        marginInlineEnd: -1
      }
    },
    [`${t}-hoverable`]: {
      cursor: "pointer",
      transition: `box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,
      "&:hover": {
        borderColor: "transparent",
        boxShadow: a
      }
    },
    [`${t}-contain-grid`]: {
      [`${t}-body`]: {
        display: "flex",
        flexWrap: "wrap"
      },
      [`&:not(${t}-loading) ${t}-body`]: {
        marginBlockStart: -e.lineWidth,
        marginInlineStart: -e.lineWidth,
        padding: 0
      }
    },
    [`${t}-contain-tabs`]: {
      [`> ${t}-head`]: {
        [`${t}-head-title, ${t}-extra`]: {
          paddingTop: n
        }
      }
    },
    [`${t}-type-inner`]: Ge(e),
    [`${t}-loading`]: Le(e),
    [`${t}-rtl`]: {
      direction: "rtl"
    }
  };
}, We = (e) => {
  const {
    componentCls: t,
    cardPaddingSM: a,
    cardHeadHeightSM: n
  } = e;
  return {
    [`${t}-small`]: {
      [`> ${t}-head`]: {
        minHeight: n,
        padding: `0 ${a}px`,
        fontSize: e.fontSize,
        [`> ${t}-head-wrapper`]: {
          [`> ${t}-extra`]: {
            fontSize: e.fontSize
          }
        }
      },
      [`> ${t}-body`]: {
        padding: a
      }
    },
    [`${t}-small${t}-contain-tabs`]: {
      [`> ${t}-head`]: {
        [`${t}-head-title, ${t}-extra`]: {
          minHeight: n,
          paddingTop: 0,
          display: "flex",
          alignItems: "center"
        }
      }
    }
  };
}, _e = Ce("Card", (e) => {
  const t = Te(e, {
    cardShadow: e.boxShadowCard,
    cardHeadHeight: e.fontSizeLG * e.lineHeightLG + e.padding * 2,
    cardHeadHeightSM: e.fontSize * e.lineHeight + e.paddingXS * 2,
    cardHeadPadding: e.padding,
    cardPaddingBase: e.paddingLG,
    cardHeadTabsMarginBottom: -e.padding - e.lineWidth,
    cardActionsLiMargin: `${e.paddingSM}px 0`,
    cardActionsIconSize: e.fontSize,
    cardPaddingSM: 12
    // Fixed padding.
  });
  return [
    // Style
    Ee(t),
    // Size
    We(t)
  ];
}), Oe = () => r(r({}, H()), {
  size: String,
  block: Boolean
}), de = m({
  compatConfig: {
    MODE: 3
  },
  name: "ASkeletonButton",
  props: ie(Oe(), {
    size: "default"
  }),
  setup(e) {
    const {
      prefixCls: t
    } = $("skeleton", e), [a, n] = I(t), o = T(() => D(t.value, `${t.value}-element`, {
      [`${t.value}-active`]: e.active,
      [`${t.value}-block`]: e.block
    }, n.value));
    return () => a(i("div", {
      class: o.value
    }, [i(X, g(g({}, e), {}, {
      prefixCls: `${t.value}-button`
    }), null)]));
  }
}), se = m({
  compatConfig: {
    MODE: 3
  },
  name: "ASkeletonInput",
  props: r(r({}, oe(H(), ["shape"])), {
    size: String,
    block: Boolean
  }),
  setup(e) {
    const {
      prefixCls: t
    } = $("skeleton", e), [a, n] = I(t), o = T(() => D(t.value, `${t.value}-element`, {
      [`${t.value}-active`]: e.active,
      [`${t.value}-block`]: e.block
    }, n.value));
    return () => a(i("div", {
      class: o.value
    }, [i(X, g(g({}, e), {}, {
      prefixCls: `${t.value}-input`
    }), null)]));
  }
}), je = "M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z", ce = m({
  compatConfig: {
    MODE: 3
  },
  name: "ASkeletonImage",
  props: oe(H(), ["size", "shape", "active"]),
  setup(e) {
    const {
      prefixCls: t
    } = $("skeleton", e), [a, n] = I(t), o = T(() => D(t.value, `${t.value}-element`, n.value));
    return () => a(i("div", {
      class: o.value
    }, [i("div", {
      class: `${t.value}-image`
    }, [i("svg", {
      viewBox: "0 0 1098 1024",
      xmlns: "http://www.w3.org/2000/svg",
      class: `${t.value}-image-svg`
    }, [i("path", {
      d: je,
      class: `${t.value}-image-path`
    }, null)])])]));
  }
}), qe = () => r(r({}, H()), {
  shape: String
}), ue = m({
  compatConfig: {
    MODE: 3
  },
  name: "ASkeletonAvatar",
  props: ie(qe(), {
    size: "default",
    shape: "circle"
  }),
  setup(e) {
    const {
      prefixCls: t
    } = $("skeleton", e), [a, n] = I(t), o = T(() => D(t.value, `${t.value}-element`, {
      [`${t.value}-active`]: e.active
    }, n.value));
    return () => a(i("div", {
      class: o.value
    }, [i(X, g(g({}, e), {}, {
      prefixCls: `${t.value}-avatar`
    }), null)]));
  }
});
s.Button = de;
s.Avatar = ue;
s.Input = se;
s.Image = ce;
s.Title = re;
s.install = function(e) {
  return e.component(s.name, s), e.component(s.Button.name, de), e.component(s.Avatar.name, ue), e.component(s.Input.name, se), e.component(s.Image.name, ce), e.component(s.Title.name, re), e;
};
const {
  TabPane: Ke
} = le, Ne = () => ({
  prefixCls: String,
  title: x.any,
  extra: x.any,
  bordered: {
    type: Boolean,
    default: !0
  },
  bodyStyle: {
    type: Object,
    default: void 0
  },
  headStyle: {
    type: Object,
    default: void 0
  },
  loading: {
    type: Boolean,
    default: !1
  },
  hoverable: {
    type: Boolean,
    default: !1
  },
  type: {
    type: String
  },
  size: {
    type: String
  },
  actions: x.any,
  tabList: {
    type: Array
  },
  tabBarExtraContent: x.any,
  activeTabKey: String,
  defaultActiveTabKey: String,
  cover: x.any,
  onTabChange: {
    type: Function
  }
}), C = m({
  compatConfig: {
    MODE: 3
  },
  name: "ACard",
  inheritAttrs: !1,
  props: Ne(),
  slots: Object,
  setup(e, t) {
    let {
      slots: a,
      attrs: n
    } = t;
    const {
      prefixCls: o,
      direction: d,
      size: v
    } = $("card", e), [z, R] = _e(o), B = (p) => p.map((c, h) => ae(c) && !Ae(c) || !ae(c) ? i("li", {
      style: {
        width: `${100 / p.length}%`
      },
      key: `action-${h}`
    }, [i("span", null, [c])]) : null), w = (p) => {
      var u;
      (u = e.onTabChange) === null || u === void 0 || u.call(e, p);
    }, P = function() {
      let p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], u;
      return p.forEach((c) => {
        c && Ie(c.type) && c.type.__ANT_CARD_GRID && (u = !0);
      }), u;
    };
    return () => {
      var p, u, c, h, G, L;
      const {
        headStyle: pe = {},
        bodyStyle: ge = {},
        loading: F,
        bordered: ve = !0,
        type: V,
        tabList: b,
        hoverable: $e,
        activeTabKey: U,
        defaultActiveTabKey: me,
        tabBarExtraContent: J = y((p = a.tabBarExtraContent) === null || p === void 0 ? void 0 : p.call(a)),
        title: E = y((u = a.title) === null || u === void 0 ? void 0 : u.call(a)),
        extra: W = y((c = a.extra) === null || c === void 0 ? void 0 : c.call(a)),
        actions: _ = y((h = a.actions) === null || h === void 0 ? void 0 : h.call(a)),
        cover: Q = y((G = a.cover) === null || G === void 0 ? void 0 : G.call(a))
      } = e, S = Be((L = a.default) === null || L === void 0 ? void 0 : L.call(a)), l = o.value, he = {
        [`${l}`]: !0,
        [R.value]: !0,
        [`${l}-loading`]: F,
        [`${l}-bordered`]: ve,
        [`${l}-hoverable`]: !!$e,
        [`${l}-contain-grid`]: P(S),
        [`${l}-contain-tabs`]: b && b.length,
        [`${l}-${v.value}`]: v.value,
        [`${l}-type-${V}`]: !!V,
        [`${l}-rtl`]: d.value === "rtl"
      }, be = i(s, {
        loading: !0,
        active: !0,
        paragraph: {
          rows: 4
        },
        title: !1
      }, {
        default: () => [S]
      }), Y = U !== void 0, Se = {
        size: "large",
        [Y ? "activeKey" : "defaultActiveKey"]: Y ? U : me,
        onChange: w,
        class: `${l}-head-tabs`
      };
      let Z;
      const k = b && b.length ? i(le, Se, {
        default: () => [b.map((f) => {
          const {
            tab: ee,
            slots: M
          } = f, te = M == null ? void 0 : M.tab;
          we(!M, "Card", "tabList slots is deprecated, Please use `customTab` instead.");
          let O = ee !== void 0 ? ee : a[te] ? a[te](f) : null;
          return O = Me(a, "customTab", f, () => [O]), i(Ke, {
            tab: O,
            key: f.key,
            disabled: f.disabled
          }, null);
        })],
        rightExtra: J ? () => J : null
      }) : null;
      (E || W || k) && (Z = i("div", {
        class: `${l}-head`,
        style: pe
      }, [i("div", {
        class: `${l}-head-wrapper`
      }, [E && i("div", {
        class: `${l}-head-title`
      }, [E]), W && i("div", {
        class: `${l}-extra`
      }, [W])]), k]));
      const fe = Q ? i("div", {
        class: `${l}-cover`
      }, [Q]) : null, ye = i("div", {
        class: `${l}-body`,
        style: ge
      }, [F ? be : S]), xe = _ && _.length ? i("ul", {
        class: `${l}-actions`
      }, [B(_)]) : null;
      return z(i("div", g(g({
        ref: "cardContainerRef"
      }, n), {}, {
        class: [he, n.class]
      }), [Z, fe, S && S.length ? ye : null, xe]));
    };
  }
}), Xe = () => ({
  prefixCls: String,
  title: q(),
  description: q(),
  avatar: q()
}), K = m({
  compatConfig: {
    MODE: 3
  },
  name: "ACardMeta",
  props: Xe(),
  slots: Object,
  setup(e, t) {
    let {
      slots: a
    } = t;
    const {
      prefixCls: n
    } = $("card", e);
    return () => {
      const o = {
        [`${n.value}-meta`]: !0
      }, d = j(a, e, "avatar"), v = j(a, e, "title"), z = j(a, e, "description"), R = d ? i("div", {
        class: `${n.value}-meta-avatar`
      }, [d]) : null, B = v ? i("div", {
        class: `${n.value}-meta-title`
      }, [v]) : null, w = z ? i("div", {
        class: `${n.value}-meta-description`
      }, [z]) : null, P = B || w ? i("div", {
        class: `${n.value}-meta-detail`
      }, [B, w]) : null;
      return i("div", {
        class: o
      }, [R, P]);
    };
  }
}), Fe = () => ({
  prefixCls: String,
  hoverable: {
    type: Boolean,
    default: !0
  }
}), N = m({
  compatConfig: {
    MODE: 3
  },
  name: "ACardGrid",
  __ANT_CARD_GRID: !0,
  props: Fe(),
  setup(e, t) {
    let {
      slots: a
    } = t;
    const {
      prefixCls: n
    } = $("card", e), o = T(() => ({
      [`${n.value}-grid`]: !0,
      [`${n.value}-grid-hoverable`]: e.hoverable
    }));
    return () => {
      var d;
      return i("div", {
        class: o.value
      }, [(d = a.default) === null || d === void 0 ? void 0 : d.call(a)]);
    };
  }
});
C.Meta = K;
C.Grid = N;
C.install = function(e) {
  return e.component(C.name, C), e.component(K.name, K), e.component(N.name, N), e;
};
export {
  C
};
