webpackJsonp([5],{

/***/ 1223:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewBuilderModule", function() { return ViewBuilderModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__view_builder__ = __webpack_require__(1490);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ionic_angular__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngx_translate_core__ = __webpack_require__(257);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_components_module__ = __webpack_require__(775);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(53);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};






var ViewBuilderModule = /** @class */ (function () {
    function ViewBuilderModule() {
    }
    ViewBuilderModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_1__view_builder__["a" /* ViewBuilder */]
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__["g" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_4__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["i" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_1__view_builder__["a" /* ViewBuilder */]),
                __WEBPACK_IMPORTED_MODULE_3__ngx_translate_core__["b" /* TranslateModule */].forChild()
            ],
            exports: [
                __WEBPACK_IMPORTED_MODULE_1__view_builder__["a" /* ViewBuilder */]
            ],
            entryComponents: [
                __WEBPACK_IMPORTED_MODULE_1__view_builder__["a" /* ViewBuilder */]
            ]
        })
    ], ViewBuilderModule);
    return ViewBuilderModule;
}());

//# sourceMappingURL=view-builder.module.js.map

/***/ }),

/***/ 1490:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ViewBuilder; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ngx_logger__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__view_builder_template__ = __webpack_require__(1491);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_classification_phase_one_classification_phase_one__ = __webpack_require__(788);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__components_basic_button_basic_button__ = __webpack_require__(787);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_ionic_angular_util_util__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__providers_shared_data_service_shared_data_service__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__providers_activity_log_activity_log__ = __webpack_require__(67);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ncinga_sp_nsp_app_core_dist_providers_app_events__ = __webpack_require__(65);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__candc_module__ = __webpack_require__(144);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__components_modals_sub_settings__ = __webpack_require__(792);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__ncinga_sp_nsp_app_core_dist_providers_business_context__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__providers_appMasterDataCntrl_app_masterData_cntrl_provider__ = __webpack_require__(777);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__providers_application_cache_service_app_cache_service__ = __webpack_require__(794);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
















