(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["configure-monitors-add-custom-monitor-generic-rest-monitor-generic-rest-monitor-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.component.html":
/*!********************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.component.html ***!
  \********************************************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<p-panel [toggleable]=\"true\" styleClass=\"mb-16 net-panel1\">\n    <p-header>\n        <div class=\"p-grid p-align-center\">\n            <span class=\"ui-panel-title text-uppercase font-16 ml-8\">ADD METRIC</span>\n            <!-- <button type=\"button\" pButton class=\"ml-5 btn-icon font-16\" icon=\"icons8 icons8-help\"></button> -->\n        </div>\n    </p-header>\n\n    <form #groupForm=\"ngForm\" (ngSubmit)=\"addMetricData()\" ngNativeValidate>\n        <!-- <div class=\"p-grid p-align-center\">\n      <div class=\"p-col-3\">\n          <label>Use subject name form subject</label>\n      </div>\n      <div class=\"p-col-3\">\n          <p-selectButton class=\"ml-3 radio-selectButton\" name=\"metricSub\" (onChange)=\"onAliasChange()\" [options]=\"metricSubject\" [(ngModel)]=\"selectedMetricSubject\">\n          </p-selectButton>\n      </div>\n      <div class=\"p-col-6 p-grid p-align-center p-justify-end\" *ngIf=\"selectedMetricSubject === 'yes'\">\n          <label class=\"mr-10\">Alias from Subject</label>\n          <p-dropdown [options]=\"aliasValue\" placeholder=\"--Select Subject--\" name=\"aliasChange\" (onChange)=\"onAliasChange()\" [style]=\"{'min-width':'150px', 'max-width':'150px'}\" [(ngModel)]=\"selectAlias\">\n          </p-dropdown>\n      </div>\n  </div> -->\n\n        <div class=\"p-grid mt-12\">\n            <div class=\"p-col-4\">\n                <label class=\"mb-8\">Metric Name\n                    <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"metricPath.show($event)\"\n                        (mouseleave)=\"metricPath.hide()\"></i>\n                </label>\n                <input type=\"text\" class=\"w-100-p\" required name=\"metricName\" [(ngModel)]=\"metricData._mN\"\n                    pTooltip=\"To automatically enter the metric name, click on the required json field that you want to monitor. You can also edit the name manually \"\n                    pInputText>\n            </div>\n            <div class=\"p-col-4\">\n                <label class=\"mb-8\">Metric Path\n                    <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"metricName.show($event)\"\n                        (mouseleave)=\"metricName.hide()\"></i>\n                </label>\n                <input type=\"text\" class=\"w-100-p\" required name=\"metricPath\" [(ngModel)]=\"metricData._mP\"\n                    pTooltip=\"Complete JSON path of the node that has been selected as the metric\" pInputText>\n            </div>\n            <div class=\"p-col-4\">\n                <label class=\"mb-8\">Metric Value\n                    <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"metricValue.show($event)\"\n                        (mouseleave)=\"metricValue.hide()\"></i>\n                </label>\n                <input type=\"text\" class=\"w-100-p\" required name=\"metricValue\" [(ngModel)]=\"metricData._mV\"\n                    pTooltip=\"Current value of the node that has been selected as a metric. This value is dynamic and will change once monitoring is initiated.\"\n                    pInputText disabled>\n            </div>\n            <div class=\"p-col-4 mt-10\">\n                <label class=\"mb-8\">Metric Display Name\n                    <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"metricDisplayName.show($event)\"\n                        (mouseleave)=\"metricDisplayName.hide()\"></i>\n                </label>\n                <input type=\"text\" class=\"w-100-p\" required name=\"metricdisplayName\" [(ngModel)]=\"metricData._mDN\"\n                    pTooltip=\"The name that will be displayed in the metric tree. Filled automatically and can be edited according to your requirement.\"\n                    pInputText>\n            </div>\n            <div class=\"p-col-8 mt-10\">\n                <label class=\"mb-8\">Metric Description\n                    <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"metricDescription.show($event)\"\n                        (mouseleave)=\"metricDescription.hide()\"></i>\n                </label>\n                <input type=\"text\" class=\"w-100-p\" name=\"metricDescription\" [(ngModel)]=\"metricData._metDesc\"\n                    pTooltip=\"Provide description of the metric being monitored.\" pInputText>\n            </div>\n        </div>\n        <div class=\"p-grid\" *ngIf=\"!pending\">\n            <div class=\"p-col-12\">\n                <div class=\"p-grid p-align-center p-col\">\n                    <p-toggleButton [(ngModel)]=\"additionalSettings\" name=\"addSetting\"\n                        offLabel=\"Additional&nbsp;Settings\" onLabel=\"Additional&nbsp;Settings\" onIcon=\"las-minus-square\"\n                        offIcon=\"las-plus-square\" styleClass=\"toggle-button-link\"></p-toggleButton>\n                </div>\n            </div>\n        </div>\n\n        <ng-container *ngIf=\"additionalSettings\">\n            <div class=\"p-grid\">\n                <div class=\"p-col\">\n                    <label class=\"mb-8\">Operation\n                        <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"operation.show($event)\"\n                            (mouseleave)=\"operation.hide()\"></i>\n                    </label>\n                    <p-dropdown [options]=\"operationVal\"\n                        pTooltip=\"\n              Apply one of the available operations that will be performed on the metric and displayed after the operation is applied on the selected metric\"\n                        appendTo=\"body\" name=\"operVal\" [style]=\"{'min-width':'100%'}\" [(ngModel)]=\"metricData._opr\">\n                    </p-dropdown>\n                </div>\n                <div class=\"p-col\">\n                    <label class=\"mb-8\">Data Type\n                        <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"dataType.show($event)\"\n                            (mouseleave)=\"dataType.hide()\"></i>\n                    </label>\n                    <p-dropdown [options]=\"dataTypeVal\"\n                        pTooltip=\"It is a classification that specifies which type of value a variable has\"\n                        [style]=\"{'min-width':'100%'}\" name=\"dataType\" [(ngModel)]=\"metricData._dT\">\n                    </p-dropdown>\n                </div>\n                <div class=\"p-col\">\n                    <label class=\"mb-8\">Metric Formula\n                        <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"metricFormula.show($event)\"\n                            (mouseleave)=\"metricFormula.hide()\"></i>\n                    </label>\n                    <p-dropdown [options]=\"metFormVal\"\n                        pTooltip=\"Convert the captured metric data using one of the formulas. Metric data is shown after applying the selected conversion.\"\n                        name=\"metricForm\" appendTo=\"body\" placeholder=\"--Select--\" [style]=\"{'min-width':'100%'}\"\n                        [(ngModel)]=\"metricData._mF\">\n                    </p-dropdown>\n                </div>\n                <div class=\"p-col\">\n                    <label class=\"mb-8\">Convert From\n                        <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"convertFrom.show($event)\"\n                            (mouseleave)=\"convertFrom.hide()\"></i>\n                    </label>\n                    <p-multiSelect [options]=\"convFromVal\"\n                        pTooltip=\"Convert the metric unit from one format to another. Select the unit that you want to convert via this option.\"\n                        appendTo=\"body\" placeholder=\"--Select--\" [style]=\"{'min-width':'100%'}\" name=\"convFrom\"\n                        [(ngModel)]=\"metricData._cF\">\n                    </p-multiSelect>\n                </div>\n                <div class=\"p-col\">\n                    <label class=\"mb-8\">Convert To\n                        <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"convertTo.show($event)\"\n                            (mouseleave)=\"convertTo.hide()\"></i>\n\n                    </label>\n                    <p-multiSelect [options]=\"convFromVal\"\n                        pTooltip=\"Use this option to convert the metric unit according to your preference. Note that select the correct unit i.e. if you have selected bytes in the convert from option, use a matching unit in the convert to field.\"\n                        appendTo=\"body\" placeholder=\"--Select--\" [style]=\"{'min-width':'100%'}\" name=\"convTo\"\n                        [(ngModel)]=\"metricData._cT\">\n                    </p-multiSelect>\n                </div>\n                <div class=\"p-col-fixed\">\n                    <button type=\"button\" class=\"mt-24\" (click)=\"showDataFromPatternDialog()\" pButton\n                        icon=\"cav database\" [disabled]=\"!isIconDisabledDataFromPattern\"\n                        pTooltip=\"This is used if we want to replace a string data with some pattern values.\"></button>\n                </div>\n            </div>\n        </ng-container>\n        <div class=\"p-grid p-col p-justify-end\">\n            <button type=\"button\" [disabled]=\"customMonService.switchTabs\" pButton class=\"btn-primary-outline\"\n                (click)=\"clearField()\" label=\"{{isEditMetricTable ? 'Cancel' :'Clear Fields'}}\"\n                pTooltip=\"{{isEditMetricTable ? 'Cancel' :'Clear Fields'}}\"></button>&nbsp;&nbsp;\n            <!-- </div> -->\n            <!-- <div class=\"p-grid p-col p-justify-end\">    for making clear and add metric button in one line -->\n            <button type=\"submit\" [disabled]=\"customMonService.switchTabs\" pButton class=\"btn-primary-outline\"\n                label=\"{{isEditMetricTable ? 'Update Metrics' :'Add Metrics'}}\"\n                pTooltip=\"{{isEditMetricTable ? 'Update metric configuration' :'Add metric configuration'}}\"></button>\n        </div>\n        <div class=\"px-5 my-16\">\n            <cav-table [value]=\"addMetData\" [rows]=\"10\" [headerRelativePath]=\"relativePath\"\n                (clickButtonEvent)=\"clickButtonEvent($event)\">\n            </cav-table>\n        </div>\n    </form>\n</p-panel>\n\n\n  <p-overlayPanel #addMetric class=\"popHover\" styleClass=\"width-250\">\n      <h3>Add Metric</h3>\n       <p>In this section, user can add metrics by clicking on node from the response JSON.</p>\n      <!-- <p>Add metric from the list of metrics.</p> -->\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n\n  <p-overlayPanel #metricPath class=\"popHover\" styleClass=\"width-250\">\n      <h3>Metric Path</h3>\n      <p>It is path of the node where user has clicked to get node values from response json.</p>\n      <p>This key is used to configure graph json path.</p>\n      <p>This instance is used to configure metric query path.</p>\n      <!-- <p>This instance is used to configure multiple vector path to create vector name.</p> -->\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n\n  <p-overlayPanel #metricName class=\"popHover\" styleClass=\"width-250\">\n      <h3>Metric Name</h3>\n      <p>It is name of the node clicked from response json.</p>\n      <p> It is key from where we get json metric values.</p>\n\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n\n  <p-overlayPanel #metricValue class=\"popHover\" styleClass=\"width-250\">\n      <h3>Metric Value</h3>\n      <p>This instance is used to show default value if value returned is either string or null.</p>\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n\n  <p-overlayPanel #metricDisplayName class=\"popHover\" styleClass=\"width-250\">\n      <h3>Metric Display Name</h3>\n      <p>This is added Metric Display name.It will be added in GDF and shown in dashboard tree. </p>\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n\n  <p-overlayPanel #metricDescription class=\"popHover\" styleClass=\"width-250\">\n      <h3>Metric Description</h3>\n      <p>This instance is used to configure graphs.</p>\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n\n  <p-overlayPanel #operation class=\"popHover\" styleClass=\"width-250\">\n      <h3>Operation</h3>\n      <p>This is used to configure operation on graph value.</p>\n  </p-overlayPanel>\n\n  <p-overlayPanel #dataType class=\"popHover\" styleClass=\"width-250\">\n      <h3>Data Type</h3>\n      <p>It is a classification that specifies which type of value a variable has.</p>\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n\n  <p-overlayPanel #metricFormula class=\"popHover\" styleClass=\"width-250\">\n      <h3>Metric Formula</h3>\n      <p>This instance is used to configure data conversion using appropriate formula</p>\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n\n  <p-overlayPanel #convertFrom class=\"popHover\" styleClass=\"width-250\">\n      <h3>Convert From</h3>\n      <p>This instance is used to configure convert from. You need to check type of data returned.</p>\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n\n  <p-overlayPanel #convertTo class=\"popHover\" styleClass=\"width-250\">\n      <h3>Convert To</h3>\n      <p>This instance is used to configure data conversion. You need to configure this instance to convert data into.</p>\n      <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n  </p-overlayPanel>\n  <div class=\"confirm-dialog\">\n      <p-confirmDialog #cd class=\"confirmdialog\"  header=\"Confirmation\" key=\"addMetricConDial\" acceptButtonStyleClass=\"ui-button-rounded px-10\" rejectButtonStyleClass=\"ui-button-rounded ui-button-secondary px-10 mx-6\" acceptIcon=\"null\"  rejectIcon=\"null\"  acceptLabel=\"Yes\" rejectLabel=\"No\"></p-confirmDialog>\n      <p-confirmDialog #cd class=\"confirmdialog\"  header=\"Confirmation\" key=\"addMetricConDialOfDFP\" acceptButtonStyleClass=\"ui-button-rounded px-10\" rejectButtonStyleClass=\"ui-button-rounded ui-button-secondary px-10 mx-6\" acceptIcon=\"null\"  rejectIcon=\"null\"  acceptLabel=\"Yes\" rejectLabel=\"No\"></p-confirmDialog>\n      <p-confirmDialog #cd class=\"confirmdialog\"  header=\"Confirmation\" key=\"addMetricConDialOfDFPDeleteAll\" acceptButtonStyleClass=\"ui-button-rounded px-10\" rejectButtonStyleClass=\"ui-button-rounded ui-button-secondary px-10 mx-6\" acceptIcon=\"null\"  rejectIcon=\"null\"  acceptLabel=\"Yes\" rejectLabel=\"No\"></p-confirmDialog>\n  </div>\n  <div class=\"loading-indicator\" *ngIf=\"loading\">\n      <p-progressSpinner [style]=\"{width: '50px', height: '50px'}\" strokeWidth=\"4\" animationDuration=\".5s\">\n      </p-progressSpinner>\n  </div>\n\n<p-dialog header=\"Add data from pattern\" [(visible)]=\"displayDataFromPattern\" [modal]=\"true\" [style]=\"{width: '50vw'}\"\n    [draggable]=\"false\" [resizable]=\"false\" (onHide)=\"clearFieldOfDFP()\">\n    <form #groupForm2=\"ngForm\" (ngSubmit)=\"addData()\" ngNativeValidate>\n        <div class=\"w-100-p mb-8 p-grid p-align-center\">\n            <div class=\"p-col-2 pl-0\">\n                <label>Pattern Value</label>\n            </div>\n            <div class=\"p-col-2 \">\n                <input pTooltip=\"Enter the string that you want to match with a numerical value\" required type=\"text\"\n                    class=\"w-100-p\" name=\"pValue\" [(ngModel)]=\"dataFromPattern.pValue\" pInputText>\n            </div>\n            <div class=\"p-col-2 \">\n                <label>Updated Value </label>\n\n            </div>\n            <div class=\"p-col-2 \">\n                <input type=\"number\" required\n                    pTooltip=\"Enter the numerical value that you want to convert the string value to\"\n                    inputStyleClass=\"w-100-p\" name=\"updatedValue\" [(ngModel)]=\"dataFromPattern.updatedValue\"\n                    min=\"-2147483648\" max=\"2147483647\" pInputText>\n                <!-- <p-spinner title=\"Updated Value is used to replace a pattern matched value with updated value.\" inputStyleClass=\"w-100-p\" name=\"updatedValue\" [(ngModel)]=\"dataFromPattern.updatedValue\" [min]=\"-2147483648\" [max]=\"2147483647\"></p-spinner> -->\n            </div>\n            <div class=\"p-grid p-col-4  p-justify-center p-align-center\">\n                <button type=\"button\" class=\"ui-button btn-primary-outline mx-5\" (click)=\"clearFieldOfDFP()\"\n                    pTooltip=\"{{isEditDataFromPatternTable ? 'Cancel' :'Clear Fields'}}\"\n                    *ngIf=\"isEditDataFromPatternTable\">\n                    {{isEditDataFromPatternTable ? 'Cancel' :'Clear Fields'}}\n                </button>\n                <!-- </div> -->\n                <!-- <div class=\"p-grid p-col p-justify-end\">    for making clear and add metric button in one line -->\n                <button type=\"submit\" [disabled]=\"customMonService.switchTabs\"\n                    class=\"ui-button btn-primary-outline mx-20\"\n                    pTooltip=\"{{isEditDataFromPatternTable ? 'Update data from pattern configuration' :'Add data from pattern configuration'}}\">\n                    {{isEditDataFromPatternTable ? 'Update' :'Add'}}\n                </button>\n            </div>\n        </div>\n    </form>\n\n\n\n    <div class=\"px-5 my-16\">\n        <cav-table [value]=\"addDataFromPattern\" [rows]=\"10\" [headerRelativePath]=\"relativePath2\"\n            (clickButtonEvent)=\"clickButtonEvent2($event)\" [scrollable]=\"true\" scrollHeight=\"calc(100vh - 240px)\"\n            selectionMode=\"multiple \"></cav-table>\n\n    </div>\n    <div class=\"p-grid p-justify-end\">\n\n        <button type=\"button\" class=\"ui-button btn-primary-outline mx-5\" (click)=\"closeDialog()\" pTooltip=\"Close\">\n            OK\n        </button>\n    </div>\n</p-dialog>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.component.html":
/*!**************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.component.html ***!
  \**************************************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<p-panel [toggleable]=\"true\" styleClass=\"mb-16 net-panel1\">\n    <p-header>\n        <div class=\"p-grid p-align-center\">\n            <span class=\"ui-panel-title text-uppercase font-16 ml-8\">Subject Hierarchy</span>\n            <!-- <button type=\"button\" pButton class=\"ml-5 btn-icon font-16\" icon=\"icons8 icons8-help\"></button> -->\n        </div>\n    </p-header>\n\n    <div class=\"p-grid p-align-center\">\n        <div class=\"p-col-3 p-grid p-align-center\">\n            <label>Prefix Tier in Hierarchy</label>\n            <i class=\"ml-5 btn-icon icons8 icons8-info\" (mouseenter)=\"prefixTier.show($event)\"\n                (mouseleave)=\"prefixTier.hide()\"></i>\n        </div>\n\n        <div class=\"p-col-3\">\n            <p-selectButton class=\"ml-3 radio-selectButton\" name=\"tierHierarchy\" pTooltip=\"Add the subject & metric under a tier\" (onChange)=\"onKey()\"\n                [options]=\"tierHierarchy\" [(ngModel)]=\"_selectedTierHierarchy\">\n            </p-selectButton>\n        </div>\n\n        <div class=\"p-col-3 p-grid p-align-center\">\n            <label>Prefix Server in Hierarchy</label>\n            <i class=\"ml-5 btn-icon icons8 icons8-info\" (mouseenter)=\"prefixServer.show($event)\"\n                (mouseleave)=\"prefixServer.hide()\"></i>\n        </div>\n\n        <div class=\"p-col-3\">\n            <p-selectButton class=\"radio-selectButton\" (onChange)=\"onKey()\" name=\"selectServer\"\n            pTooltip=\"Add the subject & metric under a server\"[disabled]=\"_selectedTierHierarchy == 'no'\" [options]=\"serverHierarchy\"\n                [(ngModel)]=\"_selectedServerHierarchy\">\n            </p-selectButton>\n        </div>\n\n        <div class=\"p-col-3\">\n            <label>Fixed Subject Path\n                <i class=\"icons8 icons8-info btn-icon ml-6\" (mouseenter)=\"fixedSubject.show($event)\"\n                    (mouseleave)=\"fixedSubject.hide()\"></i>\n            </label>\n        </div>\n\n        <div class=\"p-col-9\">\n            <input type=\"text\" class=\"w-100-p\" name=\"fixedsubjectPath\" placeholder=\"Fixed Subject Path\"\n               pTooltip=\"This instance is used to hold the list of values received for a default vector name.\" (keyup)=\"onKey()\" [(ngModel)]=\"_fixedSP\" pInputText>\n        </div>\n        <div class=\"p-col-3\">\n            <label>Fixed Subject Value\n                <i class=\"icons8 icons8-info btn-icon ml-6\" (mouseenter)=\"fixedSubject.show($event)\"\n                    (mouseleave)=\"fixedSubject.hide()\"></i>\n            </label>\n        </div>\n\n        <div class=\"p-col-9\">\n            <input type=\"text\" class=\"w-100-p\" name=\"fixedsubjectValue\" [disabled]=\"!_fixedSP\" placeholder=\"Fixed Subject Value\"\n            pTooltip=\"This instance is used to show default value for Fixed Subject Path\" [(ngModel)]=\"_fixedSV\" pInputText>\n        </div>\n        <div class=\"p-col-3\">\n            <label>Current Hierarchy\n                <i class=\"icons8 icons8-info btn-icon ml-6\" (mouseenter)=\"currentHierarchy.show($event)\"\n                    (mouseleave)=\"currentHierarchy.hide()\"></i>\n            </label>\n        </div>\n        <div class=\"p-col-9\">\n            <input type=\"text\" class=\"w-100-p\" [disabled]=\"true\" name=\"currentHierarchy\" required\n            pTooltip=\"Preview of how the subjects & metrics will appear in the metric tree\" [(ngModel)]=\"customMonService._currentHierarchy\" pInputText>\n        </div>\n        <div class=\"p-col-12 p-grid p-align-center\">\n            <i class=\"icons8 icons8-info font-16 text-success mr-5\"></i>\n            <span class=\"text-success font-14 text-italic\">\n                If \"Fixed Subject Path\" is given,\"Fixed Subject Value\" is mandatory.\n            </span>\n        </div>\n    </div>\n</p-panel>\n\n<form #groupForm=\"ngForm\" (ngSubmit)=\"addSubjectData()\" ngNativeValidate>\n    <p-panel [toggleable]=\"true\" styleClass=\"mb-16 net-panel1\">\n        <p-header>\n            <div class=\"p-grid p-align-center\">\n                <span class=\"ui-panel-title text-uppercase font-16 ml-8\">ADD SUBJECT</span>\n                <!-- <button type=\"button\" pButton class=\"ml-5 btn-icon font-16\" icon=\"icons8 icons8-help\"></button> -->\n            </div>\n        </p-header>\n        <div class=\"p-col-12\">\n            <p-checkbox name=\"isMetricMapped\" [(ngModel)]=\"customMonService.isMetricMappedPath\"\n                (onChange)=\"clearTableData()\" pTooltip=\"Subject and metrics are mapped at same path in response JSON.\" label=\"Subject and metrics are mapped at same path in response JSON.\"\n                [binary]=\"true\"></p-checkbox>\n        </div>\n        <div class=\"p-grid mt-12\">\n            <div class=\"p-col-4\">\n                <label class=\"mb-8\">Subject Name\n                    <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"componentName.show($event)\"\n                        (mouseleave)=\"componentName.hide()\"></i>\n                </label>\n                <input type=\"text\" class=\"w-100-p\" name=\"componentName\" pTooltip=\"Click on any node in the response JSON to automatically select the subject name. The name can be manually edited as well.\"\n                    [(ngModel)]=\"SubData.jName\" required pInputText>\n            </div>\n            <div class=\"p-col-4\">\n                <label class=\"mb-8\">Subject Path <i class=\"icons8 icons8-help btn-icon ml-6\"\n                        (mouseenter)=\"jsonPath.show($event)\" (mouseleave)=\"jsonPath.hide()\"></i> </label>\n                <input type=\"text\" class=\"w-100-p\" name=\"jsonPath\" pTooltip=\"JSON path of the selected subject which is automatically entered when you click on a JSON node.\"\n                    [(ngModel)]=\"SubData.jpath\" required pInputText>\n            </div>\n            <div class=\"p-col-4\">\n                <label class=\"mb-8\">Subject Value\n                    <i class=\"icons8 icons8-help btn-icon ml-6\" (mouseenter)=\"componentValue.show($event)\"\n                        (mouseleave)=\"componentValue.hide()\"></i>\n                </label>\n                <input type=\"text\" class=\"w-100-p\" name=\"componentValue\" pTooltip=\"The node value of the selected subject. The monitor picks the subject value dynamically to reflect in the metric tree.\"\n                    [(ngModel)]=\"SubData.jValue\" required pInputText disabled>\n            </div>\n        </div>\n\n        <div class=\"p-grid p-align-center p-col\" *ngIf=\"!customMonService.isMetricMappedPath\">\n            <p-toggleButton [(ngModel)]=\"subjectAdditionalSettings\" name=\"addSetting\"\n                offLabel=\"Additional&nbsp;Settings\" onLabel=\"Additional&nbsp;Settings\" onIcon=\"las-minus-square\"\n                offIcon=\"las-plus-square\" styleClass=\"toggle-button-link\"></p-toggleButton>\n        </div>\n        \n        <div class=\"p-grid p-align-center p-col\" *ngIf=\"subjectAdditionalSettings\">\n            <div>\n                <label class=\"mr-10 ml-6\">Use as</label>\n\n                <p-selectButton [options]=\"parameterList\" class=\"radio-selectButton\" name=\"paramet\" \n                 [(ngModel)]=\"SubData.mode\" (onChange)=\"onModeChange($event)\"></p-selectButton>\n            </div>\n            <div class=\"p-col-12\" *ngIf=\"!disableStr\">\n                <label class=\"mr-10\">Use Substring of subject value by splitting by</label>\n                <p-dropdown [options]=\"separatorValue\" name=\"subString\" placeholder=\"Select\"\n                  pTooltip=\"This instance is used to split a vector name with some key and use some of the part to create vector name. If this instance is configured then pickIndex instance must be configured.\"  [style]=\"{'min-width':'100px', 'max-width':'100px'}\" [(ngModel)]=\"SubData.splitChar\">\n                </p-dropdown>\n                <label class=\"mx-10\">and taking</label>\n                <p-spinner inputStyleClass=\"width-100\" name=\"taking\"  pTooltip=\"This instance is used to pick indexes after splitting query response and create vector name using those indexes. Multiple indexes can be passed using comma as a separator\" [(ngModel)]=\"SubData.pickIndex\"></p-spinner>\n                <label class=\"mx-10\">part</label>\n            </div>\n        </div>\n\n        <div class=\"p-grid p-justify-end p-col\">\n            <button type=\"button\" [disabled]=\"!customMonService.switchTabs\" pButton class=\"btn-primary-outline\"\n                (click)=\"clearField()\" label=\"{{isEditSubjectTable ? 'Cancel' :'Clear Fields'}}\"\n                pTooltip=\"{{isEditSubjectTable ? 'Cancel' :'Clear Fields'}}\"></button>&nbsp;&nbsp;\n            <button type=\"submit\" [disabled]=\"!customMonService.switchTabs\" pButton name=\"addEditButton\"\n                class=\"btn-primary-outline\" label=\"{{isEditSubjectTable ? 'Update Subject' :'Add Subject'}}\"\n                pTooltip=\"{{isEditSubjectTable ? 'Update subject configuration' :'Add subject configuration'}}\"></button>\n        </div>\n\n        <div class=\"px-5 my-16\">\n            <cav-table [value]=\"addSubData\" [rows]=\"10\" [headerRelativePath]=\"relativePath\"\n                (clickButtonEvent)=\"clickButtonEvent($event)\">\n            </cav-table>\n        </div>\n    </p-panel>\n</form>\n\n\n<p-overlayPanel #prefixTier class=\"popHover\" styleClass=\"width-250\">\n    <h3>Prefix Tier</h3>\n    <p>In this section, if selected yes then tier will be added in current hierarchy</p>\n    <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n</p-overlayPanel>\n\n<p-overlayPanel #prefixServer class=\"popHover\" styleClass=\"width-250\">\n    <h3>Prefix Server</h3>\n    <p>In this section, if selected yes then server will be added in current hierarchy</p>\n    <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n</p-overlayPanel>\n\n<p-overlayPanel #fixedSubject class=\"popHover\" styleClass=\"width-250\">\n    <h3>Subject Path</h3>\n    <p>When response JSON is loaded, user will have to click on response json node to select vectors/subject path query.\n    </p>\n    <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n</p-overlayPanel>\n\n<p-overlayPanel #currentHierarchy class=\"popHover\" styleClass=\"width-250\">\n    <h3>Current Hierarchy</h3>\n    <p>In this field updated hierarchy will autofilled once user fills the subject details along with tier/server and\n        default hierarchy. </p>\n    <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n</p-overlayPanel>\n\n<p-overlayPanel #addSubject class=\"popHover\" styleClass=\"width-250\">\n    <h3>Add Subject</h3>\n    <p> In this section user will be selecting nodes from the response JSON used for creating vector.</p>\n    <p>There is an advanced settings section with per Add subject row.</p>\n    <p>This will be reflected as Metadata in hierarchy in GDF. </p>\n    <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n</p-overlayPanel>\n\n<p-overlayPanel #jsonPath class=\"popHover\" styleClass=\"width-250\">\n    <h3>Json Path</h3>\n    <p>This is the path from the response json to create vector.</p>\n</p-overlayPanel>\n\n<p-overlayPanel #componentName class=\"popHover\" styleClass=\"width-250\">\n    <h3>Component Name</h3>\n    <p>When response JSON is loaded, user will have to click on response json node to select vectors/subject path query\n        and its last dot index field will be considered as subject name. </p>\n    <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n</p-overlayPanel>\n\n<p-overlayPanel #componentValue class=\"popHover\" styleClass=\"width-250\">\n    <h3>Component Value</h3>\n    <p>This field will be autofilled when node is selected and its value will be shown here. </p>\n    <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n</p-overlayPanel>\n\n<p-overlayPanel #AddSubject class=\"popHover\" styleClass=\"width-250\">\n    <h3>Add Subject</h3>\n    <p> In this section user will be selecting nodes from the response JSON and those will be used for creating vector.\n    </p>\n    <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n</p-overlayPanel>\n\n<p-overlayPanel #SubjectHierarchy class=\"popHover\" styleClass=\"width-250\">\n    <h3>Subject Hierarchy</h3>\n    <p>In this section we are providing support to select Tier and Server in Hierarchy.</p>\n    <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n</p-overlayPanel>\n<div class=\"confirm-dialog\">\n\n    <p-confirmDialog #cd class=\"confirmdialog\" key=\"execHierConDial\" header=\"Confirmation\"\n        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\n</div>\n<div class=\"confirm-dialog\">\n\n    <p-confirmDialog #cd class=\"confirmdialog\" key=\"clearTableData\" header=\"Confirmation\"\n        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\n</div>\n<div class=\"loading-indicator\" *ngIf=\"loading\">\n    <p-progressSpinner [style]=\"{width: '50px', height: '50px'}\" strokeWidth=\"4\" animationDuration=\".5s\">\n    </p-progressSpinner>\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.component.html":
/*!***********************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.component.html ***!
  \***********************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<p-toolbar class=\"ui-secondary-toolbar\">\n  <div class=\"p-grid p-justify-between p-align-center pl-5 pr-5\">\n    <a routerLink=\"/monitor/custom-monitors/availCustMon/rest\">\n      <span class=\"icons8 icons8-left toolbar-icon-color\"></span>\n    </a>\n    <div class=\"p-col ui-toolbar-text\">Configure REST Monitors</div>\n    <div>\n      <button pButton class=\"ui-button ui-button-rounded ui-button-right\" form=\"ngForm\"\n        (click)=\"saveMode = '1';saveConfiguration()\" label=\"Save\" [disabled]=\"!isAdminPermisson\"\n        pTooltip=\"{{sessionService.noPermissionTitle ? sessionService.noPermissionTitle :'Save'}}\"></button>\n      <button pButton class=\"mx-6 ui-button ui-button-rounded ui-button-right\" form=\"ngForm\"\n        (click)=\"saveMode = '2';saveConfiguration()\" label=\"Save & Deploy\" [disabled]=\"!isAdminPermisson\"\n        pTooltip=\"{{sessionService.noPermissionTitle ? sessionService.noPermissionTitle :'Save & Deploy'}}\"></button>\n    </div>\n  </div>\n</p-toolbar>\n<div class=\"p-grid p-align-stretch generic-container ns-scenario  \">\n  <p-tabView class=\"tabWauto mini-tab w-100-p\">\n    <p-tabPanel header=\"Configure\">\n      <div class=\"p-grid p-align-start\">\n        <div class=\"w-60-p metric-box\">\n          <form #groupForm=\"ngForm\" (ngSubmit)=\"addConfiguration()\" ngNativeValidate>\n            <div class=\"p-grid p-align-center\">\n              <h2 class=\"my-12 font-weight-600\">\n                 Generic Rest Monitor Configuration\n                <i class=\"ml-5 btn-icon font-18 icons8 icons8-help\" (mouseenter)=\"GenericRestUI.show($event)\"\n                  (mouseleave)=\"GenericRestUI.hide()\"></i>\n              </h2>\n            </div>\n\n            <p-panel [toggleable]=\"true\" styleClass=\"mb-16\">\n              <p-header>\n                <div class=\"inline-flex\">\n                <span>Metric Group</span>\n                <i class=\"btn-icon icons8 icons8-help mx-3\" (mouseenter)=\"MetricGroup.show($event)\"\n                (mouseleave)=\"MetricGroup.hide()\"></i>\n                  <!-- <ng-container *ngIf=\"showConfigHeader\">\n                    <div class=\"p-grid p-align-center\">\n                        <span class=\"font-weight-500 ml-15\">Metric Group Name : </span>\n                        <span class=\"font-weight-400 elipseText width-200\" >{{metricGroupName}}</span>\n                        <span class=\"font-weight-500 ml-15\">Description : </span>\n                        <span class=\"font-weight-400 elipseText width-200\" > {{metricDescription}} </span>\n                    </div>\n                </ng-container> -->\n                </div>\n              </p-header>\n\n              <div class=\"p-grid p-align-center p-nogutter8\">\n                <label class=\"p-col-3 p-grid p-align-center required-mark\">Group Name\n                  <i class=\"ml-5 btn-icon icons8 icons8-info\" (mouseenter)=\"metricName.show($event)\"\n                    (mouseleave)=\"metricName.hide()\"></i>\n                </label>\n                <div class=\"p-col-9\">\n                  <input id=\"input\" name=\"metricName\" type=\"text\" pTooltip=\"Enter the metric group under which the configured metrics will be added\" autocomplete=\"off\" [disabled]=\"isFromEdit\"  class=\"w-100-p\" pInputText\n                    [(ngModel)]=\"metricGroupName\" (focusout)=\"validateGrpInfo()\" autofocus required>\n                </div>\n                <label class=\"p-col-3 p-grid p-align-center required-mark\">\n                  Group Description\n                  <i class=\"ml-5 btn-icon icons8 icons8-info\" (mouseenter)=\"metricDescriptionText.show($event)\"\n                    (mouseleave)=\"metricDescriptionText.hide()\"></i>\n                </label>\n                <div class=\"p-col-9\">\n                  <input id=\"input\" type=\"text\" pTooltip=\"Enter the metric group description\" name=\"description\" autocomplete=\"off\" class=\"w-100-p\" pInputText\n                    [(ngModel)]=\"metricDescription\" required>\n                </div>\n              </div>\n            </p-panel>\n\n            <form #groupForm=\"ngForm\" (ngSubmit)=\"addMetricGroupName()\" ngNativeValidate>\n              <p-panel [toggleable]=\"true\" styleClass=\"mb-16\">\n                <p-header>\n                  <div class=\"inline-flex\">\n                    <span >Rest Api</span>\n                    <i class=\"mx-3 btn-icon icons8 icons8-help\" (mouseenter)=\"RestApi.show($event)\"\n                      (mouseleave)=\"RestApi.hide()\"></i>\n                    <!-- <ng-container *ngIf=\"showConfigHeader\">\n                        <div class=\"p-grid p-align-center ml-15 w-80-p\">\n                            <span class=\"font-weight-500\">URL :</span>\n                             <span class=\"font-weight-400 w-90-p ml-5 elipseText\" pTooltip=\"{{restUrl}}\">{{restUrl}}</span> -->\n                    <!-- {{path}}</span> -->\n                    <!-- </div>\n                    </ng-container> -->\n\n                  </div>\n                </p-header>\n                <div class=\"p-grid p-align-center p-nogutter8\">\n                  <div class=\"p-col-12 p-grid p-align-center\">\n                    <i class=\"icons8 icons8-info font-16 text-success mr-5\"></i>\n                    <span class=\"text-success font-14 text-italic\">\n                      Once you click on execute or browse, response json will be shown on the right for configuration of\n                      this monitor\n                    </span>\n\n                  </div>\n                </div>\n\n                <div class=\"p-grid p-align-center p-nogutter8\">\n                  <label class=\"p-col-2 p-grid p-align-center required-mark\">Rest URL\n                    <i class=\"ml-5 btn-icon icons8 icons8-info\" (mouseenter)=\"restUrlPopHover.show($event)\"\n                      (mouseleave)=\"restUrlPopHover.hide()\"></i>\n                  </label>\n                  <!-- <div class=\"p-col-2\">\n            <p-dropdown [options]=\"separatorValue\" [style]=\"{'min-width':'100%'}\"\n            [(ngModel)]=\"selectSeparator\"></p-dropdown>\n        </div> -->\n                  <div class=\"p-col\">\n                    <input id=\"input\" type=\"text\" pTooltip=\"Enter the base URL of the REST API \" name=\"restURL\" pattern=\"^\\S+( +\\S+)*$\" class=\"inpbox w-100-p\"\n                      autocomplete=\"off\" required placeholder=\"eg:http://www.cavisson.com/\" pInputText\n                      [(ngModel)]=\"restUrl\">\n                  </div>\n                  <div class=\"p-col\">\n                    <input id=\"input1\" type=\"text\" pTooltip=\"Enter the remaining API URL Path \" name=\"path\" class=\"w-100-p\" placeholder=\"path\" pInputText\n                      [(ngModel)]=\"path\">\n                  </div>\n                  <div class=\"p-col\" *ngIf=\"isParameterSelected\">\n\n                    <p-dropdown name=\"logFileName\" [options]=\"parameterList\" [(ngModel)]=\"selectedParameter\"\n                      placeholder=\"Select Parameter\" (onChange)=\"onChangeParameter()\" (onClick) = \"onParameterClick()\">\n\n                    </p-dropdown>\n\n                  </div>\n                  <div class=\"w-100-p p-grid p-align-center\" *ngIf=\"isShowFinalURL\">\n                    <label class=\"p-col-2 p-grid p-align-center\">\n                      Final URL\n                      <i class=\"ml-5 btn-icon icons8 icons8-info\" (mouseenter)=\"finalUrlPopHover.show($event)\"\n                        (mouseleave)=\"finalUrlPopHover.hide()\"></i>\n\n                    </label>\n                    <div class=\"p-col\">\n                      <input id=\"input1\" type=\"text\" name=\"finalURL\" class=\"w-100-p\" pInputText [(ngModel)]=\"finalURL\">\n\n                    </div>\n                  </div>\n                </div>\n\n\n                <div class=\"p-grid p-align-center p-col\">\n                  <p-toggleButton [(ngModel)]=\"additionalSettings\" name=\"addSettin\" offLabel=\"Additional&nbsp;Settings\"\n                    onLabel=\"Additional&nbsp;Settings\" onIcon=\"las-minus-square\" offIcon=\"las-plus-square\"\n                    styleClass=\"toggle-button-link\"></p-toggleButton>\n                </div>\n\n\n\n                <ng-container *ngIf=\"additionalSettings\">\n                  <!-- <div class=\"p-grid p-align-center p-nogutter8\">\n  <label class=\"p-col-2\">Separator</label>\n  <div class=\"p-col-3\">\n      <p-dropdown [options]=\"separatorValue\" name=\"separator\" [style]=\"{'min-width':'100%'}\" [(ngModel)]=\"selectSeparator\"></p-dropdown>\n  </div>\n</div> -->\n                  <div class=\"p-grid p-align-center p-nogutter8\">\n                    <label class=\"p-col-2\">Method</label>\n                    <div class=\"p-col-3\">\n                      <p-selectButton class=\"radio-selectButton\" name=\"method\" [options]=\"method\"\n                        [(ngModel)]=\"executeData.type\"></p-selectButton>\n                    </div>\n                  </div>\n                  <div class=\"p-grid p-align-center p-nogutter8\" *ngIf=\"executeData.type === 'post'\">\n                    <label class=\"p-col-2\">Body</label>\n                    <div class=\"p-col-5\">\n                      <textarea rows=\"5\" cols=\"50\" name=\"body\" [(ngModel)]=\"executeData.body\" pInputTextarea></textarea>\n\n                    </div>\n                  </div>\n                  <div class=\"p-grid p-align-center p-nogutter8\">\n                    <label class=\"p-col-2\">Authentication Type</label>\n                    <div class=\"p-col-3\">\n                      <p-dropdown [options]=\"authTypes\" name=\"authenticationType\" [style]=\"{'min-width':'100%'}\"\n                                  [(ngModel)]=\"executeData.authMode\">\n                      </p-dropdown>\n                    </div>\n                  </div>\n                  <!-- Show username and password fields for Basic Auth -->\n                  <div class=\"p-grid p-align-center p-nogutter8\" *ngIf=\"executeData.authMode === 0\">\n                    <div class=\"w-100-p p-grid p-align-center\">\n                      <div class=\"p-col-2\">\n                        <label>Username</label>\n                      </div>\n                      <div class=\"p-col-4\">\n                        <input type=\"text\" maxlength=\"20\" class=\"w-100-p\" name=\"username\" [(ngModel)]=\"executeData.userName\" placeholder=\"Enter Username\" pInputText>\n                      </div>\n                      <div class=\"p-col-2\">\n                        <label class=\"p-col\">Password</label>\n                      </div>\n                      <div class=\"p-col-4\">\n                        <input type=\"password\" class=\"w-100-p\" name=\"password\" [(ngModel)]=\"executeData.password\" placeholder=\"Enter Password\" pInputText>\n                      </div>\n                    </div>\n                  </div>\n                  <!-- Show API Token field \"-->\n                  <div class=\"p-grid p-align-center p-nogutter8\" *ngIf=\"executeData.authMode === 1\">\n                    <label class=\"p-col-2\">API Token</label>\n                    <div class=\"p-col-10\">\n                      <input type=\"text\" name=\"apiToken\" class=\"w-100-p\" placeholder=\"Enter API Token\" [(ngModel)]=\"executeData.apiToken\" pInputText>\n                    </div>\n                  </div>\n                  <!-- Show Bearer Token field\" -->\n                  <div class=\"p-grid p-align-center p-nogutter8\" *ngIf=\"executeData.authMode === 2\">\n                    <label class=\"p-col-2\">Bearer Token</label>\n                    <div class=\"p-col-10\">\n                      <input type=\"text\" name=\"bearerToken\" class=\"w-100-p\" placeholder=\"Enter Bearer Token\"\n                        [(ngModel)]=\"executeData.bearerToken\" pInputText>\n                    </div>\n                  </div>\n                  <div class=\"px-8\">\n                    <p-tabView styleClass=\"tab-header\">\n                      <p-tabPanel header=\"Header\">\n                        <div class=\"p-grid p-alignc-center\">\n                          <div class=\"p-col\">\n                            <p-chips name=\"Header\" class=\"w-100-p input-chips\" pTooltip=\"Enter the authentication header & token value\"\n                              [(ngModel)]=\"executeData.header\"></p-chips>\n                          </div>\n                        </div>\n                      </p-tabPanel>\n                      <!-- <p-tabPanel header=\"Token\">\n                        <div class=\"p-grid p-alignc-center\">\n                          <div class=\"p-col\">\n                            <input type=\"text\" name=\"token\" class=\"w-100-p\" id=\"tokenVal\"\n                              [(ngModel)]=\"executeData.token\" placeholder=\"Enter Token\" pInputText>\n                          </div>\n                        </div>\n                      </p-tabPanel> -->\n                    </p-tabView>\n                  </div>\n                </ng-container>\n\n\n                <div class=\"p-grid p-align-center p-nogutter8 p-justify-center my-16\">\n                  <button type=\"submit\" pButton class=\"mr-3\" label=\"Execute\" pTooltip=\"Fetch the response JSON after executing the URL entered above\"></button>\n                  <button pButton type=\"button\" label=\"Browse\" (click)=\"uploader.click()\" class=\"mx-10\"\n                  pTooltip=\"Upload the response JSON from your system\"></button>\n\n                  <input hidden (click)=\"clearFile()\" type=\"file\" accept=\".json\" #uploader maxFileSize=\"409600\"\n                    (change)=\"uploadFile($event.target.files)\" />\n                </div>\n              </p-panel>\n            </form>\n\n\n            <p-card styleClass=\"my-16 p-16 font-13\" *ngIf=\"executeToggle\">\n              <p class=\"text-center\">To fill details for <span class=\"font-weight-600\">Subject Name / Subject Path /\n                  Metric Name\n                  / Metric Path / Metric Display Name,</span> click on Key Value Pair in Response JSON to\n                Autofill the mentioned field</p>\n              <!-- <p class=\"text-center\">Eg: To add a Subject, click on the <span class=\"font-weight-600\">\"Application_name:\n          NESCOM\"</span> key-value pair in response JSON</p> -->\n\n              <div class=\"p-grid p-align-center p-nogutter8 p-justify-center my-16\">\n                <button type=\"button\" pButton class=\"btn-primary-outline mr-3\" label=\"Add your first subject\"\n                  (click)=\"addFirstSubject()\" pTooltip=\"Add your first subject\"></button>\n              </div>\n            </p-card>\n\n            <p-overlayPanel #metricName class=\"popHover\" styleClass=\"width-250\">\n              <h3>Metric Group Name</h3>\n              <p>It is add as a metric group name in GDF. GDF name will be the same as Group Name</p>\n            </p-overlayPanel>\n\n            <p-overlayPanel #metricDescriptionText class=\"popHover\" styleClass=\"width-250\">\n              <h3>Description</h3>\n              <p>It is the description of the metric group. By default, if the user dose not provide description then\n                the group name will be added as Metric Group Description.</p>\n            </p-overlayPanel>\n\n            <p-overlayPanel #restUrlPopHover class=\"popHover\" styleClass=\"width-250\">\n              <h3>Rest URL</h3>\n              <p>This url is used to get response json from which user will be configuring subject and metrics.</p>\n              <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n            </p-overlayPanel>\n            <p-overlayPanel #finalUrlPopHover class=\"popHover\" styleClass=\"width-250\">\n              <h3>Final URL</h3>\n              <p>This is the FINAL URL which is combination of REST URL and selected parameter for Dependent URL configuration.</p>\n              <!-- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque mollitia libero in voluptate</p> -->\n            </p-overlayPanel>\n\n            <p-overlayPanel #MetricGroup class=\"popHover\" styleClass=\"width-250\">\n              <h3>Metric Group</h3>\n              <p>It is add as a metric group name in GDF. GDF name will be the same as Group Name</p>\n            </p-overlayPanel>\n\n            <p-overlayPanel #RestApi class=\"popHover\" styleClass=\"width-250\">\n              <h3>Rest Api</h3>\n              <p> A simpler UI to configure REST API monitors so that we can configure monitors for any service.</p>\n              <!-- <p>It is add as a metric group name in GDF. GDF name will be the same as Group Name</p> -->\n            </p-overlayPanel>\n\n            <p-overlayPanel #GenericRestUI class=\"popHover\" styleClass=\"width-250\">\n              <h3>Overview :</h3>\n              <p><b>Metric Group : </b> It is add as a metric group name in GDF. GDF name will be the same as Group Name\n              </p>\n              <p><b>Rest Api : </b> A simpler UI needed to configure REST API monitors so that we can configure monitors\n                for any service.GUI should be of minimum configuration and easy to use.</p>\n              <p><b>Subject Hierarchy : </b> In this section we are providing support to select Tier and Server in\n                Hierarchy.</p>\n              <p><b>Add Subject : </b> In this section user will be selecting nodes from the response JSON and those\n                will be used for creating vector. </p>\n              <p><b>Add Metric : </b> Add metric from the list of metrics.</p>\n\n            </p-overlayPanel>\n\n\n\n            <app-execute-hierarchy *ngIf=\"addHierarchy\" [getEditData]=\"FinalHierData\"\n              (sendFinalData)=\"getFinalData($event)\"\n              (parameterMode)=\"disableConfigureMetrices($event)\"></app-execute-hierarchy>\n\n            <div *ngIf=\"addMetrics\" class=\"p-grid p-justify-center p-col\">\n              <button type=\"button\" class=\"ui-button btn-primary-outline\" pTooltip=\"Click to Add Subject/Metric\"\n                (click)=\"switchTab()\">\n                <span>{{subsAt ? 'Configure Metrics' : 'Configure Subject'}}</span>\n                <i [ngClass]=\"subsAt ? 'las-arrow-down-solid' : 'las-arrow-up-solid'\"></i>\n              </button>\n            </div>\n\n            <app-add-metrics *ngIf=\"addMetrics\" [getEditData]=\"FinalMetricData\"\n              (sendFinalData)=\"getFinalMetricData($event)\"></app-add-metrics>\n\n\n            <div class=\"p-grid p-justify-end p-col\" *ngIf=\"configurationBtn\">\n              <button type=\"button\" pButton class=\"btn-primary-outline\" (click)=\"configureMetrics()\"\n                label=\"Configure Metrics\" pTooltip=\"Configure Metrics\"></button>\n            </div>\n\n            <div class=\"p-col-12\" *ngIf=\"customMonService.isMetricMappedPath\">\n              <label class=\"p-col-3 p-grid p-align-center required-mark\">Metric Mapped Path\n              </label>\n              <div class=\"p-col-9\">\n                <input type=\"text\" class=\"inpbox w-100-p\" name=\"mMappedPath\" pTooltip=\"This instance is used to configure metric query path.\" placeholder=\"Metric Mapped Path\"\n                  [(ngModel)]=\"customMonService.mMappedPath\" pInputText>\n              </div>\n            </div>\n\n\n            <div class=\"p-grid p-justify-end p-col\" *ngIf=\"isAddConf\">\n              <button type=\"submit\" pButton class=\"btn-primary-outline\"\n                label=\"{{isEditConfigurationTable ? 'Update Configuration' :'Add Configuration'}}\"\n                pTooltip=\"{{isEditConfigurationTable ? 'Update Configuration' :'Add Configuration'}}\"></button>\n            </div>\n\n            <div class=\"px-5 my-16\" *ngIf=\"showPreview\">\n              <cav-table [value]=\"customMonService.addPrevData\" [rows]=\"10\" [headerRelativePath]=\"relativePath\"\n                (clickButtonEvent)=\"clickButtonEvent($event)\">\n              </cav-table>\n            </div>\n\n            <div class=\"p-grid p-justify-end p-col\">\n              <!-- <div class=\"p-grid p-justify-end p-col-10\" *ngIf=\"isPreview\">\n      <button type=\"button\" pButton class=\"btn-primary-outline\"  (click)=\"showPreviewData()\" label=\"Preview\"></button>\n  </div>  -->\n              <div *ngIf=\"isAddNewUrl\">\n                <button type=\"button\" pButton class=\"btn-primary-outline\" (click)=\"addNewUrl()\" label=\"Add New URL\"\n                pTooltip=\"Add New URL\"></button>\n              </div> &nbsp;&nbsp;\n              <!-- </div> -->\n              <!-- class=\"p-grid p-justify-end p-col\" -->\n            </div>\n            <!-- ===================response file section============== -->\n          </form>\n        </div>\n        <div class=\"w-40-p response-box\">\n          <app-response-file></app-response-file>\n        </div>\n      </div>\n    </p-tabPanel>\n    <!-- <p-tabPanel [disabled]=\"disableViewDep\" header=\"View Deployment\">\n      <app-configured-monitor-info [hideActionCol]=\"hideActionCol\" [showCols]=\"tableInfo\"></app-configured-monitor-info>\n    </p-tabPanel> -->\n  </p-tabView>\n</div>\n\n<div class=\"confirm-dialog\">\n\n  <p-confirmDialog #cd class=\"confirmdialog\" key=\"genRestConDial\" header=\"Confirmation\"\n    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\n</div>\n<div class=\"loading-indicator\" *ngIf=\"loading\">\n  <p-progressSpinner [style]=\"{width: '50px', height: '50px'}\" strokeWidth=\"4\" animationDuration=\".5s\">\n  </p-progressSpinner>\n</div>\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.component.html":
/*!******************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.component.html ***!
  \******************************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<p-tabView class=\"responseTab\">\n    <p-tabPanel header=\"Response Json\">\n       <ngx-json-viewer [json]=\"data\" [expanded]=\"true\" [parent]=\"null\" [key]=\"\"></ngx-json-viewer>\n    </p-tabPanel>\n    <p-tabPanel [disabled]=\"true\" header=\"Request\">\n    </p-tabPanel>\n    <p-tabPanel [disabled]=\"true\" header=\"Response\">\n    </p-tabPanel>\n</p-tabView>\n\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.component.html":
/*!*************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.component.html ***!
  \*************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<section class=\"ngx-json-viewer\">\n    <section\n      *ngFor=\"let segment of segments\"\n      [ngClass]=\"['segment', 'segment-type-' + segment.type]\">\n      <section\n        (click)=\"toggle(segment)\"\n        [ngClass]=\"{\n          'segment-main': true,\n          'expandable': isExpandable(segment),\n          'expanded': segment.expanded\n        }\">\n        <div *ngIf=\"isExpandable(segment)\" class=\"toggler\"></div>\n        <span class=\"segment-key\">{{ segment.key }}</span>\n        <span class=\"segment-separator\">: </span>\n        <span *ngIf=\"!segment.expanded || !isExpandable(segment)\" class=\"segment-value\">{{ segment.description }}</span>\n      </section>\n      <section *ngIf=\"segment.expanded && isExpandable(segment)\" class=\"children\">\n        <ngx-json-viewer [parent]=\"this\" [segmentt]=\"segment\" [key]=\"segment.key\" [type]=\"segment.type\" [json]=\"segment.value\" [expanded]=\"expanded\" [depth]=\"depth\" [_currentDepth]=\"_currentDepth\"></ngx-json-viewer>\n      </section>\n    </section>\n  </section>");

/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/containers/rest-mon-data.ts":
/*!****************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/containers/rest-mon-data.ts ***!
  \****************************************************************************************************************/
/*! exports provided: RestDTO */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RestDTO", function() { return RestDTO; });
class RestDTO {
    constructor() {
        this.monN = ""; // Custom Mon Name which is same as Metric group name.
        this.monD = ""; //Metric group name Description.
        // ArrayList<urlSetting> urlSettings = new ArrayList<urlSetting>();
        this.currSubH = ""; // This is Current Subject Hierarchy
        this.fixedSubPath = ""; // Fixed Subject Path
        this.fixedSubValue = ""; // Fixed Subject Value
        this.tier = "no"; //Appned Tier in hierrarchy
        this.server = "no"; //Append server in hierarchy
        this.gN = ""; // Gdf Name
        this.restUrlDto = []; // Rest Url Configurations
        this.oN = ""; // Old custom mon json name (Required for edit name)
        this.enbl = "false"; // Enable /Disable
        this.opt = ""; // command/script to configure monitor
        this.aN = ""; // App Name
        this.pN = "cm_generic_rest_monitor_extended"; // Program Name
        this.type = ""; // Type
        this.aT = "BCI"; // Agent type
        this.dvm = ""; // DVM
        this.pT = "java";
        this.mdata = ""; // Hirearchy (Tier>Server)
        // Added from cmon code usage check and update if not needed - NISHA
        this.separator = "_";
    }
}


/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/containers/restMonService.data.ts":
/*!**********************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/containers/restMonService.data.ts ***!
  \**********************************************************************************************************************/
/*! exports provided: urlSettings, ExecuteHierarchyDTO, AddPreviewConfigDTO, SubjectDTO, RestUrlDTO, ExecuteUrlDto, DataFromPattern */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlSettings", function() { return urlSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExecuteHierarchyDTO", function() { return ExecuteHierarchyDTO; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddPreviewConfigDTO", function() { return AddPreviewConfigDTO; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectDTO", function() { return SubjectDTO; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RestUrlDTO", function() { return RestUrlDTO; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExecuteUrlDto", function() { return ExecuteUrlDto; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataFromPattern", function() { return DataFromPattern; });
/* harmony import */ var _generic_gdf_containers_generic_gdf_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../generic-gdf/containers/generic-gdf-data */ "./src/app/pages/generic-gdf/containers/generic-gdf-data.ts");

class urlSettings {
    constructor() {
        this.reqType = ""; //Either request type is GET or POST to fetch response json
        this.host = ""; //domain of the URL
        this.path = ""; // variable path of url to be appended with domain
        this.header = ""; //header in case of GET
        this.token = ""; //token in case of GET
        this.body = ""; //body in case of POST
    }
}
//  export class AddSubjectConfigDTO{
// 	subPath:string = ""; //Subject Path
// 	subName:string = ""; //Subject Name
// }
class ExecuteHierarchyDTO {
    constructor() {
        this.combinedData = [];
        this.selectedTierHierarchy = "no";
        this.selectedServerHierarchy = "no";
        this.fixedSP = "";
        this.fixedSV = "";
        this.currentHierarchy = "";
        this.isEditConfigurationTable = false;
        // this is added to check if mode is changed (BUG 132475)
        this.isModeChanged = false;
    }
}
// export class AddSubjectConfigDTO
// {
//     id:number;
//     subPath:string = "";//Subject Path
// 	subName:string = ""; //Subject Name
//     subValue:string="";//Subject Value
//     selectSeparator:string="/";
//     val :number =1;
// }
// export class AddMetricConfigDTO
// {
//     id:number;
//     mPath:string = "";//Metric Path
// 	mName:string = ""; //Metric Name
//     mValue:string="";//Metric Value
//     mDisName:string="";//Metric Description Name
//     mDes:string="";//Metric Description
//     opr:string="";//operation
//     dT:string="";//data type
//     mForm:string="";//meytric formula
//     cF:string="";//convert from
//     cT:string="";//conver0.t to
//     selectedMetricSubject: string ;//Use subject name from subject
//     selectAlias:any;//Alias Value
// }
class AddPreviewConfigDTO {
    constructor() {
        this.url = "";
        this.restUrl = "";
        this.path = "";
        this.finalURL = "";
        this.subject = "";
        this.metric = "";
        this.MetricData = [];
        this.parameters = "";
        this.both = "";
        this.HierData = new ExecuteHierarchyDTO();
    }
}
class SubjectDTO {
    constructor() {
        this.jpath = ""; //Component Json path
        this.jName = ""; //Component Name
        this.jValue = ""; //Component Value
        this.splitChar = ""; //Component Split Character
        //    pickIndex : Number;//After splitting, this part will be taken
        this.pickIndex = ""; //After splitting, this part will be taken
        this.mode = 0;
    }
}
class RestUrlDTO {
    constructor() {
        this.baseUrl = ""; //Base URL
        this.path = ""; //path against base URL
        this.requestType = "get";
        this.finalURL = "";
        // currSubH:String = ""; // This is Current Subject Hierarchy
        // fixedSubPath:String = "";// Fixed Subject Path
        // tier :string = "no";//Appned Tier in hierrarchy
        // server:string = "no";//Append server in hierarchy
        // gN : string = ""; // Gdf Name
        // gdfInfo: GenericGDFData[]=[]; // GDF infoT
        this.gdfInfo = new _generic_gdf_containers_generic_gdf_data__WEBPACK_IMPORTED_MODULE_0__["GenericGDFData"]();
    }
}
class ExecuteUrlDto {
    constructor() {
        this.type = "get"; //get or post
    }
}
class DataFromPattern {
    constructor() {
        this.pValue = "";
    }
}


/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.component.scss":
/*!******************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.component.scss ***!
  \******************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("");

/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.component.ts":
/*!****************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.component.ts ***!
  \****************************************************************************************************************************************************************/
/*! exports provided: METRIC_FORMULA_LABEL, METRIC_FORMULA_VALUE, AddMetricsComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "METRIC_FORMULA_LABEL", function() { return METRIC_FORMULA_LABEL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "METRIC_FORMULA_VALUE", function() { return METRIC_FORMULA_VALUE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddMetricsComponent", function() { return AddMetricsComponent; });
/* 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 _services_custom_monitor_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../services/custom-monitor.service */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/services/custom-monitor.service.ts");
/* harmony import */ var _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../../generic-gdf/services/immutable-array */ "./src/app/pages/generic-gdf/services/immutable-array.ts");
/* harmony import */ var src_app_pages_monitor_up_down_status_service_utility_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/pages/monitor-up-down-status/service/utility.service */ "./src/app/pages/monitor-up-down-status/service/utility.service.ts");
/* harmony import */ var src_app_pages_generic_gdf_containers_metric_configuration_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/pages/generic-gdf/containers/metric-configuration-data */ "./src/app/pages/generic-gdf/containers/metric-configuration-data.ts");
/* harmony import */ var _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../containers/restMonService.data */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/containers/restMonService.data.ts");
/* harmony import */ var _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../constants/mon-component-constants */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/constants/mon-component-constants.ts");
/* harmony import */ var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/shared/cav-toast/service/cav-message.service */ "./src/app/shared/cav-toast/service/cav-message.service.ts");










