import{e as z,bN as E,bO as p,aY as _,a$ as k,d as f,f as j,r as B,ad as o,bP as q,bw as w,w as x,o as c,c as v,aB as d,a as i,g as m,B as N,aP as P,b1 as $,j as A,n as D,_ as F,q as O}from"./index-BP6bNRoi.js";const V=z({size:{type:[Number,String],values:E,default:"",validator:s=>p(s)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:_},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:k(String),default:"cover"}}),Y={error:s=>s instanceof Event},C=["src","alt","srcset"],G=f({name:"ElAvatar"}),H=O(F(f({...G,props:V,emits:Y,setup(s,{emit:y}){const e=s,t=j("avatar"),n=B(!1),b=o(()=>{const{size:a,icon:l,shape:u}=e,r=[t.b()];return q(a)&&r.push(t.m(a)),l&&r.push(t.m("icon")),u&&r.push(t.m(u)),r}),g=o(()=>{const{size:a}=e;return p(a)?t.cssVarBlock({size:w(a)||""}):void 0}),S=o(()=>({objectFit:e.fit}));function h(a){n.value=!0,y("error",a)}return x(()=>e.src,()=>n.value=!1),(a,l)=>(c(),v("span",{class:D(i(b)),style:d(i(g))},[!a.src&&!a.srcSet||n.value?a.icon?(c(),m(i($),{key:1},{default:N(()=>[(c(),m(P(a.icon)))]),_:1})):A(a.$slots,"default",{key:2}):(c(),v("img",{key:0,src:a.src,alt:a.alt,srcset:a.srcSet,style:d(i(S)),onError:h},null,44,C))],6))}}),[["__file","avatar.vue"]])),I="/assets/avatar-Dcbh69co.gif";export{H as E,I as a};