import{b as B,a as D,f as A,_ as C,e as O,Y as N,X as P,x as W,u as X,m as Y}from"./index-fNs72j9w.js";import{F as j,H as F,i as J}from"./footer-BVqCE-pu.js";import{o as T,r as Z,a as K}from"./router-BSeika6K.js";import{B as g,C as l,O as f,P as r,G as p,u as s,H as n,U as v,_ as x,D as h,Y as z,Z as w,N as E,a0 as H,I as a,X as Q,W as ee,$ as te,ac as ne,ai as q,F as G,o as se,p as oe,z as ae}from"./vue-DweYBrEc.js";import"./darkSwitch-CMn1l1Tk.js";import"./useDark-DHNZxxpN.js";const re={class:"userinfo"},le=["src"],ce={class:"username"},ie={class:"user-menus"},ue={key:0,class:"user-menu-max-title"},_e=["onClick"],me=g({__name:"aside",setup(d){const _=E(),m=H(),t=B(),i=D(),c=e=>{typeof e=="string"?m.push({name:e}):T(e)};return(e,o)=>{const y=a("Icon"),u=a("el-button"),I=a("el-button-group"),L=a("el-aside"),$=Q("blur");return l(),f(L,{class:"ba-user-layouts"},{default:r(()=>[p("div",re,[p("div",{onClick:o[0]||(o[0]=b=>c("account/profile")),class:"user-avatar-box"},[p("img",{class:"user-avatar",src:s(A)(s(t).avatar?s(t).avatar:"/static/images/avatar.png"),alt:""},null,8,le),n(y,{class:"user-avatar-gender",name:s(t).getGenderIcon().name,size:"14",color:s(t).getGenderIcon().color},null,8,["name","color"])]),p("p",ce,v(s(t).nickname),1),n(I,null,{default:r(()=>[x((l(),f(u,{onClick:o[1]||(o[1]=b=>c("account/integral")),class:"userinfo-button-item",title:e.$t("Integral")+" "+s(t).score,size:"default",plain:""},{default:r(()=>[p("span",null,v(e.$t("Integral")+" "+s(t).score),1)]),_:1},8,["title"])),[[$]]),x((l(),f(u,{onClick:o[2]||(o[2]=b=>c("account/balance")),class:"userinfo-button-item",title:e.$t("Balance")+" "+s(t).money,size:"default",plain:""},{default:r(()=>[p("span",null,v(e.$t("Balance")+" "+s(t).money),1)]),_:1},8,["title"])),[[$]])]),_:1})]),p("div",ie,[(l(!0),h(w,null,z(s(i).state.viewRoutes,(b,U)=>{var M;return l(),h(w,{key:U},[s(i).state.showHeadline?(l(),h("div",ue,v((M=b.meta)==null?void 0:M.title),1)):ee("",!0),(l(!0),h(w,null,z(b.children,(k,V)=>{var R,S;return l(),h("div",{key:V,onClick:ke=>c(k),class:te(["user-menu-item",s(_).fullPath==k.path?"active":""])},[n(y,{name:(R=k.meta)==null?void 0:R.icon,size:"16",color:"var(--el-text-color-secondary)"},null,8,["name"]),p("span",null,v((S=k.meta)==null?void 0:S.title),1)],10,_e)}),128))],64)}),128))])]),_:1})}}}),pe=C(me,[["__scopeId","data-v-be8e7096"]]),fe=g({__name:"main",setup(d){const _=O();return(m,t)=>{const i=a("router-view"),c=a("el-main");return l(),f(c,{class:"layout-main"},{default:r(()=>[n(i,null,{default:r(({Component:e})=>[n(ne,{name:s(_).layout.mainAnimation,mode:"out-in"},{default:r(()=>[(l(),f(q(e)))]),_:2},1032,["name"])]),_:1})]),_:1})}}}),de=C(fe,[["__scopeId","data-v-bc73de31"]]),ye=g({__name:"default",setup(d){return(_,m)=>{const t=a("el-col"),i=a("el-row"),c=a("el-scrollbar"),e=a("el-container");return l(),f(e,{class:"is-vertical"},{default:r(()=>[n(F),n(c,{style:G(s(N)),ref_key:"layoutMainScrollbarRef",ref:P},{default:r(()=>[n(i,{class:"frontend-footer-brother",justify:"center"},{default:r(()=>[n(t,{class:"user-layouts",span:16,xs:24},{default:r(()=>[n(pe,{class:"hidden-sm-and-down"}),n(de)]),_:1})]),_:1}),n(j)]),_:1},8,["style"])]),_:1})}}}),be=C(ye,[["__scopeId","data-v-fe6705cb"]]),ve=g({__name:"disable",setup(d){return(_,m)=>{const t=a("el-alert"),i=a("el-col"),c=a("el-row"),e=a("el-scrollbar"),o=a("el-container");return l(),f(o,{class:"is-vertical"},{default:r(()=>[n(F),n(e,{style:G(s(N)),ref_key:"layoutMainScrollbarRef",ref:P},{default:r(()=>[n(c,{class:"frontend-footer-brother",justify:"center"},{default:r(()=>[n(i,{class:"user-layouts",span:16,xs:24},{default:r(()=>[n(t,{center:!0,title:_.$t("Member center disabled"),type:"error"},null,8,["title"])]),_:1})]),_:1}),n(j)]),_:1},8,["style"])]),_:1})}}}),he=C(ve,[["__scopeId","data-v-88053b8c"]]);function ge(){return new Promise(d=>{d({type:"continue"})})}const Se=g({components:{Default:be,Disable:he},__name:"user",setup(d){const{t:_}=W.useI18n(),m=E(),t=H(),i=B(),c=X(),e=D();return se(async()=>{const o=await ge();if(o.type=="break")return;if(o.type=="reload")return window.location.href=o.url;if(!i.token)return t.push({name:"userLogin"});const y=()=>{if(o.type=="jump")return t.push(o.url);if(m.params.to){const u=JSON.parse(m.params.to);if(u.path!=Y){let I=oe(u.query)?{}:u.query;Z({path:u.path,query:I});return}}if(m.name=="userMainLoading"){let u=K(e.state.viewRoutes);u?t.push({path:u.path}):ae({type:"error",message:_("No route found to jump~")})}};c.userInitialize?y():J(y,!0),document.body.clientWidth<1024?e.setShrink(!0):e.setShrink(!1)}),(o,y)=>(l(),f(q(s(e).state.layoutMode)))}});export{Se as default};
