import { defineComponent as C, resolveComponent as h, openBlock as o, createBlock as t, unref as s, withCtx as l, resolveDynamicComponent as k, createCommentVNode as c, createElementVNode as r, toDisplayString as m, createElementBlock as x, Fragment as E, renderList as I } from "vue";
import { ElMenuItem as M, ElIcon as f, ElSubMenu as S } from "element-plus";
const B = { class: "menu-item__collapse" }, b = { class: "menu-item__collapse" }, V = /* @__PURE__ */ C({
  name: "MenuItem",
  __name: "menu-item",
  props: {
    info: {
      type: Object
    },
    isCollapse: Boolean,
    iconSize: Number
  },
  setup(y) {
    const e = y;
    return (N, g) => {
      var p, _, d;
      const z = h("MenuItem", !0);
      return (p = e.info) != null && p.routes ? (o(), t(s(S), {
        key: 1,
        index: (d = e.info) == null ? void 0 : d.path
      }, {
        title: l(() => {
          var i, a, u;
          return [
            (i = e.info) != null && i.icon ? (o(), t(s(f), {
              key: 0,
              size: e.iconSize
            }, {
              default: l(() => {
                var n;
                return [
                  (o(), t(k((n = e.info) == null ? void 0 : n.icon)))
                ];
              }),
              _: 1
            }, 8, ["size"])) : c("", !0),
            !((a = e.info) != null && a.icon) && e.isCollapse ? (o(), t(s(f), {
              key: 1,
              size: 16
            }, {
              default: l(() => {
                var n;
                return [
                  r("span", b, m((n = e.info) == null ? void 0 : n.name[0]), 1)
                ];
              }),
              _: 1
            })) : c("", !0),
            r("span", null, m((u = e.info) == null ? void 0 : u.name), 1)
          ];
        }),
        default: l(() => [
          (o(!0), x(E, null, I(e.info.routes, (i) => (o(), t(z, {
            key: i.path,
            info: i
          }, null, 8, ["info"]))), 128))
        ]),
        _: 1
      }, 8, ["index"])) : (o(), t(s(M), {
        key: 0,
        index: (_ = e.info) == null ? void 0 : _.path
      }, {
        default: l(() => {
          var i, a, u;
          return [
            (i = e.info) != null && i.icon ? (o(), t(s(f), {
              key: 0,
              size: e.iconSize
            }, {
              default: l(() => {
                var n;
                return [
                  (o(), t(k((n = e.info) == null ? void 0 : n.icon)))
                ];
              }),
              _: 1
            }, 8, ["size"])) : c("", !0),
            !((a = e.info) != null && a.icon) && e.isCollapse ? (o(), t(s(f), {
              key: 1,
              size: 16
            }, {
              default: l(() => {
                var n;
                return [
                  r("span", B, m((n = e.info) == null ? void 0 : n.name[0]), 1)
                ];
              }),
              _: 1
            })) : c("", !0),
            r("span", null, m((u = e.info) == null ? void 0 : u.name), 1)
          ];
        }),
        _: 1
      }, 8, ["index"]));
    };
  }
});
export {
  V as default
};
