"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
const utils = require("../../utils/utils.js");
require("../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.js");
const router = require("../../utils/router.js");
require("../../store/modules/designStore/designStore.js");
require("../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js");
require("../GoSkeleton/index.vue.js");
require("../GoLoading/index.js");
const icon = require("../../plugins/icon.js");
require("../../settings/designSetting.js");
const index = require("../GoSystemSet/index.vue.js");
const index$1 = require("../GoSystemInfo/index.vue.js");
const person = require("./person.png.js");
const runtimeCore_esmBundler = require("../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const reactivity_esmBundler = require("../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const Avatar = require("../../../node_modules/.pnpm/naive-ui@2.34.3_vue@3.3.4/node_modules/naive-ui/es/avatar/src/Avatar.js");
const text = require("../../../node_modules/.pnpm/naive-ui@2.34.3_vue@3.3.4/node_modules/naive-ui/es/typography/src/text.js");
const _hoisted_1 = { class: "user-info-box" };
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "index",
  setup(__props) {
    const { ChatboxEllipsesIcon, PersonIcon, LogOutOutlineIcon, SettingsSharpIcon } = icon.icon.ionicons5;
    const modelShowInfo = reactivity_esmBundler.ref(false);
    const modelShow = reactivity_esmBundler.ref(false);
    const fallback = reactivity_esmBundler.ref(false);
    const renderUserInfo = () => {
      return runtimeCore_esmBundler.h(
        "div",
        {
          style: "display: flex; align-items: center; padding: 8px 12px;"
        },
        [
          runtimeCore_esmBundler.h(Avatar.default, {
            round: true,
            style: "margin-right: 12px;",
            src: person.default
          }),
          runtimeCore_esmBundler.h("div", null, [runtimeCore_esmBundler.h("div", null, [runtimeCore_esmBundler.h(text.default, { depth: 2 }, { default: () => "奔跑的面条" })])])
        ]
      );
    };
    const options = reactivity_esmBundler.ref([
      {
        label: "我的信息",
        key: "info",
        type: "render",
        render: renderUserInfo
      },
      {
        type: "divider",
        key: "d1"
      },
      {
        label: "系统设置",
        key: "sysSet",
        icon: utils.renderIcon(SettingsSharpIcon)
      },
      {
        label: "联系",
        key: "contact",
        icon: utils.renderIcon(ChatboxEllipsesIcon)
      },
      {
        type: "divider",
        key: "d3"
      },
      {
        label: "退出登录",
        key: "logout",
        icon: utils.renderIcon(LogOutOutlineIcon)
      }
    ]);
    const errorHandle = (e) => {
      fallback.value = true;
    };
    const sysSetHandle = () => {
      modelShow.value = true;
    };
    const sysInfoHandle = () => {
      modelShowInfo.value = true;
    };
    const handleSelect = (key) => {
      switch (key) {
        case "contact":
          sysInfoHandle();
          break;
        case "sysSet":
          sysSetHandle();
          break;
        case "logout":
          router.logout();
          break;
      }
    };
    return (_ctx, _cache) => {
      const _component_n_dropdown = runtimeCore_esmBundler.resolveComponent("n-dropdown");
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock(runtimeCore_esmBundler.Fragment, null, [
        runtimeCore_esmBundler.createVNode(_component_n_dropdown, {
          trigger: "hover",
          onSelect: handleSelect,
          "show-arrow": true,
          options: options.value
        }, {
          default: runtimeCore_esmBundler.withCtx(() => [
            runtimeCore_esmBundler.createElementVNode("div", _hoisted_1, [
              fallback.value ? (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(reactivity_esmBundler.unref(PersonIcon), { key: 0 })) : runtimeCore_esmBundler.createCommentVNode("", true),
              !fallback.value ? (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(reactivity_esmBundler.unref(Avatar.default), {
                key: 1,
                round: "",
                "object-fit": "cover",
                size: "medium",
                src: reactivity_esmBundler.unref(person.default),
                onError: errorHandle
              }, null, 8, ["src"])) : runtimeCore_esmBundler.createCommentVNode("", true)
            ])
          ]),
          _: 1
        }, 8, ["options"]),
        runtimeCore_esmBundler.createVNode(reactivity_esmBundler.unref(index.default), {
          modelShow: modelShow.value,
          "onUpdate:modelShow": _cache[0] || (_cache[0] = ($event) => modelShow.value = $event)
        }, null, 8, ["modelShow"]),
        runtimeCore_esmBundler.createVNode(reactivity_esmBundler.unref(index$1.default), {
          modelShow: modelShowInfo.value,
          "onUpdate:modelShow": _cache[1] || (_cache[1] = ($event) => modelShowInfo.value = $event)
        }, null, 8, ["modelShow"])
      ], 64);
    };
  }
});
exports.default = _sfc_main;
