"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useCssVariableStyles = void 0;
var react_1 = require("react");
var ramda_1 = require("ramda");
var useCssVariableStyles = function (variables, additionalStyles) {
    if (additionalStyles === void 0) { additionalStyles = {}; }
    var style = (0, react_1.useMemo)(function () {
        return Object.fromEntries(Object.entries(variables).map(function (_a) {
            var key = _a[0], value = _a[1];
            var verifiedValue = (0, ramda_1.isNil)(value) || value === '' ? 'initial' : value;
            return [key, verifiedValue];
        }));
    }, [variables]);
    return (0, react_1.useMemo)(function () { return (__assign(__assign({}, style), additionalStyles)); }, [style, additionalStyles]);
};
exports.useCssVariableStyles = useCssVariableStyles;
