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