(self["webpackChunkapp"] = self["webpackChunkapp"] || []).push([["default-src_app_pages_tabs_readings_add_add_module_ts"],{

/***/ 13226:
/*!***************************************************************!*\
  !*** ./src/app/pages/tabs/readings/add/add-routing.module.ts ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AddPageRoutingModule: () => (/* binding */ AddPageRoutingModule)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ 24398);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 37580);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ 95072);
/* harmony import */ var _add_page__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.page */ 59036);
/*
 * Copyright (c) 2022. Группа компаний "СТЕК". Все права защищены. Разработчик: Чуриков Антон Алексеевич
 */




const routes = [{
  path: '',
  component: _add_page__WEBPACK_IMPORTED_MODULE_0__.AddPage
}];
let AddPageRoutingModule = class AddPageRoutingModule {};
AddPageRoutingModule = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__decorate)([(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule)({
  imports: [_angular_router__WEBPACK_IMPORTED_MODULE_3__.RouterModule.forChild(routes)],
  exports: [_angular_router__WEBPACK_IMPORTED_MODULE_3__.RouterModule]
})], AddPageRoutingModule);


/***/ }),

/***/ 44851:
/*!*******************************************************!*\
  !*** ./src/app/pages/tabs/readings/add/add.module.ts ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AddPageModule: () => (/* binding */ AddPageModule)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! tslib */ 24398);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/core */ 37580);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ 60316);
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/forms */ 34456);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ionic/angular */ 21507);
/* harmony import */ var _add_routing_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add-routing.module */ 13226);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ionic/angular */ 4059);
/* harmony import */ var _awesome_cordova_plugins_keyboard_ngx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @awesome-cordova-plugins/keyboard/ngx */ 18532);
/* harmony import */ var _add_page__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./add.page */ 59036);
/* harmony import */ var _ngx_translate_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ngx-translate/core */ 597);
/* harmony import */ var _awesome_cordova_plugins_flashlight_ngx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @awesome-cordova-plugins/flashlight/ngx */ 71587);
/* harmony import */ var _pipes_counter_number_counter_number__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../pipes/counter-number/counter-number */ 72281);
/*
 * Copyright (c) 2022. Группа компаний "СТЕК". Все права защищены. Разработчик: Чуриков Антон Алексеевич
 */












let AddPageModule = class AddPageModule {};
AddPageModule = (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__decorate)([(0,_angular_core__WEBPACK_IMPORTED_MODULE_6__.NgModule)({
  imports: [_angular_common__WEBPACK_IMPORTED_MODULE_7__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_8__.FormsModule, _ionic_angular__WEBPACK_IMPORTED_MODULE_9__.IonicModule, _add_routing_module__WEBPACK_IMPORTED_MODULE_0__.AddPageRoutingModule, _ngx_translate_core__WEBPACK_IMPORTED_MODULE_10__.TranslateModule, _pipes_counter_number_counter_number__WEBPACK_IMPORTED_MODULE_4__.CounterNumberPipe],
  declarations: [_add_page__WEBPACK_IMPORTED_MODULE_2__.AddPage],
  providers: [_ionic_angular__WEBPACK_IMPORTED_MODULE_11__.NavController, _ionic_angular__WEBPACK_IMPORTED_MODULE_11__.NavParams, _awesome_cordova_plugins_keyboard_ngx__WEBPACK_IMPORTED_MODULE_1__.Keyboard, _awesome_cordova_plugins_flashlight_ngx__WEBPACK_IMPORTED_MODULE_3__.Flashlight]
})], AddPageModule);


/***/ }),

/***/ 59036:
/*!*****************************************************!*\
  !*** ./src/app/pages/tabs/readings/add/add.page.ts ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AddPage: () => (/* binding */ AddPage)
