(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["netocean-config-service-time-cgi-netocean-config-service-time-cgi-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.component.html":
/*!***********************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.component.html ***!
  \***********************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"w-100-p\">\n  <div class=\"w-100-p headerSection\">\n      <div class=\"w-100-p mt-5 p-grid py-5 pl-16 p-align-center p-justify-between\">\n      <div class=\"p-grid p-align-center py-5\">\n          <span class=\"font-16 text-uppercase font-weight-700\">service time settings</span>\n          <span class=\"mx-5\">\n            <app-help  [helpFileName]=\"'serviceTimeDelayGlobal'\"  [helpTitle]=\"'Service Time Delay Global'\" [helpFolder]=\"'netOcean'\"></app-help>\n          </span>\n      </div>\n      </div>\n  </div>\n</div>\n<div class=\"my-16 p-16  border-3 border-all\">\n    <h3 class=\"font-weight-600 my-12 text-uppercase\">Service Time Delay</h3> \n    <div class=\"p-grid p-align-center my-10\">\n        <p-radioButton  label=\"No Service Time\" (click)=\"catchRadioEve(0)\"\n          (keypress)=\"isNumCheck($event)\" [(ngModel)]=\"radio_val\" name=\"val1\" value=\"noServiceTime\"></p-radioButton>\n      </div>\n      <div class=\"p-grid p-align-center my-10\">\n        <p-radioButton  label=\" Exponential Random service time with median of\"\n          (click)=\"catchRadioEve(1)\" (keypress)=\"isNumCheck($event)\" [(ngModel)]=\"radio_val\"\n          name=\"val1\" value=\"randomServiceT\"></p-radioButton>\n          <div class=\"ui-inputgroup mx-5\">\n        <input [disabled]=\"global1\" size=\"5\" type=\"text\" name=\"directIndex\" (keypress)=\"isNumCheck($event)\" (focusout)=\"validateOneHourTime(exp_ran_service_time,'exp_ran_service_time')\"\n          [(ngModel)]=\"exp_ran_service_time\" (input)=\"change($event)\" pInputText value=\"0\" />\n          <span class=\"ui-inputgroup-addon px-5\">ms</span>\n        </div>\n        <div class=\"p-grid p-align-center mx-5 btn-icon\">\n             Note: For exponential random distribution, median is roughly around ¼th of mean\n        </div>\n     </div>\n\n     <div class=\"p-grid p-align-center my-10\">\n        <p-radioButton  label=\" Constant service time of\" (click)=\"catchRadioEve(2)\"\n          (keypress)=\"isNumCheck($event)\" [(ngModel)]=\"radio_val\" name=\"val1\"\n          value=\"constantServicet\"></p-radioButton>\n          <div class=\"ui-inputgroup mx-5\">\n        <input type=\"text\" size=\"5\" (input)=\"change($event)\" (keypress)=\"isNumCheck($event)\" [(ngModel)]=\"constServTime\" pInputText value=\"0\" (focusout)=\"validateOneHourTime(constServTime,'constServTime')\"\n          [disabled]=\"global2\"/>\n          <span class=\"ui-inputgroup-addon px-5\">ms</span>\n          </div>\n    </div>\n\n    <div class=\"p-grid p-align-center my-10\">\n        <p-radioButton (click)=\"catchRadioEve(3)\" (keypress)=\"isNumCheck($event)\" [(ngModel)]=\"radio_val\"\n          name=\"val1\" value=\"randomUniform\"  label=\"Random (Uniform distribution) service time from\"></p-radioButton>\n          <!-- need to discuss limit of from and to -->\n        <input type=\"text\" class=\"mx-5\" size=\"5\" (input)=\"change($event)\" pInputText (keypress)=\"isNumCheck($event)\" [(ngModel)]=\"ranServiceFrom\" (focusout)=\"validateOneHourTime(ranServiceFrom,'ranServiceFrom')\"\n          [disabled]=\"global3\" /> to\n          <div class=\"ui-inputgroup mx-5\">\n        <input type=\"text\" size=\"5\" pInputText (keypress)=\"isNumCheck($event)\" (input)=\"change($event)\" [(ngModel)]=\"ranServiceTo\" (focusout)=\"validateOneHourTime(ranServiceTo,'ranServiceTo')\"\n          [disabled]=\"global4\" />\n          <span class=\"ui-inputgroup-addon px-5\">ms</span>\n          </div>\n     </div>\n</div>\n  <div class=\"my-16 p-16 border-3 border-all\">\n    <h3 class=\"font-weight-600 my-12 text-uppercase\">Tour Application Settings</h3>\n    <div class=\"w-100-p p-grid p-align-center\">\n        <div class=\"  p-col-fixed\">Application Url:</div>\n        <div class=\"ui-g-2\">\n            <p-dropdown dropdownIcon=\"icons8 icons8-expand-arrow\" [style]=\"{'min-width':'100%'}\" [options]=\"CGIURL\" [(ngModel)]=\"selectedCGIURL\" appendTo=\"body\">\n            </p-dropdown>\n        </div>\n        <div class=\"ui-g-1 text-right\">Mode:</div>\n        <div class=\"ui-g-2\">\n            <p-dropdown dropdownIcon=\"icons8 icons8-expand-arrow\" [style]=\"{'min-width':'100%'}\" [(ngModel)]=\"mode\" [options]=\"Mode\" (onChange)=\"modeselect()\"\n            appendTo=\"body\"></p-dropdown>\n        </div>\n        <div *ngIf=\"mode == '1'\" class=\"p-col-fixed ml-20 text-right\">Median Time:</div>\n        <div *ngIf=\"mode == '2'\" class=\"p-col-fixed ml-20 text-right\">Time:</div>\n        <div *ngIf=\"mode == '3'\" class=\"p-col-fixed ml-20 text-right\">Average Time:</div>\n        <div *ngIf=\"mode != '0'\" class=\"ui-g-1\">\n            <div class=\"ui-inputgroup\">\n            <input [disabled]=\"mode == '0'\" type=\"text\" (input)=\"change($event)\" (focusout)=\"validateOneHourTime(averagetime,'averagetime')\"\n            [(ngModel)]=\"averagetime\" (keypress)=\"isNumCheck($event)\" pInputText class=\"w-100-p\">\n            <span class=\"ui-inputgroup-addon px-5\">ms</span>\n            </div>\n        </div>\n        <div *ngIf=\"mode == '3'\" class=\"p-col-fixed ml-20 text-right\">Maximum Time:</div>\n        <div *ngIf=\"mode == '3'\" class=\"ui-g-1\">\n            <div class=\"ui-inputgroup\">\n            <input [disabled]=\"mode != '3'\" type=\"text\" (input)=\"change($event)\" (focusout)=\"validateOneHourTime(maxtime,'maxtime')\"\n            [(ngModel)]=\"maxtime\" (keypress)=\"isNumCheck($event)\" pInputText class=\"w-100-p\">\n            <span class=\"ui-inputgroup-addon px-5\">ms</span>\n            </div>\n        </div>\n        <button *ngIf='!selectionMode' pButton [disabled]=\"!_commonService.$globalConfigPermission\" type=\"button\" class=\"btn-icon\" icon=\"icons8 icons8-add\"  pTooltip=\"Add\"\n        (click)=\"addCgi()\"></button>\n        <button *ngIf='selectionMode' pButton [disabled]=\"!_commonService.$globalConfigPermission\" type=\"button\" class=\"btn-icon\" icon=\"las-edit\"  pTooltip=\"Update\"\n        (click)=\"update()\"></button>\n    </div>\n    <div class=\"w-100-p my-8\">\n      <cav-table [value]=\"serviceCgiFields\" [headerRelativePath]=\"headerTablePath\" \n        [scrollable]=\"true\" [responsive] =\"true\" \n        scrollHeight=\"60px\" (clickButtonEvent)=\"clickButtonEvent($event)\">\n      </cav-table>\n    </div>\n  </div>\n    <div class=\"p-grid w-100-p p-justify-end my-5\">\n        <button class=\"ui-button-rounded mr-16\" pButton type=\"button\" label=\"Save\" [disabled]=\"!_commonService.$globalConfigPermission\"\n          (click)=\"setSvcTimeCGIFields('')\" [pTooltip]=\"_commonService.saveTooltipConfig\"></button>\n        <button pButton type=\"button\" label=\"Save & Activate\" [disabled]=\"!_commonService.$globalConfigPermission\" (click)=\"setSvcTimeCGIFields('activate')\"\n        class=\"btn-primary-outline  mr-12\" [pTooltip]=\"_commonService.saveActivateTooltipConfig\"></button>\n      </div>\n      <div class=\"\" *ngIf=\"isEnabledSpinner\">\n        <p-progressBar mode=\"indeterminate\"\n            [style]=\"{'position':'fixed','top':'0px','left':'0px','right':'0px','height': '4px'}\"></p-progressBar>\n        <div class=\"loader-container\"><i class=\"pi pi-spin pi-spinner\"\n                style=\"position: fixed;font-size: 35px;top: 0px;left: 0px;color: darkorange;animation-duration: .6s;\"></i>\n        </div>\n      </div>\n    \n    <!-- <span><p-checkbox label=\"Service Time\" (onChange)=\"serviceTime()\" [(ngModel)]=\"httpService\" [binary]=\"true\"></p-checkbox></span> -->\n <!-- <span style=\"float: right;position: relative;margin-top: -3px;\">\n            <button pButton type=\"button\" label=\"Save\" [disabled]=\"!_commonService.$globalConfigPermission\"\n              (click)=\"setLoggingOperationFields()\"></button>\n          </span> -->\n            <!-- <span class=\"ui-g-12\">\n            <p-checkbox (change)=\"serviceTime()\" [(ngModel)]=\"httpService\">Service Time</p-checkbox>\n          </span> -->\n\n \n\n\n<!-- <div align=\"center\">\n  <button pButton [disabled]=\"!_commonService.$globalConfigPermission\" type=\"button\" label=\"Add\"\n    (click)=\"addCgi()\"></button>\n  <button pButton [disabled]=\"\n      selectedRows.length != 1 || !_commonService.$globalConfigPermission\n    \" type=\"button\" label=\"Update\" (click)=\"updateCgi()\"></button>\n  <button pButton [disabled]=\"\n      selectedRows.length == 0 || !_commonService.$globalConfigPermission\n    \" type=\"button\" label=\"Delete\" (click)=\"deleteCgi()\"></button>\n</div> -->\n\n<!--alert box code........-->\n<p-dialog header=\"Alert\" [(visible)]=\"display\" [modal]=\"true\" [style]=\"{'width':'400px'}\">\n  <p class=\"my-20\">{{ msg }}</p>\n  <p-footer class=\"p-grid p-justify-end\">\n      <button type=\"button\" class=\"ui-button-rounded px-20\" pButton (click)=\"display = false\" label=\"Ok\"></button>\n  </p-footer>\n</p-dialog>\n<p-confirmDialog class=\"confirmdialog\" header=\"Confirmation\" acceptButtonStyleClass=\"ui-button-rounded px-10\"\n    rejectButtonStyleClass=\"ui-button-rounded ui-button-secondary px-10 mx-6\" acceptIcon=\"null\" rejectIcon=\"null\"\n    acceptLabel=\"Yes\" rejectLabel=\"No\"></p-confirmDialog>\n<!-- <p-growl [value]=\"msgs\"></p-growl> -->\n<p-toast key=\"msgs\"></p-toast>\n");

/***/ }),

