import * as i0 from '@angular/core';
import { forwardRef, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from '@angular/forms';
import { NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms';
import { ToggleBaseComponent } from '@ironsource/fusion-ui/components/toggle/common/base';
export * from '@ironsource/fusion-ui/components/toggle/common/entities';

function ToggleComponent_span_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 4);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.currentLabel);
} }
const _c0 = (a0, a1, a2, a3) => ({ "animated": a0, disabled: a1, loading: a2, "is-small": a3 });
class ToggleComponent extends ToggleBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵToggleComponent_BaseFactory; return function ToggleComponent_Factory(t) { return (ɵToggleComponent_BaseFactory || (ɵToggleComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ToggleComponent)))(t || ToggleComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ToggleComponent, selectors: [["fusion-toggle"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => ToggleComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 20, consts: [[1, "is-toggle", 3, "ngClass", "click"], ["type", "checkbox", 3, "ngModel", "disabled", "id", "value", "checked", "ngModelChange"], [1, "slider"], ["class", "label", 4, "ngIf"], [1, "label"]], template: function ToggleComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "label", 0);
            i0.ɵɵlistener("click", function ToggleComponent_Template_label_click_0_listener() { return ctx.propagateTouched(); });
            i0.ɵɵpipe(1, "async");
            i0.ɵɵpipe(2, "async");
            i0.ɵɵelementStart(3, "input", 1);
            i0.ɵɵlistener("ngModelChange", function ToggleComponent_Template_input_ngModelChange_3_listener($event) { return ctx.onChange($event); });
            i0.ɵɵpipe(4, "async");
            i0.ɵɵpipe(5, "async");
            i0.ɵɵelementEnd();
            i0.ɵɵelement(6, "span", 2);
            i0.ɵɵtemplate(7, ToggleComponent_span_7_Template, 2, 1, "span", 3);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction4(15, _c0, i0.ɵɵpipeBind1(1, 7, ctx.animated$), i0.ɵɵpipeBind1(2, 9, ctx.isDisabled$), ctx.loading, ctx.size === "small"));
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("ngModel", ctx.model)("disabled", i0.ɵɵpipeBind1(4, 11, ctx.isDisabled$) || ctx.loading)("id", ctx.id)("value", ctx.value)("checked", i0.ɵɵpipeBind1(5, 13, ctx.isChecked$));
            i0.ɵɵadvance(4);
            i0.ɵɵproperty("ngIf", ctx.currentLabel);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.CheckboxControlValueAccessor, i2.NgControlStatus, i2.NgModel, i1.AsyncPipe], styles: ["[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]   .is-toggle.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default;touch-callout:none;-webkit-user-select:none;user-select:none}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]{cursor:pointer;font-size:100%;line-height:1.6em}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{margin-left:4px}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]{vertical-align:sub;background:var(--light-color-600, #C2CDD7);display:inline-block;width:30px;height:18px;border-radius:40px;position:relative;transition:background-color linear .3s 0s}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]:before{content:\"\";display:block;width:16px;height:16px;background:#fff;position:absolute;top:1px;left:1px;border-radius:8px;box-shadow:0 2px 2px #0000002b;transition:left linear .3s 0s}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]{display:none}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]{background-color:var(--positive-color, #13C7C8)}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:before{left:13px}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%] + .toggle-loading[_ngcontent-%COMP%]{padding-left:22px;margin-left:5px;position:relative;display:inline-block;color:var(--light-color-800, #678099)}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%] + .toggle-loading[_ngcontent-%COMP%]   fusion-icon[_ngcontent-%COMP%]{position:absolute;left:0;top:1px}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%] + .toggle-loading[_ngcontent-%COMP%]   fusion-icon[_ngcontent-%COMP%]     svg{width:15px;height:15px}[_nghost-%COMP%]   .is-toggle.disabled[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]{opacity:.5}[_nghost-%COMP%]   .is-toggle.disabled[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{color:var(--light-color-800, #678099)}[_nghost-%COMP%]   .is-toggle.loading[_ngcontent-%COMP%]{cursor:default}[_nghost-%COMP%]   .is-toggle.loading[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]:before{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHdpZHRoPScxNXB4JyBoZWlnaHQ9JzE1cHgnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy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2NpcmNsZT48L2c+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:cover}[_nghost-%COMP%]   .is-toggle.loading[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{color:var(--light-color-800, #678099)}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]{width:22px;height:14px}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]:before{width:12px;height:12px;border-radius:6px}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:before{left:9px}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ToggleComponent, [{
        type: Component,
        args: [{ selector: 'fusion-toggle', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => ToggleComponent),
                        multi: true
                    }
                ], template: "<label class=\"is-toggle\" [ngClass]=\"{'animated': (animated$ | async), disabled: (isDisabled$ | async), loading: loading, 'is-small': size === 'small'}\" (click)=\"propagateTouched()\">\n  <input type=\"checkbox\"\n         [ngModel]=\"model\"\n         [disabled]=\"(isDisabled$ | async) || loading\"\n         (ngModelChange)=\"onChange($event)\"\n         [id]='id'\n         [value]=\"value\"\n         [checked]=\"isChecked$ | async\">\n  <span class=\"slider\"></span>\n  <span *ngIf=\"currentLabel\" class=\"label\">{{currentLabel}}</span>\n</label>\n", styles: [":host *{box-sizing:border-box}:host .is-toggle.disabled{pointer-events:none;cursor:default;touch-callout:none;-webkit-user-select:none;user-select:none}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host .is-toggle{cursor:pointer;font-size:100%;line-height:1.6em}:host .is-toggle .label{margin-left:4px}:host .is-toggle .slider{vertical-align:sub;background:var(--light-color-600, #C2CDD7);display:inline-block;width:30px;height:18px;border-radius:40px;position:relative;transition:background-color linear .3s 0s}:host .is-toggle .slider:before{content:\"\";display:block;width:16px;height:16px;background:#fff;position:absolute;top:1px;left:1px;border-radius:8px;box-shadow:0 2px 2px #0000002b;transition:left linear .3s 0s}:host .is-toggle input[type=checkbox]{display:none}:host .is-toggle input[type=checkbox]:checked+.slider{background-color:var(--positive-color, #13C7C8)}:host .is-toggle input[type=checkbox]:checked+.slider:before{left:13px}:host .is-toggle+.toggle-loading{padding-left:22px;margin-left:5px;position:relative;display:inline-block;color:var(--light-color-800, #678099)}:host .is-toggle+.toggle-loading fusion-icon{position:absolute;left:0;top:1px}:host .is-toggle+.toggle-loading fusion-icon ::ng-deep svg{width:15px;height:15px}:host .is-toggle.disabled .slider{opacity:.5}:host .is-toggle.disabled .label{color:var(--light-color-800, #678099)}:host .is-toggle.loading{cursor:default}:host .is-toggle.loading .slider:before{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHdpZHRoPScxNXB4JyBoZWlnaHQ9JzE1cHgnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIiBjbGFzcz0idWlsLXJpcHBsZSI+PGc+IDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGR1cj0iMnMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMHMiIGtleVRpbWVzPSIwOzAuMzM7MSIgdmFsdWVzPSIxOzE7MCI+PC9hbmltYXRlPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQwIiBzdHJva2U9IiM4MjhkOWEiIGZpbGw9Im5vbmUiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBkdXI9IjJzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjBzIiBrZXlUaW1lcz0iMDswLjMzOzEiIHZhbHVlcz0iMDsyMjs0NCI+PC9hbmltYXRlPjwvY2lyY2xlPjwvZz48Zz48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiBkdXI9IjJzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjFzIiBrZXlUaW1lcz0iMDswLjMzOzEiIHZhbHVlcz0iMTsxOzAiPjwvYW5pbWF0ZT48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgc3Ryb2tlPSIjODI4ZDlhIiBmaWxsPSJub25lIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iciIgZHVyPSIycyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxcyIga2V5VGltZXM9IjA7MC4zMzsxIiB2YWx1ZXM9IjA7MjI7NDQiPjwvYW5pbWF0ZT48L2NpcmNsZT48L2c+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:cover}:host .is-toggle.loading .label{color:var(--light-color-800, #678099)}:host .is-toggle.is-small .slider{width:22px;height:14px}:host .is-toggle.is-small .slider:before{width:12px;height:12px;border-radius:6px}:host .is-toggle.is-small input[type=checkbox]:checked+.slider:before{left:9px}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ToggleComponent, { className: "ToggleComponent", filePath: "toggle.component.ts", lineNumber: 18 }); })();

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

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

export { ToggleComponent, ToggleModule };
//# sourceMappingURL=ironsource-fusion-ui-components-toggle-v1.mjs.map
