import * as i0 from '@angular/core';
import { Component, ViewContainerRef, inject, Directive, HostBinding, Input, NgModule } from '@angular/core';
import * as i1 from '@ironsource/fusion-ui/components/icon/v1';
import { IconModule } from '@ironsource/fusion-ui/components/icon/v1';
import { CommonModule } from '@angular/common';
import { LoaderInlineModule } from '@ironsource/fusion-ui/components/loader-inline/v2';

class DropdownLoaderComponent {
    constructor() {
        this.iconLoader = {
            iconName: 'loading-rotate',
            iconVersion: 'v2'
        };
    }
    static { this.ɵfac = function DropdownLoaderComponent_Factory(t) { return new (t || DropdownLoaderComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DropdownLoaderComponent, selectors: [["fusion-dropdown-loader"]], decls: 3, vars: 1, consts: [[1, "fu-icon-loading", 3, "name"]], template: function DropdownLoaderComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelement(0, "fusion-icon", 0);
            i0.ɵɵelementStart(1, "div");
            i0.ɵɵtext(2, "Loading...");
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵproperty("name", ctx.iconLoader);
        } }, dependencies: [i1.IconComponent], styles: ["@font-face{font-family:NHaasGroteskDSPro;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.ttf) format(\"truetype\")}@font-face{font-family:NHaasGroteskDSPro-65Md;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue-Medium;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.ttf) format(\"truetype\")}.font-heading-6[_ngcontent-%COMP%], .font-heading-5[_ngcontent-%COMP%], .font-heading-4[_ngcontent-%COMP%], .font-heading-3[_ngcontent-%COMP%], .font-heading-2[_ngcontent-%COMP%], .font-heading-1[_ngcontent-%COMP%]{font-family:NHaasGroteskDSPro,sans-serif}.font-heading-1[_ngcontent-%COMP%]{font-size:60px}.font-heading-2[_ngcontent-%COMP%]{font-size:32px}.font-heading-3[_ngcontent-%COMP%]{font-size:22px}.font-heading-4[_ngcontent-%COMP%]{font-size:18px}.font-heading-5[_ngcontent-%COMP%]{font-size:15px}.font-heading-6[_ngcontent-%COMP%]{font-size:13px}.font-heading-label[_ngcontent-%COMP%]{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;letter-spacing:.25px}.font-caption[_ngcontent-%COMP%], .font-bodyXSmall[_ngcontent-%COMP%], [_nghost-%COMP%], .font-bodySmall[_ngcontent-%COMP%], .font-bodyMedium[_ngcontent-%COMP%], .font-bodyLarge[_ngcontent-%COMP%]{font-family:HelveticaNeue,helvetica,sans-serif;line-height:1.5}.font-bodyXSmallStrong[_ngcontent-%COMP%], .font-bodySmallStrong[_ngcontent-%COMP%], .font-bodyMediumStrong[_ngcontent-%COMP%], .font-bodyLargeStrong[_ngcontent-%COMP%]{font-family:HelveticaNeue-Medium,helvetica,sans-serif;line-height:1.5}.font-bodyLarge[_ngcontent-%COMP%], .font-bodyLargeStrong[_ngcontent-%COMP%]{font-size:16px}.font-bodyMedium[_ngcontent-%COMP%], .font-bodyMediumStrong[_ngcontent-%COMP%]{font-size:14px}[_nghost-%COMP%], .font-bodySmall[_ngcontent-%COMP%]{font-size:13px;letter-spacing:.24px}.font-bodySmallStrong[_ngcontent-%COMP%]{font-size:13px;letter-spacing:.24px}.font-bodyXSmall[_ngcontent-%COMP%], .font-bodyXSmallStrong[_ngcontent-%COMP%]{font-size:12px;letter-spacing:.24px}.font-caption[_ngcontent-%COMP%]{font-size:11px}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes _ngcontent-%COMP%_shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}[_nghost-%COMP%]{padding:0 8px;cursor:default;color:var(--fu-light-800, #8E959D);height:32px;background:var(--fu-white, #ffffff);display:flex;justify-content:flex-start;align-items:center;gap:4px}[_nghost-%COMP%]   fusion-icon.fu-icon-loading[_ngcontent-%COMP%]{width:20px;height:20px}[_nghost-%COMP%]   fusion-icon.fu-icon-loading[_ngcontent-%COMP%]     svg{width:20px;height:20px}[_nghost-%COMP%]   fusion-icon.fu-icon-loading[_ngcontent-%COMP%]     svg *{fill:var(--fu-light-700, #A9AFB4)}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DropdownLoaderComponent, [{
        type: Component,
        args: [{ selector: 'fusion-dropdown-loader', template: "<fusion-icon class=\"fu-icon-loading\" [name]=\"iconLoader\"></fusion-icon><div>Loading...</div>\n", styles: ["@font-face{font-family:NHaasGroteskDSPro;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.ttf) format(\"truetype\")}@font-face{font-family:NHaasGroteskDSPro-65Md;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue-Medium;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.ttf) format(\"truetype\")}.font-heading-6,.font-heading-5,.font-heading-4,.font-heading-3,.font-heading-2,.font-heading-1{font-family:NHaasGroteskDSPro,sans-serif}.font-heading-1{font-size:60px}.font-heading-2{font-size:32px}.font-heading-3{font-size:22px}.font-heading-4{font-size:18px}.font-heading-5{font-size:15px}.font-heading-6{font-size:13px}.font-heading-label{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;letter-spacing:.25px}.font-caption,.font-bodyXSmall,:host,.font-bodySmall,.font-bodyMedium,.font-bodyLarge{font-family:HelveticaNeue,helvetica,sans-serif;line-height:1.5}.font-bodyXSmallStrong,.font-bodySmallStrong,.font-bodyMediumStrong,.font-bodyLargeStrong{font-family:HelveticaNeue-Medium,helvetica,sans-serif;line-height:1.5}.font-bodyLarge,.font-bodyLargeStrong{font-size:16px}.font-bodyMedium,.font-bodyMediumStrong{font-size:14px}:host,.font-bodySmall{font-size:13px;letter-spacing:.24px}.font-bodySmallStrong{font-size:13px;letter-spacing:.24px}.font-bodyXSmall,.font-bodyXSmallStrong{font-size:12px;letter-spacing:.24px}.font-caption{font-size:11px}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}:host{padding:0 8px;cursor:default;color:var(--fu-light-800, #8E959D);height:32px;background:var(--fu-white, #ffffff);display:flex;justify-content:flex-start;align-items:center;gap:4px}:host fusion-icon.fu-icon-loading{width:20px;height:20px}:host fusion-icon.fu-icon-loading ::ng-deep svg{width:20px;height:20px}:host fusion-icon.fu-icon-loading ::ng-deep svg *{fill:var(--fu-light-700, #A9AFB4)}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DropdownLoaderComponent, { className: "DropdownLoaderComponent", filePath: "dropdown-loader.component.ts", lineNumber: 8 }); })();

class DropdownLoaderDirective {
    constructor(renderer) {
        this.renderer = renderer;
        this.isOptionHidden = false;
        this.loaderWrapper = true;
        this.viewContainerRef = inject(ViewContainerRef);
    }
    ngOnChanges() {
        this.isOptionHidden = !this.fusionDropdownLoader;
        this.loadContent();
    }
    loadContent() {
        if (!this.isOptionHidden) {
            this.viewContainerRef.clear();
            this.loaderComponentRef = this.viewContainerRef.createComponent(DropdownLoaderComponent);
            const loaderViewRef = this.loaderComponentRef.hostView;
            this.renderer.appendChild(this.viewContainerRef.element.nativeElement, loaderViewRef.rootNodes[0]);
        }
        else {
            this.viewContainerRef.clear();
        }
    }
    static { this.ɵfac = function DropdownLoaderDirective_Factory(t) { return new (t || DropdownLoaderDirective)(i0.ɵɵdirectiveInject(i0.Renderer2)); }; }
    static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: DropdownLoaderDirective, selectors: [["", "fusionDropdownLoader", ""]], hostVars: 4, hostBindings: function DropdownLoaderDirective_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵclassProp("is-hidden", ctx.isOptionHidden)("fu-loader-wrapper", ctx.loaderWrapper);
        } }, inputs: { fusionDropdownLoader: "fusionDropdownLoader" }, features: [i0.ɵɵNgOnChangesFeature] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DropdownLoaderDirective, [{
        type: Directive,
        args: [{
                selector: '[fusionDropdownLoader]'
            }]
    }], () => [{ type: i0.Renderer2 }], { isOptionHidden: [{
            type: HostBinding,
            args: ['class.is-hidden']
        }], loaderWrapper: [{
            type: HostBinding,
            args: ['class.fu-loader-wrapper']
        }], fusionDropdownLoader: [{
            type: Input
        }] }); })();

class DropdownLoaderModule {
    static { this.ɵfac = function DropdownLoaderModule_Factory(t) { return new (t || DropdownLoaderModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: DropdownLoaderModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule, LoaderInlineModule, IconModule, LoaderInlineModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DropdownLoaderModule, [{
        type: NgModule,
        args: [{
                declarations: [DropdownLoaderDirective, DropdownLoaderComponent],
                exports: [DropdownLoaderDirective, LoaderInlineModule],
                imports: [CommonModule, LoaderInlineModule, IconModule]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(DropdownLoaderModule, { declarations: [DropdownLoaderDirective, DropdownLoaderComponent], imports: [CommonModule, LoaderInlineModule, IconModule], exports: [DropdownLoaderDirective, LoaderInlineModule] }); })();

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

export { DropdownLoaderComponent, DropdownLoaderDirective, DropdownLoaderModule };
//# sourceMappingURL=ironsource-fusion-ui-components-dropdown-loader-v3.mjs.map