/***/ "./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.component.scss":
/*!*********************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.component.scss ***!
  \*********************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("app-netocean-manage-services .domain-row {\n  background-color: var(--background_color_12);\n  border-style: solid;\n  border-width: 1px;\n  border-radius: 2px;\n}\napp-netocean-manage-services .ui-splitbutton {\n  border-radius: 15px !important;\n  overflow: hidden;\n}\napp-netocean-config-service-time-cgi .table-cap .ui-table .ui-table-caption {\n  padding: 0 !important;\n  background-color: transparent !important;\n}");

/***/ }),

/***/ "./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.component.ts":
/*!*******************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.component.ts ***!
  \*******************************************************************************************************************************/
/*! exports provided: NetoceanConfigServiceTimeCgiComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NetoceanConfigServiceTimeCgiComponent", function() { return NetoceanConfigServiceTimeCgiComponent; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var _services_netocean_common_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../services/netocean-common.service */ "./src/app/pages/home/netocean/services/netocean-common.service.ts");
/* harmony import */ var _services_netocean_configuration_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../services/netocean-configuration.service */ "./src/app/pages/home/netocean/services/netocean-configuration.service.ts");
/* harmony import */ var primeng_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! primeng/api */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-api.js");
/* harmony import */ var _services_manage_services_info_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../services/manage-services-info.service */ "./src/app/pages/home/netocean/services/manage-services-info.service.ts");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");







