import { ChangeDetectionStrategy, Component } from '@angular/core';
import { PopupBaseComponent } from '@ironsource/fusion-ui/components/popup/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 "@ironsource/fusion-ui/components/dynamic-components/v1";
function PopupComponent_fusion_dynamic_components_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-dynamic-components", 4, 5);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("element", ctx_r1.popupData == null ? null : ctx_r1.popupData.element)("component", ctx_r1.popupData == null ? null : ctx_r1.popupData.component.type)("componentData", ctx_r1.popupData == null ? null : ctx_r1.popupData.component.data);
} }
function PopupComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵprojection(0);
} }
const _c0 = ["*"];
export class PopupComponent extends PopupBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵPopupComponent_BaseFactory; return function PopupComponent_Factory(t) { return (ɵPopupComponent_BaseFactory || (ɵPopupComponent_BaseFactory = i0.ɵɵgetInheritedFactory(PopupComponent)))(t || PopupComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PopupComponent, selectors: [["fusion-popup"]], features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0, decls: 5, vars: 7, consts: [[1, "popupContainer", 3, "ngClass", "fusionClickOutside", "resize"], ["popupContainer", ""], [3, "element", "component", "componentData", 4, "ngIf", "ngIfElse"], ["template", ""], [3, "element", "component", "componentData"], ["dynamicContent", ""]], template: function PopupComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵelementStart(0, "div", 0, 1);
            i0.ɵɵlistener("fusionClickOutside", function PopupComponent_Template_div_fusionClickOutside_0_listener($event) { return ctx.onClickOutside($event); })("resize", function PopupComponent_Template_div_resize_0_listener() { return ctx.onResize(); }, false, i0.ɵɵresolveWindow);
            i0.ɵɵtemplate(2, PopupComponent_fusion_dynamic_components_2_Template, 2, 3, "fusion-dynamic-components", 2)(3, PopupComponent_ng_template_3_Template, 1, 0, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            const _r3 = i0.ɵɵreference(4);
            i0.ɵɵstyleProp("width", ctx.popupData == null ? null : ctx.popupData.size == null ? null : ctx.popupData.size.width, "px")("height", ctx.popupData == null ? null : ctx.popupData.size == null ? null : ctx.popupData.size.height, "px");
            i0.ɵɵproperty("ngClass", ctx.popupData == null ? null : ctx.popupData.location);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", (ctx.popupData == null ? null : ctx.popupData.component == null ? null : ctx.popupData.component.type) || (ctx.popupData == null ? null : ctx.popupData.element))("ngIfElse", _r3);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.ClickOutsideDirective, i3.DynamicComponentsComponent], styles: ["[_nghost-%COMP%]   .popupContainer.element-related[_ngcontent-%COMP%]:after{margin-left:0;position:absolute;left:50%;transform:translate(-50%)}[_nghost-%COMP%]   .popupContainer[_ngcontent-%COMP%]{position:fixed;background-color:var(--background-color);z-index:3011}[_nghost-%COMP%]   .popupContainer.top-right[_ngcontent-%COMP%]{top:5px;right:5px}[_nghost-%COMP%]   .popupContainer.top-left[_ngcontent-%COMP%]{top:5px;left:5px}[_nghost-%COMP%]   .popupContainer.bottom-right[_ngcontent-%COMP%]{bottom:5px;right:5px}[_nghost-%COMP%]   .popupContainer.bottom-left[_ngcontent-%COMP%]{bottom:5px;left:5px}[_nghost-%COMP%]   .popupContainer.element-related[_ngcontent-%COMP%]{position:absolute}[_nghost-%COMP%]   .popupContainer.element-related[_ngcontent-%COMP%]:after{border:solid;border-color:transparent transparent var(--background-color) transparent;border-width:0 7px 4px;content:\"\";position:absolute;bottom:100%}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PopupComponent, [{
        type: Component,
        args: [{ selector: 'fusion-popup', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n    #popupContainer\n    class=\"popupContainer\"\n    [ngClass]=\"popupData?.location\"\n    [style.width.px]=\"popupData?.size?.width\"\n    [style.height.px]=\"popupData?.size?.height\"\n    (fusionClickOutside)=\"onClickOutside($event)\"\n    (window:resize)=\"onResize()\"\n>\n    <fusion-dynamic-components\n        #dynamicContent\n        *ngIf=\"popupData?.component?.type || popupData?.element; else template\"\n        [element]=\"popupData?.element\"\n        [component]=\"popupData?.component.type\"\n        [componentData]=\"popupData?.component.data\"\n    >\n    </fusion-dynamic-components>\n\n    <ng-template #template>\n        <ng-content></ng-content>\n    </ng-template>\n</div>\n", styles: [":host .popupContainer.element-related:after{margin-left:0;position:absolute;left:50%;transform:translate(-50%)}:host .popupContainer{position:fixed;background-color:var(--background-color);z-index:3011}:host .popupContainer.top-right{top:5px;right:5px}:host .popupContainer.top-left{top:5px;left:5px}:host .popupContainer.bottom-right{bottom:5px;right:5px}:host .popupContainer.bottom-left{bottom:5px;left:5px}:host .popupContainer.element-related{position:absolute}:host .popupContainer.element-related:after{border:solid;border-color:transparent transparent var(--background-color) transparent;border-width:0 7px 4px;content:\"\";position:absolute;bottom:100%}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PopupComponent, { className: "PopupComponent", filePath: "popup.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9wdXAuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZnVzaW9uLXVpL2NvbXBvbmVudHMvcG9wdXAvdjIvcG9wdXAuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZnVzaW9uLXVpL2Nvb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