(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@ionic/angular'), require('@iotize/ionic/target/common')) :
    typeof define === 'function' && define.amd ? define('@iotize/ionic/target/modbus', ['exports', '@angular/core', '@angular/forms', '@ionic/angular', '@iotize/ionic/target/common'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.iotize = global.iotize || {}, global.iotize.ionic = global.iotize.ionic || {}, global.iotize.ionic.target = global.iotize.ionic.target || {}, global.iotize.ionic.target.modbus = {}), global.ng.core, global.ng.forms, global.i1, global.iotize.ionic.target.common));
}(this, (function (exports, i0, forms, i1, i2) { 'use strict';

    var TapModbusConfigurationFormComponent = /** @class */ (function () {
        function TapModbusConfigurationFormComponent(alertCtrl, loadingCtrl, changeDetector) {
            this.alertCtrl = alertCtrl;
            this.loadingCtrl = loadingCtrl;
            this.changeDetector = changeDetector;
            this.SERIAL_SETTINGS_FIELDS = i2.MODBUS_SETTINGS_FIELDS;
            this.valueChanges = new i0.EventEmitter();
        }
        Object.defineProperty(TapModbusConfigurationFormComponent.prototype, "values", {
            set: function (obs) {
                var _this = this;
                var _a;
                (_a = this.valueSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
                this.valueSub = obs === null || obs === void 0 ? void 0 : obs.subscribe(function (newValue) {
                    _this.formValues = newValue;
                });
            },
            enumerable: false,
            configurable: true
        });
        TapModbusConfigurationFormComponent.prototype.onSerialSettingsChanged = function (event) {
            console.log('Onsettings changed', event);
            this.valueChanges.emit(event);
        };
        return TapModbusConfigurationFormComponent;
    }());
    /** @nocollapse */ TapModbusConfigurationFormComponent.ɵfac = function TapModbusConfigurationFormComponent_Factory(t) { return new (t || TapModbusConfigurationFormComponent)(i0.ɵɵdirectiveInject(i1.AlertController), i0.ɵɵdirectiveInject(i1.LoadingController), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    /** @nocollapse */ TapModbusConfigurationFormComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TapModbusConfigurationFormComponent, selectors: [["tap-modbus-configuration-form"]], inputs: { values: "values" }, outputs: { valueChanges: "valueChanges" }, decls: 1, vars: 2, consts: [[3, "values", "fields", "valueChanges"]], template: function TapModbusConfigurationFormComponent_Template(rf, ctx) {
            if (rf & 1) {
                i0.ɵɵelementStart(0, "tap-protocol-configuration-form", 0);
                i0.ɵɵlistener("valueChanges", function TapModbusConfigurationFormComponent_Template_tap_protocol_configuration_form_valueChanges_0_listener($event) { return ctx.onSerialSettingsChanged($event); });
                i0.ɵɵelementEnd();
            }
            if (rf & 2) {
                i0.ɵɵproperty("values", ctx.formValues)("fields", ctx.SERIAL_SETTINGS_FIELDS);
            }
        }, directives: [i2.TapProtocolConfigurationFormComponent], styles: ["ion-input[_ngcontent-%COMP%]{text-align:right}"] });
    (function () {
        (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TapModbusConfigurationFormComponent, [{
                type: i0.Component,
                args: [{
                        selector: 'tap-modbus-configuration-form',
                        templateUrl: './tap-modbus-configuration-form.component.html',
                        styleUrls: ['./tap-modbus-configuration-form.component.scss'],
                    }]
            }], function () { return [{ type: i1.AlertController }, { type: i1.LoadingController }, { type: i0.ChangeDetectorRef }]; }, { valueChanges: [{
                    type: i0.Output
                }], values: [{
                    type: i0.Input
                }] });
    })();

    var TapTargetModbusModule = /** @class */ (function () {
        function TapTargetModbusModule() {
        }
        return TapTargetModbusModule;
    }());
    /** @nocollapse */ TapTargetModbusModule.ɵfac = function TapTargetModbusModule_Factory(t) { return new (t || TapTargetModbusModule)(); };
    /** @nocollapse */ TapTargetModbusModule.ɵmod = i0.ɵɵdefineNgModule({ type: TapTargetModbusModule });
    /** @nocollapse */ TapTargetModbusModule.ɵinj = i0.ɵɵdefineInjector({ imports: [[
                i1.IonicModule,
                forms.FormsModule,
                forms.ReactiveFormsModule,
                i2.TapProtocolConfigurationModule,
            ]] });
    (function () {
        (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(TapTargetModbusModule, { declarations: [TapModbusConfigurationFormComponent], imports: [i1.IonicModule,
                forms.FormsModule,
                forms.ReactiveFormsModule,
                i2.TapProtocolConfigurationModule], exports: [TapModbusConfigurationFormComponent] });
    })();
    (function () {
        (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TapTargetModbusModule, [{
                type: i0.NgModule,
                args: [{
                        declarations: [TapModbusConfigurationFormComponent],
                        exports: [TapModbusConfigurationFormComponent],
                        imports: [
                            i1.IonicModule,
                            forms.FormsModule,
                            forms.ReactiveFormsModule,
                            i2.TapProtocolConfigurationModule,
                        ],
                    }]
            }], null, null);
    })();

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

    exports.TapModbusConfigurationFormComponent = TapModbusConfigurationFormComponent;
    exports.TapTargetModbusModule = TapTargetModbusModule;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=iotize-ionic-target-modbus.umd.js.map
