"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/extends"),t=require("@babel/runtime/helpers/defineProperty"),a=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react"),i=require("clsx"),o=require("@prom-ui/core/Icon"),n=require("@prom-ui/icons/User");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var u=c(e),s=c(t),d=c(a),m=l(r),f=c(i);var v={root:"G2c2y",image:"A7F5c",text:"ZWoLT",icon:"sQ5M9",theme_white:"alKXP","theme_black-100":"mN0Ch","theme_violet-300":"MEUSj","theme_yellow-500":"lfsbh",theme_multicolor:"zMJTY",objectFit_fill:"SpfXf",objectFit_contain:"XuTkK",objectFit_cover:"aNZ54","objectFit_scale-down":"FacDj",objectFit_none:"maThn"},b=["image","name","size","loading","theme","objectFit","className"],h=m.forwardRef((function(e,t){var a=e.image,r=e.name,i=e.size,c=void 0===i?40:i,l=e.loading,h=void 0===l?"eager":l,_=e.theme,g=void 0===_?"violet-300":_,p=e.objectFit,j=void 0===p?"cover":p,q=e.className,y=d.default(e,b),F=!!a,N=void 0,w=null;if(!F){var E=r?r.trim():"";"multicolor"===g&&(N=function(e){var t,a=0;for(t=0;t<e.length;t+=1)a=e.charCodeAt(t)+((a<<5)-a);var r="#";for(t=0;t<3;t+=1)r+="00".concat((a>>8*t&255).toString(16)).slice(-2);return r}(E)),w=function(e){return e.split(" ").slice(0,2).map((function(e){return e[0]})).join("")}(E)}return m.createElement("div",u.default({className:f.default(v.root,q,s.default(s.default({},v["theme_".concat(g)],!F),v["objectFit_".concat(j)],!0)),"data-qaid":"avatar","data-testid":"avatar"},y,{style:{background:N,width:c,height:c,fontSize:c/2.2},ref:t}),F?m.createElement("img",{className:v.image,src:a,alt:r,width:c,height:c,loading:h,"data-qaid":"avatar_image","data-testid":"avatar_image"}):m.createElement(m.Fragment,null,w?m.createElement("span",{className:v.text,"data-qaid":"avatar_short_name","data-testid":"avatar_short_name"},w):m.createElement(o.Icon,{className:v.icon,"icon-as":n.SvgUser,"data-qaid":"avatar_user_icon","data-testid":"avatar_user_icon"})))}));h.displayName="Avatar",exports.Avatar=h,require("./style.production.v2.css");