let NetoceanConfigServiceTimeCgiComponent = class NetoceanConfigServiceTimeCgiComponent {
    constructor(
    // private log: Logger,
    _commonService, _router, _config, _manageService, messageService) {
        this._commonService = _commonService;
        this._router = _router;
        this._config = _config;
        this._manageService = _manageService;
        this.messageService = messageService;
        this.display = false;
        this.serviceCgiFields = [];
        this.selectedCGIURL = '--Select CGI URL--';
        this.cgiurl = '';
        this.mode = '0';
        this.averagetime = '0';
        this.avg_able = true;
        this.maxtime = '0';
        this.max_able = true;
        this.msg = '';
        this.RegExVal = false;
        this.selectedRows = [];
        this.msgs = [];
        this.isRtc = 'false';
        /** Properties Portion for Config-Service-Time */
        // httpService :boolean = false;
        this.selectradioBox = '0';
        this.noServiceTime = false;
        this.exp_ran_service_time = '0';
        this.randomServiceT = false;
        this.randomUniform = false;
        this.constantServicet = false;
        this.ranServiceFrom = '0';
        this.ranServiceTo = '0';
        this.constServTime = '0';
        // service = true;
        this.radio_val = 'noServiceTime';
        this.global1 = true;
        this.global2 = true;
        this.global3 = true;
        this.global4 = true;
        this.inputERST = true;
        this.inputCST = true;
        this.inputRST = true;
        this.isEnabledSpinner = false;
        this.unsavedChanges = false;
        this.selectionMode = false;
        this.headerTablePath = "netocean/configuration/application-service.json";
        /**check a rtc mode */
        if (this._commonService.$mode == 'RTC Mode') {
            this.isRtc = 'true';
        }
        this.CGIURL = [];
        this.CGIURL.push({ label: '--Select Application URL--', value: '--Select CGI URL--' });
        this.CGIURL.push({ label: 'login', value: 'login' });
        this.CGIURL.push({ label: 'testpg', value: 'testpg' });
        this.CGIURL.push({ label: 'welcome', value: 'welcome' });
        this.CGIURL.push({ label: 'home', value: 'home' });
        this.CGIURL.push({ label: 'reservation', value: 'reservation' });
        this.CGIURL.push({ label: 'findflight', value: 'findflight' });
        this.CGIURL.push({ label: 'all', value: 'ALL' });
        this.Mode = [];
        this.Mode.push({ label: 'No Service Time', value: '0' });
        this.Mode.push({ label: 'Exponential Random', value: '1' });
        this.Mode.push({ label: 'Constant', value: '2' });
        this.Mode.push({ label: 'Uniform Distribution', value: '3' });
    }
    canDeactivate() {
        if (this.unsavedChanges) {
            const result = confirm('Are you sure you want to navigate? Any unsaved changes will be lost.');
            console.log(result);
            if (!result) {
                this._commonService.confirmCommandSubject.next(this._router.url);
            }
            return result;
        }
        else {
            return true;
        }
    }
    change(event) {
        this.unsavedChanges = true;
    }
    validateOneHourTime(inputTime, inputType) {
        switch (inputType) {
            case "averagetime":
                return this.averagetime = this._commonService.validateOneHourTimeInMS(inputTime);
            case "maxtime":
                return this.maxtime = this._commonService.validateOneHourTimeInMS(inputTime);
            case "exp_ran_service_time":
                return this.exp_ran_service_time = this._commonService.validateOneHourTimeInMS(inputTime);
            case "constServTime":
                return this.constServTime = this._commonService.validateOneHourTimeInMS(inputTime);
            case "ranServiceFrom":
                return this.ranServiceFrom = this._commonService.validateOneHourTimeInMS(inputTime);
            case "ranServiceTo":
                return this.ranServiceTo = this._commonService.validateOneHourTimeInMS(inputTime);
        }
    }
    ngOnInit() {
        this._config.loading = true;
        this._config.getGlobalhttpSetting(this.isRtc);
        this.getServiceOperationStatus();
        this.getHPDStatus();
        this._config.getServiceTimeCgiFields(this.isRtc);
    }
    modeselect() {
        try {
            //this.log.debug('');
            if (this._commonService.checkEmpty(this.mode) === true) {
                this.max_able = true;
                this.avg_able = true;
                if (this.mode === '3') {
                    this.max_able = false;
                    this.avg_able = false;
                }
                if (this.mode === '2' || this.mode === '1') {
                    this.max_able = true;
                    this.avg_able = false;
                }
            }
            else if (this._commonService.checkEmpty(this.mode) === false || this.mode === '0') {
                this.avg_able = true;
                this.max_able = true;
            }
        }
        catch (error) {
            console.error('error in config-service-time-cgi modelselect() ->', error);
        }
    }
    /**add a cgi fields */
    addCgi() {
        try {
            // this.averagetime = this.averagetime.replace(/^0+/, '');
            // this.maxtime = this.maxtime.replace(/^0+/, '');
            if (this.selectedCGIURL == '--Select CGI URL--') {
                this.showDialog('Please select an Application Url');
                return;
            }
            if (this.mode != '0' && (this.averagetime == "0" || this.averagetime == "")) {
                this.showDialog("Average time can't be zero or blank");
                return;
            }
            if (this.mode == '3' && this.maxtime == "") {
                this.showDialog("Maximum time can't be blank");
                return;
            }
            if (this.mode == '3' && (parseInt(this.averagetime) >= parseInt(this.maxtime))) {
                this.showDialog('Maximum time should be greater than average time');
                return;
            }
            this._config.addUpdateServiceTimeCgiFields(this.selectedCGIURL, this.mode, this.averagetime, this.maxtime, 'add', '0', this.isRtc);
            this.selectedCGIURL = '--Select CGI URL--';
            this.mode = '0';
            this.averagetime = '0';
            this.maxtime = '0';
            this.unsavedChanges = false;
        }
        catch (error) {
            console.error('error in config-service-time-cgi addCgi() ->', error);
        }
    }
    /**update a cgi fields */
    updateCgi() {
        try {
            if (this.selectedRows.length === 0) {
                this.showDialog('No record selected. Please select one record and try again.');
                return false;
            }
            else if (!this._commonService.$globalConfigPermission) {
                this.showDialog('User does not have permission to perform this action');
                return false;
            }
            if (this.serviceCgiFields.length === 0) {
                this.showDialog('No record is to update in the table');
                return false;
            }
            if (this.selectedRows.length > 1) {
                this.showDialog('Please select a Single row');
                return false;
            }
            this.selectedCGIURL = this.selectedRows[0].arrCGIURL;
            this.mode = this.selectedRows[0].arrmode;
            this.averagetime = this.selectedRows[0].arrAverageTime;
            this.maxtime = this.selectedRows[0].arrMaximumTime;
            this.selectionMode = true;
        }
        catch (error) {
            console.error('error in config-service-time-cgi updateCgi() ->', error);
        }
    }
    update() {
        try {
            if (this.selectedRows.length == 0) {
                this.messageService.add({ key: 'msgs', severity: 'error', summary: 'Error', detail: 'Please select a row for Update' });
            }
            if (this.selectedCGIURL == '--Select CGI URL--') {
                this.showDialog('Please select an Application Url');
                return;
            }
            if (this.mode != '0' && (this.averagetime == "0" || this.averagetime == "")) {
                this.showDialog("Average time can't be zero or blank");
                return;
            }
            if (this.mode == '3' && this.maxtime == "") {
                this.showDialog("Maximum time can't be blank");
                return;
            }
            if (this.mode == '3' && (parseInt(this.averagetime) >= parseInt(this.maxtime))) {
                this.showDialog('Maximum time should be greater than average time');
                return;
            }
            this._config.addUpdateServiceTimeCgiFields(this.selectedCGIURL, this.mode, this.averagetime, this.maxtime, 'update', this.selectedRows[0]['index'], this.isRtc);
            this.selectedCGIURL = '--Select CGI URL--';
            this.mode = '0';
            this.averagetime = '0';
            this.maxtime = '0';
            this.selectionMode = false;
            this.unsavedChanges = false;
        }
        catch (error) {
            console.error("Error in update", error);
        }
    }
    showDialog(message) {
        try {
            this.msg = '';
            this.msg = message;
            this.display = true;
        }
        catch (error) {
            console.error('error in config-service-time-cgi showDialog() ->', error);
        }
    }
    /**delete a cgi fields */
    deleteCgi() {
        try {
            if (this.selectedRows.length === 0) {
                this.showDialog('No record selected. Please select one record and try again.');
                return false;
            }
            else if (!this._commonService.$globalConfigPermission) {
                this.showDialog('User does not have permission to perform this action');
                return false;
            }
            if (this.serviceCgiFields.length === 0) {
                this.showDialog('No record is to delete in the table');
                return false;
            }
            let row = this.selectedRows[0]['index'];
            for (let i = 1; i < this.selectedRows.length; i++) {
                row = row + '@@' + this.selectedRows[i]['index'];
            }
            this._config.deleteServiceTimeCgiFields(row, this.isRtc);
        }
        catch (error) {
            console.error('error in config-service-time-cgi deleteCgi() ->', error);
        }
    }
    // Function to display the regular expression information
    Regex() {
        try {
            this.RegExVal = true;
        }
        catch (error) {
            console.error('error in Regex() ->', error);
        }
    }
    /* Function to check the value in a input box is numbery or not
      If number returns true, else false and does not allow the non numeric value to enter the input box;
      (parseInt($event.key) returns NAN (NOT A NUMBER) if alphabet added , else returns number..
    */
    isNumCheck($event) {
        try {
            if (parseInt($event.key) < 9 || parseInt($event.key) > 0 || parseInt($event.keyCode) >= 48 && parseInt($event.keyCode) <= 57) {
                return true;
            }
            else {
                return false;
            }
        }
        catch (error) {
            console.error('error in config-service-time-cgi isNumcheck ->', error);
        }
    }
    /**get a operation status fields */
    getServiceOperationStatus() {
        try {
            //this.log.debug('getting a status of service time cgi fields');
            this.activeSubscriber = this._config.configProvider$.subscribe(result => {
                this.messageService.clear();
                if (this._config.action == 'GETSERVICETIMECGIFIELDS') {
                    this._config.loading = false;
                    this.selectedRows = [];
                    this.serviceCgiFields = [];
                    let data = [];
                    data = result;
                    for (let key in data) {
                        if (result.hasOwnProperty(key)) {
                            this.serviceCgiFields = this.serviceCgiFields.concat({ arrCGIURL: data[key]['arrCGIURL'], arrmode: data[key]['arrmode'],
                                arrAverageTime: data[key]['arrAverageTime'], arrMaximumTime: data[key]['arrMaximumTime'],
                                index: this.serviceCgiFields.length });
                        }
                    }
                }
                if (this._config.action == 'ADDUpdateSERVICETIMECGI') {
                    this.messageService.add({ key: 'msgs', severity: 'success', summary: 'Message', detail: 'Service time application saved successfully' });
                    // if (this._commonService.$mode == 'RTC Mode')
                    //    this.messageService.addAll([{key:'msgs', severity: 'success', summary: 'Message', detail: 'Service time cgi saved successfully' },
                    //     {key:'msgs', severity: 'info', summary: 'Apply RTC', detail: this._commonService.definedMessageForRTC }]);
                    this._config.getServiceTimeCgiFields(this.isRtc);
                }
                if (this._config.action == 'DELETESERVICETIMECGI') {
                    this.messageService.add({ key: 'msgs', severity: 'success', summary: 'Message', detail: 'Service time application deleted successfully' });
                    this._config.getServiceTimeCgiFields(this.isRtc);
                }
                if (this._config.action == 'GETGLOBALHTTPSETTINGS') {
                    this.fillConfigData(result);
                }
                if (this._config.action == 'SETSERVICETIMEFIELDS') {
                    this._config.loading = false;
                    if (result['svcTime'] == true) {
                        this.messageService.add({ key: 'msgs', severity: 'success', summary: 'Saved Successfully', detail: 'Configuration Service Time Settings Saved Successfully' });
                        if (this.isRestart == "activate") {
                            this.isEnabledSpinner = true;
                            this._manageService.activateHPD();
                        }
                    }
                    else {
                        this.messageService.add({ key: 'msgs', severity: 'error', summary: 'Error', detail: 'Error in Saving Configuration Service Time Settings' });
                    }
                }
            });
        }
        catch (error) {
            console.error('error in getting git fields', error);
        }
    }
    /** Coding Portion for Config-Service-Time */
    // serviceTime() {
    //   if (this.httpService == true) {
    //     this.service = false;
    //     this.radio_val = 'noServiceTime';
    //   } else {
    //     this.service = true;
    //     this.exp_ran_service_time = '0';
    //     this.constServTime = '0';
    //     this.ranServiceFrom = '0';
    //     this.ranServiceTo = '0';
    //     this.radio_val = 'noServiceTime';
    //     this.global1 = true;
    //     this.global2 = true;
    //     this.global3 = true;
    //     this.global4 = true;
    //   }
    // }
    // function to enable input box of selected radio button...
    catchRadioEve(val) {
        // if (this.httpService == false) {
        //   return;
        // }
        this.selectradioBox = val;
        if (val == 0) {
            this.global1 = true;
            this.global2 = true;
            this.global3 = true;
            this.global4 = true;
            this.exp_ran_service_time = '0';
            this.constServTime = '0';
            this.ranServiceFrom = '0';
            this.ranServiceTo = '0';
        }
        else if (val == 1) {
            this.global1 = false;
            this.global2 = true;
            this.global3 = true;
            this.global4 = true;
            this.constServTime = '0';
            this.ranServiceFrom = '0';
            this.ranServiceTo = '0';
        }
        else if (val == 2) {
            this.global1 = true;
            this.global2 = false;
            this.global3 = true;
            this.global4 = true;
            this.exp_ran_service_time = '0';
            this.ranServiceFrom = '0';
            this.ranServiceTo = '0';
        }
        else if (val == 3) {
            this.global1 = true;
            this.global2 = true;
            this.global3 = false;
            this.global4 = false;
            this.exp_ran_service_time = '0';
            this.constServTime = '0';
        }
        if (this.radio_val === 'randomServiceT') {
            this.inputCST = true;
            this.inputRST = true;
            this.inputERST = false;
        }
        if (this.radio_val === 'constantServicet') {
            this.inputRST = true;
            this.inputERST = true;
            this.inputCST = false;
        }
        if (this.radio_val === 'randomUniform') {
            this.inputERST = true;
            this.inputCST = true;
            this.inputRST = false;
        }
    }
    /**function to get a data from a server */
    fillConfigData(result) {
        try {
            if (result['strTempMode'] == '' || result['strTempMode'] == undefined || result['strTempMode'] == '-1') {
                // this.httpService = false;
                // this.service = true;
            }
            else {
                // this.service = false;
                // this.httpService = true;
                this.radio_val = 'noServiceTime';
                this.selectradioBox = '0';
                if (result['strTempMode'].toString() == '0') {
                    this.radio_val = 'noServiceTime';
                    this.selectradioBox = '0';
                }
                else if (result['strTempMode'].toString() == '1') {
                    this.global1 = false;
                    this.radio_val = 'randomServiceT';
                    this.selectradioBox = '1';
                    this.exp_ran_service_time = (parseFloat(result['strServiceValue1'])).toString();
                }
                else if (result['strTempMode'].toString() == '2') {
                    this.global2 = false;
                    this.radio_val = 'constantServicet';
                    this.selectradioBox = '2';
                    this.constServTime = (parseFloat(result['strServiceValue1'])).toString();
                }
                else if (result['strTempMode'].toString() == '3') {
                    this.radio_val = 'randomUniform';
                    this.selectradioBox = '3';
                    this.global3 = false;
                    this.global4 = false;
                    this.ranServiceFrom = (parseFloat(result['strServiceValue1'])).toString();
                    this.ranServiceTo = (parseFloat(result['strServiceValue2'])).toString();
                }
                this.catchRadioEve(this.selectradioBox);
            }
        }
        catch (error) {
            console.error('error i9n getting data from server', error);
        }
    }
    /**send a json data for set gloabal http settings */
    setSvcTimeCGIFields(data) {
        try {
            //this.log.debug('json data for global http content')
            /**validate a service time information */
            if ((this.exp_ran_service_time - Math.floor(this.exp_ran_service_time)) != 0 || (this.constServTime - Math.floor(this.constServTime)) != 0 || (this.ranServiceFrom - Math.floor(this.ranServiceFrom)) != 0 || (this.ranServiceTo - Math.floor(this.ranServiceTo)) != 0) {
                let msg = 'Service time does not includes decimal values. Please enter valid service time.';
                this.showDialog(msg);
                return;
            }
            this.isRestart = data;
            // if (this.httpService == true) {
            if (this.selectradioBox == '1' || this.radio_val == 'randomServiceT') {
                if (this.exp_ran_service_time == '' || this.exp_ran_service_time == '0') {
                    alert('Random (Internet type distribution) service time cannot be blank/zero');
                    return;
                }
            }
            else if (this.selectradioBox == '2' || this.radio_val == 'constantServicet') {
                if (this.constServTime == '' || this.constServTime == '0') {
                    alert('Constant service time cannot be blank/zero');
                    return;
                }
            }
            else if (this.selectradioBox == '3' || this.radio_val == 'randomUniform') {
                if (this.ranServiceTo == '' || this.ranServiceFrom == '' || this.ranServiceTo == '0' || this.ranServiceFrom == '0') {
                    alert('Random(Uniform distribution) service time cannot be blank/zero');
                    return;
                }
                else if (parseFloat(this.ranServiceFrom) >= parseFloat(this.ranServiceTo)) {
                    alert(' Random(Uniform distribution) service time should be greater than Minimum time');
                    return;
                }
            }
            // }
            // let chkService = '1';
            // if (this.httpService == true) {
            //   chkService = '1';
            // } else {
            //   chkService = '0';
            // }
            let globalContent = {
                // 'chkUseServerTime': chkService,
                'chkUseServerTime': "1",
                'radServiceTimeOption': this.selectradioBox,
                'txtIntTypeDistribution': this.exp_ran_service_time,
                'txtConstService': this.constServTime,
                'txtUniDistributionFrom': this.ranServiceFrom,
                'txtUniDistributionTo': this.ranServiceTo,
                'isRtc': this.isRtc
            };
            this._config.loading = true;
            this.unsavedChanges = false;
            this._config.setServiceTimeFields(globalContent);
        }
        catch (error) {
            console.error('error in making json data', error);
        }
    }
    getHPDStatus() {
        this.serviceTimeSubscription = this._manageService.activateProvider$.subscribe(result => {
            // if (this._manageService.action == 'restartHpd') {
            this.isEnabledSpinner = false;
            // let status = result['status'].replace(/\\n/g, "\n");
            // if (status == 'Changes Activated Successfully')
            //   alert('Service virtualization server restarted successfully');
            // else {
            //   alert(status);
            // }
        }
        // }
        );
    }
    clickButtonEvent(event) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
        try {
            console.log('event', event);
            if (((_b = (_a = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _a === void 0 ? void 0 : _a.actionConfig) === null || _b === void 0 ? void 0 : _b.action) == "delete") {
                this.deleteCgi();
            }
            else if (((_d = (_c = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _c === void 0 ? void 0 : _c.actionConfig) === null || _d === void 0 ? void 0 : _d.action) == "edit") {
                this.updateCgi();
            }
            else if (((_f = (_e = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _e === void 0 ? void 0 : _e.actionConfig) === null || _f === void 0 ? void 0 : _f.action) == "rowCheckboxEnable" || ((_h = (_g = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _g === void 0 ? void 0 : _g.actionConfig) === null || _h === void 0 ? void 0 : _h.action) == "masterCheckboxEnable" || ((_k = (_j = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _j === void 0 ? void 0 : _j.actionConfig) === null || _k === void 0 ? void 0 : _k.action) == "rowCheckboxDisable" || ((_m = (_l = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _l === void 0 ? void 0 : _l.actionConfig) === null || _m === void 0 ? void 0 : _m.action) == "masterCheckboxDisable") {
                this.selectedRows = (_o = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _o === void 0 ? void 0 : _o.rowData;
            }
        }
        catch (error) {
            console.error("Error in clickButtonEvent", error);
        }
    }
    ngOnDestroy() {
        this._config.loading = false;
        if (this.serviceTimeSubscription != null)
            this.serviceTimeSubscription.unsubscribe();
        if (this.activeSubscriber != undefined)
            this.activeSubscriber.unsubscribe();
        this._manageService.action = "";
    }
};
NetoceanConfigServiceTimeCgiComponent.ctorParameters = () => [
    { type: _services_netocean_common_service__WEBPACK_IMPORTED_MODULE_2__["NetoceanCommonService"] },
    { type: _angular_router__WEBPACK_IMPORTED_MODULE_6__["Router"] },
    { type: _services_netocean_configuration_service__WEBPACK_IMPORTED_MODULE_3__["NetoceanConfigurationService"] },
    { type: _services_manage_services_info_service__WEBPACK_IMPORTED_MODULE_5__["ManageServicesInfoService"] },
    { type: primeng_api__WEBPACK_IMPORTED_MODULE_4__["MessageService"] }
];
NetoceanConfigServiceTimeCgiComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-netocean-config-service-time-cgi',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./netocean-config-service-time-cgi.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./netocean-config-service-time-cgi.component.scss */ "./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.component.scss")).default]
    })
], NetoceanConfigServiceTimeCgiComponent);



/***/ }),

