import { ɵɵinject, ɵɵdefineInjectable, ɵsetClassMetadata, Injectable, ɵɵelement, ɵɵproperty, ɵɵelementStart, ɵɵtext, ɵɵelementEnd, ɵɵadvance, ɵɵtextInterpolate1, ɵɵtemplate, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind2, ɵɵpipeBind1, EventEmitter, ɵɵdirectiveInject, ɵɵdefineComponent, Component, Input, Output, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope, NgModule } from '@angular/core';
import { Validators, FormBuilder, ɵangular_packages_forms_forms_ba, NgControlStatusGroup, FormGroupDirective, NgControlStatus, FormControlName, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TargetS3PProtocolConfiguration, SerialSettings } from '@iotize/tap/service/impl/target';
import { __awaiter } from 'tslib';
import { deepEqual } from '@iotize/common/utility';
import { BehaviorSubject, Subject } from 'rxjs';
import { CurrentDeviceService, EnumPipe, TrimPipe, LibCommonModule } from '@iotize/ionic';
import { NgIf, NgForOf, CommonModule } from '@angular/common';
import { IonItem, IonLabel, IonInput, NumericValueAccessor, IonSelect, SelectValueAccessor, IonSelectOption } from '@ionic/angular';

const SERIAL_SETTINGS_FIELDS = [
    'baudRate',
    'dataBits',
    'bitParity',
    'stopBits',
    'hardwareFlowControl',
    'handshakeDelimiter',
    'timeout',
];
const MODBUS_SETTINGS_FIELDS = [...SERIAL_SETTINGS_FIELDS, 'offsetFirstRegister', 'slave'];
const TAPNPASS_SETTINGS_FIELDS = ['physicalPort'];
const ALL_SETTINGS_FIELDS = [
    ...SERIAL_SETTINGS_FIELDS,
    ...MODBUS_SETTINGS_FIELDS,
];
class ProtocolConfigurationError extends Error {
    constructor(msg, cause) {
        super(msg);
        this.cause = cause;
        this.code = 'ProtocolConfigurationError';
    }
    static tapResponseError(err, msg) {
        const fullMsg = `${msg} - ${err.message}`;
        return new ProtocolConfigurationError(fullMsg, err);
    }
}

