import{b as k,a as l,e as g,D as x,h as a,i as f,j as y,t as m,l as M,y as _,z as h,H as q,T as I}from"./vue-y3KLWBaS.js";import{M as z}from"./MkUserInfo-NOodgOlv.js";import{aS as B,e as C,f as L,n as U}from"./app-JmgyQoR0.js";import"./MkNumber.vue_vue_type_script_setup_true_lang-gu4zp81q.js";import"./number-rE36t967.js";const b={key:1},j=k({__name:"MkUserPreview",props:{showing:{type:Boolean},q:{},source:{}},emits:["closed","mouseover","mouseleave"],setup(d,{emit:c}){const e=d,n=c,v=B("middle");let t=l(null),i=l(0),u=l(0);return g(()=>{if(typeof e.q=="object")t.value=e.q;else{const p=e.q.startsWith("@")?C.parse(e.q.slice(1)):{userId:e.q};L("users/show",p).then(w=>{e.showing&&(t.value=w)})}const s=e.source.getBoundingClientRect(),o=s.left+e.source.offsetWidth/2-300/2+window.pageXOffset,r=s.top+e.source.offsetHeight+window.pageYOffset;i.value=r,u.value=o}),(s,o)=>{const r=x("MkLoading");return a(),f(I,{name:s.$store.state.animation?"popup":"",appear:"",onAfterLeave:o[2]||(o[2]=p=>n("closed"))},{default:y(()=>[s.showing?(a(),m("div",{key:0,class:"fxxzrfni _popup _shadow",style:_({zIndex:h(v),top:i.value+"px",left:u.value+"px"}),onMouseover:o[0]||(o[0]=()=>{n("mouseover")}),onMouseleave:o[1]||(o[1]=()=>{n("mouseleave")})},[t.value!=null?(a(),f(z,{key:0,user:t.value,detailed:!0},null,8,["user"])):(a(),m("div",b,[M(r)]))],36)):q("",!0)]),_:1},8,["name"])}}}),T=U(j,[["__scopeId","data-v-4e48eeae"]]);export{T as default};
