"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var vanities_1 = require("./../properties/dom/vanities");
function applyPropertyToElement(element, name, value, context, component) {
    var type;
    if (element.__instance) {
        type = 'div';
        var addressables = element.__instance.getAddressableProperties();
        if (addressables[name] !== undefined) {
            element.__instance.state[name] = value;
        }
        if (vanities_1.default[type] && vanities_1.default[type][name]) {
            vanities_1.default[type][name](name, element, value, context, component);
        }
    }
    else {
        type = element.elementName;
        if (vanities_1.default[type] && vanities_1.default[type][name]) {
            vanities_1.default[type][name](name, element, value, context, component);
        }
        else {
            element.attributes[name] = value;
        }
    }
}
exports.default = applyPropertyToElement;
//# sourceMappingURL=applyPropertyToElement.js.map