const METRIC_FORMULA_LABEL = ['--Select--', 'Convert from milliseconds to seconds', 'Convert from milliseconds to per minute',
    'Convert from milliseconds to per second', 'Convert from bytes to kilo byte per second',
    'Divide by hundred', 'Convert cumulative values to per minute', 'Convert cumulative values to per second'];
const METRIC_FORMULA_VALUE = ['None', 'SEC', 'PM', 'PS', 'KBPS', 'DBH', 'CumToPM', 'CumToPS'];
let AddMetricsComponent = class AddMetricsComponent {
    constructor(customMonService, confirmationService, cd, messageService) {
        this.customMonService = customMonService;
        this.confirmationService = confirmationService;
        this.cd = cd;
        this.messageService = messageService;
        this.sendFinalData = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
        this.selectedMetricSubject = 'no';
        this.aliasValue = [];
        this.isEditMetricTable = false;
        this.isEditDataFromPatternTable = false;
        this.pending = false;
        this.addMetData = [];
        this.addDataFromPattern = [];
        this.loading = false;
        this.displayDataFromPattern = false;
        this.isIconDisabledDataFromPattern = false;
        this.pValue = "";
        this.updatedValue = "";
        this.relativePath = 'monitors/custom-monitors/add-metrics.json';
        this.relativePath2 = 'monitors/custom-monitors/configure-metrics.json';
        this.metricSubject = [
            { label: 'Yes', value: 'yes' },
            { label: 'No', value: 'no' },
        ];
        this.operationVal = [
            { label: 'None', value: 'none' },
            { label: 'Sum', value: 'sum' },
            { label: 'Average', value: 'avg' },
            { label: 'First', value: 'first' },
            { label: 'Last', value: 'last' },
            { label: 'Min', value: 'min' },
            { label: 'Max', value: 'max' },
            { label: 'Mean', value: 'mean' }
        ];
        this.dataTypeVal = [
            { label: 'Sample', value: 'sample' },
            { label: 'Rate', value: 'rate' },
            { label: 'Cumulative', value: 'cumulative' },
            { label: 'Times', value: 'times' },
            { label: 'TimesStd', value: 'timesStd' },
        ];
        this.metFormVal = src_app_pages_monitor_up_down_status_service_utility_service__WEBPACK_IMPORTED_MODULE_5__["UtilityService"].createListWithKeyValue(METRIC_FORMULA_LABEL, METRIC_FORMULA_VALUE);
        this.convFromVal = [
            { label: 'Bits', value: 'bits' },
            { label: 'Bytes', value: 'bytes' },
            { label: 'KB', value: 'KB' },
            { label: 'MB', value: 'MB' },
            { label: 'GB', value: 'GB' },
            { label: 'TB', value: 'TB' },
            { label: 'Core', value: 'core' },
            { label: 'Time', value: 'time' },
            { label: 'Milliseconds', value: 'ms' },
            { label: 'Seconds', value: 's' },
            { label: 'Minutes', value: 'm' },
            { label: 'Hours', value: 'h' },
            { label: 'Day', value: 'day' },
            { label: 'Nanosecond', value: 'ns' },
            { label: 'Microsecond', value: 'us' },
        ];
    }
    ngOnInit() {
        // this code for when page scroll  multi-select Dropdown
        $(document).ready(function () {
            $('div').scroll(function () {
                if ($(this).scrollTop() > 50) {
                    $('.ui-multiselect-panel').fadeOut();
                    $('body').click();
                }
                else {
                }
            });
        });
        // end above code //
        // this.metricData = new MetricConfData();
        this.metricData = new src_app_pages_generic_gdf_containers_metric_configuration_data__WEBPACK_IMPORTED_MODULE_6__["MetricConfData"]();
        this.dataFromPattern = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["DataFromPattern"]();
        this.aliasValue = src_app_pages_monitor_up_down_status_service_utility_service__WEBPACK_IMPORTED_MODULE_5__["UtilityService"].createDropdown(this.customMonService.aliasList);
        this.switchToSub = this.customMonService.$switchSubMetSub.subscribe((res1) => {
            if (this.getEditData) {
                this.addMetData = this.getEditData;
                for (let i = 0; i < this.addMetData.length; i++) {
                    this.addDataFromPattern = [...this.addMetData[i].dataFP];
                }
            }
            this.clearFieldOfDFP();
            this.clearField();
            if (res1) {
                if (this.autofill) {
                    this.autofill.unsubscribe();
                }
            }
            else {
                this.autofill = this.customMonService.$jsonData.subscribe((res) => {
                    if (res) {
                        if (!this.customMonService.isMetricMappedPath) {
                            res[0] = res[0].slice(0, -1);
                            this.metricData._mP = res[0].substring(0, res[0].lastIndexOf(".") + 1);
                        }
                        else {
                            this.metricData._mP = res[0]; // added for Dynatrace flow need to change.
                        }
                        this.metricData._mN = res[1]['key'];
                        this.metricData._mDN = res[1]['key'];
                        this.metricData._mV = res[1]['value'];
                        this.metricData._metDesc = res[1]['key'];
                        if (typeof (res[1]['value']) == "number") {
                            this.isIconDisabledDataFromPattern = false;
                        }
                        else {
                            this.isIconDisabledDataFromPattern = true;
                        }
                        if (typeof (res[1]['value']) == "object") {
                            if (typeof (res[1]['value'][0]) == "number") {
                                this.isIconDisabledDataFromPattern = false;
                            }
                            else {
                                this.isIconDisabledDataFromPattern = true;
                            }
                        }
                    }
                });
            }
        });
        this.saveConf = this.customMonService.$saveConfMetric.subscribe((res) => {
            if (res) {
                this.emitFinalData();
            }
        });
        this.cols = [
            { field: '_mP', header: 'Metric Path' },
            { field: '_mN', header: 'Metric Name' }
        ];
        this.colsDFP = [
            { field: 'pValue', header: 'Pattern Value' },
            { field: 'updatedValue', header: 'Updated Value' }
        ];
    }
    onAliasChange() {
        this.metricData.selectedMetricSubject = this.selectedMetricSubject;
        this.metricData.selectAlias = this.selectAlias;
    }
    addData() {
        if (!this.isEditDataFromPatternTable) {
            if (this.addDataFromPattern.length != 0) {
                let lastRowId = this.addDataFromPattern[this.addDataFromPattern.length - 1];
                this.dataFromPattern.id = lastRowId.id + 1;
            }
            else {
                this.dataFromPattern.id = 0; // id for the first row entry in the table
            }
            if (this.dataFromPattern.pValue.trim() == "" && this.dataFromPattern.updatedValue == undefined) {
                this.messageService.add({
                    severity: 'error',
                    summary: "Please enter Pattern Value and Updated value.",
                });
                return;
            }
            if (this.dataFromPattern.pValue.trim() == "") {
                this.messageService.add({
                    severity: 'error',
                    summary: "Please enter Pattern Value.",
                });
                return;
            }
            if (this.dataFromPattern.updatedValue == undefined) {
                this.messageService.add({
                    severity: 'error',
                    summary: "Please enter Updated value.",
                });
                return;
            }
            this.addDataFromPattern = _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_4__["ImmutableArray"].push(this.addDataFromPattern, this.dataFromPattern);
            this.dataFromPattern = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["DataFromPattern"]();
        }
        else {
            this.addDataFromPattern = _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_4__["ImmutableArray"].replace(this.addDataFromPattern, this.dataFromPattern, this.getSelectedRowIndexOfDFP(this.dataFromPattern.id));
            this.isEditDataFromPatternTable = false; // to change the form button from UPDATE -> ADD when update is already done.
            this.dataFromPattern = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["DataFromPattern"]();
        }
    }
    //Method called on Add/Edit Metrics Configuration to save in table.
    addMetricData() {
        if (this.isIconDisabledDataFromPattern == true && this.addDataFromPattern.length == 0) {
            this.messageService.add({
                severity: 'error',
                summary: "Please add data from pattern to replace string data with some pattern values.",
            });
            return;
        }
        if (!this.isEditMetricTable) {
            let flag = true;
            if (this.customMonService.isMetricMappedPath && this.addMetData.length >= 1) {
                flag = false;
                this.messageService.add({
                    severity: 'error',
                    summary: "Multiple metric configuration is not allowed.",
                });
                return;
            }
            else {
                flag = true;
            }
            if (flag) {
                this.metricData._mV = this.metricData._mV.toString();
                if (this.addMetData.length != 0) {
                    let lastRowId = this.addMetData[this.addMetData.length - 1];
                    this.metricData.id = lastRowId.id + 1;
                }
                else
                    this.metricData.id = 0; // id for the first row entry in the table
                if (this.customMonService.getSubjectFixed() == this.metricData._mN) {
                    this.messageService.add({
                        severity: 'error',
                        summary: "Metric name is present in subject configuration.",
                    });
                    return;
                }
                let subjectNameArray = [];
                subjectNameArray = this.customMonService.getsubjectName();
                for (let i = 0; i < subjectNameArray.length; i++) {
                    if (subjectNameArray[i] == this.metricData._mN) {
                        this.messageService.add({
                            severity: 'error',
                            summary: "Metric name is present in Subject configuration.",
                        });
                        return;
                    }
                }
                for (let i = 0; i < this.addMetData.length; i++) {
                    if (this.addMetData[i]._mN == this.metricData._mN && this.addMetData[i]._dT == this.metricData._dT
                        && this.addMetData[i]._mF == this.metricData._mF && this.addMetData[i]._opr == this.metricData._opr) {
                        this.messageService.add({
                            severity: 'error',
                            summary: "Metric Name " + this.metricData._mN + "with  Data Type " + this.metricData._dT + " ,  Metric Formula " + this.metricData._mF + " and Operation " + this.metricData._opr + " is already present in metric configuration.",
                        });
                        return;
                    }
                }
                if (this.addDataFromPattern.length > 0) {
                    this.metricData.dataFP = [...this.addDataFromPattern];
                }
                this.addMetData = _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_4__["ImmutableArray"].push(this.addMetData, this.metricData);
                this.sendFinalData.emit(this.addMetData);
                if (this.metricData.dataFP.length > 0) {
                    this.addDataFromPattern = [];
                    this.dataFromPattern = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["DataFromPattern"]();
                    this.isIconDisabledDataFromPattern = false;
                }
                let metricNameArray = [];
                for (let i = 0; i < this.addMetData.length; i++) {
                    metricNameArray.push(this.addMetData[i]._mN);
                }
                this.customMonService.setMetricName(metricNameArray);
                this.metricData = new src_app_pages_generic_gdf_containers_metric_configuration_data__WEBPACK_IMPORTED_MODULE_6__["MetricConfData"]();
                this.additionalSettings = false;
            }
        }
        else {
            this.isIconDisabledDataFromPattern = false;
            // if ( this.customMonService.isMetricMappedPath && this.addMetData.length >= 1  ) {
            // this.messageService.add({
            //   severity: 'error',
            //   summary: "Multiple metric configuration is not allowed.",
            // });
            // return;
            // }
            if (this.customMonService.getSubjectFixed() == this.metricData._mN) {
                this.messageService.add({
                    severity: 'error',
                    summary: "Metric name is present in subject configuration.",
                });
                return;
            }
            let subjectNameArray = [];
            subjectNameArray = [...this.customMonService.getsubjectName()];
            for (let i = 0; i < subjectNameArray.length; i++) {
                if (subjectNameArray[i] == this.metricData._mN) {
                    this.messageService.add({
                        severity: 'error',
                        summary: "Metric name is present in Subject configuration.",
                    });
                    return;
                }
            }
            for (let i = 0; i < this.addMetData.length; i++) {
                if (i != this.getSelectedRowIndex(this.metricData['id']) && this.addMetData[i]._mN == this.metricData._mN && this.addMetData[i]._dT == this.metricData._dT
                    && this.addMetData[i]._mF == this.metricData._mF && this.addMetData[i]._opr == this.metricData._opr) {
                    this.messageService.add({
                        severity: 'error',
                        summary: this.metricData._mN + ", " + this.metricData._dT + ", " + this.metricData._mF + ", " + this.metricData._opr + " is already present in metric configuration.",
                    });
                    return;
                }
            }
            this.metricData.dataFP = [...this.addDataFromPattern];
            this.addMetData = _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_4__["ImmutableArray"].replace(this.addMetData, this.metricData, this.getSelectedRowIndex(this.metricData["id"]));
            this.sendFinalData.emit(this.addMetData);
            this.isEditMetricTable = false; // to change the form button from UPDATE -> ADD when update is already done.
            let metricNameArray = [];
            for (let i = 0; i < this.addMetData.length; i++) {
                metricNameArray.push(this.addMetData[i]._mN);
            }
            this.customMonService.setMetricName(metricNameArray);
            this.metricData = new src_app_pages_generic_gdf_containers_metric_configuration_data__WEBPACK_IMPORTED_MODULE_6__["MetricConfData"]();
            this.additionalSettings = false;
        }
    }
    editTableConfig(rowData) {
        this.metricData = Object.assign({}, rowData);
        this.isEditMetricTable = true;
        if (rowData.dataFP.length > 0) {
            for (let i = 0; i < this.addMetData.length; i++) {
                this.addDataFromPattern = [...this.addMetData[i].dataFP];
            }
            this.isIconDisabledDataFromPattern = true;
        }
        else {
            this.isIconDisabledDataFromPattern = false;
        }
    }
    editTableOfDFPConfig(rowData) {
        this.dataFromPattern = Object.assign({}, rowData);
        this.isEditDataFromPatternTable = true;
    }
    /**This method returns selected row on the basis of Id */
    getSelectedRowIndex(data) {
        let index = this.addMetData.findIndex(each => each["id"] == data);
        return index;
    }
    getSelectedRowIndexOfDFP(data) {
        let index = this.addDataFromPattern.findIndex(each => each["id"] == data);
        return index;
    }
    deleteTableConfigOfDFP(rowData) {
        const me = this;
        this.confirmationService.confirm({
            message: ("Do you want to delete selected pattern(s)?"),
            header: 'Delete Confirmation',
            icon: 'pi pi-info-circle',
            key: "addMetricConDialOfDFP",
            accept: () => {
                this.clearFieldOfDFP();
                let arrId = [];
                arrId.push(rowData.id); // push selected row's id
                this.addDataFromPattern = this.addDataFromPattern.filter(function (val) {
                    return arrId.indexOf(val.id) == -1; //value to be deleted should return false
                });
            },
            reject: () => {
            }
        });
    }
    /*This method is used to delete selected rows*/
    deleteTableConfig(rowData) {
        const me = this;
        this.confirmationService.confirm({
            message: ("Are you sure to delete the selected configuration(s)?"),
            header: 'Delete Confirmation',
            icon: 'pi pi-info-circle',
            key: "addMetricConDial",
            accept: () => {
                this.clearField();
                this.loading = true;
                let arrId = [];
                if (this.customMonService.isMetricMappedPath) {
                    this.customMonService.mMappedPath = null;
                }
                arrId.push(rowData.id); // push selected row's id
                this.addMetData = this.addMetData.filter(function (val) {
                    return arrId.indexOf(val.id) == -1; //value to be deleted should return false
                });
                this.loading = false;
                this.sendFinalData.emit(this.addMetData); // added for showing error msg in UI when table is empty - bug 132467
            },
            reject: () => {
            }
        });
    }
    emitFinalData() {
        this.sendFinalData.emit(this.addMetData);
        // this is commented for bug 132467
        this.addMetData = [];
    }
    clearField() {
        this.metricData = new src_app_pages_generic_gdf_containers_metric_configuration_data__WEBPACK_IMPORTED_MODULE_6__["MetricConfData"]();
        this.isEditMetricTable = false;
        this.isEditDataFromPatternTable = false;
        this.isIconDisabledDataFromPattern = false;
        this.dataFromPattern = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["DataFromPattern"]();
        if (this.addDataFromPattern.length > 0) {
            this.addDataFromPattern = [];
        }
    }
    clearFieldOfDFP() {
        this.dataFromPattern = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["DataFromPattern"]();
        this.isEditDataFromPatternTable = false;
    }
    clickButtonEvent(event) {
        var _a, _b, _c, _d;
        let rowData = event.cavEventExt.row;
        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) == _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_8__["EVENT_EDIT"]) {
            this.editTableConfig(rowData);
        }
        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) == _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_8__["EVENT_DELETEROW"]) {
            this.deleteTableConfig(rowData);
        }
    }
    clickButtonEvent2(event) {
        var _a, _b;
        const row = event.cavEventExt.row;
        const action = (_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;
        if (action === _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_8__["EVENT_EDIT"]) {
            this.editTableOfDFPConfig(row);
        }
        if (action === _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_8__["EVENT_DELETEROW"]) {
            this.deleteTableConfigOfDFP(row);
        }
        if (action === _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_8__["EVENT_DELETEALL"]) {
            this.deleteConf(event.cavEventExt.rowData);
        }
    }
    ngOnDestroy() {
        if (this.subscription)
            this.subscription.unsubscribe();
        if (this.autofill)
            this.autofill.unsubscribe();
    }
    showDataFromPatternDialog() {
        this.displayDataFromPattern = true;
    }
    deleteConf(rowData) {
        this.selectedRow = rowData;
        const me = this;
        if (!me.selectedRow || me.selectedRow.length == 0) {
            this.messageService.add({ severity: "error", summary: "Please select row to delete" });
            return;
        }
        me.confirmationService.confirm({
            message: ' Do you want to delete selected pattern(s)?',
            header: 'Delete Confirmation',
            icon: 'pi pi-info-circle',
            key: 'addMetricConDialOfDFPDeleteAll',
            accept: () => {
                for (let i = 0; i < this.addDataFromPattern.length; i++) {
                    for (let j = 0; j < this.selectedRow.length; j++) {
                        if (this.addDataFromPattern[i].id == this.selectedRow[j].id) {
                            this.addDataFromPattern.splice(i, 1);
                            this.selectedRow.splice(j, 1);
                        }
                    }
                }
                if (this.addDataFromPattern.length == this.selectedRow.length) {
                    this.addDataFromPattern = [];
                    this.selectedRow = [];
                }
                // for (let i = 0; i < this.selectedRow.length; i++) {
                //   monName += this.selectedRow[i]._m + ",";
                //   objId += this.selectedRow[i].oid + ",";
                // }
                // monName = monName.slice(0, monName.length - 1)
            },
            reject: () => {
                this.selectedRow = [];
            },
        });
    }
    closeDialog() {
        this.displayDataFromPattern = false;
    }
};
AddMetricsComponent.ctorParameters = () => [
    { type: _services_custom_monitor_service__WEBPACK_IMPORTED_MODULE_3__["CustomMonitorService"] },
    { type: primeng__WEBPACK_IMPORTED_MODULE_2__["ConfirmationService"] },
    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"] },
    { type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_9__["CavMessageService"] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], AddMetricsComponent.prototype, "getEditData", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])()
], AddMetricsComponent.prototype, "sendFinalData", void 0);
AddMetricsComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-add-metrics',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./add-metrics.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.component.html")).default,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./add-metrics.component.scss */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.component.scss")).default]
    })
], AddMetricsComponent);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.module.ts":
/*!*************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.module.ts ***!
  \*************************************************************************************************************************************************************/
