import { Component, ChangeDetectionStrategy } from '@angular/core';
import { AccordionBaseComponent } from '@ironsource/fusion-ui/components/accordion/common/base';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 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));
} }
export 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 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3JkaW9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11aS9jb21wb25lbnRzL2FjY29yZGlvbi92Mi9hY2NvcmRpb24uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZnVzaW9uLXVpL2NvbXBvbmVudHMvYWNjb3JkaW9uL2NvbW1vbi9iYXNlL2FjY29yZGlvbi5iYXNlLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUUsdUJBQXVCLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDakUsT0FBTyxFQUFDLHNCQUFzQixFQUFDLE1BQU0sd0RBQXdELENBQUM7Ozs7O0lDSzFGLCtDQUk2Qjs7OztJQUR6QixvREFBaUM7SUFEakMsZ0ZBQXdEOzs7O0lBUmhFLDZCQUF3RTtJQUNwRSxvREFJQztJQURHLG1QQUFTLGVBQUEsd0JBQWMsQ0FBQSxJQUFDO0lBQzNCLGlCQUE0QjtJQUM3Qiw4SEFJNkI7SUFDakMsMEJBQWU7Ozs7SUFSUCxjQUFpQztJQUFqQyxvREFBaUM7SUFEakMsK0VBQXVEO0lBS3RELGNBQXFCO0lBQXJCLGdEQUFxQjs7QURFOUIsTUFBTSxPQUFPLGtCQUFtQixTQUFRLHNCQUFzQjs0T0FBakQsa0JBQWtCLFNBQWxCLGtCQUFrQjtvRUFBbEIsa0JBQWtCO1lDVC9CL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