/* harmony export */ });
/* harmony import */ var D_progr_mobileappv3_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 89204);
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! tslib */ 24398);
/* harmony import */ var _add_page_html_ngResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./add.page.html?ngResource */ 53236);
/* harmony import */ var _add_page_scss_ngResource__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./add.page.scss?ngResource */ 22532);
/* harmony import */ var _add_page_scss_ngResource__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_add_page_scss_ngResource__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/core */ 37580);
/* harmony import */ var _awesome_cordova_plugins_flashlight_ngx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @awesome-cordova-plugins/flashlight/ngx */ 71587);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @angular/router */ 95072);
/* harmony import */ var _awesome_cordova_plugins_keyboard_ngx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @awesome-cordova-plugins/keyboard/ngx */ 18532);
/* harmony import */ var _services_helper_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../services/helper.service */ 54102);
/* harmony import */ var _services_request_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../services/request.service */ 80931);
/* harmony import */ var _services_modal_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../services/modal.service */ 5455);
/* harmony import */ var _info_info_page__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../info/info.page */ 40871);
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 61318);
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs/operators */ 51567);
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs/operators */ 89475);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ionic/angular */ 21507);
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ 5342);
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs */ 59452);
/* harmony import */ var _awesome_cordova_plugins_taptic_engine_ngx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @awesome-cordova-plugins/taptic-engine/ngx */ 8287);
/* harmony import */ var _ngx_translate_core__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ngx-translate/core */ 597);

/*
 * Copyright (c) 2022. Группа компаний "СТЕК". Все права защищены. Разработчик: Чуриков Антон Алексеевич
 */
















