(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["additional-settings-main-additional-syncpoints-additional-syncpoints-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.component.html":
/*!**********************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.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=\"p-4 p-grid p-align-center mt-32\">\n    <div class=\"p-grid p-col-2 p-col-nogutter\">Enable Sync Point Settings</div>\n    <p-selectButton class=\"radio-selectButton\" [disabled]=\"enableDisKeywordList.ENABLE_SYNC_POINT\" [options]=\"syncPointOpt\" [(ngModel)]=\"chkOver\"></p-selectButton>\n</div>\n\n<div class=\"my-16 p-16 p-grid p-align-center  border-3 borderTabClass\" *ngIf=\"chkOver\">\n        <div class=\"p-col-6 p-col-nogutter\">Overall timeout for releasing sync point since first Vuser arrived at sync point (OATO)</div>\n        <div class=\"p-col-1 p-col-nogutter\">\n            <input type=\"text\" placeholder=\"HH:MM:SS\" [(ngModel)]=\"txtOATO\" pInputText class=\"w-100-p\" (keypress)=\"validateQty($event)\">\n        </div>\n</div>\n\n<div class=\"my-16 p-16 p-grid p-align-center  border-3 borderTabClass\" *ngIf=\"chkOver\">\n        <div class=\"p-col-6 p-col-nogutter\">Maximum time allowed between two VUser to arrive at sync point (IATO)</div>\n        <div class=\"p-col-1 p-col-nogutter\">\n            <input type=\"text\" placeholder=\"HH:MM:SS\" [(ngModel)]=\"txtIATO\" pInputText class=\"w-100-p\" (keypress)=\"validateQty($event)\">\n        </div>\n</div>\n\n<div class=\"my-16\" *ngIf=\"chkOver\">\n    \n    <cav-table [value]=\"tableValueSyncPoint\"  [headerRelativePath]=\"relativePath\" [scrollable]=\"true\" [responsive]=\"true\"\n    scrollHeight=\"calc(100vh - 240px)\" (clickButtonEvent)=\"clickButtonEvent($event)\"></cav-table>\n    \n</div>\n\n<p-menu #matMenu [popup]=\"true\" [model]=\"menuOptions\" [showTransitionOptions]=\"'0ms'\"\n          [hideTransitionOptions]=\"'0ms'\" appendTo=\"body\"></p-menu>\n\n<p-dialog [style]=\"{'min-width': '80vw'}\" [contentStyle]=\"{'min-height': '240px'}\" [modal]=\"true\" header={{dialogHeader}} [(visible)]=\"showHideDialog\"  [draggable]=\"false\">\n    <p-panel header=\"SyncPoint Settings\">\n        <div class=\"my-16 pl-5\">\n            <p-checkbox label=\"Enable SyncPoint at the start of the test\"   binary=\"true\" [(ngModel)]=\"lstActive\"></p-checkbox>\n        </div>\n        <div class=\"my-16 p-grid p-align-center\">\n            <div class=\"p-col-2\">\n                Test Group\n            </div>\n            <div class=\"p-col-4\">\n                <p-dropdown appendTo=\"body\"  filter=\"true\" dropdownIcon=\"icons8 icons8-expand-arrow\"  [style]=\"{'min-width': '100%'}\" [options]=\"lstOptGroupName\" [(ngModel)]=\"lstGroupName\"\n                (onChange)=\"changeScenPointType()\"></p-dropdown>\n            </div>\n            <div class=\"p-col-2\">\n                VUser enter SyncPoint on start of\n            </div> \n            <div class=\"p-col-2\">\n                <p-dropdown  appendTo=\"body\" dropdownIcon=\"icons8 icons8-expand-arrow\"  [style]=\"{'min-width': '100%'}\" [options]=\"lstOptType\" [(ngModel)]=\"lstType\" (onChange)=\"getNameofSelectedType()\" ></p-dropdown>\n            </div>\n            <div class=\"p-col-2\">\n                <p-dropdown appendTo=\"body\" placeholder=\"--Select Page--\" dropdownIcon=\"icons8 icons8-expand-arrow\"  [style]=\"{'min-width': '100%'}\" [options]=\"lstOptName\" [(ngModel)]=\"lstName\" (onChange)=\"getName()\"></p-dropdown>\n            </div>\n           \n        </div>\n        <div class=\"my-16 p-grid p-align-center\">\n            <div class=\"p-col-2\">\n                Participating VUsers\n            </div>\n            <div class=\"p-col-2\">\n                <div class=\"ui-inputgroup w-100-p\">\n                    <p-spinner  inputStyleClass=\"w-100-p\" [min]=\"0\" [max]=\"100\"  [(ngModel)]=\"txtParticipatingVuser\" (keypress)=\"validateQtyForParticipatingVuser($event)\"></p-spinner>        \n                    <span class=\"ui-inputgroup-addon px-10\">%</span>\n                </div>\n            </div>\n            <div class=\"p-col-2 p-offset-2\">\n                Release SyncPoint when\n            </div>\n            <div class=\"p-col-2\">\n                <input #relTargetVuser type=\"text\" pInputText class=\"w-100-p\"[(ngModel)]=\"txtReleaseTargetVuser\" min=\"0\"\n                (keypress)=\"validateInputForRelTargetVuser($event)\"\n                (focusout)=\"validateQtyForReleaseTargetUserField($event,false)\" >         \n            </div>\n            <div class=\"\">\n                VUsers arrive at SyncPoint <i class=\"mx-10 icons8 icons8 icons8-help\" pTooltip=\"This is used to specify how many Vuser should reach sync point for releasing of sync point. Since sync point can be reached many times, we can give this for each time using comma separated value. If it is same, then  can be used. But  should be used only once and that too at the end.\n\n                Valid Examples:\n                100\n                200,300,*\n                100,100,100,500,*\n                Invalid Examples:\n                *\n                *,100\n                200,*,300,*\n                100,100,100,500,*,*\n                \"></i>\n            </div>\n        </div>\n        <div class=\"my-8 p-grid p-align-center\">\n            <p-accordion class=\"w-100-p\" >\n                <p-accordionTab header=\"Advanced Settings\">\n                    <div class=\"my-16\">\n                        <p-checkbox label=\"Do not release SyncPoint automatically\" [(ngModel)]=\"lstReleaseMode\" binary=\"true\" (click)=\"syncPointAutoClicked()\"></p-checkbox>\n                    </div>\n                    <div class=\"p-grid p-align-center my-16\" >\n                        <ng-container *ngIf=\"!lstReleaseMode\">\n                            <div class=\"p-col-2 pl-0\">\n                                Release SyncPoint\n                            </div>\n                            <div class=\"p-col-4\">\n                                <p-dropdown appendTo=\"body\" dropdownIcon=\"icons8 icons8-expand-arrow\" [style]=\"{'min-width': '100%'}\"\n                                    [options]=\"lstOptRelType\" (onChange)=\"onDropDownRelTypeChange()\" [(ngModel)]=\"lstReleaseType\"></p-dropdown>\n                            </div>\n                            <ng-container *ngIf=\"lstReleaseType=='1' && !lstReleaseMode\">\n                                <div class=\"p-col-2\">\n                                    <p-calendar [(ngModel)]=\"txtAbsoluteTime\" inputStyleClass=\"w-100-p\" appendTo=\"body\"></p-calendar>\n                                </div>\n                                <div class=\"p-col-2\">\n                                    <input pInputText type=\"text\" placeholder=\"HH:MM:SS\" class=\"w-100-p\" [(ngModel)]=\"txtAbsolute\" />\n                                </div>\n                            </ng-container>\n                        \n                            <div class=\"p-col-4 p-grid p-align-center\" *ngIf=\"lstReleaseType=='2' && !lstReleaseMode\">\n                                <input pInputText type=\"text\" placeholder=\"HH:MM:SS\" class=\"w-50-p mr-5\" [(ngModel)]=\"txtTimePeriod\" />\n                                <span>(HH:MM:SS)</span>\n                            </div>\n                        </ng-container>\n\n                        <div class=\"p-grid p-align-center\" *ngIf=\"isFrequency\">\n                            <div class=\"ui-g-5\" style=\"line-height: 18px;\">\n                                <label>Release next Target VUsers after duration</label>\n                            </div>\n                            <div class=\"ui-g-2\" style=\"margin-left: -45px;\">\n                                <input pInputText type=\"text\" placeholder=\"HH:MM:SS\" style=\"width:100%\" [(ngModel)]=\"txtFrequency\" />\n                            </div>\n                            <div class=\"ui-g-2\" style=\"line-height: 18px;\">\n                                <label>(HH:MM:SS)</label>\n                            </div>\n                        </div>\n                        <div class=\"p-grid p-align-center\">\n                            <div class=\"ui-g-12\" *ngIf=\"lstReleaseType == '1' && !lstReleaseMode\" style=\"margin-top:7px\">\n                                <p-checkbox name=\"released\" binary=\"true\"\n                                    label=\"VUsers will be released when either Absolute time has occurred or VUsers target is met.\"\n                                    [(ngModel)]=\"releasedForcefully\"></p-checkbox>\n                            </div>\n                            <div class=\"ui-g-12\" *ngIf=\"lstReleaseType == '2' && !lstReleaseMode\">\n                                <p-checkbox name=\"released\" binary=\"true\"\n                                    label=\"VUsers will be released when either specified period is elapsed or VUsers target is met.\"\n                                    [(ngModel)]=\"releasedForcefully\"></p-checkbox>\n                            </div>\n                        </div>\n                        <div class=\"p-col-2\">\n                            Release SyncPoint Vusers\n                        </div>\n                        <div class=\"p-col-4\">\n                            <p-dropdown appendTo=\"body\" dropdownIcon=\"icons8 icons8-expand-arrow\"  [style]=\"{'min-width': '100%'}\" [options]=\"lstOptSchedule\" (onChange)=\"onDropDownScheduleChange()\"\n                            [(ngModel)]=\"lstReleaseSchedule\"></p-dropdown>\n                        </div>\n                        <div class=\"ui-g-4 p-grid p-align-center\" *ngIf=\"lstReleaseSchedule=='1'\">\n                            <input pInputText type=\"text\" placeholder=\"HH:MM:SS\" class=\"w-40-p\" [(ngModel)]=\"txtReleaseDuration\" />\n                            <span>(HH:MM:SS)</span>\n                          </div>\n                  \n                          <div class=\"ui-g-4 p-grid p-align-center\" *ngIf=\"lstReleaseSchedule=='2'\">\n                            <input type=\"text\" pInputText min=\"0\" [(ngModel)]=\"txtReleaseRate\"\n                              (keypress)=\"validateQtyForReleaseRate($event)\" class=\"w-40-p\" />(VUsers/min)\n                          </div>\n                  \n                        <ng-container *ngIf=\"lstReleaseSchedule=='3'\">\n                            <div class=\"ui-g-4 p-grid p-align-center\">\n                                <div class=\"p-grid p-align-center mb-5\" *ngFor=\"let rowData of arrSpecifiedMultiStepDurPer;let i = index\">\n                                    <input pInputText id=\"mutistepdur{{i}}\" type=\"text\" placeholder=\"HH:MM:SS\" class=\"width-60 px-3\"\n                                        [(ngModel)]=\"rowData['specifiedMultiStepDur']\" />\n                                    <div class=\"mx-2 font-10\">(HH:MM:SS)</div>\n                        \n                                    <div class=\"p-grid p-align-center\">\n                                        <input pInputText type=\"number\" id=\"mutistepper{{i}}\" min=\"0\" max=\"100\" step=\"1\" class=\"width-50 pr-0\"\n                                            [(ngModel)]=\"rowData['specifiedMultiStepPer']\" />\n                                        <div class=\"mx-2\">%</div>\n                                    </div>\n                                    <div class=\"mx-3\">\n                                        <button type=\"button\" pButton class=\"btn-icon\" icon=\"icons8 icons8-plus-math\"\n                                            (click)=\"addStepDuration()\" *ngIf=\"i == 0\"></button>\n                        \n                                        <button type=\"button\" pButton class=\"btn-icon\" icon=\"icons8 icons8-trash\"\n                                            (click)=\"deleteStepDuration(i)\" *ngIf=\"i > 0\"></button>\n                                    </div>\n                                </div>\n                            </div>\n                        </ng-container>\n                  \n                        <div class=\"p-col-2 pl-0\">\n                            Script(s) part of SyncPoint\n                        </div>\n                        <div class=\"p-col-10\">\n                            <input type=\"text\" class=\"w-100-p\" pInputText  [title]=\"scriptlabel\" [(ngModel)]=\"scriptlabel\" readonly>\n                        </div>\n                    </div>\n                </p-accordionTab>\n            </p-accordion>\n        </div>\n    </p-panel>\n    <p-footer class=\"p-grid p-align-center p-justify-end\">\n        <button pButton type=\"button\" label=\"Save\" (click)=\"appendData()\" ></button>\n    </p-footer>\n</p-dialog>\n");

/***/ }),

