var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { DOMPart } from '../dom/dom.js';
import { part, component } from '../../decorators.js';
import { transformLegacyText } from './legacy.js';
import { TextComponent } from './text-component.js';
let TextPart = class TextPart extends DOMPart {
    constructor() {
        super();
        this.core = this._components.get('core');
        this.core.invalidate();
    }
    static transformLegacy(app) {
        transformLegacyText(app);
    }
    getElement() {
        const el = document.createElement('div');
        el.title = 'text';
        return el;
    }
    render() {
        super.render();
        if (!this.core.invalidated) {
            return;
        }
        this._el.textContent = this.core.value;
        this._el.style.color = this.core.color;
        this.core.apply();
    }
    get value() {
        return this.core.value;
    }
    set value(v) {
        this.core.value = v;
        this.core.invalidate();
    }
    get color() {
        return this.core.color;
    }
    set color(c) {
        this.core.color = c;
        this.core.invalidate();
    }
};
__decorate([
    component(TextComponent)
], TextPart.prototype, "core", void 0);
TextPart = __decorate([
    part('text')
], TextPart);
export { TextPart };
//# sourceMappingURL=text.js.map