import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import{jsx as r}from"react/jsx-runtime";import{forwardRef as o,useMemo as n}from"react";import c from"classnames";import{getFontSize as i,getColor as a}from"./constants.js";import s from"./Avatar.scss.js";import m from"../../utils/main.js";var p=["testId","className","name","size","imageSrc"];function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function l(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?f(Object(o),!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var u=o((function(t,o){var f=t.testId,u=t.className,b=t.name,O=t.size,j=void 0===O?40:O,d=t.imageSrc,g=e(t,p),y=n((function(){return{width:"".concat(j,"px"),height:"".concat(j,"px"),fontSize:"".concat(i(j),"px"),lineHeight:"".concat(j,"px"),backgroundColor:a(b),backgroundImage:d?"url(".concat(d,")"):void 0,color:d?"transparent":void 0}}),[j,d,b]);return r("div",l(l({},g),{},{ref:o,className:c(s.root,u),"data-testid":f,style:y,children:b&&m.getNameInitials(b)}))}));export{u as Avatar};
//# sourceMappingURL=Avatar.js.map
