import { defineComponent as K, useSlots as N, computed as p, shallowRef as k, watch as _, openBlock as s, createBlock as d, unref as t, mergeProps as C, withCtx as r, createElementVNode as f, normalizeClass as i, createElementBlock as E, renderSlot as u, createVNode as c, createTextVNode as B, toDisplayString as D, createCommentVNode as m, withDirectives as R, Fragment as W, renderList as A, resolveDynamicComponent as F, vShow as I } from "vue";
import { wetProCardProps as z } from "./types.mjs";
import { useNamespace as H, ElCol as U, ElTooltip as j, ElIcon as L, ElRow as q, ElTabs as G, ElTabPane as J } from "element-plus";
import "../../confirm-button/index.mjs";
import "../../count-down-button/index.mjs";
import { TextEllipsis as M } from "../../ellipsis/index.mjs";
import "../../rich-text-editor/index.mjs";
import "../../form-fileds/index.mjs";
import "../../pro-form/index.mjs";
import "../../pro-table/index.mjs";
import "../../pro-descriptions/index.mjs";
import "../index.mjs";
import "../../page/index.mjs";
import "../../guide/index.mjs";
import { InfoFilled as O, ArrowRight as Q } from "../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.4.21/node_modules/@element-plus/icons-vue/dist/index.mjs";
const me = /* @__PURE__ */ K({
  name: "WetProCard",
  __name: "index",
  props: z,
  emits: ["update:collapse", "update:tabKey"],
  setup(V, { emit: $ }) {
    const v = N(), a = H("pro-card"), e = V, h = p(() => e.ghost || e.isLayout), x = p(() => {
      var l;
      return e.span && typeof e.span == "number" ? e.span : (l = e.colSpan) == null ? void 0 : l.span;
    }), b = p(() => e.span && typeof e.span == "string" ? e.span : ""), T = p(() => !!(e.title || e.tooltip || v.extra || v.header || e.collapsible)), y = $, n = k(!1);
    _(() => e.collapse, (l) => {
      l !== void 0 && (n.value = l);
    }, {
      deep: !0,
      immediate: !0
    });
    const P = () => {
      e.collapsible && (n.value = !n.value, y("update:collapse", n.value));
    }, w = k();
    _(() => e.tabKey, (l) => {
      l !== void 0 && (w.value = l);
    }, {
      deep: !0,
      immediate: !0
    });
    const S = (l) => {
      y("update:tabKey", l);
    }, g = p(() => e.tabList && e.tabList.length !== 0);
    return (l, X) => (s(), d(t(U), C(e.colSpan, {
      span: x.value,
      class: [
        t(a).b(),
        t(a).is("layout", e.isLayout),
        t(a).is("split", !!e.split),
        t(a).is("tab", g.value)
      ],
      style: {
        "--wet-card-w": b.value,
        "--wet-card-pad": h.value ? 0 : "var(--wet-card-padding,15px)",
        "--wet-card-bg-c": h.value ? "transparent" : "var(--wet-card-bg-color,#fff)",
        maxWidth: b.value,
        minWidth: b.value
      }
    }), {
      default: r(() => [
        f("div", {
          class: i([
            t(a).e("card-inner"),
            t(a).is("bordered", e.bordered && !e.isLayout),
            e.shadow && !e.isLayout && `is-${e.shadow}`
          ])
        }, [
          T.value ? (s(), E("div", {
            key: 0,
            class: i([
              t(a).e("header"),
              t(a).is("border-bottom", e.headerBordered),
              t(a).is("collapsible", e.collapsible),
              t(a).is("collapse", n.value)
            ]),
            onClick: P
          }, [
            u(l.$slots, "header", {}, () => [
              f("div", {
                class: i(t(a).em("header", "title"))
              }, [
                c(t(M), null, {
                  default: r(() => [
                    B(D(e.title), 1)
                  ]),
                  _: 1
                }),
                e.tooltip ? (s(), d(t(j), {
                  key: 0,
                  content: e.tooltip,
                  placement: "top"
                }, {
                  default: r(() => [
                    c(t(L), null, {
                      default: r(() => [
                        c(t(O))
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }, 8, ["content"])) : m("", !0)
              ], 2),
              f("div", {
                class: i([t(a).em("header", "extra")])
              }, [
                u(l.$slots, "extra"),
                e.collapsible ? (s(), d(t(L), {
                  key: 0,
                  class: i([t(a).em("header", "arrow-icon")])
                }, {
                  default: r(() => [
                    c(t(Q))
                  ]),
                  _: 1
                }, 8, ["class"])) : m("", !0)
              ], 2)
            ])
          ], 2)) : m("", !0),
          R(c(t(q), {
            gutter: e.gutter,
            class: i([
              t(a).e("body"),
              t(a).is(`split-${e.split}`, !!e.split)
            ])
          }, {
            default: r(() => [
              u(l.$slots, "default"),
              g.value ? (s(), d(t(G), C({ key: 0 }, e.tabProps, {
                style: { width: "100%", "margin-top": "-10px" },
                modelValue: w.value,
                "onUpdate:modelValue": S
              }), {
                default: r(() => [
                  (s(!0), E(W, null, A(e.tabList, (o) => (s(), d(t(J), {
                    name: o.key,
                    label: o.tab,
                    closable: o.closable,
                    disabled: o.disabled,
                    key: o.key
                  }, {
                    default: r(() => [
                      o.children ? (s(), d(F(o.children), { key: 0 })) : m("", !0),
                      u(l.$slots, o.key)
                    ]),
                    _: 2
                  }, 1032, ["name", "label", "closable", "disabled"]))), 128))
                ]),
                _: 3
              }, 16, ["modelValue"])) : m("", !0)
            ]),
            _: 3
          }, 8, ["gutter", "class"]), [
            [I, !n.value]
          ]),
          f("div", {
            class: i([t(a).e("footer")])
          }, [
            u(l.$slots, "footer")
          ], 2)
        ], 2)
      ]),
      _: 3
    }, 16, ["span", "class", "style"]));
  }
});
export {
  me as default
};
