import { defineComponent as D, computed as s, onMounted as I, createBlock as l, openBlock as a, unref as o, withCtx as t, createVNode as i, renderSlot as S, createElementVNode as _, createCommentVNode as u, createTextVNode as d, toDisplayString as f } from "vue";
import L from "github-slugger";
import { useConfig as V } from "../../../hooks/useConfig.js";
import { useNavState as w } from "../../../hooks/useNavState.js";
import H from "../../../features/DownloadLink/DownloadLink.vue.js";
import B from "./Description.vue.js";
import O from "../../Section/SectionContainer.vue.js";
import U from "../../Section/Section.vue.js";
import { DEFAULT_INTRODUCTION_SLUG as b } from "../../../hooks/useSidebar.js";
import A from "../../Section/SectionContent.vue.js";
import C from "../../Badge/Badge.vue.js";
import E from "../../Section/SectionHeader.vue.js";
import F from "../../Section/SectionHeaderTag.vue.js";
import G from "../../Section/SectionColumns.vue.js";
import T from "../../Section/SectionColumn.vue.js";
import h from "../../SpecificationExtension/SpecificationExtension.vue.js";
const M = { class: "flex gap-1" }, R = { class: "sticky-cards" }, ne = /* @__PURE__ */ D({
  __name: "Introduction",
  props: {
    info: {},
    parsedSpec: {}
  },
  setup(k) {
    const n = k, { getHeadingId: y } = w(), m = s(
      () => {
        var e, r;
        return ((e = n.parsedSpec) == null ? void 0 : e.openapi) ?? ((r = n.parsedSpec) == null ? void 0 : r.swagger) ?? "";
      }
    ), N = new L(), $ = s(() => {
      var e;
      return N.slug(((e = n.info) == null ? void 0 : e.title) ?? "");
    }), p = s(() => {
      var e, r;
      return typeof ((e = n.info) == null ? void 0 : e.version) == "string" ? n.info.version.toString().match(/^\d/) ? `v${n.info.version}` : n.info.version : typeof ((r = n.info) == null ? void 0 : r.version) == "number" ? `v${n.info.version}` : void 0;
    }), c = V();
    return I(() => {
      var e, r;
      return (r = (e = c.value).onLoaded) == null ? void 0 : r.call(e);
    }), (e, r) => (a(), l(o(O), null, {
      default: t(() => [
        i(o(U), {
          class: "introduction-section gap-12",
          id: o(y)({
            slug: o(b),
            depth: 1,
            value: "Introduction"
          })
        }, {
          default: t(() => {
            var v, g;
            return [
              i(o(A), {
                loading: o(c).isLoading ?? (!((v = e.info) != null && v.description) && !((g = e.info) != null && g.title))
              }, {
                default: t(() => [
                  _("div", M, [
                    p.value ? (a(), l(o(C), { key: 0 }, {
                      default: t(() => [
                        d(f(p.value), 1)
                      ]),
                      _: 1
                    })) : u("", !0),
                    m.value ? (a(), l(o(C), { key: 1 }, {
                      default: t(() => [
                        d("OAS " + f(m.value), 1)
                      ]),
                      _: 1
                    })) : u("", !0)
                  ]),
                  i(o(E), {
                    loading: !e.info.title,
                    tight: ""
                  }, {
                    default: t(() => [
                      i(o(F), { level: 1 }, {
                        default: t(() => [
                          d(f(e.info.title), 1)
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }, 8, ["loading"]),
                  i(H, { specTitle: $.value }, null, 8, ["specTitle"]),
                  i(o(G), null, {
                    default: t(() => [
                      i(o(T), null, {
                        default: t(() => [
                          i(B, {
                            value: e.info.description
                          }, null, 8, ["value"])
                        ]),
                        _: 1
                      }),
                      e.$slots.aside ? (a(), l(o(T), { key: 0 }, {
                        default: t(() => [
                          _("div", R, [
                            S(e.$slots, "aside", {}, void 0, !0)
                          ])
                        ]),
                        _: 3
                      })) : u("", !0)
                    ]),
                    _: 3
                  }),
                  i(o(h), { value: e.parsedSpec }, null, 8, ["value"]),
                  i(o(h), { value: e.info }, null, 8, ["value"])
                ]),
                _: 3
              }, 8, ["loading"]),
              S(e.$slots, "after", {}, void 0, !0)
            ];
          }),
          _: 3
        }, 8, ["id"])
      ]),
      _: 3
    }));
  }
});
export {
  ne as default
};
