import { defineComponent as y, useId as M, computed as u, createBlock as m, createCommentVNode as f, openBlock as r, unref as e, withCtx as l, createVNode as o, createElementVNode as k, createTextVNode as N, normalizeClass as g, createElementBlock as I, Fragment as C, renderList as L } from "vue";
import { ScalarErrorBoundary as B } from "@scalar/components";
import { useNavState as H } from "../../../hooks/useNavState.js";
import w from "../../ShowMoreButton.vue.js";
import { useSidebar as E } from "../../../features/sidebar/hooks/useSidebar.js";
import O from "../../Section/SectionContainer.vue.js";
import V from "../../Section/Section.vue.js";
import z from "../../Section/SectionHeader.vue.js";
import p from "../../Section/SectionHeaderTag.vue.js";
import h from "../Lazy/Lazy.vue2.js";
import A from "../../Section/CompactSection.vue.js";
import T from "../Schema/Schema.vue.js";
import j from "../Schema/SchemaHeading.vue.js";
const S = 10, U = /* @__PURE__ */ y({
  __name: "Models",
  props: {
    schemas: {}
  },
  setup(v) {
    const i = v, n = M(), { collapsedSidebarItems: _ } = E(), { getModelId: a } = H(), d = u(
      () => Object.keys(i.schemas ?? {}).length <= S || _[a()]
    ), b = u(() => {
      const t = Object.keys(i.schemas ?? {});
      return d.value ? t : t.slice(0, S);
    });
    return (t, c) => t.schemas ? (r(), m(e(O), {
      key: 0,
      id: "models"
    }, {
      default: l(() => [
        o(e(V), { "aria-labelledby": e(n) }, {
          default: l(() => [
            o(e(z), null, {
              default: l(() => [
                o(e(p), {
                  id: e(n),
                  level: 2
                }, {
                  default: l(() => c[0] || (c[0] = [
                    N(" Models ")
                  ])),
                  _: 1
                }, 8, ["id"])
              ]),
              _: 1
            }),
            o(e(h), {
              id: "models",
              isLazy: !1
            }),
            k("div", {
              class: g(["models-list", { "models-list-truncated": !d.value }])
            }, [
              (r(!0), I(C, null, L(b.value, (s) => (r(), m(e(h), {
                id: e(a)({ name: s }),
                key: s,
                isLazy: ""
              }, {
                default: l(() => [
                  o(e(A), {
                    id: e(a)({ name: s }),
                    class: "models-list-item",
                    label: s
                  }, {
                    heading: l(() => [
                      o(e(p), { level: 3 }, {
                        default: l(() => [
                          o(e(j), {
                            name: t.schemas[s].title ?? s,
                            value: t.schemas[s]
                          }, null, 8, ["name", "value"])
                        ]),
                        _: 2
                      }, 1024)
                    ]),
                    default: l(() => [
                      o(e(B), null, {
                        default: l(() => [
                          o(e(T), {
                            noncollapsible: "",
                            hideHeading: !0,
                            hideModelNames: !0,
                            schemas: t.schemas,
                            level: 1,
                            value: t.schemas[s]
                          }, null, 8, ["schemas", "value"])
                        ]),
                        _: 2
                      }, 1024)
                    ]),
                    _: 2
                  }, 1032, ["id", "label"])
                ]),
                _: 2
              }, 1032, ["id"]))), 128))
            ], 2),
            d.value ? f("", !0) : (r(), m(w, {
              key: 0,
              id: e(a)(),
              class: "show-more-models"
            }, null, 8, ["id"]))
          ]),
          _: 1
        }, 8, ["aria-labelledby"])
      ]),
      _: 1
    })) : f("", !0);
  }
});
export {
  U as default
};
