"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var node_1 = require("../../support/node");
var Renderables_1 = require("../Renderables");
/**
 * Implementation of the 'overlays' markup element.
 * A HTML div element containing 'overlay' elements.
 * For CSS manipulations the following classes are added:
 *  lto-overlays: the container
 *
 * @see {@link IRenderable}
 * @see {@link IStackeable}
 */
var Overlays = /** @class */ (function () {
    function Overlays(spec) {
        this.spec = spec;
    }
    /**
     * @inheritDoc
     */
    Overlays.prototype.render = function (renderer, isNested) {
        var _this = this;
        var overlays = node_1.default("div");
        overlays.setId(this.spec.id);
        overlays.addClasses("lto-overlays");
        this.spec.class !== undefined ? overlays.addClasses(this.spec.class) : function () { };
        var elements = (this.spec.elements || []).map(function (e) { return renderer.render(e, _this); });
        elements.forEach(function (e) { return e.forEach(function (x) { return overlays.appendChild(node_1.default(x)); }); });
        return overlays.unwrap();
    };
    return Overlays;
}());
exports.Overlays = Overlays;
Renderables_1.default.register("overlays", Overlays);
//# sourceMappingURL=Overlays.js.map