webpackJsonp([7],{

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

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SettingViewModule", function() { return SettingViewModule; });
/* 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__setting_view__ = __webpack_require__(1486);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_components_module__ = __webpack_require__(775);
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;
};
/**
 * Created by dilshan on 7/5/18.
 */





var SettingViewModule = /** @class */ (function () {
    function SettingViewModule() {
    }
    SettingViewModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__setting_view__["a" /* SettingView */]
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist__["g" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_4__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__setting_view__["a" /* SettingView */])
            ]
        })
    ], SettingViewModule);
    return SettingViewModule;
}());

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

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SettingView; });
/* 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__setting_template__ = __webpack_require__(1487);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_appMasterDataCntrl_app_masterData_cntrl_provider__ = __webpack_require__(777);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_business_context__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__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 __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [0, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
/**
 * Created by dilshan on 7/5/18.
 */







var SettingView = /** @class */ (function () {
    function SettingView(logger, appMsDtCntrl, bsCtx, imagePro) {
        this.logger = logger;
        this.appMsDtCntrl = appMsDtCntrl;
        this.bsCtx = bsCtx;
        this.imagePro = imagePro;
        this.sync_components = [];
        this.check = false;
        this.close = false;
        this.bubble = false;
        this.sync_components = [{
                name: 'Sync style info',
                value: 'styles',
                type: 'ctx'
            }, {
                name: 'Sync silhouette',
                value: 'silhouettes',
                type: 'file'
            }, {
                name: 'Sync grading list',
                value: 'sgt_size_list',
                type: 'ms_data'
            }, {
                name: 'Sync operation list',
                value: 'qc_operation',
                type: 'ms_data'
            }, {
                name: 'Sync issue ist',
                value: 'qcissues',
                type: 'ms_data'
            }];
        this.sync_components.forEach(function (data) {
            data['check'] = false;
            data['close'] = false;
            data['bubble'] = false;
        });
    }
    /*
     sync with backend call
     */
    SettingView.prototype.syncClick = function (param, index, tp) {
        return __awaiter(this, void 0, void 0, function () {
            var selectSyncBtn, data, e_1;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        selectSyncBtn = this.sync_components[index];
                        _a.label = 1;
                    case 1:
                        _a.trys.push([1, 5, , 6]);
                        this.bubble = true;
                        this.logger.trace('sync parameter', param);
                        data = null;
                        if (!(tp === 'ms_data')) return [3 /*break*/, 3];
                        return [4 /*yield*/, this.appMsDtCntrl.appSyncronization(param)];
                    case 2:
                        data = _a.sent();
                        // then(data => {
                        this.logger.trace('data ?????', data);
                        return [3 /*break*/, 4];
                    case 3:
                        if (tp === 'file') {
                            data = this.imagePro.loadImages(false);
                            // if (resn) {
                            //     this.check = true;
                            //     this.bubble = false;
                            //     this.close = false;
                            // } else {
                            //     this.check = false;
                            //     this.close = true;
                            //     this.bubble = false;
                            // }
                            // selectSyncBtn['check'] = this.check;
                            // selectSyncBtn['close'] = this.close;
                            // selectSyncBtn['bubble'] = this.bubble;
                        }
                        else if (tp === 'ctx') {
                            data = this.bsCtx.reloadContextData();
                            this.logger.trace('bsns Cntxt loading');
                            // if (resn) {
                            //     this.check = true;
                            //     this.bubble = false;
                            //     this.close = false;
                            // } else {
                            //     this.check = false;
                            //     this.close = true;
                            //     this.bubble = false;
                            // }
                            // selectSyncBtn['check'] = this.check;
                            // selectSyncBtn['close'] = this.close;
                            // selectSyncBtn['bubble'] = this.bubble;
                        }
                        _a.label = 4;
                    case 4:
                        if (data) {
                            this.check = true;
                            this.bubble = false;
                            this.close = false;
                        }
                        else {
                            this.check = false;
                            this.close = true;
                            this.bubble = false;
                        }
                        selectSyncBtn['check'] = this.check;
                        selectSyncBtn['close'] = this.close;
                        selectSyncBtn['bubble'] = this.bubble;
                        return [3 /*break*/, 6];
                    case 5:
                        e_1 = _a.sent();
                        selectSyncBtn['check'] = false;
                        selectSyncBtn['close'] = true;
                        selectSyncBtn['bubble'] = false;
                        this.logger.error(e_1);
                        return [3 /*break*/, 6];
                    case 6: return [2 /*return*/];
                }
            });
        });
    };
    /*
     sync all sync btn at once
     */
    SettingView.prototype.syncAll = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            var res, temp_sync_comp;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.logger.trace('App sync all');
                        res = null;
                        temp_sync_comp = [];
                        this.sync_components.forEach(function (data, index) {
                            _this.bubble = true;
                            var selectSyncBtn = _this.sync_components[index];
                            if (data.type === 'file') {
                                _this.logger.trace('file downloaded');
                                res = _this.imagePro.loadImages(true);
                                if (res) {
                                    _this.check = true;
                                    _this.bubble = false;
                                    _this.close = false;
                                }
                                else {
                                    _this.check = false;
                                    _this.close = true;
                                    _this.bubble = false;
                                }
                            }
                            else if (data.type === 'ctx') {
                                res = _this.bsCtx.reloadContextData();
                                _this.logger.trace('bsns Cntxt loading');
                                if (res) {
                                    _this.check = true;
                                    _this.bubble = false;
                                    _this.close = false;
                                }
                                else {
                                    _this.check = false;
                                    _this.close = true;
                                    _this.bubble = false;
                                }
                            }
                            else {
                                temp_sync_comp.push(data);
                                _this.check = false;
                                _this.bubble = true;
                                _this.close = false;
                            }
                            selectSyncBtn['check'] = _this.check;
                            selectSyncBtn['close'] = _this.close;
                            selectSyncBtn['bubble'] = _this.bubble;
                        });
                        return [4 /*yield*/, this.appMsDtCntrl.appSyncAllData()];
                    case 1:
                        res = _a.sent();
                        temp_sync_comp.forEach(function (dt, index) {
                            var selectSyncBtn = temp_sync_comp[index];
                            if (res) {
                                _this.check = true;
                                _this.bubble = false;
                                _this.close = false;
                            }
                            else {
                                _this.check = false;
                                _this.close = true;
                                _this.bubble = false;
                            }
                            _this.logger.trace('change selectSyncBtn', selectSyncBtn);
                            selectSyncBtn['check'] = _this.check;
                            selectSyncBtn['close'] = _this.close;
                            selectSyncBtn['bubble'] = _this.bubble;
                        });
                        return [2 /*return*/];
                }
            });
        });
    };
    SettingView = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'setting-view',
            template: __WEBPACK_IMPORTED_MODULE_3__setting_template__["a" /* SETTTING_TEMPLATE_HTML */]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ngx_logger__["b" /* NGXLogger */], __WEBPACK_IMPORTED_MODULE_4__providers_appMasterDataCntrl_app_masterData_cntrl_provider__["a" /* AppMasterDataCntrl */], __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */],
            __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist__["h" /* ImagesProvider */]])
    ], SettingView);
    return SettingView;
}());

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

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SETTTING_TEMPLATE_HTML; });
/**
 * Created by dilshan on 7/5/18.
 */