let AddPage = class AddPage {
  constructor(activeRoute, flashlightPl, keyboard, helper, request, modalService, alertCtrl, tapticEngine, translate) {
    var _this = this;
    this.activeRoute = activeRoute;
    this.flashlightPl = flashlightPl;
    this.keyboard = keyboard;
    this.helper = helper;
    this.request = request;
    this.modalService = modalService;
    this.alertCtrl = alertCtrl;
    this.tapticEngine = tapticEngine;
    this.translate = translate;
    this.lastDate = '';
    this.flashlight = false;
    this.flashlightAvailable = false;
    this.consumption$ = (0,_angular_core__WEBPACK_IMPORTED_MODULE_10__.signal)(0);
    const counter = JSON.parse(this.activeRoute.snapshot.queryParamMap.get('counter'));
    this.ls = JSON.parse(this.activeRoute.snapshot.queryParamMap.get('ls'));
    if (!counter) {
      const counterNumber = this.activeRoute.snapshot.queryParamMap.get('counterNumber');
      Object.values(this.request.counters.value[this.request.activeLs.value]).forEach(item => {
        // @ts-ignore
        if (item.number.toString() === counterNumber.toString()) {
          this.counter = item;
        }
      });
    } else {
      this.counter = counter;
    }
    const date = this.counter.lastdate.split('.');
    const lastDate = new Date();
    lastDate.setMonth(+date[1] - 1);
    (0,D_progr_mobileappv3_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
      _this.lastDate = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this.translate.get(_this.helper.months2[lastDate.getMonth()]));
    })();
    this.flashlightPl.available().then(() => {
      this.flashlightAvailable = true;
    }).catch(() => this.flashlightAvailable = false);
  }
  onInput(event) {
    const pattern = /[0-9]/;
    let inputChar = String.fromCharCode(event.which ? event.which : event.keyCode);
    if (!pattern.test(inputChar)) {
      event.preventDefault();
      return false;
    }
    return true;
  }
  ionViewDidEnter() {
    if (this.ls.toString() !== this.request.activeLs.value.toString()) {
      this.backButton.el.click();
    }
  }
  setFocus() {
    this.input.setFocus();
  }
  ionViewWillLeave() {
    this.keyboard.hide();
    this.flashlightPl.switchOff().catch(() => {});
  }
  changeCounterValue(event, tariff) {
    document.getElementById('input-' + tariff.indicationId)["value"] = this.helper.numberFormatted(document.getElementById('input-' + tariff.indicationId)["value"], '', this.counter.capacity, this.counter.capacityFractional);
  }
  uploadReading() {
    var _this2 = this;
    return (0,D_progr_mobileappv3_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
      let tariff_list = [];
      for (const item of _this2.counter.tariff_list) {
        const value = _this2.helper.numberFormatted(document.getElementById('input-' + item.indicationId)["value"], '', _this2.counter.capacity, _this2.counter.capacityFractional);
        if (value == '') {
          _this2.alertCtrl.create({
            header: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("ERROR_STRING.ATTENTION_HEADER")),
            message: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("READINGS.ADD_PAGE.SEND_INVALID_VALUE")),
            buttons: [yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("BUTTONS.OK"))]
          }).then(alert => {
            alert.present();
          });
          return;
        }
        tariff_list.push({
          indicationId: item.indicationId,
          tarif: item.tarif,
          value: _this2.helper.numberFormatted(document.getElementById('input-' + item.indicationId)["value"], '', _this2.counter.capacity, _this2.counter.capacityFractional)
        });
      }
      const params = {
        rowId: _this2.counter.id,
        tariff_list: tariff_list,
        type: _this2.counter.type,
        date: new Date().toISOString(),
        dop: 0
      };
      _this2.request.postRequest(_this2.request.uri.countersAddPost(), params, {
        useCache: false,
        background: true
      }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.catchError)(/*#__PURE__*/function () {
        var _ref2 = (0,D_progr_mobileappv3_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (err) {
          _this2.tapticEngine.notification({
            type: 'error'
          }).catch(() => {});
          _this2.alertCtrl.create({
            header: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("ERROR_STRING.ERROR_HEADER_TEHNIK")),
            message: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("READINGS.ADD_PAGE.SEND_ERROR")),
            buttons: [yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("BUTTONS.OK"))]
          }).then(alert => {
            alert.present().then(() => {});
          });
          return (0,rxjs__WEBPACK_IMPORTED_MODULE_13__.of)(null);
        });
        return function (_x) {
          return _ref2.apply(this, arguments);
        };
      }()), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.filter)(value => value !== null)).subscribe(/*#__PURE__*/function () {
        var _ref3 = (0,D_progr_mobileappv3_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (result) {
          if (result.result) {
            _this2.modalService.openModal({
              component: _info_info_page__WEBPACK_IMPORTED_MODULE_8__.InfoPage,
              componentProps: {
                icon: 'TestimonyTransferred',
                header: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("READINGS.ADD_PAGE.SEND_SUCCESS_HEADER")),
                description: _this2.counter.name + ' ' + (yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("FOR"))) + ' ' + (yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get(_this2.helper.months2[new Date().getMonth()]))),
                taptic: 'success'
              }
            }).then(() => {});
            _this2.request.loadingCounters.next(true);
            _this2.request.getRequest(_this2.request.uri.countersGet(), {
              preloader: false,
              background: true,
              forceUpdateCache: true
            }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.finalize)(() => {
              _this2.request.loadingCounters.next(false);
            })).subscribe(data => {
              _this2.request.loadCountersCallback(data);
            });
            _this2.backButton.el.click();
          } else {
            _this2.tapticEngine.notification({
              type: 'warning'
            }).catch(() => {});
            try {
              _this2.errorMessage = result.items[0].messages[0] || (yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("READINGS.ADD_PAGE.SEND_ERROR")));
            } catch (e) {
              _this2.errorMessage = result.message || (yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this2.translate.get("READINGS.ADD_PAGE.SEND_ERROR")));
            }
          }
        });
        return function (_x2) {
          return _ref3.apply(this, arguments);
        };
      }());
    })();
  }
  deleteReading() {
    var _this3 = this;
    return (0,D_progr_mobileappv3_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
      const alert = yield _this3.alertCtrl.create({
        header: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("READINGS.ADD_PAGE.REMOVE_ALERT_HEADER")),
        subHeader: _this3.counter.name + ' №' + _this3.counter.number,
        message: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("READINGS.ADD_PAGE.REMOVE_ALERT_TEXT")),
        buttons: [{
          text: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("BUTTONS.CANCEL"))
        }, {
          text: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("BUTTONS.DELETE")),
          handler: () => {
            let indications = [];
            for (const item of _this3.counter.tariff_list) {
              indications.push({
                id: _this3.counter.id,
                key: 'counters[' + _this3.counter.id + '_' + item.tarif + '][value]',
                tariff: item.tarif,
                value: item.indicationId
              });
            }
            const body = {
              indications
            };
            _this3.request.postRequest(_this3.request.uri.countersRemovePost(), body, {
              useCache: false,
              background: true
            }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.catchError)(/*#__PURE__*/function () {
              var _ref4 = (0,D_progr_mobileappv3_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (err) {
                _this3.tapticEngine.notification({
                  type: 'error'
                }).catch(() => {});
                _this3.alertCtrl.create({
                  header: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("ERROR_STRING.ERROR_HEADER_TEHNIK")),
                  message: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("READINGS.ADD_PAGE.REMOVE_ERROR")),
                  buttons: [yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("BUTTONS.OK"))]
                }).then(alert2 => {
                  alert2.present().then(() => {});
                });
                return (0,rxjs__WEBPACK_IMPORTED_MODULE_13__.of)(null);
              });
              return function (_x3) {
                return _ref4.apply(this, arguments);
              };
            }()), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.filter)(value => value !== null)).subscribe(/*#__PURE__*/function () {
              var _ref5 = (0,D_progr_mobileappv3_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (result) {
                if (result.result) {
                  _this3.request.loadingCounters.next(true);
                  _this3.request.getRequest(_this3.request.uri.countersGet(), {
                    forceUpdateCache: true,
                    preloader: true,
                    background: true
                  }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.finalize)(() => {
                    _this3.request.loadingCounters.next(false);
                  })).subscribe(data => {
                    _this3.request.loadCountersCallback(data);
                    data.counters.forEach(counter => {
                      if (counter.id === _this3.counter.id) {
                        _this3.counter = counter;
                      }
                    });
                  });
                  _this3.modalService.openModal({
                    component: _info_info_page__WEBPACK_IMPORTED_MODULE_8__.InfoPage,
                    componentProps: {
                      icon: 'Delete',
                      header: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("READINGS.ADD_PAGE.REMOVE_SUCCESS_HEADER")),
                      description: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("READINGS.ADD_PAGE.REMOVE_SUCCESS")),
                      taptic: 'success'
                    }
                  }).then(() => {});
                } else {
                  _this3.tapticEngine.notification({
                    type: 'error'
                  }).catch(() => {});
                  _this3.alertCtrl.create({
                    header: yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("ERROR_STRING.ATTENTION_HEADER")),
                    message: result.message,
                    buttons: [yield (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.lastValueFrom)(_this3.translate.get("BUTTONS.OK"))]
                  }).then(alert2 => {
                    alert2.present().then(() => {});
                  });
                  _this3.request.loadingCounters.next(true);
                  _this3.request.getRequest(_this3.request.uri.countersGet(), {
                    forceUpdateCache: true,
                    preloader: false,
                    background: true
                  }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.finalize)(() => {
                    _this3.request.loadingCounters.next(false);
                  })).subscribe(data => {
                    _this3.request.loadCountersCallback(data);
                    data.counters.forEach(counter => {
                      if (counter.id === _this3.counter.id) {
                        _this3.counter = counter;
                      }
                    });
                  });
                }
              });
              return function (_x4) {
                return _ref5.apply(this, arguments);
              };
            }());
          }
        }]
      });
      yield alert.present();
    })();
  }
  toggleFlashlight() {
    var _this4 = this;
    return (0,D_progr_mobileappv3_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
      yield _this4.flashlightPl.toggle();
      _this4.flashlight = !_this4.flashlight;
    })();
  }
  onInputChange(event, lastValue) {
    const value = event.detail.value | 0;
    Number.isNaN(value) ? this.consumption$.set(0) : this.consumption$.set(value - lastValue);
  }
  static {
    this.ctorParameters = () => [{
      type: _angular_router__WEBPACK_IMPORTED_MODULE_16__.ActivatedRoute
    }, {
      type: _awesome_cordova_plugins_flashlight_ngx__WEBPACK_IMPORTED_MODULE_3__.Flashlight
    }, {
      type: _awesome_cordova_plugins_keyboard_ngx__WEBPACK_IMPORTED_MODULE_4__.Keyboard
    }, {
      type: _services_helper_service__WEBPACK_IMPORTED_MODULE_5__.HelperService
    }, {
      type: _services_request_service__WEBPACK_IMPORTED_MODULE_6__.RequestService
    }, {
      type: _services_modal_service__WEBPACK_IMPORTED_MODULE_7__.ModalService
    }, {
      type: _ionic_angular__WEBPACK_IMPORTED_MODULE_17__.AlertController
    }, {
      type: _awesome_cordova_plugins_taptic_engine_ngx__WEBPACK_IMPORTED_MODULE_9__.TapticEngine
    }, {
      type: _ngx_translate_core__WEBPACK_IMPORTED_MODULE_18__.TranslateService
    }];
  }
  static {
    this.propDecorators = {
      input: [{
        type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.ViewChild,
        args: ['input']
      }],
      backButton: [{
        type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.ViewChild,
        args: ['backButton']
      }],
      onInput: [{
        type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.HostListener,
        args: ['keypress', ['$event']]
      }]
    };
  }
};
AddPage = (0,tslib__WEBPACK_IMPORTED_MODULE_19__.__decorate)([(0,_angular_core__WEBPACK_IMPORTED_MODULE_10__.Component)({
  selector: 'app-add',
  template: _add_page_html_ngResource__WEBPACK_IMPORTED_MODULE_1__,
  providers: [_awesome_cordova_plugins_taptic_engine_ngx__WEBPACK_IMPORTED_MODULE_9__.TapticEngine],
  styles: [(_add_page_scss_ngResource__WEBPACK_IMPORTED_MODULE_2___default())]
})], AddPage);


