import Renderables from '../Renderables';
import { Timestamp } from '../timestamp';
import node from "../../support/node";
import { Specification } from "../../support/Specification";
/**
 * Implementation of the 'block' markup element. A div HTML element
 * is created and the and the classes lto-block is added to
 * allow CSS modifications.
 *
 * @see {@link IRenderable}
 * @see {@link IStackeable}
 */
var Block = /** @class */ (function () {
    function Block(message) {
        this.spec = message;
    }
    /**
     * @inheritDoc
     */
    Block.prototype.render = function (renderer, isNested) {
        var _this = this;
        var block = node("div");
        new Specification(this.spec).initNode(block, "lto-block");
        block.setAriaLabel(this.spec.ariaLabel);
        block.unwrap().appendChild(Timestamp.render());
        var elements = (this.spec.elements || []).map(function (e) { return renderer.render(e, _this); });
        elements.forEach(function (e) { return e.forEach(function (x) { return block.unwrap().appendChild(x); }); });
        isNested && block.addClasses('lto-nested');
        return block.unwrap();
    };
    return Block;
}());
export { Block };
Renderables.register("block", Block);
//# sourceMappingURL=index.js.map