import { defineComponent as S, computed as V, createBlock as a, openBlock as n, unref as o, createSlots as w, withCtx as i, createElementVNode as s, createVNode as t, createCommentVNode as p, withModifiers as B, toDisplayString as u, normalizeClass as T, createTextVNode as f } from "vue";
import { ScalarIcon as I, ScalarIconButton as R, ScalarMarkdown as N } from "@scalar/components";
import { ScalarIconWebhooksLogo as O } from "@scalar/icons";
import { useClipboard as P } from "@scalar/use-hooks/useClipboard";
import W from "../../../components/OperationPath.vue.js";
import { useConfig as $ } from "../../../hooks/useConfig.js";
import { isOperationDeprecated as z, getOperationStability as y, getOperationStabilityColor as A } from "../../../libs/openapi.js";
import D from "../components/OperationParameters.vue.js";
import E from "../components/OperationResponses.vue.js";
import L from "../../../components/Section/SectionAccordion.vue.js";
import U from "../../example-responses/ExampleResponses.vue.js";
import _ from "../../example-request/ExampleRequest.vue.js";
import M from "../../test-request-button/TestRequestButton.vue.js";
import j from "../../../components/HttpMethod/HttpMethod.vue.js";
import F from "../../../components/Anchor/Anchor.vue.js";
import v from "../../../components/Badge/Badge.vue.js";
const G = { class: "operation-title" }, H = { class: "operation-details" }, J = { class: "endpoint-label" }, K = { class: "endpoint-label-path" }, Q = { class: "endpoint-label-name" }, X = { class: "endpoint-content" }, Y = { class: "operation-details-card" }, Z = { class: "operation-details-card-item" }, x = { class: "operation-details-card-item" }, ve = /* @__PURE__ */ S({
  __name: "ClassicLayout",
  props: {
    id: {},
    path: {},
    method: {},
    operation: {},
    isWebhook: { type: Boolean },
    collection: {},
    server: {},
    request: {},
    schemas: {}
  },
  emits: ["update:modelValue"],
  setup(d, { emit: b }) {
    const g = V(() => {
      var e;
      return ((e = d.operation) == null ? void 0 : e.summary) || d.path || "";
    }), { copyToClipboard: k } = P(), C = $(), q = b, m = (e) => {
      q("update:modelValue", e);
    };
    return (e, r) => {
      var c;
      return n(), a(o(L), {
        id: e.id,
        class: "reference-endpoint",
        transparent: ""
      }, w({
        title: i(() => [
          s("div", G, [
            s("div", H, [
              t(o(j), {
                class: "endpoint-type",
                method: e.method,
                short: ""
              }, null, 8, ["method"]),
              t(o(F), {
                id: e.id,
                class: "endpoint-anchor"
              }, {
                default: i(() => [
                  s("h3", J, [
                    s("div", K, [
                      t(W, {
                        deprecated: o(z)(e.operation),
                        path: e.path
                      }, null, 8, ["deprecated", "path"])
                    ]),
                    s("div", Q, u(g.value), 1),
                    o(y)(e.operation) ? (n(), a(o(v), {
                      key: 0,
                      class: T(o(A)(e.operation))
                    }, {
                      default: i(() => [
                        f(u(o(y)(e.operation)), 1)
                      ]),
                      _: 1
                    }, 8, ["class"])) : p("", !0),
                    e.isWebhook ? (n(), a(o(v), {
                      key: 1,
                      class: "font-code text-green flex w-fit items-center justify-center gap-1"
                    }, {
                      default: i(() => [
                        t(o(O), { weight: "bold" }),
                        r[1] || (r[1] = f("Webhook "))
                      ]),
                      _: 1
                    })) : p("", !0)
                  ])
                ]),
                _: 1
              }, 8, ["id"])
            ])
          ])
        ]),
        actions: i(({ active: l }) => {
          var h;
          return [
            l && e.request ? (n(), a(o(M), {
              key: 0,
              operation: e.request
            }, null, 8, ["operation"])) : (h = o(C)) != null && h.hideTestRequestButton ? p("", !0) : (n(), a(o(I), {
              key: 1,
              class: "endpoint-try-hint size-6",
              icon: "Play",
              thickness: "1.75px"
            })),
            t(o(R), {
              class: "endpoint-copy p-0.5",
              icon: "Clipboard",
              label: "Copy endpoint URL",
              size: "xs",
              variant: "ghost",
              onClick: r[0] || (r[0] = B((ee) => o(k)(e.path), ["stop"]))
            })
          ];
        }),
        default: i(() => [
          s("div", X, [
            s("div", Y, [
              s("div", Z, [
                t(D, {
                  parameters: e.operation.parameters,
                  schemas: e.schemas,
                  "onUpdate:modelValue": m
                }, null, 8, ["parameters", "schemas"])
              ]),
              s("div", x, [
                t(E, {
                  collapsableItems: !1,
                  responses: e.operation.responses,
                  schemas: e.schemas
                }, null, 8, ["responses", "schemas"])
              ])
            ]),
            t(o(U), {
              responses: e.operation.responses
            }, null, 8, ["responses"]),
            t(o(_), {
              request: e.request,
              method: e.method,
              collection: e.collection,
              operation: e.operation,
              server: e.server,
              "onUpdate:modelValue": m
            }, null, 8, ["request", "method", "collection", "operation", "server"])
          ])
        ]),
        _: 2
      }, [
        (c = e.operation) != null && c.description ? {
          name: "description",
          fn: i(() => {
            var l;
            return [
              t(o(N), {
                value: (l = e.operation) == null ? void 0 : l.description,
                withImages: "",
                withAnchors: "",
                transformType: "heading",
                anchorPrefix: e.id
              }, null, 8, ["value", "anchorPrefix"])
            ];
          }),
          key: "0"
        } : void 0
      ]), 1032, ["id"]);
    };
  }
});
export {
  ve as default
};
