"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const namespaceURI_1 = require("../../../../../client/component/namespaceURI");
const svg_1 = require("../../../../../client/svg");
class SVGUse extends svg_1.SVGElement_ {
    constructor($props, $system) {
        super($props, $system, $system.api.document.createElementNS(namespaceURI_1.namespaceURI, 'use'), $system.style['use'], {}, {
            href: (href) => {
                if (href) {
                    this.$element.setAttributeNS(namespaceURI_1.namespaceURI, 'xlink:href', href);
                    this.$element.setAttribute('href', href);
                }
                else {
                    this.$element.removeAttributeNS(namespaceURI_1.namespaceURI, 'xlink:href');
                    this.$element.removeAttribute('href');
                }
            },
        });
        const { className, href } = this.$props;
        if (className !== undefined) {
            this.$element.classList.value = className;
        }
        if (href !== undefined) {
            this.$element.setAttributeNS(namespaceURI_1.namespaceURI, 'xlink:href', href);
            this.$element.setAttribute('href', href);
        }
    }
}
exports.default = SVGUse;
//# sourceMappingURL=Component.js.map