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