text: (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["pages-category-category-module"],{
  
  /***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/category/category.page.html":
  /*!*****************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/category/category.page.html ***!
    \*****************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony default export */ __webpack_exports__["default"] = ("<ion-header>\n  <ion-toolbar color=\"primary\">\n    <ion-buttons slot=\"start\">\n      <ion-back-button text=\"\" mode=\"md\"></ion-back-button>\n    </ion-buttons>\n    <ion-title>{{'Categories' | translate}}</ion-title>\n    <ion-button (click)=\"addNewCat()\" fill=\"clear\" color=\"light\" slot=\"end\">\n      <ion-icon slot=\"icon-only\" name=\"add\"></ion-icon>\n    </ion-button>\n  </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n  <div class=\"mainContent\">\n    <h2 class=\"ion-text-center\" *ngIf=\"!dummy?.length && !categories?.length\">{{'No Category Found' | translate}}</h2>\n    <ion-item *ngFor=\"let item of dummy\">\n      <ion-thumbnail slot=\"start\">\n        <ion-skeleton-text animated></ion-skeleton-text>\n      </ion-thumbnail>\n      <ion-label>\n        <h3>\n          <ion-skeleton-text animated style=\"width: 50%\"></ion-skeleton-text>\n        </h3>\n        <p>\n          <ion-skeleton-text animated style=\"width: 80%\"></ion-skeleton-text>\n        </p>\n        <p>\n          <ion-skeleton-text animated style=\"width: 60%\"></ion-skeleton-text>\n        </p>\n      </ion-label>\n    </ion-item>\n    <ion-item lines=\"none\" *ngFor=\"let item of categories;\" (click)=\"edit(item)\">\n      <ion-label>{{item.name}}</ion-label>\n      <!-- <ion-icon slot=\"end\" name=\"pencil-sharp\"></ion-icon> -->\n      <img src=\"assets/imgs/edit.png\" class=\"edt_icn\">\n    </ion-item>\n  </div>\n</ion-content>");
  
  /***/ }),
  
  /***/ "./src/app/pages/category/category-routing.module.ts":
  /*!***********************************************************!*\
    !*** ./src/app/pages/category/category-routing.module.ts ***!
    \***********************************************************/
  /*! exports provided: CategoryPageRoutingModule */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CategoryPageRoutingModule", function() { return CategoryPageRoutingModule; });
  /* 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/fesm2015/core.js");
  /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm2015/router.js");
  /* harmony import */ var _category_page__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./category.page */ "./src/app/pages/category/category.page.ts");
  
  
  
  
  const routes = [
      {
          path: '',
          component: _category_page__WEBPACK_IMPORTED_MODULE_3__["CategoryPage"]
      }
  ];
  let CategoryPageRoutingModule = class CategoryPageRoutingModule {
  };
  CategoryPageRoutingModule = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
      Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
          imports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"].forChild(routes)],
          exports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"]],
      })
  ], CategoryPageRoutingModule);
  
  
  
  /***/ }),
  
  /***/ "./src/app/pages/category/category.module.ts":
  /*!***************************************************!*\
    !*** ./src/app/pages/category/category.module.ts ***!
    \***************************************************/
  /*! exports provided: CategoryPageModule */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CategoryPageModule", function() { return CategoryPageModule; });
  /* 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/fesm2015/core.js");
  /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm2015/common.js");
  /* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm2015/forms.js");
  /* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/fesm2015/ionic-angular.js");
  /* harmony import */ var _category_routing_module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./category-routing.module */ "./src/app/pages/category/category-routing.module.ts");
  /* harmony import */ var _category_page__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./category.page */ "./src/app/pages/category/category.page.ts");
  /* harmony import */ var src_app_shared_shared_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/shared/shared.module */ "./src/app/shared/shared.module.ts");
  
  
  
  
  
  
  
  
  let CategoryPageModule = class CategoryPageModule {
  };
  CategoryPageModule = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
      Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
          imports: [
              _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
              _angular_forms__WEBPACK_IMPORTED_MODULE_3__["FormsModule"],
              _ionic_angular__WEBPACK_IMPORTED_MODULE_4__["IonicModule"],
              src_app_shared_shared_module__WEBPACK_IMPORTED_MODULE_7__["SharedModule"],
              _category_routing_module__WEBPACK_IMPORTED_MODULE_5__["CategoryPageRoutingModule"]
          ],
          declarations: [_category_page__WEBPACK_IMPORTED_MODULE_6__["CategoryPage"]]
      })
  ], CategoryPageModule);
  
  
  
  /***/ }),
  
  /***/ "./src/app/pages/category/category.page.scss":
  /*!***************************************************!*\
    !*** ./src/app/pages/category/category.page.scss ***!
    \***************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony default export */ __webpack_exports__["default"] = (".edt_icn {\n  width: 20px;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9kYXZvY2hvYS9kZXYvdGlrby9lbmpveS9lbmpveV9yZXN0YXVyYW50X2FwcC9zcmMvYXBwL3BhZ2VzL2NhdGVnb3J5L2NhdGVnb3J5LnBhZ2Uuc2NzcyIsInNyYy9hcHAvcGFnZXMvY2F0ZWdvcnkvY2F0ZWdvcnkucGFnZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0ksV0FBQTtBQ0NKIiwiZmlsZSI6InNyYy9hcHAvcGFnZXMvY2F0ZWdvcnkvY2F0ZWdvcnkucGFnZS5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmVkdF9pY257XG4gICAgd2lkdGg6IDIwcHg7XG59IiwiLmVkdF9pY24ge1xuICB3aWR0aDogMjBweDtcbn0iXX0= */");
  
  /***/ }),
  
  /***/ "./src/app/pages/category/category.page.ts":
  /*!*************************************************!*\
    !*** ./src/app/pages/category/category.page.ts ***!
    \*************************************************/
  /*! exports provided: CategoryPage */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CategoryPage", function() { return CategoryPage; });
  /* 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/fesm2015/core.js");
  /* harmony import */ var src_app_services_apis_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/services/apis.service */ "./src/app/services/apis.service.ts");
  /* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/fesm2015/ionic-angular.js");
  /* harmony import */ var src_app_services_util_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/services/util.service */ "./src/app/services/util.service.ts");
  /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm2015/router.js");
  
  
  
  
  
  
  let CategoryPage = class CategoryPage {
      constructor(api, alertController, util, router) {
          this.api = api;
          this.alertController = alertController;
          this.util = util;
          this.router = router;
          this.categories = [];
          this.dummy = Array(50);
          this.getCategories();
      }
      getCategories() {
          this.api.getVenueCategories(localStorage.getItem('uid')).then((data) => {
              this.dummy = [];
              console.log(data);
              if (data) {
                  this.categories = data;
              }
          }, error => {
              console.log(error);
              this.dummy = [];
              this.util.errorToast(this.util.translate('Something went wrong'));
          }).catch(error => {
              console.log(error);
              this.dummy = [];
              this.util.errorToast(this.util.translate('Something went wrong'));
          });
      }
      ngOnInit() {
      }
      addNewCat() {
          return tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"](this, void 0, void 0, function* () {
              const alert = yield this.alertController.create({
                  header: this.util.translate('Add New!'),
                  inputs: [
                      {
                          name: 'name1',
                          type: 'text',
                          placeholder: this.util.translate('Category Name'),
                      },
                  ],
                  buttons: [
                      {
                          text: this.util.translate('Cancel'),
                          role: 'cancel',
                          cssClass: 'secondary',
                          handler: () => {
                              console.log('Confirm Cancel');
                          }
                      }, {
                          text: this.util.translate('Ok'),
                          handler: (data) => {
                              console.log('Confirm Ok', data);
                              if (data && data.name1 !== '') {
                                  console.log('add new');
                                  const ids = this.util.makeid(10);
                                  const param = {
                                      uid: localStorage.getItem('uid'),
                                      name: data.name1,
                                      id: ids
                                  };
                                  this.util.show();
                                  this.api.addVenueCategoies(localStorage.getItem('uid'), ids, param).then((data) => {
                                      this.util.hide();
                                      console.log(data);
                                      this.getCategories();
                                  }).catch(error => {
                                      this.util.hide();
                                      this.util.errorToast(this.util.translate('Something went wrong'));
                                      console.log(error);
                                  });
                              }
                          }
                      }
                  ]
              });
              yield alert.present();
              // this.router.navigate(['/add-category'])
          });
      }
      edit(item) {
          return tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"](this, void 0, void 0, function* () {
              // console.log(item);
              const alert = yield this.alertController.create({
                  header: this.util.translate('Edit'),
                  inputs: [
                      {
                          name: 'name1',
                          type: 'text',
                          placeholder: this.util.translate('Category Name'),
                          value: item.name
                      },
                  ],
                  buttons: [
                      {
                          text: this.util.translate('Cancel'),
                          role: 'cancel',
                          cssClass: 'secondary',
                          handler: () => {
                              console.log('Confirm Cancel');
                          }
                      }, {
                          text: this.util.translate('Ok'),
                          handler: (data) => {
                              console.log('Confirm Ok', data);
                              if (data && data.name1 !== '') {
                                  console.log('add new');
                                  const param = {
                                      uid: localStorage.getItem('uid'),
                                      name: data.name1,
                                      id: item.id
                                  };
                                  this.util.show();
                                  this.api.updateVenueCategoies(localStorage.getItem('uid'), item.id, param).then((data) => {
                                      this.util.hide();
                                      console.log(data);
                                      this.getCategories();
                                  }).catch(error => {
                                      this.util.hide();
                                      this.util.errorToast(this.util.translate('Something went wrong'));
                                      console.log(error);
                                  });
                              }
                          }
                      }
                  ]
              });
              yield alert.present();
          });
      }
  };
  CategoryPage.ctorParameters = () => [
      { type: src_app_services_apis_service__WEBPACK_IMPORTED_MODULE_2__["ApisService"] },
      { type: _ionic_angular__WEBPACK_IMPORTED_MODULE_3__["AlertController"] },
      { type: src_app_services_util_service__WEBPACK_IMPORTED_MODULE_4__["UtilService"] },
      { type: _angular_router__WEBPACK_IMPORTED_MODULE_5__["Router"] }
  ];
  CategoryPage = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
      Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
          selector: 'app-category',
          template: tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"](__webpack_require__(/*! raw-loader!./category.page.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/category/category.page.html")).default,
          styles: [tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"](__webpack_require__(/*! ./category.page.scss */ "./src/app/pages/category/category.page.scss")).default]
      }),
      tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"]("design:paramtypes", [src_app_services_apis_service__WEBPACK_IMPORTED_MODULE_2__["ApisService"],
          _ionic_angular__WEBPACK_IMPORTED_MODULE_3__["AlertController"],
          src_app_services_util_service__WEBPACK_IMPORTED_MODULE_4__["UtilService"],
          _angular_router__WEBPACK_IMPORTED_MODULE_5__["Router"]])
  ], CategoryPage);
  
  
  
  /***/ })
  
  }]);
  //# sourceMappingURL=pages-category-category-module-es2015.js.map