/*! exports provided: AddMetricsModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddMetricsModule", function() { return AddMetricsModule; });
/* 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 _add_metrics_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./add-metrics.component */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.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 primeng__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/shared/cav-table/cav-table.module */ "./src/app/shared/cav-table/cav-table.module.ts");







let AddMetricsModule = class AddMetricsModule {
};
AddMetricsModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [_add_metrics_component__WEBPACK_IMPORTED_MODULE_3__["AddMetricsComponent"]],
        exports: [_add_metrics_component__WEBPACK_IMPORTED_MODULE_3__["AddMetricsComponent"]],
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["ButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["PanelModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TableModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["CardModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TooltipModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["CheckboxModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["MultiSelectModule"],
            _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["DialogModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["InputTextModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["DropdownModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["SelectButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["ToggleButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["InputTextareaModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TabViewModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["SpinnerModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["OverlayPanelModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["ConfirmDialogModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["ProgressSpinnerModule"],
            src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_6__["CavTableModule"]
        ]
    })
], AddMetricsModule);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.component.scss":
/*!************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.component.scss ***!
  \************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("");

/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.component.ts":
/*!**********************************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.component.ts ***!
  \**********************************************************************************************************************************************************/
/*! exports provided: ExecuteHierarchyComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExecuteHierarchyComponent", function() { return ExecuteHierarchyComponent; });
/* 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 _services_custom_monitor_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../services/custom-monitor.service */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/services/custom-monitor.service.ts");
/* harmony import */ var _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../containers/restMonService.data */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/containers/restMonService.data.ts");
/* harmony import */ var _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../generic-gdf/services/immutable-array */ "./src/app/pages/generic-gdf/services/immutable-array.ts");
/* harmony import */ var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/shared/cav-toast/service/cav-message.service */ "./src/app/shared/cav-toast/service/cav-message.service.ts");
/* harmony import */ var _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../constants/mon-component-constants */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/constants/mon-component-constants.ts");