/***/ "./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.module.ts":
/*!****************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.module.ts ***!
  \****************************************************************************************************************************/
/*! exports provided: onMonacoLoad, NetoceanConfigServiceTimeCgiModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onMonacoLoad", function() { return onMonacoLoad; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NetoceanConfigServiceTimeCgiModule", function() { return NetoceanConfigServiceTimeCgiModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
/* harmony import */ var _netocean_config_service_time_cgi_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./netocean-config-service-time-cgi.component */ "./src/app/pages/home/netocean/components/netocean-config-service-time-cgi/netocean-config-service-time-cgi.component.ts");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
/* harmony import */ var _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/checkbox */ "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/checkbox.js");
/* harmony import */ var _angular_material_menu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/menu */ "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/menu.js");
/* harmony import */ var _angular_material_radio__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/radio */ "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/radio.js");
/* harmony import */ var _angular_material_select__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/select */ "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/select.js");
/* harmony import */ var _angular_material_tabs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/material/tabs */ "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/tabs.js");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! src/app/shared/help/help.module */ "./src/app/shared/help/help.module.ts");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var ngx_monaco_editor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ngx-monaco-editor */ "./node_modules/ngx-monaco-editor/__ivy_ngcc__/fesm2015/ngx-monaco-editor.js");
/* harmony import */ var _pipes_netocean_pipe_module__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../pipes/netocean-pipe.module */ "./src/app/pages/home/netocean/components/pipes/netocean-pipe.module.ts");
/* harmony import */ var _interfaces_confirmUnsavedChangesroutingguard__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../interfaces/confirmUnsavedChangesroutingguard */ "./src/app/pages/home/netocean/interfaces/confirmUnsavedChangesroutingguard.ts");
/* harmony import */ var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! src/app/shared/cav-table/cav-table.module */ "./src/app/shared/cav-table/cav-table.module.ts");

















