import{_ as Y,a as Z}from"./post-item.vue_vue_type_style_index_0_lang-b7428404.js";import{_ as ee}from"./post-skeleton-2db17910.js";import{_ as ae}from"./main-nav.vue_vue_type_style_index_0_lang-da1d5a81.js";import{d as te,r as c,j as se,w as oe,a3 as ne,c as _,V as n,_ as o,Q as y,a1 as v,O as b,o as r,a as u,M as f,e as C,a2 as D,F,a4 as H}from"./@vue-e0e89260.js";import{u as le}from"./vuex-473b3783.js";import{b as re}from"./vue-router-b8e3382f.js";import{B as k,_ as ue}from"./index-d161f57c.js";import{b as ie}from"./formatTime-4210fcd1.js";import{F as ce,G as _e,o as pe,O as me,f as ve,g as de,I as fe,H as ge}from"./naive-ui-62663ad7.js";import"./content-555eec37.js";import"./@vicons-0524c43e.js";import"./paopao-video-player-aa5e8b3f.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const he={class:"profile-baseinfo"},ke={class:"avatar"},we={class:"base-info"},ye={class:"username"},be={class:"userinfo"},Ie={class:"info-item"},Pe={class:"info-item"},Me={class:"userinfo"},Te={class:"info-item"},ze={class:"info-item"},qe={key:0,class:"skeleton-wrap"},Ce={key:1},xe={key:0,class:"empty-wrap"},Be={key:1},Se={key:2},Ve={key:1,class:"pagination-wrap"},$e=te({__name:"Profile",setup(Ne){const a=le(),d=re(),s=c(!1),l=c([]),w=c("post"),x=c(+d.query.p||1),B=c(1),S=c(1),V=c(1),$=c(1),t=c(+d.query.p||1),i=c(20),p=c(0),I=()=>{switch(w.value){case"post":P();break;case"comment":M();break;case"highlight":T();break;case"media":z();break;case"star":q();break}},P=()=>{s.value=!0,k({username:a.state.userInfo.username,style:"post",page:t.value,page_size:i.value}).then(e=>{s.value=!1,l.value=e.list||[],p.value=Math.ceil(e.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(e=>{l.value=[],s.value=!1})},M=()=>{s.value=!0,k({username:a.state.userInfo.username,style:"comment",page:t.value,page_size:i.value}).then(e=>{s.value=!1,l.value=e.list||[],p.value=Math.ceil(e.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(e=>{l.value=[],s.value=!1})},T=()=>{s.value=!0,k({username:a.state.userInfo.username,style:"highlight",page:t.value,page_size:i.value}).then(e=>{s.value=!1,l.value=e.list||[],p.value=Math.ceil(e.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(e=>{l.value=[],s.value=!1})},z=()=>{s.value=!0,k({username:a.state.userInfo.username,style:"media",page:t.value,page_size:i.value}).then(e=>{s.value=!1,l.value=e.list||[],p.value=Math.ceil(e.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(e=>{l.value=[],s.value=!1})},q=()=>{s.value=!0,k({username:a.state.userInfo.username,style:"star",page:t.value,page_size:i.value}).then(e=>{s.value=!1,l.value=e.list||[],p.value=Math.ceil(e.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(e=>{l.value=[],s.value=!1})},O=e=>{switch(w.value=e,w.value){case"post":t.value=x.value,P();break;case"comment":t.value=B.value,M();break;case"highlight":t.value=S.value,T();break;case"media":t.value=V.value,z();break;case"star":t.value=$.value,q();break}},R=e=>{switch(t.value=e,w.value){case"post":x.value=e,P();break;case"comment":B.value=t.value,M();break;case"highlight":S.value=t.value,T();break;case"media":V.value=t.value,z();break;case"star":$.value=t.value,q();break}};return se(()=>{I()}),oe(()=>({path:d.path,query:d.query,refresh:a.state.refresh}),(e,m)=>{if(e.refresh!==m.refresh){t.value=+d.query.p||1,setTimeout(()=>{I()},0);return}m.path!=="/post"&&e.path==="/profile"&&(t.value=+d.query.p||1,setTimeout(()=>{I()},0))}),(e,m)=>{const j=ae,E=pe,G=me,N=ne("router-link"),g=ve,L=de,Q=ee,A=fe,J=Y,U=ge,K=Z,W=ce,X=_e;return r(),_("div",null,[n(j,{title:"主页"}),o(a).state.userInfo.id>0?(r(),y(W,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:v(()=>[u("div",he,[u("div",ke,[n(E,{size:72,src:o(a).state.userInfo.avatar},null,8,["src"])]),u("div",we,[u("div",ye,[u("strong",null,f(o(a).state.userInfo.nickname),1),u("span",null," @"+f(o(a).state.userInfo.username),1),o(a).state.userInfo.is_admin?(r(),y(G,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:v(()=>[C(" 管理员 ")]),_:1})):b("",!0)]),u("div",be,[u("span",Ie,"UID. "+f(o(a).state.userInfo.id),1),u("span",Pe,f(o(ie)(o(a).state.userInfo.created_on))+" 加入",1)]),u("div",Me,[u("span",Te,[n(N,{onClick:m[0]||(m[0]=D(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:o(a).state.userInfo.username,n:o(a).state.userInfo.nickname,t:"follows"}}},{default:v(()=>[C(" 关注  "+f(o(a).state.userInfo.follows),1)]),_:1},8,["to"])]),u("span",ze,[n(N,{onClick:m[1]||(m[1]=D(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:o(a).state.userInfo.username,n:o(a).state.userInfo.nickname,t:"followings"}}},{default:v(()=>[C(" 粉丝  "+f(o(a).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),n(L,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":O},{default:v(()=>[n(g,{name:"post",tab:"泡泡"}),n(g,{name:"comment",tab:"评论"}),n(g,{name:"highlight",tab:"亮点"}),n(g,{name:"media",tab:"图文"}),n(g,{name:"star",tab:"喜欢"})]),_:1}),s.value?(r(),_("div",qe,[n(Q,{num:i.value},null,8,["num"])])):(r(),_("div",Ce,[l.value.length===0?(r(),_("div",xe,[n(A,{size:"large",description:"暂无数据"})])):b("",!0),o(a).state.desktopModelShow?(r(),_("div",Be,[(r(!0),_(F,null,H(l.value,h=>(r(),y(U,{key:h.id},{default:v(()=>[n(J,{post:h},null,8,["post"])]),_:2},1024))),128))])):(r(),_("div",Se,[(r(!0),_(F,null,H(l.value,h=>(r(),y(U,{key:h.id},{default:v(()=>[n(K,{post:h},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):b("",!0),p.value>0?(r(),_("div",Ve,[n(X,{page:t.value,"onUpdate:page":R,"page-slot":o(a).state.collapsedRight?5:8,"page-count":p.value},null,8,["page","page-slot","page-count"])])):b("",!0)])}}});const pa=ue($e,[["__scopeId","data-v-79a284ce"]]);export{pa as default};