/***/ "./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.component.scss":
/*!********************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.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-additional-syncpoints .borderTabClass {\n  border-style: solid;\n  border-width: 1px;\n  border-radius: 3px;\n}\napp-additional-syncpoints .whitDivClass {\n  background-color: white;\n  border-style: solid;\n  border-width: 1px;\n  border-radius: 3px;\n}\napp-additional-syncpoints .blueDiv {\n  background-color: var(--secondary-100);\n  color: var(--secondary-900);\n  border: 1px solid var(--secondary-900);\n  border-radius: 3px;\n}");

/***/ }),

/***/ "./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.component.ts":
/*!******************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.component.ts ***!
  \******************************************************************************************************************/
/*! exports provided: AdditionalSyncpointsComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdditionalSyncpointsComponent", function() { return AdditionalSyncpointsComponent; });
/* 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 primeng__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");
/* harmony import */ var _interface_scenario_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../interface/scenario-state */ "./src/app/pages/scenario/interface/scenario-state.ts");
/* harmony import */ var _service_additional_setting_data_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../service/additional-setting-data-service */ "./src/app/pages/scenario/service/additional-setting-data-service.ts");
/* harmony import */ var _service_scen_keyword_definition_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../service/scen-keyword-definition.service */ "./src/app/pages/scenario/service/scen-keyword-definition.service.ts");
/* harmony import */ var _service_scenario_http_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../service/scenario-http.service */ "./src/app/pages/scenario/service/scenario-http.service.ts");
/* harmony import */ var _service_scenario_utils_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../service/scenario-utils.service */ "./src/app/pages/scenario/service/scenario-utils.service.ts");
/* harmony import */ var _service_sch_schedule_data_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../service/sch-schedule-data.service */ "./src/app/pages/scenario/service/sch-schedule-data.service.ts");
/* harmony import */ var _constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../constants/scen-keyword-constants */ "./src/app/pages/scenario/constants/scen-keyword-constants.ts");
/* harmony import */ var _commons_scen_utility__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../commons/scen-utility */ "./src/app/pages/scenario/commons/scen-utility.ts");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _commons_immutable_array__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../commons/immutable-array */ "./src/app/pages/scenario/commons/immutable-array.ts");
/* harmony import */ var _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../constants/scen-schedule-constants */ "./src/app/pages/scenario/constants/scen-schedule-constants.ts");















