import { defineComponent as y, computed as s, openBlock as r, createElementBlock as u, normalizeClass as i, unref as e, createElementVNode as a, renderSlot as c, Fragment as C, toDisplayString as M, createBlock as v, withCtx as k, createVNode as x, normalizeStyle as I, createCommentVNode as S } from "vue";
import { QuestionCircleOutlined as T } from "@ant-design/icons-vue";
import { Tooltip as $ } from "@aplus-frontend/antdv";
import "../../config-provider/index.mjs";
import N from "./style/index.mjs";
import { useNamespace as A } from "../../config-provider/hooks/use-namespace.mjs";
import { useGlobalConfig as B } from "../../config-provider/hooks/use-global-config.mjs";
const O = /* @__PURE__ */ y({
  name: "ApTitle",
  __name: "ApTitle",
  props: {
    title: { default: "" },
    helpMessage: { default: "" },
    helpIconColor: { default: "" },
    placement: { default: "top" },
    trigger: { default: "hover" },
    uiMode: {}
  },
  setup(t) {
    const o = t, { b: m, e: n, m: p } = A("ap-title"), d = N("ap-title"), f = B("apTitle", { uiMode: "aplus" }), g = s(() => {
      const l = o.uiMode || f.value?.uiMode;
      return l === "aplus" ? "user" : l;
    }), h = s(() => o.helpIconColor ? {
      color: `${o.helpIconColor}`
    } : {});
    return (l, V) => (r(), u("div", {
      class: i([e(m)(), `${e(p)(g.value)}`, e(d)])
    }, [
      a("div", {
        class: i(e(n)("prefix"))
      }, [
        l.$slots.prefix ? c(l.$slots, "prefix", { key: 0 }) : (r(), u(C, { key: 1 }, [
          a("span", null, M(t.title), 1),
          t.helpMessage ? (r(), v(e($), {
            key: 0,
            title: t.helpMessage,
            placement: t.placement,
            trigger: t.trigger
          }, {
            default: k(() => [
              x(e(T), {
                style: I(h.value)
              }, null, 8, ["style"])
            ]),
            _: 1
          }, 8, ["title", "placement", "trigger"])) : S("", !0)
        ], 64))
      ], 2),
      a("div", {
        class: i(e(n)("suffix"))
      }, [
        c(l.$slots, "suffix")
      ], 2)
    ], 2));
  }
});
export {
  O as default
};
