import * as i0 from '@angular/core';
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import { AccordionBaseComponent, AccordionHeaderModule, AccordionContentModule } from '@ironsource/fusion-ui/components/accordion/common/base';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from '@ironsource/fusion-ui/components/dynamic-components/v1';
import { DynamicComponentsModule } from '@ironsource/fusion-ui/components/dynamic-components/v1';

function AccordionComponent_ng_container_0_fusion_dynamic_components_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-dynamic-components", 3);
} if (rf & 2) {
    const index_r2 = i0.ɵɵnextContext().index;
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("closed", !ctx_r3.isOpened(index_r2));
    i0.ɵɵproperty("configuration", ctx_r3.getItemConfiguration(index_r2, "content"));
} }
function AccordionComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "fusion-dynamic-components", 1);
    i0.ɵɵlistener("click", function AccordionComponent_ng_container_0_Template_fusion_dynamic_components_click_1_listener() { const restoredCtx = i0.ɵɵrestoreView(_r6); const index_r2 = restoredCtx.index; const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.onClick(index_r2)); });
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(2, AccordionComponent_ng_container_0_fusion_dynamic_components_2_Template, 1, 3, "fusion-dynamic-components", 2);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const index_r2 = ctx.index;
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵclassProp("closed", !ctx_r0.isOpened(index_r2));
    i0.ɵɵproperty("configuration", ctx_r0.getItemConfiguration(index_r2, "header"));
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r0.isOpened(index_r2));
} }
class AccordionComponent extends AccordionBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵAccordionComponent_BaseFactory; return function AccordionComponent_Factory(t) { return (ɵAccordionComponent_BaseFactory || (ɵAccordionComponent_BaseFactory = i0.ɵɵgetInheritedFactory(AccordionComponent)))(t || AccordionComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AccordionComponent, selectors: [["fusion-accordion"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[4, "ngFor", "ngForOf"], [3, "configuration", "click"], [3, "configuration", "closed", 4, "ngIf"], [3, "configuration"]], template: function AccordionComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, AccordionComponent_ng_container_0_Template, 3, 4, "ng-container", 0);
        } if (rf & 2) {
            i0.ɵɵproperty("ngForOf", ctx.accordionBoxes);
        } }, dependencies: [i1.NgForOf, i1.NgIf, i2.DynamicComponentsComponent], styles: ["[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]   div.border[_ngcontent-%COMP%]{border:1px solid var(--fu-light-500, #d2d5d8)}[_nghost-%COMP%]   fusion-dynamic-components.closed[_ngcontent-%COMP%]{cursor:pointer}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccordionComponent, [{
        type: Component,
        args: [{ selector: 'fusion-accordion', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let boxData of accordionBoxes; let index = index\">\n    <fusion-dynamic-components\n        [configuration]=\"getItemConfiguration(index, 'header')\"\n        [class.closed]=\"!isOpened(index)\"\n        (click)=\"onClick(index)\"\n    ></fusion-dynamic-components>\n    <fusion-dynamic-components\n        *ngIf=\"isOpened(index)\"\n        [configuration]=\"getItemConfiguration(index, 'content')\"\n        [class.closed]=\"!isOpened(index)\"\n    ></fusion-dynamic-components>\n</ng-container>\n", styles: [":host *{box-sizing:border-box}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host div.border{border:1px solid var(--fu-light-500, #d2d5d8)}:host fusion-dynamic-components.closed{cursor:pointer}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AccordionComponent, { className: "AccordionComponent", filePath: "accordion.component.ts", lineNumber: 10 }); })();

class AccordionModule {
    static { this.ɵfac = function AccordionModule_Factory(t) { return new (t || AccordionModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AccordionModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule, AccordionHeaderModule, AccordionContentModule, DynamicComponentsModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccordionModule, [{
        type: NgModule,
        args: [{
                declarations: [AccordionComponent],
                exports: [AccordionComponent],
                imports: [CommonModule, AccordionHeaderModule, AccordionContentModule, DynamicComponentsModule]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AccordionModule, { declarations: [AccordionComponent], imports: [CommonModule, AccordionHeaderModule, AccordionContentModule, DynamicComponentsModule], exports: [AccordionComponent] }); })();

/**
 * Generated bundle index. Do not edit.
 */

export { AccordionComponent, AccordionModule };
//# sourceMappingURL=ironsource-fusion-ui-components-accordion-v2.mjs.map