const TAG = 'SerialSettings';
class ProtocolConfigurationService {
    constructor(tapService) {
        this.tapService = tapService;
        this._s3pProtocolConfiguration = {
            mode: TargetS3PProtocolConfiguration.Mode.INDEXED,
            delay: 1,
        };
        this._defaultSettings = {
            serial: {
                physicalPort: SerialSettings.PhysicalPort.AUTO,
                stopBits: SerialSettings.StopBits.ONE,
                bitParity: SerialSettings.BitParity.NONE,
                dataBits: SerialSettings.DataBits._8,
                hardwareFlowControl: SerialSettings.HardwareFlowControl.NONE,
                handshakeDelimiter: SerialSettings.HandshakeDelimiter.NONE,
                timeout: 50,
                baudRate: 187500,
            },
            modbus: {
                offsetFirstRegister: false,
                slave: 0,
            },
        };
        this.pendingSettings$ = new BehaviorSubject(this._defaultSettings); // displayed settings
        this.loading = new BehaviorSubject(false);
        this.errors = new Subject();
        this._tapSettings = undefined;
    }
    set pendingSettings(settings) {
        this.pendingSettings$.next(settings);
    }
    get pendingSettings() {
        return this.pendingSettings$.value;
    }
    get tap() {
        return this.tapService.tap;
    }
    refresh() {
        return __awaiter(this, void 0, void 0, function* () {
            this.loading.next(true);
            try {
                const tapSettings = (yield this.tap.service.target.getSerialModbusConfiguration()).body();
                this._tapSettings = tapSettings;
                this.pendingSettings$.next(tapSettings);
                // debug(TAG, 'Refreshed settings: ', this.pendingSettings);
                this.loading.next(false);
            }
            catch (err) {
                const error = ProtocolConfigurationError.tapResponseError(err, 'Failed reading serial settings from Tap');
                this.loading.next(false);
                this.onError(error);
                throw error;
            }
        });
    }
    applyChanges(temporary = true, reconnectTarget = true) {
        return __awaiter(this, void 0, void 0, function* () {
            this.loading.next(true);
            try {
                yield this.setSerialModbusConfiguration(temporary);
                if (reconnectTarget) {
                    yield this.reconnectTarget();
                }
                this._tapSettings = Object.assign({}, this.pendingSettings);
                this.loading.next(false);
            }
            catch (error) {
                this.loading.next(false);
                this.onError(error);
                throw error;
            }
        });
    }
    discardChanges() {
        const prevSettings = this._tapSettings
            ? this._tapSettings
            : this._defaultSettings;
        this.pendingSettings$.next(prevSettings);
    }
    hasChanges() {
        if (!this._tapSettings) {
            return true;
        }
        return !deepEqual(this.pendingSettings, this._tapSettings);
    }
    setSerialModbusConfiguration(temporary = true) {
        return __awaiter(this, void 0, void 0, function* () {
            try {
                if (temporary) {
                    (yield this.tap.service.target.setSerialModbusConfiguration(this.pendingSettings)).successful();
                }
                else {
                    (yield this.tap.service.target.putSerialModbusConfiguration(this.pendingSettings)).successful();
                }
            }
            catch (err) {
                throw ProtocolConfigurationError.tapResponseError(err, 'Failed writing serial settings to Tap');
            }
        });
    }
    reconnectTarget() {
        return __awaiter(this, void 0, void 0, function* () {
            yield this.tap.service.target.disconnect();
            yield this.tap.service.target.connect();
        });
    }
    onError(error) {
        this.errors.next(error);
    }
}
/** @nocollapse */ ProtocolConfigurationService.ɵfac = function ProtocolConfigurationService_Factory(t) { return new (t || ProtocolConfigurationService)(ɵɵinject(CurrentDeviceService)); };
/** @nocollapse */ ProtocolConfigurationService.ɵprov = ɵɵdefineInjectable({ token: ProtocolConfigurationService, factory: ProtocolConfigurationService.ɵfac, providedIn: 'root' });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵsetClassMetadata(ProtocolConfigurationService, [{
        type: Injectable,
        args: [{
                providedIn: 'root',
            }]
    }], function () { return [{ type: CurrentDeviceService }]; }, null); })();