/***/ }),

/***/ 22532:
/*!******************************************************************!*\
  !*** ./src/app/pages/tabs/readings/add/add.page.scss?ngResource ***!
  \******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

// Imports
var ___CSS_LOADER_API_SOURCEMAP_IMPORT___ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 53142);
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ 35950);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `@charset "UTF-8";
/*!
 * Copyright (c) 2022. Группа компаний "СТЕК". Все права защищены. Разработчик: Чуриков Антон Алексеевич
 */
.content-page {
  display: flex;
  flex-direction: column;
  transition: 0.38s;
}
.content-page .input-block {
  flex-grow: 1;
  margin-bottom: 24px;
}
.content-page .input-block .inputs-array {
  width: 100%;
}
.content-page .input-block .inputs-array ion-input {
  text-align: center;
  --padding-end: 0;
}
.content-page .input-block ion-item {
  text-align: center;
  font-size: 24px;
  font-weight: 500;
  font-family: "Roboto_Mono";
  overflow: visible;
}
.content-page .input-block ion-item p {
  position: absolute;
  font-family: "Roboto";
  top: -10px;
  left: 0;
  right: 0;
  text-align: center;
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  color: var(--font-color-secondary);
}
.content-page .input-block .error-block {
  margin-top: 16px;
  background: var(--ion-color-danger-lighten-4);
  padding: 16px;
  border-radius: 8px;
  color: var(--ion-color-danger);
  display: flex;
  line-height: 24px;
  font-size: 16px;
}
.content-page .input-block .error-block ion-icon {
  width: 24px;
  height: 24px;
  margin-right: 8px;
}
.content-page .reading-number, .content-page .reading-name {
  font-size: 12px;
  color: var(--font-color-secondary);
  text-align: center;
  margin: 0 24px;
}
.content-page .reading-name {
  font-size: 14px;
  margin-top: 64px;
}
.content-page ion-button {
  pointer-events: auto;
}
.content-page .consumption-field {
  margin-top: 0;
}`, "",{"version":3,"sources":["webpack://./src/app/pages/tabs/readings/add/add.page.scss"],"names":[],"mappings":"AAAA,gBAAgB;AAAhB;;EAAA;AAIA;EACE,aAAA;EACA,sBAAA;EAGA,iBAAA;AADF;AAIE;EACE,YAAA;EACA,mBAAA;AAFJ;AAII;EACE,WAAA;AAFN;AAGM;EACE,kBAAA;EACA,gBAAA;AADR;AAKI;EACE,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,0BAAA;EACA,iBAAA;AAHN;AAKM;EACE,kBAAA;EACA,qBAAA;EACA,UAAA;EACA,OAAA;EACA,QAAA;EACA,kBAAA;EACA,SAAA;EACA,eAAA;EACA,gBAAA;EACA,kCAAA;AAHR;AAOI;EACE,gBAAA;EACA,6CAAA;EACA,aAAA;EACA,kBAAA;EACA,8BAAA;EACA,aAAA;EACA,iBAAA;EACA,eAAA;AALN;AAOM;EACE,WAAA;EACA,YAAA;EACA,iBAAA;AALR;AAUE;EACE,eAAA;EACA,kCAAA;EACA,kBAAA;EACA,cAAA;AARJ;AAWE;EACE,eAAA;EACA,gBAAA;AATJ;AAYE;EACE,oBAAA;AAVJ;AAaE;EACE,aAAA;AAXJ","sourcesContent":["/*!\n * Copyright (c) 2022. Группа компаний \"СТЕК\". Все права защищены. Разработчик: Чуриков Антон Алексеевич\n */\n\n.content-page {\n  display: flex;\n  flex-direction: column;\n  //height: 100%;\n  //padding-bottom: 0;\n  transition: 0.38s;\n  //pointer-events: none;\n\n  .input-block {\n    flex-grow: 1;\n    margin-bottom: 24px;\n\n    .inputs-array {\n      width: 100%;\n      ion-input {\n        text-align: center;\n        --padding-end: 0;\n      }\n    }\n\n    ion-item {\n      text-align: center;\n      font-size: 24px;\n      font-weight: 500;\n      font-family: 'Roboto_Mono';\n      overflow: visible;\n\n      p {\n        position: absolute;\n        font-family: 'Roboto';\n        top: -10px;\n        left: 0;\n        right: 0;\n        text-align: center;\n        margin: 0;\n        font-size: 16px;\n        font-weight: 400;\n        color: var(--font-color-secondary);\n      }\n    }\n\n    .error-block {\n      margin-top: 16px;\n      background: var(--ion-color-danger-lighten-4);\n      padding: 16px;\n      border-radius: 8px;\n      color: var(--ion-color-danger);\n      display: flex;\n      line-height: 24px;\n      font-size: 16px;\n\n      ion-icon {\n        width: 24px;\n        height: 24px;\n        margin-right: 8px;\n      }\n    }\n  }\n\n  .reading-number, .reading-name {\n    font-size: 12px;\n    color: var(--font-color-secondary);\n    text-align: center;\n    margin: 0 24px;\n  }\n\n  .reading-name {\n    font-size: 14px;\n    margin-top: 64px;\n  }\n\n  ion-button {\n    pointer-events: auto;\n  }\n\n  .consumption-field {\n    margin-top: 0;\n  }\n}\n"],"sourceRoot":""}]);
// Exports
module.exports = ___CSS_LOADER_EXPORT___.toString();


/***/ }),

/***/ 53236:
/*!******************************************************************!*\
  !*** ./src/app/pages/tabs/readings/add/add.page.html?ngResource ***!
  \******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "<!--\n  ~ Copyright (c) 2022. Группа компаний \"СТЕК\". Все права защищены. Разработчик: Чуриков Антон Алексеевич\n  -->\n\n<ion-header class=\"ion-no-border\">\n  <ion-toolbar>\n    <ion-buttons slot=\"start\">\n      <ion-back-button #backButton text=\"\" icon=\"/assets/icons/Chevron_Left.svg\"></ion-back-button>\n    </ion-buttons>\n    <ion-title>{{counter.name}}</ion-title>\n      @if (flashlightAvailable) {\n          <ion-buttons slot=\"end\">\n              <ion-button (click)=\"toggleFlashlight()\" type=\"button\" fill=\"clear\">\n                  @if (!flashlight) {\n                      <ion-icon src=\"/assets/icons/Flashlight.svg\"/>\n                  } @else {\n                      <ion-icon src=\"/assets/icons/Flashlight_Off.svg\"/>\n                  }\n                  <ion-badge color=\"primary\"/>\n              </ion-button>\n          </ion-buttons>\n      }\n  </ion-toolbar>\n</ion-header>\n\n<ion-content force-overscroll=\"false\">\n\n  <div class=\"content-page\">\n    <div class=\"reading-number\">№ {{counter.number | guardCounterNumber}}</div>\n\n      @if (counter.readonly && counter.tariff_list.length === 1) {\n          <div class=\"reading-name\">\n              {{ 'READINGS.ADD_PAGE.LAST_READING' | translate:{value: lastDate+' — '+counter.tariff_list[0].lastvalue} }}\n          </div>\n\n      }\n\n      @if (!counter.readonly) {\n          <div class=\"reading-name\">\n              {{ 'READINGS.ADD_PAGE.LAST_READING' | translate:{value: lastDate} }}\n          </div>\n      }\n\n      @if (counter.avaliable.avaliableSend) {\n          <div class=\"reading-name consumption-field\">\n              {{ 'READINGS.ADD_PAGE.CONSUMPTION' | translate: { value: consumption$() } }}\n          </div>\n      }\n\n    <div class=\"input-block\">\n        @if (counter.avaliable.avaliableSend) {\n            <div class=\"inputs-array\">\n                @for (tariff of counter.tariff_list; track tariff) {\n                    <ion-item [ngStyle]=\"counter.tariff_list.length > 1 ? {paddingTop: '34px', textAlign: 'left'} : {}\">\n                        @if (counter.tariff_list.length > 1) {\n                            <p>{{ tariff.zone }}</p>\n                        }\n                        <ion-input [id]=\"'input-'+tariff.indicationId\" autofocus=\"false\" inputmode=\"decimal\"\n                                   placeholder=\"0\"\n                                   (ionChange)=\"changeCounterValue($event, tariff)\"\n                                   (ionInput)=\"onInputChange($event, tariff.lastvalue)\"\n                        />\n                        @if (counter.tariff_list.length > 1) {\n                            <ion-note slot=\"helper\">\n                                {{ 'READINGS.ADD_PAGE.LAST_READING_MASS' | translate:{zone: tariff.zone, value: tariff.lastvalue } }}\n                            </ion-note>\n                        }\n                    </ion-item>\n                }\n            </div>\n        } @else {\n            <div class=\"inputs-array sended\">\n                @for (tariff of counter.tariff_list; track tariff) {\n                    <ion-item [ngStyle]=\"counter.tariff_list.length > 1 ? {paddingTop: '34px', textAlign: 'left'} : {}\" lines=\"none\">\n                        @if (counter.tariff_list.length > 1) {\n                            <p>{{ tariff.zone }}</p>\n                        }\n                        <ion-input [id]=\"'input-'+tariff.indicationId\" autofocus=\"false\" inputmode=\"decimal\"\n                                   placeholder=\"0\" readonly=\"true\"\n                                   value=\"{{tariff.lastvalue}}\"\n                        ></ion-input>\n                    </ion-item>\n                }\n            </div>\n        }\n\n\n        @if (counter.avaliable.avaliableSend) {\n            <ion-button\n                type=\"button\"\n                expand=\"block\"\n                fill=\"solid\"\n                (click)=\"uploadReading()\"\n            >\n                {{ 'READINGS.ADD_PAGE.BUTTON' | translate }}\n            </ion-button>\n        } @else if (counter.avaliable.avaliableDelete) {\n            <ion-button\n                type=\"button\"\n                expand=\"block\"\n                fill=\"solid\"\n                color=\"danger\"\n                (click)=\"deleteReading()\"\n            >\n                {{ 'READINGS.ADD_PAGE.DELETE' | translate }}\n            </ion-button>\n        }\n\n      <div class=\"error-block\" [hidden]=\"!errorMessage\">\n        <div>\n          <ion-icon src=\"/assets/icons/Alert.svg\"></ion-icon>\n        </div>\n        <div>\n          {{ errorMessage }}\n        </div>\n      </div>\n    </div>\n\n  </div>\n</ion-content>\n";

/***/ })

}]);
//# sourceMappingURL=default-src_app_pages_tabs_readings_add_add_module_ts.js.map