import { defineComponent as i, createElementBlock as o, openBlock as e, createCommentVNode as p, unref as t, Fragment as u } from "vue";
import { useConfig as m } from "../../hooks/useConfig.js";
import { downloadSpecBus as f } from "../../helpers/specDownloads.js";
const _ = { class: "download" }, k = ["href"], g = /* @__PURE__ */ i({
  __name: "DownloadLink",
  props: {
    specTitle: {}
  },
  setup(d) {
    const r = d, n = m(), s = () => {
      f.emit({ id: "", specTitle: r.specTitle });
    };
    return (w, h) => {
      var l, c, a;
      return e(), o("div", _, [
        (l = t(n)) != null && l.hideDownloadButton ? p("", !0) : (e(), o(u, { key: 0 }, [
          (c = t(n)) != null && c.url ? (e(), o("a", {
            key: 0,
            class: "download-button",
            download: "",
            href: (a = t(n)) == null ? void 0 : a.url,
            target: "_blank"
          }, " Download OpenAPI Document ", 8, k)) : (e(), o("button", {
            key: 1,
            class: "download-button",
            role: "link",
            type: "button",
            onClick: s
          }, " Download OpenAPI Document "))
        ], 64))
      ]);
    };
  }
});
export {
  g as default
};
