import { defineComponent as L, useSlots as O, computed as a, unref as t, isVNode as $, createVNode as z, Fragment as D, openBlock as o, createElementBlock as d, normalizeClass as r, normalizeStyle as E, createBlock as p, resolveDynamicComponent as I, createCommentVNode as C, createElementVNode as U, mergeProps as B, withCtx as u, renderSlot as i, createSlots as w, createTextVNode as F, toDisplayString as G, renderList as R, normalizeProps as q, guardReactiveProps as H } from "vue";
import { TypographyLink as J, TypographyText as K } from "@aplus-frontend/antdv";
import { isUndefined as s, omit as m, isString as M } from "lodash-unified";
import "../config-provider/index.mjs";
import "../utils/index.mjs";
import { useInjectApTextGroup as Q } from "./context.mjs";
import W from "./style/index.mjs";
import { useNamespace as X } from "../config-provider/hooks/use-namespace.mjs";
import { isDef as Y } from "../utils/is.mjs";
const ce = /* @__PURE__ */ L({
  name: "ApText",
  __name: "index",
  props: {
    ellipsis: {
      type: [Boolean, Object]
    },
    delete: {
      type: Boolean
    },
    type: {},
    code: {
      type: Boolean
    },
    mark: {
      type: Boolean
    },
    strong: {
      type: Boolean
    },
    content: {},
    underline: {
      type: Boolean
    },
    disabled: {
      type: Boolean
    },
    prefixCls: {},
    keyboard: {
      type: Boolean
    },
    editable: {
      type: [Boolean, Object]
    },
    copyable: {
      type: [Boolean, Object]
    },
    "onUpdate:content": {},
    label: {},
    colon: {
      type: Boolean,
      default: void 0
    },
    vertical: {
      type: Boolean,
      default: void 0
    },
    labelStyle: {
      default: void 0
    },
    link: {
      type: [Boolean, String]
    },
    linkProps: {
      default: () => ({})
    },
    onClickContent: {},
    class: {},
    style: {}
  },
  setup(n) {
    const f = O(), e = n, {
      b: g,
      e: c,
      em: S,
      m: P
    } = X("ap-text"), h = W("ap-text"), {
      colon: y,
      vertical: k,
      labelStyle: x
    } = Q(), N = a(() => s(e.colon) ? s(y?.value) ? !0 : y.value : e.colon), T = a(() => s(e.vertical) ? s(k?.value) ? !1 : k.value : e.vertical), V = a(() => {
      const l = t(x) || {};
      return Object.assign(l, e.labelStyle || {}), l;
    }), b = a(() => {
      if (e.label)
        return $(e.label) ? e.label : z(D, null, [e.label]);
    }), j = a(() => {
      const l = Y(e.linkProps.ellipsis) ? e.linkProps.ellipsis : !!e.ellipsis;
      return {
        href: M(e.link) ? e.link : void 0,
        ...m(e, ["linkProps"]),
        ...e.linkProps,
        ellipsis: l
      };
    });
    return (l, Z) => (o(), d("div", {
      class: r([t(g)(), {
        [t(P)("vertical")]: T.value
      }, t(h)])
    }, [b.value ? (o(), d("span", {
      key: 0,
      class: r([t(c)("label"), {
        [t(S)("label", "no-colon")]: !N.value
      }]),
      style: E(V.value)
    }, [(o(), p(I(b.value)))], 6)) : C("", !0), U("div", {
      class: r(t(c)("content"))
    }, [n.link ? (o(), p(t(J), B({
      key: 0
    }, j.value, {
      onClick: n.onClickContent
    }), {
      default: u(() => [i(l.$slots, "default")]),
      _: 3
    }, 16, ["onClick"])) : (o(), p(t(K), B({
      key: 1
    }, t(m)(e, ["label", "colon", "link", "linkProps", "vertical", "labelStyle"]), {
      onClick: n.onClickContent
    }), w({
      default: u(() => [i(l.$slots, "default", {}, () => [F(G(n.content || "--"), 1)])]),
      _: 2
    }, [R(t(m)(f, ["default", "addonAfter"]), (_, v) => ({
      name: v,
      fn: u((A) => [i(l.$slots, v, q(H(A || {})))])
    }))]), 1040, ["onClick"])), f.addonAfter ? (o(), d("div", {
      key: 2,
      class: r(t(c)("content-addon-after"))
    }, [i(l.$slots, "addonAfter")], 2)) : C("", !0)], 2)], 2));
  }
});
export {
  ce as default
};