const TIER = "Tier";
const SERVER = "Server";
let ExecuteHierarchyComponent = class ExecuteHierarchyComponent {
    constructor(customMonService, confirmationService, messageService) {
        this.customMonService = customMonService;
        this.confirmationService = confirmationService;
        this.messageService = messageService;
        this.sendFinalData = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
        this.parameterMode = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); //disable confifure
        this.executeToggle = false;
        this.pending = false;
        this.addMetrics = false;
        this.configurationBtn = true;
        this.isEditSubjectTable = false;
        this._selectedTierHierarchy = "no";
        this._selectedServerHierarchy = "no";
        this._fixedSP = "";
        this._fixedSV = "";
        this.executeHierData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_4__["ExecuteHierarchyDTO"]();
        this.addSubData = [];
        this.lenn = '';
        this.loading = false;
        this.selectedType = 0;
        this.disableStr = false;
        this.relativePath = 'monitors/custom-monitors/execute-hierarchy.json';
    }
    ngOnInit() {
        this.parameterList = [
            { label: 'Subject', value: 0, title: 'Select to configure only subject. Subject name and subject path values will be used for subject configuration.' },
            { label: 'Parameter', value: 1, title: 'Select to configure parameters to be passed in execution of next URL. Subject name and subject path values will be used as parameter in next URL. If selected, user will not be able to configure subject and metric.' },
            { label: 'Parameter & Subject', value: 2, title: 'Select to configure parameter and subject. Subject name and subject path values will be used as replace parameter in next URL and as subject in hierarchy.' },
        ];
        this.SubData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_4__["SubjectDTO"]();
        this.tierHierarchy = [
            { label: 'Yes', value: 'yes' },
            { label: 'No', value: 'no' },
        ];
        this.serverHierarchy = [
            { label: 'Yes', value: 'yes' },
            { label: 'No', value: 'no' },
        ];
        this.separatorValue = [
            { label: '/', value: '/' },
            { label: '_', value: '_' },
            { label: '.', value: '.' },
            { label: ':', value: ':' }
        ];
        this.cols = [
            { field: 'jpath', header: 'Subject Path' },
            { field: 'jName', header: 'Subject Name' }
        ];
        // if (this.getEditData) {
        //   if (this.getEditData.combinedData.length != 0 && this.getEditData.combinedData[0]['mode'] == 0) {
        //     this.addSubData = this.getEditData.combinedData;
        //   } else if (this.getEditData.combinedData.length != 0 && this.getEditData.isEditConfigurationTable == true && this.getEditData.combinedData[0]['mode'] != 0) {
        //     let obj = this.customMonService.getFinalRowData();
        //     this.addSubData = obj['HierData']['combinedData'];
        //   }
        //   this.customMonService._currentHierarchy = this.getEditData.currentHierarchy;
        //   this._fixedSP = this.getEditData.fixedSP;
        //   this._fixedSV = this.getEditData.fixedSV;
        //   this._selectedServerHierarchy = this.getEditData.selectedServerHierarchy;
        //   this._selectedTierHierarchy = this.getEditData.selectedTierHierarchy;
        // }
        this.switchToSub = this.customMonService.$switchSubMetSub.subscribe((res1) => {
            if (this.getEditData) {
                if (this.getEditData.combinedData.length != 0 && this.getEditData.combinedData[0]['mode'] == 0) {
                    this.addSubData = this.getEditData.combinedData;
                }
                else if (this.getEditData.combinedData.length != 0 && this.getEditData.isEditConfigurationTable == true && this.getEditData.combinedData[0]['mode'] != 0) {
                    let obj = this.customMonService.getFinalRowData();
                    this.addSubData = obj['HierData']['combinedData'];
                }
                this.customMonService._currentHierarchy = this.getEditData.currentHierarchy;
                this._fixedSP = this.getEditData.fixedSP;
                this._fixedSV = this.getEditData.fixedSV;
                this._selectedServerHierarchy = this.getEditData.selectedServerHierarchy;
                this._selectedTierHierarchy = this.getEditData.selectedTierHierarchy;
            }
            this.clearField();
            if (res1) {
                this.autofill = this.customMonService.$jsonData.subscribe((res) => {
                    if (res) {
                        if (!this.customMonService.isMetricMappedPath) {
                            this.lenn = res[0];
                            let ll = this.lenn.length;
                            this.SubData.jpath = this.lenn.substring(0, ll - 1);
                        }
                        else {
                            this.SubData.jpath = res[0];
                        }
                        this.SubData.jName = res[1]['key'];
                        this.SubData.jValue = res[1]['value'];
                    }
                });
            }
            else {
                if (this.autofill) {
                    this.autofill.unsubscribe();
                }
            }
        });
        this.saveConf = this.customMonService.$saveConfHier.subscribe((res) => {
            if (res) {
                this.emitFinalData(false);
            }
            else {
                // this.customMonService.sendAliasListData(this.aliasList);
                if (this.autofill)
                    this.autofill.unsubscribe();
                this.SubData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_4__["SubjectDTO"]();
            }
        });
    }
    addSubjectData() {
        let flag = true;
        if (!this.isEditSubjectTable) {
            if (this.customMonService.isMetricMappedPath && this.addSubData.length >= 1) {
                flag = false;
                this.messageService.add({
                    severity: 'error',
                    summary: "Multiple subject configuration is not allowed.",
                });
                return;
            }
            else {
                flag = true;
            }
            if (flag) {
                if (this.addSubData.length != 0) {
                    let lastRowId = this.addSubData[this.addSubData.length - 1];
                    this.SubData.id = lastRowId.id + 1;
                }
                else
                    this.SubData.id = 0; // id for the first row entry in the table
                if (this.SubData.pickIndex == "-1") {
                    this.SubData.pickIndex = "";
                }
                if (this.SubData.pickIndex)
                    this.SubData.pickIndex = this.SubData.pickIndex.toString();
                if (this.SubData.jValue)
                    this.SubData.jValue = this.SubData.jValue.toString();
                let metricNameArray = [];
                metricNameArray = [...this.customMonService.getMetricName()];
                for (let i = 0; i < metricNameArray.length; i++) {
                    if (metricNameArray[i] == this.SubData.jName) {
                        this.messageService.add({
                            severity: 'error',
                            summary: "Subject name is present in Metric configuration.",
                        });
                        return;
                    }
                }
                if (this.customMonService.getSubjectFixed() == this.SubData.jName) {
                    this.messageService.add({
                        severity: 'error',
                        summary: this.SubData.jName + " is already present in subject configuration.",
                    });
                    return;
                }
                for (let i = 0; i < this.addSubData.length; i++) {
                    if (this.addSubData[i].jName == this.SubData.jName) {
                        this.messageService.add({
                            severity: 'error',
                            summary: this.SubData.jName + " is already present in subject configuration.",
                        });
                        return;
                    }
                }
                this.addSubData = _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_5__["ImmutableArray"].push(this.addSubData, this.SubData);
                this.customMonService.aliasList.push(this.SubData.jName);
                // this.customMonService._currentHierarchy = this.customMonService._currentHierarchy + ">" + this.SubData.jName ;
                let subjectNameArray = [];
                for (let i = 0; i < this.addSubData.length; i++) {
                    subjectNameArray.push(this.addSubData[i].jName);
                }
                this.customMonService.setsubjectName(subjectNameArray);
                this.onKey();
                this.SubData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_4__["SubjectDTO"]();
                this.subjectAdditionalSettings = false;
            }
        }
        else {
            if (this.customMonService.getSubjectFixed() == this.SubData.jName) {
                this.messageService.add({
                    severity: 'error',
                    summary: this.SubData.jName + " is already present in subject configuration.",
                });
                return;
            }
            let metricNameArray = [];
            metricNameArray = [...this.customMonService.getMetricName()];
            for (let i = 0; i < metricNameArray.length; i++) {
                if (metricNameArray[i] == this.SubData.jName) {
                    this.messageService.add({
                        severity: 'error',
                        summary: "Subject name is present in Metric configuration.",
                    });
                    return;
                }
            }
            for (let i = 0; i < this.addSubData.length; i++) {
                if (i != this.getSelectedRowIndex(this.SubData['id']) && this.addSubData[i].jName == this.SubData.jName) {
                    this.messageService.add({
                        severity: 'error',
                        summary: this.SubData.jName + " is already present in subject configuration.",
                    });
                    return;
                }
            }
            this.addSubData = _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_5__["ImmutableArray"].replace(this.addSubData, this.SubData, this.getSelectedRowIndex(this.SubData["id"]));
            this.onKey();
            // if (this._fixedSP!="") {
            //   this.customMonService.setSubjectFixed(this._fixedSP);
            // }
            let subjectNameArray = [];
            for (let i = 0; i < this.addSubData.length; i++) {
                subjectNameArray.push(this.addSubData[i].jName);
            }
            this.customMonService.setsubjectName(subjectNameArray);
            this.isEditSubjectTable = false; // to change the form button from UPDATE -> ADD when update is already done.
            this.SubData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_4__["SubjectDTO"]();
            this.subjectAdditionalSettings = false;
        }
        this.emitFinalData(false);
    }
    /**This method returns selected row on the basis of Id */
    getSelectedRowIndex(data) {
        let index = this.addSubData.findIndex(each => each["id"] == data);
        return index;
    }
    onKey() {
        let subjectFromJson = "";
        for (let i = 0; i < this.addSubData.length; i++) {
            subjectFromJson = subjectFromJson + ">" + this.addSubData[i].jName + ">";
            subjectFromJson = subjectFromJson.slice(0, -1);
        }
        if (this._fixedSP) {
            this.customMonService._currentHierarchy = this._fixedSP;
            if (subjectFromJson) {
                this.customMonService._currentHierarchy = this._fixedSP + ">" + subjectFromJson;
            }
        }
        else {
            this.customMonService._currentHierarchy = "";
            //added check for mode to handle from being added in Current hierarchy in case of Parameter - bug 132597
            if (subjectFromJson && this.SubData.mode != 1) {
                this.customMonService._currentHierarchy = subjectFromJson;
            }
        }
        // this.customMonService._currentHierarchy = this._fixedSP;
        let onlyTier = false;
        let bothTierserver = false;
        if (this.customMonService._currentHierarchy.includes(TIER) && this.customMonService._currentHierarchy.includes(SERVER)) {
            bothTierserver = true;
        }
        else if (this.customMonService._currentHierarchy.includes(TIER)) {
            onlyTier = true;
        }
        if (this._selectedTierHierarchy == 'yes' && this._selectedServerHierarchy == 'yes') {
            if (!bothTierserver && !onlyTier) {
                this.customMonService._currentHierarchy = TIER + ">" + SERVER + ">" + this.customMonService._currentHierarchy;
            }
            if (onlyTier) {
                let position = this.customMonService._currentHierarchy.indexOf('>');
                this.customMonService._currentHierarchy = TIER + ">" + SERVER + ">" + this.customMonService._currentHierarchy.substring(position + 1);
            }
        }
        if (this._selectedTierHierarchy == 'yes' && this._selectedServerHierarchy == 'no') {
            if (!bothTierserver && !onlyTier) {
                this.customMonService._currentHierarchy = TIER + ">" + this.customMonService._currentHierarchy;
            }
            if (onlyTier) {
                let position = this.customMonService._currentHierarchy.indexOf('>');
                this.customMonService._currentHierarchy = TIER + ">" + this.customMonService._currentHierarchy.substring(position + 1);
            }
            if (bothTierserver) {
                let position = this.customMonService._currentHierarchy.indexOf(SERVER);
                this.customMonService._currentHierarchy = TIER + ">" + this.customMonService._currentHierarchy.substring(position + 7);
            }
        }
        this.customMonService._currentHierarchy = this.customMonService._currentHierarchy.replace(">>", ">");
        if (this.customMonService._currentHierarchy.startsWith(">")) {
            this.customMonService._currentHierarchy = this.customMonService._currentHierarchy.substring(1);
        }
        if (this.customMonService._currentHierarchy.endsWith(">")) {
            this.customMonService._currentHierarchy = this.customMonService._currentHierarchy.substring(0, this.customMonService._currentHierarchy.length - 1);
        }
    }
    editTableConfig(rowData) {
        this.SubData = Object.assign({}, rowData);
        this.isEditSubjectTable = true;
    }
    clearField() {
        this.SubData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_4__["SubjectDTO"]();
        this.isEditSubjectTable = false;
        // this.parameterMode.emit(0); // to reset flag for configure metric/add new url button.
    }
    /*This method is used to delete selected rows*/
    deleteTableConfig(rowData) {
        const me = this;
        this.confirmationService.confirm({
            message: ("Are you sure to delete the selected configuration(s)?"),
            header: 'Delete Confirmation',
            key: "execHierConDial",
            icon: 'pi pi-info-circle',
            accept: () => {
                this.clearField();
                this.loading = true;
                let arrId = [];
                if (this.customMonService.isMetricMappedPath) {
                    this.customMonService.mMappedPath = null;
                }
                arrId.push(rowData.id); // push selected row's id
                this.addSubData = this.addSubData.filter(function (val) {
                    return arrId.indexOf(val.id) == -1; //value to be deleted should return false
                });
                this.loading = false;
                this.onKey();
                this.emitFinalData(false);
            },
            reject: () => {
            }
        });
    }
    emitFinalData(isModeChanged) {
        this.executeHierData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_4__["ExecuteHierarchyDTO"]();
        this.executeHierData.selectedTierHierarchy = this._selectedTierHierarchy;
        this.executeHierData.selectedServerHierarchy = this._selectedServerHierarchy;
        this.executeHierData.fixedSP = this._fixedSP;
        this.executeHierData.fixedSV = this._fixedSV;
        this.executeHierData.currentHierarchy = this.customMonService._currentHierarchy;
        this.executeHierData.combinedData = this.addSubData;
        this.executeHierData.isModeChanged = isModeChanged;
        this.sendFinalData.emit(this.executeHierData);
        // this.addSubData = [];
        this.executeHierData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_4__["ExecuteHierarchyDTO"]();
    }
    clearTableData() {
        // if(this.customMonService.addPrevData.length>0 || this.customMonService.mMappedPath){
        if (this.customMonService.isMetricMappedPath) {
            this.SubData.mode = 0;
            this.onModeChange();
            this.subjectAdditionalSettings = false;
        }
        if (this.customMonService.addPrevData.length > 0 || this.addSubData.length > 0) {
            this.confirmationService.confirm({
                message: ("Your subject and metric configurations will be discarded. Do you want to proceed?"),
                header: 'Confirmation',
                key: "clearTableData",
                icon: 'pi pi-info-circle',
                accept: () => {
                    this.addSubData = [];
                    this.emitFinalData(true);
                },
                reject: () => {
                    this.customMonService.isMetricMappedPath = !this.customMonService.isMetricMappedPath;
                }
            });
        }
    }
    clickButtonEvent(event) {
        var _a, _b, _c, _d;
        let rowData = event.cavEventExt.row;
        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) == _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_7__["EVENT_EDIT"]) {
            this.editTableConfig(rowData);
        }
        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) == _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_7__["EVENT_DELETEROW"]) {
            this.deleteTableConfig(rowData);
        }
    }
    ngOnDestroy() {
        if (this.subscription)
            this.subscription.unsubscribe();
        if (this.autofill)
            this.autofill.unsubscribe();
    }
    //Method called when radiobutton is changed in advanced setting for subject hierarchy.
    onModeChange(event) {
        if (this.customMonService.isMetricMappedPath) {
            this.SubData.mode = 0;
        }
        if (this.SubData.mode == 1) {
            this.disableStr = true;
        }
        else {
            this.disableStr = false;
        }
        this.parameterMode.emit(this.SubData.mode);
        // if (this.SubData.mode == 1) {
        //   this.parameterMode.emit(1);
        // } else if (this.SubData.mode == 2) {
        //   this.parameterMode.emit(2);
        // } else {
        //   this.parameterMode.emit(0);
        // }
    }
};
ExecuteHierarchyComponent.ctorParameters = () => [
    { type: _services_custom_monitor_service__WEBPACK_IMPORTED_MODULE_3__["CustomMonitorService"] },
    { type: primeng__WEBPACK_IMPORTED_MODULE_2__["ConfirmationService"] },
    { type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_6__["CavMessageService"] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])()
], ExecuteHierarchyComponent.prototype, "sendFinalData", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], ExecuteHierarchyComponent.prototype, "getEditData", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])()
], ExecuteHierarchyComponent.prototype, "parameterMode", void 0);
ExecuteHierarchyComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-execute-hierarchy',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./execute-hierarchy.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./execute-hierarchy.component.scss */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.component.scss")).default]
    })
], ExecuteHierarchyComponent);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.module.ts":
/*!*******************************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.module.ts ***!
  \*******************************************************************************************************************************************************/
