import { defineComponent as l, openBlock as a, createBlock as p, unref as e, createSlots as c, withCtx as i, createElementVNode as n, createVNode as t, toDisplayString as m, withModifiers as h } from "vue";
import { HttpMethod as f } from "@scalar/api-client";
import { ScalarIcon as u, ScalarIconButton as v, ScalarMarkdown as y } from "@scalar/components";
import b from "./EndpointDetailsCard.vue.js";
import C from "./EndpointPath.vue.js";
import k from "./ExampleRequest.vue.js";
import _ from "./TestRequestButton.vue.js";
import S from "../../Section/SectionAccordion.vue.js";
import w from "../../Anchor/Anchor.vue.js";
import A from "./PathResponses/PathResponses.vue.js";
import { useClipboard as B } from "../../../hooks/useClipboard.js";
const E = { class: "endpoint-header" }, R = { class: "endpoint-details" }, g = { class: "endpoint-label" }, I = { class: "endpoint-label-path" }, M = { class: "endpoint-label-name" }, P = { class: "endpoint-content" }, G = /* @__PURE__ */ l({
  __name: "OperationAccordion",
  props: {
    id: {},
    operation: {}
  },
  setup(V) {
    const { copyToClipboard: d } = B();
    return (o, s) => (a(), p(e(S), {
      id: o.id,
      class: "reference-endpoint",
      transparent: ""
    }, c({
      title: i(() => [
        n("h3", E, [
          n("div", R, [
            t(e(f), {
              class: "endpoint-type",
              method: o.operation.httpVerb,
              short: ""
            }, null, 8, ["method"]),
            t(e(w), {
              id: o.id ?? "",
              class: "endpoint-anchor"
            }, {
              default: i(() => {
                var r;
                return [
                  n("div", g, [
                    n("div", I, [
                      t(C, {
                        deprecated: (r = o.operation.information) == null ? void 0 : r.deprecated,
                        path: o.operation.path
                      }, null, 8, ["deprecated", "path"])
                    ]),
                    n("div", M, m(o.operation.name), 1)
                  ])
                ];
              }),
              _: 1
            }, 8, ["id"])
          ])
        ])
      ]),
      actions: i(({ active: r }) => [
        r ? (a(), p(_, {
          key: 0,
          operation: o.operation
        }, null, 8, ["operation"])) : (a(), p(e(u), {
          key: 1,
          class: "endpoint-try-hint",
          icon: "PaperAirplane"
        })),
        t(e(v), {
          class: "endpoint-copy",
          icon: "Clipboard",
          label: "Copy endpoint URL",
          size: "xs",
          variant: "ghost",
          onClick: s[0] || (s[0] = h((q) => e(d)(o.operation.path), ["stop"]))
        })
      ]),
      default: i(() => [
        n("div", P, [
          t(b, { operation: o.operation }, null, 8, ["operation"]),
          t(e(A), { operation: o.operation }, null, 8, ["operation"]),
          t(k, { operation: o.operation }, null, 8, ["operation"])
        ])
      ]),
      _: 2
    }, [
      o.operation.description ? {
        name: "description",
        fn: i(() => [
          t(e(y), {
            value: o.operation.description,
            withImages: ""
          }, null, 8, ["value"])
        ]),
        key: "0"
      } : void 0
    ]), 1032, ["id"]));
  }
});
export {
  G as default
};
