import{_ as p,o as r,c as o,F as h,g as m,t as v,e as g,q as z,k as l}from"../index.js";const _=["title"],b={key:1,class:"avatar__fallback",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},x={__name:"Avatar",props:{name:{type:String,default:""},size:{type:Number,default:36}},setup(n){const a=n,i=["#6366f1","#0d9488","#d97706","#dc2626","#7c3aed","#059669","#c2410c","#4f46e5","#0891b2","#9333ea","#be185d","#0369a1"];function d(t){let e=0;for(let s=0;s<t.length;s++)e=t.charCodeAt(s)+((e<<5)-e);return Math.abs(e)}const c=l(()=>{var e;if(!a.name)return"";const t=a.name.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():((e=t[0][0])==null?void 0:e.toUpperCase())||""}),u=l(()=>a.name?i[d(a.name)%i.length]:"#94a3b8"),f=l(()=>Math.round(a.size*.4)+"px");return(t,e)=>(r(),o("span",{class:"avatar",style:z({width:n.size+"px",height:n.size+"px",fontSize:f.value,backgroundColor:u.value}),title:n.name||void 0},[c.value?(r(),o(h,{key:0},[m(v(c.value),1)],64)):(r(),o("svg",b,[...e[0]||(e[0]=[g("path",{d:"M12 12a4 4 0 100-8 4 4 0 000 8zm0 2c-4 0-8 2-8 4v2h16v-2c0-2-4-4-8-4z",fill:"currentColor"},null,-1)])]))],12,_))}},k=p(x,[["__scopeId","data-v-9225f2aa"]]);export{k as A};
