var e=Object.defineProperty,a=Object.defineProperties,s=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,o=(a,s,r)=>s in a?e(a,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[s]=r;import{a2 as i,ak as n,ae as l,b2 as u,bu as p,_ as f,d as y,X as b,a as v,c as m,aa as d,by as g,w as S,e as j,f as O,y as h,j as k,g as w,u as z,z as E,au as P,ab as _,i as x,ap as q}from"./index-ip5gDR6L.js";const A=i({size:{type:[Number,String],values:p,default:"",validator:e=>u(e)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:l},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:n(String),default:"cover"}}),B={error:e=>e instanceof Event},D=y({name:"ElAvatar"}),F=y((I=((e,a)=>{for(var s in a||(a={}))t.call(a,s)&&o(e,s,a[s]);if(r)for(var s of r(a))c.call(a,s)&&o(e,s,a[s]);return e})({},D),a(I,s({props:A,emits:B,setup(e,{emit:a}){const s=e,r=b("avatar"),t=v(!1),c=m(()=>{const{size:e,icon:a,shape:t}=s,c=[r.b()];return d(e)&&c.push(r.m(e)),a&&c.push(r.m("icon")),t&&c.push(r.m(t)),c}),o=m(()=>{const{size:e}=s;return u(e)?r.cssVarBlock({size:g(e)||""}):void 0}),i=m(()=>({objectFit:s.fit}));function n(e){t.value=!0,a("error",e)}return S(()=>s.src,()=>t.value=!1),(e,a)=>(O(),j("span",{class:x(z(c)),style:w(z(o))},[!e.src&&!e.srcSet||t.value?e.icon?(O(),h(z(_),{key:1},{default:E(()=>[(O(),h(P(e.icon)))]),_:1})):k(e.$slots,"default",{key:2}):(O(),j("img",{key:0,src:e.src,alt:e.alt,srcset:e.srcSet,style:w(z(i)),onError:n},null,44,["src","alt","srcset"]))],6))}}))));var I;const N=q(f(F,[["__file","avatar.vue"]]));export{N as E};
