import { defineComponent as p, createVNode as e, Fragment as o } 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__ */ p({
  name: "ApLadderValues",
  props: {
    labelValue: {
      type: Object,
      default: () => {
      }
    },
    labelValues: {
      type: Object,
      default: () => {
      }
    },
    onHandleClick: {
      type: Function,
      default: () => {
      }
    }
  },
  setup(r, {
    emit: i
  }) {
    return () => {
      const {
        labelValue: l,
        labelValues: s
      } = r, u = v(l.label) ? e(d, {
        text: n(l.value, {
          ...l
        })
      }, null) : n(l.value, {
        ...l
      }), {
        e: a
      } = V("ap-ladder"), c = (t) => {
        i("handleClick", t);
      };
      return e(o, null, [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(), c(l);
        }
      }, [u]) : e(o, 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(s);
        }
      }, [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
};
