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