(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", "@greenatom/icons", "../Pallette/Shape", "../Pallette/style-utils", "../utils/theme/getTheme", "../Pallette/themes", "./theme"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.IconBrokenMinusStyled = exports.IconBrokenTickStyled = exports.IconStyles = exports.InputStyled = exports.CheckBoxStyled = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var icons_1 = require("@greenatom/icons");
    var Shape_1 = require("../Pallette/Shape");
    var style_utils_1 = require("../Pallette/style-utils");
    var getTheme_1 = require("../utils/theme/getTheme");
    var themes_1 = require("../Pallette/themes");
    var theme_1 = require("./theme");
    var COMPONENT_NAME = "checkBox";
    var getColorText = function (theme, params) {
        if (params.isDisabled) {
            return theme.components.checkBox.colorDisabled;
        }
        else if (params.isChecked || params.isIndeterminate) {
            return theme.components.checkBox.colorChecked;
        }
        return theme.components.checkBox.colorDefault;
    };
    exports.CheckBoxStyled = styled_components_1.default.label.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            componentName: COMPONENT_NAME,
            defaultTheme: theme_1.defaultThemeCheckBox
        })
    }); })(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n  width: max-content;\n  padding: 4px 4px 4px 0;\n  display: flex;\n  align-items: center;\n  position: relative;\n  gap: 12px;\n  cursor: pointer;\n\n  ", ";\n\n  .checkbox-icon {\n    pointer-events: none;\n    ", "\n    color: ", ";\n  }\n"], ["\n  width: max-content;\n  padding: 4px 4px 4px 0;\n  display: flex;\n  align-items: center;\n  position: relative;\n  gap: 12px;\n  cursor: pointer;\n\n  ", ";\n\n  .checkbox-icon {\n    pointer-events: none;\n    ", "\n    color: ", ";\n  }\n"])), function (_a) {
        var theme = _a.theme, isDisabled = _a.isDisabled, isIndeterminate = _a.isIndeterminate, isChecked = _a.isChecked;
        return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n    ", ";\n    color: ", ";\n\n    :hover {\n      ", "\n    }\n  "], ["\n    ", ";\n    color: ", ";\n\n    :hover {\n      ", "\n    }\n  "])), isDisabled && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n      pointer-events: unset;\n      cursor: not-allowed;\n    "], ["\n      pointer-events: unset;\n      cursor: not-allowed;\n    "]))), getColorText(theme, { isDisabled: isDisabled, isIndeterminate: isIndeterminate, isChecked: isChecked }), !isIndeterminate &&
            !isChecked &&
            !isDisabled && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n        color: ", ";\n      "], ["\n        color: ", ";\n      "])), theme.components.checkBox.colorHover));
    }, function (_a) {
        var isDisabled = _a.isDisabled;
        return isDisabled && (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n        cursor: not-allowed;\n      "], ["\n        cursor: not-allowed;\n      "])));
    }, function (_a) {
        var theme = _a.theme, isDisabled = _a.isDisabled;
        return isDisabled
            ? theme.components.checkBox.iconDisabledChecked
            : theme.components.checkBox.iconChecked;
    });
    exports.InputStyled = styled_components_1.default.input.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            componentName: COMPONENT_NAME,
            defaultTheme: theme_1.defaultThemeCheckBox
        })
    }); })(templateObject_9 || (templateObject_9 = (0, tslib_1.__makeTemplateObject)(["\n  display: flex;\n  width: 24px;\n  height: 24px;\n  position: relative;\n  align-items: center;\n  background: transparent;\n  cursor: pointer;\n  appearance: none;\n  :before {\n    content: \"\";\n    width: 24px;\n    height: 24px;\n    position: absolute;\n    z-index: 1;\n    ", ";\n  }\n\n  :hover {\n    :before {\n      ", "\n    }\n  }\n\n  ", "\n\n  &:disabled {\n    cursor: not-allowed;\n    :before {\n      background: ", ";\n    }\n  }\n"], ["\n  display: flex;\n  width: 24px;\n  height: 24px;\n  position: relative;\n  align-items: center;\n  background: transparent;\n  cursor: pointer;\n  appearance: none;\n  :before {\n    content: \"\";\n    width: 24px;\n    height: 24px;\n    position: absolute;\n    z-index: 1;\n    ", ";\n  }\n\n  :hover {\n    :before {\n      ", "\n    }\n  }\n\n  ", "\n\n  &:disabled {\n    cursor: not-allowed;\n    :before {\n      background: ", ";\n    }\n  }\n"])), function (_a) {
        var theme = _a.theme;
        return (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n      background: ", ";\n      ", ";\n    "], ["\n      background: ", ";\n      ", ";\n    "])), theme.components.checkBox.backgroundDefault, style_utils_1.BorderRadius.roundBorder(Shape_1.Shape.borderRadiusDefault));
    }, function (_a) {
        var theme = _a.theme, isIndeterminate = _a.isIndeterminate, isChecked = _a.isChecked;
        return !isIndeterminate &&
            !isChecked && (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n          background: ", ";\n        "], ["\n          background: ", ";\n        "])), theme.components.checkBox.backgroundHover);
    }, function (_a) {
        var isChecked = _a.isChecked, theme = _a.theme;
        return isChecked && (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = (0, tslib_1.__makeTemplateObject)(["\n      :before {\n        background: ", ";\n      }\n    "], ["\n      :before {\n        background: ", ";\n      }\n    "])), theme.components.checkBox.backgroundChecked);
    }, function (_a) {
        var theme = _a.theme;
        return theme.components.checkBox.backgroundDisabled;
    });
    exports.IconStyles = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = (0, tslib_1.__makeTemplateObject)(["\n  position: absolute;\n  z-index: 2;\n  cursor: pointer;\n"], ["\n  position: absolute;\n  z-index: 2;\n  cursor: pointer;\n"])));
    exports.IconBrokenTickStyled = (0, styled_components_1.default)(icons_1.IconBrokenTick)(templateObject_11 || (templateObject_11 = (0, tslib_1.__makeTemplateObject)(["\n  ", ";\n"], ["\n  ", ";\n"])), exports.IconStyles);
    exports.IconBrokenMinusStyled = (0, styled_components_1.default)(icons_1.IconBrokenMinus)(templateObject_12 || (templateObject_12 = (0, tslib_1.__makeTemplateObject)(["\n  ", ";\n"], ["\n  ", ";\n"])), exports.IconStyles);
    exports.InputStyled.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.CheckBoxStyled.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;
});