/*! exports provided: ExecuteHierarchyModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExecuteHierarchyModule", function() { return ExecuteHierarchyModule; });
/* 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 _execute_hierarchy_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./execute-hierarchy.component */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.component.ts");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
/* harmony import */ var _add_metrics_add_metrics_module__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./add-metrics/add-metrics.module */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.module.ts");
/* harmony import */ var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/shared/cav-table/cav-table.module */ "./src/app/shared/cav-table/cav-table.module.ts");








let ExecuteHierarchyModule = class ExecuteHierarchyModule {
};
ExecuteHierarchyModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [_execute_hierarchy_component__WEBPACK_IMPORTED_MODULE_3__["ExecuteHierarchyComponent"]],
        exports: [_execute_hierarchy_component__WEBPACK_IMPORTED_MODULE_3__["ExecuteHierarchyComponent"]],
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["ButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["PanelModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["TableModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["CardModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["TooltipModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["CheckboxModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["MultiSelectModule"],
            _angular_forms__WEBPACK_IMPORTED_MODULE_5__["FormsModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["DialogModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["InputTextModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["DropdownModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["SelectButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["ToggleButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["InputTextareaModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["TabViewModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["SpinnerModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["OverlayPanelModule"],
            _add_metrics_add_metrics_module__WEBPACK_IMPORTED_MODULE_6__["AddMetricsModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["ProgressSpinnerModule"],
            primeng__WEBPACK_IMPORTED_MODULE_4__["ConfirmDialogModule"],
            src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_7__["CavTableModule"]
        ]
    })
], ExecuteHierarchyModule);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.component.scss":
/*!*********************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.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-generic-rest-monitor .generic-container {\n  height: calc(100vh - 40px);\n  overflow: hidden;\n}\napp-generic-rest-monitor .generic-container label {\n  display: inline-flex;\n}\napp-generic-rest-monitor .generic-container .metric-box {\n  padding: 0px 10px;\n  max-height: calc(100vh - 150px);\n  overflow: auto;\n}\napp-generic-rest-monitor .generic-container .response-box {\n  background-color: var(--background_color_1);\n  padding: 0px 10px;\n}\napp-generic-rest-monitor .tab-header li a {\n  font-size: 13px !important;\n}\napp-generic-rest-monitor .text-italic {\n  font-style: italic;\n}\napp-generic-rest-monitor .ui-button.ui-fileupload-choose .ui-button-icon-left {\n  display: none;\n}\napp-generic-rest-monitor .ui-button.ui-fileupload-choose.ui-button-text-icon-left .ui-button-text {\n  padding: 0.529em 1em 0.529em 1em;\n}");

/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.component.ts":
/*!*******************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.component.ts ***!
  \*******************************************************************************************************************************************/
/*! exports provided: GenericRestMonitorComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericRestMonitorComponent", function() { return GenericRestMonitorComponent; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var src_app_pages_monitor_up_down_status_service_utility_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/pages/monitor-up-down-status/service/utility.service */ "./src/app/pages/monitor-up-down-status/service/utility.service.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var _services_custom_monitor_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../services/custom-monitor.service */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/services/custom-monitor.service.ts");
/* harmony import */ var _containers_rest_mon_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../containers/rest-mon-data */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/containers/rest-mon-data.ts");
/* harmony import */ var _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../containers/restMonService.data */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/containers/restMonService.data.ts");
/* harmony import */ var _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../generic-gdf/services/immutable-array */ "./src/app/pages/generic-gdf/services/immutable-array.ts");
/* harmony import */ var _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../add-monitor/constants/monitor-configuration-constants */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-monitor/constants/monitor-configuration-constants.ts");
/* harmony import */ var _generic_gdf_containers_generic_gdf_metric_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../generic-gdf/containers/generic-gdf-metric-data */ "./src/app/pages/generic-gdf/containers/generic-gdf-metric-data.ts");
/* harmony import */ var _generic_gdf_containers_generic_gdf_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../generic-gdf/containers/generic-gdf-data */ "./src/app/pages/generic-gdf/containers/generic-gdf-data.ts");
/* harmony import */ var _constants_mon_rest_api_constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../constants/mon-rest-api-constants */ "./src/app/pages/monitor-up-down-status/constants/mon-rest-api-constants.ts");
/* harmony import */ var _containers_api_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../containers/api-data */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/containers/api-data.ts");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");
/* harmony import */ var _service_monitorupdownstatus_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../service/monitorupdownstatus.service */ "./src/app/pages/monitor-up-down-status/service/monitorupdownstatus.service.ts");
/* harmony import */ var _add_monitor_containers_rest_data__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../add-monitor/containers/rest-data */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-monitor/containers/rest-data.ts");
/* harmony import */ var _configured_monitor_info_configured_monitor_info_component__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../configured-monitor-info/configured-monitor-info.component */ "./src/app/pages/monitor-up-down-status/configure-monitors/configured-monitor-info/configured-monitor-info.component.ts");
/* harmony import */ var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! src/app/shared/cav-toast/service/cav-message.service */ "./src/app/shared/cav-toast/service/cav-message.service.ts");
/* harmony import */ var _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../constants/mon-component-constants */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/constants/mon-component-constants.ts");
/* harmony import */ var src_app_pages_tools_admin_access_control_management_constants_cav_acl_features_constants__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control-management/constants/cav-acl-features.constants */ "./src/app/pages/tools/admin/access-control-management/constants/cav-acl-features.constants.ts");





















