import{r as f,a4 as u,x as g,j as m}from"./main-BiT4j4N5.js";const h="@",v="#",y="+",A=new Intl.Segmenter;function I(t){if(t.length<1)return"";const e=t[0];[h,v,y].includes(e)&&(t=t.substring(1));const a=A.segment(t)[Symbol.iterator]().next();return a.done?"":a.value.segment}const M="_avatar_zysgz_8",x="_image_zysgz_43",o={avatar:M,image:x,"avatar-imageless":"_avatar-imageless_zysgz_55"};function E(t){return t.split("").reduce((r,n)=>r+n.charCodeAt(0),0)%6+1}function R(t){return!!(t.onClick||t.onKeyDown||t.onKeyUp)}const S=f.forwardRef(function({src:e,id:a,name:c="",type:r="round",className:n="",size:s,style:i={},onError:d,...l},_){return u.createElement(R(l)?"button":"span",{ref:_,role:"img","aria-label":a,...l,"data-type":r,"data-color":E(a),className:g(o.avatar,n,{[o["avatar-imageless"]]:!e}),style:{...i,"--cpd-avatar-size":s}},m.jsx(u.Fragment,{children:e?m.jsx("img",{loading:"lazy",alt:"",src:e,referrerPolicy:"no-referrer",className:g(o.image),"data-type":r,style:i,width:s,height:s,onError:d}):I(c)}))});export{S as A};
//# sourceMappingURL=Avatar-CO8l_TS7.js.map
