import { defineComponent as a, useId as l, createElementBlock as p, openBlock as u, createElementVNode as t, unref as s, renderSlot as c, withModifiers as m, createVNode as f, withCtx as b, createTextVNode as _ } from "vue";
import { useClipboard as y } from "@scalar/use-hooks/useClipboard";
import C from "../ScreenReader.vue.js";
import { useNavState as h } from "../../hooks/useNavState.js";
const k = { class: "label" }, N = ["id"], v = { class: "anchor" }, I = ["aria-describedby"], E = /* @__PURE__ */ a({
  __name: "Anchor",
  props: {
    id: {}
  },
  setup(S) {
    const n = l(), { copyToClipboard: r } = y(), { getHashedUrl: d } = h(), i = (o) => d(o);
    return (o, e) => (u(), p("span", k, [
      t("span", {
        id: s(n),
        class: "contents"
      }, [
        c(o.$slots, "default", {}, void 0, !0)
      ], 8, N),
      t("span", v, [
        e[3] || (e[3] = t("span", null, "​", -1)),
        t("button", {
          "aria-describedby": s(n),
          class: "anchor-copy",
          type: "button",
          onClick: e[0] || (e[0] = m((V) => s(r)(i(o.id)), ["stop"]))
        }, [
          e[2] || (e[2] = t("span", { "aria-hidden": "true" }, "#", -1)),
          f(C, null, {
            default: b(() => e[1] || (e[1] = [
              _("Copy link")
            ])),
            _: 1
          })
        ], 8, I)
      ])
    ]));
  }
});
export {
  E as default
};
