import { defineComponent as B, computed as V, useId as w, createBlock as r, openBlock as i, unref as o, withCtx as t, createVNode as a, createCommentVNode as s, createElementVNode as l, normalizeClass as b, createTextVNode as n, toDisplayString as y, createSlots as q } from "vue";
import { ScalarMarkdown as D, ScalarErrorBoundary as m } from "@scalar/components";
import { ScalarIconWebhooksLogo as L } from "@scalar/icons";
import { getOperationStability as k, getOperationStabilityColor as T, isOperationDeprecated as W } from "@scalar/oas-utils/helpers";
import $ from "../../../components/OperationPath.vue.js";
import E from "../components/callbacks/Callbacks.vue.js";
import I from "../components/OperationParameters.vue.js";
import N from "../components/OperationResponses.vue.js";
import { useConfig as P } from "../../../hooks/useConfig.js";
import R from "../../../components/Section/Section.vue.js";
import z from "../../../components/Section/SectionContent.vue.js";
import S from "../../../components/Badge/Badge.vue.js";
import H from "../../../components/Section/SectionHeader.vue.js";
import M from "../../../components/Anchor/Anchor.vue.js";
import U from "../../../components/Section/SectionHeaderTag.vue.js";
import j from "../../../components/Section/SectionColumns.vue.js";
import g from "../../../components/Section/SectionColumn.vue.js";
import A from "../../../components/LinkList/LinkList.vue.js";
import F from "../../external-docs/ExternalDocs.vue.js";
import G from "../../../v2/blocks/scalar-request-example-block/components/RequestExample.vue.js";
import J from "../../test-request-button/TestRequestButton.vue.js";
import K from "../../example-responses/ExampleResponses.vue.js";
const Q = { class: "operation-details" }, X = { class: "examples" }, ke = /* @__PURE__ */ B({
  __name: "ModernLayout",
  props: {
    id: {},
    path: {},
    clientOptions: {},
    method: {},
    operation: {},
    oldOperation: {},
    parameters: {},
    isWebhook: { type: Boolean },
    securitySchemes: {},
    server: {},
    schemas: {},
    store: {}
  },
  emits: ["update:modelValue"],
  setup(d, { emit: v }) {
    const p = V(() => d.operation.summary || d.path || ""), C = v, u = w(), O = P(), c = (e) => {
      C("update:modelValue", e);
    };
    return (e, f) => (i(), r(o(R), {
      id: e.id,
      "aria-labelledby": o(u),
      label: p.value,
      tabindex: "-1"
    }, {
      default: t(() => [
        a(o(z), {
          loading: o(O).isLoading
        }, {
          default: t(() => [
            o(k)(e.operation) ? (i(), r(o(S), {
              key: 0,
              class: b(["capitalize", o(T)(e.operation)])
            }, {
              default: t(() => [
                n(y(o(k)(e.operation)), 1)
              ]),
              _: 1
            }, 8, ["class"])) : s("", !0),
            e.isWebhook ? (i(), r(o(S), {
              key: 1,
              class: "font-code text-green flex w-fit items-center justify-center gap-1"
            }, {
              default: t(() => [
                a(o(L), { weight: "bold" }),
                f[0] || (f[0] = n("Webhook "))
              ]),
              _: 1,
              __: [0]
            })) : s("", !0),
            l("div", {
              class: b(o(W)(e.operation) ? "deprecated" : "")
            }, [
              a(o(H), null, {
                default: t(() => [
                  a(o(M), { id: e.id }, {
                    default: t(() => [
                      a(o(U), {
                        id: o(u),
                        level: 3
                      }, {
                        default: t(() => [
                          n(y(p.value), 1)
                        ]),
                        _: 1
                      }, 8, ["id"])
                    ]),
                    _: 1
                  }, 8, ["id"])
                ]),
                _: 1
              })
            ], 2),
            a(o(j), null, {
              default: t(() => [
                a(o(g), null, {
                  default: t(() => [
                    l("div", Q, [
                      a(o(D), {
                        value: e.operation.description,
                        withImages: "",
                        withAnchors: "",
                        transformType: "heading",
                        anchorPrefix: e.id
                      }, null, 8, ["value", "anchorPrefix"]),
                      a(I, {
                        breadcrumb: [e.id],
                        parameters: e.parameters,
                        requestBody: e.oldOperation.requestBody,
                        schemas: e.schemas,
                        "onUpdate:modelValue": c
                      }, null, 8, ["breadcrumb", "parameters", "requestBody", "schemas"]),
                      a(N, {
                        breadcrumb: [e.id],
                        responses: e.oldOperation.responses,
                        schemas: e.schemas
                      }, null, 8, ["breadcrumb", "responses", "schemas"]),
                      a(o(m), null, {
                        default: t(() => [
                          e.operation.callbacks ? (i(), r(E, {
                            key: 0,
                            class: "mt-6",
                            path: e.path,
                            callbacks: e.operation.callbacks,
                            method: e.method,
                            schemas: e.schemas
                          }, null, 8, ["path", "callbacks", "method", "schemas"])) : s("", !0)
                        ]),
                        _: 1
                      })
                    ])
                  ]),
                  _: 1
                }),
                a(o(g), null, {
                  default: t(() => [
                    l("div", X, [
                      e.operation.externalDocs ? (i(), r(o(A), { key: 0 }, {
                        default: t(() => [
                          a(o(F), {
                            value: e.operation.externalDocs
                          }, null, 8, ["value"])
                        ]),
                        _: 1
                      })) : s("", !0),
                      a(o(m), null, {
                        default: t(() => [
                          a(o(G), {
                            method: e.method,
                            selectedServer: e.server,
                            clientOptions: e.clientOptions,
                            securitySchemes: e.securitySchemes,
                            selectedClient: e.store.workspace["x-scalar-default-client"],
                            path: e.path,
                            fallback: "",
                            operation: e.operation,
                            "onUpdate:modelValue": c
                          }, q({
                            header: t(() => {
                              var h;
                              return [
                                a($, {
                                  class: "font-code text-c-2 [&_em]:text-c-1 [&_em]:not-italic",
                                  deprecated: (h = e.operation) == null ? void 0 : h.deprecated,
                                  path: e.path
                                }, null, 8, ["deprecated", "path"])
                              ];
                            }),
                            _: 2
                          }, [
                            e.isWebhook ? void 0 : {
                              name: "footer",
                              fn: t(() => [
                                a(o(J), {
                                  method: e.method,
                                  path: e.path
                                }, null, 8, ["method", "path"])
                              ]),
                              key: "0"
                            }
                          ]), 1032, ["method", "selectedServer", "clientOptions", "securitySchemes", "selectedClient", "path", "operation"])
                        ]),
                        _: 1
                      }),
                      a(o(m), null, {
                        default: t(() => [
                          a(o(K), {
                            responses: e.operation.responses,
                            style: { "margin-top": "12px" }
                          }, null, 8, ["responses"])
                        ]),
                        _: 1
                      })
                    ])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["loading"])
      ]),
      _: 1
    }, 8, ["id", "aria-labelledby", "label"]));
  }
});
export {
  ke as default
};
