import{_ as Ve,a as je}from"./post-item.vue_vue_type_style_index_0_lang-68b9f7c4.js";import{_ as Ee}from"./post-skeleton-649e932a.js";import{D as Ge,_ as se,E as Je,F as Ye,e as R,G as Ke,H as Qe,I as Xe,J as Ze}from"./index-4afa107a.js";import{R as pe,H as de,S as me,b as fe,e as ae,i as he,T as es,F as ss,a as as,j as ue,o as ts,M as ls,O as os,k as ns,f as us,g as is,I as cs,G as rs}from"./naive-ui-d8de3dda.js";import{d as te,H as o,e as r,q as y,w as i,j as _,k as l,A as g,x as h,R as _s,c as vs,b as ps,E as ds,r as ms,f as w,Y as P,bf as f,y as ie,F as ce,u as re,h as _e}from"./@vue-a481fc63.js";import{_ as fs}from"./main-nav.vue_vue_type_style_index_0_lang-088e2761.js";import{u as hs}from"./vuex-44de225f.js";import{b as gs}from"./vue-router-e5a2430e.js";import{b as ws}from"./formatTime-4210fcd1.js";import{W as ks}from"./v3-infinite-loading-2c58ec2f.js";import{i as ys,w as bs,x as ve,y as Ps,z as $s,D as xs,G as Ts}from"./@vicons-9939c40b.js";import"./content-bb278a07.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 zs={class:"whisper-wrap"},Us={class:"whisper-line"},Is={class:"whisper-line send-wrap"},Fs=te({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(A,{emit:$}){const d=A,v=o(""),u=o(!1),p=()=>{$("success")},s=()=>{u.value=!0,Ge({user_id:d.user.id,content:v.value}).then(n=>{window.$message.success("发送成功"),u.value=!1,v.value="",p()}).catch(n=>{u.value=!1})};return(n,k)=>{const x=pe,a=de,T=me,z=fe,U=ae,I=he;return r(),y(I,{show:n.show,"onUpdate:show":p,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:i(()=>[_("div",zs,[l(T,{"show-icon":!1},{default:i(()=>[g(" 即将发送私信给: "),l(a,{style:{"max-width":"100%"}},{default:i(()=>[l(x,{type:"success"},{default:i(()=>[g(h(n.user.nickname)+"@"+h(n.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Us,[l(z,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:v.value,"onUpdate:value":k[0]||(k[0]=F=>v.value=F),maxlength:"200","show-count":""},null,8,["value"])]),_("div",Is,[l(U,{strong:"",secondary:"",type:"primary",loading:u.value,onClick:s},{default:i(()=>[g(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ms=se(Fs,[["__scopeId","data-v-0cbfe47c"]]),qs={class:"whisper-wrap"},Cs={class:"whisper-line"},Ss={class:"whisper-line send-wrap"},Ws=te({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(A,{emit:$}){const d=A,v=o(""),u=o(!1),p=()=>{$("success")},s=()=>{u.value=!0,Je({user_id:d.user.id,greetings:v.value}).then(n=>{window.$message.success("发送成功"),u.value=!1,v.value="",p()}).catch(n=>{u.value=!1})};return(n,k)=>{const x=pe,a=de,T=me,z=fe,U=ae,I=he;return r(),y(I,{show:n.show,"onUpdate:show":p,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:i(()=>[_("div",qs,[l(T,{"show-icon":!1},{default:i(()=>[g(" 发送添加朋友申请给: "),l(a,{style:{"max-width":"100%"}},{default:i(()=>[l(x,{type:"success"},{default:i(()=>[g(h(n.user.nickname)+"@"+h(n.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Cs,[l(z,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:v.value,"onUpdate:value":k[0]||(k[0]=F=>v.value=F),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Ss,[l(U,{strong:"",secondary:"",type:"primary",loading:u.value,onClick:s},{default:i(()=>[g(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Os=se(Ws,[["__scopeId","data-v-60be56a2"]]),Rs={key:0,class:"profile-baseinfo"},As={class:"avatar"},Bs={class:"base-info"},Ds={class:"username"},Ls={class:"userinfo"},Hs={class:"info-item"},Ns={class:"info-item"},Vs={class:"userinfo"},js={class:"info-item"},Es={class:"info-item"},Gs={key:0,class:"user-opts"},Js={key:0,class:"skeleton-wrap"},Ys={key:1},Ks={key:0,class:"empty-wrap"},Qs={key:1},Xs={key:2},Zs={class:"load-more-wrap"},ea={class:"load-more-spinner"},sa=te({__name:"User",setup(A){const $=es(),d=hs(),v=gs(),u=o(!1),p=o(!1),s=_s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),n=o(!1),k=o(!1),x=o(!1),a=o([]),T=o([]),z=o([]),U=o([]),I=o([]),F=o([]),M=o(v.query.s||""),t=o(+v.query.p||1),C=o("post"),D=o(+v.query.p||1),L=o(1),H=o(1),N=o(1),V=o(1),m=o(20),c=o(0),j=o(0),E=o(0),G=o(0),J=o(0),Y=o(0),ge=()=>{p.value=!1,a.value=[],T.value=[],z.value=[],U.value=[],I.value=[],F.value=[],C.value="post",t.value=1,D.value=1,L.value=1,H.value=1,N.value=1,V.value=1,c.value=0,j.value=0,E.value=0,G.value=0,J.value=0,Y.value=0},we=()=>{switch(C.value){case"post":B();break;case"comment":K();break;case"highlight":Q();break;case"media":X();break;case"star":Z();break}},B=()=>{u.value=!0,R({username:M.value,style:"post",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),T.value=a.value,j.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},K=()=>{u.value=!0,R({username:M.value,style:"comment",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),z.value=a.value,E.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},Q=()=>{u.value=!0,R({username:M.value,style:"highlight",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),U.value=a.value,G.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},X=()=>{u.value=!0,R({username:M.value,style:"media",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),I.value=a.value,J.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},Z=()=>{u.value=!0,R({username:M.value,style:"star",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),F.value=a.value,Y.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},ke=e=>{switch(C.value=e,C.value){case"post":a.value=T.value,t.value=D.value,c.value=j.value,B();break;case"comment":a.value=z.value,t.value=L.value,c.value=E.value,K();break;case"highlight":a.value=U.value,t.value=H.value,c.value=G.value,Q();break;case"media":a.value=I.value,t.value=N.value,c.value=J.value,X();break;case"star":a.value=F.value,t.value=V.value,c.value=Y.value,Z();break}},W=()=>{n.value=!0,Ye({username:M.value}).then(e=>{n.value=!1,s.id=e.id,s.avatar=e.avatar,s.username=e.username,s.nickname=e.nickname,s.is_admin=e.is_admin,s.is_friend=e.is_friend,s.created_on=e.created_on,s.is_following=e.is_following,s.follows=e.follows,s.followings=e.followings,s.status=e.status,we()}).catch(e=>{n.value=!1,console.log(e)})},ye=()=>{switch(C.value){case"post":D.value=t.value,B();break;case"comment":L.value=t.value,K();break;case"highlight":H.value=t.value,Q();break;case"media":N.value=t.value,X();break;case"star":V.value=t.value,Z();break}},be=()=>{k.value=!0},Pe=()=>{x.value=!0},$e=()=>{k.value=!1},xe=()=>{x.value=!1},q=e=>()=>_e(ue,null,{default:()=>_e(e)}),Te=vs(()=>{let e=[{label:"私信",key:"whisper",icon:q(bs)}];return d.state.userInfo.is_admin&&(s.status===1?e.push({label:"禁言",key:"banned",icon:q(ve)}):e.push({label:"解封",key:"deblocking",icon:q(ve)})),s.is_following?e.push({label:"取消关注",key:"unfollow",icon:q(Ps)}):e.push({label:"关注",key:"follow",icon:q($s)}),s.is_friend?e.push({label:"删除好友",key:"delete",icon:q(xs)}):e.push({label:"添加朋友",key:"requesting",icon:q(Ts)}),e}),ze=e=>{switch(e){case"whisper":be();break;case"delete":Ue();break;case"requesting":Pe();break;case"follow":case"unfollow":Ie();break;case"banned":case"deblocking":Fe();break}},Ue=()=>{$.warning({title:"删除好友",content:"将好友 “"+s.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.value=!0,Ke({user_id:s.id}).then(e=>{n.value=!1,s.is_friend=!1,B()}).catch(e=>{n.value=!1,console.log(e)})}})},Ie=()=>{$.success({title:"提示",content:"确定"+(s.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.value=!0,s.is_following?Qe({user_id:s.id}).then(e=>{n.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{n.value=!1,console.log(e)}):Xe({user_id:s.id}).then(e=>{n.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{n.value=!1,console.log(e)})}})},Fe=()=>{$.warning({title:"警告",content:"确定对该用户进行"+(s.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.value=!0,Ze({id:s.id,status:s.status===1?2:1}).then(e=>{n.value=!1,s.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{n.value=!1,console.log(e)})}})},Me=()=>{t.value{W()}),ds(()=>({path:v.path,query:v.query}),(e,b)=>{b.path==="/u"&&e.path==="/u"&&(M.value=v.query.s||"",ge(),W())}),(e,b)=>{const qe=fs,Ce=ts,ee=ls,le=ms("router-link"),Se=ae,We=os,Oe=Ms,oe=ns,O=us,Re=is,Ae=Ee,Be=cs,De=Ve,ne=rs,Le=je,He=ss,Ne=as;return r(),w("div",null,[l(qe,{title:"用户详情"}),l(He,{class:"main-content-wrap profile-wrap",bordered:""},{default:i(()=>[l(oe,{show:n.value},{default:i(()=>[s.id>0?(r(),w("div",Rs,[_("div",As,[l(Ce,{size:72,src:s.avatar},null,8,["src"])]),_("div",Bs,[_("div",Ds,[_("strong",null,h(s.nickname),1),_("span",null," @"+h(s.username),1),f(d).state.userInfo.id>0&&f(d).state.userInfo.username!=s.username&&s.is_friend?(r(),y(ee,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:i(()=>[g(" 好友 ")]),_:1})):P("",!0),f(d).state.userInfo.id>0&&f(d).state.userInfo.username!=s.username&&s.is_following?(r(),y(ee,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:i(()=>[g(" 已关注 ")]),_:1})):P("",!0),s.is_admin?(r(),y(ee,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:i(()=>[g(" 管理员 ")]),_:1})):P("",!0)]),_("div",Ls,[_("span",Hs,"UID. "+h(s.id),1),_("span",Ns,h(f(ws)(s.created_on))+" 加入",1)]),_("div",Vs,[_("span",js,[l(le,{onClick:b[0]||(b[0]=ie(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:s.username,n:s.nickname,t:"follows"}}},{default:i(()=>[g(" 关注  "+h(s.follows),1)]),_:1},8,["to"])]),_("span",Es,[l(le,{onClick:b[1]||(b[1]=ie(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:s.username,n:s.nickname,t:"followings"}}},{default:i(()=>[g(" 粉丝  "+h(s.followings),1)]),_:1},8,["to"])])])]),f(d).state.userInfo.id>0&&f(d).state.userInfo.username!=s.username?(r(),w("div",Gs,[l(We,{placement:"bottom-end",trigger:"click",size:"small",options:Te.value,onSelect:ze},{default:i(()=>[l(Se,{quaternary:"",circle:""},{icon:i(()=>[l(f(ue),null,{default:i(()=>[l(f(ys))]),_:1})]),_:1})]),_:1},8,["options"])])):P("",!0)])):P("",!0),l(Oe,{show:k.value,user:s,onSuccess:$e},null,8,["show","user"]),l(Os,{show:x.value,user:s,onSuccess:xe},null,8,["show","user"])]),_:1},8,["show"]),l(Re,{class:"profile-tabs-wrap",type:"line",animated:"",value:C.value,"onUpdate:value":ke},{default:i(()=>[l(O,{name:"post",tab:"泡泡"}),l(O,{name:"comment",tab:"评论"}),l(O,{name:"highlight",tab:"亮点"}),l(O,{name:"media",tab:"图文"}),l(O,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),u.value&&a.value.length===0?(r(),w("div",Js,[l(Ae,{num:m.value},null,8,["num"])])):(r(),w("div",Ys,[a.value.length===0?(r(),w("div",Ks,[l(Be,{size:"large",description:"暂无数据"})])):P("",!0),f(d).state.desktopModelShow?(r(),w("div",Qs,[(r(!0),w(ce,null,re(a.value,S=>(r(),y(ne,{key:S.id},{default:i(()=>[l(De,{post:S},null,8,["post"])]),_:2},1024))),128))])):(r(),w("div",Xs,[(r(!0),w(ce,null,re(a.value,S=>(r(),y(ne,{key:S.id},{default:i(()=>[l(Le,{post:S},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),c.value>0?(r(),y(Ne,{key:0,justify:"center"},{default:i(()=>[l(f(ks),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:b[2]||(b[2]=S=>Me())},{spinner:i(()=>[_("div",Zs,[p.value?P("",!0):(r(),y(oe,{key:0,size:14})),_("span",ea,h(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):P("",!0)])}}});const Sa=se(sa,[["__scopeId","data-v-17f0dc61"]]);export{Sa as default};