"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react/jsx-runtime"),n=require("react"),o=require("classnames"),a=require("./constants.js"),i=require("./Avatar.scss.js"),c=require("../../utils/main.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(e),l=s(t),f=s(o),p=["testId","className","name","size","imageSrc"];function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(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){u.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 j=n.forwardRef((function(e,t){var o=e.testId,s=e.className,u=e.name,d=e.size,j=void 0===d?40:d,m=e.imageSrc,O=l.default(e,p),g=n.useMemo((function(){return{width:"".concat(j,"px"),height:"".concat(j,"px"),fontSize:"".concat(a.getFontSize(j),"px"),lineHeight:"".concat(j,"px"),backgroundColor:a.getColor(u),backgroundImage:m?"url(".concat(m,")"):void 0,color:m?"transparent":void 0}}),[j,m,u]);return r.jsx("div",b(b({},O),{},{ref:t,className:f.default(i.root,s),"data-testid":o,style:g,children:u&&c.default.getNameInitials(u)}))}));exports.Avatar=j;
//# sourceMappingURL=Avatar.js.map