let GenericRestMonitorComponent = class GenericRestMonitorComponent {
    constructor(customMonService, router, confirmationService, messageService, sessionService, monUpDown) {
        this.customMonService = customMonService;
        this.router = router;
        this.confirmationService = confirmationService;
        this.messageService = messageService;
        this.sessionService = sessionService;
        this.monUpDown = monUpDown;
        this.metricDescription = "";
        this.finalSaveData = new _containers_api_data__WEBPACK_IMPORTED_MODULE_13__["APIData"]();
        this.genericRestMonDTO = new _containers_rest_mon_data__WEBPACK_IMPORTED_MODULE_6__["RestDTO"]();
        this.addHierarchy = false;
        this.selectSeparator = "_";
        this.selectedMethod = 'get';
        this.addMetrics = false;
        this.isAddConf = false;
        this.isSaveConf = false;
        this.isAddNewUrl = false;
        this.isPreview = false;
        this.showPreview = false;
        this.subsAt = false;
        this.isFromEdit = false; // to check if UI is in edit mode
        this.isEditHierConfTable = false;
        this.isEditMetricConfTable = false;
        this.isEditConfigurationTable = false;
        this.executeData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["ExecuteUrlDto"]();
        this.get_header = '';
        this.get_token = '';
        this.saveMode = '1'; //this is added to distinguish save and save and deploy
        this.headerGroupVal = '';
        this.headerDescVal = '';
        this.restUrlVal = '';
        this.urlNameVal = '';
        this.uploadedFiles = [];
        this.loading = false;
        this.FinalHierData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["ExecuteHierarchyDTO"]();
        this.gdfInfo = new _generic_gdf_containers_generic_gdf_data__WEBPACK_IMPORTED_MODULE_11__["GenericGDFData"]();
        this.addSubData = [];
        this.depMConf = [];
        this.restUrlDto = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["RestUrlDTO"]();
        this.pending = true;
        this.disableViewDep = true;
        this.hideActionCol = true;
        this.metricInfo = new _generic_gdf_containers_generic_gdf_metric_data__WEBPACK_IMPORTED_MODULE_10__["GenericGDFMetricInfo"]();
        this.isFromFileUpload = false; // flag to check whether file upload button is clicked or not.
        this.isConfFirstUrl = true; //flag to check if User is configuring first URL or not
        this.disableMetric = false;
        this.checkParameterMode = 0; // checking parameter mode.
        this.parameterList = []; //dropdown list of parameters.
        this.isParameterSelected = false; //disable final URL and Parameter dropdown.
        this.isShowFinalURL = false;
        this.selectedParameter = ''; //selected parameter
        this.finalURL = ''; //final url
        this.paramLabel = ['--Select Parameter--']; //Added to make the parameter dropdown
        this.paramValue = ['']; //Added to make the parameter dropdown
        this.isMetricDataPresent = false;
        this.configurationBtn = false;
        this.count = 1;
        this.relativePath = 'monitors/custom-monitors/configure-generic-rest.json';
    }
    ngOnInit() {
        this.isAdminPermisson = this.sessionService.isFeatureWrite(src_app_pages_tools_admin_access_control_management_constants_cav_acl_features_constants__WEBPACK_IMPORTED_MODULE_20__["CAV_FEATURES"].MONITORS.NAME, src_app_pages_tools_admin_access_control_management_constants_cav_acl_features_constants__WEBPACK_IMPORTED_MODULE_20__["CAV_FEATURES"].MONITORS.SUB_FEATURES.MONITORS);
        this.prevData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["AddPreviewConfigDTO"]();
        this.method = [
            { label: 'GET', value: 'get' },
            { label: 'POST', value: 'post' },
        ];
        this.separatorValue = [
            { label: '_', value: '_' },
            { label: '-', value: '-' }
        ];
        this.cols = [
            { field: 'url', header: 'URL' },
            { field: 'subject', header: 'Subjects' },
            { field: 'parameters', header: 'Parameters' },
            { field: 'both', header: 'Both' },
            { field: 'metric', header: 'Metrics' }
        ];
        this.finalSaveData['restDTO'] = this.genericRestMonDTO;
        this.authTypes = [
            { label: 'No Auth', value: '' },
            { label: 'Basic Auth', value: 0 },
            { label: 'API Token', value: 1 },
            { label: 'Bearer Token', value: 2 },
        ];
        if (this.customMonService.isFromEdit) {
            this.disableViewDep = false;
            this.isFromEdit = true;
            this.editConfiguration(this.customMonService.getRestEditData);
            this.monUpDown.getConfigInfo(_add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["CUSTOM_GENERIC_REST_TECH_NAME"], this.metricGroupName).subscribe(response => {
                this.monInfoChild.getTableData(response);
            });
        }
        this.tableInfo = [
            { field: "tierInfo", header: 'Tier-Server Information', visible: true }
        ];
    }
    addFirstSubject() {
        if (this.customMonService.addPrevData.length > 0) {
            if (this.customMonService.addPrevData[0].MetricData.length > 0 && this.customMonService.addPrevData[0].MetricData[0].mMappedPath) {
                this.customMonService.isMetricMappedPath = true;
            }
        }
        this.configurationBtn = true;
        this.customMonService.switchTabs = true;
        this.addHierarchy = true;
        setTimeout(() => {
            this.customMonService.switchSubMetData(true);
        }, 500);
        this.executeToggle = false;
    }
    addMetricGroupName() {
        this.executeToggle = false;
        let executionUrl = "";
        let restUrlTmp = "";
        let pathTmp = "";
        if (this.restUrl) {
            if (!this.restUrl.trim().endsWith("/")) {
                this.restUrl = this.restUrl + "/";
            }
            executionUrl = this.restUrl;
        }
        if (this.path) {
            restUrlTmp = executionUrl;
            pathTmp = this.path;
            executionUrl = executionUrl + this.path.trim();
        }
        let execURL = String(executionUrl);
        if (execURL.length == null) {
            this.messageService.add({ severity: 'error', summary: "ERROR", detail: "Enter Valid URL" });
            return;
        }
        else {
            this.executeData.url = execURL;
        }
        if (!this.isFromFileUpload) {
            if (this.addHierarchy) {
                this.confirmationService.confirm({
                    message: ("Your changes will be discarded. Do you want to proceed?"),
                    header: 'Confirmation',
                    key: "genRestConDial",
                    icon: 'pi pi-info-circle',
                    accept: () => {
                        if (this.isConfFirstUrl && !this.isFromEdit) {
                            this.FinalHierData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["ExecuteHierarchyDTO"]();
                        }
                        // this is addded because of bug 132901
                        this.customMonService.isMetricMappedPath = false;
                        this.customMonService._currentHierarchy = "";
                        this.isAddConf = false;
                        this.addMetrics = false;
                        this.addHierarchy = false;
                        this.configurationBtn = false;
                        this.executeUrlData();
                    },
                    reject: () => {
                        this.restUrl = restUrlTmp;
                        this.path = pathTmp;
                    }
                });
            }
            else {
                this.executeUrlData();
            }
        }
        //below changes are made for bug 135973
        if (this.isFromFileUpload) {
            this.executeToggle = true;
        }
        this.isFromFileUpload = false;
    }
    executeUrlData() {
        this.loading = true;
        this.additionalSettings = false;
        if (this.executeData.authMode == 1) {
            this.executeData.token = this.executeData.apiToken;
        }
        else if (this.executeData.authMode == 2) {
            this.executeData.token = this.executeData.bearerToken;
        }
        this.customMonService.executeServiceAndGetData(this.executeData).subscribe(data => {
            if (data) {
                this.customMonService.browseJsonFileData(data);
                if (data['status'] && !this.isFromEdit) {
                    this.executeToggle = true;
                }
                this.loading = false;
            }
        });
    }
    clearFile() {
        this.uploader.nativeElement.value = '';
    }
    uploadFile(fileList) {
        let file = fileList[0];
        this.additionalSettings = false;
        if (file.size > 500000) {
            this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'File size exceeds the maximum limit(500 KB)' });
            return;
        }
        let restUrlTmp = "";
        let pathTmp = "";
        restUrlTmp = this.restUrl;
        pathTmp = this.path;
        if (this.addHierarchy) {
            this.confirmationService.confirm({
                message: ("Your changes will be discarded. Do you want to proceed?"),
                header: 'Confirmation',
                key: "genRestConDial",
                icon: 'pi pi-info-circle',
                accept: () => {
                    this.loading = true;
                    if (this.isConfFirstUrl && !this.isFromEdit) {
                        this.FinalHierData.combinedData = [];
                    }
                    // this is addded because of bug 132901
                    this.customMonService.isMetricMappedPath = false;
                    this.customMonService._currentHierarchy = "";
                    this.isAddConf = false;
                    this.addMetrics = false;
                    this.addHierarchy = false;
                    this.configurationBtn = false;
                    this.isFromFileUpload = true;
                    let fileReader = new FileReader();
                    fileReader.readAsText(file);
                    fileReader.onloadend = (e) => {
                        let obj = {
                            "data": fileReader.result,
                            "status": true
                        };
                        this.customMonService.browseJsonFileData(obj);
                        this.addMetricGroupName();
                    };
                    this.loading = false;
                },
                reject: () => {
                    this.restUrl = restUrlTmp;
                    this.path = pathTmp;
                }
            });
        }
        else {
            this.loading = true;
            this.isFromFileUpload = true;
            let fileReader = new FileReader();
            fileReader.readAsText(file);
            fileReader.onloadend = (e) => {
                let obj = {
                    "data": fileReader.result,
                    "status": true
                };
                this.customMonService.browseJsonFileData(obj);
                this.addMetricGroupName();
            };
            this.loading = false;
        }
    }
    switchTab() {
        this.customMonService.switchTabs = !this.customMonService.switchTabs;
        this.customMonService.switchSubMetData(this.customMonService.switchTabs);
        this.subsAt = this.customMonService.switchTabs;
    }
    configureMetrics() {
        this.customMonService.saveGenRestHierData(true);
        if (this.prevData.HierData.combinedData.length == 0 && this.prevData.HierData.fixedSP == "") {
            this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'Add atleast one Subject' });
            return;
        }
        if (this.prevData.HierData.fixedSP && !this.prevData.HierData.fixedSV) {
            this.messageService.add({ severity: 'error', summary: 'ERROR', detail: '"Fixed Subject Value" is also required with "Fixed Subject Path".' });
            return;
        }
        this.isAddConf = true;
        this.customMonService.switchTabs = true;
        this.addMetrics = true;
        setTimeout(() => {
            this.customMonService.switchSubMetData(false);
            this.customMonService.switchTabs = false;
            this.subsAt = this.customMonService.switchTabs;
        }, 500);
        this.configurationBtn = !this.configurationBtn;
    }
    getFinalData(event) {
        this.FinalHierData = event;
        // this is added for bug 132475
        if (this.FinalHierData.isModeChanged) {
            this.addMetrics = false;
            this.configurationBtn = true;
            this.customMonService.switchTabs = true;
            this.customMonService.switchSubMetData(this.customMonService.switchTabs);
            this.isAddConf = false;
            this.isAddNewUrl = false;
            this.showPreview = false;
            this.FinalMetricData = [];
            this.customMonService.addPrevData = [];
            this.customMonService.mMappedPath = "";
        }
        this.prevData.HierData = this.FinalHierData;
        this.prevData.subject = "";
        if (this.FinalHierData.fixedSP) {
            this.prevData.subject = this.FinalHierData.fixedSP;
        }
        for (let i = 0; i < this.FinalHierData.combinedData.length; i++) {
            this.prevData.subject = this.prevData.subject + ',' + this.FinalHierData.combinedData[i].jName;
            if (this.prevData.subject.startsWith(',')) {
                this.prevData.subject = this.prevData.subject.substring(1);
            }
        }
        if (this.customMonService.isMetricMappedPath) {
            this.generateMetricMappedPath();
        }
    }
    // event emitter method to handle the flow of UI when paramter is selected
    disableConfigureMetrices(mode) {
        this.checkParameterMode = mode;
        if (this.checkParameterMode == 1 || this.checkParameterMode == 2) {
            this.configurationBtn = false;
            this.isAddNewUrl = true;
            if (this.parameterList.length > 0) {
                this.isParameterSelected = true;
                this.isShowFinalURL = true;
            }
        }
        else {
            this.isParameterSelected = false;
            this.isShowFinalURL = false;
            this.configurationBtn = true;
            this.isAddNewUrl = false;
        }
        if (this.customMonService.isMetricMappedPath) {
            this.configurationBtn = true;
            this.isAddNewUrl = false;
        }
    }
    getFinalMetricData(event) {
        this.FinalMetricData = event;
        this.prevData.MetricData = this.FinalMetricData;
        this.prevData.metric = "";
        for (let i = 0; i < this.FinalMetricData.length; i++) {
            this.prevData.metric = this.prevData.metric + ',' + this.FinalMetricData[i]._mN;
            if (this.prevData.metric.startsWith(',')) {
                this.prevData.metric = this.prevData.metric.substring(1);
            }
        }
        if (this.customMonService.isMetricMappedPath) {
            this.generateMetricMappedPath();
        }
    }
    addConfiguration() {
        this.customMonService.saveGenRestHierData(true);
        if (!this.prevData.HierData.fixedSP && this.prevData.HierData.fixedSV) {
            this.prevData.HierData.fixedSV = "";
        }
        if (!this.validateRequiredComponents())
            return false;
        if (this.isEditConfigurationTable && this.isFromEdit) {
            this.FinalHierData.isEditConfigurationTable = false;
            this.customMonService.saveGenRestMetricData(true);
            if (this.prevData.metric != "NA") {
                this.prevData.both = 'NA';
                this.prevData.parameters = 'NA';
            }
            let parameterNames = "";
            let parameterSubjectNames = "";
            for (let i = 0; i < this.prevData.HierData.combinedData.length; i++) {
                if (this.prevData.HierData.combinedData[i].mode == 0) {
                    this.prevData.both = 'NA';
                    this.prevData.parameters = 'NA';
                }
                else if (this.prevData.HierData.combinedData[i].mode == 1) {
                    if (parameterNames)
                        parameterNames = parameterNames + this.prevData.HierData.combinedData[i].jName + ",";
                    else
                        parameterNames = this.prevData.HierData.combinedData[i].jName + ","; // first time
                    // this.prevData.parameters = this.prevData.subject;
                    this.prevData.both = 'NA';
                    this.prevData.metric = 'NA';
                    this.prevData.subject = 'NA';
                }
                else {
                    // this.prevData.both = this.prevData.subject;
                    if (parameterSubjectNames)
                        parameterSubjectNames = parameterSubjectNames + this.prevData.HierData.combinedData[i].jName + ",";
                    else
                        parameterSubjectNames = this.prevData.HierData.combinedData[i].jName + ","; // first time
                    this.prevData.metric = 'NA';
                    this.prevData.parameters = 'NA';
                    this.prevData.subject = 'NA';
                }
            }
            if (parameterNames.length > 0) {
                this.prevData.parameters = parameterNames;
            }
            if (this.prevData.parameters.endsWith(",")) {
                this.prevData.parameters = this.prevData.parameters.substring(0, this.prevData.parameters.length - 1);
            }
            if (parameterSubjectNames.length > 0) {
                this.prevData.both = parameterSubjectNames;
            }
            if (this.prevData.both.endsWith(",")) {
                this.prevData.both = this.prevData.both.substring(0, this.prevData.both.length - 1);
            }
            if (this.prevData.metric == "") {
                this.prevData.metric = 'NA';
            }
            this.prevData.requestType = this.executeData.type;
            this.prevData.header = this.executeData.header;
            this.prevData.userName = this.executeData.userName;
            this.prevData.password = this.executeData.password;
            this.prevData.token = this.executeData.token;
            this.prevData.body = this.executeData.body;
            this.prevData.authMode = this.executeData.authMode;
            this.executeData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["ExecuteUrlDto"]();
            if (this.prevData.MetricData.length != 0) {
                this.prevData.MetricData[0].mMappedPath = this.customMonService.mMappedPath;
            }
            //Handle for Bug 132906 added check !this.customMonService.isMetricMappedPath && this.customMonService.addPrevData.length > 1
            if (!this.customMonService.isMetricMappedPath && this.customMonService.addPrevData.length > 1 && this.prevData.subject != this.customMonService.addPrevData[0].subject && this.customMonService.addPrevData[0].subject != "NA") {
                this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'Subject(s) should be same for all URLs' });
                return;
            }
            this.addPreviewData();
            this.customMonService.mMappedPath = "";
            this.addHierarchy = false;
            this.addMetrics = false;
            this.isAddConf = false;
            this.customMonService.isMetricMappedPath = false;
        }
        else {
            let subjectName = '';
            let arr = this.prevData.HierData.combinedData;
            for (let i = 0; i < arr.length; i++) {
                let str = '';
                let subValue = arr[i]['jValue'];
                subjectName = arr[i]['jName'];
                str = subjectName + '(' + subValue + ')';
                this.paramLabel.push(str);
                this.paramValue.push(subjectName);
            }
            this.paramLabel = [...new Set(this.paramLabel)];
            this.paramValue = [...new Set(this.paramValue)];
            if (this.checkParameterMode == 1 || this.checkParameterMode == 2) {
                this.parameterList = src_app_pages_monitor_up_down_status_service_utility_service__WEBPACK_IMPORTED_MODULE_1__["UtilityService"].createListWithKeyValue(this.paramLabel, this.paramValue);
            }
            subjectName = this.prevData.subject;
            if (this.prevData.metric != "NA") {
                this.prevData.both = 'NA';
                this.prevData.parameters = 'NA';
            }
            if (this.checkParameterMode == 0) {
                this.prevData.both = 'NA';
                this.prevData.parameters = 'NA';
            }
            else if (this.checkParameterMode == 1) {
                this.prevData.parameters = this.prevData.subject;
                this.prevData.subject = 'NA';
                this.prevData.both = 'NA';
                this.prevData.metric = 'NA';
            }
            else {
                this.prevData.metric = 'NA';
                this.prevData.parameters = 'NA';
                this.prevData.both = this.prevData.subject;
                this.prevData.subject = 'NA';
            }
            if (this.prevData.metric == "") {
                this.prevData.metric = 'NA';
            }
            if (this.isEditConfigurationTable) {
                this.customMonService.isMetricMappedPath = false;
                if (this.prevData.HierData.combinedData.length > 0) {
                    let parameterNames = "";
                    let parameterSubjectNames = "";
                    for (let i = 0; i < this.prevData.HierData.combinedData.length; i++) {
                        if (this.prevData.metric != "NA") {
                            this.prevData.both = 'NA';
                            this.prevData.parameters = 'NA';
                        }
                        if (this.prevData.HierData.combinedData[i].mode == 0) {
                            this.prevData.both = 'NA';
                            this.prevData.parameters = 'NA';
                        }
                        else if (this.prevData.HierData.combinedData[i].mode == 1) {
                            if (parameterNames)
                                parameterNames = parameterNames + this.prevData.HierData.combinedData[i].jName + ",";
                            else
                                parameterNames = this.prevData.HierData.combinedData[i].jName + ","; // first time
                            // this.prevData.parameters = this.prevData.subject;
                            this.prevData.subject = 'NA';
                            this.prevData.both = 'NA';
                            this.prevData.metric = 'NA';
                        }
                        else {
                            if (parameterSubjectNames)
                                parameterSubjectNames = parameterSubjectNames + this.prevData.HierData.combinedData[i].jName + ",";
                            else
                                parameterSubjectNames = this.prevData.HierData.combinedData[i].jName + ","; // first time
                            this.prevData.metric = 'NA';
                            this.prevData.parameters = 'NA';
                            // this.prevData.both = this.prevData.subject;
                            this.prevData.subject = 'NA';
                        }
                        if (this.prevData.metric == "") {
                            this.prevData.metric = 'NA';
                        }
                    }
                    if (parameterNames.length > 0) {
                        this.prevData.parameters = parameterNames;
                    }
                    if (this.prevData.parameters.endsWith(",")) {
                        this.prevData.parameters = this.prevData.parameters.substring(0, this.prevData.parameters.length - 1);
                    }
                    if (parameterSubjectNames.length > 0) {
                        this.prevData.both = parameterSubjectNames;
                    }
                    if (this.prevData.both.endsWith(",")) {
                        this.prevData.both = this.prevData.both.substring(0, this.prevData.both.length - 1);
                    }
                }
            }
            // Added below check to handle case when first delete subjects and then add/update is performed.
            if (this.prevData.HierData.combinedData.length == 0 && this.prevData.HierData.fixedSP == "") {
                this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'Add atleast one Subject' });
                this.isParameterSelected = false;
                return;
            }
            if (this.prevData.HierData.fixedSP && !this.prevData.HierData.fixedSV) {
                this.messageService.add({ severity: 'error', summary: 'ERROR', detail: '"Fixed Subject Value" is also required with "Fixed Subject Path".' });
                return;
            }
            this.customMonService.saveGenRestHierData(false);
            this.customMonService.saveGenRestMetricData(true);
            // if (this.prevData.MetricData.length == 0) {
            //   if (this.prevData.HierData.combinedData[0].mode == 0) {
            //     this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'Add atleast one Metric' })
            //     return;
            //   }
            // }
            // if (!this.restUrl) {
            //   this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'Enter Base Url' })
            //   return;
            // }
            // else {
            //   this.prevData.restUrl = this.restUrl;
            //   this.prevData.finalURL = this.finalURL;
            //   this.prevData.path = this.path;
            //   this.prevData.url = this.restUrl + this.path;
            //   if (this.checkParameterMode == 0 && this.prevData.MetricData.length > 0) {
            //     this.prevData.MetricData[0].mMappedPath = this.customMonService.mMappedPath;
            //   }
            // }
            this.isAddConf = false;
            this.showPreview = true;
            this.prevData.requestType = this.executeData.type;
            this.prevData.header = this.executeData.header;
            this.prevData.userName = this.executeData.userName;
            this.prevData.password = this.executeData.password;
            this.prevData.token = this.executeData.token;
            this.prevData.body = this.executeData.body;
            this.prevData.authMode = this.executeData.authMode;
            // if (this.customMonService.addPrevData.length >= 1 && this.prevData.subject != this.customMonService.addPrevData[0].subject && this.customMonService.addPrevData[0].subject != "NA") {
            //   this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'Subject(s) should be same for all URLs' })
            //   return;
            // }
            this.metricInfo = new _generic_gdf_containers_generic_gdf_metric_data__WEBPACK_IMPORTED_MODULE_10__["GenericGDFMetricInfo"]();
            this.executeData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["ExecuteUrlDto"]();
            this.customMonService.mMappedPath = "";
            this.FinalMetricData = [];
            this.addPreviewData();
            this.isSaveConf = true;
            this.isAddNewUrl = true;
            this.isPreview = true;
            this.addHierarchy = false;
            this.addMetrics = false;
            this.customMonService.isMetricMappedPath = false;
        }
        return true;
    }
    showPreviewData() {
        this.customMonService.previewData = this.customMonService.addPrevData;
        this.router.navigate(['/monitor/preview-data']);
    }
    addNewUrl() {
        this.isConfFirstUrl = false;
        if (this.checkParameterMode == 1 || this.checkParameterMode == 2) {
            if (!this.addConfiguration()) {
                return;
            }
        }
        let obj = {
            "status": false
        };
        this.customMonService.browseJsonFileData(obj);
        this.addMetrics = false;
        this.addHierarchy = false;
        // this is commented because of bug 132885 as path was getting removed at the click of add new Url
        // if (this.checkParameterMode == 0) {
        //   this.path = '';
        // }
        this.addSubData = [];
        this.checkParameterMode = 0;
        this.depMConf = [];
        this.isAddNewUrl = false;
        // to show parameter list when Add New URL is clicked only if list contains some values.
        if (this.parameterList.length > 0) {
            this.isParameterSelected = true;
            this.isShowFinalURL = true;
        }
    }
    //Method called when Save and Save & Deploy button is clicked.
    saveConfiguration() {
        if (!this.validateMandatoryArgs()) {
            return;
        }
        this.customMonService.aliasList = [];
        this.loading = true;
        if (this.isFromEdit) {
            this.finalSaveData.objectId = this.customMonService.objectID;
        }
        if (this.customMonService.addPrevData.length == 1 && (this.customMonService.addPrevData[0].parameters != "NA" || this.customMonService.addPrevData[0].both != "NA")) {
            this.messageService.add({ severity: 'error', summary: 'ERROR', detail: "Please add Parameter or Subject and metric." });
            this.loading = false;
            return;
        }
        if (this.customMonService.addPrevData.length >= 2 && (this.customMonService.addPrevData[this.customMonService.addPrevData.length - 1].parameters != "NA" || this.customMonService.addPrevData[this.customMonService.addPrevData.length - 1].both != "NA")) {
            this.messageService.add({ severity: 'error', summary: 'ERROR', detail: "Please add Subject and metric." });
            this.loading = false;
            return;
        }
        for (let i = 0; i < this.customMonService.addPrevData.length; i++) {
            if (this.customMonService.addPrevData[i].HierData.combinedData.length == 0 && this.customMonService.addPrevData[i].HierData.fixedSP == "" && (this.customMonService.addPrevData[i].parameters == "NA" && this.customMonService.addPrevData[i].both == "NA")) {
                this.messageService.add({ severity: 'error', summary: 'ERROR', detail: "Each URL must have atleast one Subject Configuration." });
                this.loading = false;
                return;
            }
            if (this.customMonService.addPrevData[i].MetricData.length == 0 && (this.customMonService.addPrevData[i].parameters == "NA" && this.customMonService.addPrevData[i].both == "NA")) {
                this.messageService.add({ severity: 'error', summary: 'ERROR', detail: "Each URL must have atleast one Metric Configuration." });
                this.loading = false;
                return;
            }
        }
        for (let i = 0; i < this.customMonService.addPrevData.length; i++) {
            this.restUrlDto.baseUrl = this.customMonService.addPrevData[i].restUrl;
            if (this.customMonService.addPrevData[i]['finalURL'] == "") {
                this.restUrlDto.finalURL = this.customMonService.addPrevData[i].restUrl + this.customMonService.addPrevData[i].path;
            }
            else {
                this.restUrlDto.finalURL = this.customMonService.addPrevData[i].finalURL;
            }
            this.restUrlDto.path = this.customMonService.addPrevData[i].path;
            this.restUrlDto.requestType = this.customMonService.addPrevData[i].requestType;
            this.restUrlDto.userName = this.customMonService.addPrevData[i].userName;
            this.restUrlDto.password = this.customMonService.addPrevData[i].password;
            this.restUrlDto.header = this.customMonService.addPrevData[i].header;
            this.restUrlDto.token = this.customMonService.addPrevData[i].token;
            this.restUrlDto.body = this.customMonService.addPrevData[i].body;
            this.restUrlDto.authMode = this.customMonService.addPrevData[i].authMode;
            this.FinalMetricData = this.customMonService.addPrevData[i].MetricData;
            this.FinalHierData = this.customMonService.addPrevData[i].HierData;
            this.genericRestMonDTO.monN = this.metricGroupName;
            this.genericRestMonDTO.monD = this.metricDescription;
            this.genericRestMonDTO.opt = '--monUiOpt ' + this.restUrlDto.baseUrl + _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SPACE_SEPARATOR"] + "--monTier " +
                this.customMonService.addPrevData[i].HierData.selectedTierHierarchy + _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SPACE_SEPARATOR"] + "--monServer " + this.customMonService.addPrevData[i].HierData.selectedServerHierarchy;
            this.genericRestMonDTO.currSubH = this.FinalHierData.currentHierarchy;
            this.genericRestMonDTO.fixedSubPath = this.FinalHierData.fixedSP;
            this.genericRestMonDTO.fixedSubValue = this.FinalHierData.fixedSV;
            this.genericRestMonDTO.tier = this.FinalHierData.selectedTierHierarchy;
            this.genericRestMonDTO.server = this.FinalHierData.selectedServerHierarchy;
            this.genericRestMonDTO.separator = this.selectSeparator;
            //To save data of Execute hierarchy in final DTO
            this.gdfInfo.subjectInfo = this.FinalHierData.combinedData;
            //hierrachy in GDF
            this.gdfInfo.mD = this.FinalHierData.currentHierarchy;
            this.genericRestMonDTO.mdata = this.gdfInfo.mD;
            for (let i = 0; i < this.FinalMetricData.length; i++) {
                this.metricInfo.dT = this.FinalMetricData[i]._dT;
                this.metricInfo.fL = this.FinalMetricData[i]._mF;
                this.metricInfo.graphNm = this.FinalMetricData[i]._mDN;
                this.metricInfo.gD = this.FinalMetricData[i]._metDesc;
                this.metricInfo.depMConf.push(this.FinalMetricData[i]);
                this.gdfInfo.metricInfo.push(this.metricInfo);
                this.metricInfo = new _generic_gdf_containers_generic_gdf_metric_data__WEBPACK_IMPORTED_MODULE_10__["GenericGDFMetricInfo"]();
            }
            this.restUrlDto.gdfInfo = this.gdfInfo;
            this.genericRestMonDTO.restUrlDto.push(this.restUrlDto);
            this.restUrlDto = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["RestUrlDTO"]();
            this.gdfInfo = new _generic_gdf_containers_generic_gdf_data__WEBPACK_IMPORTED_MODULE_11__["GenericGDFData"]();
            this.FinalHierData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["ExecuteHierarchyDTO"]();
            this.FinalMetricData = [];
        }
        this.finalSaveData['restDTO'] = this.genericRestMonDTO;
        this.customMonService.saveGenRestData(this.finalSaveData).subscribe(res => {
            if (res['status']) {
                this.loading = false;
                this.messageService.add({ severity: 'success', summary: 'Success', detail: res['msg'] });
                if (this.saveMode == '2') {
                    setTimeout(() => {
                        this.monUpDown.monName = this.metricGroupName;
                        let obj = {
                            'monName': this.metricGroupName
                        };
                        let restData = new _add_monitor_containers_rest_data__WEBPACK_IMPORTED_MODULE_16__["RestData"]();
                        if (this.customMonService.addPrevData[0].HierData.selectedServerHierarchy == "yes") {
                            restData.isServer = true;
                        }
                        if (this.customMonService.addPrevData[0].HierData.selectedTierHierarchy == "yes") {
                            restData.isTier = true;
                        }
                        obj['restData'] = restData;
                        this.customMonService.restDepData = [];
                        this.customMonService.restDepData.push(obj);
                        this.customMonService.saveDeploy(_add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["REST_TYPE"]);
                    });
                }
                else {
                    setTimeout(() => {
                        this.router.navigate([_constants_mon_rest_api_constants__WEBPACK_IMPORTED_MODULE_12__["AVAILABLE_CST_MON_URL"], 'rest']);
                    }, 500);
                }
            }
            else {
                this.loading = false;
                this.messageService.add({ severity: 'error', summary: 'ERROR', detail: res['msg'] });
            }
        });
    }
    addPreviewData() {
        if (!this.isEditConfigurationTable) {
            if (this.customMonService.addPrevData.length != 0) {
                let lastRowId = this.customMonService.addPrevData[this.customMonService.addPrevData.length - 1];
                this.prevData.id = lastRowId.id + 1;
            }
            else
                this.prevData.id = 0; // id for the first row entry in the table
            this.customMonService.addPrevData = _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_8__["ImmutableArray"].push(this.customMonService.addPrevData, this.prevData);
            this.prevData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["AddPreviewConfigDTO"]();
        }
        else {
            this.customMonService.addPrevData = _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_8__["ImmutableArray"].replace(this.customMonService.addPrevData, this.prevData, this.getSelectedRowIndex(this.prevData["id"]));
            this.isEditConfigurationTable = false; // to change the form button from UPDATE -> ADD when update is already done.
            this.prevData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["AddPreviewConfigDTO"]();
        }
    }
    /**This method returns selected row on the basis of Id */
    getSelectedRowIndex(data) {
        let index = this.customMonService.addPrevData.findIndex(each => each["id"] == data);
        return index;
    }
    editTableConfig(rowData) {
        this.customMonService.setFinalRowData(rowData);
        this.isEditConfigurationTable = true;
        this.isAddConf = true;
        this.addHierarchy = true;
        setTimeout(() => {
            this.customMonService.switchSubMetData(true);
            this.customMonService.switchTabs = true;
            this.subsAt = this.customMonService.switchTabs;
        }, 0);
        this.FinalHierData = rowData.HierData;
        this.FinalHierData.isEditConfigurationTable = this.isEditConfigurationTable;
        this.FinalMetricData = rowData.MetricData;
        this.restUrl = rowData.restUrl;
        this.finalURL = rowData.finalURL;
        this.executeData.header = rowData.header;
        this.executeData.userName = rowData.userName;
        this.executeData.password = rowData.password;
        this.executeData.body = rowData.body;
        this.executeData.type = rowData.requestType;
        this.executeData.authMode = rowData.authMode;
        this.path = rowData.path;
        if (rowData.authMode == 1) {
            this.executeData.apiToken = rowData.token;
        }
        else if (rowData.authMode == 2) {
            this.executeData.bearerToken = rowData.token;
        }
        this.prevData = Object.assign({}, rowData);
        const myArray = rowData.subject.split(",");
        this.customMonService.aliasList = myArray;
        if (this.FinalMetricData.length > 0 && this.FinalMetricData[0].mMappedPath) {
            this.customMonService.isMetricMappedPath = true;
            this.customMonService.mMappedPath = this.FinalMetricData[0].mMappedPath;
        }
        for (let i = 0; i < rowData['HierData']['combinedData'].length; i++) {
            if (rowData['HierData']['combinedData'][i]['mode'] == 1 || rowData['HierData']['combinedData'][i]['mode'] == 2) {
                if (this.paramLabel.length != 0) {
                    this.isParameterSelected = false;
                }
                this.isShowFinalURL = true;
                this.addMetrics = false;
            }
            else {
                this.addMetrics = true;
            }
        }
        // this is added because of bug 132889
        if (rowData['finalURL'] && !this.customMonService.isMetricMappedPath) {
            this.isShowFinalURL = true;
        }
        else {
            this.isShowFinalURL = false;
        }
        // this is added because of bug 133314 as we do not need to show final url in case of Non-Dependent URL Configuration.
        if (this.customMonService.addPrevData[0]['HierData']['combinedData'][0]['mode'] == 0) {
            this.isShowFinalURL = false;
        }
    }
    /*This method is used to delete selected rows*/
    deleteTableConfig(rowData) {
        const me = this;
        this.confirmationService.confirm({
            message: ("Are you sure to delete the selected configuration(s)?"),
            header: 'Delete Confirmation',
            key: "genRestConDial",
            icon: 'pi pi-info-circle',
            accept: () => {
                this.loading = true;
                let arrId = [];
                arrId.push(rowData.id); // push selected row's id
                if (this.customMonService.mMappedPath) {
                    this.customMonService.mMappedPath = "";
                    this.customMonService.isMetricMappedPath = false;
                }
                // this is added because of Bug 132858
                if (this.customMonService.addPrevData.length == 1) {
                    this.isAddNewUrl = false;
                    //this is added because dropdown was not getting cleared at deleting the configuration
                    this.parameterList = [];
                    this.paramLabel = [];
                    this.paramValue = [];
                    this.paramLabel = ['--Select Parameter--'];
                    this.paramValue = [''];
                    this.isParameterSelected = false;
                }
                // this is added because of Bug 133000
                this.isEditConfigurationTable = false;
                this.FinalHierData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["ExecuteHierarchyDTO"]();
                this.FinalMetricData = [];
                this.customMonService.addPrevData = this.customMonService.addPrevData.filter(function (val) {
                    return arrId.indexOf(val.id) == -1; //value to be deleted should return false
                });
                // to hide subject and metric info - bug id: 130421
                this.path = "";
                // this is addded because of Bug 132886 as final url was still showing after deleting the configuration.
                this.isShowFinalURL = false;
                this.addMetrics = false;
                this.addHierarchy = false;
                this.isAddConf = false;
                this.loading = false;
                if (this.customMonService.addPrevData.length === 0) {
                    this.restUrl = "";
                    //parm 135973
                    // this.metricGroupName = "";
                    // this.metricDescription = "";
                    this.showPreview = false;
                }
                this.loading = false;
            },
            reject: () => {
            }
        });
    }
    editConfiguration(editData) {
        if (editData) {
            this.editData = editData;
            let iniSubject = "";
            let iniMetric = "";
            //subject path and metric path in edit
            let isMetricMappedPath = false;
            if (editData.restUrlDto[0].gdfInfo && editData.restUrlDto[0].gdfInfo.metricInfo &&
                editData.restUrlDto[0].gdfInfo.metricInfo.length > 0 && editData.restUrlDto[0].gdfInfo.metricInfo[0].depMConf
                && editData.restUrlDto[0].gdfInfo.metricInfo[0].depMConf[0].mMappedPath) {
                isMetricMappedPath = true;
            }
            if (isMetricMappedPath) {
                let str = editData.restUrlDto[0].gdfInfo.metricInfo[0].depMConf[0].mMappedPath;
                let finalIndex = str.lastIndexOf(".");
                let iniStr = str.substring(0, finalIndex + 1);
                let finalStr = str.substring(finalIndex + 1);
                let myArray2 = finalStr.split("'");
                let subName = myArray2[1];
                let metricName = myArray2[3];
                iniSubject = iniStr + subName + "[*]";
                iniMetric = iniStr + metricName + "[*]";
            }
            this.restUrl = editData.restUrlDto[0].baseUrl;
            this.metricGroupName = editData.monN;
            this.metricDescription = editData.monD;
            this.selectSeparator = editData.separator;
            //below check is added to handle addtional entry in subject array in case of Fixed subject Path
            let startIndex = 0;
            if (editData.restUrlDto[0].gdfInfo.subjectInfo[0].jName == null) {
                startIndex = 1;
            }
            if (editData.restUrlDto) {
                for (let i = 0; i < editData.restUrlDto.length; i++) {
                    this.prevData.HierData.currentHierarchy = editData.currSubH;
                    this.prevData.HierData.fixedSP = editData.fixedSubPath;
                    this.prevData.HierData.fixedSV = editData.fixedSubValue;
                    if (editData.restUrlDto[i]['gdfInfo']['metricInfo'].length == 0) {
                        this.prevData.metric = 'NA';
                    }
                    if (editData.currSubH.includes('Tier')) {
                        this.prevData.HierData.selectedTierHierarchy = 'yes';
                    }
                    if (editData.currSubH.includes('Server')) {
                        this.prevData.HierData.selectedServerHierarchy = 'yes';
                    }
                    if (editData.fixedSubPath) {
                        this.prevData.subject = editData.fixedSubPath;
                    }
                    let subjectsFromEdit = "";
                    let metricsFromEdit = "";
                    this.prevData.restUrl = editData.restUrlDto[i].baseUrl;
                    this.prevData.path = editData.restUrlDto[i].path;
                    this.prevData.finalURL = editData.restUrlDto[i].finalURL;
                    this.prevData.url = editData.restUrlDto[i].baseUrl + editData.restUrlDto[i].path;
                    if (editData.restUrlDto[i].header)
                        this.prevData.header = editData.restUrlDto[i].header;
                    if (editData.restUrlDto[i].body)
                        this.prevData.body = editData.restUrlDto[i].body;
                    if (editData.restUrlDto[i].token)
                        this.prevData.token = editData.restUrlDto[i].token;
                    if (editData.restUrlDto[i].authMode)
                        this.prevData.authMode = editData.restUrlDto[i].authMode;
                    if (editData.restUrlDto[i].userName)
                        this.prevData.userName = editData.restUrlDto[i].userName;
                    if (editData.restUrlDto[i].password)
                        this.prevData.password = editData.restUrlDto[i].password;
                    this.prevData.requestType = editData.restUrlDto[i].requestType;
                    for (let j = 0; j < editData.restUrlDto[i].gdfInfo.metricInfo.length; j++) {
                        editData.restUrlDto[i].gdfInfo.metricInfo[j].depMConf[0]._dT = editData.restUrlDto[i].gdfInfo.metricInfo[j].dT;
                        editData.restUrlDto[i].gdfInfo.metricInfo[j].depMConf[0]._mF = editData.restUrlDto[i].gdfInfo.metricInfo[j].fL;
                        if (iniMetric) {
                            editData.restUrlDto[i].gdfInfo.metricInfo[j].depMConf[0]._mP = iniMetric;
                        }
                        editData.restUrlDto[i].gdfInfo.metricInfo[j].depMConf[0]._mN = editData.restUrlDto[i].gdfInfo.metricInfo[j].depMConf[0]._mN;
                        this.prevData.MetricData.push(editData.restUrlDto[i].gdfInfo.metricInfo[j].depMConf[0]);
                        metricsFromEdit = metricsFromEdit + "," + editData.restUrlDto[i].gdfInfo.metricInfo[j].depMConf[0]._mN;
                    }
                    let parameterNames = "";
                    let parameterSubjectNames = "";
                    for (let k = startIndex; k < editData.restUrlDto[i].gdfInfo.subjectInfo.length; k++) {
                        //For advanced Metric Mapped path flow
                        if (this.customMonService.isMetricMappedPath || isMetricMappedPath) {
                            editData.restUrlDto[i].gdfInfo.subjectInfo[k].jName = editData.currSubH.substring(editData.currSubH.lastIndexOf(">") + 1);
                            if (iniSubject) {
                                editData.restUrlDto[i].gdfInfo.subjectInfo[k].jpath = iniSubject;
                            }
                        }
                        this.prevData.HierData.combinedData.push(editData.restUrlDto[i].gdfInfo.subjectInfo[k]);
                        if (editData.restUrlDto[i].gdfInfo.subjectInfo[k]['mode'] == 0) {
                            this.prevData.both = 'NA';
                            this.prevData.parameters = 'NA';
                        }
                        else if (editData.restUrlDto[i].gdfInfo.subjectInfo[k]['mode'] == 1) {
                            // this.prevData.parameters = editData.restUrlDto[i].gdfInfo.subjectInfo[k]['jName'];
                            if (parameterNames)
                                parameterNames = parameterNames + editData.restUrlDto[i].gdfInfo.subjectInfo[k].jName + ",";
                            else
                                parameterNames = editData.restUrlDto[i].gdfInfo.subjectInfo[k].jName + ","; // first time
                            this.prevData.both = 'NA';
                            this.prevData.metric = 'NA';
                            this.prevData.subject = "NA";
                        }
                        else {
                            if (parameterSubjectNames)
                                parameterSubjectNames = parameterSubjectNames + editData.restUrlDto[i].gdfInfo.subjectInfo[k].jName + ",";
                            else
                                parameterSubjectNames = editData.restUrlDto[i].gdfInfo.subjectInfo[k].jName + ","; // first time
                            this.prevData.metric = 'NA';
                            this.prevData.parameters = 'NA';
                            // this.prevData.both = editData.restUrlDto[i].gdfInfo.subjectInfo[k]['jName'];
                            this.prevData.subject = "NA";
                        }
                        subjectsFromEdit = subjectsFromEdit + "," + editData.restUrlDto[i].gdfInfo.subjectInfo[k].jName;
                    }
                    if (subjectsFromEdit.length > 0 && this.prevData.subject != "NA") {
                        this.prevData.subject = this.prevData.subject + "," + subjectsFromEdit.slice(1);
                    }
                    if (parameterNames.length > 0) {
                        this.prevData.parameters = parameterNames;
                    }
                    if (this.prevData.parameters.endsWith(",")) {
                        this.prevData.parameters = this.prevData.parameters.substring(0, this.prevData.parameters.length - 1);
                    }
                    if (parameterSubjectNames.length > 0) {
                        this.prevData.both = parameterSubjectNames;
                    }
                    if (this.prevData.both.endsWith(",")) {
                        this.prevData.both = this.prevData.both.substring(0, this.prevData.both.length - 1);
                    }
                    if (this.prevData.subject.startsWith(",")) {
                        this.prevData.subject = this.prevData.subject.substring(1);
                    }
                    if (this.prevData.MetricData.length != 0) {
                        this.prevData.metric = metricsFromEdit.slice(1);
                    }
                    if (this.customMonService.addPrevData.length != 0) {
                        let lastRowId = this.customMonService.addPrevData[this.customMonService.addPrevData.length - 1];
                        this.prevData.id = lastRowId.id + 1;
                    }
                    else
                        this.prevData.id = 0; // id for the first row entry in the table
                    this.customMonService.addPrevData = _generic_gdf_services_immutable_array__WEBPACK_IMPORTED_MODULE_8__["ImmutableArray"].push(this.customMonService.addPrevData, this.prevData);
                    this.prevData = new _containers_restMonService_data__WEBPACK_IMPORTED_MODULE_7__["AddPreviewConfigDTO"]();
                }
            }
            else {
                this.messageService.add({ severity: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SEVERITY_ERROR"], summary: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SUMMARY_ERROR"], detail: "Error in getting configuration." });
            }
            this.showPreview = true;
        }
        else {
            this.messageService.add({ severity: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SEVERITY_ERROR"], summary: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SUMMARY_ERROR"], detail: "Error in getting configuration." });
        }
    }
    validateGrpInfo() {
        if (this.metricDescription == "") {
            this.metricDescription = this.metricGroupName;
        }
    }
    ngOnDestroy() {
        this.isFromFileUpload = false;
        this.customMonService.setsubjectName([]);
        this.customMonService.setMetricName([]);
        this.customMonService.addPrevData = [];
        this.customMonService.isMetricMappedPath = false;
        this.customMonService.mMappedPath = "";
    }
    //Method to check and validate if all mandatory options are provided in the configuration before save.
    validateMandatoryArgs() {
        if (!this.metricGroupName) {
            this.messageService.add({ severity: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SEVERITY_ERROR"], summary: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SUMMARY_ERROR"], detail: "Please enter metric name." });
            return false;
        }
        else if (!this.restUrl) {
            this.messageService.add({ severity: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SEVERITY_ERROR"], summary: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SUMMARY_ERROR"], detail: "Please enter base URL." });
            return false;
        }
        else if (this.customMonService.addPrevData.length === 0) {
            this.messageService.add({ severity: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SEVERITY_ERROR"], summary: _add_monitor_constants_monitor_configuration_constants__WEBPACK_IMPORTED_MODULE_9__["SUMMARY_ERROR"], detail: "Please add subject and metric" });
            return false;
        }
        return true;
    }
    generateMetricMappedPath() {
        let subjectPath = "";
        let metricPath = "";
        if (this.prevData.HierData.combinedData.length > 0)
            subjectPath = this.prevData.HierData.combinedData[0].jpath;
        if (subjectPath.charAt(subjectPath.length - 1) === ".") {
            subjectPath = subjectPath.substring(0, subjectPath.length - 1);
        }
        if (this.prevData.MetricData.length > 0)
            metricPath = this.prevData.MetricData[0]._mP;
        if (metricPath.charAt(metricPath.length - 1) === ".") {
            metricPath = metricPath.substring(0, metricPath.length - 1);
        }
        let subPath = "";
        let metPath = "";
        let subjectName = "";
        let metricName = "";
        let str = "";
        subPath = subjectPath.substring(0, subjectPath.lastIndexOf(".") + 1);
        metPath = metricPath.substring(0, metricPath.lastIndexOf(".") + 1);
        if (subPath === metPath) {
            subjectName = subjectPath.substring(subjectPath.lastIndexOf(".") + 1);
            metricName = metricPath.substring(metricPath.lastIndexOf(".") + 1);
            if (subjectName.includes("[")) {
                subjectName = subjectName.substring(0, subjectName.lastIndexOf("["));
            }
            if (metricName.includes("[")) {
                metricName = metricName.substring(0, metricName.lastIndexOf("["));
            }
            str = subPath + "['" + subjectName + "', '" + metricName + "']" + "[*]";
            this.customMonService.mMappedPath = str;
        }
    }
    // on changing parameter
    onChangeParameter() {
        if (this.finalURL == '' && this.path) {
            this.finalURL = '$BaseURL' + "/" + this.path;
            this.count = 1;
        }
        else if (this.finalURL == '' && !this.path) {
            this.finalURL = '$BaseURL' + "/";
            this.count = 1;
        }
        // this check is used when finalURL contains some parameter
        if (this.count != 1 && this.finalURL.includes("#")) {
            let temp = this.finalURL.substring(this.finalURL.lastIndexOf("#") + 1, this.finalURL.lastIndexOf("#") + 2);
            this.count = Number(temp);
            this.count++;
        }
        // this check is used when finalURL does not contains any parameter
        if (this.finalURL && !this.finalURL.includes("#")) {
            this.count = 1;
        }
        let arr = this.paramLabel;
        for (let i = 0; i < arr.length; i++) {
            if (arr[i].includes(this.selectedParameter)) {
                if (this.finalURL.includes(this.selectedParameter)) {
                    break;
                }
                let substrOfParameterValue = arr[i].substring(arr[i].lastIndexOf("(") + 1, arr[i].lastIndexOf(")"));
                // Handle case of empty path
                if (!this.path) {
                    this.path = substrOfParameterValue;
                    this.finalURL = this.finalURL + this.selectedParameter + "#" + (this.count);
                }
                else {
                    this.path = this.path + "/" + substrOfParameterValue;
                    this.finalURL = this.finalURL + "/" + this.selectedParameter + "#" + (this.count);
                }
                this.count++;
            }
        }
    }
    clickButtonEvent(event) {
        var _a, _b, _c, _d;
        let rowData = event.cavEventExt.row;
        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) == _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_19__["EVENT_EDIT"]) {
            this.editTableConfig(rowData);
        }
        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) == _constants_mon_component_constants__WEBPACK_IMPORTED_MODULE_19__["EVENT_DELETEROW"]) {
            this.deleteTableConfig(rowData);
        }
    }
    validateRequiredComponents() {
        //Validate URL is present in Add/edit case
        if (!this.restUrl) {
            this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'Enter Base Url' });
            return false;
        }
        else {
            this.prevData.restUrl = this.restUrl;
            this.prevData.finalURL = this.finalURL;
            this.prevData.path = this.path;
            //handling case when path is not provided in that case undefined was being added to rest url.
            if (this.path)
                this.prevData.url = this.restUrl + this.path;
            else
                this.prevData.url = this.restUrl;
            if (this.checkParameterMode == 0 && this.prevData.MetricData.length > 0) {
                this.prevData.MetricData[0].mMappedPath = this.customMonService.mMappedPath;
            }
        }
        // Validate Empty subject
        if (this.prevData.HierData.combinedData.length == 0 && !this.prevData.HierData.fixedSP && !this.isAddNewUrl) {
            this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'Add atleast one Subject' });
            this.isParameterSelected = false;
            this.isShowFinalURL = false;
            return false;
        }
        if (this.prevData.HierData.fixedSP && !this.prevData.HierData.fixedSV) {
            this.messageService.add({ severity: 'error', summary: 'ERROR', detail: '"Fixed Subject Value" is also required with "Fixed Subject Path".' });
            return false;
        }
        //Validate Empty Metric
        if (this.prevData['MetricData'].length === 0) {
            if (this.prevData.HierData.combinedData.length > 0 && this.prevData.HierData.combinedData[0].mode == 0) {
                this.messageService.add({ severity: 'error', summary: 'ERROR', detail: 'Add atleast one Metric' });
                return false;
            }
        }
        return true;
    }
    //Method called when parameter is clicked - for bug 132847
    onParameterClick() {
        this.onChangeParameter();
    }
};
GenericRestMonitorComponent.ctorParameters = () => [
    { type: _services_custom_monitor_service__WEBPACK_IMPORTED_MODULE_5__["CustomMonitorService"] },
    { type: _angular_router__WEBPACK_IMPORTED_MODULE_4__["Router"] },
    { type: primeng__WEBPACK_IMPORTED_MODULE_3__["ConfirmationService"] },
    { type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_18__["CavMessageService"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_14__["SessionService"] },
    { type: _service_monitorupdownstatus_service__WEBPACK_IMPORTED_MODULE_15__["MonitorupdownstatusService"] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewChild"])('uploader')
], GenericRestMonitorComponent.prototype, "uploader", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewChild"])(_configured_monitor_info_configured_monitor_info_component__WEBPACK_IMPORTED_MODULE_17__["ConfiguredMonitorInfoComponent"])
], GenericRestMonitorComponent.prototype, "monInfoChild", void 0);
GenericRestMonitorComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["Component"])({
        selector: 'app-generic-rest-monitor',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./generic-rest-monitor.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].None,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./generic-rest-monitor.component.scss */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.component.scss")).default]
    })
], GenericRestMonitorComponent);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.module.ts":
/*!****************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.module.ts ***!
  \****************************************************************************************************************************************/
