import { defineComponent as r, computed as l, createElementBlock as a, createCommentVNode as y, openBlock as s, normalizeStyle as o, createElementVNode as S, renderSlot as x, normalizeClass as d, toDisplayString as f } from "vue";
import { Utils as w } from "../utils/utils.mjs";
const u = ["ztitle"], v = /* @__PURE__ */ r({
  __name: "Text",
  props: {
    textStyle: {},
    text: {}
  },
  setup(e) {
    const i = l(() => e.textStyle.textOverflow && e.textStyle.textOverflow.enable ? e.textStyle.textOverflow.displayLines === 1 ? "text-overflow-ellipsis" : "text-overflow-ellipsis-2" : ""), n = l(() => (e.textStyle.fontFamily && w.installFont(e.textStyle.fontFamily), e.textStyle.fontFamily));
    return (t, m) => t.textStyle ? (s(), a("p", {
      key: 0,
      class: "text",
      style: o({
        "--font-style": t.textStyle.fontStyle,
        "--font-family": n.value,
        "--color": t.textStyle.color.includes("linear-gradient") ? "transparent" : t.textStyle.color,
        "--background-image": t.textStyle.color.includes("linear-gradient") ? t.textStyle.color : "none",
        "--webkit-background-clip": t.textStyle.color.includes("linear-gradient") ? "text" : "",
        "--font-size": `${t.textStyle.fontSize}px`,
        "--font-weight": t.textStyle.fontWeight,
        "--align-items": t.textStyle.alignItems,
        "--text-align": t.textStyle.textAlign,
        "--justify-content": t.textStyle.justifyContent,
        "-webkit-text-stroke-color": t.textStyle["-webkit-text-stroke-color"],
        "-webkit-text-stroke-width": `${t.textStyle["-webkit-text-stroke-width"]}px`,
        "--letter-spacing": `${t.textStyle.letterSpacing}px`,
        "--line-height": t.textStyle.lineHeight,
        "--text-shadow": t.textStyle.textShadow.show ? `${t.textStyle.textShadow.x}px ${t.textStyle.textShadow.y}px ${t.textStyle.textShadow.value}px ${t.textStyle.textShadow.color}` : void 0
      })
    }, [
      S("span", {
        class: d(["value", i.value]),
        ztitle: t.textStyle.color.includes("linear-gradient") ? t.text : "",
        style: o({
          "--text-overflow-ellipsis-lines": t.textStyle.textOverflow && t.textStyle.textOverflow.enable ? t.textStyle.textOverflow.displayLines : void 0
        })
      }, f(t.text), 15, u),
      x(t.$slots, "default", {}, void 0, !0)
    ], 4)) : y("", !0);
  }
});
export {
  v as default
};
