(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib", "styled-components", "../utils/theme/getTheme", "../Pallette/themes", "./themes"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.AvatarStyle = exports.AvatarWrapper = exports.OnlineStatus = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var getTheme_1 = require("../utils/theme/getTheme");
    var themes_1 = require("../Pallette/themes");
    var themes_2 = require("./themes");
    var COMPONENT_NAME = "avatar";
    exports.OnlineStatus = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            componentName: COMPONENT_NAME,
            defaultTheme: themes_2.defaultTheme
        })
    }); })(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n  ", "\n  position: absolute;\n  box-sizing: border-box;\n  border: 1px solid\n    ", ";\n  ", ";\n"], ["\n  ", "\n  position: absolute;\n  box-sizing: border-box;\n  border: 1px solid\n    ", ";\n  ", ";\n"])), function (_a) {
        var status = _a.status, theme = _a.theme;
        return status && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n      background: ", ";\n    "], ["\n      background: ", ";\n    "])), theme.components[COMPONENT_NAME]["colorStatus" + (status.charAt(0).toUpperCase() + status.slice(1))]);
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].borderColorStatus;
    }, function (_a) {
        var size = _a.size;
        switch (size) {
            case "l":
                return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n          height: 10px;\n          width: 10px;\n          right: 0;\n          top: 0;\n          border-radius: 6px;\n        "], ["\n          height: 10px;\n          width: 10px;\n          right: 0;\n          top: 0;\n          border-radius: 6px;\n        "])));
            case "m":
                return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n          height: 10px;\n          width: 10px;\n          border-radius: 6px;\n          right: -3px;\n          top: -4px;\n        "], ["\n          height: 10px;\n          width: 10px;\n          border-radius: 6px;\n          right: -3px;\n          top: -4px;\n        "])));
            case "s":
                return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n          height: 10px;\n          width: 10px;\n          right: -3px;\n          top: -3px;\n          border-radius: 6px;\n        "], ["\n          height: 10px;\n          width: 10px;\n          right: -3px;\n          top: -3px;\n          border-radius: 6px;\n        "])));
            case "xs":
                return (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n          height: 10px;\n          width: 10px;\n          right: -4px;\n          top: -4px;\n          border-radius: 6px;\n        "], ["\n          height: 10px;\n          width: 10px;\n          right: -4px;\n          top: -4px;\n          border-radius: 6px;\n        "])));
            case "xl":
            default:
                return (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n          height: 16px;\n          width: 16px;\n          right: 0;\n          border-radius: 6px;\n          border: 2px solid\n            ", ";\n        "], ["\n          height: 16px;\n          width: 16px;\n          right: 0;\n          border-radius: 6px;\n          border: 2px solid\n            ", ";\n        "])), function (_a) {
                    var theme = _a.theme;
                    return theme.components[COMPONENT_NAME].borderColorStatus;
                });
        }
    });
    exports.OnlineStatus.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.AvatarWrapper = styled_components_1.default.div(templateObject_8 || (templateObject_8 = (0, tslib_1.__makeTemplateObject)(["\n  cursor: pointer;\n  display: inline-flex;\n  box-sizing: border-box;\n  position: relative;\n"], ["\n  cursor: pointer;\n  display: inline-flex;\n  box-sizing: border-box;\n  position: relative;\n"])));
    exports.AvatarWrapper.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.AvatarStyle = styled_components_1.default.button.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            componentName: COMPONENT_NAME,
            defaultTheme: themes_2.defaultTheme
        })
    }); })(templateObject_18 || (templateObject_18 = (0, tslib_1.__makeTemplateObject)(["\n  transition: all 0.3s linear;\n  position: relative;\n  cursor: pointer;\n  background: ", ";\n  background-size: contain;\n  background-repeat: no-repeat;\n  border: none;\n  box-sizing: border-box;\n  display: flex;\n  align-items: center;\n  font-size: 14px;\n  font-weight: 600;\n  justify-content: center;\n  ", "\n\n  &:hover {\n    background: ", ";\n\n    .edit {\n      visibility: visible;\n      svg {\n        color: ", ";\n      }\n      transition: opacity 0.3s linear;\n      opacity: 1;\n    }\n\n    .avatar_icon {\n      visibility: hidden;\n      transition: all 0.3s linear;\n      opacity: 0;\n    }\n\n    .text {\n      opacity: 0;\n      transition: all 0.3s linear;\n    }\n  }\n\n  &:active {\n    border: none;\n    box-sizing: border-box;\n    transition: all 0.3s linear;\n    background: ", ";\n    background-size: contain;\n\n    .edit {\n      visibility: visible;\n      transition: color 0.3s linear;\n      svg {\n        color: ", ";\n      }\n    }\n  }\n\n  &:disabled {\n    cursor: not-allowed;\n    background: ", ";\n    box-sizing: border-box;\n    .disabled-icon {\n      visibility: visible;\n      opacity: 1;\n      svg {\n        color: ", ";\n      }\n    }\n    &:hover {\n      .edit {\n        visibility: hidden;\n      }\n    }\n  }\n\n  svg {\n    position: absolute;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    margin: auto;\n    color: ", ";\n    ", "\n  }\n\n  .text {\n    transition: all 0.3s linear;\n    opacity: 1;\n    color: ", ";\n  }\n\n  .edit {\n    visibility: hidden;\n    transition: all 0.3s linear;\n    opacity: 0;\n  }\n\n  .avatar_icon {\n    visibility: visible;\n    transition: all 0.3s linear;\n    opacity: 1;\n  }\n"], ["\n  transition: all 0.3s linear;\n  position: relative;\n  cursor: pointer;\n  background: ", ";\n  background-size: contain;\n  background-repeat: no-repeat;\n  border: none;\n  box-sizing: border-box;\n  display: flex;\n  align-items: center;\n  font-size: 14px;\n  font-weight: 600;\n  justify-content: center;\n  ", "\n\n  &:hover {\n    background: ", ";\n\n    .edit {\n      visibility: visible;\n      svg {\n        color: ", ";\n      }\n      transition: opacity 0.3s linear;\n      opacity: 1;\n    }\n\n    .avatar_icon {\n      visibility: hidden;\n      transition: all 0.3s linear;\n      opacity: 0;\n    }\n\n    .text {\n      opacity: 0;\n      transition: all 0.3s linear;\n    }\n  }\n\n  &:active {\n    border: none;\n    box-sizing: border-box;\n    transition: all 0.3s linear;\n    background: ", ";\n    background-size: contain;\n\n    .edit {\n      visibility: visible;\n      transition: color 0.3s linear;\n      svg {\n        color: ", ";\n      }\n    }\n  }\n\n  &:disabled {\n    cursor: not-allowed;\n    background: ", ";\n    box-sizing: border-box;\n    .disabled-icon {\n      visibility: visible;\n      opacity: 1;\n      svg {\n        color: ", ";\n      }\n    }\n    &:hover {\n      .edit {\n        visibility: hidden;\n      }\n    }\n  }\n\n  svg {\n    position: absolute;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    margin: auto;\n    color: ", ";\n    ", "\n  }\n\n  .text {\n    transition: all 0.3s linear;\n    opacity: 1;\n    color: ", ";\n  }\n\n  .edit {\n    visibility: hidden;\n    transition: all 0.3s linear;\n    opacity: 0;\n  }\n\n  .avatar_icon {\n    visibility: visible;\n    transition: all 0.3s linear;\n    opacity: 1;\n  }\n"])), function (_a) {
        var image = _a.image, disabled = _a.disabled;
        return image && !disabled
            ? "url(" + image + ") center"
            : function (_a) {
                var theme = _a.theme;
                return theme.components[COMPONENT_NAME].background;
            };
    }, function (_a) {
        var size = _a.size;
        switch (size) {
            case "l":
                return (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = (0, tslib_1.__makeTemplateObject)(["\n          height: 48px;\n          width: 48px;\n          border-radius: 16px;\n          .text {\n            font-size: 13px;\n          }\n        "], ["\n          height: 48px;\n          width: 48px;\n          border-radius: 16px;\n          .text {\n            font-size: 13px;\n          }\n        "])));
            case "m":
                return (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = (0, tslib_1.__makeTemplateObject)(["\n          height: 32px;\n          width: 32px;\n          border-radius: 8px;\n        "], ["\n          height: 32px;\n          width: 32px;\n          border-radius: 8px;\n        "])));
            case "s":
                return (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = (0, tslib_1.__makeTemplateObject)(["\n          height: 24px;\n          width: 24px;\n          border-radius: 8px;\n          .text {\n            font-size: 7px;\n            font-weight: 600;\n          }\n        "], ["\n          height: 24px;\n          width: 24px;\n          border-radius: 8px;\n          .text {\n            font-size: 7px;\n            font-weight: 600;\n          }\n        "])));
            case "xs":
                return (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = (0, tslib_1.__makeTemplateObject)(["\n          height: 16px;\n          width: 16px;\n          border-radius: 12px;\n          .text {\n            font-size: 7px;\n            font-weight: 600;\n          }\n        "], ["\n          height: 16px;\n          width: 16px;\n          border-radius: 12px;\n          .text {\n            font-size: 7px;\n            font-weight: 600;\n          }\n        "])));
            case "xl":
            default:
                return (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = (0, tslib_1.__makeTemplateObject)(["\n          height: 64px;\n          width: 64px;\n          border-radius: 24px;\n          font-size: 20px;\n        "], ["\n          height: 64px;\n          width: 64px;\n          border-radius: 24px;\n          font-size: 20px;\n        "])));
        }
    }, function (_a) {
        var image = _a.image, theme = _a.theme, disabled = _a.disabled;
        if (!disabled) {
            return image
                ? theme.components[COMPONENT_NAME].backgroundImageHover
                : theme.components[COMPONENT_NAME].backgroundHover;
        }
    }, function (_a) {
        var image = _a.image, theme = _a.theme;
        return image
            ? theme.components[COMPONENT_NAME].iconColorImage
            : theme.components[COMPONENT_NAME].iconColorHover;
    }, function (_a) {
        var image = _a.image, theme = _a.theme, disabled = _a.disabled;
        if (!disabled) {
            return image
                ? theme.components[COMPONENT_NAME].backgroundImagePressed
                : theme.components[COMPONENT_NAME].backgroundPressed;
        }
    }, function (_a) {
        var image = _a.image, theme = _a.theme;
        return image
            ? theme.components[COMPONENT_NAME].iconColorImage
            : theme.components[COMPONENT_NAME].iconColorPressed;
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].backgroundDisabled;
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].iconColorDisabled;
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].iconColor;
    }, function (_a) {
        var size = _a.size;
        switch (size) {
            case "l":
                return (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = (0, tslib_1.__makeTemplateObject)(["\n            width: 15px;\n            height: 15px;\n          "], ["\n            width: 15px;\n            height: 15px;\n          "])));
            case "m":
                return (0, styled_components_1.css)(templateObject_15 || (templateObject_15 = (0, tslib_1.__makeTemplateObject)(["\n            width: 10px;\n            height: 10px;\n          "], ["\n            width: 10px;\n            height: 10px;\n          "])));
            case "s":
                return (0, styled_components_1.css)(templateObject_16 || (templateObject_16 = (0, tslib_1.__makeTemplateObject)(["\n            width: 7.5px;\n            height: 7.5px;\n          "], ["\n            width: 7.5px;\n            height: 7.5px;\n          "])));
            case "xl":
            default:
                return (0, styled_components_1.css)(templateObject_17 || (templateObject_17 = (0, tslib_1.__makeTemplateObject)(["\n            width: 24px;\n            height: 24px;\n          "], ["\n            width: 24px;\n            height: 24px;\n          "])));
        }
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].color;
    });
    exports.AvatarStyle.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18;
});