/*! exports provided: GenericRestMonitorModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericRestMonitorModule", function() { return GenericRestMonitorModule; });
/* 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 _generic_rest_monitor_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generic-rest-monitor.component */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/generic-rest-monitor.component.ts");
/* harmony import */ var primeng_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! primeng/button */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-button.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
/* harmony import */ var _execute_hierarchy_execute_hierarchy_module__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./execute-hierarchy/execute-hierarchy.module */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/execute-hierarchy.module.ts");
/* harmony import */ var _response_file_response_file_module__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./response-file/response-file.module */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.module.ts");
/* harmony import */ var _execute_hierarchy_add_metrics_add_metrics_module__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./execute-hierarchy/add-metrics/add-metrics.module */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/execute-hierarchy/add-metrics/add-metrics.module.ts");
/* harmony import */ var _preview_data_preview_data_module__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./preview-data/preview-data.module */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/preview-data/preview-data.module.ts");
/* harmony import */ var _configured_monitor_info_configured_monitor_info_module__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../configured-monitor-info/configured-monitor-info.module */ "./src/app/pages/monitor-up-down-status/configure-monitors/configured-monitor-info/configured-monitor-info.module.ts");
/* harmony import */ var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! src/app/shared/cav-table/cav-table.module */ "./src/app/shared/cav-table/cav-table.module.ts");














