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%]   .is-toggle[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{font-size:13px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}[_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;position:relative}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{width:27px;overflow:hidden;position:absolute;color:var(--fu-white, #ffffff);top:-1px;left:28px}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]{vertical-align:middle;background:var(--fu-light-800, #8e959d);display:inline-block;width:60px;height:24px;border-radius:12px;position:relative}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]:before{content:\"\";display:block;width:16px;height:16px;background:#fff;position:absolute;top:4px;left:4px;border-radius:8px}[_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(--checked-bg-color, var(--fu-secondary-500, #00ccd7))}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:before{left:40px}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%] + .label[_ngcontent-%COMP%]{left:11px}[_nghost-%COMP%]   .is-toggle.disabled[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%] + .slider[_ngcontent-%COMP%]{background-color:var(--fu-light-400, #dddfe1)}[_nghost-%COMP%]   .is-toggle.disabled[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]{background-color:var(--checked-bg-color, var(--fu-secondary-300, #91e2e7))}[_nghost-%COMP%]   .is-toggle.disabled[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{color:var(--fu-white, #ffffff)}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{width:inherit;overflow:inherit;color:var(--fu-dark-700, #1d1c64);left:24px}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]{width:20px;height:12px;border-radius:10px}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]:before{top:2px;left:2px;width:8px;height:8px;border-radius:4px}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]{background-color:var(--checked-bg-color, var(--fu-secondary-500, #00ccd7))}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:before{left:10px}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%] + .label[_ngcontent-%COMP%]{left:24px}[_nghost-%COMP%]   .is-toggle.is-small.disabled[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]{background-color:var(--checked-bg-color, var(--fu-secondary-300, #91e2e7))}[_nghost-%COMP%]   .is-toggle.animated[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]{transition:background-color linear .3s 0s}[_nghost-%COMP%]   .is-toggle.animated[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]:before{transition:left linear .3s 0s}"], 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 .is-toggle .label{font-size:13px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}:host .is-toggle.is-small .label{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}: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;position:relative}:host .is-toggle .label{width:27px;overflow:hidden;position:absolute;color:var(--fu-white, #ffffff);top:-1px;left:28px}:host .is-toggle .slider{vertical-align:middle;background:var(--fu-light-800, #8e959d);display:inline-block;width:60px;height:24px;border-radius:12px;position:relative}:host .is-toggle .slider:before{content:\"\";display:block;width:16px;height:16px;background:#fff;position:absolute;top:4px;left:4px;border-radius:8px}:host .is-toggle input[type=checkbox]{display:none}:host .is-toggle input[type=checkbox]:checked+.slider{background-color:var(--checked-bg-color, var(--fu-secondary-500, #00ccd7))}:host .is-toggle input[type=checkbox]:checked+.slider:before{left:40px}:host .is-toggle input[type=checkbox]:checked+.slider+.label{left:11px}:host .is-toggle.disabled input[type=checkbox]+.slider{background-color:var(--fu-light-400, #dddfe1)}:host .is-toggle.disabled input[type=checkbox]:checked+.slider{background-color:var(--checked-bg-color, var(--fu-secondary-300, #91e2e7))}:host .is-toggle.disabled .label{color:var(--fu-white, #ffffff)}:host .is-toggle.is-small .label{width:inherit;overflow:inherit;color:var(--fu-dark-700, #1d1c64);left:24px}:host .is-toggle.is-small .slider{width:20px;height:12px;border-radius:10px}:host .is-toggle.is-small .slider:before{top:2px;left:2px;width:8px;height:8px;border-radius:4px}:host .is-toggle.is-small input[type=checkbox]:checked+.slider{background-color:var(--checked-bg-color, var(--fu-secondary-500, #00ccd7))}:host .is-toggle.is-small input[type=checkbox]:checked+.slider:before{left:10px}:host .is-toggle.is-small input[type=checkbox]:checked+.slider+.label{left:24px}:host .is-toggle.is-small.disabled input[type=checkbox]:checked+.slider{background-color:var(--checked-bg-color, var(--fu-secondary-300, #91e2e7))}:host .is-toggle.animated .slider{transition:background-color linear .3s 0s}:host .is-toggle.animated .slider:before{transition:left linear .3s 0s}\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-v2.mjs.map