var ViewBuilder = /** @class */ (function () {
    function ViewBuilder(navProvider, navParams, logger, sharedService, activityLogService, appState, modalCtrl, businessCtx, appCtx, appMasDa, alertCtrl, appCache) {
        this.navProvider = navProvider;
        this.navParams = navParams;
        this.logger = logger;
        this.sharedService = sharedService;
        this.activityLogService = activityLogService;
        this.appState = appState;
        this.modalCtrl = modalCtrl;
        this.businessCtx = businessCtx;
        this.appCtx = appCtx;
        this.appMasDa = appMasDa;
        this.alertCtrl = alertCtrl;
        this.appCache = appCache;
        this.pgTitle = 'Active Counters';
        this.evenRowData = [];
        this.oddRowData = [];
        this.demoArray = [];
        this.incre = 0;
        this.dupIncre = 0;
        this.component_Conf_Length = 0;
        this.sub_header = true;
        this.hasFmenu = false;
        this.subcription = [];
        this.view_config = this.navParams.get('conf');
        // this.logger.debug('>>>>>>>>>>loading conf', this.view_config);
        // this.appMasDa.initAppMasterData(this.view_config.masterDataList);
        this.tools = {
            line: true,
            menu: true,
            shift: true,
            user: true,
        };
        this.initEventListeners();
    }
    ViewBuilder.prototype.ngOnInit = function () {
        this.view_config = this.navParams.get('conf');
        if (this.view_config) {
            this.appMasDa.setMsDtList(this.view_config.masterDataList);
            // this.pgTitle = this.view_config['title'];
            // this.sub_header = this.view_config['order_heading'];
            this.logger.debug('loading conf', this.view_config);
            this.components_descriptor = this.view_config.components_descriptor;
            this.component_Conf_Length = this.components_descriptor.length;
            this.confDataAssign();
            this.setBtnDataStore();
            // enable floating menu
            if (this.view_config['floating_menu']) {
                if (this.view_config['floating_menu'].length > 0) {
                    this.hasFmenu = true;
                }
            }
            // if (!this.subcription) {
            //     this.subcription = this.sharedService.memUpdate.subscribe((res) => {
            //         if (res) {
            //             this.logger.trace('update member count', res);
            //             this.appDataEnterValidation();
            //         }
            //     });
            // }
        }
    };
    ViewBuilder.prototype.initEventListeners = function () {
        var _this = this;
        var s1 = this.appState.subscribe(__WEBPACK_IMPORTED_MODULE_9__ncinga_sp_nsp_app_core_dist_providers_app_events__["a" /* APPEvents */].APP_SUBJECT_CHANGE, function (res) {
            _this.logger.trace('subject change header', res);
            _this.saveExsistingDataInToCache('subject_id', res);
            _this.appCache.getCrntAppCacheData();
            _this.appMasDa.masterDataSetChange();
        });
        this.subcription.push(s1);
        var s2 = this.appState.subscribe(__WEBPACK_IMPORTED_MODULE_9__ncinga_sp_nsp_app_core_dist_providers_app_events__["a" /* APPEvents */].APP_SHIFT_CHANGE, function (res) {
            _this.logger.trace('shift change header', res);
            _this.saveExsistingDataInToCache('shift_id', res);
        });
        this.subcription.push(s2);
        var s3 = this.appState.subscribe(__WEBPACK_IMPORTED_MODULE_9__ncinga_sp_nsp_app_core_dist_providers_app_events__["a" /* APPEvents */].APP_BUSINESS_CTX_CHANGE, function (res) {
            _this.logger.trace('bsns_ctx change header', res);
            _this.appCache.getCrntAppCacheData();
            _this.appMasDa.masterDataSetChange();
            // this.saveExsistingDataInToCache('business_ctx', this.businessCtx.getCurrentContext());
        });
        this.subcription.push(s3);
    };
    ViewBuilder.prototype.ionViewDidLoad = function () {
        if (!Object(__WEBPACK_IMPORTED_MODULE_6_ionic_angular_util_util__["p" /* isUndefined */])(this.basicButton)) {
            this.basicButton.viewMapping();
            this.basicButton.checkAvaliability();
        }
        if (!Object(__WEBPACK_IMPORTED_MODULE_6_ionic_angular_util_util__["p" /* isUndefined */])(this.classificationOnePhase)) {
            this.classificationOnePhase.checkAvaliability();
        }
        // this.appDataEnterValidation();
    };
    // add conf json data in to RowArray(oddRowData & evenRowData) //
    ViewBuilder.prototype.confDataAssign = function () {
        try {
            for (this.dupIncre; this.dupIncre < this.components_descriptor.length; this.dupIncre++) {
                if (this.component_Conf_Length > 1) {
                    this.demoArray = [];
                    this.incre = 0;
                    for (this.incre; this.incre < 2; this.incre++) {
                        this.demoArray.push(this.components_descriptor[this.incre + this.dupIncre]);
                        this.component_Conf_Length--;
                    }
                    this.evenRowData.push(this.demoArray);
                    this.dupIncre++;
                }
                else {
                    this.oddRowData.push(this.components_descriptor[this.dupIncre]);
                }
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    // set button types for data store//
    ViewBuilder.prototype.setBtnDataStore = function () {
        try {
            this.logger.debug(JSON.stringify(this.sharedService.getSharedBtnService()));
            this.activityLogService.initMasterData();
            this.activityLogService.setActivityLogReferenceId();
            this.sharedService.saveReferenceToCache(__WEBPACK_IMPORTED_MODULE_11__candc_module__["c" /* CC_MOD_KEY */], 48);
            var ref = this.activityLogService.getActivityLogReferenceId();
            /*
             check ref id availability in cache
             */
            if (!this.sharedService.getReferenceFromCache(__WEBPACK_IMPORTED_MODULE_11__candc_module__["c" /* CC_MOD_KEY */])) {
                if (JSON.stringify(this.sharedService.getSharedBtnService()) === '{}') {
                    this.sharedService.generateSharedDataSrvKey();
                    for (var _i = 0, _a = this.components_descriptor; _i < _a.length; _i++) {
                        var dataSet = _a[_i];
                        this.activityLogService.initActivityLog(dataSet);
                    }
                }
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    /*
     save existing data in to cache
     */
    ViewBuilder.prototype.saveExsistingDataInToCache = function (type, data) {
        this.activityLogService.updateContextData(type, data);
        this.sharedService.saveReferenceToCache(__WEBPACK_IMPORTED_MODULE_11__candc_module__["c" /* CC_MOD_KEY */], 48);
        // this.setBtnDataStore();
    };
    /*
     * Floating menu controller
     * */
    ViewBuilder.prototype.floatingMenuHandler = function (conf) {
        try {
            switch (conf.type) {
                case 'page': {
                    this.navProvider.nextView(conf.next_view_ref, conf);
                    break;
                }
                case 'popup': {
                    var popup = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_12__components_modals_sub_settings__["a" /* SubSettingsModal */], { conf: conf }, { 'cssClass': 'cc_subsettings' });
                    popup.present();
                    break;
                }
            }
        }
        catch (e) {
            this.logger.error('Action not found ');
        }
    };
    /*
     application validation part according to subject select and member count
     */
    ViewBuilder.prototype.appDataEnterValidation = function () {
        this.logger.trace('view conf current page', this.view_config);
        if (this.view_config) {
            if (this.view_config.subject_validation) {
                var sub = this.sharedService.getSubject();
                if (sub === null) {
                    this.btnDisabled = true;
                    var subj = this.appCtx.getCurrentSubject();
                    this.sharedService.setSubject(subj.id);
                }
                else {
                    this.btnDisabled = false;
                }
                this.logger.trace('validation part for member and subject', sub);
            }
            if (this.view_config.member_validation) {
                var mem = this.sharedService.getMemCnt();
                if (mem === null) {
                    this.btnDisabled = true;
                    this.presentAlert();
                }
                else {
                    this.btnDisabled = false;
                }
                this.logger.trace('validation part for member and subject', mem);
            }
        }
    };
    /*
     alert present for validation before data enter
     */
    ViewBuilder.prototype.presentAlert = function () {
        var alert = this.alertCtrl.create({
            title: 'Before Capture Data',
            subTitle: 'Please add member count before data entering',
            buttons: ['Cancel']
        });
        alert.present();
        setTimeout(function () {
            alert.dismiss();
        }, 2000);
    };
    ViewBuilder.prototype.ngOnDestroy = function () {
        var _this = this;
        try {
            this.subcription.forEach(function (val) {
                if (val) {
                    _this.appState.unsubscribe(val);
                }
            });
        }
        catch (e) {
            this.logger.debug(e);
        }
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])(__WEBPACK_IMPORTED_MODULE_4__components_classification_phase_one_classification_phase_one__["a" /* ClassificationPhaseOneComponent */]),
        __metadata("design:type", Object)
    ], ViewBuilder.prototype, "classificationOnePhase", void 0);
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])(__WEBPACK_IMPORTED_MODULE_5__components_basic_button_basic_button__["a" /* BasicButtonComponent */]),
        __metadata("design:type", Object)
    ], ViewBuilder.prototype, "basicButton", void 0);
    ViewBuilder = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'counting-view-builder',
            template: __WEBPACK_IMPORTED_MODULE_3__view_builder_template__["a" /* VIEW_BUILDER_HTML */]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_10__ncinga_sp_nsp_app_core_dist__["i" /* NavigationManager */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["n" /* NavParams */], __WEBPACK_IMPORTED_MODULE_2_ngx_logger__["b" /* NGXLogger */],
            __WEBPACK_IMPORTED_MODULE_7__providers_shared_data_service_shared_data_service__["a" /* SharedDataProvider */], __WEBPACK_IMPORTED_MODULE_8__providers_activity_log_activity_log__["a" /* ActivityLogProvider */],
            __WEBPACK_IMPORTED_MODULE_10__ncinga_sp_nsp_app_core_dist__["d" /* ApplicationService */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["k" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_13__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */],
            __WEBPACK_IMPORTED_MODULE_10__ncinga_sp_nsp_app_core_dist__["c" /* ApplicationContext */],
            __WEBPACK_IMPORTED_MODULE_14__providers_appMasterDataCntrl_app_masterData_cntrl_provider__["a" /* AppMasterDataCntrl */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* AlertController */], __WEBPACK_IMPORTED_MODULE_15__providers_application_cache_service_app_cache_service__["a" /* AppCacheService */]])
    ], ViewBuilder);
    return ViewBuilder;
}());