const routes = [
    { path: '', component: _generic_rest_monitor_component__WEBPACK_IMPORTED_MODULE_3__["GenericRestMonitorComponent"] }
];
let GenericRestMonitorModule = class GenericRestMonitorModule {
};
GenericRestMonitorModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [_generic_rest_monitor_component__WEBPACK_IMPORTED_MODULE_3__["GenericRestMonitorComponent"]],
        imports: [
            primeng__WEBPACK_IMPORTED_MODULE_6__["ToolbarModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["MenuModule"],
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            _execute_hierarchy_execute_hierarchy_module__WEBPACK_IMPORTED_MODULE_8__["ExecuteHierarchyModule"],
            _response_file_response_file_module__WEBPACK_IMPORTED_MODULE_9__["ResponseFileModule"],
            _angular_router__WEBPACK_IMPORTED_MODULE_5__["RouterModule"].forChild(routes),
            primeng_button__WEBPACK_IMPORTED_MODULE_4__["ButtonModule"],
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["PanelModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["TableModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["CardModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["TooltipModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["OverlayPanelModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["CheckboxModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["MultiSelectModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["AutoCompleteModule"],
            _angular_forms__WEBPACK_IMPORTED_MODULE_7__["FormsModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["DialogModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["InputTextModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["DropdownModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["SelectButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["ToggleButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["InputTextareaModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["TabViewModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["SpinnerModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["FileUploadModule"],
            _execute_hierarchy_add_metrics_add_metrics_module__WEBPACK_IMPORTED_MODULE_10__["AddMetricsModule"],
            _preview_data_preview_data_module__WEBPACK_IMPORTED_MODULE_11__["PreviewDataModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["ConfirmDialogModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["ProgressSpinnerModule"],
            _configured_monitor_info_configured_monitor_info_module__WEBPACK_IMPORTED_MODULE_12__["ConfiguredMonitorInfoModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["ChipsModule"],
            src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_13__["CavTableModule"]
        ],
        exports: [_generic_rest_monitor_component__WEBPACK_IMPORTED_MODULE_3__["GenericRestMonitorComponent"]],
    })
], GenericRestMonitorModule);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.component.scss":
/*!****************************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.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-response-file .responseTab .ui-tabview-nav {\n  height: 46px;\n  overflow: hidden !important;\n}\napp-response-file .responseTab .ui-tabview-panels {\n  height: calc(100vh - 150px);\n  overflow: auto;\n  max-height: 550px;\n}");

/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.component.ts":
/*!**************************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.component.ts ***!
  \**************************************************************************************************************************************************/
/*! exports provided: ResponseFileComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponseFileComponent", function() { return ResponseFileComponent; });
/* 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_custom_monitor_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../services/custom-monitor.service */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/services/custom-monitor.service.ts");
/* harmony import */ var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/shared/cav-toast/service/cav-message.service */ "./src/app/shared/cav-toast/service/cav-message.service.ts");




let ResponseFileComponent = class ResponseFileComponent {
    constructor(customMonService, messageService) {
        this.customMonService = customMonService;
        this.messageService = messageService;
        this.data = {};
        this.cyclicData = {
            list: [
                1,
                2,
                3,
            ],
        };
        this.cyclicData.list.push(this.cyclicData, this.cyclicData, this.cyclicData.list);
    }
    ngOnInit() {
        this.autofill = this.customMonService.$browseJson.subscribe((res) => {
            if (res['status']) {
                try {
                    this.data = JSON.parse(res['data']);
                }
                catch (e) // for bug 132397
                 {
                    let errorMsg = "JSON is not valid. " + e.message;
                    this.messageService.add({ severity: 'error', summary: 'ERROR', detail: errorMsg });
                    this.data = {};
                    res['status'] = false; // added for bug 145640 [if the response is not parseable then it will not proceed for add subject]
                }
            }
            else {
                this.data = {};
                if (res['data']) {
                    this.messageService.add({ severity: 'error', summary: 'ERROR', detail: res['data'] });
                }
                return;
            }
        });
    }
    ngOnDestroy() {
        if (this.subscription)
            this.subscription.unsubscribe();
        if (this.autofill)
            this.autofill.unsubscribe();
    }
};
ResponseFileComponent.ctorParameters = () => [
    { type: _services_custom_monitor_service__WEBPACK_IMPORTED_MODULE_2__["CustomMonitorService"] },
    { type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_3__["CavMessageService"] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], ResponseFileComponent.prototype, "browseJsonFile", void 0);
ResponseFileComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-response-file',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./response-file.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./response-file.component.scss */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.component.scss")).default]
    })
], ResponseFileComponent);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.module.ts":
/*!***********************************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.module.ts ***!
  \***********************************************************************************************************************************************/
/*! exports provided: ResponseFileModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponseFileModule", function() { return ResponseFileModule; });
/* 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 _response_file_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./response-file.component */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/generic-rest-monitor/response-file/response-file.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 primeng__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var _ngx_json_viewer_ngx_json_viewer_module__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ngx-json-viewer/ngx-json-viewer.module */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.module.ts");







let ResponseFileModule = class ResponseFileModule {
};
ResponseFileModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [_response_file_component__WEBPACK_IMPORTED_MODULE_3__["ResponseFileComponent"]],
        exports: [_response_file_component__WEBPACK_IMPORTED_MODULE_3__["ResponseFileComponent"]],
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["ButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["PanelModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TableModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["CardModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TooltipModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["CheckboxModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["MultiSelectModule"],
            _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["DialogModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["InputTextModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["DropdownModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["SelectButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["ToggleButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["InputTextareaModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TabViewModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["SpinnerModule"],
            _ngx_json_viewer_ngx_json_viewer_module__WEBPACK_IMPORTED_MODULE_6__["NgxJsonViewerModule"]
        ]
    })
], ResponseFileModule);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.component.scss":
/*!***********************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.component.scss ***!
  \***********************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("@charset \"UTF-8\";\n.ngx-json-viewer {\n  font-family: var(--ngx-json-font-family, monospace);\n  font-size: var(--ngx-json-font-size, 1em);\n  width: 100%;\n  height: 100%;\n  overflow: hidden;\n  position: relative;\n}\n.ngx-json-viewer .segment {\n  padding: 2px;\n  margin: 1px 1px 1px 12px;\n}\n.ngx-json-viewer .segment .segment-main {\n  word-wrap: break-word;\n}\n.ngx-json-viewer .segment .segment-main .toggler {\n  position: absolute;\n  margin-left: -14px;\n  margin-top: 3px;\n  font-size: 0.8em;\n  line-height: 1.2em;\n  vertical-align: middle;\n  color: var(--ngx-json-toggler, #787878);\n}\n.ngx-json-viewer .segment .segment-main .toggler::after {\n  display: inline-block;\n  content: \"►\";\n  transition: transform 0.1s ease-in;\n}\n.ngx-json-viewer .segment .segment-main .segment-key {\n  color: var(--ngx-json-key, #4E187C);\n}\n.ngx-json-viewer .segment .segment-main .segment-separator {\n  color: var(--ngx-json-separator, #999);\n}\n.ngx-json-viewer .segment .segment-main .segment-value {\n  color: var(--ngx-json-value, #000);\n}\n.ngx-json-viewer .segment .children {\n  margin-left: 12px;\n}\n.ngx-json-viewer .segment-type-string > .segment-main > .segment-value {\n  color: var(--ngx-json-string, #FF6B6B);\n}\n.ngx-json-viewer .segment-type-number > .segment-main > .segment-value {\n  color: var(--ngx-json-number, #009688);\n}\n.ngx-json-viewer .segment-type-boolean > .segment-main > .segment-value {\n  color: var(--ngx-json-boolean, #B938A4);\n}\n.ngx-json-viewer .segment-type-date > .segment-main > .segment-value {\n  color: var(--ngx-json-date, #05668D);\n}\n.ngx-json-viewer .segment-type-array > .segment-main > .segment-value {\n  color: var(--ngx-json-array, #999);\n}\n.ngx-json-viewer .segment-type-object > .segment-main > .segment-value {\n  color: var(--ngx-json-object, #999);\n}\n.ngx-json-viewer .segment-type-function > .segment-main > .segment-value {\n  color: var(--ngx-json-function, #999);\n}\n.ngx-json-viewer .segment-type-null > .segment-main > .segment-value {\n  color: var(--ngx-json-null, #fff);\n}\n.ngx-json-viewer .segment-type-undefined > .segment-main > .segment-value {\n  color: var(--ngx-json-undefined, #fff);\n}\n.ngx-json-viewer .segment-type-null > .segment-main > .segment-value {\n  background-color: var(--ngx-json-null-bg, red);\n}\n.ngx-json-viewer .segment-type-undefined > .segment-main > .segment-key {\n  color: var(--ngx-json-undefined-key, #999);\n}\n.ngx-json-viewer .segment-type-undefined > .segment-main > .segment-value {\n  background-color: var(--ngx-json-undefined-key, #999);\n}\n.ngx-json-viewer .segment-type-object > .segment-main,\n.ngx-json-viewer .segment-type-array > .segment-main {\n  white-space: nowrap;\n}\n.ngx-json-viewer .expanded > .toggler::after {\n  transform: rotate(90deg);\n}\n.ngx-json-viewer .expandable,\n.ngx-json-viewer .expandable > .toggler {\n  cursor: pointer;\n}");

/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.component.ts":
/*!*********************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.component.ts ***!
  \*********************************************************************************************************************************/
/*! exports provided: NgxJsonViewerComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgxJsonViewerComponent", function() { return NgxJsonViewerComponent; });
/* 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_custom_monitor_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../services/custom-monitor.service */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/services/custom-monitor.service.ts");


// import { concatAll } from 'rxjs';

let NgxJsonViewerComponent = class NgxJsonViewerComponent {
    constructor(customMonService) {
        this.customMonService = customMonService;
        this.tempPath = "";
        this.arr = new Array();
        this.finalPath = "";
        this.finalObject = new Array();
        this.expanded = true;
        this.depth = -1;
        this._currentDepth = -1;
        this.segments = [];
        this.Namemap = new Map();
        this.newMAP = new Map();
        this.initialBool = true;
        this.isJsonProcessing = false;
    }
    ngOnChanges() {
        this.isJsonProcessing = true;
        this.segments = [];
        // remove cycles
        this.json = this.decycle(this.json);
        this._currentDepth++;
        if (typeof this.json === 'object') {
            Object.keys(this.json).forEach(key => {
                this.segments.push(this.parseKeyValue(key, this.json[key]));
            });
        }
        else {
            this.segments.push(this.parseKeyValue(`(${typeof this.json})`, this.json));
        }
        this.isJsonProcessing = false;
    }
    isExpandable(segment) {
        return segment.type === 'object' || segment.type === 'array';
    }
    getKeyPath(segmentt, parent) {
        var _a;
        if (!parent) {
            return segmentt;
        }
        else {
            segmentt.push((_a = parent.segmentt) !== null && _a !== void 0 ? _a : "");
            return this.getKeyPath(segmentt, parent === null || parent === void 0 ? void 0 : parent.parent);
        }
    }
    toggle(segment) {
        let intervalId = setInterval(() => {
            if (!this.isJsonProcessing) {
                this.arr = this.getKeyPath([this.segmentt], this.parent);
                this.arr.reverse().shift();
                this.arr.push(segment);
                this.finalPath = "$";
                let isPrevArray = false;
                let arrayCount = 0;
                for (let i = 0; i < this.arr.length; i++) {
                    if (this.arr[i].type == 'array') {
                        this.finalPath = this.finalPath + "." + this.arr[i].key;
                        isPrevArray = true;
                        arrayCount++;
                    }
                    else {
                        if (isPrevArray) {
                            // if(arrayCount==1)
                            //   this.finalPath = this.finalPath +"["+this.arr[i].key+"]" ;
                            // else
                            this.finalPath = this.finalPath + "[*]";
                            isPrevArray = false;
                        }
                        else {
                            this.finalPath = this.finalPath + "." + this.arr[i].key;
                        }
                    }
                }
                this.finalPath = this.finalPath + ".";
                this.finalObject = [];
                this.finalObject.push(this.finalPath);
                this.finalObject.push(segment);
                this.customMonService.autoFillJsonInfoData(this.finalObject);
                clearInterval(intervalId);
            }
        }, 250);
    }
    parseKeyValue(key, value) {
        const segment = {
            key: key,
            value: value,
            type: undefined,
            description: '' + value,
            expanded: this.isExpanded()
        };
        switch (typeof segment.value) {
            case 'number': {
                segment.type = 'number';
                break;
            }
            case 'boolean': {
                segment.type = 'boolean';
                break;
            }
            case 'function': {
                segment.type = 'function';
                break;
            }
            case 'string': {
                segment.type = 'string';
                segment.description = '"' + segment.value + '"';
                break;
            }
            case 'undefined': {
                segment.type = 'undefined';
                segment.description = 'undefined';
                break;
            }
            case 'object': {
                // yea, null is object
                if (segment.value === null) {
                    segment.type = 'null';
                    segment.description = 'null';
                }
                else if (Array.isArray(segment.value)) {
                    segment.type = 'array';
                    segment.description = 'Array[' + segment.value.length + '] ' + JSON.stringify(segment.value);
                }
                else if (segment.value instanceof Date) {
                    segment.type = 'date';
                }
                else {
                    segment.type = 'object';
                    segment.description = 'Object ' + JSON.stringify(segment.value);
                }
                break;
            }
        }
        return segment;
    }
    isExpanded() {
        return (this.expanded &&
            !(this.depth > -1 && this._currentDepth >= this.depth));
    }
    // https://github.com/douglascrockford/JSON-js/blob/master/cycle.js
    decycle(object) {
        let me = this;
        const objects = new WeakMap();
        let a = "";
        return (function derez(value, path) {
            me.Namemap.set(path, value);
            let old_path;
            let nu;
            if (typeof value === 'object' && value !== null && !(value instanceof Boolean) && !(value instanceof Date)
                && !(value instanceof Number) && !(value instanceof RegExp) && !(value instanceof String)) {
                old_path = objects.get(value);
                if (old_path !== undefined) {
                    return { $ref: old_path };
                }
                objects.set(value, path);
                if (Array.isArray(value)) {
                    nu = [];
                    value.forEach(function (element, i) {
                        nu[i] = derez(element, path + '[' + i + ']');
                    });
                }
                else {
                    nu = {};
                    Object.keys(value).forEach(function (name) {
                        a = name;
                        nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']');
                    });
                }
                return nu;
            }
            return value;
        }(object, '$'));
    }
};
NgxJsonViewerComponent.ctorParameters = () => [
    { type: _services_custom_monitor_service__WEBPACK_IMPORTED_MODULE_2__["CustomMonitorService"] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], NgxJsonViewerComponent.prototype, "json", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], NgxJsonViewerComponent.prototype, "expanded", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], NgxJsonViewerComponent.prototype, "depth", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], NgxJsonViewerComponent.prototype, "_currentDepth", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], NgxJsonViewerComponent.prototype, "parent", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], NgxJsonViewerComponent.prototype, "key", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], NgxJsonViewerComponent.prototype, "type", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()
], NgxJsonViewerComponent.prototype, "segmentt", void 0);
NgxJsonViewerComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'ngx-json-viewer',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./ngx-json-viewer.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.component.html")).default,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./ngx-json-viewer.component.scss */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.component.scss")).default]
    })
], NgxJsonViewerComponent);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.module.ts":
/*!******************************************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.module.ts ***!
  \******************************************************************************************************************************/
/*! exports provided: NgxJsonViewerModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgxJsonViewerModule", function() { return NgxJsonViewerModule; });
/* 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 _ngx_json_viewer_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ngx-json-viewer.component */ "./src/app/pages/monitor-up-down-status/configure-monitors/add-custom-monitor/ngx-json-viewer/ngx-json-viewer.component.ts");




let NgxJsonViewerModule = class NgxJsonViewerModule {
};
NgxJsonViewerModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"]
        ],
        declarations: [
            _ngx_json_viewer_component__WEBPACK_IMPORTED_MODULE_3__["NgxJsonViewerComponent"]
        ],
        exports: [
            _ngx_json_viewer_component__WEBPACK_IMPORTED_MODULE_3__["NgxJsonViewerComponent"]
        ]
    })
], NgxJsonViewerModule);



/***/ }),

/***/ "./src/app/pages/monitor-up-down-status/configure-monitors/add-monitor/containers/rest-data.ts":
/*!*****************************************************************************************************!*\
  !*** ./src/app/pages/monitor-up-down-status/configure-monitors/add-monitor/containers/rest-data.ts ***!
  \*****************************************************************************************************/
/*! exports provided: RestData */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RestData", function() { return RestData; });
class RestData {
    constructor() {
        this.host = ""; // host
        this.user = ""; // username
        this.pwd = ""; //pwd
        this.pHost = ""; //proxy host
        this.pPort = 3128; // proxy port
        this.pURL = ""; // proxy URL
        this.pUser = ""; // proxy user
        this.pPwd = ""; // proxy pwd
        this.setRequired = false;
        this.protocol = "http://";
        this.isServer = false;
        this.isTier = false;
        this.header = []; //Header
        this.restUrl = ""; // Rest Url
    }
}


/***/ })

}]);