(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", "../Pallette/style-utils", "../Pallette/themes", "../utils/theme/getTheme", "./themes"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.Label = exports.Filler = exports.ProgressBarStyle = exports.PreloaderBase = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var style_utils_1 = require("../Pallette/style-utils");
    var themes_1 = require("../Pallette/themes");
    var getTheme_1 = require("../utils/theme/getTheme");
    var themes_2 = require("./themes");
    var spinner = (0, styled_components_1.keyframes)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n"], ["\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n"])));
    var COMPONENT_NAME = "preloader";
    exports.PreloaderBase = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: themes_2.defaultThemePreloader,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  color: ", ";\n  ", ";\n  ", ";\n  ", ";\n\n  svg {\n    width: ", ";\n    height: ", ";\n    display: flex;\n    color: ", ";\n    animation: ", " 1s linear infinite;\n  }\n\n  .progressbar {\n    margin-top: ", ";\n    justify-content: center;\n    align-items: center;\n  }\n"], ["\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  color: ", ";\n  ", ";\n  ", ";\n  ", ";\n\n  svg {\n    width: ", ";\n    height: ", ";\n    display: flex;\n    color: ", ";\n    animation: ", " 1s linear infinite;\n  }\n\n  .progressbar {\n    margin-top: ", ";\n    justify-content: center;\n    align-items: center;\n  }\n"])), function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].color;
    }, style_utils_1.Margin.allSide(6, 0), function (_a) {
        var width = _a.width;
        return width && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n      width: ", ";\n    "], ["\n      width: ", ";\n    "])), width);
    }, function (_a) {
        var height = _a.height;
        return height && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n      height: ", ";\n    "], ["\n      height: ", ";\n    "])), height);
    }, function (_a) {
        var isShowLabel = _a.isShowLabel;
        return (isShowLabel ? "15px" : "20px");
    }, function (_a) {
        var isShowLabel = _a.isShowLabel;
        return (isShowLabel ? "19px" : "20px");
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].background;
    }, spinner, function (_a) {
        var isShowLabel = _a.isShowLabel;
        return (isShowLabel ? "0.4px" : "6px");
    });
    exports.PreloaderBase.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.ProgressBarStyle = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: themes_2.defaultThemePreloader,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n  width: 40px;\n  height: 2px;\n  display: flex;\n  flex-direction: row;\n  ", ";\n  background: ", ";\n"], ["\n  width: 40px;\n  height: 2px;\n  display: flex;\n  flex-direction: row;\n  ", ";\n  background: ", ";\n"])), style_utils_1.Padding.allSide(0), function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].backgroundProgress;
    });
    exports.ProgressBarStyle.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.Filler = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: themes_2.defaultThemePreloader,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n  width: ", "%;\n  transition: all 0.2s linear;\n  height: 100%;\n  border-radius: 2px;\n  background: ", ";\n"], ["\n  width: ", "%;\n  transition: all 0.2s linear;\n  height: 100%;\n  border-radius: 2px;\n  background: ", ";\n"])), function (_a) {
        var progress = _a.progress;
        return progress;
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].background;
    });
    exports.Filler.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.Label = styled_components_1.default.label.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: themes_2.defaultThemePreloader,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n  font-weight: 400;\n  line-height: 16px;\n  font-size: 12px;\n  height: 16px;\n  ", ";\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  ", ";\n  color: ", ";\n"], ["\n  font-weight: 400;\n  line-height: 16px;\n  font-size: 12px;\n  height: 16px;\n  ", ";\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  ", ";\n  color: ", ";\n"])), style_utils_1.Margin.allSide(1, 0.5), style_utils_1.Padding.allSide(1), function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].color;
    });
    exports.Label.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
});