function TapProtocolConfigurationFormComponent_ion_item_1_ion_input_3_Template(rf, ctx) { if (rf & 1) {
    ɵɵelement(0, "ion-input", 4);
} if (rf & 2) {
    ɵɵproperty("formControlName", "baudRate");
} }
function TapProtocolConfigurationFormComponent_ion_item_1_ion_select_4_ion_select_option_1_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-select-option", 7);
    ɵɵtext(1);
    ɵɵelementEnd();
} if (rf & 2) {
    const baud_r12 = ctx.$implicit;
    ɵɵproperty("value", baud_r12);
    ɵɵadvance(1);
    ɵɵtextInterpolate1(" ", baud_r12, " bauds ");
} }
function TapProtocolConfigurationFormComponent_ion_item_1_ion_select_4_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-select", 5);
    ɵɵtemplate(1, TapProtocolConfigurationFormComponent_ion_item_1_ion_select_4_ion_select_option_1_Template, 2, 2, "ion-select-option", 6);
    ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r10 = ɵɵnextContext(2);
    ɵɵproperty("formControlName", "baudRate");
    ɵɵadvance(1);
    ɵɵproperty("ngForOf", ctx_r10.baudRates);
} }
function TapProtocolConfigurationFormComponent_ion_item_1_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-item");
    ɵɵelementStart(1, "ion-label");
    ɵɵtext(2, " Baud rate ");
    ɵɵelementEnd();
    ɵɵtemplate(3, TapProtocolConfigurationFormComponent_ion_item_1_ion_input_3_Template, 1, 1, "ion-input", 2);
    ɵɵtemplate(4, TapProtocolConfigurationFormComponent_ion_item_1_ion_select_4_Template, 2, 2, "ion-select", 3);
    ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = ɵɵnextContext();
    ɵɵadvance(3);
    ɵɵproperty("ngIf", ctx_r0.customBaudRate);
    ɵɵadvance(1);
    ɵɵproperty("ngIf", !ctx_r0.customBaudRate);
} }
function TapProtocolConfigurationFormComponent_ion_item_2_ion_select_option_4_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-select-option", 7);
    ɵɵtext(1);
    ɵɵpipe(2, "trim");
    ɵɵelementEnd();
} if (rf & 2) {
    const option_r14 = ctx.$implicit;
    ɵɵproperty("value", option_r14.key);
    ɵɵadvance(1);
    ɵɵtextInterpolate1(" ", ɵɵpipeBind2(2, 2, option_r14.value, "_"), " ");
} }
function TapProtocolConfigurationFormComponent_ion_item_2_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-item");
    ɵɵelementStart(1, "ion-label");
    ɵɵtext(2, "Data bits");
    ɵɵelementEnd();
    ɵɵelementStart(3, "ion-select", 8);
    ɵɵtemplate(4, TapProtocolConfigurationFormComponent_ion_item_2_ion_select_option_4_Template, 3, 5, "ion-select-option", 6);
    ɵɵpipe(5, "enum");
    ɵɵelementEnd();
    ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = ɵɵnextContext();
    ɵɵadvance(3);
    ɵɵproperty("formControlName", "dataBits");
    ɵɵadvance(1);
    ɵɵproperty("ngForOf", ɵɵpipeBind1(5, 2, ctx_r1.SerialSettings.DataBits));
} }
function TapProtocolConfigurationFormComponent_ion_item_3_ion_select_option_4_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-select-option", 7);
    ɵɵtext(1);
    ɵɵelementEnd();
} if (rf & 2) {
    const option_r16 = ctx.$implicit;
    ɵɵproperty("value", option_r16.key);
    ɵɵadvance(1);
    ɵɵtextInterpolate1("", option_r16.value, " ");
} }
function TapProtocolConfigurationFormComponent_ion_item_3_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-item");
    ɵɵelementStart(1, "ion-label");
    ɵɵtext(2, "Stop bit");
    ɵɵelementEnd();
    ɵɵelementStart(3, "ion-select", 8);
    ɵɵtemplate(4, TapProtocolConfigurationFormComponent_ion_item_3_ion_select_option_4_Template, 2, 2, "ion-select-option", 6);
    ɵɵpipe(5, "enum");
    ɵɵelementEnd();
    ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = ɵɵnextContext();
    ɵɵadvance(3);
    ɵɵproperty("formControlName", "stopBits");
    ɵɵadvance(1);
    ɵɵproperty("ngForOf", ɵɵpipeBind1(5, 2, ctx_r2.SerialSettings.StopBits));
} }
function TapProtocolConfigurationFormComponent_ion_item_4_ion_select_option_4_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-select-option", 7);
    ɵɵtext(1);
    ɵɵelementEnd();
} if (rf & 2) {
    const option_r18 = ctx.$implicit;
    ɵɵproperty("value", option_r18.key);
    ɵɵadvance(1);
    ɵɵtextInterpolate1(" ", option_r18.value, " ");
} }
function TapProtocolConfigurationFormComponent_ion_item_4_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-item");
    ɵɵelementStart(1, "ion-label");
    ɵɵtext(2, "Parity");
    ɵɵelementEnd();
    ɵɵelementStart(3, "ion-select", 8);
    ɵɵtemplate(4, TapProtocolConfigurationFormComponent_ion_item_4_ion_select_option_4_Template, 2, 2, "ion-select-option", 6);
    ɵɵpipe(5, "enum");
    ɵɵelementEnd();
    ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = ɵɵnextContext();
    ɵɵadvance(3);
    ɵɵproperty("formControlName", "bitParity");
    ɵɵadvance(1);
    ɵɵproperty("ngForOf", ɵɵpipeBind1(5, 2, ctx_r3.SerialSettings.BitParity));
} }
function TapProtocolConfigurationFormComponent_ion_item_5_ion_select_option_4_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-select-option", 7);
    ɵɵtext(1);
    ɵɵelementEnd();
} if (rf & 2) {
    const option_r20 = ctx.$implicit;
    ɵɵproperty("value", option_r20.key);
    ɵɵadvance(1);
    ɵɵtextInterpolate1(" ", option_r20.value, " ");
} }
function TapProtocolConfigurationFormComponent_ion_item_5_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-item");
    ɵɵelementStart(1, "ion-label");
    ɵɵtext(2, "Hardware flow control");
    ɵɵelementEnd();
    ɵɵelementStart(3, "ion-select", 8);
    ɵɵtemplate(4, TapProtocolConfigurationFormComponent_ion_item_5_ion_select_option_4_Template, 2, 2, "ion-select-option", 6);
    ɵɵpipe(5, "enum");
    ɵɵelementEnd();
    ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = ɵɵnextContext();
    ɵɵadvance(3);
    ɵɵproperty("formControlName", "hardwareFlowControl");
    ɵɵadvance(1);
    ɵɵproperty("ngForOf", ɵɵpipeBind1(5, 2, ctx_r4.SerialSettings.HardwareFlowControl));
} }
function TapProtocolConfigurationFormComponent_ion_item_6_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-item");
    ɵɵelementStart(1, "ion-label");
    ɵɵtext(2, "Slave number");
    ɵɵelementEnd();
    ɵɵelement(3, "ion-input", 4);
    ɵɵelementEnd();
} if (rf & 2) {
    ɵɵadvance(3);
    ɵɵproperty("formControlName", "slave");
} }
function TapProtocolConfigurationFormComponent_ion_item_7_ion_select_option_4_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-select-option", 7);
    ɵɵtext(1);
    ɵɵelementEnd();
} if (rf & 2) {
    const option_r22 = ctx.$implicit;
    ɵɵproperty("value", option_r22.key);
    ɵɵadvance(1);
    ɵɵtextInterpolate1(" ", option_r22.value, "");
} }
function TapProtocolConfigurationFormComponent_ion_item_7_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-item");
    ɵɵelementStart(1, "ion-label");
    ɵɵtext(2, "Physical port");
    ɵɵelementEnd();
    ɵɵelementStart(3, "ion-select", 8);
    ɵɵtemplate(4, TapProtocolConfigurationFormComponent_ion_item_7_ion_select_option_4_Template, 2, 2, "ion-select-option", 6);
    ɵɵpipe(5, "enum");
    ɵɵelementEnd();
    ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r6 = ɵɵnextContext();
    ɵɵadvance(3);
    ɵɵproperty("formControlName", "physicalPort");
    ɵɵadvance(1);
    ɵɵproperty("ngForOf", ɵɵpipeBind1(5, 2, ctx_r6.SerialSettings.PhysicalPort));
} }
function TapProtocolConfigurationFormComponent_ion_item_8_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-item");
    ɵɵelementStart(1, "ion-label");
    ɵɵtext(2, "Timeout");
    ɵɵelementEnd();
    ɵɵelement(3, "ion-input", 4);
    ɵɵelementEnd();
} if (rf & 2) {
    ɵɵadvance(3);
    ɵɵproperty("formControlName", "timeout");
} }
function TapProtocolConfigurationFormComponent_ion_item_9_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "ion-item");
    ɵɵelementStart(1, "ion-label");
    ɵɵtext(2, "Offset first register");
    ɵɵelementEnd();
    ɵɵelementStart(3, "ion-select", 8);
    ɵɵelementStart(4, "ion-select-option", 7);
    ɵɵtext(5, "No");
    ɵɵelementEnd();
    ɵɵelementStart(6, "ion-select-option", 7);
    ɵɵtext(7, "Yes");
    ɵɵelementEnd();
    ɵɵelementEnd();
    ɵɵelementEnd();
} if (rf & 2) {
    ɵɵadvance(3);
    ɵɵproperty("formControlName", "offsetFirstRegister");
    ɵɵadvance(1);
    ɵɵproperty("value", false);
    ɵɵadvance(2);
    ɵɵproperty("value", true);
} }
class TapProtocolConfigurationFormComponent {
    constructor(formBuilder, protocolConfigurationService) {
        this.protocolConfigurationService = protocolConfigurationService;
        this.customBaudRate = false;
        this.baudRates = [
            300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 187500, 230400,
            460800, 921600,
        ];
        this.fields = ALL_SETTINGS_FIELDS;
        this.valueChanges = new EventEmitter();
        // TODO add validators
        const formConfig = {
            baudRate: [187500, [Validators.required, Validators.min(0)]],
            bitParity: [''],
            dataBits: [''],
            hardwareFlowControl: [''],
            handshakeDelimiter: [SerialSettings.HandshakeDelimiter.NONE],
            physicalPort: [''],
            stopBits: [''],
            offsetFirstRegister: [''],
            // identification: [''],
            // ledStatus: [''],
            slave: [''],
            timeout: [''],
        };
        this.form = formBuilder.group(formConfig);
    }
    set values(v) {
        if (v) {
            this.updateFormValue(v);
        }
    }
    hasField(field) {
        return this.fields.indexOf(field) >= 0;
    }
    get SerialSettings() {
        return SerialSettings;
    }
    updateFormValue(settings) {
        const newValues = Object.assign(Object.assign({}, settings.modbus), settings.serial);
        for (const key in newValues) {
            const field = this.form.get(key);
            if (field) {
                field.setValue(newValues[key], {
                    emitEvent: false,
                });
            }
        }
    }
    ngOnInit() {
        // debug(TAG, 'ngOnInit');
        const settings = this.protocolConfigurationService.pendingSettings;
        this.updateFormValue(settings);
        this.form.valueChanges.subscribe((newValue) => {
            // debug(TAG, 'Protocol configuration changed:', newValue);
            const netProtocolConfig = {
                modbus: {
                    offsetFirstRegister: newValue.offsetFirstRegister,
                    slave: newValue.slave,
                },
                serial: {
                    baudRate: newValue.baudRate,
                    bitParity: newValue.bitParity,
                    dataBits: newValue.dataBits,
                    handshakeDelimiter: newValue.handshakeDelimiter,
                    hardwareFlowControl: newValue.hardwareFlowControl,
                    physicalPort: newValue.physicalPort,
                    stopBits: newValue.stopBits,
                    timeout: newValue.timeout,
                },
            };
            this.valueChanges.emit(netProtocolConfig);
            this.protocolConfigurationService.pendingSettings = netProtocolConfig;
        });
        this.protocolConfigurationService.pendingSettings$.subscribe((newSettings) => {
            // debug(TAG, 'Refreshing form value', newSettings);
            if (this.baudRates.indexOf(newSettings.serial.baudRate) === -1) {
                this.customBaudRate = true;
            }
            this.updateFormValue(newSettings);
        });
    }
}
/** @nocollapse */ TapProtocolConfigurationFormComponent.ɵfac = function TapProtocolConfigurationFormComponent_Factory(t) { return new (t || TapProtocolConfigurationFormComponent)(ɵɵdirectiveInject(FormBuilder), ɵɵdirectiveInject(ProtocolConfigurationService)); };
/** @nocollapse */ TapProtocolConfigurationFormComponent.ɵcmp = ɵɵdefineComponent({ type: TapProtocolConfigurationFormComponent, selectors: [["tap-protocol-configuration-form"]], inputs: { customBaudRate: "customBaudRate", baudRates: "baudRates", fields: "fields", values: "values" }, outputs: { valueChanges: "valueChanges" }, decls: 10, vars: 10, consts: [[3, "formGroup"], [4, "ngIf"], ["slot", "end", "type", "number", 3, "formControlName", 4, "ngIf"], ["slot", "end", 3, "formControlName", 4, "ngIf"], ["slot", "end", "type", "number", 3, "formControlName"], ["slot", "end", 3, "formControlName"], [3, "value", 4, "ngFor", "ngForOf"], [3, "value"], [3, "formControlName"]], template: function TapProtocolConfigurationFormComponent_Template(rf, ctx) { if (rf & 1) {
        ɵɵelementStart(0, "form", 0);
        ɵɵtemplate(1, TapProtocolConfigurationFormComponent_ion_item_1_Template, 5, 2, "ion-item", 1);
        ɵɵtemplate(2, TapProtocolConfigurationFormComponent_ion_item_2_Template, 6, 4, "ion-item", 1);
        ɵɵtemplate(3, TapProtocolConfigurationFormComponent_ion_item_3_Template, 6, 4, "ion-item", 1);
        ɵɵtemplate(4, TapProtocolConfigurationFormComponent_ion_item_4_Template, 6, 4, "ion-item", 1);
        ɵɵtemplate(5, TapProtocolConfigurationFormComponent_ion_item_5_Template, 6, 4, "ion-item", 1);
        ɵɵtemplate(6, TapProtocolConfigurationFormComponent_ion_item_6_Template, 4, 1, "ion-item", 1);
        ɵɵtemplate(7, TapProtocolConfigurationFormComponent_ion_item_7_Template, 6, 4, "ion-item", 1);
        ɵɵtemplate(8, TapProtocolConfigurationFormComponent_ion_item_8_Template, 4, 1, "ion-item", 1);
        ɵɵtemplate(9, TapProtocolConfigurationFormComponent_ion_item_9_Template, 8, 3, "ion-item", 1);
        ɵɵelementEnd();
    } if (rf & 2) {
        ɵɵproperty("formGroup", ctx.form);
        ɵɵadvance(1);
        ɵɵproperty("ngIf", ctx.hasField("baudRate"));
        ɵɵadvance(1);
        ɵɵproperty("ngIf", ctx.hasField("dataBits"));
        ɵɵadvance(1);
        ɵɵproperty("ngIf", ctx.hasField("stopBits"));
        ɵɵadvance(1);
        ɵɵproperty("ngIf", ctx.hasField("bitParity"));
        ɵɵadvance(1);
        ɵɵproperty("ngIf", ctx.hasField("hardwareFlowControl"));
        ɵɵadvance(1);
        ɵɵproperty("ngIf", ctx.hasField("slave"));
        ɵɵadvance(1);
        ɵɵproperty("ngIf", ctx.hasField("physicalPort"));
        ɵɵadvance(1);
        ɵɵproperty("ngIf", ctx.hasField("timeout"));
        ɵɵadvance(1);
        ɵɵproperty("ngIf", ctx.hasField("offsetFirstRegister"));
    } }, directives: [ɵangular_packages_forms_forms_ba, NgControlStatusGroup, FormGroupDirective, NgIf, IonItem, IonLabel, IonInput, NumericValueAccessor, NgControlStatus, FormControlName, IonSelect, SelectValueAccessor, NgForOf, IonSelectOption], pipes: [EnumPipe, TrimPipe], styles: ["ion-input[_ngcontent-%COMP%]{text-align:right}"] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵsetClassMetadata(TapProtocolConfigurationFormComponent, [{
        type: Component,
        args: [{
                selector: 'tap-protocol-configuration-form',
                templateUrl: './tap-protocol-configuration-form.component.html',
                styleUrls: ['./tap-protocol-configuration-form.component.scss'],
            }]
    }], function () { return [{ type: FormBuilder }, { type: ProtocolConfigurationService }]; }, { customBaudRate: [{
            type: Input
        }], baudRates: [{
            type: Input
        }], fields: [{
            type: Input
        }], values: [{
            type: Input
        }], valueChanges: [{
            type: Output
        }] }); })();

