(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/themes", "../utils/theme/getTheme", "./theme"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.Title = exports.IconWrapper = exports.TreeItem = exports.TreeList = exports.TreeHeader = exports.TreeWrapper = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var themes_1 = require("../Pallette/themes");
    var getTheme_1 = require("../utils/theme/getTheme");
    var theme_1 = require("./theme");
    var COMPONENT_NAME = "tree";
    exports.TreeWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n  ", "\n"], ["\n  ", "\n"])), function (_a) {
        var isDragOver = _a.isDragOver, isDragging = _a.isDragging, isAnyDragging = _a.isAnyDragging, theme = _a.theme;
        if (isAnyDragging || isDragOver) {
            return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n        ", "\n        ", "\n      "], ["\n        ", "\n        ", "\n      "])), isAnyDragging && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n          * {\n            user-select: none;\n            cursor: grabbing;\n          }\n        "], ["\n          * {\n            user-select: none;\n            cursor: grabbing;\n          }\n        "]))), isDragOver && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n          background-color: ", ";\n          border-radius: 8px;\n        "], ["\n          background-color: ", ";\n          border-radius: 8px;\n        "])), theme.components[COMPONENT_NAME].backgroundEdit));
        }
        if (isDragging) {
            return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n        cursor: grabbing;\n        .tree-header__title {\n          background-color: transparent;\n        }\n        .tree_header {\n          width: 50%;\n          background-color: ", ";\n          ", "\n          ", "\n          ", "\n          ", "\n          position: fixed;\n          z-index: 20;\n          pointer-events: none;\n        }\n      "], ["\n        cursor: grabbing;\n        .tree-header__title {\n          background-color: transparent;\n        }\n        .tree_header {\n          width: 50%;\n          background-color: ", ";\n          ", "\n          ", "\n          ", "\n          ", "\n          position: fixed;\n          z-index: 20;\n          pointer-events: none;\n        }\n      "])), theme.components[COMPONENT_NAME]
                .backgroundDragging, theme.shadows.tp.top, theme.shadows.tp.bottom, theme.shadows.tp.left, theme.shadows.tp.right);
        }
        return "";
    });
    exports.TreeHeader = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: theme_1.defaultThemeTree,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_10 || (templateObject_10 = (0, tslib_1.__makeTemplateObject)(["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  justify-content: start;\n  border-radius: 8px;\n  padding: 0px 8px 0px 8px;\n  ", ";\n  gap: 8px;\n  width: 100%;\n  ", "\n\n  & > div {\n    display: flex;\n    flex-direction: row;\n    align-items: center;\n    justify-content: center;\n  }\n\n  .tree-header__right-content {\n    margin-left: auto;\n    display: flex;\n    flex-direction: row;\n    gap: 8px;\n    color: ", ";\n    svg {\n      color: ", ";\n    }\n  }\n\n  [data-element=\"radioButton\"] {\n    align-items: normal;\n  }\n"], ["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  justify-content: start;\n  border-radius: 8px;\n  padding: 0px 8px 0px 8px;\n  ", ";\n  gap: 8px;\n  width: 100%;\n  ", "\n\n  & > div {\n    display: flex;\n    flex-direction: row;\n    align-items: center;\n    justify-content: center;\n  }\n\n  .tree-header__right-content {\n    margin-left: auto;\n    display: flex;\n    flex-direction: row;\n    gap: 8px;\n    color: ", ";\n    svg {\n      color: ", ";\n    }\n  }\n\n  [data-element=\"radioButton\"] {\n    align-items: normal;\n  }\n"])), function (_a) {
        var isDragAllowed = _a.isDragAllowed, isAnyDragging = _a.isAnyDragging;
        return !isAnyDragging && (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n      cursor: ", ";\n      .arrow-icon {\n        cursor: pointer;\n      }\n    "], ["\n      cursor: ", ";\n      .arrow-icon {\n        cursor: pointer;\n      }\n    "])), isDragAllowed ? "grab" : "pointer");
    }, function (_a) {
        var theme = _a.theme, isDisabled = _a.isDisabled, isActive = _a.isActive;
        if (isDisabled) {
            return (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n        cursor: not-allowed;\n        color: ", ";\n      "], ["\n        cursor: not-allowed;\n        color: ", ";\n      "])), theme.components[COMPONENT_NAME].colorDisabled);
        }
        else if (isActive) {
            return (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = (0, tslib_1.__makeTemplateObject)(["\n        color: ", ";\n      "], ["\n        color: ", ";\n      "])), theme.components[COMPONENT_NAME].colorActive);
        }
        return (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = (0, tslib_1.__makeTemplateObject)(["\n      color: ", ";\n      &:hover {\n        color: ", ";\n      }\n    "], ["\n      color: ", ";\n      &:hover {\n        color: ", ";\n      }\n    "])), theme.components[COMPONENT_NAME].colorDefault, theme.components[COMPONENT_NAME].colorHover);
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].colorActive;
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].colorIcon;
    });
    exports.TreeList = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: theme_1.defaultThemeTree,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_11 || (templateObject_11 = (0, tslib_1.__makeTemplateObject)(["\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  border-left: 1px solid ", ";\n  margin-left: 7px;\n  padding-left: 15px;\n"], ["\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  border-left: 1px solid ", ";\n  margin-left: 7px;\n  padding-left: 15px;\n"])), function (_a) {
        var theme = _a.theme;
        return theme.dividersColors.secondary;
    });
    exports.TreeItem = styled_components_1.default.div(templateObject_12 || (templateObject_12 = (0, tslib_1.__makeTemplateObject)(["\n  padding: 8px 0;\n  margin-left: 2px;\n  ", " {\n    padding: 0 8px 0 0;\n  }\n"], ["\n  padding: 8px 0;\n  margin-left: 2px;\n  ", " {\n    padding: 0 8px 0 0;\n  }\n"])), exports.TreeHeader);
    exports.IconWrapper = styled_components_1.default.div(templateObject_14 || (templateObject_14 = (0, tslib_1.__makeTemplateObject)(["\n  display: flex;\n\n  .arrow-icon {\n    transition: all 0.3s;\n    ", "\n  }\n"], ["\n  display: flex;\n\n  .arrow-icon {\n    transition: all 0.3s;\n    ", "\n  }\n"])), function (_a) {
        var isShown = _a.isShown;
        return isShown && (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = (0, tslib_1.__makeTemplateObject)(["\n        transform: rotate(90deg);\n      "], ["\n        transform: rotate(90deg);\n      "])));
    });
    exports.Title = styled_components_1.default.input(templateObject_16 || (templateObject_16 = (0, tslib_1.__makeTemplateObject)(["\n  margin: 3px 0;\n  padding: 4px;\n  box-sizing: border-box;\n  width: 100%;\n  background: transparent;\n  border: none;\n  :disabled {\n    cursor: not-allowed;\n  }\n  :focus {\n    outline: none;\n    ", "\n  }\n  z-index: 5;\n"], ["\n  margin: 3px 0;\n  padding: 4px;\n  box-sizing: border-box;\n  width: 100%;\n  background: transparent;\n  border: none;\n  :disabled {\n    cursor: not-allowed;\n  }\n  :focus {\n    outline: none;\n    ", "\n  }\n  z-index: 5;\n"])), function (_a) {
        var readOnly = _a.readOnly;
        return !readOnly && (0, styled_components_1.css)(templateObject_15 || (templateObject_15 = (0, tslib_1.__makeTemplateObject)(["\n        border-radius: 8px;\n        background-color: ", ";\n      "], ["\n        border-radius: 8px;\n        background-color: ", ";\n      "])), function (_a) {
            var theme = _a.theme;
            return theme.components[COMPONENT_NAME].backgroundEdit;
        });
    });
    exports.Title.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.TreeList.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.TreeHeader.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.TreeWrapper.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;
});
