import { h, Host } from "@stencil/core";
export class ModalHeader {
    constructor() {
        this.closeHandler = () => {
            if (this.parentModal) {
                this.parentModal.dismiss(undefined, 'model-close');
            }
        };
    }
    get parentModal() {
        return this.el.closest('bal-modal');
    }
    render() {
        var _a;
        return (h(Host, { key: 'fa05e7fa9f1a04125400d4e8dc620ef41b8ee8e0', class: "bal-modal__header" }, h("div", { key: 'eff6b456ba712662d46cc8034e4e0781e9b56910', class: "bal-modal__header__title" }, h("bal-heading", { key: '68d8992f401e949c0323054389e4f8c4a2a731de', level: "h2", space: "none" }, h("slot", { key: '7abb147d4ee07d0f9e62daca6d77018bb17d7261' }))), ((_a = this.parentModal) === null || _a === void 0 ? void 0 : _a.isClosable) ? (h("bal-close", { class: "bal-modal__header__close data-test-modal-close", onClick: this.closeHandler })) : ('')));
    }
    static get is() { return "bal-modal-header"; }
    static get elementRef() { return "el"; }
}
