import { NgModule, Component, ElementRef, Input } from "@angular/core";
import { getAttributes } from "@carbon/icon-helpers";
var BackToTop16 = /** @class */ (function () {
    function BackToTop16(elementRef) {
        this.elementRef = elementRef;
    }
    BackToTop16.prototype.ngAfterViewInit = function () {
        var svg = this.elementRef.nativeElement.querySelector("svg");
        var attributes = getAttributes({
            width: 16,
            height: 16,
            viewBox: "0 0 16 16",
            title: this.title,
            "aria-label": this.ariaLabel,
            "aria-labelledby": this.ariaLabelledby,
            "aria-hidden": this.ariaHidden,
            focusable: this.focusable
        });
        var attrKeys = Object.keys(attributes);
        for (var i = 0; i < attrKeys.length; i++) {
            var key = attrKeys[i];
            var value = attributes[key];
            if (key === "title") {
                continue;
            }
            if (value) {
                svg.setAttribute(key, value);
            }
        }
        if (attributes.title) {
            var title = document.createElement("title");
            title.textContent = attributes.title;
            BackToTop16.titleIdCounter++;
            title.setAttribute("id", "back-to-top16-" + BackToTop16.titleIdCounter);
            svg.appendChild(title);
            svg.setAttribute("aria-labelledby", "back-to-top16-" + BackToTop16.titleIdCounter);
        }
    };
    BackToTop16.titleIdCounter = 0;
    BackToTop16.decorators = [
        { type: Component, args: [{
                    selector: "ibm-icon-back-to-top16",
                    template: "<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform;\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M8 7l-5 5 .7.7L8 8.4l4.3 4.3.7-.7zM2 4h12v1H2z\"></path></svg>"
                },] },
    ];
    /** @nocollapse */
    BackToTop16.ctorParameters = function () { return [
        { type: ElementRef }
    ]; };
    BackToTop16.propDecorators = {
        ariaLabel: [{ type: Input }],
        ariaLabelledby: [{ type: Input }],
        ariaHidden: [{ type: Input }],
        title: [{ type: Input }],
        focusable: [{ type: Input }]
    };
    return BackToTop16;
}());
export { BackToTop16 };
var BackToTop16Module = /** @class */ (function () {
    function BackToTop16Module() {
    }
    BackToTop16Module.decorators = [
        { type: NgModule, args: [{
                    declarations: [
                        BackToTop16
                    ],
                    exports: [
                        BackToTop16
                    ]
                },] },
    ];
    return BackToTop16Module;
}());
export { BackToTop16Module };
//# sourceMappingURL=16.js.map