import { defineComponent as c, computed as d, createElementBlock as n, openBlock as i, withModifiers as h, createVNode as s, createElementVNode as f, unref as k, withCtx as C, createTextVNode as l, toDisplayString as r, Fragment as g } from "vue";
import { ScalarIconPlay as y } from "@scalar/icons";
import B from "../../components/ScreenReader.vue.js";
import { useConfig as b } from "../../hooks/useConfig.js";
import { useApiClient as w } from "../api-client-modal/useApiClient.js";
const R = ["method"], S = /* @__PURE__ */ c({
  __name: "TestRequestButton",
  props: {
    method: {},
    path: {}
  },
  setup(t) {
    const { client: a } = w(), m = b(), u = d(
      () => m.value.hideTestRequestButton !== !0
    ), p = () => {
      var e;
      (e = a.value) == null || e.open({
        method: t.method,
        path: t.path
      });
    };
    return (e, o) => u.value ? (i(), n("button", {
      key: 0,
      class: "show-api-client-button",
      method: e.method,
      type: "button",
      onClick: h(p, ["stop"])
    }, [
      s(k(y), {
        class: "size-3",
        weight: "fill"
      }),
      o[0] || (o[0] = f("span", null, "Test Request", -1)),
      s(B, null, {
        default: C(() => [
          l("(" + r(e.method) + " " + r(e.path) + ")", 1)
        ]),
        _: 1
      })
    ], 8, R)) : (i(), n(g, { key: 1 }, [
      l(" ")
    ], 64));
  }
});
export {
  S as default
};