//# sourceMappingURL=view-builder.js.map

/***/ }),

/***/ 1491:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VIEW_BUILDER_HTML; });
/**
 * Created by shadeeka on 5/2/18.
 */
var VIEW_BUILDER_HTML = "\n\n<ion-header>\n    <ion-navbar color=\"c22\">\n       <common-main-header [title]=\"view_config?.title\" [tools]=\"tools\"\n       [header_disabled]=\"view_config?.subject_disable\"></common-main-header>\n    </ion-navbar>\n</ion-header>\n\n<ion-content class=\"candclanging-page\">\n    <ion-grid no-padding *ngIf=\"view_config?.order_heading\">\n        <ion-row class=\"summary-row\">\n            <ion-col>\n                <core-domain-header></core-domain-header>\n            </ion-col>\n        </ion-row>\n    </ion-grid>\n\n    <ion-grid class=\"grid-content\">\n        <ion-row *ngFor=\"let conf of evenRowData\">\n            <ion-col class=\"btn-pad\" *ngFor=\"let subConf of conf\" col-12 col-lg-6 col-md-6>\n                <basic-button *ngIf=\"subConf.button_type === 'basic_button'\" [btnConfig]=\"subConf\" ></basic-button>\n                <classification-phase-one *ngIf=\"subConf.button_type === 'classification_phase_one'\" [btnConfig]=\"subConf\">\n                </classification-phase-one>\n            </ion-col>\n        </ion-row>\n        <ion-row>\n            <ion-col *ngFor=\"let conf of oddRowData\" col-12 offset-lg-3 offset-md-3 col-lg-6 col-md-6>\n                <basic-button *ngIf=\"conf.button_type === 'basic_button'\" [btnConfig]=\"conf\"></basic-button>\n                <classification-phase-one *ngIf=\"conf.button_type === 'classification_phase_one'\" [btnConfig]=\"conf\">\n                </classification-phase-one>\n            </ion-col>\n        </ion-row>\n    </ion-grid>\n\n<ion-fab right bottom class=\"flting-btn-main\">\n    <button ion-fab color=\"dark\"><ion-icon name=\"arrow-dropleft\"></ion-icon></button>\n    <ion-fab-list side=\"left\">\n      <button class=\"sub-btn\" color=\"dark\" ion-fab *ngFor=\"let item of view_config?.floating_menu\" [title]=\"item.name\"\n      (click)=\"floatingMenuHandler(item)\" >\n      <ion-icon [name]=\"item.icon\"></ion-icon></button>\n    </ion-fab-list>\n  </ion-fab>\n</ion-content>";
//# sourceMappingURL=view-builder-template.js.map

/***/ })

});
//# sourceMappingURL=5.js.map