import{_ as ye}from"./post-item.03452002.js";import{_ as be}from"./post-skeleton.39a35f5b.js";import{D as Ce,c as V,c5 as ke,l as H,p as xe,o as j,d as R,u as G,q as A,r as h,s as E,h as I,af as Be,b2 as Fe,i as Ee,c6 as Se,be as De,b as T,bd as $e,v as q,y as Te,ah as W,V as C,a5 as z,a4 as _,Y as k,a3 as l,a8 as S,a9 as D,c7 as ze,_ as K,J as P,bp as J,c8 as Re,c9 as Ae,Z as Ie,ai as We,ca as Pe,S as Oe,a1 as Ue,ae as Le,W as F,cb as je,a2 as m,a6 as $,aa as qe,ab as Me,c4 as Ne,cc as Ve,cd as He,ad as Ge,an as Ke,bX as Je,b_ as Xe,c1 as Ye,c2 as Ze}from"./index.f480f018.js";import{u as Qe,a as es,_ as ss}from"./Skeleton.57e98fe3.js";import{_ as X}from"./Alert.a854329b.js";import{_ as ts}from"./main-nav.9110259b.js";import{M as ns}from"./MoreHorizFilled.80db5156.js";import{_ as os}from"./List.49bcdf81.js";import{_ as as}from"./Pagination.1263479e.js";import"./content.ef1e095a.js";import"./formatTime.02109bf5.js";import"./Thing.eef6b133.js";const ls=Ce({name:"Ellipsis",common:V,peers:{Tooltip:ke}});var is=ls,us=H("ellipsis",{overflow:"hidden"},[xe("line-clamp",` white-space: nowrap; display: inline-block; vertical-align: bottom; max-width: 100%; `),j("line-clamp",` display: -webkit-inline-box; -webkit-box-orient: vertical; `),j("cursor-pointer",` cursor: pointer; `)]);function M(e){return`${e}-ellipsis--line-clamp`}function N(e,u){return`${e}-ellipsis--cursor-${u}`}const rs=Object.assign(Object.assign({},A.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}});var Y=R({name:"Ellipsis",inheritAttrs:!1,props:rs,setup(e,{slots:u,attrs:r}){const{mergedClsPrefixRef:n}=G(e),i=A("Ellipsis","-ellipsis",us,is,e,n),s=h(null),c=h(null),f=h(!1),p=E(()=>{const{lineClamp:t}=e,{value:d}=f;return t!==void 0?{textOverflow:"","-webkit-line-clamp":d?"":t}:{textOverflow:d?"":"ellipsis","-webkit-line-clamp":""}});function a(){let t=!1;const{value:d}=f;if(d)return!0;const{value:g}=s;if(g){const{lineClamp:B}=e;b(g),B!==void 0?t=g.scrollHeight<=g.offsetHeight:t=g.scrollWidth<=g.offsetWidth,x(g,t)}return t}const v=E(()=>e.expandTrigger==="click"?()=>{var t;const{value:d}=f;d&&((t=c.value)===null||t===void 0||t.setShow(!1)),f.value=!d}:void 0),y=()=>I("span",Object.assign({},Fe(r,{class:[`${n.value}-ellipsis`,e.lineClamp!==void 0?M(n.value):void 0,e.expandTrigger==="click"?N(n.value,"pointer"):void 0],style:p.value}),{ref:"triggerRef",onClick:v.value,onMouseenter:e.expandTrigger==="click"?a:void 0}),u);function b(t){if(!t)return;const d=p.value,g=M(n.value);e.lineClamp!==void 0?w(t,g,"add"):w(t,g,"remove");for(const B in d)t.style[B]!==d[B]&&(t.style[B]=d[B])}function x(t,d){const g=N(n.value,"pointer");e.expandTrigger==="click"&&!d?w(t,g,"add"):w(t,g,"remove")}function w(t,d,g){g==="add"?t.classList.contains(d)||t.classList.add(d):t.classList.contains(d)&&t.classList.remove(d)}return{mergedTheme:i,triggerRef:s,tooltipRef:c,handleClick:v,renderTrigger:y,getTooltipDisabled:a}},render(){var e;const{tooltip:u,renderTrigger:r,$slots:n}=this;if(u){const{mergedTheme:i}=this;return I(Be,Object.assign({ref:"tooltipRef",placement:"top"},u,{getDisabled:this.getTooltipDisabled,theme:i.peers.Tooltip,themeOverrides:i.peerOverrides.Tooltip}),{trigger:r,default:(e=n.tooltip)!==null&&e!==void 0?e:n.default})}else return r()}});function cs(){const e=Ee(Se,null);return e===null&&De("use-dialog","No outer founded."),e}const ds=e=>{const{primaryColor:u,successColor:r,warningColor:n,errorColor:i,infoColor:s,fontWeightStrong:c}=e;return{fontWeight:c,rotate:"252deg",colorStartPrimary:T(u,{alpha:.6}),colorEndPrimary:u,colorStartInfo:T(s,{alpha:.6}),colorEndInfo:s,colorStartWarning:T(n,{alpha:.6}),colorEndWarning:n,colorStartError:T(i,{alpha:.6}),colorEndError:i,colorStartSuccess:T(r,{alpha:.6}),colorEndSuccess:r}},_s={name:"GradientText",common:V,self:ds};var ps=_s,ms=H("gradient-text",` display: inline-block; font-weight: var(--n-font-weight); -webkit-background-clip: text; background-clip: text; color: #0000; white-space: nowrap; background-image: linear-gradient(var(--n-rotate), var(--n-color-start) 0%, var(--n-color-end) 100%); transition: --n-color-start .3s var(--n-bezier), --n-color-end .3s var(--n-bezier); `);const fs=Object.assign(Object.assign({},A.props),{size:[String,Number],fontSize:[String,Number],type:{type:String,default:"primary"},color:[Object,String],gradient:[Object,String]});var Z=R({name:"GradientText",props:fs,setup(e){Qe();const{mergedClsPrefixRef:u,inlineThemeDisabled:r}=G(e),n=E(()=>{const{type:a}=e;return a==="danger"?"error":a}),i=E(()=>{let a=e.size||e.fontSize;return a&&(a=$e(a)),a||void 0}),s=E(()=>{const a=e.color||e.gradient;if(typeof a=="string")return a;if(a){const v=a.deg||0,y=a.from,b=a.to;return`linear-gradient(${v}deg, ${y} 0%, ${b} 100%)`}}),c=A("GradientText","-gradient-text",ms,ps,e,u),f=E(()=>{const{value:a}=n,{common:{cubicBezierEaseInOut:v},self:{rotate:y,[q("colorStart",a)]:b,[q("colorEnd",a)]:x,fontWeight:w}}=c.value;return{"--n-bezier":v,"--n-rotate":y,"--n-color-start":b,"--n-color-end":x,"--n-font-weight":w}}),p=r?Te("gradient-text",E(()=>n.value[0]),f,e):void 0;return{mergedClsPrefix:u,compatibleType:n,styleFontSize:i,styleBgImage:s,cssVars:r?void 0:f,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender}},render(){const{mergedClsPrefix:e,onRender:u}=this;return u==null||u(),I("span",{class:[`${e}-gradient-text`,`${e}-gradient-text--${this.compatibleType}-type`,this.themeClass],style:[{fontSize:this.styleFontSize,backgroundImage:this.styleBgImage},this.cssVars]},this.$slots)}});const gs={class:"whisper-wrap"},hs=S(" \u5373\u5C06\u53D1\u9001\u79C1\u4FE1\u7ED9: "),vs={class:"whisper-line"},ws={class:"whisper-line send-wrap"},ys=S(" \u53D1\u9001 "),bs=R({props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(e,{emit:u}){const r=e,n=h(""),i=h(!1),s=()=>{u("success")},c=()=>{i.value=!0,ze({user_id:r.user.id,content:n.value}).then(f=>{window.$message.success("\u53D1\u9001\u6210\u529F"),i.value=!1,n.value="",s()}).catch(f=>{i.value=!1})};return(f,p)=>{const a=Z,v=Y,y=X,b=K,x=P,w=J;return C(),z(w,{show:e.show,"onUpdate:show":s,class:"whisper-card",preset:"card",size:"small",title:"\u79C1\u4FE1","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:_(()=>[k("div",gs,[l(y,{"show-icon":!1},{default:_(()=>[hs,l(v,{style:{"max-width":"100%"}},{default:_(()=>[l(a,{type:"success"},{default:_(()=>[S(D(e.user.nickname)+"@"+D(e.user.username),1)]),_:1})]),_:1})]),_:1}),k("div",vs,[l(b,{type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u79C1\u4FE1\u5185\u5BB9\uFF08\u8BF7\u52FF\u53D1\u9001\u4E0D\u548C\u8C10\u5185\u5BB9\uFF0C\u5426\u5219\u5C06\u4F1A\u88AB\u5C01\u53F7\uFF09",autosize:{minRows:5,maxRows:10},value:n.value,"onUpdate:value":p[0]||(p[0]=t=>n.value=t),maxlength:"200","show-count":""},null,8,["value"])]),k("div",ws,[l(x,{strong:"",secondary:"",type:"primary",loading:i.value,onClick:c},{default:_(()=>[ys]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});var Cs=W(bs,[["__scopeId","data-v-3e021430"]]);const ks={class:"whisper-wrap"},xs=S(" \u53D1\u9001\u6DFB\u52A0\u670B\u53CB\u7533\u8BF7\u7ED9: "),Bs={class:"whisper-line"},Fs={class:"whisper-line send-wrap"},Es=S(" \u53D1\u9001 "),Ss=R({props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(e,{emit:u}){const r=e,n=h(""),i=h(!1),s=()=>{u("success")},c=()=>{i.value=!0,Re({user_id:r.user.id,greetings:n.value}).then(f=>{window.$message.success("\u53D1\u9001\u6210\u529F"),i.value=!1,n.value="",s()}).catch(f=>{i.value=!1})};return(f,p)=>{const a=Z,v=Y,y=X,b=K,x=P,w=J;return C(),z(w,{show:e.show,"onUpdate:show":s,class:"whisper-card",preset:"card",size:"small",title:"\u7533\u8BF7\u6DFB\u52A0\u670B\u53CB","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:_(()=>[k("div",ks,[l(y,{"show-icon":!1},{default:_(()=>[xs,l(v,{style:{"max-width":"100%"}},{default:_(()=>[l(a,{type:"success"},{default:_(()=>[S(D(e.user.nickname)+"@"+D(e.user.username),1)]),_:1})]),_:1})]),_:1}),k("div",Bs,[l(b,{type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u771F\u631A\u7684\u95EE\u5019\u8BED",autosize:{minRows:5,maxRows:10},value:n.value,"onUpdate:value":p[0]||(p[0]=t=>n.value=t),maxlength:"120","show-count":""},null,8,["value"])]),k("div",Fs,[l(x,{strong:"",secondary:"",type:"primary",loading:i.value,onClick:c},{default:_(()=>[Es]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});var Ds=W(Ss,[["__scopeId","data-v-bf9bc04e"]]);const $s={key:0,class:"profile-baseinfo"},Ts={class:"avatar"},zs={class:"base-info"},Rs={class:"username"},As=S(" \u597D\u53CB "),Is=S(" \u7BA1\u7406\u5458 "),Ws={class:"uid"},Ps={key:0,class:"user-opts"},Os={key:0,class:"pagination-wrap"},Us={key:0,class:"skeleton-wrap"},Ls={key:1},js={key:0,class:"empty-wrap"},qs=R({setup(e){Ae();const u=cs(),r=Ie(),n=We(),i=h(!1),s=Pe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),c=h(!1),f=h(!1),p=h(!1),a=h([]),v=h(n.query.username||""),y=h(+n.query.p||1),b=h(20),x=h(0),w=()=>{i.value=!0,Ne({username:v.value,page:y.value,page_size:b.value}).then(o=>{i.value=!1,a.value=o.list,x.value=Math.ceil(o.pager.total_rows/b.value),window.scrollTo(0,0)}).catch(o=>{i.value=!1})},t=()=>{c.value=!0,je({username:v.value}).then(o=>{c.value=!1,s.id=o.id,s.avatar=o.avatar,s.username=o.username,s.nickname=o.nickname,s.is_admin=o.is_admin,s.is_friend=o.is_friend,s.status=o.status,w()}).catch(o=>{c.value=!1,console.log(o)})},d=o=>{y.value=o,w()},g=()=>{f.value=!0},B=()=>{p.value=!0},Q=()=>{f.value=!1},ee=()=>{p.value=!1},se=E(()=>{let o=[{label:"\u79C1\u4FE1",key:"whisper"}];return r.state.userInfo.is_admin&&(s.status===1?o.push({label:"\u7981\u8A00",key:"banned"}):o.push({label:"\u89E3\u5C01",key:"deblocking"})),s.is_friend?o.push({label:"\u5220\u9664\u597D\u53CB",key:"delete"}):o.push({label:"\u6DFB\u52A0\u670B\u53CB",key:"requesting"}),o}),te=o=>{switch(o){case"whisper":g();break;case"delete":ne();break;case"requesting":B();break;case"banned":case"deblocking":oe();break}},ne=()=>{u.warning({title:"\u5220\u9664\u597D\u53CB",content:"\u5C06\u597D\u53CB \u201C"+s.nickname+"\u201D \u5220\u9664\uFF0C\u5C06\u540C\u65F6\u5220\u9664 \u70B9\u8D5E/\u6536\u85CF \u5217\u8868\u4E2D\u5173\u4E8E\u8BE5\u670B\u53CB\u7684 \u201C\u597D\u53CB\u53EF\u89C1\u201D \u63A8\u6587",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>{c.value=!0,Ve({user_id:s.id}).then(o=>{c.value=!1,s.is_friend=!1,w()}).catch(o=>{c.value=!1,console.log(o)})}})},oe=()=>{u.warning({title:"\u8B66\u544A",content:"\u786E\u5B9A\u5BF9\u8BE5\u7528\u6237\u8FDB\u884C"+(s.status===1?"\u7981\u8A00":"\u89E3\u5C01")+"\u5904\u7406\u5417\uFF1F",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>{c.value=!0,He({id:s.id,status:s.status===1?2:1}).then(o=>{c.value=!1,t()}).catch(o=>{c.value=!1,console.log(o)})}})};return Oe(()=>({path:n.path,query:n.query}),(o,O)=>{O.path==="/user"&&o.path==="/user"&&(v.value=n.query.username||"",t())}),Ue(()=>{t()}),(o,O)=>{const ae=ts,le=Ge,U=Ke,ie=Le,ue=P,re=Je,ce=Cs,de=Xe,_e=as,pe=Ye,me=Ze,fe=be,ge=es,he=ye,ve=ss,we=os;return C(),F("div",null,[l(ae,{title:"\u7528\u6237\u8BE6\u60C5"}),l(we,{class:"main-content-wrap profile-wrap",bordered:""},{footer:_(()=>[x.value>0?(C(),F("div",Os,[l(_e,{page:y.value,"onUpdate:page":d,"page-slot":m(r).state.collapsedRight?5:8,"page-count":x.value},null,8,["page","page-slot","page-count"])])):$("",!0)]),default:_(()=>[l(de,{show:c.value},{default:_(()=>[m(s).id>0?(C(),F("div",$s,[k("div",Ts,[l(le,{size:"large",src:m(s).avatar},null,8,["src"])]),k("div",zs,[k("div",Rs,[k("strong",null,D(m(s).nickname),1),k("span",null," @"+D(m(s).username),1),m(r).state.userInfo.id>0&&m(r).state.userInfo.username!=m(s).username&&m(s).is_friend?(C(),z(U,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:_(()=>[As]),_:1})):$("",!0),m(s).is_admin?(C(),z(U,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:_(()=>[Is]),_:1})):$("",!0)]),k("div",Ws,"UID. "+D(m(s).id),1)]),m(r).state.userInfo.id>0&&m(r).state.userInfo.username!=m(s).username?(C(),F("div",Ps,[l(re,{placement:"bottom-end",trigger:"click",size:"small",options:m(se),onSelect:te},{default:_(()=>[l(ue,{quaternary:"",circle:""},{icon:_(()=>[l(ie,null,{default:_(()=>[l(m(ns))]),_:1})]),_:1})]),_:1},8,["options"])])):$("",!0)])):$("",!0),l(ce,{show:f.value,user:m(s),onSuccess:Q},null,8,["show","user"]),l(Ds,{show:p.value,user:m(s),onSuccess:ee},null,8,["show","user"])]),_:1},8,["show"]),l(me,{class:"profile-tabs-wrap",animated:""},{default:_(()=>[l(pe,{name:"post",tab:"\u6CE1\u6CE1"})]),_:1}),i.value?(C(),F("div",Us,[l(fe,{num:b.value},null,8,["num"])])):(C(),F("div",Ls,[a.value.length===0?(C(),F("div",js,[l(ge,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):$("",!0),(C(!0),F(qe,null,Me(a.value,L=>(C(),z(ve,{key:L.id},{default:_(()=>[l(he,{post:L},null,8,["post"])]),_:2},1024))),128))]))]),_:1})])}}});var st=W(qs,[["__scopeId","data-v-7a6aaa02"]]);export{st as default};