import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { MONTH_PICKER_PLACEHOLDER } from '@ironsource/fusion-ui/components/month-picker/common/base';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ironsource/fusion-ui/components/icon/v1";
function MonthPickerPlaceholderComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 4);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r0.placeholder == null ? null : ctx_r0.placeholder.text);
} }
function MonthPickerPlaceholderComponent_fusion_icon_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 5);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r1.arrowIconName);
} }
function MonthPickerPlaceholderComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 4);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(2, "div", 6);
    i0.ɵɵtext(3);
    i0.ɵɵpipe(4, "date");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r2.placeholder == null ? null : ctx_r2.placeholder.prefix);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(4, 2, ctx_r2.selectedDate, ctx_r2.placeholder == null ? null : ctx_r2.placeholder.format));
} }
const _c0 = () => ({ iconName: "calendar-2", iconVersion: "v2" });
export class MonthPickerPlaceholderComponent {
    constructor() {
        this.placeholder = MONTH_PICKER_PLACEHOLDER;
        this.arrowIconName = { iconName: 'arrow-dropdown', iconVersion: 'v1' };
    }
    get selectedDate() {
        return new Date(`${this.selected?.year}-${this.selected?.month + 1}-10`);
    }
    static { this.ɵfac = function MonthPickerPlaceholderComponent_Factory(t) { return new (t || MonthPickerPlaceholderComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MonthPickerPlaceholderComponent, selectors: [["fusion-month-picker-placeholder"]], inputs: { placeholder: "placeholder", selected: "selected" }, decls: 5, vars: 5, consts: [[1, "fu-calendar-icon", 3, "name"], [4, "ngIf", "ngIfElse"], ["class", "icon-arrow", 3, "name", 4, "ngIf"], ["selectedMonth", ""], [1, "fu-placeholder"], [1, "icon-arrow", 3, "name"], [1, "fu-value-selected"]], template: function MonthPickerPlaceholderComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelement(0, "fusion-icon", 0);
            i0.ɵɵtemplate(1, MonthPickerPlaceholderComponent_ng_container_1_Template, 3, 1, "ng-container", 1)(2, MonthPickerPlaceholderComponent_fusion_icon_2_Template, 1, 1, "fusion-icon", 2)(3, MonthPickerPlaceholderComponent_ng_template_3_Template, 5, 5, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
        } if (rf & 2) {
            const _r3 = i0.ɵɵreference(4);
            i0.ɵɵproperty("name", i0.ɵɵpureFunction0(4, _c0));
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", !ctx.selected && ctx.placeholder)("ngIfElse", _r3);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.arrowIconName);
        } }, dependencies: [i1.NgIf, i2.IconComponent, i1.DatePipe], styles: ["[_nghost-%COMP%]{position:relative;width:100%;display:flex;align-items:center;cursor:pointer}.fu-disabled[_nghost-%COMP%]{cursor:default;pointer-events:none}", "[_nghost-%COMP%]   .fu-value-selected[_ngcontent-%COMP%]{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:700}[_nghost-%COMP%]{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{height:var(--fu-month-picker-height, 32px);padding:var(--fu-month-picker-padding, 9px);border:var(--fu-month-picker-border, solid 1px var(--light-color, #E1E6EB));border-radius:var(--fu-month-picker-border-radius, 3px)}[_nghost-%COMP%]   fusion-icon[class^=fu-calendar-icon][_ngcontent-%COMP%]{margin-right:8px;padding-top:4px}[_nghost-%COMP%]   fusion-icon[class^=fu-calendar-icon][_ngcontent-%COMP%]     svg{width:var(--fu-month-picker-calendar-icon-size, 15px);height:var(--fu-month-picker-calendar-icon-size, 15px)}[_nghost-%COMP%]   fusion-icon[class^=fu-calendar-icon][_ngcontent-%COMP%]     svg *{fill:var(--fu-month-picker-calendar-icon-color, var(--light-color-800, #678099))}[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px)}[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg *{fill:var(--fu-month-picker-arrow-icon-color, var(--light-color-800, #678099))}[_nghost-%COMP%]   .fu-value-selected[_ngcontent-%COMP%]{margin-left:3px}.fu-opened[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px);transform:rotate(180deg)}.fu-opened[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg *{fill:var(--fu-month-picker-arrow-icon-color, var(--light-color-800, #678099))}.fu-disabled[_nghost-%COMP%]{color:var(--fu-month-picker-disabled-color, var(--light-color-800, #678099))}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MonthPickerPlaceholderComponent, [{
        type: Component,
        args: [{ selector: 'fusion-month-picker-placeholder', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fusion-icon class=\"fu-calendar-icon\" [name]=\"{iconName: 'calendar-2', iconVersion: 'v2'}\"></fusion-icon>\n<ng-container *ngIf=\"!selected && placeholder; else selectedMonth\">\n    <div class=\"fu-placeholder\">{{ placeholder?.text }}</div>\n</ng-container>\n<fusion-icon *ngIf=\"arrowIconName\" class=\"icon-arrow\" [name]=\"arrowIconName\"></fusion-icon>\n\n<ng-template #selectedMonth>\n    <div class=\"fu-placeholder\">{{ placeholder?.prefix }}</div>\n    <div class=\"fu-value-selected\">{{ selectedDate | date: placeholder?.format }}</div>\n</ng-template>\n", styles: [":host{position:relative;width:100%;display:flex;align-items:center;cursor:pointer}:host.fu-disabled{cursor:default;pointer-events:none}\n", ":host .fu-value-selected{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:700}:host{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}:host *{box-sizing:border-box}:host{height:var(--fu-month-picker-height, 32px);padding:var(--fu-month-picker-padding, 9px);border:var(--fu-month-picker-border, solid 1px var(--light-color, #E1E6EB));border-radius:var(--fu-month-picker-border-radius, 3px)}:host fusion-icon[class^=fu-calendar-icon]{margin-right:8px;padding-top:4px}:host fusion-icon[class^=fu-calendar-icon] ::ng-deep svg{width:var(--fu-month-picker-calendar-icon-size, 15px);height:var(--fu-month-picker-calendar-icon-size, 15px)}:host fusion-icon[class^=fu-calendar-icon] ::ng-deep svg *{fill:var(--fu-month-picker-calendar-icon-color, var(--light-color-800, #678099))}:host fusion-icon[class^=icon-arrow]{margin-left:auto}:host fusion-icon[class^=icon-arrow] ::ng-deep svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px)}:host fusion-icon[class^=icon-arrow] ::ng-deep svg *{fill:var(--fu-month-picker-arrow-icon-color, var(--light-color-800, #678099))}:host .fu-value-selected{margin-left:3px}:host.fu-opened fusion-icon[class^=icon-arrow] ::ng-deep svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px);transform:rotate(180deg)}:host.fu-opened fusion-icon[class^=icon-arrow] ::ng-deep svg *{fill:var(--fu-month-picker-arrow-icon-color, var(--light-color-800, #678099))}:host.fu-disabled{color:var(--fu-month-picker-disabled-color, var(--light-color-800, #678099))}\n"] }]
    }], null, { placeholder: [{
            type: Input
        }], selected: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MonthPickerPlaceholderComponent, { className: "MonthPickerPlaceholderComponent", filePath: "components/month-picker-placeholder/month-picker-placeholder.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9udGgtcGlja2VyLXBsYWNlaG9sZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11aS9jb21wb25lbnRzL21vbnRoLXBpY2tlci92MS9jb21wb25lbnRzL21vbnRoLXBpY2tlci1wbGFjZWhvbGRlci9tb250aC1waWNrZXItcGxhY2Vob2xkZXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZnVzaW9uLXVpL2NvbXBvbmVudHMvbW9udGgtcGlja2VyL3YxL2NvbXBvbmVudHMvbW9udGgtcGlja2VyLXBsYWNlaG9sZGVyL21vbnRoLXBpY2tlci1wbGFjZWhvbGRlci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUN4RSxPQUFPLEVBQUMsd0JBQXdCL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