let AdditionalSyncpointsComponent = class AdditionalSyncpointsComponent {
    constructor(keywordDefinition, dataService, confirmationService, scenUtilsService, schData, scenarioHttpService, sessionService) {
        this.keywordDefinition = keywordDefinition;
        this.dataService = dataService;
        this.confirmationService = confirmationService;
        this.scenUtilsService = scenUtilsService;
        this.schData = schData;
        this.scenarioHttpService = scenarioHttpService;
        this.sessionService = sessionService;
        this.enableDisKeywordList = {
            "SYNC_POINT": false,
            "SYNC_POINT_TIME_OUT": false,
            "ENABLE_SYNC_POINT": false
        };
        this.screenKeywordList = Object.keys(this.enableDisKeywordList);
        //Overall timeout for releasing sync point
        this.chkOver = false;
        //table syncpoint.
        this.tableValueSyncPoint = [];
        this.page_name_check = [];
        //table syncpoint groupname column of listItems
        this.lstOptGroupName = [];
        this.lstGroupName = "ALL";
        //table syncpoint Type column of listItems
        this.lstOptType = [];
        this.lstType = "Page";
        //table syncpoint name column of listItems
        this.lstOptName = [];
        //table syncpoint Active column of listItems
        this.lstOptActive = [];
        this.lstActive = true;
        // table syncpoint particpating VUser column
        this.txtParticipatingVuser = 100;
        this.arrKeywordData = {}; //main obj of screen Keyword data.
        this.grpListArr = [];
        this.scriptlabel = "";
        this.selectedRowData = [];
        this.showHideDialog = false;
        this.isFromAdd = false;
        this.dialogHeader = "Add Sync Point";
        this.lstOptMode = [];
        this.lstReleaseMode = false;
        this.lstOptRelType = [];
        this.lstReleaseType = "";
        this.lstOptSchedule = [];
        this.lstReleaseSchedule = "";
        this.txtTimePeriod = "00:00:00";
        this.txtReleaseDuration = "00:01:00";
        this.txtReleaseRate = "120";
        this.MAX_HOURS = 24;
        this.YEAR = 2019;
        this.releasedForcefully = false;
        this.txtAbsolute = "00:00:00";
        this.txtFrequency = "00:15:00";
        this.isFrequency = false;
        this.arrSpecifiedMultiStepDurPer = [
            {
                specifiedMultiStepDur: "00:00:00",
                specifiedMultiStepPer: 0
            }
        ];
        this.txtOATO = "10:10:10";
        this.txtIATO = '10:10:10';
        this.syncPointOpt = [];
        this.data = [];
        this.timeZoneId = sessionService.serverTimeInfo.zoneId;
        this.lstOptGroupName = [];
        let groupList = this.dataService.getGroupList();
        var scriptList = [];
        this.grpListArr = [];
        for (let groupData of groupList) {
            scriptList.push(groupData.scriptName);
            this.lstOptGroupName.push({ label: groupData.grpName, value: groupData.grpName });
            this.lstGroupName = this.lstOptGroupName[0].value;
            this.grpListArr.push({ groupName: groupData.grpName, scriptName: groupData.scriptName });
        }
        if (scriptList != null && scriptList != undefined && scriptList.length != 0) {
            this.lstOptGroupName.unshift({ label: "ALL", value: "ALL" });
            let scriptListcontent = scriptList.join(","); //adding the values with commas in the script name.
            this.grpListArr.push({ groupName: "ALL", scriptName: scriptListcontent });
        }
        this.relativePath = "scenario/additionalSettings/syncpoints.json";
    }
    /**
     * insert logic to check if there are pending changes here
     * returning true will navigate without confirmation
     * returning false will show a confirm alert before navigating away
     */
    canDeactivate() {
        try {
            if (this.validateAndSetKeywordArray() == false) {
                return false;
            }
        }
        catch (e) {
        }
        return true;
    }
    setDataInConf() {
        return true;
    }
    ngOnInit() {
        this.subscription = this.scenUtilsService.$saveGroupbasedSetting.subscribe((res) => {
            if (this.validateAndSetKeywordArray()) {
                this.scenUtilsService.saveComponentData(0, {});
            }
        });
        this.fillDDs();
        this.fillInitialData();
        this.arrKeywordData = this.keywordDefinition.chkAndGetKeywrdDataWithAdditionalKeys(this.screenKeywordList);
        if (this.keywordDefinition.isArrKeywordDataEmpty(this.arrKeywordData, this.screenKeywordList)) {
            this.keywordDefinition.setRequestKeywordListInBody(this.screenKeywordList, "");
            let obj = this.keywordDefinition.getRequestJsonParm();
            this.getKeywordData(obj);
            //error case
            if (this.arrKeywordData == null)
                this.arrKeywordData = {};
        }
        else
            this.fillDataInComp();
        this.menuOptions = [
            { label: 'Edit', command: (event) => { this.editSyncpoint(); } },
            { label: 'Delete', command: (event) => { this.deleteSyncpoint(); } }
        ];
    }
    clickButtonEvent(event) {
        var _a, _b, _c, _d, _e, _f;
        const me = this;
        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) === "menuClick") {
            me.matMenu.toggle(event);
            me.onMenuClick(event.cavEventExt.row);
        }
        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) === "add") {
            me.onClickAdd();
        }
        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) === "deleteSelectedRow") {
            me.deleteSyncpoint(event.cavEventExt.rowData);
        }
    }
    getKeywordData(obj) {
        this.scenarioHttpService.getDefaultKeywordData(obj).subscribe((state) => {
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_4__["GetDefaultKeywordDataLoadingState"]) {
                return;
            }
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_4__["GetDefaultKeywordDataLoadedState"]) {
                this.keywordDefinition.setArrKeywordData(this.arrKeywordData, state.data, this.keywordDefinition.mergeKeywordData);
                this.fillDataInComp();
                return;
            }
        }, (state) => {
            console.log(state.error);
            return;
        });
    }
    fillDDs() {
        this.syncPointOpt = [
            { label: 'Yes', value: true },
            { label: "No", value: false }
        ];
        //items of type
        this.lstOptType = [];
        this.lstOptType.push({ 'label': "Page", value: "Page" });
        this.lstOptType.push({ 'label': "Transaction", value: "Transaction" });
        this.lstOptType.push({ 'label': "Script", value: "Script" });
        this.lstOptType.push({ 'label': "API", value: "API" });
        //items of name
        this.lstOptName = [];
        this.lstOptName.push({ 'label': "---Select Page---", value: null });
        //items of active
        this.lstOptActive = [];
        this.lstOptActive.push({ 'label': "Yes", value: "Yes" });
        this.lstOptActive.push({ 'label': "No", value: "No" });
        //list of Release mode
        this.lstOptMode.push({ 'label': 'Auto', 'value': 'Auto' });
        this.lstOptMode.push({ 'label': 'Manual', 'value': 'Manual' });
        //list of Release Type
        this.lstOptRelType.push({ 'label': 'at target vusers', 'value': '0' });
        this.lstOptRelType.push({ 'label': 'at absolute time', 'value': '1' });
        this.lstOptRelType.push({ 'label': 'after Duration', 'value': '2' });
        //list of Release Schedule
        this.lstOptSchedule.push({ 'label': 'immediately', 'value': '0' });
        this.lstOptSchedule.push({ 'label': 'in specified duration', 'value': '1' });
        this.lstOptSchedule.push({ 'label': 'at rate', 'value': '2' });
        this.lstOptSchedule.push({ 'label': 'in specified multi-step duration', 'value': '3' });
    }
    /**
   * This data is to get the data from the server for Transaction list, Page List and Sync point.
   */
    fillInitialData() {
        let scriptList = "";
        var groupNameScriptObj = this.dataService.getGroupList();
        for (let key of groupNameScriptObj) {
            this.data.push(key.scriptName);
        }
        scriptList = this.data.join("|");
        const me = this;
        let dataServiceObj = {
            getScenMode: () => {
                return me.scenUtilsService.ScenMode;
            },
            getScenName: () => {
                return me.dataService.getScenName();
            }
        };
        this.scenarioHttpService.getScriptRelatedData(scriptList, dataServiceObj).subscribe((state) => {
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_4__["ScenarioRestLoadingState"]) {
                return;
            }
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_4__["ScenarioRestLoadedState"]) {
                this.scenUtilsService.scriptDataList = state.data;
                this.getNameofSelectedType();
                return;
            }
        }, (state) => {
        });
    }
    /**
   * Filling Name Drop Down
   */
    getNameofSelectedType() {
        this.scriptlabel = '';
        try {
            this.lstOptName = [];
            for (var i = 0; i < this.grpListArr.length; i++) {
                if (this.lstType == null || this.lstType == "")
                    this.lstType = "Page";
                if (this.lstGroupName == null || this.lstGroupName == "")
                    this.lstGroupName = this.lstOptGroupName[0].value;
                if (this.lstType == "Page") {
                    if (this.grpListArr[i]["groupName"] == this.lstGroupName) {
                        let scriptNames = this.grpListArr[i]["scriptName"];
                        if (this.lstGroupName != null && this.lstGroupName != "ALL") {
                            this.lstOptName.push({ 'label': "---Select Page---", value: null });
                            let pages = this.scenUtilsService.scriptDataList[this.data.indexOf(scriptNames)][scriptNames]["pageList"];
                            let transListFromApiGrp = this.getTransListFromAPIGrp(this.lstGroupName, false);
                            if (transListFromApiGrp.length != 0)
                                pages = transListFromApiGrp;
                            if (pages != undefined) {
                                for (var j = 0; j < pages.length; j++) {
                                    this.lstOptName.push({ 'label': pages[j], value: pages[j] });
                                }
                            }
                        }
                        else {
                            this.scriptlabel = scriptNames;
                            scriptNames = scriptNames.split(',');
                            let tmpArr = [];
                            tmpArr.splice(0, 0, "---Select Page---");
                            for (var k = 0; k < scriptNames.length; k++) {
                                let scriptName = scriptNames[k];
                                let pages = this.scenUtilsService.scriptDataList[this.data.indexOf(scriptName)][scriptName]["pageList"];
                                let transListFromApiGrp = this.getTransListFromAPIGrp(scriptName, true);
                                if (transListFromApiGrp.length != 0)
                                    pages = transListFromApiGrp;
                                if (pages != undefined) {
                                    for (let j = 0; j < pages.length; j++) {
                                        if (tmpArr.indexOf(pages[j]) == -1) {
                                            tmpArr.push(pages[j]);
                                        }
                                    }
                                    this.lstOptName = _commons_scen_utility__WEBPACK_IMPORTED_MODULE_11__["ScenUtility"].createSelectItem(tmpArr);
                                }
                            }
                        }
                    }
                }
                else if (this.lstType == "Script") {
                    if (this.grpListArr[i]["groupName"] == this.lstGroupName) {
                        var scriptNames = this.grpListArr[i]["scriptName"];
                        if (typeof (scriptNames) == "string") {
                            let scriptTempList = this.grpListArr[i]["scriptName"];
                            if (this.lstGroupName == "ALL") {
                                let scripttemp = scriptTempList.split(",");
                                let removeDup = this.removeDuplicateUsingFilter(scripttemp);
                                this.lstOptName.push({ 'label': "---Select Script---", value: null });
                                for (let t = 0; t < removeDup.length; t++) //When group name is selected as 'All' making DropDown Options
                                 {
                                    this.lstOptName.push({ label: removeDup[t], value: removeDup[t] });
                                }
                            }
                            else {
                                this.lstOptName.push({ 'label': "---Select Script---", value: null });
                                this.lstOptName.push({ 'label': this.grpListArr[i]["scriptName"], value: this.grpListArr[i]["scriptName"] });
                                this.scriptlabel = scriptTempList;
                            }
                        }
                        else {
                            for (var k = 0; k < scriptNames.length; k++) {
                                var scriptName = scriptNames[k];
                                this.lstOptName.push({ 'label': scriptName, value: scriptName });
                            }
                        }
                    }
                }
                else if (this.lstType == "API") {
                    if (this.grpListArr[i]["groupName"] == this.lstGroupName) {
                        var scriptNames = this.grpListArr[i]["scriptName"];
                        if (this.lstGroupName == "ALL")
                            scriptNames = scriptNames.split(",");
                        this.lstOptName.push({ 'label': "---Select API---", value: null });
                        if (typeof (scriptNames) == "string") {
                            var syncList = this.scenUtilsService.scriptDataList[this.data.indexOf(scriptNames)][scriptNames]["syncList"];
                            this.scriptlabel = scriptNames;
                            if (syncList != undefined) {
                                for (var j = 0; j < syncList.length; j++) {
                                    this.lstOptName.push({ 'label': syncList[j], value: syncList[j] });
                                }
                            }
                        }
                        else {
                            let tmpArr = [];
                            for (var k = 0; k < scriptNames.length; k++) {
                                var scriptName = scriptNames[k];
                                var syncList = this.scenUtilsService.scriptDataList[this.data.indexOf(scriptName)][scriptName]["syncList"];
                                this.scriptlabel = scriptNames.toString();
                                if (syncList != undefined) {
                                    for (var j = 0; j < syncList.length; j++) {
                                        if (tmpArr.indexOf(syncList[j]) == -1) {
                                            tmpArr.push(syncList[j]);
                                            this.lstOptName.push({ 'label': syncList[j], value: syncList[j] });
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else {
                    if (this.grpListArr[i]["groupName"] == this.lstGroupName) {
                        var scriptNames = this.grpListArr[i]["scriptName"];
                        if (this.lstGroupName == "ALL")
                            scriptNames = scriptNames.split(",");
                        this.lstOptName.push({ 'label': "---Select Transaction---", value: null });
                        if (typeof (scriptNames) == "string") {
                            var transList = this.scenUtilsService.scriptDataList[this.data.indexOf(scriptNames)][scriptNames]["transList"];
                            let transListFromApiGrp = this.getTransListFromAPIGrp(this.lstGroupName, false);
                            if (transListFromApiGrp.length != 0)
                                transList = transListFromApiGrp;
                            this.scriptlabel = scriptNames;
                            if (transList != undefined) {
                                for (var j = 0; j < transList.length; j++) {
                                    this.lstOptName.push({ 'label': transList[j], value: transList[j] });
                                }
                            }
                        }
                        else {
                            let tmpArr = [];
                            for (var k = 0; k < scriptNames.length; k++) {
                                var scriptName = scriptNames[k];
                                var transList = this.scenUtilsService.scriptDataList[this.data.indexOf(scriptName)][scriptName]["transList"];
                                let transListFromApiGrp = this.getTransListFromAPIGrp(scriptName, true);
                                if (transListFromApiGrp.length != 0)
                                    transList = transListFromApiGrp;
                                this.scriptlabel = scriptNames.toString();
                                if (transList != undefined) {
                                    for (var j = 0; j < transList.length; j++) {
                                        if (tmpArr.indexOf(transList[j]) == -1) {
                                            tmpArr.push(transList[j]);
                                            this.lstOptName.push({ 'label': transList[j], value: transList[j] });
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (this.lstOptName[0] != undefined)
                this.lstName = this.lstOptName[0].value; //Displaying First value 
        }
        catch (e) {
            console.trace("Exception=", e);
        }
    }
    /**
     * This method returns list of transactions or pages in api type group.
     * If grp is not API type then blank array will be returned.
     * @param grpName
     */
    getTransListFromAPIGrp(grpScriptName, isScript) {
        let grpList = this.schData.groupDataList;
        let transList = [];
        for (let grp of grpList) {
            if (((grp.grpName == grpScriptName && !isScript) || (grp.scriptName == grpScriptName && isScript)) && grp.grpType == _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_14__["GROUP_TYPE"].API) {
                let flowArr = grp.flowArr;
                for (let flow of flowArr) {
                    for (let req of flow.reqArr) {
                        if (req.reqName)
                            transList.push(req.reqName);
                    }
                }
            }
        }
        return transList;
    }
    changeScenPointType(value) {
        if (value == null) {
            this.lstType = 'Page';
            this.lstName = "---Page---";
        }
        else {
            this.lstType = value;
        }
        this.lstOptName = [];
        this.lstOptName.push({ 'label': "---Select Page---", value: null });
        this.getNameofSelectedType(); //Passing data by default
    }
    fillUpdateGUI(event) {
        let date = moment__WEBPACK_IMPORTED_MODULE_12__["tz"](Date.now(), this.timeZoneId).format('HH:mm:ss_MM/DD/YYYY');
        let curDate = date.split('_');
        this.lstGroupName = event.data["GroupName"];
        this.lstType = event.data["Type"];
        this.changeScenPointType(this.lstType);
        this.lstName = event.data["Name"];
        if (event.data["Active"] == "Yes")
            this.lstActive = true;
        else
            this.lstActive = false;
        this.txtParticipatingVuser = event.data["ParticipatingVUsersPct"];
        this.txtReleaseTargetVuser = event.data["ReleaseTargetVUsers"];
        let grpDataList = this.schData.groupDataList;
        if (event.data['Scripts'].indexOf(",") == -1) {
            for (let i = 0; i < grpDataList.length; i++) {
                if (grpDataList[i]["groupName"] == this.lstGroupName) {
                    if (grpDataList[i]["scriptName"] != event.data["Scripts"]) {
                        this.scriptlabel = grpDataList[i]["scriptName"];
                        break;
                    }
                    else {
                        this.scriptlabel = event.data["Scripts"];
                        break;
                    }
                }
                else if (this.lstGroupName == "ALL") {
                    this.scriptlabel = event.data["Scripts"];
                    break;
                }
            }
        }
        else {
            this.scriptlabel = event.data["Scripts"];
        }
        //Bug id:79114
        if (this.lstGroupName == "ALL" && this.lstType == "Script") {
            this.scriptlabel = event.data["Scripts"];
        }
        if (event.data["Mode"] == "Auto")
            this.lstReleaseMode = false;
        else
            this.lstReleaseMode = true;
        if (event.data["relTypeDropDownVal"] == "1") {
            this.txtAbsoluteTime = new Date(event.data["releaseType"].split("-", 3)[0]);
            this.txtAbsolute = event.data["releaseType"].split("-")[1];
            if (event.data["releaseType"].split(",").length > 1) {
                this.isFrequency = true;
                this.txtFrequency = event.data["releaseType"].split(",")[1];
                this.txtAbsolute = this.txtAbsolute.split(",")[0];
            }
        }
        else {
            this.txtAbsoluteTime = new Date(curDate[1]);
            this.txtAbsolute = curDate[0];
            this.isFrequency = false;
            this.txtFrequency = "00:15:00";
        }
        if (event.data["relTypeDropDownVal"] == "2") {
            this.txtTimePeriod = event.data["releaseType"].split(" ")[2];
        }
        else {
            this.txtTimePeriod = "00:00:00";
        }
        this.lstReleaseType = event.data["relTypeDropDownVal"];
        this.arrSpecifiedMultiStepDurPer = [];
        this.arrSpecifiedMultiStepDurPer.push({
            specifiedMultiStepDur: "00:00:00",
            specifiedMultiStepPer: 0
        });
        if (event.data["relScheduleDropDown"] == "1")
            this.txtReleaseDuration = event.data["Schedule"];
        else
            this.txtReleaseDuration = "00:01:00";
        if (event.data["relScheduleDropDown"] == "2")
            this.txtReleaseRate = event.data["Schedule"];
        else
            this.txtReleaseRate = "120";
        if (event.data["relScheduleDropDown"] == "3") {
            let arr = event.data["Schedule"].split(";");
            for (let i = 0; i < arr.length; i++) {
                let arr2 = arr[i].split(",");
                this.arrSpecifiedMultiStepDurPer.push({
                    specifiedMultiStepDur: arr2[0],
                    specifiedMultiStepPer: Number.parseInt(arr2[1])
                });
            }
        }
        this.lstReleaseSchedule = event.data["relScheduleDropDown"];
    }
    onClickAdd() {
        this.showHideDialog = true;
        this.isFromAdd = true;
        this.dialogHeader = "Add Sync Point";
        this.showDefaultValue(); //Passing data by default
    }
    showDefaultValue() {
        //Resetting all values
        this.lstGroupName = _constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_10__["DEFAULT_GROUP"];
        this.lstType = 'Page';
        this.lstActive = true;
        this.lstName = null;
        this.txtParticipatingVuser = 100;
        this.txtReleaseTargetVuser = "";
        this.lstReleaseMode = false;
        this.lstReleaseType = "Target";
        this.lstReleaseSchedule = "Immediate";
        this.txtTimePeriod = "00:00:00";
        this.txtReleaseDuration = "00:01:00";
        this.txtReleaseRate = "120";
        this.releasedForcefully = false;
        let date = moment__WEBPACK_IMPORTED_MODULE_12__["tz"](Date.now(), this.timeZoneId).format('HH:mm:ss_MM/DD/YYYY');
        let curDate = date.split('_');
        this.txtAbsoluteTime = new Date(curDate[1]);
        this.txtAbsolute = curDate[0];
        this.isFrequency = false;
        this.txtFrequency = "00:15:00";
        this.arrSpecifiedMultiStepDurPer = [];
        this.arrSpecifiedMultiStepDurPer.push({
            'specifiedMultiStepDur': "00:00:00",
            'specifiedMultiStepPer': 0
        });
        this.getNameofSelectedType(); //Passing data by default
    }
    onClickUpdate() {
        if (this.selectedRowData.length == 0) {
            this.scenUtilsService.errorMessage("No record is selected  to update");
            return;
        }
        if (this.selectedRowData.length > 1) {
            this.scenUtilsService.errorMessage("Select only one row at a time to update");
            return;
        }
        this.lstReleaseType = this.selectedRowData[0].relTypeDropDownVal;
        this.lstName = this.selectedRowData[0].Name;
        this.showHideDialog = true;
        this.isFromAdd = false;
        this.releasedForcefully = this.selectedRowData[0].CheckReleased == true ? true : false;
        this.dialogHeader = "Update Sync Point";
        this.fillUpdateGUI({ 'data': this.selectedRowData[0] });
    }
    appendData() {
        try {
            let strReleaseType = "";
            let strRelTypeDropDownVal = "";
            if (!this.lstReleaseMode) {
                if (this.lstReleaseType == "1") {
                    if (this.isFrequency)
                        strReleaseType = "(Absolute Time)" + " " + moment__WEBPACK_IMPORTED_MODULE_12__(new Date(this.txtAbsoluteTime)).format('MM/DD/YY') + "-" + this.txtAbsolute + "," + this.txtFrequency; //this.txtAbsoluteTime.toLocaleDateString() + " " + this.txtAbsoluteTime.toTimeString().split(" ")[0];
                    else
                        strReleaseType = "(Absolute Time)" + " " + moment__WEBPACK_IMPORTED_MODULE_12__(new Date(this.txtAbsoluteTime)).format('MM/DD/YY') + "-" + this.txtAbsolute; //this.txtAbsoluteTime.toLocaleDateString() + " " + this.txtAbsoluteTime.toTimeString().split(" ")[0];
                    strRelTypeDropDownVal = "1";
                }
                else if (this.lstReleaseType == "2") {
                    strReleaseType = "(Time Period)" + " " + this.txtTimePeriod;
                    strRelTypeDropDownVal = "2";
                }
                else {
                    strReleaseType = "Target VUsers";
                    strRelTypeDropDownVal = "0";
                }
            }
            else {
                strReleaseType = "-";
            }
            let strSchedule = "";
            let strScheduleDropDownVal = "";
            if (this.lstReleaseSchedule == "1") {
                strSchedule = this.txtReleaseDuration;
                strScheduleDropDownVal = "1";
            }
            else if (this.lstReleaseSchedule == "2") {
                strSchedule = this.txtReleaseRate;
                strScheduleDropDownVal = "2";
            }
            else if (this.lstReleaseSchedule == "3") {
                strScheduleDropDownVal = "3";
                let percentageSum = 0;
                if (this.arrSpecifiedMultiStepDurPer.length < 2) {
                    this.scenUtilsService.errorMessage("For specified multiple-step Duration, duration (in HH:MM: SS format) of release and % of Syncpoint Vusers (not more than 100%) to be released is mandatory field.");
                    return;
                }
                for (let i = 1; i < this.arrSpecifiedMultiStepDurPer.length; i++) {
                    let stepDuration = this.arrSpecifiedMultiStepDurPer[i]['specifiedMultiStepDur'].split(":");
                    if (stepDuration.length != 3 || stepDuration[0].split('').length != 2 || stepDuration[1].split('').length != 2 || stepDuration[2].split('').length != 2) {
                        this.scenUtilsService.errorMessage("Enter specfied multi step duration in correct format (HH:MM:SS).");
                        return false;
                    }
                    else if (this.arrSpecifiedMultiStepDurPer[i]['specifiedMultiStepDur'] == "00:00:00") {
                        this.scenUtilsService.errorMessage("Multi-step duration is mandatory (HH:MM:SS).");
                        return false;
                    }
                    else if (this.arrSpecifiedMultiStepDurPer[i]['specifiedMultiStepPer'] <= 0 || this.arrSpecifiedMultiStepDurPer[i]['specifiedMultiStepPer'] > 100) {
                        this.scenUtilsService.errorMessage("Specfied Mutli step percent should be in between 0-100.");
                        return false;
                    }
                    if (i != this.arrSpecifiedMultiStepDurPer.length - 1)
                        strSchedule += this.arrSpecifiedMultiStepDurPer[i]['specifiedMultiStepDur'] + "," + this.arrSpecifiedMultiStepDurPer[i]['specifiedMultiStepPer'] + ";";
                    else
                        strSchedule += this.arrSpecifiedMultiStepDurPer[i]['specifiedMultiStepDur'] + "," + this.arrSpecifiedMultiStepDurPer[i]['specifiedMultiStepPer'];
                    percentageSum += this.arrSpecifiedMultiStepDurPer[i]['specifiedMultiStepPer'];
                }
                if (percentageSum > 100) {
                    this.scenUtilsService.errorMessage("Sum of specfied multi step percentage cannot be greater than 100.");
                    return false;
                }
            }
            else {
                strSchedule = "Immediate";
                strScheduleDropDownVal = "0";
            }
            let checkReleased = "";
            if (this.lstReleaseType != "0") {
                if (this.releasedForcefully == true) {
                    checkReleased = "1";
                }
                else {
                    checkReleased = "0";
                }
            }
            else {
                checkReleased = "0";
            }
            if (this.isFromAdd) {
                if (this.validatTableData(false, -1) == false)
                    return;
                this.tableValueSyncPoint = _commons_immutable_array__WEBPACK_IMPORTED_MODULE_13__["ImmutableArray"].push(this.tableValueSyncPoint, { GroupName: this.lstGroupName, Type: this.lstType, Name: this.lstName, Active: this.lstActive == true ? "Yes" : "No", ParticipatingVUsersPct: this.txtParticipatingVuser, ReleaseTargetVUsers: this.txtReleaseTargetVuser, Scripts: this.scriptlabel, Mode: this.lstReleaseMode != true ? "Auto" : "Manual", releaseType: strReleaseType, Schedule: strSchedule, relTypeDropDownVal: strRelTypeDropDownVal, relScheduleDropDown: strScheduleDropDownVal, CheckReleased: checkReleased });
                this.showDefaultValue();
            }
            else {
                let index = this.tableValueSyncPoint.indexOf(this.selectedRowData[0]);
                if (this.validatTableData(true, index) == false)
                    return;
                this.tableValueSyncPoint = _commons_immutable_array__WEBPACK_IMPORTED_MODULE_13__["ImmutableArray"].replace(this.tableValueSyncPoint, { GroupName: this.lstGroupName, Type: this.lstType, Name: this.lstName, Active: this.lstActive == true ? "Yes" : "No", ParticipatingVUsersPct: this.txtParticipatingVuser, ReleaseTargetVUsers: this.txtReleaseTargetVuser, Scripts: this.scriptlabel, Mode: this.lstReleaseMode != true ? "Auto" : "Manual", releaseType: strReleaseType, Schedule: strSchedule, relTypeDropDownVal: strRelTypeDropDownVal, relScheduleDropDown: strScheduleDropDownVal, CheckReleased: checkReleased }, index);
            }
            this.selectedRowData = [];
            this.showHideDialog = false;
        }
        catch (e) {
            console.log("Sync Point | appendData = ", e);
        }
    }
    /**
   * This methos is to validate the data from the table row when added or updated.
   */
    validatTableData(isUpdate, updateIndex) {
        if (this.lstGroupName == undefined || this.lstGroupName == "") {
            this.scenUtilsService.errorMessage("Select group name.");
            return false;
        }
        if (this.lstType == undefined || this.lstType == "") {
            this.scenUtilsService.errorMessage("Select type.");
            return false;
        }
        if (this.lstName == undefined || this.lstName == "") {
            let type = "Page";
            if (this.lstType == "Page")
                type = "Page";
            else if (this.lstType == "Transaction")
                type = "Transaction";
            else if (this.lstType == "Script")
                type = "Script";
            else
                type = "API";
            this.scenUtilsService.errorMessage(`Select ${type} name.`);
            return false;
        }
        if (this.txtParticipatingVuser == undefined || this.txtParticipatingVuser == null) {
            this.scenUtilsService.errorMessage("Please enter percentage");
            return false;
        }
        if (Number(this.txtParticipatingVuser) > 100 || Number(this.txtParticipatingVuser) <= 0) {
            this.scenUtilsService.errorMessage("Percentage should be greater than 0 and less than 100");
            return false;
        }
        if (this.txtReleaseTargetVuser == undefined || this.txtReleaseTargetVuser == "") {
            this.scenUtilsService.errorMessage("Please enter value for Release target VUser");
            return false;
        }
        let pattern = /^[\d,]{0,}((,[\d]+)|(,[*]{1})|([\d]+))$/;
        if (this.txtReleaseTargetVuser == "0") {
            this.scenUtilsService.errorMessage("Release target VUser cannot be zero.");
            return false;
        }
        if (!pattern.test(this.txtReleaseTargetVuser)) {
            this.scenUtilsService.errorMessage("Please enter valid value for Release target VUser. Release target VUser should start with a number and can be separated by ,(comma) and may end with *(asteric).");
            return false;
        }
        if (this.txtReleaseTargetVuser.split(",").some(ele => !isNaN(parseInt(ele)) ? parseInt(ele) == 0 : false)) {
            this.scenUtilsService.errorMessage("Please enter valid value for Release target VUser. Release target VUser cannot be zero.");
            return false;
        }
        let tmpArr = this.txtReleaseTargetVuser.split(",");
        let grpData = this.schData.groupDataList;
        let vuserNum = 0;
        for (let j = 0; j < grpData.length; j++) {
            vuserNum += grpData[j].numVUser;
        }
        for (let i = 0; i < tmpArr.length; i++) {
            if (this.lstGroupName == "ALL") {
                if (parseInt(tmpArr[i]) > vuserNum) {
                    this.scenUtilsService.errorMessage("Number of Release Target VUser cannot be greater than the total number of VUser's.");
                    return false;
                }
            }
            else {
                for (let j = 0; j < grpData.length; j++) {
                    if (this.lstGroupName == grpData[j]["groupName"]) {
                        if (tmpArr[i].endsWith("*"))
                            tmpArr[i] = tmpArr[i].replace("*", "");
                        if (parseInt(tmpArr[i]) > grpData[j].numVUser) {
                            this.scenUtilsService.errorMessage("Number of Release Target VUser cannot be greater than the VUser in group " + this.lstGroupName);
                            return false;
                        }
                    }
                }
            }
        }
        if (this.scriptlabel == undefined || this.scriptlabel == "") {
            this.scenUtilsService.errorMessage("Select script label.");
            return false;
        }
        /**This validation is to chek wether the entry is already exixst or not*/
        for (var i = 0; i < this.tableValueSyncPoint.length; i++) {
            var rowdata = this.tableValueSyncPoint[i];
            if (isUpdate && (i == updateIndex))
                continue;
            if (rowdata.GroupName == this.lstGroupName && rowdata.Name == this.lstName && rowdata.Type == this.lstType) {
                this.scenUtilsService.errorMessage("Record with the same key ( " + this.lstGroupName + " , " + this.lstName + " , " + this.lstType + " ) already exist");
                return false;
            }
            if (this.lstGroupName == "ALL") {
                for (let j = 0; j < this.grpListArr.length; j++) {
                    if (rowdata.Name == this.lstName && rowdata.Type == this.lstType && rowdata.GroupName == this.grpListArr[j]["groupName"]) {
                        this.scenUtilsService.errorMessage("Record with the key ( " + this.lstName + " , " + this.lstType + " ) already exists with group name " + rowdata.GroupName);
                        return false;
                    }
                }
            }
            else {
                if (rowdata.Name == this.lstName && rowdata.Type == this.lstType && rowdata.GroupName == "ALL") {
                    this.scenUtilsService.errorMessage("Record with the key ( " + this.lstName + " , " + this.lstType + " ) already exists with group name " + rowdata.GroupName);
                    return false;
                }
            }
        }
        if (!this.lstReleaseMode) {
            if (this.lstReleaseType == "1") {
                if (this.validateAbsoluteTime() == false) {
                    return false;
                }
            }
            if (this.lstReleaseType == "2") {
                if (this.isValidDate(this.txtTimePeriod) == false) {
                    return false;
                }
            }
        }
        if (this.lstReleaseSchedule == "1") {
            if (this.isValidDate(this.txtReleaseDuration) == false) {
                return false;
            }
        }
        if (this.lstReleaseSchedule == "2") {
            if (this.txtReleaseRate.length < 0 || this.txtReleaseRate == "0") {
                this.scenUtilsService.errorMessage("Release Target VUsers cannot be less than or equal to 0");
                return false;
            }
        }
        return true;
    }
    getDateString(dateString) {
        let arr = dateString.split(" ");
        let month = arr[1];
        let date = arr[2];
        let year = arr[3];
        let monthNum = "01";
        switch (month) {
            case 'Jan':
                monthNum = "01";
                break;
            case 'Feb':
                monthNum = "02";
                break;
            case 'Mar':
                monthNum = "03";
                break;
            case 'Apr':
                monthNum = "04";
                break;
            case 'May':
                monthNum = "05";
                break;
            case 'Jun':
                monthNum = "06";
                break;
            case 'Jul':
                monthNum = "07";
                break;
            case 'Aug':
                monthNum = "08";
                break;
            case 'Sep':
                monthNum = "09";
                break;
            case 'Oct':
                monthNum = "10";
                break;
            case 'Nov':
                monthNum = "11";
                break;
            case 'Dec':
                monthNum = "12";
                break;
        }
        return monthNum + "/" + date + "/" + year;
    }
    validateAbsoluteTime() {
        let date = moment__WEBPACK_IMPORTED_MODULE_12__["tz"](Date.now(), this.timeZoneId).format('HH:mm:ss_MM/DD/YYYY');
        let curDate = date.split('_');
        let stTime = curDate[0];
        let stDate = curDate[1];
        /*converting date to format. */
        let absoluteDate;
        let currString;
        /**check a time */
        if (!/[0-9][0-9]:[0-5][0-9]:[0-5][0-9]/.test(this.txtAbsolute)) {
            this.scenUtilsService.errorMessage("Absolute time format should be HH:MM:SS.");
            return false;
        }
        absoluteDate = this.txtAbsolute + ' ' + this.getDateString(this.txtAbsoluteTime.toDateString());
        currString = stTime + ' ' + stDate;
        if (new Date(absoluteDate).getTime() < new Date(currString).getTime()) {
            this.scenUtilsService.errorMessage("Absolute date/time can not be less than Current date/time.");
            return false;
        }
        if (this.isFrequency) {
            if (!/[0-9][0-9]:[0-5][0-9]:[0-5][0-9]/.test(this.txtFrequency)) {
                this.scenUtilsService.errorMessage("Frequency time format should be HH:MM:SS.");
                return false;
            }
        }
        if (this.lstReleaseSchedule == "1") {
            let releaseDurDate = new Date("1/1/1972 " + this.txtReleaseDuration);
            let freqeuncyDate = new Date("1/1/1972 " + this.txtFrequency);
            if (freqeuncyDate < releaseDurDate) {
                this.scenUtilsService.errorMessage("Frequency is less than duration.");
                return false;
            }
        }
        if (this.lstReleaseSchedule == "3") {
            for (let i = 1; i < this.arrSpecifiedMultiStepDurPer.length; i++) {
                if (!/[0-9][0-9]:[0-5][0-9]:[0-5][0-9]/.test(this.arrSpecifiedMultiStepDurPer[i]["specifiedMultiStepDur"])) {
                    this.scenUtilsService.errorMessage("Specified multi-step duration format should be HH:MM:SS.");
                    return false;
                }
            }
        }
        return true;
    }
    /**
   * Filling GUI on load
   */
    fillDataInComp() {
        let rampDownArr = this.arrKeywordData;
        this.enableDisKeywordList.SYNC_POINT = this.dataService.isCompEnable(this.dataService.getScenMode(), this.arrKeywordData["SYNC_POINT"], "SYNC_POINT");
        this.enableDisKeywordList.SYNC_POINT_TIME_OUT = this.dataService.isCompEnable(this.dataService.getScenMode(), this.arrKeywordData["SYNC_POINT_TIME_OUT"], "SYNC_POINT_TIME_OUT");
        this.enableDisKeywordList.ENABLE_SYNC_POINT = this.dataService.isCompEnable(this.dataService.getScenMode(), this.arrKeywordData["ENABLE_SYNC_POINT"], "ENABLE_SYNC_POINT");
        /*Is scenario file have ENABLE_SYNC_POINT = 1 means we have to select the check box.*/
        if (rampDownArr["ENABLE_SYNC_POINT"]["data"]["_G"][0][0] == "1")
            this.chkOver = true;
        else
            this.chkOver = false;
        if (Object.keys(rampDownArr["SYNC_POINT_TIME_OUT"].data).length != 0) {
            var overallTime = rampDownArr["SYNC_POINT_TIME_OUT"].data["_G"][0][0];
            var maxTimeAllowed = rampDownArr["SYNC_POINT_TIME_OUT"].data["_G"][0][1];
            this.txtOATO = overallTime;
            this.txtIATO = maxTimeAllowed;
        }
        else {
            var defTimeVal = rampDownArr["SYNC_POINT_TIME_OUT"].defVal.split(" ");
            var overallTime = defTimeVal[0];
            var maxTimeAllowed = defTimeVal[1];
            this.txtOATO = overallTime;
            this.txtIATO = maxTimeAllowed;
        }
        if (Object.keys(rampDownArr["SYNC_POINT"].data).length != 0) {
            for (var j = 0; j < this.lstOptGroupName.length; j++) {
                let groupName = this.lstOptGroupName[j].value;
                var tableDataArr = rampDownArr["SYNC_POINT"].data[groupName];
                if (tableDataArr != undefined) {
                    for (var k = 0; k < tableDataArr.length; k++) {
                        var tableData = tableDataArr[k];
                        if (tableData != undefined) {
                            let type = "";
                            if (tableData[0] == 0)
                                type = "Transaction";
                            else if (tableData[0] == 1)
                                type = "Page";
                            else if (tableData[0] == 2)
                                type = "Script";
                            else
                                type = "API";
                            let active = "";
                            if (tableData[2] == 1)
                                active = "Yes";
                            else
                                active = "No";
                            let mode = "";
                            if (tableData[6] == 0) {
                                mode = "Auto";
                            }
                            else {
                                mode = "Manual";
                            }
                            let releaseManSchedule = "";
                            let releaseType = "";
                            let relScheduleDropDown = "";
                            let releasedForcefully = false;
                            if (tableData[6] == "1") {
                                releasedForcefully = tableData[9] == "0" ? false : true;
                                relScheduleDropDown = tableData[10];
                                releaseManSchedule = tableData[11] == "NA" ? "Immediate" : tableData[11];
                                releaseType = "-";
                            }
                            else if (tableData[6] == "0" && tableData[7] == "1") {
                                releaseType = "(Absolute Time) " + tableData[8];
                                releasedForcefully = tableData[9] == "0" ? false : true;
                                relScheduleDropDown = tableData[10];
                                releaseManSchedule = tableData[11] == "NA" ? "Immediate" : tableData[11];
                            }
                            else if (tableData[6] == "0" && tableData[7] == "0") {
                                releaseType = tableData[8] == "NA" ? "Target VUsers" : tableData[8];
                                releasedForcefully = tableData[9] == "0" ? false : true;
                                relScheduleDropDown = tableData[10];
                                releaseManSchedule = tableData[11] == "NA" ? "Immediate" : tableData[11];
                            }
                            else {
                                releaseType = "(Time Period) " + tableData[8]; //+ " " + tableData[9];
                                releasedForcefully = tableData[9] == "0" ? false : true;
                                relScheduleDropDown = tableData[10];
                                releaseManSchedule = tableData[11] == "NA" ? "Immediate" : tableData[11];
                            }
                            this.tableValueSyncPoint = [...this.tableValueSyncPoint, { GroupName: groupName, Type: type, Name: tableData[1], Active: active, ParticipatingVUsersPct: tableData[3], ReleaseTargetVUsers: tableData[4], Scripts: tableData[5], Mode: mode, releaseType, Schedule: releaseManSchedule, relTypeDropDownVal: tableData[7], relScheduleDropDown, CheckReleased: releasedForcefully }];
                        }
                    }
                }
            }
        }
    }
    /**
     * This method is used to store the data in the .conf file after validating properly..
     */
    validateAndSetKeywordArray() {
        if (this.validateEnableDisableSyncPoint() == false)
            return false;
        if (this.validateSyncPointTimeOut() == false)
            return false;
        if (this.validateSyncPointGroupBased() == false)
            return false;
        //All validation success
        for (let i = 0; i < this.screenKeywordList.length; i++) {
            this.schData.saveKeywordData[this.screenKeywordList[i]] = this.arrKeywordData[this.screenKeywordList[i]].data;
        }
        return true;
    }
    /**
     * This method is to set the ENABLE_SYNC_POINT keyword in the .conf file.
     */
    validateEnableDisableSyncPoint() {
        let tempObj = [];
        if (this.chkOver)
            tempObj.push(1);
        else
            tempObj.push(0);
        this.setArrayWithKeyWordForScaler("ENABLE_SYNC_POINT", tempObj);
        return true;
    }
    /**
     * This method is to set the SYNC_POINT_TIME_OUT keyword in the .conf file.
     */
    validateSyncPointTimeOut() {
        let tempObj = [];
        let txtHH = this.txtOATO.split(":")[0];
        let txtMM = this.txtOATO.split(":")[1];
        let txtSS = this.txtOATO.split(":")[2];
        let txtMaxHH = this.txtIATO.split(":")[0];
        let txtMaxMM = this.txtIATO.split(":")[1];
        let txtMaxSS = this.txtIATO.split(":")[2];
        //Validation for time 
        // Bug Id: 24596
        if (!this.txtOATO) {
            this.scenUtilsService.errorMessage("Overall time at sync point (OATO) cannot be blank");
            return false;
        }
        if (!this.txtIATO) {
            this.scenUtilsService.errorMessage("Maximum time at sync point (IATO) cannot be blank");
            return false;
        }
        if (txtHH.length != 2 || txtMM.length != 2 || txtSS.length != 2) {
            this.scenUtilsService.errorMessage("Overall time at syncpoint (OATO) should be in correct format(HH:MM:SS).");
            return false;
        }
        if (txtMaxHH.length != 2 || txtMaxMM.length != 2 || txtMaxSS.length != 2) {
            this.scenUtilsService.errorMessage("Maximum time at sync point (IATO) should be in correct format(HH:MM:SS).");
            return false;
        }
        if ((Number.parseInt(txtMM) < 0 || Number.parseInt(txtMM) > 59) || (Number.parseInt(txtMaxMM) < 0 || Number.parseInt(txtMaxMM) > 59)) {
            this.scenUtilsService.errorMessage("Minute can not be less than 0 and greater then 59");
            return false;
        }
        if ((Number.parseInt(txtSS) < 0 || Number.parseInt(txtSS) > 59) || (Number.parseInt(txtMaxSS) < 0 || Number.parseInt(txtMaxSS) > 59)) {
            this.scenUtilsService.errorMessage("Second can not be less than 0 and greater then 59");
            return false;
        }
        if (Number.parseInt(txtHH) < 0 || Number.parseInt(txtMaxHH) < 0) {
            this.scenUtilsService.errorMessage("Second can not be less than 0");
            return false;
        }
        tempObj.push(txtHH + ":" + txtMM + ":" + txtSS);
        tempObj.push(txtMaxHH + ":" + txtMaxMM + ":" + txtMaxSS);
        this.setArrayWithKeyWordForScaler("SYNC_POINT_TIME_OUT", tempObj);
        return true;
    }
    getValueBasisOfType(type) {
        if (type == "Transaction")
            return 0;
        else if (type == "Page")
            return 1;
        else if (type == "Script")
            return 2;
        else
            return 3;
    }
    getValueOfMode(mode) {
        if (mode == "Auto") {
            return 0;
        }
        else {
            return 1;
        }
    }
    getActiveFlagNUmber(active) {
        if (active == "Yes")
            return 1;
        else
            return 0;
    }
    /**
     * This method is to set the SYNC_POINT keyword in the .conf file.
     */
    validateSyncPointGroupBased() {
        //SYNC_POINT ALL 2 tours 1 100 45 tours
        if (this.tableValueSyncPoint != undefined) {
            let listGroupName = [];
            //Evertime clearing SYNC POINT before filling this
            this.setArrayWithKeyWordForSyncPoints("SYNC_POINT", []);
            for (var i = 0; i < this.tableValueSyncPoint.length; i++) {
                let tempObj = [];
                tempObj.push(this.getValueBasisOfType(this.tableValueSyncPoint[i].Type));
                tempObj.push(this.tableValueSyncPoint[i].Name);
                tempObj.push(this.getActiveFlagNUmber(this.tableValueSyncPoint[i].Active));
                tempObj.push(this.tableValueSyncPoint[i].ParticipatingVUsersPct);
                tempObj.push(this.tableValueSyncPoint[i].ReleaseTargetVUsers);
                tempObj.push(this.tableValueSyncPoint[i].Scripts);
                tempObj.push(this.getValueOfMode(this.tableValueSyncPoint[i].Mode));
                if (this.tableValueSyncPoint[i].Mode == "Auto") {
                    if (this.tableValueSyncPoint[i].relTypeDropDownVal == "0") {
                        tempObj.push("0");
                        tempObj.push("NA");
                    }
                    else if (this.tableValueSyncPoint[i].relTypeDropDownVal == "1") {
                        tempObj.push("1");
                        tempObj.push(this.tableValueSyncPoint[i].releaseType.split(" ")[2]);
                    }
                    else {
                        tempObj.push("2");
                        tempObj.push(this.tableValueSyncPoint[i].releaseType.split(" ")[2]);
                    }
                }
                else {
                    tempObj.push("NA");
                    tempObj.push("NA");
                }
                if (this.tableValueSyncPoint[i].relTypeDropDownVal == "1" || this.tableValueSyncPoint[i].relTypeDropDownVal == "2") {
                    if (this.tableValueSyncPoint[i].CheckReleased == "1") {
                        tempObj.push("1");
                    }
                    else {
                        tempObj.push("0");
                    }
                }
                else {
                    tempObj.push("0");
                }
                if (this.tableValueSyncPoint[i].relScheduleDropDown == "0") {
                    tempObj.push("0");
                    tempObj.push("NA");
                }
                else if (this.tableValueSyncPoint[i].relScheduleDropDown == "1") {
                    tempObj.push("1");
                    tempObj.push(this.tableValueSyncPoint[i].Schedule);
                }
                else if (this.tableValueSyncPoint[i].relScheduleDropDown == "2") {
                    tempObj.push("2");
                    tempObj.push(this.tableValueSyncPoint[i].Schedule);
                }
                else {
                    tempObj.push("3");
                    tempObj.push(this.tableValueSyncPoint[i].Schedule);
                }
                var groupName = this.tableValueSyncPoint[i].GroupName;
                listGroupName.push(groupName);
                this.setArrayWithKeyWord("SYNC_POINT", tempObj, groupName, (listGroupName.indexOf(groupName) < 0));
            }
            // }
            //Clearing Sync Point Keyword if table has no Sync List
            if (this.tableValueSyncPoint.length == 0) {
                var tempObj = [];
                this.setArrayWithKeyWordForSyncPoints("SYNC_POINT", tempObj);
            }
        }
        return true;
    }
    /**
     * This is to remove SYNC Point from file if no recored found.
     */
    setArrayWithKeyWordForSyncPoints(keyword, tempObj) {
        let dataObj = this.arrKeywordData[keyword].data;
        if (dataObj != undefined) {
            this.arrKeywordData[keyword][_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_10__["KEYWORD_DATA_KEY"].DATA] = {};
        }
        else {
            this.arrKeywordData[keyword][_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_10__["KEYWORD_DATA_KEY"].DATA] = {};
        }
    }
    /**
  * This method is to set the scaler type keyword in .conf file.
  */
    setArrayWithKeyWord(keyword, temObj, groupName, isFirstTime) {
        let dataObj = this.arrKeywordData[keyword].data;
        if (dataObj[groupName] != undefined) {
            if (isFirstTime)
                dataObj[groupName] = [];
            dataObj[groupName].push(temObj);
        }
        else {
            dataObj[groupName] = [temObj];
        }
    }
    /** this method will set data for 'G_OVERRIDE_RECORDED_THINK_TIME' */
    setArrayWithKeyWordForScaler(keyword, temObj) {
        let dataObj = this.arrKeywordData[keyword].data;
        if (dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_10__["GLOBAL_KEY"]] != undefined) {
            dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_10__["GLOBAL_KEY"]] = [];
            dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_10__["GLOBAL_KEY"]].push(temObj);
        }
        else {
            dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_10__["GLOBAL_KEY"]] = [temObj];
        }
    }
    removeDuplicateUsingFilter(arr) {
        let unique_array = arr.filter(function (elem, index, self) {
            return index == self.indexOf(elem);
        });
        return unique_array;
    }
    getName() {
        if (this.lstType == "Page") {
            for (var i = 0; i < (this.grpListArr.length - 1); i++) {
                if (this.lstGroupName != "ALL") {
                    if (this.grpListArr[i]["groupName"] == this.lstGroupName) {
                        var scriptNames = this.grpListArr[i]["scriptName"];
                        this.scriptlabel = scriptNames;
                    }
                }
            }
        }
        if (this.lstGroupName == "ALL" && this.lstType == "Script") {
            this.scriptlabel = this.lstName;
        }
    }
    isValidDate(dateStr) {
        try {
            if (!this.isValidTimeFormat(dateStr)) {
                return false;
            }
            let dateObj = this.getDateObjFormString(dateStr);
            let hh = dateObj.getHours();
            let mm = dateObj.getMinutes();
            let ss = dateObj.getSeconds();
            if ((hh == 0) && (mm == 0) && (ss == 0)) {
                this.scenUtilsService.errorMessage("Time value cannot be zero");
                return false;
            }
            else if ((hh > 23) && (mm > 59) && (ss > 59)) {
                this.scenUtilsService.errorMessage("Time value cannot be greater than 23:59:59");
                return false;
            }
            return true;
        }
        catch (e) {
            console.trace("dashboard-update-user-session-rate", "isValidDate", "", "", "Exception in isValidDate()", e);
            return false;
        }
    }
    isValidTimeFormat(dateStr) {
        //Regex for 24 hr format: 00:00:00 to 23:59:59
        let patt = /^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/;
        let isValid = patt.test(dateStr);
        if (!isValid) {
            this.scenUtilsService.errorMessage("Please enter valid time format in HH:MM:SS (less than equal to 23:59:59).");
            return false;
        }
        return true;
    }
    getDateObjFormString(strDate) {
        try {
            let tempDate = new Date();
            let date = 1;
            let str = strDate.split(":");
            let hours = +str[0];
            if (hours > this.MAX_HOURS) {
                date = date + Math.floor(hours / this.MAX_HOURS);
                hours = hours % this.MAX_HOURS;
            }
            ;
            tempDate = new Date(this.YEAR, 0, date, hours, +str[1], +str[2]);
            return tempDate;
        }
        catch (error) {
            console.error("RTC Updation", "getDateObjFormString", "", "", "Exception in getDateObjFormString ", error);
            return null;
        }
    }
    onDropDownRelTypeChange() {
        if (this.lstReleaseType == "1") {
            if (this.txtAbsoluteTime == new Date())
                this.txtAbsoluteTime = new Date();
        }
        else if (this.lstReleaseType == "2") {
            if (this.txtTimePeriod == "00:00:00")
                this.txtTimePeriod = "00:00:00";
        }
        this.isFrequencyEnabled();
    }
    onDropDownScheduleChange() {
        if (this.lstReleaseSchedule == "1") {
            if (this.txtReleaseDuration == "00:00:00")
                this.txtReleaseDuration = "00:00:00";
        }
        else if (this.lstReleaseSchedule == "2") {
            if (this.txtReleaseRate == "")
                this.txtReleaseRate = "";
        }
    }
    isFrequencyEnabled() {
        if (this.txtReleaseTargetVuser.indexOf(",") != -1 && this.lstReleaseType == "1" && !this.lstReleaseMode)
            this.isFrequency = true;
        else
            this.isFrequency = false;
    }
    validateQty(event) {
        if (event.charCode > 31 && (event.charCode < 48 || event.charCode > 57))
            return false;
        return true;
    }
    validateQtyForParticipatingVuser(event) {
        if (event.charCode > 31 && (event.charCode < 48 || event.charCode > 57) && event.charCode != 46)
            return false;
        return true;
    }
    validateQtyForReleaseTargetUserField(event, isFromUpdate) {
        if (!isFromUpdate) {
            if (event.charCode > 31 && (event.charCode < 48 || event.charCode > 57) && event.charCode != 42 && event.charCode != 44)
                return false;
        }
        this.isFrequencyEnabled();
        return true;
    }
    validateInputForRelTargetVuser(event) {
        let selection = this.relTargetVuser.nativeElement.selectionEnd - this.relTargetVuser.nativeElement.selectionStart;
        if (event.charCode > 31 && (event.charCode < 48 || event.charCode > 57) && event.charCode != 42 && event.charCode != 44)
            return false;
        if (selection != 0)
            return true;
        if (this.txtReleaseTargetVuser.endsWith(",") && event.charCode == 44)
            return false;
        if (this.txtReleaseTargetVuser.endsWith("*"))
            return false;
    }
    syncPointAutoClicked() {
        this.isFrequencyEnabled();
    }
    validateQtyForReleaseRate(event) {
        if ((event.charCode >= 48 && event.charCode <= 57)) {
            return true;
        }
        return false;
    }
    addStepDuration() {
        let specifiedMultiStepDur = this.arrSpecifiedMultiStepDurPer[0]['specifiedMultiStepDur'];
        let specifiedMultiStepPer = this.arrSpecifiedMultiStepDurPer[0]['specifiedMultiStepPer'];
        if (specifiedMultiStepDur == "00:00:00") {
            this.scenUtilsService.errorMessage("Multi-step duration is mandatory (HH:MM:SS).");
            return;
        }
        if (specifiedMultiStepPer == 0) {
            this.scenUtilsService.errorMessage("Multi-step percent is mandatory.");
            return;
        }
        this.arrSpecifiedMultiStepDurPer.unshift({
            'specifiedMultiStepDur': "00:00:00",
            'specifiedMultiStepPer': 0
        });
    }
    deleteStepDuration(index) {
        this.arrSpecifiedMultiStepDurPer = this.arrSpecifiedMultiStepDurPer.filter((ele, i) => {
            return index != i;
        });
    }
    ngOnDestroy() {
        if (this.subscription)
            this.subscription.unsubscribe();
    }
    deleteSyncpoint(rowData) {
        if (rowData) {
            this.selectedRowData = rowData;
        }
        if (this.selectedRowData == null || this.selectedRowData.length == 0) {
            this.scenUtilsService.errorMessage("Select at least one record to delete");
            return;
        }
        else {
            this.confirmationService.confirm({
                message: 'Do you want to delete the selected records?',
                header: 'Delete Confirmation',
                icon: 'fa fa-trash',
                key: 'additionalBasedConfirm',
                accept: () => {
                    this.deleteRecords();
                    this.scenUtilsService.successMessage('Sync points deleted successfully.');
                },
                reject: () => {
                    this.selectedRowData = [];
                    this.showDefaultValue();
                }
            });
        }
    }
    deleteRecords() {
        for (let i = 0; i < this.selectedRowData.length; i++) {
            let index = this.tableValueSyncPoint.indexOf(this.selectedRowData[i]); //getting index of checked row
            if (index != -1) {
                this.tableValueSyncPoint = _commons_immutable_array__WEBPACK_IMPORTED_MODULE_13__["ImmutableArray"].delete(this.tableValueSyncPoint, index);
                this.page_name_check.splice(index - 1, 1);
                this.selectedRowData.splice(i, 1);
                i = i - 1;
            }
        }
        this.selectedRowData = [];
        this.showDefaultValue();
    }
    editSyncpoint() {
        if (this.selectedRowData.length == 0) {
            this.scenUtilsService.errorMessage("No record is selected  to update");
            return;
        }
        if (this.selectedRowData.length > 1) {
            this.scenUtilsService.errorMessage("Select only one row at a time to update");
            return;
        }
        this.lstReleaseType = this.selectedRowData[0].relTypeDropDownVal;
        this.lstName = this.selectedRowData[0].Name;
        this.showHideDialog = true;
        this.isFromAdd = false;
        this.releasedForcefully = this.selectedRowData[0].CheckReleased == true ? true : false;
        this.dialogHeader = "Update Sync Point";
        this.fillUpdateGUI({ 'data': this.selectedRowData[0] });
    }
    onMenuClick(rowData) {
        this.selectedRowData = [rowData];
    }
};
AdditionalSyncpointsComponent.ctorParameters = () => [
    { type: _service_scen_keyword_definition_service__WEBPACK_IMPORTED_MODULE_6__["ScenKeywordDefinitionService"] },
    { type: _service_additional_setting_data_service__WEBPACK_IMPORTED_MODULE_5__["AdditionalSettingsDataService"] },
    { type: primeng__WEBPACK_IMPORTED_MODULE_2__["ConfirmationService"] },
    { type: _service_scenario_utils_service__WEBPACK_IMPORTED_MODULE_8__["ScenarioUtilsService"] },
    { type: _service_sch_schedule_data_service__WEBPACK_IMPORTED_MODULE_9__["SchScheduleDataService"] },
    { type: _service_scenario_http_service__WEBPACK_IMPORTED_MODULE_7__["ScenarioHttpService"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_3__["SessionService"] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])("relTargetVuser")
], AdditionalSyncpointsComponent.prototype, "relTargetVuser", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])('matMenu')
], AdditionalSyncpointsComponent.prototype, "matMenu", void 0);
AdditionalSyncpointsComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-additional-syncpoints',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./additional-syncpoints.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./additional-syncpoints.component.scss */ "./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.component.scss")).default]
    })
], AdditionalSyncpointsComponent);



/***/ }),

