"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("react/jsx-runtime"),r=require("classnames"),i=require("@material-ui/core/Avatar"),a=require("../Tooltip/Tooltip.js");require("../Tooltip/ScrollableTooltip.js");var o=require("../../utils/main.js"),n=require("@material-ui/core");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(e),l=u(r),s=u(i);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){c.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){switch(e){case 24:return 12;case 32:return 14;case 40:return 16;case 48:return 20;case 128:return 64;case 200:return 80;default:return Math.floor(e/2)}},b=function(e){return{minWidth:e,width:e,height:e,lineHeight:"".concat(e,"px"),fontSize:p(e)}},h=["#5F47A4","#9078C8","#DC74FD","#F695B5","#CB4F4F","#896F65","#F3AE96","#EE7850","#DDAE67","#A6CA72","#62893D","#91C9C4","#38818D","#77B5F1","#3F4C99","#919DA4"],v=function(e){return h[Math.abs(o.default.hashCode(e)%h.length)]},m=n.makeStyles((function(e){return{avatar:{color:e.palette.common.white,fontWeight:"bold"}}})),j=function(e){var r=e.className,i=e.imgSrc,n=e.alt,u=e.displayName,c=void 0===u?"":u,d=e.showTooltip,p=void 0!==d&&d,h=e.size,j=void 0===h?32:h,O=e["data-testid"],y=void 0===O?"generic_avatar":O,g=m();return t.jsx(a.Tooltip,{title:c,disableFocusListener:!p,disableHoverListener:!p,disableTouchListener:!p,children:t.jsx(s.default,{"data-testid":y,alt:n,src:i,className:l.default(g.avatar,r),style:f(f({},b(Number(j))),{},{backgroundColor:c?v(c):void 0}),children:c?o.default.getNameInitials(c):null})})};exports.AvatarComponent=j,exports.default=j;
//# sourceMappingURL=index.js.map
