var e=Object.defineProperty,a=Object.defineProperties,r=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable,n=(a,r,s)=>r in a?e(a,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[r]=s,l=(e,a)=>{for(var r in a||(a={}))o.call(a,r)&&n(e,r,a[r]);if(s)for(var r of s(a))t.call(a,r)&&n(e,r,a[r]);return e},i=(e,s)=>a(e,r(s)),d=(e,a)=>{var r={};for(var n in e)o.call(e,n)&&a.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&s)for(var n of s(e))a.indexOf(n)<0&&t.call(e,n)&&(r[n]=e[n]);return r};import{r as c,j as f,t as u,K as m,y as p}from"./ui-vendor-BewJQzBv.js";import{r as v}from"./react-vendor-D6Nbkvjy.js";import{g}from"./home-components-zRcEiFkI.js";var y="Avatar",[w,j]=c(y),[N,b]=w(y),h=v.forwardRef((e,a)=>{const r=e,{__scopeAvatar:s}=r,o=d(r,["__scopeAvatar"]),[t,n]=v.useState("idle");return f.jsx(N,{scope:s,imageLoadingStatus:t,onImageLoadingStatusChange:n,children:f.jsx(u.span,i(l({},o),{ref:a}))})});h.displayName=y;var x="AvatarImage",_=v.forwardRef((e,a)=>{const r=e,{__scopeAvatar:s,src:o,onLoadingStatusChange:t=()=>{}}=r,n=d(r,["__scopeAvatar","src","onLoadingStatusChange"]),c=b(x,s),g=function(e,a){const[r,s]=v.useState("idle");return p(()=>{if(!e)return void s("error");let r=!0;const o=new window.Image,t=e=>()=>{r&&s(e)};return s("loading"),o.onload=t("loaded"),o.onerror=t("error"),o.src=e,a&&(o.referrerPolicy=a),()=>{r=!1}},[e,a]),r}(o,n.referrerPolicy),y=m(e=>{t(e),c.onImageLoadingStatusChange(e)});return p(()=>{"idle"!==g&&y(g)},[g,y]),"loaded"===g?f.jsx(u.img,i(l({},n),{ref:a,src:o})):null});_.displayName=x;var O="AvatarFallback",A=v.forwardRef((e,a)=>{const r=e,{__scopeAvatar:s,delayMs:o}=r,t=d(r,["__scopeAvatar","delayMs"]),n=b(O,s),[c,m]=v.useState(void 0===o);return v.useEffect(()=>{if(void 0!==o){const e=window.setTimeout(()=>m(!0),o);return()=>window.clearTimeout(e)}},[o]),c&&"loaded"!==n.imageLoadingStatus?f.jsx(u.span,i(l({},t),{ref:a})):null});A.displayName=O;var S=h,P=_,L=A;const R=v.forwardRef((e,a)=>{var r=e,{className:s}=r,o=d(r,["className"]);return f.jsx(S,l({ref:a,className:g("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",s)},o))});R.displayName=S.displayName;const I=v.forwardRef((e,a)=>{var r=e,{className:s}=r,o=d(r,["className"]);return f.jsx(P,l({ref:a,className:g("aspect-square h-full w-full",s)},o))});I.displayName=P.displayName;const C=v.forwardRef((e,a)=>{var r=e,{className:s}=r,o=d(r,["className"]);return f.jsx(L,l({ref:a,className:g("flex h-full w-full items-center justify-center rounded-full bg-muted",s)},o))});C.displayName=L.displayName;export{R as A,C as a,I as b};
