import { ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { MonthPickerBaseComponent } 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/directives/click-outside";
import * as i3 from "./components/month-picker-placeholder/month-picker-placeholder.component";
import * as i4 from "./components/month-picker-selector/month-picker-selector.component";
function MonthPickerComponent_div_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 4);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.error);
} }
export class MonthPickerComponent extends MonthPickerBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵMonthPickerComponent_BaseFactory; return function MonthPickerComponent_Factory(t) { return (ɵMonthPickerComponent_BaseFactory || (ɵMonthPickerComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MonthPickerComponent)))(t || MonthPickerComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MonthPickerComponent, selectors: [["fusion-month-picker"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => MonthPickerComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 16, consts: [[1, "fu-month-picker-wrapper", 3, "fusionClickOutside"], [3, "placeholder", "selected", "click"], [3, "selected", "min", "max", "selectedChange"], ["class", "error-msg", 4, "ngIf"], [1, "error-msg"]], template: function MonthPickerComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵlistener("fusionClickOutside", function MonthPickerComponent_Template_div_fusionClickOutside_0_listener() { return ctx.onOutsideClick(); });
            i0.ɵɵelementStart(1, "fusion-month-picker-placeholder", 1);
            i0.ɵɵlistener("click", function MonthPickerComponent_Template_fusion_month_picker_placeholder_click_1_listener() { return ctx.onMonthPlaceholderClicked(); });
            i0.ɵɵpipe(2, "async");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(3, "fusion-month-picker-selector", 2);
            i0.ɵɵlistener("selectedChange", function MonthPickerComponent_Template_fusion_month_picker_selector_selectedChange_3_listener($event) { return ctx.selectedChanged($event); });
            i0.ɵɵpipe(4, "async");
            i0.ɵɵelementEnd()();
            i0.ɵɵtemplate(5, MonthPickerComponent_div_5_Template, 2, 1, "div", 3);
        } if (rf & 2) {
            i0.ɵɵadvance();
            i0.ɵɵclassProp("fu-disabled", ctx.isDisabled)("fu-opened", i0.ɵɵpipeBind1(2, 12, ctx.isOpen$));
            i0.ɵɵproperty("placeholder", ctx.config == null ? null : ctx.config.placeholder)("selected", ctx.selected);
            i0.ɵɵadvance(2);
            i0.ɵɵclassProp("fu-opened", i0.ɵɵpipeBind1(4, 14, ctx.isOpen$));
            i0.ɵɵproperty("selected", ctx.selected)("min", ctx.config == null ? null : ctx.config.min)("max", ctx.config == null ? null : ctx.config.max);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.error);
        } }, dependencies: [i1.NgIf, i2.ClickOutsideDirective, i3.MonthPickerPlaceholderComponent, i4.MonthPickerSelectorComponent, i1.AsyncPipe], styles: ["[_nghost-%COMP%]   .error-msg[_ngcontent-%COMP%]{font-size:11px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]   .fu-month-picker-wrapper[_ngcontent-%COMP%]{position:relative;min-width:220px;max-width:300px;color:var(--fu-month-picker-color, var(--fu-dark-500, #0d148c))}[_nghost-%COMP%]   .error-msg[_ngcontent-%COMP%]{color:var(--fu-negative-500, #ff6a63)}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MonthPickerComponent, [{
        type: Component,
        args: [{ selector: 'fusion-month-picker', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => MonthPickerComponent),
                        multi: true
                    }
                ], template: "<div class=\"fu-month-picker-wrapper\" (fusionClickOutside)=\"onOutsideClick()\">\n    <fusion-month-picker-placeholder\n        [placeholder]=\"config?.placeholder\"\n        [selected]=\"selected\"\n        [class.fu-disabled]=\"isDisabled\"\n        [class.fu-opened]=\"isOpen$ | async\"\n        (click)=\"onMonthPlaceholderClicked()\"\n    ></fusion-month-picker-placeholder>\n    <fusion-month-picker-selector\n        [class.fu-opened]=\"isOpen$ | async\"\n        [selected]=\"selected\"\n        [min]=\"config?.min\"\n        [max]=\"config?.max\"\n        (selectedChange)=\"selectedChanged($event)\"\n    ></fusion-month-picker-selector>\n</div>\n<div class=\"error-msg\" *ngIf=\"error\">{{ error }}</div>\n", styles: [":host .error-msg{font-size:11px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400}:host *{box-sizing:border-box}:host .fu-month-picker-wrapper{position:relative;min-width:220px;max-width:300px;color:var(--fu-month-picker-color, var(--fu-dark-500, #0d148c))}:host .error-msg{color:var(--fu-negative-500, #ff6a63)}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MonthPickerComponent, { className: "MonthPickerComponent", filePath: "month-picker.component.ts", lineNumber: 18 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9udGgtcGlja2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11aS9jb21wb25lbnRzL21vbnRoLXBpY2tlci92Mi9tb250aC1waWNrZXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4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