/***/ "./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.module.ts":
/*!***************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.module.ts ***!
  \***************************************************************************************************************/
/*! exports provided: AdditionalSyncpointsModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdditionalSyncpointsModule", function() { return AdditionalSyncpointsModule; });
/* 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 _additional_syncpoints_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./additional-syncpoints.component */ "./src/app/pages/scenario/additional-settings-main/additional-syncpoints/additional-syncpoints.component.ts");
/* harmony import */ var _interface_scenario_routing_guard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../interface/scenario-routing-guard */ "./src/app/pages/scenario/interface/scenario-routing-guard.ts");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var _angular_material_menu__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/menu */ "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/menu.js");
/* harmony import */ var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/shared/cav-table/cav-table.module */ "./src/app/shared/cav-table/cav-table.module.ts");










const route = [
    { path: '', component: _additional_syncpoints_component__WEBPACK_IMPORTED_MODULE_3__["AdditionalSyncpointsComponent"], canDeactivate: [_interface_scenario_routing_guard__WEBPACK_IMPORTED_MODULE_4__["ScenRoutingGuard"]] }
];
let AdditionalSyncpointsModule = class AdditionalSyncpointsModule {
};
AdditionalSyncpointsModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [_additional_syncpoints_component__WEBPACK_IMPORTED_MODULE_3__["AdditionalSyncpointsComponent"]],
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["FileUploadModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["DialogModule"],
            _angular_forms__WEBPACK_IMPORTED_MODULE_6__["FormsModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["DropdownModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["ButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["AccordionModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["BreadcrumbModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["SelectButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["InputTextModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["MultiSelectModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TableModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["CardModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["CheckboxModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["MessageModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["RadioButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["SpinnerModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TooltipModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["PanelModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["CalendarModule"],
            _angular_material_menu__WEBPACK_IMPORTED_MODULE_8__["MatMenuModule"],
            _angular_router__WEBPACK_IMPORTED_MODULE_7__["RouterModule"].forChild(route),
            src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_9__["CavTableModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["MenuModule"]
        ],
        exports: [_additional_syncpoints_component__WEBPACK_IMPORTED_MODULE_3__["AdditionalSyncpointsComponent"]]
    })
], AdditionalSyncpointsModule);



/***/ })

}]);