"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const namespaceURI_1 = require("../../../../../client/component/namespaceURI");
const element_1 = require("../../../../../client/element");
const style_1 = require("../../../../../client/style");
class SVGTextPath extends element_1.Element {
    constructor($props, $system) {
        super($props, $system);
        const { style = {}, className, href, startOffset, lenghtAdjust, spacing, textContent, rotate, } = this.$props;
        const text_path_el = this.$system.api.document.createElementNS(namespaceURI_1.namespaceURI, 'textPath');
        (0, style_1.applyStyle)(text_path_el, style);
        if (className) {
            text_path_el.classList.add(className);
        }
        if (href !== undefined) {
            text_path_el.setAttribute('href', href);
        }
        if (startOffset !== undefined) {
            text_path_el.setAttribute('startOffset', startOffset);
        }
        if (lenghtAdjust !== undefined) {
            text_path_el.setAttribute('lenghtAdjust', lenghtAdjust);
        }
        if (spacing !== undefined) {
            text_path_el.setAttribute('spacing', spacing);
        }
        if (textContent !== undefined) {
            text_path_el.textContent = textContent;
        }
        if (rotate !== undefined) {
            text_path_el.setAttribute('rotate', rotate);
        }
        this._text_path_el = text_path_el;
        this.$element = text_path_el;
    }
    // TODO
    onPropChanged(prop, current) {
        if (prop === 'textContent') {
            this._text_path_el.textContent = current;
        }
    }
}
exports.default = SVGTextPath;
//# sourceMappingURL=Component.js.map