import { effectScope as C, getCurrentInstance as F, inject as $, shallowRef as A, defineComponent as c, openBlock as u, createBlock as d, unref as l, normalizeStyle as S, withCtx as o, renderSlot as _, createElementVNode as M, toDisplayString as v, computed as R, createElementBlock as m, Fragment as y, renderList as D, createVNode as r, resolveDynamicComponent as T, createTextVNode as x, ref as I, readonly as N } from "vue";
import { ElHeader as O, ElMenuItem as V, ElIcon as k, ElSubMenu as j, ElAside as B, ElMenu as H, ElMain as L, ElContainer as z } from "element-plus";
import { useRoute as G, RouterView as K } from "vue-router";
const b = 60;
function U(n) {
  let t = !1, e;
  const a = C(!0);
  return (...i) => (t || (e = a.run(() => n(...i)), t = !0), e);
}
const w = /* @__PURE__ */ new WeakMap(), W = (...n) => {
  var t;
  const e = n[0], a = (t = F()) == null ? void 0 : t.proxy;
  if (a == null)
    throw new Error("injectLocal must be called in setup");
  return w.has(a) && e in w.get(a) ? w.get(a)[e] : $(...n);
};
function X(n, t) {
  if (typeof Symbol < "u") {
    const e = { ...n };
    return Object.defineProperty(e, Symbol.iterator, {
      enumerable: !1,
      value() {
        let a = 0;
        return {
          next: () => ({
            value: t[a++],
            done: a > t.length
          })
        };
      }
    }), e;
  } else
    return Object.assign([...t], n);
}
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
function P(n) {
  const t = /* @__PURE__ */ Object.create(null);
  return (e) => t[e] || (t[e] = n(e));
}
const q = /-(\w)/g, J = P((n) => n.replace(q, (t, e) => e ? e.toUpperCase() : ""));
function Q(n = {}) {
  const {
    inheritAttrs: t = !0
  } = n, e = A(), a = /* @__PURE__ */ c({
    setup(f, { slots: s }) {
      return () => {
        e.value = s.default;
      };
    }
  }), i = /* @__PURE__ */ c({
    inheritAttrs: t,
    setup(f, { attrs: s, slots: g }) {
      return () => {
        var E;
        if (!e.value && process.env.NODE_ENV !== "production")
          throw new Error("[VueUse] Failed to find the definition of reusable template");
        const h = (E = e.value) == null ? void 0 : E.call(e, { ...Y(s), $slots: g });
        return t && (h == null ? void 0 : h.length) === 1 ? h[0] : h;
      };
    }
  });
  return X(
    { define: a, reuse: i },
    [a, i]
  );
}
function Y(n) {
  const t = {};
  for (const e in n)
    t[J(e)] = n[e];
  return t;
}
const Z = {
  rowKey: "id",
  title: "Fast Start",
  routerMode: "hash",
  basename: "/"
}, ee = Symbol("FAST_START_CONTEXT"), te = () => W(ee, Z), ne = { class: "fast-start-layout-header-title" }, ae = /* @__PURE__ */ c({
  __name: "Header",
  setup(n) {
    const { title: t } = te();
    return (e, a) => (u(), d(l(O), {
      class: "fast-start-layout-header",
      style: S({ height: l(b) })
    }, {
      default: o(() => [
        _(e.$slots, "default", {}, () => [
          M("div", ne, v(l(t)), 1)
        ])
      ]),
      _: 3
    }, 8, ["style"]));
  }
}), p = /* @__PURE__ */ c({
  name: "If",
  __name: "If",
  props: {
    when: {}
  },
  setup(n) {
    const t = (e) => e;
    return (e, a) => e.when ? _(e.$slots, "default", {
      key: 0,
      value: t(e.when)
    }) : _(e.$slots, "fallback", { key: 1 });
  }
}), le = /* @__PURE__ */ c({
  name: "For",
  inheritAttrs: !1,
  __name: "For",
  props: {
    echo: {},
    rowKey: {}
  },
  setup(n) {
    const t = n, e = R(() => t.echo);
    return (a, i) => (u(), m(
      y,
      null,
      [
        (u(!0), m(
          y,
          null,
          D(a.echo, (f, s) => _(a.$slots, "default", {
            key: a.rowKey,
            item: f,
            index: s
          })),
          128
          /* KEYED_FRAGMENT */
        )),
        r(p, {
          when: !e.value || !e.value.length || e.value.length === 0
        }, {
          default: o(() => [
            _(a.$slots, "fallback")
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["when"])
      ],
      64
      /* STABLE_FRAGMENT */
    ));
  }
}), re = /* @__PURE__ */ c({
  name: "FsSideBarItem",
  __name: "Item",
  props: {
    items: {}
  },
  setup(n) {
    const [t, e] = Q();
    return (a, i) => (u(), m(y, null, [
      r(l(t), null, {
        default: o(({ list: f }) => [
          r(l(le), {
            echo: f,
            "row-key": "path"
          }, {
            default: o(({ item: s }) => [
              r(l(p), {
                when: s.children && s.children.length
              }, {
                fallback: o(() => [
                  r(l(V), {
                    class: "fast-start-menu-item",
                    index: s.path
                  }, {
                    default: o(() => [
                      r(l(p), {
                        when: s.icon
                      }, {
                        default: o(() => [
                          r(l(k), null, {
                            default: o(() => [
                              (u(), d(T(s.icon)))
                            ]),
                            _: 2
                          }, 1024)
                        ]),
                        _: 2
                      }, 1032, ["when"]),
                      x(" " + v(s.name), 1)
                    ]),
                    _: 2
                  }, 1032, ["index"])
                ]),
                default: o(() => [
                  r(l(j), {
                    class: "fast-start-menu-item-title",
                    index: s.path
                  }, {
                    title: o(() => [
                      r(l(p), {
                        when: s.icon
                      }, {
                        default: o(() => [
                          r(l(k), null, {
                            default: o(() => [
                              (u(), d(T(s.icon)))
                            ]),
                            _: 2
                          }, 1024)
                        ]),
                        _: 2
                      }, 1032, ["when"]),
                      x(" " + v(s.name), 1)
                    ]),
                    default: o(() => [
                      r(l(e), {
                        list: s.children || []
                      }, null, 8, ["list"])
                    ]),
                    _: 2
                  }, 1032, ["index"])
                ]),
                _: 2
              }, 1032, ["when"])
            ]),
            _: 2
          }, 1032, ["echo"])
        ]),
        _: 1
      }),
      r(l(e), { list: a.items }, null, 8, ["list"])
    ], 64));
  }
}), se = U(() => {
  const n = I({
    menu: []
  });
  function t(e) {
    n.value.menu = e;
  }
  return {
    state: N(n),
    setMenu: t
  };
}), oe = /* @__PURE__ */ c({
  __name: "SideBar",
  setup(n) {
    const { state: t } = se(), e = G();
    return (a, i) => (u(), d(l(B), {
      class: "fast-start-aside",
      width: "230px",
      style: S({ height: `calc(100vh - ${l(b)}px)` })
    }, {
      default: o(() => [
        r(l(H), {
          "default-active": l(e).path,
          router: "",
          class: "fast-start-menu"
        }, {
          default: o(() => [
            r(re, {
              items: l(t).menu
            }, null, 8, ["items"])
          ]),
          _: 1
        }, 8, ["default-active"])
      ]),
      _: 1
    }, 8, ["style"]));
  }
}), ue = /* @__PURE__ */ c({
  __name: "Main",
  setup(n) {
    return (t, e) => (u(), d(l(L), {
      class: "fast-start-layout-main",
      style: S({
        height: `calc(100vh - ${l(b)}px) `
      })
    }, {
      default: o(() => [
        r(l(K))
      ]),
      _: 1
    }, 8, ["style"]));
  }
}), de = /* @__PURE__ */ c({
  __name: "DefaultLayout",
  setup(n) {
    return (t, e) => (u(), m(y, null, [
      r(ae),
      r(l(z), null, {
        default: o(() => [
          r(oe),
          r(ue)
        ]),
        _: 1
      })
    ], 64));
  }
});
export {
  de as default
};
//# sourceMappingURL=DefaultLayout.mjs.map
