import { Component, ElementRef, Inject, Input } from '@angular/core';
import { addClass, toBoolean } from '@wm/core';
import { DialogRef } from '@wm/components/base';
import { BaseDialog } from '../base-dialog';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@wm/components/base";
import * as i3 from "../base-dialog";
const _c0 = ["wmDialogHeader", ""];
const _c1 = (a0, a1, a2) => ({ width: a0, height: a1, margin: a2 });
function DialogHeaderComponent_button_0_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 5);
    i0.ɵɵlistener("click", function DialogHeaderComponent_button_0_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.closeDialog()); });
    i0.ɵɵelementStart(1, "span", 6);
    i0.ɵɵtext(2, "\u00D7");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵattribute("aria-label", "Close " + (ctx_r1.title ? ctx_r1.title : "") + " dialog");
} }
function DialogHeaderComponent_ng_container_2_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function DialogHeaderComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "h1", 7);
    i0.ɵɵtemplate(2, DialogHeaderComponent_ng_container_2_ng_container_2_Template, 1, 0, "ng-container", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const headerTemplate_r3 = i0.ɵɵreference(10);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngTemplateOutlet", headerTemplate_r3);
} }
function DialogHeaderComponent_ng_container_3_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function DialogHeaderComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "h2", 7);
    i0.ɵɵtemplate(2, DialogHeaderComponent_ng_container_3_ng_container_2_Template, 1, 0, "ng-container", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const headerTemplate_r3 = i0.ɵɵreference(10);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngTemplateOutlet", headerTemplate_r3);
} }
function DialogHeaderComponent_ng_container_4_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function DialogHeaderComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "h3", 7);
    i0.ɵɵtemplate(2, DialogHeaderComponent_ng_container_4_ng_container_2_Template, 1, 0, "ng-container", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const headerTemplate_r3 = i0.ɵɵreference(10);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngTemplateOutlet", headerTemplate_r3);
} }
function DialogHeaderComponent_ng_container_5_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function DialogHeaderComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "h4", 7);
    i0.ɵɵtemplate(2, DialogHeaderComponent_ng_container_5_ng_container_2_Template, 1, 0, "ng-container", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const headerTemplate_r3 = i0.ɵɵreference(10);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngTemplateOutlet", headerTemplate_r3);
} }
function DialogHeaderComponent_ng_container_6_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function DialogHeaderComponent_ng_container_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "h5", 7);
    i0.ɵɵtemplate(2, DialogHeaderComponent_ng_container_6_ng_container_2_Template, 1, 0, "ng-container", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const headerTemplate_r3 = i0.ɵɵreference(10);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngTemplateOutlet", headerTemplate_r3);
} }
function DialogHeaderComponent_ng_container_7_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function DialogHeaderComponent_ng_container_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "h6", 7);
    i0.ɵɵtemplate(2, DialogHeaderComponent_ng_container_7_ng_container_2_Template, 1, 0, "ng-container", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const headerTemplate_r3 = i0.ɵɵreference(10);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngTemplateOutlet", headerTemplate_r3);
} }
function DialogHeaderComponent_ng_container_8_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function DialogHeaderComponent_ng_container_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "h4", 7);
    i0.ɵɵtemplate(2, DialogHeaderComponent_ng_container_8_ng_container_2_Template, 1, 0, "ng-container", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const headerTemplate_r3 = i0.ɵɵreference(10);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngTemplateOutlet", headerTemplate_r3);
} }
function DialogHeaderComponent_ng_template_9_i_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 13);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("ngClass", ctx_r1.iconclass)("ngStyle", i0.ɵɵpureFunction3(2, _c1, ctx_r1.iconwidth, ctx_r1.iconheight, ctx_r1.iconmargin));
} }
function DialogHeaderComponent_ng_template_9_img_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "img", 14);
    i0.ɵɵpipe(1, "image");
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("src", i0.ɵɵpipeBind1(1, 2, ctx_r1.iconurl), i0.ɵɵsanitizeUrl)("ngStyle", i0.ɵɵpureFunction3(4, _c1, ctx_r1.iconwidth, ctx_r1.iconheight, ctx_r1.iconmargin));
} }
function DialogHeaderComponent_ng_template_9_span_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "span", 15);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("title", ctx_r1.subheading)("textContent", ctx_r1.subheading);
} }
function DialogHeaderComponent_ng_template_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, DialogHeaderComponent_ng_template_9_i_0_Template, 1, 6, "i", 9)(1, DialogHeaderComponent_ng_template_9_img_1_Template, 2, 8, "img", 10);
    i0.ɵɵelement(2, "span", 11);
    i0.ɵɵtemplate(3, DialogHeaderComponent_ng_template_9_span_3_Template, 1, 2, "span", 12);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngIf", ctx_r1.iconclass && !ctx_r1.iconurl);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r1.iconurl);
    i0.ɵɵadvance();
    i0.ɵɵproperty("textContent", ctx_r1.heading)("id", ctx_r1.titleid);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r1.subheading);
} }
const DEFAULT_CLS = 'app-dialog-header modal-header';
const DEFAULT_ICON_DIMENSIONS = '21px';
export class DialogHeaderComponent {
    get isClosable() {
        return toBoolean(this.closable);
    }
    constructor(elRef, dialogRef) {
        this.dialogRef = dialogRef;
        this.iconwidth = DEFAULT_ICON_DIMENSIONS;
        this.iconheight = DEFAULT_ICON_DIMENSIONS;
        this.closable = true;
        this.headinglevel = 'h4';
        addClass(elRef.nativeElement, DEFAULT_CLS);
    }
    closeDialog() {
        this.dialogRef.close();
    }
    static { this.ɵfac = function DialogHeaderComponent_Factory(t) { return new (t || DialogHeaderComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(DialogRef)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DialogHeaderComponent, selectors: [["div", "wmDialogHeader", ""]], inputs: { iconwidth: "iconwidth", iconheight: "iconheight", iconmargin: "iconmargin", iconclass: "iconclass", iconurl: "iconurl", closable: "closable", heading: "heading", headinglevel: "headinglevel", subheading: "subheading", titleid: "titleid", title: "title" }, attrs: _c0, decls: 11, vars: 8, consts: [["headerTemplate", ""], ["class", "app-dialog-close close", "title", "Close", 3, "click", 4, "ngIf"], [3, "ngSwitch"], [4, "ngSwitchCase"], [4, "ngSwitchDefault"], ["title", "Close", 1, "app-dialog-close", "close", 3, "click"], ["aria-hidden", "true"], [1, "app-dialog-title", "modal-title"], [4, "ngTemplateOutlet"], [3, "ngClass", "ngStyle", 4, "ngIf"], ["data-identifier", "img", 3, "src", "ngStyle", 4, "ngIf"], [1, "dialog-heading", 3, "textContent", "id"], ["class", "dialog-sub-heading", 3, "title", "textContent", 4, "ngIf"], [3, "ngClass", "ngStyle"], ["data-identifier", "img", 3, "src", "ngStyle"], [1, "dialog-sub-heading", 3, "title", "textContent"]], template: function DialogHeaderComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, DialogHeaderComponent_button_0_Template, 3, 1, "button", 1);
            i0.ɵɵelementContainerStart(1, 2);
            i0.ɵɵtemplate(2, DialogHeaderComponent_ng_container_2_Template, 3, 1, "ng-container", 3)(3, DialogHeaderComponent_ng_container_3_Template, 3, 1, "ng-container", 3)(4, DialogHeaderComponent_ng_container_4_Template, 3, 1, "ng-container", 3)(5, DialogHeaderComponent_ng_container_5_Template, 3, 1, "ng-container", 3)(6, DialogHeaderComponent_ng_container_6_Template, 3, 1, "ng-container", 3)(7, DialogHeaderComponent_ng_container_7_Template, 3, 1, "ng-container", 3)(8, DialogHeaderComponent_ng_container_8_Template, 3, 1, "ng-container", 4);
            i0.ɵɵelementContainerEnd();
            i0.ɵɵtemplate(9, DialogHeaderComponent_ng_template_9_Template, 4, 5, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.isClosable);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitch", ctx.headinglevel);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", "h1");
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", "h2");
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", "h3");
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", "h4");
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", "h5");
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", "h6");
        } }, dependencies: [i1.NgClass, i1.NgIf, i1.NgTemplateOutlet, i1.NgStyle, i1.NgSwitch, i1.NgSwitchCase, i1.NgSwitchDefault, i2.TextContentDirective, i2.ImagePipe], encapsulation: 2 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DialogHeaderComponent, [{
        type: Component,
        args: [{ selector: 'div[wmDialogHeader]', template: "<button (click)=\"closeDialog();\" *ngIf=\"isClosable\"\n        [attr.aria-label]=\"'Close ' + (title ? title : '') + ' dialog'\" class=\"app-dialog-close close\" title=\"Close\">\n    <span aria-hidden=\"true\">&times;</span>\n</button>\n\n<ng-container [ngSwitch]=\"headinglevel\">\n    <ng-container *ngSwitchCase=\"'h1'\">\n        <h1 class=\"app-dialog-title modal-title\">\n            <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n        </h1>\n    </ng-container>\n    <ng-container *ngSwitchCase=\"'h2'\">\n        <h2 class=\"app-dialog-title modal-title\">\n            <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n        </h2>\n    </ng-container>\n    <ng-container *ngSwitchCase=\"'h3'\">\n        <h3 class=\"app-dialog-title modal-title\">\n            <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n        </h3>\n    </ng-container>\n    <ng-container *ngSwitchCase=\"'h4'\">\n        <h4 class=\"app-dialog-title modal-title\">\n            <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n        </h4>\n    </ng-container>\n    <ng-container *ngSwitchCase=\"'h5'\">\n        <h5 class=\"app-dialog-title modal-title\">\n            <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n        </h5>\n    </ng-container>\n    <ng-container *ngSwitchCase=\"'h6'\">\n        <h6 class=\"app-dialog-title modal-title\">\n            <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n        </h6>\n    </ng-container>\n    <ng-container *ngSwitchDefault>\n        <h4 class=\"app-dialog-title modal-title\">\n            <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n        </h4>\n    </ng-container>\n</ng-container>\n\n<ng-template #headerTemplate>\n    <i [ngClass]=\"iconclass\" [ngStyle]=\"{width: iconwidth, height: iconheight, margin: iconmargin}\" *ngIf=\"iconclass && !iconurl\"></i>\n    <img data-identifier=\"img\" [src]=\"iconurl | image\" *ngIf=\"iconurl\" [ngStyle]=\"{width: iconwidth, height: iconheight, margin: iconmargin}\"/>\n    <span class=\"dialog-heading\" [textContent]=\"heading\" [id]=\"titleid\"></span>\n    <span class=\"dialog-sub-heading\" *ngIf=\"subheading\" [title]=\"subheading\" [textContent]=\"subheading\"></span>\n</ng-template>\n" }]
    }], () => [{ type: i0.ElementRef }, { type: i3.BaseDialog, decorators: [{
                type: Inject,
                args: [DialogRef]
            }] }], { iconwidth: [{
            type: Input
        }], iconheight: [{
            type: Input
        }], iconmargin: [{
            type: Input
        }], iconclass: [{
            type: Input
        }], iconurl: [{
            type: Input
        }], closable: [{
            type: Input
        }], heading: [{
            type: Input
        }], headinglevel: [{
            type: Input
        }], subheading: [{
            type: Input
        }], titleid: [{
            type: Input
        }], title: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DialogHeaderComponent, { className: "DialogHeaderComponent", filePath: "dialog-header/dialog-header.component.ts", lineNumber: 15 }); })();
//# sourceMappingURL=data:application/json;base64, 