"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = require("path");
const tempseal_1 = require("@sealcode/tempseal");
const article_list_item_1 = require("../../items/article-list-item/article-list-item");
const button_1 = require("../../elements/button/button");
const wave_1 = require("../../ornaments/wave/wave");
let OrderedBlocks;
OrderedBlocks = (add_effect, config, { list_items, btn_config, btn2_config, header_mode, starting_index = 0, bg = true, }) => __awaiter(void 0, void 0, void 0, function* () {
    const html = /* HTML */ `
		<section class="ordered-blocks">
			${bg
        ? /* HTML */ `
						<div class="ordered-blocks__bg">
							${yield tempseal_1.embedComponent(add_effect, config, { rotated: true, wave_color: "#f6f6f6" }, wave_1.default)}
						</div>
				  `
        : ""}
			<div class="ordered-blocks__body">
				<ol class="ordered-blocks__article-list">
					${(yield Promise.all(list_items.map((item, index) => tempseal_1.embedComponent(add_effect, config, Object.assign(Object.assign({ number: index + starting_index }, item), { header_mode }), article_list_item_1.default)))).join("")}
				</ol>
				<div class="ordered-blocks__buttons">
					${btn_config
        ? `<div class="ordered-blocks__button-wrapper">
					  ${yield tempseal_1.embedComponent(add_effect, config, btn_config, button_1.default)}
				</div>`
        : ""}
					${btn2_config
        ? `<div class="ordered-blocks__button-wrapper">
					  ${yield tempseal_1.embedComponent(add_effect, config, btn2_config, button_1.default)}
					</div>`
        : ""}
				</div>
			</div>
		</section>
	`;
    yield Promise.all([
        tempseal_1.SideEffects.Scss.addFromPath(add_effect, config, path_1.resolve(__dirname, "ordered-blocks.scss")),
        add_effect(new tempseal_1.SideEffects.HtmlChunk(html)),
    ]);
});
OrderedBlocks.identifier = "ordered-blocks";
exports.default = OrderedBlocks;
//# sourceMappingURL=ordered-blocks.js.map