import { defineComponent as c, createVNode as e, Fragment as p } from "vue";
import "../../../config-provider/index.mjs";
import { ApCopy as d } from "../../ap-copy/index.mjs";
import { isConstLabel as v, convertValue as n, isVNodeOrFunction as C, renderValue as k } from "../utils.mjs";
import { useNamespace as V } from "../../../config-provider/hooks/use-namespace.mjs";
const h = /* @__PURE__ */ c({
  name: "ApLadderValues",
  props: {
    labelValue: {
      type: Object,
      default: () => {
      }
    },
    labelValues: {
      type: Object,
      default: () => {
      }
    },
    onHandleClick: {
      type: Function,
      default: () => {
      }
    }
  },
  setup(o, {
    emit: r
  }) {
    return () => {
      const {
        labelValue: l,
        labelValues: i
      } = o, u = v(l.label) ? e(d, {
        text: n(l.value, {
          ...l
        })
      }, null) : n(l.value, {
        ...l
      }), {
        e: a
      } = V("ap-ladder"), s = (t) => {
        r("handleClick", t);
      };
      return e("span", {
        class: a("value-group-value"),
        title: String(n(l.value, {
          ...l
        }))
      }, [C(l.value) ? k(l.value) : l.link ? e("a", {
        href: l.link,
        target: "_blank",
        class: a("value-group-link"),
        title: String(l.value),
        style: l.linkColor ? {
          color: l.linkColor
        } : null,
        onClick: (t) => {
          t.preventDefault(), s(l);
        },
        rel: "noopener"
      }, [u]) : e(p, null, [e("span", {
        class: [l.handleValueClick ? a("value-group-link") : null],
        title: String(l.value),
        style: l.valueColor ? {
          color: l.valueColor
        } : null,
        onClick: () => {
          l.handleValueClick && l.handleValueClick(i);
        }
      }, [u]), l.unit && e("span", {
        class: a("value-group-unit"),
        title: String(n(l.value, {
          ...l
        })),
        style: l.unitColor ? {
          color: l.unitColor
        } : null
      }, [l.unit])])]);
    };
  }
});
export {
  h as default
};