var SETTTING_TEMPLATE_HTML = "\n<ion-header>\n<ion-navbar color=\"c22\">\n      <common-main-header ></common-main-header>\n   </ion-navbar>\n</ion-header>\n<!-- <ion-content>\n<ion-grid class=\"bdy-cnt\">\n\t<ion-row class=\"spc-row\"></ion-row>\n\t<ion-row class=\"sting-btn\">\n\t\t<ion-col col-12 col-md-6 col-sm-6>\n\t\t\t<button ion-button>Advanced Behind</button>\n\t\t</ion-col>\n\t\t<ion-col col-12 col-md-6 col-sm-6>\n\t\t\t<button ion-button>App Sync</button>\n\t\t</ion-col>\n\t</ion-row>\n</ion-grid>\n</ion-content> -->\n\n\n\n<ion-content>\n<ion-grid class=\"syc-list\">\n\n\t<ion-row no-padding class=\"info-row\">\n\t\t<div class=\"info-msg r-align-flx\"><ion-icon name=\"information-circle\"></ion-icon> Please click<ion-icon class=\"ref-btn\" name=\"refresh\">\n</ion-icon> button to load application data</div>\n       \t<button ion-button class=\"lod-all-btn\" (click)=\"syncAll()\"><ion-icon name=\"refresh\"></ion-icon> Load All App Data </button>\n\t</ion-row>\n\n\t<ion-row class=\"syc-lst-itm\" *ngFor=\"let item of sync_components; let i=index\">\n\t\t<ion-icon *ngIf=\"item.check\" class=\"syced\" name=\"checkmark-circle\"></ion-icon>\n\t\t<ion-icon *ngIf=\"item.close\" class=\"sycfl\" name=\"close-circle\"></ion-icon>\n\t\t<ion-spinner *ngIf=\"item.bubble\" name=\"bubbles\"></ion-spinner>\n\t\t<div class=\"r-align-flx\" (click)=\"syncClick(item.value, i, item.type)\">{{item.name}}</div>\n\t\t<button ion-button (click)=\"syncClick(item.value, i, item.type)\"><ion-icon name=\"refresh\"></ion-icon></button>\n\t</ion-row>\n\n</ion-grid>\n</ion-content>\n<ion-footer></ion-footer>\n";
//# sourceMappingURL=setting-template.js.map

/***/ })

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