import { defineComponent as m, openBlock as p, createBlock as u, withCtx as f, renderSlot as S } from "vue";
import w from "../IntersectionObserver.vue.js";
import { useSidebar as b } from "../../hooks/useSidebar.js";
import { joinWithSlash as _ } from "../../helpers/joinWithSlash.js";
import { useNavState as v } from "../../hooks/useNavState.js";
const B = /* @__PURE__ */ m({
  __name: "Section",
  props: {
    id: {},
    label: {}
  },
  setup(s) {
    const t = s, { getSectionId: r, hash: l, isIntersectionEnabled: d, pathRouting: i } = v(), { setCollapsedSidebarItem: c } = b();
    function h() {
      var n, a;
      if (!t.label || !d.value) return;
      const e = new URL(window.location.href), o = t.id ?? "";
      i.value ? e.pathname = _(i.value.basePath, o) : e.hash = o, l.value = o, window.history.replaceState({}, "", e), ((n = t.id) != null && n.startsWith("model") || (a = t.id) != null && a.startsWith("webhook")) && c(r(t.id), !0);
    }
    return (e, o) => (p(), u(w, {
      is: "section",
      id: e.id,
      class: "section",
      onIntersecting: h
    }, {
      default: f(() => [
        S(e.$slots, "default", {}, void 0, !0)
      ]),
      _: 3
    }, 8, ["id"]));
  }
});
export {
  B as default
};
