"use strict";
/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.isI18nAttribute = exports.I18N_ATTR_PREFIX = exports.I18N_ATTR = exports.getAttrsForDirectiveMatching = void 0;
/**
 * Extract a map of properties to values for a given element or template node, which can be used
 * by the directive matching machinery.
 *
 * @param elOrTpl the element or template in question
 * @return an object set up for directive matching. For attributes on the element/template, this
 * object maps a property name to its (static) value. For any bindings, this map simply maps the
 * property name to an empty string.
 */
function getAttrsForDirectiveMatching(elOrTpl) {
    const attributesMap = {};
    elOrTpl.attributes.forEach((a) => {
        if (!isI18nAttribute(a.name)) {
            attributesMap[a.name] = a.value;
        }
    });
    elOrTpl.inputs.forEach((i) => {
        attributesMap[i.name] = '';
    });
    elOrTpl.outputs.forEach((o) => {
        attributesMap[o.name] = '';
    });
    return attributesMap;
}
exports.getAttrsForDirectiveMatching = getAttrsForDirectiveMatching;
/** Name of the i18n attributes **/
exports.I18N_ATTR = 'i18n';
exports.I18N_ATTR_PREFIX = 'i18n-';
function isI18nAttribute(name) {
    return name === exports.I18N_ATTR || name.startsWith(exports.I18N_ATTR_PREFIX);
}
exports.isI18nAttribute = isI18nAttribute;