function onMonacoLoad() {
    console.log(window.monaco);
    return window.monaco;
}
const monacoConfig = {
    baseUrl: './assets',
    defaultOptions: { scrollBeyondLastLine: false },
    onMonacoLoad: onMonacoLoad // here monaco object will be available as window.monaco use this function to extend monaco editor functionalities.
};
const routes = [
    {
        path: '',
        component: _netocean_config_service_time_cgi_component__WEBPACK_IMPORTED_MODULE_3__["NetoceanConfigServiceTimeCgiComponent"], canDeactivate: [_interfaces_confirmUnsavedChangesroutingguard__WEBPACK_IMPORTED_MODULE_15__["ConfirmUnsavedChangesGuard"]]
    }
];
let NetoceanConfigServiceTimeCgiModule = class NetoceanConfigServiceTimeCgiModule {
};
NetoceanConfigServiceTimeCgiModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [_netocean_config_service_time_cgi_component__WEBPACK_IMPORTED_MODULE_3__["NetoceanConfigServiceTimeCgiComponent"]],
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            _angular_router__WEBPACK_IMPORTED_MODULE_12__["RouterModule"].forChild(routes),
            _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"], src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_11__["HelpModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["DynamicDialogModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TabMenuModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TreeModule"],
            primeng__WEBPACK_IMPORTED_MODULE_10__["TieredMenuModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["DialogModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["CalendarModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["InputTextareaModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["AccordionModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["SidebarModule"], ngx_monaco_editor__WEBPACK_IMPORTED_MODULE_13__["MonacoEditorModule"].forRoot(monacoConfig),
            primeng__WEBPACK_IMPORTED_MODULE_10__["SplitButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TooltipModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["MenuModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ToolbarModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TableModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ScrollPanelModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TabViewModule"],
            primeng__WEBPACK_IMPORTED_MODULE_10__["CheckboxModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["DropdownModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ConfirmDialogModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["FieldsetModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["PanelModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["FileUploadModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ToastModule"],
            primeng__WEBPACK_IMPORTED_MODULE_10__["MultiSelectModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["RadioButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["OverlayPanelModule"], _angular_material_menu__WEBPACK_IMPORTED_MODULE_6__["MatMenuModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["SpinnerModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ToggleButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["OrderListModule"],
            primeng__WEBPACK_IMPORTED_MODULE_10__["ChipsModule"], _angular_material_radio__WEBPACK_IMPORTED_MODULE_7__["MatRadioModule"], _angular_material_select__WEBPACK_IMPORTED_MODULE_8__["MatSelectModule"], _angular_material_tabs__WEBPACK_IMPORTED_MODULE_9__["MatTabsModule"], _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_5__["MatCheckboxModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["BreadcrumbModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ProgressBarModule"],
            primeng__WEBPACK_IMPORTED_MODULE_10__["CardModule"], _pipes_netocean_pipe_module__WEBPACK_IMPORTED_MODULE_14__["NetoceanPipeModule"], src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_16__["CavTableModule"]
        ],
        providers: [],
        schemas: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["CUSTOM_ELEMENTS_SCHEMA"]]
    })
], NetoceanConfigServiceTimeCgiModule);



/***/ })

}]);