class TapProtocolConfigurationModule {
}
/** @nocollapse */ TapProtocolConfigurationModule.ɵfac = function TapProtocolConfigurationModule_Factory(t) { return new (t || TapProtocolConfigurationModule)(); };
/** @nocollapse */ TapProtocolConfigurationModule.ɵmod = ɵɵdefineNgModule({ type: TapProtocolConfigurationModule });
/** @nocollapse */ TapProtocolConfigurationModule.ɵinj = ɵɵdefineInjector({ providers: [ProtocolConfigurationService], imports: [[CommonModule, LibCommonModule, FormsModule, ReactiveFormsModule]] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(TapProtocolConfigurationModule, { declarations: [TapProtocolConfigurationFormComponent], imports: [CommonModule, LibCommonModule, FormsModule, ReactiveFormsModule], exports: [TapProtocolConfigurationFormComponent] }); })();
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵsetClassMetadata(TapProtocolConfigurationModule, [{
        type: NgModule,
        args: [{
                declarations: [TapProtocolConfigurationFormComponent],
                exports: [TapProtocolConfigurationFormComponent],
                imports: [CommonModule, LibCommonModule, FormsModule, ReactiveFormsModule],
                providers: [ProtocolConfigurationService],
            }]
    }], null, null); })();

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

export { ALL_SETTINGS_FIELDS, MODBUS_SETTINGS_FIELDS, ProtocolConfigurationError, ProtocolConfigurationService, SERIAL_SETTINGS_FIELDS, TAPNPASS_SETTINGS_FIELDS, TapProtocolConfigurationFormComponent, TapProtocolConfigurationModule };
//# sourceMappingURL=iotize-ionic-target-common.js.map
