import { defineComponent as R, useSlots as b, shallowRef as N, computed as v, watch as W, openBlock as o, createBlock as u, unref as e, normalizeClass as d, normalizeStyle as A, withCtx as r, createVNode as t, renderSlot as m, resolveDynamicComponent as x, createCommentVNode as c, createElementBlock as _, toDisplayString as g, createElementVNode as p } from "vue";
import { useNamespace as V, ElContainer as k, ElAside as C, ElHeader as h, ElButton as D, ElIcon as F, ElBacktop as H, ElMain as I, ElFooter as L } from "element-plus";
import { SwitchButton as P, Fold as j, Expand as q } from "../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.4.21/node_modules/@element-plus/icons-vue/dist/index.mjs";
import G from "./xmenu.vue.mjs";
import J from "./ymenu.vue.mjs";
import K from "./person.vue.mjs";
import { proLayoutProps as O } from "./types.mjs";
const Q = { key: 1 }, T = { class: "ymenu-wrapper" }, U = { key: 1 }, X = { class: "header-menus-wrapper" }, Y = { style: { flex: "1" } }, Z = { class: "header-tools-wrapper" }, ee = { style: { "margin-right": "20px" } }, re = /* @__PURE__ */ R({
  __name: "index",
  props: O,
  emits: ["logout"],
  setup($, { emit: E }) {
    const a = V("pro-layout"), w = b(), l = $, z = E, i = N(!1), S = v(() => [
      {
        label: "退出登录",
        icon: P,
        action() {
          z("logout");
        }
      },
      ...(l.avatarActions || []).map((s) => ({
        ...s,
        iconSrc: typeof s.icon == "string" ? s.icon : ""
      }))
    ]), f = v(() => ({
      ...{
        iconSize: 20,
        menus: []
      },
      ...l.headerMenus
    })), n = v(() => ({
      ...{
        iconSize: 20,
        menus: [],
        isCollapse: !1,
        maxWidth: 300,
        minWidth: 84
      },
      ...l.asideMenus
    })), B = v(() => {
      var s;
      return (s = l.asideMenus) == null ? void 0 : s.isCollapse;
    });
    W(B, (s) => {
      i.value = !!s, console.log(i.value, "xxxxx");
    }, {
      immediate: !0,
      deep: !0
    });
    const M = () => {
      i.value = !i.value;
    };
    return (s, se) => (o(), u(e(k), {
      class: d([e(a).b()]),
      style: A({
        "--wet-pro-layout-aside-width": i.value ? `${n.value.minWidth}px` : `${n.value.maxWidth}px`
      })
    }, {
      default: r(() => [
        t(e(C), {
          class: d([e(a).e("aside"), e(a).is("fixed", n.value.fixed), l.asideClass])
        }, {
          default: r(() => [
            t(e(h), {
              class: d([e(a).e("logo")])
            }, {
              default: r(() => [
                m(s.$slots, "logo", {}, () => [
                  l.logo ? (o(), u(x(l.logo), { key: 0 })) : c("", !0),
                  i.value ? c("", !0) : (o(), _("h1", Q, g(l.title), 1))
                ])
              ]),
              _: 3
            }, 8, ["class"]),
            p("div", T, [
              t(J, {
                "icon-size": n.value.iconSize,
                "is-collapse": i.value,
                active: n.value.active,
                menus: n.value.menus
              }, null, 8, ["icon-size", "is-collapse", "active", "menus"])
            ]),
            p("div", null, [
              m(s.$slots, "aside-tools")
            ])
          ]),
          _: 3
        }, 8, ["class"]),
        n.value.fixed ? (o(), u(e(C), {
          key: 0,
          class: d([e(a).e("aside"), l.asideClass])
        }, null, 8, ["class"])) : c("", !0),
        t(e(k), null, {
          default: r(() => [
            t(e(h), {
              class: d([e(a).e("header"), e(a).is("fixed", f.value.fixed), e(a).is("aside-fixed", n.value.fixed), l.headerClass])
            }, {
              default: r(() => {
                var y;
                return [
                  !n.value.fixed && f.value.fixed ? (o(), _("div", {
                    key: 0,
                    class: d([e(a).e("logo")])
                  }, [
                    m(s.$slots, "logo", {}, () => [
                      l.logo ? (o(), u(x(l.logo), { key: 0 })) : c("", !0),
                      i.value ? c("", !0) : (o(), _("h1", U, g(l.title), 1))
                    ])
                  ], 2)) : c("", !0),
                  t(e(D), {
                    link: "",
                    onClick: M,
                    style: { "margin-left": "20px" }
                  }, {
                    default: r(() => [
                      t(e(F), null, {
                        default: r(() => [
                          i.value ? (o(), u(e(q), { key: 1 })) : (o(), u(e(j), { key: 0 }))
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }),
                  p("div", X, [
                    p("div", Y, [
                      m(s.$slots, "header", {}, () => [
                        t(G, {
                          active: f.value.active,
                          "icon-size": f.value.iconSize,
                          menus: f.value.menus
                        }, null, 8, ["active", "icon-size", "menus"])
                      ])
                    ]),
                    p("div", Z, [
                      l.backtop ? (o(), u(e(H), { key: 0 })) : c("", !0),
                      m(s.$slots, "header-tools")
                    ])
                  ]),
                  p("div", ee, [
                    t(K, {
                      nickname: (y = l.avatar) == null ? void 0 : y.nickname,
                      "more-actions": S.value
                    }, null, 8, ["nickname", "more-actions"])
                  ])
                ];
              }),
              _: 3
            }, 8, ["class"]),
            f.value.fixed ? (o(), u(e(h), {
              key: 0,
              class: d([e(a).e("header")])
            }, null, 8, ["class"])) : c("", !0),
            t(e(I), { style: { padding: "0" } }, {
              default: r(() => [
                m(s.$slots, "default")
              ]),
              _: 3
            }),
            e(w).footer ? (o(), u(e(L), { key: 1 }, {
              default: r(() => [
                m(s.$slots, "footer")
              ]),
              _: 3
            })) : c("", !0)
          ]),
          _: 3
        })
      ]),
      _: 3
    }, 8, ["class", "style"]));
  }
});
export {
  re as default
};
